@elizaos/core 1.6.3-alpha.7 → 1.6.3-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,9 +2,9 @@ var w0=Object.create;var{getPrototypeOf:Z0,defineProperty:U4,getOwnPropertyNames
2
2
  You can add a runtime option to disable the check or this warning:
3
3
  See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`)}function xy(){Object.keys(kj).forEach(function($){delete kj[$]})}});var Gj=u$((ey)=>{ey.__esModule=!0;ey.HandlebarsEnvironment=Qz;function oA($){return $&&$.__esModule?$:{default:$}}var V_=cq(),ry=w8(),Fz=oA(ry),oy=Bz(),ny=cA(),iy=tz(),Aj=oA(iy),By=Uz(),ty="4.7.8";ey.VERSION=ty;var Uy=8;ey.COMPILER_REVISION=Uy;var Fy=7;ey.LAST_COMPATIBLE_COMPILER_REVISION=Fy;var ay={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};ey.REVISION_CHANGES=ay;var az="[object Object]";function Qz($,q,K){this.helpers=$||{},this.partials=q||{},this.decorators=K||{},oy.registerDefaultHelpers(this),ny.registerDefaultDecorators(this)}Qz.prototype={constructor:Qz,logger:Aj.default,log:Aj.default.log,registerHelper:function(q,K){if(V_.toString.call(q)===az){if(K)throw new Fz.default("Arg not supported with multiple helpers");V_.extend(this.helpers,q)}else this.helpers[q]=K},unregisterHelper:function(q){delete this.helpers[q]},registerPartial:function(q,K){if(V_.toString.call(q)===az)V_.extend(this.partials,q);else{if(typeof K>"u")throw new Fz.default('Attempting to register a partial called "'+q+'" as undefined');this.partials[q]=K}},unregisterPartial:function(q){delete this.partials[q]},registerDecorator:function(q,K){if(V_.toString.call(q)===az){if(K)throw new Fz.default("Arg not supported with multiple decorators");V_.extend(this.decorators,q)}else this.decorators[q]=K},unregisterDecorator:function(q){delete this.decorators[q]},resetLoggedPropertyAccesses:function(){By.resetLoggedProperties()}};var Qy=Aj.default.log;ey.log=Qy;ey.createFrame=V_.createFrame;ey.logger=Aj.default});var BA=u$((nA,iA)=>{nA.__esModule=!0;function ez($){this.string=$}ez.prototype.toString=ez.prototype.toHTML=function(){return""+this.string};nA.default=ez;iA.exports=nA.default});var tA=u$((Hx)=>{Hx.__esModule=!0;Hx.wrapHelper=Wx;function Wx($,q){if(typeof $!=="function")return $;var K=function(){var _=arguments[arguments.length-1];return arguments[arguments.length-1]=q(_),$.apply(this,arguments)};return K}});var eA=u$((Ex)=>{Ex.__esModule=!0;Ex.checkRevision=Ax;Ex.template=Gx;Ex.wrapProgram=Vj;Ex.resolvePartial=Vx;Ex.invokePartial=Sx;Ex.noop=aA;function wx($){return $&&$.__esModule?$:{default:$}}function Zx($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var K in $)if(Object.prototype.hasOwnProperty.call($,K))q[K]=$[K]}return q.default=$,q}}var fx=cq(),JK=Zx(fx),Xx=w8(),TK=wx(Xx),wK=Gj(),UA=Bz(),kx=tA(),FA=Uz();function Ax($){var q=$&&$[0]||1,K=wK.COMPILER_REVISION;if(q>=wK.LAST_COMPATIBLE_COMPILER_REVISION&&q<=wK.COMPILER_REVISION)return;if(q<wK.LAST_COMPATIBLE_COMPILER_REVISION){var P=wK.REVISION_CHANGES[K],_=wK.REVISION_CHANGES[q];throw new TK.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+P+") or downgrade your runtime to an older version ("+_+").")}else throw new TK.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+$[1]+").")}function Gx($,q){if(!q)throw new TK.default("No environment passed to template");if(!$||!$.main)throw new TK.default("Unknown template object: "+typeof $);$.main.decorator=$.main_d,q.VM.checkRevision($.compiler);var K=$.compiler&&$.compiler[0]===7;function P(j,z,J){if(J.hash){if(z=JK.extend({},z,J.hash),J.ids)J.ids[0]=!0}j=q.VM.resolvePartial.call(this,j,z,J);var w=JK.extend({},J,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),k=q.VM.invokePartial.call(this,j,z,w);if(k==null&&q.compile)J.partials[J.name]=q.compile(j,$.compilerOptions,q),k=J.partials[J.name](z,w);if(k!=null){if(J.indent){var X=k.split(`
4
4
  `);for(var G=0,V=X.length;G<V;G++){if(!X[G]&&G+1===V)break;X[G]=J.indent+X[G]}k=X.join(`
5
- `)}return k}else throw new TK.default("The partial "+J.name+" could not be compiled when running in runtime-only mode")}var _={strict:function(z,J,w){if(!z||!(J in z))throw new TK.default('"'+J+'" not defined in '+z,{loc:w});return _.lookupProperty(z,J)},lookupProperty:function(z,J){var w=z[J];if(w==null)return w;if(Object.prototype.hasOwnProperty.call(z,J))return w;if(FA.resultIsAllowed(w,_.protoAccessControl,J))return w;return},lookup:function(z,J){var w=z.length;for(var k=0;k<w;k++){var X=z[k]&&_.lookupProperty(z[k],J);if(X!=null)return z[k][J]}},lambda:function(z,J){return typeof z==="function"?z.call(J):z},escapeExpression:JK.escapeExpression,invokePartial:P,fn:function(z){var J=$[z];return J.decorator=$[z+"_d"],J},programs:[],program:function(z,J,w,k,X){var G=this.programs[z],V=this.fn(z);if(J||X||k||w)G=Vj(this,z,V,J,w,k,X);else if(!G)G=this.programs[z]=Vj(this,z,V);return G},data:function(z,J){while(z&&J--)z=z._parent;return z},mergeIfNeeded:function(z,J){var w=z||J;if(z&&J&&z!==J)w=JK.extend({},J,z);return w},nullContext:Object.seal({}),noop:q.VM.noop,compilerInfo:$.compiler};function O(j){var z=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],J=z.data;if(O._setup(z),!z.partial&&$.useData)J=Mx(j,J);var w=void 0,k=$.useBlockParams?[]:void 0;if($.useDepths)if(z.depths)w=j!=z.depths[0]?[j].concat(z.depths):z.depths;else w=[j];function X(G){return""+$.main(_,G,_.helpers,_.partials,J,k,w)}return X=QA($.main,X,_,z.depths||[],J,k),X(j,z)}return O.isTop=!0,O._setup=function(j){if(!j.partial){var z=JK.extend({},q.helpers,j.helpers);if(Nx(z,_),_.helpers=z,$.usePartial)_.partials=_.mergeIfNeeded(j.partials,q.partials);if($.usePartial||$.useDecorators)_.decorators=JK.extend({},q.decorators,j.decorators);_.hooks={},_.protoAccessControl=FA.createProtoAccessControl(j);var J=j.allowCallsToHelperMissing||K;UA.moveHelperToHooks(_,"helperMissing",J),UA.moveHelperToHooks(_,"blockHelperMissing",J)}else _.protoAccessControl=j.protoAccessControl,_.helpers=j.helpers,_.partials=j.partials,_.decorators=j.decorators,_.hooks=j.hooks},O._child=function(j,z,J,w){if($.useBlockParams&&!J)throw new TK.default("must pass block params");if($.useDepths&&!w)throw new TK.default("must pass parent depths");return Vj(_,j,$[j],z,0,J,w)},O}function Vj($,q,K,P,_,O,j){function z(J){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],k=j;if(j&&J!=j[0]&&!(J===$.nullContext&&j[0]===null))k=[J].concat(j);return K($,J,$.helpers,$.partials,w.data||P,O&&[w.blockParams].concat(O),k)}return z=QA(K,z,$,j,P,O),z.program=q,z.depth=j?j.length:0,z.blockParams=_||0,z}function Vx($,q,K){if(!$)if(K.name==="@partial-block")$=K.data["partial-block"];else $=K.partials[K.name];else if(!$.call&&!K.name)K.name=$,$=K.partials[$];return $}function Sx($,q,K){var P=K.data&&K.data["partial-block"];if(K.partial=!0,K.ids)K.data.contextPath=K.ids[0]||K.data.contextPath;var _=void 0;if(K.fn&&K.fn!==aA)(function(){K.data=wK.createFrame(K.data);var O=K.fn;if(_=K.data["partial-block"]=function(z){var J=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return J.data=wK.createFrame(J.data),J.data["partial-block"]=P,O(z,J)},O.partials)K.partials=JK.extend({},K.partials,O.partials)})();if($===void 0&&_)$=_;if($===void 0)throw new TK.default("The partial "+K.name+" could not be found");else if($ instanceof Function)return $(q,K)}function aA(){return""}function Mx($,q){if(!q||!("root"in q))q=q?wK.createFrame(q):{},q.root=$;return q}function QA($,q,K,P,_,O){if($.decorator){var j={};q=$.decorator(q,j,K,P&&P[0],_,O,P),JK.extend(q,j)}return q}function Nx($,q){Object.keys($).forEach(function(K){var P=$[K];$[K]=Cx(P,q)})}function Cx($,q){var K=q.lookupProperty;return kx.wrapHelper($,function(P){return JK.extend({lookupProperty:K},P)})}});var sz=u$((sA,$G)=>{sA.__esModule=!0;sA.default=function($){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var q=globalThis.Handlebars;$.noConflict=function(){if(globalThis.Handlebars===$)globalThis.Handlebars=q;return $}};$G.exports=sA.default});var OG=u$((PG,jG)=>{PG.__esModule=!0;function qW($){return $&&$.__esModule?$:{default:$}}function KW($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var K in $)if(Object.prototype.hasOwnProperty.call($,K))q[K]=$[K]}return q.default=$,q}}var xx=Gj(),qG=KW(xx),cx=BA(),px=qW(cx),mx=w8(),dx=qW(mx),lx=cq(),$W=KW(lx),rx=eA(),KG=KW(rx),ox=sz(),nx=qW(ox);function _G(){var $=new qG.HandlebarsEnvironment;return $W.extend($,qG),$.SafeString=px.default,$.Exception=dx.default,$.Utils=$W,$.escapeExpression=$W.escapeExpression,$.VM=KG,$.template=function(q){return KG.template(q,$)},$}var V7=_G();V7.create=_G;nx.default(V7);V7.default=V7;PG.default=V7;jG.exports=PG.default});var _W=u$((vG,zG)=>{vG.__esModule=!0;var YG={helpers:{helperExpression:function(q){return q.type==="SubExpression"||(q.type==="MustacheStatement"||q.type==="BlockStatement")&&!!(q.params&&q.params.length||q.hash)},scopedId:function(q){return/^\.|this\b/.test(q.original)},simpleId:function(q){return q.parts.length===1&&!YG.helpers.scopedId(q)&&!q.depth}}};vG.default=YG;zG.exports=vG.default});var JG=u$((WG,HG)=>{WG.__esModule=!0;var Fx=function(){var $={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(_,O,j,z,J,w,k){var X=w.length-1;switch(J){case 1:return w[X-1];case 2:this.$=z.prepareProgram(w[X]);break;case 3:this.$=w[X];break;case 4:this.$=w[X];break;case 5:this.$=w[X];break;case 6:this.$=w[X];break;case 7:this.$=w[X];break;case 8:this.$=w[X];break;case 9:this.$={type:"CommentStatement",value:z.stripComment(w[X]),strip:z.stripFlags(w[X],w[X]),loc:z.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:w[X],value:w[X],loc:z.locInfo(this._$)};break;case 11:this.$=z.prepareRawBlock(w[X-2],w[X-1],w[X],this._$);break;case 12:this.$={path:w[X-3],params:w[X-2],hash:w[X-1]};break;case 13:this.$=z.prepareBlock(w[X-3],w[X-2],w[X-1],w[X],!1,this._$);break;case 14:this.$=z.prepareBlock(w[X-3],w[X-2],w[X-1],w[X],!0,this._$);break;case 15:this.$={open:w[X-5],path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 16:this.$={path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 17:this.$={path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 18:this.$={strip:z.stripFlags(w[X-1],w[X-1]),program:w[X]};break;case 19:var G=z.prepareBlock(w[X-2],w[X-1],w[X],w[X],!1,this._$),V=z.prepareProgram([G],w[X-1].loc);V.chained=!0,this.$={strip:w[X-2].strip,program:V,chain:!0};break;case 20:this.$=w[X];break;case 21:this.$={path:w[X-1],strip:z.stripFlags(w[X-2],w[X])};break;case 22:this.$=z.prepareMustache(w[X-3],w[X-2],w[X-1],w[X-4],z.stripFlags(w[X-4],w[X]),this._$);break;case 23:this.$=z.prepareMustache(w[X-3],w[X-2],w[X-1],w[X-4],z.stripFlags(w[X-4],w[X]),this._$);break;case 24:this.$={type:"PartialStatement",name:w[X-3],params:w[X-2],hash:w[X-1],indent:"",strip:z.stripFlags(w[X-4],w[X]),loc:z.locInfo(this._$)};break;case 25:this.$=z.preparePartialBlock(w[X-2],w[X-1],w[X],this._$);break;case 26:this.$={path:w[X-3],params:w[X-2],hash:w[X-1],strip:z.stripFlags(w[X-4],w[X])};break;case 27:this.$=w[X];break;case 28:this.$=w[X];break;case 29:this.$={type:"SubExpression",path:w[X-3],params:w[X-2],hash:w[X-1],loc:z.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:w[X],loc:z.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:z.id(w[X-2]),value:w[X],loc:z.locInfo(this._$)};break;case 32:this.$=z.id(w[X-1]);break;case 33:this.$=w[X];break;case 34:this.$=w[X];break;case 35:this.$={type:"StringLiteral",value:w[X],original:w[X],loc:z.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(w[X]),original:Number(w[X]),loc:z.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:w[X]==="true",original:w[X]==="true",loc:z.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:z.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:z.locInfo(this._$)};break;case 40:this.$=w[X];break;case 41:this.$=w[X];break;case 42:this.$=z.preparePath(!0,w[X],this._$);break;case 43:this.$=z.preparePath(!1,w[X],this._$);break;case 44:w[X-2].push({part:z.id(w[X]),original:w[X],separator:w[X-1]}),this.$=w[X-2];break;case 45:this.$=[{part:z.id(w[X]),original:w[X]}];break;case 46:this.$=[];break;case 47:w[X-1].push(w[X]);break;case 48:this.$=[];break;case 49:w[X-1].push(w[X]);break;case 50:this.$=[];break;case 51:w[X-1].push(w[X]);break;case 58:this.$=[];break;case 59:w[X-1].push(w[X]);break;case 64:this.$=[];break;case 65:w[X-1].push(w[X]);break;case 70:this.$=[];break;case 71:w[X-1].push(w[X]);break;case 78:this.$=[];break;case 79:w[X-1].push(w[X]);break;case 82:this.$=[];break;case 83:w[X-1].push(w[X]);break;case 86:this.$=[];break;case 87:w[X-1].push(w[X]);break;case 90:this.$=[];break;case 91:w[X-1].push(w[X]);break;case 94:this.$=[];break;case 95:w[X-1].push(w[X]);break;case 98:this.$=[w[X]];break;case 99:w[X-1].push(w[X]);break;case 100:this.$=[w[X]];break;case 101:w[X-1].push(w[X]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(_,O){throw Error(_)},parse:function(_){var O=this,j=[0],z=[null],J=[],w=this.table,k="",X=0,G=0,V=0,C=2,E=1;if(this.lexer.setInput(_),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u")this.lexer.yylloc={};var h=this.lexer.yylloc;J.push(h);var I=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function D(W){j.length=j.length-2*W,z.length=z.length-W,J.length=J.length-W}function g(){var W=O.lexer.lex()||1;if(typeof W!=="number")W=O.symbols_[W]||W;return W}var u,y,p,m,s,U,l={},o,M,Y,H;while(!0){if(p=j[j.length-1],this.defaultActions[p])m=this.defaultActions[p];else{if(u===null||typeof u>"u")u=g();m=w[p]&&w[p][u]}if(typeof m>"u"||!m.length||!m[0]){var T="";if(!V){H=[];for(o in w[p])if(this.terminals_[o]&&o>2)H.push("'"+this.terminals_[o]+"'");if(this.lexer.showPosition)T="Parse error on line "+(X+1)+`:
5
+ `)}return k}else throw new TK.default("The partial "+J.name+" could not be compiled when running in runtime-only mode")}var _={strict:function(z,J,w){if(!z||!(J in z))throw new TK.default('"'+J+'" not defined in '+z,{loc:w});return _.lookupProperty(z,J)},lookupProperty:function(z,J){var w=z[J];if(w==null)return w;if(Object.prototype.hasOwnProperty.call(z,J))return w;if(FA.resultIsAllowed(w,_.protoAccessControl,J))return w;return},lookup:function(z,J){var w=z.length;for(var k=0;k<w;k++){var X=z[k]&&_.lookupProperty(z[k],J);if(X!=null)return z[k][J]}},lambda:function(z,J){return typeof z==="function"?z.call(J):z},escapeExpression:JK.escapeExpression,invokePartial:P,fn:function(z){var J=$[z];return J.decorator=$[z+"_d"],J},programs:[],program:function(z,J,w,k,X){var G=this.programs[z],V=this.fn(z);if(J||X||k||w)G=Vj(this,z,V,J,w,k,X);else if(!G)G=this.programs[z]=Vj(this,z,V);return G},data:function(z,J){while(z&&J--)z=z._parent;return z},mergeIfNeeded:function(z,J){var w=z||J;if(z&&J&&z!==J)w=JK.extend({},J,z);return w},nullContext:Object.seal({}),noop:q.VM.noop,compilerInfo:$.compiler};function O(j){var z=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],J=z.data;if(O._setup(z),!z.partial&&$.useData)J=Mx(j,J);var w=void 0,k=$.useBlockParams?[]:void 0;if($.useDepths)if(z.depths)w=j!=z.depths[0]?[j].concat(z.depths):z.depths;else w=[j];function X(G){return""+$.main(_,G,_.helpers,_.partials,J,k,w)}return X=QA($.main,X,_,z.depths||[],J,k),X(j,z)}return O.isTop=!0,O._setup=function(j){if(!j.partial){var z=JK.extend({},q.helpers,j.helpers);if(Nx(z,_),_.helpers=z,$.usePartial)_.partials=_.mergeIfNeeded(j.partials,q.partials);if($.usePartial||$.useDecorators)_.decorators=JK.extend({},q.decorators,j.decorators);_.hooks={},_.protoAccessControl=FA.createProtoAccessControl(j);var J=j.allowCallsToHelperMissing||K;UA.moveHelperToHooks(_,"helperMissing",J),UA.moveHelperToHooks(_,"blockHelperMissing",J)}else _.protoAccessControl=j.protoAccessControl,_.helpers=j.helpers,_.partials=j.partials,_.decorators=j.decorators,_.hooks=j.hooks},O._child=function(j,z,J,w){if($.useBlockParams&&!J)throw new TK.default("must pass block params");if($.useDepths&&!w)throw new TK.default("must pass parent depths");return Vj(_,j,$[j],z,0,J,w)},O}function Vj($,q,K,P,_,O,j){function z(J){var w=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],k=j;if(j&&J!=j[0]&&!(J===$.nullContext&&j[0]===null))k=[J].concat(j);return K($,J,$.helpers,$.partials,w.data||P,O&&[w.blockParams].concat(O),k)}return z=QA(K,z,$,j,P,O),z.program=q,z.depth=j?j.length:0,z.blockParams=_||0,z}function Vx($,q,K){if(!$)if(K.name==="@partial-block")$=K.data["partial-block"];else $=K.partials[K.name];else if(!$.call&&!K.name)K.name=$,$=K.partials[$];return $}function Sx($,q,K){var P=K.data&&K.data["partial-block"];if(K.partial=!0,K.ids)K.data.contextPath=K.ids[0]||K.data.contextPath;var _=void 0;if(K.fn&&K.fn!==aA)(function(){K.data=wK.createFrame(K.data);var O=K.fn;if(_=K.data["partial-block"]=function(z){var J=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return J.data=wK.createFrame(J.data),J.data["partial-block"]=P,O(z,J)},O.partials)K.partials=JK.extend({},K.partials,O.partials)})();if($===void 0&&_)$=_;if($===void 0)throw new TK.default("The partial "+K.name+" could not be found");else if($ instanceof Function)return $(q,K)}function aA(){return""}function Mx($,q){if(!q||!("root"in q))q=q?wK.createFrame(q):{},q.root=$;return q}function QA($,q,K,P,_,O){if($.decorator){var j={};q=$.decorator(q,j,K,P&&P[0],_,O,P),JK.extend(q,j)}return q}function Nx($,q){Object.keys($).forEach(function(K){var P=$[K];$[K]=Cx(P,q)})}function Cx($,q){var K=q.lookupProperty;return kx.wrapHelper($,function(P){return JK.extend({lookupProperty:K},P)})}});var sz=u$((sA,$G)=>{sA.__esModule=!0;sA.default=function($){(function(){if(typeof globalThis==="object")return;Object.prototype.__defineGetter__("__magic__",function(){return this}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__})();var q=globalThis.Handlebars;$.noConflict=function(){if(globalThis.Handlebars===$)globalThis.Handlebars=q;return $}};$G.exports=sA.default});var OG=u$((PG,jG)=>{PG.__esModule=!0;function qW($){return $&&$.__esModule?$:{default:$}}function KW($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var K in $)if(Object.prototype.hasOwnProperty.call($,K))q[K]=$[K]}return q.default=$,q}}var xx=Gj(),qG=KW(xx),cx=BA(),px=qW(cx),mx=w8(),dx=qW(mx),lx=cq(),$W=KW(lx),rx=eA(),KG=KW(rx),ox=sz(),nx=qW(ox);function _G(){var $=new qG.HandlebarsEnvironment;return $W.extend($,qG),$.SafeString=px.default,$.Exception=dx.default,$.Utils=$W,$.escapeExpression=$W.escapeExpression,$.VM=KG,$.template=function(q){return KG.template(q,$)},$}var V7=_G();V7.create=_G;nx.default(V7);V7.default=V7;PG.default=V7;jG.exports=PG.default});var _W=u$((vG,zG)=>{vG.__esModule=!0;var YG={helpers:{helperExpression:function(q){return q.type==="SubExpression"||(q.type==="MustacheStatement"||q.type==="BlockStatement")&&!!(q.params&&q.params.length||q.hash)},scopedId:function(q){return/^\.|this\b/.test(q.original)},simpleId:function(q){return q.parts.length===1&&!YG.helpers.scopedId(q)&&!q.depth}}};vG.default=YG;zG.exports=vG.default});var JG=u$((WG,HG)=>{WG.__esModule=!0;var Fx=function(){var $={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,partialBlock:12,content:13,COMMENT:14,CONTENT:15,openRawBlock:16,rawBlock_repetition0:17,END_RAW_BLOCK:18,OPEN_RAW_BLOCK:19,helperName:20,openRawBlock_repetition0:21,openRawBlock_option0:22,CLOSE_RAW_BLOCK:23,openBlock:24,block_option0:25,closeBlock:26,openInverse:27,block_option1:28,OPEN_BLOCK:29,openBlock_repetition0:30,openBlock_option0:31,openBlock_option1:32,CLOSE:33,OPEN_INVERSE:34,openInverse_repetition0:35,openInverse_option0:36,openInverse_option1:37,openInverseChain:38,OPEN_INVERSE_CHAIN:39,openInverseChain_repetition0:40,openInverseChain_option0:41,openInverseChain_option1:42,inverseAndProgram:43,INVERSE:44,inverseChain:45,inverseChain_option0:46,OPEN_ENDBLOCK:47,OPEN:48,mustache_repetition0:49,mustache_option0:50,OPEN_UNESCAPED:51,mustache_repetition1:52,mustache_option1:53,CLOSE_UNESCAPED:54,OPEN_PARTIAL:55,partialName:56,partial_repetition0:57,partial_option0:58,openPartialBlock:59,OPEN_PARTIAL_BLOCK:60,openPartialBlock_repetition0:61,openPartialBlock_option0:62,param:63,sexpr:64,OPEN_SEXPR:65,sexpr_repetition0:66,sexpr_option0:67,CLOSE_SEXPR:68,hash:69,hash_repetition_plus0:70,hashSegment:71,ID:72,EQUALS:73,blockParams:74,OPEN_BLOCK_PARAMS:75,blockParams_repetition_plus0:76,CLOSE_BLOCK_PARAMS:77,path:78,dataName:79,STRING:80,NUMBER:81,BOOLEAN:82,UNDEFINED:83,NULL:84,DATA:85,pathSegments:86,SEP:87,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"COMMENT",15:"CONTENT",18:"END_RAW_BLOCK",19:"OPEN_RAW_BLOCK",23:"CLOSE_RAW_BLOCK",29:"OPEN_BLOCK",33:"CLOSE",34:"OPEN_INVERSE",39:"OPEN_INVERSE_CHAIN",44:"INVERSE",47:"OPEN_ENDBLOCK",48:"OPEN",51:"OPEN_UNESCAPED",54:"CLOSE_UNESCAPED",55:"OPEN_PARTIAL",60:"OPEN_PARTIAL_BLOCK",65:"OPEN_SEXPR",68:"CLOSE_SEXPR",72:"ID",73:"EQUALS",75:"OPEN_BLOCK_PARAMS",77:"CLOSE_BLOCK_PARAMS",80:"STRING",81:"NUMBER",82:"BOOLEAN",83:"UNDEFINED",84:"NULL",85:"DATA",87:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[13,1],[10,3],[16,5],[9,4],[9,4],[24,6],[27,6],[38,6],[43,2],[45,3],[45,1],[26,3],[8,5],[8,5],[11,5],[12,3],[59,5],[63,1],[63,1],[64,5],[69,1],[71,3],[74,3],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[20,1],[56,1],[56,1],[79,2],[78,1],[86,3],[86,1],[6,0],[6,2],[17,0],[17,2],[21,0],[21,2],[22,0],[22,1],[25,0],[25,1],[28,0],[28,1],[30,0],[30,2],[31,0],[31,1],[32,0],[32,1],[35,0],[35,2],[36,0],[36,1],[37,0],[37,1],[40,0],[40,2],[41,0],[41,1],[42,0],[42,1],[46,0],[46,1],[49,0],[49,2],[50,0],[50,1],[52,0],[52,2],[53,0],[53,1],[57,0],[57,2],[58,0],[58,1],[61,0],[61,2],[62,0],[62,1],[66,0],[66,2],[67,0],[67,1],[70,1],[70,2],[76,1],[76,2]],performAction:function(_,O,j,z,J,w,k){var X=w.length-1;switch(J){case 1:return w[X-1];case 2:this.$=z.prepareProgram(w[X]);break;case 3:this.$=w[X];break;case 4:this.$=w[X];break;case 5:this.$=w[X];break;case 6:this.$=w[X];break;case 7:this.$=w[X];break;case 8:this.$=w[X];break;case 9:this.$={type:"CommentStatement",value:z.stripComment(w[X]),strip:z.stripFlags(w[X],w[X]),loc:z.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:w[X],value:w[X],loc:z.locInfo(this._$)};break;case 11:this.$=z.prepareRawBlock(w[X-2],w[X-1],w[X],this._$);break;case 12:this.$={path:w[X-3],params:w[X-2],hash:w[X-1]};break;case 13:this.$=z.prepareBlock(w[X-3],w[X-2],w[X-1],w[X],!1,this._$);break;case 14:this.$=z.prepareBlock(w[X-3],w[X-2],w[X-1],w[X],!0,this._$);break;case 15:this.$={open:w[X-5],path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 16:this.$={path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 17:this.$={path:w[X-4],params:w[X-3],hash:w[X-2],blockParams:w[X-1],strip:z.stripFlags(w[X-5],w[X])};break;case 18:this.$={strip:z.stripFlags(w[X-1],w[X-1]),program:w[X]};break;case 19:var G=z.prepareBlock(w[X-2],w[X-1],w[X],w[X],!1,this._$),V=z.prepareProgram([G],w[X-1].loc);V.chained=!0,this.$={strip:w[X-2].strip,program:V,chain:!0};break;case 20:this.$=w[X];break;case 21:this.$={path:w[X-1],strip:z.stripFlags(w[X-2],w[X])};break;case 22:this.$=z.prepareMustache(w[X-3],w[X-2],w[X-1],w[X-4],z.stripFlags(w[X-4],w[X]),this._$);break;case 23:this.$=z.prepareMustache(w[X-3],w[X-2],w[X-1],w[X-4],z.stripFlags(w[X-4],w[X]),this._$);break;case 24:this.$={type:"PartialStatement",name:w[X-3],params:w[X-2],hash:w[X-1],indent:"",strip:z.stripFlags(w[X-4],w[X]),loc:z.locInfo(this._$)};break;case 25:this.$=z.preparePartialBlock(w[X-2],w[X-1],w[X],this._$);break;case 26:this.$={path:w[X-3],params:w[X-2],hash:w[X-1],strip:z.stripFlags(w[X-4],w[X])};break;case 27:this.$=w[X];break;case 28:this.$=w[X];break;case 29:this.$={type:"SubExpression",path:w[X-3],params:w[X-2],hash:w[X-1],loc:z.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:w[X],loc:z.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:z.id(w[X-2]),value:w[X],loc:z.locInfo(this._$)};break;case 32:this.$=z.id(w[X-1]);break;case 33:this.$=w[X];break;case 34:this.$=w[X];break;case 35:this.$={type:"StringLiteral",value:w[X],original:w[X],loc:z.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(w[X]),original:Number(w[X]),loc:z.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:w[X]==="true",original:w[X]==="true",loc:z.locInfo(this._$)};break;case 38:this.$={type:"UndefinedLiteral",original:void 0,value:void 0,loc:z.locInfo(this._$)};break;case 39:this.$={type:"NullLiteral",original:null,value:null,loc:z.locInfo(this._$)};break;case 40:this.$=w[X];break;case 41:this.$=w[X];break;case 42:this.$=z.preparePath(!0,w[X],this._$);break;case 43:this.$=z.preparePath(!1,w[X],this._$);break;case 44:w[X-2].push({part:z.id(w[X]),original:w[X],separator:w[X-1]}),this.$=w[X-2];break;case 45:this.$=[{part:z.id(w[X]),original:w[X]}];break;case 46:this.$=[];break;case 47:w[X-1].push(w[X]);break;case 48:this.$=[];break;case 49:w[X-1].push(w[X]);break;case 50:this.$=[];break;case 51:w[X-1].push(w[X]);break;case 58:this.$=[];break;case 59:w[X-1].push(w[X]);break;case 64:this.$=[];break;case 65:w[X-1].push(w[X]);break;case 70:this.$=[];break;case 71:w[X-1].push(w[X]);break;case 78:this.$=[];break;case 79:w[X-1].push(w[X]);break;case 82:this.$=[];break;case 83:w[X-1].push(w[X]);break;case 86:this.$=[];break;case 87:w[X-1].push(w[X]);break;case 90:this.$=[];break;case 91:w[X-1].push(w[X]);break;case 94:this.$=[];break;case 95:w[X-1].push(w[X]);break;case 98:this.$=[w[X]];break;case 99:w[X-1].push(w[X]);break;case 100:this.$=[w[X]];break;case 101:w[X-1].push(w[X]);break}},table:[{3:1,4:2,5:[2,46],6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:10,13:11,14:[1,12],15:[1,20],16:17,19:[1,23],24:15,27:16,29:[1,21],34:[1,22],39:[2,2],44:[2,2],47:[2,2],48:[1,13],51:[1,14],55:[1,18],59:19,60:[1,24]},{1:[2,1]},{5:[2,47],14:[2,47],15:[2,47],19:[2,47],29:[2,47],34:[2,47],39:[2,47],44:[2,47],47:[2,47],48:[2,47],51:[2,47],55:[2,47],60:[2,47]},{5:[2,3],14:[2,3],15:[2,3],19:[2,3],29:[2,3],34:[2,3],39:[2,3],44:[2,3],47:[2,3],48:[2,3],51:[2,3],55:[2,3],60:[2,3]},{5:[2,4],14:[2,4],15:[2,4],19:[2,4],29:[2,4],34:[2,4],39:[2,4],44:[2,4],47:[2,4],48:[2,4],51:[2,4],55:[2,4],60:[2,4]},{5:[2,5],14:[2,5],15:[2,5],19:[2,5],29:[2,5],34:[2,5],39:[2,5],44:[2,5],47:[2,5],48:[2,5],51:[2,5],55:[2,5],60:[2,5]},{5:[2,6],14:[2,6],15:[2,6],19:[2,6],29:[2,6],34:[2,6],39:[2,6],44:[2,6],47:[2,6],48:[2,6],51:[2,6],55:[2,6],60:[2,6]},{5:[2,7],14:[2,7],15:[2,7],19:[2,7],29:[2,7],34:[2,7],39:[2,7],44:[2,7],47:[2,7],48:[2,7],51:[2,7],55:[2,7],60:[2,7]},{5:[2,8],14:[2,8],15:[2,8],19:[2,8],29:[2,8],34:[2,8],39:[2,8],44:[2,8],47:[2,8],48:[2,8],51:[2,8],55:[2,8],60:[2,8]},{5:[2,9],14:[2,9],15:[2,9],19:[2,9],29:[2,9],34:[2,9],39:[2,9],44:[2,9],47:[2,9],48:[2,9],51:[2,9],55:[2,9],60:[2,9]},{20:25,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:36,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:37,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{4:38,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{15:[2,48],17:39,18:[2,48]},{20:41,56:40,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:44,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{5:[2,10],14:[2,10],15:[2,10],18:[2,10],19:[2,10],29:[2,10],34:[2,10],39:[2,10],44:[2,10],47:[2,10],48:[2,10],51:[2,10],55:[2,10],60:[2,10]},{20:45,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:46,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:47,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:41,56:48,64:42,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[2,78],49:49,65:[2,78],72:[2,78],80:[2,78],81:[2,78],82:[2,78],83:[2,78],84:[2,78],85:[2,78]},{23:[2,33],33:[2,33],54:[2,33],65:[2,33],68:[2,33],72:[2,33],75:[2,33],80:[2,33],81:[2,33],82:[2,33],83:[2,33],84:[2,33],85:[2,33]},{23:[2,34],33:[2,34],54:[2,34],65:[2,34],68:[2,34],72:[2,34],75:[2,34],80:[2,34],81:[2,34],82:[2,34],83:[2,34],84:[2,34],85:[2,34]},{23:[2,35],33:[2,35],54:[2,35],65:[2,35],68:[2,35],72:[2,35],75:[2,35],80:[2,35],81:[2,35],82:[2,35],83:[2,35],84:[2,35],85:[2,35]},{23:[2,36],33:[2,36],54:[2,36],65:[2,36],68:[2,36],72:[2,36],75:[2,36],80:[2,36],81:[2,36],82:[2,36],83:[2,36],84:[2,36],85:[2,36]},{23:[2,37],33:[2,37],54:[2,37],65:[2,37],68:[2,37],72:[2,37],75:[2,37],80:[2,37],81:[2,37],82:[2,37],83:[2,37],84:[2,37],85:[2,37]},{23:[2,38],33:[2,38],54:[2,38],65:[2,38],68:[2,38],72:[2,38],75:[2,38],80:[2,38],81:[2,38],82:[2,38],83:[2,38],84:[2,38],85:[2,38]},{23:[2,39],33:[2,39],54:[2,39],65:[2,39],68:[2,39],72:[2,39],75:[2,39],80:[2,39],81:[2,39],82:[2,39],83:[2,39],84:[2,39],85:[2,39]},{23:[2,43],33:[2,43],54:[2,43],65:[2,43],68:[2,43],72:[2,43],75:[2,43],80:[2,43],81:[2,43],82:[2,43],83:[2,43],84:[2,43],85:[2,43],87:[1,50]},{72:[1,35],86:51},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{52:52,54:[2,82],65:[2,82],72:[2,82],80:[2,82],81:[2,82],82:[2,82],83:[2,82],84:[2,82],85:[2,82]},{25:53,38:55,39:[1,57],43:56,44:[1,58],45:54,47:[2,54]},{28:59,43:60,44:[1,58],47:[2,56]},{13:62,15:[1,20],18:[1,61]},{33:[2,86],57:63,65:[2,86],72:[2,86],80:[2,86],81:[2,86],82:[2,86],83:[2,86],84:[2,86],85:[2,86]},{33:[2,40],65:[2,40],72:[2,40],80:[2,40],81:[2,40],82:[2,40],83:[2,40],84:[2,40],85:[2,40]},{33:[2,41],65:[2,41],72:[2,41],80:[2,41],81:[2,41],82:[2,41],83:[2,41],84:[2,41],85:[2,41]},{20:64,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:65,47:[1,66]},{30:67,33:[2,58],65:[2,58],72:[2,58],75:[2,58],80:[2,58],81:[2,58],82:[2,58],83:[2,58],84:[2,58],85:[2,58]},{33:[2,64],35:68,65:[2,64],72:[2,64],75:[2,64],80:[2,64],81:[2,64],82:[2,64],83:[2,64],84:[2,64],85:[2,64]},{21:69,23:[2,50],65:[2,50],72:[2,50],80:[2,50],81:[2,50],82:[2,50],83:[2,50],84:[2,50],85:[2,50]},{33:[2,90],61:70,65:[2,90],72:[2,90],80:[2,90],81:[2,90],82:[2,90],83:[2,90],84:[2,90],85:[2,90]},{20:74,33:[2,80],50:71,63:72,64:75,65:[1,43],69:73,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{72:[1,79]},{23:[2,42],33:[2,42],54:[2,42],65:[2,42],68:[2,42],72:[2,42],75:[2,42],80:[2,42],81:[2,42],82:[2,42],83:[2,42],84:[2,42],85:[2,42],87:[1,50]},{20:74,53:80,54:[2,84],63:81,64:75,65:[1,43],69:82,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{26:83,47:[1,66]},{47:[2,55]},{4:84,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],39:[2,46],44:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{47:[2,20]},{20:85,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{4:86,6:3,14:[2,46],15:[2,46],19:[2,46],29:[2,46],34:[2,46],47:[2,46],48:[2,46],51:[2,46],55:[2,46],60:[2,46]},{26:87,47:[1,66]},{47:[2,57]},{5:[2,11],14:[2,11],15:[2,11],19:[2,11],29:[2,11],34:[2,11],39:[2,11],44:[2,11],47:[2,11],48:[2,11],51:[2,11],55:[2,11],60:[2,11]},{15:[2,49],18:[2,49]},{20:74,33:[2,88],58:88,63:89,64:75,65:[1,43],69:90,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{65:[2,94],66:91,68:[2,94],72:[2,94],80:[2,94],81:[2,94],82:[2,94],83:[2,94],84:[2,94],85:[2,94]},{5:[2,25],14:[2,25],15:[2,25],19:[2,25],29:[2,25],34:[2,25],39:[2,25],44:[2,25],47:[2,25],48:[2,25],51:[2,25],55:[2,25],60:[2,25]},{20:92,72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,31:93,33:[2,60],63:94,64:75,65:[1,43],69:95,70:76,71:77,72:[1,78],75:[2,60],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,66],36:96,63:97,64:75,65:[1,43],69:98,70:76,71:77,72:[1,78],75:[2,66],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,22:99,23:[2,52],63:100,64:75,65:[1,43],69:101,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{20:74,33:[2,92],62:102,63:103,64:75,65:[1,43],69:104,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,105]},{33:[2,79],65:[2,79],72:[2,79],80:[2,79],81:[2,79],82:[2,79],83:[2,79],84:[2,79],85:[2,79]},{33:[2,81]},{23:[2,27],33:[2,27],54:[2,27],65:[2,27],68:[2,27],72:[2,27],75:[2,27],80:[2,27],81:[2,27],82:[2,27],83:[2,27],84:[2,27],85:[2,27]},{23:[2,28],33:[2,28],54:[2,28],65:[2,28],68:[2,28],72:[2,28],75:[2,28],80:[2,28],81:[2,28],82:[2,28],83:[2,28],84:[2,28],85:[2,28]},{23:[2,30],33:[2,30],54:[2,30],68:[2,30],71:106,72:[1,107],75:[2,30]},{23:[2,98],33:[2,98],54:[2,98],68:[2,98],72:[2,98],75:[2,98]},{23:[2,45],33:[2,45],54:[2,45],65:[2,45],68:[2,45],72:[2,45],73:[1,108],75:[2,45],80:[2,45],81:[2,45],82:[2,45],83:[2,45],84:[2,45],85:[2,45],87:[2,45]},{23:[2,44],33:[2,44],54:[2,44],65:[2,44],68:[2,44],72:[2,44],75:[2,44],80:[2,44],81:[2,44],82:[2,44],83:[2,44],84:[2,44],85:[2,44],87:[2,44]},{54:[1,109]},{54:[2,83],65:[2,83],72:[2,83],80:[2,83],81:[2,83],82:[2,83],83:[2,83],84:[2,83],85:[2,83]},{54:[2,85]},{5:[2,13],14:[2,13],15:[2,13],19:[2,13],29:[2,13],34:[2,13],39:[2,13],44:[2,13],47:[2,13],48:[2,13],51:[2,13],55:[2,13],60:[2,13]},{38:55,39:[1,57],43:56,44:[1,58],45:111,46:110,47:[2,76]},{33:[2,70],40:112,65:[2,70],72:[2,70],75:[2,70],80:[2,70],81:[2,70],82:[2,70],83:[2,70],84:[2,70],85:[2,70]},{47:[2,18]},{5:[2,14],14:[2,14],15:[2,14],19:[2,14],29:[2,14],34:[2,14],39:[2,14],44:[2,14],47:[2,14],48:[2,14],51:[2,14],55:[2,14],60:[2,14]},{33:[1,113]},{33:[2,87],65:[2,87],72:[2,87],80:[2,87],81:[2,87],82:[2,87],83:[2,87],84:[2,87],85:[2,87]},{33:[2,89]},{20:74,63:115,64:75,65:[1,43],67:114,68:[2,96],69:116,70:76,71:77,72:[1,78],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{33:[1,117]},{32:118,33:[2,62],74:119,75:[1,120]},{33:[2,59],65:[2,59],72:[2,59],75:[2,59],80:[2,59],81:[2,59],82:[2,59],83:[2,59],84:[2,59],85:[2,59]},{33:[2,61],75:[2,61]},{33:[2,68],37:121,74:122,75:[1,120]},{33:[2,65],65:[2,65],72:[2,65],75:[2,65],80:[2,65],81:[2,65],82:[2,65],83:[2,65],84:[2,65],85:[2,65]},{33:[2,67],75:[2,67]},{23:[1,123]},{23:[2,51],65:[2,51],72:[2,51],80:[2,51],81:[2,51],82:[2,51],83:[2,51],84:[2,51],85:[2,51]},{23:[2,53]},{33:[1,124]},{33:[2,91],65:[2,91],72:[2,91],80:[2,91],81:[2,91],82:[2,91],83:[2,91],84:[2,91],85:[2,91]},{33:[2,93]},{5:[2,22],14:[2,22],15:[2,22],19:[2,22],29:[2,22],34:[2,22],39:[2,22],44:[2,22],47:[2,22],48:[2,22],51:[2,22],55:[2,22],60:[2,22]},{23:[2,99],33:[2,99],54:[2,99],68:[2,99],72:[2,99],75:[2,99]},{73:[1,108]},{20:74,63:125,64:75,65:[1,43],72:[1,35],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,23],14:[2,23],15:[2,23],19:[2,23],29:[2,23],34:[2,23],39:[2,23],44:[2,23],47:[2,23],48:[2,23],51:[2,23],55:[2,23],60:[2,23]},{47:[2,19]},{47:[2,77]},{20:74,33:[2,72],41:126,63:127,64:75,65:[1,43],69:128,70:76,71:77,72:[1,78],75:[2,72],78:26,79:27,80:[1,28],81:[1,29],82:[1,30],83:[1,31],84:[1,32],85:[1,34],86:33},{5:[2,24],14:[2,24],15:[2,24],19:[2,24],29:[2,24],34:[2,24],39:[2,24],44:[2,24],47:[2,24],48:[2,24],51:[2,24],55:[2,24],60:[2,24]},{68:[1,129]},{65:[2,95],68:[2,95],72:[2,95],80:[2,95],81:[2,95],82:[2,95],83:[2,95],84:[2,95],85:[2,95]},{68:[2,97]},{5:[2,21],14:[2,21],15:[2,21],19:[2,21],29:[2,21],34:[2,21],39:[2,21],44:[2,21],47:[2,21],48:[2,21],51:[2,21],55:[2,21],60:[2,21]},{33:[1,130]},{33:[2,63]},{72:[1,132],76:131},{33:[1,133]},{33:[2,69]},{15:[2,12],18:[2,12]},{14:[2,26],15:[2,26],19:[2,26],29:[2,26],34:[2,26],47:[2,26],48:[2,26],51:[2,26],55:[2,26],60:[2,26]},{23:[2,31],33:[2,31],54:[2,31],68:[2,31],72:[2,31],75:[2,31]},{33:[2,74],42:134,74:135,75:[1,120]},{33:[2,71],65:[2,71],72:[2,71],75:[2,71],80:[2,71],81:[2,71],82:[2,71],83:[2,71],84:[2,71],85:[2,71]},{33:[2,73],75:[2,73]},{23:[2,29],33:[2,29],54:[2,29],65:[2,29],68:[2,29],72:[2,29],75:[2,29],80:[2,29],81:[2,29],82:[2,29],83:[2,29],84:[2,29],85:[2,29]},{14:[2,15],15:[2,15],19:[2,15],29:[2,15],34:[2,15],39:[2,15],44:[2,15],47:[2,15],48:[2,15],51:[2,15],55:[2,15],60:[2,15]},{72:[1,137],77:[1,136]},{72:[2,100],77:[2,100]},{14:[2,16],15:[2,16],19:[2,16],29:[2,16],34:[2,16],44:[2,16],47:[2,16],48:[2,16],51:[2,16],55:[2,16],60:[2,16]},{33:[1,138]},{33:[2,75]},{33:[2,32]},{72:[2,101],77:[2,101]},{14:[2,17],15:[2,17],19:[2,17],29:[2,17],34:[2,17],39:[2,17],44:[2,17],47:[2,17],48:[2,17],51:[2,17],55:[2,17],60:[2,17]}],defaultActions:{4:[2,1],54:[2,55],56:[2,20],60:[2,57],73:[2,81],82:[2,85],86:[2,18],90:[2,89],101:[2,53],104:[2,93],110:[2,19],111:[2,77],116:[2,97],119:[2,63],122:[2,69],135:[2,75],136:[2,32]},parseError:function(_,O){throw Error(_)},parse:function(_){var O=this,j=[0],z=[null],J=[],w=this.table,k="",X=0,G=0,V=0,C=2,E=1;if(this.lexer.setInput(_),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u")this.lexer.yylloc={};var h=this.lexer.yylloc;J.push(h);var I=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function D(W){j.length=j.length-2*W,z.length=z.length-W,J.length=J.length-W}function g(){var W=O.lexer.lex()||1;if(typeof W!=="number")W=O.symbols_[W]||W;return W}var u,y,p,l,Q,e,m={},o,M,Y,H;while(!0){if(p=j[j.length-1],this.defaultActions[p])l=this.defaultActions[p];else{if(u===null||typeof u>"u")u=g();l=w[p]&&w[p][u]}if(typeof l>"u"||!l.length||!l[0]){var T="";if(!V){H=[];for(o in w[p])if(this.terminals_[o]&&o>2)H.push("'"+this.terminals_[o]+"'");if(this.lexer.showPosition)T="Parse error on line "+(X+1)+`:
6
6
  `+this.lexer.showPosition()+`
7
- Expecting `+H.join(", ")+", got '"+(this.terminals_[u]||u)+"'";else T="Parse error on line "+(X+1)+": Unexpected "+(u==1?"end of input":"'"+(this.terminals_[u]||u)+"'");this.parseError(T,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:H})}}if(m[0]instanceof Array&&m.length>1)throw Error("Parse Error: multiple actions possible at state: "+p+", token: "+u);switch(m[0]){case 1:if(j.push(u),z.push(this.lexer.yytext),J.push(this.lexer.yylloc),j.push(m[1]),u=null,!y){if(G=this.lexer.yyleng,k=this.lexer.yytext,X=this.lexer.yylineno,h=this.lexer.yylloc,V>0)V--}else u=y,y=null;break;case 2:if(M=this.productions_[m[1]][1],l.$=z[z.length-M],l._$={first_line:J[J.length-(M||1)].first_line,last_line:J[J.length-1].last_line,first_column:J[J.length-(M||1)].first_column,last_column:J[J.length-1].last_column},I)l._$.range=[J[J.length-(M||1)].range[0],J[J.length-1].range[1]];if(U=this.performAction.call(l,k,G,X,this.yy,m[1],z,J),typeof U<"u")return U;if(M)j=j.slice(0,-1*M*2),z=z.slice(0,-1*M),J=J.slice(0,-1*M);j.push(this.productions_[m[1]][0]),z.push(l.$),J.push(l._$),Y=w[j[j.length-2]][j[j.length-1]],j.push(Y);break;case 3:return!0}}return!0}},q=function(){var P={EOF:1,parseError:function(O,j){if(this.yy.parser)this.yy.parser.parseError(O,j);else throw Error(O)},setInput:function(O){if(this._input=O,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var j=O.match(/(?:\r\n?|\n).*/g);if(j)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),O},unput:function(O){var j=O.length,z=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j-1),this.offset-=j;var J=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1)this.yylineno-=z.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===J.length?this.yylloc.first_column:0)+J[J.length-z.length].length-z[0].length:this.yylloc.first_column-j},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-j];return this},more:function(){return this._more=!0,this},less:function(O){this.unput(this.match.slice(O))},pastInput:function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var O=this.match;if(O.length<20)O+=this._input.substr(0,20-O.length);return(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var O=this.pastInput(),j=Array(O.length+1).join("-");return O+this.upcomingInput()+`
7
+ Expecting `+H.join(", ")+", got '"+(this.terminals_[u]||u)+"'";else T="Parse error on line "+(X+1)+": Unexpected "+(u==1?"end of input":"'"+(this.terminals_[u]||u)+"'");this.parseError(T,{text:this.lexer.match,token:this.terminals_[u]||u,line:this.lexer.yylineno,loc:h,expected:H})}}if(l[0]instanceof Array&&l.length>1)throw Error("Parse Error: multiple actions possible at state: "+p+", token: "+u);switch(l[0]){case 1:if(j.push(u),z.push(this.lexer.yytext),J.push(this.lexer.yylloc),j.push(l[1]),u=null,!y){if(G=this.lexer.yyleng,k=this.lexer.yytext,X=this.lexer.yylineno,h=this.lexer.yylloc,V>0)V--}else u=y,y=null;break;case 2:if(M=this.productions_[l[1]][1],m.$=z[z.length-M],m._$={first_line:J[J.length-(M||1)].first_line,last_line:J[J.length-1].last_line,first_column:J[J.length-(M||1)].first_column,last_column:J[J.length-1].last_column},I)m._$.range=[J[J.length-(M||1)].range[0],J[J.length-1].range[1]];if(e=this.performAction.call(m,k,G,X,this.yy,l[1],z,J),typeof e<"u")return e;if(M)j=j.slice(0,-1*M*2),z=z.slice(0,-1*M),J=J.slice(0,-1*M);j.push(this.productions_[l[1]][0]),z.push(m.$),J.push(m._$),Y=w[j[j.length-2]][j[j.length-1]],j.push(Y);break;case 3:return!0}}return!0}},q=function(){var P={EOF:1,parseError:function(O,j){if(this.yy.parser)this.yy.parser.parseError(O,j);else throw Error(O)},setInput:function(O){if(this._input=O,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges)this.yylloc.range=[0,0];return this.offset=0,this},input:function(){var O=this._input[0];this.yytext+=O,this.yyleng++,this.offset++,this.match+=O,this.matched+=O;var j=O.match(/(?:\r\n?|\n).*/g);if(j)this.yylineno++,this.yylloc.last_line++;else this.yylloc.last_column++;if(this.options.ranges)this.yylloc.range[1]++;return this._input=this._input.slice(1),O},unput:function(O){var j=O.length,z=O.split(/(?:\r\n?|\n)/g);this._input=O+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-j-1),this.offset-=j;var J=this.match.split(/(?:\r\n?|\n)/g);if(this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),z.length-1)this.yylineno-=z.length-1;var w=this.yylloc.range;if(this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:z?(z.length===J.length?this.yylloc.first_column:0)+J[J.length-z.length].length-z[0].length:this.yylloc.first_column-j},this.options.ranges)this.yylloc.range=[w[0],w[0]+this.yyleng-j];return this},more:function(){return this._more=!0,this},less:function(O){this.unput(this.match.slice(O))},pastInput:function(){var O=this.matched.substr(0,this.matched.length-this.match.length);return(O.length>20?"...":"")+O.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var O=this.match;if(O.length<20)O+=this._input.substr(0,20-O.length);return(O.substr(0,20)+(O.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var O=this.pastInput(),j=Array(O.length+1).join("-");return O+this.upcomingInput()+`
8
8
  `+j+"^"},next:function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var O,j,z,J,w,k;if(!this._more)this.yytext="",this.match="";var X=this._currentRules();for(var G=0;G<X.length;G++)if(z=this._input.match(this.rules[X[G]]),z&&(!j||z[0].length>j[0].length)){if(j=z,J=G,!this.options.flex)break}if(j){if(k=j[0].match(/(?:\r\n?|\n).*/g),k)this.yylineno+=k.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:k?k[k.length-1].length-k[k.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+j[0].length},this.yytext+=j[0],this.match+=j[0],this.matches=j,this.yyleng=this.yytext.length,this.options.ranges)this.yylloc.range=[this.offset,this.offset+=this.yyleng];if(this._more=!1,this._input=this._input.slice(j[0].length),this.matched+=j[0],O=this.performAction.call(this,this.yy,this,X[J],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(O)return O;else return}if(this._input==="")return this.EOF;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
9
9
  `+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var O=this.next();if(typeof O<"u")return O;else return this.lex()},begin:function(O){this.conditionStack.push(O)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(O){this.begin(O)}};return P.options={},P.performAction=function(O,j,z,J){function w(X,G){return j.yytext=j.yytext.substring(X,j.yyleng-G+X)}var k=J;switch(z){case 0:if(j.yytext.slice(-2)==="\\\\")w(0,1),this.begin("mu");else if(j.yytext.slice(-1)==="\\")w(0,1),this.begin("emu");else this.begin("mu");if(j.yytext)return 15;break;case 1:return 15;case 2:return this.popState(),15;break;case 3:return this.begin("raw"),15;break;case 4:if(this.popState(),this.conditionStack[this.conditionStack.length-1]==="raw")return 15;else return w(5,9),"END_RAW_BLOCK";break;case 5:return 15;case 6:return this.popState(),14;break;case 7:return 65;case 8:return 68;case 9:return 19;case 10:return this.popState(),this.begin("raw"),23;break;case 11:return 55;case 12:return 60;case 13:return 29;case 14:return 47;case 15:return this.popState(),44;break;case 16:return this.popState(),44;break;case 17:return 34;case 18:return 39;case 19:return 51;case 20:return 48;case 21:this.unput(j.yytext),this.popState(),this.begin("com");break;case 22:return this.popState(),14;break;case 23:return 48;case 24:return 73;case 25:return 72;case 26:return 72;case 27:return 87;case 28:break;case 29:return this.popState(),54;break;case 30:return this.popState(),33;break;case 31:return j.yytext=w(1,2).replace(/\\"/g,'"'),80;break;case 32:return j.yytext=w(1,2).replace(/\\'/g,"'"),80;break;case 33:return 85;case 34:return 82;case 35:return 82;case 36:return 83;case 37:return 84;case 38:return 81;case 39:return 75;case 40:return 77;case 41:return 72;case 42:return j.yytext=j.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},P.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{(?=[^/]))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]+?(?=(\{\{\{\{)))/,/^(?:[\s\S]*?--(~)?\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#>)/,/^(?:\{\{(~)?#\*?)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{(~)?!--)/,/^(?:\{\{(~)?![\s\S]*?\}\})/,/^(?:\{\{(~)?\*?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)|])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:undefined(?=([~}\s)])))/,/^(?:null(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:as\s+\|)/,/^(?:\|)/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],P.conditions={mu:{rules:[7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[6],inclusive:!1},raw:{rules:[3,4,5],inclusive:!1},INITIAL:{rules:[0,1,44],inclusive:!0}},P}();$.lexer=q;function K(){this.yy={}}return K.prototype=$,$.Parser=K,new K}();WG.default=Fx;HG.exports=WG.default});var Nj=u$((ZG,fG)=>{ZG.__esModule=!0;function ex($){return $&&$.__esModule?$:{default:$}}var sx=w8(),PW=ex(sx);function Sj(){this.parents=[]}Sj.prototype={constructor:Sj,mutating:!1,acceptKey:function(q,K){var P=this.accept(q[K]);if(this.mutating){if(P&&!Sj.prototype[P.type])throw new PW.default('Unexpected node type "'+P.type+'" found when accepting '+K+" on "+q.type);q[K]=P}},acceptRequired:function(q,K){if(this.acceptKey(q,K),!q[K])throw new PW.default(q.type+" requires "+K)},acceptArray:function(q){for(var K=0,P=q.length;K<P;K++)if(this.acceptKey(q,K),!q[K])q.splice(K,1),K--,P--},accept:function(q){if(!q)return;if(!this[q.type])throw new PW.default("Unknown type: "+q.type,q);if(this.current)this.parents.unshift(this.current);this.current=q;var K=this[q.type](q);if(this.current=this.parents.shift(),!this.mutating||K)return K;else if(K!==!1)return q},Program:function(q){this.acceptArray(q.body)},MustacheStatement:Mj,Decorator:Mj,BlockStatement:TG,DecoratorBlock:TG,PartialStatement:wG,PartialBlockStatement:function(q){wG.call(this,q),this.acceptKey(q,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:Mj,PathExpression:function(){},StringLiteral:function(){},NumberLiteral:function(){},BooleanLiteral:function(){},UndefinedLiteral:function(){},NullLiteral:function(){},Hash:function(q){this.acceptArray(q.pairs)},HashPair:function(q){this.acceptRequired(q,"value")}};function Mj($){this.acceptRequired($,"path"),this.acceptArray($.params),this.acceptKey($,"hash")}function TG($){Mj.call(this,$),this.acceptKey($,"program"),this.acceptKey($,"inverse")}function wG($){this.acceptRequired($,"name"),this.acceptArray($.params),this.acceptKey($,"hash")}ZG.default=Sj;fG.exports=ZG.default});var AG=u$((XG,kG)=>{XG.__esModule=!0;function Kc($){return $&&$.__esModule?$:{default:$}}var _c=Nj(),Pc=Kc(_c);function i8(){var $=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=$}i8.prototype=new Pc.default;i8.prototype.Program=function($){var q=!this.options.ignoreStandalone,K=!this.isRootSeen;this.isRootSeen=!0;var P=$.body;for(var _=0,O=P.length;_<O;_++){var j=P[_],z=this.accept(j);if(!z)continue;var J=jW(P,_,K),w=OW(P,_,K),k=z.openStandalone&&J,X=z.closeStandalone&&w,G=z.inlineStandalone&&J&&w;if(z.close)S_(P,_,!0);if(z.open)oK(P,_,!0);if(q&&G){if(S_(P,_),oK(P,_)){if(j.type==="PartialStatement")j.indent=/([ \t]+$)/.exec(P[_-1].original)[1]}}if(q&&k)S_((j.program||j.inverse).body),oK(P,_);if(q&&X)S_(P,_),oK((j.inverse||j.program).body)}return $};i8.prototype.BlockStatement=i8.prototype.DecoratorBlock=i8.prototype.PartialBlockStatement=function($){this.accept($.program),this.accept($.inverse);var q=$.program||$.inverse,K=$.program&&$.inverse,P=K,_=K;if(K&&K.chained){P=K.body[0].program;while(_.chained)_=_.body[_.body.length-1].program}var O={open:$.openStrip.open,close:$.closeStrip.close,openStandalone:OW(q.body),closeStandalone:jW((P||q).body)};if($.openStrip.close)S_(q.body,null,!0);if(K){var j=$.inverseStrip;if(j.open)oK(q.body,null,!0);if(j.close)S_(P.body,null,!0);if($.closeStrip.open)oK(_.body,null,!0);if(!this.options.ignoreStandalone&&jW(q.body)&&OW(P.body))oK(q.body),S_(P.body)}else if($.closeStrip.open)oK(q.body,null,!0);return O};i8.prototype.Decorator=i8.prototype.MustacheStatement=function($){return $.strip};i8.prototype.PartialStatement=i8.prototype.CommentStatement=function($){var q=$.strip||{};return{inlineStandalone:!0,open:q.open,close:q.close}};function jW($,q,K){if(q===void 0)q=$.length;var P=$[q-1],_=$[q-2];if(!P)return K;if(P.type==="ContentStatement")return(_||!K?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(P.original)}function OW($,q,K){if(q===void 0)q=-1;var P=$[q+1],_=$[q+2];if(!P)return K;if(P.type==="ContentStatement")return(_||!K?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(P.original)}function S_($,q,K){var P=$[q==null?0:q+1];if(!P||P.type!=="ContentStatement"||!K&&P.rightStripped)return;var _=P.value;P.value=P.value.replace(K?/^\s+/:/^[ \t]*\r?\n?/,""),P.rightStripped=P.value!==_}function oK($,q,K){var P=$[q==null?$.length-1:q-1];if(!P||P.type!=="ContentStatement"||!K&&P.leftStripped)return;var _=P.value;return P.value=P.value.replace(K?/\s+$/:/[ \t]+$/,""),P.leftStripped=P.value!==_,P.leftStripped}XG.default=i8;kG.exports=XG.default});var GG=u$((Ac)=>{Ac.__esModule=!0;Ac.SourceLocation=zc;Ac.id=Wc;Ac.stripFlags=Hc;Ac.stripComment=Jc;Ac.preparePath=Tc;Ac.prepareMustache=wc;Ac.prepareRawBlock=Zc;Ac.prepareBlock=fc;Ac.prepareProgram=Xc;Ac.preparePartialBlock=kc;function Yc($){return $&&$.__esModule?$:{default:$}}var vc=w8(),YW=Yc(vc);function vW($,q){if(q=q.path?q.path.original:q,$.path.original!==q){var K={loc:$.path.loc};throw new YW.default($.path.original+" doesn't match "+q,K)}}function zc($,q){this.source=$,this.start={line:q.first_line,column:q.first_column},this.end={line:q.last_line,column:q.last_column}}function Wc($){if(/^\[.*\]$/.test($))return $.substring(1,$.length-1);else return $}function Hc($,q){return{open:$.charAt(2)==="~",close:q.charAt(q.length-3)==="~"}}function Jc($){return $.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function Tc($,q,K){K=this.locInfo(K);var P=$?"@":"",_=[],O=0;for(var j=0,z=q.length;j<z;j++){var J=q[j].part,w=q[j].original!==J;if(P+=(q[j].separator||"")+J,!w&&(J===".."||J==="."||J==="this")){if(_.length>0)throw new YW.default("Invalid path: "+P,{loc:K});else if(J==="..")O++}else _.push(J)}return{type:"PathExpression",data:$,depth:O,parts:_,original:P,loc:K}}function wc($,q,K,P,_,O){var j=P.charAt(3)||P.charAt(2),z=j!=="{"&&j!=="&",J=/\*/.test(P);return{type:J?"Decorator":"MustacheStatement",path:$,params:q,hash:K,escaped:z,strip:_,loc:this.locInfo(O)}}function Zc($,q,K,P){vW($,K),P=this.locInfo(P);var _={type:"Program",body:q,strip:{},loc:P};return{type:"BlockStatement",path:$.path,params:$.params,hash:$.hash,program:_,openStrip:{},inverseStrip:{},closeStrip:{},loc:P}}function fc($,q,K,P,_,O){if(P&&P.path)vW($,P);var j=/\*/.test($.open);q.blockParams=$.blockParams;var z=void 0,J=void 0;if(K){if(j)throw new YW.default("Unexpected inverse block on decorator",K);if(K.chain)K.program.body[0].closeStrip=P.strip;J=K.strip,z=K.program}if(_)_=z,z=q,q=_;return{type:j?"DecoratorBlock":"BlockStatement",path:$.path,params:$.params,hash:$.hash,program:q,inverse:z,openStrip:$.strip,inverseStrip:J,closeStrip:P&&P.strip,loc:this.locInfo(O)}}function Xc($,q){if(!q&&$.length){var K=$[0].loc,P=$[$.length-1].loc;if(K&&P)q={source:K.source,start:{line:K.start.line,column:K.start.column},end:{line:P.end.line,column:P.end.column}}}return{type:"Program",body:$,strip:{},loc:q}}function kc($,q,K,P){return vW($,K),{type:"PartialBlockStatement",name:$.path,params:$.params,hash:$.hash,program:q,openStrip:$.strip,closeStrip:K&&K.strip,loc:this.locInfo(P)}}});var MG=u$((mc)=>{mc.__esModule=!0;mc.parseWithoutProcessing=SG;mc.parse=pc;function Lc($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var K in $)if(Object.prototype.hasOwnProperty.call($,K))q[K]=$[K]}return q.default=$,q}}function VG($){return $&&$.__esModule?$:{default:$}}var bc=JG(),zW=VG(bc),gc=AG(),uc=VG(gc),yc=GG(),xc=Lc(yc),cc=cq();mc.parser=zW.default;var Cj={};cc.extend(Cj,xc);function SG($,q){if($.type==="Program")return $;zW.default.yy=Cj,Cj.locInfo=function(P){return new Cj.SourceLocation(q&&q.srcName,P)};var K=zW.default.parse($);return K}function pc($,q){var K=SG($,q),P=new uc.default(q);return P.accept(K)}});var hG=u$((Fc)=>{Fc.__esModule=!0;Fc.Compiler=WW;Fc.precompile=tc;Fc.compile=Uc;function CG($){return $&&$.__esModule?$:{default:$}}var nc=w8(),M7=CG(nc),N7=cq(),ic=_W(),S7=CG(ic),Bc=[].slice;function WW(){}WW.prototype={compiler:WW,equals:function(q){var K=this.opcodes.length;if(q.opcodes.length!==K)return!1;for(var P=0;P<K;P++){var _=this.opcodes[P],O=q.opcodes[P];if(_.opcode!==O.opcode||!EG(_.args,O.args))return!1}K=this.children.length;for(var P=0;P<K;P++)if(!this.children[P].equals(q.children[P]))return!1;return!0},guid:0,compile:function(q,K){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=K,this.stringParams=K.stringParams,this.trackIds=K.trackIds,K.blockParams=K.blockParams||[],K.knownHelpers=N7.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},K.knownHelpers),this.accept(q)},compileProgram:function(q){var K=new this.compiler,P=K.compile(q,this.options),_=this.guid++;return this.usePartial=this.usePartial||P.usePartial,this.children[_]=P,this.useDepths=this.useDepths||P.useDepths,_},accept:function(q){if(!this[q.type])throw new M7.default("Unknown type: "+q.type,q);this.sourceNode.unshift(q);var K=this[q.type](q);return this.sourceNode.shift(),K},Program:function(q){this.options.blockParams.unshift(q.blockParams);var K=q.body,P=K.length;for(var _=0;_<P;_++)this.accept(K[_]);return this.options.blockParams.shift(),this.isSimple=P===1,this.blockParams=q.blockParams?q.blockParams.length:0,this},BlockStatement:function(q){NG(q);var{program:K,inverse:P}=q;K=K&&this.compileProgram(K),P=P&&this.compileProgram(P);var _=this.classifySexpr(q);if(_==="helper")this.helperSexpr(q,K,P);else if(_==="simple")this.simpleSexpr(q),this.opcode("pushProgram",K),this.opcode("pushProgram",P),this.opcode("emptyHash"),this.opcode("blockValue",q.path.original);else this.ambiguousSexpr(q,K,P),this.opcode("pushProgram",K),this.opcode("pushProgram",P),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function(q){var K=q.program&&this.compileProgram(q.program),P=this.setupFullMustacheParams(q,K,void 0),_=q.path;this.useDecorators=!0,this.opcode("registerDecorator",P.length,_.original)},PartialStatement:function(q){this.usePartial=!0;var K=q.program;if(K)K=this.compileProgram(q.program);var P=q.params;if(P.length>1)throw new M7.default("Unsupported number of partial arguments: "+P.length,q);else if(!P.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else P.push({type:"PathExpression",parts:[],depth:0});var _=q.name.original,O=q.name.type==="SubExpression";if(O)this.accept(q.name);this.setupFullMustacheParams(q,K,void 0,!0);var j=q.indent||"";if(this.options.preventIndent&&j)this.opcode("appendContent",j),j="";this.opcode("invokePartial",O,_,j),this.opcode("append")},PartialBlockStatement:function(q){this.PartialStatement(q)},MustacheStatement:function(q){if(this.SubExpression(q),q.escaped&&!this.options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},Decorator:function(q){this.DecoratorBlock(q)},ContentStatement:function(q){if(q.value)this.opcode("appendContent",q.value)},CommentStatement:function(){},SubExpression:function(q){NG(q);var K=this.classifySexpr(q);if(K==="simple")this.simpleSexpr(q);else if(K==="helper")this.helperSexpr(q);else this.ambiguousSexpr(q)},ambiguousSexpr:function(q,K,P){var _=q.path,O=_.parts[0],j=K!=null||P!=null;this.opcode("getContext",_.depth),this.opcode("pushProgram",K),this.opcode("pushProgram",P),_.strict=!0,this.accept(_),this.opcode("invokeAmbiguous",O,j)},simpleSexpr:function(q){var K=q.path;K.strict=!0,this.accept(K),this.opcode("resolvePossibleLambda")},helperSexpr:function(q,K,P){var _=this.setupFullMustacheParams(q,K,P),O=q.path,j=O.parts[0];if(this.options.knownHelpers[j])this.opcode("invokeKnownHelper",_.length,j);else if(this.options.knownHelpersOnly)throw new M7.default("You specified knownHelpersOnly, but used the unknown helper "+j,q);else O.strict=!0,O.falsy=!0,this.accept(O),this.opcode("invokeHelper",_.length,O.original,S7.default.helpers.simpleId(O))},PathExpression:function(q){this.addDepth(q.depth),this.opcode("getContext",q.depth);var K=q.parts[0],P=S7.default.helpers.scopedId(q),_=!q.depth&&!P&&this.blockParamIndex(K);if(_)this.opcode("lookupBlockParam",_,q.parts);else if(!K)this.opcode("pushContext");else if(q.data)this.options.data=!0,this.opcode("lookupData",q.depth,q.parts,q.strict);else this.opcode("lookupOnContext",q.parts,q.falsy,q.strict,P)},StringLiteral:function(q){this.opcode("pushString",q.value)},NumberLiteral:function(q){this.opcode("pushLiteral",q.value)},BooleanLiteral:function(q){this.opcode("pushLiteral",q.value)},UndefinedLiteral:function(){this.opcode("pushLiteral","undefined")},NullLiteral:function(){this.opcode("pushLiteral","null")},Hash:function(q){var K=q.pairs,P=0,_=K.length;this.opcode("pushHash");for(;P<_;P++)this.pushParam(K[P].value);while(P--)this.opcode("assignToHash",K[P].key);this.opcode("popHash")},opcode:function(q){this.opcodes.push({opcode:q,args:Bc.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(q){if(!q)return;this.useDepths=!0},classifySexpr:function(q){var K=S7.default.helpers.simpleId(q.path),P=K&&!!this.blockParamIndex(q.path.parts[0]),_=!P&&S7.default.helpers.helperExpression(q),O=!P&&(_||K);if(O&&!_){var j=q.path.parts[0],z=this.options;if(z.knownHelpers[j])_=!0;else if(z.knownHelpersOnly)O=!1}if(_)return"helper";else if(O)return"ambiguous";else return"simple"},pushParams:function(q){for(var K=0,P=q.length;K<P;K++)this.pushParam(q[K])},pushParam:function(q){var K=q.value!=null?q.value:q.original||"";if(this.stringParams){if(K.replace)K=K.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(q.depth)this.addDepth(q.depth);if(this.opcode("getContext",q.depth||0),this.opcode("pushStringParam",K,q.type),q.type==="SubExpression")this.accept(q)}else{if(this.trackIds){var P=void 0;if(q.parts&&!S7.default.helpers.scopedId(q)&&!q.depth)P=this.blockParamIndex(q.parts[0]);if(P){var _=q.parts.slice(1).join(".");this.opcode("pushId","BlockParam",P,_)}else{if(K=q.original||K,K.replace)K=K.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",q.type,K)}}this.accept(q)}},setupFullMustacheParams:function(q,K,P,_){var O=q.params;if(this.pushParams(O),this.opcode("pushProgram",K),this.opcode("pushProgram",P),q.hash)this.accept(q.hash);else this.opcode("emptyHash",_);return O},blockParamIndex:function(q){for(var K=0,P=this.options.blockParams.length;K<P;K++){var _=this.options.blockParams[K],O=_&&N7.indexOf(_,q);if(_&&O>=0)return[K,O]}}};function tc($,q,K){if($==null||typeof $!=="string"&&$.type!=="Program")throw new M7.default("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+$);if(q=q||{},!("data"in q))q.data=!0;if(q.compat)q.useDepths=!0;var P=K.parse($,q),_=new K.Compiler().compile(P,q);return new K.JavaScriptCompiler().compile(_,q)}function Uc($,q,K){if(q===void 0)q={};if($==null||typeof $!=="string"&&$.type!=="Program")throw new M7.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+$);if(q=N7.extend({},q),!("data"in q))q.data=!0;if(q.compat)q.useDepths=!0;var P=void 0;function _(){var j=K.parse($,q),z=new K.Compiler().compile(j,q),J=new K.JavaScriptCompiler().compile(z,q,void 0,!0);return K.template(J)}function O(j,z){if(!P)P=_();return P.call(this,j,z)}return O._setup=function(j){if(!P)P=_();return P._setup(j)},O._child=function(j,z,J,w){if(!P)P=_();return P._child(j,z,J,w)},O}function EG($,q){if($===q)return!0;if(N7.isArray($)&&N7.isArray(q)&&$.length===q.length){for(var K=0;K<$.length;K++)if(!EG($[K],q[K]))return!1;return!0}}function NG($){if(!$.path.parts){var q=$.path;$.path={type:"PathExpression",data:!1,depth:0,parts:[q.original+""],original:q.original+"",loc:q.loc}}}});var IG=u$(($p)=>{var RG="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");$p.encode=function($){if(0<=$&&$<RG.length)return RG[$];throw TypeError("Must be between 0 and 63: "+$)};$p.decode=function($){var q=65,K=90,P=97,_=122,O=48,j=57,z=43,J=47,w=26,k=52;if(q<=$&&$<=K)return $-q;if(P<=$&&$<=_)return $-P+w;if(O<=$&&$<=j)return $-O+k;if($==z)return 62;if($==J)return 63;return-1}});var JW=u$((jp)=>{var DG=IG(),HW=5,LG=1<<HW,bG=LG-1,gG=LG;function _p($){return $<0?(-$<<1)+1:($<<1)+0}function Pp($){var q=($&1)===1,K=$>>1;return q?-K:K}jp.encode=function(q){var K="",P,_=_p(q);do{if(P=_&bG,_>>>=HW,_>0)P|=gG;K+=DG.encode(P)}while(_>0);return K};jp.decode=function(q,K,P){var _=q.length,O=0,j=0,z,J;do{if(K>=_)throw Error("Expected more digits in base 64 VLQ value.");if(J=DG.decode(q.charCodeAt(K++)),J===-1)throw Error("Invalid base64 digit: "+q.charAt(K-1));z=!!(J&gG),J&=bG,O=O+(J<<j),j+=HW}while(z);P.value=Pp(O),P.rest=K}});var C4=u$((kp)=>{function vp($,q,K){if(q in $)return $[q];else if(arguments.length===3)return K;else throw Error('"'+q+'" is a required argument.')}kp.getArg=vp;var uG=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,zp=/^data:.+\,.+$/;function C7($){var q=$.match(uG);if(!q)return null;return{scheme:q[1],auth:q[2],host:q[3],port:q[4],path:q[5]}}kp.urlParse=C7;function M4($){var q="";if($.scheme)q+=$.scheme+":";if(q+="//",$.auth)q+=$.auth+"@";if($.host)q+=$.host;if($.port)q+=":"+$.port;if($.path)q+=$.path;return q}kp.urlGenerate=M4;function TW($){var q=$,K=C7($);if(K){if(!K.path)return $;q=K.path}var P=kp.isAbsolute(q),_=q.split(/\/+/);for(var O,j=0,z=_.length-1;z>=0;z--)if(O=_[z],O===".")_.splice(z,1);else if(O==="..")j++;else if(j>0)if(O==="")_.splice(z+1,j),j=0;else _.splice(z,2),j--;if(q=_.join("/"),q==="")q=P?"/":".";if(K)return K.path=q,M4(K);return q}kp.normalize=TW;function yG($,q){if($==="")$=".";if(q==="")q=".";var K=C7(q),P=C7($);if(P)$=P.path||"/";if(K&&!K.scheme){if(P)K.scheme=P.scheme;return M4(K)}if(K||q.match(zp))return q;if(P&&!P.host&&!P.path)return P.host=q,M4(P);var _=q.charAt(0)==="/"?q:TW($.replace(/\/+$/,"")+"/"+q);if(P)return P.path=_,M4(P);return _}kp.join=yG;kp.isAbsolute=function($){return $.charAt(0)==="/"||uG.test($)};function Wp($,q){if($==="")$=".";$=$.replace(/\/$/,"");var K=0;while(q.indexOf($+"/")!==0){var P=$.lastIndexOf("/");if(P<0)return q;if($=$.slice(0,P),$.match(/^([^\/]+:\/)?\/*$/))return q;++K}return Array(K+1).join("../")+q.substr($.length+1)}kp.relative=Wp;var xG=function(){var $=Object.create(null);return!("__proto__"in $)}();function cG($){return $}function Hp($){if(pG($))return"$"+$;return $}kp.toSetString=xG?cG:Hp;function Jp($){if(pG($))return $.slice(1);return $}kp.fromSetString=xG?cG:Jp;function pG($){if(!$)return!1;var q=$.length;if(q<9)return!1;if($.charCodeAt(q-1)!==95||$.charCodeAt(q-2)!==95||$.charCodeAt(q-3)!==111||$.charCodeAt(q-4)!==116||$.charCodeAt(q-5)!==111||$.charCodeAt(q-6)!==114||$.charCodeAt(q-7)!==112||$.charCodeAt(q-8)!==95||$.charCodeAt(q-9)!==95)return!1;for(var K=q-10;K>=0;K--)if($.charCodeAt(K)!==36)return!1;return!0}function Tp($,q,K){var P=N4($.source,q.source);if(P!==0)return P;if(P=$.originalLine-q.originalLine,P!==0)return P;if(P=$.originalColumn-q.originalColumn,P!==0||K)return P;if(P=$.generatedColumn-q.generatedColumn,P!==0)return P;if(P=$.generatedLine-q.generatedLine,P!==0)return P;return N4($.name,q.name)}kp.compareByOriginalPositions=Tp;function wp($,q,K){var P=$.generatedLine-q.generatedLine;if(P!==0)return P;if(P=$.generatedColumn-q.generatedColumn,P!==0||K)return P;if(P=N4($.source,q.source),P!==0)return P;if(P=$.originalLine-q.originalLine,P!==0)return P;if(P=$.originalColumn-q.originalColumn,P!==0)return P;return N4($.name,q.name)}kp.compareByGeneratedPositionsDeflated=wp;function N4($,q){if($===q)return 0;if($===null)return 1;if(q===null)return-1;if($>q)return 1;return-1}function Zp($,q){var K=$.generatedLine-q.generatedLine;if(K!==0)return K;if(K=$.generatedColumn-q.generatedColumn,K!==0)return K;if(K=N4($.source,q.source),K!==0)return K;if(K=$.originalLine-q.originalLine,K!==0)return K;if(K=$.originalColumn-q.originalColumn,K!==0)return K;return N4($.name,q.name)}kp.compareByGeneratedPositionsInflated=Zp;function fp($){return JSON.parse($.replace(/^\)]}'[^\n]*\n/,""))}kp.parseSourceMapInput=fp;function Xp($,q,K){if(q=q||"",$){if($[$.length-1]!=="/"&&q[0]!=="/")$+="/";q=$+q}if(K){var P=C7(K);if(!P)throw Error("sourceMapURL could not be parsed");if(P.path){var _=P.path.lastIndexOf("/");if(_>=0)P.path=P.path.substring(0,_+1)}q=yG(M4(P),q)}return TW(q)}kp.computeSourceURL=Xp});var fW=u$((gp)=>{var wW=C4(),ZW=Object.prototype.hasOwnProperty,M_=typeof Map<"u";function ZK(){this._array=[],this._set=M_?new Map:Object.create(null)}ZK.fromArray=function(q,K){var P=new ZK;for(var _=0,O=q.length;_<O;_++)P.add(q[_],K);return P};ZK.prototype.size=function(){return M_?this._set.size:Object.getOwnPropertyNames(this._set).length};ZK.prototype.add=function(q,K){var P=M_?q:wW.toSetString(q),_=M_?this.has(q):ZW.call(this._set,P),O=this._array.length;if(!_||K)this._array.push(q);if(!_)if(M_)this._set.set(q,O);else this._set[P]=O};ZK.prototype.has=function(q){if(M_)return this._set.has(q);else{var K=wW.toSetString(q);return ZW.call(this._set,K)}};ZK.prototype.indexOf=function(q){if(M_){var K=this._set.get(q);if(K>=0)return K}else{var P=wW.toSetString(q);if(ZW.call(this._set,P))return this._set[P]}throw Error('"'+q+'" is not in the set.')};ZK.prototype.at=function(q){if(q>=0&&q<this._array.length)return this._array[q];throw Error("No element indexed by "+q)};ZK.prototype.toArray=function(){return this._array.slice()};gp.ArraySet=ZK});var dG=u$((xp)=>{var mG=C4();function yp($,q){var K=$.generatedLine,P=q.generatedLine,_=$.generatedColumn,O=q.generatedColumn;return P>K||P==K&&O>=_||mG.compareByGeneratedPositionsInflated($,q)<=0}function Ej(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ej.prototype.unsortedForEach=function(q,K){this._array.forEach(q,K)};Ej.prototype.add=function(q){if(yp(this._last,q))this._last=q,this._array.push(q);else this._sorted=!1,this._array.push(q)};Ej.prototype.toArray=function(){if(!this._sorted)this._array.sort(mG.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};xp.MappingList=Ej});var XW=u$((mp)=>{var E7=JW(),m6=C4(),hj=fW().ArraySet,pp=dG().MappingList;function Z8($){if(!$)$={};this._file=m6.getArg($,"file",null),this._sourceRoot=m6.getArg($,"sourceRoot",null),this._skipValidation=m6.getArg($,"skipValidation",!1),this._sources=new hj,this._names=new hj,this._mappings=new pp,this._sourcesContents=null}Z8.prototype._version=3;Z8.fromSourceMap=function(q){var K=q.sourceRoot,P=new Z8({file:q.file,sourceRoot:K});return q.eachMapping(function(_){var O={generated:{line:_.generatedLine,column:_.generatedColumn}};if(_.source!=null){if(O.source=_.source,K!=null)O.source=m6.relative(K,O.source);if(O.original={line:_.originalLine,column:_.originalColumn},_.name!=null)O.name=_.name}P.addMapping(O)}),q.sources.forEach(function(_){var O=_;if(K!==null)O=m6.relative(K,_);if(!P._sources.has(O))P._sources.add(O);var j=q.sourceContentFor(_);if(j!=null)P.setSourceContent(_,j)}),P};Z8.prototype.addMapping=function(q){var K=m6.getArg(q,"generated"),P=m6.getArg(q,"original",null),_=m6.getArg(q,"source",null),O=m6.getArg(q,"name",null);if(!this._skipValidation)this._validateMapping(K,P,_,O);if(_!=null){if(_=String(_),!this._sources.has(_))this._sources.add(_)}if(O!=null){if(O=String(O),!this._names.has(O))this._names.add(O)}this._mappings.add({generatedLine:K.line,generatedColumn:K.column,originalLine:P!=null&&P.line,originalColumn:P!=null&&P.column,source:_,name:O})};Z8.prototype.setSourceContent=function(q,K){var P=q;if(this._sourceRoot!=null)P=m6.relative(this._sourceRoot,P);if(K!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[m6.toSetString(P)]=K}else if(this._sourcesContents){if(delete this._sourcesContents[m6.toSetString(P)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};Z8.prototype.applySourceMap=function(q,K,P){var _=K;if(K==null){if(q.file==null)throw Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);_=q.file}var O=this._sourceRoot;if(O!=null)_=m6.relative(O,_);var j=new hj,z=new hj;this._mappings.unsortedForEach(function(J){if(J.source===_&&J.originalLine!=null){var w=q.originalPositionFor({line:J.originalLine,column:J.originalColumn});if(w.source!=null){if(J.source=w.source,P!=null)J.source=m6.join(P,J.source);if(O!=null)J.source=m6.relative(O,J.source);if(J.originalLine=w.line,J.originalColumn=w.column,w.name!=null)J.name=w.name}}var k=J.source;if(k!=null&&!j.has(k))j.add(k);var X=J.name;if(X!=null&&!z.has(X))z.add(X)},this),this._sources=j,this._names=z,q.sources.forEach(function(J){var w=q.sourceContentFor(J);if(w!=null){if(P!=null)J=m6.join(P,J);if(O!=null)J=m6.relative(O,J);this.setSourceContent(J,w)}},this)};Z8.prototype._validateMapping=function(q,K,P,_){if(K&&typeof K.line!=="number"&&typeof K.column!=="number")throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(q&&"line"in q&&"column"in q&&q.line>0&&q.column>=0&&!K&&!P&&!_)return;else if(q&&"line"in q&&"column"in q&&K&&"line"in K&&"column"in K&&q.line>0&&q.column>=0&&K.line>0&&K.column>=0&&P)return;else throw Error("Invalid mapping: "+JSON.stringify({generated:q,source:P,original:K,name:_}))};Z8.prototype._serializeMappings=function(){var q=0,K=1,P=0,_=0,O=0,j=0,z="",J,w,k,X,G=this._mappings.toArray();for(var V=0,C=G.length;V<C;V++){if(w=G[V],J="",w.generatedLine!==K){q=0;while(w.generatedLine!==K)J+=";",K++}else if(V>0){if(!m6.compareByGeneratedPositionsInflated(w,G[V-1]))continue;J+=","}if(J+=E7.encode(w.generatedColumn-q),q=w.generatedColumn,w.source!=null){if(X=this._sources.indexOf(w.source),J+=E7.encode(X-j),j=X,J+=E7.encode(w.originalLine-1-_),_=w.originalLine-1,J+=E7.encode(w.originalColumn-P),P=w.originalColumn,w.name!=null)k=this._names.indexOf(w.name),J+=E7.encode(k-O),O=k}z+=J}return z};Z8.prototype._generateSourcesContent=function(q,K){return q.map(function(P){if(!this._sourcesContents)return null;if(K!=null)P=m6.relative(K,P);var _=m6.toSetString(P);return Object.prototype.hasOwnProperty.call(this._sourcesContents,_)?this._sourcesContents[_]:null},this)};Z8.prototype.toJSON=function(){var q={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};if(this._file!=null)q.file=this._file;if(this._sourceRoot!=null)q.sourceRoot=this._sourceRoot;if(this._sourcesContents)q.sourcesContent=this._generateSourcesContent(q.sources,q.sourceRoot);return q};Z8.prototype.toString=function(){return JSON.stringify(this.toJSON())};mp.SourceMapGenerator=Z8});var rG=u$((lp)=>{lp.GREATEST_LOWER_BOUND=1;lp.LEAST_UPPER_BOUND=2;function kW($,q,K,P,_,O){var j=Math.floor((q-$)/2)+$,z=_(K,P[j],!0);if(z===0)return j;else if(z>0){if(q-j>1)return kW(j,q,K,P,_,O);if(O==lp.LEAST_UPPER_BOUND)return q<P.length?q:-1;else return j}else{if(j-$>1)return kW($,j,K,P,_,O);if(O==lp.LEAST_UPPER_BOUND)return j;else return $<0?-1:$}}lp.search=function(q,K,P,_){if(K.length===0)return-1;var O=kW(-1,K.length,q,K,P,_||lp.GREATEST_LOWER_BOUND);if(O<0)return-1;while(O-1>=0){if(P(K[O],K[O-1],!0)!==0)break;--O}return O}});var oG=u$((np)=>{function GW($,q,K){var P=$[q];$[q]=$[K],$[K]=P}function op($,q){return Math.round($+Math.random()*(q-$))}function VW($,q,K,P){if(K<P){var _=op(K,P),O=K-1;GW($,_,P);var j=$[P];for(var z=K;z<P;z++)if(q($[z],j)<=0)O+=1,GW($,O,z);GW($,O+1,z);var J=O+1;VW($,q,K,J-1),VW($,q,J+1,P)}}np.quickSort=function($,q){VW($,q,0,$.length-1)}});var iG=u$((tp)=>{var U$=C4(),SW=rG(),E4=fW().ArraySet,Bp=JW(),h7=oG().quickSort;function E6($,q){var K=$;if(typeof $==="string")K=U$.parseSourceMapInput($);return K.sections!=null?new R8(K,q):new Aq(K,q)}E6.fromSourceMap=function($,q){return Aq.fromSourceMap($,q)};E6.prototype._version=3;E6.prototype.__generatedMappings=null;Object.defineProperty(E6.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});E6.prototype.__originalMappings=null;Object.defineProperty(E6.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});E6.prototype._charIsMappingSeparator=function(q,K){var P=q.charAt(K);return P===";"||P===","};E6.prototype._parseMappings=function(q,K){throw Error("Subclasses must implement _parseMappings")};E6.GENERATED_ORDER=1;E6.ORIGINAL_ORDER=2;E6.GREATEST_LOWER_BOUND=1;E6.LEAST_UPPER_BOUND=2;E6.prototype.eachMapping=function(q,K,P){var _=K||null,O=P||E6.GENERATED_ORDER,j;switch(O){case E6.GENERATED_ORDER:j=this._generatedMappings;break;case E6.ORIGINAL_ORDER:j=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var z=this.sourceRoot;j.map(function(J){var w=J.source===null?null:this._sources.at(J.source);return w=U$.computeSourceURL(z,w,this._sourceMapURL),{source:w,generatedLine:J.generatedLine,generatedColumn:J.generatedColumn,originalLine:J.originalLine,originalColumn:J.originalColumn,name:J.name===null?null:this._names.at(J.name)}},this).forEach(q,_)};E6.prototype.allGeneratedPositionsFor=function(q){var K=U$.getArg(q,"line"),P={source:U$.getArg(q,"source"),originalLine:K,originalColumn:U$.getArg(q,"column",0)};if(P.source=this._findSourceIndex(P.source),P.source<0)return[];var _=[],O=this._findMapping(P,this._originalMappings,"originalLine","originalColumn",U$.compareByOriginalPositions,SW.LEAST_UPPER_BOUND);if(O>=0){var j=this._originalMappings[O];if(q.column===void 0){var z=j.originalLine;while(j&&j.originalLine===z)_.push({line:U$.getArg(j,"generatedLine",null),column:U$.getArg(j,"generatedColumn",null),lastColumn:U$.getArg(j,"lastGeneratedColumn",null)}),j=this._originalMappings[++O]}else{var J=j.originalColumn;while(j&&j.originalLine===K&&j.originalColumn==J)_.push({line:U$.getArg(j,"generatedLine",null),column:U$.getArg(j,"generatedColumn",null),lastColumn:U$.getArg(j,"lastGeneratedColumn",null)}),j=this._originalMappings[++O]}}return _};tp.SourceMapConsumer=E6;function Aq($,q){var K=$;if(typeof $==="string")K=U$.parseSourceMapInput($);var P=U$.getArg(K,"version"),_=U$.getArg(K,"sources"),O=U$.getArg(K,"names",[]),j=U$.getArg(K,"sourceRoot",null),z=U$.getArg(K,"sourcesContent",null),J=U$.getArg(K,"mappings"),w=U$.getArg(K,"file",null);if(P!=this._version)throw Error("Unsupported version: "+P);if(j)j=U$.normalize(j);_=_.map(String).map(U$.normalize).map(function(k){return j&&U$.isAbsolute(j)&&U$.isAbsolute(k)?U$.relative(j,k):k}),this._names=E4.fromArray(O.map(String),!0),this._sources=E4.fromArray(_,!0),this._absoluteSources=this._sources.toArray().map(function(k){return U$.computeSourceURL(j,k,q)}),this.sourceRoot=j,this.sourcesContent=z,this._mappings=J,this._sourceMapURL=q,this.file=w}Aq.prototype=Object.create(E6.prototype);Aq.prototype.consumer=E6;Aq.prototype._findSourceIndex=function($){var q=$;if(this.sourceRoot!=null)q=U$.relative(this.sourceRoot,q);if(this._sources.has(q))return this._sources.indexOf(q);var K;for(K=0;K<this._absoluteSources.length;++K)if(this._absoluteSources[K]==$)return K;return-1};Aq.fromSourceMap=function(q,K){var P=Object.create(Aq.prototype),_=P._names=E4.fromArray(q._names.toArray(),!0),O=P._sources=E4.fromArray(q._sources.toArray(),!0);P.sourceRoot=q._sourceRoot,P.sourcesContent=q._generateSourcesContent(P._sources.toArray(),P.sourceRoot),P.file=q._file,P._sourceMapURL=K,P._absoluteSources=P._sources.toArray().map(function(V){return U$.computeSourceURL(P.sourceRoot,V,K)});var j=q._mappings.toArray().slice(),z=P.__generatedMappings=[],J=P.__originalMappings=[];for(var w=0,k=j.length;w<k;w++){var X=j[w],G=new nG;if(G.generatedLine=X.generatedLine,G.generatedColumn=X.generatedColumn,X.source){if(G.source=O.indexOf(X.source),G.originalLine=X.originalLine,G.originalColumn=X.originalColumn,X.name)G.name=_.indexOf(X.name);J.push(G)}z.push(G)}return h7(P.__originalMappings,U$.compareByOriginalPositions),P};Aq.prototype._version=3;Object.defineProperty(Aq.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function nG(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Aq.prototype._parseMappings=function(q,K){var P=1,_=0,O=0,j=0,z=0,J=0,w=q.length,k=0,X={},G={},V=[],C=[],E,h,I,D,g;while(k<w)if(q.charAt(k)===";")P++,k++,_=0;else if(q.charAt(k)===",")k++;else{E=new nG,E.generatedLine=P;for(D=k;D<w;D++)if(this._charIsMappingSeparator(q,D))break;if(h=q.slice(k,D),I=X[h],I)k+=h.length;else{I=[];while(k<D)Bp.decode(q,k,G),g=G.value,k=G.rest,I.push(g);if(I.length===2)throw Error("Found a source, but no line and column");if(I.length===3)throw Error("Found a source and line, but no column");X[h]=I}if(E.generatedColumn=_+I[0],_=E.generatedColumn,I.length>1){if(E.source=z+I[1],z+=I[1],E.originalLine=O+I[2],O=E.originalLine,E.originalLine+=1,E.originalColumn=j+I[3],j=E.originalColumn,I.length>4)E.name=J+I[4],J+=I[4]}if(C.push(E),typeof E.originalLine==="number")V.push(E)}h7(C,U$.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,h7(V,U$.compareByOriginalPositions),this.__originalMappings=V};Aq.prototype._findMapping=function(q,K,P,_,O,j){if(q[P]<=0)throw TypeError("Line must be greater than or equal to 1, got "+q[P]);if(q[_]<0)throw TypeError("Column must be greater than or equal to 0, got "+q[_]);return SW.search(q,K,O,j)};Aq.prototype.computeColumnSpans=function(){for(var q=0;q<this._generatedMappings.length;++q){var K=this._generatedMappings[q];if(q+1<this._generatedMappings.length){var P=this._generatedMappings[q+1];if(K.generatedLine===P.generatedLine){K.lastGeneratedColumn=P.generatedColumn-1;continue}}K.lastGeneratedColumn=1/0}};Aq.prototype.originalPositionFor=function(q){var K={generatedLine:U$.getArg(q,"line"),generatedColumn:U$.getArg(q,"column")},P=this._findMapping(K,this._generatedMappings,"generatedLine","generatedColumn",U$.compareByGeneratedPositionsDeflated,U$.getArg(q,"bias",E6.GREATEST_LOWER_BOUND));if(P>=0){var _=this._generatedMappings[P];if(_.generatedLine===K.generatedLine){var O=U$.getArg(_,"source",null);if(O!==null)O=this._sources.at(O),O=U$.computeSourceURL(this.sourceRoot,O,this._sourceMapURL);var j=U$.getArg(_,"name",null);if(j!==null)j=this._names.at(j);return{source:O,line:U$.getArg(_,"originalLine",null),column:U$.getArg(_,"originalColumn",null),name:j}}}return{source:null,line:null,column:null,name:null}};Aq.prototype.hasContentsOfAllSources=function(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(q){return q==null})};Aq.prototype.sourceContentFor=function(q,K){if(!this.sourcesContent)return null;var P=this._findSourceIndex(q);if(P>=0)return this.sourcesContent[P];var _=q;if(this.sourceRoot!=null)_=U$.relative(this.sourceRoot,_);var O;if(this.sourceRoot!=null&&(O=U$.urlParse(this.sourceRoot))){var j=_.replace(/^file:\/\//,"");if(O.scheme=="file"&&this._sources.has(j))return this.sourcesContent[this._sources.indexOf(j)];if((!O.path||O.path=="/")&&this._sources.has("/"+_))return this.sourcesContent[this._sources.indexOf("/"+_)]}if(K)return null;else throw Error('"'+_+'" is not in the SourceMap.')};Aq.prototype.generatedPositionFor=function(q){var K=U$.getArg(q,"source");if(K=this._findSourceIndex(K),K<0)return{line:null,column:null,lastColumn:null};var P={source:K,originalLine:U$.getArg(q,"line"),originalColumn:U$.getArg(q,"column")},_=this._findMapping(P,this._originalMappings,"originalLine","originalColumn",U$.compareByOriginalPositions,U$.getArg(q,"bias",E6.GREATEST_LOWER_BOUND));if(_>=0){var O=this._originalMappings[_];if(O.source===P.source)return{line:U$.getArg(O,"generatedLine",null),column:U$.getArg(O,"generatedColumn",null),lastColumn:U$.getArg(O,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};tp.BasicSourceMapConsumer=Aq;function R8($,q){var K=$;if(typeof $==="string")K=U$.parseSourceMapInput($);var P=U$.getArg(K,"version"),_=U$.getArg(K,"sections");if(P!=this._version)throw Error("Unsupported version: "+P);this._sources=new E4,this._names=new E4;var O={line:-1,column:0};this._sections=_.map(function(j){if(j.url)throw Error("Support for url field in sections not implemented.");var z=U$.getArg(j,"offset"),J=U$.getArg(z,"line"),w=U$.getArg(z,"column");if(J<O.line||J===O.line&&w<O.column)throw Error("Section offsets must be ordered and non-overlapping.");return O=z,{generatedOffset:{generatedLine:J+1,generatedColumn:w+1},consumer:new E6(U$.getArg(j,"map"),q)}})}R8.prototype=Object.create(E6.prototype);R8.prototype.constructor=E6;R8.prototype._version=3;Object.defineProperty(R8.prototype,"sources",{get:function(){var $=[];for(var q=0;q<this._sections.length;q++)for(var K=0;K<this._sections[q].consumer.sources.length;K++)$.push(this._sections[q].consumer.sources[K]);return $}});R8.prototype.originalPositionFor=function(q){var K={generatedLine:U$.getArg(q,"line"),generatedColumn:U$.getArg(q,"column")},P=SW.search(K,this._sections,function(O,j){var z=O.generatedLine-j.generatedOffset.generatedLine;if(z)return z;return O.generatedColumn-j.generatedOffset.generatedColumn}),_=this._sections[P];if(!_)return{source:null,line:null,column:null,name:null};return _.consumer.originalPositionFor({line:K.generatedLine-(_.generatedOffset.generatedLine-1),column:K.generatedColumn-(_.generatedOffset.generatedLine===K.generatedLine?_.generatedOffset.generatedColumn-1:0),bias:q.bias})};R8.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(q){return q.consumer.hasContentsOfAllSources()})};R8.prototype.sourceContentFor=function(q,K){for(var P=0;P<this._sections.length;P++){var _=this._sections[P],O=_.consumer.sourceContentFor(q,!0);if(O)return O}if(K)return null;else throw Error('"'+q+'" is not in the SourceMap.')};R8.prototype.generatedPositionFor=function(q){for(var K=0;K<this._sections.length;K++){var P=this._sections[K];if(P.consumer._findSourceIndex(U$.getArg(q,"source"))===-1)continue;var _=P.consumer.generatedPositionFor(q);if(_){var O={line:_.line+(P.generatedOffset.generatedLine-1),column:_.column+(P.generatedOffset.generatedLine===_.line?P.generatedOffset.generatedColumn-1:0)};return O}}return{line:null,column:null}};R8.prototype._parseMappings=function(q,K){this.__generatedMappings=[],this.__originalMappings=[];for(var P=0;P<this._sections.length;P++){var _=this._sections[P],O=_.consumer._generatedMappings;for(var j=0;j<O.length;j++){var z=O[j],J=_.consumer._sources.at(z.source);J=U$.computeSourceURL(_.consumer.sourceRoot,J,this._sourceMapURL),this._sources.add(J),J=this._sources.indexOf(J);var w=null;if(z.name)w=_.consumer._names.at(z.name),this._names.add(w),w=this._names.indexOf(w);var k={source:J,generatedLine:z.generatedLine+(_.generatedOffset.generatedLine-1),generatedColumn:z.generatedColumn+(_.generatedOffset.generatedLine===z.generatedLine?_.generatedOffset.generatedColumn-1:0),originalLine:z.originalLine,originalColumn:z.originalColumn,name:w};if(this.__generatedMappings.push(k),typeof k.originalLine==="number")this.__originalMappings.push(k)}}h7(this.__generatedMappings,U$.compareByGeneratedPositionsDeflated),h7(this.__originalMappings,U$.compareByOriginalPositions)};tp.IndexedSourceMapConsumer=R8});var BG=u$(($m)=>{var Qp=XW().SourceMapGenerator,Rj=C4(),ep=/(\r?\n)/,sp=10,h4="$$$isSourceNode$$$";function K8($,q,K,P,_){if(this.children=[],this.sourceContents={},this.line=$==null?null:$,this.column=q==null?null:q,this.source=K==null?null:K,this.name=_==null?null:_,this[h4]=!0,P!=null)this.add(P)}K8.fromStringWithSourceMap=function(q,K,P){var _=new K8,O=q.split(ep),j=0,z=function(){var G=C(),V=C()||"";return G+V;function C(){return j<O.length?O[j++]:void 0}},J=1,w=0,k=null;if(K.eachMapping(function(G){if(k!==null)if(J<G.generatedLine)X(k,z()),J++,w=0;else{var V=O[j]||"",C=V.substr(0,G.generatedColumn-w);O[j]=V.substr(G.generatedColumn-w),w=G.generatedColumn,X(k,C),k=G;return}while(J<G.generatedLine)_.add(z()),J++;if(w<G.generatedColumn){var V=O[j]||"";_.add(V.substr(0,G.generatedColumn)),O[j]=V.substr(G.generatedColumn),w=G.generatedColumn}k=G},this),j<O.length){if(k)X(k,z());_.add(O.splice(j).join(""))}return K.sources.forEach(function(G){var V=K.sourceContentFor(G);if(V!=null){if(P!=null)G=Rj.join(P,G);_.setSourceContent(G,V)}}),_;function X(G,V){if(G===null||G.source===void 0)_.add(V);else{var C=P?Rj.join(P,G.source):G.source;_.add(new K8(G.originalLine,G.originalColumn,C,V,G.name))}}};K8.prototype.add=function(q){if(Array.isArray(q))q.forEach(function(K){this.add(K)},this);else if(q[h4]||typeof q==="string"){if(q)this.children.push(q)}else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+q);return this};K8.prototype.prepend=function(q){if(Array.isArray(q))for(var K=q.length-1;K>=0;K--)this.prepend(q[K]);else if(q[h4]||typeof q==="string")this.children.unshift(q);else throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+q);return this};K8.prototype.walk=function(q){var K;for(var P=0,_=this.children.length;P<_;P++)if(K=this.children[P],K[h4])K.walk(q);else if(K!=="")q(K,{source:this.source,line:this.line,column:this.column,name:this.name})};K8.prototype.join=function(q){var K,P,_=this.children.length;if(_>0){K=[];for(P=0;P<_-1;P++)K.push(this.children[P]),K.push(q);K.push(this.children[P]),this.children=K}return this};K8.prototype.replaceRight=function(q,K){var P=this.children[this.children.length-1];if(P[h4])P.replaceRight(q,K);else if(typeof P==="string")this.children[this.children.length-1]=P.replace(q,K);else this.children.push("".replace(q,K));return this};K8.prototype.setSourceContent=function(q,K){this.sourceContents[Rj.toSetString(q)]=K};K8.prototype.walkSourceContents=function(q){for(var K=0,P=this.children.length;K<P;K++)if(this.children[K][h4])this.children[K].walkSourceContents(q);var _=Object.keys(this.sourceContents);for(var K=0,P=_.length;K<P;K++)q(Rj.fromSetString(_[K]),this.sourceContents[_[K]])};K8.prototype.toString=function(){var q="";return this.walk(function(K){q+=K}),q};K8.prototype.toStringWithSourceMap=function(q){var K={code:"",line:1,column:0},P=new Qp(q),_=!1,O=null,j=null,z=null,J=null;return this.walk(function(w,k){if(K.code+=w,k.source!==null&&k.line!==null&&k.column!==null){if(O!==k.source||j!==k.line||z!==k.column||J!==k.name)P.addMapping({source:k.source,original:{line:k.line,column:k.column},generated:{line:K.line,column:K.column},name:k.name});O=k.source,j=k.line,z=k.column,J=k.name,_=!0}else if(_)P.addMapping({generated:{line:K.line,column:K.column}}),O=null,_=!1;for(var X=0,G=w.length;X<G;X++)if(w.charCodeAt(X)===sp){if(K.line++,K.column=0,X+1===G)O=null,_=!1;else if(_)P.addMapping({source:k.source,original:{line:k.line,column:k.column},generated:{line:K.line,column:K.column},name:k.name})}else K.column++}),this.walkSourceContents(function(w,k){P.setSourceContent(w,k)}),{code:K.code,map:P}};$m.SourceNode=K8});var tG=u$((Km)=>{Km.SourceMapGenerator=XW().SourceMapGenerator;Km.SourceMapConsumer=iG().SourceMapConsumer;Km.SourceNode=BG().SourceNode});var QG=u$((FG,aG)=>{FG.__esModule=!0;var NW=cq(),N_=void 0;try{if(typeof define!=="function"||!define.amd)CW=tG(),N_=CW.SourceNode}catch($){}var CW;if(!N_)N_=function($,q,K,P){if(this.src="",P)this.add(P)},N_.prototype={add:function(q){if(NW.isArray(q))q=q.join("");this.src+=q},prepend:function(q){if(NW.isArray(q))q=q.join("");this.src=q+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}};function MW($,q,K){if(NW.isArray($)){var P=[];for(var _=0,O=$.length;_<O;_++)P.push(q.wrap($[_],K));return P}else if(typeof $==="boolean"||typeof $==="number")return $+"";return $}function UG($){this.srcFile=$,this.source=[]}UG.prototype={isEmpty:function(){return!this.source.length},prepend:function(q,K){this.source.unshift(this.wrap(q,K))},push:function(q,K){this.source.push(this.wrap(q,K))},merge:function(){var q=this.empty();return this.each(function(K){q.add([" ",K,`
10
10
  `])}),q},each:function(q){for(var K=0,P=this.source.length;K<P;K++)q(this.source[K])},empty:function(){var q=this.currentLocation||{start:{}};return new N_(q.start.line,q.start.column,this.srcFile)},wrap:function(q){var K=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(q instanceof N_)return q;return q=MW(q,this,K),new N_(K.start.line,K.start.column,this.srcFile,q)},functionCall:function(q,K,P){return P=this.generateList(P),this.wrap([q,K?"."+K+"(":"(",P,")"])},quotedString:function(q){return'"'+(q+"").replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},objectLiteral:function(q){var K=this,P=[];Object.keys(q).forEach(function(O){var j=MW(q[O],K);if(j!=="undefined")P.push([K.quotedString(O),":",j])});var _=this.generateList(P);return _.prepend("{"),_.add("}"),_},generateList:function(q){var K=this.empty();for(var P=0,_=q.length;P<_;P++){if(P)K.add(",");K.add(MW(q[P],this))}return K},generateArray:function(q){var K=this.generateList(q);return K.prepend("["),K.add("]"),K}};FG.default=UG;aG.exports=FG.default});var _V=u$((qV,KV)=>{qV.__esModule=!0;function $V($){return $&&$.__esModule?$:{default:$}}var eG=Gj(),vm=w8(),EW=$V(vm),zm=cq(),Wm=QG(),sG=$V(Wm);function R4($){this.value=$}function I4(){}I4.prototype={nameLookup:function(q,K){return this.internalNameLookup(q,K)},depthedLookup:function(q){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(q),")"]},compilerInfo:function(){var q=eG.COMPILER_REVISION,K=eG.REVISION_CHANGES[q];return[q,K]},appendToBuffer:function(q,K,P){if(!zm.isArray(q))q=[q];if(q=this.source.wrap(q,K),this.environment.isSimple)return["return ",q,";"];else if(P)return["buffer += ",q,";"];else return q.appendToBuffer=!0,q},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(q,K){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",q,",",JSON.stringify(K),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(q,K,P,_){this.environment=q,this.options=K,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!_,this.name=this.environment.name,this.isChild=!!P,this.context=P||{decorators:[],programs:[],environments:[]},this.preamble(),this.stackSlot=0,this.stackVars=[],this.aliases={},this.registers={list:[]},this.hashes=[],this.compileStack=[],this.inlineStack=[],this.blockParams=[],this.compileChildren(q,K),this.useDepths=this.useDepths||q.useDepths||q.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||q.useBlockParams;var O=q.opcodes,j=void 0,z=void 0,J=void 0,w=void 0;for(J=0,w=O.length;J<w;J++)j=O[J],this.source.currentLocation=j.loc,z=z||j.loc,this[j.opcode].apply(this,j.args);if(this.source.currentLocation=z,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new EW.default("Compile completed with content left on stack");if(!this.decorators.isEmpty())if(this.useDecorators=!0,this.decorators.prepend(["var decorators = container.decorators, ",this.lookupPropertyFunctionVarDeclaration(),`;
@@ -31,10 +31,10 @@ Expecting `+H.join(", ")+", got '"+(this.terminals_[u]||u)+"'";else T="Parse err
31
31
  `)>=0)P++;return O+j.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(_>60)return K[0]+(q===""?"":q+`
32
32
  `)+" "+$.join(`,
33
33
  `)+" "+K[1];return K[0]+q+" "+$.join(", ")+" "+K[1]}function eV($){return Array.isArray($)}function UW($){return typeof $==="boolean"}function mj($){return $===null}function Ud($){return $==null}function sV($){return typeof $==="number"}function dj($){return typeof $==="string"}function Fd($){return typeof $==="symbol"}function b4($){return $===void 0}function yj($){return g4($)&&FW($)==="[object RegExp]"}function g4($){return typeof $==="object"&&$!==null}function BW($){return g4($)&&FW($)==="[object Date]"}function xj($){return g4($)&&(FW($)==="[object Error]"||$ instanceof Error)}function cj($){return typeof $==="function"}function ad($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function Qd($){return $ instanceof Buffer}function FW($){return Object.prototype.toString.call($)}function nW($){return $<10?"0"+$.toString(10):$.toString(10)}function sd(){var $=new Date,q=[nW($.getHours()),nW($.getMinutes()),nW($.getSeconds())].join(":");return[$.getDate(),ed[$.getMonth()],q].join(" ")}function $S(...$){console.log("%s - %s",sd(),tW.apply(null,$))}function qS($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function aW($,q){if(!q||!g4(q))return $;var K=Object.keys(q),P=K.length;while(P--)$[K[P]]=q[K[P]];return $}function KS($,q){return Object.prototype.hasOwnProperty.call($,q)}function QW($,q){if(!$){var K=Error("Promise was rejected with a falsy value");K.reason=$,$=K}return q($)}function PS($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(...K){var P=K.pop();if(typeof P!=="function")throw TypeError("The last argument must be of type Function");var _=this,O=function(...j){return P.apply(_,...j)};$.apply(this,K).then(function(j){process.nextTick(O.bind(null,null,j))},function(j){process.nextTick(QW.bind(null,j,O))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var pd,dd,h_,td=()=>{},ed,_S,jS,OS,$l;var vS=aK(()=>{pd=/%[sdj%]/g;dd=(($={},q={},K)=>((K=typeof process<"u"&&!1)&&(K=K.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+K+"$","i"),(P)=>{if(P=P.toUpperCase(),!$[P])if(q.test(P))$[P]=function(..._){console.error("%s: %s",P,pid,tW.apply(null,..._))};else $[P]=function(){};return $[P]}))(),h_=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function(q,K,...P){var _={seen:[],stylize:rd};if(P.length>=1)_.depth=P[0];if(P.length>=2)_.colors=P[1];if(UW(K))_.showHidden=K;else if(K)aW(_,K);if(b4(_.showHidden))_.showHidden=!1;if(b4(_.depth))_.depth=2;if(b4(_.colors))_.colors=!1;if(_.colors)_.stylize=ld;return pj(_,q,_.depth)});ed=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];_S=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function(q){if(typeof q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&q[kCustomPromisifiedSymbol]){var K=q[kCustomPromisifiedSymbol];if(typeof K!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(...P){var _,O,j=new Promise(function(z,J){_=z,O=J});P.push(function(z,J){if(z)O(z);else _(J)});try{q.apply(this,P)}catch(z){O(z)}return j}if(Object.setPrototypeOf(K,Object.getPrototypeOf(q)),kCustomPromisifiedSymbol)Object.defineProperty(K,kCustomPromisifiedSymbol,{value:K,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(K,Object.getOwnPropertyDescriptors(q))});({TextEncoder:jS,TextDecoder:OS}=globalThis),$l={TextEncoder:jS,TextDecoder:OS,promisify:_S,log:$S,inherits:qS,_extend:aW,callbackifyOnRejected:QW,callbackify:PS}});var b7={};Nq(b7,{setMaxListeners:()=>AS,once:()=>XS,listenerCount:()=>GS,init:()=>iK,getMaxListeners:()=>SS,getEventListeners:()=>kS,default:()=>zl,captureRejectionSymbol:()=>TS,addAbortListener:()=>MS,EventEmitter:()=>iK});function wS($,q){var{_events:K}=$;if(q[0]??=Error("Unhandled error."),!K)throw q[0];var P=K[JS];if(P)for(var _ of WS.call(P))_.apply($,q);var O=K.error;if(!O)throw q[0];for(var _ of WS.call(O))_.apply($,q);return!0}function _l($,q,K,P){q.then(void 0,function(_){queueMicrotask(()=>Pl($,_,K,P))})}function Pl($,q,K,P){if(typeof $[zS]==="function")$[zS](q,K,...P);else try{$[R_]=!1,$.emit("error",q)}finally{$[R_]=!0}}function ZS($,q,K){K.warned=!0;let P=Error(`Possible EventEmitter memory leak detected. ${K.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);P.name="MaxListenersExceededWarning",P.emitter=$,P.type=q,P.count=K.length,console.warn(P)}function fS($,q,...K){this.removeListener($,q),q.apply(this,K)}function XS($,q,K){var P=K?.signal;if(VS(P,"options.signal"),P?.aborted)throw new eW(void 0,{cause:P?.reason});let{resolve:_,reject:O,promise:j}=$newPromiseCapability(Promise),z=(k)=>{if($.removeListener(q,J),P!=null)lj(P,"abort",w);O(k)},J=(...k)=>{if(typeof $.removeListener==="function")$.removeListener("error",z);if(P!=null)lj(P,"abort",w);_(k)};if(HS($,q,J,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",z);function w(){lj($,q,J),lj($,"error",z),O(new eW(void 0,{cause:P?.reason}))}if(P!=null)HS(P,"abort",w,{once:!0});return j}function kS($,q){return $.listeners(q)}function AS($,...q){$H($,"setMaxListeners",0);var K;if(q&&(K=q.length))for(let P=0;P<K;P++)q[P].setMaxListeners($);else I_=$}function GS($,q){return $.listenerCount(q)}function lj($,q,K,P){if(typeof $.removeListener==="function")$.removeListener(q,K);else $.removeEventListener(q,K,P)}function HS($,q,K,P){if(typeof $.on==="function")if(P.once)$.once(q,K);else $.on(q,K);else $.addEventListener(q,K,P)}function u4($,q,K){let P=TypeError(`The "${$}" argument must be of type ${q}. Received ${K}`);return P.code="ERR_INVALID_ARG_TYPE",P}function Yl($,q,K){let P=RangeError(`The "${$}" argument is out of range. It must be ${q}. Received ${K}`);return P.code="ERR_OUT_OF_RANGE",P}function VS($,q){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw u4(q,"AbortSignal",$)}function $H($,q,K,P){if(typeof $!=="number")throw u4(q,"number",$);if(K!=null&&$<K||P!=null&&$>P||(K!=null||P!=null)&&Number.isNaN($))throw Yl(q,`${K!=null?`>= ${K}`:""}${K!=null&&P!=null?" && ":""}${P!=null?`<= ${P}`:""}`,$)}function L7($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function vl($,q){if(typeof $!=="boolean")throw u4(q,"boolean",$)}function SS($){return $?._maxListeners??I_}function MS($,q){if($===void 0)throw u4("signal","AbortSignal",$);if(VS($,"signal"),typeof q!=="function")throw u4("listener","function",q);let K;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),K=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){K?.()}}}var sW,R_,JS,ql,Kl,zS,TS,WS,I_=10,iK=function(q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[R_]=q?.captureRejections?Boolean(q?.captureRejections):h6[R_])this.emit=Ol},h6,jl=function(q,...K){if(q==="error")return wS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j];switch(K.length){case 0:J.call(this);break;case 1:J.call(this,K[0]);break;case 2:J.call(this,K[0],K[1]);break;case 3:J.call(this,K[0],K[1],K[2]);break;default:J.apply(this,K);break}}return!0},Ol=function(q,...K){if(q==="error")return wS(this,K);var{_events:P}=this;if(P===void 0)return!1;var _=P[q];if(_===void 0)return!1;let O=_.length>1?_.slice():_;for(let j=0,{length:z}=O;j<z;j++){let J=O[j],w;switch(K.length){case 0:w=J.call(this);break;case 1:w=J.call(this,K[0]);break;case 2:w=J.call(this,K[0],K[1]);break;case 3:w=J.call(this,K[0],K[1],K[2]);break;default:w=J.apply(this,K);break}if(w!==void 0&&typeof w?.then==="function"&&w.then===Promise.prototype.then)_l(this,w,q,K)}return!0},eW,zl;var g7=aK(()=>{sW=Symbol.for,R_=Symbol("kCapture"),JS=sW("events.errorMonitor"),ql=Symbol("events.maxEventTargetListeners"),Kl=Symbol("events.maxEventTargetListenersWarned"),zS=sW("nodejs.rejection"),TS=sW("nodejs.rejection"),WS=Array.prototype.slice,h6=iK.prototype={};h6._events=void 0;h6._eventsCount=0;h6._maxListeners=void 0;h6.setMaxListeners=function(q){return $H(q,"setMaxListeners",0),this._maxListeners=q,this};h6.constructor=iK;h6.getMaxListeners=function(){return this?._maxListeners??I_};h6.emit=jl;h6.addListener=function(q,K){L7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.push(K);var O=this._maxListeners??I_;if(O>0&&_.length>O&&!_.warned)ZS(this,q,_)}return this};h6.on=h6.addListener;h6.prependListener=function(q,K){L7(K);var P=this._events;if(!P)P=this._events={__proto__:null},this._eventsCount=0;else if(P.newListener)this.emit("newListener",q,K.listener??K);var _=P[q];if(!_)P[q]=[K],this._eventsCount++;else{_.unshift(K);var O=this._maxListeners??I_;if(O>0&&_.length>O&&!_.warned)ZS(this,q,_)}return this};h6.once=function(q,K){L7(K);let P=fS.bind(this,q,K);return P.listener=K,this.addListener(q,P),this};h6.prependOnceListener=function(q,K){L7(K);let P=fS.bind(this,q,K);return P.listener=K,this.prependListener(q,P),this};h6.removeListener=function(q,K){L7(K);var{_events:P}=this;if(!P)return this;var _=P[q];if(!_)return this;var O=_.length;let j=-1;for(let z=O-1;z>=0;z--)if(_[z]===K||_[z].listener===K){j=z;break}if(j<0)return this;if(j===0)_.shift();else _.splice(j,1);if(_.length===0)delete P[q],this._eventsCount--;return this};h6.off=h6.removeListener;h6.removeAllListeners=function(q){var{_events:K}=this;if(q&&K){if(K[q])delete K[q],this._eventsCount--}else this._events={__proto__:null};return this};h6.listeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.map((_)=>_.listener??_)};h6.rawListeners=function(q){var{_events:K}=this;if(!K)return[];var P=K[q];if(!P)return[];return P.slice()};h6.listenerCount=function(q){var{_events:K}=this;if(!K)return 0;return K[q]?.length??0};h6.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};h6[R_]=!1;eW=class eW extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw u4("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(iK,{captureRejections:{get(){return h6[R_]},set($){vl($,"EventEmitter.captureRejections"),h6[R_]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return I_},set:($)=>{$H($,"defaultMaxListeners",0),I_=$}},kMaxEventTargetListeners:{value:ql,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:Kl,enumerable:!1,configurable:!1,writable:!1}});Object.assign(iK,{once:XS,getEventListeners:kS,getMaxListeners:SS,setMaxListeners:AS,EventEmitter:iK,usingDomains:!1,captureRejectionSymbol:TS,errorMonitor:JS,addAbortListener:MS,init:iK,listenerCount:GS});zl=iK});var PH=u$((aK$,LS)=>{var A6=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),L6=A6(($,q)=>{class K extends Error{constructor(P){if(!Array.isArray(P))throw TypeError(`Expected input to be an Array, got ${typeof P}`);let _="";for(let O=0;O<P.length;O++)_+=` ${P[O].stack}
34
- `;super(_);this.name="AggregateError",this.errors=P}}q.exports={AggregateError:K,ArrayIsArray(P){return Array.isArray(P)},ArrayPrototypeIncludes(P,_){return P.includes(_)},ArrayPrototypeIndexOf(P,_){return P.indexOf(_)},ArrayPrototypeJoin(P,_){return P.join(_)},ArrayPrototypeMap(P,_){return P.map(_)},ArrayPrototypePop(P,_){return P.pop(_)},ArrayPrototypePush(P,_){return P.push(_)},ArrayPrototypeSlice(P,_,O){return P.slice(_,O)},Error,FunctionPrototypeCall(P,_,...O){return P.call(_,...O)},FunctionPrototypeSymbolHasInstance(P,_){return Function.prototype[Symbol.hasInstance].call(P,_)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(P,_){return Object.defineProperties(P,_)},ObjectDefineProperty(P,_,O){return Object.defineProperty(P,_,O)},ObjectGetOwnPropertyDescriptor(P,_){return Object.getOwnPropertyDescriptor(P,_)},ObjectKeys(P){return Object.keys(P)},ObjectSetPrototypeOf(P,_){return Object.setPrototypeOf(P,_)},Promise,PromisePrototypeCatch(P,_){return P.catch(_)},PromisePrototypeThen(P,_,O){return P.then(_,O)},PromiseReject(P){return Promise.reject(P)},PromiseResolve(P){return Promise.resolve(P)},ReflectApply:Reflect.apply,RegExpPrototypeTest(P,_){return P.test(_)},SafeSet:Set,String,StringPrototypeSlice(P,_,O){return P.slice(_,O)},StringPrototypeToLowerCase(P){return P.toLowerCase()},StringPrototypeToUpperCase(P){return P.toUpperCase()},StringPrototypeTrim(P){return P.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(P,_,O){return P.set(_,O)},Boolean,Uint8Array}}),NS=A6(($,q)=>{q.exports={format(K,...P){return K.replace(/%([sdifj])/g,function(...[_,O]){let j=P.shift();if(O==="f")return j.toFixed(6);else if(O==="j")return JSON.stringify(j);else if(O==="s"&&typeof j==="object")return`${j.constructor!==Object?j.constructor.name:""} {}`.trim();else return j.toString()})},inspect(K){switch(typeof K){case"string":if(K.includes("'")){if(!K.includes('"'))return`"${K}"`;else if(!K.includes("`")&&!K.includes("${"))return`\`${K}\``}return`'${K}'`;case"number":if(isNaN(K))return"NaN";else if(Object.is(K,-0))return String(K);return K;case"bigint":return`${String(K)}n`;case"boolean":case"undefined":return String(K);case"object":return"{}"}}}}),pq=A6(($,q)=>{var{format:K,inspect:P}=NS(),{AggregateError:_}=L6(),O=globalThis.AggregateError||_,j=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],J=/^([A-Z][a-z0-9]*)+$/,w={};function k(I,D){if(!I)throw new w.ERR_INTERNAL_ASSERTION(D)}function X(I){let D="",g=I.length,u=I[0]==="-"?1:0;for(;g>=u+4;g-=3)D=`_${I.slice(g-3,g)}${D}`;return`${I.slice(0,g)}${D}`}function G(I,D,g){if(typeof D==="function")return k(D.length<=g.length,`Code: ${I}; The provided arguments length (${g.length}) does not match the required ones (${D.length}).`),D(...g);let u=(D.match(/%[dfijoOs]/g)||[]).length;if(k(u===g.length,`Code: ${I}; The provided arguments length (${g.length}) does not match the required ones (${u}).`),g.length===0)return D;return K(D,...g)}function V(I,D,g){if(!g)g=Error;class u extends g{constructor(...y){super(G(I,D,y))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(u.prototype,{name:{value:g.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),u.prototype.code=I,u.prototype[j]=!0,w[I]=u}function C(I){let D="__node_internal_"+I.name;return Object.defineProperty(I,"name",{value:D}),I}function E(I,D){if(I&&D&&I!==D){if(Array.isArray(D.errors))return D.errors.push(I),D;let g=new O([D,I],D.message);return g.code=D.code,g}return I||D}class h extends Error{constructor(I="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!=="object")throw new w.ERR_INVALID_ARG_TYPE("options","Object",D);super(I,D);this.code="ABORT_ERR",this.name="AbortError"}}V("ERR_ASSERTION","%s",Error),V("ERR_INVALID_ARG_TYPE",(I,D,g)=>{if(k(typeof I==="string","'name' must be a string"),!Array.isArray(D))D=[D];let u="The ";if(I.endsWith(" argument"))u+=`${I} `;else u+=`"${I}" ${I.includes(".")?"property":"argument"} `;u+="must be ";let y=[],p=[],m=[];for(let U of D)if(k(typeof U==="string","All expected entries have to be of type string"),z.includes(U))y.push(U.toLowerCase());else if(J.test(U))p.push(U);else k(U!=="object",'The value "object" should be written as "Object"'),m.push(U);if(p.length>0){let U=y.indexOf("object");if(U!==-1)y.splice(y,U,1),p.push("Object")}if(y.length>0){switch(y.length){case 1:u+=`of type ${y[0]}`;break;case 2:u+=`one of type ${y[0]} or ${y[1]}`;break;default:{let U=y.pop();u+=`one of type ${y.join(", ")}, or ${U}`}}if(p.length>0||m.length>0)u+=" or "}if(p.length>0){switch(p.length){case 1:u+=`an instance of ${p[0]}`;break;case 2:u+=`an instance of ${p[0]} or ${p[1]}`;break;default:{let U=p.pop();u+=`an instance of ${p.join(", ")}, or ${U}`}}if(m.length>0)u+=" or "}switch(m.length){case 0:break;case 1:if(m[0].toLowerCase()!==m[0])u+="an ";u+=`${m[0]}`;break;case 2:u+=`one of ${m[0]} or ${m[1]}`;break;default:{let U=m.pop();u+=`one of ${m.join(", ")}, or ${U}`}}if(g==null)u+=`. Received ${g}`;else if(typeof g==="function"&&g.name)u+=`. Received function ${g.name}`;else if(typeof g==="object"){var s;if((s=g.constructor)!==null&&s!==void 0&&s.name)u+=`. Received an instance of ${g.constructor.name}`;else{let U=P(g,{depth:-1});u+=`. Received ${U}`}}else{let U=P(g,{colors:!1});if(U.length>25)U=`${U.slice(0,25)}...`;u+=`. Received type ${typeof g} (${U})`}return u},TypeError),V("ERR_INVALID_ARG_VALUE",(I,D,g="is invalid")=>{let u=P(D);if(u.length>128)u=u.slice(0,128)+"...";return`The ${I.includes(".")?"property":"argument"} '${I}' ${g}. Received ${u}`},TypeError),V("ERR_INVALID_RETURN_VALUE",(I,D,g)=>{var u;let y=g!==null&&g!==void 0&&(u=g.constructor)!==null&&u!==void 0&&u.name?`instance of ${g.constructor.name}`:`type ${typeof g}`;return`Expected ${I} to be returned from the "${D}" function but got ${y}.`},TypeError),V("ERR_MISSING_ARGS",(...I)=>{k(I.length>0,"At least one arg needs to be specified");let D,g=I.length;switch(I=(Array.isArray(I)?I:[I]).map((u)=>`"${u}"`).join(" or "),g){case 1:D+=`The ${I[0]} argument`;break;case 2:D+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let u=I.pop();D+=`The ${I.join(", ")}, and ${u} arguments`}break}return`${D} must be specified`},TypeError),V("ERR_OUT_OF_RANGE",(I,D,g)=>{k(D,'Missing "range" argument');let u;if(Number.isInteger(g)&&Math.abs(g)>4294967296)u=X(String(g));else if(typeof g==="bigint"){u=String(g);let y=BigInt(2)**BigInt(32);if(g>y||g<-y)u=X(u);u+="n"}else u=P(g);return`The value of "${I}" is out of range. It must be ${D}. Received ${u}`},RangeError),V("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),V("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),V("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),V("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),V("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),V("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),V("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),V("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),V("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),V("ERR_STREAM_WRITE_AFTER_END","write after end",Error),V("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:h,aggregateTwoErrors:C(E),hideStackFrames:C,codes:w}}),Wl=A6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=new WeakMap,P=new WeakMap;function _(l){let o=K.get(l);return console.assert(o!=null,"'this' is expected an Event object, but got",l),o}function O(l){if(l.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",l.passiveListener);return}if(!l.event.cancelable)return;if(l.canceled=!0,typeof l.event.preventDefault==="function")l.event.preventDefault()}function j(l,o){K.set(this,{eventTarget:l,event:o,eventPhase:2,currentTarget:l,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:o.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let M=Object.keys(o);for(let Y=0;Y<M.length;++Y){let H=M[Y];if(!(H in this))Object.defineProperty(this,H,z(H))}}if(j.prototype={get type(){return _(this).event.type},get target(){return _(this).eventTarget},get currentTarget(){return _(this).currentTarget},composedPath(){let l=_(this).currentTarget;if(l==null)return[];return[l]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return _(this).eventPhase},stopPropagation(){let l=_(this);if(l.stopped=!0,typeof l.event.stopPropagation==="function")l.event.stopPropagation()},stopImmediatePropagation(){let l=_(this);if(l.stopped=!0,l.immediateStopped=!0,typeof l.event.stopImmediatePropagation==="function")l.event.stopImmediatePropagation()},get bubbles(){return Boolean(_(this).event.bubbles)},get cancelable(){return Boolean(_(this).event.cancelable)},preventDefault(){O(_(this))},get defaultPrevented(){return _(this).canceled},get composed(){return Boolean(_(this).event.composed)},get timeStamp(){return _(this).timeStamp},get srcElement(){return _(this).eventTarget},get cancelBubble(){return _(this).stopped},set cancelBubble(l){if(!l)return;let o=_(this);if(o.stopped=!0,typeof o.event.cancelBubble==="boolean")o.event.cancelBubble=!0},get returnValue(){return!_(this).canceled},set returnValue(l){if(!l)O(_(this))},initEvent(){}},Object.defineProperty(j.prototype,"constructor",{value:j,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(j.prototype,window.Event.prototype),P.set(window.Event.prototype,j);function z(l){return{get(){return _(this).event[l]},set(o){_(this).event[l]=o},configurable:!0,enumerable:!0}}function J(l){return{value(){let o=_(this).event;return o[l].apply(o,arguments)},configurable:!0,enumerable:!0}}function w(l,o){let M=Object.keys(o);if(M.length===0)return l;function Y(H,T){l.call(this,H,T)}Y.prototype=Object.create(l.prototype,{constructor:{value:Y,configurable:!0,writable:!0}});for(let H=0;H<M.length;++H){let T=M[H];if(!(T in l.prototype)){let W=typeof Object.getOwnPropertyDescriptor(o,T).value==="function";Object.defineProperty(Y.prototype,T,W?J(T):z(T))}}return Y}function k(l){if(l==null||l===Object.prototype)return j;let o=P.get(l);if(o==null)o=w(k(Object.getPrototypeOf(l)),l),P.set(l,o);return o}function X(l,o){return new(k(Object.getPrototypeOf(o)))(l,o)}function G(l){return _(l).immediateStopped}function V(l,o){_(l).eventPhase=o}function C(l,o){_(l).currentTarget=o}function E(l,o){_(l).passiveListener=o}var h=new WeakMap,I=1,D=2,g=3;function u(l){return l!==null&&typeof l==="object"}function y(l){let o=h.get(l);if(o==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return o}function p(l){return{get(){let o=y(this).get(l);while(o!=null){if(o.listenerType===g)return o.listener;o=o.next}return null},set(o){if(typeof o!=="function"&&!u(o))o=null;let M=y(this),Y=null,H=M.get(l);while(H!=null){if(H.listenerType===g)if(Y!==null)Y.next=H.next;else if(H.next!==null)M.set(l,H.next);else M.delete(l);else Y=H;H=H.next}if(o!==null){let T={listener:o,listenerType:g,passive:!1,once:!1,next:null};if(Y===null)M.set(l,T);else Y.next=T}},configurable:!0,enumerable:!0}}function m(l,o){Object.defineProperty(l,`on${o}`,p(o))}function s(l){function o(){U.call(this)}o.prototype=Object.create(U.prototype,{constructor:{value:o,configurable:!0,writable:!0}});for(let M=0;M<l.length;++M)m(o.prototype,l[M]);return o}function U(){if(this instanceof U){h.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return s(arguments[0]);if(arguments.length>0){let l=Array(arguments.length);for(let o=0;o<arguments.length;++o)l[o]=arguments[o];return s(l)}throw TypeError("Cannot call a class as a function")}if(U.prototype={addEventListener(l,o,M){if(o==null)return;if(typeof o!=="function"&&!u(o))throw TypeError("'listener' should be a function or an object.");let Y=y(this),H=u(M),T=(H?Boolean(M.capture):Boolean(M))?I:D,W={listener:o,listenerType:T,passive:H&&Boolean(M.passive),once:H&&Boolean(M.once),next:null},Z=Y.get(l);if(Z===void 0){Y.set(l,W);return}let S=null;while(Z!=null){if(Z.listener===o&&Z.listenerType===T)return;S=Z,Z=Z.next}S.next=W},removeEventListener(l,o,M){if(o==null)return;let Y=y(this),H=(u(M)?Boolean(M.capture):Boolean(M))?I:D,T=null,W=Y.get(l);while(W!=null){if(W.listener===o&&W.listenerType===H){if(T!==null)T.next=W.next;else if(W.next!==null)Y.set(l,W.next);else Y.delete(l);return}T=W,W=W.next}},dispatchEvent(l){if(l==null||typeof l.type!=="string")throw TypeError('"event.type" should be a string.');let o=y(this),M=l.type,Y=o.get(M);if(Y==null)return!0;let H=X(this,l),T=null;while(Y!=null){if(Y.once)if(T!==null)T.next=Y.next;else if(Y.next!==null)o.set(M,Y.next);else o.delete(M);else T=Y;if(E(H,Y.passive?Y.listener:null),typeof Y.listener==="function")try{Y.listener.call(this,H)}catch(W){if(typeof console<"u"&&typeof console.error==="function")console.error(W)}else if(Y.listenerType!==g&&typeof Y.listener.handleEvent==="function")Y.listener.handleEvent(H);if(G(H))break;Y=Y.next}return E(H,null),V(H,0),C(H,null),!H.defaultPrevented}},Object.defineProperty(U.prototype,"constructor",{value:U,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(U.prototype,window.EventTarget.prototype);$.defineEventAttribute=m,$.EventTarget=U,$.default=U,q.exports=U,q.exports.EventTarget=q.exports.default=U,q.exports.defineEventAttribute=m}),u7=A6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=Wl();class P extends K.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let k=j.get(this);if(typeof k!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return k}}K.defineEventAttribute(P.prototype,"abort");function _(){let k=Object.create(P.prototype);return K.EventTarget.call(k),j.set(k,!1),k}function O(k){if(j.get(k)!==!1)return;j.set(k,!0),k.dispatchEvent({type:"abort"})}var j=new WeakMap;if(Object.defineProperties(P.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(P.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){J.set(this,_())}get signal(){return w(this)}abort(){O(w(this))}}var J=new WeakMap;function w(k){let X=J.get(k);if(X==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${k===null?"null":typeof k}`);return X}if(Object.defineProperties(z.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(z.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=z,$.AbortSignal=P,$.default=z,q.exports=z,q.exports.AbortController=q.exports.default=z,q.exports.AbortSignal=P}),Fq=A6(($,q)=>{var K=(vq(),W6(Yq)),{format:P,inspect:_}=NS(),{codes:{ERR_INVALID_ARG_TYPE:O}}=pq(),{kResistStopPropagation:j,AggregateError:z,SymbolDispose:J}=L6(),w=globalThis.AbortSignal||u7().AbortSignal,k=globalThis.AbortController||u7().AbortController,X=Object.getPrototypeOf(async function(){}).constructor,G=globalThis.Blob||K.Blob,V=typeof G<"u"?function(I){return I instanceof G}:function(I){return!1},C=(h,I)=>{if(h!==void 0&&(h===null||typeof h!=="object"||!("aborted"in h)))throw new O(I,"AbortSignal",h)},E=(h,I)=>{if(typeof h!=="function")throw new O(I,"Function",h)};q.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(h){let I=!1;return function(...D){if(I)return;I=!0,h.apply(this,D)}},createDeferredPromise:function(){let h,I;return{promise:new Promise((D,g)=>{h=D,I=g}),resolve:h,reject:I}},promisify(h){return new Promise((I,D)=>{h((g,...u)=>{if(g)return D(g);return I(...u)})})},debuglog(){return function(){}},format:P,inspect:_,types:{isAsyncFunction(h){return h instanceof X},isArrayBufferView(h){return ArrayBuffer.isView(h)}},isBlob:V,deprecate(h,I){return h},addAbortListener:(g7(),W6(b7)).addAbortListener||function(I,D){if(I===void 0)throw new O("signal","AbortSignal",I);C(I,"signal"),E(D,"listener");let g;if(I.aborted)queueMicrotask(()=>D());else I.addEventListener("abort",D,{__proto__:null,once:!0,[j]:!0}),g=()=>{I.removeEventListener("abort",D)};return{__proto__:null,[J](){var u;(u=g)===null||u===void 0||u()}}},AbortSignalAny:w.any||function(I){if(I.length===1)return I[0];let D=new k,g=()=>D.abort();return I.forEach((u)=>{C(u,"signals"),u.addEventListener("abort",g,{once:!0})}),D.signal.addEventListener("abort",()=>{I.forEach((u)=>u.removeEventListener("abort",g))},{once:!0}),D.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),y7=A6(($,q)=>{var{ArrayIsArray:K,ArrayPrototypeIncludes:P,ArrayPrototypeJoin:_,ArrayPrototypeMap:O,NumberIsInteger:j,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:J,NumberMIN_SAFE_INTEGER:w,NumberParseInt:k,ObjectPrototypeHasOwnProperty:X,RegExpPrototypeExec:G,String:V,StringPrototypeToUpperCase:C,StringPrototypeTrim:E}=L6(),{hideStackFrames:h,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:D,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:u,ERR_UNKNOWN_SIGNAL:y}}=pq(),{normalizeEncoding:p}=Fq(),{isAsyncFunction:m,isArrayBufferView:s}=Fq().types,U={};function l(e){return e===(e|0)}function o(e){return e===e>>>0}var M=/^[0-7]+$/,Y="must be a 32-bit unsigned integer or an octal string";function H(e,F,_$){if(typeof e>"u")e=_$;if(typeof e==="string"){if(G(M,e)===null)throw new g(F,e,Y);e=k(e,8)}return Z(e,F),e}var T=h((e,F,_$=w,f$=J)=>{if(typeof e!=="number")throw new D(F,"number",e);if(!j(e))throw new u(F,"an integer",e);if(e<_$||e>f$)throw new u(F,`>= ${_$} && <= ${f$}`,e)}),W=h((e,F,_$=-2147483648,f$=2147483647)=>{if(typeof e!=="number")throw new D(F,"number",e);if(!j(e))throw new u(F,"an integer",e);if(e<_$||e>f$)throw new u(F,`>= ${_$} && <= ${f$}`,e)}),Z=h((e,F,_$=!1)=>{if(typeof e!=="number")throw new D(F,"number",e);if(!j(e))throw new u(F,"an integer",e);let f$=_$?1:0,O$=4294967295;if(e<f$||e>O$)throw new u(F,`>= ${f$} && <= ${O$}`,e)});function S(e,F){if(typeof e!=="string")throw new D(F,"string",e)}function N(e,F,_$=void 0,f$){if(typeof e!=="number")throw new D(F,"number",e);if(_$!=null&&e<_$||f$!=null&&e>f$||(_$!=null||f$!=null)&&z(e))throw new u(F,`${_$!=null?`>= ${_$}`:""}${_$!=null&&f$!=null?" && ":""}${f$!=null?`<= ${f$}`:""}`,e)}var f=h((e,F,_$)=>{if(!P(_$,e)){let f$="must be one of: "+_(O(_$,(O$)=>typeof O$==="string"?`'${O$}'`:V(O$)),", ");throw new g(F,e,f$)}});function v(e,F){if(typeof e!=="boolean")throw new D(F,"boolean",e)}function A(e,F,_$){return e==null||!X(e,F)?_$:e[F]}var L=h((e,F,_$=null)=>{let f$=A(_$,"allowArray",!1),O$=A(_$,"allowFunction",!1);if(!A(_$,"nullable",!1)&&e===null||!f$&&K(e)||typeof e!=="object"&&(!O$||typeof e!=="function"))throw new D(F,"Object",e)}),R=h((e,F)=>{if(e!=null&&typeof e!=="object"&&typeof e!=="function")throw new D(F,"a dictionary",e)}),b=h((e,F,_$=0)=>{if(!K(e))throw new D(F,"Array",e);if(e.length<_$){let f$=`must be longer than ${_$}`;throw new g(F,e,f$)}});function d(e,F){b(e,F);for(let _$=0;_$<e.length;_$++)S(e[_$],`${F}[${_$}]`)}function i(e,F){b(e,F);for(let _$=0;_$<e.length;_$++)v(e[_$],`${F}[${_$}]`)}function a(e,F){b(e,F);for(let _$=0;_$<e.length;_$++){let f$=e[_$],O$=`${F}[${_$}]`;if(f$==null)throw new D(O$,"AbortSignal",f$);Y$(f$,O$)}}function W$(e,F="signal"){if(S(e,F),U[e]===void 0){if(U[C(e)]!==void 0)throw new y(e+" (signals must use all capital letters)");throw new y(e)}}var n=h((e,F="buffer")=>{if(!s(e))throw new D(F,["Buffer","TypedArray","DataView"],e)});function B(e,F){let _$=p(F),f$=e.length;if(_$==="hex"&&f$%2!==0)throw new g("encoding",F,`is invalid for data of length ${f$}`)}function y$(e,F="Port",_$=!0){if(typeof e!=="number"&&typeof e!=="string"||typeof e==="string"&&E(e).length===0||+e!==+e>>>0||e>65535||e===0&&!_$)throw new I(F,e,_$);return e|0}var Y$=h((e,F)=>{if(e!==void 0&&(e===null||typeof e!=="object"||!("aborted"in e)))throw new D(F,"AbortSignal",e)}),v$=h((e,F)=>{if(typeof e!=="function")throw new D(F,"Function",e)}),Q=h((e,F)=>{if(typeof e!=="function"||m(e))throw new D(F,"Function",e)}),r=h((e,F)=>{if(e!==void 0)throw new D(F,"undefined",e)});function t(e,F,_$){if(!P(_$,e))throw new D(F,`('${_(_$,"|")}')`,e)}var x$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q$(e,F){if(typeof e>"u"||!G(x$,e))throw new g(F,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function $$(e){if(typeof e==="string")return q$(e,"hints"),e;else if(K(e)){let F=e.length,_$="";if(F===0)return _$;for(let f$=0;f$<F;f$++){let O$=e[f$];if(q$(O$,"hints"),_$+=O$,f$!==F-1)_$+=", "}return _$}throw new g("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}q.exports={isInt32:l,isUint32:o,parseFileMode:H,validateArray:b,validateStringArray:d,validateBooleanArray:i,validateAbortSignalArray:a,validateBoolean:v,validateBuffer:n,validateDictionary:R,validateEncoding:B,validateFunction:v$,validateInt32:W,validateInteger:T,validateNumber:N,validateObject:L,validateOneOf:f,validatePlainFunction:Q,validatePort:y$,validateSignalName:W$,validateString:S,validateUint32:Z,validateUndefined:r,validateUnion:t,validateAbortSignal:Y$,validateLinkHeaderValue:$$}}),D_=A6(($,q)=>{q.exports=globalThis.process}),kK=A6(($,q)=>{var{SymbolAsyncIterator:K,SymbolIterator:P,SymbolFor:_}=L6(),O=_("nodejs.stream.destroyed"),j=_("nodejs.stream.errored"),z=_("nodejs.stream.readable"),J=_("nodejs.stream.writable"),w=_("nodejs.stream.disturbed"),k=_("nodejs.webstream.isClosedPromise"),X=_("nodejs.webstream.controllerErrorFunction");function G(A,L=!1){var R;return!!(A&&typeof A.pipe==="function"&&typeof A.on==="function"&&(!L||typeof A.pause==="function"&&typeof A.resume==="function")&&(!A._writableState||((R=A._readableState)===null||R===void 0?void 0:R.readable)!==!1)&&(!A._writableState||A._readableState))}function V(A){var L;return!!(A&&typeof A.write==="function"&&typeof A.on==="function"&&(!A._readableState||((L=A._writableState)===null||L===void 0?void 0:L.writable)!==!1))}function C(A){return!!(A&&typeof A.pipe==="function"&&A._readableState&&typeof A.on==="function"&&typeof A.write==="function")}function E(A){return A&&(A._readableState||A._writableState||typeof A.write==="function"&&typeof A.on==="function"||typeof A.pipe==="function"&&typeof A.on==="function")}function h(A){return!!(A&&!E(A)&&typeof A.pipeThrough==="function"&&typeof A.getReader==="function"&&typeof A.cancel==="function")}function I(A){return!!(A&&!E(A)&&typeof A.getWriter==="function"&&typeof A.abort==="function")}function D(A){return!!(A&&!E(A)&&typeof A.readable==="object"&&typeof A.writable==="object")}function g(A){return h(A)||I(A)||D(A)}function u(A,L){if(A==null)return!1;if(L===!0)return typeof A[K]==="function";if(L===!1)return typeof A[P]==="function";return typeof A[K]==="function"||typeof A[P]==="function"}function y(A){if(!E(A))return null;let{_writableState:L,_readableState:R}=A,b=L||R;return!!(A.destroyed||A[O]||b!==null&&b!==void 0&&b.destroyed)}function p(A){if(!V(A))return null;if(A.writableEnded===!0)return!0;let L=A._writableState;if(L!==null&&L!==void 0&&L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function m(A,L){if(!V(A))return null;if(A.writableFinished===!0)return!0;let R=A._writableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.finished)!=="boolean")return null;return!!(R.finished||L===!1&&R.ended===!0&&R.length===0)}function s(A){if(!G(A))return null;if(A.readableEnded===!0)return!0;let L=A._readableState;if(!L||L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function U(A,L){if(!G(A))return null;let R=A._readableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.endEmitted)!=="boolean")return null;return!!(R.endEmitted||L===!1&&R.ended===!0&&R.length===0)}function l(A){if(A&&A[z]!=null)return A[z];if(typeof(A===null||A===void 0?void 0:A.readable)!=="boolean")return null;if(y(A))return!1;return G(A)&&A.readable&&!U(A)}function o(A){if(A&&A[J]!=null)return A[J];if(typeof(A===null||A===void 0?void 0:A.writable)!=="boolean")return null;if(y(A))return!1;return V(A)&&A.writable&&!p(A)}function M(A,L){if(!E(A))return null;if(y(A))return!0;if((L===null||L===void 0?void 0:L.readable)!==!1&&l(A))return!1;if((L===null||L===void 0?void 0:L.writable)!==!1&&o(A))return!1;return!0}function Y(A){var L,R;if(!E(A))return null;if(A.writableErrored)return A.writableErrored;return(L=(R=A._writableState)===null||R===void 0?void 0:R.errored)!==null&&L!==void 0?L:null}function H(A){var L,R;if(!E(A))return null;if(A.readableErrored)return A.readableErrored;return(L=(R=A._readableState)===null||R===void 0?void 0:R.errored)!==null&&L!==void 0?L:null}function T(A){if(!E(A))return null;if(typeof A.closed==="boolean")return A.closed;let{_writableState:L,_readableState:R}=A;if(typeof(L===null||L===void 0?void 0:L.closed)==="boolean"||typeof(R===null||R===void 0?void 0:R.closed)==="boolean")return(L===null||L===void 0?void 0:L.closed)||(R===null||R===void 0?void 0:R.closed);if(typeof A._closed==="boolean"&&W(A))return A._closed;return null}function W(A){return typeof A._closed==="boolean"&&typeof A._defaultKeepAlive==="boolean"&&typeof A._removedConnection==="boolean"&&typeof A._removedContLen==="boolean"}function Z(A){return typeof A._sent100==="boolean"&&W(A)}function S(A){var L;return typeof A._consuming==="boolean"&&typeof A._dumped==="boolean"&&((L=A.req)===null||L===void 0?void 0:L.upgradeOrConnect)===void 0}function N(A){if(!E(A))return null;let{_writableState:L,_readableState:R}=A,b=L||R;return!b&&Z(A)||!!(b&&b.autoDestroy&&b.emitClose&&b.closed===!1)}function f(A){var L;return!!(A&&((L=A[w])!==null&&L!==void 0?L:A.readableDidRead||A.readableAborted))}function v(A){var L,R,b,d,i,a,W$,n,B,y$;return!!(A&&((L=(R=(b=(d=(i=(a=A[j])!==null&&a!==void 0?a:A.readableErrored)!==null&&i!==void 0?i:A.writableErrored)!==null&&d!==void 0?d:(W$=A._readableState)===null||W$===void 0?void 0:W$.errorEmitted)!==null&&b!==void 0?b:(n=A._writableState)===null||n===void 0?void 0:n.errorEmitted)!==null&&R!==void 0?R:(B=A._readableState)===null||B===void 0?void 0:B.errored)!==null&&L!==void 0?L:(y$=A._writableState)===null||y$===void 0?void 0:y$.errored))}q.exports={isDestroyed:y,kIsDestroyed:O,isDisturbed:f,kIsDisturbed:w,isErrored:v,kIsErrored:j,isReadable:l,kIsReadable:z,kIsClosedPromise:k,kControllerErrorFunction:X,kIsWritable:J,isClosed:T,isDuplexNodeStream:C,isFinished:M,isIterable:u,isReadableNodeStream:G,isReadableStream:h,isReadableEnded:s,isReadableFinished:U,isReadableErrored:H,isNodeStream:E,isWebStream:g,isWritable:o,isWritableNodeStream:V,isWritableStream:I,isWritableEnded:p,isWritableFinished:m,isWritableErrored:Y,isServerRequest:S,isServerResponse:Z,willEmitClose:N,isTransformStream:D}}),BK=A6(($,q)=>{var K=D_(),{AbortError:P,codes:_}=pq(),{ERR_INVALID_ARG_TYPE:O,ERR_STREAM_PREMATURE_CLOSE:j}=_,{kEmptyObject:z,once:J}=Fq(),{validateAbortSignal:w,validateFunction:k,validateObject:X,validateBoolean:G}=y7(),{Promise:V,PromisePrototypeThen:C,SymbolDispose:E}=L6(),{isClosed:h,isReadable:I,isReadableNodeStream:D,isReadableStream:g,isReadableFinished:u,isReadableErrored:y,isWritable:p,isWritableNodeStream:m,isWritableStream:s,isWritableFinished:U,isWritableErrored:l,isNodeStream:o,willEmitClose:M,kIsClosedPromise:Y}=kK(),H;function T(f){return f.setHeader&&typeof f.abort==="function"}var W=()=>{};function Z(f,v,A){var L,R;if(arguments.length===2)A=v,v=z;else if(v==null)v=z;else X(v,"options");if(k(A,"callback"),w(v.signal,"options.signal"),A=J(A),g(f)||s(f))return S(f,v,A);if(!o(f))throw new O("stream",["ReadableStream","WritableStream","Stream"],f);let b=(L=v.readable)!==null&&L!==void 0?L:D(f),d=(R=v.writable)!==null&&R!==void 0?R:m(f),i=f._writableState,a=f._readableState,W$=()=>{if(!f.writable)y$()},n=M(f)&&D(f)===b&&m(f)===d,B=U(f,!1),y$=()=>{if(B=!0,f.destroyed)n=!1;if(n&&(!f.readable||b))return;if(!b||Y$)A.call(f)},Y$=u(f,!1),v$=()=>{if(Y$=!0,f.destroyed)n=!1;if(n&&(!f.writable||d))return;if(!d||B)A.call(f)},Q=(e)=>{A.call(f,e)},r=h(f),t=()=>{r=!0;let e=l(f)||y(f);if(e&&typeof e!=="boolean")return A.call(f,e);if(b&&!Y$&&D(f,!0)){if(!u(f,!1))return A.call(f,new j)}if(d&&!B){if(!U(f,!1))return A.call(f,new j)}A.call(f)},x$=()=>{r=!0;let e=l(f)||y(f);if(e&&typeof e!=="boolean")return A.call(f,e);A.call(f)},q$=()=>{f.req.on("finish",y$)};if(T(f)){if(f.on("complete",y$),!n)f.on("abort",t);if(f.req)q$();else f.on("request",q$)}else if(d&&!i)f.on("end",W$),f.on("close",W$);if(!n&&typeof f.aborted==="boolean")f.on("aborted",t);if(f.on("end",v$),f.on("finish",y$),v.error!==!1)f.on("error",Q);if(f.on("close",t),r)K.nextTick(t);else if(i!==null&&i!==void 0&&i.errorEmitted||a!==null&&a!==void 0&&a.errorEmitted){if(!n)K.nextTick(x$)}else if(!b&&(!n||I(f))&&(B||p(f)===!1))K.nextTick(x$);else if(!d&&(!n||p(f))&&(Y$||I(f)===!1))K.nextTick(x$);else if(a&&f.req&&f.aborted)K.nextTick(x$);let $$=()=>{if(A=W,f.removeListener("aborted",t),f.removeListener("complete",y$),f.removeListener("abort",t),f.removeListener("request",q$),f.req)f.req.removeListener("finish",y$);f.removeListener("end",W$),f.removeListener("close",W$),f.removeListener("finish",y$),f.removeListener("end",v$),f.removeListener("error",Q),f.removeListener("close",t)};if(v.signal&&!r){let e=()=>{let F=A;$$(),F.call(f,new P(void 0,{cause:v.signal.reason}))};if(v.signal.aborted)K.nextTick(e);else{H=H||Fq().addAbortListener;let F=H(v.signal,e),_$=A;A=J((...f$)=>{F[E](),_$.apply(f,f$)})}}return $$}function S(f,v,A){let L=!1,R=W;if(v.signal)if(R=()=>{L=!0,A.call(f,new P(void 0,{cause:v.signal.reason}))},v.signal.aborted)K.nextTick(R);else{H=H||Fq().addAbortListener;let d=H(v.signal,R),i=A;A=J((...a)=>{d[E](),i.apply(f,a)})}let b=(...d)=>{if(!L)K.nextTick(()=>A.apply(f,d))};return C(f[Y].promise,b,b),W}function N(f,v){var A;let L=!1;if(v===null)v=z;if((A=v)!==null&&A!==void 0&&A.cleanup)G(v.cleanup,"cleanup"),L=v.cleanup;return new V((R,b)=>{let d=Z(f,v,(i)=>{if(L)d();if(i)b(i);else R()})})}q.exports=Z,q.exports.finished=N}),y4=A6(($,q)=>{var K=D_(),{aggregateTwoErrors:P,codes:{ERR_MULTIPLE_CALLBACK:_},AbortError:O}=pq(),{Symbol:j}=L6(),{kIsDestroyed:z,isDestroyed:J,isFinished:w,isServerRequest:k}=kK(),X=j("kDestroy"),G=j("kConstruct");function V(M,Y,H){if(M){if(M.stack,Y&&!Y.errored)Y.errored=M;if(H&&!H.errored)H.errored=M}}function C(M,Y){let H=this._readableState,T=this._writableState,W=T||H;if(T!==null&&T!==void 0&&T.destroyed||H!==null&&H!==void 0&&H.destroyed){if(typeof Y==="function")Y();return this}if(V(M,T,H),T)T.destroyed=!0;if(H)H.destroyed=!0;if(!W.constructed)this.once(X,function(Z){E(this,P(Z,M),Y)});else E(this,M,Y);return this}function E(M,Y,H){let T=!1;function W(Z){if(T)return;T=!0;let{_readableState:S,_writableState:N}=M;if(V(Z,N,S),N)N.closed=!0;if(S)S.closed=!0;if(typeof H==="function")H(Z);if(Z)K.nextTick(h,M,Z);else K.nextTick(I,M)}try{M._destroy(Y||null,W)}catch(Z){W(Z)}}function h(M,Y){D(M,Y),I(M)}function I(M){let{_readableState:Y,_writableState:H}=M;if(H)H.closeEmitted=!0;if(Y)Y.closeEmitted=!0;if(H!==null&&H!==void 0&&H.emitClose||Y!==null&&Y!==void 0&&Y.emitClose)M.emit("close")}function D(M,Y){let{_readableState:H,_writableState:T}=M;if(T!==null&&T!==void 0&&T.errorEmitted||H!==null&&H!==void 0&&H.errorEmitted)return;if(T)T.errorEmitted=!0;if(H)H.errorEmitted=!0;M.emit("error",Y)}function g(){let M=this._readableState,Y=this._writableState;if(M)M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1;if(Y)Y.constructed=!0,Y.destroyed=!1,Y.closed=!1,Y.closeEmitted=!1,Y.errored=null,Y.errorEmitted=!1,Y.finalCalled=!1,Y.prefinished=!1,Y.ended=Y.writable===!1,Y.ending=Y.writable===!1,Y.finished=Y.writable===!1}function u(M,Y,H){let{_readableState:T,_writableState:W}=M;if(W!==null&&W!==void 0&&W.destroyed||T!==null&&T!==void 0&&T.destroyed)return this;if(T!==null&&T!==void 0&&T.autoDestroy||W!==null&&W!==void 0&&W.autoDestroy)M.destroy(Y);else if(Y){if(Y.stack,W&&!W.errored)W.errored=Y;if(T&&!T.errored)T.errored=Y;if(H)K.nextTick(D,M,Y);else D(M,Y)}}function y(M,Y){if(typeof M._construct!=="function")return;let{_readableState:H,_writableState:T}=M;if(H)H.constructed=!1;if(T)T.constructed=!1;if(M.once(G,Y),M.listenerCount(G)>1)return;K.nextTick(p,M)}function p(M){let Y=!1;function H(T){if(Y){u(M,T!==null&&T!==void 0?T:new _);return}Y=!0;let{_readableState:W,_writableState:Z}=M,S=Z||W;if(W)W.constructed=!0;if(Z)Z.constructed=!0;if(S.destroyed)M.emit(X,T);else if(T)u(M,T,!0);else K.nextTick(m,M)}try{M._construct((T)=>{K.nextTick(H,T)})}catch(T){K.nextTick(H,T)}}function m(M){M.emit(G)}function s(M){return(M===null||M===void 0?void 0:M.setHeader)&&typeof M.abort==="function"}function U(M){M.emit("close")}function l(M,Y){M.emit("error",Y),K.nextTick(U,M)}function o(M,Y){if(!M||J(M))return;if(!Y&&!w(M))Y=new O;if(k(M))M.socket=null,M.destroy(Y);else if(s(M))M.abort();else if(s(M.req))M.req.abort();else if(typeof M.destroy==="function")M.destroy(Y);else if(typeof M.close==="function")M.close();else if(Y)K.nextTick(l,M,Y);else K.nextTick(U,M);if(!M.destroyed)M[z]=!0}q.exports={construct:y,destroyer:o,destroy:C,undestroy:g,errorOrDestroy:u}}),qH=A6(($,q)=>{var{ArrayIsArray:K,ObjectSetPrototypeOf:P}=L6(),{EventEmitter:_}=(g7(),W6(b7));function O(z){_.call(this,z)}P(O.prototype,_.prototype),P(O,_),O.prototype.pipe=function(z,J){let w=this;function k(I){if(z.writable&&z.write(I)===!1&&w.pause)w.pause()}w.on("data",k);function X(){if(w.readable&&w.resume)w.resume()}if(z.on("drain",X),!z._isStdio&&(!J||J.end!==!1))w.on("end",V),w.on("close",C);let G=!1;function V(){if(G)return;G=!0,z.end()}function C(){if(G)return;if(G=!0,typeof z.destroy==="function")z.destroy()}function E(I){if(h(),_.listenerCount(this,"error")===0)this.emit("error",I)}j(w,"error",E),j(z,"error",E);function h(){w.removeListener("data",k),z.removeListener("drain",X),w.removeListener("end",V),w.removeListener("close",C),w.removeListener("error",E),z.removeListener("error",E),w.removeListener("end",h),w.removeListener("close",h),z.removeListener("close",h)}return w.on("end",h),w.on("close",h),z.on("close",h),z.emit("pipe",w),z};function j(z,J,w){if(typeof z.prependListener==="function")return z.prependListener(J,w);if(!z._events||!z._events[J])z.on(J,w);else if(K(z._events[J]))z._events[J].unshift(w);else z._events[J]=[w,z._events[J]]}q.exports={Stream:O,prependListener:j}}),rj=A6(($,q)=>{var{SymbolDispose:K}=L6(),{AbortError:P,codes:_}=pq(),{isNodeStream:O,isWebStream:j,kControllerErrorFunction:z}=kK(),J=BK(),{ERR_INVALID_ARG_TYPE:w}=_,k,X=(G,V)=>{if(typeof G!=="object"||!("aborted"in G))throw new w(V,"AbortSignal",G)};q.exports.addAbortSignal=function(V,C){if(X(V,"signal"),!O(C)&&!j(C))throw new w("stream",["ReadableStream","WritableStream","Stream"],C);return q.exports.addAbortSignalNoValidate(V,C)},q.exports.addAbortSignalNoValidate=function(G,V){if(typeof G!=="object"||!("aborted"in G))return V;let C=O(V)?()=>{V.destroy(new P(void 0,{cause:G.reason}))}:()=>{V[z](new P(void 0,{cause:G.reason}))};if(G.aborted)C();else{k=k||Fq().addAbortListener;let E=k(G,C);J(V,E[K])}return V}}),Hl=A6(($,q)=>{var{StringPrototypeSlice:K,SymbolIterator:P,TypedArrayPrototypeSet:_,Uint8Array:O}=L6(),{Buffer:j}=(vq(),W6(Yq)),{inspect:z}=Fq();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(w){let k={data:w,next:null};if(this.length>0)this.tail.next=k;else this.head=k;this.tail=k,++this.length}unshift(w){let k={data:w,next:this.head};if(this.length===0)this.tail=k;this.head=k,++this.length}shift(){if(this.length===0)return;let w=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,w}clear(){this.head=this.tail=null,this.length=0}join(w){if(this.length===0)return"";let k=this.head,X=""+k.data;while((k=k.next)!==null)X+=w+k.data;return X}concat(w){if(this.length===0)return j.alloc(0);let k=j.allocUnsafe(w>>>0),X=this.head,G=0;while(X)_(k,X.data,G),G+=X.data.length,X=X.next;return k}consume(w,k){let X=this.head.data;if(w<X.length){let G=X.slice(0,w);return this.head.data=X.slice(w),G}if(w===X.length)return this.shift();return k?this._getString(w):this._getBuffer(w)}first(){return this.head.data}*[P](){for(let w=this.head;w;w=w.next)yield w.data}_getString(w){let k="",X=this.head,G=0;do{let V=X.data;if(w>V.length)k+=V,w-=V.length;else{if(w===V.length)if(k+=V,++G,X.next)this.head=X.next;else this.head=this.tail=null;else k+=K(V,0,w),this.head=X,X.data=K(V,w);break}++G}while((X=X.next)!==null);return this.length-=G,k}_getBuffer(w){let k=j.allocUnsafe(w),X=w,G=this.head,V=0;do{let C=G.data;if(w>C.length)_(k,C,X-w),w-=C.length;else{if(w===C.length)if(_(k,C,X-w),++V,G.next)this.head=G.next;else this.head=this.tail=null;else _(k,new O(C.buffer,C.byteOffset,w),X-w),this.head=G,G.data=C.slice(w);break}++V}while((G=G.next)!==null);return this.length-=V,k}[Symbol.for("nodejs.util.inspect.custom")](w,k){return z(this,{...k,depth:0,customInspect:!1})}}}),oj=A6(($,q)=>{var{MathFloor:K,NumberIsInteger:P}=L6(),{validateInteger:_}=y7(),{ERR_INVALID_ARG_VALUE:O}=pq().codes,j=16384,z=16;function J(G,V,C){return G.highWaterMark!=null?G.highWaterMark:V?G[C]:null}function w(G){return G?z:j}function k(G,V){if(_(V,"value",0),G)z=V;else j=V}function X(G,V,C,E){let h=J(V,E,C);if(h!=null){if(!P(h)||h<0){let I=E?`options.${C}`:"options.highWaterMark";throw new O(I,h)}return K(h)}return w(G.objectMode)}q.exports={getHighWaterMark:X,getDefaultHighWaterMark:w,setDefaultHighWaterMark:k}}),Jl=A6(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(vq(),W6(Yq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),Tl=A6(($)=>{var q=Jl().Buffer,K=q.isEncoding||function(D){switch(D=""+D,D&&D.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function P(D){if(!D)return"utf8";var g;while(!0)switch(D){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 D;default:if(g)return;D=(""+D).toLowerCase(),g=!0}}function _(D){var g=P(D);if(typeof g!=="string"&&(q.isEncoding===K||!K(D)))throw Error("Unknown encoding: "+D);return g||D}$.StringDecoder=O;function O(D){this.encoding=_(D);var g;switch(this.encoding){case"utf16le":this.text=G,this.end=V,g=4;break;case"utf8":this.fillLast=w,g=4;break;case"base64":this.text=C,this.end=E,g=3;break;default:this.write=h,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(g)}O.prototype.write=function(D){if(D.length===0)return"";var g,u;if(this.lastNeed){if(g=this.fillLast(D),g===void 0)return"";u=this.lastNeed,this.lastNeed=0}else u=0;if(u<D.length)return g?g+this.text(D,u):this.text(D,u);return g||""},O.prototype.end=X,O.prototype.text=k,O.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function j(D){if(D<=127)return 0;else if(D>>5===6)return 2;else if(D>>4===14)return 3;else if(D>>3===30)return 4;return D>>6===2?-1:-2}function z(D,g,u){var y=g.length-1;if(y<u)return 0;var p=j(g[y]);if(p>=0){if(p>0)D.lastNeed=p-1;return p}if(--y<u||p===-2)return 0;if(p=j(g[y]),p>=0){if(p>0)D.lastNeed=p-2;return p}if(--y<u||p===-2)return 0;if(p=j(g[y]),p>=0){if(p>0)if(p===2)p=0;else D.lastNeed=p-3;return p}return 0}function J(D,g,u){if((g[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&g.length>2){if((g[2]&192)!==128)return D.lastNeed=2,"�"}}}function w(D){var g=this.lastTotal-this.lastNeed,u=J(this,D,g);if(u!==void 0)return u;if(this.lastNeed<=D.length)return D.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,g,0,D.length),this.lastNeed-=D.length}function k(D,g){var u=z(this,D,g);if(!this.lastNeed)return D.toString("utf8",g);this.lastTotal=u;var y=D.length-(u-this.lastNeed);return D.copy(this.lastChar,0,y),D.toString("utf8",g,y)}function X(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed)return g+"�";return g}function G(D,g){if((D.length-g)%2===0){var u=D.toString("utf16le",g);if(u){var y=u.charCodeAt(u.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],u.slice(0,-1)}return u}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",g,D.length-1)}function V(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed){var u=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,u)}return g}function C(D,g){var u=(D.length-g)%3;if(u===0)return D.toString("base64",g);if(this.lastNeed=3-u,this.lastTotal=3,u===1)this.lastChar[0]=D[D.length-1];else this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1];return D.toString("base64",g,D.length-u)}function E(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed)return g+this.lastChar.toString("base64",0,3-this.lastNeed);return g}function h(D){return D.toString(this.encoding)}function I(D){return D&&D.length?this.write(D):""}}),CS=A6(($,q)=>{var K=D_(),{PromisePrototypeThen:P,SymbolAsyncIterator:_,SymbolIterator:O}=L6(),{Buffer:j}=(vq(),W6(Yq)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:J}=pq().codes;function w(k,X,G){let V;if(typeof X==="string"||X instanceof j)return new k({objectMode:!0,...G,read(){this.push(X),this.push(null)}});let C;if(X&&X[_])C=!0,V=X[_]();else if(X&&X[O])C=!1,V=X[O]();else throw new z("iterable",["Iterable"],X);let E=new k({objectMode:!0,highWaterMark:1,...G}),h=!1;E._read=function(){if(!h)h=!0,D()},E._destroy=function(g,u){P(I(g),()=>K.nextTick(u,g),(y)=>K.nextTick(u,y||g))};async function I(g){let u=g!==void 0&&g!==null,y=typeof V.throw==="function";if(u&&y){let{value:p,done:m}=await V.throw(g);if(await p,m)return}if(typeof V.return==="function"){let{value:p}=await V.return();await p}}async function D(){for(;;){try{let{value:g,done:u}=C?await V.next():V.next();if(u)E.push(null);else{let y=g&&typeof g.then==="function"?await g:g;if(y===null)throw h=!1,new J;else if(E.push(y))continue;else h=!1}}catch(g){E.destroy(g)}break}}return E}q.exports=w}),nj=A6(($,q)=>{var K=D_(),{ArrayPrototypeIndexOf:P,NumberIsInteger:_,NumberIsNaN:O,NumberParseInt:j,ObjectDefineProperties:z,ObjectKeys:J,ObjectSetPrototypeOf:w,Promise:k,SafeSet:X,SymbolAsyncDispose:G,SymbolAsyncIterator:V,Symbol:C}=L6();q.exports=f$,f$.ReadableState=_$;var{EventEmitter:E}=(g7(),W6(b7)),{Stream:h,prependListener:I}=qH(),{Buffer:D}=(vq(),W6(Yq)),{addAbortSignal:g}=rj(),u=BK(),y=Fq().debuglog("stream",(x)=>{y=x}),p=Hl(),m=y4(),{getHighWaterMark:s,getDefaultHighWaterMark:U}=oj(),{aggregateTwoErrors:l,codes:{ERR_INVALID_ARG_TYPE:o,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:Y,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:W}=pq(),{validateObject:Z}=y7(),S=C("kPaused"),{StringDecoder:N}=Tl(),f=CS();w(f$.prototype,h.prototype),w(f$,h);var v=()=>{},{errorOrDestroy:A}=m,L=1,R=2,b=4,d=8,i=16,a=32,W$=64,n=128,B=256,y$=512,Y$=1024,v$=2048,Q=4096,r=8192,t=16384,x$=32768,q$=65536,$$=131072,e=262144;function F(x){return{enumerable:!1,get(){return(this.state&x)!==0},set(c){if(c)this.state|=x;else this.state&=~x}}}z(_$.prototype,{objectMode:F(L),ended:F(R),endEmitted:F(b),reading:F(d),constructed:F(i),sync:F(a),needReadable:F(W$),emittedReadable:F(n),readableListening:F(B),resumeScheduled:F(y$),errorEmitted:F(Y$),emitClose:F(v$),autoDestroy:F(Q),destroyed:F(r),closed:F(t),closeEmitted:F(x$),multiAwaitDrain:F(q$),readingMore:F($$),dataEmitted:F(e)});function _$(x,c,c$){if(typeof c$!=="boolean")c$=c instanceof XK();if(this.state=v$|Q|i|a,x&&x.objectMode)this.state|=L;if(c$&&x&&x.readableObjectMode)this.state|=L;if(this.highWaterMark=x?s(this,x,"readableHighWaterMark",c$):U(!1),this.buffer=new p,this.length=0,this.pipes=[],this.flowing=null,this[S]=null,x&&x.emitClose===!1)this.state&=~v$;if(x&&x.autoDestroy===!1)this.state&=~Q;if(this.errored=null,this.defaultEncoding=x&&x.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,x&&x.encoding)this.decoder=new N(x.encoding),this.encoding=x.encoding}function f$(x){if(!(this instanceof f$))return new f$(x);let c=this instanceof XK();if(this._readableState=new _$(x,this,c),x){if(typeof x.read==="function")this._read=x.read;if(typeof x.destroy==="function")this._destroy=x.destroy;if(typeof x.construct==="function")this._construct=x.construct;if(x.signal&&!c)g(x.signal,this)}h.call(this,x),m.construct(this,()=>{if(this._readableState.needReadable)y6(this,this._readableState)})}f$.prototype.destroy=m.destroy,f$.prototype._undestroy=m.undestroy,f$.prototype._destroy=function(x,c){c(x)},f$.prototype[E.captureRejectionSymbol]=function(x){this.destroy(x)},f$.prototype[G]=function(){let x;if(!this.destroyed)x=this.readableEnded?null:new W,this.destroy(x);return new k((c,c$)=>u(this,(K$)=>K$&&K$!==x?c$(K$):c(null)))},f$.prototype.push=function(x,c){return O$(this,x,c,!1)},f$.prototype.unshift=function(x,c){return O$(this,x,c,!0)};function O$(x,c,c$,K$){y("readableAddChunk",c);let j$=x._readableState,k6;if((j$.state&L)===0){if(typeof c==="string"){if(c$=c$||j$.defaultEncoding,j$.encoding!==c$)if(K$&&j$.encoding)c=D.from(c,c$).toString(j$.encoding);else c=D.from(c,c$),c$=""}else if(c instanceof D)c$="";else if(h._isUint8Array(c))c=h._uint8ArrayToBuffer(c),c$="";else if(c!=null)k6=new o("chunk",["string","Buffer","Uint8Array"],c)}if(k6)A(x,k6);else if(c===null)j$.state&=~d,X6(x,j$);else if((j$.state&L)!==0||c&&c.length>0)if(K$)if((j$.state&b)!==0)A(x,new T);else if(j$.destroyed||j$.errored)return!1;else T$(x,j$,c,!0);else if(j$.ended)A(x,new H);else if(j$.destroyed||j$.errored)return!1;else if(j$.state&=~d,j$.decoder&&!c$)if(c=j$.decoder.write(c),j$.objectMode||c.length!==0)T$(x,j$,c,!1);else y6(x,j$);else T$(x,j$,c,!1);else if(!K$)j$.state&=~d,y6(x,j$);return!j$.ended&&(j$.length<j$.highWaterMark||j$.length===0)}function T$(x,c,c$,K$){if(c.flowing&&c.length===0&&!c.sync&&x.listenerCount("data")>0){if((c.state&q$)!==0)c.awaitDrainWriters.clear();else c.awaitDrainWriters=null;c.dataEmitted=!0,x.emit("data",c$)}else{if(c.length+=c.objectMode?1:c$.length,K$)c.buffer.unshift(c$);else c.buffer.push(c$);if((c.state&W$)!==0)w$(x)}y6(x,c)}f$.prototype.isPaused=function(){let x=this._readableState;return x[S]===!0||x.flowing===!1},f$.prototype.setEncoding=function(x){let c=new N(x);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;let c$=this._readableState.buffer,K$="";for(let j$ of c$)K$+=c.write(j$);if(c$.clear(),K$!=="")c$.push(K$);return this._readableState.length=K$.length,this};var O6=1073741824;function H$(x){if(x>O6)throw new Y("size","<= 1GiB",x);else x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++;return x}function X$(x,c){if(x<=0||c.length===0&&c.ended)return 0;if((c.state&L)!==0)return 1;if(O(x)){if(c.flowing&&c.length)return c.buffer.first().length;return c.length}if(x<=c.length)return x;return c.ended?c.length:0}f$.prototype.read=function(x){if(y("read",x),x===void 0)x=NaN;else if(!_(x))x=j(x,10);let c=this._readableState,c$=x;if(x>c.highWaterMark)c.highWaterMark=H$(x);if(x!==0)c.state&=~n;if(x===0&&c.needReadable&&((c.highWaterMark!==0?c.length>=c.highWaterMark:c.length>0)||c.ended)){if(y("read: emitReadable",c.length,c.ended),c.length===0&&c.ended)V$(this);else w$(this);return null}if(x=X$(x,c),x===0&&c.ended){if(c.length===0)V$(this);return null}let K$=(c.state&W$)!==0;if(y("need readable",K$),c.length===0||c.length-x<c.highWaterMark)K$=!0,y("length less than watermark",K$);if(c.ended||c.reading||c.destroyed||c.errored||!c.constructed)K$=!1,y("reading, ended or constructing",K$);else if(K$){if(y("do read"),c.state|=d|a,c.length===0)c.state|=W$;try{this._read(c.highWaterMark)}catch(k6){A(this,k6)}if(c.state&=~a,!c.reading)x=X$(c$,c)}let j$;if(x>0)j$=h$(x,c);else j$=null;if(j$===null)c.needReadable=c.length<=c.highWaterMark,x=0;else if(c.length-=x,c.multiAwaitDrain)c.awaitDrainWriters.clear();else c.awaitDrainWriters=null;if(c.length===0){if(!c.ended)c.needReadable=!0;if(c$!==x&&c.ended)V$(this)}if(j$!==null&&!c.errorEmitted&&!c.closeEmitted)c.dataEmitted=!0,this.emit("data",j$);return j$};function X6(x,c){if(y("onEofChunk"),c.ended)return;if(c.decoder){let c$=c.decoder.end();if(c$&&c$.length)c.buffer.push(c$),c.length+=c.objectMode?1:c$.length}if(c.ended=!0,c.sync)w$(x);else c.needReadable=!1,c.emittedReadable=!0,G$(x)}function w$(x){let c=x._readableState;if(y("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,!c.emittedReadable)y("emitReadable",c.flowing),c.emittedReadable=!0,K.nextTick(G$,x)}function G$(x){let c=x._readableState;if(y("emitReadable_",c.destroyed,c.length,c.ended),!c.destroyed&&!c.errored&&(c.length||c.ended))x.emit("readable"),c.emittedReadable=!1;c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,C$(x)}function y6(x,c){if(!c.readingMore&&c.constructed)c.readingMore=!0,K.nextTick(k$,x,c)}function k$(x,c){while(!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&c.length===0)){let c$=c.length;if(y("maybeReadMore read 0"),x.read(0),c$===c.length)break}c.readingMore=!1}f$.prototype._read=function(x){throw new M("_read()")},f$.prototype.pipe=function(x,c){let c$=this,K$=this._readableState;if(K$.pipes.length===1){if(!K$.multiAwaitDrain)K$.multiAwaitDrain=!0,K$.awaitDrainWriters=new X(K$.awaitDrainWriters?[K$.awaitDrainWriters]:[])}K$.pipes.push(x),y("pipe count=%d opts=%j",K$.pipes.length,c);let j$=(!c||c.end!==!1)&&x!==K.stdout&&x!==K.stderr?Z$:Y6;if(K$.endEmitted)K.nextTick(j$);else c$.once("end",j$);x.on("unpipe",k6);function k6(K6,G6){if(y("onunpipe"),K6===c$){if(G6&&G6.hasUnpiped===!1)G6.hasUnpiped=!0,g$()}}function Z$(){y("onend"),x.end()}let A$,Hq=!1;function g$(){if(y("cleanup"),x.removeListener("close",N$),x.removeListener("finish",b6),A$)x.removeListener("drain",A$);if(x.removeListener("error",M$),x.removeListener("unpipe",k6),c$.removeListener("end",Z$),c$.removeListener("end",Y6),c$.removeListener("data",Jq),Hq=!0,A$&&K$.awaitDrainWriters&&(!x._writableState||x._writableState.needDrain))A$()}function R$(){if(!Hq){if(K$.pipes.length===1&&K$.pipes[0]===x)y("false write response, pause",0),K$.awaitDrainWriters=x,K$.multiAwaitDrain=!1;else if(K$.pipes.length>1&&K$.pipes.includes(x))y("false write response, pause",K$.awaitDrainWriters.size),K$.awaitDrainWriters.add(x);c$.pause()}if(!A$)A$=I$(c$,x),x.on("drain",A$)}c$.on("data",Jq);function Jq(K6){y("ondata");let G6=x.write(K6);if(y("dest.write",G6),G6===!1)R$()}function M$(K6){if(y("onerror",K6),Y6(),x.removeListener("error",M$),x.listenerCount("error")===0){let G6=x._writableState||x._readableState;if(G6&&!G6.errorEmitted)A(x,K6);else x.emit("error",K6)}}I(x,"error",M$);function N$(){x.removeListener("finish",b6),Y6()}x.once("close",N$);function b6(){y("onfinish"),x.removeListener("close",N$),Y6()}x.once("finish",b6);function Y6(){y("unpipe"),c$.unpipe(x)}if(x.emit("pipe",c$),x.writableNeedDrain===!0)R$();else if(!K$.flowing)y("pipe resume"),c$.resume();return x};function I$(x,c){return function(){let K$=x._readableState;if(K$.awaitDrainWriters===c)y("pipeOnDrain",1),K$.awaitDrainWriters=null;else if(K$.multiAwaitDrain)y("pipeOnDrain",K$.awaitDrainWriters.size),K$.awaitDrainWriters.delete(c);if((!K$.awaitDrainWriters||K$.awaitDrainWriters.size===0)&&x.listenerCount("data"))x.resume()}}f$.prototype.unpipe=function(x){let c=this._readableState,c$={hasUnpiped:!1};if(c.pipes.length===0)return this;if(!x){let j$=c.pipes;c.pipes=[],this.pause();for(let k6=0;k6<j$.length;k6++)j$[k6].emit("unpipe",this,{hasUnpiped:!1});return this}let K$=P(c.pipes,x);if(K$===-1)return this;if(c.pipes.splice(K$,1),c.pipes.length===0)this.pause();return x.emit("unpipe",this,c$),this},f$.prototype.on=function(x,c){let c$=h.prototype.on.call(this,x,c),K$=this._readableState;if(x==="data"){if(K$.readableListening=this.listenerCount("readable")>0,K$.flowing!==!1)this.resume()}else if(x==="readable"){if(!K$.endEmitted&&!K$.readableListening){if(K$.readableListening=K$.needReadable=!0,K$.flowing=!1,K$.emittedReadable=!1,y("on readable",K$.length,K$.reading),K$.length)w$(this);else if(!K$.reading)K.nextTick(D$,this)}}return c$},f$.prototype.addListener=f$.prototype.on,f$.prototype.removeListener=function(x,c){let c$=h.prototype.removeListener.call(this,x,c);if(x==="readable")K.nextTick(zq,this);return c$},f$.prototype.off=f$.prototype.removeListener,f$.prototype.removeAllListeners=function(x){let c=h.prototype.removeAllListeners.apply(this,arguments);if(x==="readable"||x===void 0)K.nextTick(zq,this);return c};function zq(x){let c=x._readableState;if(c.readableListening=x.listenerCount("readable")>0,c.resumeScheduled&&c[S]===!1)c.flowing=!0;else if(x.listenerCount("data")>0)x.resume();else if(!c.readableListening)c.flowing=null}function D$(x){y("readable nexttick read 0"),x.read(0)}f$.prototype.resume=function(){let x=this._readableState;if(!x.flowing)y("resume"),x.flowing=!x.readableListening,L$(this,x);return x[S]=!1,this};function L$(x,c){if(!c.resumeScheduled)c.resumeScheduled=!0,K.nextTick(Vq,x,c)}function Vq(x,c){if(y("resume",c.reading),!c.reading)x.read(0);if(c.resumeScheduled=!1,x.emit("resume"),C$(x),c.flowing&&!c.reading)x.read(0)}f$.prototype.pause=function(){if(y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)y("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[S]=!0,this};function C$(x){let c=x._readableState;y("flow",c.flowing);while(c.flowing&&x.read()!==null);}f$.prototype.wrap=function(x){let c=!1;x.on("data",(K$)=>{if(!this.push(K$)&&x.pause)c=!0,x.pause()}),x.on("end",()=>{this.push(null)}),x.on("error",(K$)=>{A(this,K$)}),x.on("close",()=>{this.destroy()}),x.on("destroy",()=>{this.destroy()}),this._read=()=>{if(c&&x.resume)c=!1,x.resume()};let c$=J(x);for(let K$=1;K$<c$.length;K$++){let j$=c$[K$];if(this[j$]===void 0&&typeof x[j$]==="function")this[j$]=x[j$].bind(x)}return this},f$.prototype[V]=function(){return E$(this)},f$.prototype.iterator=function(x){if(x!==void 0)Z(x,"options");return E$(this,x)};function E$(x,c){if(typeof x.read!=="function")x=f$.wrap(x,{objectMode:!0});let c$=Sq(x,c);return c$.stream=x,c$}async function*Sq(x,c){let c$=v;function K$(Z$){if(this===x)c$(),c$=v;else c$=Z$}x.on("readable",K$);let j$,k6=u(x,{writable:!1},(Z$)=>{j$=Z$?l(j$,Z$):null,c$(),c$=v});try{while(!0){let Z$=x.destroyed?null:x.read();if(Z$!==null)yield Z$;else if(j$)throw j$;else if(j$===null)return;else await new k(K$)}}catch(Z$){throw j$=l(j$,Z$),j$}finally{if((j$||(c===null||c===void 0?void 0:c.destroyOnReturn)!==!1)&&(j$===void 0||x._readableState.autoDestroy))m.destroyer(x,null);else x.off("readable",K$),k6()}}z(f$.prototype,{readable:{__proto__:null,get(){let x=this._readableState;return!!x&&x.readable!==!1&&!x.destroyed&&!x.errorEmitted&&!x.endEmitted},set(x){if(this._readableState)this._readableState.readable=!!x}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){if(this._readableState)this._readableState.flowing=x}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(x){if(!this._readableState)return;this._readableState.destroyed=x}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(_$.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[S]!==!1},set(x){this[S]=!!x}}}),f$._fromList=h$;function h$(x,c){if(c.length===0)return null;let c$;if(c.objectMode)c$=c.buffer.shift();else if(!x||x>=c.length){if(c.decoder)c$=c.buffer.join("");else if(c.buffer.length===1)c$=c.buffer.first();else c$=c.buffer.concat(c.length);c.buffer.clear()}else c$=c.buffer.consume(x,c.decoder);return c$}function V$(x){let c=x._readableState;if(y("endReadable",c.endEmitted),!c.endEmitted)c.ended=!0,K.nextTick(Mq,c,x)}function Mq(x,c){if(y("endReadableNT",x.endEmitted,x.length),!x.errored&&!x.closeEmitted&&!x.endEmitted&&x.length===0){if(x.endEmitted=!0,c.emit("end"),c.writable&&c.allowHalfOpen===!1)K.nextTick(b$,c);else if(x.autoDestroy){let c$=c._writableState;if(!c$||c$.autoDestroy&&(c$.finished||c$.writable===!1))c.destroy()}}}function b$(x){if(x.writable&&!x.writableEnded&&!x.destroyed)x.end()}f$.from=function(x,c){return f(f$,x,c)};var S$;function Wq(){if(S$===void 0)S$={};return S$}f$.fromWeb=function(x,c){return Wq().newStreamReadableFromReadableStream(x,c)},f$.toWeb=function(x,c){return Wq().newReadableStreamFromStreamReadable(x,c)},f$.wrap=function(x,c){var c$,K$;return new f$({objectMode:(c$=(K$=x.readableObjectMode)!==null&&K$!==void 0?K$:x.objectMode)!==null&&c$!==void 0?c$:!0,...c,destroy(j$,k6){m.destroyer(x,j$),k6(j$)}}).wrap(x)}}),KH=A6(($,q)=>{var K=D_(),{ArrayPrototypeSlice:P,Error:_,FunctionPrototypeSymbolHasInstance:O,ObjectDefineProperty:j,ObjectDefineProperties:z,ObjectSetPrototypeOf:J,StringPrototypeToLowerCase:w,Symbol:k,SymbolHasInstance:X}=L6();q.exports=Z,Z.WritableState=T;var{EventEmitter:G}=(g7(),W6(b7)),V=qH().Stream,{Buffer:C}=(vq(),W6(Yq)),E=y4(),{addAbortSignal:h}=rj(),{getHighWaterMark:I,getDefaultHighWaterMark:D}=oj(),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:u,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:p,ERR_STREAM_DESTROYED:m,ERR_STREAM_ALREADY_FINISHED:s,ERR_STREAM_NULL_VALUES:U,ERR_STREAM_WRITE_AFTER_END:l,ERR_UNKNOWN_ENCODING:o}=pq().codes,{errorOrDestroy:M}=E;J(Z.prototype,V.prototype),J(Z,V);function Y(){}var H=k("kOnFinished");function T(Q,r,t){if(typeof t!=="boolean")t=r instanceof XK();if(this.objectMode=!!(Q&&Q.objectMode),t)this.objectMode=this.objectMode||!!(Q&&Q.writableObjectMode);this.highWaterMark=Q?I(this,Q,"writableHighWaterMark",t):D(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let x$=!!(Q&&Q.decodeStrings===!1);this.decodeStrings=!x$,this.defaultEncoding=Q&&Q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=A.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,W(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Q||Q.emitClose!==!1,this.autoDestroy=!Q||Q.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function W(Q){Q.buffered=[],Q.bufferedIndex=0,Q.allBuffers=!0,Q.allNoop=!0}T.prototype.getBuffer=function(){return P(this.buffered,this.bufferedIndex)},j(T.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Z(Q){let r=this instanceof XK();if(!r&&!O(Z,this))return new Z(Q);if(this._writableState=new T(Q,this,r),Q){if(typeof Q.write==="function")this._write=Q.write;if(typeof Q.writev==="function")this._writev=Q.writev;if(typeof Q.destroy==="function")this._destroy=Q.destroy;if(typeof Q.final==="function")this._final=Q.final;if(typeof Q.construct==="function")this._construct=Q.construct;if(Q.signal)h(Q.signal,this)}V.call(this,Q),E.construct(this,()=>{let t=this._writableState;if(!t.writing)d(this,t);n(this,t)})}j(Z,X,{__proto__:null,value:function(Q){if(O(this,Q))return!0;if(this!==Z)return!1;return Q&&Q._writableState instanceof T}}),Z.prototype.pipe=function(){M(this,new p)};function S(Q,r,t,x$){let q$=Q._writableState;if(typeof t==="function")x$=t,t=q$.defaultEncoding;else{if(!t)t=q$.defaultEncoding;else if(t!=="buffer"&&!C.isEncoding(t))throw new o(t);if(typeof x$!=="function")x$=Y}if(r===null)throw new U;else if(!q$.objectMode)if(typeof r==="string"){if(q$.decodeStrings!==!1)r=C.from(r,t),t="buffer"}else if(r instanceof C)t="buffer";else if(V._isUint8Array(r))r=V._uint8ArrayToBuffer(r),t="buffer";else throw new g("chunk",["string","Buffer","Uint8Array"],r);let $$;if(q$.ending)$$=new l;else if(q$.destroyed)$$=new m("write");if($$)return K.nextTick(x$,$$),M(Q,$$,!0),$$;return q$.pendingcb++,N(Q,q$,r,t,x$)}Z.prototype.write=function(Q,r,t){return S(this,Q,r,t)===!0},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){let Q=this._writableState;if(Q.corked){if(Q.corked--,!Q.writing)d(this,Q)}},Z.prototype.setDefaultEncoding=function(r){if(typeof r==="string")r=w(r);if(!C.isEncoding(r))throw new o(r);return this._writableState.defaultEncoding=r,this};function N(Q,r,t,x$,q$){let $$=r.objectMode?1:t.length;r.length+=$$;let e=r.length<r.highWaterMark;if(!e)r.needDrain=!0;if(r.writing||r.corked||r.errored||!r.constructed){if(r.buffered.push({chunk:t,encoding:x$,callback:q$}),r.allBuffers&&x$!=="buffer")r.allBuffers=!1;if(r.allNoop&&q$!==Y)r.allNoop=!1}else r.writelen=$$,r.writecb=q$,r.writing=!0,r.sync=!0,Q._write(t,x$,r.onwrite),r.sync=!1;return e&&!r.errored&&!r.destroyed}function f(Q,r,t,x$,q$,$$,e){if(r.writelen=x$,r.writecb=e,r.writing=!0,r.sync=!0,r.destroyed)r.onwrite(new m("write"));else if(t)Q._writev(q$,r.onwrite);else Q._write(q$,$$,r.onwrite);r.sync=!1}function v(Q,r,t,x$){--r.pendingcb,x$(t),b(r),M(Q,t)}function A(Q,r){let t=Q._writableState,x$=t.sync,q$=t.writecb;if(typeof q$!=="function"){M(Q,new y);return}if(t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0,r){if(r.stack,!t.errored)t.errored=r;if(Q._readableState&&!Q._readableState.errored)Q._readableState.errored=r;if(x$)K.nextTick(v,Q,t,r,q$);else v(Q,t,r,q$)}else{if(t.buffered.length>t.bufferedIndex)d(Q,t);if(x$)if(t.afterWriteTickInfo!==null&&t.afterWriteTickInfo.cb===q$)t.afterWriteTickInfo.count++;else t.afterWriteTickInfo={count:1,cb:q$,stream:Q,state:t},K.nextTick(L,t.afterWriteTickInfo);else R(Q,t,1,q$)}}function L({stream:Q,state:r,count:t,cb:x$}){return r.afterWriteTickInfo=null,R(Q,r,t,x$)}function R(Q,r,t,x$){if(!r.ending&&!Q.destroyed&&r.length===0&&r.needDrain)r.needDrain=!1,Q.emit("drain");while(t-- >0)r.pendingcb--,x$();if(r.destroyed)b(r);n(Q,r)}function b(Q){if(Q.writing)return;for(let q$=Q.bufferedIndex;q$<Q.buffered.length;++q$){var r;let{chunk:$$,callback:e}=Q.buffered[q$],F=Q.objectMode?1:$$.length;Q.length-=F,e((r=Q.errored)!==null&&r!==void 0?r:new m("write"))}let t=Q[H].splice(0);for(let q$=0;q$<t.length;q$++){var x$;t[q$]((x$=Q.errored)!==null&&x$!==void 0?x$:new m("end"))}W(Q)}function d(Q,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:t,bufferedIndex:x$,objectMode:q$}=r,$$=t.length-x$;if(!$$)return;let e=x$;if(r.bufferProcessing=!0,$$>1&&Q._writev){r.pendingcb-=$$-1;let F=r.allNoop?Y:(f$)=>{for(let O$=e;O$<t.length;++O$)t[O$].callback(f$)},_$=r.allNoop&&e===0?t:P(t,e);_$.allBuffers=r.allBuffers,f(Q,r,!0,r.length,_$,"",F),W(r)}else{do{let{chunk:F,encoding:_$,callback:f$}=t[e];t[e++]=null;let O$=q$?1:F.length;f(Q,r,!1,O$,F,_$,f$)}while(e<t.length&&!r.writing);if(e===t.length)W(r);else if(e>256)t.splice(0,e),r.bufferedIndex=0;else r.bufferedIndex=e}r.bufferProcessing=!1}Z.prototype._write=function(Q,r,t){if(this._writev)this._writev([{chunk:Q,encoding:r}],t);else throw new u("_write()")},Z.prototype._writev=null,Z.prototype.end=function(Q,r,t){let x$=this._writableState;if(typeof Q==="function")t=Q,Q=null,r=null;else if(typeof r==="function")t=r,r=null;let q$;if(Q!==null&&Q!==void 0){let $$=S(this,Q,r);if($$ instanceof _)q$=$$}if(x$.corked)x$.corked=1,this.uncork();if(q$);else if(!x$.errored&&!x$.ending)x$.ending=!0,n(this,x$,!0),x$.ended=!0;else if(x$.finished)q$=new s("end");else if(x$.destroyed)q$=new m("end");if(typeof t==="function")if(q$||x$.finished)K.nextTick(t,q$);else x$[H].push(t);return this};function i(Q){return Q.ending&&!Q.destroyed&&Q.constructed&&Q.length===0&&!Q.errored&&Q.buffered.length===0&&!Q.finished&&!Q.writing&&!Q.errorEmitted&&!Q.closeEmitted}function a(Q,r){let t=!1;function x$(q$){if(t){M(Q,q$!==null&&q$!==void 0?q$:y());return}if(t=!0,r.pendingcb--,q$){let $$=r[H].splice(0);for(let e=0;e<$$.length;e++)$$[e](q$);M(Q,q$,r.sync)}else if(i(r))r.prefinished=!0,Q.emit("prefinish"),r.pendingcb++,K.nextTick(B,Q,r)}r.sync=!0,r.pendingcb++;try{Q._final(x$)}catch(q$){x$(q$)}r.sync=!1}function W$(Q,r){if(!r.prefinished&&!r.finalCalled)if(typeof Q._final==="function"&&!r.destroyed)r.finalCalled=!0,a(Q,r);else r.prefinished=!0,Q.emit("prefinish")}function n(Q,r,t){if(i(r)){if(W$(Q,r),r.pendingcb===0){if(t)r.pendingcb++,K.nextTick((x$,q$)=>{if(i(q$))B(x$,q$);else q$.pendingcb--},Q,r);else if(i(r))r.pendingcb++,B(Q,r)}}}function B(Q,r){r.pendingcb--,r.finished=!0;let t=r[H].splice(0);for(let x$=0;x$<t.length;x$++)t[x$]();if(Q.emit("finish"),r.autoDestroy){let x$=Q._readableState;if(!x$||x$.autoDestroy&&(x$.endEmitted||x$.readable===!1))Q.destroy()}}z(Z.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(Q){if(this._writableState)this._writableState.destroyed=Q}},writable:{__proto__:null,get(){let Q=this._writableState;return!!Q&&Q.writable!==!1&&!Q.destroyed&&!Q.errored&&!Q.ending&&!Q.ended},set(Q){if(this._writableState)this._writableState.writable=!!Q}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let Q=this._writableState;if(!Q)return!1;return!Q.destroyed&&!Q.ending&&Q.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var y$=E.destroy;Z.prototype.destroy=function(Q,r){let t=this._writableState;if(!t.destroyed&&(t.bufferedIndex<t.buffered.length||t[H].length))K.nextTick(b,t);return y$.call(this,Q,r),this},Z.prototype._undestroy=E.undestroy,Z.prototype._destroy=function(Q,r){r(Q)},Z.prototype[G.captureRejectionSymbol]=function(Q){this.destroy(Q)};var Y$;function v$(){if(Y$===void 0)Y$={};return Y$}Z.fromWeb=function(Q,r){return v$().newStreamWritableFromWritableStream(Q,r)},Z.toWeb=function(Q){return v$().newWritableStreamFromStreamWritable(Q)}}),wl=A6(($,q)=>{var K=D_(),P=(vq(),W6(Yq)),{isReadable:_,isWritable:O,isIterable:j,isNodeStream:z,isReadableNodeStream:J,isWritableNodeStream:w,isDuplexNodeStream:k,isReadableStream:X,isWritableStream:G}=kK(),V=BK(),{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:E,ERR_INVALID_RETURN_VALUE:h}}=pq(),{destroyer:I}=y4(),D=XK(),g=nj(),u=KH(),{createDeferredPromise:y}=Fq(),p=CS(),m=globalThis.Blob||P.Blob,s=typeof m<"u"?function(T){return T instanceof m}:function(T){return!1},U=globalThis.AbortController||u7().AbortController,{FunctionPrototypeCall:l}=L6();class o extends D{constructor(H){super(H);if((H===null||H===void 0?void 0:H.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((H===null||H===void 0?void 0:H.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function H(T,W){if(k(T))return T;if(J(T))return Y({readable:T});if(w(T))return Y({writable:T});if(z(T))return Y({writable:!1,readable:!1});if(X(T))return Y({readable:g.fromWeb(T)});if(G(T))return Y({writable:u.fromWeb(T)});if(typeof T==="function"){let{value:S,write:N,final:f,destroy:v}=M(T);if(j(S))return p(o,S,{objectMode:!0,write:N,final:f,destroy:v});let A=S===null||S===void 0?void 0:S.then;if(typeof A==="function"){let L,R=l(A,S,(b)=>{if(b!=null)throw new h("nully","body",b)},(b)=>{I(L,b)});return L=new o({objectMode:!0,readable:!1,write:N,final(b){f(async()=>{try{await R,K.nextTick(b,null)}catch(d){K.nextTick(b,d)}})},destroy:v})}throw new h("Iterable, AsyncIterable or AsyncFunction",W,S)}if(s(T))return H(T.arrayBuffer());if(j(T))return p(o,T,{objectMode:!0,writable:!1});if(X(T===null||T===void 0?void 0:T.readable)&&G(T===null||T===void 0?void 0:T.writable))return o.fromWeb(T);if(typeof(T===null||T===void 0?void 0:T.writable)==="object"||typeof(T===null||T===void 0?void 0:T.readable)==="object"){let S=T!==null&&T!==void 0&&T.readable?J(T===null||T===void 0?void 0:T.readable)?T===null||T===void 0?void 0:T.readable:H(T.readable):void 0,N=T!==null&&T!==void 0&&T.writable?w(T===null||T===void 0?void 0:T.writable)?T===null||T===void 0?void 0:T.writable:H(T.writable):void 0;return Y({readable:S,writable:N})}let Z=T===null||T===void 0?void 0:T.then;if(typeof Z==="function"){let S;return l(Z,T,(N)=>{if(N!=null)S.push(N);S.push(null)},(N)=>{I(S,N)}),S=new o({objectMode:!0,writable:!1,read(){}})}throw new E(W,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],T)};function M(H){let{promise:T,resolve:W}=y(),Z=new U,S=Z.signal;return{value:H(async function*(){while(!0){let N=T;T=null;let{chunk:f,done:v,cb:A}=await N;if(K.nextTick(A),v)return;if(S.aborted)throw new C(void 0,{cause:S.reason});({promise:T,resolve:W}=y()),yield f}}(),{signal:S}),write(N,f,v){let A=W;W=null,A({chunk:N,done:!1,cb:v})},final(N){let f=W;W=null,f({done:!0,cb:N})},destroy(N,f){Z.abort(),f(N)}}}function Y(H){let T=H.readable&&typeof H.readable.read!=="function"?g.wrap(H.readable):H.readable,W=H.writable,Z=!!_(T),S=!!O(W),N,f,v,A,L;function R(b){let d=A;if(A=null,d)d(b);else if(b)L.destroy(b)}if(L=new o({readableObjectMode:!!(T!==null&&T!==void 0&&T.readableObjectMode),writableObjectMode:!!(W!==null&&W!==void 0&&W.writableObjectMode),readable:Z,writable:S}),S)V(W,(b)=>{if(S=!1,b)I(T,b);R(b)}),L._write=function(b,d,i){if(W.write(b,d))i();else N=i},L._final=function(b){W.end(),f=b},W.on("drain",function(){if(N){let b=N;N=null,b()}}),W.on("finish",function(){if(f){let b=f;f=null,b()}});if(Z)V(T,(b)=>{if(Z=!1,b)I(T,b);R(b)}),T.on("readable",function(){if(v){let b=v;v=null,b()}}),T.on("end",function(){L.push(null)}),L._read=function(){while(!0){let b=T.read();if(b===null){v=L._read;return}if(!L.push(b))return}};return L._destroy=function(b,d){if(!b&&A!==null)b=new C;if(v=null,N=null,f=null,A===null)d(b);else A=d,I(W,b),I(T,b)},L}}),XK=A6(($,q)=>{var{ObjectDefineProperties:K,ObjectGetOwnPropertyDescriptor:P,ObjectKeys:_,ObjectSetPrototypeOf:O}=L6();q.exports=J;var j=nj(),z=KH();O(J.prototype,j.prototype),O(J,j);{let G=_(z.prototype);for(let V=0;V<G.length;V++){let C=G[V];if(!J.prototype[C])J.prototype[C]=z.prototype[C]}}function J(G){if(!(this instanceof J))return new J(G);if(j.call(this,G),z.call(this,G),G){if(this.allowHalfOpen=G.allowHalfOpen!==!1,G.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(G.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}K(J.prototype,{writable:{__proto__:null,...P(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...P(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...P(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...P(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...P(z.prototype,"writableLength")},writableFinished:{__proto__:null,...P(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...P(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...P(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...P(z.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(G){if(this._readableState&&this._writableState)this._readableState.destroyed=G,this._writableState.destroyed=G}}});var w;function k(){if(w===void 0)w={};return w}J.fromWeb=function(G,V){return k().newStreamDuplexFromReadableWritablePair(G,V)},J.toWeb=function(G){return k().newReadableWritablePairFromDuplex(G)};var X;J.from=function(G){if(!X)X=wl();return X(G,"body")}}),ES=A6(($,q)=>{var{ObjectSetPrototypeOf:K,Symbol:P}=L6();q.exports=J;var{ERR_METHOD_NOT_IMPLEMENTED:_}=pq().codes,O=XK(),{getHighWaterMark:j}=oj();K(J.prototype,O.prototype),K(J,O);var z=P("kCallback");function J(X){if(!(this instanceof J))return new J(X);let G=X?j(this,X,"readableHighWaterMark",!0):null;if(G===0)X={...X,highWaterMark:null,readableHighWaterMark:G,writableHighWaterMark:X.writableHighWaterMark||0};if(O.call(this,X),this._readableState.sync=!1,this[z]=null,X){if(typeof X.transform==="function")this._transform=X.transform;if(typeof X.flush==="function")this._flush=X.flush}this.on("prefinish",k)}function w(X){if(typeof this._flush==="function"&&!this.destroyed)this._flush((G,V)=>{if(G){if(X)X(G);else this.destroy(G);return}if(V!=null)this.push(V);if(this.push(null),X)X()});else if(this.push(null),X)X()}function k(){if(this._final!==w)w.call(this)}J.prototype._final=w,J.prototype._transform=function(X,G,V){throw new _("_transform()")},J.prototype._write=function(X,G,V){let C=this._readableState,E=this._writableState,h=C.length;this._transform(X,G,(I,D)=>{if(I){V(I);return}if(D!=null)this.push(D);if(E.ended||h===C.length||C.length<C.highWaterMark)V();else this[z]=V})},J.prototype._read=function(){if(this[z]){let X=this[z];this[z]=null,X()}}}),hS=A6(($,q)=>{var{ObjectSetPrototypeOf:K}=L6();q.exports=_;var P=ES();K(_.prototype,P.prototype),K(_,P);function _(O){if(!(this instanceof _))return new _(O);P.call(this,O)}_.prototype._transform=function(O,j,z){z(null,O)}}),_H=A6(($,q)=>{var K=D_(),{ArrayIsArray:P,Promise:_,SymbolAsyncIterator:O,SymbolDispose:j}=L6(),z=BK(),{once:J}=Fq(),w=y4(),k=XK(),{aggregateTwoErrors:X,codes:{ERR_INVALID_ARG_TYPE:G,ERR_INVALID_RETURN_VALUE:V,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:E,ERR_STREAM_PREMATURE_CLOSE:h},AbortError:I}=pq(),{validateFunction:D,validateAbortSignal:g}=y7(),{isIterable:u,isReadable:y,isReadableNodeStream:p,isNodeStream:m,isTransformStream:s,isWebStream:U,isReadableStream:l,isReadableFinished:o}=kK(),M=globalThis.AbortController||u7().AbortController,Y,H,T;function W(b,d,i){let a=!1;b.on("close",()=>{a=!0});let W$=z(b,{readable:d,writable:i},(n)=>{a=!n});return{destroy:(n)=>{if(a)return;a=!0,w.destroyer(b,n||new E("pipe"))},cleanup:W$}}function Z(b){return D(b[b.length-1],"streams[stream.length - 1]"),b.pop()}function S(b){if(u(b))return b;else if(p(b))return N(b);throw new G("val",["Readable","Iterable","AsyncIterable"],b)}async function*N(b){if(!H)H=nj();yield*H.prototype[O].call(b)}async function f(b,d,i,{end:a}){let W$,n=null,B=(v$)=>{if(v$)W$=v$;if(n){let Q=n;n=null,Q()}},y$=()=>new _((v$,Q)=>{if(W$)Q(W$);else n=()=>{if(W$)Q(W$);else v$()}});d.on("drain",B);let Y$=z(d,{readable:!1},B);try{if(d.writableNeedDrain)await y$();for await(let v$ of b)if(!d.write(v$))await y$();if(a)d.end(),await y$();i()}catch(v$){i(W$!==v$?X(W$,v$):v$)}finally{Y$(),d.off("drain",B)}}async function v(b,d,i,{end:a}){if(s(d))d=d.writable;let W$=d.getWriter();try{for await(let n of b)await W$.ready,W$.write(n).catch(()=>{});if(await W$.ready,a)await W$.close();i()}catch(n){try{await W$.abort(n),i(n)}catch(B){i(B)}}}function A(...b){return L(b,J(Z(b)))}function L(b,d,i){if(b.length===1&&P(b[0]))b=b[0];if(b.length<2)throw new C("streams");let a=new M,W$=a.signal,n=i===null||i===void 0?void 0:i.signal,B=[];g(n,"options.signal");function y$(){q$(new I)}T=T||Fq().addAbortListener;let Y$;if(n)Y$=T(n,y$);let v$,Q,r=[],t=0;function x$(f$){q$(f$,--t===0)}function q$(f$,O$){var T$;if(f$&&(!v$||v$.code==="ERR_STREAM_PREMATURE_CLOSE"))v$=f$;if(!v$&&!O$)return;while(r.length)r.shift()(v$);if((T$=Y$)===null||T$===void 0||T$[j](),a.abort(),O$){if(!v$)B.forEach((O6)=>O6());K.nextTick(d,v$,Q)}}let $$;for(let f$=0;f$<b.length;f$++){let O$=b[f$],T$=f$<b.length-1,O6=f$>0,H$=T$||(i===null||i===void 0?void 0:i.end)!==!1,X$=f$===b.length-1;if(m(O$)){let X6=function(w$){if(w$&&w$.name!=="AbortError"&&w$.code!=="ERR_STREAM_PREMATURE_CLOSE")x$(w$)};var e=X6;if(H$){let{destroy:w$,cleanup:G$}=W(O$,T$,O6);if(r.push(w$),y(O$)&&X$)B.push(G$)}if(O$.on("error",X6),y(O$)&&X$)B.push(()=>{O$.removeListener("error",X6)})}if(f$===0)if(typeof O$==="function"){if($$=O$({signal:W$}),!u($$))throw new V("Iterable, AsyncIterable or Stream","source",$$)}else if(u(O$)||p(O$)||s(O$))$$=O$;else $$=k.from(O$);else if(typeof O$==="function"){if(s($$)){var F;$$=S((F=$$)===null||F===void 0?void 0:F.readable)}else $$=S($$);if($$=O$($$,{signal:W$}),T$){if(!u($$,!0))throw new V("AsyncIterable",`transform[${f$-1}]`,$$)}else{var _$;if(!Y)Y=hS();let X6=new Y({objectMode:!0}),w$=(_$=$$)===null||_$===void 0?void 0:_$.then;if(typeof w$==="function")t++,w$.call($$,(k$)=>{if(Q=k$,k$!=null)X6.write(k$);if(H$)X6.end();K.nextTick(x$)},(k$)=>{X6.destroy(k$),K.nextTick(x$,k$)});else if(u($$,!0))t++,f($$,X6,x$,{end:H$});else if(l($$)||s($$)){let k$=$$.readable||$$;t++,f(k$,X6,x$,{end:H$})}else throw new V("AsyncIterable or Promise","destination",$$);$$=X6;let{destroy:G$,cleanup:y6}=W($$,!1,!0);if(r.push(G$),X$)B.push(y6)}}else if(m(O$)){if(p($$)){t+=2;let X6=R($$,O$,x$,{end:H$});if(y(O$)&&X$)B.push(X6)}else if(s($$)||l($$)){let X6=$$.readable||$$;t++,f(X6,O$,x$,{end:H$})}else if(u($$))t++,f($$,O$,x$,{end:H$});else throw new G("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$$);$$=O$}else if(U(O$)){if(p($$))t++,v(S($$),O$,x$,{end:H$});else if(l($$)||u($$))t++,v($$,O$,x$,{end:H$});else if(s($$))t++,v($$.readable,O$,x$,{end:H$});else throw new G("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$$);$$=O$}else $$=k.from(O$)}if(W$!==null&&W$!==void 0&&W$.aborted||n!==null&&n!==void 0&&n.aborted)K.nextTick(y$);return $$}function R(b,d,i,{end:a}){let W$=!1;if(d.on("close",()=>{if(!W$)i(new h)}),b.pipe(d,{end:!1}),a){let B=function(){W$=!0,d.end()};var n=B;if(o(b))K.nextTick(B);else b.once("end",B)}else i();return z(b,{readable:!0,writable:!1},(B)=>{let y$=b._readableState;if(B&&B.code==="ERR_STREAM_PREMATURE_CLOSE"&&y$&&y$.ended&&!y$.errored&&!y$.errorEmitted)b.once("end",i).once("error",i);else i(B)}),z(d,{readable:!1,writable:!0},i)}q.exports={pipelineImpl:L,pipeline:A}}),RS=A6(($,q)=>{var{pipeline:K}=_H(),P=XK(),{destroyer:_}=y4(),{isNodeStream:O,isReadable:j,isWritable:z,isWebStream:J,isTransformStream:w,isWritableStream:k,isReadableStream:X}=kK(),{AbortError:G,codes:{ERR_INVALID_ARG_VALUE:V,ERR_MISSING_ARGS:C}}=pq(),E=BK();q.exports=function(...I){if(I.length===0)throw new C("streams");if(I.length===1)return P.from(I[0]);let D=[...I];if(typeof I[0]==="function")I[0]=P.from(I[0]);if(typeof I[I.length-1]==="function"){let Y=I.length-1;I[Y]=P.from(I[Y])}for(let Y=0;Y<I.length;++Y){if(!O(I[Y])&&!J(I[Y]))continue;if(Y<I.length-1&&!(j(I[Y])||X(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be readable");if(Y>0&&!(z(I[Y])||k(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be writable")}let g,u,y,p,m;function s(Y){let H=p;if(p=null,H)H(Y);else if(Y)m.destroy(Y);else if(!M&&!o)m.destroy()}let U=I[0],l=K(I,s),o=!!(z(U)||k(U)||w(U)),M=!!(j(l)||X(l)||w(l));if(m=new P({writableObjectMode:!!(U!==null&&U!==void 0&&U.writableObjectMode),readableObjectMode:!!(l!==null&&l!==void 0&&l.readableObjectMode),writable:o,readable:M}),o){if(O(U))m._write=function(H,T,W){if(U.write(H,T))W();else g=W},m._final=function(H){U.end(),u=H},U.on("drain",function(){if(g){let H=g;g=null,H()}});else if(J(U)){let H=(w(U)?U.writable:U).getWriter();m._write=async function(T,W,Z){try{await H.ready,H.write(T).catch(()=>{}),Z()}catch(S){Z(S)}},m._final=async function(T){try{await H.ready,H.close().catch(()=>{}),u=T}catch(W){T(W)}}}let Y=w(l)?l.readable:l;E(Y,()=>{if(u){let H=u;u=null,H()}})}if(M){if(O(l))l.on("readable",function(){if(y){let Y=y;y=null,Y()}}),l.on("end",function(){m.push(null)}),m._read=function(){while(!0){let Y=l.read();if(Y===null){y=m._read;return}if(!m.push(Y))return}};else if(J(l)){let Y=(w(l)?l.readable:l).getReader();m._read=async function(){while(!0)try{let{value:H,done:T}=await Y.read();if(!m.push(H))return;if(T){m.push(null);return}}catch{return}}}}return m._destroy=function(Y,H){if(!Y&&p!==null)Y=new G;if(y=null,g=null,u=null,p===null)H(Y);else if(p=H,O(l))_(l,Y)},m}}),Zl=A6(($,q)=>{var K=globalThis.AbortController||u7().AbortController,{codes:{ERR_INVALID_ARG_VALUE:P,ERR_INVALID_ARG_TYPE:_,ERR_MISSING_ARGS:O,ERR_OUT_OF_RANGE:j},AbortError:z}=pq(),{validateAbortSignal:J,validateInteger:w,validateObject:k}=y7(),X=L6().Symbol("kWeak"),G=L6().Symbol("kResistStopPropagation"),{finished:V}=BK(),C=RS(),{addAbortSignalNoValidate:E}=rj(),{isWritable:h,isNodeStream:I}=kK(),{deprecate:D}=Fq(),{ArrayPrototypePush:g,Boolean:u,MathFloor:y,Number:p,NumberIsNaN:m,Promise:s,PromiseReject:U,PromiseResolve:l,PromisePrototypeThen:o,Symbol:M}=L6(),Y=M("kEmpty"),H=M("kEof");function T(n,B){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");if(I(n)&&!h(n))throw new P("stream",n,"must be writable");let y$=C(this,n);if(B!==null&&B!==void 0&&B.signal)E(B.signal,y$);return y$}function W(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");let y$=1;if((B===null||B===void 0?void 0:B.concurrency)!=null)y$=y(B.concurrency);let Y$=y$-1;if((B===null||B===void 0?void 0:B.highWaterMark)!=null)Y$=y(B.highWaterMark);return w(y$,"options.concurrency",1),w(Y$,"options.highWaterMark",0),Y$+=y$,async function*(){let Q=Fq().AbortSignalAny([B===null||B===void 0?void 0:B.signal].filter(u)),r=this,t=[],x$={signal:Q},q$,$$,e=!1,F=0;function _$(){e=!0,f$()}function f$(){F-=1,O$()}function O$(){if($$&&!e&&F<y$&&t.length<Y$)$$(),$$=null}async function T$(){try{for await(let O6 of r){if(e)return;if(Q.aborted)throw new z;try{if(O6=n(O6,x$),O6===Y)continue;O6=l(O6)}catch(H$){O6=U(H$)}if(F+=1,o(O6,f$,_$),t.push(O6),q$)q$(),q$=null;if(!e&&(t.length>=Y$||F>=y$))await new s((H$)=>{$$=H$})}t.push(H)}catch(O6){let H$=U(O6);o(H$,f$,_$),t.push(H$)}finally{if(e=!0,q$)q$(),q$=null}}T$();try{while(!0){while(t.length>0){let O6=await t[0];if(O6===H)return;if(Q.aborted)throw new z;if(O6!==Y)yield O6;t.shift(),O$()}await new s((O6)=>{q$=O6})}}finally{if(e=!0,$$)$$(),$$=null}}.call(this)}function Z(n=void 0){if(n!=null)k(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");return async function*(){let y$=0;for await(let v$ of this){var Y$;if(n!==null&&n!==void 0&&(Y$=n.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z({cause:n.signal.reason});yield[y$++,v$]}}.call(this)}async function S(n,B=void 0){for await(let y$ of A.call(this,n,B))return!0;return!1}async function N(n,B=void 0){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);return!await S.call(this,async(...y$)=>{return!await n(...y$)},B)}async function f(n,B){for await(let y$ of A.call(this,n,B))return y$;return}async function v(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){return await n(Y$,v$),Y}for await(let Y$ of W.call(this,y$,B));}function A(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){if(await n(Y$,v$))return Y$;return Y}return W.call(this,y$,B)}class L extends O{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function R(n,B,y$){var Y$;if(typeof n!=="function")throw new _("reducer",["Function","AsyncFunction"],n);if(y$!=null)k(y$,"options");if((y$===null||y$===void 0?void 0:y$.signal)!=null)J(y$.signal,"options.signal");let v$=arguments.length>1;if(y$!==null&&y$!==void 0&&(Y$=y$.signal)!==null&&Y$!==void 0&&Y$.aborted){let q$=new z(void 0,{cause:y$.signal.reason});throw this.once("error",()=>{}),await V(this.destroy(q$)),q$}let Q=new K,r=Q.signal;if(y$!==null&&y$!==void 0&&y$.signal){let q$={once:!0,[X]:this,[G]:!0};y$.signal.addEventListener("abort",()=>Q.abort(),q$)}let t=!1;try{for await(let q$ of this){var x$;if(t=!0,y$!==null&&y$!==void 0&&(x$=y$.signal)!==null&&x$!==void 0&&x$.aborted)throw new z;if(!v$)B=q$,v$=!0;else B=await n(B,q$,{signal:r})}if(!t&&!v$)throw new L}finally{Q.abort()}return B}async function b(n){if(n!=null)k(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");let B=[];for await(let Y$ of this){var y$;if(n!==null&&n!==void 0&&(y$=n.signal)!==null&&y$!==void 0&&y$.aborted)throw new z(void 0,{cause:n.signal.reason});g(B,Y$)}return B}function d(n,B){let y$=W.call(this,n,B);return async function*(){for await(let v$ of y$)yield*v$}.call(this)}function i(n){if(n=p(n),m(n))return 0;if(n<0)throw new j("number",">= 0",n);return n}function a(n,B=void 0){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");return n=i(n),async function*(){var Y$;if(B!==null&&B!==void 0&&(Y$=B.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let Q of this){var v$;if(B!==null&&B!==void 0&&(v$=B.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n--<=0)yield Q}}.call(this)}function W$(n,B=void 0){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");return n=i(n),async function*(){var Y$;if(B!==null&&B!==void 0&&(Y$=B.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let Q of this){var v$;if(B!==null&&B!==void 0&&(v$=B.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n-- >0)yield Q;if(n<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:D(Z,"readable.asIndexedPairs will be removed in a future version."),drop:a,filter:A,flatMap:d,map:W,take:W$,compose:T},q.exports.promiseReturningOperators={every:N,forEach:v,reduce:R,toArray:b,some:S,find:f}}),IS=A6(($,q)=>{var{ArrayPrototypePop:K,Promise:P}=L6(),{isIterable:_,isNodeStream:O,isWebStream:j}=kK(),{pipelineImpl:z}=_H(),{finished:J}=BK();DS();function w(...k){return new P((X,G)=>{let V,C,E=k[k.length-1];if(E&&typeof E==="object"&&!O(E)&&!_(E)&&!j(E)){let h=K(k);V=h.signal,C=h.end}z(k,(h,I)=>{if(h)G(h);else X(I)},{signal:V,end:C})})}q.exports={finished:J,pipeline:w}}),DS=A6(($,q)=>{var{Buffer:K}=(vq(),W6(Yq)),{ObjectDefineProperty:P,ObjectKeys:_,ReflectApply:O}=L6(),{promisify:{custom:j}}=Fq(),{streamReturningOperators:z,promiseReturningOperators:J}=Zl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:w}}=pq(),k=RS(),{setDefaultHighWaterMark:X,getDefaultHighWaterMark:G}=oj(),{pipeline:V}=_H(),{destroyer:C}=y4(),E=BK(),h=IS(),I=kK(),D=q.exports=qH().Stream;D.isDestroyed=I.isDestroyed,D.isDisturbed=I.isDisturbed,D.isErrored=I.isErrored,D.isReadable=I.isReadable,D.isWritable=I.isWritable,D.Readable=nj();for(let u of _(z)){let y=function(...m){if(new.target)throw w();return D.Readable.from(O(p,this,m))},p=z[u];P(y,"name",{__proto__:null,value:p.name}),P(y,"length",{__proto__:null,value:p.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(let u of _(J)){let y=function(...m){if(new.target)throw w();return O(p,this,m)},p=J[u];P(y,"name",{__proto__:null,value:p.name}),P(y,"length",{__proto__:null,value:p.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}D.Writable=KH(),D.Duplex=XK(),D.Transform=ES(),D.PassThrough=hS(),D.pipeline=V;var{addAbortSignal:g}=rj();D.addAbortSignal=g,D.finished=E,D.destroy=C,D.compose=k,D.setDefaultHighWaterMark=X,D.getDefaultHighWaterMark=G,P(D,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return h}}),P(V,j,{__proto__:null,enumerable:!0,get(){return h.pipeline}}),P(E,j,{__proto__:null,enumerable:!0,get(){return h.finished}}),D.Stream=D,D._isUint8Array=function(y){return y instanceof Uint8Array},D._uint8ArrayToBuffer=function(y){return K.from(y.buffer,y.byteOffset,y.byteLength)}}),fl=A6(($,q)=>{var K=PH();{let P=DS(),_=IS(),O=P.Readable.destroy;q.exports=P.Readable,q.exports._uint8ArrayToBuffer=P._uint8ArrayToBuffer,q.exports._isUint8Array=P._isUint8Array,q.exports.isDisturbed=P.isDisturbed,q.exports.isErrored=P.isErrored,q.exports.isReadable=P.isReadable,q.exports.Readable=P.Readable,q.exports.Writable=P.Writable,q.exports.Duplex=P.Duplex,q.exports.Transform=P.Transform,q.exports.PassThrough=P.PassThrough,q.exports.addAbortSignal=P.addAbortSignal,q.exports.finished=P.finished,q.exports.destroy=P.destroy,q.exports.destroy=O,q.exports.pipeline=P.pipeline,q.exports.compose=P.compose,Object.defineProperty(P,"promises",{configurable:!0,enumerable:!0,get(){return _}}),q.exports.Stream=P.Stream}q.exports.default=q.exports});LS.exports=fl()});var mq={};Nq(mq,{webcrypto:()=>zo,rng:()=>Vr,randomUUID:()=>Oo,randomFillSync:()=>qo,randomFill:()=>$o,randomBytes:()=>Sr,publicEncrypt:()=>ar,publicDecrypt:()=>er,pseudoRandomBytes:()=>Gr,prng:()=>Ar,privateEncrypt:()=>Qr,privateDecrypt:()=>sr,pbkdf2Sync:()=>Ir,pbkdf2:()=>Rr,listCiphers:()=>mr,getRandomValues:()=>jo,getHashes:()=>hr,getDiffieHellman:()=>rr,getCurves:()=>vo,getCiphers:()=>pr,default:()=>Wo,createVerify:()=>tr,createSign:()=>ir,createHmac:()=>Er,createHash:()=>Nr,createECDH:()=>Fr,createDiffieHellmanGroup:()=>lr,createDiffieHellman:()=>or,createDecipheriv:()=>cr,createDecipher:()=>yr,createCredentials:()=>Ko,createCipheriv:()=>gr,createCipher:()=>Lr,constants:()=>_o,Verify:()=>Ur,Sign:()=>Br,Hmac:()=>Cr,Hash:()=>Mr,DiffieHellmanGroup:()=>dr,DiffieHellman:()=>nr,Decipheriv:()=>xr,Decipher:()=>ur,DEFAULT_ENCODING:()=>Po,Cipheriv:()=>br,Cipher:()=>Dr});function vo(){return Yo}var Xl,kl,bS,Al,Gl,Vl=($,q,K)=>{K=$!=null?Xl(kl($)):{};let P=q||!$||!$.__esModule?bS(K,"default",{value:$,enumerable:!0}):K;for(let _ of Al($))if(!Gl.call(P,_))bS(P,_,{get:()=>$[_],enumerable:!0});return P},l$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),ij,Bj,uS,Sl,OH,YH,aq,vH,yS,Ml,xS,Nl,Cl,El,hl,AK,tK,cS,X8,pS,tj,Rl,_8,Il,Dl,Ll,mS,F8,c7,dS,bl,lS,gl,rS,ul,yl,xl,cl,zH,pl,WH,ml,dl,ll,rl,ol,nl,il,Bl,tl,Ul,Fl,al,Ql,el,gS,sl,x7,$r,oS,nS,qr,Kr,iS,_r,Pr,p7,jr,Or,Yr,vr,zr,Wr,BS,Hr,tS,US,FS,HH,aS,Jr,QS,Tr,wr,jH,Zr,fr,Xr,kr,T6,Ar,Gr,Vr,Sr,Mr,Nr,Cr,Er,hr,Rr,Ir,Dr,Lr,br,gr,ur,yr,xr,cr,pr,mr,dr,lr,rr,or,nr,ir,Br,tr,Ur,Fr,ar,Qr,er,sr,$o,qo,Ko,_o,Po="buffer",jo=($)=>{return crypto.getRandomValues($)},Oo=()=>{return crypto.randomUUID()},Yo,zo,Wo;var dq=aK(()=>{Xl=Object.create,{getPrototypeOf:kl,defineProperty:bS,getOwnPropertyNames:Al}=Object,Gl=Object.prototype.hasOwnProperty,ij=l$(($,q)=>{q.exports=(dq(),W6(mq)).randomBytes}),Bj=l$(($,q)=>{q.exports=(dq(),W6(mq)).createHash}),uS=l$(($,q)=>{q.exports=(dq(),W6(mq)).createHmac}),Sl=l$(($,q)=>{q.exports={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"}}}),OH=l$(($,q)=>{var K=Math.pow(2,30)-1;q.exports=function(P,_){if(typeof P!=="number")throw TypeError("Iterations not a number");if(P<0)throw TypeError("Bad iterations");if(typeof _!=="number")throw TypeError("Key length not a number");if(_<0||_>K||_!==_)throw TypeError("Bad key length")}}),YH=l$(($,q)=>{var K;if(globalThis.process&&globalThis.process.browser)K="utf-8";else if(globalThis.process&&globalThis.process.version)P=parseInt(process.version.split(".")[0].slice(1),10),K=P>=6?"utf-8":"binary";else K="utf-8";var P;q.exports=K}),aq=l$(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(vq(),W6(Yq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),vH=l$(($,q)=>{var K=aq().Buffer;q.exports=function(P,_,O){if(K.isBuffer(P))return P;else if(typeof P==="string")return K.from(P,_);else if(ArrayBuffer.isView(P))return K.from(P.buffer);else throw TypeError(O+" must be a string, a Buffer, a typed array or a DataView")}}),yS=l$(($,q)=>{var K={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},P=uS(),_=aq().Buffer,O=OH(),j=YH(),z=vH();function J(w,k,X,G,V){O(X,G),w=z(w,j,"Password"),k=z(k,j,"Salt"),V=V||"sha1";var C=_.allocUnsafe(G),E=_.allocUnsafe(k.length+4);k.copy(E,0,0,k.length);var h=0,I=K[V],D=Math.ceil(G/I);for(var g=1;g<=D;g++){E.writeUInt32BE(g,k.length);var u=P(V,w).update(E).digest(),y=u;for(var p=1;p<X;p++){y=P(V,w).update(y).digest();for(var m=0;m<I;m++)u[m]^=y[m]}u.copy(C,h),h+=I}return C}q.exports=J}),Ml=l$(($,q)=>{var K=aq().Buffer,P=OH(),_=YH(),O=yS(),j=vH(),z,J=globalThis.crypto&&globalThis.crypto.subtle,w={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},k=[];function X(h){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!J||!J.importKey||!J.deriveBits)return Promise.resolve(!1);if(k[h]!==void 0)return k[h];z=z||K.alloc(8);var I=C(z,z,10,128,h).then(function(){return!0}).catch(function(){return!1});return k[h]=I,I}var G;function V(){if(G)return G;if(globalThis.process&&globalThis.process.nextTick)G=globalThis.process.nextTick;else if(globalThis.queueMicrotask)G=globalThis.queueMicrotask;else if(globalThis.setImmediate)G=globalThis.setImmediate;else G=globalThis.setTimeout;return G}function C(h,I,D,g,u){return J.importKey("raw",h,{name:"PBKDF2"},!1,["deriveBits"]).then(function(y){return J.deriveBits({name:"PBKDF2",salt:I,iterations:D,hash:{name:u}},y,g<<3)}).then(function(y){return K.from(y)})}function E(h,I){h.then(function(D){V()(function(){I(null,D)})},function(D){V()(function(){I(D)})})}q.exports=function(h,I,D,g,u,y){if(typeof u==="function")y=u,u=void 0;u=u||"sha1";var p=w[u.toLowerCase()];if(!p||typeof globalThis.Promise!=="function"){V()(function(){var m;try{m=O(h,I,D,g,u)}catch(s){return y(s)}y(null,m)});return}if(P(D,g),h=j(h,_,"Password"),I=j(I,_,"Salt"),typeof y!=="function")throw Error("No callback provided to pbkdf2");E(X(p).then(function(m){if(m)return C(h,I,D,g,p);return O(h,I,D,g,u)}),y)}}),xS=l$(($)=>{var q=(dq(),W6(mq)),K=OH(),P=YH(),_=vH();function O(z,J,w,k,X,G){if(K(w,k),z=_(z,P,"Password"),J=_(J,P,"Salt"),typeof X==="function")G=X,X="sha1";if(typeof G!=="function")throw Error("No callback provided to pbkdf2");return q.pbkdf2(z,J,w,k,X,G)}function j(z,J,w,k,X){return K(w,k),z=_(z,P,"Password"),J=_(J,P,"Salt"),X=X||"sha1",q.pbkdf2Sync(z,J,w,k,X)}if(!q.pbkdf2Sync||q.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=yS(),$.pbkdf2=Ml();else $.pbkdf2Sync=j,$.pbkdf2=O}),Nl=l$(($)=>{var q=(dq(),W6(mq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Cl=l$(($)=>{var q=(dq(),W6(mq));$.DiffieHellmanGroup=q.DiffieHellmanGroup,$.createDiffieHellmanGroup=q.createDiffieHellmanGroup,$.getDiffieHellman=q.getDiffieHellman,$.createDiffieHellman=q.createDiffieHellman,$.DiffieHellman=q.DiffieHellman}),El=l$(($)=>{var q=(dq(),W6(mq));$.createSign=q.createSign,$.Sign=q.Sign,$.createVerify=q.createVerify,$.Verify=q.Verify}),hl=l$(($,q)=>{q.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),AK=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,a=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,Q=W[4]|0,r=Q&8191,t=Q>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,e=W[6]|0,F=e&8191,_$=e>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(a,k$)|0,A=Math.imul(a,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(a,D$)|0,A=A+Math.imul(a,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(a,C$)|0,A=A+Math.imul(a,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(a,h$)|0,A=A+Math.imul(a,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(a,b$)|0,A=A+Math.imul(a,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(F,k$),v=Math.imul(F,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(a,x)|0,A=A+Math.imul(a,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(F,D$)|0,v=v+Math.imul(F,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(a,K$)|0,A=A+Math.imul(a,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(F,C$)|0,v=v+Math.imul(F,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(a,Z$)|0,A=A+Math.imul(a,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(F,h$)|0,v=v+Math.imul(F,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(a,g$)|0,A=A+Math.imul(a,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(F,b$)|0,v=v+Math.imul(F,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(a,M$)|0,A=A+Math.imul(a,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(F,x)|0,v=v+Math.imul(F,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(F,K$)|0,v=v+Math.imul(F,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(F,Z$)|0,v=v+Math.imul(F,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(F,g$)|0,v=v+Math.imul(F,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(F,M$)|0,v=v+Math.imul(F,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],a=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=a+n,T[L+d+N]=i-W$,W[L+d+N]=a-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(s,y);function U(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(U,y),U.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new m;else if(Y==="p192")H=new s;else if(Y==="p25519")H=new U;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var a=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(a),A=a.redSqr(),R=R.redMul(A),b=i}return L},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,l),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),tK=l$(($,q)=>{q.exports=K;function K(P,_){if(!P)throw Error(_||"Assertion failed")}K.equal=function(_,O,j){if(_!=O)throw Error(j||"Assertion failed: "+_+" != "+O)}}),cS=l$(($)=>{var q=$;function K(O,j){if(Array.isArray(O))return O.slice();if(!O)return[];var z=[];if(typeof O!=="string"){for(var J=0;J<O.length;J++)z[J]=O[J]|0;return z}if(j==="hex"){if(O=O.replace(/[^a-z0-9]+/ig,""),O.length%2!==0)O="0"+O;for(var J=0;J<O.length;J+=2)z.push(parseInt(O[J]+O[J+1],16))}else for(var J=0;J<O.length;J++){var w=O.charCodeAt(J),k=w>>8,X=w&255;if(k)z.push(k,X);else z.push(X)}return z}q.toArray=K;function P(O){if(O.length===1)return"0"+O;else return O}q.zero2=P;function _(O){var j="";for(var z=0;z<O.length;z++)j+=P(O[z].toString(16));return j}q.toHex=_,q.encode=function(j,z){if(z==="hex")return _(j);else return j}}),X8=l$(($)=>{var q=$,K=AK(),P=tK(),_=cS();q.assert=P,q.toArray=_.toArray,q.zero2=_.zero2,q.toHex=_.toHex,q.encode=_.encode;function O(k,X,G){var V=Array(Math.max(k.bitLength(),G)+1),C;for(C=0;C<V.length;C+=1)V[C]=0;var E=1<<X+1,h=k.clone();for(C=0;C<V.length;C++){var I,D=h.andln(E-1);if(h.isOdd()){if(D>(E>>1)-1)I=(E>>1)-D;else I=D;h.isubn(I)}else I=0;V[C]=I,h.iushrn(1)}return V}q.getNAF=O;function j(k,X){var G=[[],[]];k=k.clone(),X=X.clone();var V=0,C=0,E;while(k.cmpn(-V)>0||X.cmpn(-C)>0){var h=k.andln(3)+V&3,I=X.andln(3)+C&3;if(h===3)h=-1;if(I===3)I=-1;var D;if((h&1)===0)D=0;else if(E=k.andln(7)+V&7,(E===3||E===5)&&I===2)D=-h;else D=h;G[0].push(D);var g;if((I&1)===0)g=0;else if(E=X.andln(7)+C&7,(E===3||E===5)&&h===2)g=-I;else g=I;if(G[1].push(g),2*V===D+1)V=1-V;if(2*C===g+1)C=1-C;k.iushrn(1),X.iushrn(1)}return G}q.getJSF=j;function z(k,X,G){var V="_"+X;k.prototype[X]=function(){return this[V]!==void 0?this[V]:this[V]=G.call(this)}}q.cachedProperty=z;function J(k){return typeof k==="string"?q.toArray(k,"hex"):k}q.parseBytes=J;function w(k){return new K(k,"hex","le")}q.intFromLE=w}),pS=l$(($,q)=>{var K;q.exports=function(j){if(!K)K=new P(null);return K.generate(j)};function P(O){this.rand=O}if(q.exports.Rand=P,P.prototype.generate=function(j){return this._rand(j)},P.prototype._rand=function(j){if(this.rand.getBytes)return this.rand.getBytes(j);var z=new Uint8Array(j);for(var J=0;J<z.length;J++)z[J]=this.rand.getByte();return z},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.crypto.getRandomValues(z),z};else if(self.msCrypto&&self.msCrypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.msCrypto.getRandomValues(z),z};else if(typeof window==="object")P.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(_=(dq(),W6(mq)),typeof _.randomBytes!=="function")throw Error("Not supported");P.prototype._rand=function(j){return _.randomBytes(j)}}catch(O){}var _}),tj=l$(($,q)=>{var K=AK(),P=X8(),_=P.getNAF,O=P.getJSF,j=P.assert;function z(w,k){this.type=w,this.p=new K(k.p,16),this.red=k.prime?K.red(k.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=k.n&&new K(k.n,16),this.g=k.g&&this.pointFromJSON(k.g,k.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var X=this.n&&this.p.div(this.n);if(!X||X.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}q.exports=z,z.prototype.point=function(){throw Error("Not implemented")},z.prototype.validate=function(){throw Error("Not implemented")},z.prototype._fixedNafMul=function(k,X){j(k.precomputed);var G=k._getDoubles(),V=_(X,1,this._bitLength),C=(1<<G.step+1)-(G.step%2===0?2:1);C/=3;var E=[],h,I;for(h=0;h<V.length;h+=G.step){I=0;for(var D=h+G.step-1;D>=h;D--)I=(I<<1)+V[D];E.push(I)}var g=this.jpoint(null,null,null),u=this.jpoint(null,null,null);for(var y=C;y>0;y--){for(h=0;h<E.length;h++)if(I=E[h],I===y)u=u.mixedAdd(G.points[h]);else if(I===-y)u=u.mixedAdd(G.points[h].neg());g=g.add(u)}return g.toP()},z.prototype._wnafMul=function(k,X){var G=4,V=k._getNAFPoints(G);G=V.wnd;var C=V.points,E=_(X,G,this._bitLength),h=this.jpoint(null,null,null);for(var I=E.length-1;I>=0;I--){for(var D=0;I>=0&&E[I]===0;I--)D++;if(I>=0)D++;if(h=h.dblp(D),I<0)break;var g=E[I];if(j(g!==0),k.type==="affine")if(g>0)h=h.mixedAdd(C[g-1>>1]);else h=h.mixedAdd(C[-g-1>>1].neg());else if(g>0)h=h.add(C[g-1>>1]);else h=h.add(C[-g-1>>1].neg())}return k.type==="affine"?h.toP():h},z.prototype._wnafMulAdd=function(k,X,G,V,C){var E=this._wnafT1,h=this._wnafT2,I=this._wnafT3,D=0,g,u,y;for(g=0;g<V;g++){y=X[g];var p=y._getNAFPoints(k);E[g]=p.wnd,h[g]=p.points}for(g=V-1;g>=1;g-=2){var m=g-1,s=g;if(E[m]!==1||E[s]!==1){I[m]=_(G[m],E[m],this._bitLength),I[s]=_(G[s],E[s],this._bitLength),D=Math.max(I[m].length,D),D=Math.max(I[s].length,D);continue}var U=[X[m],null,null,X[s]];if(X[m].y.cmp(X[s].y)===0)U[1]=X[m].add(X[s]),U[2]=X[m].toJ().mixedAdd(X[s].neg());else if(X[m].y.cmp(X[s].y.redNeg())===0)U[1]=X[m].toJ().mixedAdd(X[s]),U[2]=X[m].add(X[s].neg());else U[1]=X[m].toJ().mixedAdd(X[s]),U[2]=X[m].toJ().mixedAdd(X[s].neg());var l=[-3,-1,-5,-7,0,7,5,1,3],o=O(G[m],G[s]);D=Math.max(o[0].length,D),I[m]=Array(D),I[s]=Array(D);for(u=0;u<D;u++){var M=o[0][u]|0,Y=o[1][u]|0;I[m][u]=l[(M+1)*3+(Y+1)],I[s][u]=0,h[m]=U}}var H=this.jpoint(null,null,null),T=this._wnafT4;for(g=D;g>=0;g--){var W=0;while(g>=0){var Z=!0;for(u=0;u<V;u++)if(T[u]=I[u][g]|0,T[u]!==0)Z=!1;if(!Z)break;W++,g--}if(g>=0)W++;if(H=H.dblp(W),g<0)break;for(u=0;u<V;u++){var S=T[u];if(S===0)continue;else if(S>0)y=h[u][S-1>>1];else if(S<0)y=h[u][-S-1>>1].neg();if(y.type==="affine")H=H.mixedAdd(y);else H=H.add(y)}}for(g=0;g<V;g++)h[g]=null;if(C)return H;else return H.toP()};function J(w,k){this.curve=w,this.type=k,this.precomputed=null}z.BasePoint=J,J.prototype.eq=function(){throw Error("Not implemented")},J.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(k,X){k=P.toArray(k,X);var G=this.p.byteLength();if((k[0]===4||k[0]===6||k[0]===7)&&k.length-1===2*G){if(k[0]===6)j(k[k.length-1]%2===0);else if(k[0]===7)j(k[k.length-1]%2===1);var V=this.point(k.slice(1,1+G),k.slice(1+G,1+2*G));return V}else if((k[0]===2||k[0]===3)&&k.length-1===G)return this.pointFromX(k.slice(1,1+G),k[0]===3);throw Error("Unknown point format")},J.prototype.encodeCompressed=function(k){return this.encode(k,!0)},J.prototype._encode=function(k){var X=this.curve.p.byteLength(),G=this.getX().toArray("be",X);if(k)return[this.getY().isEven()?2:3].concat(G);return[4].concat(G,this.getY().toArray("be",X))},J.prototype.encode=function(k,X){return P.encode(this._encode(X),k)},J.prototype.precompute=function(k){if(this.precomputed)return this;var X={doubles:null,naf:null,beta:null};return X.naf=this._getNAFPoints(8),X.doubles=this._getDoubles(4,k),X.beta=this._getBeta(),this.precomputed=X,this},J.prototype._hasDoubles=function(k){if(!this.precomputed)return!1;var X=this.precomputed.doubles;if(!X)return!1;return X.points.length>=Math.ceil((k.bitLength()+1)/X.step)},J.prototype._getDoubles=function(k,X){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var G=[this],V=this;for(var C=0;C<X;C+=k){for(var E=0;E<k;E++)V=V.dbl();G.push(V)}return{step:k,points:G}},J.prototype._getNAFPoints=function(k){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var X=[this],G=(1<<k)-1,V=G===1?null:this.dbl();for(var C=1;C<G;C++)X[C]=X[C-1].add(V);return{wnd:k,points:X}},J.prototype._getBeta=function(){return null},J.prototype.dblp=function(k){var X=this;for(var G=0;G<k;G++)X=X.dbl();return X}}),Rl=l$(($,q)=>{if(typeof Object.create==="function")q.exports=function(P,_){if(_)P.super_=_,P.prototype=Object.create(_.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(P,_){if(_){P.super_=_;var O=function(){};O.prototype=_.prototype,P.prototype=new O,P.prototype.constructor=P}}}),_8=l$(($,q)=>{try{if(K=(vS(),W6(YS)),typeof K.inherits!=="function")throw"";q.exports=K.inherits}catch(P){q.exports=Rl()}var K}),Il=l$(($,q)=>{var K=X8(),P=AK(),_=_8(),O=tj(),j=K.assert;function z(k){O.call(this,"short",k),this.a=new P(k.a,16).toRed(this.red),this.b=new P(k.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(k),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}_(z,O),q.exports=z,z.prototype._getEndomorphism=function(X){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var G,V;if(X.beta)G=new P(X.beta,16).toRed(this.red);else{var C=this._getEndoRoots(this.p);G=C[0].cmp(C[1])<0?C[0]:C[1],G=G.toRed(this.red)}if(X.lambda)V=new P(X.lambda,16);else{var E=this._getEndoRoots(this.n);if(this.g.mul(E[0]).x.cmp(this.g.x.redMul(G))===0)V=E[0];else V=E[1],j(this.g.mul(V).x.cmp(this.g.x.redMul(G))===0)}var h;if(X.basis)h=X.basis.map(function(I){return{a:new P(I.a,16),b:new P(I.b,16)}});else h=this._getEndoBasis(V);return{beta:G,lambda:V,basis:h}},z.prototype._getEndoRoots=function(X){var G=X===this.p?this.red:P.mont(X),V=new P(2).toRed(G).redInvm(),C=V.redNeg(),E=new P(3).toRed(G).redNeg().redSqrt().redMul(V),h=C.redAdd(E).fromRed(),I=C.redSub(E).fromRed();return[h,I]},z.prototype._getEndoBasis=function(X){var G=this.n.ushrn(Math.floor(this.n.bitLength()/2)),V=X,C=this.n.clone(),E=new P(1),h=new P(0),I=new P(0),D=new P(1),g,u,y,p,m,s,U,l=0,o,M;while(V.cmpn(0)!==0){var Y=C.div(V);o=C.sub(Y.mul(V)),M=I.sub(Y.mul(E));var H=D.sub(Y.mul(h));if(!y&&o.cmp(G)<0)g=U.neg(),u=E,y=o.neg(),p=M;else if(y&&++l===2)break;U=o,C=V,V=o,I=E,E=M,D=h,h=H}m=o.neg(),s=M;var T=y.sqr().add(p.sqr()),W=m.sqr().add(s.sqr());if(W.cmp(T)>=0)m=g,s=u;if(y.negative)y=y.neg(),p=p.neg();if(m.negative)m=m.neg(),s=s.neg();return[{a:y,b:p},{a:m,b:s}]},z.prototype._endoSplit=function(X){var G=this.endo.basis,V=G[0],C=G[1],E=C.b.mul(X).divRound(this.n),h=V.b.neg().mul(X).divRound(this.n),I=E.mul(V.a),D=h.mul(C.a),g=E.mul(V.b),u=h.mul(C.b),y=X.sub(I).sub(D),p=g.add(u).neg();return{k1:y,k2:p}},z.prototype.pointFromX=function(X,G){if(X=new P(X,16),!X.red)X=X.toRed(this.red);var V=X.redSqr().redMul(X).redIAdd(X.redMul(this.a)).redIAdd(this.b),C=V.redSqrt();if(C.redSqr().redSub(V).cmp(this.zero)!==0)throw Error("invalid point");var E=C.fromRed().isOdd();if(G&&!E||!G&&E)C=C.redNeg();return this.point(X,C)},z.prototype.validate=function(X){if(X.inf)return!0;var{x:G,y:V}=X,C=this.a.redMul(G),E=G.redSqr().redMul(G).redIAdd(C).redIAdd(this.b);return V.redSqr().redISub(E).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(X,G,V){var C=this._endoWnafT1,E=this._endoWnafT2;for(var h=0;h<X.length;h++){var I=this._endoSplit(G[h]),D=X[h],g=D._getBeta();if(I.k1.negative)I.k1.ineg(),D=D.neg(!0);if(I.k2.negative)I.k2.ineg(),g=g.neg(!0);C[h*2]=D,C[h*2+1]=g,E[h*2]=I.k1,E[h*2+1]=I.k2}var u=this._wnafMulAdd(1,C,E,h*2,V);for(var y=0;y<h*2;y++)C[y]=null,E[y]=null;return u};function J(k,X,G,V){if(O.BasePoint.call(this,k,"affine"),X===null&&G===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new P(X,16),this.y=new P(G,16),V)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}_(J,O.BasePoint),z.prototype.point=function(X,G,V){return new J(this,X,G,V)},z.prototype.pointFromJSON=function(X,G){return J.fromJSON(this,X,G)},J.prototype._getBeta=function(){if(!this.curve.endo)return;var X=this.precomputed;if(X&&X.beta)return X.beta;var G=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(X){var V=this.curve,C=function(E){return V.point(E.x.redMul(V.endo.beta),E.y)};X.beta=G,G.precomputed={beta:null,naf:X.naf&&{wnd:X.naf.wnd,points:X.naf.points.map(C)},doubles:X.doubles&&{step:X.doubles.step,points:X.doubles.points.map(C)}}}return G},J.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},J.fromJSON=function(X,G,V){if(typeof G==="string")G=JSON.parse(G);var C=X.point(G[0],G[1],V);if(!G[2])return C;function E(I){return X.point(I[0],I[1],V)}var h=G[2];return C.precomputed={beta:null,doubles:h.doubles&&{step:h.doubles.step,points:[C].concat(h.doubles.points.map(E))},naf:h.naf&&{wnd:h.naf.wnd,points:[C].concat(h.naf.points.map(E))}},C},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.inf},J.prototype.add=function(X){if(this.inf)return X;if(X.inf)return this;if(this.eq(X))return this.dbl();if(this.neg().eq(X))return this.curve.point(null,null);if(this.x.cmp(X.x)===0)return this.curve.point(null,null);var G=this.y.redSub(X.y);if(G.cmpn(0)!==0)G=G.redMul(this.x.redSub(X.x).redInvm());var V=G.redSqr().redISub(this.x).redISub(X.x),C=G.redMul(this.x.redSub(V)).redISub(this.y);return this.curve.point(V,C)},J.prototype.dbl=function(){if(this.inf)return this;var X=this.y.redAdd(this.y);if(X.cmpn(0)===0)return this.curve.point(null,null);var G=this.curve.a,V=this.x.redSqr(),C=X.redInvm(),E=V.redAdd(V).redIAdd(V).redIAdd(G).redMul(C),h=E.redSqr().redISub(this.x.redAdd(this.x)),I=E.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,I)},J.prototype.getX=function(){return this.x.fromRed()},J.prototype.getY=function(){return this.y.fromRed()},J.prototype.mul=function(X){if(X=new P(X,16),this.isInfinity())return this;else if(this._hasDoubles(X))return this.curve._fixedNafMul(this,X);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[X]);else return this.curve._wnafMul(this,X)},J.prototype.mulAdd=function(X,G,V){var C=[this,G],E=[X,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E);else return this.curve._wnafMulAdd(1,C,E,2)},J.prototype.jmulAdd=function(X,G,V){var C=[this,G],E=[X,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E,!0);else return this.curve._wnafMulAdd(1,C,E,2,!0)},J.prototype.eq=function(X){return this===X||this.inf===X.inf&&(this.inf||this.x.cmp(X.x)===0&&this.y.cmp(X.y)===0)},J.prototype.neg=function(X){if(this.inf)return this;var G=this.curve.point(this.x,this.y.redNeg());if(X&&this.precomputed){var V=this.precomputed,C=function(E){return E.neg()};G.precomputed={naf:V.naf&&{wnd:V.naf.wnd,points:V.naf.points.map(C)},doubles:V.doubles&&{step:V.doubles.step,points:V.doubles.points.map(C)}}}return G},J.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var X=this.curve.jpoint(this.x,this.y,this.curve.one);return X};function w(k,X,G,V){if(O.BasePoint.call(this,k,"jacobian"),X===null&&G===null&&V===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new P(0);else this.x=new P(X,16),this.y=new P(G,16),this.z=new P(V,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}_(w,O.BasePoint),z.prototype.jpoint=function(X,G,V){return new w(this,X,G,V)},w.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var X=this.z.redInvm(),G=X.redSqr(),V=this.x.redMul(G),C=this.y.redMul(G).redMul(X);return this.curve.point(V,C)},w.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},w.prototype.add=function(X){if(this.isInfinity())return X;if(X.isInfinity())return this;var G=X.z.redSqr(),V=this.z.redSqr(),C=this.x.redMul(G),E=X.x.redMul(V),h=this.y.redMul(G.redMul(X.z)),I=X.y.redMul(V.redMul(this.z)),D=C.redSub(E),g=h.redSub(I);if(D.cmpn(0)===0)if(g.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var u=D.redSqr(),y=u.redMul(D),p=C.redMul(u),m=g.redSqr().redIAdd(y).redISub(p).redISub(p),s=g.redMul(p.redISub(m)).redISub(h.redMul(y)),U=this.z.redMul(X.z).redMul(D);return this.curve.jpoint(m,s,U)},w.prototype.mixedAdd=function(X){if(this.isInfinity())return X.toJ();if(X.isInfinity())return this;var G=this.z.redSqr(),V=this.x,C=X.x.redMul(G),E=this.y,h=X.y.redMul(G).redMul(this.z),I=V.redSub(C),D=E.redSub(h);if(I.cmpn(0)===0)if(D.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var g=I.redSqr(),u=g.redMul(I),y=V.redMul(g),p=D.redSqr().redIAdd(u).redISub(y).redISub(y),m=D.redMul(y.redISub(p)).redISub(E.redMul(u)),s=this.z.redMul(I);return this.curve.jpoint(p,m,s)},w.prototype.dblp=function(X){if(X===0)return this;if(this.isInfinity())return this;if(!X)return this.dbl();var G;if(this.curve.zeroA||this.curve.threeA){var V=this;for(G=0;G<X;G++)V=V.dbl();return V}var C=this.curve.a,E=this.curve.tinv,h=this.x,I=this.y,D=this.z,g=D.redSqr().redSqr(),u=I.redAdd(I);for(G=0;G<X;G++){var y=h.redSqr(),p=u.redSqr(),m=p.redSqr(),s=y.redAdd(y).redIAdd(y).redIAdd(C.redMul(g)),U=h.redMul(p),l=s.redSqr().redISub(U.redAdd(U)),o=U.redISub(l),M=s.redMul(o);M=M.redIAdd(M).redISub(m);var Y=u.redMul(D);if(G+1<X)g=g.redMul(m);h=l,D=Y,u=M}return this.curve.jpoint(h,u.redMul(E),D)},w.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},w.prototype._zeroDbl=function(){var X,G,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),h=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(h);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C),g=D.redSqr().redISub(I).redISub(I),u=h.redIAdd(h);u=u.redIAdd(u),u=u.redIAdd(u),X=g,G=D.redMul(I.redISub(g)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),p=this.y.redSqr(),m=p.redSqr(),s=this.x.redAdd(p).redSqr().redISub(y).redISub(m);s=s.redIAdd(s);var U=y.redAdd(y).redIAdd(y),l=U.redSqr(),o=m.redIAdd(m);o=o.redIAdd(o),o=o.redIAdd(o),X=l.redISub(s).redISub(s),G=U.redMul(s.redISub(X)).redISub(o),V=this.y.redMul(this.z),V=V.redIAdd(V)}return this.curve.jpoint(X,G,V)},w.prototype._threeDbl=function(){var X,G,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),h=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(h);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C).redIAdd(this.curve.a),g=D.redSqr().redISub(I).redISub(I);X=g;var u=h.redIAdd(h);u=u.redIAdd(u),u=u.redIAdd(u),G=D.redMul(I.redISub(g)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),p=this.y.redSqr(),m=this.x.redMul(p),s=this.x.redSub(y).redMul(this.x.redAdd(y));s=s.redAdd(s).redIAdd(s);var U=m.redIAdd(m);U=U.redIAdd(U);var l=U.redAdd(U);X=s.redSqr().redISub(l),V=this.y.redAdd(this.z).redSqr().redISub(p).redISub(y);var o=p.redSqr();o=o.redIAdd(o),o=o.redIAdd(o),o=o.redIAdd(o),G=s.redMul(U.redISub(X)).redISub(o)}return this.curve.jpoint(X,G,V)},w.prototype._dbl=function(){var X=this.curve.a,G=this.x,V=this.y,C=this.z,E=C.redSqr().redSqr(),h=G.redSqr(),I=V.redSqr(),D=h.redAdd(h).redIAdd(h).redIAdd(X.redMul(E)),g=G.redAdd(G);g=g.redIAdd(g);var u=g.redMul(I),y=D.redSqr().redISub(u.redAdd(u)),p=u.redISub(y),m=I.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var s=D.redMul(p).redISub(m),U=V.redAdd(V).redMul(C);return this.curve.jpoint(y,s,U)},w.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var X=this.x.redSqr(),G=this.y.redSqr(),V=this.z.redSqr(),C=G.redSqr(),E=X.redAdd(X).redIAdd(X),h=E.redSqr(),I=this.x.redAdd(G).redSqr().redISub(X).redISub(C);I=I.redIAdd(I),I=I.redAdd(I).redIAdd(I),I=I.redISub(h);var D=I.redSqr(),g=C.redIAdd(C);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var u=E.redIAdd(I).redSqr().redISub(h).redISub(D).redISub(g),y=G.redMul(u);y=y.redIAdd(y),y=y.redIAdd(y);var p=this.x.redMul(D).redISub(y);p=p.redIAdd(p),p=p.redIAdd(p);var m=this.y.redMul(u.redMul(g.redISub(u)).redISub(I.redMul(D)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var s=this.z.redAdd(I).redSqr().redISub(V).redISub(D);return this.curve.jpoint(p,m,s)},w.prototype.mul=function(X,G){return X=new P(X,G),this.curve._wnafMul(this,X)},w.prototype.eq=function(X){if(X.type==="affine")return this.eq(X.toJ());if(this===X)return!0;var G=this.z.redSqr(),V=X.z.redSqr();if(this.x.redMul(V).redISub(X.x.redMul(G)).cmpn(0)!==0)return!1;var C=G.redMul(this.z),E=V.redMul(X.z);return this.y.redMul(E).redISub(X.y.redMul(C)).cmpn(0)===0},w.prototype.eqXToP=function(X){var G=this.z.redSqr(),V=X.toRed(this.curve.red).redMul(G);if(this.x.cmp(V)===0)return!0;var C=X.clone(),E=this.curve.redN.redMul(G);for(;;){if(C.iadd(this.curve.n),C.cmp(this.curve.p)>=0)return!1;if(V.redIAdd(E),this.x.cmp(V)===0)return!0}},w.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},w.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),Dl=l$(($,q)=>{var K=AK(),P=_8(),_=tj(),O=X8();function j(J){_.call(this,"mont",J),this.a=new K(J.a,16).toRed(this.red),this.b=new K(J.b,16).toRed(this.red),this.i4=new K(4).toRed(this.red).redInvm(),this.two=new K(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}P(j,_),q.exports=j,j.prototype.validate=function(w){var k=w.normalize().x,X=k.redSqr(),G=X.redMul(k).redAdd(X.redMul(this.a)).redAdd(k),V=G.redSqrt();return V.redSqr().cmp(G)===0};function z(J,w,k){if(_.BasePoint.call(this,J,"projective"),w===null&&k===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new K(w,16),this.z=new K(k,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}P(z,_.BasePoint),j.prototype.decodePoint=function(w,k){return this.point(O.toArray(w,k),1)},j.prototype.point=function(w,k){return new z(this,w,k)},j.prototype.pointFromJSON=function(w){return z.fromJSON(this,w)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(w,k){return new z(w,k[0],k[1]||w.one)},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.z.cmpn(0)===0},z.prototype.dbl=function(){var w=this.x.redAdd(this.z),k=w.redSqr(),X=this.x.redSub(this.z),G=X.redSqr(),V=k.redSub(G),C=k.redMul(G),E=V.redMul(G.redAdd(this.curve.a24.redMul(V)));return this.curve.point(C,E)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(w,k){var X=this.x.redAdd(this.z),G=this.x.redSub(this.z),V=w.x.redAdd(w.z),C=w.x.redSub(w.z),E=C.redMul(X),h=V.redMul(G),I=k.z.redMul(E.redAdd(h).redSqr()),D=k.x.redMul(E.redISub(h).redSqr());return this.curve.point(I,D)},z.prototype.mul=function(w){var k=w.clone(),X=this,G=this.curve.point(null,null),V=this;for(var C=[];k.cmpn(0)!==0;k.iushrn(1))C.push(k.andln(1));for(var E=C.length-1;E>=0;E--)if(C[E]===0)X=X.diffAdd(G,V),G=G.dbl();else G=X.diffAdd(G,V),X=X.dbl();return G},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(w){return this.getX().cmp(w.getX())===0},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),Ll=l$(($,q)=>{var K=X8(),P=AK(),_=_8(),O=tj(),j=K.assert;function z(w){this.twisted=(w.a|0)!==1,this.mOneA=this.twisted&&(w.a|0)===-1,this.extended=this.mOneA,O.call(this,"edwards",w),this.a=new P(w.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new P(w.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new P(w.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(w.c|0)===1}_(z,O),q.exports=z,z.prototype._mulA=function(k){if(this.mOneA)return k.redNeg();else return this.a.redMul(k)},z.prototype._mulC=function(k){if(this.oneC)return k;else return this.c.redMul(k)},z.prototype.jpoint=function(k,X,G,V){return this.point(k,X,G,V)},z.prototype.pointFromX=function(k,X){if(k=new P(k,16),!k.red)k=k.toRed(this.red);var G=k.redSqr(),V=this.c2.redSub(this.a.redMul(G)),C=this.one.redSub(this.c2.redMul(this.d).redMul(G)),E=V.redMul(C.redInvm()),h=E.redSqrt();if(h.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");var I=h.fromRed().isOdd();if(X&&!I||!X&&I)h=h.redNeg();return this.point(k,h)},z.prototype.pointFromY=function(k,X){if(k=new P(k,16),!k.red)k=k.toRed(this.red);var G=k.redSqr(),V=G.redSub(this.c2),C=G.redMul(this.d).redMul(this.c2).redSub(this.a),E=V.redMul(C.redInvm());if(E.cmp(this.zero)===0)if(X)throw Error("invalid point");else return this.point(this.zero,k);var h=E.redSqrt();if(h.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");if(h.fromRed().isOdd()!==X)h=h.redNeg();return this.point(h,k)},z.prototype.validate=function(k){if(k.isInfinity())return!0;k.normalize();var X=k.x.redSqr(),G=k.y.redSqr(),V=X.redMul(this.a).redAdd(G),C=this.c2.redMul(this.one.redAdd(this.d.redMul(X).redMul(G)));return V.cmp(C)===0};function J(w,k,X,G,V){if(O.BasePoint.call(this,w,"projective"),k===null&&X===null&&G===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new P(k,16),this.y=new P(X,16),this.z=G?new P(G,16):this.curve.one,this.t=V&&new P(V,16),!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);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}_(J,O.BasePoint),z.prototype.pointFromJSON=function(k){return J.fromJSON(this,k)},z.prototype.point=function(k,X,G,V){return new J(this,k,X,G,V)},J.fromJSON=function(k,X){return new J(k,X[0],X[1],X[2])},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},J.prototype._extDbl=function(){var k=this.x.redSqr(),X=this.y.redSqr(),G=this.z.redSqr();G=G.redIAdd(G);var V=this.curve._mulA(k),C=this.x.redAdd(this.y).redSqr().redISub(k).redISub(X),E=V.redAdd(X),h=E.redSub(G),I=V.redSub(X),D=C.redMul(h),g=E.redMul(I),u=C.redMul(I),y=h.redMul(E);return this.curve.point(D,g,y,u)},J.prototype._projDbl=function(){var k=this.x.redAdd(this.y).redSqr(),X=this.x.redSqr(),G=this.y.redSqr(),V,C,E,h,I,D;if(this.curve.twisted){h=this.curve._mulA(X);var g=h.redAdd(G);if(this.zOne)V=k.redSub(X).redSub(G).redMul(g.redSub(this.curve.two)),C=g.redMul(h.redSub(G)),E=g.redSqr().redSub(g).redSub(g);else I=this.z.redSqr(),D=g.redSub(I).redISub(I),V=k.redSub(X).redISub(G).redMul(D),C=g.redMul(h.redSub(G)),E=g.redMul(D)}else h=X.redAdd(G),I=this.curve._mulC(this.z).redSqr(),D=h.redSub(I).redSub(I),V=this.curve._mulC(k.redISub(h)).redMul(D),C=this.curve._mulC(h).redMul(X.redISub(G)),E=h.redMul(D);return this.curve.point(V,C,E)},J.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},J.prototype._extAdd=function(k){var X=this.y.redSub(this.x).redMul(k.y.redSub(k.x)),G=this.y.redAdd(this.x).redMul(k.y.redAdd(k.x)),V=this.t.redMul(this.curve.dd).redMul(k.t),C=this.z.redMul(k.z.redAdd(k.z)),E=G.redSub(X),h=C.redSub(V),I=C.redAdd(V),D=G.redAdd(X),g=E.redMul(h),u=I.redMul(D),y=E.redMul(D),p=h.redMul(I);return this.curve.point(g,u,p,y)},J.prototype._projAdd=function(k){var X=this.z.redMul(k.z),G=X.redSqr(),V=this.x.redMul(k.x),C=this.y.redMul(k.y),E=this.curve.d.redMul(V).redMul(C),h=G.redSub(E),I=G.redAdd(E),D=this.x.redAdd(this.y).redMul(k.x.redAdd(k.y)).redISub(V).redISub(C),g=X.redMul(h).redMul(D),u,y;if(this.curve.twisted)u=X.redMul(I).redMul(C.redSub(this.curve._mulA(V))),y=h.redMul(I);else u=X.redMul(I).redMul(C.redSub(V)),y=this.curve._mulC(h).redMul(I);return this.curve.point(g,u,y)},J.prototype.add=function(k){if(this.isInfinity())return k;if(k.isInfinity())return this;if(this.curve.extended)return this._extAdd(k);else return this._projAdd(k)},J.prototype.mul=function(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);else return this.curve._wnafMul(this,k)},J.prototype.mulAdd=function(k,X,G){return this.curve._wnafMulAdd(1,[this,X],[k,G],2,!1)},J.prototype.jmulAdd=function(k,X,G){return this.curve._wnafMulAdd(1,[this,X],[k,G],2,!0)},J.prototype.normalize=function(){if(this.zOne)return this;var k=this.z.redInvm();if(this.x=this.x.redMul(k),this.y=this.y.redMul(k),this.t)this.t=this.t.redMul(k);return this.z=this.curve.one,this.zOne=!0,this},J.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},J.prototype.getX=function(){return this.normalize(),this.x.fromRed()},J.prototype.getY=function(){return this.normalize(),this.y.fromRed()},J.prototype.eq=function(k){return this===k||this.getX().cmp(k.getX())===0&&this.getY().cmp(k.getY())===0},J.prototype.eqXToP=function(k){var X=k.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(X)===0)return!0;var G=k.clone(),V=this.curve.redN.redMul(this.z);for(;;){if(G.iadd(this.curve.n),G.cmp(this.curve.p)>=0)return!1;if(X.redIAdd(V),this.x.cmp(X)===0)return!0}},J.prototype.toP=J.prototype.normalize,J.prototype.mixedAdd=J.prototype.add}),mS=l$(($)=>{var q=$;q.base=tj(),q.short=Il(),q.mont=Dl(),q.edwards=Ll()}),F8=l$(($)=>{var q=tK(),K=_8();$.inherits=K;function P(Y,H){if((Y.charCodeAt(H)&64512)!==55296)return!1;if(H<0||H+1>=Y.length)return!1;return(Y.charCodeAt(H+1)&64512)===56320}function _(Y,H){if(Array.isArray(Y))return Y.slice();if(!Y)return[];var T=[];if(typeof Y==="string"){if(!H){var W=0;for(var Z=0;Z<Y.length;Z++){var S=Y.charCodeAt(Z);if(S<128)T[W++]=S;else if(S<2048)T[W++]=S>>6|192,T[W++]=S&63|128;else if(P(Y,Z))S=65536+((S&1023)<<10)+(Y.charCodeAt(++Z)&1023),T[W++]=S>>18|240,T[W++]=S>>12&63|128,T[W++]=S>>6&63|128,T[W++]=S&63|128;else T[W++]=S>>12|224,T[W++]=S>>6&63|128,T[W++]=S&63|128}}else if(H==="hex"){if(Y=Y.replace(/[^a-z0-9]+/ig,""),Y.length%2!==0)Y="0"+Y;for(Z=0;Z<Y.length;Z+=2)T.push(parseInt(Y[Z]+Y[Z+1],16))}}else for(Z=0;Z<Y.length;Z++)T[Z]=Y[Z]|0;return T}$.toArray=_;function O(Y){var H="";for(var T=0;T<Y.length;T++)H+=J(Y[T].toString(16));return H}$.toHex=O;function j(Y){var H=Y>>>24|Y>>>8&65280|Y<<8&16711680|(Y&255)<<24;return H>>>0}$.htonl=j;function z(Y,H){var T="";for(var W=0;W<Y.length;W++){var Z=Y[W];if(H==="little")Z=j(Z);T+=w(Z.toString(16))}return T}$.toHex32=z;function J(Y){if(Y.length===1)return"0"+Y;else return Y}$.zero2=J;function w(Y){if(Y.length===7)return"0"+Y;else if(Y.length===6)return"00"+Y;else if(Y.length===5)return"000"+Y;else if(Y.length===4)return"0000"+Y;else if(Y.length===3)return"00000"+Y;else if(Y.length===2)return"000000"+Y;else if(Y.length===1)return"0000000"+Y;else return Y}$.zero8=w;function k(Y,H,T,W){var Z=T-H;q(Z%4===0);var S=Array(Z/4);for(var N=0,f=H;N<S.length;N++,f+=4){var v;if(W==="big")v=Y[f]<<24|Y[f+1]<<16|Y[f+2]<<8|Y[f+3];else v=Y[f+3]<<24|Y[f+2]<<16|Y[f+1]<<8|Y[f];S[N]=v>>>0}return S}$.join32=k;function X(Y,H){var T=Array(Y.length*4);for(var W=0,Z=0;W<Y.length;W++,Z+=4){var S=Y[W];if(H==="big")T[Z]=S>>>24,T[Z+1]=S>>>16&255,T[Z+2]=S>>>8&255,T[Z+3]=S&255;else T[Z+3]=S>>>24,T[Z+2]=S>>>16&255,T[Z+1]=S>>>8&255,T[Z]=S&255}return T}$.split32=X;function G(Y,H){return Y>>>H|Y<<32-H}$.rotr32=G;function V(Y,H){return Y<<H|Y>>>32-H}$.rotl32=V;function C(Y,H){return Y+H>>>0}$.sum32=C;function E(Y,H,T){return Y+H+T>>>0}$.sum32_3=E;function h(Y,H,T,W){return Y+H+T+W>>>0}$.sum32_4=h;function I(Y,H,T,W,Z){return Y+H+T+W+Z>>>0}$.sum32_5=I;function D(Y,H,T,W){var Z=Y[H],S=Y[H+1],N=W+S>>>0,f=(N<W?1:0)+T+Z;Y[H]=f>>>0,Y[H+1]=N}$.sum64=D;function g(Y,H,T,W){var Z=H+W>>>0,S=(Z<H?1:0)+Y+T;return S>>>0}$.sum64_hi=g;function u(Y,H,T,W){var Z=H+W;return Z>>>0}$.sum64_lo=u;function y(Y,H,T,W,Z,S,N,f){var v=0,A=H;A=A+W>>>0,v+=A<H?1:0,A=A+S>>>0,v+=A<S?1:0,A=A+f>>>0,v+=A<f?1:0;var L=Y+T+Z+N+v;return L>>>0}$.sum64_4_hi=y;function p(Y,H,T,W,Z,S,N,f){var v=H+W+S+f;return v>>>0}$.sum64_4_lo=p;function m(Y,H,T,W,Z,S,N,f,v,A){var L=0,R=H;R=R+W>>>0,L+=R<H?1:0,R=R+S>>>0,L+=R<S?1:0,R=R+f>>>0,L+=R<f?1:0,R=R+A>>>0,L+=R<A?1:0;var b=Y+T+Z+N+v+L;return b>>>0}$.sum64_5_hi=m;function s(Y,H,T,W,Z,S,N,f,v,A){var L=H+W+S+f+A;return L>>>0}$.sum64_5_lo=s;function U(Y,H,T){var W=H<<32-T|Y>>>T;return W>>>0}$.rotr64_hi=U;function l(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.rotr64_lo=l;function o(Y,H,T){return Y>>>T}$.shr64_hi=o;function M(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.shr64_lo=M}),c7=l$(($)=>{var q=F8(),K=tK();function P(){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}$.BlockHash=P,P.prototype.update=function(O,j){if(O=q.toArray(O,j),!this.pending)this.pending=O;else this.pending=this.pending.concat(O);if(this.pendingTotal+=O.length,this.pending.length>=this._delta8){O=this.pending;var z=O.length%this._delta8;if(this.pending=O.slice(O.length-z,O.length),this.pending.length===0)this.pending=null;O=q.join32(O,0,O.length-z,this.endian);for(var J=0;J<O.length;J+=this._delta32)this._update(O,J,J+this._delta32)}return this},P.prototype.digest=function(O){return this.update(this._pad()),K(this.pending===null),this._digest(O)},P.prototype._pad=function(){var O=this.pendingTotal,j=this._delta8,z=j-(O+this.padLength)%j,J=Array(z+this.padLength);J[0]=128;for(var w=1;w<z;w++)J[w]=0;if(O<<=3,this.endian==="big"){for(var k=8;k<this.padLength;k++)J[w++]=0;J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=O>>>24&255,J[w++]=O>>>16&255,J[w++]=O>>>8&255,J[w++]=O&255}else{J[w++]=O&255,J[w++]=O>>>8&255,J[w++]=O>>>16&255,J[w++]=O>>>24&255,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0;for(k=8;k<this.padLength;k++)J[w++]=0}return J}}),dS=l$(($)=>{var q=F8(),K=q.rotr32;function P(X,G,V,C){if(X===0)return _(G,V,C);if(X===1||X===3)return j(G,V,C);if(X===2)return O(G,V,C)}$.ft_1=P;function _(X,G,V){return X&G^~X&V}$.ch32=_;function O(X,G,V){return X&G^X&V^G&V}$.maj32=O;function j(X,G,V){return X^G^V}$.p32=j;function z(X){return K(X,2)^K(X,13)^K(X,22)}$.s0_256=z;function J(X){return K(X,6)^K(X,11)^K(X,25)}$.s1_256=J;function w(X){return K(X,7)^K(X,18)^X>>>3}$.g0_256=w;function k(X){return K(X,17)^K(X,19)^X>>>10}$.g1_256=k}),bl=l$(($,q)=>{var K=F8(),P=c7(),_=dS(),O=K.rotl32,j=K.sum32,z=K.sum32_5,J=_.ft_1,w=P.BlockHash,k=[1518500249,1859775393,2400959708,3395469782];function X(){if(!(this instanceof X))return new X;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}K.inherits(X,w),q.exports=X,X.blockSize=512,X.outSize=160,X.hmacStrength=80,X.padLength=64,X.prototype._update=function(V,C){var E=this.W;for(var h=0;h<16;h++)E[h]=V[C+h];for(;h<E.length;h++)E[h]=O(E[h-3]^E[h-8]^E[h-14]^E[h-16],1);var I=this.h[0],D=this.h[1],g=this.h[2],u=this.h[3],y=this.h[4];for(h=0;h<E.length;h++){var p=~~(h/20),m=z(O(I,5),J(p,D,g,u),y,E[h],k[p]);y=u,u=g,g=O(D,30),D=I,I=m}this.h[0]=j(this.h[0],I),this.h[1]=j(this.h[1],D),this.h[2]=j(this.h[2],g),this.h[3]=j(this.h[3],u),this.h[4]=j(this.h[4],y)},X.prototype._digest=function(V){if(V==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),lS=l$(($,q)=>{var K=F8(),P=c7(),_=dS(),O=tK(),j=K.sum32,z=K.sum32_4,J=K.sum32_5,w=_.ch32,k=_.maj32,X=_.s0_256,G=_.s1_256,V=_.g0_256,C=_.g1_256,E=P.BlockHash,h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function I(){if(!(this instanceof I))return new I;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=h,this.W=Array(64)}K.inherits(I,E),q.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(g,u){var y=this.W;for(var p=0;p<16;p++)y[p]=g[u+p];for(;p<y.length;p++)y[p]=z(C(y[p-2]),y[p-7],V(y[p-15]),y[p-16]);var m=this.h[0],s=this.h[1],U=this.h[2],l=this.h[3],o=this.h[4],M=this.h[5],Y=this.h[6],H=this.h[7];O(this.k.length===y.length);for(p=0;p<y.length;p++){var T=J(H,G(o),w(o,M,Y),this.k[p],y[p]),W=j(X(m),k(m,s,U));H=Y,Y=M,M=o,o=j(l,T),l=U,U=s,s=m,m=j(T,W)}this.h[0]=j(this.h[0],m),this.h[1]=j(this.h[1],s),this.h[2]=j(this.h[2],U),this.h[3]=j(this.h[3],l),this.h[4]=j(this.h[4],o),this.h[5]=j(this.h[5],M),this.h[6]=j(this.h[6],Y),this.h[7]=j(this.h[7],H)},I.prototype._digest=function(g){if(g==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),gl=l$(($,q)=>{var K=F8(),P=lS();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=512,_.outSize=224,_.hmacStrength=192,_.padLength=64,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,7),"big");else return K.split32(this.h.slice(0,7),"big")}}),rS=l$(($,q)=>{var K=F8(),P=c7(),_=tK(),O=K.rotr64_hi,j=K.rotr64_lo,z=K.shr64_hi,J=K.shr64_lo,w=K.sum64,k=K.sum64_hi,X=K.sum64_lo,G=K.sum64_4_hi,V=K.sum64_4_lo,C=K.sum64_5_hi,E=K.sum64_5_lo,h=P.BlockHash,I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function D(){if(!(this instanceof D))return new D;h.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=Array(160)}K.inherits(D,h),q.exports=D,D.blockSize=1024,D.outSize=512,D.hmacStrength=192,D.padLength=128,D.prototype._prepareBlock=function(W,Z){var S=this.W;for(var N=0;N<32;N++)S[N]=W[Z+N];for(;N<S.length;N+=2){var f=Y(S[N-4],S[N-3]),v=H(S[N-4],S[N-3]),A=S[N-14],L=S[N-13],R=o(S[N-30],S[N-29]),b=M(S[N-30],S[N-29]),d=S[N-32],i=S[N-31];S[N]=G(f,v,A,L,R,b,d,i),S[N+1]=V(f,v,A,L,R,b,d,i)}},D.prototype._update=function(W,Z){this._prepareBlock(W,Z);var S=this.W,N=this.h[0],f=this.h[1],v=this.h[2],A=this.h[3],L=this.h[4],R=this.h[5],b=this.h[6],d=this.h[7],i=this.h[8],a=this.h[9],W$=this.h[10],n=this.h[11],B=this.h[12],y$=this.h[13],Y$=this.h[14],v$=this.h[15];_(this.k.length===S.length);for(var Q=0;Q<S.length;Q+=2){var r=Y$,t=v$,x$=U(i,a),q$=l(i,a),$$=g(i,a,W$,n,B,y$),e=u(i,a,W$,n,B,y$),F=this.k[Q],_$=this.k[Q+1],f$=S[Q],O$=S[Q+1],T$=C(r,t,x$,q$,$$,e,F,_$,f$,O$),O6=E(r,t,x$,q$,$$,e,F,_$,f$,O$);r=m(N,f),t=s(N,f),x$=y(N,f,v,A,L,R),q$=p(N,f,v,A,L,R);var H$=k(r,t,x$,q$),X$=X(r,t,x$,q$);Y$=B,v$=y$,B=W$,y$=n,W$=i,n=a,i=k(b,d,T$,O6),a=X(d,d,T$,O6),b=L,d=R,L=v,R=A,v=N,A=f,N=k(T$,O6,H$,X$),f=X(T$,O6,H$,X$)}w(this.h,0,N,f),w(this.h,2,v,A),w(this.h,4,L,R),w(this.h,6,b,d),w(this.h,8,i,a),w(this.h,10,W$,n),w(this.h,12,B,y$),w(this.h,14,Y$,v$)},D.prototype._digest=function(W){if(W==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")};function g(T,W,Z,S,N){var f=T&Z^~T&N;if(f<0)f+=4294967296;return f}function u(T,W,Z,S,N,f){var v=W&S^~W&f;if(v<0)v+=4294967296;return v}function y(T,W,Z,S,N){var f=T&Z^T&N^Z&N;if(f<0)f+=4294967296;return f}function p(T,W,Z,S,N,f){var v=W&S^W&f^S&f;if(v<0)v+=4294967296;return v}function m(T,W){var Z=O(T,W,28),S=O(W,T,2),N=O(W,T,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function s(T,W){var Z=j(T,W,28),S=j(W,T,2),N=j(W,T,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function U(T,W){var Z=O(T,W,14),S=O(T,W,18),N=O(W,T,9),f=Z^S^N;if(f<0)f+=4294967296;return f}function l(T,W){var Z=j(T,W,14),S=j(T,W,18),N=j(W,T,9),f=Z^S^N;if(f<0)f+=4294967296;return f}function o(T,W){var Z=O(T,W,1),S=O(T,W,8),N=z(T,W,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function M(T,W){var Z=j(T,W,1),S=j(T,W,8),N=J(T,W,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function Y(T,W){var Z=O(T,W,19),S=O(W,T,29),N=z(T,W,6),f=Z^S^N;if(f<0)f+=4294967296;return f}function H(T,W){var Z=j(T,W,19),S=j(W,T,29),N=J(T,W,6),f=Z^S^N;if(f<0)f+=4294967296;return f}}),ul=l$(($,q)=>{var K=F8(),P=rS();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=1024,_.outSize=384,_.hmacStrength=192,_.padLength=128,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,12),"big");else return K.split32(this.h.slice(0,12),"big")}}),yl=l$(($)=>{$.sha1=bl(),$.sha224=gl(),$.sha256=lS(),$.sha384=ul(),$.sha512=rS()}),xl=l$(($)=>{var q=F8(),K=c7(),P=q.rotl32,_=q.sum32,O=q.sum32_3,j=q.sum32_4,z=K.BlockHash;function J(){if(!(this instanceof J))return new J;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}q.inherits(J,z),$.ripemd160=J,J.blockSize=512,J.outSize=160,J.hmacStrength=192,J.padLength=64,J.prototype._update=function(I,D){var g=this.h[0],u=this.h[1],y=this.h[2],p=this.h[3],m=this.h[4],s=g,U=u,l=y,o=p,M=m;for(var Y=0;Y<80;Y++){var H=_(P(j(g,w(Y,u,y,p),I[G[Y]+D],k(Y)),C[Y]),m);g=m,m=p,p=P(y,10),y=u,u=H,H=_(P(j(s,w(79-Y,U,l,o),I[V[Y]+D],X(Y)),E[Y]),M),s=M,M=o,o=P(l,10),l=U,U=H}H=O(this.h[1],y,o),this.h[1]=O(this.h[2],p,M),this.h[2]=O(this.h[3],m,s),this.h[3]=O(this.h[4],g,U),this.h[4]=O(this.h[0],u,l),this.h[0]=H},J.prototype._digest=function(I){if(I==="hex")return q.toHex32(this.h,"little");else return q.split32(this.h,"little")};function w(h,I,D,g){if(h<=15)return I^D^g;else if(h<=31)return I&D|~I&g;else if(h<=47)return(I|~D)^g;else if(h<=63)return I&g|D&~g;else return I^(D|~g)}function k(h){if(h<=15)return 0;else if(h<=31)return 1518500249;else if(h<=47)return 1859775393;else if(h<=63)return 2400959708;else return 2840853838}function X(h){if(h<=15)return 1352829926;else if(h<=31)return 1548603684;else if(h<=47)return 1836072691;else if(h<=63)return 2053994217;else return 0}var G=[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],V=[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],C=[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],E=[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]}),cl=l$(($,q)=>{var K=F8(),P=tK();function _(O,j,z){if(!(this instanceof _))return new _(O,j,z);this.Hash=O,this.blockSize=O.blockSize/8,this.outSize=O.outSize/8,this.inner=null,this.outer=null,this._init(K.toArray(j,z))}q.exports=_,_.prototype._init=function(j){if(j.length>this.blockSize)j=new this.Hash().update(j).digest();P(j.length<=this.blockSize);for(var z=j.length;z<this.blockSize;z++)j.push(0);for(z=0;z<j.length;z++)j[z]^=54;this.inner=new this.Hash().update(j);for(z=0;z<j.length;z++)j[z]^=106;this.outer=new this.Hash().update(j)},_.prototype.update=function(j,z){return this.inner.update(j,z),this},_.prototype.digest=function(j){return this.outer.update(this.inner.digest()),this.outer.digest(j)}}),zH=l$(($)=>{var q=$;q.utils=F8(),q.common=c7(),q.sha=yl(),q.ripemd=xl(),q.hmac=cl(),q.sha1=q.sha.sha1,q.sha256=q.sha.sha256,q.sha224=q.sha.sha224,q.sha384=q.sha.sha384,q.sha512=q.sha.sha512,q.ripemd160=q.ripemd.ripemd160}),pl=l$(($,q)=>{q.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),WH=l$(($)=>{var q=$,K=zH(),P=mS(),_=X8(),O=_.assert;function j(w){if(w.type==="short")this.curve=new P.short(w);else if(w.type==="edwards")this.curve=new P.edwards(w);else this.curve=new P.mont(w);this.g=this.curve.g,this.n=this.curve.n,this.hash=w.hash,O(this.g.validate(),"Invalid curve"),O(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}q.PresetCurve=j;function z(w,k){Object.defineProperty(q,w,{configurable:!0,enumerable:!0,get:function(){var X=new j(k);return Object.defineProperty(q,w,{configurable:!0,enumerable:!0,value:X}),X}})}z("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:K.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),z("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:K.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),z("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:K.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),z("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:K.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),z("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:K.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),z("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:K.sha256,gRed:!1,g:["9"]}),z("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:K.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var J;try{J=pl()}catch(w){J=void 0}z("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:K.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",J]})}),ml=l$(($,q)=>{var K=zH(),P=cS(),_=tK();function O(j){if(!(this instanceof O))return new O(j);this.hash=j.hash,this.predResist=!!j.predResist,this.outLen=this.hash.outSize,this.minEntropy=j.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=P.toArray(j.entropy,j.entropyEnc||"hex"),J=P.toArray(j.nonce,j.nonceEnc||"hex"),w=P.toArray(j.pers,j.persEnc||"hex");_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,J,w)}q.exports=O,O.prototype._init=function(z,J,w){var k=z.concat(J).concat(w);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var X=0;X<this.V.length;X++)this.K[X]=0,this.V[X]=1;this._update(k),this._reseed=1,this.reseedInterval=281474976710656},O.prototype._hmac=function(){return new K.hmac(this.hash,this.K)},O.prototype._update=function(z){var J=this._hmac().update(this.V).update([0]);if(z)J=J.update(z);if(this.K=J.digest(),this.V=this._hmac().update(this.V).digest(),!z)return;this.K=this._hmac().update(this.V).update([1]).update(z).digest(),this.V=this._hmac().update(this.V).digest()},O.prototype.reseed=function(z,J,w,k){if(typeof J!=="string")k=w,w=J,J=null;z=P.toArray(z,J),w=P.toArray(w,k),_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(z.concat(w||[])),this._reseed=1},O.prototype.generate=function(z,J,w,k){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof J!=="string")k=w,w=J,J=null;if(w)w=P.toArray(w,k||"hex"),this._update(w);var X=[];while(X.length<z)this.V=this._hmac().update(this.V).digest(),X=X.concat(this.V);var G=X.slice(0,z);return this._update(w),this._reseed++,P.encode(G,J)}}),dl=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert;function O(j,z){if(this.ec=j,this.priv=null,this.pub=null,z.priv)this._importPrivate(z.priv,z.privEnc);if(z.pub)this._importPublic(z.pub,z.pubEnc)}q.exports=O,O.fromPublic=function(z,J,w){if(J instanceof O)return J;return new O(z,{pub:J,pubEnc:w})},O.fromPrivate=function(z,J,w){if(J instanceof O)return J;return new O(z,{priv:J,privEnc:w})},O.prototype.validate=function(){var z=this.getPublic();if(z.isInfinity())return{result:!1,reason:"Invalid public key"};if(!z.validate())return{result:!1,reason:"Public key is not a point"};if(!z.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},O.prototype.getPublic=function(z,J){if(typeof z==="string")J=z,z=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!J)return this.pub;return this.pub.encode(J,z)},O.prototype.getPrivate=function(z){if(z==="hex")return this.priv.toString(16,2);else return this.priv},O.prototype._importPrivate=function(z,J){this.priv=new K(z,J||16),this.priv=this.priv.umod(this.ec.curve.n)},O.prototype._importPublic=function(z,J){if(z.x||z.y){if(this.ec.curve.type==="mont")_(z.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")_(z.x&&z.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(z.x,z.y);return}this.pub=this.ec.curve.decodePoint(z,J)},O.prototype.derive=function(z){if(!z.validate())_(z.validate(),"public point not validated");return z.mul(this.priv).getX()},O.prototype.sign=function(z,J,w){return this.ec.sign(z,this,J,w)},O.prototype.verify=function(z,J,w){return this.ec.verify(z,J,this,void 0,w)},O.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),ll=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert;function O(k,X){if(k instanceof O)return k;if(this._importDER(k,X))return;if(_(k.r&&k.s,"Signature without r or s"),this.r=new K(k.r,16),this.s=new K(k.s,16),k.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=k.recoveryParam}q.exports=O;function j(){this.place=0}function z(k,X){var G=k[X.place++];if(!(G&128))return G;var V=G&15;if(V===0||V>4)return!1;if(k[X.place]===0)return!1;var C=0;for(var E=0,h=X.place;E<V;E++,h++)C<<=8,C|=k[h],C>>>=0;if(C<=127)return!1;return X.place=h,C}function J(k){var X=0,G=k.length-1;while(!k[X]&&!(k[X+1]&128)&&X<G)X++;if(X===0)return k;return k.slice(X)}O.prototype._importDER=function(X,G){X=P.toArray(X,G);var V=new j;if(X[V.place++]!==48)return!1;var C=z(X,V);if(C===!1)return!1;if(C+V.place!==X.length)return!1;if(X[V.place++]!==2)return!1;var E=z(X,V);if(E===!1)return!1;if((X[V.place]&128)!==0)return!1;var h=X.slice(V.place,E+V.place);if(V.place+=E,X[V.place++]!==2)return!1;var I=z(X,V);if(I===!1)return!1;if(X.length!==I+V.place)return!1;if((X[V.place]&128)!==0)return!1;var D=X.slice(V.place,I+V.place);if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;if(D[0]===0)if(D[1]&128)D=D.slice(1);else return!1;return this.r=new K(h),this.s=new K(D),this.recoveryParam=null,!0};function w(k,X){if(X<128){k.push(X);return}var G=1+(Math.log(X)/Math.LN2>>>3);k.push(G|128);while(--G)k.push(X>>>(G<<3)&255);k.push(X)}O.prototype.toDER=function(X){var G=this.r.toArray(),V=this.s.toArray();if(G[0]&128)G=[0].concat(G);if(V[0]&128)V=[0].concat(V);G=J(G),V=J(V);while(!V[0]&&!(V[1]&128))V=V.slice(1);var C=[2];w(C,G.length),C=C.concat(G),C.push(2),w(C,V.length);var E=C.concat(V),h=[48];return w(h,E.length),h=h.concat(E),P.encode(h,X)}}),rl=l$(($,q)=>{var K=AK(),P=ml(),_=X8(),O=WH(),j=pS(),z=_.assert,J=dl(),w=ll();function k(X){if(!(this instanceof k))return new k(X);if(typeof X==="string")z(Object.prototype.hasOwnProperty.call(O,X),"Unknown curve "+X),X=O[X];if(X instanceof O.PresetCurve)X={curve:X};this.curve=X.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=X.curve.g,this.g.precompute(X.curve.n.bitLength()+1),this.hash=X.hash||X.curve.hash}q.exports=k,k.prototype.keyPair=function(G){return new J(this,G)},k.prototype.keyFromPrivate=function(G,V){return J.fromPrivate(this,G,V)},k.prototype.keyFromPublic=function(G,V){return J.fromPublic(this,G,V)},k.prototype.genKeyPair=function(G){if(!G)G={};var V=new P({hash:this.hash,pers:G.pers,persEnc:G.persEnc||"utf8",entropy:G.entropy||j(this.hash.hmacStrength),entropyEnc:G.entropy&&G.entropyEnc||"utf8",nonce:this.n.toArray()}),C=this.n.byteLength(),E=this.n.sub(new K(2));for(;;){var h=new K(V.generate(C));if(h.cmp(E)>0)continue;return h.iaddn(1),this.keyFromPrivate(h)}},k.prototype._truncateToN=function(G,V,C){var E;if(K.isBN(G)||typeof G==="number")G=new K(G,16),E=G.byteLength();else if(typeof G==="object")E=G.length,G=new K(G,16);else{var h=G.toString();E=h.length+1>>>1,G=new K(h,16)}if(typeof C!=="number")C=E*8;var I=C-this.n.bitLength();if(I>0)G=G.ushrn(I);if(!V&&G.cmp(this.n)>=0)return G.sub(this.n);else return G},k.prototype.sign=function(G,V,C,E){if(typeof C==="object")E=C,C=null;if(!E)E={};if(typeof G!=="string"&&typeof G!=="number"&&!K.isBN(G)){z(typeof G==="object"&&G&&typeof G.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(G.length>>>0===G.length);for(var h=0;h<G.length;h++)z((G[h]&255)===G[h])}V=this.keyFromPrivate(V,C),G=this._truncateToN(G,!1,E.msgBitLength),z(!G.isNeg(),"Can not sign a negative message");var I=this.n.byteLength(),D=V.getPrivate().toArray("be",I),g=G.toArray("be",I);z(new K(g).eq(G),"Can not sign message");var u=new P({hash:this.hash,entropy:D,nonce:g,pers:E.pers,persEnc:E.persEnc||"utf8"}),y=this.n.sub(new K(1));for(var p=0;;p++){var m=E.k?E.k(p):new K(u.generate(this.n.byteLength()));if(m=this._truncateToN(m,!0),m.cmpn(1)<=0||m.cmp(y)>=0)continue;var s=this.g.mul(m);if(s.isInfinity())continue;var U=s.getX(),l=U.umod(this.n);if(l.cmpn(0)===0)continue;var o=m.invm(this.n).mul(l.mul(V.getPrivate()).iadd(G));if(o=o.umod(this.n),o.cmpn(0)===0)continue;var M=(s.getY().isOdd()?1:0)|(U.cmp(l)!==0?2:0);if(E.canonical&&o.cmp(this.nh)>0)o=this.n.sub(o),M^=1;return new w({r:l,s:o,recoveryParam:M})}},k.prototype.verify=function(G,V,C,E,h){if(!h)h={};G=this._truncateToN(G,!1,h.msgBitLength),C=this.keyFromPublic(C,E),V=new w(V,"hex");var{r:I,s:D}=V;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;if(D.cmpn(1)<0||D.cmp(this.n)>=0)return!1;var g=D.invm(this.n),u=g.mul(G).umod(this.n),y=g.mul(I).umod(this.n),p;if(!this.curve._maxwellTrick){if(p=this.g.mulAdd(u,C.getPublic(),y),p.isInfinity())return!1;return p.getX().umod(this.n).cmp(I)===0}if(p=this.g.jmulAdd(u,C.getPublic(),y),p.isInfinity())return!1;return p.eqXToP(I)},k.prototype.recoverPubKey=function(X,G,V,C){z((3&V)===V,"The recovery param is more than two bits"),G=new w(G,C);var E=this.n,h=new K(X),I=G.r,D=G.s,g=V&1,u=V>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");if(u)I=this.curve.pointFromX(I.add(this.curve.n),g);else I=this.curve.pointFromX(I,g);var y=G.r.invm(E),p=E.sub(h).mul(y).umod(E),m=D.mul(y).umod(E);return this.g.mulAdd(p,I,m)},k.prototype.getKeyRecoveryParam=function(X,G,V,C){if(G=new w(G,C),G.recoveryParam!==null)return G.recoveryParam;for(var E=0;E<4;E++){var h;try{h=this.recoverPubKey(X,G,E)}catch(I){continue}if(h.eq(V))return E}throw Error("Unable to find valid recovery factor")}}),ol=l$(($,q)=>{var K=X8(),P=K.assert,_=K.parseBytes,O=K.cachedProperty;function j(z,J){if(this.eddsa=z,this._secret=_(J.secret),z.isPoint(J.pub))this._pub=J.pub;else this._pubBytes=_(J.pub)}j.fromPublic=function(J,w){if(w instanceof j)return w;return new j(J,{pub:w})},j.fromSecret=function(J,w){if(w instanceof j)return w;return new j(J,{secret:w})},j.prototype.secret=function(){return this._secret},O(j,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),O(j,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),O(j,"privBytes",function(){var J=this.eddsa,w=this.hash(),k=J.encodingLength-1,X=w.slice(0,J.encodingLength);return X[0]&=248,X[k]&=127,X[k]|=64,X}),O(j,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),O(j,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),O(j,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),j.prototype.sign=function(J){return P(this._secret,"KeyPair can only verify"),this.eddsa.sign(J,this)},j.prototype.verify=function(J,w){return this.eddsa.verify(J,w,this)},j.prototype.getSecret=function(J){return P(this._secret,"KeyPair is public only"),K.encode(this.secret(),J)},j.prototype.getPublic=function(J){return K.encode(this.pubBytes(),J)},q.exports=j}),nl=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert,O=P.cachedProperty,j=P.parseBytes;function z(J,w){if(this.eddsa=J,typeof w!=="object")w=j(w);if(Array.isArray(w))_(w.length===J.encodingLength*2,"Signature has invalid size"),w={R:w.slice(0,J.encodingLength),S:w.slice(J.encodingLength)};if(_(w.R&&w.S,"Signature without R or S"),J.isPoint(w.R))this._R=w.R;if(w.S instanceof K)this._S=w.S;this._Rencoded=Array.isArray(w.R)?w.R:w.Rencoded,this._Sencoded=Array.isArray(w.S)?w.S:w.Sencoded}O(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),O(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),O(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),O(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return P.encode(this.toBytes(),"hex").toUpperCase()},q.exports=z}),il=l$(($,q)=>{var K=zH(),P=WH(),_=X8(),O=_.assert,j=_.parseBytes,z=ol(),J=nl();function w(k){if(O(k==="ed25519","only tested with ed25519 so far"),!(this instanceof w))return new w(k);k=P[k].curve,this.curve=k,this.g=k.g,this.g.precompute(k.n.bitLength()+1),this.pointClass=k.point().constructor,this.encodingLength=Math.ceil(k.n.bitLength()/8),this.hash=K.sha512}q.exports=w,w.prototype.sign=function(X,G){X=j(X);var V=this.keyFromSecret(G),C=this.hashInt(V.messagePrefix(),X),E=this.g.mul(C),h=this.encodePoint(E),I=this.hashInt(h,V.pubBytes(),X).mul(V.priv()),D=C.add(I).umod(this.curve.n);return this.makeSignature({R:E,S:D,Rencoded:h})},w.prototype.verify=function(X,G,V){if(X=j(X),G=this.makeSignature(G),G.S().gte(G.eddsa.curve.n)||G.S().isNeg())return!1;var C=this.keyFromPublic(V),E=this.hashInt(G.Rencoded(),C.pubBytes(),X),h=this.g.mul(G.S()),I=G.R().add(C.pub().mul(E));return I.eq(h)},w.prototype.hashInt=function(){var X=this.hash();for(var G=0;G<arguments.length;G++)X.update(arguments[G]);return _.intFromLE(X.digest()).umod(this.curve.n)},w.prototype.keyFromPublic=function(X){return z.fromPublic(this,X)},w.prototype.keyFromSecret=function(X){return z.fromSecret(this,X)},w.prototype.makeSignature=function(X){if(X instanceof J)return X;return new J(this,X)},w.prototype.encodePoint=function(X){var G=X.getY().toArray("le",this.encodingLength);return G[this.encodingLength-1]|=X.getX().isOdd()?128:0,G},w.prototype.decodePoint=function(X){X=_.parseBytes(X);var G=X.length-1,V=X.slice(0,G).concat(X[G]&-129),C=(X[G]&128)!==0,E=_.intFromLE(V);return this.curve.pointFromY(E,C)},w.prototype.encodeInt=function(X){return X.toArray("le",this.encodingLength)},w.prototype.decodeInt=function(X){return _.intFromLE(X)},w.prototype.isPoint=function(X){return X instanceof this.pointClass}}),Bl=l$(($)=>{var q=$;q.version=hl().version,q.utils=X8(),q.rand=pS(),q.curve=mS(),q.curves=WH(),q.ec=rl(),q.eddsa=il()}),tl=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,a=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,Q=W[4]|0,r=Q&8191,t=Q>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,e=W[6]|0,F=e&8191,_$=e>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(a,k$)|0,A=Math.imul(a,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(a,D$)|0,A=A+Math.imul(a,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(a,C$)|0,A=A+Math.imul(a,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(a,h$)|0,A=A+Math.imul(a,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(a,b$)|0,A=A+Math.imul(a,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(F,k$),v=Math.imul(F,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(a,x)|0,A=A+Math.imul(a,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(F,D$)|0,v=v+Math.imul(F,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(a,K$)|0,A=A+Math.imul(a,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(F,C$)|0,v=v+Math.imul(F,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(a,Z$)|0,A=A+Math.imul(a,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(F,h$)|0,v=v+Math.imul(F,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(a,g$)|0,A=A+Math.imul(a,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(F,b$)|0,v=v+Math.imul(F,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(a,M$)|0,A=A+Math.imul(a,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(F,x)|0,v=v+Math.imul(F,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(F,K$)|0,v=v+Math.imul(F,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(F,Z$)|0,v=v+Math.imul(F,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(F,g$)|0,v=v+Math.imul(F,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(F,M$)|0,v=v+Math.imul(F,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],a=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=a+n,T[L+d+N]=i-W$,W[L+d+N]=a-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(s,y);function U(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(U,y),U.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new m;else if(Y==="p192")H=new s;else if(Y==="p25519")H=new U;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var a=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(a),A=a.redSqr(),R=R.redMul(A),b=i}return L},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,l),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),Ul=l$(($,q)=>{var K=Bl(),P=tl();q.exports=function(J){return new O(J)};var _={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};_.p224=_.secp224r1,_.p256=_.secp256r1=_.prime256v1,_.p192=_.secp192r1=_.prime192v1,_.p384=_.secp384r1,_.p521=_.secp521r1;function O(z){if(this.curveType=_[z],!this.curveType)this.curveType={name:z};this.curve=new K.ec(this.curveType.name),this.keys=void 0}O.prototype.generateKeys=function(z,J){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,J)},O.prototype.computeSecret=function(z,J,w){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var k=this.curve.keyFromPublic(z).getPublic(),X=k.mul(this.keys.getPrivate()).getX();return j(X,w,this.curveType.byteLength)},O.prototype.getPublicKey=function(z,J){var w=this.keys.getPublic(J==="compressed",!0);if(J==="hybrid")if(w[w.length-1]%2)w[0]=7;else w[0]=6;return j(w,z)},O.prototype.getPrivateKey=function(z){return j(this.keys.getPrivate(),z)},O.prototype.setPublicKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);return this.keys._importPublic(z),this},O.prototype.setPrivateKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var w=new P(z);return w=w.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(w),this};function j(z,J,w){if(!Array.isArray(z))z=z.toArray();var k=new Buffer(z);if(w&&k.length<w){var X=new Buffer(w-k.length);X.fill(0),k=Buffer.concat([X,k])}if(!J)return k;else return k.toString(J)}}),Fl=l$(($,q)=>{var K=(dq(),W6(mq)).createECDH;q.exports=K||Ul()}),al=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,a=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,Q=W[4]|0,r=Q&8191,t=Q>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,e=W[6]|0,F=e&8191,_$=e>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(a,k$)|0,A=Math.imul(a,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(a,D$)|0,A=A+Math.imul(a,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(a,C$)|0,A=A+Math.imul(a,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(a,h$)|0,A=A+Math.imul(a,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(a,b$)|0,A=A+Math.imul(a,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(F,k$),v=Math.imul(F,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(a,x)|0,A=A+Math.imul(a,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(F,D$)|0,v=v+Math.imul(F,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(a,K$)|0,A=A+Math.imul(a,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(F,C$)|0,v=v+Math.imul(F,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(a,Z$)|0,A=A+Math.imul(a,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(F,h$)|0,v=v+Math.imul(F,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(a,g$)|0,A=A+Math.imul(a,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(F,b$)|0,v=v+Math.imul(F,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(a,M$)|0,A=A+Math.imul(a,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(F,x)|0,v=v+Math.imul(F,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(F,K$)|0,v=v+Math.imul(F,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(F,Z$)|0,v=v+Math.imul(F,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(F,g$)|0,v=v+Math.imul(F,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(F,M$)|0,v=v+Math.imul(F,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],a=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=a+n,T[L+d+N]=i-W$,W[L+d+N]=a-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(s,y);function U(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(U,y),U.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new m;else if(Y==="p192")H=new s;else if(Y==="p25519")H=new U;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var a=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(a),A=a.redSqr(),R=R.redMul(A),b=i}return L},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,l),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),Ql=l$(($)=>{var q=p7(),K=_8(),P=$;P.define=function(j,z){return new _(j,z)};function _(O,j){this.name=O,this.body=j,this.decoders={},this.encoders={}}_.prototype._createNamed=function(j){var z;try{z=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
34
+ `;super(_);this.name="AggregateError",this.errors=P}}q.exports={AggregateError:K,ArrayIsArray(P){return Array.isArray(P)},ArrayPrototypeIncludes(P,_){return P.includes(_)},ArrayPrototypeIndexOf(P,_){return P.indexOf(_)},ArrayPrototypeJoin(P,_){return P.join(_)},ArrayPrototypeMap(P,_){return P.map(_)},ArrayPrototypePop(P,_){return P.pop(_)},ArrayPrototypePush(P,_){return P.push(_)},ArrayPrototypeSlice(P,_,O){return P.slice(_,O)},Error,FunctionPrototypeCall(P,_,...O){return P.call(_,...O)},FunctionPrototypeSymbolHasInstance(P,_){return Function.prototype[Symbol.hasInstance].call(P,_)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(P,_){return Object.defineProperties(P,_)},ObjectDefineProperty(P,_,O){return Object.defineProperty(P,_,O)},ObjectGetOwnPropertyDescriptor(P,_){return Object.getOwnPropertyDescriptor(P,_)},ObjectKeys(P){return Object.keys(P)},ObjectSetPrototypeOf(P,_){return Object.setPrototypeOf(P,_)},Promise,PromisePrototypeCatch(P,_){return P.catch(_)},PromisePrototypeThen(P,_,O){return P.then(_,O)},PromiseReject(P){return Promise.reject(P)},PromiseResolve(P){return Promise.resolve(P)},ReflectApply:Reflect.apply,RegExpPrototypeTest(P,_){return P.test(_)},SafeSet:Set,String,StringPrototypeSlice(P,_,O){return P.slice(_,O)},StringPrototypeToLowerCase(P){return P.toLowerCase()},StringPrototypeToUpperCase(P){return P.toUpperCase()},StringPrototypeTrim(P){return P.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(P,_,O){return P.set(_,O)},Boolean,Uint8Array}}),NS=A6(($,q)=>{q.exports={format(K,...P){return K.replace(/%([sdifj])/g,function(...[_,O]){let j=P.shift();if(O==="f")return j.toFixed(6);else if(O==="j")return JSON.stringify(j);else if(O==="s"&&typeof j==="object")return`${j.constructor!==Object?j.constructor.name:""} {}`.trim();else return j.toString()})},inspect(K){switch(typeof K){case"string":if(K.includes("'")){if(!K.includes('"'))return`"${K}"`;else if(!K.includes("`")&&!K.includes("${"))return`\`${K}\``}return`'${K}'`;case"number":if(isNaN(K))return"NaN";else if(Object.is(K,-0))return String(K);return K;case"bigint":return`${String(K)}n`;case"boolean":case"undefined":return String(K);case"object":return"{}"}}}}),pq=A6(($,q)=>{var{format:K,inspect:P}=NS(),{AggregateError:_}=L6(),O=globalThis.AggregateError||_,j=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],J=/^([A-Z][a-z0-9]*)+$/,w={};function k(I,D){if(!I)throw new w.ERR_INTERNAL_ASSERTION(D)}function X(I){let D="",g=I.length,u=I[0]==="-"?1:0;for(;g>=u+4;g-=3)D=`_${I.slice(g-3,g)}${D}`;return`${I.slice(0,g)}${D}`}function G(I,D,g){if(typeof D==="function")return k(D.length<=g.length,`Code: ${I}; The provided arguments length (${g.length}) does not match the required ones (${D.length}).`),D(...g);let u=(D.match(/%[dfijoOs]/g)||[]).length;if(k(u===g.length,`Code: ${I}; The provided arguments length (${g.length}) does not match the required ones (${u}).`),g.length===0)return D;return K(D,...g)}function V(I,D,g){if(!g)g=Error;class u extends g{constructor(...y){super(G(I,D,y))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(u.prototype,{name:{value:g.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),u.prototype.code=I,u.prototype[j]=!0,w[I]=u}function C(I){let D="__node_internal_"+I.name;return Object.defineProperty(I,"name",{value:D}),I}function E(I,D){if(I&&D&&I!==D){if(Array.isArray(D.errors))return D.errors.push(I),D;let g=new O([D,I],D.message);return g.code=D.code,g}return I||D}class h extends Error{constructor(I="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!=="object")throw new w.ERR_INVALID_ARG_TYPE("options","Object",D);super(I,D);this.code="ABORT_ERR",this.name="AbortError"}}V("ERR_ASSERTION","%s",Error),V("ERR_INVALID_ARG_TYPE",(I,D,g)=>{if(k(typeof I==="string","'name' must be a string"),!Array.isArray(D))D=[D];let u="The ";if(I.endsWith(" argument"))u+=`${I} `;else u+=`"${I}" ${I.includes(".")?"property":"argument"} `;u+="must be ";let y=[],p=[],l=[];for(let e of D)if(k(typeof e==="string","All expected entries have to be of type string"),z.includes(e))y.push(e.toLowerCase());else if(J.test(e))p.push(e);else k(e!=="object",'The value "object" should be written as "Object"'),l.push(e);if(p.length>0){let e=y.indexOf("object");if(e!==-1)y.splice(y,e,1),p.push("Object")}if(y.length>0){switch(y.length){case 1:u+=`of type ${y[0]}`;break;case 2:u+=`one of type ${y[0]} or ${y[1]}`;break;default:{let e=y.pop();u+=`one of type ${y.join(", ")}, or ${e}`}}if(p.length>0||l.length>0)u+=" or "}if(p.length>0){switch(p.length){case 1:u+=`an instance of ${p[0]}`;break;case 2:u+=`an instance of ${p[0]} or ${p[1]}`;break;default:{let e=p.pop();u+=`an instance of ${p.join(", ")}, or ${e}`}}if(l.length>0)u+=" or "}switch(l.length){case 0:break;case 1:if(l[0].toLowerCase()!==l[0])u+="an ";u+=`${l[0]}`;break;case 2:u+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();u+=`one of ${l.join(", ")}, or ${e}`}}if(g==null)u+=`. Received ${g}`;else if(typeof g==="function"&&g.name)u+=`. Received function ${g.name}`;else if(typeof g==="object"){var Q;if((Q=g.constructor)!==null&&Q!==void 0&&Q.name)u+=`. Received an instance of ${g.constructor.name}`;else{let e=P(g,{depth:-1});u+=`. Received ${e}`}}else{let e=P(g,{colors:!1});if(e.length>25)e=`${e.slice(0,25)}...`;u+=`. Received type ${typeof g} (${e})`}return u},TypeError),V("ERR_INVALID_ARG_VALUE",(I,D,g="is invalid")=>{let u=P(D);if(u.length>128)u=u.slice(0,128)+"...";return`The ${I.includes(".")?"property":"argument"} '${I}' ${g}. Received ${u}`},TypeError),V("ERR_INVALID_RETURN_VALUE",(I,D,g)=>{var u;let y=g!==null&&g!==void 0&&(u=g.constructor)!==null&&u!==void 0&&u.name?`instance of ${g.constructor.name}`:`type ${typeof g}`;return`Expected ${I} to be returned from the "${D}" function but got ${y}.`},TypeError),V("ERR_MISSING_ARGS",(...I)=>{k(I.length>0,"At least one arg needs to be specified");let D,g=I.length;switch(I=(Array.isArray(I)?I:[I]).map((u)=>`"${u}"`).join(" or "),g){case 1:D+=`The ${I[0]} argument`;break;case 2:D+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let u=I.pop();D+=`The ${I.join(", ")}, and ${u} arguments`}break}return`${D} must be specified`},TypeError),V("ERR_OUT_OF_RANGE",(I,D,g)=>{k(D,'Missing "range" argument');let u;if(Number.isInteger(g)&&Math.abs(g)>4294967296)u=X(String(g));else if(typeof g==="bigint"){u=String(g);let y=BigInt(2)**BigInt(32);if(g>y||g<-y)u=X(u);u+="n"}else u=P(g);return`The value of "${I}" is out of range. It must be ${D}. Received ${u}`},RangeError),V("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),V("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),V("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),V("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),V("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),V("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),V("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),V("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),V("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),V("ERR_STREAM_WRITE_AFTER_END","write after end",Error),V("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:h,aggregateTwoErrors:C(E),hideStackFrames:C,codes:w}}),Wl=A6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=new WeakMap,P=new WeakMap;function _(m){let o=K.get(m);return console.assert(o!=null,"'this' is expected an Event object, but got",m),o}function O(m){if(m.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",m.passiveListener);return}if(!m.event.cancelable)return;if(m.canceled=!0,typeof m.event.preventDefault==="function")m.event.preventDefault()}function j(m,o){K.set(this,{eventTarget:m,event:o,eventPhase:2,currentTarget:m,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:o.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let M=Object.keys(o);for(let Y=0;Y<M.length;++Y){let H=M[Y];if(!(H in this))Object.defineProperty(this,H,z(H))}}if(j.prototype={get type(){return _(this).event.type},get target(){return _(this).eventTarget},get currentTarget(){return _(this).currentTarget},composedPath(){let m=_(this).currentTarget;if(m==null)return[];return[m]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return _(this).eventPhase},stopPropagation(){let m=_(this);if(m.stopped=!0,typeof m.event.stopPropagation==="function")m.event.stopPropagation()},stopImmediatePropagation(){let m=_(this);if(m.stopped=!0,m.immediateStopped=!0,typeof m.event.stopImmediatePropagation==="function")m.event.stopImmediatePropagation()},get bubbles(){return Boolean(_(this).event.bubbles)},get cancelable(){return Boolean(_(this).event.cancelable)},preventDefault(){O(_(this))},get defaultPrevented(){return _(this).canceled},get composed(){return Boolean(_(this).event.composed)},get timeStamp(){return _(this).timeStamp},get srcElement(){return _(this).eventTarget},get cancelBubble(){return _(this).stopped},set cancelBubble(m){if(!m)return;let o=_(this);if(o.stopped=!0,typeof o.event.cancelBubble==="boolean")o.event.cancelBubble=!0},get returnValue(){return!_(this).canceled},set returnValue(m){if(!m)O(_(this))},initEvent(){}},Object.defineProperty(j.prototype,"constructor",{value:j,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(j.prototype,window.Event.prototype),P.set(window.Event.prototype,j);function z(m){return{get(){return _(this).event[m]},set(o){_(this).event[m]=o},configurable:!0,enumerable:!0}}function J(m){return{value(){let o=_(this).event;return o[m].apply(o,arguments)},configurable:!0,enumerable:!0}}function w(m,o){let M=Object.keys(o);if(M.length===0)return m;function Y(H,T){m.call(this,H,T)}Y.prototype=Object.create(m.prototype,{constructor:{value:Y,configurable:!0,writable:!0}});for(let H=0;H<M.length;++H){let T=M[H];if(!(T in m.prototype)){let W=typeof Object.getOwnPropertyDescriptor(o,T).value==="function";Object.defineProperty(Y.prototype,T,W?J(T):z(T))}}return Y}function k(m){if(m==null||m===Object.prototype)return j;let o=P.get(m);if(o==null)o=w(k(Object.getPrototypeOf(m)),m),P.set(m,o);return o}function X(m,o){return new(k(Object.getPrototypeOf(o)))(m,o)}function G(m){return _(m).immediateStopped}function V(m,o){_(m).eventPhase=o}function C(m,o){_(m).currentTarget=o}function E(m,o){_(m).passiveListener=o}var h=new WeakMap,I=1,D=2,g=3;function u(m){return m!==null&&typeof m==="object"}function y(m){let o=h.get(m);if(o==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return o}function p(m){return{get(){let o=y(this).get(m);while(o!=null){if(o.listenerType===g)return o.listener;o=o.next}return null},set(o){if(typeof o!=="function"&&!u(o))o=null;let M=y(this),Y=null,H=M.get(m);while(H!=null){if(H.listenerType===g)if(Y!==null)Y.next=H.next;else if(H.next!==null)M.set(m,H.next);else M.delete(m);else Y=H;H=H.next}if(o!==null){let T={listener:o,listenerType:g,passive:!1,once:!1,next:null};if(Y===null)M.set(m,T);else Y.next=T}},configurable:!0,enumerable:!0}}function l(m,o){Object.defineProperty(m,`on${o}`,p(o))}function Q(m){function o(){e.call(this)}o.prototype=Object.create(e.prototype,{constructor:{value:o,configurable:!0,writable:!0}});for(let M=0;M<m.length;++M)l(o.prototype,m[M]);return o}function e(){if(this instanceof e){h.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return Q(arguments[0]);if(arguments.length>0){let m=Array(arguments.length);for(let o=0;o<arguments.length;++o)m[o]=arguments[o];return Q(m)}throw TypeError("Cannot call a class as a function")}if(e.prototype={addEventListener(m,o,M){if(o==null)return;if(typeof o!=="function"&&!u(o))throw TypeError("'listener' should be a function or an object.");let Y=y(this),H=u(M),T=(H?Boolean(M.capture):Boolean(M))?I:D,W={listener:o,listenerType:T,passive:H&&Boolean(M.passive),once:H&&Boolean(M.once),next:null},Z=Y.get(m);if(Z===void 0){Y.set(m,W);return}let S=null;while(Z!=null){if(Z.listener===o&&Z.listenerType===T)return;S=Z,Z=Z.next}S.next=W},removeEventListener(m,o,M){if(o==null)return;let Y=y(this),H=(u(M)?Boolean(M.capture):Boolean(M))?I:D,T=null,W=Y.get(m);while(W!=null){if(W.listener===o&&W.listenerType===H){if(T!==null)T.next=W.next;else if(W.next!==null)Y.set(m,W.next);else Y.delete(m);return}T=W,W=W.next}},dispatchEvent(m){if(m==null||typeof m.type!=="string")throw TypeError('"event.type" should be a string.');let o=y(this),M=m.type,Y=o.get(M);if(Y==null)return!0;let H=X(this,m),T=null;while(Y!=null){if(Y.once)if(T!==null)T.next=Y.next;else if(Y.next!==null)o.set(M,Y.next);else o.delete(M);else T=Y;if(E(H,Y.passive?Y.listener:null),typeof Y.listener==="function")try{Y.listener.call(this,H)}catch(W){if(typeof console<"u"&&typeof console.error==="function")console.error(W)}else if(Y.listenerType!==g&&typeof Y.listener.handleEvent==="function")Y.listener.handleEvent(H);if(G(H))break;Y=Y.next}return E(H,null),V(H,0),C(H,null),!H.defaultPrevented}},Object.defineProperty(e.prototype,"constructor",{value:e,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(e.prototype,window.EventTarget.prototype);$.defineEventAttribute=l,$.EventTarget=e,$.default=e,q.exports=e,q.exports.EventTarget=q.exports.default=e,q.exports.defineEventAttribute=l}),u7=A6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var K=Wl();class P extends K.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let k=j.get(this);if(typeof k!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return k}}K.defineEventAttribute(P.prototype,"abort");function _(){let k=Object.create(P.prototype);return K.EventTarget.call(k),j.set(k,!1),k}function O(k){if(j.get(k)!==!1)return;j.set(k,!0),k.dispatchEvent({type:"abort"})}var j=new WeakMap;if(Object.defineProperties(P.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(P.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){J.set(this,_())}get signal(){return w(this)}abort(){O(w(this))}}var J=new WeakMap;function w(k){let X=J.get(k);if(X==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${k===null?"null":typeof k}`);return X}if(Object.defineProperties(z.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(z.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=z,$.AbortSignal=P,$.default=z,q.exports=z,q.exports.AbortController=q.exports.default=z,q.exports.AbortSignal=P}),Fq=A6(($,q)=>{var K=(vq(),W6(Yq)),{format:P,inspect:_}=NS(),{codes:{ERR_INVALID_ARG_TYPE:O}}=pq(),{kResistStopPropagation:j,AggregateError:z,SymbolDispose:J}=L6(),w=globalThis.AbortSignal||u7().AbortSignal,k=globalThis.AbortController||u7().AbortController,X=Object.getPrototypeOf(async function(){}).constructor,G=globalThis.Blob||K.Blob,V=typeof G<"u"?function(I){return I instanceof G}:function(I){return!1},C=(h,I)=>{if(h!==void 0&&(h===null||typeof h!=="object"||!("aborted"in h)))throw new O(I,"AbortSignal",h)},E=(h,I)=>{if(typeof h!=="function")throw new O(I,"Function",h)};q.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(h){let I=!1;return function(...D){if(I)return;I=!0,h.apply(this,D)}},createDeferredPromise:function(){let h,I;return{promise:new Promise((D,g)=>{h=D,I=g}),resolve:h,reject:I}},promisify(h){return new Promise((I,D)=>{h((g,...u)=>{if(g)return D(g);return I(...u)})})},debuglog(){return function(){}},format:P,inspect:_,types:{isAsyncFunction(h){return h instanceof X},isArrayBufferView(h){return ArrayBuffer.isView(h)}},isBlob:V,deprecate(h,I){return h},addAbortListener:(g7(),W6(b7)).addAbortListener||function(I,D){if(I===void 0)throw new O("signal","AbortSignal",I);C(I,"signal"),E(D,"listener");let g;if(I.aborted)queueMicrotask(()=>D());else I.addEventListener("abort",D,{__proto__:null,once:!0,[j]:!0}),g=()=>{I.removeEventListener("abort",D)};return{__proto__:null,[J](){var u;(u=g)===null||u===void 0||u()}}},AbortSignalAny:w.any||function(I){if(I.length===1)return I[0];let D=new k,g=()=>D.abort();return I.forEach((u)=>{C(u,"signals"),u.addEventListener("abort",g,{once:!0})}),D.signal.addEventListener("abort",()=>{I.forEach((u)=>u.removeEventListener("abort",g))},{once:!0}),D.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),y7=A6(($,q)=>{var{ArrayIsArray:K,ArrayPrototypeIncludes:P,ArrayPrototypeJoin:_,ArrayPrototypeMap:O,NumberIsInteger:j,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:J,NumberMIN_SAFE_INTEGER:w,NumberParseInt:k,ObjectPrototypeHasOwnProperty:X,RegExpPrototypeExec:G,String:V,StringPrototypeToUpperCase:C,StringPrototypeTrim:E}=L6(),{hideStackFrames:h,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:D,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:u,ERR_UNKNOWN_SIGNAL:y}}=pq(),{normalizeEncoding:p}=Fq(),{isAsyncFunction:l,isArrayBufferView:Q}=Fq().types,e={};function m(s){return s===(s|0)}function o(s){return s===s>>>0}var M=/^[0-7]+$/,Y="must be a 32-bit unsigned integer or an octal string";function H(s,U,_$){if(typeof s>"u")s=_$;if(typeof s==="string"){if(G(M,s)===null)throw new g(U,s,Y);s=k(s,8)}return Z(s,U),s}var T=h((s,U,_$=w,f$=J)=>{if(typeof s!=="number")throw new D(U,"number",s);if(!j(s))throw new u(U,"an integer",s);if(s<_$||s>f$)throw new u(U,`>= ${_$} && <= ${f$}`,s)}),W=h((s,U,_$=-2147483648,f$=2147483647)=>{if(typeof s!=="number")throw new D(U,"number",s);if(!j(s))throw new u(U,"an integer",s);if(s<_$||s>f$)throw new u(U,`>= ${_$} && <= ${f$}`,s)}),Z=h((s,U,_$=!1)=>{if(typeof s!=="number")throw new D(U,"number",s);if(!j(s))throw new u(U,"an integer",s);let f$=_$?1:0,O$=4294967295;if(s<f$||s>O$)throw new u(U,`>= ${f$} && <= ${O$}`,s)});function S(s,U){if(typeof s!=="string")throw new D(U,"string",s)}function N(s,U,_$=void 0,f$){if(typeof s!=="number")throw new D(U,"number",s);if(_$!=null&&s<_$||f$!=null&&s>f$||(_$!=null||f$!=null)&&z(s))throw new u(U,`${_$!=null?`>= ${_$}`:""}${_$!=null&&f$!=null?" && ":""}${f$!=null?`<= ${f$}`:""}`,s)}var f=h((s,U,_$)=>{if(!P(_$,s)){let f$="must be one of: "+_(O(_$,(O$)=>typeof O$==="string"?`'${O$}'`:V(O$)),", ");throw new g(U,s,f$)}});function v(s,U){if(typeof s!=="boolean")throw new D(U,"boolean",s)}function A(s,U,_$){return s==null||!X(s,U)?_$:s[U]}var L=h((s,U,_$=null)=>{let f$=A(_$,"allowArray",!1),O$=A(_$,"allowFunction",!1);if(!A(_$,"nullable",!1)&&s===null||!f$&&K(s)||typeof s!=="object"&&(!O$||typeof s!=="function"))throw new D(U,"Object",s)}),R=h((s,U)=>{if(s!=null&&typeof s!=="object"&&typeof s!=="function")throw new D(U,"a dictionary",s)}),b=h((s,U,_$=0)=>{if(!K(s))throw new D(U,"Array",s);if(s.length<_$){let f$=`must be longer than ${_$}`;throw new g(U,s,f$)}});function d(s,U){b(s,U);for(let _$=0;_$<s.length;_$++)S(s[_$],`${U}[${_$}]`)}function i(s,U){b(s,U);for(let _$=0;_$<s.length;_$++)v(s[_$],`${U}[${_$}]`)}function F(s,U){b(s,U);for(let _$=0;_$<s.length;_$++){let f$=s[_$],O$=`${U}[${_$}]`;if(f$==null)throw new D(O$,"AbortSignal",f$);Y$(f$,O$)}}function W$(s,U="signal"){if(S(s,U),e[s]===void 0){if(e[C(s)]!==void 0)throw new y(s+" (signals must use all capital letters)");throw new y(s)}}var n=h((s,U="buffer")=>{if(!Q(s))throw new D(U,["Buffer","TypedArray","DataView"],s)});function B(s,U){let _$=p(U),f$=s.length;if(_$==="hex"&&f$%2!==0)throw new g("encoding",U,`is invalid for data of length ${f$}`)}function y$(s,U="Port",_$=!0){if(typeof s!=="number"&&typeof s!=="string"||typeof s==="string"&&E(s).length===0||+s!==+s>>>0||s>65535||s===0&&!_$)throw new I(U,s,_$);return s|0}var Y$=h((s,U)=>{if(s!==void 0&&(s===null||typeof s!=="object"||!("aborted"in s)))throw new D(U,"AbortSignal",s)}),v$=h((s,U)=>{if(typeof s!=="function")throw new D(U,"Function",s)}),a=h((s,U)=>{if(typeof s!=="function"||l(s))throw new D(U,"Function",s)}),r=h((s,U)=>{if(s!==void 0)throw new D(U,"undefined",s)});function t(s,U,_$){if(!P(_$,s))throw new D(U,`('${_(_$,"|")}')`,s)}var x$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q$(s,U){if(typeof s>"u"||!G(x$,s))throw new g(U,s,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function $$(s){if(typeof s==="string")return q$(s,"hints"),s;else if(K(s)){let U=s.length,_$="";if(U===0)return _$;for(let f$=0;f$<U;f$++){let O$=s[f$];if(q$(O$,"hints"),_$+=O$,f$!==U-1)_$+=", "}return _$}throw new g("hints",s,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}q.exports={isInt32:m,isUint32:o,parseFileMode:H,validateArray:b,validateStringArray:d,validateBooleanArray:i,validateAbortSignalArray:F,validateBoolean:v,validateBuffer:n,validateDictionary:R,validateEncoding:B,validateFunction:v$,validateInt32:W,validateInteger:T,validateNumber:N,validateObject:L,validateOneOf:f,validatePlainFunction:a,validatePort:y$,validateSignalName:W$,validateString:S,validateUint32:Z,validateUndefined:r,validateUnion:t,validateAbortSignal:Y$,validateLinkHeaderValue:$$}}),D_=A6(($,q)=>{q.exports=globalThis.process}),kK=A6(($,q)=>{var{SymbolAsyncIterator:K,SymbolIterator:P,SymbolFor:_}=L6(),O=_("nodejs.stream.destroyed"),j=_("nodejs.stream.errored"),z=_("nodejs.stream.readable"),J=_("nodejs.stream.writable"),w=_("nodejs.stream.disturbed"),k=_("nodejs.webstream.isClosedPromise"),X=_("nodejs.webstream.controllerErrorFunction");function G(A,L=!1){var R;return!!(A&&typeof A.pipe==="function"&&typeof A.on==="function"&&(!L||typeof A.pause==="function"&&typeof A.resume==="function")&&(!A._writableState||((R=A._readableState)===null||R===void 0?void 0:R.readable)!==!1)&&(!A._writableState||A._readableState))}function V(A){var L;return!!(A&&typeof A.write==="function"&&typeof A.on==="function"&&(!A._readableState||((L=A._writableState)===null||L===void 0?void 0:L.writable)!==!1))}function C(A){return!!(A&&typeof A.pipe==="function"&&A._readableState&&typeof A.on==="function"&&typeof A.write==="function")}function E(A){return A&&(A._readableState||A._writableState||typeof A.write==="function"&&typeof A.on==="function"||typeof A.pipe==="function"&&typeof A.on==="function")}function h(A){return!!(A&&!E(A)&&typeof A.pipeThrough==="function"&&typeof A.getReader==="function"&&typeof A.cancel==="function")}function I(A){return!!(A&&!E(A)&&typeof A.getWriter==="function"&&typeof A.abort==="function")}function D(A){return!!(A&&!E(A)&&typeof A.readable==="object"&&typeof A.writable==="object")}function g(A){return h(A)||I(A)||D(A)}function u(A,L){if(A==null)return!1;if(L===!0)return typeof A[K]==="function";if(L===!1)return typeof A[P]==="function";return typeof A[K]==="function"||typeof A[P]==="function"}function y(A){if(!E(A))return null;let{_writableState:L,_readableState:R}=A,b=L||R;return!!(A.destroyed||A[O]||b!==null&&b!==void 0&&b.destroyed)}function p(A){if(!V(A))return null;if(A.writableEnded===!0)return!0;let L=A._writableState;if(L!==null&&L!==void 0&&L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function l(A,L){if(!V(A))return null;if(A.writableFinished===!0)return!0;let R=A._writableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.finished)!=="boolean")return null;return!!(R.finished||L===!1&&R.ended===!0&&R.length===0)}function Q(A){if(!G(A))return null;if(A.readableEnded===!0)return!0;let L=A._readableState;if(!L||L.errored)return!1;if(typeof(L===null||L===void 0?void 0:L.ended)!=="boolean")return null;return L.ended}function e(A,L){if(!G(A))return null;let R=A._readableState;if(R!==null&&R!==void 0&&R.errored)return!1;if(typeof(R===null||R===void 0?void 0:R.endEmitted)!=="boolean")return null;return!!(R.endEmitted||L===!1&&R.ended===!0&&R.length===0)}function m(A){if(A&&A[z]!=null)return A[z];if(typeof(A===null||A===void 0?void 0:A.readable)!=="boolean")return null;if(y(A))return!1;return G(A)&&A.readable&&!e(A)}function o(A){if(A&&A[J]!=null)return A[J];if(typeof(A===null||A===void 0?void 0:A.writable)!=="boolean")return null;if(y(A))return!1;return V(A)&&A.writable&&!p(A)}function M(A,L){if(!E(A))return null;if(y(A))return!0;if((L===null||L===void 0?void 0:L.readable)!==!1&&m(A))return!1;if((L===null||L===void 0?void 0:L.writable)!==!1&&o(A))return!1;return!0}function Y(A){var L,R;if(!E(A))return null;if(A.writableErrored)return A.writableErrored;return(L=(R=A._writableState)===null||R===void 0?void 0:R.errored)!==null&&L!==void 0?L:null}function H(A){var L,R;if(!E(A))return null;if(A.readableErrored)return A.readableErrored;return(L=(R=A._readableState)===null||R===void 0?void 0:R.errored)!==null&&L!==void 0?L:null}function T(A){if(!E(A))return null;if(typeof A.closed==="boolean")return A.closed;let{_writableState:L,_readableState:R}=A;if(typeof(L===null||L===void 0?void 0:L.closed)==="boolean"||typeof(R===null||R===void 0?void 0:R.closed)==="boolean")return(L===null||L===void 0?void 0:L.closed)||(R===null||R===void 0?void 0:R.closed);if(typeof A._closed==="boolean"&&W(A))return A._closed;return null}function W(A){return typeof A._closed==="boolean"&&typeof A._defaultKeepAlive==="boolean"&&typeof A._removedConnection==="boolean"&&typeof A._removedContLen==="boolean"}function Z(A){return typeof A._sent100==="boolean"&&W(A)}function S(A){var L;return typeof A._consuming==="boolean"&&typeof A._dumped==="boolean"&&((L=A.req)===null||L===void 0?void 0:L.upgradeOrConnect)===void 0}function N(A){if(!E(A))return null;let{_writableState:L,_readableState:R}=A,b=L||R;return!b&&Z(A)||!!(b&&b.autoDestroy&&b.emitClose&&b.closed===!1)}function f(A){var L;return!!(A&&((L=A[w])!==null&&L!==void 0?L:A.readableDidRead||A.readableAborted))}function v(A){var L,R,b,d,i,F,W$,n,B,y$;return!!(A&&((L=(R=(b=(d=(i=(F=A[j])!==null&&F!==void 0?F:A.readableErrored)!==null&&i!==void 0?i:A.writableErrored)!==null&&d!==void 0?d:(W$=A._readableState)===null||W$===void 0?void 0:W$.errorEmitted)!==null&&b!==void 0?b:(n=A._writableState)===null||n===void 0?void 0:n.errorEmitted)!==null&&R!==void 0?R:(B=A._readableState)===null||B===void 0?void 0:B.errored)!==null&&L!==void 0?L:(y$=A._writableState)===null||y$===void 0?void 0:y$.errored))}q.exports={isDestroyed:y,kIsDestroyed:O,isDisturbed:f,kIsDisturbed:w,isErrored:v,kIsErrored:j,isReadable:m,kIsReadable:z,kIsClosedPromise:k,kControllerErrorFunction:X,kIsWritable:J,isClosed:T,isDuplexNodeStream:C,isFinished:M,isIterable:u,isReadableNodeStream:G,isReadableStream:h,isReadableEnded:Q,isReadableFinished:e,isReadableErrored:H,isNodeStream:E,isWebStream:g,isWritable:o,isWritableNodeStream:V,isWritableStream:I,isWritableEnded:p,isWritableFinished:l,isWritableErrored:Y,isServerRequest:S,isServerResponse:Z,willEmitClose:N,isTransformStream:D}}),BK=A6(($,q)=>{var K=D_(),{AbortError:P,codes:_}=pq(),{ERR_INVALID_ARG_TYPE:O,ERR_STREAM_PREMATURE_CLOSE:j}=_,{kEmptyObject:z,once:J}=Fq(),{validateAbortSignal:w,validateFunction:k,validateObject:X,validateBoolean:G}=y7(),{Promise:V,PromisePrototypeThen:C,SymbolDispose:E}=L6(),{isClosed:h,isReadable:I,isReadableNodeStream:D,isReadableStream:g,isReadableFinished:u,isReadableErrored:y,isWritable:p,isWritableNodeStream:l,isWritableStream:Q,isWritableFinished:e,isWritableErrored:m,isNodeStream:o,willEmitClose:M,kIsClosedPromise:Y}=kK(),H;function T(f){return f.setHeader&&typeof f.abort==="function"}var W=()=>{};function Z(f,v,A){var L,R;if(arguments.length===2)A=v,v=z;else if(v==null)v=z;else X(v,"options");if(k(A,"callback"),w(v.signal,"options.signal"),A=J(A),g(f)||Q(f))return S(f,v,A);if(!o(f))throw new O("stream",["ReadableStream","WritableStream","Stream"],f);let b=(L=v.readable)!==null&&L!==void 0?L:D(f),d=(R=v.writable)!==null&&R!==void 0?R:l(f),i=f._writableState,F=f._readableState,W$=()=>{if(!f.writable)y$()},n=M(f)&&D(f)===b&&l(f)===d,B=e(f,!1),y$=()=>{if(B=!0,f.destroyed)n=!1;if(n&&(!f.readable||b))return;if(!b||Y$)A.call(f)},Y$=u(f,!1),v$=()=>{if(Y$=!0,f.destroyed)n=!1;if(n&&(!f.writable||d))return;if(!d||B)A.call(f)},a=(s)=>{A.call(f,s)},r=h(f),t=()=>{r=!0;let s=m(f)||y(f);if(s&&typeof s!=="boolean")return A.call(f,s);if(b&&!Y$&&D(f,!0)){if(!u(f,!1))return A.call(f,new j)}if(d&&!B){if(!e(f,!1))return A.call(f,new j)}A.call(f)},x$=()=>{r=!0;let s=m(f)||y(f);if(s&&typeof s!=="boolean")return A.call(f,s);A.call(f)},q$=()=>{f.req.on("finish",y$)};if(T(f)){if(f.on("complete",y$),!n)f.on("abort",t);if(f.req)q$();else f.on("request",q$)}else if(d&&!i)f.on("end",W$),f.on("close",W$);if(!n&&typeof f.aborted==="boolean")f.on("aborted",t);if(f.on("end",v$),f.on("finish",y$),v.error!==!1)f.on("error",a);if(f.on("close",t),r)K.nextTick(t);else if(i!==null&&i!==void 0&&i.errorEmitted||F!==null&&F!==void 0&&F.errorEmitted){if(!n)K.nextTick(x$)}else if(!b&&(!n||I(f))&&(B||p(f)===!1))K.nextTick(x$);else if(!d&&(!n||p(f))&&(Y$||I(f)===!1))K.nextTick(x$);else if(F&&f.req&&f.aborted)K.nextTick(x$);let $$=()=>{if(A=W,f.removeListener("aborted",t),f.removeListener("complete",y$),f.removeListener("abort",t),f.removeListener("request",q$),f.req)f.req.removeListener("finish",y$);f.removeListener("end",W$),f.removeListener("close",W$),f.removeListener("finish",y$),f.removeListener("end",v$),f.removeListener("error",a),f.removeListener("close",t)};if(v.signal&&!r){let s=()=>{let U=A;$$(),U.call(f,new P(void 0,{cause:v.signal.reason}))};if(v.signal.aborted)K.nextTick(s);else{H=H||Fq().addAbortListener;let U=H(v.signal,s),_$=A;A=J((...f$)=>{U[E](),_$.apply(f,f$)})}}return $$}function S(f,v,A){let L=!1,R=W;if(v.signal)if(R=()=>{L=!0,A.call(f,new P(void 0,{cause:v.signal.reason}))},v.signal.aborted)K.nextTick(R);else{H=H||Fq().addAbortListener;let d=H(v.signal,R),i=A;A=J((...F)=>{d[E](),i.apply(f,F)})}let b=(...d)=>{if(!L)K.nextTick(()=>A.apply(f,d))};return C(f[Y].promise,b,b),W}function N(f,v){var A;let L=!1;if(v===null)v=z;if((A=v)!==null&&A!==void 0&&A.cleanup)G(v.cleanup,"cleanup"),L=v.cleanup;return new V((R,b)=>{let d=Z(f,v,(i)=>{if(L)d();if(i)b(i);else R()})})}q.exports=Z,q.exports.finished=N}),y4=A6(($,q)=>{var K=D_(),{aggregateTwoErrors:P,codes:{ERR_MULTIPLE_CALLBACK:_},AbortError:O}=pq(),{Symbol:j}=L6(),{kIsDestroyed:z,isDestroyed:J,isFinished:w,isServerRequest:k}=kK(),X=j("kDestroy"),G=j("kConstruct");function V(M,Y,H){if(M){if(M.stack,Y&&!Y.errored)Y.errored=M;if(H&&!H.errored)H.errored=M}}function C(M,Y){let H=this._readableState,T=this._writableState,W=T||H;if(T!==null&&T!==void 0&&T.destroyed||H!==null&&H!==void 0&&H.destroyed){if(typeof Y==="function")Y();return this}if(V(M,T,H),T)T.destroyed=!0;if(H)H.destroyed=!0;if(!W.constructed)this.once(X,function(Z){E(this,P(Z,M),Y)});else E(this,M,Y);return this}function E(M,Y,H){let T=!1;function W(Z){if(T)return;T=!0;let{_readableState:S,_writableState:N}=M;if(V(Z,N,S),N)N.closed=!0;if(S)S.closed=!0;if(typeof H==="function")H(Z);if(Z)K.nextTick(h,M,Z);else K.nextTick(I,M)}try{M._destroy(Y||null,W)}catch(Z){W(Z)}}function h(M,Y){D(M,Y),I(M)}function I(M){let{_readableState:Y,_writableState:H}=M;if(H)H.closeEmitted=!0;if(Y)Y.closeEmitted=!0;if(H!==null&&H!==void 0&&H.emitClose||Y!==null&&Y!==void 0&&Y.emitClose)M.emit("close")}function D(M,Y){let{_readableState:H,_writableState:T}=M;if(T!==null&&T!==void 0&&T.errorEmitted||H!==null&&H!==void 0&&H.errorEmitted)return;if(T)T.errorEmitted=!0;if(H)H.errorEmitted=!0;M.emit("error",Y)}function g(){let M=this._readableState,Y=this._writableState;if(M)M.constructed=!0,M.closed=!1,M.closeEmitted=!1,M.destroyed=!1,M.errored=null,M.errorEmitted=!1,M.reading=!1,M.ended=M.readable===!1,M.endEmitted=M.readable===!1;if(Y)Y.constructed=!0,Y.destroyed=!1,Y.closed=!1,Y.closeEmitted=!1,Y.errored=null,Y.errorEmitted=!1,Y.finalCalled=!1,Y.prefinished=!1,Y.ended=Y.writable===!1,Y.ending=Y.writable===!1,Y.finished=Y.writable===!1}function u(M,Y,H){let{_readableState:T,_writableState:W}=M;if(W!==null&&W!==void 0&&W.destroyed||T!==null&&T!==void 0&&T.destroyed)return this;if(T!==null&&T!==void 0&&T.autoDestroy||W!==null&&W!==void 0&&W.autoDestroy)M.destroy(Y);else if(Y){if(Y.stack,W&&!W.errored)W.errored=Y;if(T&&!T.errored)T.errored=Y;if(H)K.nextTick(D,M,Y);else D(M,Y)}}function y(M,Y){if(typeof M._construct!=="function")return;let{_readableState:H,_writableState:T}=M;if(H)H.constructed=!1;if(T)T.constructed=!1;if(M.once(G,Y),M.listenerCount(G)>1)return;K.nextTick(p,M)}function p(M){let Y=!1;function H(T){if(Y){u(M,T!==null&&T!==void 0?T:new _);return}Y=!0;let{_readableState:W,_writableState:Z}=M,S=Z||W;if(W)W.constructed=!0;if(Z)Z.constructed=!0;if(S.destroyed)M.emit(X,T);else if(T)u(M,T,!0);else K.nextTick(l,M)}try{M._construct((T)=>{K.nextTick(H,T)})}catch(T){K.nextTick(H,T)}}function l(M){M.emit(G)}function Q(M){return(M===null||M===void 0?void 0:M.setHeader)&&typeof M.abort==="function"}function e(M){M.emit("close")}function m(M,Y){M.emit("error",Y),K.nextTick(e,M)}function o(M,Y){if(!M||J(M))return;if(!Y&&!w(M))Y=new O;if(k(M))M.socket=null,M.destroy(Y);else if(Q(M))M.abort();else if(Q(M.req))M.req.abort();else if(typeof M.destroy==="function")M.destroy(Y);else if(typeof M.close==="function")M.close();else if(Y)K.nextTick(m,M,Y);else K.nextTick(e,M);if(!M.destroyed)M[z]=!0}q.exports={construct:y,destroyer:o,destroy:C,undestroy:g,errorOrDestroy:u}}),qH=A6(($,q)=>{var{ArrayIsArray:K,ObjectSetPrototypeOf:P}=L6(),{EventEmitter:_}=(g7(),W6(b7));function O(z){_.call(this,z)}P(O.prototype,_.prototype),P(O,_),O.prototype.pipe=function(z,J){let w=this;function k(I){if(z.writable&&z.write(I)===!1&&w.pause)w.pause()}w.on("data",k);function X(){if(w.readable&&w.resume)w.resume()}if(z.on("drain",X),!z._isStdio&&(!J||J.end!==!1))w.on("end",V),w.on("close",C);let G=!1;function V(){if(G)return;G=!0,z.end()}function C(){if(G)return;if(G=!0,typeof z.destroy==="function")z.destroy()}function E(I){if(h(),_.listenerCount(this,"error")===0)this.emit("error",I)}j(w,"error",E),j(z,"error",E);function h(){w.removeListener("data",k),z.removeListener("drain",X),w.removeListener("end",V),w.removeListener("close",C),w.removeListener("error",E),z.removeListener("error",E),w.removeListener("end",h),w.removeListener("close",h),z.removeListener("close",h)}return w.on("end",h),w.on("close",h),z.on("close",h),z.emit("pipe",w),z};function j(z,J,w){if(typeof z.prependListener==="function")return z.prependListener(J,w);if(!z._events||!z._events[J])z.on(J,w);else if(K(z._events[J]))z._events[J].unshift(w);else z._events[J]=[w,z._events[J]]}q.exports={Stream:O,prependListener:j}}),rj=A6(($,q)=>{var{SymbolDispose:K}=L6(),{AbortError:P,codes:_}=pq(),{isNodeStream:O,isWebStream:j,kControllerErrorFunction:z}=kK(),J=BK(),{ERR_INVALID_ARG_TYPE:w}=_,k,X=(G,V)=>{if(typeof G!=="object"||!("aborted"in G))throw new w(V,"AbortSignal",G)};q.exports.addAbortSignal=function(V,C){if(X(V,"signal"),!O(C)&&!j(C))throw new w("stream",["ReadableStream","WritableStream","Stream"],C);return q.exports.addAbortSignalNoValidate(V,C)},q.exports.addAbortSignalNoValidate=function(G,V){if(typeof G!=="object"||!("aborted"in G))return V;let C=O(V)?()=>{V.destroy(new P(void 0,{cause:G.reason}))}:()=>{V[z](new P(void 0,{cause:G.reason}))};if(G.aborted)C();else{k=k||Fq().addAbortListener;let E=k(G,C);J(V,E[K])}return V}}),Hl=A6(($,q)=>{var{StringPrototypeSlice:K,SymbolIterator:P,TypedArrayPrototypeSet:_,Uint8Array:O}=L6(),{Buffer:j}=(vq(),W6(Yq)),{inspect:z}=Fq();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(w){let k={data:w,next:null};if(this.length>0)this.tail.next=k;else this.head=k;this.tail=k,++this.length}unshift(w){let k={data:w,next:this.head};if(this.length===0)this.tail=k;this.head=k,++this.length}shift(){if(this.length===0)return;let w=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,w}clear(){this.head=this.tail=null,this.length=0}join(w){if(this.length===0)return"";let k=this.head,X=""+k.data;while((k=k.next)!==null)X+=w+k.data;return X}concat(w){if(this.length===0)return j.alloc(0);let k=j.allocUnsafe(w>>>0),X=this.head,G=0;while(X)_(k,X.data,G),G+=X.data.length,X=X.next;return k}consume(w,k){let X=this.head.data;if(w<X.length){let G=X.slice(0,w);return this.head.data=X.slice(w),G}if(w===X.length)return this.shift();return k?this._getString(w):this._getBuffer(w)}first(){return this.head.data}*[P](){for(let w=this.head;w;w=w.next)yield w.data}_getString(w){let k="",X=this.head,G=0;do{let V=X.data;if(w>V.length)k+=V,w-=V.length;else{if(w===V.length)if(k+=V,++G,X.next)this.head=X.next;else this.head=this.tail=null;else k+=K(V,0,w),this.head=X,X.data=K(V,w);break}++G}while((X=X.next)!==null);return this.length-=G,k}_getBuffer(w){let k=j.allocUnsafe(w),X=w,G=this.head,V=0;do{let C=G.data;if(w>C.length)_(k,C,X-w),w-=C.length;else{if(w===C.length)if(_(k,C,X-w),++V,G.next)this.head=G.next;else this.head=this.tail=null;else _(k,new O(C.buffer,C.byteOffset,w),X-w),this.head=G,G.data=C.slice(w);break}++V}while((G=G.next)!==null);return this.length-=V,k}[Symbol.for("nodejs.util.inspect.custom")](w,k){return z(this,{...k,depth:0,customInspect:!1})}}}),oj=A6(($,q)=>{var{MathFloor:K,NumberIsInteger:P}=L6(),{validateInteger:_}=y7(),{ERR_INVALID_ARG_VALUE:O}=pq().codes,j=16384,z=16;function J(G,V,C){return G.highWaterMark!=null?G.highWaterMark:V?G[C]:null}function w(G){return G?z:j}function k(G,V){if(_(V,"value",0),G)z=V;else j=V}function X(G,V,C,E){let h=J(V,E,C);if(h!=null){if(!P(h)||h<0){let I=E?`options.${C}`:"options.highWaterMark";throw new O(I,h)}return K(h)}return w(G.objectMode)}q.exports={getHighWaterMark:X,getDefaultHighWaterMark:w,setDefaultHighWaterMark:k}}),Jl=A6(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(vq(),W6(Yq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),Tl=A6(($)=>{var q=Jl().Buffer,K=q.isEncoding||function(D){switch(D=""+D,D&&D.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function P(D){if(!D)return"utf8";var g;while(!0)switch(D){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 D;default:if(g)return;D=(""+D).toLowerCase(),g=!0}}function _(D){var g=P(D);if(typeof g!=="string"&&(q.isEncoding===K||!K(D)))throw Error("Unknown encoding: "+D);return g||D}$.StringDecoder=O;function O(D){this.encoding=_(D);var g;switch(this.encoding){case"utf16le":this.text=G,this.end=V,g=4;break;case"utf8":this.fillLast=w,g=4;break;case"base64":this.text=C,this.end=E,g=3;break;default:this.write=h,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(g)}O.prototype.write=function(D){if(D.length===0)return"";var g,u;if(this.lastNeed){if(g=this.fillLast(D),g===void 0)return"";u=this.lastNeed,this.lastNeed=0}else u=0;if(u<D.length)return g?g+this.text(D,u):this.text(D,u);return g||""},O.prototype.end=X,O.prototype.text=k,O.prototype.fillLast=function(D){if(this.lastNeed<=D.length)return D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,this.lastTotal-this.lastNeed,0,D.length),this.lastNeed-=D.length};function j(D){if(D<=127)return 0;else if(D>>5===6)return 2;else if(D>>4===14)return 3;else if(D>>3===30)return 4;return D>>6===2?-1:-2}function z(D,g,u){var y=g.length-1;if(y<u)return 0;var p=j(g[y]);if(p>=0){if(p>0)D.lastNeed=p-1;return p}if(--y<u||p===-2)return 0;if(p=j(g[y]),p>=0){if(p>0)D.lastNeed=p-2;return p}if(--y<u||p===-2)return 0;if(p=j(g[y]),p>=0){if(p>0)if(p===2)p=0;else D.lastNeed=p-3;return p}return 0}function J(D,g,u){if((g[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&g.length>2){if((g[2]&192)!==128)return D.lastNeed=2,"�"}}}function w(D){var g=this.lastTotal-this.lastNeed,u=J(this,D,g);if(u!==void 0)return u;if(this.lastNeed<=D.length)return D.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,g,0,D.length),this.lastNeed-=D.length}function k(D,g){var u=z(this,D,g);if(!this.lastNeed)return D.toString("utf8",g);this.lastTotal=u;var y=D.length-(u-this.lastNeed);return D.copy(this.lastChar,0,y),D.toString("utf8",g,y)}function X(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed)return g+"�";return g}function G(D,g){if((D.length-g)%2===0){var u=D.toString("utf16le",g);if(u){var y=u.charCodeAt(u.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1],u.slice(0,-1)}return u}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",g,D.length-1)}function V(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed){var u=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,u)}return g}function C(D,g){var u=(D.length-g)%3;if(u===0)return D.toString("base64",g);if(this.lastNeed=3-u,this.lastTotal=3,u===1)this.lastChar[0]=D[D.length-1];else this.lastChar[0]=D[D.length-2],this.lastChar[1]=D[D.length-1];return D.toString("base64",g,D.length-u)}function E(D){var g=D&&D.length?this.write(D):"";if(this.lastNeed)return g+this.lastChar.toString("base64",0,3-this.lastNeed);return g}function h(D){return D.toString(this.encoding)}function I(D){return D&&D.length?this.write(D):""}}),CS=A6(($,q)=>{var K=D_(),{PromisePrototypeThen:P,SymbolAsyncIterator:_,SymbolIterator:O}=L6(),{Buffer:j}=(vq(),W6(Yq)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:J}=pq().codes;function w(k,X,G){let V;if(typeof X==="string"||X instanceof j)return new k({objectMode:!0,...G,read(){this.push(X),this.push(null)}});let C;if(X&&X[_])C=!0,V=X[_]();else if(X&&X[O])C=!1,V=X[O]();else throw new z("iterable",["Iterable"],X);let E=new k({objectMode:!0,highWaterMark:1,...G}),h=!1;E._read=function(){if(!h)h=!0,D()},E._destroy=function(g,u){P(I(g),()=>K.nextTick(u,g),(y)=>K.nextTick(u,y||g))};async function I(g){let u=g!==void 0&&g!==null,y=typeof V.throw==="function";if(u&&y){let{value:p,done:l}=await V.throw(g);if(await p,l)return}if(typeof V.return==="function"){let{value:p}=await V.return();await p}}async function D(){for(;;){try{let{value:g,done:u}=C?await V.next():V.next();if(u)E.push(null);else{let y=g&&typeof g.then==="function"?await g:g;if(y===null)throw h=!1,new J;else if(E.push(y))continue;else h=!1}}catch(g){E.destroy(g)}break}}return E}q.exports=w}),nj=A6(($,q)=>{var K=D_(),{ArrayPrototypeIndexOf:P,NumberIsInteger:_,NumberIsNaN:O,NumberParseInt:j,ObjectDefineProperties:z,ObjectKeys:J,ObjectSetPrototypeOf:w,Promise:k,SafeSet:X,SymbolAsyncDispose:G,SymbolAsyncIterator:V,Symbol:C}=L6();q.exports=f$,f$.ReadableState=_$;var{EventEmitter:E}=(g7(),W6(b7)),{Stream:h,prependListener:I}=qH(),{Buffer:D}=(vq(),W6(Yq)),{addAbortSignal:g}=rj(),u=BK(),y=Fq().debuglog("stream",(x)=>{y=x}),p=Hl(),l=y4(),{getHighWaterMark:Q,getDefaultHighWaterMark:e}=oj(),{aggregateTwoErrors:m,codes:{ERR_INVALID_ARG_TYPE:o,ERR_METHOD_NOT_IMPLEMENTED:M,ERR_OUT_OF_RANGE:Y,ERR_STREAM_PUSH_AFTER_EOF:H,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:T},AbortError:W}=pq(),{validateObject:Z}=y7(),S=C("kPaused"),{StringDecoder:N}=Tl(),f=CS();w(f$.prototype,h.prototype),w(f$,h);var v=()=>{},{errorOrDestroy:A}=l,L=1,R=2,b=4,d=8,i=16,F=32,W$=64,n=128,B=256,y$=512,Y$=1024,v$=2048,a=4096,r=8192,t=16384,x$=32768,q$=65536,$$=131072,s=262144;function U(x){return{enumerable:!1,get(){return(this.state&x)!==0},set(c){if(c)this.state|=x;else this.state&=~x}}}z(_$.prototype,{objectMode:U(L),ended:U(R),endEmitted:U(b),reading:U(d),constructed:U(i),sync:U(F),needReadable:U(W$),emittedReadable:U(n),readableListening:U(B),resumeScheduled:U(y$),errorEmitted:U(Y$),emitClose:U(v$),autoDestroy:U(a),destroyed:U(r),closed:U(t),closeEmitted:U(x$),multiAwaitDrain:U(q$),readingMore:U($$),dataEmitted:U(s)});function _$(x,c,c$){if(typeof c$!=="boolean")c$=c instanceof XK();if(this.state=v$|a|i|F,x&&x.objectMode)this.state|=L;if(c$&&x&&x.readableObjectMode)this.state|=L;if(this.highWaterMark=x?Q(this,x,"readableHighWaterMark",c$):e(!1),this.buffer=new p,this.length=0,this.pipes=[],this.flowing=null,this[S]=null,x&&x.emitClose===!1)this.state&=~v$;if(x&&x.autoDestroy===!1)this.state&=~a;if(this.errored=null,this.defaultEncoding=x&&x.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,x&&x.encoding)this.decoder=new N(x.encoding),this.encoding=x.encoding}function f$(x){if(!(this instanceof f$))return new f$(x);let c=this instanceof XK();if(this._readableState=new _$(x,this,c),x){if(typeof x.read==="function")this._read=x.read;if(typeof x.destroy==="function")this._destroy=x.destroy;if(typeof x.construct==="function")this._construct=x.construct;if(x.signal&&!c)g(x.signal,this)}h.call(this,x),l.construct(this,()=>{if(this._readableState.needReadable)y6(this,this._readableState)})}f$.prototype.destroy=l.destroy,f$.prototype._undestroy=l.undestroy,f$.prototype._destroy=function(x,c){c(x)},f$.prototype[E.captureRejectionSymbol]=function(x){this.destroy(x)},f$.prototype[G]=function(){let x;if(!this.destroyed)x=this.readableEnded?null:new W,this.destroy(x);return new k((c,c$)=>u(this,(K$)=>K$&&K$!==x?c$(K$):c(null)))},f$.prototype.push=function(x,c){return O$(this,x,c,!1)},f$.prototype.unshift=function(x,c){return O$(this,x,c,!0)};function O$(x,c,c$,K$){y("readableAddChunk",c);let j$=x._readableState,k6;if((j$.state&L)===0){if(typeof c==="string"){if(c$=c$||j$.defaultEncoding,j$.encoding!==c$)if(K$&&j$.encoding)c=D.from(c,c$).toString(j$.encoding);else c=D.from(c,c$),c$=""}else if(c instanceof D)c$="";else if(h._isUint8Array(c))c=h._uint8ArrayToBuffer(c),c$="";else if(c!=null)k6=new o("chunk",["string","Buffer","Uint8Array"],c)}if(k6)A(x,k6);else if(c===null)j$.state&=~d,X6(x,j$);else if((j$.state&L)!==0||c&&c.length>0)if(K$)if((j$.state&b)!==0)A(x,new T);else if(j$.destroyed||j$.errored)return!1;else T$(x,j$,c,!0);else if(j$.ended)A(x,new H);else if(j$.destroyed||j$.errored)return!1;else if(j$.state&=~d,j$.decoder&&!c$)if(c=j$.decoder.write(c),j$.objectMode||c.length!==0)T$(x,j$,c,!1);else y6(x,j$);else T$(x,j$,c,!1);else if(!K$)j$.state&=~d,y6(x,j$);return!j$.ended&&(j$.length<j$.highWaterMark||j$.length===0)}function T$(x,c,c$,K$){if(c.flowing&&c.length===0&&!c.sync&&x.listenerCount("data")>0){if((c.state&q$)!==0)c.awaitDrainWriters.clear();else c.awaitDrainWriters=null;c.dataEmitted=!0,x.emit("data",c$)}else{if(c.length+=c.objectMode?1:c$.length,K$)c.buffer.unshift(c$);else c.buffer.push(c$);if((c.state&W$)!==0)w$(x)}y6(x,c)}f$.prototype.isPaused=function(){let x=this._readableState;return x[S]===!0||x.flowing===!1},f$.prototype.setEncoding=function(x){let c=new N(x);this._readableState.decoder=c,this._readableState.encoding=this._readableState.decoder.encoding;let c$=this._readableState.buffer,K$="";for(let j$ of c$)K$+=c.write(j$);if(c$.clear(),K$!=="")c$.push(K$);return this._readableState.length=K$.length,this};var O6=1073741824;function H$(x){if(x>O6)throw new Y("size","<= 1GiB",x);else x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++;return x}function X$(x,c){if(x<=0||c.length===0&&c.ended)return 0;if((c.state&L)!==0)return 1;if(O(x)){if(c.flowing&&c.length)return c.buffer.first().length;return c.length}if(x<=c.length)return x;return c.ended?c.length:0}f$.prototype.read=function(x){if(y("read",x),x===void 0)x=NaN;else if(!_(x))x=j(x,10);let c=this._readableState,c$=x;if(x>c.highWaterMark)c.highWaterMark=H$(x);if(x!==0)c.state&=~n;if(x===0&&c.needReadable&&((c.highWaterMark!==0?c.length>=c.highWaterMark:c.length>0)||c.ended)){if(y("read: emitReadable",c.length,c.ended),c.length===0&&c.ended)V$(this);else w$(this);return null}if(x=X$(x,c),x===0&&c.ended){if(c.length===0)V$(this);return null}let K$=(c.state&W$)!==0;if(y("need readable",K$),c.length===0||c.length-x<c.highWaterMark)K$=!0,y("length less than watermark",K$);if(c.ended||c.reading||c.destroyed||c.errored||!c.constructed)K$=!1,y("reading, ended or constructing",K$);else if(K$){if(y("do read"),c.state|=d|F,c.length===0)c.state|=W$;try{this._read(c.highWaterMark)}catch(k6){A(this,k6)}if(c.state&=~F,!c.reading)x=X$(c$,c)}let j$;if(x>0)j$=h$(x,c);else j$=null;if(j$===null)c.needReadable=c.length<=c.highWaterMark,x=0;else if(c.length-=x,c.multiAwaitDrain)c.awaitDrainWriters.clear();else c.awaitDrainWriters=null;if(c.length===0){if(!c.ended)c.needReadable=!0;if(c$!==x&&c.ended)V$(this)}if(j$!==null&&!c.errorEmitted&&!c.closeEmitted)c.dataEmitted=!0,this.emit("data",j$);return j$};function X6(x,c){if(y("onEofChunk"),c.ended)return;if(c.decoder){let c$=c.decoder.end();if(c$&&c$.length)c.buffer.push(c$),c.length+=c.objectMode?1:c$.length}if(c.ended=!0,c.sync)w$(x);else c.needReadable=!1,c.emittedReadable=!0,G$(x)}function w$(x){let c=x._readableState;if(y("emitReadable",c.needReadable,c.emittedReadable),c.needReadable=!1,!c.emittedReadable)y("emitReadable",c.flowing),c.emittedReadable=!0,K.nextTick(G$,x)}function G$(x){let c=x._readableState;if(y("emitReadable_",c.destroyed,c.length,c.ended),!c.destroyed&&!c.errored&&(c.length||c.ended))x.emit("readable"),c.emittedReadable=!1;c.needReadable=!c.flowing&&!c.ended&&c.length<=c.highWaterMark,C$(x)}function y6(x,c){if(!c.readingMore&&c.constructed)c.readingMore=!0,K.nextTick(k$,x,c)}function k$(x,c){while(!c.reading&&!c.ended&&(c.length<c.highWaterMark||c.flowing&&c.length===0)){let c$=c.length;if(y("maybeReadMore read 0"),x.read(0),c$===c.length)break}c.readingMore=!1}f$.prototype._read=function(x){throw new M("_read()")},f$.prototype.pipe=function(x,c){let c$=this,K$=this._readableState;if(K$.pipes.length===1){if(!K$.multiAwaitDrain)K$.multiAwaitDrain=!0,K$.awaitDrainWriters=new X(K$.awaitDrainWriters?[K$.awaitDrainWriters]:[])}K$.pipes.push(x),y("pipe count=%d opts=%j",K$.pipes.length,c);let j$=(!c||c.end!==!1)&&x!==K.stdout&&x!==K.stderr?Z$:Y6;if(K$.endEmitted)K.nextTick(j$);else c$.once("end",j$);x.on("unpipe",k6);function k6(K6,G6){if(y("onunpipe"),K6===c$){if(G6&&G6.hasUnpiped===!1)G6.hasUnpiped=!0,g$()}}function Z$(){y("onend"),x.end()}let A$,Hq=!1;function g$(){if(y("cleanup"),x.removeListener("close",N$),x.removeListener("finish",b6),A$)x.removeListener("drain",A$);if(x.removeListener("error",M$),x.removeListener("unpipe",k6),c$.removeListener("end",Z$),c$.removeListener("end",Y6),c$.removeListener("data",Jq),Hq=!0,A$&&K$.awaitDrainWriters&&(!x._writableState||x._writableState.needDrain))A$()}function R$(){if(!Hq){if(K$.pipes.length===1&&K$.pipes[0]===x)y("false write response, pause",0),K$.awaitDrainWriters=x,K$.multiAwaitDrain=!1;else if(K$.pipes.length>1&&K$.pipes.includes(x))y("false write response, pause",K$.awaitDrainWriters.size),K$.awaitDrainWriters.add(x);c$.pause()}if(!A$)A$=I$(c$,x),x.on("drain",A$)}c$.on("data",Jq);function Jq(K6){y("ondata");let G6=x.write(K6);if(y("dest.write",G6),G6===!1)R$()}function M$(K6){if(y("onerror",K6),Y6(),x.removeListener("error",M$),x.listenerCount("error")===0){let G6=x._writableState||x._readableState;if(G6&&!G6.errorEmitted)A(x,K6);else x.emit("error",K6)}}I(x,"error",M$);function N$(){x.removeListener("finish",b6),Y6()}x.once("close",N$);function b6(){y("onfinish"),x.removeListener("close",N$),Y6()}x.once("finish",b6);function Y6(){y("unpipe"),c$.unpipe(x)}if(x.emit("pipe",c$),x.writableNeedDrain===!0)R$();else if(!K$.flowing)y("pipe resume"),c$.resume();return x};function I$(x,c){return function(){let K$=x._readableState;if(K$.awaitDrainWriters===c)y("pipeOnDrain",1),K$.awaitDrainWriters=null;else if(K$.multiAwaitDrain)y("pipeOnDrain",K$.awaitDrainWriters.size),K$.awaitDrainWriters.delete(c);if((!K$.awaitDrainWriters||K$.awaitDrainWriters.size===0)&&x.listenerCount("data"))x.resume()}}f$.prototype.unpipe=function(x){let c=this._readableState,c$={hasUnpiped:!1};if(c.pipes.length===0)return this;if(!x){let j$=c.pipes;c.pipes=[],this.pause();for(let k6=0;k6<j$.length;k6++)j$[k6].emit("unpipe",this,{hasUnpiped:!1});return this}let K$=P(c.pipes,x);if(K$===-1)return this;if(c.pipes.splice(K$,1),c.pipes.length===0)this.pause();return x.emit("unpipe",this,c$),this},f$.prototype.on=function(x,c){let c$=h.prototype.on.call(this,x,c),K$=this._readableState;if(x==="data"){if(K$.readableListening=this.listenerCount("readable")>0,K$.flowing!==!1)this.resume()}else if(x==="readable"){if(!K$.endEmitted&&!K$.readableListening){if(K$.readableListening=K$.needReadable=!0,K$.flowing=!1,K$.emittedReadable=!1,y("on readable",K$.length,K$.reading),K$.length)w$(this);else if(!K$.reading)K.nextTick(D$,this)}}return c$},f$.prototype.addListener=f$.prototype.on,f$.prototype.removeListener=function(x,c){let c$=h.prototype.removeListener.call(this,x,c);if(x==="readable")K.nextTick(zq,this);return c$},f$.prototype.off=f$.prototype.removeListener,f$.prototype.removeAllListeners=function(x){let c=h.prototype.removeAllListeners.apply(this,arguments);if(x==="readable"||x===void 0)K.nextTick(zq,this);return c};function zq(x){let c=x._readableState;if(c.readableListening=x.listenerCount("readable")>0,c.resumeScheduled&&c[S]===!1)c.flowing=!0;else if(x.listenerCount("data")>0)x.resume();else if(!c.readableListening)c.flowing=null}function D$(x){y("readable nexttick read 0"),x.read(0)}f$.prototype.resume=function(){let x=this._readableState;if(!x.flowing)y("resume"),x.flowing=!x.readableListening,L$(this,x);return x[S]=!1,this};function L$(x,c){if(!c.resumeScheduled)c.resumeScheduled=!0,K.nextTick(Vq,x,c)}function Vq(x,c){if(y("resume",c.reading),!c.reading)x.read(0);if(c.resumeScheduled=!1,x.emit("resume"),C$(x),c.flowing&&!c.reading)x.read(0)}f$.prototype.pause=function(){if(y("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)y("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[S]=!0,this};function C$(x){let c=x._readableState;y("flow",c.flowing);while(c.flowing&&x.read()!==null);}f$.prototype.wrap=function(x){let c=!1;x.on("data",(K$)=>{if(!this.push(K$)&&x.pause)c=!0,x.pause()}),x.on("end",()=>{this.push(null)}),x.on("error",(K$)=>{A(this,K$)}),x.on("close",()=>{this.destroy()}),x.on("destroy",()=>{this.destroy()}),this._read=()=>{if(c&&x.resume)c=!1,x.resume()};let c$=J(x);for(let K$=1;K$<c$.length;K$++){let j$=c$[K$];if(this[j$]===void 0&&typeof x[j$]==="function")this[j$]=x[j$].bind(x)}return this},f$.prototype[V]=function(){return E$(this)},f$.prototype.iterator=function(x){if(x!==void 0)Z(x,"options");return E$(this,x)};function E$(x,c){if(typeof x.read!=="function")x=f$.wrap(x,{objectMode:!0});let c$=Sq(x,c);return c$.stream=x,c$}async function*Sq(x,c){let c$=v;function K$(Z$){if(this===x)c$(),c$=v;else c$=Z$}x.on("readable",K$);let j$,k6=u(x,{writable:!1},(Z$)=>{j$=Z$?m(j$,Z$):null,c$(),c$=v});try{while(!0){let Z$=x.destroyed?null:x.read();if(Z$!==null)yield Z$;else if(j$)throw j$;else if(j$===null)return;else await new k(K$)}}catch(Z$){throw j$=m(j$,Z$),j$}finally{if((j$||(c===null||c===void 0?void 0:c.destroyOnReturn)!==!1)&&(j$===void 0||x._readableState.autoDestroy))l.destroyer(x,null);else x.off("readable",K$),k6()}}z(f$.prototype,{readable:{__proto__:null,get(){let x=this._readableState;return!!x&&x.readable!==!1&&!x.destroyed&&!x.errorEmitted&&!x.endEmitted},set(x){if(this._readableState)this._readableState.readable=!!x}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){if(this._readableState)this._readableState.flowing=x}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(x){if(!this._readableState)return;this._readableState.destroyed=x}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(_$.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[S]!==!1},set(x){this[S]=!!x}}}),f$._fromList=h$;function h$(x,c){if(c.length===0)return null;let c$;if(c.objectMode)c$=c.buffer.shift();else if(!x||x>=c.length){if(c.decoder)c$=c.buffer.join("");else if(c.buffer.length===1)c$=c.buffer.first();else c$=c.buffer.concat(c.length);c.buffer.clear()}else c$=c.buffer.consume(x,c.decoder);return c$}function V$(x){let c=x._readableState;if(y("endReadable",c.endEmitted),!c.endEmitted)c.ended=!0,K.nextTick(Mq,c,x)}function Mq(x,c){if(y("endReadableNT",x.endEmitted,x.length),!x.errored&&!x.closeEmitted&&!x.endEmitted&&x.length===0){if(x.endEmitted=!0,c.emit("end"),c.writable&&c.allowHalfOpen===!1)K.nextTick(b$,c);else if(x.autoDestroy){let c$=c._writableState;if(!c$||c$.autoDestroy&&(c$.finished||c$.writable===!1))c.destroy()}}}function b$(x){if(x.writable&&!x.writableEnded&&!x.destroyed)x.end()}f$.from=function(x,c){return f(f$,x,c)};var S$;function Wq(){if(S$===void 0)S$={};return S$}f$.fromWeb=function(x,c){return Wq().newStreamReadableFromReadableStream(x,c)},f$.toWeb=function(x,c){return Wq().newReadableStreamFromStreamReadable(x,c)},f$.wrap=function(x,c){var c$,K$;return new f$({objectMode:(c$=(K$=x.readableObjectMode)!==null&&K$!==void 0?K$:x.objectMode)!==null&&c$!==void 0?c$:!0,...c,destroy(j$,k6){l.destroyer(x,j$),k6(j$)}}).wrap(x)}}),KH=A6(($,q)=>{var K=D_(),{ArrayPrototypeSlice:P,Error:_,FunctionPrototypeSymbolHasInstance:O,ObjectDefineProperty:j,ObjectDefineProperties:z,ObjectSetPrototypeOf:J,StringPrototypeToLowerCase:w,Symbol:k,SymbolHasInstance:X}=L6();q.exports=Z,Z.WritableState=T;var{EventEmitter:G}=(g7(),W6(b7)),V=qH().Stream,{Buffer:C}=(vq(),W6(Yq)),E=y4(),{addAbortSignal:h}=rj(),{getHighWaterMark:I,getDefaultHighWaterMark:D}=oj(),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:u,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:p,ERR_STREAM_DESTROYED:l,ERR_STREAM_ALREADY_FINISHED:Q,ERR_STREAM_NULL_VALUES:e,ERR_STREAM_WRITE_AFTER_END:m,ERR_UNKNOWN_ENCODING:o}=pq().codes,{errorOrDestroy:M}=E;J(Z.prototype,V.prototype),J(Z,V);function Y(){}var H=k("kOnFinished");function T(a,r,t){if(typeof t!=="boolean")t=r instanceof XK();if(this.objectMode=!!(a&&a.objectMode),t)this.objectMode=this.objectMode||!!(a&&a.writableObjectMode);this.highWaterMark=a?I(this,a,"writableHighWaterMark",t):D(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let x$=!!(a&&a.decodeStrings===!1);this.decodeStrings=!x$,this.defaultEncoding=a&&a.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=A.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,W(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!a||a.emitClose!==!1,this.autoDestroy=!a||a.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[H]=[]}function W(a){a.buffered=[],a.bufferedIndex=0,a.allBuffers=!0,a.allNoop=!0}T.prototype.getBuffer=function(){return P(this.buffered,this.bufferedIndex)},j(T.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Z(a){let r=this instanceof XK();if(!r&&!O(Z,this))return new Z(a);if(this._writableState=new T(a,this,r),a){if(typeof a.write==="function")this._write=a.write;if(typeof a.writev==="function")this._writev=a.writev;if(typeof a.destroy==="function")this._destroy=a.destroy;if(typeof a.final==="function")this._final=a.final;if(typeof a.construct==="function")this._construct=a.construct;if(a.signal)h(a.signal,this)}V.call(this,a),E.construct(this,()=>{let t=this._writableState;if(!t.writing)d(this,t);n(this,t)})}j(Z,X,{__proto__:null,value:function(a){if(O(this,a))return!0;if(this!==Z)return!1;return a&&a._writableState instanceof T}}),Z.prototype.pipe=function(){M(this,new p)};function S(a,r,t,x$){let q$=a._writableState;if(typeof t==="function")x$=t,t=q$.defaultEncoding;else{if(!t)t=q$.defaultEncoding;else if(t!=="buffer"&&!C.isEncoding(t))throw new o(t);if(typeof x$!=="function")x$=Y}if(r===null)throw new e;else if(!q$.objectMode)if(typeof r==="string"){if(q$.decodeStrings!==!1)r=C.from(r,t),t="buffer"}else if(r instanceof C)t="buffer";else if(V._isUint8Array(r))r=V._uint8ArrayToBuffer(r),t="buffer";else throw new g("chunk",["string","Buffer","Uint8Array"],r);let $$;if(q$.ending)$$=new m;else if(q$.destroyed)$$=new l("write");if($$)return K.nextTick(x$,$$),M(a,$$,!0),$$;return q$.pendingcb++,N(a,q$,r,t,x$)}Z.prototype.write=function(a,r,t){return S(this,a,r,t)===!0},Z.prototype.cork=function(){this._writableState.corked++},Z.prototype.uncork=function(){let a=this._writableState;if(a.corked){if(a.corked--,!a.writing)d(this,a)}},Z.prototype.setDefaultEncoding=function(r){if(typeof r==="string")r=w(r);if(!C.isEncoding(r))throw new o(r);return this._writableState.defaultEncoding=r,this};function N(a,r,t,x$,q$){let $$=r.objectMode?1:t.length;r.length+=$$;let s=r.length<r.highWaterMark;if(!s)r.needDrain=!0;if(r.writing||r.corked||r.errored||!r.constructed){if(r.buffered.push({chunk:t,encoding:x$,callback:q$}),r.allBuffers&&x$!=="buffer")r.allBuffers=!1;if(r.allNoop&&q$!==Y)r.allNoop=!1}else r.writelen=$$,r.writecb=q$,r.writing=!0,r.sync=!0,a._write(t,x$,r.onwrite),r.sync=!1;return s&&!r.errored&&!r.destroyed}function f(a,r,t,x$,q$,$$,s){if(r.writelen=x$,r.writecb=s,r.writing=!0,r.sync=!0,r.destroyed)r.onwrite(new l("write"));else if(t)a._writev(q$,r.onwrite);else a._write(q$,$$,r.onwrite);r.sync=!1}function v(a,r,t,x$){--r.pendingcb,x$(t),b(r),M(a,t)}function A(a,r){let t=a._writableState,x$=t.sync,q$=t.writecb;if(typeof q$!=="function"){M(a,new y);return}if(t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0,r){if(r.stack,!t.errored)t.errored=r;if(a._readableState&&!a._readableState.errored)a._readableState.errored=r;if(x$)K.nextTick(v,a,t,r,q$);else v(a,t,r,q$)}else{if(t.buffered.length>t.bufferedIndex)d(a,t);if(x$)if(t.afterWriteTickInfo!==null&&t.afterWriteTickInfo.cb===q$)t.afterWriteTickInfo.count++;else t.afterWriteTickInfo={count:1,cb:q$,stream:a,state:t},K.nextTick(L,t.afterWriteTickInfo);else R(a,t,1,q$)}}function L({stream:a,state:r,count:t,cb:x$}){return r.afterWriteTickInfo=null,R(a,r,t,x$)}function R(a,r,t,x$){if(!r.ending&&!a.destroyed&&r.length===0&&r.needDrain)r.needDrain=!1,a.emit("drain");while(t-- >0)r.pendingcb--,x$();if(r.destroyed)b(r);n(a,r)}function b(a){if(a.writing)return;for(let q$=a.bufferedIndex;q$<a.buffered.length;++q$){var r;let{chunk:$$,callback:s}=a.buffered[q$],U=a.objectMode?1:$$.length;a.length-=U,s((r=a.errored)!==null&&r!==void 0?r:new l("write"))}let t=a[H].splice(0);for(let q$=0;q$<t.length;q$++){var x$;t[q$]((x$=a.errored)!==null&&x$!==void 0?x$:new l("end"))}W(a)}function d(a,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:t,bufferedIndex:x$,objectMode:q$}=r,$$=t.length-x$;if(!$$)return;let s=x$;if(r.bufferProcessing=!0,$$>1&&a._writev){r.pendingcb-=$$-1;let U=r.allNoop?Y:(f$)=>{for(let O$=s;O$<t.length;++O$)t[O$].callback(f$)},_$=r.allNoop&&s===0?t:P(t,s);_$.allBuffers=r.allBuffers,f(a,r,!0,r.length,_$,"",U),W(r)}else{do{let{chunk:U,encoding:_$,callback:f$}=t[s];t[s++]=null;let O$=q$?1:U.length;f(a,r,!1,O$,U,_$,f$)}while(s<t.length&&!r.writing);if(s===t.length)W(r);else if(s>256)t.splice(0,s),r.bufferedIndex=0;else r.bufferedIndex=s}r.bufferProcessing=!1}Z.prototype._write=function(a,r,t){if(this._writev)this._writev([{chunk:a,encoding:r}],t);else throw new u("_write()")},Z.prototype._writev=null,Z.prototype.end=function(a,r,t){let x$=this._writableState;if(typeof a==="function")t=a,a=null,r=null;else if(typeof r==="function")t=r,r=null;let q$;if(a!==null&&a!==void 0){let $$=S(this,a,r);if($$ instanceof _)q$=$$}if(x$.corked)x$.corked=1,this.uncork();if(q$);else if(!x$.errored&&!x$.ending)x$.ending=!0,n(this,x$,!0),x$.ended=!0;else if(x$.finished)q$=new Q("end");else if(x$.destroyed)q$=new l("end");if(typeof t==="function")if(q$||x$.finished)K.nextTick(t,q$);else x$[H].push(t);return this};function i(a){return a.ending&&!a.destroyed&&a.constructed&&a.length===0&&!a.errored&&a.buffered.length===0&&!a.finished&&!a.writing&&!a.errorEmitted&&!a.closeEmitted}function F(a,r){let t=!1;function x$(q$){if(t){M(a,q$!==null&&q$!==void 0?q$:y());return}if(t=!0,r.pendingcb--,q$){let $$=r[H].splice(0);for(let s=0;s<$$.length;s++)$$[s](q$);M(a,q$,r.sync)}else if(i(r))r.prefinished=!0,a.emit("prefinish"),r.pendingcb++,K.nextTick(B,a,r)}r.sync=!0,r.pendingcb++;try{a._final(x$)}catch(q$){x$(q$)}r.sync=!1}function W$(a,r){if(!r.prefinished&&!r.finalCalled)if(typeof a._final==="function"&&!r.destroyed)r.finalCalled=!0,F(a,r);else r.prefinished=!0,a.emit("prefinish")}function n(a,r,t){if(i(r)){if(W$(a,r),r.pendingcb===0){if(t)r.pendingcb++,K.nextTick((x$,q$)=>{if(i(q$))B(x$,q$);else q$.pendingcb--},a,r);else if(i(r))r.pendingcb++,B(a,r)}}}function B(a,r){r.pendingcb--,r.finished=!0;let t=r[H].splice(0);for(let x$=0;x$<t.length;x$++)t[x$]();if(a.emit("finish"),r.autoDestroy){let x$=a._readableState;if(!x$||x$.autoDestroy&&(x$.endEmitted||x$.readable===!1))a.destroy()}}z(Z.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(a){if(this._writableState)this._writableState.destroyed=a}},writable:{__proto__:null,get(){let a=this._writableState;return!!a&&a.writable!==!1&&!a.destroyed&&!a.errored&&!a.ending&&!a.ended},set(a){if(this._writableState)this._writableState.writable=!!a}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let a=this._writableState;if(!a)return!1;return!a.destroyed&&!a.ending&&a.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var y$=E.destroy;Z.prototype.destroy=function(a,r){let t=this._writableState;if(!t.destroyed&&(t.bufferedIndex<t.buffered.length||t[H].length))K.nextTick(b,t);return y$.call(this,a,r),this},Z.prototype._undestroy=E.undestroy,Z.prototype._destroy=function(a,r){r(a)},Z.prototype[G.captureRejectionSymbol]=function(a){this.destroy(a)};var Y$;function v$(){if(Y$===void 0)Y$={};return Y$}Z.fromWeb=function(a,r){return v$().newStreamWritableFromWritableStream(a,r)},Z.toWeb=function(a){return v$().newWritableStreamFromStreamWritable(a)}}),wl=A6(($,q)=>{var K=D_(),P=(vq(),W6(Yq)),{isReadable:_,isWritable:O,isIterable:j,isNodeStream:z,isReadableNodeStream:J,isWritableNodeStream:w,isDuplexNodeStream:k,isReadableStream:X,isWritableStream:G}=kK(),V=BK(),{AbortError:C,codes:{ERR_INVALID_ARG_TYPE:E,ERR_INVALID_RETURN_VALUE:h}}=pq(),{destroyer:I}=y4(),D=XK(),g=nj(),u=KH(),{createDeferredPromise:y}=Fq(),p=CS(),l=globalThis.Blob||P.Blob,Q=typeof l<"u"?function(T){return T instanceof l}:function(T){return!1},e=globalThis.AbortController||u7().AbortController,{FunctionPrototypeCall:m}=L6();class o extends D{constructor(H){super(H);if((H===null||H===void 0?void 0:H.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((H===null||H===void 0?void 0:H.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function H(T,W){if(k(T))return T;if(J(T))return Y({readable:T});if(w(T))return Y({writable:T});if(z(T))return Y({writable:!1,readable:!1});if(X(T))return Y({readable:g.fromWeb(T)});if(G(T))return Y({writable:u.fromWeb(T)});if(typeof T==="function"){let{value:S,write:N,final:f,destroy:v}=M(T);if(j(S))return p(o,S,{objectMode:!0,write:N,final:f,destroy:v});let A=S===null||S===void 0?void 0:S.then;if(typeof A==="function"){let L,R=m(A,S,(b)=>{if(b!=null)throw new h("nully","body",b)},(b)=>{I(L,b)});return L=new o({objectMode:!0,readable:!1,write:N,final(b){f(async()=>{try{await R,K.nextTick(b,null)}catch(d){K.nextTick(b,d)}})},destroy:v})}throw new h("Iterable, AsyncIterable or AsyncFunction",W,S)}if(Q(T))return H(T.arrayBuffer());if(j(T))return p(o,T,{objectMode:!0,writable:!1});if(X(T===null||T===void 0?void 0:T.readable)&&G(T===null||T===void 0?void 0:T.writable))return o.fromWeb(T);if(typeof(T===null||T===void 0?void 0:T.writable)==="object"||typeof(T===null||T===void 0?void 0:T.readable)==="object"){let S=T!==null&&T!==void 0&&T.readable?J(T===null||T===void 0?void 0:T.readable)?T===null||T===void 0?void 0:T.readable:H(T.readable):void 0,N=T!==null&&T!==void 0&&T.writable?w(T===null||T===void 0?void 0:T.writable)?T===null||T===void 0?void 0:T.writable:H(T.writable):void 0;return Y({readable:S,writable:N})}let Z=T===null||T===void 0?void 0:T.then;if(typeof Z==="function"){let S;return m(Z,T,(N)=>{if(N!=null)S.push(N);S.push(null)},(N)=>{I(S,N)}),S=new o({objectMode:!0,writable:!1,read(){}})}throw new E(W,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],T)};function M(H){let{promise:T,resolve:W}=y(),Z=new e,S=Z.signal;return{value:H(async function*(){while(!0){let N=T;T=null;let{chunk:f,done:v,cb:A}=await N;if(K.nextTick(A),v)return;if(S.aborted)throw new C(void 0,{cause:S.reason});({promise:T,resolve:W}=y()),yield f}}(),{signal:S}),write(N,f,v){let A=W;W=null,A({chunk:N,done:!1,cb:v})},final(N){let f=W;W=null,f({done:!0,cb:N})},destroy(N,f){Z.abort(),f(N)}}}function Y(H){let T=H.readable&&typeof H.readable.read!=="function"?g.wrap(H.readable):H.readable,W=H.writable,Z=!!_(T),S=!!O(W),N,f,v,A,L;function R(b){let d=A;if(A=null,d)d(b);else if(b)L.destroy(b)}if(L=new o({readableObjectMode:!!(T!==null&&T!==void 0&&T.readableObjectMode),writableObjectMode:!!(W!==null&&W!==void 0&&W.writableObjectMode),readable:Z,writable:S}),S)V(W,(b)=>{if(S=!1,b)I(T,b);R(b)}),L._write=function(b,d,i){if(W.write(b,d))i();else N=i},L._final=function(b){W.end(),f=b},W.on("drain",function(){if(N){let b=N;N=null,b()}}),W.on("finish",function(){if(f){let b=f;f=null,b()}});if(Z)V(T,(b)=>{if(Z=!1,b)I(T,b);R(b)}),T.on("readable",function(){if(v){let b=v;v=null,b()}}),T.on("end",function(){L.push(null)}),L._read=function(){while(!0){let b=T.read();if(b===null){v=L._read;return}if(!L.push(b))return}};return L._destroy=function(b,d){if(!b&&A!==null)b=new C;if(v=null,N=null,f=null,A===null)d(b);else A=d,I(W,b),I(T,b)},L}}),XK=A6(($,q)=>{var{ObjectDefineProperties:K,ObjectGetOwnPropertyDescriptor:P,ObjectKeys:_,ObjectSetPrototypeOf:O}=L6();q.exports=J;var j=nj(),z=KH();O(J.prototype,j.prototype),O(J,j);{let G=_(z.prototype);for(let V=0;V<G.length;V++){let C=G[V];if(!J.prototype[C])J.prototype[C]=z.prototype[C]}}function J(G){if(!(this instanceof J))return new J(G);if(j.call(this,G),z.call(this,G),G){if(this.allowHalfOpen=G.allowHalfOpen!==!1,G.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(G.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}K(J.prototype,{writable:{__proto__:null,...P(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...P(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...P(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...P(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...P(z.prototype,"writableLength")},writableFinished:{__proto__:null,...P(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...P(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...P(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...P(z.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(G){if(this._readableState&&this._writableState)this._readableState.destroyed=G,this._writableState.destroyed=G}}});var w;function k(){if(w===void 0)w={};return w}J.fromWeb=function(G,V){return k().newStreamDuplexFromReadableWritablePair(G,V)},J.toWeb=function(G){return k().newReadableWritablePairFromDuplex(G)};var X;J.from=function(G){if(!X)X=wl();return X(G,"body")}}),ES=A6(($,q)=>{var{ObjectSetPrototypeOf:K,Symbol:P}=L6();q.exports=J;var{ERR_METHOD_NOT_IMPLEMENTED:_}=pq().codes,O=XK(),{getHighWaterMark:j}=oj();K(J.prototype,O.prototype),K(J,O);var z=P("kCallback");function J(X){if(!(this instanceof J))return new J(X);let G=X?j(this,X,"readableHighWaterMark",!0):null;if(G===0)X={...X,highWaterMark:null,readableHighWaterMark:G,writableHighWaterMark:X.writableHighWaterMark||0};if(O.call(this,X),this._readableState.sync=!1,this[z]=null,X){if(typeof X.transform==="function")this._transform=X.transform;if(typeof X.flush==="function")this._flush=X.flush}this.on("prefinish",k)}function w(X){if(typeof this._flush==="function"&&!this.destroyed)this._flush((G,V)=>{if(G){if(X)X(G);else this.destroy(G);return}if(V!=null)this.push(V);if(this.push(null),X)X()});else if(this.push(null),X)X()}function k(){if(this._final!==w)w.call(this)}J.prototype._final=w,J.prototype._transform=function(X,G,V){throw new _("_transform()")},J.prototype._write=function(X,G,V){let C=this._readableState,E=this._writableState,h=C.length;this._transform(X,G,(I,D)=>{if(I){V(I);return}if(D!=null)this.push(D);if(E.ended||h===C.length||C.length<C.highWaterMark)V();else this[z]=V})},J.prototype._read=function(){if(this[z]){let X=this[z];this[z]=null,X()}}}),hS=A6(($,q)=>{var{ObjectSetPrototypeOf:K}=L6();q.exports=_;var P=ES();K(_.prototype,P.prototype),K(_,P);function _(O){if(!(this instanceof _))return new _(O);P.call(this,O)}_.prototype._transform=function(O,j,z){z(null,O)}}),_H=A6(($,q)=>{var K=D_(),{ArrayIsArray:P,Promise:_,SymbolAsyncIterator:O,SymbolDispose:j}=L6(),z=BK(),{once:J}=Fq(),w=y4(),k=XK(),{aggregateTwoErrors:X,codes:{ERR_INVALID_ARG_TYPE:G,ERR_INVALID_RETURN_VALUE:V,ERR_MISSING_ARGS:C,ERR_STREAM_DESTROYED:E,ERR_STREAM_PREMATURE_CLOSE:h},AbortError:I}=pq(),{validateFunction:D,validateAbortSignal:g}=y7(),{isIterable:u,isReadable:y,isReadableNodeStream:p,isNodeStream:l,isTransformStream:Q,isWebStream:e,isReadableStream:m,isReadableFinished:o}=kK(),M=globalThis.AbortController||u7().AbortController,Y,H,T;function W(b,d,i){let F=!1;b.on("close",()=>{F=!0});let W$=z(b,{readable:d,writable:i},(n)=>{F=!n});return{destroy:(n)=>{if(F)return;F=!0,w.destroyer(b,n||new E("pipe"))},cleanup:W$}}function Z(b){return D(b[b.length-1],"streams[stream.length - 1]"),b.pop()}function S(b){if(u(b))return b;else if(p(b))return N(b);throw new G("val",["Readable","Iterable","AsyncIterable"],b)}async function*N(b){if(!H)H=nj();yield*H.prototype[O].call(b)}async function f(b,d,i,{end:F}){let W$,n=null,B=(v$)=>{if(v$)W$=v$;if(n){let a=n;n=null,a()}},y$=()=>new _((v$,a)=>{if(W$)a(W$);else n=()=>{if(W$)a(W$);else v$()}});d.on("drain",B);let Y$=z(d,{readable:!1},B);try{if(d.writableNeedDrain)await y$();for await(let v$ of b)if(!d.write(v$))await y$();if(F)d.end(),await y$();i()}catch(v$){i(W$!==v$?X(W$,v$):v$)}finally{Y$(),d.off("drain",B)}}async function v(b,d,i,{end:F}){if(Q(d))d=d.writable;let W$=d.getWriter();try{for await(let n of b)await W$.ready,W$.write(n).catch(()=>{});if(await W$.ready,F)await W$.close();i()}catch(n){try{await W$.abort(n),i(n)}catch(B){i(B)}}}function A(...b){return L(b,J(Z(b)))}function L(b,d,i){if(b.length===1&&P(b[0]))b=b[0];if(b.length<2)throw new C("streams");let F=new M,W$=F.signal,n=i===null||i===void 0?void 0:i.signal,B=[];g(n,"options.signal");function y$(){q$(new I)}T=T||Fq().addAbortListener;let Y$;if(n)Y$=T(n,y$);let v$,a,r=[],t=0;function x$(f$){q$(f$,--t===0)}function q$(f$,O$){var T$;if(f$&&(!v$||v$.code==="ERR_STREAM_PREMATURE_CLOSE"))v$=f$;if(!v$&&!O$)return;while(r.length)r.shift()(v$);if((T$=Y$)===null||T$===void 0||T$[j](),F.abort(),O$){if(!v$)B.forEach((O6)=>O6());K.nextTick(d,v$,a)}}let $$;for(let f$=0;f$<b.length;f$++){let O$=b[f$],T$=f$<b.length-1,O6=f$>0,H$=T$||(i===null||i===void 0?void 0:i.end)!==!1,X$=f$===b.length-1;if(l(O$)){let X6=function(w$){if(w$&&w$.name!=="AbortError"&&w$.code!=="ERR_STREAM_PREMATURE_CLOSE")x$(w$)};var s=X6;if(H$){let{destroy:w$,cleanup:G$}=W(O$,T$,O6);if(r.push(w$),y(O$)&&X$)B.push(G$)}if(O$.on("error",X6),y(O$)&&X$)B.push(()=>{O$.removeListener("error",X6)})}if(f$===0)if(typeof O$==="function"){if($$=O$({signal:W$}),!u($$))throw new V("Iterable, AsyncIterable or Stream","source",$$)}else if(u(O$)||p(O$)||Q(O$))$$=O$;else $$=k.from(O$);else if(typeof O$==="function"){if(Q($$)){var U;$$=S((U=$$)===null||U===void 0?void 0:U.readable)}else $$=S($$);if($$=O$($$,{signal:W$}),T$){if(!u($$,!0))throw new V("AsyncIterable",`transform[${f$-1}]`,$$)}else{var _$;if(!Y)Y=hS();let X6=new Y({objectMode:!0}),w$=(_$=$$)===null||_$===void 0?void 0:_$.then;if(typeof w$==="function")t++,w$.call($$,(k$)=>{if(a=k$,k$!=null)X6.write(k$);if(H$)X6.end();K.nextTick(x$)},(k$)=>{X6.destroy(k$),K.nextTick(x$,k$)});else if(u($$,!0))t++,f($$,X6,x$,{end:H$});else if(m($$)||Q($$)){let k$=$$.readable||$$;t++,f(k$,X6,x$,{end:H$})}else throw new V("AsyncIterable or Promise","destination",$$);$$=X6;let{destroy:G$,cleanup:y6}=W($$,!1,!0);if(r.push(G$),X$)B.push(y6)}}else if(l(O$)){if(p($$)){t+=2;let X6=R($$,O$,x$,{end:H$});if(y(O$)&&X$)B.push(X6)}else if(Q($$)||m($$)){let X6=$$.readable||$$;t++,f(X6,O$,x$,{end:H$})}else if(u($$))t++,f($$,O$,x$,{end:H$});else throw new G("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$$);$$=O$}else if(e(O$)){if(p($$))t++,v(S($$),O$,x$,{end:H$});else if(m($$)||u($$))t++,v($$,O$,x$,{end:H$});else if(Q($$))t++,v($$.readable,O$,x$,{end:H$});else throw new G("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],$$);$$=O$}else $$=k.from(O$)}if(W$!==null&&W$!==void 0&&W$.aborted||n!==null&&n!==void 0&&n.aborted)K.nextTick(y$);return $$}function R(b,d,i,{end:F}){let W$=!1;if(d.on("close",()=>{if(!W$)i(new h)}),b.pipe(d,{end:!1}),F){let B=function(){W$=!0,d.end()};var n=B;if(o(b))K.nextTick(B);else b.once("end",B)}else i();return z(b,{readable:!0,writable:!1},(B)=>{let y$=b._readableState;if(B&&B.code==="ERR_STREAM_PREMATURE_CLOSE"&&y$&&y$.ended&&!y$.errored&&!y$.errorEmitted)b.once("end",i).once("error",i);else i(B)}),z(d,{readable:!1,writable:!0},i)}q.exports={pipelineImpl:L,pipeline:A}}),RS=A6(($,q)=>{var{pipeline:K}=_H(),P=XK(),{destroyer:_}=y4(),{isNodeStream:O,isReadable:j,isWritable:z,isWebStream:J,isTransformStream:w,isWritableStream:k,isReadableStream:X}=kK(),{AbortError:G,codes:{ERR_INVALID_ARG_VALUE:V,ERR_MISSING_ARGS:C}}=pq(),E=BK();q.exports=function(...I){if(I.length===0)throw new C("streams");if(I.length===1)return P.from(I[0]);let D=[...I];if(typeof I[0]==="function")I[0]=P.from(I[0]);if(typeof I[I.length-1]==="function"){let Y=I.length-1;I[Y]=P.from(I[Y])}for(let Y=0;Y<I.length;++Y){if(!O(I[Y])&&!J(I[Y]))continue;if(Y<I.length-1&&!(j(I[Y])||X(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be readable");if(Y>0&&!(z(I[Y])||k(I[Y])||w(I[Y])))throw new V(`streams[${Y}]`,D[Y],"must be writable")}let g,u,y,p,l;function Q(Y){let H=p;if(p=null,H)H(Y);else if(Y)l.destroy(Y);else if(!M&&!o)l.destroy()}let e=I[0],m=K(I,Q),o=!!(z(e)||k(e)||w(e)),M=!!(j(m)||X(m)||w(m));if(l=new P({writableObjectMode:!!(e!==null&&e!==void 0&&e.writableObjectMode),readableObjectMode:!!(m!==null&&m!==void 0&&m.readableObjectMode),writable:o,readable:M}),o){if(O(e))l._write=function(H,T,W){if(e.write(H,T))W();else g=W},l._final=function(H){e.end(),u=H},e.on("drain",function(){if(g){let H=g;g=null,H()}});else if(J(e)){let H=(w(e)?e.writable:e).getWriter();l._write=async function(T,W,Z){try{await H.ready,H.write(T).catch(()=>{}),Z()}catch(S){Z(S)}},l._final=async function(T){try{await H.ready,H.close().catch(()=>{}),u=T}catch(W){T(W)}}}let Y=w(m)?m.readable:m;E(Y,()=>{if(u){let H=u;u=null,H()}})}if(M){if(O(m))m.on("readable",function(){if(y){let Y=y;y=null,Y()}}),m.on("end",function(){l.push(null)}),l._read=function(){while(!0){let Y=m.read();if(Y===null){y=l._read;return}if(!l.push(Y))return}};else if(J(m)){let Y=(w(m)?m.readable:m).getReader();l._read=async function(){while(!0)try{let{value:H,done:T}=await Y.read();if(!l.push(H))return;if(T){l.push(null);return}}catch{return}}}}return l._destroy=function(Y,H){if(!Y&&p!==null)Y=new G;if(y=null,g=null,u=null,p===null)H(Y);else if(p=H,O(m))_(m,Y)},l}}),Zl=A6(($,q)=>{var K=globalThis.AbortController||u7().AbortController,{codes:{ERR_INVALID_ARG_VALUE:P,ERR_INVALID_ARG_TYPE:_,ERR_MISSING_ARGS:O,ERR_OUT_OF_RANGE:j},AbortError:z}=pq(),{validateAbortSignal:J,validateInteger:w,validateObject:k}=y7(),X=L6().Symbol("kWeak"),G=L6().Symbol("kResistStopPropagation"),{finished:V}=BK(),C=RS(),{addAbortSignalNoValidate:E}=rj(),{isWritable:h,isNodeStream:I}=kK(),{deprecate:D}=Fq(),{ArrayPrototypePush:g,Boolean:u,MathFloor:y,Number:p,NumberIsNaN:l,Promise:Q,PromiseReject:e,PromiseResolve:m,PromisePrototypeThen:o,Symbol:M}=L6(),Y=M("kEmpty"),H=M("kEof");function T(n,B){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");if(I(n)&&!h(n))throw new P("stream",n,"must be writable");let y$=C(this,n);if(B!==null&&B!==void 0&&B.signal)E(B.signal,y$);return y$}function W(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");let y$=1;if((B===null||B===void 0?void 0:B.concurrency)!=null)y$=y(B.concurrency);let Y$=y$-1;if((B===null||B===void 0?void 0:B.highWaterMark)!=null)Y$=y(B.highWaterMark);return w(y$,"options.concurrency",1),w(Y$,"options.highWaterMark",0),Y$+=y$,async function*(){let a=Fq().AbortSignalAny([B===null||B===void 0?void 0:B.signal].filter(u)),r=this,t=[],x$={signal:a},q$,$$,s=!1,U=0;function _$(){s=!0,f$()}function f$(){U-=1,O$()}function O$(){if($$&&!s&&U<y$&&t.length<Y$)$$(),$$=null}async function T$(){try{for await(let O6 of r){if(s)return;if(a.aborted)throw new z;try{if(O6=n(O6,x$),O6===Y)continue;O6=m(O6)}catch(H$){O6=e(H$)}if(U+=1,o(O6,f$,_$),t.push(O6),q$)q$(),q$=null;if(!s&&(t.length>=Y$||U>=y$))await new Q((H$)=>{$$=H$})}t.push(H)}catch(O6){let H$=e(O6);o(H$,f$,_$),t.push(H$)}finally{if(s=!0,q$)q$(),q$=null}}T$();try{while(!0){while(t.length>0){let O6=await t[0];if(O6===H)return;if(a.aborted)throw new z;if(O6!==Y)yield O6;t.shift(),O$()}await new Q((O6)=>{q$=O6})}}finally{if(s=!0,$$)$$(),$$=null}}.call(this)}function Z(n=void 0){if(n!=null)k(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");return async function*(){let y$=0;for await(let v$ of this){var Y$;if(n!==null&&n!==void 0&&(Y$=n.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z({cause:n.signal.reason});yield[y$++,v$]}}.call(this)}async function S(n,B=void 0){for await(let y$ of A.call(this,n,B))return!0;return!1}async function N(n,B=void 0){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);return!await S.call(this,async(...y$)=>{return!await n(...y$)},B)}async function f(n,B){for await(let y$ of A.call(this,n,B))return y$;return}async function v(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){return await n(Y$,v$),Y}for await(let Y$ of W.call(this,y$,B));}function A(n,B){if(typeof n!=="function")throw new _("fn",["Function","AsyncFunction"],n);async function y$(Y$,v$){if(await n(Y$,v$))return Y$;return Y}return W.call(this,y$,B)}class L extends O{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function R(n,B,y$){var Y$;if(typeof n!=="function")throw new _("reducer",["Function","AsyncFunction"],n);if(y$!=null)k(y$,"options");if((y$===null||y$===void 0?void 0:y$.signal)!=null)J(y$.signal,"options.signal");let v$=arguments.length>1;if(y$!==null&&y$!==void 0&&(Y$=y$.signal)!==null&&Y$!==void 0&&Y$.aborted){let q$=new z(void 0,{cause:y$.signal.reason});throw this.once("error",()=>{}),await V(this.destroy(q$)),q$}let a=new K,r=a.signal;if(y$!==null&&y$!==void 0&&y$.signal){let q$={once:!0,[X]:this,[G]:!0};y$.signal.addEventListener("abort",()=>a.abort(),q$)}let t=!1;try{for await(let q$ of this){var x$;if(t=!0,y$!==null&&y$!==void 0&&(x$=y$.signal)!==null&&x$!==void 0&&x$.aborted)throw new z;if(!v$)B=q$,v$=!0;else B=await n(B,q$,{signal:r})}if(!t&&!v$)throw new L}finally{a.abort()}return B}async function b(n){if(n!=null)k(n,"options");if((n===null||n===void 0?void 0:n.signal)!=null)J(n.signal,"options.signal");let B=[];for await(let Y$ of this){var y$;if(n!==null&&n!==void 0&&(y$=n.signal)!==null&&y$!==void 0&&y$.aborted)throw new z(void 0,{cause:n.signal.reason});g(B,Y$)}return B}function d(n,B){let y$=W.call(this,n,B);return async function*(){for await(let v$ of y$)yield*v$}.call(this)}function i(n){if(n=p(n),l(n))return 0;if(n<0)throw new j("number",">= 0",n);return n}function F(n,B=void 0){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");return n=i(n),async function*(){var Y$;if(B!==null&&B!==void 0&&(Y$=B.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let a of this){var v$;if(B!==null&&B!==void 0&&(v$=B.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n--<=0)yield a}}.call(this)}function W$(n,B=void 0){if(B!=null)k(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)J(B.signal,"options.signal");return n=i(n),async function*(){var Y$;if(B!==null&&B!==void 0&&(Y$=B.signal)!==null&&Y$!==void 0&&Y$.aborted)throw new z;for await(let a of this){var v$;if(B!==null&&B!==void 0&&(v$=B.signal)!==null&&v$!==void 0&&v$.aborted)throw new z;if(n-- >0)yield a;if(n<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:D(Z,"readable.asIndexedPairs will be removed in a future version."),drop:F,filter:A,flatMap:d,map:W,take:W$,compose:T},q.exports.promiseReturningOperators={every:N,forEach:v,reduce:R,toArray:b,some:S,find:f}}),IS=A6(($,q)=>{var{ArrayPrototypePop:K,Promise:P}=L6(),{isIterable:_,isNodeStream:O,isWebStream:j}=kK(),{pipelineImpl:z}=_H(),{finished:J}=BK();DS();function w(...k){return new P((X,G)=>{let V,C,E=k[k.length-1];if(E&&typeof E==="object"&&!O(E)&&!_(E)&&!j(E)){let h=K(k);V=h.signal,C=h.end}z(k,(h,I)=>{if(h)G(h);else X(I)},{signal:V,end:C})})}q.exports={finished:J,pipeline:w}}),DS=A6(($,q)=>{var{Buffer:K}=(vq(),W6(Yq)),{ObjectDefineProperty:P,ObjectKeys:_,ReflectApply:O}=L6(),{promisify:{custom:j}}=Fq(),{streamReturningOperators:z,promiseReturningOperators:J}=Zl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:w}}=pq(),k=RS(),{setDefaultHighWaterMark:X,getDefaultHighWaterMark:G}=oj(),{pipeline:V}=_H(),{destroyer:C}=y4(),E=BK(),h=IS(),I=kK(),D=q.exports=qH().Stream;D.isDestroyed=I.isDestroyed,D.isDisturbed=I.isDisturbed,D.isErrored=I.isErrored,D.isReadable=I.isReadable,D.isWritable=I.isWritable,D.Readable=nj();for(let u of _(z)){let y=function(...l){if(new.target)throw w();return D.Readable.from(O(p,this,l))},p=z[u];P(y,"name",{__proto__:null,value:p.name}),P(y,"length",{__proto__:null,value:p.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(let u of _(J)){let y=function(...l){if(new.target)throw w();return O(p,this,l)},p=J[u];P(y,"name",{__proto__:null,value:p.name}),P(y,"length",{__proto__:null,value:p.length}),P(D.Readable.prototype,u,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}D.Writable=KH(),D.Duplex=XK(),D.Transform=ES(),D.PassThrough=hS(),D.pipeline=V;var{addAbortSignal:g}=rj();D.addAbortSignal=g,D.finished=E,D.destroy=C,D.compose=k,D.setDefaultHighWaterMark=X,D.getDefaultHighWaterMark=G,P(D,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return h}}),P(V,j,{__proto__:null,enumerable:!0,get(){return h.pipeline}}),P(E,j,{__proto__:null,enumerable:!0,get(){return h.finished}}),D.Stream=D,D._isUint8Array=function(y){return y instanceof Uint8Array},D._uint8ArrayToBuffer=function(y){return K.from(y.buffer,y.byteOffset,y.byteLength)}}),fl=A6(($,q)=>{var K=PH();{let P=DS(),_=IS(),O=P.Readable.destroy;q.exports=P.Readable,q.exports._uint8ArrayToBuffer=P._uint8ArrayToBuffer,q.exports._isUint8Array=P._isUint8Array,q.exports.isDisturbed=P.isDisturbed,q.exports.isErrored=P.isErrored,q.exports.isReadable=P.isReadable,q.exports.Readable=P.Readable,q.exports.Writable=P.Writable,q.exports.Duplex=P.Duplex,q.exports.Transform=P.Transform,q.exports.PassThrough=P.PassThrough,q.exports.addAbortSignal=P.addAbortSignal,q.exports.finished=P.finished,q.exports.destroy=P.destroy,q.exports.destroy=O,q.exports.pipeline=P.pipeline,q.exports.compose=P.compose,Object.defineProperty(P,"promises",{configurable:!0,enumerable:!0,get(){return _}}),q.exports.Stream=P.Stream}q.exports.default=q.exports});LS.exports=fl()});var mq={};Nq(mq,{webcrypto:()=>zo,rng:()=>Vr,randomUUID:()=>Oo,randomFillSync:()=>qo,randomFill:()=>$o,randomBytes:()=>Sr,publicEncrypt:()=>ar,publicDecrypt:()=>er,pseudoRandomBytes:()=>Gr,prng:()=>Ar,privateEncrypt:()=>Qr,privateDecrypt:()=>sr,pbkdf2Sync:()=>Ir,pbkdf2:()=>Rr,listCiphers:()=>mr,getRandomValues:()=>jo,getHashes:()=>hr,getDiffieHellman:()=>rr,getCurves:()=>vo,getCiphers:()=>pr,default:()=>Wo,createVerify:()=>tr,createSign:()=>ir,createHmac:()=>Er,createHash:()=>Nr,createECDH:()=>Fr,createDiffieHellmanGroup:()=>lr,createDiffieHellman:()=>or,createDecipheriv:()=>cr,createDecipher:()=>yr,createCredentials:()=>Ko,createCipheriv:()=>gr,createCipher:()=>Lr,constants:()=>_o,Verify:()=>Ur,Sign:()=>Br,Hmac:()=>Cr,Hash:()=>Mr,DiffieHellmanGroup:()=>dr,DiffieHellman:()=>nr,Decipheriv:()=>xr,Decipher:()=>ur,DEFAULT_ENCODING:()=>Po,Cipheriv:()=>br,Cipher:()=>Dr});function vo(){return Yo}var Xl,kl,bS,Al,Gl,Vl=($,q,K)=>{K=$!=null?Xl(kl($)):{};let P=q||!$||!$.__esModule?bS(K,"default",{value:$,enumerable:!0}):K;for(let _ of Al($))if(!Gl.call(P,_))bS(P,_,{get:()=>$[_],enumerable:!0});return P},l$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),ij,Bj,uS,Sl,OH,YH,aq,vH,yS,Ml,xS,Nl,Cl,El,hl,AK,tK,cS,X8,pS,tj,Rl,_8,Il,Dl,Ll,mS,F8,c7,dS,bl,lS,gl,rS,ul,yl,xl,cl,zH,pl,WH,ml,dl,ll,rl,ol,nl,il,Bl,tl,Ul,Fl,al,Ql,el,gS,sl,x7,$r,oS,nS,qr,Kr,iS,_r,Pr,p7,jr,Or,Yr,vr,zr,Wr,BS,Hr,tS,US,FS,HH,aS,Jr,QS,Tr,wr,jH,Zr,fr,Xr,kr,T6,Ar,Gr,Vr,Sr,Mr,Nr,Cr,Er,hr,Rr,Ir,Dr,Lr,br,gr,ur,yr,xr,cr,pr,mr,dr,lr,rr,or,nr,ir,Br,tr,Ur,Fr,ar,Qr,er,sr,$o,qo,Ko,_o,Po="buffer",jo=($)=>{return crypto.getRandomValues($)},Oo=()=>{return crypto.randomUUID()},Yo,zo,Wo;var dq=aK(()=>{Xl=Object.create,{getPrototypeOf:kl,defineProperty:bS,getOwnPropertyNames:Al}=Object,Gl=Object.prototype.hasOwnProperty,ij=l$(($,q)=>{q.exports=(dq(),W6(mq)).randomBytes}),Bj=l$(($,q)=>{q.exports=(dq(),W6(mq)).createHash}),uS=l$(($,q)=>{q.exports=(dq(),W6(mq)).createHmac}),Sl=l$(($,q)=>{q.exports={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"}}}),OH=l$(($,q)=>{var K=Math.pow(2,30)-1;q.exports=function(P,_){if(typeof P!=="number")throw TypeError("Iterations not a number");if(P<0)throw TypeError("Bad iterations");if(typeof _!=="number")throw TypeError("Key length not a number");if(_<0||_>K||_!==_)throw TypeError("Bad key length")}}),YH=l$(($,q)=>{var K;if(globalThis.process&&globalThis.process.browser)K="utf-8";else if(globalThis.process&&globalThis.process.version)P=parseInt(process.version.split(".")[0].slice(1),10),K=P>=6?"utf-8":"binary";else K="utf-8";var P;q.exports=K}),aq=l$(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var K=(vq(),W6(Yq)),P=K.Buffer;function _(j,z){for(var J in j)z[J]=j[J]}if(P.from&&P.alloc&&P.allocUnsafe&&P.allocUnsafeSlow)q.exports=K;else _(K,$),$.Buffer=O;function O(j,z,J){return P(j,z,J)}O.prototype=Object.create(P.prototype),_(P,O),O.from=function(j,z,J){if(typeof j==="number")throw TypeError("Argument must not be a number");return P(j,z,J)},O.alloc=function(j,z,J){if(typeof j!=="number")throw TypeError("Argument must be a number");var w=P(j);if(z!==void 0)if(typeof J==="string")w.fill(z,J);else w.fill(z);else w.fill(0);return w},O.allocUnsafe=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return P(j)},O.allocUnsafeSlow=function(j){if(typeof j!=="number")throw TypeError("Argument must be a number");return K.SlowBuffer(j)}}),vH=l$(($,q)=>{var K=aq().Buffer;q.exports=function(P,_,O){if(K.isBuffer(P))return P;else if(typeof P==="string")return K.from(P,_);else if(ArrayBuffer.isView(P))return K.from(P.buffer);else throw TypeError(O+" must be a string, a Buffer, a typed array or a DataView")}}),yS=l$(($,q)=>{var K={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},P=uS(),_=aq().Buffer,O=OH(),j=YH(),z=vH();function J(w,k,X,G,V){O(X,G),w=z(w,j,"Password"),k=z(k,j,"Salt"),V=V||"sha1";var C=_.allocUnsafe(G),E=_.allocUnsafe(k.length+4);k.copy(E,0,0,k.length);var h=0,I=K[V],D=Math.ceil(G/I);for(var g=1;g<=D;g++){E.writeUInt32BE(g,k.length);var u=P(V,w).update(E).digest(),y=u;for(var p=1;p<X;p++){y=P(V,w).update(y).digest();for(var l=0;l<I;l++)u[l]^=y[l]}u.copy(C,h),h+=I}return C}q.exports=J}),Ml=l$(($,q)=>{var K=aq().Buffer,P=OH(),_=YH(),O=yS(),j=vH(),z,J=globalThis.crypto&&globalThis.crypto.subtle,w={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},k=[];function X(h){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!J||!J.importKey||!J.deriveBits)return Promise.resolve(!1);if(k[h]!==void 0)return k[h];z=z||K.alloc(8);var I=C(z,z,10,128,h).then(function(){return!0}).catch(function(){return!1});return k[h]=I,I}var G;function V(){if(G)return G;if(globalThis.process&&globalThis.process.nextTick)G=globalThis.process.nextTick;else if(globalThis.queueMicrotask)G=globalThis.queueMicrotask;else if(globalThis.setImmediate)G=globalThis.setImmediate;else G=globalThis.setTimeout;return G}function C(h,I,D,g,u){return J.importKey("raw",h,{name:"PBKDF2"},!1,["deriveBits"]).then(function(y){return J.deriveBits({name:"PBKDF2",salt:I,iterations:D,hash:{name:u}},y,g<<3)}).then(function(y){return K.from(y)})}function E(h,I){h.then(function(D){V()(function(){I(null,D)})},function(D){V()(function(){I(D)})})}q.exports=function(h,I,D,g,u,y){if(typeof u==="function")y=u,u=void 0;u=u||"sha1";var p=w[u.toLowerCase()];if(!p||typeof globalThis.Promise!=="function"){V()(function(){var l;try{l=O(h,I,D,g,u)}catch(Q){return y(Q)}y(null,l)});return}if(P(D,g),h=j(h,_,"Password"),I=j(I,_,"Salt"),typeof y!=="function")throw Error("No callback provided to pbkdf2");E(X(p).then(function(l){if(l)return C(h,I,D,g,p);return O(h,I,D,g,u)}),y)}}),xS=l$(($)=>{var q=(dq(),W6(mq)),K=OH(),P=YH(),_=vH();function O(z,J,w,k,X,G){if(K(w,k),z=_(z,P,"Password"),J=_(J,P,"Salt"),typeof X==="function")G=X,X="sha1";if(typeof G!=="function")throw Error("No callback provided to pbkdf2");return q.pbkdf2(z,J,w,k,X,G)}function j(z,J,w,k,X){return K(w,k),z=_(z,P,"Password"),J=_(J,P,"Salt"),X=X||"sha1",q.pbkdf2Sync(z,J,w,k,X)}if(!q.pbkdf2Sync||q.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=yS(),$.pbkdf2=Ml();else $.pbkdf2Sync=j,$.pbkdf2=O}),Nl=l$(($)=>{var q=(dq(),W6(mq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Cl=l$(($)=>{var q=(dq(),W6(mq));$.DiffieHellmanGroup=q.DiffieHellmanGroup,$.createDiffieHellmanGroup=q.createDiffieHellmanGroup,$.getDiffieHellman=q.getDiffieHellman,$.createDiffieHellman=q.createDiffieHellman,$.DiffieHellman=q.DiffieHellman}),El=l$(($)=>{var q=(dq(),W6(mq));$.createSign=q.createSign,$.Sign=q.Sign,$.createVerify=q.createVerify,$.Verify=q.Verify}),hl=l$(($,q)=>{q.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),AK=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,r=a&8191,t=a>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,s=W[6]|0,U=s&8191,_$=s>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,A=Math.imul(F,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(F,D$)|0,A=A+Math.imul(F,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,A=A+Math.imul(F,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,A=A+Math.imul(F,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,b$)|0,A=A+Math.imul(F,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(F,x)|0,A=A+Math.imul(F,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(U,D$)|0,v=v+Math.imul(U,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,A=A+Math.imul(F,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,A=A+Math.imul(F,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,g$)|0,A=A+Math.imul(F,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(U,b$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,A=A+Math.imul(F,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(U,x)|0,v=v+Math.imul(U,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(U,g$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],F=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=F+n,T[L+d+N]=i-W$,W[L+d+N]=F-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new m(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function l(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,y);function Q(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(Q,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new l;else if(Y==="p192")H=new Q;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function m(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}m.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},m.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},m.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},m.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},m.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},m.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},m.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},m.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},m.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},m.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},m.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},m.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},m.prototype.sqr=function(Y){return this.mul(Y,Y)},m.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var F=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(F),A=F.redSqr(),R=R.redMul(A),b=i}return L},m.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},m.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},m.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},m.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(m.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,m),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),tK=l$(($,q)=>{q.exports=K;function K(P,_){if(!P)throw Error(_||"Assertion failed")}K.equal=function(_,O,j){if(_!=O)throw Error(j||"Assertion failed: "+_+" != "+O)}}),cS=l$(($)=>{var q=$;function K(O,j){if(Array.isArray(O))return O.slice();if(!O)return[];var z=[];if(typeof O!=="string"){for(var J=0;J<O.length;J++)z[J]=O[J]|0;return z}if(j==="hex"){if(O=O.replace(/[^a-z0-9]+/ig,""),O.length%2!==0)O="0"+O;for(var J=0;J<O.length;J+=2)z.push(parseInt(O[J]+O[J+1],16))}else for(var J=0;J<O.length;J++){var w=O.charCodeAt(J),k=w>>8,X=w&255;if(k)z.push(k,X);else z.push(X)}return z}q.toArray=K;function P(O){if(O.length===1)return"0"+O;else return O}q.zero2=P;function _(O){var j="";for(var z=0;z<O.length;z++)j+=P(O[z].toString(16));return j}q.toHex=_,q.encode=function(j,z){if(z==="hex")return _(j);else return j}}),X8=l$(($)=>{var q=$,K=AK(),P=tK(),_=cS();q.assert=P,q.toArray=_.toArray,q.zero2=_.zero2,q.toHex=_.toHex,q.encode=_.encode;function O(k,X,G){var V=Array(Math.max(k.bitLength(),G)+1),C;for(C=0;C<V.length;C+=1)V[C]=0;var E=1<<X+1,h=k.clone();for(C=0;C<V.length;C++){var I,D=h.andln(E-1);if(h.isOdd()){if(D>(E>>1)-1)I=(E>>1)-D;else I=D;h.isubn(I)}else I=0;V[C]=I,h.iushrn(1)}return V}q.getNAF=O;function j(k,X){var G=[[],[]];k=k.clone(),X=X.clone();var V=0,C=0,E;while(k.cmpn(-V)>0||X.cmpn(-C)>0){var h=k.andln(3)+V&3,I=X.andln(3)+C&3;if(h===3)h=-1;if(I===3)I=-1;var D;if((h&1)===0)D=0;else if(E=k.andln(7)+V&7,(E===3||E===5)&&I===2)D=-h;else D=h;G[0].push(D);var g;if((I&1)===0)g=0;else if(E=X.andln(7)+C&7,(E===3||E===5)&&h===2)g=-I;else g=I;if(G[1].push(g),2*V===D+1)V=1-V;if(2*C===g+1)C=1-C;k.iushrn(1),X.iushrn(1)}return G}q.getJSF=j;function z(k,X,G){var V="_"+X;k.prototype[X]=function(){return this[V]!==void 0?this[V]:this[V]=G.call(this)}}q.cachedProperty=z;function J(k){return typeof k==="string"?q.toArray(k,"hex"):k}q.parseBytes=J;function w(k){return new K(k,"hex","le")}q.intFromLE=w}),pS=l$(($,q)=>{var K;q.exports=function(j){if(!K)K=new P(null);return K.generate(j)};function P(O){this.rand=O}if(q.exports.Rand=P,P.prototype.generate=function(j){return this._rand(j)},P.prototype._rand=function(j){if(this.rand.getBytes)return this.rand.getBytes(j);var z=new Uint8Array(j);for(var J=0;J<z.length;J++)z[J]=this.rand.getByte();return z},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.crypto.getRandomValues(z),z};else if(self.msCrypto&&self.msCrypto.getRandomValues)P.prototype._rand=function(j){var z=new Uint8Array(j);return self.msCrypto.getRandomValues(z),z};else if(typeof window==="object")P.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(_=(dq(),W6(mq)),typeof _.randomBytes!=="function")throw Error("Not supported");P.prototype._rand=function(j){return _.randomBytes(j)}}catch(O){}var _}),tj=l$(($,q)=>{var K=AK(),P=X8(),_=P.getNAF,O=P.getJSF,j=P.assert;function z(w,k){this.type=w,this.p=new K(k.p,16),this.red=k.prime?K.red(k.prime):K.mont(this.p),this.zero=new K(0).toRed(this.red),this.one=new K(1).toRed(this.red),this.two=new K(2).toRed(this.red),this.n=k.n&&new K(k.n,16),this.g=k.g&&this.pointFromJSON(k.g,k.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var X=this.n&&this.p.div(this.n);if(!X||X.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}q.exports=z,z.prototype.point=function(){throw Error("Not implemented")},z.prototype.validate=function(){throw Error("Not implemented")},z.prototype._fixedNafMul=function(k,X){j(k.precomputed);var G=k._getDoubles(),V=_(X,1,this._bitLength),C=(1<<G.step+1)-(G.step%2===0?2:1);C/=3;var E=[],h,I;for(h=0;h<V.length;h+=G.step){I=0;for(var D=h+G.step-1;D>=h;D--)I=(I<<1)+V[D];E.push(I)}var g=this.jpoint(null,null,null),u=this.jpoint(null,null,null);for(var y=C;y>0;y--){for(h=0;h<E.length;h++)if(I=E[h],I===y)u=u.mixedAdd(G.points[h]);else if(I===-y)u=u.mixedAdd(G.points[h].neg());g=g.add(u)}return g.toP()},z.prototype._wnafMul=function(k,X){var G=4,V=k._getNAFPoints(G);G=V.wnd;var C=V.points,E=_(X,G,this._bitLength),h=this.jpoint(null,null,null);for(var I=E.length-1;I>=0;I--){for(var D=0;I>=0&&E[I]===0;I--)D++;if(I>=0)D++;if(h=h.dblp(D),I<0)break;var g=E[I];if(j(g!==0),k.type==="affine")if(g>0)h=h.mixedAdd(C[g-1>>1]);else h=h.mixedAdd(C[-g-1>>1].neg());else if(g>0)h=h.add(C[g-1>>1]);else h=h.add(C[-g-1>>1].neg())}return k.type==="affine"?h.toP():h},z.prototype._wnafMulAdd=function(k,X,G,V,C){var E=this._wnafT1,h=this._wnafT2,I=this._wnafT3,D=0,g,u,y;for(g=0;g<V;g++){y=X[g];var p=y._getNAFPoints(k);E[g]=p.wnd,h[g]=p.points}for(g=V-1;g>=1;g-=2){var l=g-1,Q=g;if(E[l]!==1||E[Q]!==1){I[l]=_(G[l],E[l],this._bitLength),I[Q]=_(G[Q],E[Q],this._bitLength),D=Math.max(I[l].length,D),D=Math.max(I[Q].length,D);continue}var e=[X[l],null,null,X[Q]];if(X[l].y.cmp(X[Q].y)===0)e[1]=X[l].add(X[Q]),e[2]=X[l].toJ().mixedAdd(X[Q].neg());else if(X[l].y.cmp(X[Q].y.redNeg())===0)e[1]=X[l].toJ().mixedAdd(X[Q]),e[2]=X[l].add(X[Q].neg());else e[1]=X[l].toJ().mixedAdd(X[Q]),e[2]=X[l].toJ().mixedAdd(X[Q].neg());var m=[-3,-1,-5,-7,0,7,5,1,3],o=O(G[l],G[Q]);D=Math.max(o[0].length,D),I[l]=Array(D),I[Q]=Array(D);for(u=0;u<D;u++){var M=o[0][u]|0,Y=o[1][u]|0;I[l][u]=m[(M+1)*3+(Y+1)],I[Q][u]=0,h[l]=e}}var H=this.jpoint(null,null,null),T=this._wnafT4;for(g=D;g>=0;g--){var W=0;while(g>=0){var Z=!0;for(u=0;u<V;u++)if(T[u]=I[u][g]|0,T[u]!==0)Z=!1;if(!Z)break;W++,g--}if(g>=0)W++;if(H=H.dblp(W),g<0)break;for(u=0;u<V;u++){var S=T[u];if(S===0)continue;else if(S>0)y=h[u][S-1>>1];else if(S<0)y=h[u][-S-1>>1].neg();if(y.type==="affine")H=H.mixedAdd(y);else H=H.add(y)}}for(g=0;g<V;g++)h[g]=null;if(C)return H;else return H.toP()};function J(w,k){this.curve=w,this.type=k,this.precomputed=null}z.BasePoint=J,J.prototype.eq=function(){throw Error("Not implemented")},J.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(k,X){k=P.toArray(k,X);var G=this.p.byteLength();if((k[0]===4||k[0]===6||k[0]===7)&&k.length-1===2*G){if(k[0]===6)j(k[k.length-1]%2===0);else if(k[0]===7)j(k[k.length-1]%2===1);var V=this.point(k.slice(1,1+G),k.slice(1+G,1+2*G));return V}else if((k[0]===2||k[0]===3)&&k.length-1===G)return this.pointFromX(k.slice(1,1+G),k[0]===3);throw Error("Unknown point format")},J.prototype.encodeCompressed=function(k){return this.encode(k,!0)},J.prototype._encode=function(k){var X=this.curve.p.byteLength(),G=this.getX().toArray("be",X);if(k)return[this.getY().isEven()?2:3].concat(G);return[4].concat(G,this.getY().toArray("be",X))},J.prototype.encode=function(k,X){return P.encode(this._encode(X),k)},J.prototype.precompute=function(k){if(this.precomputed)return this;var X={doubles:null,naf:null,beta:null};return X.naf=this._getNAFPoints(8),X.doubles=this._getDoubles(4,k),X.beta=this._getBeta(),this.precomputed=X,this},J.prototype._hasDoubles=function(k){if(!this.precomputed)return!1;var X=this.precomputed.doubles;if(!X)return!1;return X.points.length>=Math.ceil((k.bitLength()+1)/X.step)},J.prototype._getDoubles=function(k,X){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var G=[this],V=this;for(var C=0;C<X;C+=k){for(var E=0;E<k;E++)V=V.dbl();G.push(V)}return{step:k,points:G}},J.prototype._getNAFPoints=function(k){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var X=[this],G=(1<<k)-1,V=G===1?null:this.dbl();for(var C=1;C<G;C++)X[C]=X[C-1].add(V);return{wnd:k,points:X}},J.prototype._getBeta=function(){return null},J.prototype.dblp=function(k){var X=this;for(var G=0;G<k;G++)X=X.dbl();return X}}),Rl=l$(($,q)=>{if(typeof Object.create==="function")q.exports=function(P,_){if(_)P.super_=_,P.prototype=Object.create(_.prototype,{constructor:{value:P,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(P,_){if(_){P.super_=_;var O=function(){};O.prototype=_.prototype,P.prototype=new O,P.prototype.constructor=P}}}),_8=l$(($,q)=>{try{if(K=(vS(),W6(YS)),typeof K.inherits!=="function")throw"";q.exports=K.inherits}catch(P){q.exports=Rl()}var K}),Il=l$(($,q)=>{var K=X8(),P=AK(),_=_8(),O=tj(),j=K.assert;function z(k){O.call(this,"short",k),this.a=new P(k.a,16).toRed(this.red),this.b=new P(k.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(k),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}_(z,O),q.exports=z,z.prototype._getEndomorphism=function(X){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var G,V;if(X.beta)G=new P(X.beta,16).toRed(this.red);else{var C=this._getEndoRoots(this.p);G=C[0].cmp(C[1])<0?C[0]:C[1],G=G.toRed(this.red)}if(X.lambda)V=new P(X.lambda,16);else{var E=this._getEndoRoots(this.n);if(this.g.mul(E[0]).x.cmp(this.g.x.redMul(G))===0)V=E[0];else V=E[1],j(this.g.mul(V).x.cmp(this.g.x.redMul(G))===0)}var h;if(X.basis)h=X.basis.map(function(I){return{a:new P(I.a,16),b:new P(I.b,16)}});else h=this._getEndoBasis(V);return{beta:G,lambda:V,basis:h}},z.prototype._getEndoRoots=function(X){var G=X===this.p?this.red:P.mont(X),V=new P(2).toRed(G).redInvm(),C=V.redNeg(),E=new P(3).toRed(G).redNeg().redSqrt().redMul(V),h=C.redAdd(E).fromRed(),I=C.redSub(E).fromRed();return[h,I]},z.prototype._getEndoBasis=function(X){var G=this.n.ushrn(Math.floor(this.n.bitLength()/2)),V=X,C=this.n.clone(),E=new P(1),h=new P(0),I=new P(0),D=new P(1),g,u,y,p,l,Q,e,m=0,o,M;while(V.cmpn(0)!==0){var Y=C.div(V);o=C.sub(Y.mul(V)),M=I.sub(Y.mul(E));var H=D.sub(Y.mul(h));if(!y&&o.cmp(G)<0)g=e.neg(),u=E,y=o.neg(),p=M;else if(y&&++m===2)break;e=o,C=V,V=o,I=E,E=M,D=h,h=H}l=o.neg(),Q=M;var T=y.sqr().add(p.sqr()),W=l.sqr().add(Q.sqr());if(W.cmp(T)>=0)l=g,Q=u;if(y.negative)y=y.neg(),p=p.neg();if(l.negative)l=l.neg(),Q=Q.neg();return[{a:y,b:p},{a:l,b:Q}]},z.prototype._endoSplit=function(X){var G=this.endo.basis,V=G[0],C=G[1],E=C.b.mul(X).divRound(this.n),h=V.b.neg().mul(X).divRound(this.n),I=E.mul(V.a),D=h.mul(C.a),g=E.mul(V.b),u=h.mul(C.b),y=X.sub(I).sub(D),p=g.add(u).neg();return{k1:y,k2:p}},z.prototype.pointFromX=function(X,G){if(X=new P(X,16),!X.red)X=X.toRed(this.red);var V=X.redSqr().redMul(X).redIAdd(X.redMul(this.a)).redIAdd(this.b),C=V.redSqrt();if(C.redSqr().redSub(V).cmp(this.zero)!==0)throw Error("invalid point");var E=C.fromRed().isOdd();if(G&&!E||!G&&E)C=C.redNeg();return this.point(X,C)},z.prototype.validate=function(X){if(X.inf)return!0;var{x:G,y:V}=X,C=this.a.redMul(G),E=G.redSqr().redMul(G).redIAdd(C).redIAdd(this.b);return V.redSqr().redISub(E).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(X,G,V){var C=this._endoWnafT1,E=this._endoWnafT2;for(var h=0;h<X.length;h++){var I=this._endoSplit(G[h]),D=X[h],g=D._getBeta();if(I.k1.negative)I.k1.ineg(),D=D.neg(!0);if(I.k2.negative)I.k2.ineg(),g=g.neg(!0);C[h*2]=D,C[h*2+1]=g,E[h*2]=I.k1,E[h*2+1]=I.k2}var u=this._wnafMulAdd(1,C,E,h*2,V);for(var y=0;y<h*2;y++)C[y]=null,E[y]=null;return u};function J(k,X,G,V){if(O.BasePoint.call(this,k,"affine"),X===null&&G===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new P(X,16),this.y=new P(G,16),V)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}_(J,O.BasePoint),z.prototype.point=function(X,G,V){return new J(this,X,G,V)},z.prototype.pointFromJSON=function(X,G){return J.fromJSON(this,X,G)},J.prototype._getBeta=function(){if(!this.curve.endo)return;var X=this.precomputed;if(X&&X.beta)return X.beta;var G=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(X){var V=this.curve,C=function(E){return V.point(E.x.redMul(V.endo.beta),E.y)};X.beta=G,G.precomputed={beta:null,naf:X.naf&&{wnd:X.naf.wnd,points:X.naf.points.map(C)},doubles:X.doubles&&{step:X.doubles.step,points:X.doubles.points.map(C)}}}return G},J.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]},J.fromJSON=function(X,G,V){if(typeof G==="string")G=JSON.parse(G);var C=X.point(G[0],G[1],V);if(!G[2])return C;function E(I){return X.point(I[0],I[1],V)}var h=G[2];return C.precomputed={beta:null,doubles:h.doubles&&{step:h.doubles.step,points:[C].concat(h.doubles.points.map(E))},naf:h.naf&&{wnd:h.naf.wnd,points:[C].concat(h.naf.points.map(E))}},C},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.inf},J.prototype.add=function(X){if(this.inf)return X;if(X.inf)return this;if(this.eq(X))return this.dbl();if(this.neg().eq(X))return this.curve.point(null,null);if(this.x.cmp(X.x)===0)return this.curve.point(null,null);var G=this.y.redSub(X.y);if(G.cmpn(0)!==0)G=G.redMul(this.x.redSub(X.x).redInvm());var V=G.redSqr().redISub(this.x).redISub(X.x),C=G.redMul(this.x.redSub(V)).redISub(this.y);return this.curve.point(V,C)},J.prototype.dbl=function(){if(this.inf)return this;var X=this.y.redAdd(this.y);if(X.cmpn(0)===0)return this.curve.point(null,null);var G=this.curve.a,V=this.x.redSqr(),C=X.redInvm(),E=V.redAdd(V).redIAdd(V).redIAdd(G).redMul(C),h=E.redSqr().redISub(this.x.redAdd(this.x)),I=E.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,I)},J.prototype.getX=function(){return this.x.fromRed()},J.prototype.getY=function(){return this.y.fromRed()},J.prototype.mul=function(X){if(X=new P(X,16),this.isInfinity())return this;else if(this._hasDoubles(X))return this.curve._fixedNafMul(this,X);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[X]);else return this.curve._wnafMul(this,X)},J.prototype.mulAdd=function(X,G,V){var C=[this,G],E=[X,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E);else return this.curve._wnafMulAdd(1,C,E,2)},J.prototype.jmulAdd=function(X,G,V){var C=[this,G],E=[X,V];if(this.curve.endo)return this.curve._endoWnafMulAdd(C,E,!0);else return this.curve._wnafMulAdd(1,C,E,2,!0)},J.prototype.eq=function(X){return this===X||this.inf===X.inf&&(this.inf||this.x.cmp(X.x)===0&&this.y.cmp(X.y)===0)},J.prototype.neg=function(X){if(this.inf)return this;var G=this.curve.point(this.x,this.y.redNeg());if(X&&this.precomputed){var V=this.precomputed,C=function(E){return E.neg()};G.precomputed={naf:V.naf&&{wnd:V.naf.wnd,points:V.naf.points.map(C)},doubles:V.doubles&&{step:V.doubles.step,points:V.doubles.points.map(C)}}}return G},J.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var X=this.curve.jpoint(this.x,this.y,this.curve.one);return X};function w(k,X,G,V){if(O.BasePoint.call(this,k,"jacobian"),X===null&&G===null&&V===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new P(0);else this.x=new P(X,16),this.y=new P(G,16),this.z=new P(V,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}_(w,O.BasePoint),z.prototype.jpoint=function(X,G,V){return new w(this,X,G,V)},w.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var X=this.z.redInvm(),G=X.redSqr(),V=this.x.redMul(G),C=this.y.redMul(G).redMul(X);return this.curve.point(V,C)},w.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},w.prototype.add=function(X){if(this.isInfinity())return X;if(X.isInfinity())return this;var G=X.z.redSqr(),V=this.z.redSqr(),C=this.x.redMul(G),E=X.x.redMul(V),h=this.y.redMul(G.redMul(X.z)),I=X.y.redMul(V.redMul(this.z)),D=C.redSub(E),g=h.redSub(I);if(D.cmpn(0)===0)if(g.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var u=D.redSqr(),y=u.redMul(D),p=C.redMul(u),l=g.redSqr().redIAdd(y).redISub(p).redISub(p),Q=g.redMul(p.redISub(l)).redISub(h.redMul(y)),e=this.z.redMul(X.z).redMul(D);return this.curve.jpoint(l,Q,e)},w.prototype.mixedAdd=function(X){if(this.isInfinity())return X.toJ();if(X.isInfinity())return this;var G=this.z.redSqr(),V=this.x,C=X.x.redMul(G),E=this.y,h=X.y.redMul(G).redMul(this.z),I=V.redSub(C),D=E.redSub(h);if(I.cmpn(0)===0)if(D.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var g=I.redSqr(),u=g.redMul(I),y=V.redMul(g),p=D.redSqr().redIAdd(u).redISub(y).redISub(y),l=D.redMul(y.redISub(p)).redISub(E.redMul(u)),Q=this.z.redMul(I);return this.curve.jpoint(p,l,Q)},w.prototype.dblp=function(X){if(X===0)return this;if(this.isInfinity())return this;if(!X)return this.dbl();var G;if(this.curve.zeroA||this.curve.threeA){var V=this;for(G=0;G<X;G++)V=V.dbl();return V}var C=this.curve.a,E=this.curve.tinv,h=this.x,I=this.y,D=this.z,g=D.redSqr().redSqr(),u=I.redAdd(I);for(G=0;G<X;G++){var y=h.redSqr(),p=u.redSqr(),l=p.redSqr(),Q=y.redAdd(y).redIAdd(y).redIAdd(C.redMul(g)),e=h.redMul(p),m=Q.redSqr().redISub(e.redAdd(e)),o=e.redISub(m),M=Q.redMul(o);M=M.redIAdd(M).redISub(l);var Y=u.redMul(D);if(G+1<X)g=g.redMul(l);h=m,D=Y,u=M}return this.curve.jpoint(h,u.redMul(E),D)},w.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},w.prototype._zeroDbl=function(){var X,G,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),h=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(h);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C),g=D.redSqr().redISub(I).redISub(I),u=h.redIAdd(h);u=u.redIAdd(u),u=u.redIAdd(u),X=g,G=D.redMul(I.redISub(g)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.x.redSqr(),p=this.y.redSqr(),l=p.redSqr(),Q=this.x.redAdd(p).redSqr().redISub(y).redISub(l);Q=Q.redIAdd(Q);var e=y.redAdd(y).redIAdd(y),m=e.redSqr(),o=l.redIAdd(l);o=o.redIAdd(o),o=o.redIAdd(o),X=m.redISub(Q).redISub(Q),G=e.redMul(Q.redISub(X)).redISub(o),V=this.y.redMul(this.z),V=V.redIAdd(V)}return this.curve.jpoint(X,G,V)},w.prototype._threeDbl=function(){var X,G,V;if(this.zOne){var C=this.x.redSqr(),E=this.y.redSqr(),h=E.redSqr(),I=this.x.redAdd(E).redSqr().redISub(C).redISub(h);I=I.redIAdd(I);var D=C.redAdd(C).redIAdd(C).redIAdd(this.curve.a),g=D.redSqr().redISub(I).redISub(I);X=g;var u=h.redIAdd(h);u=u.redIAdd(u),u=u.redIAdd(u),G=D.redMul(I.redISub(g)).redISub(u),V=this.y.redAdd(this.y)}else{var y=this.z.redSqr(),p=this.y.redSqr(),l=this.x.redMul(p),Q=this.x.redSub(y).redMul(this.x.redAdd(y));Q=Q.redAdd(Q).redIAdd(Q);var e=l.redIAdd(l);e=e.redIAdd(e);var m=e.redAdd(e);X=Q.redSqr().redISub(m),V=this.y.redAdd(this.z).redSqr().redISub(p).redISub(y);var o=p.redSqr();o=o.redIAdd(o),o=o.redIAdd(o),o=o.redIAdd(o),G=Q.redMul(e.redISub(X)).redISub(o)}return this.curve.jpoint(X,G,V)},w.prototype._dbl=function(){var X=this.curve.a,G=this.x,V=this.y,C=this.z,E=C.redSqr().redSqr(),h=G.redSqr(),I=V.redSqr(),D=h.redAdd(h).redIAdd(h).redIAdd(X.redMul(E)),g=G.redAdd(G);g=g.redIAdd(g);var u=g.redMul(I),y=D.redSqr().redISub(u.redAdd(u)),p=u.redISub(y),l=I.redSqr();l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var Q=D.redMul(p).redISub(l),e=V.redAdd(V).redMul(C);return this.curve.jpoint(y,Q,e)},w.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var X=this.x.redSqr(),G=this.y.redSqr(),V=this.z.redSqr(),C=G.redSqr(),E=X.redAdd(X).redIAdd(X),h=E.redSqr(),I=this.x.redAdd(G).redSqr().redISub(X).redISub(C);I=I.redIAdd(I),I=I.redAdd(I).redIAdd(I),I=I.redISub(h);var D=I.redSqr(),g=C.redIAdd(C);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var u=E.redIAdd(I).redSqr().redISub(h).redISub(D).redISub(g),y=G.redMul(u);y=y.redIAdd(y),y=y.redIAdd(y);var p=this.x.redMul(D).redISub(y);p=p.redIAdd(p),p=p.redIAdd(p);var l=this.y.redMul(u.redMul(g.redISub(u)).redISub(I.redMul(D)));l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var Q=this.z.redAdd(I).redSqr().redISub(V).redISub(D);return this.curve.jpoint(p,l,Q)},w.prototype.mul=function(X,G){return X=new P(X,G),this.curve._wnafMul(this,X)},w.prototype.eq=function(X){if(X.type==="affine")return this.eq(X.toJ());if(this===X)return!0;var G=this.z.redSqr(),V=X.z.redSqr();if(this.x.redMul(V).redISub(X.x.redMul(G)).cmpn(0)!==0)return!1;var C=G.redMul(this.z),E=V.redMul(X.z);return this.y.redMul(E).redISub(X.y.redMul(C)).cmpn(0)===0},w.prototype.eqXToP=function(X){var G=this.z.redSqr(),V=X.toRed(this.curve.red).redMul(G);if(this.x.cmp(V)===0)return!0;var C=X.clone(),E=this.curve.redN.redMul(G);for(;;){if(C.iadd(this.curve.n),C.cmp(this.curve.p)>=0)return!1;if(V.redIAdd(E),this.x.cmp(V)===0)return!0}},w.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},w.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),Dl=l$(($,q)=>{var K=AK(),P=_8(),_=tj(),O=X8();function j(J){_.call(this,"mont",J),this.a=new K(J.a,16).toRed(this.red),this.b=new K(J.b,16).toRed(this.red),this.i4=new K(4).toRed(this.red).redInvm(),this.two=new K(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}P(j,_),q.exports=j,j.prototype.validate=function(w){var k=w.normalize().x,X=k.redSqr(),G=X.redMul(k).redAdd(X.redMul(this.a)).redAdd(k),V=G.redSqrt();return V.redSqr().cmp(G)===0};function z(J,w,k){if(_.BasePoint.call(this,J,"projective"),w===null&&k===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new K(w,16),this.z=new K(k,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}P(z,_.BasePoint),j.prototype.decodePoint=function(w,k){return this.point(O.toArray(w,k),1)},j.prototype.point=function(w,k){return new z(this,w,k)},j.prototype.pointFromJSON=function(w){return z.fromJSON(this,w)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(w,k){return new z(w,k[0],k[1]||w.one)},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.z.cmpn(0)===0},z.prototype.dbl=function(){var w=this.x.redAdd(this.z),k=w.redSqr(),X=this.x.redSub(this.z),G=X.redSqr(),V=k.redSub(G),C=k.redMul(G),E=V.redMul(G.redAdd(this.curve.a24.redMul(V)));return this.curve.point(C,E)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(w,k){var X=this.x.redAdd(this.z),G=this.x.redSub(this.z),V=w.x.redAdd(w.z),C=w.x.redSub(w.z),E=C.redMul(X),h=V.redMul(G),I=k.z.redMul(E.redAdd(h).redSqr()),D=k.x.redMul(E.redISub(h).redSqr());return this.curve.point(I,D)},z.prototype.mul=function(w){var k=w.clone(),X=this,G=this.curve.point(null,null),V=this;for(var C=[];k.cmpn(0)!==0;k.iushrn(1))C.push(k.andln(1));for(var E=C.length-1;E>=0;E--)if(C[E]===0)X=X.diffAdd(G,V),G=G.dbl();else G=X.diffAdd(G,V),X=X.dbl();return G},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(w){return this.getX().cmp(w.getX())===0},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),Ll=l$(($,q)=>{var K=X8(),P=AK(),_=_8(),O=tj(),j=K.assert;function z(w){this.twisted=(w.a|0)!==1,this.mOneA=this.twisted&&(w.a|0)===-1,this.extended=this.mOneA,O.call(this,"edwards",w),this.a=new P(w.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new P(w.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new P(w.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(w.c|0)===1}_(z,O),q.exports=z,z.prototype._mulA=function(k){if(this.mOneA)return k.redNeg();else return this.a.redMul(k)},z.prototype._mulC=function(k){if(this.oneC)return k;else return this.c.redMul(k)},z.prototype.jpoint=function(k,X,G,V){return this.point(k,X,G,V)},z.prototype.pointFromX=function(k,X){if(k=new P(k,16),!k.red)k=k.toRed(this.red);var G=k.redSqr(),V=this.c2.redSub(this.a.redMul(G)),C=this.one.redSub(this.c2.redMul(this.d).redMul(G)),E=V.redMul(C.redInvm()),h=E.redSqrt();if(h.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");var I=h.fromRed().isOdd();if(X&&!I||!X&&I)h=h.redNeg();return this.point(k,h)},z.prototype.pointFromY=function(k,X){if(k=new P(k,16),!k.red)k=k.toRed(this.red);var G=k.redSqr(),V=G.redSub(this.c2),C=G.redMul(this.d).redMul(this.c2).redSub(this.a),E=V.redMul(C.redInvm());if(E.cmp(this.zero)===0)if(X)throw Error("invalid point");else return this.point(this.zero,k);var h=E.redSqrt();if(h.redSqr().redSub(E).cmp(this.zero)!==0)throw Error("invalid point");if(h.fromRed().isOdd()!==X)h=h.redNeg();return this.point(h,k)},z.prototype.validate=function(k){if(k.isInfinity())return!0;k.normalize();var X=k.x.redSqr(),G=k.y.redSqr(),V=X.redMul(this.a).redAdd(G),C=this.c2.redMul(this.one.redAdd(this.d.redMul(X).redMul(G)));return V.cmp(C)===0};function J(w,k,X,G,V){if(O.BasePoint.call(this,w,"projective"),k===null&&X===null&&G===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new P(k,16),this.y=new P(X,16),this.z=G?new P(G,16):this.curve.one,this.t=V&&new P(V,16),!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);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}_(J,O.BasePoint),z.prototype.pointFromJSON=function(k){return J.fromJSON(this,k)},z.prototype.point=function(k,X,G,V){return new J(this,k,X,G,V)},J.fromJSON=function(k,X){return new J(k,X[0],X[1],X[2])},J.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},J.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},J.prototype._extDbl=function(){var k=this.x.redSqr(),X=this.y.redSqr(),G=this.z.redSqr();G=G.redIAdd(G);var V=this.curve._mulA(k),C=this.x.redAdd(this.y).redSqr().redISub(k).redISub(X),E=V.redAdd(X),h=E.redSub(G),I=V.redSub(X),D=C.redMul(h),g=E.redMul(I),u=C.redMul(I),y=h.redMul(E);return this.curve.point(D,g,y,u)},J.prototype._projDbl=function(){var k=this.x.redAdd(this.y).redSqr(),X=this.x.redSqr(),G=this.y.redSqr(),V,C,E,h,I,D;if(this.curve.twisted){h=this.curve._mulA(X);var g=h.redAdd(G);if(this.zOne)V=k.redSub(X).redSub(G).redMul(g.redSub(this.curve.two)),C=g.redMul(h.redSub(G)),E=g.redSqr().redSub(g).redSub(g);else I=this.z.redSqr(),D=g.redSub(I).redISub(I),V=k.redSub(X).redISub(G).redMul(D),C=g.redMul(h.redSub(G)),E=g.redMul(D)}else h=X.redAdd(G),I=this.curve._mulC(this.z).redSqr(),D=h.redSub(I).redSub(I),V=this.curve._mulC(k.redISub(h)).redMul(D),C=this.curve._mulC(h).redMul(X.redISub(G)),E=h.redMul(D);return this.curve.point(V,C,E)},J.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},J.prototype._extAdd=function(k){var X=this.y.redSub(this.x).redMul(k.y.redSub(k.x)),G=this.y.redAdd(this.x).redMul(k.y.redAdd(k.x)),V=this.t.redMul(this.curve.dd).redMul(k.t),C=this.z.redMul(k.z.redAdd(k.z)),E=G.redSub(X),h=C.redSub(V),I=C.redAdd(V),D=G.redAdd(X),g=E.redMul(h),u=I.redMul(D),y=E.redMul(D),p=h.redMul(I);return this.curve.point(g,u,p,y)},J.prototype._projAdd=function(k){var X=this.z.redMul(k.z),G=X.redSqr(),V=this.x.redMul(k.x),C=this.y.redMul(k.y),E=this.curve.d.redMul(V).redMul(C),h=G.redSub(E),I=G.redAdd(E),D=this.x.redAdd(this.y).redMul(k.x.redAdd(k.y)).redISub(V).redISub(C),g=X.redMul(h).redMul(D),u,y;if(this.curve.twisted)u=X.redMul(I).redMul(C.redSub(this.curve._mulA(V))),y=h.redMul(I);else u=X.redMul(I).redMul(C.redSub(V)),y=this.curve._mulC(h).redMul(I);return this.curve.point(g,u,y)},J.prototype.add=function(k){if(this.isInfinity())return k;if(k.isInfinity())return this;if(this.curve.extended)return this._extAdd(k);else return this._projAdd(k)},J.prototype.mul=function(k){if(this._hasDoubles(k))return this.curve._fixedNafMul(this,k);else return this.curve._wnafMul(this,k)},J.prototype.mulAdd=function(k,X,G){return this.curve._wnafMulAdd(1,[this,X],[k,G],2,!1)},J.prototype.jmulAdd=function(k,X,G){return this.curve._wnafMulAdd(1,[this,X],[k,G],2,!0)},J.prototype.normalize=function(){if(this.zOne)return this;var k=this.z.redInvm();if(this.x=this.x.redMul(k),this.y=this.y.redMul(k),this.t)this.t=this.t.redMul(k);return this.z=this.curve.one,this.zOne=!0,this},J.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},J.prototype.getX=function(){return this.normalize(),this.x.fromRed()},J.prototype.getY=function(){return this.normalize(),this.y.fromRed()},J.prototype.eq=function(k){return this===k||this.getX().cmp(k.getX())===0&&this.getY().cmp(k.getY())===0},J.prototype.eqXToP=function(k){var X=k.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(X)===0)return!0;var G=k.clone(),V=this.curve.redN.redMul(this.z);for(;;){if(G.iadd(this.curve.n),G.cmp(this.curve.p)>=0)return!1;if(X.redIAdd(V),this.x.cmp(X)===0)return!0}},J.prototype.toP=J.prototype.normalize,J.prototype.mixedAdd=J.prototype.add}),mS=l$(($)=>{var q=$;q.base=tj(),q.short=Il(),q.mont=Dl(),q.edwards=Ll()}),F8=l$(($)=>{var q=tK(),K=_8();$.inherits=K;function P(Y,H){if((Y.charCodeAt(H)&64512)!==55296)return!1;if(H<0||H+1>=Y.length)return!1;return(Y.charCodeAt(H+1)&64512)===56320}function _(Y,H){if(Array.isArray(Y))return Y.slice();if(!Y)return[];var T=[];if(typeof Y==="string"){if(!H){var W=0;for(var Z=0;Z<Y.length;Z++){var S=Y.charCodeAt(Z);if(S<128)T[W++]=S;else if(S<2048)T[W++]=S>>6|192,T[W++]=S&63|128;else if(P(Y,Z))S=65536+((S&1023)<<10)+(Y.charCodeAt(++Z)&1023),T[W++]=S>>18|240,T[W++]=S>>12&63|128,T[W++]=S>>6&63|128,T[W++]=S&63|128;else T[W++]=S>>12|224,T[W++]=S>>6&63|128,T[W++]=S&63|128}}else if(H==="hex"){if(Y=Y.replace(/[^a-z0-9]+/ig,""),Y.length%2!==0)Y="0"+Y;for(Z=0;Z<Y.length;Z+=2)T.push(parseInt(Y[Z]+Y[Z+1],16))}}else for(Z=0;Z<Y.length;Z++)T[Z]=Y[Z]|0;return T}$.toArray=_;function O(Y){var H="";for(var T=0;T<Y.length;T++)H+=J(Y[T].toString(16));return H}$.toHex=O;function j(Y){var H=Y>>>24|Y>>>8&65280|Y<<8&16711680|(Y&255)<<24;return H>>>0}$.htonl=j;function z(Y,H){var T="";for(var W=0;W<Y.length;W++){var Z=Y[W];if(H==="little")Z=j(Z);T+=w(Z.toString(16))}return T}$.toHex32=z;function J(Y){if(Y.length===1)return"0"+Y;else return Y}$.zero2=J;function w(Y){if(Y.length===7)return"0"+Y;else if(Y.length===6)return"00"+Y;else if(Y.length===5)return"000"+Y;else if(Y.length===4)return"0000"+Y;else if(Y.length===3)return"00000"+Y;else if(Y.length===2)return"000000"+Y;else if(Y.length===1)return"0000000"+Y;else return Y}$.zero8=w;function k(Y,H,T,W){var Z=T-H;q(Z%4===0);var S=Array(Z/4);for(var N=0,f=H;N<S.length;N++,f+=4){var v;if(W==="big")v=Y[f]<<24|Y[f+1]<<16|Y[f+2]<<8|Y[f+3];else v=Y[f+3]<<24|Y[f+2]<<16|Y[f+1]<<8|Y[f];S[N]=v>>>0}return S}$.join32=k;function X(Y,H){var T=Array(Y.length*4);for(var W=0,Z=0;W<Y.length;W++,Z+=4){var S=Y[W];if(H==="big")T[Z]=S>>>24,T[Z+1]=S>>>16&255,T[Z+2]=S>>>8&255,T[Z+3]=S&255;else T[Z+3]=S>>>24,T[Z+2]=S>>>16&255,T[Z+1]=S>>>8&255,T[Z]=S&255}return T}$.split32=X;function G(Y,H){return Y>>>H|Y<<32-H}$.rotr32=G;function V(Y,H){return Y<<H|Y>>>32-H}$.rotl32=V;function C(Y,H){return Y+H>>>0}$.sum32=C;function E(Y,H,T){return Y+H+T>>>0}$.sum32_3=E;function h(Y,H,T,W){return Y+H+T+W>>>0}$.sum32_4=h;function I(Y,H,T,W,Z){return Y+H+T+W+Z>>>0}$.sum32_5=I;function D(Y,H,T,W){var Z=Y[H],S=Y[H+1],N=W+S>>>0,f=(N<W?1:0)+T+Z;Y[H]=f>>>0,Y[H+1]=N}$.sum64=D;function g(Y,H,T,W){var Z=H+W>>>0,S=(Z<H?1:0)+Y+T;return S>>>0}$.sum64_hi=g;function u(Y,H,T,W){var Z=H+W;return Z>>>0}$.sum64_lo=u;function y(Y,H,T,W,Z,S,N,f){var v=0,A=H;A=A+W>>>0,v+=A<H?1:0,A=A+S>>>0,v+=A<S?1:0,A=A+f>>>0,v+=A<f?1:0;var L=Y+T+Z+N+v;return L>>>0}$.sum64_4_hi=y;function p(Y,H,T,W,Z,S,N,f){var v=H+W+S+f;return v>>>0}$.sum64_4_lo=p;function l(Y,H,T,W,Z,S,N,f,v,A){var L=0,R=H;R=R+W>>>0,L+=R<H?1:0,R=R+S>>>0,L+=R<S?1:0,R=R+f>>>0,L+=R<f?1:0,R=R+A>>>0,L+=R<A?1:0;var b=Y+T+Z+N+v+L;return b>>>0}$.sum64_5_hi=l;function Q(Y,H,T,W,Z,S,N,f,v,A){var L=H+W+S+f+A;return L>>>0}$.sum64_5_lo=Q;function e(Y,H,T){var W=H<<32-T|Y>>>T;return W>>>0}$.rotr64_hi=e;function m(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.rotr64_lo=m;function o(Y,H,T){return Y>>>T}$.shr64_hi=o;function M(Y,H,T){var W=Y<<32-T|H>>>T;return W>>>0}$.shr64_lo=M}),c7=l$(($)=>{var q=F8(),K=tK();function P(){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}$.BlockHash=P,P.prototype.update=function(O,j){if(O=q.toArray(O,j),!this.pending)this.pending=O;else this.pending=this.pending.concat(O);if(this.pendingTotal+=O.length,this.pending.length>=this._delta8){O=this.pending;var z=O.length%this._delta8;if(this.pending=O.slice(O.length-z,O.length),this.pending.length===0)this.pending=null;O=q.join32(O,0,O.length-z,this.endian);for(var J=0;J<O.length;J+=this._delta32)this._update(O,J,J+this._delta32)}return this},P.prototype.digest=function(O){return this.update(this._pad()),K(this.pending===null),this._digest(O)},P.prototype._pad=function(){var O=this.pendingTotal,j=this._delta8,z=j-(O+this.padLength)%j,J=Array(z+this.padLength);J[0]=128;for(var w=1;w<z;w++)J[w]=0;if(O<<=3,this.endian==="big"){for(var k=8;k<this.padLength;k++)J[w++]=0;J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=O>>>24&255,J[w++]=O>>>16&255,J[w++]=O>>>8&255,J[w++]=O&255}else{J[w++]=O&255,J[w++]=O>>>8&255,J[w++]=O>>>16&255,J[w++]=O>>>24&255,J[w++]=0,J[w++]=0,J[w++]=0,J[w++]=0;for(k=8;k<this.padLength;k++)J[w++]=0}return J}}),dS=l$(($)=>{var q=F8(),K=q.rotr32;function P(X,G,V,C){if(X===0)return _(G,V,C);if(X===1||X===3)return j(G,V,C);if(X===2)return O(G,V,C)}$.ft_1=P;function _(X,G,V){return X&G^~X&V}$.ch32=_;function O(X,G,V){return X&G^X&V^G&V}$.maj32=O;function j(X,G,V){return X^G^V}$.p32=j;function z(X){return K(X,2)^K(X,13)^K(X,22)}$.s0_256=z;function J(X){return K(X,6)^K(X,11)^K(X,25)}$.s1_256=J;function w(X){return K(X,7)^K(X,18)^X>>>3}$.g0_256=w;function k(X){return K(X,17)^K(X,19)^X>>>10}$.g1_256=k}),bl=l$(($,q)=>{var K=F8(),P=c7(),_=dS(),O=K.rotl32,j=K.sum32,z=K.sum32_5,J=_.ft_1,w=P.BlockHash,k=[1518500249,1859775393,2400959708,3395469782];function X(){if(!(this instanceof X))return new X;w.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}K.inherits(X,w),q.exports=X,X.blockSize=512,X.outSize=160,X.hmacStrength=80,X.padLength=64,X.prototype._update=function(V,C){var E=this.W;for(var h=0;h<16;h++)E[h]=V[C+h];for(;h<E.length;h++)E[h]=O(E[h-3]^E[h-8]^E[h-14]^E[h-16],1);var I=this.h[0],D=this.h[1],g=this.h[2],u=this.h[3],y=this.h[4];for(h=0;h<E.length;h++){var p=~~(h/20),l=z(O(I,5),J(p,D,g,u),y,E[h],k[p]);y=u,u=g,g=O(D,30),D=I,I=l}this.h[0]=j(this.h[0],I),this.h[1]=j(this.h[1],D),this.h[2]=j(this.h[2],g),this.h[3]=j(this.h[3],u),this.h[4]=j(this.h[4],y)},X.prototype._digest=function(V){if(V==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),lS=l$(($,q)=>{var K=F8(),P=c7(),_=dS(),O=tK(),j=K.sum32,z=K.sum32_4,J=K.sum32_5,w=_.ch32,k=_.maj32,X=_.s0_256,G=_.s1_256,V=_.g0_256,C=_.g1_256,E=P.BlockHash,h=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function I(){if(!(this instanceof I))return new I;E.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=h,this.W=Array(64)}K.inherits(I,E),q.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(g,u){var y=this.W;for(var p=0;p<16;p++)y[p]=g[u+p];for(;p<y.length;p++)y[p]=z(C(y[p-2]),y[p-7],V(y[p-15]),y[p-16]);var l=this.h[0],Q=this.h[1],e=this.h[2],m=this.h[3],o=this.h[4],M=this.h[5],Y=this.h[6],H=this.h[7];O(this.k.length===y.length);for(p=0;p<y.length;p++){var T=J(H,G(o),w(o,M,Y),this.k[p],y[p]),W=j(X(l),k(l,Q,e));H=Y,Y=M,M=o,o=j(m,T),m=e,e=Q,Q=l,l=j(T,W)}this.h[0]=j(this.h[0],l),this.h[1]=j(this.h[1],Q),this.h[2]=j(this.h[2],e),this.h[3]=j(this.h[3],m),this.h[4]=j(this.h[4],o),this.h[5]=j(this.h[5],M),this.h[6]=j(this.h[6],Y),this.h[7]=j(this.h[7],H)},I.prototype._digest=function(g){if(g==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")}}),gl=l$(($,q)=>{var K=F8(),P=lS();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=512,_.outSize=224,_.hmacStrength=192,_.padLength=64,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,7),"big");else return K.split32(this.h.slice(0,7),"big")}}),rS=l$(($,q)=>{var K=F8(),P=c7(),_=tK(),O=K.rotr64_hi,j=K.rotr64_lo,z=K.shr64_hi,J=K.shr64_lo,w=K.sum64,k=K.sum64_hi,X=K.sum64_lo,G=K.sum64_4_hi,V=K.sum64_4_lo,C=K.sum64_5_hi,E=K.sum64_5_lo,h=P.BlockHash,I=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function D(){if(!(this instanceof D))return new D;h.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I,this.W=Array(160)}K.inherits(D,h),q.exports=D,D.blockSize=1024,D.outSize=512,D.hmacStrength=192,D.padLength=128,D.prototype._prepareBlock=function(W,Z){var S=this.W;for(var N=0;N<32;N++)S[N]=W[Z+N];for(;N<S.length;N+=2){var f=Y(S[N-4],S[N-3]),v=H(S[N-4],S[N-3]),A=S[N-14],L=S[N-13],R=o(S[N-30],S[N-29]),b=M(S[N-30],S[N-29]),d=S[N-32],i=S[N-31];S[N]=G(f,v,A,L,R,b,d,i),S[N+1]=V(f,v,A,L,R,b,d,i)}},D.prototype._update=function(W,Z){this._prepareBlock(W,Z);var S=this.W,N=this.h[0],f=this.h[1],v=this.h[2],A=this.h[3],L=this.h[4],R=this.h[5],b=this.h[6],d=this.h[7],i=this.h[8],F=this.h[9],W$=this.h[10],n=this.h[11],B=this.h[12],y$=this.h[13],Y$=this.h[14],v$=this.h[15];_(this.k.length===S.length);for(var a=0;a<S.length;a+=2){var r=Y$,t=v$,x$=e(i,F),q$=m(i,F),$$=g(i,F,W$,n,B,y$),s=u(i,F,W$,n,B,y$),U=this.k[a],_$=this.k[a+1],f$=S[a],O$=S[a+1],T$=C(r,t,x$,q$,$$,s,U,_$,f$,O$),O6=E(r,t,x$,q$,$$,s,U,_$,f$,O$);r=l(N,f),t=Q(N,f),x$=y(N,f,v,A,L,R),q$=p(N,f,v,A,L,R);var H$=k(r,t,x$,q$),X$=X(r,t,x$,q$);Y$=B,v$=y$,B=W$,y$=n,W$=i,n=F,i=k(b,d,T$,O6),F=X(d,d,T$,O6),b=L,d=R,L=v,R=A,v=N,A=f,N=k(T$,O6,H$,X$),f=X(T$,O6,H$,X$)}w(this.h,0,N,f),w(this.h,2,v,A),w(this.h,4,L,R),w(this.h,6,b,d),w(this.h,8,i,F),w(this.h,10,W$,n),w(this.h,12,B,y$),w(this.h,14,Y$,v$)},D.prototype._digest=function(W){if(W==="hex")return K.toHex32(this.h,"big");else return K.split32(this.h,"big")};function g(T,W,Z,S,N){var f=T&Z^~T&N;if(f<0)f+=4294967296;return f}function u(T,W,Z,S,N,f){var v=W&S^~W&f;if(v<0)v+=4294967296;return v}function y(T,W,Z,S,N){var f=T&Z^T&N^Z&N;if(f<0)f+=4294967296;return f}function p(T,W,Z,S,N,f){var v=W&S^W&f^S&f;if(v<0)v+=4294967296;return v}function l(T,W){var Z=O(T,W,28),S=O(W,T,2),N=O(W,T,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function Q(T,W){var Z=j(T,W,28),S=j(W,T,2),N=j(W,T,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function e(T,W){var Z=O(T,W,14),S=O(T,W,18),N=O(W,T,9),f=Z^S^N;if(f<0)f+=4294967296;return f}function m(T,W){var Z=j(T,W,14),S=j(T,W,18),N=j(W,T,9),f=Z^S^N;if(f<0)f+=4294967296;return f}function o(T,W){var Z=O(T,W,1),S=O(T,W,8),N=z(T,W,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function M(T,W){var Z=j(T,W,1),S=j(T,W,8),N=J(T,W,7),f=Z^S^N;if(f<0)f+=4294967296;return f}function Y(T,W){var Z=O(T,W,19),S=O(W,T,29),N=z(T,W,6),f=Z^S^N;if(f<0)f+=4294967296;return f}function H(T,W){var Z=j(T,W,19),S=j(W,T,29),N=J(T,W,6),f=Z^S^N;if(f<0)f+=4294967296;return f}}),ul=l$(($,q)=>{var K=F8(),P=rS();function _(){if(!(this instanceof _))return new _;P.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}K.inherits(_,P),q.exports=_,_.blockSize=1024,_.outSize=384,_.hmacStrength=192,_.padLength=128,_.prototype._digest=function(j){if(j==="hex")return K.toHex32(this.h.slice(0,12),"big");else return K.split32(this.h.slice(0,12),"big")}}),yl=l$(($)=>{$.sha1=bl(),$.sha224=gl(),$.sha256=lS(),$.sha384=ul(),$.sha512=rS()}),xl=l$(($)=>{var q=F8(),K=c7(),P=q.rotl32,_=q.sum32,O=q.sum32_3,j=q.sum32_4,z=K.BlockHash;function J(){if(!(this instanceof J))return new J;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}q.inherits(J,z),$.ripemd160=J,J.blockSize=512,J.outSize=160,J.hmacStrength=192,J.padLength=64,J.prototype._update=function(I,D){var g=this.h[0],u=this.h[1],y=this.h[2],p=this.h[3],l=this.h[4],Q=g,e=u,m=y,o=p,M=l;for(var Y=0;Y<80;Y++){var H=_(P(j(g,w(Y,u,y,p),I[G[Y]+D],k(Y)),C[Y]),l);g=l,l=p,p=P(y,10),y=u,u=H,H=_(P(j(Q,w(79-Y,e,m,o),I[V[Y]+D],X(Y)),E[Y]),M),Q=M,M=o,o=P(m,10),m=e,e=H}H=O(this.h[1],y,o),this.h[1]=O(this.h[2],p,M),this.h[2]=O(this.h[3],l,Q),this.h[3]=O(this.h[4],g,e),this.h[4]=O(this.h[0],u,m),this.h[0]=H},J.prototype._digest=function(I){if(I==="hex")return q.toHex32(this.h,"little");else return q.split32(this.h,"little")};function w(h,I,D,g){if(h<=15)return I^D^g;else if(h<=31)return I&D|~I&g;else if(h<=47)return(I|~D)^g;else if(h<=63)return I&g|D&~g;else return I^(D|~g)}function k(h){if(h<=15)return 0;else if(h<=31)return 1518500249;else if(h<=47)return 1859775393;else if(h<=63)return 2400959708;else return 2840853838}function X(h){if(h<=15)return 1352829926;else if(h<=31)return 1548603684;else if(h<=47)return 1836072691;else if(h<=63)return 2053994217;else return 0}var G=[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],V=[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],C=[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],E=[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]}),cl=l$(($,q)=>{var K=F8(),P=tK();function _(O,j,z){if(!(this instanceof _))return new _(O,j,z);this.Hash=O,this.blockSize=O.blockSize/8,this.outSize=O.outSize/8,this.inner=null,this.outer=null,this._init(K.toArray(j,z))}q.exports=_,_.prototype._init=function(j){if(j.length>this.blockSize)j=new this.Hash().update(j).digest();P(j.length<=this.blockSize);for(var z=j.length;z<this.blockSize;z++)j.push(0);for(z=0;z<j.length;z++)j[z]^=54;this.inner=new this.Hash().update(j);for(z=0;z<j.length;z++)j[z]^=106;this.outer=new this.Hash().update(j)},_.prototype.update=function(j,z){return this.inner.update(j,z),this},_.prototype.digest=function(j){return this.outer.update(this.inner.digest()),this.outer.digest(j)}}),zH=l$(($)=>{var q=$;q.utils=F8(),q.common=c7(),q.sha=yl(),q.ripemd=xl(),q.hmac=cl(),q.sha1=q.sha.sha1,q.sha256=q.sha.sha256,q.sha224=q.sha.sha224,q.sha384=q.sha.sha384,q.sha512=q.sha.sha512,q.ripemd160=q.ripemd.ripemd160}),pl=l$(($,q)=>{q.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),WH=l$(($)=>{var q=$,K=zH(),P=mS(),_=X8(),O=_.assert;function j(w){if(w.type==="short")this.curve=new P.short(w);else if(w.type==="edwards")this.curve=new P.edwards(w);else this.curve=new P.mont(w);this.g=this.curve.g,this.n=this.curve.n,this.hash=w.hash,O(this.g.validate(),"Invalid curve"),O(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}q.PresetCurve=j;function z(w,k){Object.defineProperty(q,w,{configurable:!0,enumerable:!0,get:function(){var X=new j(k);return Object.defineProperty(q,w,{configurable:!0,enumerable:!0,value:X}),X}})}z("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:K.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),z("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:K.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),z("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:K.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),z("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:K.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),z("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:K.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),z("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:K.sha256,gRed:!1,g:["9"]}),z("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:K.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var J;try{J=pl()}catch(w){J=void 0}z("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:K.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",J]})}),ml=l$(($,q)=>{var K=zH(),P=cS(),_=tK();function O(j){if(!(this instanceof O))return new O(j);this.hash=j.hash,this.predResist=!!j.predResist,this.outLen=this.hash.outSize,this.minEntropy=j.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=P.toArray(j.entropy,j.entropyEnc||"hex"),J=P.toArray(j.nonce,j.nonceEnc||"hex"),w=P.toArray(j.pers,j.persEnc||"hex");_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,J,w)}q.exports=O,O.prototype._init=function(z,J,w){var k=z.concat(J).concat(w);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var X=0;X<this.V.length;X++)this.K[X]=0,this.V[X]=1;this._update(k),this._reseed=1,this.reseedInterval=281474976710656},O.prototype._hmac=function(){return new K.hmac(this.hash,this.K)},O.prototype._update=function(z){var J=this._hmac().update(this.V).update([0]);if(z)J=J.update(z);if(this.K=J.digest(),this.V=this._hmac().update(this.V).digest(),!z)return;this.K=this._hmac().update(this.V).update([1]).update(z).digest(),this.V=this._hmac().update(this.V).digest()},O.prototype.reseed=function(z,J,w,k){if(typeof J!=="string")k=w,w=J,J=null;z=P.toArray(z,J),w=P.toArray(w,k),_(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(z.concat(w||[])),this._reseed=1},O.prototype.generate=function(z,J,w,k){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof J!=="string")k=w,w=J,J=null;if(w)w=P.toArray(w,k||"hex"),this._update(w);var X=[];while(X.length<z)this.V=this._hmac().update(this.V).digest(),X=X.concat(this.V);var G=X.slice(0,z);return this._update(w),this._reseed++,P.encode(G,J)}}),dl=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert;function O(j,z){if(this.ec=j,this.priv=null,this.pub=null,z.priv)this._importPrivate(z.priv,z.privEnc);if(z.pub)this._importPublic(z.pub,z.pubEnc)}q.exports=O,O.fromPublic=function(z,J,w){if(J instanceof O)return J;return new O(z,{pub:J,pubEnc:w})},O.fromPrivate=function(z,J,w){if(J instanceof O)return J;return new O(z,{priv:J,privEnc:w})},O.prototype.validate=function(){var z=this.getPublic();if(z.isInfinity())return{result:!1,reason:"Invalid public key"};if(!z.validate())return{result:!1,reason:"Public key is not a point"};if(!z.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},O.prototype.getPublic=function(z,J){if(typeof z==="string")J=z,z=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!J)return this.pub;return this.pub.encode(J,z)},O.prototype.getPrivate=function(z){if(z==="hex")return this.priv.toString(16,2);else return this.priv},O.prototype._importPrivate=function(z,J){this.priv=new K(z,J||16),this.priv=this.priv.umod(this.ec.curve.n)},O.prototype._importPublic=function(z,J){if(z.x||z.y){if(this.ec.curve.type==="mont")_(z.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")_(z.x&&z.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(z.x,z.y);return}this.pub=this.ec.curve.decodePoint(z,J)},O.prototype.derive=function(z){if(!z.validate())_(z.validate(),"public point not validated");return z.mul(this.priv).getX()},O.prototype.sign=function(z,J,w){return this.ec.sign(z,this,J,w)},O.prototype.verify=function(z,J,w){return this.ec.verify(z,J,this,void 0,w)},O.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),ll=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert;function O(k,X){if(k instanceof O)return k;if(this._importDER(k,X))return;if(_(k.r&&k.s,"Signature without r or s"),this.r=new K(k.r,16),this.s=new K(k.s,16),k.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=k.recoveryParam}q.exports=O;function j(){this.place=0}function z(k,X){var G=k[X.place++];if(!(G&128))return G;var V=G&15;if(V===0||V>4)return!1;if(k[X.place]===0)return!1;var C=0;for(var E=0,h=X.place;E<V;E++,h++)C<<=8,C|=k[h],C>>>=0;if(C<=127)return!1;return X.place=h,C}function J(k){var X=0,G=k.length-1;while(!k[X]&&!(k[X+1]&128)&&X<G)X++;if(X===0)return k;return k.slice(X)}O.prototype._importDER=function(X,G){X=P.toArray(X,G);var V=new j;if(X[V.place++]!==48)return!1;var C=z(X,V);if(C===!1)return!1;if(C+V.place!==X.length)return!1;if(X[V.place++]!==2)return!1;var E=z(X,V);if(E===!1)return!1;if((X[V.place]&128)!==0)return!1;var h=X.slice(V.place,E+V.place);if(V.place+=E,X[V.place++]!==2)return!1;var I=z(X,V);if(I===!1)return!1;if(X.length!==I+V.place)return!1;if((X[V.place]&128)!==0)return!1;var D=X.slice(V.place,I+V.place);if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;if(D[0]===0)if(D[1]&128)D=D.slice(1);else return!1;return this.r=new K(h),this.s=new K(D),this.recoveryParam=null,!0};function w(k,X){if(X<128){k.push(X);return}var G=1+(Math.log(X)/Math.LN2>>>3);k.push(G|128);while(--G)k.push(X>>>(G<<3)&255);k.push(X)}O.prototype.toDER=function(X){var G=this.r.toArray(),V=this.s.toArray();if(G[0]&128)G=[0].concat(G);if(V[0]&128)V=[0].concat(V);G=J(G),V=J(V);while(!V[0]&&!(V[1]&128))V=V.slice(1);var C=[2];w(C,G.length),C=C.concat(G),C.push(2),w(C,V.length);var E=C.concat(V),h=[48];return w(h,E.length),h=h.concat(E),P.encode(h,X)}}),rl=l$(($,q)=>{var K=AK(),P=ml(),_=X8(),O=WH(),j=pS(),z=_.assert,J=dl(),w=ll();function k(X){if(!(this instanceof k))return new k(X);if(typeof X==="string")z(Object.prototype.hasOwnProperty.call(O,X),"Unknown curve "+X),X=O[X];if(X instanceof O.PresetCurve)X={curve:X};this.curve=X.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=X.curve.g,this.g.precompute(X.curve.n.bitLength()+1),this.hash=X.hash||X.curve.hash}q.exports=k,k.prototype.keyPair=function(G){return new J(this,G)},k.prototype.keyFromPrivate=function(G,V){return J.fromPrivate(this,G,V)},k.prototype.keyFromPublic=function(G,V){return J.fromPublic(this,G,V)},k.prototype.genKeyPair=function(G){if(!G)G={};var V=new P({hash:this.hash,pers:G.pers,persEnc:G.persEnc||"utf8",entropy:G.entropy||j(this.hash.hmacStrength),entropyEnc:G.entropy&&G.entropyEnc||"utf8",nonce:this.n.toArray()}),C=this.n.byteLength(),E=this.n.sub(new K(2));for(;;){var h=new K(V.generate(C));if(h.cmp(E)>0)continue;return h.iaddn(1),this.keyFromPrivate(h)}},k.prototype._truncateToN=function(G,V,C){var E;if(K.isBN(G)||typeof G==="number")G=new K(G,16),E=G.byteLength();else if(typeof G==="object")E=G.length,G=new K(G,16);else{var h=G.toString();E=h.length+1>>>1,G=new K(h,16)}if(typeof C!=="number")C=E*8;var I=C-this.n.bitLength();if(I>0)G=G.ushrn(I);if(!V&&G.cmp(this.n)>=0)return G.sub(this.n);else return G},k.prototype.sign=function(G,V,C,E){if(typeof C==="object")E=C,C=null;if(!E)E={};if(typeof G!=="string"&&typeof G!=="number"&&!K.isBN(G)){z(typeof G==="object"&&G&&typeof G.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(G.length>>>0===G.length);for(var h=0;h<G.length;h++)z((G[h]&255)===G[h])}V=this.keyFromPrivate(V,C),G=this._truncateToN(G,!1,E.msgBitLength),z(!G.isNeg(),"Can not sign a negative message");var I=this.n.byteLength(),D=V.getPrivate().toArray("be",I),g=G.toArray("be",I);z(new K(g).eq(G),"Can not sign message");var u=new P({hash:this.hash,entropy:D,nonce:g,pers:E.pers,persEnc:E.persEnc||"utf8"}),y=this.n.sub(new K(1));for(var p=0;;p++){var l=E.k?E.k(p):new K(u.generate(this.n.byteLength()));if(l=this._truncateToN(l,!0),l.cmpn(1)<=0||l.cmp(y)>=0)continue;var Q=this.g.mul(l);if(Q.isInfinity())continue;var e=Q.getX(),m=e.umod(this.n);if(m.cmpn(0)===0)continue;var o=l.invm(this.n).mul(m.mul(V.getPrivate()).iadd(G));if(o=o.umod(this.n),o.cmpn(0)===0)continue;var M=(Q.getY().isOdd()?1:0)|(e.cmp(m)!==0?2:0);if(E.canonical&&o.cmp(this.nh)>0)o=this.n.sub(o),M^=1;return new w({r:m,s:o,recoveryParam:M})}},k.prototype.verify=function(G,V,C,E,h){if(!h)h={};G=this._truncateToN(G,!1,h.msgBitLength),C=this.keyFromPublic(C,E),V=new w(V,"hex");var{r:I,s:D}=V;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;if(D.cmpn(1)<0||D.cmp(this.n)>=0)return!1;var g=D.invm(this.n),u=g.mul(G).umod(this.n),y=g.mul(I).umod(this.n),p;if(!this.curve._maxwellTrick){if(p=this.g.mulAdd(u,C.getPublic(),y),p.isInfinity())return!1;return p.getX().umod(this.n).cmp(I)===0}if(p=this.g.jmulAdd(u,C.getPublic(),y),p.isInfinity())return!1;return p.eqXToP(I)},k.prototype.recoverPubKey=function(X,G,V,C){z((3&V)===V,"The recovery param is more than two bits"),G=new w(G,C);var E=this.n,h=new K(X),I=G.r,D=G.s,g=V&1,u=V>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");if(u)I=this.curve.pointFromX(I.add(this.curve.n),g);else I=this.curve.pointFromX(I,g);var y=G.r.invm(E),p=E.sub(h).mul(y).umod(E),l=D.mul(y).umod(E);return this.g.mulAdd(p,I,l)},k.prototype.getKeyRecoveryParam=function(X,G,V,C){if(G=new w(G,C),G.recoveryParam!==null)return G.recoveryParam;for(var E=0;E<4;E++){var h;try{h=this.recoverPubKey(X,G,E)}catch(I){continue}if(h.eq(V))return E}throw Error("Unable to find valid recovery factor")}}),ol=l$(($,q)=>{var K=X8(),P=K.assert,_=K.parseBytes,O=K.cachedProperty;function j(z,J){if(this.eddsa=z,this._secret=_(J.secret),z.isPoint(J.pub))this._pub=J.pub;else this._pubBytes=_(J.pub)}j.fromPublic=function(J,w){if(w instanceof j)return w;return new j(J,{pub:w})},j.fromSecret=function(J,w){if(w instanceof j)return w;return new j(J,{secret:w})},j.prototype.secret=function(){return this._secret},O(j,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),O(j,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),O(j,"privBytes",function(){var J=this.eddsa,w=this.hash(),k=J.encodingLength-1,X=w.slice(0,J.encodingLength);return X[0]&=248,X[k]&=127,X[k]|=64,X}),O(j,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),O(j,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),O(j,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),j.prototype.sign=function(J){return P(this._secret,"KeyPair can only verify"),this.eddsa.sign(J,this)},j.prototype.verify=function(J,w){return this.eddsa.verify(J,w,this)},j.prototype.getSecret=function(J){return P(this._secret,"KeyPair is public only"),K.encode(this.secret(),J)},j.prototype.getPublic=function(J){return K.encode(this.pubBytes(),J)},q.exports=j}),nl=l$(($,q)=>{var K=AK(),P=X8(),_=P.assert,O=P.cachedProperty,j=P.parseBytes;function z(J,w){if(this.eddsa=J,typeof w!=="object")w=j(w);if(Array.isArray(w))_(w.length===J.encodingLength*2,"Signature has invalid size"),w={R:w.slice(0,J.encodingLength),S:w.slice(J.encodingLength)};if(_(w.R&&w.S,"Signature without R or S"),J.isPoint(w.R))this._R=w.R;if(w.S instanceof K)this._S=w.S;this._Rencoded=Array.isArray(w.R)?w.R:w.Rencoded,this._Sencoded=Array.isArray(w.S)?w.S:w.Sencoded}O(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),O(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),O(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),O(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return P.encode(this.toBytes(),"hex").toUpperCase()},q.exports=z}),il=l$(($,q)=>{var K=zH(),P=WH(),_=X8(),O=_.assert,j=_.parseBytes,z=ol(),J=nl();function w(k){if(O(k==="ed25519","only tested with ed25519 so far"),!(this instanceof w))return new w(k);k=P[k].curve,this.curve=k,this.g=k.g,this.g.precompute(k.n.bitLength()+1),this.pointClass=k.point().constructor,this.encodingLength=Math.ceil(k.n.bitLength()/8),this.hash=K.sha512}q.exports=w,w.prototype.sign=function(X,G){X=j(X);var V=this.keyFromSecret(G),C=this.hashInt(V.messagePrefix(),X),E=this.g.mul(C),h=this.encodePoint(E),I=this.hashInt(h,V.pubBytes(),X).mul(V.priv()),D=C.add(I).umod(this.curve.n);return this.makeSignature({R:E,S:D,Rencoded:h})},w.prototype.verify=function(X,G,V){if(X=j(X),G=this.makeSignature(G),G.S().gte(G.eddsa.curve.n)||G.S().isNeg())return!1;var C=this.keyFromPublic(V),E=this.hashInt(G.Rencoded(),C.pubBytes(),X),h=this.g.mul(G.S()),I=G.R().add(C.pub().mul(E));return I.eq(h)},w.prototype.hashInt=function(){var X=this.hash();for(var G=0;G<arguments.length;G++)X.update(arguments[G]);return _.intFromLE(X.digest()).umod(this.curve.n)},w.prototype.keyFromPublic=function(X){return z.fromPublic(this,X)},w.prototype.keyFromSecret=function(X){return z.fromSecret(this,X)},w.prototype.makeSignature=function(X){if(X instanceof J)return X;return new J(this,X)},w.prototype.encodePoint=function(X){var G=X.getY().toArray("le",this.encodingLength);return G[this.encodingLength-1]|=X.getX().isOdd()?128:0,G},w.prototype.decodePoint=function(X){X=_.parseBytes(X);var G=X.length-1,V=X.slice(0,G).concat(X[G]&-129),C=(X[G]&128)!==0,E=_.intFromLE(V);return this.curve.pointFromY(E,C)},w.prototype.encodeInt=function(X){return X.toArray("le",this.encodingLength)},w.prototype.decodeInt=function(X){return _.intFromLE(X)},w.prototype.isPoint=function(X){return X instanceof this.pointClass}}),Bl=l$(($)=>{var q=$;q.version=hl().version,q.utils=X8(),q.rand=pS(),q.curve=mS(),q.curves=WH(),q.ec=rl(),q.eddsa=il()}),tl=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,r=a&8191,t=a>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,s=W[6]|0,U=s&8191,_$=s>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,A=Math.imul(F,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(F,D$)|0,A=A+Math.imul(F,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,A=A+Math.imul(F,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,A=A+Math.imul(F,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,b$)|0,A=A+Math.imul(F,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(F,x)|0,A=A+Math.imul(F,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(U,D$)|0,v=v+Math.imul(U,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,A=A+Math.imul(F,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,A=A+Math.imul(F,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,g$)|0,A=A+Math.imul(F,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(U,b$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,A=A+Math.imul(F,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(U,x)|0,v=v+Math.imul(U,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(U,g$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],F=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=F+n,T[L+d+N]=i-W$,W[L+d+N]=F-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new m(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function l(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,y);function Q(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(Q,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new l;else if(Y==="p192")H=new Q;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function m(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}m.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},m.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},m.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},m.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},m.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},m.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},m.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},m.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},m.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},m.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},m.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},m.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},m.prototype.sqr=function(Y){return this.mul(Y,Y)},m.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var F=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(F),A=F.redSqr(),R=R.redMul(A),b=i}return L},m.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},m.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},m.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},m.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(m.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,m),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),Ul=l$(($,q)=>{var K=Bl(),P=tl();q.exports=function(J){return new O(J)};var _={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};_.p224=_.secp224r1,_.p256=_.secp256r1=_.prime256v1,_.p192=_.secp192r1=_.prime192v1,_.p384=_.secp384r1,_.p521=_.secp521r1;function O(z){if(this.curveType=_[z],!this.curveType)this.curveType={name:z};this.curve=new K.ec(this.curveType.name),this.keys=void 0}O.prototype.generateKeys=function(z,J){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,J)},O.prototype.computeSecret=function(z,J,w){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var k=this.curve.keyFromPublic(z).getPublic(),X=k.mul(this.keys.getPrivate()).getX();return j(X,w,this.curveType.byteLength)},O.prototype.getPublicKey=function(z,J){var w=this.keys.getPublic(J==="compressed",!0);if(J==="hybrid")if(w[w.length-1]%2)w[0]=7;else w[0]=6;return j(w,z)},O.prototype.getPrivateKey=function(z){return j(this.keys.getPrivate(),z)},O.prototype.setPublicKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);return this.keys._importPublic(z),this},O.prototype.setPrivateKey=function(z,J){if(J=J||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,J);var w=new P(z);return w=w.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(w),this};function j(z,J,w){if(!Array.isArray(z))z=z.toArray();var k=new Buffer(z);if(w&&k.length<w){var X=new Buffer(w-k.length);X.fill(0),k=Buffer.concat([X,k])}if(!J)return k;else return k.toString(J)}}),Fl=l$(($,q)=>{var K=(dq(),W6(mq)).createECDH;q.exports=K||Ul()}),al=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,r=a&8191,t=a>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,s=W[6]|0,U=s&8191,_$=s>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,A=Math.imul(F,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(F,D$)|0,A=A+Math.imul(F,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,A=A+Math.imul(F,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,A=A+Math.imul(F,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,b$)|0,A=A+Math.imul(F,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(F,x)|0,A=A+Math.imul(F,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(U,D$)|0,v=v+Math.imul(U,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,A=A+Math.imul(F,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,A=A+Math.imul(F,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,g$)|0,A=A+Math.imul(F,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(U,b$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,A=A+Math.imul(F,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(U,x)|0,v=v+Math.imul(U,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(U,g$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],F=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=F+n,T[L+d+N]=i-W$,W[L+d+N]=F-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new m(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function l(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,y);function Q(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(Q,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new l;else if(Y==="p192")H=new Q;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function m(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}m.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},m.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},m.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},m.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},m.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},m.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},m.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},m.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},m.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},m.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},m.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},m.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},m.prototype.sqr=function(Y){return this.mul(Y,Y)},m.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var F=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(F),A=F.redSqr(),R=R.redMul(A),b=i}return L},m.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},m.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},m.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},m.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(m.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,m),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),Ql=l$(($)=>{var q=p7(),K=_8(),P=$;P.define=function(j,z){return new _(j,z)};function _(O,j){this.name=O,this.body=j,this.decoders={},this.encoders={}}_.prototype._createNamed=function(j){var z;try{z=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
35
35
  this._initNamed(entity);
36
- })`)}catch(J){z=function(w){this._initNamed(w)}}return K(z,j),z.prototype._initNamed=function(w){j.call(this,w)},new z(this)},_.prototype._getDecoder=function(j){if(j=j||"der",!this.decoders.hasOwnProperty(j))this.decoders[j]=this._createNamed(q.decoders[j]);return this.decoders[j]},_.prototype.decode=function(j,z,J){return this._getDecoder(z).decode(j,J)},_.prototype._getEncoder=function(j){if(j=j||"der",!this.encoders.hasOwnProperty(j))this.encoders[j]=this._createNamed(q.encoders[j]);return this.encoders[j]},_.prototype.encode=function(j,z,J){return this._getEncoder(z).encode(j,J)}}),el=l$(($)=>{var q=_8();function K(_){this._reporterState={obj:null,path:[],options:_||{},errors:[]}}$.Reporter=K,K.prototype.isError=function(O){return O instanceof P},K.prototype.save=function(){var O=this._reporterState;return{obj:O.obj,pathLen:O.path.length}},K.prototype.restore=function(O){var j=this._reporterState;j.obj=O.obj,j.path=j.path.slice(0,O.pathLen)},K.prototype.enterKey=function(O){return this._reporterState.path.push(O)},K.prototype.exitKey=function(O){var j=this._reporterState;j.path=j.path.slice(0,O-1)},K.prototype.leaveKey=function(O,j,z){var J=this._reporterState;if(this.exitKey(O),J.obj!==null)J.obj[j]=z},K.prototype.path=function(){return this._reporterState.path.join("/")},K.prototype.enterObject=function(){var O=this._reporterState,j=O.obj;return O.obj={},j},K.prototype.leaveObject=function(O){var j=this._reporterState,z=j.obj;return j.obj=O,z},K.prototype.error=function(O){var j,z=this._reporterState,J=O instanceof P;if(J)j=O;else j=new P(z.path.map(function(w){return"["+JSON.stringify(w)+"]"}).join(""),O.message||O,O.stack);if(!z.options.partial)throw j;if(!J)z.errors.push(j);return j},K.prototype.wrapResult=function(O){var j=this._reporterState;if(!j.options.partial)return O;return{result:this.isError(O)?null:O,errors:j.errors}};function P(_,O){this.path=_,this.rethrow(O)}q(P,Error),P.prototype.rethrow=function(O){if(this.message=O+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,P);if(!this.stack)try{throw Error(this.message)}catch(j){this.stack=j.stack}return this}}),gS=l$(($)=>{var q=_8(),K=x7().Reporter,P=(vq(),W6(Yq)).Buffer;function _(j,z){if(K.call(this,z),!P.isBuffer(j)){this.error("Input not Buffer");return}this.base=j,this.offset=0,this.length=j.length}q(_,K),$.DecoderBuffer=_,_.prototype.save=function(){return{offset:this.offset,reporter:K.prototype.save.call(this)}},_.prototype.restore=function(z){var J=new _(this.base);return J.offset=z.offset,J.length=this.offset,this.offset=z.offset,K.prototype.restore.call(this,z.reporter),J},_.prototype.isEmpty=function(){return this.offset===this.length},_.prototype.readUInt8=function(z){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(z||"DecoderBuffer overrun")},_.prototype.skip=function(z,J){if(!(this.offset+z<=this.length))return this.error(J||"DecoderBuffer overrun");var w=new _(this.base);return w._reporterState=this._reporterState,w.offset=this.offset,w.length=this.offset+z,this.offset+=z,w},_.prototype.raw=function(z){return this.base.slice(z?z.offset:this.offset,this.length)};function O(j,z){if(Array.isArray(j))this.length=0,this.value=j.map(function(J){if(!(J instanceof O))J=new O(J,z);return this.length+=J.length,J},this);else if(typeof j==="number"){if(!(0<=j&&j<=255))return z.error("non-byte EncoderBuffer value");this.value=j,this.length=1}else if(typeof j==="string")this.value=j,this.length=P.byteLength(j);else if(P.isBuffer(j))this.value=j,this.length=j.length;else return z.error("Unsupported type: "+typeof j)}$.EncoderBuffer=O,O.prototype.join=function(z,J){if(!z)z=new P(this.length);if(!J)J=0;if(this.length===0)return z;if(Array.isArray(this.value))this.value.forEach(function(w){w.join(z,J),J+=w.length});else{if(typeof this.value==="number")z[J]=this.value;else if(typeof this.value==="string")z.write(this.value,J);else if(P.isBuffer(this.value))this.value.copy(z,J);J+=this.length}return z}}),sl=l$(($,q)=>{var K=x7().Reporter,P=x7().EncoderBuffer,_=x7().DecoderBuffer,O=tK(),j=["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"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(j),J=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function w(X,G){var V={};if(this._baseState=V,V.enc=X,V.parent=G||null,V.children=null,V.tag=null,V.args=null,V.reverseArgs=null,V.choice=null,V.optional=!1,V.any=!1,V.obj=!1,V.use=null,V.useDecoder=null,V.key=null,V.default=null,V.explicit=null,V.implicit=null,V.contains=null,!V.parent)V.children=[],this._wrap()}q.exports=w;var k=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];w.prototype.clone=function(){var G=this._baseState,V={};k.forEach(function(E){V[E]=G[E]});var C=new this.constructor(V.parent);return C._baseState=V,C},w.prototype._wrap=function(){var G=this._baseState;z.forEach(function(V){this[V]=function(){var E=new this.constructor(this);return G.children.push(E),E[V].apply(E,arguments)}},this)},w.prototype._init=function(G){var V=this._baseState;O(V.parent===null),G.call(this),V.children=V.children.filter(function(C){return C._baseState.parent===this},this),O.equal(V.children.length,1,"Root node can have only one child")},w.prototype._useArgs=function(G){var V=this._baseState,C=G.filter(function(E){return E instanceof this.constructor},this);if(G=G.filter(function(E){return!(E instanceof this.constructor)},this),C.length!==0)O(V.children===null),V.children=C,C.forEach(function(E){E._baseState.parent=this},this);if(G.length!==0)O(V.args===null),V.args=G,V.reverseArgs=G.map(function(E){if(typeof E!=="object"||E.constructor!==Object)return E;var h={};return Object.keys(E).forEach(function(I){if(I==(I|0))I|=0;var D=E[I];h[D]=I}),h})},J.forEach(function(X){w.prototype[X]=function(){var V=this._baseState;throw Error(X+" not implemented for encoding: "+V.enc)}}),j.forEach(function(X){w.prototype[X]=function(){var V=this._baseState,C=Array.prototype.slice.call(arguments);return O(V.tag===null),V.tag=X,this._useArgs(C),this}}),w.prototype.use=function(G){O(G);var V=this._baseState;return O(V.use===null),V.use=G,this},w.prototype.optional=function(){var G=this._baseState;return G.optional=!0,this},w.prototype.def=function(G){var V=this._baseState;return O(V.default===null),V.default=G,V.optional=!0,this},w.prototype.explicit=function(G){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.explicit=G,this},w.prototype.implicit=function(G){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.implicit=G,this},w.prototype.obj=function(){var G=this._baseState,V=Array.prototype.slice.call(arguments);if(G.obj=!0,V.length!==0)this._useArgs(V);return this},w.prototype.key=function(G){var V=this._baseState;return O(V.key===null),V.key=G,this},w.prototype.any=function(){var G=this._baseState;return G.any=!0,this},w.prototype.choice=function(G){var V=this._baseState;return O(V.choice===null),V.choice=G,this._useArgs(Object.keys(G).map(function(C){return G[C]})),this},w.prototype.contains=function(G){var V=this._baseState;return O(V.use===null),V.contains=G,this},w.prototype._decode=function(G,V){var C=this._baseState;if(C.parent===null)return G.wrapResult(C.children[0]._decode(G,V));var E=C.default,h=!0,I=null;if(C.key!==null)I=G.enterKey(C.key);if(C.optional){var D=null;if(C.explicit!==null)D=C.explicit;else if(C.implicit!==null)D=C.implicit;else if(C.tag!==null)D=C.tag;if(D===null&&!C.any){var g=G.save();try{if(C.choice===null)this._decodeGeneric(C.tag,G,V);else this._decodeChoice(G,V);h=!0}catch(U){h=!1}G.restore(g)}else if(h=this._peekTag(G,D,C.any),G.isError(h))return h}var u;if(C.obj&&h)u=G.enterObject();if(h){if(C.explicit!==null){var y=this._decodeTag(G,C.explicit);if(G.isError(y))return y;G=y}var p=G.offset;if(C.use===null&&C.choice===null){if(C.any)var g=G.save();var m=this._decodeTag(G,C.implicit!==null?C.implicit:C.tag,C.any);if(G.isError(m))return m;if(C.any)E=G.raw(g);else G=m}if(V&&V.track&&C.tag!==null)V.track(G.path(),p,G.length,"tagged");if(V&&V.track&&C.tag!==null)V.track(G.path(),G.offset,G.length,"content");if(C.any)E=E;else if(C.choice===null)E=this._decodeGeneric(C.tag,G,V);else E=this._decodeChoice(G,V);if(G.isError(E))return E;if(!C.any&&C.choice===null&&C.children!==null)C.children.forEach(function(l){l._decode(G,V)});if(C.contains&&(C.tag==="octstr"||C.tag==="bitstr")){var s=new _(E);E=this._getUse(C.contains,G._reporterState.obj)._decode(s,V)}}if(C.obj&&h)E=G.leaveObject(u);if(C.key!==null&&(E!==null||h===!0))G.leaveKey(I,C.key,E);else if(I!==null)G.exitKey(I);return E},w.prototype._decodeGeneric=function(G,V,C){var E=this._baseState;if(G==="seq"||G==="set")return null;if(G==="seqof"||G==="setof")return this._decodeList(V,G,E.args[0],C);else if(/str$/.test(G))return this._decodeStr(V,G,C);else if(G==="objid"&&E.args)return this._decodeObjid(V,E.args[0],E.args[1],C);else if(G==="objid")return this._decodeObjid(V,null,null,C);else if(G==="gentime"||G==="utctime")return this._decodeTime(V,G,C);else if(G==="null_")return this._decodeNull(V,C);else if(G==="bool")return this._decodeBool(V,C);else if(G==="objDesc")return this._decodeStr(V,G,C);else if(G==="int"||G==="enum")return this._decodeInt(V,E.args&&E.args[0],C);if(E.use!==null)return this._getUse(E.use,V._reporterState.obj)._decode(V,C);else return V.error("unknown tag: "+G)},w.prototype._getUse=function(G,V){var C=this._baseState;if(C.useDecoder=this._use(G,V),O(C.useDecoder._baseState.parent===null),C.useDecoder=C.useDecoder._baseState.children[0],C.implicit!==C.useDecoder._baseState.implicit)C.useDecoder=C.useDecoder.clone(),C.useDecoder._baseState.implicit=C.implicit;return C.useDecoder},w.prototype._decodeChoice=function(G,V){var C=this._baseState,E=null,h=!1;if(Object.keys(C.choice).some(function(I){var D=G.save(),g=C.choice[I];try{var u=g._decode(G,V);if(G.isError(u))return!1;E={type:I,value:u},h=!0}catch(y){return G.restore(D),!1}return!0},this),!h)return G.error("Choice not matched");return E},w.prototype._createEncoderBuffer=function(G){return new P(G,this.reporter)},w.prototype._encode=function(G,V,C){var E=this._baseState;if(E.default!==null&&E.default===G)return;var h=this._encodeValue(G,V,C);if(h===void 0)return;if(this._skipDefault(h,V,C))return;return h},w.prototype._encodeValue=function(G,V,C){var E=this._baseState;if(E.parent===null)return E.children[0]._encode(G,V||new K);var g=null;if(this.reporter=V,E.optional&&G===void 0)if(E.default!==null)G=E.default;else return;var h=null,I=!1;if(E.any)g=this._createEncoderBuffer(G);else if(E.choice)g=this._encodeChoice(G,V);else if(E.contains)h=this._getUse(E.contains,C)._encode(G,V),I=!0;else if(E.children)h=E.children.map(function(p){if(p._baseState.tag==="null_")return p._encode(null,V,G);if(p._baseState.key===null)return V.error("Child should have a key");var m=V.enterKey(p._baseState.key);if(typeof G!=="object")return V.error("Child expected, but input is not object");var s=p._encode(G[p._baseState.key],V,G);return V.leaveKey(m),s},this).filter(function(p){return p}),h=this._createEncoderBuffer(h);else if(E.tag==="seqof"||E.tag==="setof"){if(!(E.args&&E.args.length===1))return V.error("Too many args for : "+E.tag);if(!Array.isArray(G))return V.error("seqof/setof, but data is not Array");var D=this.clone();D._baseState.implicit=null,h=this._createEncoderBuffer(G.map(function(p){var m=this._baseState;return this._getUse(m.args[0],G)._encode(p,V)},D))}else if(E.use!==null)g=this._getUse(E.use,C)._encode(G,V);else h=this._encodePrimitive(E.tag,G),I=!0;var g;if(!E.any&&E.choice===null){var u=E.implicit!==null?E.implicit:E.tag,y=E.implicit===null?"universal":"context";if(u===null){if(E.use===null)V.error("Tag could be omitted only for .use()")}else if(E.use===null)g=this._encodeComposite(u,I,y,h)}if(E.explicit!==null)g=this._encodeComposite(E.explicit,!1,"context",g);return g},w.prototype._encodeChoice=function(G,V){var C=this._baseState,E=C.choice[G.type];if(!E)O(!1,G.type+" not found in "+JSON.stringify(Object.keys(C.choice)));return E._encode(G.value,V)},w.prototype._encodePrimitive=function(G,V){var C=this._baseState;if(/str$/.test(G))return this._encodeStr(V,G);else if(G==="objid"&&C.args)return this._encodeObjid(V,C.reverseArgs[0],C.args[1]);else if(G==="objid")return this._encodeObjid(V,null,null);else if(G==="gentime"||G==="utctime")return this._encodeTime(V,G);else if(G==="null_")return this._encodeNull();else if(G==="int"||G==="enum")return this._encodeInt(V,C.args&&C.reverseArgs[0]);else if(G==="bool")return this._encodeBool(V);else if(G==="objDesc")return this._encodeStr(V,G);else throw Error("Unsupported tag: "+G)},w.prototype._isNumstr=function(G){return/^[0-9 ]*$/.test(G)},w.prototype._isPrintstr=function(G){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(G)}}),x7=l$(($)=>{var q=$;q.Reporter=el().Reporter,q.DecoderBuffer=gS().DecoderBuffer,q.EncoderBuffer=gS().EncoderBuffer,q.Node=sl()}),$r=l$(($)=>{var q=oS();$.tagClass={0:"universal",1:"application",2:"context",3:"private"},$.tagClassByName=q._reverse($.tagClass),$.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"},$.tagByName=q._reverse($.tag)}),oS=l$(($)=>{var q=$;q._reverse=function(P){var _={};return Object.keys(P).forEach(function(O){if((O|0)==O)O=O|0;var j=P[O];_[j]=O}),_},q.der=$r()}),nS=l$(($,q)=>{var K=_8(),P=p7(),_=P.base,O=P.bignum,j=P.constants.der;function z(X){this.enc="der",this.name=X.name,this.entity=X,this.tree=new J,this.tree._init(X.body)}q.exports=z,z.prototype.decode=function(G,V){if(!(G instanceof _.DecoderBuffer))G=new _.DecoderBuffer(G,V);return this.tree._decode(G,V)};function J(X){_.Node.call(this,"der",X)}K(J,_.Node),J.prototype._peekTag=function(G,V,C){if(G.isEmpty())return!1;var E=G.save(),h=w(G,'Failed to peek tag: "'+V+'"');if(G.isError(h))return h;return G.restore(E),h.tag===V||h.tagStr===V||h.tagStr+"of"===V||C},J.prototype._decodeTag=function(G,V,C){var E=w(G,'Failed to decode tag of "'+V+'"');if(G.isError(E))return E;var h=k(G,E.primitive,'Failed to get length of "'+V+'"');if(G.isError(h))return h;if(!C&&E.tag!==V&&E.tagStr!==V&&E.tagStr+"of"!==V)return G.error('Failed to match tag: "'+V+'"');if(E.primitive||h!==null)return G.skip(h,'Failed to match body of: "'+V+'"');var I=G.save(),D=this._skipUntilEnd(G,'Failed to skip indefinite length body: "'+this.tag+'"');if(G.isError(D))return D;return h=G.offset-I.offset,G.restore(I),G.skip(h,'Failed to match body of: "'+V+'"')},J.prototype._skipUntilEnd=function(G,V){while(!0){var C=w(G,V);if(G.isError(C))return C;var E=k(G,C.primitive,V);if(G.isError(E))return E;var h;if(C.primitive||E!==null)h=G.skip(E);else h=this._skipUntilEnd(G,V);if(G.isError(h))return h;if(C.tagStr==="end")break}},J.prototype._decodeList=function(G,V,C,E){var h=[];while(!G.isEmpty()){var I=this._peekTag(G,"end");if(G.isError(I))return I;var D=C.decode(G,"der",E);if(G.isError(D)&&I)break;h.push(D)}return h},J.prototype._decodeStr=function(G,V){if(V==="bitstr"){var C=G.readUInt8();if(G.isError(C))return C;return{unused:C,data:G.raw()}}else if(V==="bmpstr"){var E=G.raw();if(E.length%2===1)return G.error("Decoding of string type: bmpstr length mismatch");var h="";for(var I=0;I<E.length/2;I++)h+=String.fromCharCode(E.readUInt16BE(I*2));return h}else if(V==="numstr"){var D=G.raw().toString("ascii");if(!this._isNumstr(D))return G.error("Decoding of string type: numstr unsupported characters");return D}else if(V==="octstr")return G.raw();else if(V==="objDesc")return G.raw();else if(V==="printstr"){var g=G.raw().toString("ascii");if(!this._isPrintstr(g))return G.error("Decoding of string type: printstr unsupported characters");return g}else if(/str$/.test(V))return G.raw().toString();else return G.error("Decoding of string type: "+V+" unsupported")},J.prototype._decodeObjid=function(G,V,C){var E,h=[],I=0;while(!G.isEmpty()){var D=G.readUInt8();if(I<<=7,I|=D&127,(D&128)===0)h.push(I),I=0}if(D&128)h.push(I);var g=h[0]/40|0,u=h[0]%40;if(C)E=h;else E=[g,u].concat(h.slice(1));if(V){var y=V[E.join(" ")];if(y===void 0)y=V[E.join(".")];if(y!==void 0)E=y}return E},J.prototype._decodeTime=function(G,V){var C=G.raw().toString();if(V==="gentime")var E=C.slice(0,4)|0,h=C.slice(4,6)|0,I=C.slice(6,8)|0,D=C.slice(8,10)|0,g=C.slice(10,12)|0,u=C.slice(12,14)|0;else if(V==="utctime"){var E=C.slice(0,2)|0,h=C.slice(2,4)|0,I=C.slice(4,6)|0,D=C.slice(6,8)|0,g=C.slice(8,10)|0,u=C.slice(10,12)|0;if(E<70)E=2000+E;else E=1900+E}else return G.error("Decoding "+V+" time is not supported yet");return Date.UTC(E,h-1,I,D,g,u,0)},J.prototype._decodeNull=function(G){return null},J.prototype._decodeBool=function(G){var V=G.readUInt8();if(G.isError(V))return V;else return V!==0},J.prototype._decodeInt=function(G,V){var C=G.raw(),E=new O(C);if(V)E=V[E.toString(10)]||E;return E},J.prototype._use=function(G,V){if(typeof G==="function")G=G(V);return G._getDecoder("der").tree};function w(X,G){var V=X.readUInt8(G);if(X.isError(V))return V;var C=j.tagClass[V>>6],E=(V&32)===0;if((V&31)===31){var h=V;V=0;while((h&128)===128){if(h=X.readUInt8(G),X.isError(h))return h;V<<=7,V|=h&127}}else V&=31;var I=j.tag[V];return{cls:C,primitive:E,tag:V,tagStr:I}}function k(X,G,V){var C=X.readUInt8(V);if(X.isError(C))return C;if(!G&&C===128)return null;if((C&128)===0)return C;var E=C&127;if(E>4)return X.error("length octect is too long");C=0;for(var h=0;h<E;h++){C<<=8;var I=X.readUInt8(V);if(X.isError(I))return I;C|=I}return C}}),qr=l$(($,q)=>{var K=_8(),P=(vq(),W6(Yq)).Buffer,_=nS();function O(j){_.call(this,j),this.enc="pem"}K(O,_),q.exports=O,O.prototype.decode=function(z,J){var w=z.toString().split(/[\r\n]+/g),k=J.label.toUpperCase(),X=/^-----(BEGIN|END) ([^-]+)-----$/,G=-1,V=-1;for(var C=0;C<w.length;C++){var E=w[C].match(X);if(E===null)continue;if(E[2]!==k)continue;if(G===-1){if(E[1]!=="BEGIN")break;G=C}else{if(E[1]!=="END")break;V=C;break}}if(G===-1||V===-1)throw Error("PEM section not found for: "+k);var h=w.slice(G+1,V).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var I=new P(h,"base64");return _.prototype.decode.call(this,I,J)}}),Kr=l$(($)=>{var q=$;q.der=nS(),q.pem=qr()}),iS=l$(($,q)=>{var K=_8(),P=(vq(),W6(Yq)).Buffer,_=p7(),O=_.base,j=_.constants.der;function z(X){this.enc="der",this.name=X.name,this.entity=X,this.tree=new J,this.tree._init(X.body)}q.exports=z,z.prototype.encode=function(G,V){return this.tree._encode(G,V).join()};function J(X){O.Node.call(this,"der",X)}K(J,O.Node),J.prototype._encodeComposite=function(G,V,C,E){var h=k(G,V,C,this.reporter);if(E.length<128){var g=new P(2);return g[0]=h,g[1]=E.length,this._createEncoderBuffer([g,E])}var I=1;for(var D=E.length;D>=256;D>>=8)I++;var g=new P(2+I);g[0]=h,g[1]=128|I;for(var D=1+I,u=E.length;u>0;D--,u>>=8)g[D]=u&255;return this._createEncoderBuffer([g,E])},J.prototype._encodeStr=function(G,V){if(V==="bitstr")return this._createEncoderBuffer([G.unused|0,G.data]);else if(V==="bmpstr"){var C=new P(G.length*2);for(var E=0;E<G.length;E++)C.writeUInt16BE(G.charCodeAt(E),E*2);return this._createEncoderBuffer(C)}else if(V==="numstr"){if(!this._isNumstr(G))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(G)}else if(V==="printstr"){if(!this._isPrintstr(G))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(G)}else if(/str$/.test(V))return this._createEncoderBuffer(G);else if(V==="objDesc")return this._createEncoderBuffer(G);else return this.reporter.error("Encoding of string type: "+V+" unsupported")},J.prototype._encodeObjid=function(G,V,C){if(typeof G==="string"){if(!V)return this.reporter.error("string objid given, but no values map found");if(!V.hasOwnProperty(G))return this.reporter.error("objid not found in values map");G=V[G].split(/[\s\.]+/g);for(var E=0;E<G.length;E++)G[E]|=0}else if(Array.isArray(G)){G=G.slice();for(var E=0;E<G.length;E++)G[E]|=0}if(!Array.isArray(G))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(G));if(!C){if(G[1]>=40)return this.reporter.error("Second objid identifier OOB");G.splice(0,2,G[0]*40+G[1])}var h=0;for(var E=0;E<G.length;E++){var I=G[E];for(h++;I>=128;I>>=7)h++}var D=new P(h),g=D.length-1;for(var E=G.length-1;E>=0;E--){var I=G[E];D[g--]=I&127;while((I>>=7)>0)D[g--]=128|I&127}return this._createEncoderBuffer(D)};function w(X){if(X<10)return"0"+X;else return X}J.prototype._encodeTime=function(G,V){var C,E=new Date(G);if(V==="gentime")C=[w(E.getFullYear()),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else if(V==="utctime")C=[w(E.getFullYear()%100),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+V+" time is not supported yet");return this._encodeStr(C,"octstr")},J.prototype._encodeNull=function(){return this._createEncoderBuffer("")},J.prototype._encodeInt=function(G,V){if(typeof G==="string"){if(!V)return this.reporter.error("String int or enum given, but no values map");if(!V.hasOwnProperty(G))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(G));G=V[G]}if(typeof G!=="number"&&!P.isBuffer(G)){var C=G.toArray();if(!G.sign&&C[0]&128)C.unshift(0);G=new P(C)}if(P.isBuffer(G)){var E=G.length;if(G.length===0)E++;var I=new P(E);if(G.copy(I),G.length===0)I[0]=0;return this._createEncoderBuffer(I)}if(G<128)return this._createEncoderBuffer(G);if(G<256)return this._createEncoderBuffer([0,G]);var E=1;for(var h=G;h>=256;h>>=8)E++;var I=Array(E);for(var h=I.length-1;h>=0;h--)I[h]=G&255,G>>=8;if(I[0]&128)I.unshift(0);return this._createEncoderBuffer(new P(I))},J.prototype._encodeBool=function(G){return this._createEncoderBuffer(G?255:0)},J.prototype._use=function(G,V){if(typeof G==="function")G=G(V);return G._getEncoder("der").tree},J.prototype._skipDefault=function(G,V,C){var E=this._baseState,h;if(E.default===null)return!1;var I=G.join();if(E.defaultBuffer===void 0)E.defaultBuffer=this._encodeValue(E.default,V,C).join();if(I.length!==E.defaultBuffer.length)return!1;for(h=0;h<I.length;h++)if(I[h]!==E.defaultBuffer[h])return!1;return!0};function k(X,G,V,C){var E;if(X==="seqof")X="seq";else if(X==="setof")X="set";if(j.tagByName.hasOwnProperty(X))E=j.tagByName[X];else if(typeof X==="number"&&(X|0)===X)E=X;else return C.error("Unknown tag: "+X);if(E>=31)return C.error("Multi-octet tag encoding unsupported");if(!G)E|=32;return E|=j.tagClassByName[V||"universal"]<<6,E}}),_r=l$(($,q)=>{var K=_8(),P=iS();function _(O){P.call(this,O),this.enc="pem"}K(_,P),q.exports=_,_.prototype.encode=function(j,z){var J=P.prototype.encode.call(this,j),w=J.toString("base64"),k=["-----BEGIN "+z.label+"-----"];for(var X=0;X<w.length;X+=64)k.push(w.slice(X,X+64));return k.push("-----END "+z.label+"-----"),k.join(`
37
- `)}}),Pr=l$(($)=>{var q=$;q.der=iS(),q.pem=_r()}),p7=l$(($)=>{var q=$;q.bignum=al(),q.define=Ql().define,q.base=x7(),q.constants=oS(),q.decoders=Kr(),q.encoders=Pr()}),jr=l$(($,q)=>{var K=p7(),P=K.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),_=K.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),O=K.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),j=K.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(O),this.key("subjectPublicKey").bitstr())}),z=K.define("RelativeDistinguishedName",function(){this.setof(_)}),J=K.define("RDNSequence",function(){this.seqof(z)}),w=K.define("Name",function(){this.choice({rdnSequence:this.use(J)})}),k=K.define("Validity",function(){this.seq().obj(this.key("notBefore").use(P),this.key("notAfter").use(P))}),X=K.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),G=K.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(O),this.key("issuer").use(w),this.key("validity").use(k),this.key("subject").use(w),this.key("subjectPublicKeyInfo").use(j),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(X).optional())}),V=K.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(G),this.key("signatureAlgorithm").use(O),this.key("signatureValue").bitstr())});q.exports=V}),Or=l$(($)=>{var q=p7();$.certificate=jr();var K=q.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$.RSAPrivateKey=K;var P=q.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=P;var _=q.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),O=q.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(_),this.key("subjectPublicKey").bitstr())});$.PublicKey=O;var j=q.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(_),this.key("subjectPrivateKey").octstr())});$.PrivateKey=j;var z=q.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$.EncryptedPrivateKey=z;var J=q.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$.DSAPrivateKey=J,$.DSAparam=q.define("DSAparam",function(){this.int()});var w=q.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),k=q.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(w),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=k,$.signature=q.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),Yr=l$(($,q)=>{q.exports={"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"}}),vr=l$(($,q)=>{var K=aq().Buffer,P=PH().Transform,_=_8();function O(w){P.call(this),this._block=K.allocUnsafe(w),this._blockSize=w,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}_(O,P),O.prototype._transform=function(w,k,X){var G=null;try{this.update(w,k)}catch(V){G=V}X(G)},O.prototype._flush=function(w){var k=null;try{this.push(this.digest())}catch(X){k=X}w(k)};var j=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(K.prototype instanceof Uint8Array||K.TYPED_ARRAY_SUPPORT);function J(w,k){if(w instanceof K)return w;if(typeof w==="string")return K.from(w,k);if(z&&ArrayBuffer.isView(w)){if(w.byteLength===0)return K.alloc(0);var X=K.from(w.buffer,w.byteOffset,w.byteLength);if(X.byteLength===w.byteLength)return X}if(j&&w instanceof Uint8Array)return K.from(w);if(K.isBuffer(w)&&w.constructor&&typeof w.constructor.isBuffer==="function"&&w.constructor.isBuffer(w))return K.from(w);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}O.prototype.update=function(w,k){if(this._finalized)throw Error("Digest already called");w=J(w,k);var X=this._block,G=0;while(this._blockOffset+w.length-G>=this._blockSize){for(var V=this._blockOffset;V<this._blockSize;)X[V++]=w[G++];this._update(),this._blockOffset=0}while(G<w.length)X[this._blockOffset++]=w[G++];for(var C=0,E=w.length*8;E>0;++C)if(this._length[C]+=E,E=this._length[C]/4294967296|0,E>0)this._length[C]-=4294967296*E;return this},O.prototype._update=function(){throw Error("_update is not implemented")},O.prototype.digest=function(w){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var k=this._digest();if(w!==void 0)k=k.toString(w);this._block.fill(0),this._blockOffset=0;for(var X=0;X<4;++X)this._length[X]=0;return k},O.prototype._digest=function(){throw Error("_digest is not implemented")},q.exports=O}),zr=l$(($,q)=>{var K=_8(),P=vr(),_=aq().Buffer,O=Array(16);function j(){P.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}K(j,P),j.prototype._update=function(){var G=O;for(var V=0;V<16;++V)G[V]=this._block.readInt32LE(V*4);var C=this._a,E=this._b,h=this._c,I=this._d;C=J(C,E,h,I,G[0],3614090360,7),I=J(I,C,E,h,G[1],3905402710,12),h=J(h,I,C,E,G[2],606105819,17),E=J(E,h,I,C,G[3],3250441966,22),C=J(C,E,h,I,G[4],4118548399,7),I=J(I,C,E,h,G[5],1200080426,12),h=J(h,I,C,E,G[6],2821735955,17),E=J(E,h,I,C,G[7],4249261313,22),C=J(C,E,h,I,G[8],1770035416,7),I=J(I,C,E,h,G[9],2336552879,12),h=J(h,I,C,E,G[10],4294925233,17),E=J(E,h,I,C,G[11],2304563134,22),C=J(C,E,h,I,G[12],1804603682,7),I=J(I,C,E,h,G[13],4254626195,12),h=J(h,I,C,E,G[14],2792965006,17),E=J(E,h,I,C,G[15],1236535329,22),C=w(C,E,h,I,G[1],4129170786,5),I=w(I,C,E,h,G[6],3225465664,9),h=w(h,I,C,E,G[11],643717713,14),E=w(E,h,I,C,G[0],3921069994,20),C=w(C,E,h,I,G[5],3593408605,5),I=w(I,C,E,h,G[10],38016083,9),h=w(h,I,C,E,G[15],3634488961,14),E=w(E,h,I,C,G[4],3889429448,20),C=w(C,E,h,I,G[9],568446438,5),I=w(I,C,E,h,G[14],3275163606,9),h=w(h,I,C,E,G[3],4107603335,14),E=w(E,h,I,C,G[8],1163531501,20),C=w(C,E,h,I,G[13],2850285829,5),I=w(I,C,E,h,G[2],4243563512,9),h=w(h,I,C,E,G[7],1735328473,14),E=w(E,h,I,C,G[12],2368359562,20),C=k(C,E,h,I,G[5],4294588738,4),I=k(I,C,E,h,G[8],2272392833,11),h=k(h,I,C,E,G[11],1839030562,16),E=k(E,h,I,C,G[14],4259657740,23),C=k(C,E,h,I,G[1],2763975236,4),I=k(I,C,E,h,G[4],1272893353,11),h=k(h,I,C,E,G[7],4139469664,16),E=k(E,h,I,C,G[10],3200236656,23),C=k(C,E,h,I,G[13],681279174,4),I=k(I,C,E,h,G[0],3936430074,11),h=k(h,I,C,E,G[3],3572445317,16),E=k(E,h,I,C,G[6],76029189,23),C=k(C,E,h,I,G[9],3654602809,4),I=k(I,C,E,h,G[12],3873151461,11),h=k(h,I,C,E,G[15],530742520,16),E=k(E,h,I,C,G[2],3299628645,23),C=X(C,E,h,I,G[0],4096336452,6),I=X(I,C,E,h,G[7],1126891415,10),h=X(h,I,C,E,G[14],2878612391,15),E=X(E,h,I,C,G[5],4237533241,21),C=X(C,E,h,I,G[12],1700485571,6),I=X(I,C,E,h,G[3],2399980690,10),h=X(h,I,C,E,G[10],4293915773,15),E=X(E,h,I,C,G[1],2240044497,21),C=X(C,E,h,I,G[8],1873313359,6),I=X(I,C,E,h,G[15],4264355552,10),h=X(h,I,C,E,G[6],2734768916,15),E=X(E,h,I,C,G[13],1309151649,21),C=X(C,E,h,I,G[4],4149444226,6),I=X(I,C,E,h,G[11],3174756917,10),h=X(h,I,C,E,G[2],718787259,15),E=X(E,h,I,C,G[9],3951481745,21),this._a=this._a+C|0,this._b=this._b+E|0,this._c=this._c+h|0,this._d=this._d+I|0},j.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var G=_.allocUnsafe(16);return G.writeInt32LE(this._a,0),G.writeInt32LE(this._b,4),G.writeInt32LE(this._c,8),G.writeInt32LE(this._d,12),G};function z(G,V){return G<<V|G>>>32-V}function J(G,V,C,E,h,I,D){return z(G+(V&C|~V&E)+h+I|0,D)+V|0}function w(G,V,C,E,h,I,D){return z(G+(V&E|C&~E)+h+I|0,D)+V|0}function k(G,V,C,E,h,I,D){return z(G+(V^C^E)+h+I|0,D)+V|0}function X(G,V,C,E,h,I,D){return z(G+(C^(V|~E))+h+I|0,D)+V|0}q.exports=j}),Wr=l$(($,q)=>{var K=aq().Buffer,P=zr();function _(O,j,z,J){if(!K.isBuffer(O))O=K.from(O,"binary");if(j){if(!K.isBuffer(j))j=K.from(j,"binary");if(j.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var w=z/8,k=K.alloc(w),X=K.alloc(J||0),G=K.alloc(0);while(w>0||J>0){var V=new P;if(V.update(G),V.update(O),j)V.update(j);G=V.digest();var C=0;if(w>0){var E=k.length-w;C=Math.min(w,G.length),G.copy(k,E,0,C),w-=C}if(C<G.length&&J>0){var h=X.length-J,I=Math.min(J,G.length-C);G.copy(X,h,C,C+I),J-=I}}return G.fill(0),{key:k,iv:X}}q.exports=_}),BS=l$(($)=>{var q=(dq(),W6(mq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Hr=l$(($,q)=>{var K=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,P=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,_=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,O=Wr(),j=BS(),z=aq().Buffer;q.exports=function(J,w){var k=J.toString(),X=k.match(K),G;if(!X){var V=k.match(_);G=z.from(V[2].replace(/[\r\n]/g,""),"base64")}else{var C="aes"+X[1],E=z.from(X[2],"hex"),h=z.from(X[3].replace(/[\r\n]/g,""),"base64"),I=O(w,E.slice(0,8),parseInt(X[1],10)).key,D=[],g=j.createDecipheriv(C,I,E);D.push(g.update(h)),D.push(g.final()),G=z.concat(D)}var u=k.match(P)[1];return{tag:u,data:G}}}),tS=l$(($,q)=>{var K=Or(),P=Yr(),_=Hr(),O=BS(),j=xS(),z=aq().Buffer;function J(k,X){var G=k.algorithm.decrypt.kde.kdeparams.salt,V=parseInt(k.algorithm.decrypt.kde.kdeparams.iters.toString(),10),C=P[k.algorithm.decrypt.cipher.algo.join(".")],E=k.algorithm.decrypt.cipher.iv,h=k.subjectPrivateKey,I=parseInt(C.split("-")[1],10)/8,D=j.pbkdf2Sync(X,G,V,I,"sha1"),g=O.createDecipheriv(C,D,E),u=[];return u.push(g.update(h)),u.push(g.final()),z.concat(u)}function w(k){var X;if(typeof k==="object"&&!z.isBuffer(k))X=k.passphrase,k=k.key;if(typeof k==="string")k=z.from(k);var G=_(k,X),V=G.tag,C=G.data,E,h;switch(V){case"CERTIFICATE":h=K.certificate.decode(C,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!h)h=K.PublicKey.decode(C,"der");switch(E=h.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=K.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":C=K.EncryptedPrivateKey.decode(C,"der"),C=J(C,X);case"PRIVATE KEY":switch(h=K.PrivateKey.decode(C,"der"),E=h.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:K.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=K.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw Error("unknown key id "+E)}case"RSA PUBLIC KEY":return K.RSAPublicKey.decode(C,"der");case"RSA PRIVATE KEY":return K.RSAPrivateKey.decode(C,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:K.DSAPrivateKey.decode(C,"der")};case"EC PRIVATE KEY":return C=K.ECPrivateKey.decode(C,"der"),{curve:C.parameters.value,privateKey:C.privateKey};default:throw Error("unknown key type "+V)}}w.signature=K.signature,q.exports=w}),US=l$(($,q)=>{var K=Bj(),P=aq().Buffer;q.exports=function(O,j){var z=P.alloc(0),J=0,w;while(z.length<j)w=_(J++),z=P.concat([z,K("sha1").update(O).update(w).digest()]);return z.slice(0,j)};function _(O){var j=P.allocUnsafe(4);return j.writeUInt32BE(O,0),j}}),FS=l$(($,q)=>{q.exports=function(P,_){var O=P.length,j=-1;while(++j<O)P[j]^=_[j];return P}}),HH=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,a=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,Q=W[4]|0,r=Q&8191,t=Q>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,e=W[6]|0,F=e&8191,_$=e>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(a,k$)|0,A=Math.imul(a,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(a,D$)|0,A=A+Math.imul(a,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(a,C$)|0,A=A+Math.imul(a,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(a,h$)|0,A=A+Math.imul(a,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(a,b$)|0,A=A+Math.imul(a,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(F,k$),v=Math.imul(F,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(a,x)|0,A=A+Math.imul(a,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(F,D$)|0,v=v+Math.imul(F,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(a,K$)|0,A=A+Math.imul(a,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(F,C$)|0,v=v+Math.imul(F,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(a,Z$)|0,A=A+Math.imul(a,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(F,h$)|0,v=v+Math.imul(F,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(a,g$)|0,A=A+Math.imul(a,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(F,b$)|0,v=v+Math.imul(F,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(a,M$)|0,A=A+Math.imul(a,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(F,x)|0,v=v+Math.imul(F,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(F,K$)|0,v=v+Math.imul(F,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(F,Z$)|0,v=v+Math.imul(F,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(F,g$)|0,v=v+Math.imul(F,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(F,M$)|0,v=v+Math.imul(F,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],a=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=a+n,T[L+d+N]=i-W$,W[L+d+N]=a-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new l(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function m(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(s,y);function U(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(U,y),U.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new m;else if(Y==="p192")H=new s;else if(Y==="p25519")H=new U;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function l(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}l.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},l.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},l.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},l.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},l.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},l.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},l.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},l.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},l.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},l.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},l.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},l.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},l.prototype.sqr=function(Y){return this.mul(Y,Y)},l.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var a=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(a),A=a.redSqr(),R=R.redMul(A),b=i}return L},l.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},l.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},l.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},l.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(l.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,l),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),aS=l$(($,q)=>{var K=HH(),P=aq().Buffer;function _(O,j){return P.from(O.toRed(K.mont(j.modulus)).redPow(new K(j.publicExponent)).fromRed().toArray())}q.exports=_}),Jr=l$(($,q)=>{(function(K,P){function _(T,W){if(!T)throw Error(W||"Assertion failed")}function O(T,W){T.super_=W;var Z=function(){};Z.prototype=W.prototype,T.prototype=new Z,T.prototype.constructor=T}function j(T,W,Z){if(j.isBN(T))return T;if(this.negative=0,this.words=null,this.length=0,this.red=null,T!==null){if(W==="le"||W==="be")Z=W,W=10;this._init(T||0,W||10,Z||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(T){}j.isBN=function(W){if(W instanceof j)return!0;return W!==null&&typeof W==="object"&&W.constructor.wordSize===j.wordSize&&Array.isArray(W.words)},j.max=function(W,Z){if(W.cmp(Z)>0)return W;return Z},j.min=function(W,Z){if(W.cmp(Z)<0)return W;return Z},j.prototype._init=function(W,Z,S){if(typeof W==="number")return this._initNumber(W,Z,S);if(typeof W==="object")return this._initArray(W,Z,S);if(Z==="hex")Z=16;_(Z===(Z|0)&&Z>=2&&Z<=36),W=W.toString().replace(/\s+/g,"");var N=0;if(W[0]==="-")N++,this.negative=1;if(N<W.length){if(Z===16)this._parseHex(W,N,S);else if(this._parseBase(W,Z,N),S==="le")this._initArray(this.toArray(),Z,S)}},j.prototype._initNumber=function(W,Z,S){if(W<0)this.negative=1,W=-W;if(W<67108864)this.words=[W&67108863],this.length=1;else if(W<4503599627370496)this.words=[W&67108863,W/67108864&67108863],this.length=2;else _(W<9007199254740992),this.words=[W&67108863,W/67108864&67108863,1],this.length=3;if(S!=="le")return;this._initArray(this.toArray(),Z,S)},j.prototype._initArray=function(W,Z,S){if(_(typeof W.length==="number"),W.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(W.length/3),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var f,v,A=0;if(S==="be"){for(N=W.length-1,f=0;N>=0;N-=3)if(v=W[N]|W[N-1]<<8|W[N-2]<<16,this.words[f]|=v<<A&67108863,this.words[f+1]=v>>>26-A&67108863,A+=24,A>=26)A-=26,f++}else if(S==="le"){for(N=0,f=0;N<W.length;N+=3)if(v=W[N]|W[N+1]<<8|W[N+2]<<16,this.words[f]|=v<<A&67108863,this.words[f+1]=v>>>26-A&67108863,A+=24,A>=26)A-=26,f++}return this._strip()};function J(T,W){var Z=T.charCodeAt(W);if(Z>=48&&Z<=57)return Z-48;else if(Z>=65&&Z<=70)return Z-55;else if(Z>=97&&Z<=102)return Z-87;else _(!1,"Invalid character in "+T)}function w(T,W,Z){var S=J(T,Z);if(Z-1>=W)S|=J(T,Z-1)<<4;return S}j.prototype._parseHex=function(W,Z,S){this.length=Math.ceil((W.length-Z)/6),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var f=0,v=0,A;if(S==="be")for(N=W.length-1;N>=Z;N-=2)if(A=w(W,Z,N)<<f,this.words[v]|=A&67108863,f>=18)f-=18,v+=1,this.words[v]|=A>>>26;else f+=8;else{var L=W.length-Z;for(N=L%2===0?Z+1:Z;N<W.length;N+=2)if(A=w(W,Z,N)<<f,this.words[v]|=A&67108863,f>=18)f-=18,v+=1,this.words[v]|=A>>>26;else f+=8}this._strip()};function k(T,W,Z,S){var N=0,f=0,v=Math.min(T.length,Z);for(var A=W;A<v;A++){var L=T.charCodeAt(A)-48;if(N*=S,L>=49)f=L-49+10;else if(L>=17)f=L-17+10;else f=L;_(L>=0&&f<S,"Invalid character"),N+=f}return N}j.prototype._parseBase=function(W,Z,S){this.words=[0],this.length=1;for(var N=0,f=1;f<=67108863;f*=Z)N++;N--,f=f/Z|0;var v=W.length-S,A=v%N,L=Math.min(v,v-A)+S,R=0;for(var b=S;b<L;b+=N)if(R=k(W,b,b+N,Z),this.imuln(f),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R);if(A!==0){var d=1;R=k(W,b,W.length,Z);for(b=0;b<A;b++)d*=Z;if(this.imuln(d),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R)}this._strip()},j.prototype.copy=function(W){W.words=Array(this.length);for(var Z=0;Z<this.length;Z++)W.words[Z]=this.words[Z];W.length=this.length,W.negative=this.negative,W.red=this.red};function X(T,W){T.words=W.words,T.length=W.length,T.negative=W.negative,T.red=W.red}if(j.prototype._move=function(W){X(W,this)},j.prototype.clone=function(){var W=new j(null);return this.copy(W),W},j.prototype._expand=function(W){while(this.length<W)this.words[this.length++]=0;return this},j.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{j.prototype[Symbol.for("nodejs.util.inspect.custom")]=G}catch(T){j.prototype.inspect=G}else j.prototype.inspect=G;function G(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var V=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(W,Z){W=W||10,Z=Z|0||1;var S;if(W===16||W==="hex"){S="";var N=0,f=0;for(var v=0;v<this.length;v++){var A=this.words[v],L=((A<<N|f)&16777215).toString(16);if(f=A>>>24-N&16777215,N+=2,N>=26)N-=26,v--;if(f!==0||v!==this.length-1)S=V[6-L.length]+L+S;else S=L+S}if(f!==0)S=f.toString(16)+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}if(W===(W|0)&&W>=2&&W<=36){var R=C[W],b=E[W];S="";var d=this.clone();d.negative=0;while(!d.isZero()){var i=d.modrn(b).toString(W);if(d=d.idivn(b),!d.isZero())S=V[R-i.length]+i+S;else S=i+S}if(this.isZero())S="0"+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var W=this.words[0];if(this.length===2)W+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)W+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-W:W},j.prototype.toJSON=function(){return this.toString(16,2)},z)j.prototype.toBuffer=function(W,Z){return this.toArrayLike(z,W,Z)};j.prototype.toArray=function(W,Z){return this.toArrayLike(Array,W,Z)};var h=function(W,Z){if(W.allocUnsafe)return W.allocUnsafe(Z);return new W(Z)};if(j.prototype.toArrayLike=function(W,Z,S){this._strip();var N=this.byteLength(),f=S||Math.max(1,N);_(N<=f,"byte array longer than desired length"),_(f>0,"Requested array length <= 0");var v=h(W,f),A=Z==="le"?"LE":"BE";return this["_toArrayLike"+A](v,N),v},j.prototype._toArrayLikeLE=function(W,Z){var S=0,N=0;for(var f=0,v=0;f<this.length;f++){var A=this.words[f]<<v|N;if(W[S++]=A&255,S<W.length)W[S++]=A>>8&255;if(S<W.length)W[S++]=A>>16&255;if(v===6){if(S<W.length)W[S++]=A>>24&255;N=0,v=0}else N=A>>>24,v+=2}if(S<W.length){W[S++]=N;while(S<W.length)W[S++]=0}},j.prototype._toArrayLikeBE=function(W,Z){var S=W.length-1,N=0;for(var f=0,v=0;f<this.length;f++){var A=this.words[f]<<v|N;if(W[S--]=A&255,S>=0)W[S--]=A>>8&255;if(S>=0)W[S--]=A>>16&255;if(v===6){if(S>=0)W[S--]=A>>24&255;N=0,v=0}else N=A>>>24,v+=2}if(S>=0){W[S--]=N;while(S>=0)W[S--]=0}},Math.clz32)j.prototype._countBits=function(W){return 32-Math.clz32(W)};else j.prototype._countBits=function(W){var Z=W,S=0;if(Z>=4096)S+=13,Z>>>=13;if(Z>=64)S+=7,Z>>>=7;if(Z>=8)S+=4,Z>>>=4;if(Z>=2)S+=2,Z>>>=2;return S+Z};j.prototype._zeroBits=function(W){if(W===0)return 26;var Z=W,S=0;if((Z&8191)===0)S+=13,Z>>>=13;if((Z&127)===0)S+=7,Z>>>=7;if((Z&15)===0)S+=4,Z>>>=4;if((Z&3)===0)S+=2,Z>>>=2;if((Z&1)===0)S++;return S},j.prototype.bitLength=function(){var W=this.words[this.length-1],Z=this._countBits(W);return(this.length-1)*26+Z};function I(T){var W=Array(T.bitLength());for(var Z=0;Z<W.length;Z++){var S=Z/26|0,N=Z%26;W[Z]=T.words[S]>>>N&1}return W}j.prototype.zeroBits=function(){if(this.isZero())return 0;var W=0;for(var Z=0;Z<this.length;Z++){var S=this._zeroBits(this.words[Z]);if(W+=S,S!==26)break}return W},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(W){if(this.negative!==0)return this.abs().inotn(W).iaddn(1);return this.clone()},j.prototype.fromTwos=function(W){if(this.testn(W-1))return this.notn(W).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(W){while(this.length<W.length)this.words[this.length++]=0;for(var Z=0;Z<W.length;Z++)this.words[Z]=this.words[Z]|W.words[Z];return this._strip()},j.prototype.ior=function(W){return _((this.negative|W.negative)===0),this.iuor(W)},j.prototype.or=function(W){if(this.length>W.length)return this.clone().ior(W);return W.clone().ior(this)},j.prototype.uor=function(W){if(this.length>W.length)return this.clone().iuor(W);return W.clone().iuor(this)},j.prototype.iuand=function(W){var Z;if(this.length>W.length)Z=W;else Z=this;for(var S=0;S<Z.length;S++)this.words[S]=this.words[S]&W.words[S];return this.length=Z.length,this._strip()},j.prototype.iand=function(W){return _((this.negative|W.negative)===0),this.iuand(W)},j.prototype.and=function(W){if(this.length>W.length)return this.clone().iand(W);return W.clone().iand(this)},j.prototype.uand=function(W){if(this.length>W.length)return this.clone().iuand(W);return W.clone().iuand(this)},j.prototype.iuxor=function(W){var Z,S;if(this.length>W.length)Z=this,S=W;else Z=W,S=this;for(var N=0;N<S.length;N++)this.words[N]=Z.words[N]^S.words[N];if(this!==Z)for(;N<Z.length;N++)this.words[N]=Z.words[N];return this.length=Z.length,this._strip()},j.prototype.ixor=function(W){return _((this.negative|W.negative)===0),this.iuxor(W)},j.prototype.xor=function(W){if(this.length>W.length)return this.clone().ixor(W);return W.clone().ixor(this)},j.prototype.uxor=function(W){if(this.length>W.length)return this.clone().iuxor(W);return W.clone().iuxor(this)},j.prototype.inotn=function(W){_(typeof W==="number"&&W>=0);var Z=Math.ceil(W/26)|0,S=W%26;if(this._expand(Z),S>0)Z--;for(var N=0;N<Z;N++)this.words[N]=~this.words[N]&67108863;if(S>0)this.words[N]=~this.words[N]&67108863>>26-S;return this._strip()},j.prototype.notn=function(W){return this.clone().inotn(W)},j.prototype.setn=function(W,Z){_(typeof W==="number"&&W>=0);var S=W/26|0,N=W%26;if(this._expand(S+1),Z)this.words[S]=this.words[S]|1<<N;else this.words[S]=this.words[S]&~(1<<N);return this._strip()},j.prototype.iadd=function(W){var Z;if(this.negative!==0&&W.negative===0)return this.negative=0,Z=this.isub(W),this.negative^=1,this._normSign();else if(this.negative===0&&W.negative!==0)return W.negative=0,Z=this.isub(W),W.negative=1,Z._normSign();var S,N;if(this.length>W.length)S=this,N=W;else S=W,N=this;var f=0;for(var v=0;v<N.length;v++)Z=(S.words[v]|0)+(N.words[v]|0)+f,this.words[v]=Z&67108863,f=Z>>>26;for(;f!==0&&v<S.length;v++)Z=(S.words[v]|0)+f,this.words[v]=Z&67108863,f=Z>>>26;if(this.length=S.length,f!==0)this.words[this.length]=f,this.length++;else if(S!==this)for(;v<S.length;v++)this.words[v]=S.words[v];return this},j.prototype.add=function(W){var Z;if(W.negative!==0&&this.negative===0)return W.negative=0,Z=this.sub(W),W.negative^=1,Z;else if(W.negative===0&&this.negative!==0)return this.negative=0,Z=W.sub(this),this.negative=1,Z;if(this.length>W.length)return this.clone().iadd(W);return W.clone().iadd(this)},j.prototype.isub=function(W){if(W.negative!==0){W.negative=0;var Z=this.iadd(W);return W.negative=1,Z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(W),this.negative=1,this._normSign();var S=this.cmp(W);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,f;if(S>0)N=this,f=W;else N=W,f=this;var v=0;for(var A=0;A<f.length;A++)Z=(N.words[A]|0)-(f.words[A]|0)+v,v=Z>>26,this.words[A]=Z&67108863;for(;v!==0&&A<N.length;A++)Z=(N.words[A]|0)+v,v=Z>>26,this.words[A]=Z&67108863;if(v===0&&A<N.length&&N!==this)for(;A<N.length;A++)this.words[A]=N.words[A];if(this.length=Math.max(this.length,A),N!==this)this.negative=1;return this._strip()},j.prototype.sub=function(W){return this.clone().isub(W)};function D(T,W,Z){Z.negative=W.negative^T.negative;var S=T.length+W.length|0;Z.length=S,S=S-1|0;var N=T.words[0]|0,f=W.words[0]|0,v=N*f,A=v&67108863,L=v/67108864|0;Z.words[0]=A;for(var R=1;R<S;R++){var b=L>>>26,d=L&67108863,i=Math.min(R,W.length-1);for(var a=Math.max(0,R-T.length+1);a<=i;a++){var W$=R-a|0;N=T.words[W$]|0,f=W.words[a]|0,v=N*f+d,b+=v/67108864|0,d=v&67108863}Z.words[R]=d|0,L=b|0}if(L!==0)Z.words[R]=L|0;else Z.length--;return Z._strip()}var g=function(W,Z,S){var N=W.words,f=Z.words,v=S.words,A=0,L,R,b,d=N[0]|0,i=d&8191,a=d>>>13,W$=N[1]|0,n=W$&8191,B=W$>>>13,y$=N[2]|0,Y$=y$&8191,v$=y$>>>13,Q=N[3]|0,r=Q&8191,t=Q>>>13,x$=N[4]|0,q$=x$&8191,$$=x$>>>13,e=N[5]|0,F=e&8191,_$=e>>>13,f$=N[6]|0,O$=f$&8191,T$=f$>>>13,O6=N[7]|0,H$=O6&8191,X$=O6>>>13,X6=N[8]|0,w$=X6&8191,G$=X6>>>13,y6=N[9]|0,k$=y6&8191,I$=y6>>>13,zq=f[0]|0,D$=zq&8191,L$=zq>>>13,Vq=f[1]|0,C$=Vq&8191,E$=Vq>>>13,Sq=f[2]|0,h$=Sq&8191,V$=Sq>>>13,Mq=f[3]|0,b$=Mq&8191,S$=Mq>>>13,Wq=f[4]|0,x=Wq&8191,c=Wq>>>13,c$=f[5]|0,K$=c$&8191,j$=c$>>>13,k6=f[6]|0,Z$=k6&8191,A$=k6>>>13,Hq=f[7]|0,g$=Hq&8191,R$=Hq>>>13,Jq=f[8]|0,M$=Jq&8191,N$=Jq>>>13,b6=f[9]|0,Y6=b6&8191,K6=b6>>>13;S.negative=W.negative^Z.negative,S.length=19,L=Math.imul(i,D$),R=Math.imul(i,L$),R=R+Math.imul(a,D$)|0,b=Math.imul(a,L$);var G6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(G6>>>26)|0,G6&=67108863,L=Math.imul(n,D$),R=Math.imul(n,L$),R=R+Math.imul(B,D$)|0,b=Math.imul(B,L$),L=L+Math.imul(i,C$)|0,R=R+Math.imul(i,E$)|0,R=R+Math.imul(a,C$)|0,b=b+Math.imul(a,E$)|0;var d6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(d6>>>26)|0,d6&=67108863,L=Math.imul(Y$,D$),R=Math.imul(Y$,L$),R=R+Math.imul(v$,D$)|0,b=Math.imul(v$,L$),L=L+Math.imul(n,C$)|0,R=R+Math.imul(n,E$)|0,R=R+Math.imul(B,C$)|0,b=b+Math.imul(B,E$)|0,L=L+Math.imul(i,h$)|0,R=R+Math.imul(i,V$)|0,R=R+Math.imul(a,h$)|0,b=b+Math.imul(a,V$)|0;var l6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(l6>>>26)|0,l6&=67108863,L=Math.imul(r,D$),R=Math.imul(r,L$),R=R+Math.imul(t,D$)|0,b=Math.imul(t,L$),L=L+Math.imul(Y$,C$)|0,R=R+Math.imul(Y$,E$)|0,R=R+Math.imul(v$,C$)|0,b=b+Math.imul(v$,E$)|0,L=L+Math.imul(n,h$)|0,R=R+Math.imul(n,V$)|0,R=R+Math.imul(B,h$)|0,b=b+Math.imul(B,V$)|0,L=L+Math.imul(i,b$)|0,R=R+Math.imul(i,S$)|0,R=R+Math.imul(a,b$)|0,b=b+Math.imul(a,S$)|0;var r6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(r6>>>26)|0,r6&=67108863,L=Math.imul(q$,D$),R=Math.imul(q$,L$),R=R+Math.imul($$,D$)|0,b=Math.imul($$,L$),L=L+Math.imul(r,C$)|0,R=R+Math.imul(r,E$)|0,R=R+Math.imul(t,C$)|0,b=b+Math.imul(t,E$)|0,L=L+Math.imul(Y$,h$)|0,R=R+Math.imul(Y$,V$)|0,R=R+Math.imul(v$,h$)|0,b=b+Math.imul(v$,V$)|0,L=L+Math.imul(n,b$)|0,R=R+Math.imul(n,S$)|0,R=R+Math.imul(B,b$)|0,b=b+Math.imul(B,S$)|0,L=L+Math.imul(i,x)|0,R=R+Math.imul(i,c)|0,R=R+Math.imul(a,x)|0,b=b+Math.imul(a,c)|0;var o6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(o6>>>26)|0,o6&=67108863,L=Math.imul(F,D$),R=Math.imul(F,L$),R=R+Math.imul(_$,D$)|0,b=Math.imul(_$,L$),L=L+Math.imul(q$,C$)|0,R=R+Math.imul(q$,E$)|0,R=R+Math.imul($$,C$)|0,b=b+Math.imul($$,E$)|0,L=L+Math.imul(r,h$)|0,R=R+Math.imul(r,V$)|0,R=R+Math.imul(t,h$)|0,b=b+Math.imul(t,V$)|0,L=L+Math.imul(Y$,b$)|0,R=R+Math.imul(Y$,S$)|0,R=R+Math.imul(v$,b$)|0,b=b+Math.imul(v$,S$)|0,L=L+Math.imul(n,x)|0,R=R+Math.imul(n,c)|0,R=R+Math.imul(B,x)|0,b=b+Math.imul(B,c)|0,L=L+Math.imul(i,K$)|0,R=R+Math.imul(i,j$)|0,R=R+Math.imul(a,K$)|0,b=b+Math.imul(a,j$)|0;var n6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(n6>>>26)|0,n6&=67108863,L=Math.imul(O$,D$),R=Math.imul(O$,L$),R=R+Math.imul(T$,D$)|0,b=Math.imul(T$,L$),L=L+Math.imul(F,C$)|0,R=R+Math.imul(F,E$)|0,R=R+Math.imul(_$,C$)|0,b=b+Math.imul(_$,E$)|0,L=L+Math.imul(q$,h$)|0,R=R+Math.imul(q$,V$)|0,R=R+Math.imul($$,h$)|0,b=b+Math.imul($$,V$)|0,L=L+Math.imul(r,b$)|0,R=R+Math.imul(r,S$)|0,R=R+Math.imul(t,b$)|0,b=b+Math.imul(t,S$)|0,L=L+Math.imul(Y$,x)|0,R=R+Math.imul(Y$,c)|0,R=R+Math.imul(v$,x)|0,b=b+Math.imul(v$,c)|0,L=L+Math.imul(n,K$)|0,R=R+Math.imul(n,j$)|0,R=R+Math.imul(B,K$)|0,b=b+Math.imul(B,j$)|0,L=L+Math.imul(i,Z$)|0,R=R+Math.imul(i,A$)|0,R=R+Math.imul(a,Z$)|0,b=b+Math.imul(a,A$)|0;var i6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(i6>>>26)|0,i6&=67108863,L=Math.imul(H$,D$),R=Math.imul(H$,L$),R=R+Math.imul(X$,D$)|0,b=Math.imul(X$,L$),L=L+Math.imul(O$,C$)|0,R=R+Math.imul(O$,E$)|0,R=R+Math.imul(T$,C$)|0,b=b+Math.imul(T$,E$)|0,L=L+Math.imul(F,h$)|0,R=R+Math.imul(F,V$)|0,R=R+Math.imul(_$,h$)|0,b=b+Math.imul(_$,V$)|0,L=L+Math.imul(q$,b$)|0,R=R+Math.imul(q$,S$)|0,R=R+Math.imul($$,b$)|0,b=b+Math.imul($$,S$)|0,L=L+Math.imul(r,x)|0,R=R+Math.imul(r,c)|0,R=R+Math.imul(t,x)|0,b=b+Math.imul(t,c)|0,L=L+Math.imul(Y$,K$)|0,R=R+Math.imul(Y$,j$)|0,R=R+Math.imul(v$,K$)|0,b=b+Math.imul(v$,j$)|0,L=L+Math.imul(n,Z$)|0,R=R+Math.imul(n,A$)|0,R=R+Math.imul(B,Z$)|0,b=b+Math.imul(B,A$)|0,L=L+Math.imul(i,g$)|0,R=R+Math.imul(i,R$)|0,R=R+Math.imul(a,g$)|0,b=b+Math.imul(a,R$)|0;var B6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(B6>>>26)|0,B6&=67108863,L=Math.imul(w$,D$),R=Math.imul(w$,L$),R=R+Math.imul(G$,D$)|0,b=Math.imul(G$,L$),L=L+Math.imul(H$,C$)|0,R=R+Math.imul(H$,E$)|0,R=R+Math.imul(X$,C$)|0,b=b+Math.imul(X$,E$)|0,L=L+Math.imul(O$,h$)|0,R=R+Math.imul(O$,V$)|0,R=R+Math.imul(T$,h$)|0,b=b+Math.imul(T$,V$)|0,L=L+Math.imul(F,b$)|0,R=R+Math.imul(F,S$)|0,R=R+Math.imul(_$,b$)|0,b=b+Math.imul(_$,S$)|0,L=L+Math.imul(q$,x)|0,R=R+Math.imul(q$,c)|0,R=R+Math.imul($$,x)|0,b=b+Math.imul($$,c)|0,L=L+Math.imul(r,K$)|0,R=R+Math.imul(r,j$)|0,R=R+Math.imul(t,K$)|0,b=b+Math.imul(t,j$)|0,L=L+Math.imul(Y$,Z$)|0,R=R+Math.imul(Y$,A$)|0,R=R+Math.imul(v$,Z$)|0,b=b+Math.imul(v$,A$)|0,L=L+Math.imul(n,g$)|0,R=R+Math.imul(n,R$)|0,R=R+Math.imul(B,g$)|0,b=b+Math.imul(B,R$)|0,L=L+Math.imul(i,M$)|0,R=R+Math.imul(i,N$)|0,R=R+Math.imul(a,M$)|0,b=b+Math.imul(a,N$)|0;var t6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(t6>>>26)|0,t6&=67108863,L=Math.imul(k$,D$),R=Math.imul(k$,L$),R=R+Math.imul(I$,D$)|0,b=Math.imul(I$,L$),L=L+Math.imul(w$,C$)|0,R=R+Math.imul(w$,E$)|0,R=R+Math.imul(G$,C$)|0,b=b+Math.imul(G$,E$)|0,L=L+Math.imul(H$,h$)|0,R=R+Math.imul(H$,V$)|0,R=R+Math.imul(X$,h$)|0,b=b+Math.imul(X$,V$)|0,L=L+Math.imul(O$,b$)|0,R=R+Math.imul(O$,S$)|0,R=R+Math.imul(T$,b$)|0,b=b+Math.imul(T$,S$)|0,L=L+Math.imul(F,x)|0,R=R+Math.imul(F,c)|0,R=R+Math.imul(_$,x)|0,b=b+Math.imul(_$,c)|0,L=L+Math.imul(q$,K$)|0,R=R+Math.imul(q$,j$)|0,R=R+Math.imul($$,K$)|0,b=b+Math.imul($$,j$)|0,L=L+Math.imul(r,Z$)|0,R=R+Math.imul(r,A$)|0,R=R+Math.imul(t,Z$)|0,b=b+Math.imul(t,A$)|0,L=L+Math.imul(Y$,g$)|0,R=R+Math.imul(Y$,R$)|0,R=R+Math.imul(v$,g$)|0,b=b+Math.imul(v$,R$)|0,L=L+Math.imul(n,M$)|0,R=R+Math.imul(n,N$)|0,R=R+Math.imul(B,M$)|0,b=b+Math.imul(B,N$)|0,L=L+Math.imul(i,Y6)|0,R=R+Math.imul(i,K6)|0,R=R+Math.imul(a,Y6)|0,b=b+Math.imul(a,K6)|0;var U6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(U6>>>26)|0,U6&=67108863,L=Math.imul(k$,C$),R=Math.imul(k$,E$),R=R+Math.imul(I$,C$)|0,b=Math.imul(I$,E$),L=L+Math.imul(w$,h$)|0,R=R+Math.imul(w$,V$)|0,R=R+Math.imul(G$,h$)|0,b=b+Math.imul(G$,V$)|0,L=L+Math.imul(H$,b$)|0,R=R+Math.imul(H$,S$)|0,R=R+Math.imul(X$,b$)|0,b=b+Math.imul(X$,S$)|0,L=L+Math.imul(O$,x)|0,R=R+Math.imul(O$,c)|0,R=R+Math.imul(T$,x)|0,b=b+Math.imul(T$,c)|0,L=L+Math.imul(F,K$)|0,R=R+Math.imul(F,j$)|0,R=R+Math.imul(_$,K$)|0,b=b+Math.imul(_$,j$)|0,L=L+Math.imul(q$,Z$)|0,R=R+Math.imul(q$,A$)|0,R=R+Math.imul($$,Z$)|0,b=b+Math.imul($$,A$)|0,L=L+Math.imul(r,g$)|0,R=R+Math.imul(r,R$)|0,R=R+Math.imul(t,g$)|0,b=b+Math.imul(t,R$)|0,L=L+Math.imul(Y$,M$)|0,R=R+Math.imul(Y$,N$)|0,R=R+Math.imul(v$,M$)|0,b=b+Math.imul(v$,N$)|0,L=L+Math.imul(n,Y6)|0,R=R+Math.imul(n,K6)|0,R=R+Math.imul(B,Y6)|0,b=b+Math.imul(B,K6)|0;var F6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(F6>>>26)|0,F6&=67108863,L=Math.imul(k$,h$),R=Math.imul(k$,V$),R=R+Math.imul(I$,h$)|0,b=Math.imul(I$,V$),L=L+Math.imul(w$,b$)|0,R=R+Math.imul(w$,S$)|0,R=R+Math.imul(G$,b$)|0,b=b+Math.imul(G$,S$)|0,L=L+Math.imul(H$,x)|0,R=R+Math.imul(H$,c)|0,R=R+Math.imul(X$,x)|0,b=b+Math.imul(X$,c)|0,L=L+Math.imul(O$,K$)|0,R=R+Math.imul(O$,j$)|0,R=R+Math.imul(T$,K$)|0,b=b+Math.imul(T$,j$)|0,L=L+Math.imul(F,Z$)|0,R=R+Math.imul(F,A$)|0,R=R+Math.imul(_$,Z$)|0,b=b+Math.imul(_$,A$)|0,L=L+Math.imul(q$,g$)|0,R=R+Math.imul(q$,R$)|0,R=R+Math.imul($$,g$)|0,b=b+Math.imul($$,R$)|0,L=L+Math.imul(r,M$)|0,R=R+Math.imul(r,N$)|0,R=R+Math.imul(t,M$)|0,b=b+Math.imul(t,N$)|0,L=L+Math.imul(Y$,Y6)|0,R=R+Math.imul(Y$,K6)|0,R=R+Math.imul(v$,Y6)|0,b=b+Math.imul(v$,K6)|0;var a6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(a6>>>26)|0,a6&=67108863,L=Math.imul(k$,b$),R=Math.imul(k$,S$),R=R+Math.imul(I$,b$)|0,b=Math.imul(I$,S$),L=L+Math.imul(w$,x)|0,R=R+Math.imul(w$,c)|0,R=R+Math.imul(G$,x)|0,b=b+Math.imul(G$,c)|0,L=L+Math.imul(H$,K$)|0,R=R+Math.imul(H$,j$)|0,R=R+Math.imul(X$,K$)|0,b=b+Math.imul(X$,j$)|0,L=L+Math.imul(O$,Z$)|0,R=R+Math.imul(O$,A$)|0,R=R+Math.imul(T$,Z$)|0,b=b+Math.imul(T$,A$)|0,L=L+Math.imul(F,g$)|0,R=R+Math.imul(F,R$)|0,R=R+Math.imul(_$,g$)|0,b=b+Math.imul(_$,R$)|0,L=L+Math.imul(q$,M$)|0,R=R+Math.imul(q$,N$)|0,R=R+Math.imul($$,M$)|0,b=b+Math.imul($$,N$)|0,L=L+Math.imul(r,Y6)|0,R=R+Math.imul(r,K6)|0,R=R+Math.imul(t,Y6)|0,b=b+Math.imul(t,K6)|0;var Q6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,L=Math.imul(k$,x),R=Math.imul(k$,c),R=R+Math.imul(I$,x)|0,b=Math.imul(I$,c),L=L+Math.imul(w$,K$)|0,R=R+Math.imul(w$,j$)|0,R=R+Math.imul(G$,K$)|0,b=b+Math.imul(G$,j$)|0,L=L+Math.imul(H$,Z$)|0,R=R+Math.imul(H$,A$)|0,R=R+Math.imul(X$,Z$)|0,b=b+Math.imul(X$,A$)|0,L=L+Math.imul(O$,g$)|0,R=R+Math.imul(O$,R$)|0,R=R+Math.imul(T$,g$)|0,b=b+Math.imul(T$,R$)|0,L=L+Math.imul(F,M$)|0,R=R+Math.imul(F,N$)|0,R=R+Math.imul(_$,M$)|0,b=b+Math.imul(_$,N$)|0,L=L+Math.imul(q$,Y6)|0,R=R+Math.imul(q$,K6)|0,R=R+Math.imul($$,Y6)|0,b=b+Math.imul($$,K6)|0;var e6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(e6>>>26)|0,e6&=67108863,L=Math.imul(k$,K$),R=Math.imul(k$,j$),R=R+Math.imul(I$,K$)|0,b=Math.imul(I$,j$),L=L+Math.imul(w$,Z$)|0,R=R+Math.imul(w$,A$)|0,R=R+Math.imul(G$,Z$)|0,b=b+Math.imul(G$,A$)|0,L=L+Math.imul(H$,g$)|0,R=R+Math.imul(H$,R$)|0,R=R+Math.imul(X$,g$)|0,b=b+Math.imul(X$,R$)|0,L=L+Math.imul(O$,M$)|0,R=R+Math.imul(O$,N$)|0,R=R+Math.imul(T$,M$)|0,b=b+Math.imul(T$,N$)|0,L=L+Math.imul(F,Y6)|0,R=R+Math.imul(F,K6)|0,R=R+Math.imul(_$,Y6)|0,b=b+Math.imul(_$,K6)|0;var s6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(s6>>>26)|0,s6&=67108863,L=Math.imul(k$,Z$),R=Math.imul(k$,A$),R=R+Math.imul(I$,Z$)|0,b=Math.imul(I$,A$),L=L+Math.imul(w$,g$)|0,R=R+Math.imul(w$,R$)|0,R=R+Math.imul(G$,g$)|0,b=b+Math.imul(G$,R$)|0,L=L+Math.imul(H$,M$)|0,R=R+Math.imul(H$,N$)|0,R=R+Math.imul(X$,M$)|0,b=b+Math.imul(X$,N$)|0,L=L+Math.imul(O$,Y6)|0,R=R+Math.imul(O$,K6)|0,R=R+Math.imul(T$,Y6)|0,b=b+Math.imul(T$,K6)|0;var $q=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+($q>>>26)|0,$q&=67108863,L=Math.imul(k$,g$),R=Math.imul(k$,R$),R=R+Math.imul(I$,g$)|0,b=Math.imul(I$,R$),L=L+Math.imul(w$,M$)|0,R=R+Math.imul(w$,N$)|0,R=R+Math.imul(G$,M$)|0,b=b+Math.imul(G$,N$)|0,L=L+Math.imul(H$,Y6)|0,R=R+Math.imul(H$,K6)|0,R=R+Math.imul(X$,Y6)|0,b=b+Math.imul(X$,K6)|0;var JO=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(JO>>>26)|0,JO&=67108863,L=Math.imul(k$,M$),R=Math.imul(k$,N$),R=R+Math.imul(I$,M$)|0,b=Math.imul(I$,N$),L=L+Math.imul(w$,Y6)|0,R=R+Math.imul(w$,K6)|0,R=R+Math.imul(G$,Y6)|0,b=b+Math.imul(G$,K6)|0;var TO=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(TO>>>26)|0,TO&=67108863,L=Math.imul(k$,Y6),R=Math.imul(k$,K6),R=R+Math.imul(I$,Y6)|0,b=Math.imul(I$,K6);var wO=(A+L|0)+((R&8191)<<13)|0;if(A=(b+(R>>>13)|0)+(wO>>>26)|0,wO&=67108863,v[0]=G6,v[1]=d6,v[2]=l6,v[3]=r6,v[4]=o6,v[5]=n6,v[6]=i6,v[7]=B6,v[8]=t6,v[9]=U6,v[10]=F6,v[11]=a6,v[12]=Q6,v[13]=e6,v[14]=s6,v[15]=$q,v[16]=JO,v[17]=TO,v[18]=wO,A!==0)v[19]=A,S.length++;return S};if(!Math.imul)g=D;function u(T,W,Z){Z.negative=W.negative^T.negative,Z.length=T.length+W.length;var S=0,N=0;for(var f=0;f<Z.length-1;f++){var v=N;N=0;var A=S&67108863,L=Math.min(f,W.length-1);for(var R=Math.max(0,f-T.length+1);R<=L;R++){var b=f-R,d=T.words[b]|0,i=W.words[R]|0,a=d*i,W$=a&67108863;v=v+(a/67108864|0)|0,W$=W$+A|0,A=W$&67108863,v=v+(W$>>>26)|0,N+=v>>>26,v&=67108863}Z.words[f]=A,S=v,v=N}if(S!==0)Z.words[f]=S;else Z.length--;return Z._strip()}function y(T,W,Z){return u(T,W,Z)}j.prototype.mulTo=function(W,Z){var S,N=this.length+W.length;if(this.length===10&&W.length===10)S=g(this,W,Z);else if(N<63)S=D(this,W,Z);else if(N<1024)S=u(this,W,Z);else S=y(this,W,Z);return S};function p(T,W){this.x=T,this.y=W}p.prototype.makeRBT=function(W){var Z=Array(W),S=j.prototype._countBits(W)-1;for(var N=0;N<W;N++)Z[N]=this.revBin(N,S,W);return Z},p.prototype.revBin=function(W,Z,S){if(W===0||W===S-1)return W;var N=0;for(var f=0;f<Z;f++)N|=(W&1)<<Z-f-1,W>>=1;return N},p.prototype.permute=function(W,Z,S,N,f,v){for(var A=0;A<v;A++)N[A]=Z[W[A]],f[A]=S[W[A]]},p.prototype.transform=function(W,Z,S,N,f,v){this.permute(v,W,Z,S,N,f);for(var A=1;A<f;A<<=1){var L=A<<1,R=Math.cos(2*Math.PI/L),b=Math.sin(2*Math.PI/L);for(var d=0;d<f;d+=L){var i=R,a=b;for(var W$=0;W$<A;W$++){var n=S[d+W$],B=N[d+W$],y$=S[d+W$+A],Y$=N[d+W$+A],v$=i*y$-a*Y$;if(Y$=i*Y$+a*y$,y$=v$,S[d+W$]=n+y$,N[d+W$]=B+Y$,S[d+W$+A]=n-y$,N[d+W$+A]=B-Y$,W$!==L)v$=R*i-b*a,a=R*a+b*i,i=v$}}}},p.prototype.guessLen13b=function(W,Z){var S=Math.max(Z,W)|1,N=S&1,f=0;for(S=S/2|0;S;S=S>>>1)f++;return 1<<f+1+N},p.prototype.conjugate=function(W,Z,S){if(S<=1)return;for(var N=0;N<S/2;N++){var f=W[N];W[N]=W[S-N-1],W[S-N-1]=f,f=Z[N],Z[N]=-Z[S-N-1],Z[S-N-1]=-f}},p.prototype.normalize13b=function(W,Z){var S=0;for(var N=0;N<Z/2;N++){var f=Math.round(W[2*N+1]/Z)*8192+Math.round(W[2*N]/Z)+S;if(W[N]=f&67108863,f<67108864)S=0;else S=f/67108864|0}return W},p.prototype.convert13b=function(W,Z,S,N){var f=0;for(var v=0;v<Z;v++)f=f+(W[v]|0),S[2*v]=f&8191,f=f>>>13,S[2*v+1]=f&8191,f=f>>>13;for(v=2*Z;v<N;++v)S[v]=0;_(f===0),_((f&-8192)===0)},p.prototype.stub=function(W){var Z=Array(W);for(var S=0;S<W;S++)Z[S]=0;return Z},p.prototype.mulp=function(W,Z,S){var N=2*this.guessLen13b(W.length,Z.length),f=this.makeRBT(N),v=this.stub(N),A=Array(N),L=Array(N),R=Array(N),b=Array(N),d=Array(N),i=Array(N),a=S.words;a.length=N,this.convert13b(W.words,W.length,A,N),this.convert13b(Z.words,Z.length,b,N),this.transform(A,v,L,R,N,f),this.transform(b,v,d,i,N,f);for(var W$=0;W$<N;W$++){var n=L[W$]*d[W$]-R[W$]*i[W$];R[W$]=L[W$]*i[W$]+R[W$]*d[W$],L[W$]=n}return this.conjugate(L,R,N),this.transform(L,R,a,v,N,f),this.conjugate(a,v,N),this.normalize13b(a,N),S.negative=W.negative^Z.negative,S.length=W.length+Z.length,S._strip()},j.prototype.mul=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),this.mulTo(W,Z)},j.prototype.mulf=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),y(this,W,Z)},j.prototype.imul=function(W){return this.clone().mulTo(W,this)},j.prototype.imuln=function(W){var Z=W<0;if(Z)W=-W;_(typeof W==="number"),_(W<67108864);var S=0;for(var N=0;N<this.length;N++){var f=(this.words[N]|0)*W,v=(f&67108863)+(S&67108863);S>>=26,S+=f/67108864|0,S+=v>>>26,this.words[N]=v&67108863}if(S!==0)this.words[N]=S,this.length++;return this.length=W===0?1:this.length,Z?this.ineg():this},j.prototype.muln=function(W){return this.clone().imuln(W)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(W){var Z=I(W);if(Z.length===0)return new j(1);var S=this;for(var N=0;N<Z.length;N++,S=S.sqr())if(Z[N]!==0)break;if(++N<Z.length)for(var f=S.sqr();N<Z.length;N++,f=f.sqr()){if(Z[N]===0)continue;S=S.mul(f)}return S},j.prototype.iushln=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=67108863>>>26-Z<<26-Z,f;if(Z!==0){var v=0;for(f=0;f<this.length;f++){var A=this.words[f]&N,L=(this.words[f]|0)-A<<Z;this.words[f]=L|v,v=A>>>26-Z}if(v)this.words[f]=v,this.length++}if(S!==0){for(f=this.length-1;f>=0;f--)this.words[f+S]=this.words[f];for(f=0;f<S;f++)this.words[f]=0;this.length+=S}return this._strip()},j.prototype.ishln=function(W){return _(this.negative===0),this.iushln(W)},j.prototype.iushrn=function(W,Z,S){_(typeof W==="number"&&W>=0);var N;if(Z)N=(Z-Z%26)/26;else N=0;var f=W%26,v=Math.min((W-f)/26,this.length),A=67108863^67108863>>>f<<f,L=S;if(N-=v,N=Math.max(0,N),L){for(var R=0;R<v;R++)L.words[R]=this.words[R];L.length=v}if(v===0);else if(this.length>v){this.length-=v;for(R=0;R<this.length;R++)this.words[R]=this.words[R+v]}else this.words[0]=0,this.length=1;var b=0;for(R=this.length-1;R>=0&&(b!==0||R>=N);R--){var d=this.words[R]|0;this.words[R]=b<<26-f|d>>>f,b=d&A}if(L&&b!==0)L.words[L.length++]=b;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},j.prototype.ishrn=function(W,Z,S){return _(this.negative===0),this.iushrn(W,Z,S)},j.prototype.shln=function(W){return this.clone().ishln(W)},j.prototype.ushln=function(W){return this.clone().iushln(W)},j.prototype.shrn=function(W){return this.clone().ishrn(W)},j.prototype.ushrn=function(W){return this.clone().iushrn(W)},j.prototype.testn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return!1;var f=this.words[S];return!!(f&N)},j.prototype.imaskn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(Z!==0)S++;if(this.length=Math.min(S,this.length),Z!==0){var N=67108863^67108863>>>Z<<Z;this.words[this.length-1]&=N}return this._strip()},j.prototype.maskn=function(W){return this.clone().imaskn(W)},j.prototype.iaddn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.isubn(-W);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=W)return this.words[0]=W-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(W),this.negative=1,this}return this._iaddn(W)},j.prototype._iaddn=function(W){this.words[0]+=W;for(var Z=0;Z<this.length&&this.words[Z]>=67108864;Z++)if(this.words[Z]-=67108864,Z===this.length-1)this.words[Z+1]=1;else this.words[Z+1]++;return this.length=Math.max(this.length,Z+1),this},j.prototype.isubn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.iaddn(-W);if(this.negative!==0)return this.negative=0,this.iaddn(W),this.negative=1,this;if(this.words[0]-=W,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Z=0;Z<this.length&&this.words[Z]<0;Z++)this.words[Z]+=67108864,this.words[Z+1]-=1;return this._strip()},j.prototype.addn=function(W){return this.clone().iaddn(W)},j.prototype.subn=function(W){return this.clone().isubn(W)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(W,Z,S){var N=W.length+S,f;this._expand(N);var v,A=0;for(f=0;f<W.length;f++){v=(this.words[f+S]|0)+A;var L=(W.words[f]|0)*Z;v-=L&67108863,A=(v>>26)-(L/67108864|0),this.words[f+S]=v&67108863}for(;f<this.length-S;f++)v=(this.words[f+S]|0)+A,A=v>>26,this.words[f+S]=v&67108863;if(A===0)return this._strip();_(A===-1),A=0;for(f=0;f<this.length;f++)v=-(this.words[f]|0)+A,A=v>>26,this.words[f]=v&67108863;return this.negative=1,this._strip()},j.prototype._wordDiv=function(W,Z){var S=this.length-W.length,N=this.clone(),f=W,v=f.words[f.length-1]|0,A=this._countBits(v);if(S=26-A,S!==0)f=f.ushln(S),N.iushln(S),v=f.words[f.length-1]|0;var L=N.length-f.length,R;if(Z!=="mod"){R=new j(null),R.length=L+1,R.words=Array(R.length);for(var b=0;b<R.length;b++)R.words[b]=0}var d=N.clone()._ishlnsubmul(f,1,L);if(d.negative===0){if(N=d,R)R.words[L]=1}for(var i=L-1;i>=0;i--){var a=(N.words[f.length+i]|0)*67108864+(N.words[f.length+i-1]|0);a=Math.min(a/v|0,67108863),N._ishlnsubmul(f,a,i);while(N.negative!==0)if(a--,N.negative=0,N._ishlnsubmul(f,1,i),!N.isZero())N.negative^=1;if(R)R.words[i]=a}if(R)R._strip();if(N._strip(),Z!=="div"&&S!==0)N.iushrn(S);return{div:R||null,mod:N}},j.prototype.divmod=function(W,Z,S){if(_(!W.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var N,f,v;if(this.negative!==0&&W.negative===0){if(v=this.neg().divmod(W,Z),Z!=="mod")N=v.div.neg();if(Z!=="div"){if(f=v.mod.neg(),S&&f.negative!==0)f.iadd(W)}return{div:N,mod:f}}if(this.negative===0&&W.negative!==0){if(v=this.divmod(W.neg(),Z),Z!=="mod")N=v.div.neg();return{div:N,mod:v.mod}}if((this.negative&W.negative)!==0){if(v=this.neg().divmod(W.neg(),Z),Z!=="div"){if(f=v.mod.neg(),S&&f.negative!==0)f.isub(W)}return{div:v.div,mod:f}}if(W.length>this.length||this.cmp(W)<0)return{div:new j(0),mod:this};if(W.length===1){if(Z==="div")return{div:this.divn(W.words[0]),mod:null};if(Z==="mod")return{div:null,mod:new j(this.modrn(W.words[0]))};return{div:this.divn(W.words[0]),mod:new j(this.modrn(W.words[0]))}}return this._wordDiv(W,Z)},j.prototype.div=function(W){return this.divmod(W,"div",!1).div},j.prototype.mod=function(W){return this.divmod(W,"mod",!1).mod},j.prototype.umod=function(W){return this.divmod(W,"mod",!0).mod},j.prototype.divRound=function(W){var Z=this.divmod(W);if(Z.mod.isZero())return Z.div;var S=Z.div.negative!==0?Z.mod.isub(W):Z.mod,N=W.ushrn(1),f=W.andln(1),v=S.cmp(N);if(v<0||f===1&&v===0)return Z.div;return Z.div.negative!==0?Z.div.isubn(1):Z.div.iaddn(1)},j.prototype.modrn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=67108864%W,N=0;for(var f=this.length-1;f>=0;f--)N=(S*N+(this.words[f]|0))%W;return Z?-N:N},j.prototype.modn=function(W){return this.modrn(W)},j.prototype.idivn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=0;for(var N=this.length-1;N>=0;N--){var f=(this.words[N]|0)+S*67108864;this.words[N]=f/W|0,S=f%W}return this._strip(),Z?this.ineg():this},j.prototype.divn=function(W){return this.clone().idivn(W)},j.prototype.egcd=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),f=new j(0),v=new j(0),A=new j(1),L=0;while(Z.isEven()&&S.isEven())Z.iushrn(1),S.iushrn(1),++L;var R=S.clone(),b=Z.clone();while(!Z.isZero()){for(var d=0,i=1;(Z.words[0]&i)===0&&d<26;++d,i<<=1);if(d>0){Z.iushrn(d);while(d-- >0){if(N.isOdd()||f.isOdd())N.iadd(R),f.isub(b);N.iushrn(1),f.iushrn(1)}}for(var a=0,W$=1;(S.words[0]&W$)===0&&a<26;++a,W$<<=1);if(a>0){S.iushrn(a);while(a-- >0){if(v.isOdd()||A.isOdd())v.iadd(R),A.isub(b);v.iushrn(1),A.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(v),f.isub(A);else S.isub(Z),v.isub(N),A.isub(f)}return{a:v,b:A,gcd:S.iushln(L)}},j.prototype._invmp=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),f=new j(0),v=S.clone();while(Z.cmpn(1)>0&&S.cmpn(1)>0){for(var A=0,L=1;(Z.words[0]&L)===0&&A<26;++A,L<<=1);if(A>0){Z.iushrn(A);while(A-- >0){if(N.isOdd())N.iadd(v);N.iushrn(1)}}for(var R=0,b=1;(S.words[0]&b)===0&&R<26;++R,b<<=1);if(R>0){S.iushrn(R);while(R-- >0){if(f.isOdd())f.iadd(v);f.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(f);else S.isub(Z),f.isub(N)}var d;if(Z.cmpn(1)===0)d=N;else d=f;if(d.cmpn(0)<0)d.iadd(W);return d},j.prototype.gcd=function(W){if(this.isZero())return W.abs();if(W.isZero())return this.abs();var Z=this.clone(),S=W.clone();Z.negative=0,S.negative=0;for(var N=0;Z.isEven()&&S.isEven();N++)Z.iushrn(1),S.iushrn(1);do{while(Z.isEven())Z.iushrn(1);while(S.isEven())S.iushrn(1);var f=Z.cmp(S);if(f<0){var v=Z;Z=S,S=v}else if(f===0||S.cmpn(1)===0)break;Z.isub(S)}while(!0);return S.iushln(N)},j.prototype.invm=function(W){return this.egcd(W).a.umod(W)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(W){return this.words[0]&W},j.prototype.bincn=function(W){_(typeof W==="number");var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return this._expand(S+1),this.words[S]|=N,this;var f=N;for(var v=S;f!==0&&v<this.length;v++){var A=this.words[v]|0;A+=f,f=A>>>26,A&=67108863,this.words[v]=A}if(f!==0)this.words[v]=f,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(W){var Z=W<0;if(this.negative!==0&&!Z)return-1;if(this.negative===0&&Z)return 1;this._strip();var S;if(this.length>1)S=1;else{if(Z)W=-W;_(W<=67108863,"Number is too big");var N=this.words[0]|0;S=N===W?0:N<W?-1:1}if(this.negative!==0)return-S|0;return S},j.prototype.cmp=function(W){if(this.negative!==0&&W.negative===0)return-1;if(this.negative===0&&W.negative!==0)return 1;var Z=this.ucmp(W);if(this.negative!==0)return-Z|0;return Z},j.prototype.ucmp=function(W){if(this.length>W.length)return 1;if(this.length<W.length)return-1;var Z=0;for(var S=this.length-1;S>=0;S--){var N=this.words[S]|0,f=W.words[S]|0;if(N===f)continue;if(N<f)Z=-1;else if(N>f)Z=1;break}return Z},j.prototype.gtn=function(W){return this.cmpn(W)===1},j.prototype.gt=function(W){return this.cmp(W)===1},j.prototype.gten=function(W){return this.cmpn(W)>=0},j.prototype.gte=function(W){return this.cmp(W)>=0},j.prototype.ltn=function(W){return this.cmpn(W)===-1},j.prototype.lt=function(W){return this.cmp(W)===-1},j.prototype.lten=function(W){return this.cmpn(W)<=0},j.prototype.lte=function(W){return this.cmp(W)<=0},j.prototype.eqn=function(W){return this.cmpn(W)===0},j.prototype.eq=function(W){return this.cmp(W)===0},j.red=function(W){return new Y(W)},j.prototype.toRed=function(W){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),W.convertTo(this)._forceRed(W)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(W){return this.red=W,this},j.prototype.forceRed=function(W){return _(!this.red,"Already a number in reduction context"),this._forceRed(W)},j.prototype.redAdd=function(W){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,W)},j.prototype.redIAdd=function(W){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,W)},j.prototype.redSub=function(W){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,W)},j.prototype.redISub=function(W){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,W)},j.prototype.redShl=function(W){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,W)},j.prototype.redMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.mul(this,W)},j.prototype.redIMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.imul(this,W)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(W){return _(this.red&&!W.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,W)};var m={k256:null,p224:null,p192:null,p25519:null};function s(T,W){this.name=T,this.p=new j(W,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}s.prototype._tmp=function(){var W=new j(null);return W.words=Array(Math.ceil(this.n/13)),W},s.prototype.ireduce=function(W){var Z=W,S;do this.split(Z,this.tmp),Z=this.imulK(Z),Z=Z.iadd(this.tmp),S=Z.bitLength();while(S>this.n);var N=S<this.n?-1:Z.ucmp(this.p);if(N===0)Z.words[0]=0,Z.length=1;else if(N>0)Z.isub(this.p);else if(Z.strip!==void 0)Z.strip();else Z._strip();return Z},s.prototype.split=function(W,Z){W.iushrn(this.n,0,Z)},s.prototype.imulK=function(W){return W.imul(this.k)};function U(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(U,s),U.prototype.split=function(W,Z){var S=4194303,N=Math.min(W.length,9);for(var f=0;f<N;f++)Z.words[f]=W.words[f];if(Z.length=N,W.length<=9){W.words[0]=0,W.length=1;return}var v=W.words[9];Z.words[Z.length++]=v&S;for(f=10;f<W.length;f++){var A=W.words[f]|0;W.words[f-10]=(A&S)<<4|v>>>22,v=A}if(v>>>=22,W.words[f-10]=v,v===0&&W.length>10)W.length-=10;else W.length-=9},U.prototype.imulK=function(W){W.words[W.length]=0,W.words[W.length+1]=0,W.length+=2;var Z=0;for(var S=0;S<W.length;S++){var N=W.words[S]|0;Z+=N*977,W.words[S]=Z&67108863,Z=N*64+(Z/67108864|0)}if(W.words[W.length-1]===0){if(W.length--,W.words[W.length-1]===0)W.length--}return W};function l(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,s);function o(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(o,s);function M(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(M,s),M.prototype.imulK=function(W){var Z=0;for(var S=0;S<W.length;S++){var N=(W.words[S]|0)*19+Z,f=N&67108863;N>>>=26,W.words[S]=f,Z=N}if(Z!==0)W.words[W.length++]=Z;return W},j._prime=function(W){if(m[W])return m[W];var Z;if(W==="k256")Z=new U;else if(W==="p224")Z=new l;else if(W==="p192")Z=new o;else if(W==="p25519")Z=new M;else throw Error("Unknown prime "+W);return m[W]=Z,Z};function Y(T){if(typeof T==="string"){var W=j._prime(T);this.m=W.p,this.prime=W}else _(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}Y.prototype._verify1=function(W){_(W.negative===0,"red works only with positives"),_(W.red,"red works only with red numbers")},Y.prototype._verify2=function(W,Z){_((W.negative|Z.negative)===0,"red works only with positives"),_(W.red&&W.red===Z.red,"red works only with red numbers")},Y.prototype.imod=function(W){if(this.prime)return this.prime.ireduce(W)._forceRed(this);return X(W,W.umod(this.m)._forceRed(this)),W},Y.prototype.neg=function(W){if(W.isZero())return W.clone();return this.m.sub(W)._forceRed(this)},Y.prototype.add=function(W,Z){this._verify2(W,Z);var S=W.add(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S._forceRed(this)},Y.prototype.iadd=function(W,Z){this._verify2(W,Z);var S=W.iadd(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S},Y.prototype.sub=function(W,Z){this._verify2(W,Z);var S=W.sub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S._forceRed(this)},Y.prototype.isub=function(W,Z){this._verify2(W,Z);var S=W.isub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S},Y.prototype.shl=function(W,Z){return this._verify1(W),this.imod(W.ushln(Z))},Y.prototype.imul=function(W,Z){return this._verify2(W,Z),this.imod(W.imul(Z))},Y.prototype.mul=function(W,Z){return this._verify2(W,Z),this.imod(W.mul(Z))},Y.prototype.isqr=function(W){return this.imul(W,W.clone())},Y.prototype.sqr=function(W){return this.mul(W,W)},Y.prototype.sqrt=function(W){if(W.isZero())return W.clone();var Z=this.m.andln(3);if(_(Z%2===1),Z===3){var S=this.m.add(new j(1)).iushrn(2);return this.pow(W,S)}var N=this.m.subn(1),f=0;while(!N.isZero()&&N.andln(1)===0)f++,N.iushrn(1);_(!N.isZero());var v=new j(1).toRed(this),A=v.redNeg(),L=this.m.subn(1).iushrn(1),R=this.m.bitLength();R=new j(2*R*R).toRed(this);while(this.pow(R,L).cmp(A)!==0)R.redIAdd(A);var b=this.pow(R,N),d=this.pow(W,N.addn(1).iushrn(1)),i=this.pow(W,N),a=f;while(i.cmp(v)!==0){var W$=i;for(var n=0;W$.cmp(v)!==0;n++)W$=W$.redSqr();_(n<a);var B=this.pow(b,new j(1).iushln(a-n-1));d=d.redMul(B),b=B.redSqr(),i=i.redMul(b),a=n}return d},Y.prototype.invm=function(W){var Z=W._invmp(this.m);if(Z.negative!==0)return Z.negative=0,this.imod(Z).redNeg();else return this.imod(Z)},Y.prototype.pow=function(W,Z){if(Z.isZero())return new j(1).toRed(this);if(Z.cmpn(1)===0)return W.clone();var S=4,N=Array(1<<S);N[0]=new j(1).toRed(this),N[1]=W;for(var f=2;f<N.length;f++)N[f]=this.mul(N[f-1],W);var v=N[0],A=0,L=0,R=Z.bitLength()%26;if(R===0)R=26;for(f=Z.length-1;f>=0;f--){var b=Z.words[f];for(var d=R-1;d>=0;d--){var i=b>>d&1;if(v!==N[0])v=this.sqr(v);if(i===0&&A===0){L=0;continue}if(A<<=1,A|=i,L++,L!==S&&(f!==0||d!==0))continue;v=this.mul(v,N[A]),L=0,A=0}R=26}return v},Y.prototype.convertTo=function(W){var Z=W.umod(this.m);return Z===W?Z.clone():Z},Y.prototype.convertFrom=function(W){var Z=W.clone();return Z.red=null,Z},j.mont=function(W){return new H(W)};function H(T){if(Y.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(H,Y),H.prototype.convertTo=function(W){return this.imod(W.ushln(this.shift))},H.prototype.convertFrom=function(W){var Z=this.imod(W.mul(this.rinv));return Z.red=null,Z},H.prototype.imul=function(W,Z){if(W.isZero()||Z.isZero())return W.words[0]=0,W.length=1,W;var S=W.imul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=S.isub(N).iushrn(this.shift),v=f;if(f.cmp(this.m)>=0)v=f.isub(this.m);else if(f.cmpn(0)<0)v=f.iadd(this.m);return v._forceRed(this)},H.prototype.mul=function(W,Z){if(W.isZero()||Z.isZero())return new j(0)._forceRed(this);var S=W.mul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=S.isub(N).iushrn(this.shift),v=f;if(f.cmp(this.m)>=0)v=f.isub(this.m);else if(f.cmpn(0)<0)v=f.iadd(this.m);return v._forceRed(this)},H.prototype.invm=function(W){var Z=this.imod(W._invmp(this.m).mul(this.r2));return Z._forceRed(this)}})(typeof q>"u"||q,$)}),QS=l$(($,q)=>{var K=Jr(),P=ij(),_=aq().Buffer;function O(J){var w=J.modulus.byteLength(),k;do k=new K(P(w));while(k.cmp(J.modulus)>=0||!k.umod(J.prime1)||!k.umod(J.prime2));return k}function j(J){var w=O(J),k=w.toRed(K.mont(J.modulus)).redPow(new K(J.publicExponent)).fromRed();return{blinder:k,unblinder:w.invm(J.modulus)}}function z(J,w){var k=j(w),X=w.modulus.byteLength(),G=new K(J).mul(k.blinder).umod(w.modulus),V=G.toRed(K.mont(w.prime1)),C=G.toRed(K.mont(w.prime2)),E=w.coefficient,h=w.prime1,I=w.prime2,D=V.redPow(w.exponent1).fromRed(),g=C.redPow(w.exponent2).fromRed(),u=D.isub(g).imul(E).umod(h).imul(I);return g.iadd(u).imul(k.unblinder).umod(w.modulus).toArrayLike(_,"be",X)}z.getr=O,q.exports=z}),Tr=l$(($,q)=>{var K=tS(),P=ij(),_=Bj(),O=US(),j=FS(),z=HH(),J=aS(),w=QS(),k=aq().Buffer;q.exports=function(E,h,I){var D;if(E.padding)D=E.padding;else if(I)D=1;else D=4;var g=K(E),u;if(D===4)u=X(g,h);else if(D===1)u=G(g,h,I);else if(D===3){if(u=new z(h),u.cmp(g.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(I)return w(u,g);else return J(u,g)};function X(C,E){var h=C.modulus.byteLength(),I=E.length,D=_("sha1").update(k.alloc(0)).digest(),g=D.length,u=2*g;if(I>h-u-2)throw Error("message too long");var y=k.alloc(h-I-u-2),p=h-g-1,m=P(g),s=j(k.concat([D,y,k.alloc(1,1),E],p),O(m,p)),U=j(m,O(s,g));return new z(k.concat([k.alloc(1),U,s],h))}function G(C,E,h){var I=E.length,D=C.modulus.byteLength();if(I>D-11)throw Error("message too long");var g;if(h)g=k.alloc(D-I-3,255);else g=V(D-I-3);return new z(k.concat([k.from([0,h?1:2]),g,k.alloc(1),E],D))}function V(C){var E=k.allocUnsafe(C),h=0,I=P(C*2),D=0,g;while(h<C){if(D===I.length)I=P(C*2),D=0;if(g=I[D++],g)E[h++]=g}return E}}),wr=l$(($,q)=>{var K=tS(),P=US(),_=FS(),O=HH(),j=QS(),z=Bj(),J=aS(),w=aq().Buffer;q.exports=function(C,E,h){var I;if(C.padding)I=C.padding;else if(h)I=1;else I=4;var D=K(C),g=D.modulus.byteLength();if(E.length>g||new O(E).cmp(D.modulus)>=0)throw Error("decryption error");var u;if(h)u=J(new O(E),D);else u=j(E,D);var y=w.alloc(g-u.length);if(u=w.concat([y,u],g),I===4)return k(D,u);else if(I===1)return X(D,u,h);else if(I===3)return u;else throw Error("unknown padding")};function k(V,C){var E=V.modulus.byteLength(),h=z("sha1").update(w.alloc(0)).digest(),I=h.length;if(C[0]!==0)throw Error("decryption error");var D=C.slice(1,I+1),g=C.slice(I+1),u=_(D,P(g,I)),y=_(g,P(u,E-I-1));if(G(h,y.slice(0,I)))throw Error("decryption error");var p=I;while(y[p]===0)p++;if(y[p++]!==1)throw Error("decryption error");return y.slice(p)}function X(V,C,E){var h=C.slice(0,2),I=2,D=0;while(C[I++]!==0)if(I>=C.length){D++;break}var g=C.slice(2,I-1);if(h.toString("hex")!=="0002"&&!E||h.toString("hex")!=="0001"&&E)D++;if(g.length<8)D++;if(D)throw Error("decryption error");return C.slice(I)}function G(V,C){V=w.from(V),C=w.from(C);var E=0,h=V.length;if(V.length!==C.length)E++,h=Math.min(V.length,C.length);var I=-1;while(++I<h)E+=V[I]^C[I];return E}}),jH=l$(($)=>{$.publicEncrypt=Tr(),$.privateDecrypt=wr(),$.privateEncrypt=function(K,P){return $.publicEncrypt(K,P,!0)},$.publicDecrypt=function(K,P){return $.privateDecrypt(K,P,!0)}}),Zr=l$(($)=>{var q=(dq(),W6(mq));if(typeof q.publicEncrypt!=="function")q=jH();if($.publicEncrypt=q.publicEncrypt,$.privateDecrypt=q.privateDecrypt,typeof q.privateEncrypt!=="function")$.privateEncrypt=jH().privateEncrypt;else $.privateEncrypt=q.privateEncrypt;if(typeof q.publicDecrypt!=="function")$.publicDecrypt=jH().publicDecrypt;else $.publicDecrypt=q.publicDecrypt}),fr=l$(($)=>{var q=aq(),K=ij(),P=q.Buffer,_=q.kMaxLength,O=globalThis.crypto||globalThis.msCrypto,j=Math.pow(2,32)-1;function z(G,V){if(typeof G!=="number"||G!==G)throw TypeError("offset must be a number");if(G>j||G<0)throw TypeError("offset must be a uint32");if(G>_||G>V)throw RangeError("offset out of range")}function J(G,V,C){if(typeof G!=="number"||G!==G)throw TypeError("size must be a number");if(G>j||G<0)throw TypeError("size must be a uint32");if(G+V>C||G>_)throw RangeError("buffer too small")}O&&O.getRandomValues,$.randomFill=w,$.randomFillSync=X;function w(G,V,C,E){if(!P.isBuffer(G)&&!(G instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof V==="function")E=V,V=0,C=G.length;else if(typeof C==="function")E=C,C=G.length-V;else if(typeof E!=="function")throw TypeError('"cb" argument must be a function');return z(V,G.length),J(C,V,G.length),k(G,V,C,E)}function k(G,V,C,E){if(!1)var h,I;if(E){K(C,function(g,u){if(g)return E(g);u.copy(G,V),E(null,G)});return}var D=K(C);return D.copy(G,V),G}function X(G,V,C){if(typeof V>"u")V=0;if(!P.isBuffer(G)&&!(G instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(V,G.length),C===void 0)C=G.length-V;return J(C,V,G.length),k(G,V,C)}}),Xr=l$(($,q)=>{var K=(dq(),W6(mq));if(typeof K.randomFill==="function"&&typeof K.randomFillSync==="function")$.randomFill=K.randomFill,$.randomFillSync=K.randomFillSync;else q.exports=fr()}),kr=l$(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=ij(),$.createHash=$.Hash=Bj(),$.createHmac=$.Hmac=uS();var q=Sl(),K=Object.keys(q),P=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(K);$.getHashes=function(){return P};var _=xS();$.pbkdf2=_.pbkdf2,$.pbkdf2Sync=_.pbkdf2Sync;var O=Nl();$.Cipher=O.Cipher,$.createCipher=O.createCipher,$.Cipheriv=O.Cipheriv,$.createCipheriv=O.createCipheriv,$.Decipher=O.Decipher,$.createDecipher=O.createDecipher,$.Decipheriv=O.Decipheriv,$.createDecipheriv=O.createDecipheriv,$.getCiphers=O.getCiphers,$.listCiphers=O.listCiphers;var j=Cl();$.DiffieHellmanGroup=j.DiffieHellmanGroup,$.createDiffieHellmanGroup=j.createDiffieHellmanGroup,$.getDiffieHellman=j.getDiffieHellman,$.createDiffieHellman=j.createDiffieHellman,$.DiffieHellman=j.DiffieHellman;var z=El();$.createSign=z.createSign,$.Sign=z.Sign,$.createVerify=z.createVerify,$.Verify=z.Verify,$.createECDH=Fl();var J=Zr();$.publicEncrypt=J.publicEncrypt,$.privateEncrypt=J.privateEncrypt,$.publicDecrypt=J.publicDecrypt,$.privateDecrypt=J.privateDecrypt;var w=Xr();$.randomFill=w.randomFill,$.randomFillSync=w.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
36
+ })`)}catch(J){z=function(w){this._initNamed(w)}}return K(z,j),z.prototype._initNamed=function(w){j.call(this,w)},new z(this)},_.prototype._getDecoder=function(j){if(j=j||"der",!this.decoders.hasOwnProperty(j))this.decoders[j]=this._createNamed(q.decoders[j]);return this.decoders[j]},_.prototype.decode=function(j,z,J){return this._getDecoder(z).decode(j,J)},_.prototype._getEncoder=function(j){if(j=j||"der",!this.encoders.hasOwnProperty(j))this.encoders[j]=this._createNamed(q.encoders[j]);return this.encoders[j]},_.prototype.encode=function(j,z,J){return this._getEncoder(z).encode(j,J)}}),el=l$(($)=>{var q=_8();function K(_){this._reporterState={obj:null,path:[],options:_||{},errors:[]}}$.Reporter=K,K.prototype.isError=function(O){return O instanceof P},K.prototype.save=function(){var O=this._reporterState;return{obj:O.obj,pathLen:O.path.length}},K.prototype.restore=function(O){var j=this._reporterState;j.obj=O.obj,j.path=j.path.slice(0,O.pathLen)},K.prototype.enterKey=function(O){return this._reporterState.path.push(O)},K.prototype.exitKey=function(O){var j=this._reporterState;j.path=j.path.slice(0,O-1)},K.prototype.leaveKey=function(O,j,z){var J=this._reporterState;if(this.exitKey(O),J.obj!==null)J.obj[j]=z},K.prototype.path=function(){return this._reporterState.path.join("/")},K.prototype.enterObject=function(){var O=this._reporterState,j=O.obj;return O.obj={},j},K.prototype.leaveObject=function(O){var j=this._reporterState,z=j.obj;return j.obj=O,z},K.prototype.error=function(O){var j,z=this._reporterState,J=O instanceof P;if(J)j=O;else j=new P(z.path.map(function(w){return"["+JSON.stringify(w)+"]"}).join(""),O.message||O,O.stack);if(!z.options.partial)throw j;if(!J)z.errors.push(j);return j},K.prototype.wrapResult=function(O){var j=this._reporterState;if(!j.options.partial)return O;return{result:this.isError(O)?null:O,errors:j.errors}};function P(_,O){this.path=_,this.rethrow(O)}q(P,Error),P.prototype.rethrow=function(O){if(this.message=O+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,P);if(!this.stack)try{throw Error(this.message)}catch(j){this.stack=j.stack}return this}}),gS=l$(($)=>{var q=_8(),K=x7().Reporter,P=(vq(),W6(Yq)).Buffer;function _(j,z){if(K.call(this,z),!P.isBuffer(j)){this.error("Input not Buffer");return}this.base=j,this.offset=0,this.length=j.length}q(_,K),$.DecoderBuffer=_,_.prototype.save=function(){return{offset:this.offset,reporter:K.prototype.save.call(this)}},_.prototype.restore=function(z){var J=new _(this.base);return J.offset=z.offset,J.length=this.offset,this.offset=z.offset,K.prototype.restore.call(this,z.reporter),J},_.prototype.isEmpty=function(){return this.offset===this.length},_.prototype.readUInt8=function(z){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(z||"DecoderBuffer overrun")},_.prototype.skip=function(z,J){if(!(this.offset+z<=this.length))return this.error(J||"DecoderBuffer overrun");var w=new _(this.base);return w._reporterState=this._reporterState,w.offset=this.offset,w.length=this.offset+z,this.offset+=z,w},_.prototype.raw=function(z){return this.base.slice(z?z.offset:this.offset,this.length)};function O(j,z){if(Array.isArray(j))this.length=0,this.value=j.map(function(J){if(!(J instanceof O))J=new O(J,z);return this.length+=J.length,J},this);else if(typeof j==="number"){if(!(0<=j&&j<=255))return z.error("non-byte EncoderBuffer value");this.value=j,this.length=1}else if(typeof j==="string")this.value=j,this.length=P.byteLength(j);else if(P.isBuffer(j))this.value=j,this.length=j.length;else return z.error("Unsupported type: "+typeof j)}$.EncoderBuffer=O,O.prototype.join=function(z,J){if(!z)z=new P(this.length);if(!J)J=0;if(this.length===0)return z;if(Array.isArray(this.value))this.value.forEach(function(w){w.join(z,J),J+=w.length});else{if(typeof this.value==="number")z[J]=this.value;else if(typeof this.value==="string")z.write(this.value,J);else if(P.isBuffer(this.value))this.value.copy(z,J);J+=this.length}return z}}),sl=l$(($,q)=>{var K=x7().Reporter,P=x7().EncoderBuffer,_=x7().DecoderBuffer,O=tK(),j=["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"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(j),J=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function w(X,G){var V={};if(this._baseState=V,V.enc=X,V.parent=G||null,V.children=null,V.tag=null,V.args=null,V.reverseArgs=null,V.choice=null,V.optional=!1,V.any=!1,V.obj=!1,V.use=null,V.useDecoder=null,V.key=null,V.default=null,V.explicit=null,V.implicit=null,V.contains=null,!V.parent)V.children=[],this._wrap()}q.exports=w;var k=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];w.prototype.clone=function(){var G=this._baseState,V={};k.forEach(function(E){V[E]=G[E]});var C=new this.constructor(V.parent);return C._baseState=V,C},w.prototype._wrap=function(){var G=this._baseState;z.forEach(function(V){this[V]=function(){var E=new this.constructor(this);return G.children.push(E),E[V].apply(E,arguments)}},this)},w.prototype._init=function(G){var V=this._baseState;O(V.parent===null),G.call(this),V.children=V.children.filter(function(C){return C._baseState.parent===this},this),O.equal(V.children.length,1,"Root node can have only one child")},w.prototype._useArgs=function(G){var V=this._baseState,C=G.filter(function(E){return E instanceof this.constructor},this);if(G=G.filter(function(E){return!(E instanceof this.constructor)},this),C.length!==0)O(V.children===null),V.children=C,C.forEach(function(E){E._baseState.parent=this},this);if(G.length!==0)O(V.args===null),V.args=G,V.reverseArgs=G.map(function(E){if(typeof E!=="object"||E.constructor!==Object)return E;var h={};return Object.keys(E).forEach(function(I){if(I==(I|0))I|=0;var D=E[I];h[D]=I}),h})},J.forEach(function(X){w.prototype[X]=function(){var V=this._baseState;throw Error(X+" not implemented for encoding: "+V.enc)}}),j.forEach(function(X){w.prototype[X]=function(){var V=this._baseState,C=Array.prototype.slice.call(arguments);return O(V.tag===null),V.tag=X,this._useArgs(C),this}}),w.prototype.use=function(G){O(G);var V=this._baseState;return O(V.use===null),V.use=G,this},w.prototype.optional=function(){var G=this._baseState;return G.optional=!0,this},w.prototype.def=function(G){var V=this._baseState;return O(V.default===null),V.default=G,V.optional=!0,this},w.prototype.explicit=function(G){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.explicit=G,this},w.prototype.implicit=function(G){var V=this._baseState;return O(V.explicit===null&&V.implicit===null),V.implicit=G,this},w.prototype.obj=function(){var G=this._baseState,V=Array.prototype.slice.call(arguments);if(G.obj=!0,V.length!==0)this._useArgs(V);return this},w.prototype.key=function(G){var V=this._baseState;return O(V.key===null),V.key=G,this},w.prototype.any=function(){var G=this._baseState;return G.any=!0,this},w.prototype.choice=function(G){var V=this._baseState;return O(V.choice===null),V.choice=G,this._useArgs(Object.keys(G).map(function(C){return G[C]})),this},w.prototype.contains=function(G){var V=this._baseState;return O(V.use===null),V.contains=G,this},w.prototype._decode=function(G,V){var C=this._baseState;if(C.parent===null)return G.wrapResult(C.children[0]._decode(G,V));var E=C.default,h=!0,I=null;if(C.key!==null)I=G.enterKey(C.key);if(C.optional){var D=null;if(C.explicit!==null)D=C.explicit;else if(C.implicit!==null)D=C.implicit;else if(C.tag!==null)D=C.tag;if(D===null&&!C.any){var g=G.save();try{if(C.choice===null)this._decodeGeneric(C.tag,G,V);else this._decodeChoice(G,V);h=!0}catch(e){h=!1}G.restore(g)}else if(h=this._peekTag(G,D,C.any),G.isError(h))return h}var u;if(C.obj&&h)u=G.enterObject();if(h){if(C.explicit!==null){var y=this._decodeTag(G,C.explicit);if(G.isError(y))return y;G=y}var p=G.offset;if(C.use===null&&C.choice===null){if(C.any)var g=G.save();var l=this._decodeTag(G,C.implicit!==null?C.implicit:C.tag,C.any);if(G.isError(l))return l;if(C.any)E=G.raw(g);else G=l}if(V&&V.track&&C.tag!==null)V.track(G.path(),p,G.length,"tagged");if(V&&V.track&&C.tag!==null)V.track(G.path(),G.offset,G.length,"content");if(C.any)E=E;else if(C.choice===null)E=this._decodeGeneric(C.tag,G,V);else E=this._decodeChoice(G,V);if(G.isError(E))return E;if(!C.any&&C.choice===null&&C.children!==null)C.children.forEach(function(m){m._decode(G,V)});if(C.contains&&(C.tag==="octstr"||C.tag==="bitstr")){var Q=new _(E);E=this._getUse(C.contains,G._reporterState.obj)._decode(Q,V)}}if(C.obj&&h)E=G.leaveObject(u);if(C.key!==null&&(E!==null||h===!0))G.leaveKey(I,C.key,E);else if(I!==null)G.exitKey(I);return E},w.prototype._decodeGeneric=function(G,V,C){var E=this._baseState;if(G==="seq"||G==="set")return null;if(G==="seqof"||G==="setof")return this._decodeList(V,G,E.args[0],C);else if(/str$/.test(G))return this._decodeStr(V,G,C);else if(G==="objid"&&E.args)return this._decodeObjid(V,E.args[0],E.args[1],C);else if(G==="objid")return this._decodeObjid(V,null,null,C);else if(G==="gentime"||G==="utctime")return this._decodeTime(V,G,C);else if(G==="null_")return this._decodeNull(V,C);else if(G==="bool")return this._decodeBool(V,C);else if(G==="objDesc")return this._decodeStr(V,G,C);else if(G==="int"||G==="enum")return this._decodeInt(V,E.args&&E.args[0],C);if(E.use!==null)return this._getUse(E.use,V._reporterState.obj)._decode(V,C);else return V.error("unknown tag: "+G)},w.prototype._getUse=function(G,V){var C=this._baseState;if(C.useDecoder=this._use(G,V),O(C.useDecoder._baseState.parent===null),C.useDecoder=C.useDecoder._baseState.children[0],C.implicit!==C.useDecoder._baseState.implicit)C.useDecoder=C.useDecoder.clone(),C.useDecoder._baseState.implicit=C.implicit;return C.useDecoder},w.prototype._decodeChoice=function(G,V){var C=this._baseState,E=null,h=!1;if(Object.keys(C.choice).some(function(I){var D=G.save(),g=C.choice[I];try{var u=g._decode(G,V);if(G.isError(u))return!1;E={type:I,value:u},h=!0}catch(y){return G.restore(D),!1}return!0},this),!h)return G.error("Choice not matched");return E},w.prototype._createEncoderBuffer=function(G){return new P(G,this.reporter)},w.prototype._encode=function(G,V,C){var E=this._baseState;if(E.default!==null&&E.default===G)return;var h=this._encodeValue(G,V,C);if(h===void 0)return;if(this._skipDefault(h,V,C))return;return h},w.prototype._encodeValue=function(G,V,C){var E=this._baseState;if(E.parent===null)return E.children[0]._encode(G,V||new K);var g=null;if(this.reporter=V,E.optional&&G===void 0)if(E.default!==null)G=E.default;else return;var h=null,I=!1;if(E.any)g=this._createEncoderBuffer(G);else if(E.choice)g=this._encodeChoice(G,V);else if(E.contains)h=this._getUse(E.contains,C)._encode(G,V),I=!0;else if(E.children)h=E.children.map(function(p){if(p._baseState.tag==="null_")return p._encode(null,V,G);if(p._baseState.key===null)return V.error("Child should have a key");var l=V.enterKey(p._baseState.key);if(typeof G!=="object")return V.error("Child expected, but input is not object");var Q=p._encode(G[p._baseState.key],V,G);return V.leaveKey(l),Q},this).filter(function(p){return p}),h=this._createEncoderBuffer(h);else if(E.tag==="seqof"||E.tag==="setof"){if(!(E.args&&E.args.length===1))return V.error("Too many args for : "+E.tag);if(!Array.isArray(G))return V.error("seqof/setof, but data is not Array");var D=this.clone();D._baseState.implicit=null,h=this._createEncoderBuffer(G.map(function(p){var l=this._baseState;return this._getUse(l.args[0],G)._encode(p,V)},D))}else if(E.use!==null)g=this._getUse(E.use,C)._encode(G,V);else h=this._encodePrimitive(E.tag,G),I=!0;var g;if(!E.any&&E.choice===null){var u=E.implicit!==null?E.implicit:E.tag,y=E.implicit===null?"universal":"context";if(u===null){if(E.use===null)V.error("Tag could be omitted only for .use()")}else if(E.use===null)g=this._encodeComposite(u,I,y,h)}if(E.explicit!==null)g=this._encodeComposite(E.explicit,!1,"context",g);return g},w.prototype._encodeChoice=function(G,V){var C=this._baseState,E=C.choice[G.type];if(!E)O(!1,G.type+" not found in "+JSON.stringify(Object.keys(C.choice)));return E._encode(G.value,V)},w.prototype._encodePrimitive=function(G,V){var C=this._baseState;if(/str$/.test(G))return this._encodeStr(V,G);else if(G==="objid"&&C.args)return this._encodeObjid(V,C.reverseArgs[0],C.args[1]);else if(G==="objid")return this._encodeObjid(V,null,null);else if(G==="gentime"||G==="utctime")return this._encodeTime(V,G);else if(G==="null_")return this._encodeNull();else if(G==="int"||G==="enum")return this._encodeInt(V,C.args&&C.reverseArgs[0]);else if(G==="bool")return this._encodeBool(V);else if(G==="objDesc")return this._encodeStr(V,G);else throw Error("Unsupported tag: "+G)},w.prototype._isNumstr=function(G){return/^[0-9 ]*$/.test(G)},w.prototype._isPrintstr=function(G){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(G)}}),x7=l$(($)=>{var q=$;q.Reporter=el().Reporter,q.DecoderBuffer=gS().DecoderBuffer,q.EncoderBuffer=gS().EncoderBuffer,q.Node=sl()}),$r=l$(($)=>{var q=oS();$.tagClass={0:"universal",1:"application",2:"context",3:"private"},$.tagClassByName=q._reverse($.tagClass),$.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"},$.tagByName=q._reverse($.tag)}),oS=l$(($)=>{var q=$;q._reverse=function(P){var _={};return Object.keys(P).forEach(function(O){if((O|0)==O)O=O|0;var j=P[O];_[j]=O}),_},q.der=$r()}),nS=l$(($,q)=>{var K=_8(),P=p7(),_=P.base,O=P.bignum,j=P.constants.der;function z(X){this.enc="der",this.name=X.name,this.entity=X,this.tree=new J,this.tree._init(X.body)}q.exports=z,z.prototype.decode=function(G,V){if(!(G instanceof _.DecoderBuffer))G=new _.DecoderBuffer(G,V);return this.tree._decode(G,V)};function J(X){_.Node.call(this,"der",X)}K(J,_.Node),J.prototype._peekTag=function(G,V,C){if(G.isEmpty())return!1;var E=G.save(),h=w(G,'Failed to peek tag: "'+V+'"');if(G.isError(h))return h;return G.restore(E),h.tag===V||h.tagStr===V||h.tagStr+"of"===V||C},J.prototype._decodeTag=function(G,V,C){var E=w(G,'Failed to decode tag of "'+V+'"');if(G.isError(E))return E;var h=k(G,E.primitive,'Failed to get length of "'+V+'"');if(G.isError(h))return h;if(!C&&E.tag!==V&&E.tagStr!==V&&E.tagStr+"of"!==V)return G.error('Failed to match tag: "'+V+'"');if(E.primitive||h!==null)return G.skip(h,'Failed to match body of: "'+V+'"');var I=G.save(),D=this._skipUntilEnd(G,'Failed to skip indefinite length body: "'+this.tag+'"');if(G.isError(D))return D;return h=G.offset-I.offset,G.restore(I),G.skip(h,'Failed to match body of: "'+V+'"')},J.prototype._skipUntilEnd=function(G,V){while(!0){var C=w(G,V);if(G.isError(C))return C;var E=k(G,C.primitive,V);if(G.isError(E))return E;var h;if(C.primitive||E!==null)h=G.skip(E);else h=this._skipUntilEnd(G,V);if(G.isError(h))return h;if(C.tagStr==="end")break}},J.prototype._decodeList=function(G,V,C,E){var h=[];while(!G.isEmpty()){var I=this._peekTag(G,"end");if(G.isError(I))return I;var D=C.decode(G,"der",E);if(G.isError(D)&&I)break;h.push(D)}return h},J.prototype._decodeStr=function(G,V){if(V==="bitstr"){var C=G.readUInt8();if(G.isError(C))return C;return{unused:C,data:G.raw()}}else if(V==="bmpstr"){var E=G.raw();if(E.length%2===1)return G.error("Decoding of string type: bmpstr length mismatch");var h="";for(var I=0;I<E.length/2;I++)h+=String.fromCharCode(E.readUInt16BE(I*2));return h}else if(V==="numstr"){var D=G.raw().toString("ascii");if(!this._isNumstr(D))return G.error("Decoding of string type: numstr unsupported characters");return D}else if(V==="octstr")return G.raw();else if(V==="objDesc")return G.raw();else if(V==="printstr"){var g=G.raw().toString("ascii");if(!this._isPrintstr(g))return G.error("Decoding of string type: printstr unsupported characters");return g}else if(/str$/.test(V))return G.raw().toString();else return G.error("Decoding of string type: "+V+" unsupported")},J.prototype._decodeObjid=function(G,V,C){var E,h=[],I=0;while(!G.isEmpty()){var D=G.readUInt8();if(I<<=7,I|=D&127,(D&128)===0)h.push(I),I=0}if(D&128)h.push(I);var g=h[0]/40|0,u=h[0]%40;if(C)E=h;else E=[g,u].concat(h.slice(1));if(V){var y=V[E.join(" ")];if(y===void 0)y=V[E.join(".")];if(y!==void 0)E=y}return E},J.prototype._decodeTime=function(G,V){var C=G.raw().toString();if(V==="gentime")var E=C.slice(0,4)|0,h=C.slice(4,6)|0,I=C.slice(6,8)|0,D=C.slice(8,10)|0,g=C.slice(10,12)|0,u=C.slice(12,14)|0;else if(V==="utctime"){var E=C.slice(0,2)|0,h=C.slice(2,4)|0,I=C.slice(4,6)|0,D=C.slice(6,8)|0,g=C.slice(8,10)|0,u=C.slice(10,12)|0;if(E<70)E=2000+E;else E=1900+E}else return G.error("Decoding "+V+" time is not supported yet");return Date.UTC(E,h-1,I,D,g,u,0)},J.prototype._decodeNull=function(G){return null},J.prototype._decodeBool=function(G){var V=G.readUInt8();if(G.isError(V))return V;else return V!==0},J.prototype._decodeInt=function(G,V){var C=G.raw(),E=new O(C);if(V)E=V[E.toString(10)]||E;return E},J.prototype._use=function(G,V){if(typeof G==="function")G=G(V);return G._getDecoder("der").tree};function w(X,G){var V=X.readUInt8(G);if(X.isError(V))return V;var C=j.tagClass[V>>6],E=(V&32)===0;if((V&31)===31){var h=V;V=0;while((h&128)===128){if(h=X.readUInt8(G),X.isError(h))return h;V<<=7,V|=h&127}}else V&=31;var I=j.tag[V];return{cls:C,primitive:E,tag:V,tagStr:I}}function k(X,G,V){var C=X.readUInt8(V);if(X.isError(C))return C;if(!G&&C===128)return null;if((C&128)===0)return C;var E=C&127;if(E>4)return X.error("length octect is too long");C=0;for(var h=0;h<E;h++){C<<=8;var I=X.readUInt8(V);if(X.isError(I))return I;C|=I}return C}}),qr=l$(($,q)=>{var K=_8(),P=(vq(),W6(Yq)).Buffer,_=nS();function O(j){_.call(this,j),this.enc="pem"}K(O,_),q.exports=O,O.prototype.decode=function(z,J){var w=z.toString().split(/[\r\n]+/g),k=J.label.toUpperCase(),X=/^-----(BEGIN|END) ([^-]+)-----$/,G=-1,V=-1;for(var C=0;C<w.length;C++){var E=w[C].match(X);if(E===null)continue;if(E[2]!==k)continue;if(G===-1){if(E[1]!=="BEGIN")break;G=C}else{if(E[1]!=="END")break;V=C;break}}if(G===-1||V===-1)throw Error("PEM section not found for: "+k);var h=w.slice(G+1,V).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var I=new P(h,"base64");return _.prototype.decode.call(this,I,J)}}),Kr=l$(($)=>{var q=$;q.der=nS(),q.pem=qr()}),iS=l$(($,q)=>{var K=_8(),P=(vq(),W6(Yq)).Buffer,_=p7(),O=_.base,j=_.constants.der;function z(X){this.enc="der",this.name=X.name,this.entity=X,this.tree=new J,this.tree._init(X.body)}q.exports=z,z.prototype.encode=function(G,V){return this.tree._encode(G,V).join()};function J(X){O.Node.call(this,"der",X)}K(J,O.Node),J.prototype._encodeComposite=function(G,V,C,E){var h=k(G,V,C,this.reporter);if(E.length<128){var g=new P(2);return g[0]=h,g[1]=E.length,this._createEncoderBuffer([g,E])}var I=1;for(var D=E.length;D>=256;D>>=8)I++;var g=new P(2+I);g[0]=h,g[1]=128|I;for(var D=1+I,u=E.length;u>0;D--,u>>=8)g[D]=u&255;return this._createEncoderBuffer([g,E])},J.prototype._encodeStr=function(G,V){if(V==="bitstr")return this._createEncoderBuffer([G.unused|0,G.data]);else if(V==="bmpstr"){var C=new P(G.length*2);for(var E=0;E<G.length;E++)C.writeUInt16BE(G.charCodeAt(E),E*2);return this._createEncoderBuffer(C)}else if(V==="numstr"){if(!this._isNumstr(G))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(G)}else if(V==="printstr"){if(!this._isPrintstr(G))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(G)}else if(/str$/.test(V))return this._createEncoderBuffer(G);else if(V==="objDesc")return this._createEncoderBuffer(G);else return this.reporter.error("Encoding of string type: "+V+" unsupported")},J.prototype._encodeObjid=function(G,V,C){if(typeof G==="string"){if(!V)return this.reporter.error("string objid given, but no values map found");if(!V.hasOwnProperty(G))return this.reporter.error("objid not found in values map");G=V[G].split(/[\s\.]+/g);for(var E=0;E<G.length;E++)G[E]|=0}else if(Array.isArray(G)){G=G.slice();for(var E=0;E<G.length;E++)G[E]|=0}if(!Array.isArray(G))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(G));if(!C){if(G[1]>=40)return this.reporter.error("Second objid identifier OOB");G.splice(0,2,G[0]*40+G[1])}var h=0;for(var E=0;E<G.length;E++){var I=G[E];for(h++;I>=128;I>>=7)h++}var D=new P(h),g=D.length-1;for(var E=G.length-1;E>=0;E--){var I=G[E];D[g--]=I&127;while((I>>=7)>0)D[g--]=128|I&127}return this._createEncoderBuffer(D)};function w(X){if(X<10)return"0"+X;else return X}J.prototype._encodeTime=function(G,V){var C,E=new Date(G);if(V==="gentime")C=[w(E.getFullYear()),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else if(V==="utctime")C=[w(E.getFullYear()%100),w(E.getUTCMonth()+1),w(E.getUTCDate()),w(E.getUTCHours()),w(E.getUTCMinutes()),w(E.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+V+" time is not supported yet");return this._encodeStr(C,"octstr")},J.prototype._encodeNull=function(){return this._createEncoderBuffer("")},J.prototype._encodeInt=function(G,V){if(typeof G==="string"){if(!V)return this.reporter.error("String int or enum given, but no values map");if(!V.hasOwnProperty(G))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(G));G=V[G]}if(typeof G!=="number"&&!P.isBuffer(G)){var C=G.toArray();if(!G.sign&&C[0]&128)C.unshift(0);G=new P(C)}if(P.isBuffer(G)){var E=G.length;if(G.length===0)E++;var I=new P(E);if(G.copy(I),G.length===0)I[0]=0;return this._createEncoderBuffer(I)}if(G<128)return this._createEncoderBuffer(G);if(G<256)return this._createEncoderBuffer([0,G]);var E=1;for(var h=G;h>=256;h>>=8)E++;var I=Array(E);for(var h=I.length-1;h>=0;h--)I[h]=G&255,G>>=8;if(I[0]&128)I.unshift(0);return this._createEncoderBuffer(new P(I))},J.prototype._encodeBool=function(G){return this._createEncoderBuffer(G?255:0)},J.prototype._use=function(G,V){if(typeof G==="function")G=G(V);return G._getEncoder("der").tree},J.prototype._skipDefault=function(G,V,C){var E=this._baseState,h;if(E.default===null)return!1;var I=G.join();if(E.defaultBuffer===void 0)E.defaultBuffer=this._encodeValue(E.default,V,C).join();if(I.length!==E.defaultBuffer.length)return!1;for(h=0;h<I.length;h++)if(I[h]!==E.defaultBuffer[h])return!1;return!0};function k(X,G,V,C){var E;if(X==="seqof")X="seq";else if(X==="setof")X="set";if(j.tagByName.hasOwnProperty(X))E=j.tagByName[X];else if(typeof X==="number"&&(X|0)===X)E=X;else return C.error("Unknown tag: "+X);if(E>=31)return C.error("Multi-octet tag encoding unsupported");if(!G)E|=32;return E|=j.tagClassByName[V||"universal"]<<6,E}}),_r=l$(($,q)=>{var K=_8(),P=iS();function _(O){P.call(this,O),this.enc="pem"}K(_,P),q.exports=_,_.prototype.encode=function(j,z){var J=P.prototype.encode.call(this,j),w=J.toString("base64"),k=["-----BEGIN "+z.label+"-----"];for(var X=0;X<w.length;X+=64)k.push(w.slice(X,X+64));return k.push("-----END "+z.label+"-----"),k.join(`
37
+ `)}}),Pr=l$(($)=>{var q=$;q.der=iS(),q.pem=_r()}),p7=l$(($)=>{var q=$;q.bignum=al(),q.define=Ql().define,q.base=x7(),q.constants=oS(),q.decoders=Kr(),q.encoders=Pr()}),jr=l$(($,q)=>{var K=p7(),P=K.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),_=K.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),O=K.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),j=K.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(O),this.key("subjectPublicKey").bitstr())}),z=K.define("RelativeDistinguishedName",function(){this.setof(_)}),J=K.define("RDNSequence",function(){this.seqof(z)}),w=K.define("Name",function(){this.choice({rdnSequence:this.use(J)})}),k=K.define("Validity",function(){this.seq().obj(this.key("notBefore").use(P),this.key("notAfter").use(P))}),X=K.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),G=K.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(O),this.key("issuer").use(w),this.key("validity").use(k),this.key("subject").use(w),this.key("subjectPublicKeyInfo").use(j),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(X).optional())}),V=K.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(G),this.key("signatureAlgorithm").use(O),this.key("signatureValue").bitstr())});q.exports=V}),Or=l$(($)=>{var q=p7();$.certificate=jr();var K=q.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$.RSAPrivateKey=K;var P=q.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=P;var _=q.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),O=q.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(_),this.key("subjectPublicKey").bitstr())});$.PublicKey=O;var j=q.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(_),this.key("subjectPrivateKey").octstr())});$.PrivateKey=j;var z=q.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$.EncryptedPrivateKey=z;var J=q.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$.DSAPrivateKey=J,$.DSAparam=q.define("DSAparam",function(){this.int()});var w=q.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),k=q.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(w),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=k,$.signature=q.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),Yr=l$(($,q)=>{q.exports={"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"}}),vr=l$(($,q)=>{var K=aq().Buffer,P=PH().Transform,_=_8();function O(w){P.call(this),this._block=K.allocUnsafe(w),this._blockSize=w,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}_(O,P),O.prototype._transform=function(w,k,X){var G=null;try{this.update(w,k)}catch(V){G=V}X(G)},O.prototype._flush=function(w){var k=null;try{this.push(this.digest())}catch(X){k=X}w(k)};var j=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(K.prototype instanceof Uint8Array||K.TYPED_ARRAY_SUPPORT);function J(w,k){if(w instanceof K)return w;if(typeof w==="string")return K.from(w,k);if(z&&ArrayBuffer.isView(w)){if(w.byteLength===0)return K.alloc(0);var X=K.from(w.buffer,w.byteOffset,w.byteLength);if(X.byteLength===w.byteLength)return X}if(j&&w instanceof Uint8Array)return K.from(w);if(K.isBuffer(w)&&w.constructor&&typeof w.constructor.isBuffer==="function"&&w.constructor.isBuffer(w))return K.from(w);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}O.prototype.update=function(w,k){if(this._finalized)throw Error("Digest already called");w=J(w,k);var X=this._block,G=0;while(this._blockOffset+w.length-G>=this._blockSize){for(var V=this._blockOffset;V<this._blockSize;)X[V++]=w[G++];this._update(),this._blockOffset=0}while(G<w.length)X[this._blockOffset++]=w[G++];for(var C=0,E=w.length*8;E>0;++C)if(this._length[C]+=E,E=this._length[C]/4294967296|0,E>0)this._length[C]-=4294967296*E;return this},O.prototype._update=function(){throw Error("_update is not implemented")},O.prototype.digest=function(w){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var k=this._digest();if(w!==void 0)k=k.toString(w);this._block.fill(0),this._blockOffset=0;for(var X=0;X<4;++X)this._length[X]=0;return k},O.prototype._digest=function(){throw Error("_digest is not implemented")},q.exports=O}),zr=l$(($,q)=>{var K=_8(),P=vr(),_=aq().Buffer,O=Array(16);function j(){P.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}K(j,P),j.prototype._update=function(){var G=O;for(var V=0;V<16;++V)G[V]=this._block.readInt32LE(V*4);var C=this._a,E=this._b,h=this._c,I=this._d;C=J(C,E,h,I,G[0],3614090360,7),I=J(I,C,E,h,G[1],3905402710,12),h=J(h,I,C,E,G[2],606105819,17),E=J(E,h,I,C,G[3],3250441966,22),C=J(C,E,h,I,G[4],4118548399,7),I=J(I,C,E,h,G[5],1200080426,12),h=J(h,I,C,E,G[6],2821735955,17),E=J(E,h,I,C,G[7],4249261313,22),C=J(C,E,h,I,G[8],1770035416,7),I=J(I,C,E,h,G[9],2336552879,12),h=J(h,I,C,E,G[10],4294925233,17),E=J(E,h,I,C,G[11],2304563134,22),C=J(C,E,h,I,G[12],1804603682,7),I=J(I,C,E,h,G[13],4254626195,12),h=J(h,I,C,E,G[14],2792965006,17),E=J(E,h,I,C,G[15],1236535329,22),C=w(C,E,h,I,G[1],4129170786,5),I=w(I,C,E,h,G[6],3225465664,9),h=w(h,I,C,E,G[11],643717713,14),E=w(E,h,I,C,G[0],3921069994,20),C=w(C,E,h,I,G[5],3593408605,5),I=w(I,C,E,h,G[10],38016083,9),h=w(h,I,C,E,G[15],3634488961,14),E=w(E,h,I,C,G[4],3889429448,20),C=w(C,E,h,I,G[9],568446438,5),I=w(I,C,E,h,G[14],3275163606,9),h=w(h,I,C,E,G[3],4107603335,14),E=w(E,h,I,C,G[8],1163531501,20),C=w(C,E,h,I,G[13],2850285829,5),I=w(I,C,E,h,G[2],4243563512,9),h=w(h,I,C,E,G[7],1735328473,14),E=w(E,h,I,C,G[12],2368359562,20),C=k(C,E,h,I,G[5],4294588738,4),I=k(I,C,E,h,G[8],2272392833,11),h=k(h,I,C,E,G[11],1839030562,16),E=k(E,h,I,C,G[14],4259657740,23),C=k(C,E,h,I,G[1],2763975236,4),I=k(I,C,E,h,G[4],1272893353,11),h=k(h,I,C,E,G[7],4139469664,16),E=k(E,h,I,C,G[10],3200236656,23),C=k(C,E,h,I,G[13],681279174,4),I=k(I,C,E,h,G[0],3936430074,11),h=k(h,I,C,E,G[3],3572445317,16),E=k(E,h,I,C,G[6],76029189,23),C=k(C,E,h,I,G[9],3654602809,4),I=k(I,C,E,h,G[12],3873151461,11),h=k(h,I,C,E,G[15],530742520,16),E=k(E,h,I,C,G[2],3299628645,23),C=X(C,E,h,I,G[0],4096336452,6),I=X(I,C,E,h,G[7],1126891415,10),h=X(h,I,C,E,G[14],2878612391,15),E=X(E,h,I,C,G[5],4237533241,21),C=X(C,E,h,I,G[12],1700485571,6),I=X(I,C,E,h,G[3],2399980690,10),h=X(h,I,C,E,G[10],4293915773,15),E=X(E,h,I,C,G[1],2240044497,21),C=X(C,E,h,I,G[8],1873313359,6),I=X(I,C,E,h,G[15],4264355552,10),h=X(h,I,C,E,G[6],2734768916,15),E=X(E,h,I,C,G[13],1309151649,21),C=X(C,E,h,I,G[4],4149444226,6),I=X(I,C,E,h,G[11],3174756917,10),h=X(h,I,C,E,G[2],718787259,15),E=X(E,h,I,C,G[9],3951481745,21),this._a=this._a+C|0,this._b=this._b+E|0,this._c=this._c+h|0,this._d=this._d+I|0},j.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var G=_.allocUnsafe(16);return G.writeInt32LE(this._a,0),G.writeInt32LE(this._b,4),G.writeInt32LE(this._c,8),G.writeInt32LE(this._d,12),G};function z(G,V){return G<<V|G>>>32-V}function J(G,V,C,E,h,I,D){return z(G+(V&C|~V&E)+h+I|0,D)+V|0}function w(G,V,C,E,h,I,D){return z(G+(V&E|C&~E)+h+I|0,D)+V|0}function k(G,V,C,E,h,I,D){return z(G+(V^C^E)+h+I|0,D)+V|0}function X(G,V,C,E,h,I,D){return z(G+(C^(V|~E))+h+I|0,D)+V|0}q.exports=j}),Wr=l$(($,q)=>{var K=aq().Buffer,P=zr();function _(O,j,z,J){if(!K.isBuffer(O))O=K.from(O,"binary");if(j){if(!K.isBuffer(j))j=K.from(j,"binary");if(j.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var w=z/8,k=K.alloc(w),X=K.alloc(J||0),G=K.alloc(0);while(w>0||J>0){var V=new P;if(V.update(G),V.update(O),j)V.update(j);G=V.digest();var C=0;if(w>0){var E=k.length-w;C=Math.min(w,G.length),G.copy(k,E,0,C),w-=C}if(C<G.length&&J>0){var h=X.length-J,I=Math.min(J,G.length-C);G.copy(X,h,C,C+I),J-=I}}return G.fill(0),{key:k,iv:X}}q.exports=_}),BS=l$(($)=>{var q=(dq(),W6(mq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),Hr=l$(($,q)=>{var K=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,P=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,_=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,O=Wr(),j=BS(),z=aq().Buffer;q.exports=function(J,w){var k=J.toString(),X=k.match(K),G;if(!X){var V=k.match(_);G=z.from(V[2].replace(/[\r\n]/g,""),"base64")}else{var C="aes"+X[1],E=z.from(X[2],"hex"),h=z.from(X[3].replace(/[\r\n]/g,""),"base64"),I=O(w,E.slice(0,8),parseInt(X[1],10)).key,D=[],g=j.createDecipheriv(C,I,E);D.push(g.update(h)),D.push(g.final()),G=z.concat(D)}var u=k.match(P)[1];return{tag:u,data:G}}}),tS=l$(($,q)=>{var K=Or(),P=Yr(),_=Hr(),O=BS(),j=xS(),z=aq().Buffer;function J(k,X){var G=k.algorithm.decrypt.kde.kdeparams.salt,V=parseInt(k.algorithm.decrypt.kde.kdeparams.iters.toString(),10),C=P[k.algorithm.decrypt.cipher.algo.join(".")],E=k.algorithm.decrypt.cipher.iv,h=k.subjectPrivateKey,I=parseInt(C.split("-")[1],10)/8,D=j.pbkdf2Sync(X,G,V,I,"sha1"),g=O.createDecipheriv(C,D,E),u=[];return u.push(g.update(h)),u.push(g.final()),z.concat(u)}function w(k){var X;if(typeof k==="object"&&!z.isBuffer(k))X=k.passphrase,k=k.key;if(typeof k==="string")k=z.from(k);var G=_(k,X),V=G.tag,C=G.data,E,h;switch(V){case"CERTIFICATE":h=K.certificate.decode(C,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!h)h=K.PublicKey.decode(C,"der");switch(E=h.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPublicKey.decode(h.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return h.subjectPrivateKey=h.subjectPublicKey,{type:"ec",data:h};case"1.2.840.10040.4.1":return h.algorithm.params.pub_key=K.DSAparam.decode(h.subjectPublicKey.data,"der"),{type:"dsa",data:h.algorithm.params};default:throw Error("unknown key id "+E)}case"ENCRYPTED PRIVATE KEY":C=K.EncryptedPrivateKey.decode(C,"der"),C=J(C,X);case"PRIVATE KEY":switch(h=K.PrivateKey.decode(C,"der"),E=h.algorithm.algorithm.join("."),E){case"1.2.840.113549.1.1.1":return K.RSAPrivateKey.decode(h.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:h.algorithm.curve,privateKey:K.ECPrivateKey.decode(h.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return h.algorithm.params.priv_key=K.DSAparam.decode(h.subjectPrivateKey,"der"),{type:"dsa",params:h.algorithm.params};default:throw Error("unknown key id "+E)}case"RSA PUBLIC KEY":return K.RSAPublicKey.decode(C,"der");case"RSA PRIVATE KEY":return K.RSAPrivateKey.decode(C,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:K.DSAPrivateKey.decode(C,"der")};case"EC PRIVATE KEY":return C=K.ECPrivateKey.decode(C,"der"),{curve:C.parameters.value,privateKey:C.privateKey};default:throw Error("unknown key type "+V)}}w.signature=K.signature,q.exports=w}),US=l$(($,q)=>{var K=Bj(),P=aq().Buffer;q.exports=function(O,j){var z=P.alloc(0),J=0,w;while(z.length<j)w=_(J++),z=P.concat([z,K("sha1").update(O).update(w).digest()]);return z.slice(0,j)};function _(O){var j=P.allocUnsafe(4);return j.writeUInt32BE(O,0),j}}),FS=l$(($,q)=>{q.exports=function(P,_){var O=P.length,j=-1;while(++j<O)P[j]^=_[j];return P}}),HH=l$(($,q)=>{(function(K,P){function _(M,Y){if(!M)throw Error(Y||"Assertion failed")}function O(M,Y){M.super_=Y;var H=function(){};H.prototype=Y.prototype,M.prototype=new H,M.prototype.constructor=M}function j(M,Y,H){if(j.isBN(M))return M;if(this.negative=0,this.words=null,this.length=0,this.red=null,M!==null){if(Y==="le"||Y==="be")H=Y,Y=10;this._init(M||0,Y||10,H||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(M){}j.isBN=function(Y){if(Y instanceof j)return!0;return Y!==null&&typeof Y==="object"&&Y.constructor.wordSize===j.wordSize&&Array.isArray(Y.words)},j.max=function(Y,H){if(Y.cmp(H)>0)return Y;return H},j.min=function(Y,H){if(Y.cmp(H)<0)return Y;return H},j.prototype._init=function(Y,H,T){if(typeof Y==="number")return this._initNumber(Y,H,T);if(typeof Y==="object")return this._initArray(Y,H,T);if(H==="hex")H=16;_(H===(H|0)&&H>=2&&H<=36),Y=Y.toString().replace(/\s+/g,"");var W=0;if(Y[0]==="-")W++,this.negative=1;if(W<Y.length){if(H===16)this._parseHex(Y,W,T);else if(this._parseBase(Y,H,W),T==="le")this._initArray(this.toArray(),H,T)}},j.prototype._initNumber=function(Y,H,T){if(Y<0)this.negative=1,Y=-Y;if(Y<67108864)this.words=[Y&67108863],this.length=1;else if(Y<4503599627370496)this.words=[Y&67108863,Y/67108864&67108863],this.length=2;else _(Y<9007199254740992),this.words=[Y&67108863,Y/67108864&67108863,1],this.length=3;if(T!=="le")return;this._initArray(this.toArray(),H,T)},j.prototype._initArray=function(Y,H,T){if(_(typeof Y.length==="number"),Y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Y.length/3),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z,S,N=0;if(T==="be"){for(W=Y.length-1,Z=0;W>=0;W-=3)if(S=Y[W]|Y[W-1]<<8|Y[W-2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}else if(T==="le"){for(W=0,Z=0;W<Y.length;W+=3)if(S=Y[W]|Y[W+1]<<8|Y[W+2]<<16,this.words[Z]|=S<<N&67108863,this.words[Z+1]=S>>>26-N&67108863,N+=24,N>=26)N-=26,Z++}return this.strip()};function J(M,Y){var H=M.charCodeAt(Y);if(H>=65&&H<=70)return H-55;else if(H>=97&&H<=102)return H-87;else return H-48&15}function w(M,Y,H){var T=J(M,H);if(H-1>=Y)T|=J(M,H-1)<<4;return T}j.prototype._parseHex=function(Y,H,T){this.length=Math.ceil((Y.length-H)/6),this.words=Array(this.length);for(var W=0;W<this.length;W++)this.words[W]=0;var Z=0,S=0,N;if(T==="be")for(W=Y.length-1;W>=H;W-=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8;else{var f=Y.length-H;for(W=f%2===0?H+1:H;W<Y.length;W+=2)if(N=w(Y,H,W)<<Z,this.words[S]|=N&67108863,Z>=18)Z-=18,S+=1,this.words[S]|=N>>>26;else Z+=8}this.strip()};function k(M,Y,H,T){var W=0,Z=Math.min(M.length,H);for(var S=Y;S<Z;S++){var N=M.charCodeAt(S)-48;if(W*=T,N>=49)W+=N-49+10;else if(N>=17)W+=N-17+10;else W+=N}return W}j.prototype._parseBase=function(Y,H,T){this.words=[0],this.length=1;for(var W=0,Z=1;Z<=67108863;Z*=H)W++;W--,Z=Z/H|0;var S=Y.length-T,N=S%W,f=Math.min(S,S-N)+T,v=0;for(var A=T;A<f;A+=W)if(v=k(Y,A,A+W,H),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(N!==0){var L=1;v=k(Y,A,Y.length,H);for(A=0;A<N;A++)L*=H;if(this.imuln(L),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},j.prototype.copy=function(Y){Y.words=Array(this.length);for(var H=0;H<this.length;H++)Y.words[H]=this.words[H];Y.length=this.length,Y.negative=this.negative,Y.red=this.red},j.prototype.clone=function(){var Y=new j(null);return this.copy(Y),Y},j.prototype._expand=function(Y){while(this.length<Y)this.words[this.length++]=0;return this},j.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},j.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var X=["","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"],G=[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],V=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(Y,H){Y=Y||10,H=H|0||1;var T;if(Y===16||Y==="hex"){T="";var W=0,Z=0;for(var S=0;S<this.length;S++){var N=this.words[S],f=((N<<W|Z)&16777215).toString(16);if(Z=N>>>24-W&16777215,W+=2,W>=26)W-=26,S--;if(Z!==0||S!==this.length-1)T=X[6-f.length]+f+T;else T=f+T}if(Z!==0)T=Z.toString(16)+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}if(Y===(Y|0)&&Y>=2&&Y<=36){var v=G[Y],A=V[Y];T="";var L=this.clone();L.negative=0;while(!L.isZero()){var R=L.modn(A).toString(Y);if(L=L.idivn(A),!L.isZero())T=X[v-R.length]+R+T;else T=R+T}if(this.isZero())T="0"+T;while(T.length%H!==0)T="0"+T;if(this.negative!==0)T="-"+T;return T}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var Y=this.words[0];if(this.length===2)Y+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Y+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Y:Y},j.prototype.toJSON=function(){return this.toString(16)},j.prototype.toBuffer=function(Y,H){return _(typeof z<"u"),this.toArrayLike(z,Y,H)},j.prototype.toArray=function(Y,H){return this.toArrayLike(Array,Y,H)},j.prototype.toArrayLike=function(Y,H,T){var W=this.byteLength(),Z=T||Math.max(1,W);_(W<=Z,"byte array longer than desired length"),_(Z>0,"Requested array length <= 0"),this.strip();var S=H==="le",N=new Y(Z),f,v,A=this.clone();if(!S){for(v=0;v<Z-W;v++)N[v]=0;for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[Z-v-1]=f}else{for(v=0;!A.isZero();v++)f=A.andln(255),A.iushrn(8),N[v]=f;for(;v<Z;v++)N[v]=0}return N},Math.clz32)j.prototype._countBits=function(Y){return 32-Math.clz32(Y)};else j.prototype._countBits=function(Y){var H=Y,T=0;if(H>=4096)T+=13,H>>>=13;if(H>=64)T+=7,H>>>=7;if(H>=8)T+=4,H>>>=4;if(H>=2)T+=2,H>>>=2;return T+H};j.prototype._zeroBits=function(Y){if(Y===0)return 26;var H=Y,T=0;if((H&8191)===0)T+=13,H>>>=13;if((H&127)===0)T+=7,H>>>=7;if((H&15)===0)T+=4,H>>>=4;if((H&3)===0)T+=2,H>>>=2;if((H&1)===0)T++;return T},j.prototype.bitLength=function(){var Y=this.words[this.length-1],H=this._countBits(Y);return(this.length-1)*26+H};function C(M){var Y=Array(M.bitLength());for(var H=0;H<Y.length;H++){var T=H/26|0,W=H%26;Y[H]=(M.words[T]&1<<W)>>>W}return Y}j.prototype.zeroBits=function(){if(this.isZero())return 0;var Y=0;for(var H=0;H<this.length;H++){var T=this._zeroBits(this.words[H]);if(Y+=T,T!==26)break}return Y},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(Y){if(this.negative!==0)return this.abs().inotn(Y).iaddn(1);return this.clone()},j.prototype.fromTwos=function(Y){if(this.testn(Y-1))return this.notn(Y).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(Y){while(this.length<Y.length)this.words[this.length++]=0;for(var H=0;H<Y.length;H++)this.words[H]=this.words[H]|Y.words[H];return this.strip()},j.prototype.ior=function(Y){return _((this.negative|Y.negative)===0),this.iuor(Y)},j.prototype.or=function(Y){if(this.length>Y.length)return this.clone().ior(Y);return Y.clone().ior(this)},j.prototype.uor=function(Y){if(this.length>Y.length)return this.clone().iuor(Y);return Y.clone().iuor(this)},j.prototype.iuand=function(Y){var H;if(this.length>Y.length)H=Y;else H=this;for(var T=0;T<H.length;T++)this.words[T]=this.words[T]&Y.words[T];return this.length=H.length,this.strip()},j.prototype.iand=function(Y){return _((this.negative|Y.negative)===0),this.iuand(Y)},j.prototype.and=function(Y){if(this.length>Y.length)return this.clone().iand(Y);return Y.clone().iand(this)},j.prototype.uand=function(Y){if(this.length>Y.length)return this.clone().iuand(Y);return Y.clone().iuand(this)},j.prototype.iuxor=function(Y){var H,T;if(this.length>Y.length)H=this,T=Y;else H=Y,T=this;for(var W=0;W<T.length;W++)this.words[W]=H.words[W]^T.words[W];if(this!==H)for(;W<H.length;W++)this.words[W]=H.words[W];return this.length=H.length,this.strip()},j.prototype.ixor=function(Y){return _((this.negative|Y.negative)===0),this.iuxor(Y)},j.prototype.xor=function(Y){if(this.length>Y.length)return this.clone().ixor(Y);return Y.clone().ixor(this)},j.prototype.uxor=function(Y){if(this.length>Y.length)return this.clone().iuxor(Y);return Y.clone().iuxor(this)},j.prototype.inotn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Math.ceil(Y/26)|0,T=Y%26;if(this._expand(H),T>0)H--;for(var W=0;W<H;W++)this.words[W]=~this.words[W]&67108863;if(T>0)this.words[W]=~this.words[W]&67108863>>26-T;return this.strip()},j.prototype.notn=function(Y){return this.clone().inotn(Y)},j.prototype.setn=function(Y,H){_(typeof Y==="number"&&Y>=0);var T=Y/26|0,W=Y%26;if(this._expand(T+1),H)this.words[T]=this.words[T]|1<<W;else this.words[T]=this.words[T]&~(1<<W);return this.strip()},j.prototype.iadd=function(Y){var H;if(this.negative!==0&&Y.negative===0)return this.negative=0,H=this.isub(Y),this.negative^=1,this._normSign();else if(this.negative===0&&Y.negative!==0)return Y.negative=0,H=this.isub(Y),Y.negative=1,H._normSign();var T,W;if(this.length>Y.length)T=this,W=Y;else T=Y,W=this;var Z=0;for(var S=0;S<W.length;S++)H=(T.words[S]|0)+(W.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;for(;Z!==0&&S<T.length;S++)H=(T.words[S]|0)+Z,this.words[S]=H&67108863,Z=H>>>26;if(this.length=T.length,Z!==0)this.words[this.length]=Z,this.length++;else if(T!==this)for(;S<T.length;S++)this.words[S]=T.words[S];return this},j.prototype.add=function(Y){var H;if(Y.negative!==0&&this.negative===0)return Y.negative=0,H=this.sub(Y),Y.negative^=1,H;else if(Y.negative===0&&this.negative!==0)return this.negative=0,H=Y.sub(this),this.negative=1,H;if(this.length>Y.length)return this.clone().iadd(Y);return Y.clone().iadd(this)},j.prototype.isub=function(Y){if(Y.negative!==0){Y.negative=0;var H=this.iadd(Y);return Y.negative=1,H._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Y),this.negative=1,this._normSign();var T=this.cmp(Y);if(T===0)return this.negative=0,this.length=1,this.words[0]=0,this;var W,Z;if(T>0)W=this,Z=Y;else W=Y,Z=this;var S=0;for(var N=0;N<Z.length;N++)H=(W.words[N]|0)-(Z.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;for(;S!==0&&N<W.length;N++)H=(W.words[N]|0)+S,S=H>>26,this.words[N]=H&67108863;if(S===0&&N<W.length&&W!==this)for(;N<W.length;N++)this.words[N]=W.words[N];if(this.length=Math.max(this.length,N),W!==this)this.negative=1;return this.strip()},j.prototype.sub=function(Y){return this.clone().isub(Y)};function E(M,Y,H){H.negative=Y.negative^M.negative;var T=M.length+Y.length|0;H.length=T,T=T-1|0;var W=M.words[0]|0,Z=Y.words[0]|0,S=W*Z,N=S&67108863,f=S/67108864|0;H.words[0]=N;for(var v=1;v<T;v++){var A=f>>>26,L=f&67108863,R=Math.min(v,Y.length-1);for(var b=Math.max(0,v-M.length+1);b<=R;b++){var d=v-b|0;W=M.words[d]|0,Z=Y.words[b]|0,S=W*Z+L,A+=S/67108864|0,L=S&67108863}H.words[v]=L|0,f=A|0}if(f!==0)H.words[v]=f|0;else H.length--;return H.strip()}var h=function(Y,H,T){var W=Y.words,Z=H.words,S=T.words,N=0,f,v,A,L=W[0]|0,R=L&8191,b=L>>>13,d=W[1]|0,i=d&8191,F=d>>>13,W$=W[2]|0,n=W$&8191,B=W$>>>13,y$=W[3]|0,Y$=y$&8191,v$=y$>>>13,a=W[4]|0,r=a&8191,t=a>>>13,x$=W[5]|0,q$=x$&8191,$$=x$>>>13,s=W[6]|0,U=s&8191,_$=s>>>13,f$=W[7]|0,O$=f$&8191,T$=f$>>>13,O6=W[8]|0,H$=O6&8191,X$=O6>>>13,X6=W[9]|0,w$=X6&8191,G$=X6>>>13,y6=Z[0]|0,k$=y6&8191,I$=y6>>>13,zq=Z[1]|0,D$=zq&8191,L$=zq>>>13,Vq=Z[2]|0,C$=Vq&8191,E$=Vq>>>13,Sq=Z[3]|0,h$=Sq&8191,V$=Sq>>>13,Mq=Z[4]|0,b$=Mq&8191,S$=Mq>>>13,Wq=Z[5]|0,x=Wq&8191,c=Wq>>>13,c$=Z[6]|0,K$=c$&8191,j$=c$>>>13,k6=Z[7]|0,Z$=k6&8191,A$=k6>>>13,Hq=Z[8]|0,g$=Hq&8191,R$=Hq>>>13,Jq=Z[9]|0,M$=Jq&8191,N$=Jq>>>13;T.negative=Y.negative^H.negative,T.length=19,f=Math.imul(R,k$),v=Math.imul(R,I$),v=v+Math.imul(b,k$)|0,A=Math.imul(b,I$);var b6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(b6>>>26)|0,b6&=67108863,f=Math.imul(i,k$),v=Math.imul(i,I$),v=v+Math.imul(F,k$)|0,A=Math.imul(F,I$),f=f+Math.imul(R,D$)|0,v=v+Math.imul(R,L$)|0,v=v+Math.imul(b,D$)|0,A=A+Math.imul(b,L$)|0;var Y6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Y6>>>26)|0,Y6&=67108863,f=Math.imul(n,k$),v=Math.imul(n,I$),v=v+Math.imul(B,k$)|0,A=Math.imul(B,I$),f=f+Math.imul(i,D$)|0,v=v+Math.imul(i,L$)|0,v=v+Math.imul(F,D$)|0,A=A+Math.imul(F,L$)|0,f=f+Math.imul(R,C$)|0,v=v+Math.imul(R,E$)|0,v=v+Math.imul(b,C$)|0,A=A+Math.imul(b,E$)|0;var K6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(K6>>>26)|0,K6&=67108863,f=Math.imul(Y$,k$),v=Math.imul(Y$,I$),v=v+Math.imul(v$,k$)|0,A=Math.imul(v$,I$),f=f+Math.imul(n,D$)|0,v=v+Math.imul(n,L$)|0,v=v+Math.imul(B,D$)|0,A=A+Math.imul(B,L$)|0,f=f+Math.imul(i,C$)|0,v=v+Math.imul(i,E$)|0,v=v+Math.imul(F,C$)|0,A=A+Math.imul(F,E$)|0,f=f+Math.imul(R,h$)|0,v=v+Math.imul(R,V$)|0,v=v+Math.imul(b,h$)|0,A=A+Math.imul(b,V$)|0;var G6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(G6>>>26)|0,G6&=67108863,f=Math.imul(r,k$),v=Math.imul(r,I$),v=v+Math.imul(t,k$)|0,A=Math.imul(t,I$),f=f+Math.imul(Y$,D$)|0,v=v+Math.imul(Y$,L$)|0,v=v+Math.imul(v$,D$)|0,A=A+Math.imul(v$,L$)|0,f=f+Math.imul(n,C$)|0,v=v+Math.imul(n,E$)|0,v=v+Math.imul(B,C$)|0,A=A+Math.imul(B,E$)|0,f=f+Math.imul(i,h$)|0,v=v+Math.imul(i,V$)|0,v=v+Math.imul(F,h$)|0,A=A+Math.imul(F,V$)|0,f=f+Math.imul(R,b$)|0,v=v+Math.imul(R,S$)|0,v=v+Math.imul(b,b$)|0,A=A+Math.imul(b,S$)|0;var d6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(d6>>>26)|0,d6&=67108863,f=Math.imul(q$,k$),v=Math.imul(q$,I$),v=v+Math.imul($$,k$)|0,A=Math.imul($$,I$),f=f+Math.imul(r,D$)|0,v=v+Math.imul(r,L$)|0,v=v+Math.imul(t,D$)|0,A=A+Math.imul(t,L$)|0,f=f+Math.imul(Y$,C$)|0,v=v+Math.imul(Y$,E$)|0,v=v+Math.imul(v$,C$)|0,A=A+Math.imul(v$,E$)|0,f=f+Math.imul(n,h$)|0,v=v+Math.imul(n,V$)|0,v=v+Math.imul(B,h$)|0,A=A+Math.imul(B,V$)|0,f=f+Math.imul(i,b$)|0,v=v+Math.imul(i,S$)|0,v=v+Math.imul(F,b$)|0,A=A+Math.imul(F,S$)|0,f=f+Math.imul(R,x)|0,v=v+Math.imul(R,c)|0,v=v+Math.imul(b,x)|0,A=A+Math.imul(b,c)|0;var l6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(l6>>>26)|0,l6&=67108863,f=Math.imul(U,k$),v=Math.imul(U,I$),v=v+Math.imul(_$,k$)|0,A=Math.imul(_$,I$),f=f+Math.imul(q$,D$)|0,v=v+Math.imul(q$,L$)|0,v=v+Math.imul($$,D$)|0,A=A+Math.imul($$,L$)|0,f=f+Math.imul(r,C$)|0,v=v+Math.imul(r,E$)|0,v=v+Math.imul(t,C$)|0,A=A+Math.imul(t,E$)|0,f=f+Math.imul(Y$,h$)|0,v=v+Math.imul(Y$,V$)|0,v=v+Math.imul(v$,h$)|0,A=A+Math.imul(v$,V$)|0,f=f+Math.imul(n,b$)|0,v=v+Math.imul(n,S$)|0,v=v+Math.imul(B,b$)|0,A=A+Math.imul(B,S$)|0,f=f+Math.imul(i,x)|0,v=v+Math.imul(i,c)|0,v=v+Math.imul(F,x)|0,A=A+Math.imul(F,c)|0,f=f+Math.imul(R,K$)|0,v=v+Math.imul(R,j$)|0,v=v+Math.imul(b,K$)|0,A=A+Math.imul(b,j$)|0;var r6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(r6>>>26)|0,r6&=67108863,f=Math.imul(O$,k$),v=Math.imul(O$,I$),v=v+Math.imul(T$,k$)|0,A=Math.imul(T$,I$),f=f+Math.imul(U,D$)|0,v=v+Math.imul(U,L$)|0,v=v+Math.imul(_$,D$)|0,A=A+Math.imul(_$,L$)|0,f=f+Math.imul(q$,C$)|0,v=v+Math.imul(q$,E$)|0,v=v+Math.imul($$,C$)|0,A=A+Math.imul($$,E$)|0,f=f+Math.imul(r,h$)|0,v=v+Math.imul(r,V$)|0,v=v+Math.imul(t,h$)|0,A=A+Math.imul(t,V$)|0,f=f+Math.imul(Y$,b$)|0,v=v+Math.imul(Y$,S$)|0,v=v+Math.imul(v$,b$)|0,A=A+Math.imul(v$,S$)|0,f=f+Math.imul(n,x)|0,v=v+Math.imul(n,c)|0,v=v+Math.imul(B,x)|0,A=A+Math.imul(B,c)|0,f=f+Math.imul(i,K$)|0,v=v+Math.imul(i,j$)|0,v=v+Math.imul(F,K$)|0,A=A+Math.imul(F,j$)|0,f=f+Math.imul(R,Z$)|0,v=v+Math.imul(R,A$)|0,v=v+Math.imul(b,Z$)|0,A=A+Math.imul(b,A$)|0;var o6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(o6>>>26)|0,o6&=67108863,f=Math.imul(H$,k$),v=Math.imul(H$,I$),v=v+Math.imul(X$,k$)|0,A=Math.imul(X$,I$),f=f+Math.imul(O$,D$)|0,v=v+Math.imul(O$,L$)|0,v=v+Math.imul(T$,D$)|0,A=A+Math.imul(T$,L$)|0,f=f+Math.imul(U,C$)|0,v=v+Math.imul(U,E$)|0,v=v+Math.imul(_$,C$)|0,A=A+Math.imul(_$,E$)|0,f=f+Math.imul(q$,h$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul($$,h$)|0,A=A+Math.imul($$,V$)|0,f=f+Math.imul(r,b$)|0,v=v+Math.imul(r,S$)|0,v=v+Math.imul(t,b$)|0,A=A+Math.imul(t,S$)|0,f=f+Math.imul(Y$,x)|0,v=v+Math.imul(Y$,c)|0,v=v+Math.imul(v$,x)|0,A=A+Math.imul(v$,c)|0,f=f+Math.imul(n,K$)|0,v=v+Math.imul(n,j$)|0,v=v+Math.imul(B,K$)|0,A=A+Math.imul(B,j$)|0,f=f+Math.imul(i,Z$)|0,v=v+Math.imul(i,A$)|0,v=v+Math.imul(F,Z$)|0,A=A+Math.imul(F,A$)|0,f=f+Math.imul(R,g$)|0,v=v+Math.imul(R,R$)|0,v=v+Math.imul(b,g$)|0,A=A+Math.imul(b,R$)|0;var n6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(n6>>>26)|0,n6&=67108863,f=Math.imul(w$,k$),v=Math.imul(w$,I$),v=v+Math.imul(G$,k$)|0,A=Math.imul(G$,I$),f=f+Math.imul(H$,D$)|0,v=v+Math.imul(H$,L$)|0,v=v+Math.imul(X$,D$)|0,A=A+Math.imul(X$,L$)|0,f=f+Math.imul(O$,C$)|0,v=v+Math.imul(O$,E$)|0,v=v+Math.imul(T$,C$)|0,A=A+Math.imul(T$,E$)|0,f=f+Math.imul(U,h$)|0,v=v+Math.imul(U,V$)|0,v=v+Math.imul(_$,h$)|0,A=A+Math.imul(_$,V$)|0,f=f+Math.imul(q$,b$)|0,v=v+Math.imul(q$,S$)|0,v=v+Math.imul($$,b$)|0,A=A+Math.imul($$,S$)|0,f=f+Math.imul(r,x)|0,v=v+Math.imul(r,c)|0,v=v+Math.imul(t,x)|0,A=A+Math.imul(t,c)|0,f=f+Math.imul(Y$,K$)|0,v=v+Math.imul(Y$,j$)|0,v=v+Math.imul(v$,K$)|0,A=A+Math.imul(v$,j$)|0,f=f+Math.imul(n,Z$)|0,v=v+Math.imul(n,A$)|0,v=v+Math.imul(B,Z$)|0,A=A+Math.imul(B,A$)|0,f=f+Math.imul(i,g$)|0,v=v+Math.imul(i,R$)|0,v=v+Math.imul(F,g$)|0,A=A+Math.imul(F,R$)|0,f=f+Math.imul(R,M$)|0,v=v+Math.imul(R,N$)|0,v=v+Math.imul(b,M$)|0,A=A+Math.imul(b,N$)|0;var i6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(i6>>>26)|0,i6&=67108863,f=Math.imul(w$,D$),v=Math.imul(w$,L$),v=v+Math.imul(G$,D$)|0,A=Math.imul(G$,L$),f=f+Math.imul(H$,C$)|0,v=v+Math.imul(H$,E$)|0,v=v+Math.imul(X$,C$)|0,A=A+Math.imul(X$,E$)|0,f=f+Math.imul(O$,h$)|0,v=v+Math.imul(O$,V$)|0,v=v+Math.imul(T$,h$)|0,A=A+Math.imul(T$,V$)|0,f=f+Math.imul(U,b$)|0,v=v+Math.imul(U,S$)|0,v=v+Math.imul(_$,b$)|0,A=A+Math.imul(_$,S$)|0,f=f+Math.imul(q$,x)|0,v=v+Math.imul(q$,c)|0,v=v+Math.imul($$,x)|0,A=A+Math.imul($$,c)|0,f=f+Math.imul(r,K$)|0,v=v+Math.imul(r,j$)|0,v=v+Math.imul(t,K$)|0,A=A+Math.imul(t,j$)|0,f=f+Math.imul(Y$,Z$)|0,v=v+Math.imul(Y$,A$)|0,v=v+Math.imul(v$,Z$)|0,A=A+Math.imul(v$,A$)|0,f=f+Math.imul(n,g$)|0,v=v+Math.imul(n,R$)|0,v=v+Math.imul(B,g$)|0,A=A+Math.imul(B,R$)|0,f=f+Math.imul(i,M$)|0,v=v+Math.imul(i,N$)|0,v=v+Math.imul(F,M$)|0,A=A+Math.imul(F,N$)|0;var B6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(B6>>>26)|0,B6&=67108863,f=Math.imul(w$,C$),v=Math.imul(w$,E$),v=v+Math.imul(G$,C$)|0,A=Math.imul(G$,E$),f=f+Math.imul(H$,h$)|0,v=v+Math.imul(H$,V$)|0,v=v+Math.imul(X$,h$)|0,A=A+Math.imul(X$,V$)|0,f=f+Math.imul(O$,b$)|0,v=v+Math.imul(O$,S$)|0,v=v+Math.imul(T$,b$)|0,A=A+Math.imul(T$,S$)|0,f=f+Math.imul(U,x)|0,v=v+Math.imul(U,c)|0,v=v+Math.imul(_$,x)|0,A=A+Math.imul(_$,c)|0,f=f+Math.imul(q$,K$)|0,v=v+Math.imul(q$,j$)|0,v=v+Math.imul($$,K$)|0,A=A+Math.imul($$,j$)|0,f=f+Math.imul(r,Z$)|0,v=v+Math.imul(r,A$)|0,v=v+Math.imul(t,Z$)|0,A=A+Math.imul(t,A$)|0,f=f+Math.imul(Y$,g$)|0,v=v+Math.imul(Y$,R$)|0,v=v+Math.imul(v$,g$)|0,A=A+Math.imul(v$,R$)|0,f=f+Math.imul(n,M$)|0,v=v+Math.imul(n,N$)|0,v=v+Math.imul(B,M$)|0,A=A+Math.imul(B,N$)|0;var t6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,f=Math.imul(w$,h$),v=Math.imul(w$,V$),v=v+Math.imul(G$,h$)|0,A=Math.imul(G$,V$),f=f+Math.imul(H$,b$)|0,v=v+Math.imul(H$,S$)|0,v=v+Math.imul(X$,b$)|0,A=A+Math.imul(X$,S$)|0,f=f+Math.imul(O$,x)|0,v=v+Math.imul(O$,c)|0,v=v+Math.imul(T$,x)|0,A=A+Math.imul(T$,c)|0,f=f+Math.imul(U,K$)|0,v=v+Math.imul(U,j$)|0,v=v+Math.imul(_$,K$)|0,A=A+Math.imul(_$,j$)|0,f=f+Math.imul(q$,Z$)|0,v=v+Math.imul(q$,A$)|0,v=v+Math.imul($$,Z$)|0,A=A+Math.imul($$,A$)|0,f=f+Math.imul(r,g$)|0,v=v+Math.imul(r,R$)|0,v=v+Math.imul(t,g$)|0,A=A+Math.imul(t,R$)|0,f=f+Math.imul(Y$,M$)|0,v=v+Math.imul(Y$,N$)|0,v=v+Math.imul(v$,M$)|0,A=A+Math.imul(v$,N$)|0;var U6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,f=Math.imul(w$,b$),v=Math.imul(w$,S$),v=v+Math.imul(G$,b$)|0,A=Math.imul(G$,S$),f=f+Math.imul(H$,x)|0,v=v+Math.imul(H$,c)|0,v=v+Math.imul(X$,x)|0,A=A+Math.imul(X$,c)|0,f=f+Math.imul(O$,K$)|0,v=v+Math.imul(O$,j$)|0,v=v+Math.imul(T$,K$)|0,A=A+Math.imul(T$,j$)|0,f=f+Math.imul(U,Z$)|0,v=v+Math.imul(U,A$)|0,v=v+Math.imul(_$,Z$)|0,A=A+Math.imul(_$,A$)|0,f=f+Math.imul(q$,g$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul($$,g$)|0,A=A+Math.imul($$,R$)|0,f=f+Math.imul(r,M$)|0,v=v+Math.imul(r,N$)|0,v=v+Math.imul(t,M$)|0,A=A+Math.imul(t,N$)|0;var F6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,f=Math.imul(w$,x),v=Math.imul(w$,c),v=v+Math.imul(G$,x)|0,A=Math.imul(G$,c),f=f+Math.imul(H$,K$)|0,v=v+Math.imul(H$,j$)|0,v=v+Math.imul(X$,K$)|0,A=A+Math.imul(X$,j$)|0,f=f+Math.imul(O$,Z$)|0,v=v+Math.imul(O$,A$)|0,v=v+Math.imul(T$,Z$)|0,A=A+Math.imul(T$,A$)|0,f=f+Math.imul(U,g$)|0,v=v+Math.imul(U,R$)|0,v=v+Math.imul(_$,g$)|0,A=A+Math.imul(_$,R$)|0,f=f+Math.imul(q$,M$)|0,v=v+Math.imul(q$,N$)|0,v=v+Math.imul($$,M$)|0,A=A+Math.imul($$,N$)|0;var a6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,f=Math.imul(w$,K$),v=Math.imul(w$,j$),v=v+Math.imul(G$,K$)|0,A=Math.imul(G$,j$),f=f+Math.imul(H$,Z$)|0,v=v+Math.imul(H$,A$)|0,v=v+Math.imul(X$,Z$)|0,A=A+Math.imul(X$,A$)|0,f=f+Math.imul(O$,g$)|0,v=v+Math.imul(O$,R$)|0,v=v+Math.imul(T$,g$)|0,A=A+Math.imul(T$,R$)|0,f=f+Math.imul(U,M$)|0,v=v+Math.imul(U,N$)|0,v=v+Math.imul(_$,M$)|0,A=A+Math.imul(_$,N$)|0;var Q6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,f=Math.imul(w$,Z$),v=Math.imul(w$,A$),v=v+Math.imul(G$,Z$)|0,A=Math.imul(G$,A$),f=f+Math.imul(H$,g$)|0,v=v+Math.imul(H$,R$)|0,v=v+Math.imul(X$,g$)|0,A=A+Math.imul(X$,R$)|0,f=f+Math.imul(O$,M$)|0,v=v+Math.imul(O$,N$)|0,v=v+Math.imul(T$,M$)|0,A=A+Math.imul(T$,N$)|0;var e6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,f=Math.imul(w$,g$),v=Math.imul(w$,R$),v=v+Math.imul(G$,g$)|0,A=Math.imul(G$,R$),f=f+Math.imul(H$,M$)|0,v=v+Math.imul(H$,N$)|0,v=v+Math.imul(X$,M$)|0,A=A+Math.imul(X$,N$)|0;var s6=(N+f|0)+((v&8191)<<13)|0;N=(A+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,f=Math.imul(w$,M$),v=Math.imul(w$,N$),v=v+Math.imul(G$,M$)|0,A=Math.imul(G$,N$);var $q=(N+f|0)+((v&8191)<<13)|0;if(N=(A+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,S[0]=b6,S[1]=Y6,S[2]=K6,S[3]=G6,S[4]=d6,S[5]=l6,S[6]=r6,S[7]=o6,S[8]=n6,S[9]=i6,S[10]=B6,S[11]=t6,S[12]=U6,S[13]=F6,S[14]=a6,S[15]=Q6,S[16]=e6,S[17]=s6,S[18]=$q,N!==0)S[19]=N,T.length++;return T};if(!Math.imul)h=E;function I(M,Y,H){H.negative=Y.negative^M.negative,H.length=M.length+Y.length;var T=0,W=0;for(var Z=0;Z<H.length-1;Z++){var S=W;W=0;var N=T&67108863,f=Math.min(Z,Y.length-1);for(var v=Math.max(0,Z-M.length+1);v<=f;v++){var A=Z-v,L=M.words[A]|0,R=Y.words[v]|0,b=L*R,d=b&67108863;S=S+(b/67108864|0)|0,d=d+N|0,N=d&67108863,S=S+(d>>>26)|0,W+=S>>>26,S&=67108863}H.words[Z]=N,T=S,S=W}if(T!==0)H.words[Z]=T;else H.length--;return H.strip()}function D(M,Y,H){var T=new g;return T.mulp(M,Y,H)}j.prototype.mulTo=function(Y,H){var T,W=this.length+Y.length;if(this.length===10&&Y.length===10)T=h(this,Y,H);else if(W<63)T=E(this,Y,H);else if(W<1024)T=I(this,Y,H);else T=D(this,Y,H);return T};function g(M,Y){this.x=M,this.y=Y}g.prototype.makeRBT=function(Y){var H=Array(Y),T=j.prototype._countBits(Y)-1;for(var W=0;W<Y;W++)H[W]=this.revBin(W,T,Y);return H},g.prototype.revBin=function(Y,H,T){if(Y===0||Y===T-1)return Y;var W=0;for(var Z=0;Z<H;Z++)W|=(Y&1)<<H-Z-1,Y>>=1;return W},g.prototype.permute=function(Y,H,T,W,Z,S){for(var N=0;N<S;N++)W[N]=H[Y[N]],Z[N]=T[Y[N]]},g.prototype.transform=function(Y,H,T,W,Z,S){this.permute(S,Y,H,T,W,Z);for(var N=1;N<Z;N<<=1){var f=N<<1,v=Math.cos(2*Math.PI/f),A=Math.sin(2*Math.PI/f);for(var L=0;L<Z;L+=f){var R=v,b=A;for(var d=0;d<N;d++){var i=T[L+d],F=W[L+d],W$=T[L+d+N],n=W[L+d+N],B=R*W$-b*n;if(n=R*n+b*W$,W$=B,T[L+d]=i+W$,W[L+d]=F+n,T[L+d+N]=i-W$,W[L+d+N]=F-n,d!==f)B=v*R-A*b,b=v*b+A*R,R=B}}}},g.prototype.guessLen13b=function(Y,H){var T=Math.max(H,Y)|1,W=T&1,Z=0;for(T=T/2|0;T;T=T>>>1)Z++;return 1<<Z+1+W},g.prototype.conjugate=function(Y,H,T){if(T<=1)return;for(var W=0;W<T/2;W++){var Z=Y[W];Y[W]=Y[T-W-1],Y[T-W-1]=Z,Z=H[W],H[W]=-H[T-W-1],H[T-W-1]=-Z}},g.prototype.normalize13b=function(Y,H){var T=0;for(var W=0;W<H/2;W++){var Z=Math.round(Y[2*W+1]/H)*8192+Math.round(Y[2*W]/H)+T;if(Y[W]=Z&67108863,Z<67108864)T=0;else T=Z/67108864|0}return Y},g.prototype.convert13b=function(Y,H,T,W){var Z=0;for(var S=0;S<H;S++)Z=Z+(Y[S]|0),T[2*S]=Z&8191,Z=Z>>>13,T[2*S+1]=Z&8191,Z=Z>>>13;for(S=2*H;S<W;++S)T[S]=0;_(Z===0),_((Z&-8192)===0)},g.prototype.stub=function(Y){var H=Array(Y);for(var T=0;T<Y;T++)H[T]=0;return H},g.prototype.mulp=function(Y,H,T){var W=2*this.guessLen13b(Y.length,H.length),Z=this.makeRBT(W),S=this.stub(W),N=Array(W),f=Array(W),v=Array(W),A=Array(W),L=Array(W),R=Array(W),b=T.words;b.length=W,this.convert13b(Y.words,Y.length,N,W),this.convert13b(H.words,H.length,A,W),this.transform(N,S,f,v,W,Z),this.transform(A,S,L,R,W,Z);for(var d=0;d<W;d++){var i=f[d]*L[d]-v[d]*R[d];v[d]=f[d]*R[d]+v[d]*L[d],f[d]=i}return this.conjugate(f,v,W),this.transform(f,v,b,S,W,Z),this.conjugate(b,S,W),this.normalize13b(b,W),T.negative=Y.negative^H.negative,T.length=Y.length+H.length,T.strip()},j.prototype.mul=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),this.mulTo(Y,H)},j.prototype.mulf=function(Y){var H=new j(null);return H.words=Array(this.length+Y.length),D(this,Y,H)},j.prototype.imul=function(Y){return this.clone().mulTo(Y,this)},j.prototype.imuln=function(Y){_(typeof Y==="number"),_(Y<67108864);var H=0;for(var T=0;T<this.length;T++){var W=(this.words[T]|0)*Y,Z=(W&67108863)+(H&67108863);H>>=26,H+=W/67108864|0,H+=Z>>>26,this.words[T]=Z&67108863}if(H!==0)this.words[T]=H,this.length++;return this.length=Y===0?1:this.length,this},j.prototype.muln=function(Y){return this.clone().imuln(Y)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(Y){var H=C(Y);if(H.length===0)return new j(1);var T=this;for(var W=0;W<H.length;W++,T=T.sqr())if(H[W]!==0)break;if(++W<H.length)for(var Z=T.sqr();W<H.length;W++,Z=Z.sqr()){if(H[W]===0)continue;T=T.mul(Z)}return T},j.prototype.iushln=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=67108863>>>26-H<<26-H,Z;if(H!==0){var S=0;for(Z=0;Z<this.length;Z++){var N=this.words[Z]&W,f=(this.words[Z]|0)-N<<H;this.words[Z]=f|S,S=N>>>26-H}if(S)this.words[Z]=S,this.length++}if(T!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+T]=this.words[Z];for(Z=0;Z<T;Z++)this.words[Z]=0;this.length+=T}return this.strip()},j.prototype.ishln=function(Y){return _(this.negative===0),this.iushln(Y)},j.prototype.iushrn=function(Y,H,T){_(typeof Y==="number"&&Y>=0);var W;if(H)W=(H-H%26)/26;else W=0;var Z=Y%26,S=Math.min((Y-Z)/26,this.length),N=67108863^67108863>>>Z<<Z,f=T;if(W-=S,W=Math.max(0,W),f){for(var v=0;v<S;v++)f.words[v]=this.words[v];f.length=S}if(S===0);else if(this.length>S){this.length-=S;for(v=0;v<this.length;v++)this.words[v]=this.words[v+S]}else this.words[0]=0,this.length=1;var A=0;for(v=this.length-1;v>=0&&(A!==0||v>=W);v--){var L=this.words[v]|0;this.words[v]=A<<26-Z|L>>>Z,A=L&N}if(f&&A!==0)f.words[f.length++]=A;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},j.prototype.ishrn=function(Y,H,T){return _(this.negative===0),this.iushrn(Y,H,T)},j.prototype.shln=function(Y){return this.clone().ishln(Y)},j.prototype.ushln=function(Y){return this.clone().iushln(Y)},j.prototype.shrn=function(Y){return this.clone().ishrn(Y)},j.prototype.ushrn=function(Y){return this.clone().iushrn(Y)},j.prototype.testn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return!1;var Z=this.words[T];return!!(Z&W)},j.prototype.imaskn=function(Y){_(typeof Y==="number"&&Y>=0);var H=Y%26,T=(Y-H)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=T)return this;if(H!==0)T++;if(this.length=Math.min(T,this.length),H!==0){var W=67108863^67108863>>>H<<H;this.words[this.length-1]&=W}return this.strip()},j.prototype.maskn=function(Y){return this.clone().imaskn(Y)},j.prototype.iaddn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.isubn(-Y);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<Y)return this.words[0]=Y-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Y),this.negative=1,this}return this._iaddn(Y)},j.prototype._iaddn=function(Y){this.words[0]+=Y;for(var H=0;H<this.length&&this.words[H]>=67108864;H++)if(this.words[H]-=67108864,H===this.length-1)this.words[H+1]=1;else this.words[H+1]++;return this.length=Math.max(this.length,H+1),this},j.prototype.isubn=function(Y){if(_(typeof Y==="number"),_(Y<67108864),Y<0)return this.iaddn(-Y);if(this.negative!==0)return this.negative=0,this.iaddn(Y),this.negative=1,this;if(this.words[0]-=Y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var H=0;H<this.length&&this.words[H]<0;H++)this.words[H]+=67108864,this.words[H+1]-=1;return this.strip()},j.prototype.addn=function(Y){return this.clone().iaddn(Y)},j.prototype.subn=function(Y){return this.clone().isubn(Y)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(Y,H,T){var W=Y.length+T,Z;this._expand(W);var S,N=0;for(Z=0;Z<Y.length;Z++){S=(this.words[Z+T]|0)+N;var f=(Y.words[Z]|0)*H;S-=f&67108863,N=(S>>26)-(f/67108864|0),this.words[Z+T]=S&67108863}for(;Z<this.length-T;Z++)S=(this.words[Z+T]|0)+N,N=S>>26,this.words[Z+T]=S&67108863;if(N===0)return this.strip();_(N===-1),N=0;for(Z=0;Z<this.length;Z++)S=-(this.words[Z]|0)+N,N=S>>26,this.words[Z]=S&67108863;return this.negative=1,this.strip()},j.prototype._wordDiv=function(Y,H){var T=this.length-Y.length,W=this.clone(),Z=Y,S=Z.words[Z.length-1]|0,N=this._countBits(S);if(T=26-N,T!==0)Z=Z.ushln(T),W.iushln(T),S=Z.words[Z.length-1]|0;var f=W.length-Z.length,v;if(H!=="mod"){v=new j(null),v.length=f+1,v.words=Array(v.length);for(var A=0;A<v.length;A++)v.words[A]=0}var L=W.clone()._ishlnsubmul(Z,1,f);if(L.negative===0){if(W=L,v)v.words[f]=1}for(var R=f-1;R>=0;R--){var b=(W.words[Z.length+R]|0)*67108864+(W.words[Z.length+R-1]|0);b=Math.min(b/S|0,67108863),W._ishlnsubmul(Z,b,R);while(W.negative!==0)if(b--,W.negative=0,W._ishlnsubmul(Z,1,R),!W.isZero())W.negative^=1;if(v)v.words[R]=b}if(v)v.strip();if(W.strip(),H!=="div"&&T!==0)W.iushrn(T);return{div:v||null,mod:W}},j.prototype.divmod=function(Y,H,T){if(_(!Y.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var W,Z,S;if(this.negative!==0&&Y.negative===0){if(S=this.neg().divmod(Y,H),H!=="mod")W=S.div.neg();if(H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.iadd(Y)}return{div:W,mod:Z}}if(this.negative===0&&Y.negative!==0){if(S=this.divmod(Y.neg(),H),H!=="mod")W=S.div.neg();return{div:W,mod:S.mod}}if((this.negative&Y.negative)!==0){if(S=this.neg().divmod(Y.neg(),H),H!=="div"){if(Z=S.mod.neg(),T&&Z.negative!==0)Z.isub(Y)}return{div:S.div,mod:Z}}if(Y.length>this.length||this.cmp(Y)<0)return{div:new j(0),mod:this};if(Y.length===1){if(H==="div")return{div:this.divn(Y.words[0]),mod:null};if(H==="mod")return{div:null,mod:new j(this.modn(Y.words[0]))};return{div:this.divn(Y.words[0]),mod:new j(this.modn(Y.words[0]))}}return this._wordDiv(Y,H)},j.prototype.div=function(Y){return this.divmod(Y,"div",!1).div},j.prototype.mod=function(Y){return this.divmod(Y,"mod",!1).mod},j.prototype.umod=function(Y){return this.divmod(Y,"mod",!0).mod},j.prototype.divRound=function(Y){var H=this.divmod(Y);if(H.mod.isZero())return H.div;var T=H.div.negative!==0?H.mod.isub(Y):H.mod,W=Y.ushrn(1),Z=Y.andln(1),S=T.cmp(W);if(S<0||Z===1&&S===0)return H.div;return H.div.negative!==0?H.div.isubn(1):H.div.iaddn(1)},j.prototype.modn=function(Y){_(Y<=67108863);var H=67108864%Y,T=0;for(var W=this.length-1;W>=0;W--)T=(H*T+(this.words[W]|0))%Y;return T},j.prototype.idivn=function(Y){_(Y<=67108863);var H=0;for(var T=this.length-1;T>=0;T--){var W=(this.words[T]|0)+H*67108864;this.words[T]=W/Y|0,H=W%Y}return this.strip()},j.prototype.divn=function(Y){return this.clone().idivn(Y)},j.prototype.egcd=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=new j(0),N=new j(1),f=0;while(H.isEven()&&T.isEven())H.iushrn(1),T.iushrn(1),++f;var v=T.clone(),A=H.clone();while(!H.isZero()){for(var L=0,R=1;(H.words[0]&R)===0&&L<26;++L,R<<=1);if(L>0){H.iushrn(L);while(L-- >0){if(W.isOdd()||Z.isOdd())W.iadd(v),Z.isub(A);W.iushrn(1),Z.iushrn(1)}}for(var b=0,d=1;(T.words[0]&d)===0&&b<26;++b,d<<=1);if(b>0){T.iushrn(b);while(b-- >0){if(S.isOdd()||N.isOdd())S.iadd(v),N.isub(A);S.iushrn(1),N.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(S),Z.isub(N);else T.isub(H),S.isub(W),N.isub(Z)}return{a:S,b:N,gcd:T.iushln(f)}},j.prototype._invmp=function(Y){_(Y.negative===0),_(!Y.isZero());var H=this,T=Y.clone();if(H.negative!==0)H=H.umod(Y);else H=H.clone();var W=new j(1),Z=new j(0),S=T.clone();while(H.cmpn(1)>0&&T.cmpn(1)>0){for(var N=0,f=1;(H.words[0]&f)===0&&N<26;++N,f<<=1);if(N>0){H.iushrn(N);while(N-- >0){if(W.isOdd())W.iadd(S);W.iushrn(1)}}for(var v=0,A=1;(T.words[0]&A)===0&&v<26;++v,A<<=1);if(v>0){T.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(S);Z.iushrn(1)}}if(H.cmp(T)>=0)H.isub(T),W.isub(Z);else T.isub(H),Z.isub(W)}var L;if(H.cmpn(1)===0)L=W;else L=Z;if(L.cmpn(0)<0)L.iadd(Y);return L},j.prototype.gcd=function(Y){if(this.isZero())return Y.abs();if(Y.isZero())return this.abs();var H=this.clone(),T=Y.clone();H.negative=0,T.negative=0;for(var W=0;H.isEven()&&T.isEven();W++)H.iushrn(1),T.iushrn(1);do{while(H.isEven())H.iushrn(1);while(T.isEven())T.iushrn(1);var Z=H.cmp(T);if(Z<0){var S=H;H=T,T=S}else if(Z===0||T.cmpn(1)===0)break;H.isub(T)}while(!0);return T.iushln(W)},j.prototype.invm=function(Y){return this.egcd(Y).a.umod(Y)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(Y){return this.words[0]&Y},j.prototype.bincn=function(Y){_(typeof Y==="number");var H=Y%26,T=(Y-H)/26,W=1<<H;if(this.length<=T)return this._expand(T+1),this.words[T]|=W,this;var Z=W;for(var S=T;Z!==0&&S<this.length;S++){var N=this.words[S]|0;N+=Z,Z=N>>>26,N&=67108863,this.words[S]=N}if(Z!==0)this.words[S]=Z,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(Y){var H=Y<0;if(this.negative!==0&&!H)return-1;if(this.negative===0&&H)return 1;this.strip();var T;if(this.length>1)T=1;else{if(H)Y=-Y;_(Y<=67108863,"Number is too big");var W=this.words[0]|0;T=W===Y?0:W<Y?-1:1}if(this.negative!==0)return-T|0;return T},j.prototype.cmp=function(Y){if(this.negative!==0&&Y.negative===0)return-1;if(this.negative===0&&Y.negative!==0)return 1;var H=this.ucmp(Y);if(this.negative!==0)return-H|0;return H},j.prototype.ucmp=function(Y){if(this.length>Y.length)return 1;if(this.length<Y.length)return-1;var H=0;for(var T=this.length-1;T>=0;T--){var W=this.words[T]|0,Z=Y.words[T]|0;if(W===Z)continue;if(W<Z)H=-1;else if(W>Z)H=1;break}return H},j.prototype.gtn=function(Y){return this.cmpn(Y)===1},j.prototype.gt=function(Y){return this.cmp(Y)===1},j.prototype.gten=function(Y){return this.cmpn(Y)>=0},j.prototype.gte=function(Y){return this.cmp(Y)>=0},j.prototype.ltn=function(Y){return this.cmpn(Y)===-1},j.prototype.lt=function(Y){return this.cmp(Y)===-1},j.prototype.lten=function(Y){return this.cmpn(Y)<=0},j.prototype.lte=function(Y){return this.cmp(Y)<=0},j.prototype.eqn=function(Y){return this.cmpn(Y)===0},j.prototype.eq=function(Y){return this.cmp(Y)===0},j.red=function(Y){return new m(Y)},j.prototype.toRed=function(Y){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),Y.convertTo(this)._forceRed(Y)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(Y){return this.red=Y,this},j.prototype.forceRed=function(Y){return _(!this.red,"Already a number in reduction context"),this._forceRed(Y)},j.prototype.redAdd=function(Y){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,Y)},j.prototype.redIAdd=function(Y){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Y)},j.prototype.redSub=function(Y){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,Y)},j.prototype.redISub=function(Y){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,Y)},j.prototype.redShl=function(Y){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,Y)},j.prototype.redMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.mul(this,Y)},j.prototype.redIMul=function(Y){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,Y),this.red.imul(this,Y)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(Y){return _(this.red&&!Y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Y)};var u={k256:null,p224:null,p192:null,p25519:null};function y(M,Y){this.name=M,this.p=new j(Y,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var Y=new j(null);return Y.words=Array(Math.ceil(this.n/13)),Y},y.prototype.ireduce=function(Y){var H=Y,T;do this.split(H,this.tmp),H=this.imulK(H),H=H.iadd(this.tmp),T=H.bitLength();while(T>this.n);var W=T<this.n?-1:H.ucmp(this.p);if(W===0)H.words[0]=0,H.length=1;else if(W>0)H.isub(this.p);else if(H.strip!==void 0)H.strip();else H._strip();return H},y.prototype.split=function(Y,H){Y.iushrn(this.n,0,H)},y.prototype.imulK=function(Y){return Y.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(p,y),p.prototype.split=function(Y,H){var T=4194303,W=Math.min(Y.length,9);for(var Z=0;Z<W;Z++)H.words[Z]=Y.words[Z];if(H.length=W,Y.length<=9){Y.words[0]=0,Y.length=1;return}var S=Y.words[9];H.words[H.length++]=S&T;for(Z=10;Z<Y.length;Z++){var N=Y.words[Z]|0;Y.words[Z-10]=(N&T)<<4|S>>>22,S=N}if(S>>>=22,Y.words[Z-10]=S,S===0&&Y.length>10)Y.length-=10;else Y.length-=9},p.prototype.imulK=function(Y){Y.words[Y.length]=0,Y.words[Y.length+1]=0,Y.length+=2;var H=0;for(var T=0;T<Y.length;T++){var W=Y.words[T]|0;H+=W*977,Y.words[T]=H&67108863,H=W*64+(H/67108864|0)}if(Y.words[Y.length-1]===0){if(Y.length--,Y.words[Y.length-1]===0)Y.length--}return Y};function l(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(l,y);function Q(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(Q,y);function e(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(e,y),e.prototype.imulK=function(Y){var H=0;for(var T=0;T<Y.length;T++){var W=(Y.words[T]|0)*19+H,Z=W&67108863;W>>>=26,Y.words[T]=Z,H=W}if(H!==0)Y.words[Y.length++]=H;return Y},j._prime=function(Y){if(u[Y])return u[Y];var H;if(Y==="k256")H=new p;else if(Y==="p224")H=new l;else if(Y==="p192")H=new Q;else if(Y==="p25519")H=new e;else throw Error("Unknown prime "+Y);return u[Y]=H,H};function m(M){if(typeof M==="string"){var Y=j._prime(M);this.m=Y.p,this.prime=Y}else _(M.gtn(1),"modulus must be greater than 1"),this.m=M,this.prime=null}m.prototype._verify1=function(Y){_(Y.negative===0,"red works only with positives"),_(Y.red,"red works only with red numbers")},m.prototype._verify2=function(Y,H){_((Y.negative|H.negative)===0,"red works only with positives"),_(Y.red&&Y.red===H.red,"red works only with red numbers")},m.prototype.imod=function(Y){if(this.prime)return this.prime.ireduce(Y)._forceRed(this);return Y.umod(this.m)._forceRed(this)},m.prototype.neg=function(Y){if(Y.isZero())return Y.clone();return this.m.sub(Y)._forceRed(this)},m.prototype.add=function(Y,H){this._verify2(Y,H);var T=Y.add(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T._forceRed(this)},m.prototype.iadd=function(Y,H){this._verify2(Y,H);var T=Y.iadd(H);if(T.cmp(this.m)>=0)T.isub(this.m);return T},m.prototype.sub=function(Y,H){this._verify2(Y,H);var T=Y.sub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T._forceRed(this)},m.prototype.isub=function(Y,H){this._verify2(Y,H);var T=Y.isub(H);if(T.cmpn(0)<0)T.iadd(this.m);return T},m.prototype.shl=function(Y,H){return this._verify1(Y),this.imod(Y.ushln(H))},m.prototype.imul=function(Y,H){return this._verify2(Y,H),this.imod(Y.imul(H))},m.prototype.mul=function(Y,H){return this._verify2(Y,H),this.imod(Y.mul(H))},m.prototype.isqr=function(Y){return this.imul(Y,Y.clone())},m.prototype.sqr=function(Y){return this.mul(Y,Y)},m.prototype.sqrt=function(Y){if(Y.isZero())return Y.clone();var H=this.m.andln(3);if(_(H%2===1),H===3){var T=this.m.add(new j(1)).iushrn(2);return this.pow(Y,T)}var W=this.m.subn(1),Z=0;while(!W.isZero()&&W.andln(1)===0)Z++,W.iushrn(1);_(!W.isZero());var S=new j(1).toRed(this),N=S.redNeg(),f=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new j(2*v*v).toRed(this);while(this.pow(v,f).cmp(N)!==0)v.redIAdd(N);var A=this.pow(v,W),L=this.pow(Y,W.addn(1).iushrn(1)),R=this.pow(Y,W),b=Z;while(R.cmp(S)!==0){var d=R;for(var i=0;d.cmp(S)!==0;i++)d=d.redSqr();_(i<b);var F=this.pow(A,new j(1).iushln(b-i-1));L=L.redMul(F),A=F.redSqr(),R=R.redMul(A),b=i}return L},m.prototype.invm=function(Y){var H=Y._invmp(this.m);if(H.negative!==0)return H.negative=0,this.imod(H).redNeg();else return this.imod(H)},m.prototype.pow=function(Y,H){if(H.isZero())return new j(1).toRed(this);if(H.cmpn(1)===0)return Y.clone();var T=4,W=Array(1<<T);W[0]=new j(1).toRed(this),W[1]=Y;for(var Z=2;Z<W.length;Z++)W[Z]=this.mul(W[Z-1],Y);var S=W[0],N=0,f=0,v=H.bitLength()%26;if(v===0)v=26;for(Z=H.length-1;Z>=0;Z--){var A=H.words[Z];for(var L=v-1;L>=0;L--){var R=A>>L&1;if(S!==W[0])S=this.sqr(S);if(R===0&&N===0){f=0;continue}if(N<<=1,N|=R,f++,f!==T&&(Z!==0||L!==0))continue;S=this.mul(S,W[N]),f=0,N=0}v=26}return S},m.prototype.convertTo=function(Y){var H=Y.umod(this.m);return H===Y?H.clone():H},m.prototype.convertFrom=function(Y){var H=Y.clone();return H.red=null,H},j.mont=function(Y){return new o(Y)};function o(M){if(m.call(this,M),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(o,m),o.prototype.convertTo=function(Y){return this.imod(Y.ushln(this.shift))},o.prototype.convertFrom=function(Y){var H=this.imod(Y.mul(this.rinv));return H.red=null,H},o.prototype.imul=function(Y,H){if(Y.isZero()||H.isZero())return Y.words[0]=0,Y.length=1,Y;var T=Y.imul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.mul=function(Y,H){if(Y.isZero()||H.isZero())return new j(0)._forceRed(this);var T=Y.mul(H),W=T.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=T.isub(W).iushrn(this.shift),S=Z;if(Z.cmp(this.m)>=0)S=Z.isub(this.m);else if(Z.cmpn(0)<0)S=Z.iadd(this.m);return S._forceRed(this)},o.prototype.invm=function(Y){var H=this.imod(Y._invmp(this.m).mul(this.r2));return H._forceRed(this)}})(typeof q>"u"||q,$)}),aS=l$(($,q)=>{var K=HH(),P=aq().Buffer;function _(O,j){return P.from(O.toRed(K.mont(j.modulus)).redPow(new K(j.publicExponent)).fromRed().toArray())}q.exports=_}),Jr=l$(($,q)=>{(function(K,P){function _(T,W){if(!T)throw Error(W||"Assertion failed")}function O(T,W){T.super_=W;var Z=function(){};Z.prototype=W.prototype,T.prototype=new Z,T.prototype.constructor=T}function j(T,W,Z){if(j.isBN(T))return T;if(this.negative=0,this.words=null,this.length=0,this.red=null,T!==null){if(W==="le"||W==="be")Z=W,W=10;this._init(T||0,W||10,Z||"be")}}if(typeof K==="object")K.exports=j;else P.BN=j;j.BN=j,j.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(vq(),W6(Yq)).Buffer}catch(T){}j.isBN=function(W){if(W instanceof j)return!0;return W!==null&&typeof W==="object"&&W.constructor.wordSize===j.wordSize&&Array.isArray(W.words)},j.max=function(W,Z){if(W.cmp(Z)>0)return W;return Z},j.min=function(W,Z){if(W.cmp(Z)<0)return W;return Z},j.prototype._init=function(W,Z,S){if(typeof W==="number")return this._initNumber(W,Z,S);if(typeof W==="object")return this._initArray(W,Z,S);if(Z==="hex")Z=16;_(Z===(Z|0)&&Z>=2&&Z<=36),W=W.toString().replace(/\s+/g,"");var N=0;if(W[0]==="-")N++,this.negative=1;if(N<W.length){if(Z===16)this._parseHex(W,N,S);else if(this._parseBase(W,Z,N),S==="le")this._initArray(this.toArray(),Z,S)}},j.prototype._initNumber=function(W,Z,S){if(W<0)this.negative=1,W=-W;if(W<67108864)this.words=[W&67108863],this.length=1;else if(W<4503599627370496)this.words=[W&67108863,W/67108864&67108863],this.length=2;else _(W<9007199254740992),this.words=[W&67108863,W/67108864&67108863,1],this.length=3;if(S!=="le")return;this._initArray(this.toArray(),Z,S)},j.prototype._initArray=function(W,Z,S){if(_(typeof W.length==="number"),W.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(W.length/3),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var f,v,A=0;if(S==="be"){for(N=W.length-1,f=0;N>=0;N-=3)if(v=W[N]|W[N-1]<<8|W[N-2]<<16,this.words[f]|=v<<A&67108863,this.words[f+1]=v>>>26-A&67108863,A+=24,A>=26)A-=26,f++}else if(S==="le"){for(N=0,f=0;N<W.length;N+=3)if(v=W[N]|W[N+1]<<8|W[N+2]<<16,this.words[f]|=v<<A&67108863,this.words[f+1]=v>>>26-A&67108863,A+=24,A>=26)A-=26,f++}return this._strip()};function J(T,W){var Z=T.charCodeAt(W);if(Z>=48&&Z<=57)return Z-48;else if(Z>=65&&Z<=70)return Z-55;else if(Z>=97&&Z<=102)return Z-87;else _(!1,"Invalid character in "+T)}function w(T,W,Z){var S=J(T,Z);if(Z-1>=W)S|=J(T,Z-1)<<4;return S}j.prototype._parseHex=function(W,Z,S){this.length=Math.ceil((W.length-Z)/6),this.words=Array(this.length);for(var N=0;N<this.length;N++)this.words[N]=0;var f=0,v=0,A;if(S==="be")for(N=W.length-1;N>=Z;N-=2)if(A=w(W,Z,N)<<f,this.words[v]|=A&67108863,f>=18)f-=18,v+=1,this.words[v]|=A>>>26;else f+=8;else{var L=W.length-Z;for(N=L%2===0?Z+1:Z;N<W.length;N+=2)if(A=w(W,Z,N)<<f,this.words[v]|=A&67108863,f>=18)f-=18,v+=1,this.words[v]|=A>>>26;else f+=8}this._strip()};function k(T,W,Z,S){var N=0,f=0,v=Math.min(T.length,Z);for(var A=W;A<v;A++){var L=T.charCodeAt(A)-48;if(N*=S,L>=49)f=L-49+10;else if(L>=17)f=L-17+10;else f=L;_(L>=0&&f<S,"Invalid character"),N+=f}return N}j.prototype._parseBase=function(W,Z,S){this.words=[0],this.length=1;for(var N=0,f=1;f<=67108863;f*=Z)N++;N--,f=f/Z|0;var v=W.length-S,A=v%N,L=Math.min(v,v-A)+S,R=0;for(var b=S;b<L;b+=N)if(R=k(W,b,b+N,Z),this.imuln(f),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R);if(A!==0){var d=1;R=k(W,b,W.length,Z);for(b=0;b<A;b++)d*=Z;if(this.imuln(d),this.words[0]+R<67108864)this.words[0]+=R;else this._iaddn(R)}this._strip()},j.prototype.copy=function(W){W.words=Array(this.length);for(var Z=0;Z<this.length;Z++)W.words[Z]=this.words[Z];W.length=this.length,W.negative=this.negative,W.red=this.red};function X(T,W){T.words=W.words,T.length=W.length,T.negative=W.negative,T.red=W.red}if(j.prototype._move=function(W){X(W,this)},j.prototype.clone=function(){var W=new j(null);return this.copy(W),W},j.prototype._expand=function(W){while(this.length<W)this.words[this.length++]=0;return this},j.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},j.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{j.prototype[Symbol.for("nodejs.util.inspect.custom")]=G}catch(T){j.prototype.inspect=G}else j.prototype.inspect=G;function G(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var V=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],E=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(j.prototype.toString=function(W,Z){W=W||10,Z=Z|0||1;var S;if(W===16||W==="hex"){S="";var N=0,f=0;for(var v=0;v<this.length;v++){var A=this.words[v],L=((A<<N|f)&16777215).toString(16);if(f=A>>>24-N&16777215,N+=2,N>=26)N-=26,v--;if(f!==0||v!==this.length-1)S=V[6-L.length]+L+S;else S=L+S}if(f!==0)S=f.toString(16)+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}if(W===(W|0)&&W>=2&&W<=36){var R=C[W],b=E[W];S="";var d=this.clone();d.negative=0;while(!d.isZero()){var i=d.modrn(b).toString(W);if(d=d.idivn(b),!d.isZero())S=V[R-i.length]+i+S;else S=i+S}if(this.isZero())S="0"+S;while(S.length%Z!==0)S="0"+S;if(this.negative!==0)S="-"+S;return S}_(!1,"Base should be between 2 and 36")},j.prototype.toNumber=function(){var W=this.words[0];if(this.length===2)W+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)W+=4503599627370496+this.words[1]*67108864;else if(this.length>2)_(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-W:W},j.prototype.toJSON=function(){return this.toString(16,2)},z)j.prototype.toBuffer=function(W,Z){return this.toArrayLike(z,W,Z)};j.prototype.toArray=function(W,Z){return this.toArrayLike(Array,W,Z)};var h=function(W,Z){if(W.allocUnsafe)return W.allocUnsafe(Z);return new W(Z)};if(j.prototype.toArrayLike=function(W,Z,S){this._strip();var N=this.byteLength(),f=S||Math.max(1,N);_(N<=f,"byte array longer than desired length"),_(f>0,"Requested array length <= 0");var v=h(W,f),A=Z==="le"?"LE":"BE";return this["_toArrayLike"+A](v,N),v},j.prototype._toArrayLikeLE=function(W,Z){var S=0,N=0;for(var f=0,v=0;f<this.length;f++){var A=this.words[f]<<v|N;if(W[S++]=A&255,S<W.length)W[S++]=A>>8&255;if(S<W.length)W[S++]=A>>16&255;if(v===6){if(S<W.length)W[S++]=A>>24&255;N=0,v=0}else N=A>>>24,v+=2}if(S<W.length){W[S++]=N;while(S<W.length)W[S++]=0}},j.prototype._toArrayLikeBE=function(W,Z){var S=W.length-1,N=0;for(var f=0,v=0;f<this.length;f++){var A=this.words[f]<<v|N;if(W[S--]=A&255,S>=0)W[S--]=A>>8&255;if(S>=0)W[S--]=A>>16&255;if(v===6){if(S>=0)W[S--]=A>>24&255;N=0,v=0}else N=A>>>24,v+=2}if(S>=0){W[S--]=N;while(S>=0)W[S--]=0}},Math.clz32)j.prototype._countBits=function(W){return 32-Math.clz32(W)};else j.prototype._countBits=function(W){var Z=W,S=0;if(Z>=4096)S+=13,Z>>>=13;if(Z>=64)S+=7,Z>>>=7;if(Z>=8)S+=4,Z>>>=4;if(Z>=2)S+=2,Z>>>=2;return S+Z};j.prototype._zeroBits=function(W){if(W===0)return 26;var Z=W,S=0;if((Z&8191)===0)S+=13,Z>>>=13;if((Z&127)===0)S+=7,Z>>>=7;if((Z&15)===0)S+=4,Z>>>=4;if((Z&3)===0)S+=2,Z>>>=2;if((Z&1)===0)S++;return S},j.prototype.bitLength=function(){var W=this.words[this.length-1],Z=this._countBits(W);return(this.length-1)*26+Z};function I(T){var W=Array(T.bitLength());for(var Z=0;Z<W.length;Z++){var S=Z/26|0,N=Z%26;W[Z]=T.words[S]>>>N&1}return W}j.prototype.zeroBits=function(){if(this.isZero())return 0;var W=0;for(var Z=0;Z<this.length;Z++){var S=this._zeroBits(this.words[Z]);if(W+=S,S!==26)break}return W},j.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},j.prototype.toTwos=function(W){if(this.negative!==0)return this.abs().inotn(W).iaddn(1);return this.clone()},j.prototype.fromTwos=function(W){if(this.testn(W-1))return this.notn(W).iaddn(1).ineg();return this.clone()},j.prototype.isNeg=function(){return this.negative!==0},j.prototype.neg=function(){return this.clone().ineg()},j.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},j.prototype.iuor=function(W){while(this.length<W.length)this.words[this.length++]=0;for(var Z=0;Z<W.length;Z++)this.words[Z]=this.words[Z]|W.words[Z];return this._strip()},j.prototype.ior=function(W){return _((this.negative|W.negative)===0),this.iuor(W)},j.prototype.or=function(W){if(this.length>W.length)return this.clone().ior(W);return W.clone().ior(this)},j.prototype.uor=function(W){if(this.length>W.length)return this.clone().iuor(W);return W.clone().iuor(this)},j.prototype.iuand=function(W){var Z;if(this.length>W.length)Z=W;else Z=this;for(var S=0;S<Z.length;S++)this.words[S]=this.words[S]&W.words[S];return this.length=Z.length,this._strip()},j.prototype.iand=function(W){return _((this.negative|W.negative)===0),this.iuand(W)},j.prototype.and=function(W){if(this.length>W.length)return this.clone().iand(W);return W.clone().iand(this)},j.prototype.uand=function(W){if(this.length>W.length)return this.clone().iuand(W);return W.clone().iuand(this)},j.prototype.iuxor=function(W){var Z,S;if(this.length>W.length)Z=this,S=W;else Z=W,S=this;for(var N=0;N<S.length;N++)this.words[N]=Z.words[N]^S.words[N];if(this!==Z)for(;N<Z.length;N++)this.words[N]=Z.words[N];return this.length=Z.length,this._strip()},j.prototype.ixor=function(W){return _((this.negative|W.negative)===0),this.iuxor(W)},j.prototype.xor=function(W){if(this.length>W.length)return this.clone().ixor(W);return W.clone().ixor(this)},j.prototype.uxor=function(W){if(this.length>W.length)return this.clone().iuxor(W);return W.clone().iuxor(this)},j.prototype.inotn=function(W){_(typeof W==="number"&&W>=0);var Z=Math.ceil(W/26)|0,S=W%26;if(this._expand(Z),S>0)Z--;for(var N=0;N<Z;N++)this.words[N]=~this.words[N]&67108863;if(S>0)this.words[N]=~this.words[N]&67108863>>26-S;return this._strip()},j.prototype.notn=function(W){return this.clone().inotn(W)},j.prototype.setn=function(W,Z){_(typeof W==="number"&&W>=0);var S=W/26|0,N=W%26;if(this._expand(S+1),Z)this.words[S]=this.words[S]|1<<N;else this.words[S]=this.words[S]&~(1<<N);return this._strip()},j.prototype.iadd=function(W){var Z;if(this.negative!==0&&W.negative===0)return this.negative=0,Z=this.isub(W),this.negative^=1,this._normSign();else if(this.negative===0&&W.negative!==0)return W.negative=0,Z=this.isub(W),W.negative=1,Z._normSign();var S,N;if(this.length>W.length)S=this,N=W;else S=W,N=this;var f=0;for(var v=0;v<N.length;v++)Z=(S.words[v]|0)+(N.words[v]|0)+f,this.words[v]=Z&67108863,f=Z>>>26;for(;f!==0&&v<S.length;v++)Z=(S.words[v]|0)+f,this.words[v]=Z&67108863,f=Z>>>26;if(this.length=S.length,f!==0)this.words[this.length]=f,this.length++;else if(S!==this)for(;v<S.length;v++)this.words[v]=S.words[v];return this},j.prototype.add=function(W){var Z;if(W.negative!==0&&this.negative===0)return W.negative=0,Z=this.sub(W),W.negative^=1,Z;else if(W.negative===0&&this.negative!==0)return this.negative=0,Z=W.sub(this),this.negative=1,Z;if(this.length>W.length)return this.clone().iadd(W);return W.clone().iadd(this)},j.prototype.isub=function(W){if(W.negative!==0){W.negative=0;var Z=this.iadd(W);return W.negative=1,Z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(W),this.negative=1,this._normSign();var S=this.cmp(W);if(S===0)return this.negative=0,this.length=1,this.words[0]=0,this;var N,f;if(S>0)N=this,f=W;else N=W,f=this;var v=0;for(var A=0;A<f.length;A++)Z=(N.words[A]|0)-(f.words[A]|0)+v,v=Z>>26,this.words[A]=Z&67108863;for(;v!==0&&A<N.length;A++)Z=(N.words[A]|0)+v,v=Z>>26,this.words[A]=Z&67108863;if(v===0&&A<N.length&&N!==this)for(;A<N.length;A++)this.words[A]=N.words[A];if(this.length=Math.max(this.length,A),N!==this)this.negative=1;return this._strip()},j.prototype.sub=function(W){return this.clone().isub(W)};function D(T,W,Z){Z.negative=W.negative^T.negative;var S=T.length+W.length|0;Z.length=S,S=S-1|0;var N=T.words[0]|0,f=W.words[0]|0,v=N*f,A=v&67108863,L=v/67108864|0;Z.words[0]=A;for(var R=1;R<S;R++){var b=L>>>26,d=L&67108863,i=Math.min(R,W.length-1);for(var F=Math.max(0,R-T.length+1);F<=i;F++){var W$=R-F|0;N=T.words[W$]|0,f=W.words[F]|0,v=N*f+d,b+=v/67108864|0,d=v&67108863}Z.words[R]=d|0,L=b|0}if(L!==0)Z.words[R]=L|0;else Z.length--;return Z._strip()}var g=function(W,Z,S){var N=W.words,f=Z.words,v=S.words,A=0,L,R,b,d=N[0]|0,i=d&8191,F=d>>>13,W$=N[1]|0,n=W$&8191,B=W$>>>13,y$=N[2]|0,Y$=y$&8191,v$=y$>>>13,a=N[3]|0,r=a&8191,t=a>>>13,x$=N[4]|0,q$=x$&8191,$$=x$>>>13,s=N[5]|0,U=s&8191,_$=s>>>13,f$=N[6]|0,O$=f$&8191,T$=f$>>>13,O6=N[7]|0,H$=O6&8191,X$=O6>>>13,X6=N[8]|0,w$=X6&8191,G$=X6>>>13,y6=N[9]|0,k$=y6&8191,I$=y6>>>13,zq=f[0]|0,D$=zq&8191,L$=zq>>>13,Vq=f[1]|0,C$=Vq&8191,E$=Vq>>>13,Sq=f[2]|0,h$=Sq&8191,V$=Sq>>>13,Mq=f[3]|0,b$=Mq&8191,S$=Mq>>>13,Wq=f[4]|0,x=Wq&8191,c=Wq>>>13,c$=f[5]|0,K$=c$&8191,j$=c$>>>13,k6=f[6]|0,Z$=k6&8191,A$=k6>>>13,Hq=f[7]|0,g$=Hq&8191,R$=Hq>>>13,Jq=f[8]|0,M$=Jq&8191,N$=Jq>>>13,b6=f[9]|0,Y6=b6&8191,K6=b6>>>13;S.negative=W.negative^Z.negative,S.length=19,L=Math.imul(i,D$),R=Math.imul(i,L$),R=R+Math.imul(F,D$)|0,b=Math.imul(F,L$);var G6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(G6>>>26)|0,G6&=67108863,L=Math.imul(n,D$),R=Math.imul(n,L$),R=R+Math.imul(B,D$)|0,b=Math.imul(B,L$),L=L+Math.imul(i,C$)|0,R=R+Math.imul(i,E$)|0,R=R+Math.imul(F,C$)|0,b=b+Math.imul(F,E$)|0;var d6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(d6>>>26)|0,d6&=67108863,L=Math.imul(Y$,D$),R=Math.imul(Y$,L$),R=R+Math.imul(v$,D$)|0,b=Math.imul(v$,L$),L=L+Math.imul(n,C$)|0,R=R+Math.imul(n,E$)|0,R=R+Math.imul(B,C$)|0,b=b+Math.imul(B,E$)|0,L=L+Math.imul(i,h$)|0,R=R+Math.imul(i,V$)|0,R=R+Math.imul(F,h$)|0,b=b+Math.imul(F,V$)|0;var l6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(l6>>>26)|0,l6&=67108863,L=Math.imul(r,D$),R=Math.imul(r,L$),R=R+Math.imul(t,D$)|0,b=Math.imul(t,L$),L=L+Math.imul(Y$,C$)|0,R=R+Math.imul(Y$,E$)|0,R=R+Math.imul(v$,C$)|0,b=b+Math.imul(v$,E$)|0,L=L+Math.imul(n,h$)|0,R=R+Math.imul(n,V$)|0,R=R+Math.imul(B,h$)|0,b=b+Math.imul(B,V$)|0,L=L+Math.imul(i,b$)|0,R=R+Math.imul(i,S$)|0,R=R+Math.imul(F,b$)|0,b=b+Math.imul(F,S$)|0;var r6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(r6>>>26)|0,r6&=67108863,L=Math.imul(q$,D$),R=Math.imul(q$,L$),R=R+Math.imul($$,D$)|0,b=Math.imul($$,L$),L=L+Math.imul(r,C$)|0,R=R+Math.imul(r,E$)|0,R=R+Math.imul(t,C$)|0,b=b+Math.imul(t,E$)|0,L=L+Math.imul(Y$,h$)|0,R=R+Math.imul(Y$,V$)|0,R=R+Math.imul(v$,h$)|0,b=b+Math.imul(v$,V$)|0,L=L+Math.imul(n,b$)|0,R=R+Math.imul(n,S$)|0,R=R+Math.imul(B,b$)|0,b=b+Math.imul(B,S$)|0,L=L+Math.imul(i,x)|0,R=R+Math.imul(i,c)|0,R=R+Math.imul(F,x)|0,b=b+Math.imul(F,c)|0;var o6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(o6>>>26)|0,o6&=67108863,L=Math.imul(U,D$),R=Math.imul(U,L$),R=R+Math.imul(_$,D$)|0,b=Math.imul(_$,L$),L=L+Math.imul(q$,C$)|0,R=R+Math.imul(q$,E$)|0,R=R+Math.imul($$,C$)|0,b=b+Math.imul($$,E$)|0,L=L+Math.imul(r,h$)|0,R=R+Math.imul(r,V$)|0,R=R+Math.imul(t,h$)|0,b=b+Math.imul(t,V$)|0,L=L+Math.imul(Y$,b$)|0,R=R+Math.imul(Y$,S$)|0,R=R+Math.imul(v$,b$)|0,b=b+Math.imul(v$,S$)|0,L=L+Math.imul(n,x)|0,R=R+Math.imul(n,c)|0,R=R+Math.imul(B,x)|0,b=b+Math.imul(B,c)|0,L=L+Math.imul(i,K$)|0,R=R+Math.imul(i,j$)|0,R=R+Math.imul(F,K$)|0,b=b+Math.imul(F,j$)|0;var n6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(n6>>>26)|0,n6&=67108863,L=Math.imul(O$,D$),R=Math.imul(O$,L$),R=R+Math.imul(T$,D$)|0,b=Math.imul(T$,L$),L=L+Math.imul(U,C$)|0,R=R+Math.imul(U,E$)|0,R=R+Math.imul(_$,C$)|0,b=b+Math.imul(_$,E$)|0,L=L+Math.imul(q$,h$)|0,R=R+Math.imul(q$,V$)|0,R=R+Math.imul($$,h$)|0,b=b+Math.imul($$,V$)|0,L=L+Math.imul(r,b$)|0,R=R+Math.imul(r,S$)|0,R=R+Math.imul(t,b$)|0,b=b+Math.imul(t,S$)|0,L=L+Math.imul(Y$,x)|0,R=R+Math.imul(Y$,c)|0,R=R+Math.imul(v$,x)|0,b=b+Math.imul(v$,c)|0,L=L+Math.imul(n,K$)|0,R=R+Math.imul(n,j$)|0,R=R+Math.imul(B,K$)|0,b=b+Math.imul(B,j$)|0,L=L+Math.imul(i,Z$)|0,R=R+Math.imul(i,A$)|0,R=R+Math.imul(F,Z$)|0,b=b+Math.imul(F,A$)|0;var i6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(i6>>>26)|0,i6&=67108863,L=Math.imul(H$,D$),R=Math.imul(H$,L$),R=R+Math.imul(X$,D$)|0,b=Math.imul(X$,L$),L=L+Math.imul(O$,C$)|0,R=R+Math.imul(O$,E$)|0,R=R+Math.imul(T$,C$)|0,b=b+Math.imul(T$,E$)|0,L=L+Math.imul(U,h$)|0,R=R+Math.imul(U,V$)|0,R=R+Math.imul(_$,h$)|0,b=b+Math.imul(_$,V$)|0,L=L+Math.imul(q$,b$)|0,R=R+Math.imul(q$,S$)|0,R=R+Math.imul($$,b$)|0,b=b+Math.imul($$,S$)|0,L=L+Math.imul(r,x)|0,R=R+Math.imul(r,c)|0,R=R+Math.imul(t,x)|0,b=b+Math.imul(t,c)|0,L=L+Math.imul(Y$,K$)|0,R=R+Math.imul(Y$,j$)|0,R=R+Math.imul(v$,K$)|0,b=b+Math.imul(v$,j$)|0,L=L+Math.imul(n,Z$)|0,R=R+Math.imul(n,A$)|0,R=R+Math.imul(B,Z$)|0,b=b+Math.imul(B,A$)|0,L=L+Math.imul(i,g$)|0,R=R+Math.imul(i,R$)|0,R=R+Math.imul(F,g$)|0,b=b+Math.imul(F,R$)|0;var B6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(B6>>>26)|0,B6&=67108863,L=Math.imul(w$,D$),R=Math.imul(w$,L$),R=R+Math.imul(G$,D$)|0,b=Math.imul(G$,L$),L=L+Math.imul(H$,C$)|0,R=R+Math.imul(H$,E$)|0,R=R+Math.imul(X$,C$)|0,b=b+Math.imul(X$,E$)|0,L=L+Math.imul(O$,h$)|0,R=R+Math.imul(O$,V$)|0,R=R+Math.imul(T$,h$)|0,b=b+Math.imul(T$,V$)|0,L=L+Math.imul(U,b$)|0,R=R+Math.imul(U,S$)|0,R=R+Math.imul(_$,b$)|0,b=b+Math.imul(_$,S$)|0,L=L+Math.imul(q$,x)|0,R=R+Math.imul(q$,c)|0,R=R+Math.imul($$,x)|0,b=b+Math.imul($$,c)|0,L=L+Math.imul(r,K$)|0,R=R+Math.imul(r,j$)|0,R=R+Math.imul(t,K$)|0,b=b+Math.imul(t,j$)|0,L=L+Math.imul(Y$,Z$)|0,R=R+Math.imul(Y$,A$)|0,R=R+Math.imul(v$,Z$)|0,b=b+Math.imul(v$,A$)|0,L=L+Math.imul(n,g$)|0,R=R+Math.imul(n,R$)|0,R=R+Math.imul(B,g$)|0,b=b+Math.imul(B,R$)|0,L=L+Math.imul(i,M$)|0,R=R+Math.imul(i,N$)|0,R=R+Math.imul(F,M$)|0,b=b+Math.imul(F,N$)|0;var t6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(t6>>>26)|0,t6&=67108863,L=Math.imul(k$,D$),R=Math.imul(k$,L$),R=R+Math.imul(I$,D$)|0,b=Math.imul(I$,L$),L=L+Math.imul(w$,C$)|0,R=R+Math.imul(w$,E$)|0,R=R+Math.imul(G$,C$)|0,b=b+Math.imul(G$,E$)|0,L=L+Math.imul(H$,h$)|0,R=R+Math.imul(H$,V$)|0,R=R+Math.imul(X$,h$)|0,b=b+Math.imul(X$,V$)|0,L=L+Math.imul(O$,b$)|0,R=R+Math.imul(O$,S$)|0,R=R+Math.imul(T$,b$)|0,b=b+Math.imul(T$,S$)|0,L=L+Math.imul(U,x)|0,R=R+Math.imul(U,c)|0,R=R+Math.imul(_$,x)|0,b=b+Math.imul(_$,c)|0,L=L+Math.imul(q$,K$)|0,R=R+Math.imul(q$,j$)|0,R=R+Math.imul($$,K$)|0,b=b+Math.imul($$,j$)|0,L=L+Math.imul(r,Z$)|0,R=R+Math.imul(r,A$)|0,R=R+Math.imul(t,Z$)|0,b=b+Math.imul(t,A$)|0,L=L+Math.imul(Y$,g$)|0,R=R+Math.imul(Y$,R$)|0,R=R+Math.imul(v$,g$)|0,b=b+Math.imul(v$,R$)|0,L=L+Math.imul(n,M$)|0,R=R+Math.imul(n,N$)|0,R=R+Math.imul(B,M$)|0,b=b+Math.imul(B,N$)|0,L=L+Math.imul(i,Y6)|0,R=R+Math.imul(i,K6)|0,R=R+Math.imul(F,Y6)|0,b=b+Math.imul(F,K6)|0;var U6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(U6>>>26)|0,U6&=67108863,L=Math.imul(k$,C$),R=Math.imul(k$,E$),R=R+Math.imul(I$,C$)|0,b=Math.imul(I$,E$),L=L+Math.imul(w$,h$)|0,R=R+Math.imul(w$,V$)|0,R=R+Math.imul(G$,h$)|0,b=b+Math.imul(G$,V$)|0,L=L+Math.imul(H$,b$)|0,R=R+Math.imul(H$,S$)|0,R=R+Math.imul(X$,b$)|0,b=b+Math.imul(X$,S$)|0,L=L+Math.imul(O$,x)|0,R=R+Math.imul(O$,c)|0,R=R+Math.imul(T$,x)|0,b=b+Math.imul(T$,c)|0,L=L+Math.imul(U,K$)|0,R=R+Math.imul(U,j$)|0,R=R+Math.imul(_$,K$)|0,b=b+Math.imul(_$,j$)|0,L=L+Math.imul(q$,Z$)|0,R=R+Math.imul(q$,A$)|0,R=R+Math.imul($$,Z$)|0,b=b+Math.imul($$,A$)|0,L=L+Math.imul(r,g$)|0,R=R+Math.imul(r,R$)|0,R=R+Math.imul(t,g$)|0,b=b+Math.imul(t,R$)|0,L=L+Math.imul(Y$,M$)|0,R=R+Math.imul(Y$,N$)|0,R=R+Math.imul(v$,M$)|0,b=b+Math.imul(v$,N$)|0,L=L+Math.imul(n,Y6)|0,R=R+Math.imul(n,K6)|0,R=R+Math.imul(B,Y6)|0,b=b+Math.imul(B,K6)|0;var F6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(F6>>>26)|0,F6&=67108863,L=Math.imul(k$,h$),R=Math.imul(k$,V$),R=R+Math.imul(I$,h$)|0,b=Math.imul(I$,V$),L=L+Math.imul(w$,b$)|0,R=R+Math.imul(w$,S$)|0,R=R+Math.imul(G$,b$)|0,b=b+Math.imul(G$,S$)|0,L=L+Math.imul(H$,x)|0,R=R+Math.imul(H$,c)|0,R=R+Math.imul(X$,x)|0,b=b+Math.imul(X$,c)|0,L=L+Math.imul(O$,K$)|0,R=R+Math.imul(O$,j$)|0,R=R+Math.imul(T$,K$)|0,b=b+Math.imul(T$,j$)|0,L=L+Math.imul(U,Z$)|0,R=R+Math.imul(U,A$)|0,R=R+Math.imul(_$,Z$)|0,b=b+Math.imul(_$,A$)|0,L=L+Math.imul(q$,g$)|0,R=R+Math.imul(q$,R$)|0,R=R+Math.imul($$,g$)|0,b=b+Math.imul($$,R$)|0,L=L+Math.imul(r,M$)|0,R=R+Math.imul(r,N$)|0,R=R+Math.imul(t,M$)|0,b=b+Math.imul(t,N$)|0,L=L+Math.imul(Y$,Y6)|0,R=R+Math.imul(Y$,K6)|0,R=R+Math.imul(v$,Y6)|0,b=b+Math.imul(v$,K6)|0;var a6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(a6>>>26)|0,a6&=67108863,L=Math.imul(k$,b$),R=Math.imul(k$,S$),R=R+Math.imul(I$,b$)|0,b=Math.imul(I$,S$),L=L+Math.imul(w$,x)|0,R=R+Math.imul(w$,c)|0,R=R+Math.imul(G$,x)|0,b=b+Math.imul(G$,c)|0,L=L+Math.imul(H$,K$)|0,R=R+Math.imul(H$,j$)|0,R=R+Math.imul(X$,K$)|0,b=b+Math.imul(X$,j$)|0,L=L+Math.imul(O$,Z$)|0,R=R+Math.imul(O$,A$)|0,R=R+Math.imul(T$,Z$)|0,b=b+Math.imul(T$,A$)|0,L=L+Math.imul(U,g$)|0,R=R+Math.imul(U,R$)|0,R=R+Math.imul(_$,g$)|0,b=b+Math.imul(_$,R$)|0,L=L+Math.imul(q$,M$)|0,R=R+Math.imul(q$,N$)|0,R=R+Math.imul($$,M$)|0,b=b+Math.imul($$,N$)|0,L=L+Math.imul(r,Y6)|0,R=R+Math.imul(r,K6)|0,R=R+Math.imul(t,Y6)|0,b=b+Math.imul(t,K6)|0;var Q6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,L=Math.imul(k$,x),R=Math.imul(k$,c),R=R+Math.imul(I$,x)|0,b=Math.imul(I$,c),L=L+Math.imul(w$,K$)|0,R=R+Math.imul(w$,j$)|0,R=R+Math.imul(G$,K$)|0,b=b+Math.imul(G$,j$)|0,L=L+Math.imul(H$,Z$)|0,R=R+Math.imul(H$,A$)|0,R=R+Math.imul(X$,Z$)|0,b=b+Math.imul(X$,A$)|0,L=L+Math.imul(O$,g$)|0,R=R+Math.imul(O$,R$)|0,R=R+Math.imul(T$,g$)|0,b=b+Math.imul(T$,R$)|0,L=L+Math.imul(U,M$)|0,R=R+Math.imul(U,N$)|0,R=R+Math.imul(_$,M$)|0,b=b+Math.imul(_$,N$)|0,L=L+Math.imul(q$,Y6)|0,R=R+Math.imul(q$,K6)|0,R=R+Math.imul($$,Y6)|0,b=b+Math.imul($$,K6)|0;var e6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(e6>>>26)|0,e6&=67108863,L=Math.imul(k$,K$),R=Math.imul(k$,j$),R=R+Math.imul(I$,K$)|0,b=Math.imul(I$,j$),L=L+Math.imul(w$,Z$)|0,R=R+Math.imul(w$,A$)|0,R=R+Math.imul(G$,Z$)|0,b=b+Math.imul(G$,A$)|0,L=L+Math.imul(H$,g$)|0,R=R+Math.imul(H$,R$)|0,R=R+Math.imul(X$,g$)|0,b=b+Math.imul(X$,R$)|0,L=L+Math.imul(O$,M$)|0,R=R+Math.imul(O$,N$)|0,R=R+Math.imul(T$,M$)|0,b=b+Math.imul(T$,N$)|0,L=L+Math.imul(U,Y6)|0,R=R+Math.imul(U,K6)|0,R=R+Math.imul(_$,Y6)|0,b=b+Math.imul(_$,K6)|0;var s6=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(s6>>>26)|0,s6&=67108863,L=Math.imul(k$,Z$),R=Math.imul(k$,A$),R=R+Math.imul(I$,Z$)|0,b=Math.imul(I$,A$),L=L+Math.imul(w$,g$)|0,R=R+Math.imul(w$,R$)|0,R=R+Math.imul(G$,g$)|0,b=b+Math.imul(G$,R$)|0,L=L+Math.imul(H$,M$)|0,R=R+Math.imul(H$,N$)|0,R=R+Math.imul(X$,M$)|0,b=b+Math.imul(X$,N$)|0,L=L+Math.imul(O$,Y6)|0,R=R+Math.imul(O$,K6)|0,R=R+Math.imul(T$,Y6)|0,b=b+Math.imul(T$,K6)|0;var $q=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+($q>>>26)|0,$q&=67108863,L=Math.imul(k$,g$),R=Math.imul(k$,R$),R=R+Math.imul(I$,g$)|0,b=Math.imul(I$,R$),L=L+Math.imul(w$,M$)|0,R=R+Math.imul(w$,N$)|0,R=R+Math.imul(G$,M$)|0,b=b+Math.imul(G$,N$)|0,L=L+Math.imul(H$,Y6)|0,R=R+Math.imul(H$,K6)|0,R=R+Math.imul(X$,Y6)|0,b=b+Math.imul(X$,K6)|0;var JO=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(JO>>>26)|0,JO&=67108863,L=Math.imul(k$,M$),R=Math.imul(k$,N$),R=R+Math.imul(I$,M$)|0,b=Math.imul(I$,N$),L=L+Math.imul(w$,Y6)|0,R=R+Math.imul(w$,K6)|0,R=R+Math.imul(G$,Y6)|0,b=b+Math.imul(G$,K6)|0;var TO=(A+L|0)+((R&8191)<<13)|0;A=(b+(R>>>13)|0)+(TO>>>26)|0,TO&=67108863,L=Math.imul(k$,Y6),R=Math.imul(k$,K6),R=R+Math.imul(I$,Y6)|0,b=Math.imul(I$,K6);var wO=(A+L|0)+((R&8191)<<13)|0;if(A=(b+(R>>>13)|0)+(wO>>>26)|0,wO&=67108863,v[0]=G6,v[1]=d6,v[2]=l6,v[3]=r6,v[4]=o6,v[5]=n6,v[6]=i6,v[7]=B6,v[8]=t6,v[9]=U6,v[10]=F6,v[11]=a6,v[12]=Q6,v[13]=e6,v[14]=s6,v[15]=$q,v[16]=JO,v[17]=TO,v[18]=wO,A!==0)v[19]=A,S.length++;return S};if(!Math.imul)g=D;function u(T,W,Z){Z.negative=W.negative^T.negative,Z.length=T.length+W.length;var S=0,N=0;for(var f=0;f<Z.length-1;f++){var v=N;N=0;var A=S&67108863,L=Math.min(f,W.length-1);for(var R=Math.max(0,f-T.length+1);R<=L;R++){var b=f-R,d=T.words[b]|0,i=W.words[R]|0,F=d*i,W$=F&67108863;v=v+(F/67108864|0)|0,W$=W$+A|0,A=W$&67108863,v=v+(W$>>>26)|0,N+=v>>>26,v&=67108863}Z.words[f]=A,S=v,v=N}if(S!==0)Z.words[f]=S;else Z.length--;return Z._strip()}function y(T,W,Z){return u(T,W,Z)}j.prototype.mulTo=function(W,Z){var S,N=this.length+W.length;if(this.length===10&&W.length===10)S=g(this,W,Z);else if(N<63)S=D(this,W,Z);else if(N<1024)S=u(this,W,Z);else S=y(this,W,Z);return S};function p(T,W){this.x=T,this.y=W}p.prototype.makeRBT=function(W){var Z=Array(W),S=j.prototype._countBits(W)-1;for(var N=0;N<W;N++)Z[N]=this.revBin(N,S,W);return Z},p.prototype.revBin=function(W,Z,S){if(W===0||W===S-1)return W;var N=0;for(var f=0;f<Z;f++)N|=(W&1)<<Z-f-1,W>>=1;return N},p.prototype.permute=function(W,Z,S,N,f,v){for(var A=0;A<v;A++)N[A]=Z[W[A]],f[A]=S[W[A]]},p.prototype.transform=function(W,Z,S,N,f,v){this.permute(v,W,Z,S,N,f);for(var A=1;A<f;A<<=1){var L=A<<1,R=Math.cos(2*Math.PI/L),b=Math.sin(2*Math.PI/L);for(var d=0;d<f;d+=L){var i=R,F=b;for(var W$=0;W$<A;W$++){var n=S[d+W$],B=N[d+W$],y$=S[d+W$+A],Y$=N[d+W$+A],v$=i*y$-F*Y$;if(Y$=i*Y$+F*y$,y$=v$,S[d+W$]=n+y$,N[d+W$]=B+Y$,S[d+W$+A]=n-y$,N[d+W$+A]=B-Y$,W$!==L)v$=R*i-b*F,F=R*F+b*i,i=v$}}}},p.prototype.guessLen13b=function(W,Z){var S=Math.max(Z,W)|1,N=S&1,f=0;for(S=S/2|0;S;S=S>>>1)f++;return 1<<f+1+N},p.prototype.conjugate=function(W,Z,S){if(S<=1)return;for(var N=0;N<S/2;N++){var f=W[N];W[N]=W[S-N-1],W[S-N-1]=f,f=Z[N],Z[N]=-Z[S-N-1],Z[S-N-1]=-f}},p.prototype.normalize13b=function(W,Z){var S=0;for(var N=0;N<Z/2;N++){var f=Math.round(W[2*N+1]/Z)*8192+Math.round(W[2*N]/Z)+S;if(W[N]=f&67108863,f<67108864)S=0;else S=f/67108864|0}return W},p.prototype.convert13b=function(W,Z,S,N){var f=0;for(var v=0;v<Z;v++)f=f+(W[v]|0),S[2*v]=f&8191,f=f>>>13,S[2*v+1]=f&8191,f=f>>>13;for(v=2*Z;v<N;++v)S[v]=0;_(f===0),_((f&-8192)===0)},p.prototype.stub=function(W){var Z=Array(W);for(var S=0;S<W;S++)Z[S]=0;return Z},p.prototype.mulp=function(W,Z,S){var N=2*this.guessLen13b(W.length,Z.length),f=this.makeRBT(N),v=this.stub(N),A=Array(N),L=Array(N),R=Array(N),b=Array(N),d=Array(N),i=Array(N),F=S.words;F.length=N,this.convert13b(W.words,W.length,A,N),this.convert13b(Z.words,Z.length,b,N),this.transform(A,v,L,R,N,f),this.transform(b,v,d,i,N,f);for(var W$=0;W$<N;W$++){var n=L[W$]*d[W$]-R[W$]*i[W$];R[W$]=L[W$]*i[W$]+R[W$]*d[W$],L[W$]=n}return this.conjugate(L,R,N),this.transform(L,R,F,v,N,f),this.conjugate(F,v,N),this.normalize13b(F,N),S.negative=W.negative^Z.negative,S.length=W.length+Z.length,S._strip()},j.prototype.mul=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),this.mulTo(W,Z)},j.prototype.mulf=function(W){var Z=new j(null);return Z.words=Array(this.length+W.length),y(this,W,Z)},j.prototype.imul=function(W){return this.clone().mulTo(W,this)},j.prototype.imuln=function(W){var Z=W<0;if(Z)W=-W;_(typeof W==="number"),_(W<67108864);var S=0;for(var N=0;N<this.length;N++){var f=(this.words[N]|0)*W,v=(f&67108863)+(S&67108863);S>>=26,S+=f/67108864|0,S+=v>>>26,this.words[N]=v&67108863}if(S!==0)this.words[N]=S,this.length++;return this.length=W===0?1:this.length,Z?this.ineg():this},j.prototype.muln=function(W){return this.clone().imuln(W)},j.prototype.sqr=function(){return this.mul(this)},j.prototype.isqr=function(){return this.imul(this.clone())},j.prototype.pow=function(W){var Z=I(W);if(Z.length===0)return new j(1);var S=this;for(var N=0;N<Z.length;N++,S=S.sqr())if(Z[N]!==0)break;if(++N<Z.length)for(var f=S.sqr();N<Z.length;N++,f=f.sqr()){if(Z[N]===0)continue;S=S.mul(f)}return S},j.prototype.iushln=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=67108863>>>26-Z<<26-Z,f;if(Z!==0){var v=0;for(f=0;f<this.length;f++){var A=this.words[f]&N,L=(this.words[f]|0)-A<<Z;this.words[f]=L|v,v=A>>>26-Z}if(v)this.words[f]=v,this.length++}if(S!==0){for(f=this.length-1;f>=0;f--)this.words[f+S]=this.words[f];for(f=0;f<S;f++)this.words[f]=0;this.length+=S}return this._strip()},j.prototype.ishln=function(W){return _(this.negative===0),this.iushln(W)},j.prototype.iushrn=function(W,Z,S){_(typeof W==="number"&&W>=0);var N;if(Z)N=(Z-Z%26)/26;else N=0;var f=W%26,v=Math.min((W-f)/26,this.length),A=67108863^67108863>>>f<<f,L=S;if(N-=v,N=Math.max(0,N),L){for(var R=0;R<v;R++)L.words[R]=this.words[R];L.length=v}if(v===0);else if(this.length>v){this.length-=v;for(R=0;R<this.length;R++)this.words[R]=this.words[R+v]}else this.words[0]=0,this.length=1;var b=0;for(R=this.length-1;R>=0&&(b!==0||R>=N);R--){var d=this.words[R]|0;this.words[R]=b<<26-f|d>>>f,b=d&A}if(L&&b!==0)L.words[L.length++]=b;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},j.prototype.ishrn=function(W,Z,S){return _(this.negative===0),this.iushrn(W,Z,S)},j.prototype.shln=function(W){return this.clone().ishln(W)},j.prototype.ushln=function(W){return this.clone().iushln(W)},j.prototype.shrn=function(W){return this.clone().ishrn(W)},j.prototype.ushrn=function(W){return this.clone().iushrn(W)},j.prototype.testn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return!1;var f=this.words[S];return!!(f&N)},j.prototype.imaskn=function(W){_(typeof W==="number"&&W>=0);var Z=W%26,S=(W-Z)/26;if(_(this.negative===0,"imaskn works only with positive numbers"),this.length<=S)return this;if(Z!==0)S++;if(this.length=Math.min(S,this.length),Z!==0){var N=67108863^67108863>>>Z<<Z;this.words[this.length-1]&=N}return this._strip()},j.prototype.maskn=function(W){return this.clone().imaskn(W)},j.prototype.iaddn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.isubn(-W);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=W)return this.words[0]=W-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(W),this.negative=1,this}return this._iaddn(W)},j.prototype._iaddn=function(W){this.words[0]+=W;for(var Z=0;Z<this.length&&this.words[Z]>=67108864;Z++)if(this.words[Z]-=67108864,Z===this.length-1)this.words[Z+1]=1;else this.words[Z+1]++;return this.length=Math.max(this.length,Z+1),this},j.prototype.isubn=function(W){if(_(typeof W==="number"),_(W<67108864),W<0)return this.iaddn(-W);if(this.negative!==0)return this.negative=0,this.iaddn(W),this.negative=1,this;if(this.words[0]-=W,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Z=0;Z<this.length&&this.words[Z]<0;Z++)this.words[Z]+=67108864,this.words[Z+1]-=1;return this._strip()},j.prototype.addn=function(W){return this.clone().iaddn(W)},j.prototype.subn=function(W){return this.clone().isubn(W)},j.prototype.iabs=function(){return this.negative=0,this},j.prototype.abs=function(){return this.clone().iabs()},j.prototype._ishlnsubmul=function(W,Z,S){var N=W.length+S,f;this._expand(N);var v,A=0;for(f=0;f<W.length;f++){v=(this.words[f+S]|0)+A;var L=(W.words[f]|0)*Z;v-=L&67108863,A=(v>>26)-(L/67108864|0),this.words[f+S]=v&67108863}for(;f<this.length-S;f++)v=(this.words[f+S]|0)+A,A=v>>26,this.words[f+S]=v&67108863;if(A===0)return this._strip();_(A===-1),A=0;for(f=0;f<this.length;f++)v=-(this.words[f]|0)+A,A=v>>26,this.words[f]=v&67108863;return this.negative=1,this._strip()},j.prototype._wordDiv=function(W,Z){var S=this.length-W.length,N=this.clone(),f=W,v=f.words[f.length-1]|0,A=this._countBits(v);if(S=26-A,S!==0)f=f.ushln(S),N.iushln(S),v=f.words[f.length-1]|0;var L=N.length-f.length,R;if(Z!=="mod"){R=new j(null),R.length=L+1,R.words=Array(R.length);for(var b=0;b<R.length;b++)R.words[b]=0}var d=N.clone()._ishlnsubmul(f,1,L);if(d.negative===0){if(N=d,R)R.words[L]=1}for(var i=L-1;i>=0;i--){var F=(N.words[f.length+i]|0)*67108864+(N.words[f.length+i-1]|0);F=Math.min(F/v|0,67108863),N._ishlnsubmul(f,F,i);while(N.negative!==0)if(F--,N.negative=0,N._ishlnsubmul(f,1,i),!N.isZero())N.negative^=1;if(R)R.words[i]=F}if(R)R._strip();if(N._strip(),Z!=="div"&&S!==0)N.iushrn(S);return{div:R||null,mod:N}},j.prototype.divmod=function(W,Z,S){if(_(!W.isZero()),this.isZero())return{div:new j(0),mod:new j(0)};var N,f,v;if(this.negative!==0&&W.negative===0){if(v=this.neg().divmod(W,Z),Z!=="mod")N=v.div.neg();if(Z!=="div"){if(f=v.mod.neg(),S&&f.negative!==0)f.iadd(W)}return{div:N,mod:f}}if(this.negative===0&&W.negative!==0){if(v=this.divmod(W.neg(),Z),Z!=="mod")N=v.div.neg();return{div:N,mod:v.mod}}if((this.negative&W.negative)!==0){if(v=this.neg().divmod(W.neg(),Z),Z!=="div"){if(f=v.mod.neg(),S&&f.negative!==0)f.isub(W)}return{div:v.div,mod:f}}if(W.length>this.length||this.cmp(W)<0)return{div:new j(0),mod:this};if(W.length===1){if(Z==="div")return{div:this.divn(W.words[0]),mod:null};if(Z==="mod")return{div:null,mod:new j(this.modrn(W.words[0]))};return{div:this.divn(W.words[0]),mod:new j(this.modrn(W.words[0]))}}return this._wordDiv(W,Z)},j.prototype.div=function(W){return this.divmod(W,"div",!1).div},j.prototype.mod=function(W){return this.divmod(W,"mod",!1).mod},j.prototype.umod=function(W){return this.divmod(W,"mod",!0).mod},j.prototype.divRound=function(W){var Z=this.divmod(W);if(Z.mod.isZero())return Z.div;var S=Z.div.negative!==0?Z.mod.isub(W):Z.mod,N=W.ushrn(1),f=W.andln(1),v=S.cmp(N);if(v<0||f===1&&v===0)return Z.div;return Z.div.negative!==0?Z.div.isubn(1):Z.div.iaddn(1)},j.prototype.modrn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=67108864%W,N=0;for(var f=this.length-1;f>=0;f--)N=(S*N+(this.words[f]|0))%W;return Z?-N:N},j.prototype.modn=function(W){return this.modrn(W)},j.prototype.idivn=function(W){var Z=W<0;if(Z)W=-W;_(W<=67108863);var S=0;for(var N=this.length-1;N>=0;N--){var f=(this.words[N]|0)+S*67108864;this.words[N]=f/W|0,S=f%W}return this._strip(),Z?this.ineg():this},j.prototype.divn=function(W){return this.clone().idivn(W)},j.prototype.egcd=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),f=new j(0),v=new j(0),A=new j(1),L=0;while(Z.isEven()&&S.isEven())Z.iushrn(1),S.iushrn(1),++L;var R=S.clone(),b=Z.clone();while(!Z.isZero()){for(var d=0,i=1;(Z.words[0]&i)===0&&d<26;++d,i<<=1);if(d>0){Z.iushrn(d);while(d-- >0){if(N.isOdd()||f.isOdd())N.iadd(R),f.isub(b);N.iushrn(1),f.iushrn(1)}}for(var F=0,W$=1;(S.words[0]&W$)===0&&F<26;++F,W$<<=1);if(F>0){S.iushrn(F);while(F-- >0){if(v.isOdd()||A.isOdd())v.iadd(R),A.isub(b);v.iushrn(1),A.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(v),f.isub(A);else S.isub(Z),v.isub(N),A.isub(f)}return{a:v,b:A,gcd:S.iushln(L)}},j.prototype._invmp=function(W){_(W.negative===0),_(!W.isZero());var Z=this,S=W.clone();if(Z.negative!==0)Z=Z.umod(W);else Z=Z.clone();var N=new j(1),f=new j(0),v=S.clone();while(Z.cmpn(1)>0&&S.cmpn(1)>0){for(var A=0,L=1;(Z.words[0]&L)===0&&A<26;++A,L<<=1);if(A>0){Z.iushrn(A);while(A-- >0){if(N.isOdd())N.iadd(v);N.iushrn(1)}}for(var R=0,b=1;(S.words[0]&b)===0&&R<26;++R,b<<=1);if(R>0){S.iushrn(R);while(R-- >0){if(f.isOdd())f.iadd(v);f.iushrn(1)}}if(Z.cmp(S)>=0)Z.isub(S),N.isub(f);else S.isub(Z),f.isub(N)}var d;if(Z.cmpn(1)===0)d=N;else d=f;if(d.cmpn(0)<0)d.iadd(W);return d},j.prototype.gcd=function(W){if(this.isZero())return W.abs();if(W.isZero())return this.abs();var Z=this.clone(),S=W.clone();Z.negative=0,S.negative=0;for(var N=0;Z.isEven()&&S.isEven();N++)Z.iushrn(1),S.iushrn(1);do{while(Z.isEven())Z.iushrn(1);while(S.isEven())S.iushrn(1);var f=Z.cmp(S);if(f<0){var v=Z;Z=S,S=v}else if(f===0||S.cmpn(1)===0)break;Z.isub(S)}while(!0);return S.iushln(N)},j.prototype.invm=function(W){return this.egcd(W).a.umod(W)},j.prototype.isEven=function(){return(this.words[0]&1)===0},j.prototype.isOdd=function(){return(this.words[0]&1)===1},j.prototype.andln=function(W){return this.words[0]&W},j.prototype.bincn=function(W){_(typeof W==="number");var Z=W%26,S=(W-Z)/26,N=1<<Z;if(this.length<=S)return this._expand(S+1),this.words[S]|=N,this;var f=N;for(var v=S;f!==0&&v<this.length;v++){var A=this.words[v]|0;A+=f,f=A>>>26,A&=67108863,this.words[v]=A}if(f!==0)this.words[v]=f,this.length++;return this},j.prototype.isZero=function(){return this.length===1&&this.words[0]===0},j.prototype.cmpn=function(W){var Z=W<0;if(this.negative!==0&&!Z)return-1;if(this.negative===0&&Z)return 1;this._strip();var S;if(this.length>1)S=1;else{if(Z)W=-W;_(W<=67108863,"Number is too big");var N=this.words[0]|0;S=N===W?0:N<W?-1:1}if(this.negative!==0)return-S|0;return S},j.prototype.cmp=function(W){if(this.negative!==0&&W.negative===0)return-1;if(this.negative===0&&W.negative!==0)return 1;var Z=this.ucmp(W);if(this.negative!==0)return-Z|0;return Z},j.prototype.ucmp=function(W){if(this.length>W.length)return 1;if(this.length<W.length)return-1;var Z=0;for(var S=this.length-1;S>=0;S--){var N=this.words[S]|0,f=W.words[S]|0;if(N===f)continue;if(N<f)Z=-1;else if(N>f)Z=1;break}return Z},j.prototype.gtn=function(W){return this.cmpn(W)===1},j.prototype.gt=function(W){return this.cmp(W)===1},j.prototype.gten=function(W){return this.cmpn(W)>=0},j.prototype.gte=function(W){return this.cmp(W)>=0},j.prototype.ltn=function(W){return this.cmpn(W)===-1},j.prototype.lt=function(W){return this.cmp(W)===-1},j.prototype.lten=function(W){return this.cmpn(W)<=0},j.prototype.lte=function(W){return this.cmp(W)<=0},j.prototype.eqn=function(W){return this.cmpn(W)===0},j.prototype.eq=function(W){return this.cmp(W)===0},j.red=function(W){return new Y(W)},j.prototype.toRed=function(W){return _(!this.red,"Already a number in reduction context"),_(this.negative===0,"red works only with positives"),W.convertTo(this)._forceRed(W)},j.prototype.fromRed=function(){return _(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},j.prototype._forceRed=function(W){return this.red=W,this},j.prototype.forceRed=function(W){return _(!this.red,"Already a number in reduction context"),this._forceRed(W)},j.prototype.redAdd=function(W){return _(this.red,"redAdd works only with red numbers"),this.red.add(this,W)},j.prototype.redIAdd=function(W){return _(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,W)},j.prototype.redSub=function(W){return _(this.red,"redSub works only with red numbers"),this.red.sub(this,W)},j.prototype.redISub=function(W){return _(this.red,"redISub works only with red numbers"),this.red.isub(this,W)},j.prototype.redShl=function(W){return _(this.red,"redShl works only with red numbers"),this.red.shl(this,W)},j.prototype.redMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.mul(this,W)},j.prototype.redIMul=function(W){return _(this.red,"redMul works only with red numbers"),this.red._verify2(this,W),this.red.imul(this,W)},j.prototype.redSqr=function(){return _(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},j.prototype.redISqr=function(){return _(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},j.prototype.redSqrt=function(){return _(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},j.prototype.redInvm=function(){return _(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},j.prototype.redNeg=function(){return _(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},j.prototype.redPow=function(W){return _(this.red&&!W.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,W)};var l={k256:null,p224:null,p192:null,p25519:null};function Q(T,W){this.name=T,this.p=new j(W,16),this.n=this.p.bitLength(),this.k=new j(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Q.prototype._tmp=function(){var W=new j(null);return W.words=Array(Math.ceil(this.n/13)),W},Q.prototype.ireduce=function(W){var Z=W,S;do this.split(Z,this.tmp),Z=this.imulK(Z),Z=Z.iadd(this.tmp),S=Z.bitLength();while(S>this.n);var N=S<this.n?-1:Z.ucmp(this.p);if(N===0)Z.words[0]=0,Z.length=1;else if(N>0)Z.isub(this.p);else if(Z.strip!==void 0)Z.strip();else Z._strip();return Z},Q.prototype.split=function(W,Z){W.iushrn(this.n,0,Z)},Q.prototype.imulK=function(W){return W.imul(this.k)};function e(){Q.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}O(e,Q),e.prototype.split=function(W,Z){var S=4194303,N=Math.min(W.length,9);for(var f=0;f<N;f++)Z.words[f]=W.words[f];if(Z.length=N,W.length<=9){W.words[0]=0,W.length=1;return}var v=W.words[9];Z.words[Z.length++]=v&S;for(f=10;f<W.length;f++){var A=W.words[f]|0;W.words[f-10]=(A&S)<<4|v>>>22,v=A}if(v>>>=22,W.words[f-10]=v,v===0&&W.length>10)W.length-=10;else W.length-=9},e.prototype.imulK=function(W){W.words[W.length]=0,W.words[W.length+1]=0,W.length+=2;var Z=0;for(var S=0;S<W.length;S++){var N=W.words[S]|0;Z+=N*977,W.words[S]=Z&67108863,Z=N*64+(Z/67108864|0)}if(W.words[W.length-1]===0){if(W.length--,W.words[W.length-1]===0)W.length--}return W};function m(){Q.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}O(m,Q);function o(){Q.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}O(o,Q);function M(){Q.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}O(M,Q),M.prototype.imulK=function(W){var Z=0;for(var S=0;S<W.length;S++){var N=(W.words[S]|0)*19+Z,f=N&67108863;N>>>=26,W.words[S]=f,Z=N}if(Z!==0)W.words[W.length++]=Z;return W},j._prime=function(W){if(l[W])return l[W];var Z;if(W==="k256")Z=new e;else if(W==="p224")Z=new m;else if(W==="p192")Z=new o;else if(W==="p25519")Z=new M;else throw Error("Unknown prime "+W);return l[W]=Z,Z};function Y(T){if(typeof T==="string"){var W=j._prime(T);this.m=W.p,this.prime=W}else _(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}Y.prototype._verify1=function(W){_(W.negative===0,"red works only with positives"),_(W.red,"red works only with red numbers")},Y.prototype._verify2=function(W,Z){_((W.negative|Z.negative)===0,"red works only with positives"),_(W.red&&W.red===Z.red,"red works only with red numbers")},Y.prototype.imod=function(W){if(this.prime)return this.prime.ireduce(W)._forceRed(this);return X(W,W.umod(this.m)._forceRed(this)),W},Y.prototype.neg=function(W){if(W.isZero())return W.clone();return this.m.sub(W)._forceRed(this)},Y.prototype.add=function(W,Z){this._verify2(W,Z);var S=W.add(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S._forceRed(this)},Y.prototype.iadd=function(W,Z){this._verify2(W,Z);var S=W.iadd(Z);if(S.cmp(this.m)>=0)S.isub(this.m);return S},Y.prototype.sub=function(W,Z){this._verify2(W,Z);var S=W.sub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S._forceRed(this)},Y.prototype.isub=function(W,Z){this._verify2(W,Z);var S=W.isub(Z);if(S.cmpn(0)<0)S.iadd(this.m);return S},Y.prototype.shl=function(W,Z){return this._verify1(W),this.imod(W.ushln(Z))},Y.prototype.imul=function(W,Z){return this._verify2(W,Z),this.imod(W.imul(Z))},Y.prototype.mul=function(W,Z){return this._verify2(W,Z),this.imod(W.mul(Z))},Y.prototype.isqr=function(W){return this.imul(W,W.clone())},Y.prototype.sqr=function(W){return this.mul(W,W)},Y.prototype.sqrt=function(W){if(W.isZero())return W.clone();var Z=this.m.andln(3);if(_(Z%2===1),Z===3){var S=this.m.add(new j(1)).iushrn(2);return this.pow(W,S)}var N=this.m.subn(1),f=0;while(!N.isZero()&&N.andln(1)===0)f++,N.iushrn(1);_(!N.isZero());var v=new j(1).toRed(this),A=v.redNeg(),L=this.m.subn(1).iushrn(1),R=this.m.bitLength();R=new j(2*R*R).toRed(this);while(this.pow(R,L).cmp(A)!==0)R.redIAdd(A);var b=this.pow(R,N),d=this.pow(W,N.addn(1).iushrn(1)),i=this.pow(W,N),F=f;while(i.cmp(v)!==0){var W$=i;for(var n=0;W$.cmp(v)!==0;n++)W$=W$.redSqr();_(n<F);var B=this.pow(b,new j(1).iushln(F-n-1));d=d.redMul(B),b=B.redSqr(),i=i.redMul(b),F=n}return d},Y.prototype.invm=function(W){var Z=W._invmp(this.m);if(Z.negative!==0)return Z.negative=0,this.imod(Z).redNeg();else return this.imod(Z)},Y.prototype.pow=function(W,Z){if(Z.isZero())return new j(1).toRed(this);if(Z.cmpn(1)===0)return W.clone();var S=4,N=Array(1<<S);N[0]=new j(1).toRed(this),N[1]=W;for(var f=2;f<N.length;f++)N[f]=this.mul(N[f-1],W);var v=N[0],A=0,L=0,R=Z.bitLength()%26;if(R===0)R=26;for(f=Z.length-1;f>=0;f--){var b=Z.words[f];for(var d=R-1;d>=0;d--){var i=b>>d&1;if(v!==N[0])v=this.sqr(v);if(i===0&&A===0){L=0;continue}if(A<<=1,A|=i,L++,L!==S&&(f!==0||d!==0))continue;v=this.mul(v,N[A]),L=0,A=0}R=26}return v},Y.prototype.convertTo=function(W){var Z=W.umod(this.m);return Z===W?Z.clone():Z},Y.prototype.convertFrom=function(W){var Z=W.clone();return Z.red=null,Z},j.mont=function(W){return new H(W)};function H(T){if(Y.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new j(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)}O(H,Y),H.prototype.convertTo=function(W){return this.imod(W.ushln(this.shift))},H.prototype.convertFrom=function(W){var Z=this.imod(W.mul(this.rinv));return Z.red=null,Z},H.prototype.imul=function(W,Z){if(W.isZero()||Z.isZero())return W.words[0]=0,W.length=1,W;var S=W.imul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=S.isub(N).iushrn(this.shift),v=f;if(f.cmp(this.m)>=0)v=f.isub(this.m);else if(f.cmpn(0)<0)v=f.iadd(this.m);return v._forceRed(this)},H.prototype.mul=function(W,Z){if(W.isZero()||Z.isZero())return new j(0)._forceRed(this);var S=W.mul(Z),N=S.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),f=S.isub(N).iushrn(this.shift),v=f;if(f.cmp(this.m)>=0)v=f.isub(this.m);else if(f.cmpn(0)<0)v=f.iadd(this.m);return v._forceRed(this)},H.prototype.invm=function(W){var Z=this.imod(W._invmp(this.m).mul(this.r2));return Z._forceRed(this)}})(typeof q>"u"||q,$)}),QS=l$(($,q)=>{var K=Jr(),P=ij(),_=aq().Buffer;function O(J){var w=J.modulus.byteLength(),k;do k=new K(P(w));while(k.cmp(J.modulus)>=0||!k.umod(J.prime1)||!k.umod(J.prime2));return k}function j(J){var w=O(J),k=w.toRed(K.mont(J.modulus)).redPow(new K(J.publicExponent)).fromRed();return{blinder:k,unblinder:w.invm(J.modulus)}}function z(J,w){var k=j(w),X=w.modulus.byteLength(),G=new K(J).mul(k.blinder).umod(w.modulus),V=G.toRed(K.mont(w.prime1)),C=G.toRed(K.mont(w.prime2)),E=w.coefficient,h=w.prime1,I=w.prime2,D=V.redPow(w.exponent1).fromRed(),g=C.redPow(w.exponent2).fromRed(),u=D.isub(g).imul(E).umod(h).imul(I);return g.iadd(u).imul(k.unblinder).umod(w.modulus).toArrayLike(_,"be",X)}z.getr=O,q.exports=z}),Tr=l$(($,q)=>{var K=tS(),P=ij(),_=Bj(),O=US(),j=FS(),z=HH(),J=aS(),w=QS(),k=aq().Buffer;q.exports=function(E,h,I){var D;if(E.padding)D=E.padding;else if(I)D=1;else D=4;var g=K(E),u;if(D===4)u=X(g,h);else if(D===1)u=G(g,h,I);else if(D===3){if(u=new z(h),u.cmp(g.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(I)return w(u,g);else return J(u,g)};function X(C,E){var h=C.modulus.byteLength(),I=E.length,D=_("sha1").update(k.alloc(0)).digest(),g=D.length,u=2*g;if(I>h-u-2)throw Error("message too long");var y=k.alloc(h-I-u-2),p=h-g-1,l=P(g),Q=j(k.concat([D,y,k.alloc(1,1),E],p),O(l,p)),e=j(l,O(Q,g));return new z(k.concat([k.alloc(1),e,Q],h))}function G(C,E,h){var I=E.length,D=C.modulus.byteLength();if(I>D-11)throw Error("message too long");var g;if(h)g=k.alloc(D-I-3,255);else g=V(D-I-3);return new z(k.concat([k.from([0,h?1:2]),g,k.alloc(1),E],D))}function V(C){var E=k.allocUnsafe(C),h=0,I=P(C*2),D=0,g;while(h<C){if(D===I.length)I=P(C*2),D=0;if(g=I[D++],g)E[h++]=g}return E}}),wr=l$(($,q)=>{var K=tS(),P=US(),_=FS(),O=HH(),j=QS(),z=Bj(),J=aS(),w=aq().Buffer;q.exports=function(C,E,h){var I;if(C.padding)I=C.padding;else if(h)I=1;else I=4;var D=K(C),g=D.modulus.byteLength();if(E.length>g||new O(E).cmp(D.modulus)>=0)throw Error("decryption error");var u;if(h)u=J(new O(E),D);else u=j(E,D);var y=w.alloc(g-u.length);if(u=w.concat([y,u],g),I===4)return k(D,u);else if(I===1)return X(D,u,h);else if(I===3)return u;else throw Error("unknown padding")};function k(V,C){var E=V.modulus.byteLength(),h=z("sha1").update(w.alloc(0)).digest(),I=h.length;if(C[0]!==0)throw Error("decryption error");var D=C.slice(1,I+1),g=C.slice(I+1),u=_(D,P(g,I)),y=_(g,P(u,E-I-1));if(G(h,y.slice(0,I)))throw Error("decryption error");var p=I;while(y[p]===0)p++;if(y[p++]!==1)throw Error("decryption error");return y.slice(p)}function X(V,C,E){var h=C.slice(0,2),I=2,D=0;while(C[I++]!==0)if(I>=C.length){D++;break}var g=C.slice(2,I-1);if(h.toString("hex")!=="0002"&&!E||h.toString("hex")!=="0001"&&E)D++;if(g.length<8)D++;if(D)throw Error("decryption error");return C.slice(I)}function G(V,C){V=w.from(V),C=w.from(C);var E=0,h=V.length;if(V.length!==C.length)E++,h=Math.min(V.length,C.length);var I=-1;while(++I<h)E+=V[I]^C[I];return E}}),jH=l$(($)=>{$.publicEncrypt=Tr(),$.privateDecrypt=wr(),$.privateEncrypt=function(K,P){return $.publicEncrypt(K,P,!0)},$.publicDecrypt=function(K,P){return $.privateDecrypt(K,P,!0)}}),Zr=l$(($)=>{var q=(dq(),W6(mq));if(typeof q.publicEncrypt!=="function")q=jH();if($.publicEncrypt=q.publicEncrypt,$.privateDecrypt=q.privateDecrypt,typeof q.privateEncrypt!=="function")$.privateEncrypt=jH().privateEncrypt;else $.privateEncrypt=q.privateEncrypt;if(typeof q.publicDecrypt!=="function")$.publicDecrypt=jH().publicDecrypt;else $.publicDecrypt=q.publicDecrypt}),fr=l$(($)=>{var q=aq(),K=ij(),P=q.Buffer,_=q.kMaxLength,O=globalThis.crypto||globalThis.msCrypto,j=Math.pow(2,32)-1;function z(G,V){if(typeof G!=="number"||G!==G)throw TypeError("offset must be a number");if(G>j||G<0)throw TypeError("offset must be a uint32");if(G>_||G>V)throw RangeError("offset out of range")}function J(G,V,C){if(typeof G!=="number"||G!==G)throw TypeError("size must be a number");if(G>j||G<0)throw TypeError("size must be a uint32");if(G+V>C||G>_)throw RangeError("buffer too small")}O&&O.getRandomValues,$.randomFill=w,$.randomFillSync=X;function w(G,V,C,E){if(!P.isBuffer(G)&&!(G instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof V==="function")E=V,V=0,C=G.length;else if(typeof C==="function")E=C,C=G.length-V;else if(typeof E!=="function")throw TypeError('"cb" argument must be a function');return z(V,G.length),J(C,V,G.length),k(G,V,C,E)}function k(G,V,C,E){if(!1)var h,I;if(E){K(C,function(g,u){if(g)return E(g);u.copy(G,V),E(null,G)});return}var D=K(C);return D.copy(G,V),G}function X(G,V,C){if(typeof V>"u")V=0;if(!P.isBuffer(G)&&!(G instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(V,G.length),C===void 0)C=G.length-V;return J(C,V,G.length),k(G,V,C)}}),Xr=l$(($,q)=>{var K=(dq(),W6(mq));if(typeof K.randomFill==="function"&&typeof K.randomFillSync==="function")$.randomFill=K.randomFill,$.randomFillSync=K.randomFillSync;else q.exports=fr()}),kr=l$(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=ij(),$.createHash=$.Hash=Bj(),$.createHmac=$.Hmac=uS();var q=Sl(),K=Object.keys(q),P=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(K);$.getHashes=function(){return P};var _=xS();$.pbkdf2=_.pbkdf2,$.pbkdf2Sync=_.pbkdf2Sync;var O=Nl();$.Cipher=O.Cipher,$.createCipher=O.createCipher,$.Cipheriv=O.Cipheriv,$.createCipheriv=O.createCipheriv,$.Decipher=O.Decipher,$.createDecipher=O.createDecipher,$.Decipheriv=O.Decipheriv,$.createDecipheriv=O.createDecipheriv,$.getCiphers=O.getCiphers,$.listCiphers=O.listCiphers;var j=Cl();$.DiffieHellmanGroup=j.DiffieHellmanGroup,$.createDiffieHellmanGroup=j.createDiffieHellmanGroup,$.getDiffieHellman=j.getDiffieHellman,$.createDiffieHellman=j.createDiffieHellman,$.DiffieHellman=j.DiffieHellman;var z=El();$.createSign=z.createSign,$.Sign=z.Sign,$.createVerify=z.createVerify,$.Verify=z.Verify,$.createECDH=Fl();var J=Zr();$.publicEncrypt=J.publicEncrypt,$.privateEncrypt=J.privateEncrypt,$.publicDecrypt=J.publicDecrypt,$.privateDecrypt=J.privateDecrypt;var w=Xr();$.randomFill=w.randomFill,$.randomFillSync=w.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
38
38
  we accept pull requests
39
39
  https://github.com/browserify/crypto-browserify`)},$.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}}),T6=Vl(kr(),1),Ar=T6.prng,Gr=T6.pseudoRandomBytes,Vr=T6.rng,Sr=T6.randomBytes,Mr=T6.Hash,Nr=T6.createHash,Cr=T6.Hmac,Er=T6.createHmac,hr=T6.getHashes,Rr=T6.pbkdf2,Ir=T6.pbkdf2Sync,Dr=T6.Cipher,Lr=T6.createCipher,br=T6.Cipheriv,gr=T6.createCipheriv,ur=T6.Decipher,yr=T6.createDecipher,xr=T6.Decipheriv,cr=T6.createDecipheriv,pr=T6.getCiphers,mr=T6.listCiphers,dr=T6.DiffieHellmanGroup,lr=T6.createDiffieHellmanGroup,rr=T6.getDiffieHellman,or=T6.createDiffieHellman,nr=T6.DiffieHellman,ir=T6.createSign,Br=T6.Sign,tr=T6.createVerify,Ur=T6.Verify,Fr=T6.createECDH,ar=T6.publicEncrypt,Qr=T6.privateEncrypt,er=T6.publicDecrypt,sr=T6.privateDecrypt,$o=T6.randomFill,qo=T6.randomFillSync,Ko=T6.createCredentials,_o=T6.constants,Yo=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];zo=crypto,Wo=crypto});var eS=u$((QK$,Ho)=>{Ho.exports={name:"dotenv",version:"17.2.3",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run tests/**/*.js --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run tests/**/*.js --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var wH=u$((eK$,GK)=>{var JH=(()=>({})),Uj=(LW(),W6(DW)),Jo=(gW(),W6(bW)),To=(dq(),W6(mq)),wo=eS(),TH=wo.version,sS=["\uD83D\uDD10 encrypt with Dotenvx: https://dotenvx.com","\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit","\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild","\uD83D\uDCE1 add observability to secrets: https://dotenvx.com/ops","\uD83D\uDC65 sync secrets across teammates & machines: https://dotenvx.com/ops","\uD83D\uDDC2️ backup and recover secrets: https://dotenvx.com/ops","✅ audit secrets and track compliance: https://dotenvx.com/ops","\uD83D\uDD04 add secrets lifecycle management: https://dotenvx.com/ops","\uD83D\uDD11 add access controls to secrets: https://dotenvx.com/ops","\uD83D\uDEE0️ run anywhere with `dotenvx run -- yourcommand`","⚙️ specify custom .env file path with { path: '/custom/path/.env' }","⚙️ enable debug logging with { debug: true }","⚙️ override existing env vars with { override: true }","⚙️ suppress all logs with { quiet: true }","⚙️ write to custom object with { processEnv: myObject }","⚙️ load multiple .env files with { path: ['.env.local', '.env'] }"];function Zo(){return sS[Math.floor(Math.random()*sS.length)]}function x4($){if(typeof $==="string")return!["false","0","no","off",""].includes($.toLowerCase());return Boolean($)}function fo(){return process.stdout.isTTY}function Xo($){return fo()?`\x1B[2m${$}\x1B[0m`:$}var ko=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Ao($){let q={},K=$.toString();K=K.replace(/\r\n?/mg,`
40
40
  `);let P;while((P=ko.exec(K))!=null){let _=P[1],O=P[2]||"";O=O.trim();let j=O[0];if(O=O.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),j==='"')O=O.replace(/\\n/g,`
@@ -54,7 +54,7 @@ Context: ${q}`:""}`),p1("[Unserializable]");if(c6("SUPPRESS_CIRCULAR_JSON_WARNIN
54
54
  Context: ${q}`:""}`),typeof _>"u")_=LR();W2($,"",0,[],void 0,0,_);let j;try{if($4.length===0)j=JSON.stringify($,K,P);else j=JSON.stringify($,gR(K),P)}catch(z){return p1("[unable to serialize, circular reference is too complex to analyze]")}finally{while(m1.length!==0){let z=m1.pop();if(z.length===4)Object.defineProperty(z[0],z[1],z[3]);else z[0][z[1]]=z[2]}}return p1(j)}}function z2($,q,K,P){var _=Object.getOwnPropertyDescriptor(P,K);if(_.get!==void 0)if(_.configurable)Object.defineProperty(P,K,{value:$}),m1.push([P,K,q,_]);else $4.push([q,K,$]);else P[K]=$,m1.push([P,K,q])}function W2($,q,K,P,_,O,j){O+=1;var z;if(typeof $==="object"&&$!==null){for(z=0;z<P.length;z++)if(P[z]===$){z2(IR,$,q,_);return}if(typeof j.depthLimit<"u"&&O>j.depthLimit){z2(uZ,$,q,_);return}if(typeof j.edgesLimit<"u"&&K+1>j.edgesLimit){z2(uZ,$,q,_);return}if(P.push($),Array.isArray($))for(z=0;z<$.length;z++)W2($[z],z,z,P,$,O,j);else{$=yZ($);var J=Object.keys($);for(z=0;z<J.length;z++){var w=J[z];W2($[w],w,z,P,$,O,j)}}P.pop()}}function gR($){return $=typeof $<"u"?$:function(q,K){return K},function(q,K){if($4.length>0)for(var P=0;P<$4.length;P++){var _=$4[P];if(_[1]===q&&_[0]===K){K=_[2],$4.splice(P,1);break}}return $.call(this,q,K)}}function xZ($,q){let K=f1(),P=q??pO(),_=$.extra??{},O=_.metadata;return $.extra={..._,runtime:{...K,..._?.runtime},metadata:{...P,...P.revision_id||"revision_id"in $&&$.revision_id?{revision_id:("revision_id"in $?$.revision_id:void 0)??P.revision_id}:{},...O}},$}var uR=($)=>{let q=$?.toString()??c6("TRACING_SAMPLING_RATE");if(q===void 0)return;let K=parseFloat(q);if(K<0||K>1)throw Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${K}`);return K},yR=($)=>{let K=$.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return K==="localhost"||K==="127.0.0.1"||K==="::1"};async function xR($){let q=[];for await(let K of $)q.push(K);return q}function d1($){if($===void 0)return;return $.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}var cR=async($)=>{if($?.status===429){let q=parseInt($.headers.get("retry-after")??"10",10)*1000;if(q>0)return await new Promise((K)=>setTimeout(K,q)),!0}return!1};function cZ($){if(typeof $==="number")return Number($.toFixed(4));return $}class dZ{constructor(){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0})}peek(){return this.items[0]}push($){let q,K=new Promise((_)=>{q=_}),P=oq($.item,`Serializing run with id: ${$.item.id}`).length;return this.items.push({action:$.action,payload:$.item,otelContext:$.otelContext,apiKey:$.apiKey,apiUrl:$.apiUrl,itemPromiseResolve:q,itemPromise:K,size:P}),this.sizeBytes+=P,K}pop({upToSizeBytes:$,upToSize:q}){if($<1)throw Error("Number of bytes to pop off may not be less than 1.");let K=[],P=0;while(P+(this.peek()?.size??0)<$&&this.items.length>0&&K.length<q){let _=this.items.shift();if(_)K.push(_),P+=_.size,this.sizeBytes-=_.size}if(K.length===0&&this.items.length>0){let _=this.items.shift();K.push(_),P+=_.size,this.sizeBytes-=_.size}return[K.map((_)=>({action:_.action,item:_.payload,otelContext:_.otelContext,apiKey:_.apiKey,apiUrl:_.apiUrl})),()=>K.forEach((_)=>_.itemPromiseResolve())]}}var pR=25165824,mR=1e4,dR=100,pZ="https://api.smith.langchain.com";class LK{get _fetch(){return this.fetchImplementation||fT(this.debug)}constructor($={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:new dZ}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchSizeLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:Qq("LANGSMITH_TRACING_BACKGROUND")==="false"}),Object.defineProperty(this,"traceBatchConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"manualFlushMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"langSmithToOTELTranslator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchImplementation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cachedLSEnvVarsForMetadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipartStreamingDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:Qq("LANGSMITH_DEBUG")==="true"});let q=LK.getDefaultClientConfig();if(this.tracingSampleRate=uR($.tracingSamplingRate),this.apiUrl=d1($.apiUrl??q.apiUrl)??"",this.apiUrl.endsWith("/"))this.apiUrl=this.apiUrl.slice(0,-1);if(this.apiKey=d1($.apiKey??q.apiKey),this.webUrl=d1($.webUrl??q.webUrl),this.webUrl?.endsWith("/"))this.webUrl=this.webUrl.slice(0,-1);if(this.workspaceId=d1($.workspaceId??c6("WORKSPACE_ID")),this.timeout_ms=$.timeout_ms??90000,this.caller=new N1({...$.callerOptions??{},maxRetries:4,debug:$.debug??this.debug}),this.traceBatchConcurrency=$.traceBatchConcurrency??this.traceBatchConcurrency,this.traceBatchConcurrency<1)throw Error("Trace batch concurrency must be positive.");if(this.debug=$.debug??this.debug,this.fetchImplementation=$.fetchImplementation,this.batchIngestCaller=new N1({maxRetries:2,maxConcurrency:this.traceBatchConcurrency,...$.callerOptions??{},onFailedResponseHook:cR,debug:$.debug??this.debug}),this.hideInputs=$.hideInputs??$.anonymizer??q.hideInputs,this.hideOutputs=$.hideOutputs??$.anonymizer??q.hideOutputs,this.autoBatchTracing=$.autoBatchTracing??this.autoBatchTracing,this.blockOnRootRunFinalization=$.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=$.batchSizeBytesLimit,this.batchSizeLimit=$.batchSizeLimit,this.fetchOptions=$.fetchOptions||{},this.manualFlushMode=$.manualFlushMode??this.manualFlushMode,X1())this.langSmithToOTELTranslator=new rO;this.cachedLSEnvVarsForMetadata=pO()}static getDefaultClientConfig(){let $=c6("API_KEY"),q=c6("ENDPOINT")??pZ,K=c6("HIDE_INPUTS")==="true",P=c6("HIDE_OUTPUTS")==="true";return{apiUrl:q,apiKey:$,webUrl:void 0,hideInputs:K,hideOutputs:P}}getHostUrl(){if(this.webUrl)return this.webUrl;else if(yR(this.apiUrl))return this.webUrl="http://localhost:3000",this.webUrl;else if(this.apiUrl.endsWith("/api/v1"))return this.webUrl=this.apiUrl.replace("/api/v1",""),this.webUrl;else if(this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api"))return this.webUrl=this.apiUrl.replace("/api",""),this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("dev"))return this.webUrl="https://dev.smith.langchain.com",this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("eu"))return this.webUrl="https://eu.smith.langchain.com",this.webUrl;else if(this.apiUrl.split(".",1)[0].includes("beta"))return this.webUrl="https://beta.smith.langchain.com",this.webUrl;else return this.webUrl="https://smith.langchain.com",this.webUrl}get headers(){let $={"User-Agent":`langsmith-js/${Z1}`};if(this.apiKey)$["x-api-key"]=`${this.apiKey}`;if(this.workspaceId)$["x-tenant-id"]=this.workspaceId;return $}_getPlatformEndpointPath($){return this.apiUrl.slice(-3)!=="/v1"&&this.apiUrl.slice(-4)!=="/v1/"?`/v1/platform/${$}`:`/platform/${$}`}async processInputs($){if(this.hideInputs===!1)return $;if(this.hideInputs===!0)return{};if(typeof this.hideInputs==="function")return this.hideInputs($);return $}async processOutputs($){if(this.hideOutputs===!1)return $;if(this.hideOutputs===!0)return{};if(typeof this.hideOutputs==="function")return this.hideOutputs($);return $}async prepareRunCreateOrUpdateInputs($){let q={...$};if(q.inputs!==void 0)q.inputs=await this.processInputs(q.inputs);if(q.outputs!==void 0)q.outputs=await this.processOutputs(q.outputs);return q}async _getResponse($,q){let K=q?.toString()??"",P=`${this.apiUrl}${$}?${K}`;return await this.caller.call(async()=>{let O=await this._fetch(P,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(O,`fetch ${$}`),O})}async _get($,q){return(await this._getResponse($,q)).json()}async*_getPaginated($,q=new URLSearchParams,K){let P=Number(q.get("offset"))||0,_=Number(q.get("limit"))||100;while(!0){q.set("offset",String(P)),q.set("limit",String(_));let O=`${this.apiUrl}${$}?${q}`,j=await this.caller.call(async()=>{let J=await this._fetch(O,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(J,`fetch ${$}`),J}),z=K?K(await j.json()):await j.json();if(z.length===0)break;if(yield z,z.length<_)break;P+=z.length}}async*_getCursorPaginatedList($,q=null,K="POST",P="runs"){let _=q?{...q}:{};while(!0){let O=JSON.stringify(_),z=await(await this.caller.call(async()=>{let w=await this._fetch(`${this.apiUrl}${$}`,{method:K,headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(w,`fetch ${$}`),w})).json();if(!z)break;if(!z[P])break;yield z[P];let J=z.cursors;if(!J)break;if(!J.next)break;_.cursor=J.next}}_shouldSample(){if(this.tracingSampleRate===void 0)return!0;return Math.random()<this.tracingSampleRate}_filterForSampling($,q=!1){if(this.tracingSampleRate===void 0)return $;if(q){let K=[];for(let P of $)if(!this.filteredPostUuids.has(P.trace_id))K.push(P);else if(P.id===P.trace_id)this.filteredPostUuids.delete(P.trace_id);return K}else{let K=[];for(let P of $){let _=P.trace_id??P.id;if(this.filteredPostUuids.has(_))continue;if(P.id===_)if(this._shouldSample())K.push(P);else this.filteredPostUuids.add(_);else K.push(P)}return K}}async _getBatchSizeLimitBytes(){let $=await this._ensureServerInfo();return this.batchSizeBytesLimit??$.batch_ingest_config?.size_limit_bytes??pR}async _getBatchSizeLimit(){let $=await this._ensureServerInfo();return this.batchSizeLimit??$.batch_ingest_config?.size_limit??dR}async _getDatasetExamplesMultiPartSupport(){return(await this._ensureServerInfo()).instance_flags?.dataset_examples_multipart_enabled??!1}drainAutoBatchQueue({batchSizeLimitBytes:$,batchSizeLimit:q}){let K=[];while(this.autoBatchQueue.items.length>0){let[P,_]=this.autoBatchQueue.pop({upToSizeBytes:$,upToSize:q});if(!P.length){_();break}let O=P.reduce((J,w)=>{let k=w.apiUrl??this.apiUrl,X=w.apiKey??this.apiKey,V=w.apiKey===this.apiKey&&w.apiUrl===this.apiUrl?"default":`${k}|${X}`;if(!J[V])J[V]=[];return J[V].push(w),J},{}),j=[];for(let[J,w]of Object.entries(O)){let k=this._processBatch(w,{apiUrl:J==="default"?void 0:J.split("|")[0],apiKey:J==="default"?void 0:J.split("|")[1]});j.push(k)}let z=Promise.all(j).finally(_);K.push(z)}return Promise.all(K)}async _processBatch($,q){if(!$.length)return;try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator($);else{let K={runCreates:$.filter((_)=>_.action==="create").map((_)=>_.item),runUpdates:$.filter((_)=>_.action==="update").map((_)=>_.item)},P=await this._ensureServerInfo();if(P?.batch_ingest_config?.use_multipart_endpoint){let _=P?.instance_flags?.gzip_body_enabled;await this.multipartIngestRuns(K,{...q,useGzip:_})}else await this.batchIngestRuns(K,q)}}catch(K){console.error("Error exporting batch:",K)}}_sendBatchToOTELTranslator($){if(this.langSmithToOTELTranslator!==void 0){let q=new Map,K=[];for(let P of $)if(P.item.id&&P.otelContext)if(q.set(P.item.id,P.otelContext),P.action==="create")K.push({operation:"post",id:P.item.id,trace_id:P.item.trace_id??P.item.id,run:P.item});else K.push({operation:"patch",id:P.item.id,trace_id:P.item.trace_id??P.item.id,run:P.item});this.langSmithToOTELTranslator.exportBatch(K,q)}}async processRunOperation($){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,$.item=xZ($.item,this.cachedLSEnvVarsForMetadata);let q=this.autoBatchQueue.push($);if(this.manualFlushMode)return q;let K=await this._getBatchSizeLimitBytes(),P=await this._getBatchSizeLimit();if(this.autoBatchQueue.sizeBytes>K||this.autoBatchQueue.items.length>P)this.drainAutoBatchQueue({batchSizeLimitBytes:K,batchSizeLimit:P});if(this.autoBatchQueue.items.length>0)this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue({batchSizeLimitBytes:K,batchSizeLimit:P})},this.autoBatchAggregationDelayMs);return q}async _getServerInfo(){let q=await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(mR),...this.fetchOptions});return await a$(K,"get server info"),K})).json();if(this.debug)console.log(`
55
55
  === LangSmith Server Configuration ===
56
56
  `+JSON.stringify(q,null,2)+`
57
- `);return q}async _ensureServerInfo(){if(this._getServerInfoPromise===void 0)this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch($){console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${$.status??"Unspecified status code"} ${$.message}`)}return this._serverInfo??{}})();return this._getServerInfoPromise.then(($)=>{if(this._serverInfo===void 0)this._getServerInfoPromise=void 0;return $})}async _getSettings(){if(!this.settings)this.settings=this._get("/settings");return await this.settings}async flush(){let $=await this._getBatchSizeLimitBytes(),q=await this._getBatchSizeLimit();await this.drainAutoBatchQueue({batchSizeLimitBytes:$,batchSizeLimit:q})}_cloneCurrentOTELContext(){let $=k1(),q=MT();if(this.langSmithToOTELTranslator!==void 0){let K=$.getActiveSpan();if(K)return $.setSpan(q.active(),K)}return}async createRun($,q){if(!this._filterForSampling([$]).length)return;let K={...this.headers,"Content-Type":"application/json"},P=$.project_name;delete $.project_name;let _=await this.prepareRunCreateOrUpdateInputs({session_name:P,...$,start_time:$.start_time??Date.now()});if(this.autoBatchTracing&&_.trace_id!==void 0&&_.dotted_order!==void 0){let z=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:_,otelContext:z,apiKey:q?.apiKey,apiUrl:q?.apiUrl}).catch(console.error);return}let O=xZ(_,this.cachedLSEnvVarsForMetadata);if(q?.apiKey!==void 0)K["x-api-key"]=q.apiKey;if(q?.workspaceId!==void 0)K["x-tenant-id"]=q.workspaceId;let j=oq(O,`Creating run with id: ${O.id}`);await this.caller.call(async()=>{let z=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:K,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"create run",!0),z})}async batchIngestRuns({runCreates:$,runUpdates:q},K){if($===void 0&&q===void 0)return;let P=await Promise.all($?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]),_=await Promise.all(q?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]);if(P.length>0&&_.length>0){let z=P.reduce((w,k)=>{if(!k.id)return w;return w[k.id]=k,w},{}),J=[];for(let w of _)if(w.id!==void 0&&z[w.id])z[w.id]={...z[w.id],...w};else J.push(w);P=Object.values(z),_=J}let O={post:P,patch:_};if(!O.post.length&&!O.patch.length)return;let j={post:[],patch:[]};for(let z of["post","patch"]){let J=z,w=O[J].reverse(),k=w.pop();while(k!==void 0)j[J].push(k),k=w.pop()}if(j.post.length>0||j.patch.length>0){let z=j.post.map((J)=>J.id).concat(j.patch.map((J)=>J.id)).join(",");await this._postBatchIngestRuns(oq(j,`Ingesting runs with ids: ${z}`),K)}}async _postBatchIngestRuns($,q){let K={...this.headers,"Content-Type":"application/json",Accept:"application/json"};if(q?.apiKey!==void 0)K["x-api-key"]=q.apiKey;await this.batchIngestCaller.call(async()=>{let P=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:K,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:$});return await a$(P,"batch create run",!0),P})}async multipartIngestRuns({runCreates:$,runUpdates:q},K){if($===void 0&&q===void 0)return;let P={},_=[];for(let k of $??[]){let X=await this.prepareRunCreateOrUpdateInputs(k);if(X.id!==void 0&&X.attachments!==void 0)P[X.id]=X.attachments;delete X.attachments,_.push(X)}let O=[];for(let k of q??[])O.push(await this.prepareRunCreateOrUpdateInputs(k));if(_.find((k)=>{return k.trace_id===void 0||k.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(O.find((k)=>{return k.trace_id===void 0||k.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(_.length>0&&O.length>0){let k=_.reduce((G,V)=>{if(!V.id)return G;return G[V.id]=V,G},{}),X=[];for(let G of O)if(G.id!==void 0&&k[G.id])k[G.id]={...k[G.id],...G};else X.push(G);_=Object.values(k),O=X}if(_.length===0&&O.length===0)return;let J=[],w=[];for(let[k,X]of[["post",_],["patch",O]])for(let G of X){let{inputs:V,outputs:C,events:E,extra:h,error:I,serialized:D,attachments:g,...u}=G,y={inputs:V,outputs:C,events:E,extra:h,error:I,serialized:D},p=oq(u,`Serializing for multipart ingestion of run with id: ${u.id}`);w.push({name:`${k}.${u.id}`,payload:new Blob([p],{type:`application/json; length=${p.length}`})});for(let[m,s]of Object.entries(y)){if(s===void 0)continue;let U=oq(s,`Serializing ${m} for multipart ingestion of run with id: ${u.id}`);w.push({name:`${k}.${u.id}.${m}`,payload:new Blob([U],{type:`application/json; length=${U.length}`})})}if(u.id!==void 0){let m=P[u.id];if(m){delete P[u.id];for(let[s,U]of Object.entries(m)){let l,o;if(Array.isArray(U))[l,o]=U;else l=U.mimeType,o=U.data;if(s.includes(".")){console.warn(`Skipping attachment '${s}' for run ${u.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}w.push({name:`attachment.${u.id}.${s}`,payload:new Blob([o],{type:`${l}; length=${o.byteLength}`})})}}}J.push(`trace=${u.trace_id},id=${u.id}`)}await this._sendMultipartRequest(w,J.join("; "),K)}async _createNodeFetchBody($,q){let K=[];for(let O of $)K.push(new Blob([`--${q}\r
57
+ `);return q}async _ensureServerInfo(){if(this._getServerInfoPromise===void 0)this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch($){console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${$.status??"Unspecified status code"} ${$.message}`)}return this._serverInfo??{}})();return this._getServerInfoPromise.then(($)=>{if(this._serverInfo===void 0)this._getServerInfoPromise=void 0;return $})}async _getSettings(){if(!this.settings)this.settings=this._get("/settings");return await this.settings}async flush(){let $=await this._getBatchSizeLimitBytes(),q=await this._getBatchSizeLimit();await this.drainAutoBatchQueue({batchSizeLimitBytes:$,batchSizeLimit:q})}_cloneCurrentOTELContext(){let $=k1(),q=MT();if(this.langSmithToOTELTranslator!==void 0){let K=$.getActiveSpan();if(K)return $.setSpan(q.active(),K)}return}async createRun($,q){if(!this._filterForSampling([$]).length)return;let K={...this.headers,"Content-Type":"application/json"},P=$.project_name;delete $.project_name;let _=await this.prepareRunCreateOrUpdateInputs({session_name:P,...$,start_time:$.start_time??Date.now()});if(this.autoBatchTracing&&_.trace_id!==void 0&&_.dotted_order!==void 0){let z=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:_,otelContext:z,apiKey:q?.apiKey,apiUrl:q?.apiUrl}).catch(console.error);return}let O=xZ(_,this.cachedLSEnvVarsForMetadata);if(q?.apiKey!==void 0)K["x-api-key"]=q.apiKey;if(q?.workspaceId!==void 0)K["x-tenant-id"]=q.workspaceId;let j=oq(O,`Creating run with id: ${O.id}`);await this.caller.call(async()=>{let z=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:K,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"create run",!0),z})}async batchIngestRuns({runCreates:$,runUpdates:q},K){if($===void 0&&q===void 0)return;let P=await Promise.all($?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]),_=await Promise.all(q?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]);if(P.length>0&&_.length>0){let z=P.reduce((w,k)=>{if(!k.id)return w;return w[k.id]=k,w},{}),J=[];for(let w of _)if(w.id!==void 0&&z[w.id])z[w.id]={...z[w.id],...w};else J.push(w);P=Object.values(z),_=J}let O={post:P,patch:_};if(!O.post.length&&!O.patch.length)return;let j={post:[],patch:[]};for(let z of["post","patch"]){let J=z,w=O[J].reverse(),k=w.pop();while(k!==void 0)j[J].push(k),k=w.pop()}if(j.post.length>0||j.patch.length>0){let z=j.post.map((J)=>J.id).concat(j.patch.map((J)=>J.id)).join(",");await this._postBatchIngestRuns(oq(j,`Ingesting runs with ids: ${z}`),K)}}async _postBatchIngestRuns($,q){let K={...this.headers,"Content-Type":"application/json",Accept:"application/json"};if(q?.apiKey!==void 0)K["x-api-key"]=q.apiKey;await this.batchIngestCaller.call(async()=>{let P=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:K,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:$});return await a$(P,"batch create run",!0),P})}async multipartIngestRuns({runCreates:$,runUpdates:q},K){if($===void 0&&q===void 0)return;let P={},_=[];for(let k of $??[]){let X=await this.prepareRunCreateOrUpdateInputs(k);if(X.id!==void 0&&X.attachments!==void 0)P[X.id]=X.attachments;delete X.attachments,_.push(X)}let O=[];for(let k of q??[])O.push(await this.prepareRunCreateOrUpdateInputs(k));if(_.find((k)=>{return k.trace_id===void 0||k.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(O.find((k)=>{return k.trace_id===void 0||k.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(_.length>0&&O.length>0){let k=_.reduce((G,V)=>{if(!V.id)return G;return G[V.id]=V,G},{}),X=[];for(let G of O)if(G.id!==void 0&&k[G.id])k[G.id]={...k[G.id],...G};else X.push(G);_=Object.values(k),O=X}if(_.length===0&&O.length===0)return;let J=[],w=[];for(let[k,X]of[["post",_],["patch",O]])for(let G of X){let{inputs:V,outputs:C,events:E,extra:h,error:I,serialized:D,attachments:g,...u}=G,y={inputs:V,outputs:C,events:E,extra:h,error:I,serialized:D},p=oq(u,`Serializing for multipart ingestion of run with id: ${u.id}`);w.push({name:`${k}.${u.id}`,payload:new Blob([p],{type:`application/json; length=${p.length}`})});for(let[l,Q]of Object.entries(y)){if(Q===void 0)continue;let e=oq(Q,`Serializing ${l} for multipart ingestion of run with id: ${u.id}`);w.push({name:`${k}.${u.id}.${l}`,payload:new Blob([e],{type:`application/json; length=${e.length}`})})}if(u.id!==void 0){let l=P[u.id];if(l){delete P[u.id];for(let[Q,e]of Object.entries(l)){let m,o;if(Array.isArray(e))[m,o]=e;else m=e.mimeType,o=e.data;if(Q.includes(".")){console.warn(`Skipping attachment '${Q}' for run ${u.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}w.push({name:`attachment.${u.id}.${Q}`,payload:new Blob([o],{type:`${m}; length=${o.byteLength}`})})}}}J.push(`trace=${u.trace_id},id=${u.id}`)}await this._sendMultipartRequest(w,J.join("; "),K)}async _createNodeFetchBody($,q){let K=[];for(let O of $)K.push(new Blob([`--${q}\r
58
58
  `])),K.push(new Blob([`Content-Disposition: form-data; name="${O.name}"\r
59
59
  `,`Content-Type: ${O.payload.type}\r
60
60
  \r
@@ -68,11 +68,11 @@ Context: ${q}`:""}`),typeof _>"u")_=LR();W2($,"",0,[],void 0,0,_);let j;try{if($
68
68
  `)}await O(`--${q}--\r
69
69
  `),_.close()}})}async _sendMultipartRequest($,q,K){let P="----LangSmithFormBoundary"+Math.random().toString(36).slice(2),_=ZT(),O=()=>this._createNodeFetchBody($,P),j=()=>this._createMultipartStream($,P),z=async(J)=>{return this.batchIngestCaller.call(async()=>{let w=await J(),k={...this.headers,"Content-Type":`multipart/form-data; boundary=${P}`};if(K?.apiKey!==void 0)k["x-api-key"]=K.apiKey;let X=w;if(K?.useGzip&&typeof w==="object"&&"pipeThrough"in w)X=w.pipeThrough(new CompressionStream("gzip")),k["Content-Encoding"]="gzip";let G=await this._fetch(`${K?.apiUrl??this.apiUrl}/runs/multipart`,{method:"POST",headers:k,body:X,duplex:"half",signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(G,"Failed to send multipart request",!0),G})};try{let J,w=!1;if(!_&&!this.multipartStreamingDisabled&&cO()!=="bun")w=!0,J=await z(j);else J=await z(O);if((!this.multipartStreamingDisabled||w)&&J.status===422&&(K?.apiUrl??this.apiUrl)!==pZ)console.warn(`Streaming multipart upload to ${K?.apiUrl??this.apiUrl}/runs/multipart failed. This usually means the host does not support chunked uploads. Retrying with a buffered upload for operation "${q}".`),this.multipartStreamingDisabled=!0,J=await z(O)}catch(J){console.warn(`${J.message.trim()}
70
70
 
71
- Context: ${q}`)}}async updateRun($,q,K){if(_6($),q.inputs)q.inputs=await this.processInputs(q.inputs);if(q.outputs)q.outputs=await this.processOutputs(q.outputs);let P={...q,id:$};if(!this._filterForSampling([P],!0).length)return;if(this.autoBatchTracing&&P.trace_id!==void 0&&P.dotted_order!==void 0){let j=this._cloneCurrentOTELContext();if(q.end_time!==void 0&&P.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:P,otelContext:j,apiKey:K?.apiKey,apiUrl:K?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:P,otelContext:j,apiKey:K?.apiKey,apiUrl:K?.apiUrl}).catch(console.error);return}let _={...this.headers,"Content-Type":"application/json"};if(K?.apiKey!==void 0)_["x-api-key"]=K.apiKey;if(K?.workspaceId!==void 0)_["x-tenant-id"]=K.workspaceId;let O=oq(q,`Serializing payload to update run with id: ${$}`);await this.caller.call(async()=>{let j=await this._fetch(`${K?.apiUrl??this.apiUrl}/runs/${$}`,{method:"PATCH",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(j,"update run",!0),j})}async readRun($,{loadChildRuns:q}={loadChildRuns:!1}){_6($);let K=await this._get(`/runs/${$}`);if(q)K=await this._loadChildRuns(K);return K}async getRunUrl({runId:$,run:q,projectOpts:K}){if(q!==void 0){let P;if(q.session_id)P=q.session_id;else if(K?.projectName)P=(await this.readProject({projectName:K?.projectName})).id;else if(K?.projectId)P=K?.projectId;else P=(await this.readProject({projectName:c6("PROJECT")||"default"})).id;let _=await this._getTenantId();return`${this.getHostUrl()}/o/${_}/projects/p/${P}/r/${q.id}?poll=true`}else if($!==void 0){let P=await this.readRun($);if(!P.app_path)throw Error(`Run ${$} has no app_path`);return`${this.getHostUrl()}${P.app_path}`}else throw Error("Must provide either runId or run")}async _loadChildRuns($){let q=await xR(this.listRuns({isRoot:!1,projectId:$.session_id,traceId:$.trace_id})),K={},P={};q.sort((_,O)=>(_?.dotted_order??"").localeCompare(O?.dotted_order??""));for(let _ of q){if(_.parent_run_id===null||_.parent_run_id===void 0)throw Error(`Child run ${_.id} has no parent`);if(_.dotted_order?.startsWith($.dotted_order??"")&&_.id!==$.id){if(!(_.parent_run_id in K))K[_.parent_run_id]=[];K[_.parent_run_id].push(_),P[_.id]=_}}$.child_runs=K[$.id]||[];for(let _ in K)if(_!==$.id)P[_].child_runs=K[_];return $}async*listRuns($){let{projectId:q,projectName:K,parentRunId:P,traceId:_,referenceExampleId:O,startTime:j,executionOrder:z,isRoot:J,runType:w,error:k,id:X,query:G,filter:V,traceFilter:C,treeFilter:E,limit:h,select:I,order:D}=$,g=[];if(q)g=Array.isArray(q)?q:[q];if(K){let m=Array.isArray(K)?K:[K],s=await Promise.all(m.map((U)=>this.readProject({projectName:U}).then((l)=>l.id)));g.push(...s)}let u=["app_path","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],y={session:g.length?g:null,run_type:w,reference_example:O,query:G,filter:V,trace_filter:C,tree_filter:E,execution_order:z,parent_run:P,start_time:j?j.toISOString():null,error:k,id:X,limit:h,trace:_,select:I?I:u,is_root:J,order:D};if(y.select.includes("child_run_ids"))HP("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");let p=0;for await(let m of this._getCursorPaginatedList("/runs/query",y))if(h){if(p>=h)break;if(m.length+p>h){yield*m.slice(0,h-p);break}p+=m.length,yield*m}else yield*m}async*listGroupRuns($){let{projectId:q,projectName:K,groupBy:P,filter:_,startTime:O,endTime:j,limit:z,offset:J}=$,k={session_id:q||(await this.readProject({projectName:K})).id,group_by:P,filter:_,start_time:O?O.toISOString():null,end_time:j?j.toISOString():null,limit:Number(z)||100},X=Number(J)||0,G="/runs/group",V=`${this.apiUrl}${G}`;while(!0){let C={...k,offset:X},E=Object.fromEntries(Object.entries(C).filter(([y,p])=>p!==void 0)),h=JSON.stringify(E),D=await(await this.caller.call(async()=>{let y=await this._fetch(V,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:h});return await a$(y,`Failed to fetch ${G}`),y})).json(),{groups:g,total:u}=D;if(g.length===0)break;for(let y of g)yield y;if(X+=g.length,X>=u)break}}async getRunStats({id:$,trace:q,parentRun:K,runType:P,projectNames:_,projectIds:O,referenceExampleIds:j,startTime:z,endTime:J,error:w,query:k,filter:X,traceFilter:G,treeFilter:V,isRoot:C,dataSourceType:E}){let h=O||[];if(_)h=[...O||[],...await Promise.all(_.map((p)=>this.readProject({projectName:p}).then((m)=>m.id)))];let D=Object.fromEntries(Object.entries({id:$,trace:q,parent_run:K,run_type:P,session:h,reference_example:j,start_time:z,end_time:J,error:w,query:k,filter:X,trace_filter:G,tree_filter:V,is_root:C,data_source_type:E}).filter(([p,m])=>m!==void 0)),g=JSON.stringify(D);return await(await this.caller.call(async()=>{let p=await this._fetch(`${this.apiUrl}/runs/stats`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:g});return await a$(p,"get run stats"),p})).json()}async shareRun($,{shareId:q}={}){let K={run_id:$,share_token:q||qK()};_6($);let P=JSON.stringify(K),O=await(await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:P});return await a$(j,"share run"),j})).json();if(O===null||!("share_token"in O))throw Error("Invalid response from server");return`${this.getHostUrl()}/public/${O.share_token}/r`}async unshareRun($){_6($),await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"unshare run",!0),q})}async readRunSharedLink($){_6($);let K=await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(P,"read run shared link"),P})).json();if(K===null||!("share_token"in K))return;return`${this.getHostUrl()}/public/${K.share_token}/r`}async listSharedRuns($,{runIds:q}={}){let K=new URLSearchParams({share_token:$});if(q!==void 0)for(let O of q)K.append("id",O);return _6($),await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/public/${$}/runs${K}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(O,"list shared runs"),O})).json()}async readDatasetSharedSchema($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;_6($);let P=await(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,"read dataset shared schema"),_})).json();return P.url=`${this.getHostUrl()}/public/${P.share_token}/d`,P}async shareDataset($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;let K={dataset_id:$};_6($);let P=JSON.stringify(K),O=await(await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:P});return await a$(j,"share dataset"),j})).json();return O.url=`${this.getHostUrl()}/public/${O.share_token}/d`,O}async unshareDataset($){_6($),await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"unshare dataset",!0),q})}async readSharedDataset($){return _6($),await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/public/${$}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(P,"read shared dataset"),P})).json()}async listSharedExamples($,q){let K={};if(q?.exampleIds)K.id=q.exampleIds;let P=new URLSearchParams;Object.entries(K).forEach(([j,z])=>{if(Array.isArray(z))z.forEach((J)=>P.append(j,J));else P.append(j,z)});let _=await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/public/${$}/examples?${P.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(j,"list shared examples"),j}),O=await _.json();if(!_.ok){if("detail"in O)throw Error(`Failed to list shared examples.
71
+ Context: ${q}`)}}async updateRun($,q,K){if(_6($),q.inputs)q.inputs=await this.processInputs(q.inputs);if(q.outputs)q.outputs=await this.processOutputs(q.outputs);let P={...q,id:$};if(!this._filterForSampling([P],!0).length)return;if(this.autoBatchTracing&&P.trace_id!==void 0&&P.dotted_order!==void 0){let j=this._cloneCurrentOTELContext();if(q.end_time!==void 0&&P.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:P,otelContext:j,apiKey:K?.apiKey,apiUrl:K?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:P,otelContext:j,apiKey:K?.apiKey,apiUrl:K?.apiUrl}).catch(console.error);return}let _={...this.headers,"Content-Type":"application/json"};if(K?.apiKey!==void 0)_["x-api-key"]=K.apiKey;if(K?.workspaceId!==void 0)_["x-tenant-id"]=K.workspaceId;let O=oq(q,`Serializing payload to update run with id: ${$}`);await this.caller.call(async()=>{let j=await this._fetch(`${K?.apiUrl??this.apiUrl}/runs/${$}`,{method:"PATCH",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(j,"update run",!0),j})}async readRun($,{loadChildRuns:q}={loadChildRuns:!1}){_6($);let K=await this._get(`/runs/${$}`);if(q)K=await this._loadChildRuns(K);return K}async getRunUrl({runId:$,run:q,projectOpts:K}){if(q!==void 0){let P;if(q.session_id)P=q.session_id;else if(K?.projectName)P=(await this.readProject({projectName:K?.projectName})).id;else if(K?.projectId)P=K?.projectId;else P=(await this.readProject({projectName:c6("PROJECT")||"default"})).id;let _=await this._getTenantId();return`${this.getHostUrl()}/o/${_}/projects/p/${P}/r/${q.id}?poll=true`}else if($!==void 0){let P=await this.readRun($);if(!P.app_path)throw Error(`Run ${$} has no app_path`);return`${this.getHostUrl()}${P.app_path}`}else throw Error("Must provide either runId or run")}async _loadChildRuns($){let q=await xR(this.listRuns({isRoot:!1,projectId:$.session_id,traceId:$.trace_id})),K={},P={};q.sort((_,O)=>(_?.dotted_order??"").localeCompare(O?.dotted_order??""));for(let _ of q){if(_.parent_run_id===null||_.parent_run_id===void 0)throw Error(`Child run ${_.id} has no parent`);if(_.dotted_order?.startsWith($.dotted_order??"")&&_.id!==$.id){if(!(_.parent_run_id in K))K[_.parent_run_id]=[];K[_.parent_run_id].push(_),P[_.id]=_}}$.child_runs=K[$.id]||[];for(let _ in K)if(_!==$.id)P[_].child_runs=K[_];return $}async*listRuns($){let{projectId:q,projectName:K,parentRunId:P,traceId:_,referenceExampleId:O,startTime:j,executionOrder:z,isRoot:J,runType:w,error:k,id:X,query:G,filter:V,traceFilter:C,treeFilter:E,limit:h,select:I,order:D}=$,g=[];if(q)g=Array.isArray(q)?q:[q];if(K){let l=Array.isArray(K)?K:[K],Q=await Promise.all(l.map((e)=>this.readProject({projectName:e}).then((m)=>m.id)));g.push(...Q)}let u=["app_path","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],y={session:g.length?g:null,run_type:w,reference_example:O,query:G,filter:V,trace_filter:C,tree_filter:E,execution_order:z,parent_run:P,start_time:j?j.toISOString():null,error:k,id:X,limit:h,trace:_,select:I?I:u,is_root:J,order:D};if(y.select.includes("child_run_ids"))HP("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");let p=0;for await(let l of this._getCursorPaginatedList("/runs/query",y))if(h){if(p>=h)break;if(l.length+p>h){yield*l.slice(0,h-p);break}p+=l.length,yield*l}else yield*l}async*listGroupRuns($){let{projectId:q,projectName:K,groupBy:P,filter:_,startTime:O,endTime:j,limit:z,offset:J}=$,k={session_id:q||(await this.readProject({projectName:K})).id,group_by:P,filter:_,start_time:O?O.toISOString():null,end_time:j?j.toISOString():null,limit:Number(z)||100},X=Number(J)||0,G="/runs/group",V=`${this.apiUrl}${G}`;while(!0){let C={...k,offset:X},E=Object.fromEntries(Object.entries(C).filter(([y,p])=>p!==void 0)),h=JSON.stringify(E),D=await(await this.caller.call(async()=>{let y=await this._fetch(V,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:h});return await a$(y,`Failed to fetch ${G}`),y})).json(),{groups:g,total:u}=D;if(g.length===0)break;for(let y of g)yield y;if(X+=g.length,X>=u)break}}async getRunStats({id:$,trace:q,parentRun:K,runType:P,projectNames:_,projectIds:O,referenceExampleIds:j,startTime:z,endTime:J,error:w,query:k,filter:X,traceFilter:G,treeFilter:V,isRoot:C,dataSourceType:E}){let h=O||[];if(_)h=[...O||[],...await Promise.all(_.map((p)=>this.readProject({projectName:p}).then((l)=>l.id)))];let D=Object.fromEntries(Object.entries({id:$,trace:q,parent_run:K,run_type:P,session:h,reference_example:j,start_time:z,end_time:J,error:w,query:k,filter:X,trace_filter:G,tree_filter:V,is_root:C,data_source_type:E}).filter(([p,l])=>l!==void 0)),g=JSON.stringify(D);return await(await this.caller.call(async()=>{let p=await this._fetch(`${this.apiUrl}/runs/stats`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:g});return await a$(p,"get run stats"),p})).json()}async shareRun($,{shareId:q}={}){let K={run_id:$,share_token:q||qK()};_6($);let P=JSON.stringify(K),O=await(await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:P});return await a$(j,"share run"),j})).json();if(O===null||!("share_token"in O))throw Error("Invalid response from server");return`${this.getHostUrl()}/public/${O.share_token}/r`}async unshareRun($){_6($),await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"unshare run",!0),q})}async readRunSharedLink($){_6($);let K=await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(P,"read run shared link"),P})).json();if(K===null||!("share_token"in K))return;return`${this.getHostUrl()}/public/${K.share_token}/r`}async listSharedRuns($,{runIds:q}={}){let K=new URLSearchParams({share_token:$});if(q!==void 0)for(let O of q)K.append("id",O);return _6($),await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/public/${$}/runs${K}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(O,"list shared runs"),O})).json()}async readDatasetSharedSchema($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;_6($);let P=await(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,"read dataset shared schema"),_})).json();return P.url=`${this.getHostUrl()}/public/${P.share_token}/d`,P}async shareDataset($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;let K={dataset_id:$};_6($);let P=JSON.stringify(K),O=await(await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:P});return await a$(j,"share dataset"),j})).json();return O.url=`${this.getHostUrl()}/public/${O.share_token}/d`,O}async unshareDataset($){_6($),await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"unshare dataset",!0),q})}async readSharedDataset($){return _6($),await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/public/${$}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(P,"read shared dataset"),P})).json()}async listSharedExamples($,q){let K={};if(q?.exampleIds)K.id=q.exampleIds;let P=new URLSearchParams;Object.entries(K).forEach(([j,z])=>{if(Array.isArray(z))z.forEach((J)=>P.append(j,J));else P.append(j,z)});let _=await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/public/${$}/examples?${P.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(j,"list shared examples"),j}),O=await _.json();if(!_.ok){if("detail"in O)throw Error(`Failed to list shared examples.
72
72
  Status: ${_.status}
73
73
  Message: ${Array.isArray(O.detail)?O.detail.join(`
74
74
  `):"Unspecified error"}`);throw Error(`Failed to list shared examples: ${_.status} ${_.statusText}`)}return O.map((j)=>({...j,_hostUrl:this.getHostUrl()}))}async createProject({projectName:$,description:q=null,metadata:K=null,upsert:P=!1,projectExtra:_=null,referenceDatasetId:O=null}){let j=P?"?upsert=true":"",z=`${this.apiUrl}/sessions${j}`,J=_||{};if(K)J.metadata=K;let w={name:$,extra:J,description:q};if(O!==null)w.reference_dataset_id=O;let k=JSON.stringify(w);return await(await this.caller.call(async()=>{let V=await this._fetch(z,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:k});return await a$(V,"create project"),V})).json()}async updateProject($,{name:q=null,description:K=null,metadata:P=null,projectExtra:_=null,endTime:O=null}){let j=`${this.apiUrl}/sessions/${$}`,z=_;if(P)z={...z||{},metadata:P};let J=JSON.stringify({name:q,extra:z,description:K,end_time:O?new Date(O).toISOString():null});return await(await this.caller.call(async()=>{let X=await this._fetch(j,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:J});return await a$(X,"update project"),X})).json()}async hasProject({projectId:$,projectName:q}){let K="/sessions",P=new URLSearchParams;if($!==void 0&&q!==void 0)throw Error("Must provide either projectName or projectId, not both");else if($!==void 0)_6($),K+=`/${$}`;else if(q!==void 0)P.append("name",q);else throw Error("Must provide projectName or projectId");let _=await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}${K}?${P}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(O,"has project"),O});try{let O=await _.json();if(!_.ok)return!1;if(Array.isArray(O))return O.length>0;return!0}catch(O){return!1}}async readProject({projectId:$,projectName:q,includeStats:K}){let P="/sessions",_=new URLSearchParams;if($!==void 0&&q!==void 0)throw Error("Must provide either projectName or projectId, not both");else if($!==void 0)_6($),P+=`/${$}`;else if(q!==void 0)_.append("name",q);else throw Error("Must provide projectName or projectId");if(K!==void 0)_.append("include_stats",K.toString());let O=await this._get(P,_),j;if(Array.isArray(O)){if(O.length===0)throw Error(`Project[id=${$}, name=${q}] not found`);j=O[0]}else j=O;return j}async getProjectUrl({projectId:$,projectName:q}){if($===void 0&&q===void 0)throw Error("Must provide either projectName or projectId");let K=await this.readProject({projectId:$,projectName:q}),P=await this._getTenantId();return`${this.getHostUrl()}/o/${P}/projects/p/${K.id}`}async getDatasetUrl({datasetId:$,datasetName:q}){if($===void 0&&q===void 0)throw Error("Must provide either datasetName or datasetId");let K=await this.readDataset({datasetId:$,datasetName:q}),P=await this._getTenantId();return`${this.getHostUrl()}/o/${P}/datasets/${K.id}`}async _getTenantId(){if(this._tenantId!==null)return this._tenantId;let $=new URLSearchParams({limit:"1"});for await(let q of this._getPaginated("/sessions",$))return this._tenantId=q[0].tenant_id,q[0].tenant_id;throw Error("No projects found to resolve tenant.")}async*listProjects({projectIds:$,name:q,nameContains:K,referenceDatasetId:P,referenceDatasetName:_,includeStats:O,datasetVersion:j,referenceFree:z,metadata:J}={}){let w=new URLSearchParams;if($!==void 0)for(let k of $)w.append("id",k);if(q!==void 0)w.append("name",q);if(K!==void 0)w.append("name_contains",K);if(P!==void 0)w.append("reference_dataset",P);else if(_!==void 0){let k=await this.readDataset({datasetName:_});w.append("reference_dataset",k.id)}if(O!==void 0)w.append("include_stats",O.toString());if(j!==void 0)w.append("dataset_version",j);if(z!==void 0)w.append("reference_free",z.toString());if(J!==void 0)w.append("metadata",JSON.stringify(J));for await(let k of this._getPaginated("/sessions",w))yield*k}async deleteProject({projectId:$,projectName:q}){let K;if($===void 0&&q===void 0)throw Error("Must provide projectName or projectId");else if($!==void 0&&q!==void 0)throw Error("Must provide either projectName or projectId, not both");else if($===void 0)K=(await this.readProject({projectName:q})).id;else K=$;_6(K),await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/sessions/${K}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(P,`delete session ${K} (${q})`,!0),P})}async uploadCsv({csvFile:$,fileName:q,inputKeys:K,outputKeys:P,description:_,dataType:O,name:j}){let z=`${this.apiUrl}/datasets/upload`,J=new FormData;if(J.append("file",$,q),K.forEach((X)=>{J.append("input_keys",X)}),P.forEach((X)=>{J.append("output_keys",X)}),_)J.append("description",_);if(O)J.append("data_type",O);if(j)J.append("name",j);return await(await this.caller.call(async()=>{let X=await this._fetch(z,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:J});return await a$(X,"upload CSV"),X})).json()}async createDataset($,{description:q,dataType:K,inputsSchema:P,outputsSchema:_,metadata:O}={}){let j={name:$,description:q,extra:O?{metadata:O}:void 0};if(K)j.data_type=K;if(P)j.inputs_schema_definition=P;if(_)j.outputs_schema_definition=_;let z=JSON.stringify(j);return await(await this.caller.call(async()=>{let k=await this._fetch(`${this.apiUrl}/datasets`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:z});return await a$(k,"create dataset"),k})).json()}async readDataset({datasetId:$,datasetName:q}){let K="/datasets",P=new URLSearchParams({limit:"1"});if($&&q)throw Error("Must provide either datasetName or datasetId, not both");else if($)_6($),K+=`/${$}`;else if(q)P.append("name",q);else throw Error("Must provide datasetName or datasetId");let _=await this._get(K,P),O;if(Array.isArray(_)){if(_.length===0)throw Error(`Dataset[id=${$}, name=${q}] not found`);O=_[0]}else O=_;return O}async hasDataset({datasetId:$,datasetName:q}){try{return await this.readDataset({datasetId:$,datasetName:q}),!0}catch(K){if(K instanceof Error&&K.message.toLocaleLowerCase().includes("not found"))return!1;throw K}}async diffDatasetVersions({datasetId:$,datasetName:q,fromVersion:K,toVersion:P}){let _=$;if(_===void 0&&q===void 0)throw Error("Must provide either datasetName or datasetId");else if(_!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(_===void 0)_=(await this.readDataset({datasetName:q})).id;let O=new URLSearchParams({from_version:typeof K==="string"?K:K.toISOString(),to_version:typeof P==="string"?P:P.toISOString()});return await this._get(`/datasets/${_}/versions/diff`,O)}async readDatasetOpenaiFinetuning({datasetId:$,datasetName:q}){if($!==void 0);else if(q!==void 0)$=(await this.readDataset({datasetName:q})).id;else throw Error("Must provide either datasetName or datasetId");return(await(await this._getResponse(`/datasets/${$}/openai_ft`)).text()).trim().split(`
75
- `).map((j)=>JSON.parse(j))}async*listDatasets({limit:$=100,offset:q=0,datasetIds:K,datasetName:P,datasetNameContains:_,metadata:O}={}){let z=new URLSearchParams({limit:$.toString(),offset:q.toString()});if(K!==void 0)for(let J of K)z.append("id",J);if(P!==void 0)z.append("name",P);if(_!==void 0)z.append("name_contains",_);if(O!==void 0)z.append("metadata",JSON.stringify(O));for await(let J of this._getPaginated("/datasets",z))yield*J}async updateDataset($){let{datasetId:q,datasetName:K,...P}=$;if(!q&&!K)throw Error("Must provide either datasetName or datasetId");let _=q??(await this.readDataset({datasetName:K})).id;_6(_);let O=JSON.stringify(P);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${_}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"update dataset"),z})).json()}async updateDatasetTag($){let{datasetId:q,datasetName:K,asOf:P,tag:_}=$;if(!q&&!K)throw Error("Must provide either datasetName or datasetId");let O=q??(await this.readDataset({datasetName:K})).id;_6(O);let j=JSON.stringify({as_of:typeof P==="string"?P:P.toISOString(),tag:_});await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${O}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"update dataset tags",!0),z})}async deleteDataset({datasetId:$,datasetName:q}){let K="/datasets",P=$;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(q!==void 0)P=(await this.readDataset({datasetName:q})).id;if(P!==void 0)_6(P),K+=`/${P}`;else throw Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+K,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,`delete ${K}`,!0),_})}async indexDataset({datasetId:$,datasetName:q,tag:K}){let P=$;if(!P&&!q)throw Error("Must provide either datasetName or datasetId");else if(P&&q)throw Error("Must provide either datasetName or datasetId, not both");else if(!P)P=(await this.readDataset({datasetName:q})).id;_6(P);let O=JSON.stringify({tag:K});await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"index dataset"),z})).json()}async similarExamples($,q,K,{filter:P}={}){let _={limit:K,inputs:$};if(P!==void 0)_.filter=P;_6(q);let O=JSON.stringify(_);return(await(await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/datasets/${q}/search`,{headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,method:"POST",body:O});return await a$(J,"fetch similar examples"),J})).json()).examples}async createExample($,q,K){if(mZ($)){if(q!==void 0||K!==void 0)throw Error("Cannot provide outputs or options when using ExampleCreate object")}let P=q?K?.datasetId:$.dataset_id,_=q?K?.datasetName:$.dataset_name;if(P===void 0&&_===void 0)throw Error("Must provide either datasetName or datasetId");else if(P!==void 0&&_!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(P===void 0)P=(await this.readDataset({datasetName:_})).id;let O=(q?K?.createdAt:$.created_at)||new Date,j;if(!mZ($))j={inputs:$,outputs:q,created_at:O?.toISOString(),id:K?.exampleId,metadata:K?.metadata,split:K?.split,source_run_id:K?.sourceRunId,use_source_run_io:K?.useSourceRunIO,use_source_run_attachments:K?.useSourceRunAttachments,attachments:K?.attachments};else j=$;let z=await this._uploadExamplesMultipart(P,[j]);return await this.readExample(z.example_ids?.[0]??qK())}async createExamples($){if(Array.isArray($)){if($.length===0)return[];let I=$,D=I[0].dataset_id,g=I[0].dataset_name;if(D===void 0&&g===void 0)throw Error("Must provide either datasetName or datasetId");else if(D!==void 0&&g!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(D===void 0)D=(await this.readDataset({datasetName:g})).id;let u=await this._uploadExamplesMultipart(D,I);return await Promise.all(u.example_ids.map((p)=>this.readExample(p)))}let{inputs:q,outputs:K,metadata:P,splits:_,sourceRunIds:O,useSourceRunIOs:j,useSourceRunAttachments:z,attachments:J,exampleIds:w,datasetId:k,datasetName:X}=$;if(q===void 0)throw Error("Must provide inputs when using legacy parameters");let G=k,V=X;if(G===void 0&&V===void 0)throw Error("Must provide either datasetName or datasetId");else if(G!==void 0&&V!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(G===void 0)G=(await this.readDataset({datasetName:V})).id;let C=q.map((I,D)=>{return{dataset_id:G,inputs:I,outputs:K?.[D],metadata:P?.[D],split:_?.[D],id:w?.[D],attachments:J?.[D],source_run_id:O?.[D],use_source_run_io:j?.[D],use_source_run_attachments:z?.[D]}}),E=await this._uploadExamplesMultipart(G,C);return await Promise.all(E.example_ids.map((I)=>this.readExample(I)))}async createLLMExample($,q,K){return this.createExample({input:$},{output:q},K)}async createChatExample($,q,K){let P=$.map((O)=>{if(iO(O))return BO(O);return O}),_=iO(q)?BO(q):q;return this.createExample({input:P},{output:_},K)}async readExample($){_6($);let q=`/examples/${$}`,K=await this._get(q),{attachment_urls:P,..._}=K,O=_;if(P)O.attachments=Object.entries(P).reduce((j,[z,J])=>{return j[z.slice(11)]={presigned_url:J.presigned_url,mime_type:J.mime_type},j},{});return O}async*listExamples({datasetId:$,datasetName:q,exampleIds:K,asOf:P,splits:_,inlineS3Urls:O,metadata:j,limit:z,offset:J,filter:w,includeAttachments:k}={}){let X;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($!==void 0)X=$;else if(q!==void 0)X=(await this.readDataset({datasetName:q})).id;else throw Error("Must provide a datasetName or datasetId");let G=new URLSearchParams({dataset:X}),V=P?typeof P==="string"?P:P?.toISOString():void 0;if(V)G.append("as_of",V);let C=O??!0;if(G.append("inline_s3_urls",C.toString()),K!==void 0)for(let h of K)G.append("id",h);if(_!==void 0)for(let h of _)G.append("splits",h);if(j!==void 0){let h=JSON.stringify(j);G.append("metadata",h)}if(z!==void 0)G.append("limit",z.toString());if(J!==void 0)G.append("offset",J.toString());if(w!==void 0)G.append("filter",w);if(k===!0)["attachment_urls","outputs","metadata"].forEach((h)=>G.append("select",h));let E=0;for await(let h of this._getPaginated("/examples",G)){for(let I of h){let{attachment_urls:D,...g}=I,u=g;if(D)u.attachments=Object.entries(D).reduce((y,[p,m])=>{return y[p.slice(11)]={presigned_url:m.presigned_url,mime_type:m.mime_type||void 0},y},{});yield u,E++}if(z!==void 0&&E>=z)break}}async deleteExample($){_6($);let q=`/examples/${$}`;await this.caller.call(async()=>{let K=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,`delete ${q}`,!0),K})}async updateExample($,q){let K;if(q)K=$;else K=$.id;_6(K);let P;if(q)P={id:K,...q};else P=$;let _;if(P.dataset_id!==void 0)_=P.dataset_id;else _=(await this.readExample(K)).dataset_id;return this._updateExamplesMultipart(_,[P])}async updateExamples($){let q;if($[0].dataset_id===void 0)q=(await this.readExample($[0].id)).dataset_id;else q=$[0].dataset_id;return this._updateExamplesMultipart(q,$)}async readDatasetVersion({datasetId:$,datasetName:q,asOf:K,tag:P}){let _;if(!$)_=(await this.readDataset({datasetName:q})).id;else _=$;if(_6(_),K&&P||!K&&!P)throw Error("Exactly one of asOf and tag must be specified.");let O=new URLSearchParams;if(K!==void 0)O.append("as_of",typeof K==="string"?K:K.toISOString());if(P!==void 0)O.append("tag",P);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${_}/version?${O.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(z,"read dataset version"),z})).json()}async listDatasetSplits({datasetId:$,datasetName:q,asOf:K}){let P;if($===void 0&&q===void 0)throw Error("Must provide dataset name or ID");else if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($===void 0)P=(await this.readDataset({datasetName:q})).id;else P=$;_6(P);let _=new URLSearchParams,O=K?typeof K==="string"?K:K?.toISOString():void 0;if(O)_.append("as_of",O);return await this._get(`/datasets/${P}/splits`,_)}async updateDatasetSplits({datasetId:$,datasetName:q,splitName:K,exampleIds:P,remove:_=!1}){let O;if($===void 0&&q===void 0)throw Error("Must provide dataset name or ID");else if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($===void 0)O=(await this.readDataset({datasetName:q})).id;else O=$;_6(O);let j={split_name:K,examples:P.map((J)=>{return _6(J),J}),remove:_},z=JSON.stringify(j);await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/datasets/${O}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:z});return await a$(J,"update dataset splits",!0),J})}async evaluateRun($,q,{sourceInfo:K,loadChildRuns:P,referenceExample:_}={loadChildRuns:!1}){HP("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let O;if(typeof $==="string")O=await this.readRun($,{loadChildRuns:P});else if(typeof $==="object"&&"id"in $)O=$;else throw Error(`Invalid run type: ${typeof $}`);if(O.reference_example_id!==null&&O.reference_example_id!==void 0)_=await this.readExample(O.reference_example_id);let j=await q.evaluateRun(O,_),[z,J]=await this._logEvaluationFeedback(j,O,K);return J[0]}async createFeedback($,q,{score:K,value:P,correction:_,comment:O,sourceInfo:j,feedbackSourceType:z="api",sourceRunId:J,feedbackId:w,feedbackConfig:k,projectId:X,comparativeExperimentId:G}){if(!$&&!X)throw Error("One of runId or projectId must be provided");if($&&X)throw Error("Only one of runId or projectId can be provided");let V={type:z??"api",metadata:j??{}};if(J!==void 0&&V?.metadata!==void 0&&!V.metadata.__run)V.metadata.__run={run_id:J};if(V?.metadata!==void 0&&V.metadata.__run?.run_id!==void 0)_6(V.metadata.__run.run_id);let C={id:w??qK(),run_id:$,key:q,score:cZ(K),value:P,correction:_,comment:O,feedback_source:V,comparative_experiment_id:G,feedbackConfig:k,session_id:X},E=JSON.stringify(C),h=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let I=await this._fetch(h,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:E});return await a$(I,"create feedback",!0),I}),C}async updateFeedback($,{score:q,value:K,correction:P,comment:_}){let O={};if(q!==void 0&&q!==null)O.score=cZ(q);if(K!==void 0&&K!==null)O.value=K;if(P!==void 0&&P!==null)O.correction=P;if(_!==void 0&&_!==null)O.comment=_;_6($);let j=JSON.stringify(O);await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/feedback/${$}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"update feedback",!0),z})}async readFeedback($){_6($);let q=`/feedback/${$}`;return await this._get(q)}async deleteFeedback($){_6($);let q=`/feedback/${$}`;await this.caller.call(async()=>{let K=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,`delete ${q}`,!0),K})}async*listFeedback({runIds:$,feedbackKeys:q,feedbackSourceTypes:K}={}){let P=new URLSearchParams;if($)for(let _ of $)_6(_),P.append("run",_);if(q)for(let _ of q)P.append("key",_);if(K)for(let _ of K)P.append("source",_);for await(let _ of this._getPaginated("/feedback",P))yield*_}async createPresignedFeedbackToken($,q,{expiration:K,feedbackConfig:P}={}){let _={run_id:$,feedback_key:q,feedback_config:P};if(K){if(typeof K==="string")_.expires_at=K;else if(K?.hours||K?.minutes||K?.days)_.expires_in=K}else _.expires_in={hours:3};let O=JSON.stringify(_);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"create presigned feedback token"),z})).json()}async createComparativeExperiment({name:$,experimentIds:q,referenceDatasetId:K,createdAt:P,description:_,metadata:O,id:j}){if(q.length===0)throw Error("At least one experiment is required");if(!K)K=(await this.readProject({projectId:q[0]})).reference_dataset_id;if(!K==null)throw Error("A reference dataset is required");let z={id:j,name:$,experiment_ids:q,reference_dataset_id:K,description:_,created_at:(P??new Date)?.toISOString(),extra:{}};if(O)z.extra.metadata=O;let J=JSON.stringify(z);return(await this.caller.call(async()=>{let k=await this._fetch(`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:J});return await a$(k,"create comparative experiment"),k})).json()}async*listPresignedFeedbackTokens($){_6($);let q=new URLSearchParams({run_id:$});for await(let K of this._getPaginated("/feedback/tokens",q))yield*K}_selectEvalResults($){let q;if("results"in $)q=$.results;else if(Array.isArray($))q=$;else q=[$];return q}async _logEvaluationFeedback($,q,K){let P=this._selectEvalResults($),_=[];for(let O of P){let j=K||{};if(O.evaluatorInfo)j={...O.evaluatorInfo,...j};let z=null;if(O.targetRunId)z=O.targetRunId;else if(q)z=q.id;_.push(await this.createFeedback(z,O.key,{score:O.score,value:O.value,comment:O.comment,correction:O.correction,sourceInfo:j,sourceRunId:O.sourceRunId,feedbackConfig:O.feedbackConfig,feedbackSourceType:"model"}))}return[P,_]}async logEvaluationFeedback($,q,K){let[P]=await this._logEvaluationFeedback($,q,K);return P}async*listAnnotationQueues($={}){let{queueIds:q,name:K,nameContains:P,limit:_}=$,O=new URLSearchParams;if(q)q.forEach((z,J)=>{_6(z,`queueIds[${J}]`),O.append("ids",z)});if(K)O.append("name",K);if(P)O.append("name_contains",P);O.append("limit",(_!==void 0?Math.min(_,100):100).toString());let j=0;for await(let z of this._getPaginated("/annotation-queues",O))if(yield*z,j++,_!==void 0&&j>=_)break}async createAnnotationQueue($){let{name:q,description:K,queueId:P,rubricInstructions:_}=$,O={name:q,description:K,id:P||qK(),rubric_instructions:_},j=JSON.stringify(Object.fromEntries(Object.entries(O).filter(([J,w])=>w!==void 0)));return(await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(J,"create annotation queue"),J})).json()}async readAnnotationQueue($){return(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"read annotation queue"),K})).json()}async updateAnnotationQueue($,q){let{name:K,description:P,rubricInstructions:_}=q,O=JSON.stringify({name:K,description:P,rubric_instructions:_});await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(j,"update annotation queue",!0),j})}async deleteAnnotationQueue($){await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"delete annotation queue",!0),q})}async addRunsToAnnotationQueue($,q){let K=JSON.stringify(q.map((P,_)=>_6(P,`runIds[${_}]`).toString()));await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await a$(P,"add runs to annotation queue",!0),P})}async getRunFromAnnotationQueue($,q){let K=`/annotation-queues/${_6($,"queueId")}/run`;return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}${K}/${q}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,"get run from annotation queue"),_})).json()}async deleteRunFromAnnotationQueue($,q){await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/runs/${_6(q,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"delete run from annotation queue",!0),K})}async getSizeFromAnnotationQueue($){return(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"get size from annotation queue"),K})).json()}async _currentTenantIsOwner($){let q=await this._getSettings();return $=="-"||q.tenant_handle===$}async _ownerConflictError($,q){let K=await this._getSettings();return Error(`Cannot ${$} for another tenant.
75
+ `).map((j)=>JSON.parse(j))}async*listDatasets({limit:$=100,offset:q=0,datasetIds:K,datasetName:P,datasetNameContains:_,metadata:O}={}){let z=new URLSearchParams({limit:$.toString(),offset:q.toString()});if(K!==void 0)for(let J of K)z.append("id",J);if(P!==void 0)z.append("name",P);if(_!==void 0)z.append("name_contains",_);if(O!==void 0)z.append("metadata",JSON.stringify(O));for await(let J of this._getPaginated("/datasets",z))yield*J}async updateDataset($){let{datasetId:q,datasetName:K,...P}=$;if(!q&&!K)throw Error("Must provide either datasetName or datasetId");let _=q??(await this.readDataset({datasetName:K})).id;_6(_);let O=JSON.stringify(P);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${_}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"update dataset"),z})).json()}async updateDatasetTag($){let{datasetId:q,datasetName:K,asOf:P,tag:_}=$;if(!q&&!K)throw Error("Must provide either datasetName or datasetId");let O=q??(await this.readDataset({datasetName:K})).id;_6(O);let j=JSON.stringify({as_of:typeof P==="string"?P:P.toISOString(),tag:_});await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${O}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"update dataset tags",!0),z})}async deleteDataset({datasetId:$,datasetName:q}){let K="/datasets",P=$;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(q!==void 0)P=(await this.readDataset({datasetName:q})).id;if(P!==void 0)_6(P),K+=`/${P}`;else throw Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+K,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,`delete ${K}`,!0),_})}async indexDataset({datasetId:$,datasetName:q,tag:K}){let P=$;if(!P&&!q)throw Error("Must provide either datasetName or datasetId");else if(P&&q)throw Error("Must provide either datasetName or datasetId, not both");else if(!P)P=(await this.readDataset({datasetName:q})).id;_6(P);let O=JSON.stringify({tag:K});await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"index dataset"),z})).json()}async similarExamples($,q,K,{filter:P}={}){let _={limit:K,inputs:$};if(P!==void 0)_.filter=P;_6(q);let O=JSON.stringify(_);return(await(await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/datasets/${q}/search`,{headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,method:"POST",body:O});return await a$(J,"fetch similar examples"),J})).json()).examples}async createExample($,q,K){if(mZ($)){if(q!==void 0||K!==void 0)throw Error("Cannot provide outputs or options when using ExampleCreate object")}let P=q?K?.datasetId:$.dataset_id,_=q?K?.datasetName:$.dataset_name;if(P===void 0&&_===void 0)throw Error("Must provide either datasetName or datasetId");else if(P!==void 0&&_!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(P===void 0)P=(await this.readDataset({datasetName:_})).id;let O=(q?K?.createdAt:$.created_at)||new Date,j;if(!mZ($))j={inputs:$,outputs:q,created_at:O?.toISOString(),id:K?.exampleId,metadata:K?.metadata,split:K?.split,source_run_id:K?.sourceRunId,use_source_run_io:K?.useSourceRunIO,use_source_run_attachments:K?.useSourceRunAttachments,attachments:K?.attachments};else j=$;let z=await this._uploadExamplesMultipart(P,[j]);return await this.readExample(z.example_ids?.[0]??qK())}async createExamples($){if(Array.isArray($)){if($.length===0)return[];let I=$,D=I[0].dataset_id,g=I[0].dataset_name;if(D===void 0&&g===void 0)throw Error("Must provide either datasetName or datasetId");else if(D!==void 0&&g!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(D===void 0)D=(await this.readDataset({datasetName:g})).id;let u=await this._uploadExamplesMultipart(D,I);return await Promise.all(u.example_ids.map((p)=>this.readExample(p)))}let{inputs:q,outputs:K,metadata:P,splits:_,sourceRunIds:O,useSourceRunIOs:j,useSourceRunAttachments:z,attachments:J,exampleIds:w,datasetId:k,datasetName:X}=$;if(q===void 0)throw Error("Must provide inputs when using legacy parameters");let G=k,V=X;if(G===void 0&&V===void 0)throw Error("Must provide either datasetName or datasetId");else if(G!==void 0&&V!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(G===void 0)G=(await this.readDataset({datasetName:V})).id;let C=q.map((I,D)=>{return{dataset_id:G,inputs:I,outputs:K?.[D],metadata:P?.[D],split:_?.[D],id:w?.[D],attachments:J?.[D],source_run_id:O?.[D],use_source_run_io:j?.[D],use_source_run_attachments:z?.[D]}}),E=await this._uploadExamplesMultipart(G,C);return await Promise.all(E.example_ids.map((I)=>this.readExample(I)))}async createLLMExample($,q,K){return this.createExample({input:$},{output:q},K)}async createChatExample($,q,K){let P=$.map((O)=>{if(iO(O))return BO(O);return O}),_=iO(q)?BO(q):q;return this.createExample({input:P},{output:_},K)}async readExample($){_6($);let q=`/examples/${$}`,K=await this._get(q),{attachment_urls:P,..._}=K,O=_;if(P)O.attachments=Object.entries(P).reduce((j,[z,J])=>{return j[z.slice(11)]={presigned_url:J.presigned_url,mime_type:J.mime_type},j},{});return O}async*listExamples({datasetId:$,datasetName:q,exampleIds:K,asOf:P,splits:_,inlineS3Urls:O,metadata:j,limit:z,offset:J,filter:w,includeAttachments:k}={}){let X;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($!==void 0)X=$;else if(q!==void 0)X=(await this.readDataset({datasetName:q})).id;else throw Error("Must provide a datasetName or datasetId");let G=new URLSearchParams({dataset:X}),V=P?typeof P==="string"?P:P?.toISOString():void 0;if(V)G.append("as_of",V);let C=O??!0;if(G.append("inline_s3_urls",C.toString()),K!==void 0)for(let h of K)G.append("id",h);if(_!==void 0)for(let h of _)G.append("splits",h);if(j!==void 0){let h=JSON.stringify(j);G.append("metadata",h)}if(z!==void 0)G.append("limit",z.toString());if(J!==void 0)G.append("offset",J.toString());if(w!==void 0)G.append("filter",w);if(k===!0)["attachment_urls","outputs","metadata"].forEach((h)=>G.append("select",h));let E=0;for await(let h of this._getPaginated("/examples",G)){for(let I of h){let{attachment_urls:D,...g}=I,u=g;if(D)u.attachments=Object.entries(D).reduce((y,[p,l])=>{return y[p.slice(11)]={presigned_url:l.presigned_url,mime_type:l.mime_type||void 0},y},{});yield u,E++}if(z!==void 0&&E>=z)break}}async deleteExample($){_6($);let q=`/examples/${$}`;await this.caller.call(async()=>{let K=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,`delete ${q}`,!0),K})}async updateExample($,q){let K;if(q)K=$;else K=$.id;_6(K);let P;if(q)P={id:K,...q};else P=$;let _;if(P.dataset_id!==void 0)_=P.dataset_id;else _=(await this.readExample(K)).dataset_id;return this._updateExamplesMultipart(_,[P])}async updateExamples($){let q;if($[0].dataset_id===void 0)q=(await this.readExample($[0].id)).dataset_id;else q=$[0].dataset_id;return this._updateExamplesMultipart(q,$)}async readDatasetVersion({datasetId:$,datasetName:q,asOf:K,tag:P}){let _;if(!$)_=(await this.readDataset({datasetName:q})).id;else _=$;if(_6(_),K&&P||!K&&!P)throw Error("Exactly one of asOf and tag must be specified.");let O=new URLSearchParams;if(K!==void 0)O.append("as_of",typeof K==="string"?K:K.toISOString());if(P!==void 0)O.append("tag",P);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${_}/version?${O.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(z,"read dataset version"),z})).json()}async listDatasetSplits({datasetId:$,datasetName:q,asOf:K}){let P;if($===void 0&&q===void 0)throw Error("Must provide dataset name or ID");else if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($===void 0)P=(await this.readDataset({datasetName:q})).id;else P=$;_6(P);let _=new URLSearchParams,O=K?typeof K==="string"?K:K?.toISOString():void 0;if(O)_.append("as_of",O);return await this._get(`/datasets/${P}/splits`,_)}async updateDatasetSplits({datasetId:$,datasetName:q,splitName:K,exampleIds:P,remove:_=!1}){let O;if($===void 0&&q===void 0)throw Error("Must provide dataset name or ID");else if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($===void 0)O=(await this.readDataset({datasetName:q})).id;else O=$;_6(O);let j={split_name:K,examples:P.map((J)=>{return _6(J),J}),remove:_},z=JSON.stringify(j);await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/datasets/${O}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:z});return await a$(J,"update dataset splits",!0),J})}async evaluateRun($,q,{sourceInfo:K,loadChildRuns:P,referenceExample:_}={loadChildRuns:!1}){HP("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let O;if(typeof $==="string")O=await this.readRun($,{loadChildRuns:P});else if(typeof $==="object"&&"id"in $)O=$;else throw Error(`Invalid run type: ${typeof $}`);if(O.reference_example_id!==null&&O.reference_example_id!==void 0)_=await this.readExample(O.reference_example_id);let j=await q.evaluateRun(O,_),[z,J]=await this._logEvaluationFeedback(j,O,K);return J[0]}async createFeedback($,q,{score:K,value:P,correction:_,comment:O,sourceInfo:j,feedbackSourceType:z="api",sourceRunId:J,feedbackId:w,feedbackConfig:k,projectId:X,comparativeExperimentId:G}){if(!$&&!X)throw Error("One of runId or projectId must be provided");if($&&X)throw Error("Only one of runId or projectId can be provided");let V={type:z??"api",metadata:j??{}};if(J!==void 0&&V?.metadata!==void 0&&!V.metadata.__run)V.metadata.__run={run_id:J};if(V?.metadata!==void 0&&V.metadata.__run?.run_id!==void 0)_6(V.metadata.__run.run_id);let C={id:w??qK(),run_id:$,key:q,score:cZ(K),value:P,correction:_,comment:O,feedback_source:V,comparative_experiment_id:G,feedbackConfig:k,session_id:X},E=JSON.stringify(C),h=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let I=await this._fetch(h,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:E});return await a$(I,"create feedback",!0),I}),C}async updateFeedback($,{score:q,value:K,correction:P,comment:_}){let O={};if(q!==void 0&&q!==null)O.score=cZ(q);if(K!==void 0&&K!==null)O.value=K;if(P!==void 0&&P!==null)O.correction=P;if(_!==void 0&&_!==null)O.comment=_;_6($);let j=JSON.stringify(O);await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/feedback/${$}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(z,"update feedback",!0),z})}async readFeedback($){_6($);let q=`/feedback/${$}`;return await this._get(q)}async deleteFeedback($){_6($);let q=`/feedback/${$}`;await this.caller.call(async()=>{let K=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,`delete ${q}`,!0),K})}async*listFeedback({runIds:$,feedbackKeys:q,feedbackSourceTypes:K}={}){let P=new URLSearchParams;if($)for(let _ of $)_6(_),P.append("run",_);if(q)for(let _ of q)P.append("key",_);if(K)for(let _ of K)P.append("source",_);for await(let _ of this._getPaginated("/feedback",P))yield*_}async createPresignedFeedbackToken($,q,{expiration:K,feedbackConfig:P}={}){let _={run_id:$,feedback_key:q,feedback_config:P};if(K){if(typeof K==="string")_.expires_at=K;else if(K?.hours||K?.minutes||K?.days)_.expires_in=K}else _.expires_in={hours:3};let O=JSON.stringify(_);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(z,"create presigned feedback token"),z})).json()}async createComparativeExperiment({name:$,experimentIds:q,referenceDatasetId:K,createdAt:P,description:_,metadata:O,id:j}){if(q.length===0)throw Error("At least one experiment is required");if(!K)K=(await this.readProject({projectId:q[0]})).reference_dataset_id;if(!K==null)throw Error("A reference dataset is required");let z={id:j,name:$,experiment_ids:q,reference_dataset_id:K,description:_,created_at:(P??new Date)?.toISOString(),extra:{}};if(O)z.extra.metadata=O;let J=JSON.stringify(z);return(await this.caller.call(async()=>{let k=await this._fetch(`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:J});return await a$(k,"create comparative experiment"),k})).json()}async*listPresignedFeedbackTokens($){_6($);let q=new URLSearchParams({run_id:$});for await(let K of this._getPaginated("/feedback/tokens",q))yield*K}_selectEvalResults($){let q;if("results"in $)q=$.results;else if(Array.isArray($))q=$;else q=[$];return q}async _logEvaluationFeedback($,q,K){let P=this._selectEvalResults($),_=[];for(let O of P){let j=K||{};if(O.evaluatorInfo)j={...O.evaluatorInfo,...j};let z=null;if(O.targetRunId)z=O.targetRunId;else if(q)z=q.id;_.push(await this.createFeedback(z,O.key,{score:O.score,value:O.value,comment:O.comment,correction:O.correction,sourceInfo:j,sourceRunId:O.sourceRunId,feedbackConfig:O.feedbackConfig,feedbackSourceType:"model"}))}return[P,_]}async logEvaluationFeedback($,q,K){let[P]=await this._logEvaluationFeedback($,q,K);return P}async*listAnnotationQueues($={}){let{queueIds:q,name:K,nameContains:P,limit:_}=$,O=new URLSearchParams;if(q)q.forEach((z,J)=>{_6(z,`queueIds[${J}]`),O.append("ids",z)});if(K)O.append("name",K);if(P)O.append("name_contains",P);O.append("limit",(_!==void 0?Math.min(_,100):100).toString());let j=0;for await(let z of this._getPaginated("/annotation-queues",O))if(yield*z,j++,_!==void 0&&j>=_)break}async createAnnotationQueue($){let{name:q,description:K,queueId:P,rubricInstructions:_}=$,O={name:q,description:K,id:P||qK(),rubric_instructions:_},j=JSON.stringify(Object.fromEntries(Object.entries(O).filter(([J,w])=>w!==void 0)));return(await this.caller.call(async()=>{let J=await this._fetch(`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:j});return await a$(J,"create annotation queue"),J})).json()}async readAnnotationQueue($){return(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"read annotation queue"),K})).json()}async updateAnnotationQueue($,q){let{name:K,description:P,rubricInstructions:_}=q,O=JSON.stringify({name:K,description:P,rubric_instructions:_});await this.caller.call(async()=>{let j=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await a$(j,"update annotation queue",!0),j})}async deleteAnnotationQueue($){await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(q,"delete annotation queue",!0),q})}async addRunsToAnnotationQueue($,q){let K=JSON.stringify(q.map((P,_)=>_6(P,`runIds[${_}]`).toString()));await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await a$(P,"add runs to annotation queue",!0),P})}async getRunFromAnnotationQueue($,q){let K=`/annotation-queues/${_6($,"queueId")}/run`;return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}${K}/${q}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(_,"get run from annotation queue"),_})).json()}async deleteRunFromAnnotationQueue($,q){await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/runs/${_6(q,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"delete run from annotation queue",!0),K})}async getSizeFromAnnotationQueue($){return(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${_6($,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await a$(K,"get size from annotation queue"),K})).json()}async _currentTenantIsOwner($){let q=await this._getSettings();return $=="-"||q.tenant_handle===$}async _ownerConflictError($,q){let K=await this._getSettings();return Error(`Cannot ${$} for another tenant.
76
76
 
77
77
  Current tenant: ${K.tenant_handle}
78
78
 
@@ -92,7 +92,7 @@ graph TD;
92
92
  `;if(j){let C={["default"]:"{0}({1})"};if(P!==void 0)C[P]="{0}([{1}]):::first";if(_!==void 0)C[_]="{0}([{1}]):::last";for(let[E,h]of Object.entries($)){let I=h.name.split(":").pop()??"",g=kI.some((y)=>I.startsWith(y)&&I.endsWith(y))?`<p>${I}</p>`:I;if(Object.keys(h.metadata??{}).length)g+=`<hr/><small><em>${Object.entries(h.metadata??{}).map(([y,p])=>`${y} = ${p}`).join(`
93
93
  `)}</em></small>`;let u=(C[E]??C.default).replace("{0}",b2(E)).replace("{1}",g);w+=` ${u}
94
94
  `}}let k={};for(let V of q){let C=V.source.split(":"),E=V.target.split(":"),h=C.filter((I,D)=>I===E[D]).join(":");if(!k[h])k[h]=[];k[h].push(V)}let X=new Set;function G(V,C){let E=V.length===1&&V[0].source===V[0].target;if(C&&!E){let h=C.split(":").pop();if(X.has(h))throw Error(`Found duplicate subgraph '${h}' -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);X.add(h),w+=` subgraph ${h}
95
- `}for(let h of V){let{source:I,target:D,data:g,conditional:u}=h,y="";if(g!==void 0){let p=g,m=p.split(" ");if(m.length>J)p=Array.from({length:Math.ceil(m.length/J)},(s,U)=>m.slice(U*J,(U+1)*J).join(" ")).join("&nbsp;<br>&nbsp;");y=u?` -. &nbsp;${p}&nbsp; .-> `:` -- &nbsp;${p}&nbsp; --> `}else y=u?" -.-> ":" --> ";w+=` ${b2(I)}${y}${b2(D)};
95
+ `}for(let h of V){let{source:I,target:D,data:g,conditional:u}=h,y="";if(g!==void 0){let p=g,l=p.split(" ");if(l.length>J)p=Array.from({length:Math.ceil(l.length/J)},(Q,e)=>l.slice(e*J,(e+1)*J).join(" ")).join("&nbsp;<br>&nbsp;");y=u?` -. &nbsp;${p}&nbsp; .-> `:` -- &nbsp;${p}&nbsp; --> `}else y=u?" -.-> ":" --> ";w+=` ${b2(I)}${y}${b2(D)};
96
96
  `}for(let h in k)if(h.startsWith(`${C}:`)&&h!==C)G(k[h],h);if(C&&!E)w+=` end
97
97
  `}G(k[""]??[],"");for(let V in k)if(!V.includes(":")&&V!=="")G(k[V],V);if(j)w+=AI(O??{});return w}async function Lf($,q){return GI($,{...q,imageType:"png"})}async function GI($,q){let K=q?.backgroundColor??"white",P=q?.imageType??"png",_=btoa($);if(K!==void 0){if(!/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(K))K=`!${K}`}let O=`https://mermaid.ink/img/${_}?bgColor=${K}&type=${P}`,j=await fetch(O);if(!j.ok)throw Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${j.status}`,`Status text: ${j.statusText}`].join(`
98
98
  `));return await j.blob()}var AQ=Object.freeze({status:"aborted"});function P4($,q,K){function P(z,J){var w;Object.defineProperty(z,"_zod",{value:z._zod??{},enumerable:!1}),(w=z._zod).traits??(w.traits=new Set),z._zod.traits.add($),q(z,J);for(let k in j.prototype)if(!(k in z))Object.defineProperty(z,k,{value:j.prototype[k].bind(z)});z._zod.constr=j,z._zod.def=J}let _=K?.Parent??Object;class O extends _{}Object.defineProperty(O,"name",{value:$});function j(z){var J;let w=K?.Parent?new O:this;P(w,z),(J=w._zod).deferred??(J.deferred=[]);for(let k of w._zod.deferred)k();return w}return Object.defineProperty(j,"init",{value:P}),Object.defineProperty(j,Symbol.hasInstance,{value:(z)=>{if(K?.Parent&&z instanceof K.Parent)return!0;return z?._zod?.traits?.has($)}}),Object.defineProperty(j,"name",{value:$}),j}var GQ=Symbol("zod_brand");class W_ extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}var g2={};function CP($){if($)Object.assign(g2,$);return g2}function u2($){let q=Object.values($).filter((P)=>typeof P==="number");return Object.entries($).filter(([P,_])=>q.indexOf(+P)===-1).map(([P,_])=>_)}function gf($,q){if(typeof q==="bigint")return q.toString();return q}function uf($){return{get value(){{let K=$();return Object.defineProperty(this,"value",{value:K}),K}throw Error("cached value already set")}}}var yf=Error.captureStackTrace?Error.captureStackTrace:(...$)=>{};var VI=uf(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function j4($,q,K){let P=new $._zod.constr(q??$._zod.def);if(!q||K?.parent)P._zod.parent=$;return P}function xf($){let q=$;if(!q)return{};if(typeof q==="string")return{error:()=>q};if(q?.message!==void 0){if(q?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");q.error=q.message}if(delete q.message,typeof q.error==="string")return{...q,error:()=>q.error};return q}var VQ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function s1($,q=0){for(let K=q;K<$.issues.length;K++)if($.issues[K]?.continue!==!0)return!0;return!1}function e1($){return typeof $==="string"?$:$?.message}function EP($,q,K){let P={...$,path:$.path??[]};if(!$.message){let _=e1($.inst?._zod.def?.error?.($))??e1(q?.error?.($))??e1(K.customError?.($))??e1(K.localeError?.($))??"Invalid input";P.message=_}if(delete P.inst,delete P.continue,!q?.reportInput)delete P.input;return P}var cf=($,q)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:q,enumerable:!1}),Object.defineProperty($,"message",{get(){return JSON.stringify(q,gf,2)},enumerable:!0}),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},pf=P4("$ZodError",cf),$9=P4("$ZodError",cf,{Parent:Error});var MI=($)=>(q,K,P,_)=>{let O=P?Object.assign(P,{async:!1}):{async:!1},j=q._zod.run({value:K,issues:[]},O);if(j instanceof Promise)throw new W_;if(j.issues.length){let z=new(_?.Err??$)(j.issues.map((J)=>EP(J,O,CP())));throw yf(z,_?.callee),z}return j.value},mf=MI($9);var NI=($)=>(q,K,P)=>{let _=P?{...P,async:!1}:{async:!1},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)throw new W_;return O.issues.length?{success:!1,error:new($??pf)(O.issues.map((j)=>EP(j,_,CP())))}:{success:!0,data:O.value}},df=NI($9),CI=($)=>async(q,K,P)=>{let _=P?Object.assign(P,{async:!0}):{async:!0},O=q._zod.run({value:K,issues:[]},_);if(O instanceof Promise)O=await O;return O.issues.length?{success:!1,error:new $(O.issues.map((j)=>EP(j,_,CP())))}:{success:!0,data:O.value}},lf=CI($9);var rf={major:4,minor:0,patch:0};var EI=P4("$ZodType",($,q)=>{var K;$??($={}),$._zod.def=q,$._zod.bag=$._zod.bag||{},$._zod.version=rf;let P=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))P.unshift($);for(let _ of P)for(let O of _._zod.onattach)O($);if(P.length===0)(K=$._zod).deferred??(K.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let _=(O,j,z)=>{let J=s1(O),w;for(let k of j){if(k._zod.def.when){if(!k._zod.def.when(O))continue}else if(J)continue;let X=O.issues.length,G=k._zod.check(O);if(G instanceof Promise&&z?.async===!1)throw new W_;if(w||G instanceof Promise)w=(w??Promise.resolve()).then(async()=>{if(await G,O.issues.length===X)return;if(!J)J=s1(O,X)});else{if(O.issues.length===X)continue;if(!J)J=s1(O,X)}}if(w)return w.then(()=>{return O});return O};$._zod.run=(O,j)=>{let z=$._zod.parse(O,j);if(z instanceof Promise){if(j.async===!1)throw new W_;return z.then((J)=>_(J,P,j))}return _(z,P,j)}}$["~standard"]={validate:(_)=>{try{let O=df($,_);return O.success?{value:O.data}:{issues:O.error?.issues}}catch(O){return lf($,_).then((j)=>j.success?{value:j.data}:{issues:j.error?.issues})}},vendor:"zod",version:1}});var of=P4("$ZodNever",($,q)=>{EI.init($,q),$._zod.parse=(K,P)=>{return K.issues.push({expected:"never",code:"invalid_type",input:K.value,inst:$}),K}});var dQ=Symbol("ZodOutput"),lQ=Symbol("ZodInput");class q9{constructor(){this._map=new Map,this._idmap=new Map}add($,...q){let K=q[0];if(this._map.set($,K),K&&typeof K==="object"&&"id"in K){if(this._idmap.has(K.id))throw Error(`ID ${K.id} already exists in the registry`);this._idmap.set(K.id,$)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove($){let q=this._map.get($);if(q&&typeof q==="object"&&"id"in q)this._idmap.delete(q.id);return this._map.delete($),this}get($){let q=$._zod.parent;if(q){let K={...this.get(q)??{}};return delete K.id,{...K,...this._map.get($)}}return this._map.get($)}has($){return this._map.has($)}}function hI(){return new q9}var m8=hI();function nf($,q){return new $({type:"never",...xf(q)})}class y2{constructor($){this.counter=0,this.metadataRegistry=$?.metadata??m8,this.target=$?.target??"draft-2020-12",this.unrepresentable=$?.unrepresentable??"throw",this.override=$?.override??(()=>{}),this.io=$?.io??"output",this.seen=new Map}process($,q={path:[],schemaPath:[]}){var K;let P=$._zod.def,_={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},O=this.seen.get($);if(O){if(O.count++,q.schemaPath.includes($))O.cycle=q.path;return O.schema}let j={schema:{},count:1,cycle:void 0,path:q.path};this.seen.set($,j);let z=$._zod.toJSONSchema?.();if(z)j.schema=z;else{let k={...q,schemaPath:[...q.schemaPath,$],path:q.path},X=$._zod.parent;if(X)j.ref=X,this.process(X,k),this.seen.get(X).isParent=!0;else{let G=j.schema;switch(P.type){case"string":{let V=G;V.type="string";let{minimum:C,maximum:E,format:h,patterns:I,contentEncoding:D}=$._zod.bag;if(typeof C==="number")V.minLength=C;if(typeof E==="number")V.maxLength=E;if(h){if(V.format=_[h]??h,V.format==="")delete V.format}if(D)V.contentEncoding=D;if(I&&I.size>0){let g=[...I];if(g.length===1)V.pattern=g[0].source;else if(g.length>1)j.schema.allOf=[...g.map((u)=>({...this.target==="draft-7"?{type:"string"}:{},pattern:u.source}))]}break}case"number":{let V=G,{minimum:C,maximum:E,format:h,multipleOf:I,exclusiveMaximum:D,exclusiveMinimum:g}=$._zod.bag;if(typeof h==="string"&&h.includes("int"))V.type="integer";else V.type="number";if(typeof g==="number")V.exclusiveMinimum=g;if(typeof C==="number"){if(V.minimum=C,typeof g==="number")if(g>=C)delete V.minimum;else delete V.exclusiveMinimum}if(typeof D==="number")V.exclusiveMaximum=D;if(typeof E==="number"){if(V.maximum=E,typeof D==="number")if(D<=E)delete V.maximum;else delete V.exclusiveMaximum}if(typeof I==="number")V.multipleOf=I;break}case"boolean":{let V=G;V.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema");break}case"null":{G.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema");break}case"never":{G.not={};break}case"date":{if(this.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema");break}case"array":{let V=G,{minimum:C,maximum:E}=$._zod.bag;if(typeof C==="number")V.minItems=C;if(typeof E==="number")V.maxItems=E;V.type="array",V.items=this.process(P.element,{...k,path:[...k.path,"items"]});break}case"object":{let V=G;V.type="object",V.properties={};let C=P.shape;for(let I in C)V.properties[I]=this.process(C[I],{...k,path:[...k.path,"properties",I]});let E=new Set(Object.keys(C)),h=new Set([...E].filter((I)=>{let D=P.shape[I]._zod;if(this.io==="input")return D.optin===void 0;else return D.optout===void 0}));if(h.size>0)V.required=Array.from(h);if(P.catchall?._zod.def.type==="never")V.additionalProperties=!1;else if(!P.catchall){if(this.io==="output")V.additionalProperties=!1}else if(P.catchall)V.additionalProperties=this.process(P.catchall,{...k,path:[...k.path,"additionalProperties"]});break}case"union":{let V=G;V.anyOf=P.options.map((C,E)=>this.process(C,{...k,path:[...k.path,"anyOf",E]}));break}case"intersection":{let V=G,C=this.process(P.left,{...k,path:[...k.path,"allOf",0]}),E=this.process(P.right,{...k,path:[...k.path,"allOf",1]}),h=(D)=>("allOf"in D)&&Object.keys(D).length===1,I=[...h(C)?C.allOf:[C],...h(E)?E.allOf:[E]];V.allOf=I;break}case"tuple":{let V=G;V.type="array";let C=P.items.map((I,D)=>this.process(I,{...k,path:[...k.path,"prefixItems",D]}));if(this.target==="draft-2020-12")V.prefixItems=C;else V.items=C;if(P.rest){let I=this.process(P.rest,{...k,path:[...k.path,"items"]});if(this.target==="draft-2020-12")V.items=I;else V.additionalItems=I}if(P.rest)V.items=this.process(P.rest,{...k,path:[...k.path,"items"]});let{minimum:E,maximum:h}=$._zod.bag;if(typeof E==="number")V.minItems=E;if(typeof h==="number")V.maxItems=h;break}case"record":{let V=G;V.type="object",V.propertyNames=this.process(P.keyType,{...k,path:[...k.path,"propertyNames"]}),V.additionalProperties=this.process(P.valueType,{...k,path:[...k.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema");break}case"enum":{let V=G,C=u2(P.entries);if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";V.enum=C;break}case"literal":{let V=G,C=[];for(let E of P.values)if(E===void 0){if(this.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof E==="bigint")if(this.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else C.push(Number(E));else C.push(E);if(C.length===0);else if(C.length===1){let E=C[0];V.type=E===null?"null":typeof E,V.const=E}else{if(C.every((E)=>typeof E==="number"))V.type="number";if(C.every((E)=>typeof E==="string"))V.type="string";if(C.every((E)=>typeof E==="boolean"))V.type="string";if(C.every((E)=>E===null))V.type="null";V.enum=C}break}case"file":{let V=G,C={type:"string",format:"binary",contentEncoding:"binary"},{minimum:E,maximum:h,mime:I}=$._zod.bag;if(E!==void 0)C.minLength=E;if(h!==void 0)C.maxLength=h;if(I)if(I.length===1)C.contentMediaType=I[0],Object.assign(V,C);else V.anyOf=I.map((D)=>{return{...C,contentMediaType:D}});else Object.assign(V,C);break}case"transform":{if(this.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let V=this.process(P.innerType,k);G.anyOf=[V,{type:"null"}];break}case"nonoptional":{this.process(P.innerType,k),j.ref=P.innerType;break}case"success":{let V=G;V.type="boolean";break}case"default":{this.process(P.innerType,k),j.ref=P.innerType,G.default=JSON.parse(JSON.stringify(P.defaultValue));break}case"prefault":{if(this.process(P.innerType,k),j.ref=P.innerType,this.io==="input")G._prefault=JSON.parse(JSON.stringify(P.defaultValue));break}case"catch":{this.process(P.innerType,k),j.ref=P.innerType;let V;try{V=P.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}G.default=V;break}case"nan":{if(this.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let V=G,C=$._zod.pattern;if(!C)throw Error("Pattern not found in template literal");V.type="string",V.pattern=C.source;break}case"pipe":{let V=this.io==="input"?P.in._zod.def.type==="transform"?P.out:P.in:P.out;this.process(V,k),j.ref=V;break}case"readonly":{this.process(P.innerType,k),j.ref=P.innerType,G.readOnly=!0;break}case"promise":{this.process(P.innerType,k),j.ref=P.innerType;break}case"optional":{this.process(P.innerType,k),j.ref=P.innerType;break}case"lazy":{let V=$._zod.innerType;this.process(V,k),j.ref=V;break}case"custom":{if(this.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema");break}default:}}}let J=this.metadataRegistry.get($);if(J)Object.assign(j.schema,J);if(this.io==="input"&&Kq($))delete j.schema.examples,delete j.schema.default;if(this.io==="input"&&j.schema._prefault)(K=j.schema).default??(K.default=j.schema._prefault);return delete j.schema._prefault,this.seen.get($).schema}emit($,q){let K={cycles:q?.cycles??"ref",reused:q?.reused??"inline",external:q?.external??void 0},P=this.seen.get($);if(!P)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(w)=>{let k=this.target==="draft-2020-12"?"$defs":"definitions";if(K.external){let C=K.external.registry.get(w[0])?.id,E=K.external.uri??((I)=>I);if(C)return{ref:E(C)};let h=w[1].defId??w[1].schema.id??`schema${this.counter++}`;return w[1].defId=h,{defId:h,ref:`${E("__shared")}#/${k}/${h}`}}if(w[1]===P)return{ref:"#"};let G=`${"#"}/${k}/`,V=w[1].schema.id??`__schema${this.counter++}`;return{defId:V,ref:G+V}},O=(w)=>{if(w[1].schema.$ref)return;let k=w[1],{ref:X,defId:G}=_(w);if(k.def={...k.schema},G)k.defId=G;let V=k.schema;for(let C in V)delete V[C];V.$ref=X};if(K.cycles==="throw")for(let w of this.seen.entries()){let k=w[1];if(k.cycle)throw Error(`Cycle detected: #/${k.cycle?.join("/")}/<root>
@@ -331,7 +331,7 @@ assembly `,`
331
331
  `," ",""];else throw Error(`Language ${$} is not supported.`)}}var tH=Dq(JV(),1);var TV=($)=>{$=1831565813+($|=0)|0;let q=Math.imul($^$>>>15,1|$);return q=q+Math.imul(q^q>>>7,61|q)^q,((q^q>>>14)>>>0)/4294967296};class ZV{constructor($){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;let{length:q,separator:K,dictionaries:P,style:_,seed:O}=$;this.dictionaries=P,this.separator=K,this.length=q,this.style=_,this.seed=O}generate(){if(!this.dictionaries)throw Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw Error("Invalid length provided");if(this.length>this.dictionaries.length)throw Error(`The length cannot be bigger than the number of dictionaries.
332
332
  Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let $=this.seed;return this.dictionaries.slice(0,this.length).reduce((q,K)=>{let P;$?(P=((O)=>{if(typeof O=="string"){let j=O.split("").map((J)=>J.charCodeAt(0)).reduce((J,w)=>J+w,1),z=Math.floor(Number(j));return TV(z)}return TV(O)})($),$=4294967296*P):P=Math.random();let _=K[Math.floor(P*K.length)]||"";if(this.style==="lowerCase")_=_.toLowerCase();else if(this.style==="capital"){let[O,...j]=_.split("");_=O.toUpperCase()+j.join("")}else this.style==="upperCase"&&(_=_.toUpperCase());return q?`${q}${this.separator}${_}`:`${_}`},"")}}var wV={separator:"_",dictionaries:[]},Dj=($)=>{let q=[...$&&$.dictionaries||wV.dictionaries],K={...wV,...$,length:$&&$.length||q.length,dictionaries:q};if(!$||!$.dictionaries||!$.dictionaries.length)throw Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new ZV(K).generate()};var Lj=["Aaren","Aarika","Abagael","Abagail","Abbe","Abbey","Abbi","Abbie","Abby","Abbye","Abigael","Abigail","Abigale","Abra","Ada","Adah","Adaline","Adan","Adara","Adda","Addi","Addia","Addie","Addy","Adel","Adela","Adelaida","Adelaide","Adele","Adelheid","Adelice","Adelina","Adelind","Adeline","Adella","Adelle","Adena","Adey","Adi","Adiana","Adina","Adora","Adore","Adoree","Adorne","Adrea","Adria","Adriaens","Adrian","Adriana","Adriane","Adrianna","Adrianne","Adriena","Adrienne","Aeriel","Aeriela","Aeriell","Afton","Ag","Agace","Agata","Agatha","Agathe","Aggi","Aggie","Aggy","Agna","Agnella","Agnes","Agnese","Agnesse","Agneta","Agnola","Agretha","Aida","Aidan","Aigneis","Aila","Aile","Ailee","Aileen","Ailene","Ailey","Aili","Ailina","Ailis","Ailsun","Ailyn","Aime","Aimee","Aimil","Aindrea","Ainslee","Ainsley","Ainslie","Ajay","Alaine","Alameda","Alana","Alanah","Alane","Alanna","Alayne","Alberta","Albertina","Albertine","Albina","Alecia","Aleda","Aleece","Aleen","Alejandra","Alejandrina","Alena","Alene","Alessandra","Aleta","Alethea","Alex","Alexa","Alexandra","Alexandrina","Alexi","Alexia","Alexina","Alexine","Alexis","Alfi","Alfie","Alfreda","Alfy","Ali","Alia","Alica","Alice","Alicea","Alicia","Alida","Alidia","Alie","Alika","Alikee","Alina","Aline","Alis","Alisa","Alisha","Alison","Alissa","Alisun","Alix","Aliza","Alla","Alleen","Allegra","Allene","Alli","Allianora","Allie","Allina","Allis","Allison","Allissa","Allix","Allsun","Allx","Ally","Allyce","Allyn","Allys","Allyson","Alma","Almeda","Almeria","Almeta","Almira","Almire","Aloise","Aloisia","Aloysia","Alta","Althea","Alvera","Alverta","Alvina","Alvinia","Alvira","Alyce","Alyda","Alys","Alysa","Alyse","Alysia","Alyson","Alyss","Alyssa","Amabel","Amabelle","Amalea","Amalee","Amaleta","Amalia","Amalie","Amalita","Amalle","Amanda","Amandi","Amandie","Amandy","Amara","Amargo","Amata","Amber","Amberly","Ambur","Ame","Amelia","Amelie","Amelina","Ameline","Amelita","Ami","Amie","Amii","Amil","Amitie","Amity","Ammamaria","Amy","Amye","Ana","Anabal","Anabel","Anabella","Anabelle","Analiese","Analise","Anallese","Anallise","Anastasia","Anastasie","Anastassia","Anatola","Andee","Andeee","Anderea","Andi","Andie","Andra","Andrea","Andreana","Andree","Andrei","Andria","Andriana","Andriette","Andromache","Andy","Anestassia","Anet","Anett","Anetta","Anette","Ange","Angel","Angela","Angele","Angelia","Angelica","Angelika","Angelina","Angeline","Angelique","Angelita","Angelle","Angie","Angil","Angy","Ania","Anica","Anissa","Anita","Anitra","Anjanette","Anjela","Ann","Ann-marie","Anna","Anna-diana","Anna-diane","Anna-maria","Annabal","Annabel","Annabela","Annabell","Annabella","Annabelle","Annadiana","Annadiane","Annalee","Annaliese","Annalise","Annamaria","Annamarie","Anne","Anne-corinne","Anne-marie","Annecorinne","Anneliese","Annelise","Annemarie","Annetta","Annette","Anni","Annice","Annie","Annis","Annissa","Annmaria","Annmarie","Annnora","Annora","Anny","Anselma","Ansley","Anstice","Anthe","Anthea","Anthia","Anthiathia","Antoinette","Antonella","Antonetta","Antonia","Antonie","Antonietta","Antonina","Anya","Appolonia","April","Aprilette","Ara","Arabel","Arabela","Arabele","Arabella","Arabelle","Arda","Ardath","Ardeen","Ardelia","Ardelis","Ardella","Ardelle","Arden","Ardene","Ardenia","Ardine","Ardis","Ardisj","Ardith","Ardra","Ardyce","Ardys","Ardyth","Aretha","Ariadne","Ariana","Aridatha","Ariel","Ariela","Ariella","Arielle","Arlana","Arlee","Arleen","Arlen","Arlena","Arlene","Arleta","Arlette","Arleyne","Arlie","Arliene","Arlina","Arlinda","Arline","Arluene","Arly","Arlyn","Arlyne","Aryn","Ashely","Ashia","Ashien","Ashil","Ashla","Ashlan","Ashlee","Ashleigh","Ashlen","Ashley","Ashli","Ashlie","Ashly","Asia","Astra","Astrid","Astrix","Atalanta","Athena","Athene","Atlanta","Atlante","Auberta","Aubine","Aubree","Aubrette","Aubrey","Aubrie","Aubry","Audi","Audie","Audra","Audre","Audrey","Audrie","Audry","Audrye","Audy","Augusta","Auguste","Augustina","Augustine","Aundrea","Aura","Aurea","Aurel","Aurelea","Aurelia","Aurelie","Auria","Aurie","Aurilia","Aurlie","Auroora","Aurora","Aurore","Austin","Austina","Austine","Ava","Aveline","Averil","Averyl","Avie","Avis","Aviva","Avivah","Avril","Avrit","Ayn","Bab","Babara","Babb","Babbette","Babbie","Babette","Babita","Babs","Bambi","Bambie","Bamby","Barb","Barbabra","Barbara","Barbara-anne","Barbaraanne","Barbe","Barbee","Barbette","Barbey","Barbi","Barbie","Barbra","Barby","Bari","Barrie","Barry","Basia","Bathsheba","Batsheva","Bea","Beatrice","Beatrisa","Beatrix","Beatriz","Bebe","Becca","Becka","Becki","Beckie","Becky","Bee","Beilul","Beitris","Bekki","Bel","Belia","Belicia","Belinda","Belita","Bell","Bella","Bellanca","Belle","Bellina","Belva","Belvia","Bendite","Benedetta","Benedicta","Benedikta","Benetta","Benita","Benni","Bennie","Benny","Benoite","Berenice","Beret","Berget","Berna","Bernadene","Bernadette","Bernadina","Bernadine","Bernardina","Bernardine","Bernelle","Bernete","Bernetta","Bernette","Berni","Bernice","Bernie","Bernita","Berny","Berri","Berrie","Berry","Bert","Berta","Berte","Bertha","Berthe","Berti","Bertie","Bertina","Bertine","Berty","Beryl","Beryle","Bess","Bessie","Bessy","Beth","Bethanne","Bethany","Bethena","Bethina","Betsey","Betsy","Betta","Bette","Bette-ann","Betteann","Betteanne","Betti","Bettina","Bettine","Betty","Bettye","Beulah","Bev","Beverie","Beverlee","Beverley","Beverlie","Beverly","Bevvy","Bianca","Bianka","Bibbie","Bibby","Bibbye","Bibi","Biddie","Biddy","Bidget","Bili","Bill","Billi","Billie","Billy","Billye","Binni","Binnie","Binny","Bird","Birdie","Birgit","Birgitta","Blair","Blaire","Blake","Blakelee","Blakeley","Blanca","Blanch","Blancha","Blanche","Blinni","Blinnie","Blinny","Bliss","Blisse","Blithe","Blondell","Blondelle","Blondie","Blondy","Blythe","Bobbe","Bobbee","Bobbette","Bobbi","Bobbie","Bobby","Bobbye","Bobette","Bobina","Bobine","Bobinette","Bonita","Bonnee","Bonni","Bonnibelle","Bonnie","Bonny","Brana","Brandais","Brande","Brandea","Brandi","Brandice","Brandie","Brandise","Brandy","Breanne","Brear","Bree","Breena","Bren","Brena","Brenda","Brenn","Brenna","Brett","Bria","Briana","Brianna","Brianne","Bride","Bridget","Bridgette","Bridie","Brier","Brietta","Brigid","Brigida","Brigit","Brigitta","Brigitte","Brina","Briney","Brinn","Brinna","Briny","Brit","Brita","Britney","Britni","Britt","Britta","Brittan","Brittaney","Brittani","Brittany","Britte","Britteny","Brittne","Brittney","Brittni","Brook","Brooke","Brooks","Brunhilda","Brunhilde","Bryana","Bryn","Bryna","Brynn","Brynna","Brynne","Buffy","Bunni","Bunnie","Bunny","Cacilia","Cacilie","Cahra","Cairistiona","Caitlin","Caitrin","Cal","Calida","Calla","Calley","Calli","Callida","Callie","Cally","Calypso","Cam","Camala","Camel","Camella","Camellia","Cami","Camila","Camile","Camilla","Camille","Cammi","Cammie","Cammy","Candace","Candi","Candice","Candida","Candide","Candie","Candis","Candra","Candy","Caprice","Cara","Caralie","Caren","Carena","Caresa","Caressa","Caresse","Carey","Cari","Caria","Carie","Caril","Carilyn","Carin","Carina","Carine","Cariotta","Carissa","Carita","Caritta","Carla","Carlee","Carleen","Carlen","Carlene","Carley","Carlie","Carlin","Carlina","Carline","Carlita","Carlota","Carlotta","Carly","Carlye","Carlyn","Carlynn","Carlynne","Carma","Carmel","Carmela","Carmelia","Carmelina","Carmelita","Carmella","Carmelle","Carmen","Carmencita","Carmina","Carmine","Carmita","Carmon","Caro","Carol","Carol-jean","Carola","Carolan","Carolann","Carole","Carolee","Carolin","Carolina","Caroline","Caroljean","Carolyn","Carolyne","Carolynn","Caron","Carree","Carri","Carrie","Carrissa","Carroll","Carry","Cary","Caryl","Caryn","Casandra","Casey","Casi","Casie","Cass","Cassandra","Cassandre","Cassandry","Cassaundra","Cassey","Cassi","Cassie","Cassondra","Cassy","Catarina","Cate","Caterina","Catha","Catharina","Catharine","Cathe","Cathee","Catherin","Catherina","Catherine","Cathi","Cathie","Cathleen","Cathlene","Cathrin","Cathrine","Cathryn","Cathy","Cathyleen","Cati","Catie","Catina","Catlaina","Catlee","Catlin","Catrina","Catriona","Caty","Caye","Cayla","Cecelia","Cecil","Cecile","Ceciley","Cecilia","Cecilla","Cecily","Ceil","Cele","Celene","Celesta","Celeste","Celestia","Celestina","Celestine","Celestyn","Celestyna","Celia","Celie","Celina","Celinda","Celine","Celinka","Celisse","Celka","Celle","Cesya","Chad","Chanda","Chandal","Chandra","Channa","Chantal","Chantalle","Charil","Charin","Charis","Charissa","Charisse","Charita","Charity","Charla","Charlean","Charleen","Charlena","Charlene","Charline","Charlot","Charlotta","Charlotte","Charmain","Charmaine","Charmane","Charmian","Charmine","Charmion","Charo","Charyl","Chastity","Chelsae","Chelsea","Chelsey","Chelsie","Chelsy","Cher","Chere","Cherey","Cheri","Cherianne","Cherice","Cherida","Cherie","Cherilyn","Cherilynn","Cherin","Cherise","Cherish","Cherlyn","Cherri","Cherrita","Cherry","Chery","Cherye","Cheryl","Cheslie","Chiarra","Chickie","Chicky","Chiquia","Chiquita","Chlo","Chloe","Chloette","Chloris","Chris","Chrissie","Chrissy","Christa","Christabel","Christabella","Christal","Christalle","Christan","Christean","Christel","Christen","Christi","Christian","Christiana","Christiane","Christie","Christin","Christina","Christine","Christy","Christye","Christyna","Chrysa","Chrysler","Chrystal","Chryste","Chrystel","Cicely","Cicily","Ciel","Cilka","Cinda","Cindee","Cindelyn","Cinderella","Cindi","Cindie","Cindra","Cindy","Cinnamon","Cissiee","Cissy","Clair","Claire","Clara","Clarabelle","Clare","Claresta","Clareta","Claretta","Clarette","Clarey","Clari","Claribel","Clarice","Clarie","Clarinda","Clarine","Clarissa","Clarisse","Clarita","Clary","Claude","Claudelle","Claudetta","Claudette","Claudia","Claudie","Claudina","Claudine","Clea","Clem","Clemence","Clementia","Clementina","Clementine","Clemmie","Clemmy","Cleo","Cleopatra","Clerissa","Clio","Clo","Cloe","Cloris","Clotilda","Clovis","Codee","Codi","Codie","Cody","Coleen","Colene","Coletta","Colette","Colleen","Collen","Collete","Collette","Collie","Colline","Colly","Con","Concettina","Conchita","Concordia","Conni","Connie","Conny","Consolata","Constance","Constancia","Constancy","Constanta","Constantia","Constantina","Constantine","Consuela","Consuelo","Cookie","Cora","Corabel","Corabella","Corabelle","Coral","Coralie","Coraline","Coralyn","Cordelia","Cordelie","Cordey","Cordi","Cordie","Cordula","Cordy","Coreen","Corella","Corenda","Corene","Coretta","Corette","Corey","Cori","Corie","Corilla","Corina","Corine","Corinna","Corinne","Coriss","Corissa","Corliss","Corly","Cornela","Cornelia","Cornelle","Cornie","Corny","Correna","Correy","Corri","Corrianne","Corrie","Corrina","Corrine","Corrinne","Corry","Cortney","Cory","Cosetta","Cosette","Costanza","Courtenay","Courtnay","Courtney","Crin","Cris","Crissie","Crissy","Crista","Cristabel","Cristal","Cristen","Cristi","Cristie","Cristin","Cristina","Cristine","Cristionna","Cristy","Crysta","Crystal","Crystie","Cthrine","Cyb","Cybil","Cybill","Cymbre","Cynde","Cyndi","Cyndia","Cyndie","Cyndy","Cynthea","Cynthia","Cynthie","Cynthy","Dacey","Dacia","Dacie","Dacy","Dael","Daffi","Daffie","Daffy","Dagmar","Dahlia","Daile","Daisey","Daisi","Daisie","Daisy","Dale","Dalenna","Dalia","Dalila","Dallas","Daloris","Damara","Damaris","Damita","Dana","Danell","Danella","Danette","Dani","Dania","Danica","Danice","Daniela","Daniele","Daniella","Danielle","Danika","Danila","Danit","Danita","Danna","Danni","Dannie","Danny","Dannye","Danya","Danyelle","Danyette","Daphene","Daphna","Daphne","Dara","Darb","Darbie","Darby","Darcee","Darcey","Darci","Darcie","Darcy","Darda","Dareen","Darell","Darelle","Dari","Daria","Darice","Darla","Darleen","Darlene","Darline","Darlleen","Daron","Darrelle","Darryl","Darsey","Darsie","Darya","Daryl","Daryn","Dasha","Dasi","Dasie","Dasya","Datha","Daune","Daveen","Daveta","Davida","Davina","Davine","Davita","Dawn","Dawna","Dayle","Dayna","Ddene","De","Deana","Deane","Deanna","Deanne","Deb","Debbi","Debbie","Debby","Debee","Debera","Debi","Debor","Debora","Deborah","Debra","Dede","Dedie","Dedra","Dee","Deeann","Deeanne","Deedee","Deena","Deerdre","Deeyn","Dehlia","Deidre","Deina","Deirdre","Del","Dela","Delcina","Delcine","Delia","Delila","Delilah","Delinda","Dell","Della","Delly","Delora","Delores","Deloria","Deloris","Delphine","Delphinia","Demeter","Demetra","Demetria","Demetris","Dena","Deni","Denice","Denise","Denna","Denni","Dennie","Denny","Deny","Denys","Denyse","Deonne","Desdemona","Desirae","Desiree","Desiri","Deva","Devan","Devi","Devin","Devina","Devinne","Devon","Devondra","Devonna","Devonne","Devora","Di","Diahann","Dian","Diana","Diandra","Diane","Diane-marie","Dianemarie","Diann","Dianna","Dianne","Diannne","Didi","Dido","Diena","Dierdre","Dina","Dinah","Dinnie","Dinny","Dion","Dione","Dionis","Dionne","Dita","Dix","Dixie","Dniren","Dode","Dodi","Dodie","Dody","Doe","Doll","Dolley","Dolli","Dollie","Dolly","Dolores","Dolorita","Doloritas","Domeniga","Dominga","Domini","Dominica","Dominique","Dona","Donella","Donelle","Donetta","Donia","Donica","Donielle","Donna","Donnamarie","Donni","Donnie","Donny","Dora","Doralia","Doralin","Doralyn","Doralynn","Doralynne","Dore","Doreen","Dorelia","Dorella","Dorelle","Dorena","Dorene","Doretta","Dorette","Dorey","Dori","Doria","Dorian","Dorice","Dorie","Dorine","Doris","Dorisa","Dorise","Dorita","Doro","Dorolice","Dorolisa","Dorotea","Doroteya","Dorothea","Dorothee","Dorothy","Dorree","Dorri","Dorrie","Dorris","Dorry","Dorthea","Dorthy","Dory","Dosi","Dot","Doti","Dotti","Dottie","Dotty","Dre","Dreddy","Dredi","Drona","Dru","Druci","Drucie","Drucill","Drucy","Drusi","Drusie","Drusilla","Drusy","Dulce","Dulcea","Dulci","Dulcia","Dulciana","Dulcie","Dulcine","Dulcinea","Dulcy","Dulsea","Dusty","Dyan","Dyana","Dyane","Dyann","Dyanna","Dyanne","Dyna","Dynah","Eachelle","Eada","Eadie","Eadith","Ealasaid","Eartha","Easter","Eba","Ebba","Ebonee","Ebony","Eda","Eddi","Eddie","Eddy","Ede","Edee","Edeline","Eden","Edi","Edie","Edin","Edita","Edith","Editha","Edithe","Ediva","Edna","Edwina","Edy","Edyth","Edythe","Effie","Eileen","Eilis","Eimile","Eirena","Ekaterina","Elaina","Elaine","Elana","Elane","Elayne","Elberta","Elbertina","Elbertine","Eleanor","Eleanora","Eleanore","Electra","Eleen","Elena","Elene","Eleni","Elenore","Eleonora","Eleonore","Elfie","Elfreda","Elfrida","Elfrieda","Elga","Elianora","Elianore","Elicia","Elie","Elinor","Elinore","Elisa","Elisabet","Elisabeth","Elisabetta","Elise","Elisha","Elissa","Elita","Eliza","Elizabet","Elizabeth","Elka","Elke","Ella","Elladine","Elle","Ellen","Ellene","Ellette","Elli","Ellie","Ellissa","Elly","Ellyn","Ellynn","Elmira","Elna","Elnora","Elnore","Eloisa","Eloise","Elonore","Elora","Elsa","Elsbeth","Else","Elset","Elsey","Elsi","Elsie","Elsinore","Elspeth","Elsy","Elva","Elvera","Elvina","Elvira","Elwira","Elyn","Elyse","Elysee","Elysha","Elysia","Elyssa","Em","Ema","Emalee","Emalia","Emelda","Emelia","Emelina","Emeline","Emelita","Emelyne","Emera","Emilee","Emili","Emilia","Emilie","Emiline","Emily","Emlyn","Emlynn","Emlynne","Emma","Emmalee","Emmaline","Emmalyn","Emmalynn","Emmalynne","Emmeline","Emmey","Emmi","Emmie","Emmy","Emmye","Emogene","Emyle","Emylee","Engracia","Enid","Enrica","Enrichetta","Enrika","Enriqueta","Eolanda","Eolande","Eran","Erda","Erena","Erica","Ericha","Ericka","Erika","Erin","Erina","Erinn","Erinna","Erma","Ermengarde","Ermentrude","Ermina","Erminia","Erminie","Erna","Ernaline","Ernesta","Ernestine","Ertha","Eryn","Esma","Esmaria","Esme","Esmeralda","Essa","Essie","Essy","Esta","Estel","Estele","Estell","Estella","Estelle","Ester","Esther","Estrella","Estrellita","Ethel","Ethelda","Ethelin","Ethelind","Etheline","Ethelyn","Ethyl","Etta","Etti","Ettie","Etty","Eudora","Eugenia","Eugenie","Eugine","Eula","Eulalie","Eunice","Euphemia","Eustacia","Eva","Evaleen","Evangelia","Evangelin","Evangelina","Evangeline","Evania","Evanne","Eve","Eveleen","Evelina","Eveline","Evelyn","Evey","Evie","Evita","Evonne","Evvie","Evvy","Evy","Eyde","Eydie","Ezmeralda","Fae","Faina","Faith","Fallon","Fan","Fanchette","Fanchon","Fancie","Fancy","Fanechka","Fania","Fanni","Fannie","Fanny","Fanya","Fara","Farah","Farand","Farica","Farra","Farrah","Farrand","Faun","Faunie","Faustina","Faustine","Fawn","Fawne","Fawnia","Fay","Faydra","Faye","Fayette","Fayina","Fayre","Fayth","Faythe","Federica","Fedora","Felecia","Felicdad","Felice","Felicia","Felicity","Felicle","Felipa","Felisha","Felita","Feliza","Fenelia","Feodora","Ferdinanda","Ferdinande","Fern","Fernanda","Fernande","Fernandina","Ferne","Fey","Fiann","Fianna","Fidela","Fidelia","Fidelity","Fifi","Fifine","Filia","Filide","Filippa","Fina","Fiona","Fionna","Fionnula","Fiorenze","Fleur","Fleurette","Flo","Flor","Flora","Florance","Flore","Florella","Florence","Florencia","Florentia","Florenza","Florette","Flori","Floria","Florida","Florie","Florina","Florinda","Floris","Florri","Florrie","Florry","Flory","Flossi","Flossie","Flossy","Flss","Fran","Francene","Frances","Francesca","Francine","Francisca","Franciska","Francoise","Francyne","Frank","Frankie","Franky","Franni","Frannie","Franny","Frayda","Fred","Freda","Freddi","Freddie","Freddy","Fredelia","Frederica","Fredericka","Frederique","Fredi","Fredia","Fredra","Fredrika","Freida","Frieda","Friederike","Fulvia","Gabbey","Gabbi","Gabbie","Gabey","Gabi","Gabie","Gabriel","Gabriela","Gabriell","Gabriella","Gabrielle","Gabriellia","Gabrila","Gaby","Gae","Gael","Gail","Gale","Galina","Garland","Garnet","Garnette","Gates","Gavra","Gavrielle","Gay","Gaye","Gayel","Gayla","Gayle","Gayleen","Gaylene","Gaynor","Gelya","Gena","Gene","Geneva","Genevieve","Genevra","Genia","Genna","Genni","Gennie","Gennifer","Genny","Genovera","Genvieve","George","Georgeanna","Georgeanne","Georgena","Georgeta","Georgetta","Georgette","Georgia","Georgiana","Georgianna","Georgianne","Georgie","Georgina","Georgine","Geralda","Geraldine","Gerda","Gerhardine","Geri","Gerianna","Gerianne","Gerladina","Germain","Germaine","Germana","Gerri","Gerrie","Gerrilee","Gerry","Gert","Gerta","Gerti","Gertie","Gertrud","Gertruda","Gertrude","Gertrudis","Gerty","Giacinta","Giana","Gianina","Gianna","Gigi","Gilberta","Gilberte","Gilbertina","Gilbertine","Gilda","Gilemette","Gill","Gillan","Gilli","Gillian","Gillie","Gilligan","Gilly","Gina","Ginelle","Ginevra","Ginger","Ginni","Ginnie","Ginnifer","Ginny","Giorgia","Giovanna","Gipsy","Giralda","Gisela","Gisele","Gisella","Giselle","Giuditta","Giulia","Giulietta","Giustina","Gizela","Glad","Gladi","Gladys","Gleda","Glen","Glenda","Glenine","Glenn","Glenna","Glennie","Glennis","Glori","Gloria","Gloriana","Gloriane","Glory","Glyn","Glynda","Glynis","Glynnis","Gnni","Godiva","Golda","Goldarina","Goldi","Goldia","Goldie","Goldina","Goldy","Grace","Gracia","Gracie","Grata","Gratia","Gratiana","Gray","Grayce","Grazia","Greer","Greta","Gretal","Gretchen","Grete","Gretel","Grethel","Gretna","Gretta","Grier","Griselda","Grissel","Guendolen","Guenevere","Guenna","Guglielma","Gui","Guillema","Guillemette","Guinevere","Guinna","Gunilla","Gus","Gusella","Gussi","Gussie","Gussy","Gusta","Gusti","Gustie","Gusty","Gwen","Gwendolen","Gwendolin","Gwendolyn","Gweneth","Gwenette","Gwenneth","Gwenni","Gwennie","Gwenny","Gwenora","Gwenore","Gwyn","Gwyneth","Gwynne","Gypsy","Hadria","Hailee","Haily","Haleigh","Halette","Haley","Hali","Halie","Halimeda","Halley","Halli","Hallie","Hally","Hana","Hanna","Hannah","Hanni","Hannie","Hannis","Hanny","Happy","Harlene","Harley","Harli","Harlie","Harmonia","Harmonie","Harmony","Harri","Harrie","Harriet","Harriett","Harrietta","Harriette","Harriot","Harriott","Hatti","Hattie","Hatty","Hayley","Hazel","Heath","Heather","Heda","Hedda","Heddi","Heddie","Hedi","Hedvig","Hedvige","Hedwig","Hedwiga","Hedy","Heida","Heidi","Heidie","Helaina","Helaine","Helen","Helen-elizabeth","Helena","Helene","Helenka","Helga","Helge","Helli","Heloise","Helsa","Helyn","Hendrika","Henka","Henrie","Henrieta","Henrietta","Henriette","Henryetta","Hephzibah","Hermia","Hermina","Hermine","Herminia","Hermione","Herta","Hertha","Hester","Hesther","Hestia","Hetti","Hettie","Hetty","Hilary","Hilda","Hildagard","Hildagarde","Hilde","Hildegaard","Hildegarde","Hildy","Hillary","Hilliary","Hinda","Holli","Hollie","Holly","Holly-anne","Hollyanne","Honey","Honor","Honoria","Hope","Horatia","Hortense","Hortensia","Hulda","Hyacinth","Hyacintha","Hyacinthe","Hyacinthia","Hyacinthie","Hynda","Ianthe","Ibbie","Ibby","Ida","Idalia","Idalina","Idaline","Idell","Idelle","Idette","Ileana","Ileane","Ilene","Ilise","Ilka","Illa","Ilsa","Ilse","Ilysa","Ilyse","Ilyssa","Imelda","Imogen","Imogene","Imojean","Ina","Indira","Ines","Inesita","Inessa","Inez","Inga","Ingaberg","Ingaborg","Inge","Ingeberg","Ingeborg","Inger","Ingrid","Ingunna","Inna","Iolande","Iolanthe","Iona","Iormina","Ira","Irena","Irene","Irina","Iris","Irita","Irma","Isa","Isabel","Isabelita","Isabella","Isabelle","Isadora","Isahella","Iseabal","Isidora","Isis","Isobel","Issi","Issie","Issy","Ivett","Ivette","Ivie","Ivonne","Ivory","Ivy","Izabel","Jacenta","Jacinda","Jacinta","Jacintha","Jacinthe","Jackelyn","Jacki","Jackie","Jacklin","Jacklyn","Jackquelin","Jackqueline","Jacky","Jaclin","Jaclyn","Jacquelin","Jacqueline","Jacquelyn","Jacquelynn","Jacquenetta","Jacquenette","Jacquetta","Jacquette","Jacqui","Jacquie","Jacynth","Jada","Jade","Jaime","Jaimie","Jaine","Jami","Jamie","Jamima","Jammie","Jan","Jana","Janaya","Janaye","Jandy","Jane","Janean","Janeczka","Janeen","Janel","Janela","Janella","Janelle","Janene","Janenna","Janessa","Janet","Janeta","Janetta","Janette","Janeva","Janey","Jania","Janice","Janie","Janifer","Janina","Janine","Janis","Janith","Janka","Janna","Jannel","Jannelle","Janot","Jany","Jaquelin","Jaquelyn","Jaquenetta","Jaquenette","Jaquith","Jasmin","Jasmina","Jasmine","Jayme","Jaymee","Jayne","Jaynell","Jazmin","Jean","Jeana","Jeane","Jeanelle","Jeanette","Jeanie","Jeanine","Jeanna","Jeanne","Jeannette","Jeannie","Jeannine","Jehanna","Jelene","Jemie","Jemima","Jemimah","Jemmie","Jemmy","Jen","Jena","Jenda","Jenelle","Jeni","Jenica","Jeniece","Jenifer","Jeniffer","Jenilee","Jenine","Jenn","Jenna","Jennee","Jennette","Jenni","Jennica","Jennie","Jennifer","Jennilee","Jennine","Jenny","Jeralee","Jere","Jeri","Jermaine","Jerrie","Jerrilee","Jerrilyn","Jerrine","Jerry","Jerrylee","Jess","Jessa","Jessalin","Jessalyn","Jessamine","Jessamyn","Jesse","Jesselyn","Jessi","Jessica","Jessie","Jessika","Jessy","Jewel","Jewell","Jewelle","Jill","Jillana","Jillane","Jillayne","Jilleen","Jillene","Jilli","Jillian","Jillie","Jilly","Jinny","Jo","Jo-ann","Jo-anne","Joan","Joana","Joane","Joanie","Joann","Joanna","Joanne","Joannes","Jobey","Jobi","Jobie","Jobina","Joby","Jobye","Jobyna","Jocelin","Joceline","Jocelyn","Jocelyne","Jodee","Jodi","Jodie","Jody","Joeann","Joela","Joelie","Joell","Joella","Joelle","Joellen","Joelly","Joellyn","Joelynn","Joete","Joey","Johanna","Johannah","Johna","Johnath","Johnette","Johnna","Joice","Jojo","Jolee","Joleen","Jolene","Joletta","Joli","Jolie","Joline","Joly","Jolyn","Jolynn","Jonell","Joni","Jonie","Jonis","Jordain","Jordan","Jordana","Jordanna","Jorey","Jori","Jorie","Jorrie","Jorry","Joscelin","Josee","Josefa","Josefina","Josepha","Josephina","Josephine","Josey","Josi","Josie","Josselyn","Josy","Jourdan","Joy","Joya","Joyan","Joyann","Joyce","Joycelin","Joye","Jsandye","Juana","Juanita","Judi","Judie","Judith","Juditha","Judy","Judye","Juieta","Julee","Juli","Julia","Juliana","Juliane","Juliann","Julianna","Julianne","Julie","Julienne","Juliet","Julieta","Julietta","Juliette","Julina","Juline","Julissa","Julita","June","Junette","Junia","Junie","Junina","Justina","Justine","Justinn","Jyoti","Kacey","Kacie","Kacy","Kaela","Kai","Kaia","Kaila","Kaile","Kailey","Kaitlin","Kaitlyn","Kaitlynn","Kaja","Kakalina","Kala","Kaleena","Kali","Kalie","Kalila","Kalina","Kalinda","Kalindi","Kalli","Kally","Kameko","Kamila","Kamilah","Kamillah","Kandace","Kandy","Kania","Kanya","Kara","Kara-lynn","Karalee","Karalynn","Kare","Karee","Karel","Karen","Karena","Kari","Karia","Karie","Karil","Karilynn","Karin","Karina","Karine","Kariotta","Karisa","Karissa","Karita","Karla","Karlee","Karleen","Karlen","Karlene","Karlie","Karlotta","Karlotte","Karly","Karlyn","Karmen","Karna","Karol","Karola","Karole","Karolina","Karoline","Karoly","Karon","Karrah","Karrie","Karry","Kary","Karyl","Karylin","Karyn","Kasey","Kass","Kassandra","Kassey","Kassi","Kassia","Kassie","Kat","Kata","Katalin","Kate","Katee","Katerina","Katerine","Katey","Kath","Katha","Katharina","Katharine","Katharyn","Kathe","Katherina","Katherine","Katheryn","Kathi","Kathie","Kathleen","Kathlin","Kathrine","Kathryn","Kathryne","Kathy","Kathye","Kati","Katie","Katina","Katine","Katinka","Katleen","Katlin","Katrina","Katrine","Katrinka","Katti","Kattie","Katuscha","Katusha","Katy","Katya","Kay","Kaycee","Kaye","Kayla","Kayle","Kaylee","Kayley","Kaylil","Kaylyn","Keeley","Keelia","Keely","Kelcey","Kelci","Kelcie","Kelcy","Kelila","Kellen","Kelley","Kelli","Kellia","Kellie","Kellina","Kellsie","Kelly","Kellyann","Kelsey","Kelsi","Kelsy","Kendra","Kendre","Kenna","Keri","Keriann","Kerianne","Kerri","Kerrie","Kerrill","Kerrin","Kerry","Kerstin","Kesley","Keslie","Kessia","Kessiah","Ketti","Kettie","Ketty","Kevina","Kevyn","Ki","Kiah","Kial","Kiele","Kiersten","Kikelia","Kiley","Kim","Kimberlee","Kimberley","Kimberli","Kimberly","Kimberlyn","Kimbra","Kimmi","Kimmie","Kimmy","Kinna","Kip","Kipp","Kippie","Kippy","Kira","Kirbee","Kirbie","Kirby","Kiri","Kirsten","Kirsteni","Kirsti","Kirstin","Kirstyn","Kissee","Kissiah","Kissie","Kit","Kitti","Kittie","Kitty","Kizzee","Kizzie","Klara","Klarika","Klarrisa","Konstance","Konstanze","Koo","Kora","Koral","Koralle","Kordula","Kore","Korella","Koren","Koressa","Kori","Korie","Korney","Korrie","Korry","Kris","Krissie","Krissy","Krista","Kristal","Kristan","Kriste","Kristel","Kristen","Kristi","Kristien","Kristin","Kristina","Kristine","Kristy","Kristyn","Krysta","Krystal","Krystalle","Krystle","Krystyna","Kyla","Kyle","Kylen","Kylie","Kylila","Kylynn","Kym","Kynthia","Kyrstin","Lacee","Lacey","Lacie","Lacy","Ladonna","Laetitia","Laina","Lainey","Lana","Lanae","Lane","Lanette","Laney","Lani","Lanie","Lanita","Lanna","Lanni","Lanny","Lara","Laraine","Lari","Larina","Larine","Larisa","Larissa","Lark","Laryssa","Latashia","Latia","Latisha","Latrena","Latrina","Laura","Lauraine","Laural","Lauralee","Laure","Lauree","Laureen","Laurel","Laurella","Lauren","Laurena","Laurene","Lauretta","Laurette","Lauri","Laurianne","Laurice","Laurie","Lauryn","Lavena","Laverna","Laverne","Lavina","Lavinia","Lavinie","Layla","Layne","Layney","Lea","Leah","Leandra","Leann","Leanna","Leanor","Leanora","Lebbie","Leda","Lee","Leeann","Leeanne","Leela","Leelah","Leena","Leesa","Leese","Legra","Leia","Leigh","Leigha","Leila","Leilah","Leisha","Lela","Lelah","Leland","Lelia","Lena","Lenee","Lenette","Lenka","Lenna","Lenora","Lenore","Leodora","Leoine","Leola","Leoline","Leona","Leonanie","Leone","Leonelle","Leonie","Leonora","Leonore","Leontine","Leontyne","Leora","Leshia","Lesley","Lesli","Leslie","Lesly","Lesya","Leta","Lethia","Leticia","Letisha","Letitia","Letizia","Letta","Letti","Lettie","Letty","Lexi","Lexie","Lexine","Lexis","Lexy","Leyla","Lezlie","Lia","Lian","Liana","Liane","Lianna","Lianne","Lib","Libbey","Libbi","Libbie","Libby","Licha","Lida","Lidia","Liesa","Lil","Lila","Lilah","Lilas","Lilia","Lilian","Liliane","Lilias","Lilith","Lilla","Lilli","Lillian","Lillis","Lilllie","Lilly","Lily","Lilyan","Lin","Lina","Lind","Linda","Lindi","Lindie","Lindsay","Lindsey","Lindsy","Lindy","Linea","Linell","Linet","Linette","Linn","Linnea","Linnell","Linnet","Linnie","Linzy","Lira","Lisa","Lisabeth","Lisbeth","Lise","Lisetta","Lisette","Lisha","Lishe","Lissa","Lissi","Lissie","Lissy","Lita","Liuka","Liv","Liva","Livia","Livvie","Livvy","Livvyy","Livy","Liz","Liza","Lizabeth","Lizbeth","Lizette","Lizzie","Lizzy","Loella","Lois","Loise","Lola","Loleta","Lolita","Lolly","Lona","Lonee","Loni","Lonna","Lonni","Lonnie","Lora","Lorain","Loraine","Loralee","Loralie","Loralyn","Loree","Loreen","Lorelei","Lorelle","Loren","Lorena","Lorene","Lorenza","Loretta","Lorette","Lori","Loria","Lorianna","Lorianne","Lorie","Lorilee","Lorilyn","Lorinda","Lorine","Lorita","Lorna","Lorne","Lorraine","Lorrayne","Lorri","Lorrie","Lorrin","Lorry","Lory","Lotta","Lotte","Lotti","Lottie","Lotty","Lou","Louella","Louisa","Louise","Louisette","Loutitia","Lu","Luce","Luci","Lucia","Luciana","Lucie","Lucienne","Lucila","Lucilia","Lucille","Lucina","Lucinda","Lucine","Lucita","Lucky","Lucretia","Lucy","Ludovika","Luella","Luelle","Luisa","Luise","Lula","Lulita","Lulu","Lura","Lurette","Lurleen","Lurlene","Lurline","Lusa","Luz","Lyda","Lydia","Lydie","Lyn","Lynda","Lynde","Lyndel","Lyndell","Lyndsay","Lyndsey","Lyndsie","Lyndy","Lynea","Lynelle","Lynett","Lynette","Lynn","Lynna","Lynne","Lynnea","Lynnell","Lynnelle","Lynnet","Lynnett","Lynnette","Lynsey","Lyssa","Mab","Mabel","Mabelle","Mable","Mada","Madalena","Madalyn","Maddalena","Maddi","Maddie","Maddy","Madel","Madelaine","Madeleine","Madelena","Madelene","Madelin","Madelina","Madeline","Madella","Madelle","Madelon","Madelyn","Madge","Madlen","Madlin","Madonna","Mady","Mae","Maegan","Mag","Magda","Magdaia","Magdalen","Magdalena","Magdalene","Maggee","Maggi","Maggie","Maggy","Mahala","Mahalia","Maia","Maible","Maiga","Maighdiln","Mair","Maire","Maisey","Maisie","Maitilde","Mala","Malanie","Malena","Malia","Malina","Malinda","Malinde","Malissa","Malissia","Mallissa","Mallorie","Mallory","Malorie","Malory","Malva","Malvina","Malynda","Mame","Mamie","Manda","Mandi","Mandie","Mandy","Manon","Manya","Mara","Marabel","Marcela","Marcelia","Marcella","Marcelle","Marcellina","Marcelline","Marchelle","Marci","Marcia","Marcie","Marcile","Marcille","Marcy","Mareah","Maren","Marena","Maressa","Marga","Margalit","Margalo","Margaret","Margareta","Margarete","Margaretha","Margarethe","Margaretta","Margarette","Margarita","Margaux","Marge","Margeaux","Margery","Marget","Margette","Margi","Margie","Margit","Margo","Margot","Margret","Marguerite","Margy","Mari","Maria","Mariam","Marian","Mariana","Mariann","Marianna","Marianne","Maribel","Maribelle","Maribeth","Marice","Maridel","Marie","Marie-ann","Marie-jeanne","Marieann","Mariejeanne","Mariel","Mariele","Marielle","Mariellen","Marietta","Mariette","Marigold","Marijo","Marika","Marilee","Marilin","Marillin","Marilyn","Marin","Marina","Marinna","Marion","Mariquilla","Maris","Marisa","Mariska","Marissa","Marita","Maritsa","Mariya","Marj","Marja","Marje","Marji","Marjie","Marjorie","Marjory","Marjy","Marketa","Marla","Marlane","Marleah","Marlee","Marleen","Marlena","Marlene","Marley","Marlie","Marline","Marlo","Marlyn","Marna","Marne","Marney","Marni","Marnia","Marnie","Marquita","Marrilee","Marris","Marrissa","Marsha","Marsiella","Marta","Martelle","Martguerita","Martha","Marthe","Marthena","Marti","Martica","Martie","Martina","Martita","Marty","Martynne","Mary","Marya","Maryann","Maryanna","Maryanne","Marybelle","Marybeth","Maryellen","Maryjane","Maryjo","Maryl","Marylee","Marylin","Marylinda","Marylou","Marylynne","Maryrose","Marys","Marysa","Masha","Matelda","Mathilda","Mathilde","Matilda","Matilde","Matti","Mattie","Matty","Maud","Maude","Maudie","Maura","Maure","Maureen","Maureene","Maurene","Maurine","Maurise","Maurita","Maurizia","Mavis","Mavra","Max","Maxi","Maxie","Maxine","Maxy","May","Maybelle","Maye","Mead","Meade","Meagan","Meaghan","Meara","Mechelle","Meg","Megan","Megen","Meggi","Meggie","Meggy","Meghan","Meghann","Mehetabel","Mei","Mel","Mela","Melamie","Melania","Melanie","Melantha","Melany","Melba","Melesa","Melessa","Melicent","Melina","Melinda","Melinde","Melisa","Melisande","Melisandra","Melisenda","Melisent","Melissa","Melisse","Melita","Melitta","Mella","Melli","Mellicent","Mellie","Mellisa","Mellisent","Melloney","Melly","Melodee","Melodie","Melody","Melonie","Melony","Melosa","Melva","Mercedes","Merci","Mercie","Mercy","Meredith","Meredithe","Meridel","Meridith","Meriel","Merilee","Merilyn","Meris","Merissa","Merl","Merla","Merle","Merlina","Merline","Merna","Merola","Merralee","Merridie","Merrie","Merrielle","Merrile","Merrilee","Merrili","Merrill","Merrily","Merry","Mersey","Meryl","Meta","Mia","Micaela","Michaela","Michaelina","Michaeline","Michaella","Michal","Michel","Michele","Michelina","Micheline","Michell","Michelle","Micki","Mickie","Micky","Midge","Mignon","Mignonne","Miguela","Miguelita","Mikaela","Mil","Mildred","Mildrid","Milena","Milicent","Milissent","Milka","Milli","Millicent","Millie","Millisent","Milly","Milzie","Mimi","Min","Mina","Minda","Mindy","Minerva","Minetta","Minette","Minna","Minnaminnie","Minne","Minni","Minnie","Minnnie","Minny","Minta","Miquela","Mira","Mirabel","Mirabella","Mirabelle","Miran","Miranda","Mireielle","Mireille","Mirella","Mirelle","Miriam","Mirilla","Mirna","Misha","Missie","Missy","Misti","Misty","Mitzi","Modesta","Modestia","Modestine","Modesty","Moina","Moira","Moll","Mollee","Molli","Mollie","Molly","Mommy","Mona","Monah","Monica","Monika","Monique","Mora","Moreen","Morena","Morgan","Morgana","Morganica","Morganne","Morgen","Moria","Morissa","Morna","Moselle","Moyna","Moyra","Mozelle","Muffin","Mufi","Mufinella","Muire","Mureil","Murial","Muriel","Murielle","Myra","Myrah","Myranda","Myriam","Myrilla","Myrle","Myrlene","Myrna","Myrta","Myrtia","Myrtice","Myrtie","Myrtle","Nada","Nadean","Nadeen","Nadia","Nadine","Nadiya","Nady","Nadya","Nalani","Nan","Nana","Nananne","Nance","Nancee","Nancey","Nanci","Nancie","Nancy","Nanete","Nanette","Nani","Nanice","Nanine","Nannette","Nanni","Nannie","Nanny","Nanon","Naoma","Naomi","Nara","Nari","Nariko","Nat","Nata","Natala","Natalee","Natalie","Natalina","Nataline","Natalya","Natasha","Natassia","Nathalia","Nathalie","Natividad","Natka","Natty","Neala","Neda","Nedda","Nedi","Neely","Neila","Neile","Neilla","Neille","Nelia","Nelie","Nell","Nelle","Nelli","Nellie","Nelly","Nerissa","Nerita","Nert","Nerta","Nerte","Nerti","Nertie","Nerty","Nessa","Nessi","Nessie","Nessy","Nesta","Netta","Netti","Nettie","Nettle","Netty","Nevsa","Neysa","Nichol","Nichole","Nicholle","Nicki","Nickie","Nicky","Nicol","Nicola","Nicole","Nicolea","Nicolette","Nicoli","Nicolina","Nicoline","Nicolle","Nikaniki","Nike","Niki","Nikki","Nikkie","Nikoletta","Nikolia","Nina","Ninetta","Ninette","Ninnetta","Ninnette","Ninon","Nissa","Nisse","Nissie","Nissy","Nita","Nixie","Noami","Noel","Noelani","Noell","Noella","Noelle","Noellyn","Noelyn","Noemi","Nola","Nolana","Nolie","Nollie","Nomi","Nona","Nonah","Noni","Nonie","Nonna","Nonnah","Nora","Norah","Norean","Noreen","Norene","Norina","Norine","Norma","Norri","Norrie","Norry","Novelia","Nydia","Nyssa","Octavia","Odele","Odelia","Odelinda","Odella","Odelle","Odessa","Odetta","Odette","Odilia","Odille","Ofelia","Ofella","Ofilia","Ola","Olenka","Olga","Olia","Olimpia","Olive","Olivette","Olivia","Olivie","Oliy","Ollie","Olly","Olva","Olwen","Olympe","Olympia","Olympie","Ondrea","Oneida","Onida","Oona","Opal","Opalina","Opaline","Ophelia","Ophelie","Ora","Oralee","Oralia","Oralie","Oralla","Oralle","Orel","Orelee","Orelia","Orelie","Orella","Orelle","Oriana","Orly","Orsa","Orsola","Ortensia","Otha","Othelia","Othella","Othilia","Othilie","Ottilie","Page","Paige","Paloma","Pam","Pamela","Pamelina","Pamella","Pammi","Pammie","Pammy","Pandora","Pansie","Pansy","Paola","Paolina","Papagena","Pat","Patience","Patrica","Patrice","Patricia","Patrizia","Patsy","Patti","Pattie","Patty","Paula","Paule","Pauletta","Paulette","Pauli","Paulie","Paulina","Pauline","Paulita","Pauly","Pavia","Pavla","Pearl","Pearla","Pearle","Pearline","Peg","Pegeen","Peggi","Peggie","Peggy","Pen","Penelopa","Penelope","Penni","Pennie","Penny","Pepi","Pepita","Peri","Peria","Perl","Perla","Perle","Perri","Perrine","Perry","Persis","Pet","Peta","Petra","Petrina","Petronella","Petronia","Petronilla","Petronille","Petunia","Phaedra","Phaidra","Phebe","Phedra","Phelia","Phil","Philipa","Philippa","Philippe","Philippine","Philis","Phillida","Phillie","Phillis","Philly","Philomena","Phoebe","Phylis","Phyllida","Phyllis","Phyllys","Phylys","Pia","Pier","Pierette","Pierrette","Pietra","Piper","Pippa","Pippy","Polly","Pollyanna","Pooh","Poppy","Portia","Pris","Prisca","Priscella","Priscilla","Prissie","Pru","Prudence","Prudi","Prudy","Prue","Queenie","Quentin","Querida","Quinn","Quinta","Quintana","Quintilla","Quintina","Rachael","Rachel","Rachele","Rachelle","Rae","Raeann","Raf","Rafa","Rafaela","Rafaelia","Rafaelita","Rahal","Rahel","Raina","Raine","Rakel","Ralina","Ramona","Ramonda","Rana","Randa","Randee","Randene","Randi","Randie","Randy","Ranee","Rani","Rania","Ranice","Ranique","Ranna","Raphaela","Raquel","Raquela","Rasia","Rasla","Raven","Ray","Raychel","Raye","Rayna","Raynell","Rayshell","Rea","Reba","Rebbecca","Rebe","Rebeca","Rebecca","Rebecka","Rebeka","Rebekah","Rebekkah","Ree","Reeba","Reena","Reeta","Reeva","Regan","Reggi","Reggie","Regina","Regine","Reiko","Reina","Reine","Remy","Rena","Renae","Renata","Renate","Rene","Renee","Renell","Renelle","Renie","Rennie","Reta","Retha","Revkah","Rey","Reyna","Rhea","Rheba","Rheta","Rhetta","Rhiamon","Rhianna","Rhianon","Rhoda","Rhodia","Rhodie","Rhody","Rhona","Rhonda","Riane","Riannon","Rianon","Rica","Ricca","Rici","Ricki","Rickie","Ricky","Riki","Rikki","Rina","Risa","Rita","Riva","Rivalee","Rivi","Rivkah","Rivy","Roana","Roanna","Roanne","Robbi","Robbie","Robbin","Robby","Robbyn","Robena","Robenia","Roberta","Robin","Robina","Robinet","Robinett","Robinetta","Robinette","Robinia","Roby","Robyn","Roch","Rochell","Rochella","Rochelle","Rochette","Roda","Rodi","Rodie","Rodina","Rois","Romola","Romona","Romonda","Romy","Rona","Ronalda","Ronda","Ronica","Ronna","Ronni","Ronnica","Ronnie","Ronny","Roobbie","Rora","Rori","Rorie","Rory","Ros","Rosa","Rosabel","Rosabella","Rosabelle","Rosaleen","Rosalia","Rosalie","Rosalind","Rosalinda","Rosalinde","Rosaline","Rosalyn","Rosalynd","Rosamond","Rosamund","Rosana","Rosanna","Rosanne","Rose","Roseann","Roseanna","Roseanne","Roselia","Roselin","Roseline","Rosella","Roselle","Rosemaria","Rosemarie","Rosemary","Rosemonde","Rosene","Rosetta","Rosette","Roshelle","Rosie","Rosina","Rosita","Roslyn","Rosmunda","Rosy","Row","Rowe","Rowena","Roxana","Roxane","Roxanna","Roxanne","Roxi","Roxie","Roxine","Roxy","Roz","Rozalie","Rozalin","Rozamond","Rozanna","Rozanne","Roze","Rozele","Rozella","Rozelle","Rozina","Rubetta","Rubi","Rubia","Rubie","Rubina","Ruby","Ruperta","Ruth","Ruthann","Ruthanne","Ruthe","Ruthi","Ruthie","Ruthy","Ryann","Rycca","Saba","Sabina","Sabine","Sabra","Sabrina","Sacha","Sada","Sadella","Sadie","Sadye","Saidee","Sal","Salaidh","Sallee","Salli","Sallie","Sally","Sallyann","Sallyanne","Saloma","Salome","Salomi","Sam","Samantha","Samara","Samaria","Sammy","Sande","Sandi","Sandie","Sandra","Sandy","Sandye","Sapphira","Sapphire","Sara","Sara-ann","Saraann","Sarah","Sarajane","Saree","Sarena","Sarene","Sarette","Sari","Sarina","Sarine","Sarita","Sascha","Sasha","Sashenka","Saudra","Saundra","Savina","Sayre","Scarlet","Scarlett","Sean","Seana","Seka","Sela","Selena","Selene","Selestina","Selia","Selie","Selina","Selinda","Seline","Sella","Selle","Selma","Sena","Sephira","Serena","Serene","Shae","Shaina","Shaine","Shalna","Shalne","Shana","Shanda","Shandee","Shandeigh","Shandie","Shandra","Shandy","Shane","Shani","Shanie","Shanna","Shannah","Shannen","Shannon","Shanon","Shanta","Shantee","Shara","Sharai","Shari","Sharia","Sharity","Sharl","Sharla","Sharleen","Sharlene","Sharline","Sharon","Sharona","Sharron","Sharyl","Shaun","Shauna","Shawn","Shawna","Shawnee","Shay","Shayla","Shaylah","Shaylyn","Shaylynn","Shayna","Shayne","Shea","Sheba","Sheela","Sheelagh","Sheelah","Sheena","Sheeree","Sheila","Sheila-kathryn","Sheilah","Shel","Shela","Shelagh","Shelba","Shelbi","Shelby","Shelia","Shell","Shelley","Shelli","Shellie","Shelly","Shena","Sher","Sheree","Sheri","Sherie","Sherill","Sherilyn","Sherline","Sherri","Sherrie","Sherry","Sherye","Sheryl","Shina","Shir","Shirl","Shirlee","Shirleen","Shirlene","Shirley","Shirline","Shoshana","Shoshanna","Siana","Sianna","Sib","Sibbie","Sibby","Sibeal","Sibel","Sibella","Sibelle","Sibilla","Sibley","Sibyl","Sibylla","Sibylle","Sidoney","Sidonia","Sidonnie","Sigrid","Sile","Sileas","Silva","Silvana","Silvia","Silvie","Simona","Simone","Simonette","Simonne","Sindee","Siobhan","Sioux","Siouxie","Sisely","Sisile","Sissie","Sissy","Siusan","Sofia","Sofie","Sondra","Sonia","Sonja","Sonni","Sonnie","Sonnnie","Sonny","Sonya","Sophey","Sophi","Sophia","Sophie","Sophronia","Sorcha","Sosanna","Stace","Stacee","Stacey","Staci","Stacia","Stacie","Stacy","Stafani","Star","Starla","Starlene","Starlin","Starr","Stefa","Stefania","Stefanie","Steffane","Steffi","Steffie","Stella","Stepha","Stephana","Stephani","Stephanie","Stephannie","Stephenie","Stephi","Stephie","Stephine","Stesha","Stevana","Stevena","Stoddard","Storm","Stormi","Stormie","Stormy","Sue","Suellen","Sukey","Suki","Sula","Sunny","Sunshine","Susan","Susana","Susanetta","Susann","Susanna","Susannah","Susanne","Susette","Susi","Susie","Susy","Suzann","Suzanna","Suzanne","Suzette","Suzi","Suzie","Suzy","Sybil","Sybila","Sybilla","Sybille","Sybyl","Sydel","Sydelle","Sydney","Sylvia","Tabatha","Tabbatha","Tabbi","Tabbie","Tabbitha","Tabby","Tabina","Tabitha","Taffy","Talia","Tallia","Tallie","Tallou","Tallulah","Tally","Talya","Talyah","Tamar","Tamara","Tamarah","Tamarra","Tamera","Tami","Tamiko","Tamma","Tammara","Tammi","Tammie","Tammy","Tamqrah","Tamra","Tana","Tandi","Tandie","Tandy","Tanhya","Tani","Tania","Tanitansy","Tansy","Tanya","Tara","Tarah","Tarra","Tarrah","Taryn","Tasha","Tasia","Tate","Tatiana","Tatiania","Tatum","Tawnya","Tawsha","Ted","Tedda","Teddi","Teddie","Teddy","Tedi","Tedra","Teena","Teirtza","Teodora","Tera","Teresa","Terese","Teresina","Teresita","Teressa","Teri","Teriann","Terra","Terri","Terrie","Terrijo","Terry","Terrye","Tersina","Terza","Tess","Tessa","Tessi","Tessie","Tessy","Thalia","Thea","Theadora","Theda","Thekla","Thelma","Theo","Theodora","Theodosia","Theresa","Therese","Theresina","Theresita","Theressa","Therine","Thia","Thomasa","Thomasin","Thomasina","Thomasine","Tiena","Tierney","Tiertza","Tiff","Tiffani","Tiffanie","Tiffany","Tiffi","Tiffie","Tiffy","Tilda","Tildi","Tildie","Tildy","Tillie","Tilly","Tim","Timi","Timmi","Timmie","Timmy","Timothea","Tina","Tine","Tiphani","Tiphanie","Tiphany","Tish","Tisha","Tobe","Tobey","Tobi","Toby","Tobye","Toinette","Toma","Tomasina","Tomasine","Tomi","Tommi","Tommie","Tommy","Toni","Tonia","Tonie","Tony","Tonya","Tonye","Tootsie","Torey","Tori","Torie","Torrie","Tory","Tova","Tove","Tracee","Tracey","Traci","Tracie","Tracy","Trenna","Tresa","Trescha","Tressa","Tricia","Trina","Trish","Trisha","Trista","Trix","Trixi","Trixie","Trixy","Truda","Trude","Trudey","Trudi","Trudie","Trudy","Trula","Tuesday","Twila","Twyla","Tybi","Tybie","Tyne","Ula","Ulla","Ulrica","Ulrika","Ulrikaumeko","Ulrike","Umeko","Una","Ursa","Ursala","Ursola","Ursula","Ursulina","Ursuline","Uta","Val","Valaree","Valaria","Vale","Valeda","Valencia","Valene","Valenka","Valentia","Valentina","Valentine","Valera","Valeria","Valerie","Valery","Valerye","Valida","Valina","Valli","Vallie","Vally","Valma","Valry","Van","Vanda","Vanessa","Vania","Vanna","Vanni","Vannie","Vanny","Vanya","Veda","Velma","Velvet","Venita","Venus","Vera","Veradis","Vere","Verena","Verene","Veriee","Verile","Verina","Verine","Verla","Verna","Vernice","Veronica","Veronika","Veronike","Veronique","Vevay","Vi","Vicki","Vickie","Vicky","Victoria","Vida","Viki","Vikki","Vikky","Vilhelmina","Vilma","Vin","Vina","Vinita","Vinni","Vinnie","Vinny","Viola","Violante","Viole","Violet","Violetta","Violette","Virgie","Virgina","Virginia","Virginie","Vita","Vitia","Vitoria","Vittoria","Viv","Viva","Vivi","Vivia","Vivian","Viviana","Vivianna","Vivianne","Vivie","Vivien","Viviene","Vivienne","Viviyan","Vivyan","Vivyanne","Vonni","Vonnie","Vonny","Vyky","Wallie","Wallis","Walliw","Wally","Waly","Wanda","Wandie","Wandis","Waneta","Wanids","Wenda","Wendeline","Wendi","Wendie","Wendy","Wendye","Wenona","Wenonah","Whitney","Wileen","Wilhelmina","Wilhelmine","Wilie","Willa","Willabella","Willamina","Willetta","Willette","Willi","Willie","Willow","Willy","Willyt","Wilma","Wilmette","Wilona","Wilone","Wilow","Windy","Wini","Winifred","Winna","Winnah","Winne","Winni","Winnie","Winnifred","Winny","Winona","Winonah","Wren","Wrennie","Wylma","Wynn","Wynne","Wynnie","Wynny","Xaviera","Xena","Xenia","Xylia","Xylina","Yalonda","Yasmeen","Yasmin","Yelena","Yetta","Yettie","Yetty","Yevette","Ynes","Ynez","Yoko","Yolanda","Yolande","Yolane","Yolanthe","Yoshi","Yoshiko","Yovonnda","Ysabel","Yvette","Yvonne","Zabrina","Zahara","Zandra","Zaneta","Zara","Zarah","Zaria","Zarla","Zea","Zelda","Zelma","Zena","Zenia","Zia","Zilvia","Zita","Zitella","Zoe","Zola","Zonda","Zondra","Zonnya","Zora","Zorah","Zorana","Zorina","Zorine","Zsazsa","Zulema","Zuzana"];SK();class Fj{globalStore;constructor($){this.globalStore=$}clear(){console.clear()}filterByLabel($){YM($,this.globalStore.cache).forEach((K)=>{d7(K)})}filterByNamespace(...$){vM($,this.globalStore.cache).forEach((K)=>{d7(K)})}filterByLevel($){zM($,this.globalStore.cache).forEach((K)=>{d7(K)})}renderAll(){this.globalStore.cache.forEach(($)=>{d7($)})}}class c4{config;pidCounter=1;labels=new Map;_listenerCounter=0;_levelsToListeners=new Map;_cache=[];constructor($={}){this.config=$}get cache(){return this._cache}get configuration(){return this.config}get pid(){let $=this.pidCounter;return this.pidCounter++,$}get tools(){return new Fj(this)}addLogToCache($){if(this._cache.length<(this.config.cacheSize??300))this._cache.push($)}clearCache(){this._cache=[]}getLabel($){return this.labels.get($)}setLabel($,q){this.labels.set($,q)}addListener($,q){let K=this._listenerCounter+=1;return l7({...P8.levels,...this.config.levels??{}},$).forEach((_)=>{if(this._levelsToListeners.has(_))this._levelsToListeners.get(_).set(K,q);else this._levelsToListeners.set(_,new Map([[K,q]]))}),K}removeListener($){this._levelsToListeners.forEach((q)=>{q.delete($)})}getListeners($){return Array.from(this._levelsToListeners.get($)?.values()??[])}}function kH($){return globalThis.$adzeGlobal=new c4($),globalThis.$adzeGlobal}function aj($){let q=globalThis.$adzeGlobal;if(ro(q))return q;let K=new c4($);return globalThis.$adzeGlobal=K,K}function ro($){return $ instanceof c4}function MK(){return typeof window<"u"&&typeof window.location<"u"&&typeof window.navigator.userAgent<"u"&&!oo()}function oo(){return typeof Deno<"u"}function WM($){return MK()}function HM(){let $=!1;if(MK())$=new URLSearchParams(globalThis.location.search).get("ADZE_ENV")==="test";return globalThis.$ADZE_ENV==="test"||$}function JM(){let $=globalThis;if(WM($))return $.navigator.userAgent.includes("Firefox");return!1}function p4($){return Object.prototype.toString.call($)==="[object String]"}function m4($){return $!==null&&typeof $==="number"&&!isNaN(Number($))}function Qj($){return VH.includes($)}function TM($){return fM.includes($)}function wM($){return GH.includes($)}function AH($){return $.every((q)=>p4(q))}function ZM($){return Array.isArray($)&&$.length===3&&$[1]==="-"}function XM(){return Error().stack?.replace(/^Error\n/,`
333
333
  `)}function kM($){if(m4($.activeLevel))return $.activeLevel;return $.levels[$.activeLevel].level}var NH=Dq(GM(),1),VM=NH.default??NH;function CH($){return $.charAt(0).toUpperCase()+$.slice(1)}function EH($){return Object.values($).map((q)=>q.level)}function hH($,q,K){return $.filter((P)=>P>=q&&P<=K)}function RH($,q=!1,K){let _=(q&&K?9+K.length:9)-$.length,O=$;for(let j=0;j<=_;j+=1)O+=" ";return O}function IH($,q){return q.reduce((K,P)=>{return VM[P](K)},$)}function d7($){if($.data)console[$.data.method](...$.data.message)}function SM($){return $.filter((q)=>q!=="")}function MM($){return typeof $==="object"&&$!==null}function l7($,q){if(q==="*")return Object.values($).map((K)=>K.level);if(p4(q))return[$[q].level];if(m4(q))return[q];if(ZM(q)){if(AH(q)){let K=$[q[0]].level,P=$[q[2]].level;return hH(EH($),K,P)}return hH(EH($),q[0],q[2])}if(Array.isArray(q)&&AH(q))return q.map((K)=>$[K].level);return q}function DH($,q,K){if(q.length===0)return!1;return $==="include"?!q.includes(K):q.includes(K)}function LH($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return!q.map((K)=>$.includes(K)).includes(!0)}function bH($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return q.map((K)=>$.includes(K)).includes(!0)}function YM($,q){return q.filter((K)=>K.data?.label?.name===$)}function vM($,q){return q.filter((K)=>{if(K.data?.namespace)return K.data.namespace.map((_)=>$.includes(_)).includes(!0);return!1})}function zM($,q){return q.filter((K)=>{let P=l7(K.configuration.levels,$);if(K.data?.level===void 0)return!1;return DH("exclude",P,K.data.level)})}function gH($){if($&&$.length>0)return $.reduce((q,K)=>`${q}#${K} `,"");return""}function uH($){return $?`[${$.name}] `:""}function yH($){return $!==void 0?`(Count: ${$}) `:""}function xH($,q){return $!==void 0&&!$?`${q?"❌ ":""}Assertion failed:`:""}function cH($,q){return $!==void 0&&$?`${q?"✅ ":""}Expression passed:`:""}var ej=-1,d4=0,l4=1,r4=2,r7=3,o7=4,n7=5,i7=6,sj=7,$O=8;var NM=typeof self==="object"?self:globalThis,no=($,q)=>{let K=(_,O)=>{return $.set(O,_),_},P=(_)=>{if($.has(_))return $.get(_);let[O,j]=q[_];switch(O){case d4:case ej:return K(j,_);case l4:{let z=K([],_);for(let J of j)z.push(P(J));return z}case r4:{let z=K({},_);for(let[J,w]of j)z[P(J)]=P(w);return z}case r7:return K(new Date(j),_);case o7:{let{source:z,flags:J}=j;return K(new RegExp(z,J),_)}case n7:{let z=K(new Map,_);for(let[J,w]of j)z.set(P(J),P(w));return z}case i7:{let z=K(new Set,_);for(let J of j)z.add(P(J));return z}case sj:{let{name:z,message:J}=j;return K(new NM[z](J),_)}case $O:return K(BigInt(j),_);case"BigInt":return K(Object(BigInt(j)),_)}return K(new NM[O](j),_)};return P},pH=($)=>no(new Map,$)(0);var o4="",{toString:io}={},{keys:Bo}=Object,B7=($)=>{let q=typeof $;if(q!=="object"||!$)return[d4,q];let K=io.call($).slice(8,-1);switch(K){case"Array":return[l4,o4];case"Object":return[r4,o4];case"Date":return[r7,o4];case"RegExp":return[o7,o4];case"Map":return[n7,o4];case"Set":return[i7,o4]}if(K.includes("Array"))return[l4,K];if(K.includes("Error"))return[sj,K];return[r4,K]},qO=([$,q])=>$===d4&&(q==="function"||q==="symbol"),to=($,q,K,P)=>{let _=(j,z)=>{let J=P.push(j)-1;return K.set(z,J),J},O=(j)=>{if(K.has(j))return K.get(j);let[z,J]=B7(j);switch(z){case d4:{let k=j;switch(J){case"bigint":z=$O,k=j.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+J);k=null;break;case"undefined":return _([ej],j)}return _([z,k],j)}case l4:{if(J)return _([J,[...j]],j);let k=[],X=_([z,k],j);for(let G of j)k.push(O(G));return X}case r4:{if(J)switch(J){case"BigInt":return _([J,j.toString()],j);case"Boolean":case"Number":case"String":return _([J,j.valueOf()],j)}if(q&&"toJSON"in j)return O(j.toJSON());let k=[],X=_([z,k],j);for(let G of Bo(j))if($||!qO(B7(j[G])))k.push([O(G),O(j[G])]);return X}case r7:return _([z,j.toISOString()],j);case o7:{let{source:k,flags:X}=j;return _([z,{source:k,flags:X}],j)}case n7:{let k=[],X=_([z,k],j);for(let[G,V]of j)if($||!(qO(B7(G))||qO(B7(V))))k.push([O(G),O(V)]);return X}case i7:{let k=[],X=_([z,k],j);for(let G of j)if($||!qO(B7(G)))k.push(O(G));return X}}let{message:w}=j;return _([z,{name:J,message:w}],j)};return O},mH=($,{json:q,lossy:K}={})=>{let P=[];return to(!(q||K),!!q,new Map,P)($),P};var dH=typeof structuredClone==="function"?($,q)=>q&&(("json"in q)||("lossy"in q))?pH(mH($,q)):structuredClone($):($,q)=>pH(mH($,q));function lH($,q,K,P){let{formatters:_,middleware:O=[],...j}=q.exportValues();return class extends ${_cfg=new n4({...dH(j),formatters:{..._},middleware:[...O]});_modifierData=dH(K);modifierQueue=[...P]}}function rH([$,q]){return`${$}s ${q/1e6}ms`}function CM(){return rH(KO())}function KO($){let q=performance.now()*0.001,K=Math.floor(q),P=Math.floor(q%1*1e9);if($===void 0)return[K,P];let _=K-$[0],O=P-$[1];if(O<0)_-=1,O+=1e9;return[_,O]}function i4($){let q=(O)=>`${Math.floor(Math.abs(O))}`.padStart(2,"0"),K=-$.getTimezoneOffset(),_=`${K>=0?"+":"-"}${q(K/60)}:${q(K%60)}`;return`${$.getFullYear()}-${q($.getMonth()+1)}-${q($.getDate())}T${q($.getHours())}:${q($.getMinutes())}:${q($.getSeconds())}${_}`}function EM($){let q=(E,h=2)=>String(E).padStart(h,"0"),K=q($.getDate()),_=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][$.getMonth()],O=$.getFullYear(),j=q($.getHours()),z=q($.getMinutes()),J=q($.getSeconds()),w=-$.getTimezoneOffset(),k=w>=0?"+":"-",X=Math.abs(w),G=q(Math.floor(X/60)),V=q(X%60),C=`${k}${G}${V}`;return`${K}/${_}/${O}:${j}:${z}:${J} ${C}`}class I8{cfg;level;timestampFormatFunction=($)=>i4($);constructor($,q){this.cfg=$,this.level=q}get timestampFormatter(){return this.cfg.timestampFormatter?this.cfg.timestampFormatter:this.timestampFormatFunction}print($,q,K){if(this.level.level>kM(this.cfg))return[];if(this.failsFilters($))return[];if($.assertion===!0)return[];if($.if===!1)return[];if($.method&&!wM($.method)){if(TM($.method)&&Qj($.method))return K}let P=MK()?this.formatBrowser($,q,K):this.formatServer($,q,K);if($.stacktrace)P.push($.stacktrace);return P}failsFilters($){if(this.failsLevelSelector())return!0;if(this.failsNamespacesFilter($))return!0;if(this.failsLabelsFilter($))return!0;return!1}failsLevelSelector(){if(this.cfg.filters?.levels===void 0)return!1;let $=l7(this.cfg.levels,this.cfg.filters.levels.values);if(DH(this.cfg.filters.levels.type,$,this.level.level))return!0;return!1}failsNamespacesFilter($){if(this.cfg.filters?.namespaces===void 0)return!1;if(this.cfg.filters.namespaces.values.length>0&&$.namespace===void 0)return!0;if(this.cfg.filters.namespaces.type==="include"){let K=$.namespace??[];return LH(this.cfg.filters.namespaces.values,K)}let q=$.namespace??[];return bH(this.cfg.filters.namespaces.values,q)}failsLabelsFilter($){if(this.cfg.filters?.labels===void 0)return!1;if(this.cfg.filters.labels.values.length>0&&$.label===void 0)return!0;let q=$.label?[$.label.name]:[];if(this.cfg.filters.labels.type==="include")return LH(this.cfg.filters.labels.values,q);return bH(this.cfg.filters.labels.values,q)}}class _O extends I8{timestampFormatFunction=($)=>EM($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){if(this.cfg.meta.hostname===void 0)console.warn(Error("Adze: 'hostname' is required for the common log format. Please provide this value in your log's meta data."));let P=this.cfg.meta.hostname,_=this.cfg.meta.ident??"-",O=this.cfg.meta.user??"-",j=K[0];return[`${P} ${_} ${O} [${q}] ${j}`]}}var hM=_O;function RM($){return typeof $.name==="string"&&typeof $.hostname==="string"}class PO extends I8{timestampFormatFunction=($)=>i4($);formatBrowser($,q,K){return this.formatMessage($,q,K)}formatServer($,q,K){return this.formatMessage($,q,K)}formatMessage($,q,K){let P=aj(),_=[...K],O=_.shift();if(RM(this.cfg.meta)){let{src:j,err:z,req_id:J,req:w,res:k,latency:X,hostname:G,name:V,...C}=this.cfg.meta,{namespace:E,label:h}=$,I={v:1,level:this.level.level,levelName:this.level.levelName,name:V,hostname:G,msg:O,args:_,pid:P.pid,time:q,meta:Object.keys(C).length>0?C:void 0,namespace:E,label:h?.name,src:j,err:z,req_id:J,req:w,res:k,latency:X};return[JSON.stringify(I)]}return console.warn(Error("Adze: Required fields are missing from the log meta for generating a JSON log.")),[..._]}}var IM=PO;class jO extends I8{formatBrowser($,q,K){let P=this.formatLeader(),_=this.formatMeta($,q);if(this.cfg.withEmoji)return[P,"font-size: 12px;",this.level.style,_,...K];return[P,this.level.style,_,...K]}formatServer($,q,K){let P=[],O=`${RH(this.formatLeader(!1),this.cfg.withEmoji,this.level.emoji)} `,j=this.formatMeta($,q),z=IH(O,this.level.terminalStyle);return P.push(z),j!==""&&P.push(j),[z,j,...K]}formatLeader($=!0){let q=$?"%c":"",K=" "+CH(this.level.levelName);if(this.cfg.withEmoji)return`${q}${this.formatEmoji($)}${q}${K}`;return`${q}${K}`}formatEmoji($){let q=$?" ":"";return this.level.emoji?`${this.level.emoji}${q}`:""}formatMeta($,q){let K=this.cfg.showTimestamp?`${q} `:"",P=gH($.namespace),_=uH($.label),O=this.formatTime($),j=yH($.label?.count),z=xH($.assertion,this.cfg.withEmoji),J=cH($.if,this.cfg.withEmoji),w=z!==""?z:J!==""?J:"";return K+P+_+O+j+w}formatTime($){let q=this.cfg.withEmoji?"⏱ ":"Time elapsed: ";if($.timeNow)return`(${q}${$.timeNow})`;return $.label?.timeElapsed?`(${q}${$.label.timeElapsed})`:""}}var oH=jO;class t7 extends I8{timestampFormatFunction=($)=>i4($);formatBrowser($,q,K){return this.formatMessage(q,$,K)}formatServer($,q,K){return this.formatMessage(q,$,K)}formatMessage($,q,K){let P="",{appname:_,hostname:O,port:j}=this.cfg.meta,z=m4(j)?`/${j}`:"",J=p4(_)?`${_}${z}`:"",w=p4(O)?` on ${O}: `:"",k=this.formatNamespace(q.namespace),X=q.label?`[${q.label.name}] `:"";return P=`${J}${w}${k}${X}`,[`[${$}] ${this.level.levelName.toUpperCase()}: ${P}${K[0]} `,K.map((G)=>MM(G)?JSON.stringify(G):G).slice(1).join(" ")]}formatNamespace($){if($&&$.length>0)return`${$.reduce((K,P,_)=>{return _===$.length-1?`${K}${P}`:`${K}${P}/`},"")} `;return""}}var GH=["group","groupCollapsed"],DM=["dir","dirxml","table",...GH],VH=["error","warn","info","log","debug",...DM],SH=["clear","groupEnd"],fM=[...DM,...SH],V4$=[...VH,...SH];var P8={activeLevel:"log",cache:!1,cacheSize:300,dump:!1,format:"pretty",meta:{},middleware:[],showTimestamp:!1,silent:!1,withEmoji:!1,levels:{alert:Uo(),error:Fo(),warn:ao(),info:Qo(),fail:eo(),success:so(),log:$n(),debug:qn(),verbose:Kn()},formatters:{default:oH,pretty:oH,standard:t7,common:hM,json:IM}};function Uo($={}){return{levelName:"alert",level:0,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fc8585, #fc2323); color: #fff; border-color: #b70101;",terminalStyle:["white","bold","bgRed"],method:"error",emoji:"\uD83D\uDEA8",...$}}function Fo($={}){return{levelName:"error",level:1,style:"padding-right: 24px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"error",emoji:"\uD83D\uDD25",...$}}function ao($={}){return{levelName:"warn",level:2,style:`font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #fff, #fff0a8); color: #715100; border-color: #e3d696; padding-right: ${JM()?"44px":"30px"};`,terminalStyle:["white","bgYellow"],method:"warn",emoji:"\uD83D\uDD14",...$}}function Qo($={}){return{levelName:"info",level:3,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #d8ebff, #b2d7ff); color: #465464; border-color: #96b5d7;",terminalStyle:["white","bgBlue"],method:"info",emoji:"ℹ️",...$}}function eo($={}){return{levelName:"fail",level:4,style:"padding-right: 44px; font-size: 12px; border-radius: 4px; background: linear-gradient(to right, #ffe8e8, #ffd1d1); color: #a4000f; border-color: #e3bbbb;",terminalStyle:["white","bgRed"],method:"info",emoji:"❌",...$}}function so($={}){return{levelName:"success",level:5,style:"font-size: 12px; border-radius: 4px; padding-right: 22px; background: linear-gradient(to right, #e6f6e4, #ceedc9); color: #4e594d; border-color: #b7d1b3;",terminalStyle:["white","bgGreen"],method:"info",emoji:"\uD83C\uDF89",...$}}function $n($={}){return{levelName:"log",level:6,style:"font-size: 12px; border-radius: 4px; padding-right: 51px; background: linear-gradient(to right, #ecedef, #d9dce0); color: #333435; border-color: #bfc1c5;",terminalStyle:["white","bgBlackBright"],method:"log",emoji:"\uD83E\uDEB5",...$}}function qn($={}){return{levelName:"debug",level:7,style:"font-size: 12px; padding-right: 36px; border-right: 1px solid #d9dce0; color: #465464; border-color: #999999;",terminalStyle:["white","bgBlack"],method:"debug",emoji:"\uD83D\uDC1E",...$}}function Kn($={}){return{levelName:"verbose",level:8,style:"font-size: 12px; padding-right: 22px; color: #999999;",terminalStyle:["black","italic"],method:"debug",emoji:"\uD83D\uDCAC",...$}}class n4{logCfg;glblCfg;constructor($){this.logCfg=$??{},this.glblCfg=globalThis.$adzeGlobal?.configuration}updateConfiguration($){this.logCfg=$}get activeLevel(){return this.glblCfg?.activeLevel??this.logCfg.activeLevel??P8.activeLevel}set activeLevel($){this.logCfg.activeLevel=$}get cache(){return this.glblCfg?.cache??this.logCfg.cache??P8.cache}set cache($){this.logCfg.cache=$}get cacheSize(){return this.glblCfg?.cacheSize??this.logCfg.cacheSize??P8.cacheSize}set cacheSize($){this.logCfg.cacheSize=$}get dump(){return this.glblCfg?.dump??this.logCfg.dump??P8.dump}set dump($){this.logCfg.dump=$}get meta(){return{...this.logCfg.meta,...this.glblCfg?.meta}}set meta($){this.logCfg.meta=$}get silent(){return this.glblCfg?.silent??this.logCfg.silent??P8.silent}set silent($){this.logCfg.silent=$}get showTimestamp(){return this.glblCfg?.showTimestamp??this.logCfg.showTimestamp??P8.showTimestamp}set showTimestamp($){this.logCfg.showTimestamp=$}get withEmoji(){return this.glblCfg?.withEmoji??this.logCfg.withEmoji??P8.withEmoji}set withEmoji($){this.logCfg.withEmoji=$}get format(){return this.glblCfg?.format??this.logCfg.format??P8.format}set format($){this.logCfg.format=$}get levels(){return{...P8.levels,...this.logCfg.levels??{},...this.glblCfg?.levels??{}}}set levels($){this.logCfg.levels=$}get middleware(){return[...this.glblCfg?.middleware??[],...this.logCfg.middleware??[]]}set middleware($){this.logCfg.middleware=$}get filters(){return this.glblCfg?.filters??this.logCfg.filters}set filters($){this.logCfg.filters=$}get timestampFormatter(){return this.glblCfg?.timestampFormatter??this.logCfg.timestampFormatter}set timestampFormatter($){this.logCfg.timestampFormatter=$}get formatters(){return{...P8.formatters,...this.logCfg.formatters??{},...this.glblCfg?.formatters??{}}}set formatters($){this.logCfg.formatters=$}exportValues(){return{activeLevel:this.logCfg.activeLevel,cache:this.logCfg.cache,cacheSize:this.logCfg.cacheSize,dump:this.logCfg.dump,meta:this.logCfg.meta,silent:this.logCfg.silent,showTimestamp:this.logCfg.showTimestamp,withEmoji:this.logCfg.withEmoji,format:this.logCfg.format,levels:this.logCfg.levels,middleware:this.logCfg.middleware,filters:this.logCfg.filters,timestampFormatter:this.logCfg.timestampFormatter,formatters:this.logCfg.formatters}}}function _n($){return typeof $==="function"}class B4{globalStore;_cfg;_modifierData;_data;modifierQueue=[];constructor($,q){this.globalStore=aj($),this._modifierData=q??{},this._cfg=new n4($),this.doHook((K)=>{if(K.constructed)K.constructed(this)})}get data(){return this._data}get modifierData(){return this._modifierData}get configuration(){return this._cfg}alert(...$){this.terminate("alert",$)}static alert(...$){new this().alert(...$)}error(...$){this.terminate("error",$)}static error(...$){new this().error(...$)}warn(...$){this.terminate("warn",$)}static warn(...$){new this().warn(...$)}info(...$){this.terminate("info",$)}static info(...$){new this().info(...$)}fail(...$){this.terminate("fail",$)}static fail(...$){new this().fail(...$)}success(...$){this.terminate("success",$)}static success(...$){new this().success(...$)}log(...$){this.terminate("log",$)}static log($,...q){new this().log(...[$,...q])}debug(...$){this.terminate("debug",$)}static debug(...$){new this().debug(...$)}verbose(...$){this.terminate("verbose",$)}static verbose(...$){new this().verbose(...$)}clear(){console.clear()}static clear(){console.clear()}clr(){console.clear()}static clr(){console.clear()}custom($,...q){if(!this._cfg.levels[$])return console.warn(Error("Custom log level not found in configuration.")),this;return this.terminate($,q),this}static custom($,...q){return new this().custom($,...q)}seal($){if($)this._cfg.updateConfiguration($);return lH(B4,this._cfg,this.modifierData,this.modifierQueue)}static seal($){return new this().seal($)}sealTag($,q){return this._cfg=new n4({...this._cfg.exportValues(),...q}),(K,...P)=>{let _=String.raw({raw:K},...P),O=lH(B4,this._cfg,this.modifierData,this.modifierQueue),j=$;if(_n(O[j]))O[j](_)}}static sealTag($,q){return new this().sealTag($,q)}thread($,q){if(this.runModifierQueue(),this._modifierData.label){if(!this._modifierData.label.context)this._modifierData.label.context={};this._modifierData.label.context={...this._modifierData.label.context,[$]:q}}}static thread($,q){new this().thread($,q)}assert($){return this.modifierQueue.push(["assert",(q)=>{return q.assertion=$,q}]),this}static assert($){return new this().assert($)}get closeThread(){return this.modifierQueue.push(["closeThread",($)=>{if($.label?.context)$.label.context=void 0;return $}]),this}static get closeThread(){return new this().closeThread}get count(){return this.modifierQueue.push(["count",($)=>{if($.label)$.label.count=$.label.count!==void 0?$.label.count+1:1;return $}]),this}static get count(){return new this().count}get countClear(){return this.modifierQueue.push(["countClear",($)=>{if($.label)delete $.label.count;return $}]),this}static get countClear(){return new this().countClear}get countReset(){return this.modifierQueue.push(["countReset",($)=>{if($.label)$.label.count=0;return $}]),this}static get countReset(){return new this().countReset}get dir(){return this.modifierQueue.push(["dir",($)=>{return $.method="dir",$}]),this}static get dir(){return new this().dir}get dirxml(){return this.modifierQueue.push(["dirxml",($)=>{return $.method="dirxml",$}]),this}static get dirxml(){return new this().dirxml}get dump(){return this.modifierQueue.push(["dump",($,q)=>{return q._cfg.dump=!0,$}]),this}static get dump(){return new this().dump}format($){return this.modifierQueue.push(["format",(q,K)=>{if(Object.keys(K._cfg.formatters).includes($))return K._cfg.format=$,q;return console.warn(Error(`Adze: Formatter "${$}" not found in configuration.`)),q}]),this}static format($){return new this().format($)}get group(){return this.modifierQueue.push(["group",($)=>{return $.method="group",$}]),this}static get group(){return new this().group}get groupCollapsed(){return this.modifierQueue.push(["groupCollapsed",($)=>{return $.method="groupCollapsed",$}]),this}static get groupCollapsed(){return new this().groupCollapsed}get groupEnd(){return this.modifierQueue.push(["groupEnd",($)=>{return $.method="groupEnd",$}]),this}static get groupEnd(){return new this().groupEnd}if($){return this.modifierQueue.push(["if",(q)=>{return q.if=$,q}]),this}static if($){return new this().if($)}test($){return this.if($)}static test($){return new this().if($)}label($){return this.modifierQueue.unshift(["label",(q)=>{let K=this.globalStore.getLabel($)??{name:$};return q.label=K,this.globalStore.setLabel($,K),q}]),this}static label($){return new this().label($)}meta($){return this.modifierQueue.push(["meta",(q,K)=>{return K._cfg.meta={...K._cfg.meta,...$},q}]),this}static meta($){return new this().meta($)}namespace(...$){return this.modifierQueue.push(["namespace",(q)=>{let K=q.namespace??[];return q.namespace=K.length>0?[...K,...$]:$,q}]),this}static namespace(...$){return new this().namespace(...$)}ns(...$){return this.namespace(...$)}static ns(...$){return new this().namespace(...$)}get silent(){return this.modifierQueue.push(["silent",($,q)=>{return q._cfg.silent=!0,$}]),this}static get silent(){return new this().silent}get table(){return this.modifierQueue.push(["table",($)=>{return $.method="table",$}]),this}static get table(){return new this().table}get time(){return this.modifierQueue.push(["time",($)=>{let q=KO();if($.label)$.label.timeStart=q;return $}]),this}static get time(){return new this().time}get timeEnd(){return this.modifierQueue.push(["timeEnd",($)=>{if($.label?.timeStart)$.label.timeElapsed=rH(KO($.label.timeStart));return $}]),this}static get timeEnd(){return new this().timeEnd}get timeNow(){return this.modifierQueue.push(["timeNow",($)=>{return $.timeNow=CM(),$}]),this}static get timeNow(){return new this().timeNow}get timestamp(){return this.modifierQueue.push(["timestamp",($,q)=>{return q._cfg.showTimestamp=!0,$}]),this}static get timestamp(){return new this().timestamp}get trace(){return this.modifierQueue.push(["trace",($)=>{return $.stacktrace=XM(),$}]),this}static get trace(){return new this().trace}get withEmoji(){return this.modifierQueue.push(["withEmoji",($,q)=>{return q._cfg.withEmoji=!0,$}]),this}static get withEmoji(){return new this().withEmoji}print($){if(HM())return;if($.silent)return;if($.message.length<1)return;if(Qj($.method))console[$.method](...$.message);else console[$.method]()}terminate($,q){this.doHook((I)=>{if(I.beforeTerminated)I.beforeTerminated(this,$,q)}),this.runModifierQueue();let K=this.getLevelConfig($),_=new(this.selectFormatter(this._cfg.format))(this._cfg,K),O=_.timestampFormatter(new Date),j=SM(_.print(this.modifierData,O,q));if(this._cfg.dump&&this.modifierData.label?.context)j.push(this.modifierData.label.context);this.doHook((I)=>{if(I.beforeFormatApplied)j=I.beforeFormatApplied(this,this._cfg.format,j)});let{activeLevel:z,cache:J,cacheSize:w,dump:k,format:X,meta:G,showTimestamp:V,silent:C,withEmoji:E}=this._cfg,h={activeLevel:z,cache:J,cacheSize:w,dump:k,format:X,meta:G,showTimestamp:V,silent:C,withEmoji:E,...K,...this._modifierData,terminator:$,args:q,timestamp:O,message:j};if(this.doHook((I)=>{if(I.afterFormatApplied)I.afterFormatApplied(this,this._cfg.format,j)}),this._data=h,this._cfg.cache)this.globalStore.addLogToCache(this);this.doHook((I)=>{if(I.beforePrint)I.beforePrint(this)}),this.print(this._data),this.doHook((I)=>{if(I.afterTerminated)I.afterTerminated(this,$,q)}),this.globalStore.getListeners(K.level).forEach((I)=>{I(this)})}selectFormatter($){return this._cfg.formatters[$]}getLevelConfig($){return this._cfg.levels[$]}runModifierQueue(){this.modifierQueue.forEach(([$,q])=>{let K=q(this.modifierData,this);this.doHook((P)=>{if(P.beforeModifierApplied)P.beforeModifierApplied(this,$,K)}),this._modifierData=K,this.doHook((P)=>{if(P.afterModifierApplied)P.afterModifierApplied(this,$,K)})})}doHook($){this._cfg.middleware?.forEach((q)=>{$(q)})}}class Pn{targetEnvironment;environment=MK()?"browser":"server";dependencyLoaders=[];constructor($){if(this.targetEnvironment=$??"both",!MK()&&(this.targetEnvironment==="server"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadServerDependencies());if(MK()&&(this.targetEnvironment==="browser"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadBrowserDependencies())}async load(){await Promise.all(this.dependencyLoaders)}async loadServerDependencies(){}async loadBrowserDependencies(){}}var jn=["black","red","green","yellow","blue","magenta","cyan","white","gray","blackBright","redBright","greenBright","yellowBright","blueBright","magentaBright","cyanBright","whiteBright","bgBlack","bgRed","bgGreen","bgYellow","bgBlue","bgMagenta","bgCyan","bgWhite","bgBlackBright","bgRedBright","bgGreenBright","bgYellowBright","bgBlueBright","bgMagentaBright","bgCyanBright","bgWhiteBright","reset","bold","dim","italic","underline","inverse","hidden","strikethrough"],LM=Object.freeze(jn);var bM=B4;var U4$={__noop:()=>{}},OO={trace:10,verbose:10,debug:20,success:27,progress:28,log:29,info:30,warn:40,error:50,fatal:60,alert:60},On={10:"trace",20:"debug",27:"success",28:"progress",29:"log",30:"info",40:"warn",50:"error",60:"fatal"};function gM($,q){let K=OO[$.toLowerCase()]||30,P=OO[q.toLowerCase()]||30;return K>=P}function nH($){try{let q=new WeakSet;return JSON.stringify($,(K,P)=>{if(typeof P==="object"&&P!==null){if(q.has(P))return"[Circular]";q.add(P)}return P})}catch{return String($)}}function uM($){if(!$)return!1;let q=$.toLowerCase().trim();return q==="true"||q==="1"||q==="yes"||q==="on"}var Yn="info",YO=VK("LOG_LEVEL")||Yn,Q4$={fatal:60,error:50,warn:40,info:30,log:29,progress:28,success:27,debug:20,trace:10},iH=uM(VK("LOG_JSON_FORMAT")),BH=uM(VK("LOG_TIMESTAMPS")??"true");function vn($=100){let q=[];return{write(K){if(q.push(K),q.length>$)q.shift()},clear(){q.length=0},recentLogs(){return q.map((K)=>{let P=BH?new Date(K.time).toISOString():"",_=On[K.level??30]||"info";return`${P} ${_} ${K.msg}`.trim()}).join(`
334
- `)}}}var U7=vn(),yM=()=>{let $=YO.toLowerCase();if($==="trace")return"verbose";if($==="debug")return"debug";if($==="log")return"log";if($==="info")return"info";if($==="warn")return"warn";if($==="error")return"error";if($==="fatal")return"alert";return"info"},zn=yM(),xM={alert:{levelName:"alert",level:0,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","white","bold"],method:"error",emoji:""},error:{levelName:"error",level:1,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","whiteBright","bold"],method:"error",emoji:""},warn:{levelName:"warn",level:2,style:"font-size: 12px; color: #ffaa00;",terminalStyle:["bgYellow","black","bold"],method:"warn",emoji:""},info:{levelName:"info",level:3,style:"font-size: 12px; color: #0099ff;",terminalStyle:["cyan"],method:"info",emoji:""},fail:{levelName:"fail",level:4,style:"font-size: 12px; color: #ff6600;",terminalStyle:["red","underline"],method:"error",emoji:""},success:{levelName:"success",level:5,style:"font-size: 12px; color: #00cc00;",terminalStyle:["green"],method:"log",emoji:""},log:{levelName:"log",level:6,style:"font-size: 12px; color: #888888;",terminalStyle:["white"],method:"log",emoji:""},debug:{levelName:"debug",level:7,style:"font-size: 12px; color: #9b59b6;",terminalStyle:["gray","dim"],method:"debug",emoji:""},verbose:{levelName:"verbose",level:8,style:"font-size: 12px; color: #666666;",terminalStyle:["gray","dim","italic"],method:"debug",emoji:""}},Wn=kH({activeLevel:zn,format:iH?"json":"pretty",timestampFormatter:BH?void 0:()=>"",withEmoji:!1,levels:xM});Wn.addListener("*",($)=>{try{let q=$.data,K=Array.isArray(q?.message)?q.message.map((_)=>typeof _==="string"?_:nH(_)).join(" "):typeof q?.message==="string"?q.message:"",P={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:K};U7.write(P)}catch{}});function Hn($){let q=bM,K=[];if(typeof $.namespace==="string")K.push($.namespace);if(Array.isArray($.namespaces))K.push(...$.namespaces);if(K.length>0)q=q.ns(...K);let P={...$};if(delete P.namespace,delete P.namespaces,iH){if(!P.name)P.name="elizaos";if(!P.hostname){let O="unknown";if(typeof process<"u"&&process.platform)try{O=(gW(),W6(bW)).hostname()}catch{O="localhost"}else if(typeof window<"u"&&window.location)O=window.location.hostname||"browser";P.hostname=O}}let _={activeLevel:yM(),format:iH?"json":"pretty",timestampFormatter:BH?void 0:()=>"",withEmoji:!1,levels:xM};return q.meta(P).seal(_)}function Jn($){let q=YO,K={},P;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")P=$.maxMemoryLogs;let{level:_,maxMemoryLogs:O,...j}=$;K=j}return{level:q,base:K,maxMemoryLogs:P}}function F7($=!1){let{level:q,base:K,maxMemoryLogs:P}=Jn($);if(typeof P==="number"&&P>0)U7.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let m=(typeof q==="number"?"info":q||YO).toLowerCase(),s=(...o)=>{return o.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return nH(M)}).join(" ")},U=(o,...M)=>{if(!gM(o,m))return;let Y=s(...M),H=o==="fatal"?"error":o==="trace"||o==="verbose"?"debug":o==="success"||o==="progress"?"info":o==="log"?"log":console[o]?o:"log";if(typeof console[H]==="function")console[H](Y)},l=(o,M,...Y)=>{if(typeof o==="string")return M!==void 0?[o,M,...Y]:[o,...Y];if(o instanceof Error)return M!==void 0?[o.message,M,...Y]:[o.message,...Y];if(M!==void 0)return[M,o,...Y];return[o,...Y]};return{level:m,trace:(o,M,...Y)=>U("trace",...l(o,M,...Y)),debug:(o,M,...Y)=>U("debug",...l(o,M,...Y)),info:(o,M,...Y)=>U("info",...l(o,M,...Y)),warn:(o,M,...Y)=>U("warn",...l(o,M,...Y)),error:(o,M,...Y)=>U("error",...l(o,M,...Y)),fatal:(o,M,...Y)=>U("fatal",...l(o,M,...Y)),success:(o,M,...Y)=>U("success",...l(o,M,...Y)),progress:(o,M,...Y)=>U("progress",...l(o,M,...Y)),log:(o,M,...Y)=>U("log",...l(o,M,...Y)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(o)=>F7({level:m,...K,...o,__forceType:"browser"})}}let O=Hn(K),z=(typeof q==="number"?"info":q||YO).toLowerCase(),J=(p,m)=>{},w=(p,...m)=>{if(!gM(p,z))return;J(p,m);try{let l="";if(m.length>0)l=m.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return nH(M)}).join(" ");if(K.namespace)l=`#${K.namespace} ${l}`;let o={time:Date.now(),level:OO[p.toLowerCase()]||OO.info,msg:l};U7.write(o)}catch{}let s=p,U=m;if(p==="fatal")s="alert";else if(p==="progress")s="info",U=["[PROGRESS]",...m];else if(p==="success")s="info",U=["[SUCCESS]",...m];else if(p==="trace")s="verbose";try{O[s](...U)}catch(l){console.log(`[${p.toUpperCase()}]`,...m)}},k=(p,m,...s)=>{if(typeof p==="string")return m!==void 0?[p,m,...s]:[p,...s];if(p instanceof Error)return m!==void 0?[p.message,{error:p},m,...s]:[p.message,{error:p},...s];if(m!==void 0)return[m,p,...s];return[p,...s]};return{level:z,trace:(p,m,...s)=>w("verbose",...k(p,m,...s)),debug:(p,m,...s)=>w("debug",...k(p,m,...s)),info:(p,m,...s)=>w("info",...k(p,m,...s)),warn:(p,m,...s)=>w("warn",...k(p,m,...s)),error:(p,m,...s)=>w("error",...k(p,m,...s)),fatal:(p,m,...s)=>w("fatal",...k(p,m,...s)),success:(p,m,...s)=>w("success",...k(p,m,...s)),progress:(p,m,...s)=>w("progress",...k(p,m,...s)),log:(p,m,...s)=>w("log",...k(p,m,...s)),clear:()=>{try{if(typeof console?.clear==="function")console.clear()}catch{}U7.clear()},child:(p)=>{return F7({level:z,...K,...p})}}}var j6=F7(),e4$=j6,s4$=()=>U7.recentLogs();var a8=j6;SK();function pM($){return $.replace(/(?<!{){{(?![{#\/!>])([\s\S]*?)}}/g,(q,K)=>{if(K.trim()==="else")return`{{${K}}}`;return`{{{${K}}}}`})}var mM=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=tH.default.compile(pM(K));return dM(P($),10)},a7=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=tH.default.compile(pM(K)),j=Object.keys($).filter((J)=>!["text","values","data"].includes(J)).reduce((J,w)=>{return J[w]=$[w],J},{});return dM(P({...j,...$.values}),10)},vP$=($,q)=>{return q.length>0?`${$?`${$}
334
+ `)}}}var U7=vn(),yM=()=>{let $=YO.toLowerCase();if($==="trace")return"verbose";if($==="debug")return"debug";if($==="log")return"log";if($==="info")return"info";if($==="warn")return"warn";if($==="error")return"error";if($==="fatal")return"alert";return"info"},zn=yM(),xM={alert:{levelName:"alert",level:0,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","white","bold"],method:"error",emoji:""},error:{levelName:"error",level:1,style:"font-size: 12px; color: #ff0000;",terminalStyle:["bgRed","whiteBright","bold"],method:"error",emoji:""},warn:{levelName:"warn",level:2,style:"font-size: 12px; color: #ffaa00;",terminalStyle:["bgYellow","black","bold"],method:"warn",emoji:""},info:{levelName:"info",level:3,style:"font-size: 12px; color: #0099ff;",terminalStyle:["cyan"],method:"info",emoji:""},fail:{levelName:"fail",level:4,style:"font-size: 12px; color: #ff6600;",terminalStyle:["red","underline"],method:"error",emoji:""},success:{levelName:"success",level:5,style:"font-size: 12px; color: #00cc00;",terminalStyle:["green"],method:"log",emoji:""},log:{levelName:"log",level:6,style:"font-size: 12px; color: #888888;",terminalStyle:["white"],method:"log",emoji:""},debug:{levelName:"debug",level:7,style:"font-size: 12px; color: #9b59b6;",terminalStyle:["gray","dim"],method:"debug",emoji:""},verbose:{levelName:"verbose",level:8,style:"font-size: 12px; color: #666666;",terminalStyle:["gray","dim","italic"],method:"debug",emoji:""}},Wn=kH({activeLevel:zn,format:iH?"json":"pretty",timestampFormatter:BH?void 0:()=>"",withEmoji:!1,levels:xM});Wn.addListener("*",($)=>{try{let q=$.data,K=Array.isArray(q?.message)?q.message.map((_)=>typeof _==="string"?_:nH(_)).join(" "):typeof q?.message==="string"?q.message:"",P={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:K};U7.write(P)}catch{}});function Hn($){let q=bM,K=[];if(typeof $.namespace==="string")K.push($.namespace);if(Array.isArray($.namespaces))K.push(...$.namespaces);if(K.length>0)q=q.ns(...K);let P={...$};if(delete P.namespace,delete P.namespaces,iH){if(!P.name)P.name="elizaos";if(!P.hostname){let O="unknown";if(typeof process<"u"&&process.platform)try{O=(gW(),W6(bW)).hostname()}catch{O="localhost"}else if(typeof window<"u"&&window.location)O=window.location.hostname||"browser";P.hostname=O}}let _={activeLevel:yM(),format:iH?"json":"pretty",timestampFormatter:BH?void 0:()=>"",withEmoji:!1,levels:xM};return q.meta(P).seal(_)}function Jn($){let q=YO,K={},P;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")P=$.maxMemoryLogs;let{level:_,maxMemoryLogs:O,...j}=$;K=j}return{level:q,base:K,maxMemoryLogs:P}}function F7($=!1){let{level:q,base:K,maxMemoryLogs:P}=Jn($);if(typeof P==="number"&&P>0)U7.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let l=(typeof q==="number"?"info":q||YO).toLowerCase(),Q=(...o)=>{return o.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return nH(M)}).join(" ")},e=(o,...M)=>{if(!gM(o,l))return;let Y=Q(...M),H=o==="fatal"?"error":o==="trace"||o==="verbose"?"debug":o==="success"||o==="progress"?"info":o==="log"?"log":console[o]?o:"log";if(typeof console[H]==="function")console[H](Y)},m=(o,M,...Y)=>{if(typeof o==="string")return M!==void 0?[o,M,...Y]:[o,...Y];if(o instanceof Error)return M!==void 0?[o.message,M,...Y]:[o.message,...Y];if(M!==void 0)return[M,o,...Y];return[o,...Y]};return{level:l,trace:(o,M,...Y)=>e("trace",...m(o,M,...Y)),debug:(o,M,...Y)=>e("debug",...m(o,M,...Y)),info:(o,M,...Y)=>e("info",...m(o,M,...Y)),warn:(o,M,...Y)=>e("warn",...m(o,M,...Y)),error:(o,M,...Y)=>e("error",...m(o,M,...Y)),fatal:(o,M,...Y)=>e("fatal",...m(o,M,...Y)),success:(o,M,...Y)=>e("success",...m(o,M,...Y)),progress:(o,M,...Y)=>e("progress",...m(o,M,...Y)),log:(o,M,...Y)=>e("log",...m(o,M,...Y)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(o)=>F7({level:l,...K,...o,__forceType:"browser"})}}let O=Hn(K),z=(typeof q==="number"?"info":q||YO).toLowerCase(),J=(p,l)=>{},w=(p,...l)=>{if(!gM(p,z))return;J(p,l);try{let m="";if(l.length>0)m=l.map((M)=>{if(typeof M==="string")return M;if(M instanceof Error)return M.message;return nH(M)}).join(" ");if(K.namespace)m=`#${K.namespace} ${m}`;let o={time:Date.now(),level:OO[p.toLowerCase()]||OO.info,msg:m};U7.write(o)}catch{}let Q=p,e=l;if(p==="fatal")Q="alert";else if(p==="progress")Q="info",e=["[PROGRESS]",...l];else if(p==="success")Q="info",e=["[SUCCESS]",...l];else if(p==="trace")Q="verbose";try{O[Q](...e)}catch(m){console.log(`[${p.toUpperCase()}]`,...l)}},k=(p,l,...Q)=>{if(typeof p==="string")return l!==void 0?[p,l,...Q]:[p,...Q];if(p instanceof Error)return l!==void 0?[p.message,{error:p},l,...Q]:[p.message,{error:p},...Q];if(l!==void 0)return[l,p,...Q];return[p,...Q]};return{level:z,trace:(p,l,...Q)=>w("verbose",...k(p,l,...Q)),debug:(p,l,...Q)=>w("debug",...k(p,l,...Q)),info:(p,l,...Q)=>w("info",...k(p,l,...Q)),warn:(p,l,...Q)=>w("warn",...k(p,l,...Q)),error:(p,l,...Q)=>w("error",...k(p,l,...Q)),fatal:(p,l,...Q)=>w("fatal",...k(p,l,...Q)),success:(p,l,...Q)=>w("success",...k(p,l,...Q)),progress:(p,l,...Q)=>w("progress",...k(p,l,...Q)),log:(p,l,...Q)=>w("log",...k(p,l,...Q)),clear:()=>{try{if(typeof console?.clear==="function")console.clear()}catch{}U7.clear()},child:(p)=>{return F7({level:z,...K,...p})}}}var j6=F7(),e4$=j6,s4$=()=>U7.recentLogs();var a8=j6;SK();function pM($){return $.replace(/(?<!{){{(?![{#\/!>])([\s\S]*?)}}/g,(q,K)=>{if(K.trim()==="else")return`{{${K}}}`;return`{{{${K}}}}`})}var mM=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=tH.default.compile(pM(K));return dM(P($),10)},a7=({state:$,template:q})=>{let K=typeof q==="function"?q({state:$}):q,P=tH.default.compile(pM(K)),j=Object.keys($).filter((J)=>!["text","values","data"].includes(J)).reduce((J,w)=>{return J[w]=$[w],J},{});return dM(P({...j,...$.values}),10)},vP$=($,q)=>{return q.length>0?`${$?`${$}
335
335
  `:$}${q}
336
336
  `:""},dM=($,q)=>{let K=Array.from({length:q},()=>Dj({dictionaries:[Lj]})),P=$;for(let _=0;_<K.length;_++)P=P.replaceAll(`{{name${_+1}}}`,K[_]);return P},zP$=({messages:$,entities:q,conversationHeader:K=!0})=>{let P={};return $.forEach((j)=>{if(j.roomId){if(!P[j.roomId])P[j.roomId]=[];P[j.roomId].push(j)}}),Object.values(P).forEach((j)=>{j.sort((z,J)=>(z.createdAt||0)-(J.createdAt||0))}),Object.entries(P).sort(([,j],[,z])=>(z[z.length-1]?.createdAt||0)-(j[j.length-1]?.createdAt||0)).map(([j,z])=>{let J=z.filter((k)=>k.entityId).map((k)=>{let X=q.find((C)=>C.id===k.entityId);if(!X)a8.warn({entityId:k.entityId},"core::prompts:formatPosts - no entity for");let G=X?.names[0]||"Unknown User",V=X?.names[0]||"unknown";return`Name: ${G} (@${V} EntityID:${k.entityId})
337
337
  MessageID: ${k.id}${k.content.inReplyTo?`
@@ -348,7 +348,7 @@ ${k.content.text}`});return`${K?`Conversation: ${j.slice(-5)}
348
348
  `)}).join(J.every((u)=>!u.text&&!u.description)?", ":`
349
349
  `)})`:null,k=new Date(P.createdAt||0),X=k.getHours().toString().padStart(2,"0"),G=k.getMinutes().toString().padStart(2,"0"),V=`${X}:${G}`,C=lM(P.createdAt||0),E=j?`(${z}'s internal thought: ${j})`:null,h=`${V} (${C}) [${P.entityId}]`,I=_?`${h} ${z}: ${_}`:null,D=O&&O.length>0?`${I?"":h} (${z}'s actions: ${O.join(", ")})`:null;return[I,E,D,w].filter(Boolean).join(`
350
350
  `)}).join(`
351
- `)},lM=($)=>{let K=new Date().getTime()-$,P=Math.abs(K),_=Math.floor(P/1000),O=Math.floor(_/60),j=Math.floor(O/60),z=Math.floor(j/24);if(P<60000)return"just now";if(O<60)return`${O} minute${O!==1?"s":""} ago`;if(j<24)return`${j} hour${j!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},Tn=/```json\n([\s\S]*?)\n```/;function UK($){if(!$)return null;let q=$.match(/<response>([\s\S]*?)<\/response>/),K;if(q)K=q[1],a8.debug("Found response XML block");else{let z=((J)=>{let w=0,k=J.length;while(w<k){let X=J.indexOf("<",w);if(X===-1)break;if(J.startsWith("</",X)||J.startsWith("<!--",X)||J.startsWith("<?",X)){w=X+1;continue}let G=X+1,V="";while(G<k){let g=J[G];if(/^[A-Za-z0-9_-]$/.test(g)){V+=g,G++;continue}break}if(!V){w=X+1;continue}let C=J.indexOf(">",G);if(C===-1)break;let E=J.slice(X,C+1);if(/\/\s*>$/.test(E)){w=C+1;continue}let h=`</${V}>`,I=1,D=C+1;while(I>0&&D<k){let g=J.indexOf(`<${V}`,D),u=J.indexOf(h,D);if(u===-1)break;if(g!==-1&&g<u){let y=J.indexOf(">",g+1);if(y===-1)break;let p=J.slice(g,y+1);if(/\/\s*>$/.test(p))D=y+1;else I++,D=y+1}else I--,D=u+h.length}if(I===0){let g=D-h.length,u=J.slice(C+1,g);return{tag:V,content:u}}w=C+1}return null})($);if(!z)return a8.warn("Could not find XML block in text"),a8.debug({textPreview:$.substring(0,200)+"..."},"Text content"),null;K=z.content,a8.debug(`Found XML block with tag: ${z.tag}`)}let P={},O=((j)=>{let z=[],J=j.length,w=0;while(w<J){let k=j.indexOf("<",w);if(k===-1)break;if(j.startsWith("</",k)||j.startsWith("<!--",k)||j.startsWith("<?",k)){w=k+1;continue}let X=k+1,G="";while(X<J){let y=j[X];if(/^[A-Za-z0-9_-]$/.test(y)){G+=y,X++;continue}break}if(!G){w=k+1;continue}let V=j.indexOf(">",X);if(V===-1)break;let C=j.slice(k,V+1);if(/\/\s*>$/.test(C)){w=V+1;continue}let E=`</${G}>`,h=1,I=V+1;while(h>0&&I<J){let y=j.indexOf(`<${G}`,I),p=j.indexOf(E,I);if(p===-1)break;if(y!==-1&&y<p){let m=j.indexOf(">",y+1);if(m===-1)break;let s=j.slice(y,m+1);if(!/\/\s*>$/.test(s))h++;I=m+1}else h--,I=p+E.length}if(h!==0){w=V+1;continue}let D=I-E.length,u=j.slice(V+1,D).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'").trim();z.push({key:G,value:u}),w=I}return z})(K);for(let{key:j,value:z}of O)if(j==="actions"||j==="providers"||j==="evaluators")P[j]=z?z.split(",").map((J)=>J.trim()):[];else if(j==="simple")P[j]=z.toLowerCase()==="true";else P[j]=z;if(Object.keys(P).length===0)return a8.warn("No key-value pairs extracted from XML content"),a8.debug({xmlPreview:K.substring(0,200)+"..."},"XML content was"),null;return P}function HP$($){let q=null,K=$.match(Tn);try{if(K)q=JSON.parse(cM(K[1].trim()));else q=JSON.parse(cM($.trim()))}catch(P){return null}if(q&&typeof q==="object"&&!Array.isArray(q))return q;return null}var cM=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,K,P)=>`"${K}": "${P}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function rM($,q){if($.length<=q)return $;let K=$.lastIndexOf(".",q-1);if(K!==-1){let O=$.slice(0,K+1).trim();if(O.length>0)return O}let P=$.lastIndexOf(" ",q-1);if(P!==-1){let O=$.slice(0,P).trim();if(O.length>0)return`${O}...`}return`${$.slice(0,q-3).trim()}...`}async function JP$($,q=512,K=20){a8.debug("[splitChunks] Starting text split");let P=3.5,O=await new k7({chunkSize:Number(Math.floor(q*P)),chunkOverlap:Number(Math.floor(K*P))}).splitText($);return a8.debug({numberOfChunks:O.length,averageChunkSize:O.reduce((j,z)=>j+z.length,0)/O.length},"[splitChunks] Split complete"),O}async function TP$($,q,K){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let P=await K.useModel(I6.TEXT_TOKENIZER_ENCODE,{prompt:$});if(P.length<=q)return $;let _=P.slice(-q);return await K.useModel(I6.TEXT_TOKENIZER_DECODE,{tokens:_})}function UH(){let $=new WeakSet;return function(q,K){if(typeof K==="object"&&K!==null){if($.has(K))return"[Circular]";$.add(K)}return K}}function zO($){if(!$)return!1;if(typeof $==="boolean")return $;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],K=["NO","N","FALSE","F","0","OFF","DISABLE"],P=$.trim().toUpperCase();if(q.includes(P))return!0;if(K.includes(P))return!1;return!1}var wn=n$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format");function Zn($){let q=wn.safeParse($);return q.success?q.data:null}function WO($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=Zn($);if(q)return q;let K=encodeURIComponent($),_=fn(K).slice(0,16);return _[8]=_[8]&63|128,_[6]=_[6]&15|0,kn(_)}async function wP$($){if(!FH())return;let q=$.map(async(K)=>{let P=encodeURIComponent(K),_=await oM(P);g_.set(P,_)});await Promise.all(q)}var g_=new Map,vO=null;function FH(){if(vO!==null)return vO;try{if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return vO=!0,!0}catch{}return vO=!1,!1}function fn($){let q=g_.get($);if(q)return q;let K=nM($);if(g_.set($,K),FH())oM($).then((P)=>{g_.set($,P)}).catch(()=>{});if(g_.size>1e4)Array.from(g_.keys()).slice(0,5000).forEach((_)=>g_.delete(_));return K}async function oM($){if(FH())try{let K=new TextEncoder().encode($),P=await globalThis.crypto.subtle.digest("SHA-1",K);return new Uint8Array(P)}catch{}return nM($)}function nM($){let q=Xn($),K=q.length,P=new Uint8Array(K+9+63>>>6<<6);P.set(q),P[K]=128;let _=K*8,O=new DataView(P.buffer);O.setUint32(P.length-4,_>>>0,!1),O.setUint32(P.length-8,Math.floor(_/4294967296)>>>0,!1);let j=1732584193,z=4023233417,J=2562383102,w=271733878,k=3285377520,X=new Uint32Array(80);for(let C=0;C<P.length;C+=64){for(let u=0;u<16;u++)X[u]=O.getUint32(C+u*4,!1);for(let u=16;u<80;u++){let y=X[u-3]^X[u-8]^X[u-14]^X[u-16];X[u]=y<<1|y>>>31}let E=j,h=z,I=J,D=w,g=k;for(let u=0;u<80;u++){let y,p;if(u<20)y=h&I|~h&D,p=1518500249;else if(u<40)y=h^I^D,p=1859775393;else if(u<60)y=h&I|h&D|I&D,p=2400959708;else y=h^I^D,p=3395469782;let m=(E<<5|E>>>27)+y+g+p+X[u]>>>0;g=D,D=I,I=(h<<30|h>>>2)>>>0,h=E,E=m}j=j+E>>>0,z=z+h>>>0,J=J+I>>>0,w=w+D>>>0,k=k+g>>>0}let G=new Uint8Array(20),V=new DataView(G.buffer);return V.setUint32(0,j,!1),V.setUint32(4,z,!1),V.setUint32(8,J,!1),V.setUint32(12,w,!1),V.setUint32(16,k,!1),G}function Xn($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let K=0;K<$.length;K++){let P=$.charCodeAt(K);if(P<128)q.push(P);else if(P<2048)q.push(192|P>>6,128|P&63);else if(P<55296||P>=57344)q.push(224|P>>12,128|P>>6&63,128|P&63);else{K++;let _=65536+((P&1023)<<10|$.charCodeAt(K)&1023);q.push(240|_>>18,128|_>>12&63,128|_>>6&63,128|_&63)}}return new Uint8Array(q)}function kn($){let q=[];for(let K=0;K<$.length;K++){let P=$[K].toString(16).padStart(2,"0");q.push(P)}return q.slice(0,4).join("")+"-"+q.slice(4,6).join("")+"-"+q.slice(6,8).join("")+"-"+q.slice(8,10).join("")+"-"+q.slice(10,16).join("")}var ZP$=($)=>{if($.startsWith("image/"))return"image";if($.startsWith("video/"))return"video";if($.startsWith("audio/"))return"audio";if($.includes("pdf")||$.includes("document")||$.startsWith("text/"))return"document";return};function iM($){return`http://localhost:${VK("SERVER_PORT","3000")}${$}`}var BM=n$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format").describe("Unique identifier for the character in UUID format"),An=n$.object({id:n$.string().describe("Unique identifier for the media"),url:n$.string().describe("URL of the media file"),title:n$.string().optional().describe("Media title"),source:n$.string().optional().describe("Media source"),description:n$.string().optional().describe("Media description"),text:n$.string().optional().describe("Text content associated with the media"),contentType:n$.nativeEnum(F4).optional().describe("Type of media content")}).loose().describe("Media attachment with URL and metadata"),Gn=n$.object({text:n$.string().optional().describe("The main text content of the message"),thought:n$.string().optional().describe("Internal thought process or reasoning"),actions:n$.array(n$.string()).optional().describe("Actions to be taken in response"),providers:n$.array(n$.string()).optional().describe("Data providers to use (e.g., KNOWLEDGE)"),source:n$.string().optional().describe("Source of the content"),target:n$.string().optional().describe("Target of the content"),url:n$.string().optional().describe("Related URL"),inReplyTo:BM.optional().describe("UUID of message this is replying to"),attachments:n$.array(An).optional().describe("Array of media attachments (images, videos, documents, etc.)"),channelType:n$.enum(a4).optional().describe("Type of channel this content is for")}).catchall(n$.unknown()).describe("Content structure for messages in conversation examples"),Vn=n$.object({name:n$.string().describe("Name of the speaker (can use {{name1}} placeholder for dynamic names)"),content:Gn}).describe("A single message in a conversation example"),Sn=n$.object({directory:n$.string().describe("Path to a directory containing knowledge files"),shared:n$.boolean().optional().describe("Whether this knowledge is shared across characters")}).describe("Directory-based knowledge source"),Mn=n$.union([n$.string().describe("File path to a knowledge document"),n$.object({path:n$.string().describe("Path to a knowledge file"),shared:n$.boolean().optional().describe("Whether this knowledge is shared across characters")}),Sn]).describe("Knowledge source - can be a file path, file object, or directory"),Nn=n$.union([n$.string().describe("Template string with placeholders"),n$.function().optional()]).describe("Template for generating text - can be a string template or function"),Cn=n$.object({all:n$.array(n$.string()).optional().describe("Style guidelines applied to all types of responses"),chat:n$.array(n$.string()).optional().describe("Style guidelines specific to chat/conversation responses"),post:n$.array(n$.string()).optional().describe("Style guidelines specific to social media posts")}).optional().describe("Style configuration defining how the character communicates across different contexts"),En=n$.record(n$.string(),n$.union([n$.string(),n$.boolean(),n$.number(),n$.object({}).loose(),n$.array(n$.any())])).optional().describe("Character-specific settings like avatar URL, preferences, and configuration"),hn=n$.record(n$.string(),n$.union([n$.string(),n$.boolean(),n$.number()])).optional().describe("Secret values and API keys (should not be committed to version control)"),Rn=n$.object({id:BM.optional().describe("Unique identifier for the character"),name:n$.string().min(1,"Character name is required").describe('The name of the character (e.g., "Eliza")'),username:n$.string().optional().describe("Username for the character on various platforms"),system:n$.string().optional().describe("System prompt that defines the character's core behavior and response style"),templates:n$.record(n$.string(),Nn).optional().describe("Custom templates for generating different types of content"),bio:n$.union([n$.string(),n$.array(n$.string())]).describe("Character biography - can be a single string or array of biographical points"),messageExamples:n$.array(n$.array(Vn)).optional().describe("Example conversations showing how the character responds in different scenarios"),postExamples:n$.array(n$.string()).optional().describe("Example social media posts demonstrating the character's voice and topics"),topics:n$.array(n$.string()).optional().describe("Topics the character is knowledgeable about and engages with"),adjectives:n$.array(n$.string()).optional().describe("Adjectives that describe the character's personality and traits"),knowledge:n$.array(Mn).optional().describe("Knowledge sources (files, directories) the character can reference"),plugins:n$.array(n$.string()).optional().describe('List of plugin package names to load (e.g., ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"] - these are commonly required)'),settings:En,secrets:hn,style:Cn}).strict().describe("Complete character definition including personality, behavior, and capabilities");function tM($){let q=Rn.safeParse($);if(q.success)return{success:!0,data:q.data};return{success:!1,error:{message:`Character validation failed: ${q.error.message}`,issues:q.error.issues}}}function GP$($){try{let q=JSON.parse($);return tM(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function VP$($){return tM($).success}SK();function NK(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function In($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(NK())return Buffer.from(q,"hex");let K=new Uint8Array(q.length/2);for(let P=0;P<K.length;P++)K[P]=parseInt(q.substr(P*2,2),16);return K}function Dn($,q="utf8"){if(NK()){let P=q==="utf-8"?"utf8":q;return Buffer.from($,P)}if(q==="base64"){let P=atob($),_=new Uint8Array(P.length);for(let O=0;O<P.length;O++)_[O]=P.charCodeAt(O);return _}return new TextEncoder().encode($)}function UM($){if(NK()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),K="";for(let P=0;P<q.length;P++){let _=q[P].toString(16);K+=_.length===1?"0"+_:_}return K}function Ln($,q="utf8"){if(NK()&&Buffer.isBuffer($)){let _=q==="utf-8"?"utf8":q;return $.toString(_)}let K=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return UM(K);if(q==="base64"){let _="";for(let O=0;O<K.length;O++)_+=String.fromCharCode(K[O]);return btoa(_)}return new TextDecoder().decode(K)}function bn($){if(!$)return!1;if(NK()&&Buffer.isBuffer($))return!0;return $ instanceof Uint8Array||$ instanceof ArrayBuffer||typeof $==="object"&&$.buffer instanceof ArrayBuffer&&typeof $.byteLength==="number"&&!Array.isArray($)}function gn($){if(NK())return Buffer.alloc($);return new Uint8Array($)}function un($){if(NK())return Buffer.from($);return new Uint8Array($)}function yn($){if(NK()&&$.every((_)=>Buffer.isBuffer(_)))return Buffer.concat($);let q=0;for(let _ of $)q+=_.length;let K=new Uint8Array(q),P=0;for(let _ of $){let O=_ instanceof Uint8Array?_:new Uint8Array(_);K.set(O,P),P+=O.length}return K}function xn($,q,K){if(NK()&&Buffer.isBuffer($))return $.slice(q,K);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,K)}function cn($,q){if($.length!==q.length)return!1;let K=$ instanceof Uint8Array?$:new Uint8Array($),P=q instanceof Uint8Array?q:new Uint8Array(q);for(let _=0;_<K.length;_++)if(K[_]!==P[_])return!1;return!0}function pn($){return $.length}function mn($){let q=new Uint8Array($),K=typeof globalThis<"u"?globalThis.crypto||globalThis.webcrypto:void 0;if(K&&typeof K.getRandomValues==="function")K.getRandomValues(q);else for(let P=0;P<$;P++)q[P]=Math.floor(Math.random()*256);return q}var FK={fromHex:In,fromString:Dn,fromBytes:un,toHex:UM,toString:Ln,isBuffer:bn,alloc:gn,concat:yn,slice:xn,equals:cn,byteLength:pn,randomBytes:mn};var CP$=($,q)=>{if(!$.length||q<=0)return"";let K=$.filter((j)=>j.examples&&Array.isArray(j.examples)&&j.examples.length>0);if(!K.length)return"";let P=K.map((j)=>[...j.examples||[]]),_=[],O=P.map((j,z)=>j.length>0?z:-1).filter((j)=>j!==-1);while(_.length<q&&O.length>0){let j=Math.floor(Math.random()*O.length),z=O[j],J=P[z],w=Math.floor(Math.random()*J.length);if(_.push(J.splice(w,1)[0]),J.length===0)O.splice(j,1)}return dn(_)},dn=($)=>{return $.map((K)=>{let P=Array.from({length:5},()=>Dj({dictionaries:[Lj]}));return`
351
+ `)},lM=($)=>{let K=new Date().getTime()-$,P=Math.abs(K),_=Math.floor(P/1000),O=Math.floor(_/60),j=Math.floor(O/60),z=Math.floor(j/24);if(P<60000)return"just now";if(O<60)return`${O} minute${O!==1?"s":""} ago`;if(j<24)return`${j} hour${j!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},Tn=/```json\n([\s\S]*?)\n```/;function UK($){if(!$)return null;let q=$.match(/<response>([\s\S]*?)<\/response>/),K;if(q)K=q[1],a8.debug("Found response XML block");else{let z=((J)=>{let w=0,k=J.length;while(w<k){let X=J.indexOf("<",w);if(X===-1)break;if(J.startsWith("</",X)||J.startsWith("<!--",X)||J.startsWith("<?",X)){w=X+1;continue}let G=X+1,V="";while(G<k){let g=J[G];if(/^[A-Za-z0-9_-]$/.test(g)){V+=g,G++;continue}break}if(!V){w=X+1;continue}let C=J.indexOf(">",G);if(C===-1)break;let E=J.slice(X,C+1);if(/\/\s*>$/.test(E)){w=C+1;continue}let h=`</${V}>`,I=1,D=C+1;while(I>0&&D<k){let g=J.indexOf(`<${V}`,D),u=J.indexOf(h,D);if(u===-1)break;if(g!==-1&&g<u){let y=J.indexOf(">",g+1);if(y===-1)break;let p=J.slice(g,y+1);if(/\/\s*>$/.test(p))D=y+1;else I++,D=y+1}else I--,D=u+h.length}if(I===0){let g=D-h.length,u=J.slice(C+1,g);return{tag:V,content:u}}w=C+1}return null})($);if(!z)return a8.warn("Could not find XML block in text"),a8.debug({textPreview:$.substring(0,200)+"..."},"Text content"),null;K=z.content,a8.debug(`Found XML block with tag: ${z.tag}`)}let P={},O=((j)=>{let z=[],J=j.length,w=0;while(w<J){let k=j.indexOf("<",w);if(k===-1)break;if(j.startsWith("</",k)||j.startsWith("<!--",k)||j.startsWith("<?",k)){w=k+1;continue}let X=k+1,G="";while(X<J){let y=j[X];if(/^[A-Za-z0-9_-]$/.test(y)){G+=y,X++;continue}break}if(!G){w=k+1;continue}let V=j.indexOf(">",X);if(V===-1)break;let C=j.slice(k,V+1);if(/\/\s*>$/.test(C)){w=V+1;continue}let E=`</${G}>`,h=1,I=V+1;while(h>0&&I<J){let y=j.indexOf(`<${G}`,I),p=j.indexOf(E,I);if(p===-1)break;if(y!==-1&&y<p){let l=j.indexOf(">",y+1);if(l===-1)break;let Q=j.slice(y,l+1);if(!/\/\s*>$/.test(Q))h++;I=l+1}else h--,I=p+E.length}if(h!==0){w=V+1;continue}let D=I-E.length,u=j.slice(V+1,D).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'").trim();z.push({key:G,value:u}),w=I}return z})(K);for(let{key:j,value:z}of O)if(j==="actions"||j==="providers"||j==="evaluators")P[j]=z?z.split(",").map((J)=>J.trim()):[];else if(j==="simple")P[j]=z.toLowerCase()==="true";else P[j]=z;if(Object.keys(P).length===0)return a8.warn("No key-value pairs extracted from XML content"),a8.debug({xmlPreview:K.substring(0,200)+"..."},"XML content was"),null;return P}function HP$($){let q=null,K=$.match(Tn);try{if(K)q=JSON.parse(cM(K[1].trim()));else q=JSON.parse(cM($.trim()))}catch(P){return null}if(q&&typeof q==="object"&&!Array.isArray(q))return q;return null}var cM=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,K,P)=>`"${K}": "${P}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function rM($,q){if($.length<=q)return $;let K=$.lastIndexOf(".",q-1);if(K!==-1){let O=$.slice(0,K+1).trim();if(O.length>0)return O}let P=$.lastIndexOf(" ",q-1);if(P!==-1){let O=$.slice(0,P).trim();if(O.length>0)return`${O}...`}return`${$.slice(0,q-3).trim()}...`}async function JP$($,q=512,K=20){a8.debug("[splitChunks] Starting text split");let P=3.5,O=await new k7({chunkSize:Number(Math.floor(q*P)),chunkOverlap:Number(Math.floor(K*P))}).splitText($);return a8.debug({numberOfChunks:O.length,averageChunkSize:O.reduce((j,z)=>j+z.length,0)/O.length},"[splitChunks] Split complete"),O}async function TP$($,q,K){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let P=await K.useModel(I6.TEXT_TOKENIZER_ENCODE,{prompt:$});if(P.length<=q)return $;let _=P.slice(-q);return await K.useModel(I6.TEXT_TOKENIZER_DECODE,{tokens:_})}function UH(){let $=new WeakSet;return function(q,K){if(typeof K==="object"&&K!==null){if($.has(K))return"[Circular]";$.add(K)}return K}}function zO($){if(!$)return!1;if(typeof $==="boolean")return $;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],K=["NO","N","FALSE","F","0","OFF","DISABLE"],P=$.trim().toUpperCase();if(q.includes(P))return!0;if(K.includes(P))return!1;return!1}var wn=n$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format");function Zn($){let q=wn.safeParse($);return q.success?q.data:null}function WO($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=Zn($);if(q)return q;let K=encodeURIComponent($),_=fn(K).slice(0,16);return _[8]=_[8]&63|128,_[6]=_[6]&15|0,kn(_)}async function wP$($){if(!FH())return;let q=$.map(async(K)=>{let P=encodeURIComponent(K),_=await oM(P);g_.set(P,_)});await Promise.all(q)}var g_=new Map,vO=null;function FH(){if(vO!==null)return vO;try{if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return vO=!0,!0}catch{}return vO=!1,!1}function fn($){let q=g_.get($);if(q)return q;let K=nM($);if(g_.set($,K),FH())oM($).then((P)=>{g_.set($,P)}).catch(()=>{});if(g_.size>1e4)Array.from(g_.keys()).slice(0,5000).forEach((_)=>g_.delete(_));return K}async function oM($){if(FH())try{let K=new TextEncoder().encode($),P=await globalThis.crypto.subtle.digest("SHA-1",K);return new Uint8Array(P)}catch{}return nM($)}function nM($){let q=Xn($),K=q.length,P=new Uint8Array(K+9+63>>>6<<6);P.set(q),P[K]=128;let _=K*8,O=new DataView(P.buffer);O.setUint32(P.length-4,_>>>0,!1),O.setUint32(P.length-8,Math.floor(_/4294967296)>>>0,!1);let j=1732584193,z=4023233417,J=2562383102,w=271733878,k=3285377520,X=new Uint32Array(80);for(let C=0;C<P.length;C+=64){for(let u=0;u<16;u++)X[u]=O.getUint32(C+u*4,!1);for(let u=16;u<80;u++){let y=X[u-3]^X[u-8]^X[u-14]^X[u-16];X[u]=y<<1|y>>>31}let E=j,h=z,I=J,D=w,g=k;for(let u=0;u<80;u++){let y,p;if(u<20)y=h&I|~h&D,p=1518500249;else if(u<40)y=h^I^D,p=1859775393;else if(u<60)y=h&I|h&D|I&D,p=2400959708;else y=h^I^D,p=3395469782;let l=(E<<5|E>>>27)+y+g+p+X[u]>>>0;g=D,D=I,I=(h<<30|h>>>2)>>>0,h=E,E=l}j=j+E>>>0,z=z+h>>>0,J=J+I>>>0,w=w+D>>>0,k=k+g>>>0}let G=new Uint8Array(20),V=new DataView(G.buffer);return V.setUint32(0,j,!1),V.setUint32(4,z,!1),V.setUint32(8,J,!1),V.setUint32(12,w,!1),V.setUint32(16,k,!1),G}function Xn($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let K=0;K<$.length;K++){let P=$.charCodeAt(K);if(P<128)q.push(P);else if(P<2048)q.push(192|P>>6,128|P&63);else if(P<55296||P>=57344)q.push(224|P>>12,128|P>>6&63,128|P&63);else{K++;let _=65536+((P&1023)<<10|$.charCodeAt(K)&1023);q.push(240|_>>18,128|_>>12&63,128|_>>6&63,128|_&63)}}return new Uint8Array(q)}function kn($){let q=[];for(let K=0;K<$.length;K++){let P=$[K].toString(16).padStart(2,"0");q.push(P)}return q.slice(0,4).join("")+"-"+q.slice(4,6).join("")+"-"+q.slice(6,8).join("")+"-"+q.slice(8,10).join("")+"-"+q.slice(10,16).join("")}var ZP$=($)=>{if($.startsWith("image/"))return"image";if($.startsWith("video/"))return"video";if($.startsWith("audio/"))return"audio";if($.includes("pdf")||$.includes("document")||$.startsWith("text/"))return"document";return};function iM($){return`http://localhost:${VK("SERVER_PORT","3000")}${$}`}var BM=n$.string().regex(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,"Invalid UUID format").describe("Unique identifier for the character in UUID format"),An=n$.object({id:n$.string().describe("Unique identifier for the media"),url:n$.string().describe("URL of the media file"),title:n$.string().optional().describe("Media title"),source:n$.string().optional().describe("Media source"),description:n$.string().optional().describe("Media description"),text:n$.string().optional().describe("Text content associated with the media"),contentType:n$.nativeEnum(F4).optional().describe("Type of media content")}).loose().describe("Media attachment with URL and metadata"),Gn=n$.object({text:n$.string().optional().describe("The main text content of the message"),thought:n$.string().optional().describe("Internal thought process or reasoning"),actions:n$.array(n$.string()).optional().describe("Actions to be taken in response"),providers:n$.array(n$.string()).optional().describe("Data providers to use (e.g., KNOWLEDGE)"),source:n$.string().optional().describe("Source of the content"),target:n$.string().optional().describe("Target of the content"),url:n$.string().optional().describe("Related URL"),inReplyTo:BM.optional().describe("UUID of message this is replying to"),attachments:n$.array(An).optional().describe("Array of media attachments (images, videos, documents, etc.)"),channelType:n$.enum(a4).optional().describe("Type of channel this content is for")}).catchall(n$.unknown()).describe("Content structure for messages in conversation examples"),Vn=n$.object({name:n$.string().describe("Name of the speaker (can use {{name1}} placeholder for dynamic names)"),content:Gn}).describe("A single message in a conversation example"),Sn=n$.object({directory:n$.string().describe("Path to a directory containing knowledge files"),shared:n$.boolean().optional().describe("Whether this knowledge is shared across characters")}).describe("Directory-based knowledge source"),Mn=n$.union([n$.string().describe("File path to a knowledge document"),n$.object({path:n$.string().describe("Path to a knowledge file"),shared:n$.boolean().optional().describe("Whether this knowledge is shared across characters")}),Sn]).describe("Knowledge source - can be a file path, file object, or directory"),Nn=n$.union([n$.string().describe("Template string with placeholders"),n$.function().optional()]).describe("Template for generating text - can be a string template or function"),Cn=n$.object({all:n$.array(n$.string()).optional().describe("Style guidelines applied to all types of responses"),chat:n$.array(n$.string()).optional().describe("Style guidelines specific to chat/conversation responses"),post:n$.array(n$.string()).optional().describe("Style guidelines specific to social media posts")}).optional().describe("Style configuration defining how the character communicates across different contexts"),En=n$.record(n$.string(),n$.union([n$.string(),n$.boolean(),n$.number(),n$.object({}).loose(),n$.array(n$.any())])).optional().describe("Character-specific settings like avatar URL, preferences, and configuration"),hn=n$.record(n$.string(),n$.union([n$.string(),n$.boolean(),n$.number()])).optional().describe("Secret values and API keys (should not be committed to version control)"),Rn=n$.object({id:BM.optional().describe("Unique identifier for the character"),name:n$.string().min(1,"Character name is required").describe('The name of the character (e.g., "Eliza")'),username:n$.string().optional().describe("Username for the character on various platforms"),system:n$.string().optional().describe("System prompt that defines the character's core behavior and response style"),templates:n$.record(n$.string(),Nn).optional().describe("Custom templates for generating different types of content"),bio:n$.union([n$.string(),n$.array(n$.string())]).describe("Character biography - can be a single string or array of biographical points"),messageExamples:n$.array(n$.array(Vn)).optional().describe("Example conversations showing how the character responds in different scenarios"),postExamples:n$.array(n$.string()).optional().describe("Example social media posts demonstrating the character's voice and topics"),topics:n$.array(n$.string()).optional().describe("Topics the character is knowledgeable about and engages with"),adjectives:n$.array(n$.string()).optional().describe("Adjectives that describe the character's personality and traits"),knowledge:n$.array(Mn).optional().describe("Knowledge sources (files, directories) the character can reference"),plugins:n$.array(n$.string()).optional().describe('List of plugin package names to load (e.g., ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"] - these are commonly required)'),settings:En,secrets:hn,style:Cn}).strict().describe("Complete character definition including personality, behavior, and capabilities");function tM($){let q=Rn.safeParse($);if(q.success)return{success:!0,data:q.data};return{success:!1,error:{message:`Character validation failed: ${q.error.message}`,issues:q.error.issues}}}function GP$($){try{let q=JSON.parse($);return tM(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function VP$($){return tM($).success}SK();function NK(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function In($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(NK())return Buffer.from(q,"hex");let K=new Uint8Array(q.length/2);for(let P=0;P<K.length;P++)K[P]=parseInt(q.substr(P*2,2),16);return K}function Dn($,q="utf8"){if(NK()){let P=q==="utf-8"?"utf8":q;return Buffer.from($,P)}if(q==="base64"){let P=atob($),_=new Uint8Array(P.length);for(let O=0;O<P.length;O++)_[O]=P.charCodeAt(O);return _}return new TextEncoder().encode($)}function UM($){if(NK()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),K="";for(let P=0;P<q.length;P++){let _=q[P].toString(16);K+=_.length===1?"0"+_:_}return K}function Ln($,q="utf8"){if(NK()&&Buffer.isBuffer($)){let _=q==="utf-8"?"utf8":q;return $.toString(_)}let K=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return UM(K);if(q==="base64"){let _="";for(let O=0;O<K.length;O++)_+=String.fromCharCode(K[O]);return btoa(_)}return new TextDecoder().decode(K)}function bn($){if(!$)return!1;if(NK()&&Buffer.isBuffer($))return!0;return $ instanceof Uint8Array||$ instanceof ArrayBuffer||typeof $==="object"&&$.buffer instanceof ArrayBuffer&&typeof $.byteLength==="number"&&!Array.isArray($)}function gn($){if(NK())return Buffer.alloc($);return new Uint8Array($)}function un($){if(NK())return Buffer.from($);return new Uint8Array($)}function yn($){if(NK()&&$.every((_)=>Buffer.isBuffer(_)))return Buffer.concat($);let q=0;for(let _ of $)q+=_.length;let K=new Uint8Array(q),P=0;for(let _ of $){let O=_ instanceof Uint8Array?_:new Uint8Array(_);K.set(O,P),P+=O.length}return K}function xn($,q,K){if(NK()&&Buffer.isBuffer($))return $.slice(q,K);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,K)}function cn($,q){if($.length!==q.length)return!1;let K=$ instanceof Uint8Array?$:new Uint8Array($),P=q instanceof Uint8Array?q:new Uint8Array(q);for(let _=0;_<K.length;_++)if(K[_]!==P[_])return!1;return!0}function pn($){return $.length}function mn($){let q=new Uint8Array($),K=typeof globalThis<"u"?globalThis.crypto||globalThis.webcrypto:void 0;if(K&&typeof K.getRandomValues==="function")K.getRandomValues(q);else for(let P=0;P<$;P++)q[P]=Math.floor(Math.random()*256);return q}var FK={fromHex:In,fromString:Dn,fromBytes:un,toHex:UM,toString:Ln,isBuffer:bn,alloc:gn,concat:yn,slice:xn,equals:cn,byteLength:pn,randomBytes:mn};var CP$=($,q)=>{if(!$.length||q<=0)return"";let K=$.filter((j)=>j.examples&&Array.isArray(j.examples)&&j.examples.length>0);if(!K.length)return"";let P=K.map((j)=>[...j.examples||[]]),_=[],O=P.map((j,z)=>j.length>0?z:-1).filter((j)=>j!==-1);while(_.length<q&&O.length>0){let j=Math.floor(Math.random()*O.length),z=O[j],J=P[z],w=Math.floor(Math.random()*J.length);if(_.push(J.splice(w,1)[0]),J.length===0)O.splice(j,1)}return dn(_)},dn=($)=>{return $.map((K)=>{let P=Array.from({length:5},()=>Dj({dictionaries:[Lj]}));return`
352
352
  ${K.map((O)=>{let j=`${O.name}: ${O.content.text}`;for(let z=0;z<P.length;z++)j=j.replaceAll(`{{name${z+1}}}`,P[z]);return j}).join(`
353
353
  `)}`}).join(`
354
354
  `)};function EP$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>q.name).join(", ")}function hP$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>`- **${q.name}**: ${q.description||"No description available"}`).join(`
@@ -591,8 +591,8 @@ Here are the actions taken by the assistant to fulfill the request:
591
591
  <text>Your final message to the user</text>
592
592
  </response>
593
593
  </output>
594
- `;async function iP$($,q,K){let P=Q8($,K),_=await $.getWorld(P);if(!_||!_.metadata?.roles)return"NONE";if(_.metadata.roles[q])return _.metadata.roles[q];if(_.metadata.roles[q])return _.metadata.roles[q];return"NONE"}async function BP$($,q){if(!q)return j6.error("User ID is required to find server"),null;let K=await $.getAllWorlds();if(!K||K.length===0)return j6.info("No worlds found for this agent"),null;let P=[];for(let _ of K)if(_.metadata?.ownership?.ownerId===q)P.push(_);return P.length?P:null}var Gq=[];for(let $=0;$<256;++$)Gq.push(($+256).toString(16).slice(1));function $0($,q=0){return(Gq[$[q+0]]+Gq[$[q+1]]+Gq[$[q+2]]+Gq[$[q+3]]+"-"+Gq[$[q+4]]+Gq[$[q+5]]+"-"+Gq[$[q+6]]+Gq[$[q+7]]+"-"+Gq[$[q+8]]+Gq[$[q+9]]+"-"+Gq[$[q+10]]+Gq[$[q+11]]+Gq[$[q+12]]+Gq[$[q+13]]+Gq[$[q+14]]+Gq[$[q+15]]).toLowerCase()}var aH,rn=new Uint8Array(16);function QH(){if(!aH){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");aH=crypto.getRandomValues.bind(crypto)}return aH(rn)}var on=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eH={randomUUID:on};function nn($,q,K){$=$||{};let P=$.random??$.rng?.()??QH();if(P.length<16)throw Error("Random bytes length must be >= 16");if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){if(K=K||0,K<0||K+16>q.length)throw RangeError(`UUID byte range ${K}:${K+15} is out of buffer bounds`);for(let _=0;_<16;++_)q[K+_]=P[_];return q}return $0(P)}function Bn($,q,K){if(eH.randomUUID&&!q&&!$)return eH.randomUUID();return nn($,q,K)}var Iq=Bn;SK();var Q7=new Map;class sH{async handleMessage($,q,K,P){let _={maxRetries:P?.maxRetries??3,timeoutDuration:P?.timeoutDuration??3600000,useMultiStep:P?.useMultiStep??zO($.getSetting("USE_MULTI_STEP")),maxMultiStepIterations:P?.maxMultiStepIterations??parseInt($.getSetting("MAX_MULTISTEP_ITERATIONS")||"6")},O=void 0,j=Iq();try{if($.logger.info(`[MessageService] Message received from ${q.entityId} in room ${q.roomId}`),!Q7.has($.agentId))Q7.set($.agentId,new Map);let z=Q7.get($.agentId);if(!z)throw Error("Agent responses map not found");let J=z.get(q.roomId);if(J)j6.warn(`[MessageService] Updating response ID for room ${q.roomId} from ${J} to ${j}`);z.set(q.roomId,j);let w=$.startRun(),k=Date.now();await $.emitEvent("RUN_STARTED",{runtime:$,runId:w,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:k,status:"started",source:"messageHandler",metadata:q.content});let X=new Promise((C,E)=>{O=setTimeout(async()=>{await $.emitEvent("RUN_TIMEOUT",{runtime:$,runId:w,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:k,status:"timeout",endTime:Date.now(),duration:Date.now()-k,error:"Run exceeded timeout",source:"messageHandler"}),E(Error("Run exceeded timeout"))},_.timeoutDuration)}),G=this.processMessage($,q,K,j,w,k,_),V=await Promise.race([G,X]);return clearTimeout(O),V}catch(z){throw clearTimeout(O),$.logger.error({error:z},"[MessageService] Error in handleMessage:"),z}}async processMessage($,q,K,P,_,O,j){try{let z=Q7.get($.agentId);if(!z)throw Error("Agent responses map not found");if(q.entityId===$.agentId)return $.logger.debug(`[MessageService] Skipping message from self (${$.agentId})`),await this.emitRunEnded($,_,q,O,"self"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};$.logger.debug(`[MessageService] Processing message: ${rM(q.content.text||"",50)}...`),$.logger.debug("[MessageService] Saving message to memory and queueing embeddings");let J;if(q.id){let U=await $.getMemoryById(q.id);if(U)$.logger.debug("[MessageService] Memory already exists, skipping creation"),J=U;else{let l=await $.createMemory(q,"messages");J={...q,id:l}}await $.queueEmbeddingGeneration(J,"high")}else{let U=await $.createMemory(q,"messages");q.id=U,J={...q,id:U},await $.queueEmbeddingGeneration(J,"normal")}let w=await $.getParticipantUserState(q.roomId,$.agentId);if(zO($.getSetting("BOOTSTRAP_DEFLLMOFF"))&&w===null)return $.logger.debug("[MessageService] LLM is off by default"),await this.emitRunEnded($,_,q,O,"off"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};if(w==="MUTED"&&!q.content.text?.toLowerCase().includes($.character.name.toLowerCase()))return $.logger.debug(`[MessageService] Ignoring muted room ${q.roomId}`),await this.emitRunEnded($,_,q,O,"muted"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};let X=await $.composeState(q,["ANXIETY","ENTITIES","CHARACTER","RECENT_MESSAGES","ACTIONS"],!0),G=q.content.mentionContext,V=await $.getRoom(q.roomId);if(q.content.attachments&&q.content.attachments.length>0){if(q.content.attachments=await this.processAttachments($,q.content.attachments),q.id)await $.updateMemory({id:q.id,content:q.content})}let C=this.shouldRespond($,q,V??void 0,G);$.logger.debug(`[MessageService] Response decision: ${JSON.stringify(C)}`);let E=!0;if(C.skipEvaluation)$.logger.debug(`[MessageService] Skipping evaluation for ${$.character.name} (${C.reason})`),E=C.shouldRespond;else{let U=a7({state:X,template:$.character.templates?.shouldRespondTemplate||FM});$.logger.debug(`[MessageService] Using LLM evaluation for ${$.character.name} (${C.reason})`);let l=await $.useModel(I6.TEXT_SMALL,{prompt:U});$.logger.debug(`[MessageService] LLM evaluation result:
595
- ${l}`);let o=UK(l);$.logger.debug({responseObject:o},"[MessageService] Parsed evaluation result:");let M=["IGNORE","NONE"];E=o?.action&&!M.includes(o.action.toUpperCase())}let h=null,I=[],D="none";if(E){let U=j.useMultiStep?await this.runMultiStepCore($,q,X,K,j):await this.runSingleShotCore($,q,X,j);if(h=U.responseContent,I=U.responseMessages,X=U.state,D=U.mode,z.get(q.roomId)!==P)return $.logger.info(`Response discarded - newer message being processed for agent: ${$.agentId}, room: ${q.roomId}`),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};if(h&&q.id)h.inReplyTo=Q8($,q.id);if(h?.providers?.length&&h.providers.length>0)X=await $.composeState(q,h.providers||[]);if(h){if(D==="simple"){if(h.providers&&h.providers.length>0)$.logger.debug({providers:h.providers},"[MessageService] Simple response used providers");if(K)await K(h)}else if(D==="actions")await $.processActions(q,I,X,async(o)=>{if($.logger.debug({content:o},"action callback"),h.actionCallbacks=o,K)return K(o);return[]})}}else{$.logger.debug("[MessageService] Agent decided not to respond (shouldRespond is false).");let U=z.get(q.roomId),l=zO($.getSetting("BOOTSTRAP_KEEP_RESP"));if(U!==P&&!l)return $.logger.info(`Ignore response discarded - newer message being processed for agent: ${$.agentId}, room: ${q.roomId}`),await this.emitRunEnded($,_,q,O,"replaced"),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};if(!q.id)return $.logger.error("[MessageService] Message ID is missing, cannot create ignore response."),await this.emitRunEnded($,_,q,O,"noMessageId"),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};let o={thought:"Agent decided not to respond to this message.",actions:["IGNORE"],simple:!0,inReplyTo:Q8($,q.id)};if(K)await K(o);let M={id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:o,roomId:q.roomId,createdAt:Date.now()};await $.createMemory(M,"messages"),$.logger.debug("[MessageService] Saved ignore response to memory",`memoryId: ${M.id}`)}if(z.delete(q.roomId),z.size===0)Q7.delete($.agentId);await $.evaluate(q,X,E,async(U)=>{if($.logger.debug({content:U},"evaluate callback"),h)h.evalCallbacks=U;if(K)return K(U);return[]},I);let g="noname";if(q.metadata&&"entityName"in q.metadata)g=q.metadata.entityName;let u=q.content?.channelType==="DM",y=g;if(!u){let U=await $.getRoomsByIds([q.roomId]);if(U?.length){let l=U[0];if(l.name)y=l.name;if(l.worldId){let o=await $.getWorld(l.worldId);if(o)y=o.name+"-"+y}}}let p=new Date,m=X.data?.providers?.ACTIONS?.data?.actionsData?.map((U)=>U.name)||[-1],s={at:p.toString(),timestamp:parseInt(""+p.getTime()/1000),messageId:q.id,userEntityId:q.entityId,input:q.content.text,thought:h?.thought,simple:h?.simple,availableActions:m,actions:h?.actions,providers:h?.providers,irt:h?.inReplyTo,output:h?.text,entityName:g,source:q.content.source,channelType:q.content.channelType,roomName:y};return await $.emitEvent("RUN_ENDED",{runtime:$,runId:_,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:O,status:"completed",endTime:Date.now(),duration:Date.now()-O,source:"messageHandler",entityName:g,responseContent:h,metadata:s}),{didRespond:E,responseContent:h,responseMessages:I,state:X,mode:D}}catch(z){throw console.error("error is",z),await $.emitEvent("RUN_ENDED",{runtime:$,runId:_,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:O,status:"error",endTime:Date.now(),duration:Date.now()-O,error:z.message,source:"messageHandler"}),z}}shouldRespond($,q,K,P){if(!K)return{shouldRespond:!1,skipEvaluation:!0,reason:"no room context"};function _(C){if(!C||typeof C!=="string")return[];return C.trim().replace(/^\[|\]$/g,"").split(",").map((h)=>h.trim()).filter(Boolean)}let O=["DM","VOICE_DM","SELF","API"],j=["client_chat"],z=_($.getSetting("ALWAYS_RESPOND_CHANNELS")||$.getSetting("SHOULD_RESPOND_BYPASS_TYPES")),J=_($.getSetting("ALWAYS_RESPOND_SOURCES")||$.getSetting("SHOULD_RESPOND_BYPASS_SOURCES")),w=new Set([...O.map((C)=>C.toString()),...z].map((C)=>C.trim().toLowerCase())),k=[...j,...J].map((C)=>C.trim().toLowerCase()),X=K.type?.toString().toLowerCase(),G=q.content.source?.toLowerCase()||"";if(w.has(X))return{shouldRespond:!0,skipEvaluation:!0,reason:`private channel: ${X}`};if(k.some((C)=>G.includes(C)))return{shouldRespond:!0,skipEvaluation:!0,reason:`whitelisted source: ${G}`};if(!!(P?.isMention||P?.isReply))return{shouldRespond:!0,skipEvaluation:!0,reason:`platform ${P?.isMention?"mention":"reply"}`};return{shouldRespond:!1,skipEvaluation:!1,reason:"needs LLM evaluation"}}async processAttachments($,q){if(!q||q.length===0)return[];$.logger.debug(`[MessageService] Processing ${q.length} attachment(s)`);let K=[];for(let P of q)try{let _={...P},O=/^(http|https):\/\//.test(P.url),j=O?P.url:iM(P.url);if(P.contentType==="image"&&!P.description){$.logger.debug(`[MessageService] Generating description for image: ${P.url}`);let z=j;if(!O){let J=await fetch(j);if(!J.ok)throw Error(`Failed to fetch image: ${J.statusText}`);let w=await J.arrayBuffer(),k=Buffer.from(w);z=`data:${J.headers.get("content-type")||"application/octet-stream"};base64,${k.toString("base64")}`}try{let J=await $.useModel(I6.IMAGE_DESCRIPTION,{prompt:QM,imageUrl:z});if(typeof J==="string"){let w=UK(J);if(w&&(w.description||w.text))_.description=w.description||"",_.title=w.title||"Image",_.text=w.text||w.description||"",$.logger.debug(`[MessageService] Generated description: ${_.description?.substring(0,100)}...`);else{let k=J,X=k.match(/<title>([^<]+)<\/title>/),G=k.match(/<description>([^<]+)<\/description>/),V=k.match(/<text>([^<]+)<\/text>/);if(X||G||V)_.title=X?.[1]||"Image",_.description=G?.[1]||"",_.text=V?.[1]||G?.[1]||"",$.logger.debug(`[MessageService] Used fallback XML parsing - description: ${_.description?.substring(0,100)}...`);else $.logger.warn("[MessageService] Failed to parse XML response for image description")}}else if(J&&typeof J==="object"&&"description"in J)_.description=J.description,_.title=J.title||"Image",_.text=J.description,$.logger.debug(`[MessageService] Generated description: ${_.description?.substring(0,100)}...`);else $.logger.warn("[MessageService] Unexpected response format for image description")}catch(J){$.logger.error({error:J},"[MessageService] Error generating image description:")}}else if(P.contentType==="document"&&!P.text){let z=await fetch(j);if(!z.ok)throw Error(`Failed to fetch document: ${z.statusText}`);let J=z.headers.get("content-type")||"";if(J.startsWith("text/plain")){$.logger.debug(`[MessageService] Processing plain text document: ${P.url}`);let k=await z.text();_.text=k,_.title=_.title||"Text File",$.logger.debug(`[MessageService] Extracted text content (first 100 chars): ${_.text?.substring(0,100)}...`)}else $.logger.warn(`[MessageService] Skipping non-plain-text document: ${J}`)}K.push(_)}catch(_){$.logger.error({error:_,attachmentUrl:P.url},`[MessageService] Failed to process attachment ${P.url}:`),K.push(P)}return K}async runSingleShotCore($,q,K,P){if(K=await $.composeState(q,["ACTIONS"]),!K.values?.actionNames)$.logger.warn("actionNames data missing from state, even though it was requested");let _=a7({state:K,template:$.character.templates?.messageHandlerTemplate||aM}),O=null,j=0;while(j<P.maxRetries&&(!O?.thought||!O?.actions)){let w=await $.useModel(I6.TEXT_LARGE,{prompt:_});$.logger.debug({response:w},"[MessageService] *** Raw LLM Response ***");let k=UK(w);if($.logger.debug({parsedXml:k},"[MessageService] *** Parsed XML Content ***"),k)O={...k,thought:k.thought||"",actions:k.actions||["IGNORE"],providers:k.providers||[],text:k.text||"",simple:k.simple||!1};else O=null;if(j++,!O?.thought||!O?.actions)$.logger.warn({response:w,parsedXml:k,responseContent:O},"[MessageService] *** Missing required fields (thought or actions), retrying... ***")}if(!O)return{responseContent:null,responseMessages:[],state:K,mode:"none"};if(O.actions&&O.actions.length>1){let w=(X)=>typeof X==="string"&&X.toUpperCase()==="IGNORE";if(O.actions.some(w))if(!O.text||O.text.trim()==="")O.actions=["IGNORE"];else{let X=O.actions.filter((G)=>!w(G));O.actions=X.length?X:["REPLY"]}}let z=O.actions?.length===1&&typeof O.actions[0]==="string"&&O.actions[0].toUpperCase()==="REPLY"&&(!O.providers||O.providers.length===0);O.simple=z;let J=[{id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:O,roomId:q.roomId,createdAt:Date.now()}];return{responseContent:O,responseMessages:J,state:K,mode:z&&O.text?"simple":"actions"}}async runMultiStepCore($,q,K,P,_){let O=[],j=K,z=0;while(z<_.maxMultiStepIterations){z++,$.logger.debug(`[MultiStep] Starting iteration ${z}/${_.maxMultiStepIterations}`),j=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]),j.data.actionResults=O;let V=a7({state:j,template:$.character.templates?.multiStepDecisionTemplate||eM}),C=await $.useModel(I6.TEXT_LARGE,{prompt:V}),E=UK(C);if(!E){$.logger.warn(`[MultiStep] Failed to parse step result at iteration ${z}`),O.push({data:{actionName:"parse_error"},success:!1,error:"Failed to parse step result"});break}let{thought:h,providers:I=[],action:D,isFinish:g}=E;if(g==="true"||g===!0){if($.logger.info(`[MultiStep] Task marked as complete at iteration ${z}`),P)await P({text:"",thought:h??""});break}if((!I||I.length===0)&&!D){$.logger.warn(`[MultiStep] No providers or action specified at iteration ${z}, forcing completion`);break}try{for(let u of I){let y=$.providers.find((s)=>s.name===u);if(!y){$.logger.warn(`[MultiStep] Provider not found: ${u}`),O.push({data:{actionName:u},success:!1,error:`Provider not found: ${u}`});continue}let p=await y.get($,q,K);if(!p){$.logger.warn(`[MultiStep] Provider returned no result: ${u}`),O.push({data:{actionName:u},success:!1,error:"Provider returned no result"});continue}let m=!!p.text;if(O.push({data:{actionName:u},success:m,text:m?p.text:void 0,error:m?void 0:"Provider returned no result"}),P)await P({text:`\uD83D\uDD0E Provider executed: ${u}`,actions:[u],thought:h??""})}if(D){let u={text:`\uD83D\uDD0E Executing action: ${D}`,actions:[D],thought:h??""};await $.processActions(q,[{id:Iq(),entityId:$.agentId,roomId:q.roomId,createdAt:Date.now(),content:u}],K,async()=>{return[]});let p=$.stateCache?.get(`${q.id}_action_results`)?.values?.actionResults||[],m=p.length>0?p[0]:null,s=m?.success??!1;O.push({data:{actionName:D},success:s,text:m?.text,values:m?.values,error:s?void 0:m?.text})}}catch(u){$.logger.error({err:u},"[MultiStep] Error executing step"),O.push({data:{actionName:D||"unknown"},success:!1,error:u instanceof Error?u.message:String(u)})}}if(z>=_.maxMultiStepIterations)$.logger.warn(`[MultiStep] Reached maximum iterations (${_.maxMultiStepIterations}), forcing completion`);j=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]);let J=a7({state:j,template:$.character.templates?.multiStepSummaryTemplate||sM}),w=await $.useModel(I6.TEXT_LARGE,{prompt:J}),k=UK(w),X=null;if(k?.text)X={actions:["MULTI_STEP_SUMMARY"],text:k.text,thought:k.thought||"Final user-facing message after task completion.",simple:!0};let G=X?[{id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:X,roomId:q.roomId,createdAt:Date.now()}]:[];return{responseContent:X,responseMessages:G,state:j,mode:X?"simple":"none"}}async emitRunEnded($,q,K,P,_){await $.emitEvent("RUN_ENDED",{runtime:$,runId:q,messageId:K.id,roomId:K.roomId,entityId:K.entityId,startTime:P,status:_,endTime:Date.now(),duration:Date.now()-P,source:"messageHandler"})}async deleteMessage($,q){try{if(!q.id){$.logger.error("[MessageService] Cannot delete memory: message ID is missing");return}$.logger.info("[MessageService] Deleting memory for message",q.id,"from room",q.roomId),await $.deleteMemory(q.id),$.logger.debug({messageId:q.id},"[MessageService] Successfully deleted memory for message")}catch(K){throw $.logger.error({error:K},"[MessageService] Error in deleteMessage:"),K}}async clearChannel($,q,K){try{$.logger.info(`[MessageService] Clearing message memories from channel ${K} -> room ${q}`);let P=await $.getMemoriesByRoomIds({tableName:"messages",roomIds:[q]});$.logger.info(`[MessageService] Found ${P.length} message memories to delete from channel ${K}`);let _=0;for(let O of P)if(O.id)try{await $.deleteMemory(O.id),_++}catch(j){$.logger.warn({error:j,memoryId:O.id},`[MessageService] Failed to delete message memory ${O.id}:`)}$.logger.info(`[MessageService] Successfully cleared ${_}/${P.length} message memories from channel ${K}`)}catch(P){throw $.logger.error({error:P},"[MessageService] Error in clearChannel:"),P}}}var CK=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},tn=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},Un=($)=>{switch($){case 99:case 100:case 101:case 103:case 104:case 107:case 109:case 110:case 114:case 116:return!0;default:return!1}},Fn=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},q0=($,q)=>{return q>=2&&CK($[q-2])&&(q===2&&!CK($[q-1])||q>=3&&!CK($[q-3])&&!tn($[q-1]))},an=($)=>{if($.length<3)return $;if($.length<=6)switch($){case"ski":return"ski";case"skies":return"sky";case"dying":return"die";case"lying":return"lie";case"tying":return"tie";case"idly":return"idl";case"gently":return"gentl";case"ugly":return"ugli";case"early":return"earli";case"only":return"onli";case"singly":return"singl";case"sky":case"news":case"howe":case"atlas":case"cosmos":case"bias":case"andes":return $}let q=$.charCodeAt(0)===39?1:0,K=$.length-q,P=Array(K),_=!1;for(let k=0;k<K;++k){let X=$.charCodeAt(k+q);if(X===121&&(k===0||CK(P[k-1]))){_=!0,P[k]=89;continue}P[k]=X}if(P[K-1]===39)--K;if(K>=2&&P[K-2]===39&&P[K-1]===115)K-=2;let O=0;while(O<K&&!CK(P[O]))++O;if(O<K)++O;let j=O;if(K>=5&&(P[0]===103&&P[1]===101&&P[2]===110&&P[3]===101&&P[4]===114||P[0]===97&&P[1]===114&&P[2]===115&&P[3]===101&&P[4]===110))j=5;else if(K>=6&&P[0]===99&&P[1]===111&&P[2]===109&&P[3]===109&&P[4]===117&&P[5]===110)j=6;else{while(j<K&&CK(P[j]))++j;if(j<K)++j}let z=j;while(z<K&&!CK(P[z]))++z;while(z<K&&CK(P[z]))++z;if(z<K)++z;if(K>=3){if(P[K-1]===115){if(K>=4&&P[K-2]===101&&P[K-3]===115&&P[K-4]===115)K-=2;else if(P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1;else if(P[K-2]!==117&&P[K-2]!==115&&O<K-1)K-=1}else if(P[K-1]===100&&P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1}if(K===6&&(P[0]===105&&P[1]===110&&P[2]===110&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===111&&P[1]===117&&P[2]===116&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===101&&P[1]===120&&P[2]===99&&P[3]===101&&P[4]===101&&P[5]===100)||K===7&&(P[0]===99&&P[1]===97&&P[2]===110&&P[3]===110&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===104&&P[1]===101&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===101&&P[1]===97&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===112&&P[1]===114&&P[2]===111&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100||P[0]===115&&P[1]===117&&P[2]===99&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100)){let k="";for(let X=0;X<K;++X)k+=String.fromCharCode(P[X]);return k}let J=K>=2&&P[K-1]===121&&P[K-2]===108?K-2:K;if(J>=3)if(P[J-3]===101&&P[J-2]===101&&P[J-1]===100){if(J>=j+3)K=J-1}else{if(P[J-2]===101&&P[J-1]===100)J-=2;else if(P[J-3]===105&&P[J-2]===110&&P[J-1]===103)J-=3;else J=-1;if(J>=0&&O<=J){if(K=J,K>=2){if(P[K-1]===116&&P[K-2]===97||P[K-1]===108&&P[K-2]===98||P[K-1]===122&&P[K-2]===105)P[K]=101,++K;else if(P[K-2]===P[K-1]&&Fn(P[K-1]))--K;else if(j>=K&&q0(P,K))P[K]=101,++K}}}if(K>=3&&(P[K-1]===89||P[K-1]===121)&&!CK(P[K-2]))P[K-1]=105;if(K>=j+2)switch(P[K-1]){case 108:if(K>=j+6&&P[K-2]===97&&P[K-3]===110&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2;break;case 110:if(K>=j+5&&P[K-2]===111&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)if(K>=7&&P[K-6]===122&&P[K-7]===105){if(K>=j+7)K-=4,P[K-1]=101}else K-=2,P[K-1]=101;break;case 114:if(K>=j+4){if(P[K-2]===101){if(P[K-3]===122&&P[K-4]===105)--K}else if(P[K-2]===111){if(P[K-3]===116&&P[K-4]===97)--K,P[K-1]=101}}break;case 115:if(K>=j+7&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110&&(P[K-5]===108&&P[K-6]===117&&P[K-7]===102||P[K-5]===115&&P[K-6]===117&&P[K-7]===111||P[K-5]===101&&P[K-6]===118&&P[K-7]===105))K-=4;break;case 109:if(K>=j+5&&P[K-2]===115&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3;break;case 105:if(P[K-2]===99){if(K>=j+4&&(P[K-4]===101||P[K-4]===97)&&P[K-3]===110)P[K-1]=101}else if(P[K-2]===103){if(K>=j+3&&K>=4&&P[K-2]===103&&P[K-3]===111&&P[K-4]===108)--K}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===105){if(P[K-4]===108){if(K>=6&&P[K-5]===105&&P[K-6]===98){if(K>=j+6)K-=3,P[K-2]=108,P[K-1]=101}else if(P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-4]===118&&P[K-5]===105)K-=2,P[K-1]=101}}else if(P[K-2]===108&&K>=3){if(P[K-3]===98){if(K>=4&&P[K-4]===97){if(K>=j+4)P[K-1]=101}else if(K>=j+3)P[K-1]=101}else if(P[K-3]===108){if(K>=5&&P[K-4]===117&&P[K-5]===102){if(K>=j+5)K-=2}else if(K>=j+4&&P[K-4]===97)K-=2}else if(P[K-3]===115){if(K>=6&&P[K-4]===115&&P[K-5]===101&&P[K-6]===108){if(K>=j+6)K-=2}else if(K>=j+5&&P[K-4]===117&&P[K-5]===111)K-=2}else if(K>=5&&P[K-3]===116&&P[K-4]===110&&P[K-5]===101){if(K>=j+5)K-=2}else if(Un(P[K-3]))K-=2}}if(K>=j+3)switch(P[K-1]){case 108:if(P[K-3]===99){if(K>=j+4&&P[K-4]===105&&P[K-2]===97)K-=2}else if(P[K-3]===102){if(P[K-2]===117)K-=3}else if(P[K-3]===110){if(K>=j+6&&P[K-2]===97&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2}break;case 101:if(P[K-2]===122){if(K>=j+5&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===97&&P[K-4]===99&&P[K-5]===105)K-=3}else if(P[K-2]===118){if(K>=z+5&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)K-=5}break;case 105:if(K>=j+5&&P[K-2]===116&&P[K-3]===105&&P[K-4]===99&&P[K-5]===105)K-=3;break;case 115:if(K>=j+4&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110)K-=4}if(K>=z+2)switch(P[K-1]){case 110:if(K>=z+3&&P[K-2]===111&&P[K-3]===105&&(P[K-4]===115||P[K-4]===116))K-=3;break;case 108:if(P[K-2]===97)K-=2;break;case 114:if(P[K-2]===101)K-=2;break;case 99:if(P[K-2]===105)K-=2;break;case 109:if(K>=z+3&&P[K-2]===115&&P[K-3]===105)K-=3;break;case 105:if(K>=z+3&&P[K-2]===116&&P[K-3]===105)K-=3;break;case 115:if(K>=z+3&&P[K-2]===117&&P[K-3]===111)K-=3;break;case 116:if(K>=z+3&&P[K-2]===110){if(P[K-3]===97)K-=3;else if(P[K-3]===101)if(K>=4&&P[K-4]===109){if(K>=5&&P[K-5]===101){if(K>=z+5)K-=5}else if(K>=z+4)K-=4}else K-=3}break;case 101:if(P[K-2]===99){if(K>=z+4&&P[K-3]===110&&(P[K-4]===97||P[K-4]===101))K-=4}else if(P[K-2]===108){if(K>=z+4&&P[K-3]===98&&(P[K-4]===97||P[K-4]===105))K-=4}else if(P[K-2]===116){if(K>=z+3&&P[K-3]===97)K-=3}else if(K>=z+3&&(P[K-2]===118||P[K-2]===122)&&P[K-3]===105)K-=3}if(K>=j+1&&(K>=z+1&&P[K-1]===108&&P[K-2]===108||P[K-1]===101&&(K>=z+1||!q0(P,K-1))))--K;let w="";if(_)for(let k=0;k<K;++k)w+=String.fromCharCode(P[k]===89?121:P[k]);else for(let k=0;k<K;++k)w+=String.fromCharCode(P[k]);return w},Qn={k1:1.2,b:0.75,minLength:2,stopWords:new Set(["a","an","and","are","as","at","be","by","for","from","has","he","in","is","it","its","of","on","that","the","to","was","were","will","with"]),stemming:!1,stemWords:($)=>$};class $J{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...$J.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((K)=>({...K,pattern:typeof K.pattern==="string"?new RegExp(K.pattern):K.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let K=Date.now(),P=$.split(/\s+/).filter((z)=>z.length>0),O=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),j=q?{originalWordCount:P.length,stopWordsRemoved:P.length-O.length,stemmedWords:this.stemming?O.length:0,processingTimeMs:Date.now()-K}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:O,stats:j}}cleanText($){return $.toLowerCase().normalize("NFKD").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/[\u0300-\u036f]/g,"").replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu,"").replace(/[™®©℠‼]/g,"").replace(/[\p{P}]/gu," ").replace(/[^a-z0-9\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\s]/gu," ").replace(/\s+/g," ").trim()}isValidToken($){let q=/^\d+$/.test($);return($.length>=this.minLength||q)&&!this.stopWords.has($)}stemWord($){if($.length<3)return $;let q=!1,K=$;for(let P of this.stemmingRules){let _=K.match(P.pattern);if(_){if(!P.minMeasure||this.measure(K.substring(0,_.index))>=P.minMeasure){if(typeof P.replacement==="string")K=K.replace(P.pattern,P.replacement);else K=K.replace(P.pattern,(...O)=>P.replacement(...O));q=!0}}}if(q&&K!==$)return K;return an(K)}isConsonant($,q){let K=$[q];if("aeiou".includes(K))return!1;return K!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,K=!1;for(let P=0;P<$.length;P++)if(this.isConsonant($,P)){if(K)q++,K=!1}else K=!0;return q}}class qJ{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let K={...Qn,...q};if(this.termFrequencySaturation=K.k1,this.lengthNormalizationFactor=K.b,this.tokenizer=new $J(K),this.fieldBoosts=K.fieldBoosts||{},this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex=new Map,this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies=new Map,$&&$.length>0){this.documents=[...$];let{documentLengths:P,termToIndex:_,documentFrequency:O,averageDocLength:j,termFrequencies:z}=this.processDocuments($);this.documentLengths=P,this.termToIndex=_,this.documentFrequency=O,this.averageDocLength=j,this.termFrequencies=z}}processDocuments($){let q=$.length,K=new Uint32Array(q),P=new Map,_=new Map,O=new Map,j=0,z=0;$.forEach((w,k)=>{let X=0,G=new Map;Object.entries(w).forEach(([V,C])=>{if(typeof C!=="string")return;let E=this.fieldBoosts[V]||1,{tokens:h}=this.tokenizer.tokenize(C),I=h.length*E;X+=I,h.forEach((D)=>{if(!P.has(D))P.set(D,z++);let g=P.get(D);if(!_.has(D))_.set(D,new Set);_.get(D).add(k);let u=G.get(g)||0;G.set(g,u+E)})}),K[k]=X,j+=X,G.forEach((V,C)=>{if(!O.has(C))O.set(C,new Map);O.get(C).set(k,V)})});let J=new Uint32Array(P.size);return _.forEach((w,k)=>{let X=P.get(k);J[X]=w.size}),{documentLengths:K,termToIndex:P,documentFrequency:J,averageDocLength:q>0?j/q:0,termFrequencies:O}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,K)=>q+K,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:K}=this.tokenizer.tokenize($),P=new Float32Array(this.documentLengths.length).fill(0);return K.forEach((_)=>{let O=this.termToIndex.get(_);if(O===void 0)return;let j=this.calculateIdf(O);if(j<=0)return;let z=this.termFrequencies.get(O);if(!z)return;z.forEach((J,w)=>{let k=this.documentLengths[w],X=J*(this.termFrequencySaturation+1),G=J+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*k/this.averageDocLength);P[w]+=j*(X/G)})}),Array.from({length:P.length},(_,O)=>({index:O,score:P[O]})).filter((_)=>_.score>0).sort((_,O)=>O.score-_.score).slice(0,q)}searchPhrase($,q=10){let{tokens:K}=this.tokenizer.tokenize($);if(K.length===0)return[];let P=null;for(let O of K){let j=this.termToIndex.get(O);if(j===void 0)return[];let z=this.termFrequencies.get(j)?.keys();if(!z)return[];let J=new Set(z);if(P===null)P=J;else P=new Set([...P].filter((w)=>J.has(w)));if(P.size===0)return[]}if(P===null||P.size===0)return[];let _=new Map;return P.forEach((O)=>{let j=this.getDocument(O),z=!1;Object.entries(j).forEach(([J,w])=>{if(typeof w!=="string"||z)return;let k=this.fieldBoosts[J]||1,{tokens:X}=this.tokenizer.tokenize(w);for(let G=0;G<=X.length-K.length;G++){let V=!0;for(let C=0;C<K.length;C++)if(X[G+C]!==K[C]){V=!1;break}if(V){let C=this.calculatePhraseScore(K,O)*k;_.set(O,(_.get(O)||0)+C),z=!0;break}}})}),Array.from(_.entries()).map(([O,j])=>({index:O,score:j})).sort((O,j)=>j.score-O.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((K,P)=>{let _=this.termToIndex.get(P);if(_===void 0)return K;let O=this.calculateIdf(_),j=this.termFrequencies.get(_)?.get(q)||0,z=this.documentLengths[q],J=j*(this.termFrequencySaturation+1),w=j+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return K+O*(J/w)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let K=new Uint32Array(q+1);K.set(this.documentLengths,0),this.documentLengths=K;let P=0,_=new Map;Object.entries($).forEach(([O,j])=>{if(typeof j!=="string")return;let z=this.fieldBoosts[O]||1,{tokens:J}=this.tokenizer.tokenize(j);P+=J.length*z,J.forEach((w)=>{let k;if(!this.termToIndex.has(w)){if(k=this.termToIndex.size,this.termToIndex.set(w,k),this.documentFrequency.length<=k){let G=this.documentFrequency,V=Math.max(k+1,G.length*2||1);this.documentFrequency=new Uint32Array(V),this.documentFrequency.set(G,0)}this.documentFrequency[k]=0}else k=this.termToIndex.get(w);let X=_.get(k)||0;_.set(k,X+z)})}),this.documentLengths[q]=P,_.forEach((O,j)=>{if(!this.termFrequencies.has(j))this.termFrequencies.set(j,new Map);if(this.termFrequencies.get(j).set(q,O),j<this.documentFrequency.length)this.documentFrequency[j]++;else console.error(`Error: termIndexVal ${j} is out of bounds for documentFrequency (length ${this.documentFrequency.length}). This indicates an issue with array resizing or term indexing.`)}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let P=this.documentLengths.length-q+0.5,_=q+0.5;return Math.log(1+P/_)}getTermFrequency($,q){return this.termFrequencies.get($)?.get(q)||0}getDocument($){if($<0||$>=this.documents.length)throw Error(`Document index ${$} out of bounds (0-${this.documents.length-1})`);return this.documents[$]}clearDocuments(){this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex.clear(),this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies.clear()}getDocumentCount(){return this.documents.length}async addDocuments($){return Promise.all($.map((q)=>this.addDocument(q)))}}var en={};class sn{permits;waiting=[];constructor($){this.permits=$}async acquire(){if(this.permits>0)return this.permits-=1,Promise.resolve();return new Promise(($)=>{this.waiting.push($)})}release(){this.permits+=1;let $=this.waiting.shift();if($&&this.permits>0)this.permits-=1,$()}}class KJ{#$=32;agentId;character;adapter;actions=[];evaluators=[];providers=[];plugins=[];events={};stateCache=new Map;fetch=fetch;services=new Map;serviceTypes=new Map;models=new Map;routes=[];taskWorkers=new Map;sendHandlers=new Map;eventHandlers=new Map;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;migratedPlugins=new Set;currentRunId;currentActionContext;maxWorkingMemoryEntries=50;messageService=null;constructor($){if(this.agentId=$.character?.id??$?.agentId??WO($.character?.name??Iq()),this.character=$.character,this.initPromise=new Promise((q,K)=>{this.initResolver=q,this.initRejecter=K}),this.logger=F7({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??en,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug(`Success: Agent ID: ${this.agentId}`),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=XH("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return Iq()}startRun(){return this.currentRunId=this.createRunId(),this.currentRunId}endRun(){this.currentRunId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error("*** registerPlugin: Plugin or plugin name is undefined"),Error("*** registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((K)=>K.name===$.name)){this.logger.warn(`${this.character.name}(${this.agentId}) - Plugin ${$.name} is already registered. Skipping re-registration.`);return}if(this.plugins.push($),this.logger.debug(`Success: Plugin ${$.name} added to active plugins for ${this.character.name}(${this.agentId}).`),$.init)try{await $.init($.config||{},this),this.logger.debug(`Success: Plugin ${$.name} initialized successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(P.includes("API key")||P.includes("environment variables")||P.includes("Invalid plugin configuration"))console.warn(`Plugin ${$.name} requires configuration. ${P}`),console.warn("Please check your environment variables and ensure all required API keys are set."),console.warn("You can set these in your .env file.");else throw K}if($.adapter)this.logger.debug(`Registering database adapter for plugin ${$.name}`),this.registerDatabaseAdapter($.adapter);if($.actions)for(let K of $.actions)this.registerAction(K);if($.evaluators)for(let K of $.evaluators)this.registerEvaluator(K);if($.providers)for(let K of $.providers)this.registerProvider(K);if($.models)for(let[K,P]of Object.entries($.models))this.registerModel(K,P,$.name,$?.priority);if($.routes)for(let K of $.routes){let P=K.path.startsWith("/")?K.path:`/${K.path}`;this.routes.push({...K,path:"/"+$.name+P})}if($.events)for(let[K,P]of Object.entries($.events))for(let _ of P)this.registerEvent(K,_);if($.services)for(let K of $.services){if(!this.servicePromises.has(K.serviceType))this._createServiceResolver(K.serviceType);this.serviceRegistrationStatus.set(K.serviceType,"pending"),this.registerService(K).catch((P)=>{this.logger.error(`Service registration failed for ${K.serviceType}: ${P instanceof Error?P.message:String(P)}`);let _=this.servicePromiseHandlers.get(K.serviceType);if(_){let O=Error(`Service ${K.serviceType} failed to register: ${P instanceof Error?P.message:String(P)}`);_.reject(O),this.servicePromiseHandlers.delete(K.serviceType),this.servicePromises.delete(K.serviceType)}this.serviceRegistrationStatus.set(K.serviceType,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug(`runtime::stop - character ${this.character.name}`);for(let[$,q]of this.services){this.logger.debug(`runtime::stop - requesting service stop for ${$}`);for(let K of q)await K.stop()}}async initialize(){try{let $=[],q=this.characterPlugins;for(let z of q)if(z)$.push(this.registerPlugin(z));if(await Promise.all($),!this.adapter)throw this.logger.error("Database adapter not initialized. Make sure @elizaos/plugin-sql is included in your plugins."),Error("Database adapter not initialized. The SQL plugin (@elizaos/plugin-sql) is required for agent initialization. Please ensure it is included in your character configuration.");if(!await this.adapter.isReady())await this.adapter.init();this.messageService=new sH,this.logger.info("Running plugin migrations..."),await this.runPluginMigrations(),this.logger.info("Plugin migrations completed.");let K=await this.ensureAgentExists({...this.character,id:this.agentId});if(!K){let z=`Agent ${this.agentId} does not exist in database after ensureAgentExists call`;throw Error(z)}let P=await this.getEntityById(this.agentId);if(!P){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:K.id})){let J=`Failed to create entity for agent ${this.agentId}`;throw Error(J)}if(P=await this.getEntityById(this.agentId),!P)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug(`Success: Agent entity created successfully for ${this.character.name}`)}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,serverId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId)){let J=`Failed to add agent ${this.agentId} as participant to its own room`;throw Error(J)}this.logger.debug(`Agent ${this.character.name} linked to its own room successfully`)}if(!this.getModel(I6.TEXT_EMBEDDING))this.logger.warn(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered. Skipping embedding dimension setup.`);else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}catch($){let q=$ instanceof Error?$.message:String($);if(this.logger.error(`Runtime initialization failed: ${q}`),this.initRejecter)this.initRejecter($),this.initRejecter=void 0;for(let[K,P]of this.servicePromises){let _=this.servicePromiseHandlers.get(K);if(_){let O=Error(`Service ${K} failed to start due to runtime initialization failure: ${q}`);_.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K),this.serviceRegistrationStatus.set(K,"failed")}}throw $}}async runPluginMigrations(){if(!this.adapter){this.logger.warn("Database adapter not found, skipping plugin migrations.");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn("Database adapter does not support plugin migrations.");return}let $=this.plugins.filter((q)=>q.schema).map((q)=>({name:q.name,schema:q.schema}));if($.length===0){this.logger.info("No plugins with schemas found, skipping migrations.");return}this.logger.info(`Found ${$.length} plugins with schemas to migrate.`);try{let P={verbose:!0,force:process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true",dryRun:!1};await this.adapter.runPluginMigrations($,P),this.logger.info("Plugin migrations completed successfully.")}catch(q){throw this.logger.error(q instanceof Error?q:Error(String(q)),"Failed to run plugin migrations"),q}}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,K=!1){if(K){if(!this.character.secrets)this.character.secrets={};this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};this.character.settings[$]=q}}getSetting($){let q=this.character.secrets?.[$]||this.character.settings?.[$]||typeof this.character.settings==="object"&&this.character.settings!==null&&"secrets"in this.character.settings&&this.character.settings.secrets?.[$]||this.settings[$],K=HO(q,u_());if(K==="true")return!0;if(K==="false")return!1;return K||null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn("Database adapter already registered. Additional adapters will be ignored. This may lead to unexpected behavior.");else this.adapter=$,this.logger.debug("Success: Database adapter registered successfully.")}registerProvider($){this.providers.push($),this.logger.debug(`Success: Provider ${$.name} registered successfully.`)}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn(`${this.character.name}(${this.agentId}) - Action ${$.name} already exists. Skipping registration.`);else try{this.actions.push($),this.logger.success(`${this.character.name}(${this.agentId}) - Action ${$.name} registered successfully.`)}catch(q){console.error("Error registering action",q)}}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,K){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn(`Invalid step index: ${q} for plan with ${$.steps?.length||0} steps`),$;return{...$,steps:$.steps.map((P,_)=>_===q?{...P,...K}:P)}}async processActions($,q,K,P){let _=[];for(let k of q)if(k.content?.actions&&k.content.actions.length>0)_.push(...k.content.actions);let O=_.length>1,j=this.getCurrentRunId(),z=this.createRunId(),J=null;if(O){let k=q[0]?.content?.thought||`Executing ${_.length} actions: ${_.join(", ")}`;J={runId:z,totalSteps:_.length,currentStep:0,steps:_.map((X)=>({action:X,status:"pending"})),thought:k,startTime:Date.now()}}let w=0;for(let k of q){let C=function(E){return E.toLowerCase().replace(/_/g,"")};if(!k.content?.actions||k.content.actions.length===0){this.logger.warn("No action found in the response content.");continue}let X=k.content.actions,G=[],V=K;this.logger.debug(`Found actions: ${this.actions.map((E)=>C(E.name))}`);for(let E of X){if(J)J=this.updateActionPlan(J,{currentStep:w+1});if(V=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),J&&V.data)V.data.actionPlan=J,V.data.actionResults=G;this.logger.debug(`Success: Calling action: ${E}`);let h=C(E),I=this.actions.find((D)=>C(D.name)===h);if(!I)I=this.actions.find((D)=>C(D.name).includes(h)||h.includes(C(D.name)));if(I)this.logger.debug(`Success: Found action: ${I?.name}`);else{this.logger.debug("Attempting to find action in similes.");for(let D of this.actions){if(D.similes?.find((y)=>C(y)===h)){I=D,this.logger.debug(`Success: Action found in similes (exact match): ${I.name}`);break}if(D.similes?.find((y)=>C(y).includes(h)||h.includes(C(y)))){I=D,this.logger.debug(`Success: Action found in similes (fuzzy match): ${I.name}`);break}}}if(!I){let D=`No action found for: ${E}`;if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:D});let g={id:Iq(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:D,source:"auto",type:"action_result",actionName:E,actionStatus:"failed",runId:z}};await this.createMemory(g,"messages"),w++;continue}if(!I.handler){if(this.logger.error(`Action ${I.name} has no handler.`),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:"No handler"});w++;continue}try{this.logger.debug(`Executing handler for action: ${I.name}`);let D=Iq();this.currentActionContext={actionName:I.name,actionId:D,prompts:[]};let u={actionContext:{previousResults:G,getPreviousResult:(o)=>{return G.find((M)=>M.data?.actionName===o)}}};if(J)u.actionPlan={totalSteps:J.totalSteps,currentStep:J.currentStep,steps:J.steps,thought:J.thought};try{this.logger.debug(`Creating action start message for: ${I.name}`),await this.emitEvent("ACTION_STARTED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${I.name}`,actions:[I.name],actionStatus:"executing",actionId:D,runId:z,type:"agent_action",thought:J?.thought,source:$.content?.source}})}catch(o){this.logger.error("Failed to create action start message:",String(o))}let y=[],p=async(o)=>{return y.push(o),[]},m=await I.handler(this,$,V,u,p,q),s=m===void 0||m===null||typeof m==="boolean",U=null;if(!s){if(typeof m==="object"&&m!==null&&(("values"in m)||("data"in m)||("text"in m)))U={...m,success:"success"in m?m.success:!0};else U={success:!0,data:{actionName:I.name,legacyResult:m}};if(G.push(U),U.values)V={...V,values:{...V.values,...U.values},data:{...V.data||{},actionResults:[...V.data?.actionResults||[],U],actionPlan:J}};if(U&&V.data){if(!V.data.workingMemory)V.data.workingMemory={};let o=`action_${E}_${Iq()}`,M={actionName:I.name,result:U,timestamp:Date.now()};V.data.workingMemory[o]=M;let Y=Object.entries(V.data.workingMemory);if(Y.length>this.maxWorkingMemoryEntries){let H=Y.sort((T,W)=>{let Z=T[1],S=W[1],N=Z?.timestamp??0;return(S?.timestamp??0)-N});V.data.workingMemory=Object.fromEntries(H.slice(0,this.maxWorkingMemoryEntries))}}if(J&&J.steps[w])J=this.updateActionStep(J,w,{status:"completed",result:U})}try{let M=U?.success!==!1?"completed":"failed";await this.emitEvent("ACTION_COMPLETED",{messageId:D,roomId:$.roomId,world:$.worldId,content:{text:`Action ${I.name} ${M}`,actions:[I.name],actionStatus:M,actionId:D,type:"agent_action",actionResult:U,source:$.content?.source}})}catch(o){let M=o instanceof Error?o.message:String(o);this.logger.error(`Failed to emit ACTION_COMPLETED event for action ${I.name} (${D}): ${M}`)}if(P)for(let o of y)await P(o);let l={id:D,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:U?.text||`Executed action: ${I.name}`,source:"action",type:"action_result",actionName:I.name,actionStatus:U?.success?"completed":"failed",actionResult:s?{legacy:m}:U,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,actionId:D,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};await this.createMemory(l,"messages"),this.logger.debug(`Action ${I.name} completed`,JSON.stringify({isLegacyReturn:s,result:s?m:void 0,hasValues:U?!!U.values:!1,hasData:U?!!U.data:!1,hasText:U?!!U.text:!1})),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:I.name,actionId:D,message:$.content.text,messageId:$.id,state:V,responses:q,result:s?{legacy:m}:U,isLegacyReturn:s,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:z,parentRunId:j,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}}}),this.currentActionContext=void 0}catch(D){let g=D instanceof Error?D.message:String(D);if(this.logger.error(D),J&&J.steps[w])J=this.updateActionStep(J,w,{status:"failed",error:g});this.currentActionContext=void 0;let u={success:!1,data:{actionName:I.name,error:g,errorObject:D}};G.push(u);let y={id:Iq(),content:{thought:g,source:"auto",type:"action_result",actionName:I.name,actionStatus:"failed",error:g,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,metadata:{type:"action_result",actionName:I.name,runId:z,parentRunId:j,error:!0,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};if(await this.createMemory(y,"messages"),D?.critical||D?.code==="CRITICAL_ERROR")throw D}w++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:G},data:{actionResults:G,actionPlan:J},text:JSON.stringify(G)})}}async evaluate($,q,K,P,_){try{let O=this.evaluators.map(async(z)=>{try{if(!z.handler)return null;if(!K&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}catch(J){return this.logger.error({error:J,evaluatorName:z.name},`Error validating evaluator ${z.name}`),null}}),j=(await Promise.all(O)).filter(Boolean);if(j.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(j.map(async(z)=>{try{if(z.handler)await z.handler(this,$,q,{},P,_),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})}catch(J){this.logger.error({error:J,evaluatorName:z.name},`Error executing evaluator ${z.name}`)}})),j}catch(O){return this.logger.error({error:O,messageId:$.id,roomId:$.roomId},"Error in evaluate method"),[]}}async ensureConnections($,q,K,P){if(!$){console.trace(),this.logger.error("ensureConnections - no entities");return}if(!q||q.length===0){console.trace(),this.logger.error("ensureConnections - no rooms");return}await this.ensureWorldExists({...P,agentId:this.agentId});let _=q[0],O=(u,y)=>u.reduce((p,m,s)=>{if(s%y===0)p.push([]);return p[p.length-1].push(m),p},[]),j=q.map((u)=>u.id),J=(await this.getRoomsByIds(j))?.map((u)=>u.id),w=j.filter((u)=>!J?.includes(u)),k={worldId:P.id,serverId:P.serverId,source:K,agentId:this.agentId};if(w.length){this.logger.debug("runtime/ensureConnections - create",w.length.toLocaleString(),"rooms");let u=q.filter((y)=>w.includes(y.id)).map((y)=>({...y,...k}));await this.createRooms(u)}let X=$.map((u)=>u.id),V=(await this.adapter.getEntitiesByIds(X))?.map((u)=>u.id),C=$.filter((u)=>!V?.includes(u.id)),E={roomId:_.id,channelId:_.channelId,type:_.type},h={worldId:P.id,serverId:P.serverId};if(C.length){this.logger.debug("runtime/ensureConnections - creating",C.length.toLocaleString(),"entities...");let u={...E,...h,source:K,agentId:this.agentId},y=C.map((m)=>({...m,...u})),p=O(y,5000);for(let m of p)await this.createEntities(m)}await this.ensureParticipantInRoom(this.agentId,_.id);let D=(await this.getParticipantsForRoom(_.id)).filter(Boolean),g=X.filter((u)=>!D.includes(u));if(g.length){this.logger.debug("runtime/ensureConnections - Missing",g.length.toLocaleString(),"connections in",_.id);let u=O(g,5000);for(let y of u)await this.addParticipantsRoom(y,_.id)}this.logger.success("Success: Successfully connected world")}async ensureConnection({entityId:$,roomId:q,worldId:K,worldName:P,userName:_,name:O,source:j,type:z,channelId:J,serverId:w,userId:k,metadata:X}){if(!K&&w)K=Q8(this,w);let G=[O,_].filter(Boolean),V={[j]:{id:k,name:O,userName:_}};try{let C=await this.getEntityById($);if(!C)try{if(await this.createEntity({id:$,names:G,metadata:V,agentId:this.agentId}))this.logger.debug(`Created new entity ${$} for user ${O||_||"unknown"}`);else throw Error(`Failed to create entity ${$}`)}catch(E){if(E.message?.includes("duplicate key")||E.code==="23505")this.logger.debug(`Entity ${$} exists in database but not for this agent. This is normal in multi-agent setups.`);else throw E}else await this.adapter.updateEntity({id:$,names:[...new Set([...C.names||[],...G])].filter(Boolean),metadata:{...C.metadata,[j]:{...C.metadata?.[j],id:k,name:O,userName:_}},agentId:this.agentId});await this.ensureWorldExists({id:K,name:P||w?`World for server ${w}`:`World for room ${q}`,agentId:this.agentId,serverId:w||"default",metadata:X}),await this.ensureRoomExists({id:q,name:O||"default",source:j||"default",type:z||"DM",channelId:J,serverId:w,worldId:K});try{await this.ensureParticipantInRoom($,q)}catch(E){if(E.message?.includes("not found")){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);this.logger.debug(`Added participant ${$} to room ${q} directly`)}else throw E}await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug(`Success: Successfully connected entity ${$} in room ${q}`)}catch(C){throw this.logger.error(`Failed to ensure connection: ${C instanceof Error?C.message:String(C)}`),C}}async ensureParticipantInRoom($,q){let K=await this.getEntityById($);if(!K&&$!==this.agentId)this.logger.warn(`Entity ${$} not directly accessible to agent ${this.agentId}. Will attempt to add as participant anyway.`);else if(!K&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!K)throw Error(`User entity ${$} not found, cannot add as participant.`);if(!(await this.adapter.getParticipantsForRoom(q)).includes($)){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);if($===this.agentId)this.logger.debug(`Agent ${this.character.name} linked to room ${q} successfully.`);else this.logger.debug(`User ${$} linked to room ${q} successfully.`)}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,serverId:K,metadata:P}){if(!await this.getWorld($))this.logger.debug("Creating world:",JSON.stringify({id:$,name:q,serverId:K,agentId:this.agentId})),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,serverId:K||"default",metadata:P}),this.logger.debug(`World ${$} created successfully.`)}async ensureRoomExists({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}){if(!j)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}),this.logger.debug(`Room ${$} created successfully.`)}async composeState($,q=null,K=!1,P=!1){let _=K?q:null,O={values:{},data:{},text:""},j=P||!$.id?O:await this.stateCache.get($.id)||O,z=new Set;if(_&&_.length>0)_.forEach((E)=>z.add(E));else this.providers.filter((E)=>!E.private&&!E.dynamic).forEach((E)=>z.add(E.name));if(!_&&q&&q.length>0)q.forEach((E)=>z.add(E));let J=Array.from(new Set(this.providers.filter((E)=>z.has(E.name)))).sort((E,h)=>(E.position||0)-(h.position||0)),w=await Promise.all(J.map(async(E)=>{let h=Date.now();try{let I=await E.get(this,$,j),D=Date.now()-h;if(D>100)this.logger.debug(`${E.name} Provider took ${D}ms to respond`);return{...I,providerName:E.name}}catch(I){return console.error("provider error",E.name,I),{values:{},text:"",data:{},providerName:E.name}}})),k={...j.data?.providers||{}};for(let E of w)k[E.providerName]=E;let X=[];for(let E of J){let h=k[E.name];if(h&&h.text&&h.text.trim()!=="")X.push(h.text)}let G=X.join(`
594
+ `;async function iP$($,q,K){let P=Q8($,K),_=await $.getWorld(P);if(!_||!_.metadata?.roles)return"NONE";if(_.metadata.roles[q])return _.metadata.roles[q];if(_.metadata.roles[q])return _.metadata.roles[q];return"NONE"}async function BP$($,q){if(!q)return j6.error("User ID is required to find server"),null;let K=await $.getAllWorlds();if(!K||K.length===0)return j6.info("No worlds found for this agent"),null;let P=[];for(let _ of K)if(_.metadata?.ownership?.ownerId===q)P.push(_);return P.length?P:null}var Gq=[];for(let $=0;$<256;++$)Gq.push(($+256).toString(16).slice(1));function $0($,q=0){return(Gq[$[q+0]]+Gq[$[q+1]]+Gq[$[q+2]]+Gq[$[q+3]]+"-"+Gq[$[q+4]]+Gq[$[q+5]]+"-"+Gq[$[q+6]]+Gq[$[q+7]]+"-"+Gq[$[q+8]]+Gq[$[q+9]]+"-"+Gq[$[q+10]]+Gq[$[q+11]]+Gq[$[q+12]]+Gq[$[q+13]]+Gq[$[q+14]]+Gq[$[q+15]]).toLowerCase()}var aH,rn=new Uint8Array(16);function QH(){if(!aH){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");aH=crypto.getRandomValues.bind(crypto)}return aH(rn)}var on=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),eH={randomUUID:on};function nn($,q,K){$=$||{};let P=$.random??$.rng?.()??QH();if(P.length<16)throw Error("Random bytes length must be >= 16");if(P[6]=P[6]&15|64,P[8]=P[8]&63|128,q){if(K=K||0,K<0||K+16>q.length)throw RangeError(`UUID byte range ${K}:${K+15} is out of buffer bounds`);for(let _=0;_<16;++_)q[K+_]=P[_];return q}return $0(P)}function Bn($,q,K){if(eH.randomUUID&&!q&&!$)return eH.randomUUID();return nn($,q,K)}var Iq=Bn;SK();var Q7=new Map;class sH{async handleMessage($,q,K,P){let _={maxRetries:P?.maxRetries??3,timeoutDuration:P?.timeoutDuration??3600000,useMultiStep:P?.useMultiStep??zO($.getSetting("USE_MULTI_STEP")),maxMultiStepIterations:P?.maxMultiStepIterations??parseInt($.getSetting("MAX_MULTISTEP_ITERATIONS")||"6")},O=void 0,j=Iq();try{if($.logger.info(`[MessageService] Message received from ${q.entityId} in room ${q.roomId}`),!Q7.has($.agentId))Q7.set($.agentId,new Map);let z=Q7.get($.agentId);if(!z)throw Error("Agent responses map not found");let J=z.get(q.roomId);if(J)j6.warn(`[MessageService] Updating response ID for room ${q.roomId} from ${J} to ${j}`);z.set(q.roomId,j);let w=$.startRun(),k=Date.now();await $.emitEvent("RUN_STARTED",{runtime:$,runId:w,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:k,status:"started",source:"messageHandler",metadata:q.content});let X=new Promise((C,E)=>{O=setTimeout(async()=>{await $.emitEvent("RUN_TIMEOUT",{runtime:$,runId:w,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:k,status:"timeout",endTime:Date.now(),duration:Date.now()-k,error:"Run exceeded timeout",source:"messageHandler"}),E(Error("Run exceeded timeout"))},_.timeoutDuration)}),G=this.processMessage($,q,K,j,w,k,_),V=await Promise.race([G,X]);return clearTimeout(O),V}catch(z){throw clearTimeout(O),$.logger.error({error:z},"[MessageService] Error in handleMessage:"),z}}async processMessage($,q,K,P,_,O,j){try{let z=Q7.get($.agentId);if(!z)throw Error("Agent responses map not found");if(q.entityId===$.agentId)return $.logger.debug(`[MessageService] Skipping message from self (${$.agentId})`),await this.emitRunEnded($,_,q,O,"self"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};$.logger.debug(`[MessageService] Processing message: ${rM(q.content.text||"",50)}...`),$.logger.debug("[MessageService] Saving message to memory and queueing embeddings");let J;if(q.id){let e=await $.getMemoryById(q.id);if(e)$.logger.debug("[MessageService] Memory already exists, skipping creation"),J=e;else{let m=await $.createMemory(q,"messages");J={...q,id:m}}await $.queueEmbeddingGeneration(J,"high")}else{let e=await $.createMemory(q,"messages");q.id=e,J={...q,id:e},await $.queueEmbeddingGeneration(J,"normal")}let w=await $.getParticipantUserState(q.roomId,$.agentId);if(zO($.getSetting("BOOTSTRAP_DEFLLMOFF"))&&w===null)return $.logger.debug("[MessageService] LLM is off by default"),await this.emitRunEnded($,_,q,O,"off"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};if(w==="MUTED"&&!q.content.text?.toLowerCase().includes($.character.name.toLowerCase()))return $.logger.debug(`[MessageService] Ignoring muted room ${q.roomId}`),await this.emitRunEnded($,_,q,O,"muted"),{didRespond:!1,responseContent:null,responseMessages:[],state:{},mode:"none"};let X=await $.composeState(q,["ANXIETY","ENTITIES","CHARACTER","RECENT_MESSAGES","ACTIONS"],!0),G=q.content.mentionContext,V=await $.getRoom(q.roomId);if(q.content.attachments&&q.content.attachments.length>0){if(q.content.attachments=await this.processAttachments($,q.content.attachments),q.id)await $.updateMemory({id:q.id,content:q.content})}let C=this.shouldRespond($,q,V??void 0,G);$.logger.debug(`[MessageService] Response decision: ${JSON.stringify(C)}`);let E=!0;if(C.skipEvaluation)$.logger.debug(`[MessageService] Skipping evaluation for ${$.character.name} (${C.reason})`),E=C.shouldRespond;else{let e=a7({state:X,template:$.character.templates?.shouldRespondTemplate||FM});$.logger.debug(`[MessageService] Using LLM evaluation for ${$.character.name} (${C.reason})`);let m=await $.useModel(I6.TEXT_SMALL,{prompt:e});$.logger.debug(`[MessageService] LLM evaluation result:
595
+ ${m}`);let o=UK(m);$.logger.debug({responseObject:o},"[MessageService] Parsed evaluation result:");let M=["IGNORE","NONE"];E=o?.action&&!M.includes(o.action.toUpperCase())}let h=null,I=[],D="none";if(E){let e=j.useMultiStep?await this.runMultiStepCore($,q,X,K,j):await this.runSingleShotCore($,q,X,j);if(h=e.responseContent,I=e.responseMessages,X=e.state,D=e.mode,z.get(q.roomId)!==P)return $.logger.info(`Response discarded - newer message being processed for agent: ${$.agentId}, room: ${q.roomId}`),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};if(h&&q.id)h.inReplyTo=Q8($,q.id);if(h?.providers?.length&&h.providers.length>0)X=await $.composeState(q,h.providers||[]);if(h){if(D==="simple"){if(h.providers&&h.providers.length>0)$.logger.debug({providers:h.providers},"[MessageService] Simple response used providers");if(K)await K(h)}else if(D==="actions")await $.processActions(q,I,X,async(o)=>{if($.logger.debug({content:o},"action callback"),h.actionCallbacks=o,K)return K(o);return[]})}}else{$.logger.debug("[MessageService] Agent decided not to respond (shouldRespond is false).");let e=z.get(q.roomId),m=zO($.getSetting("BOOTSTRAP_KEEP_RESP"));if(e!==P&&!m)return $.logger.info(`Ignore response discarded - newer message being processed for agent: ${$.agentId}, room: ${q.roomId}`),await this.emitRunEnded($,_,q,O,"replaced"),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};if(!q.id)return $.logger.error("[MessageService] Message ID is missing, cannot create ignore response."),await this.emitRunEnded($,_,q,O,"noMessageId"),{didRespond:!1,responseContent:null,responseMessages:[],state:X,mode:"none"};let o={thought:"Agent decided not to respond to this message.",actions:["IGNORE"],simple:!0,inReplyTo:Q8($,q.id)};if(K)await K(o);let M={id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:o,roomId:q.roomId,createdAt:Date.now()};await $.createMemory(M,"messages"),$.logger.debug("[MessageService] Saved ignore response to memory",`memoryId: ${M.id}`)}if(z.delete(q.roomId),z.size===0)Q7.delete($.agentId);await $.evaluate(q,X,E,async(e)=>{if($.logger.debug({content:e},"evaluate callback"),h)h.evalCallbacks=e;if(K)return K(e);return[]},I);let g="noname";if(q.metadata&&"entityName"in q.metadata)g=q.metadata.entityName;let u=q.content?.channelType==="DM",y=g;if(!u){let e=await $.getRoomsByIds([q.roomId]);if(e?.length){let m=e[0];if(m.name)y=m.name;if(m.worldId){let o=await $.getWorld(m.worldId);if(o)y=o.name+"-"+y}}}let p=new Date,l=X.data?.providers?.ACTIONS?.data?.actionsData?.map((e)=>e.name)||[-1],Q={at:p.toString(),timestamp:parseInt(""+p.getTime()/1000),messageId:q.id,userEntityId:q.entityId,input:q.content.text,thought:h?.thought,simple:h?.simple,availableActions:l,actions:h?.actions,providers:h?.providers,irt:h?.inReplyTo,output:h?.text,entityName:g,source:q.content.source,channelType:q.content.channelType,roomName:y};return await $.emitEvent("RUN_ENDED",{runtime:$,runId:_,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:O,status:"completed",endTime:Date.now(),duration:Date.now()-O,source:"messageHandler",entityName:g,responseContent:h,metadata:Q}),{didRespond:E,responseContent:h,responseMessages:I,state:X,mode:D}}catch(z){throw console.error("error is",z),await $.emitEvent("RUN_ENDED",{runtime:$,runId:_,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:O,status:"error",endTime:Date.now(),duration:Date.now()-O,error:z.message,source:"messageHandler"}),z}}shouldRespond($,q,K,P){if(!K)return{shouldRespond:!1,skipEvaluation:!0,reason:"no room context"};function _(C){if(!C||typeof C!=="string")return[];return C.trim().replace(/^\[|\]$/g,"").split(",").map((h)=>h.trim()).filter(Boolean)}let O=["DM","VOICE_DM","SELF","API"],j=["client_chat"],z=_($.getSetting("ALWAYS_RESPOND_CHANNELS")||$.getSetting("SHOULD_RESPOND_BYPASS_TYPES")),J=_($.getSetting("ALWAYS_RESPOND_SOURCES")||$.getSetting("SHOULD_RESPOND_BYPASS_SOURCES")),w=new Set([...O.map((C)=>C.toString()),...z].map((C)=>C.trim().toLowerCase())),k=[...j,...J].map((C)=>C.trim().toLowerCase()),X=K.type?.toString().toLowerCase(),G=q.content.source?.toLowerCase()||"";if(w.has(X))return{shouldRespond:!0,skipEvaluation:!0,reason:`private channel: ${X}`};if(k.some((C)=>G.includes(C)))return{shouldRespond:!0,skipEvaluation:!0,reason:`whitelisted source: ${G}`};if(!!(P?.isMention||P?.isReply))return{shouldRespond:!0,skipEvaluation:!0,reason:`platform ${P?.isMention?"mention":"reply"}`};return{shouldRespond:!1,skipEvaluation:!1,reason:"needs LLM evaluation"}}async processAttachments($,q){if(!q||q.length===0)return[];$.logger.debug(`[MessageService] Processing ${q.length} attachment(s)`);let K=[];for(let P of q)try{let _={...P},O=/^(http|https):\/\//.test(P.url),j=O?P.url:iM(P.url);if(P.contentType==="image"&&!P.description){$.logger.debug(`[MessageService] Generating description for image: ${P.url}`);let z=j;if(!O){let J=await fetch(j);if(!J.ok)throw Error(`Failed to fetch image: ${J.statusText}`);let w=await J.arrayBuffer(),k=Buffer.from(w);z=`data:${J.headers.get("content-type")||"application/octet-stream"};base64,${k.toString("base64")}`}try{let J=await $.useModel(I6.IMAGE_DESCRIPTION,{prompt:QM,imageUrl:z});if(typeof J==="string"){let w=UK(J);if(w&&(w.description||w.text))_.description=w.description||"",_.title=w.title||"Image",_.text=w.text||w.description||"",$.logger.debug(`[MessageService] Generated description: ${_.description?.substring(0,100)}...`);else{let k=J,X=k.match(/<title>([^<]+)<\/title>/),G=k.match(/<description>([^<]+)<\/description>/),V=k.match(/<text>([^<]+)<\/text>/);if(X||G||V)_.title=X?.[1]||"Image",_.description=G?.[1]||"",_.text=V?.[1]||G?.[1]||"",$.logger.debug(`[MessageService] Used fallback XML parsing - description: ${_.description?.substring(0,100)}...`);else $.logger.warn("[MessageService] Failed to parse XML response for image description")}}else if(J&&typeof J==="object"&&"description"in J)_.description=J.description,_.title=J.title||"Image",_.text=J.description,$.logger.debug(`[MessageService] Generated description: ${_.description?.substring(0,100)}...`);else $.logger.warn("[MessageService] Unexpected response format for image description")}catch(J){$.logger.error({error:J},"[MessageService] Error generating image description:")}}else if(P.contentType==="document"&&!P.text){let z=await fetch(j);if(!z.ok)throw Error(`Failed to fetch document: ${z.statusText}`);let J=z.headers.get("content-type")||"";if(J.startsWith("text/plain")){$.logger.debug(`[MessageService] Processing plain text document: ${P.url}`);let k=await z.text();_.text=k,_.title=_.title||"Text File",$.logger.debug(`[MessageService] Extracted text content (first 100 chars): ${_.text?.substring(0,100)}...`)}else $.logger.warn(`[MessageService] Skipping non-plain-text document: ${J}`)}K.push(_)}catch(_){$.logger.error({error:_,attachmentUrl:P.url},`[MessageService] Failed to process attachment ${P.url}:`),K.push(P)}return K}async runSingleShotCore($,q,K,P){if(K=await $.composeState(q,["ACTIONS"]),!K.values?.actionNames)$.logger.warn("actionNames data missing from state, even though it was requested");let _=a7({state:K,template:$.character.templates?.messageHandlerTemplate||aM}),O=null,j=0;while(j<P.maxRetries&&(!O?.thought||!O?.actions)){let w=await $.useModel(I6.TEXT_LARGE,{prompt:_});$.logger.debug({response:w},"[MessageService] *** Raw LLM Response ***");let k=UK(w);if($.logger.debug({parsedXml:k},"[MessageService] *** Parsed XML Content ***"),k)O={...k,thought:k.thought||"",actions:k.actions||["IGNORE"],providers:k.providers||[],text:k.text||"",simple:k.simple||!1};else O=null;if(j++,!O?.thought||!O?.actions)$.logger.warn({response:w,parsedXml:k,responseContent:O},"[MessageService] *** Missing required fields (thought or actions), retrying... ***")}if(!O)return{responseContent:null,responseMessages:[],state:K,mode:"none"};if(O.actions&&O.actions.length>1){let w=(X)=>typeof X==="string"&&X.toUpperCase()==="IGNORE";if(O.actions.some(w))if(!O.text||O.text.trim()==="")O.actions=["IGNORE"];else{let X=O.actions.filter((G)=>!w(G));O.actions=X.length?X:["REPLY"]}}let z=O.actions?.length===1&&typeof O.actions[0]==="string"&&O.actions[0].toUpperCase()==="REPLY"&&(!O.providers||O.providers.length===0);O.simple=z;let J=[{id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:O,roomId:q.roomId,createdAt:Date.now()}];return{responseContent:O,responseMessages:J,state:K,mode:z&&O.text?"simple":"actions"}}async runMultiStepCore($,q,K,P,_){let O=[],j=K,z=0;while(z<_.maxMultiStepIterations){z++,$.logger.debug(`[MultiStep] Starting iteration ${z}/${_.maxMultiStepIterations}`),j=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]),j.data.actionResults=O;let V=a7({state:j,template:$.character.templates?.multiStepDecisionTemplate||eM}),C=await $.useModel(I6.TEXT_LARGE,{prompt:V}),E=UK(C);if(!E){$.logger.warn(`[MultiStep] Failed to parse step result at iteration ${z}`),O.push({data:{actionName:"parse_error"},success:!1,error:"Failed to parse step result"});break}let{thought:h,providers:I=[],action:D,isFinish:g}=E;if(g==="true"||g===!0){if($.logger.info(`[MultiStep] Task marked as complete at iteration ${z}`),P)await P({text:"",thought:h??""});break}if((!I||I.length===0)&&!D){$.logger.warn(`[MultiStep] No providers or action specified at iteration ${z}, forcing completion`);break}try{for(let u of I){let y=$.providers.find((Q)=>Q.name===u);if(!y){$.logger.warn(`[MultiStep] Provider not found: ${u}`),O.push({data:{actionName:u},success:!1,error:`Provider not found: ${u}`});continue}let p=await y.get($,q,K);if(!p){$.logger.warn(`[MultiStep] Provider returned no result: ${u}`),O.push({data:{actionName:u},success:!1,error:"Provider returned no result"});continue}let l=!!p.text;if(O.push({data:{actionName:u},success:l,text:l?p.text:void 0,error:l?void 0:"Provider returned no result"}),P)await P({text:`\uD83D\uDD0E Provider executed: ${u}`,actions:[u],thought:h??""})}if(D){let u={text:`\uD83D\uDD0E Executing action: ${D}`,actions:[D],thought:h??""};await $.processActions(q,[{id:Iq(),entityId:$.agentId,roomId:q.roomId,createdAt:Date.now(),content:u}],K,async()=>{return[]});let p=$.stateCache?.get(`${q.id}_action_results`)?.values?.actionResults||[],l=p.length>0?p[0]:null,Q=l?.success??!1;O.push({data:{actionName:D},success:Q,text:l?.text,values:l?.values,error:Q?void 0:l?.text})}}catch(u){$.logger.error({err:u},"[MultiStep] Error executing step"),O.push({data:{actionName:D||"unknown"},success:!1,error:u instanceof Error?u.message:String(u)})}}if(z>=_.maxMultiStepIterations)$.logger.warn(`[MultiStep] Reached maximum iterations (${_.maxMultiStepIterations}), forcing completion`);j=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]);let J=a7({state:j,template:$.character.templates?.multiStepSummaryTemplate||sM}),w=await $.useModel(I6.TEXT_LARGE,{prompt:J}),k=UK(w),X=null;if(k?.text)X={actions:["MULTI_STEP_SUMMARY"],text:k.text,thought:k.thought||"Final user-facing message after task completion.",simple:!0};let G=X?[{id:e7(Iq()),entityId:$.agentId,agentId:$.agentId,content:X,roomId:q.roomId,createdAt:Date.now()}]:[];return{responseContent:X,responseMessages:G,state:j,mode:X?"simple":"none"}}async emitRunEnded($,q,K,P,_){await $.emitEvent("RUN_ENDED",{runtime:$,runId:q,messageId:K.id,roomId:K.roomId,entityId:K.entityId,startTime:P,status:_,endTime:Date.now(),duration:Date.now()-P,source:"messageHandler"})}async deleteMessage($,q){try{if(!q.id){$.logger.error("[MessageService] Cannot delete memory: message ID is missing");return}$.logger.info("[MessageService] Deleting memory for message",q.id,"from room",q.roomId),await $.deleteMemory(q.id),$.logger.debug({messageId:q.id},"[MessageService] Successfully deleted memory for message")}catch(K){throw $.logger.error({error:K},"[MessageService] Error in deleteMessage:"),K}}async clearChannel($,q,K){try{$.logger.info(`[MessageService] Clearing message memories from channel ${K} -> room ${q}`);let P=await $.getMemoriesByRoomIds({tableName:"messages",roomIds:[q]});$.logger.info(`[MessageService] Found ${P.length} message memories to delete from channel ${K}`);let _=0;for(let O of P)if(O.id)try{await $.deleteMemory(O.id),_++}catch(j){$.logger.warn({error:j,memoryId:O.id},`[MessageService] Failed to delete message memory ${O.id}:`)}$.logger.info(`[MessageService] Successfully cleared ${_}/${P.length} message memories from channel ${K}`)}catch(P){throw $.logger.error({error:P},"[MessageService] Error in clearChannel:"),P}}}var CK=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},tn=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},Un=($)=>{switch($){case 99:case 100:case 101:case 103:case 104:case 107:case 109:case 110:case 114:case 116:return!0;default:return!1}},Fn=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},q0=($,q)=>{return q>=2&&CK($[q-2])&&(q===2&&!CK($[q-1])||q>=3&&!CK($[q-3])&&!tn($[q-1]))},an=($)=>{if($.length<3)return $;if($.length<=6)switch($){case"ski":return"ski";case"skies":return"sky";case"dying":return"die";case"lying":return"lie";case"tying":return"tie";case"idly":return"idl";case"gently":return"gentl";case"ugly":return"ugli";case"early":return"earli";case"only":return"onli";case"singly":return"singl";case"sky":case"news":case"howe":case"atlas":case"cosmos":case"bias":case"andes":return $}let q=$.charCodeAt(0)===39?1:0,K=$.length-q,P=Array(K),_=!1;for(let k=0;k<K;++k){let X=$.charCodeAt(k+q);if(X===121&&(k===0||CK(P[k-1]))){_=!0,P[k]=89;continue}P[k]=X}if(P[K-1]===39)--K;if(K>=2&&P[K-2]===39&&P[K-1]===115)K-=2;let O=0;while(O<K&&!CK(P[O]))++O;if(O<K)++O;let j=O;if(K>=5&&(P[0]===103&&P[1]===101&&P[2]===110&&P[3]===101&&P[4]===114||P[0]===97&&P[1]===114&&P[2]===115&&P[3]===101&&P[4]===110))j=5;else if(K>=6&&P[0]===99&&P[1]===111&&P[2]===109&&P[3]===109&&P[4]===117&&P[5]===110)j=6;else{while(j<K&&CK(P[j]))++j;if(j<K)++j}let z=j;while(z<K&&!CK(P[z]))++z;while(z<K&&CK(P[z]))++z;if(z<K)++z;if(K>=3){if(P[K-1]===115){if(K>=4&&P[K-2]===101&&P[K-3]===115&&P[K-4]===115)K-=2;else if(P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1;else if(P[K-2]!==117&&P[K-2]!==115&&O<K-1)K-=1}else if(P[K-1]===100&&P[K-2]===101&&P[K-3]===105)K-=K>=5?2:1}if(K===6&&(P[0]===105&&P[1]===110&&P[2]===110&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===111&&P[1]===117&&P[2]===116&&P[3]===105&&P[4]===110&&P[5]===103||P[0]===101&&P[1]===120&&P[2]===99&&P[3]===101&&P[4]===101&&P[5]===100)||K===7&&(P[0]===99&&P[1]===97&&P[2]===110&&P[3]===110&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===104&&P[1]===101&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===101&&P[1]===97&&P[2]===114&&P[3]===114&&P[4]===105&&P[5]===110&&P[6]===103||P[0]===112&&P[1]===114&&P[2]===111&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100||P[0]===115&&P[1]===117&&P[2]===99&&P[3]===99&&P[4]===101&&P[5]===101&&P[6]===100)){let k="";for(let X=0;X<K;++X)k+=String.fromCharCode(P[X]);return k}let J=K>=2&&P[K-1]===121&&P[K-2]===108?K-2:K;if(J>=3)if(P[J-3]===101&&P[J-2]===101&&P[J-1]===100){if(J>=j+3)K=J-1}else{if(P[J-2]===101&&P[J-1]===100)J-=2;else if(P[J-3]===105&&P[J-2]===110&&P[J-1]===103)J-=3;else J=-1;if(J>=0&&O<=J){if(K=J,K>=2){if(P[K-1]===116&&P[K-2]===97||P[K-1]===108&&P[K-2]===98||P[K-1]===122&&P[K-2]===105)P[K]=101,++K;else if(P[K-2]===P[K-1]&&Fn(P[K-1]))--K;else if(j>=K&&q0(P,K))P[K]=101,++K}}}if(K>=3&&(P[K-1]===89||P[K-1]===121)&&!CK(P[K-2]))P[K-1]=105;if(K>=j+2)switch(P[K-1]){case 108:if(K>=j+6&&P[K-2]===97&&P[K-3]===110&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2;break;case 110:if(K>=j+5&&P[K-2]===111&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)if(K>=7&&P[K-6]===122&&P[K-7]===105){if(K>=j+7)K-=4,P[K-1]=101}else K-=2,P[K-1]=101;break;case 114:if(K>=j+4){if(P[K-2]===101){if(P[K-3]===122&&P[K-4]===105)--K}else if(P[K-2]===111){if(P[K-3]===116&&P[K-4]===97)--K,P[K-1]=101}}break;case 115:if(K>=j+7&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110&&(P[K-5]===108&&P[K-6]===117&&P[K-7]===102||P[K-5]===115&&P[K-6]===117&&P[K-7]===111||P[K-5]===101&&P[K-6]===118&&P[K-7]===105))K-=4;break;case 109:if(K>=j+5&&P[K-2]===115&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3;break;case 105:if(P[K-2]===99){if(K>=j+4&&(P[K-4]===101||P[K-4]===97)&&P[K-3]===110)P[K-1]=101}else if(P[K-2]===103){if(K>=j+3&&K>=4&&P[K-2]===103&&P[K-3]===111&&P[K-4]===108)--K}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===105){if(P[K-4]===108){if(K>=6&&P[K-5]===105&&P[K-6]===98){if(K>=j+6)K-=3,P[K-2]=108,P[K-1]=101}else if(P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-4]===118&&P[K-5]===105)K-=2,P[K-1]=101}}else if(P[K-2]===108&&K>=3){if(P[K-3]===98){if(K>=4&&P[K-4]===97){if(K>=j+4)P[K-1]=101}else if(K>=j+3)P[K-1]=101}else if(P[K-3]===108){if(K>=5&&P[K-4]===117&&P[K-5]===102){if(K>=j+5)K-=2}else if(K>=j+4&&P[K-4]===97)K-=2}else if(P[K-3]===115){if(K>=6&&P[K-4]===115&&P[K-5]===101&&P[K-6]===108){if(K>=j+6)K-=2}else if(K>=j+5&&P[K-4]===117&&P[K-5]===111)K-=2}else if(K>=5&&P[K-3]===116&&P[K-4]===110&&P[K-5]===101){if(K>=j+5)K-=2}else if(Un(P[K-3]))K-=2}}if(K>=j+3)switch(P[K-1]){case 108:if(P[K-3]===99){if(K>=j+4&&P[K-4]===105&&P[K-2]===97)K-=2}else if(P[K-3]===102){if(P[K-2]===117)K-=3}else if(P[K-3]===110){if(K>=j+6&&P[K-2]===97&&P[K-4]===111&&P[K-5]===105&&P[K-6]===116)if(K>=7&&P[K-7]===97){if(K>=j+7)K-=4,P[K-1]=101}else K-=2}break;case 101:if(P[K-2]===122){if(K>=j+5&&P[K-3]===105&&P[K-4]===108&&P[K-5]===97)K-=3}else if(P[K-2]===116){if(K>=j+5&&P[K-3]===97&&P[K-4]===99&&P[K-5]===105)K-=3}else if(P[K-2]===118){if(K>=z+5&&P[K-3]===105&&P[K-4]===116&&P[K-5]===97)K-=5}break;case 105:if(K>=j+5&&P[K-2]===116&&P[K-3]===105&&P[K-4]===99&&P[K-5]===105)K-=3;break;case 115:if(K>=j+4&&P[K-2]===115&&P[K-3]===101&&P[K-4]===110)K-=4}if(K>=z+2)switch(P[K-1]){case 110:if(K>=z+3&&P[K-2]===111&&P[K-3]===105&&(P[K-4]===115||P[K-4]===116))K-=3;break;case 108:if(P[K-2]===97)K-=2;break;case 114:if(P[K-2]===101)K-=2;break;case 99:if(P[K-2]===105)K-=2;break;case 109:if(K>=z+3&&P[K-2]===115&&P[K-3]===105)K-=3;break;case 105:if(K>=z+3&&P[K-2]===116&&P[K-3]===105)K-=3;break;case 115:if(K>=z+3&&P[K-2]===117&&P[K-3]===111)K-=3;break;case 116:if(K>=z+3&&P[K-2]===110){if(P[K-3]===97)K-=3;else if(P[K-3]===101)if(K>=4&&P[K-4]===109){if(K>=5&&P[K-5]===101){if(K>=z+5)K-=5}else if(K>=z+4)K-=4}else K-=3}break;case 101:if(P[K-2]===99){if(K>=z+4&&P[K-3]===110&&(P[K-4]===97||P[K-4]===101))K-=4}else if(P[K-2]===108){if(K>=z+4&&P[K-3]===98&&(P[K-4]===97||P[K-4]===105))K-=4}else if(P[K-2]===116){if(K>=z+3&&P[K-3]===97)K-=3}else if(K>=z+3&&(P[K-2]===118||P[K-2]===122)&&P[K-3]===105)K-=3}if(K>=j+1&&(K>=z+1&&P[K-1]===108&&P[K-2]===108||P[K-1]===101&&(K>=z+1||!q0(P,K-1))))--K;let w="";if(_)for(let k=0;k<K;++k)w+=String.fromCharCode(P[k]===89?121:P[k]);else for(let k=0;k<K;++k)w+=String.fromCharCode(P[k]);return w},Qn={k1:1.2,b:0.75,minLength:2,stopWords:new Set(["a","an","and","are","as","at","be","by","for","from","has","he","in","is","it","its","of","on","that","the","to","was","were","will","with"]),stemming:!1,stemWords:($)=>$};class $J{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...$J.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((K)=>({...K,pattern:typeof K.pattern==="string"?new RegExp(K.pattern):K.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let K=Date.now(),P=$.split(/\s+/).filter((z)=>z.length>0),O=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),j=q?{originalWordCount:P.length,stopWordsRemoved:P.length-O.length,stemmedWords:this.stemming?O.length:0,processingTimeMs:Date.now()-K}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:O,stats:j}}cleanText($){return $.toLowerCase().normalize("NFKD").replace(/[\u0000-\u001F\u007F-\u009F\u200B-\u200D\uFEFF]/g,"").replace(/[\u0300-\u036f]/g,"").replace(/[\p{Emoji_Presentation}\p{Extended_Pictographic}]/gu,"").replace(/[™®©℠‼]/g,"").replace(/[\p{P}]/gu," ").replace(/[^a-z0-9\u3040-\u30FF\u3400-\u4DBF\u4E00-\u9FFF\uAC00-\uD7AF\s]/gu," ").replace(/\s+/g," ").trim()}isValidToken($){let q=/^\d+$/.test($);return($.length>=this.minLength||q)&&!this.stopWords.has($)}stemWord($){if($.length<3)return $;let q=!1,K=$;for(let P of this.stemmingRules){let _=K.match(P.pattern);if(_){if(!P.minMeasure||this.measure(K.substring(0,_.index))>=P.minMeasure){if(typeof P.replacement==="string")K=K.replace(P.pattern,P.replacement);else K=K.replace(P.pattern,(...O)=>P.replacement(...O));q=!0}}}if(q&&K!==$)return K;return an(K)}isConsonant($,q){let K=$[q];if("aeiou".includes(K))return!1;return K!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,K=!1;for(let P=0;P<$.length;P++)if(this.isConsonant($,P)){if(K)q++,K=!1}else K=!0;return q}}class qJ{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let K={...Qn,...q};if(this.termFrequencySaturation=K.k1,this.lengthNormalizationFactor=K.b,this.tokenizer=new $J(K),this.fieldBoosts=K.fieldBoosts||{},this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex=new Map,this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies=new Map,$&&$.length>0){this.documents=[...$];let{documentLengths:P,termToIndex:_,documentFrequency:O,averageDocLength:j,termFrequencies:z}=this.processDocuments($);this.documentLengths=P,this.termToIndex=_,this.documentFrequency=O,this.averageDocLength=j,this.termFrequencies=z}}processDocuments($){let q=$.length,K=new Uint32Array(q),P=new Map,_=new Map,O=new Map,j=0,z=0;$.forEach((w,k)=>{let X=0,G=new Map;Object.entries(w).forEach(([V,C])=>{if(typeof C!=="string")return;let E=this.fieldBoosts[V]||1,{tokens:h}=this.tokenizer.tokenize(C),I=h.length*E;X+=I,h.forEach((D)=>{if(!P.has(D))P.set(D,z++);let g=P.get(D);if(!_.has(D))_.set(D,new Set);_.get(D).add(k);let u=G.get(g)||0;G.set(g,u+E)})}),K[k]=X,j+=X,G.forEach((V,C)=>{if(!O.has(C))O.set(C,new Map);O.get(C).set(k,V)})});let J=new Uint32Array(P.size);return _.forEach((w,k)=>{let X=P.get(k);J[X]=w.size}),{documentLengths:K,termToIndex:P,documentFrequency:J,averageDocLength:q>0?j/q:0,termFrequencies:O}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,K)=>q+K,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:K}=this.tokenizer.tokenize($),P=new Float32Array(this.documentLengths.length).fill(0);return K.forEach((_)=>{let O=this.termToIndex.get(_);if(O===void 0)return;let j=this.calculateIdf(O);if(j<=0)return;let z=this.termFrequencies.get(O);if(!z)return;z.forEach((J,w)=>{let k=this.documentLengths[w],X=J*(this.termFrequencySaturation+1),G=J+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*k/this.averageDocLength);P[w]+=j*(X/G)})}),Array.from({length:P.length},(_,O)=>({index:O,score:P[O]})).filter((_)=>_.score>0).sort((_,O)=>O.score-_.score).slice(0,q)}searchPhrase($,q=10){let{tokens:K}=this.tokenizer.tokenize($);if(K.length===0)return[];let P=null;for(let O of K){let j=this.termToIndex.get(O);if(j===void 0)return[];let z=this.termFrequencies.get(j)?.keys();if(!z)return[];let J=new Set(z);if(P===null)P=J;else P=new Set([...P].filter((w)=>J.has(w)));if(P.size===0)return[]}if(P===null||P.size===0)return[];let _=new Map;return P.forEach((O)=>{let j=this.getDocument(O),z=!1;Object.entries(j).forEach(([J,w])=>{if(typeof w!=="string"||z)return;let k=this.fieldBoosts[J]||1,{tokens:X}=this.tokenizer.tokenize(w);for(let G=0;G<=X.length-K.length;G++){let V=!0;for(let C=0;C<K.length;C++)if(X[G+C]!==K[C]){V=!1;break}if(V){let C=this.calculatePhraseScore(K,O)*k;_.set(O,(_.get(O)||0)+C),z=!0;break}}})}),Array.from(_.entries()).map(([O,j])=>({index:O,score:j})).sort((O,j)=>j.score-O.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((K,P)=>{let _=this.termToIndex.get(P);if(_===void 0)return K;let O=this.calculateIdf(_),j=this.termFrequencies.get(_)?.get(q)||0,z=this.documentLengths[q],J=j*(this.termFrequencySaturation+1),w=j+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return K+O*(J/w)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let K=new Uint32Array(q+1);K.set(this.documentLengths,0),this.documentLengths=K;let P=0,_=new Map;Object.entries($).forEach(([O,j])=>{if(typeof j!=="string")return;let z=this.fieldBoosts[O]||1,{tokens:J}=this.tokenizer.tokenize(j);P+=J.length*z,J.forEach((w)=>{let k;if(!this.termToIndex.has(w)){if(k=this.termToIndex.size,this.termToIndex.set(w,k),this.documentFrequency.length<=k){let G=this.documentFrequency,V=Math.max(k+1,G.length*2||1);this.documentFrequency=new Uint32Array(V),this.documentFrequency.set(G,0)}this.documentFrequency[k]=0}else k=this.termToIndex.get(w);let X=_.get(k)||0;_.set(k,X+z)})}),this.documentLengths[q]=P,_.forEach((O,j)=>{if(!this.termFrequencies.has(j))this.termFrequencies.set(j,new Map);if(this.termFrequencies.get(j).set(q,O),j<this.documentFrequency.length)this.documentFrequency[j]++;else console.error(`Error: termIndexVal ${j} is out of bounds for documentFrequency (length ${this.documentFrequency.length}). This indicates an issue with array resizing or term indexing.`)}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let P=this.documentLengths.length-q+0.5,_=q+0.5;return Math.log(1+P/_)}getTermFrequency($,q){return this.termFrequencies.get($)?.get(q)||0}getDocument($){if($<0||$>=this.documents.length)throw Error(`Document index ${$} out of bounds (0-${this.documents.length-1})`);return this.documents[$]}clearDocuments(){this.documents=[],this.documentLengths=new Uint32Array(0),this.termToIndex.clear(),this.documentFrequency=new Uint32Array(0),this.averageDocLength=0,this.termFrequencies.clear()}getDocumentCount(){return this.documents.length}async addDocuments($){return Promise.all($.map((q)=>this.addDocument(q)))}}var en={};class sn{permits;waiting=[];constructor($){this.permits=$}async acquire(){if(this.permits>0)return this.permits-=1,Promise.resolve();return new Promise(($)=>{this.waiting.push($)})}release(){this.permits+=1;let $=this.waiting.shift();if($&&this.permits>0)this.permits-=1,$()}}class KJ{#$=32;agentId;character;adapter;actions=[];evaluators=[];providers=[];plugins=[];events={};stateCache=new Map;fetch=fetch;services=new Map;serviceTypes=new Map;models=new Map;routes=[];taskWorkers=new Map;sendHandlers=new Map;eventHandlers=new Map;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;migratedPlugins=new Set;currentRunId;currentActionContext;maxWorkingMemoryEntries=50;messageService=null;constructor($){if(this.agentId=$.character?.id??$?.agentId??WO($.character?.name??Iq()),this.character=$.character,this.initPromise=new Promise((q,K)=>{this.initResolver=q,this.initRejecter=K}),this.logger=F7({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??en,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug(`Success: Agent ID: ${this.agentId}`),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=XH("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return Iq()}startRun(){return this.currentRunId=this.createRunId(),this.currentRunId}endRun(){this.currentRunId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error("*** registerPlugin: Plugin or plugin name is undefined"),Error("*** registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((K)=>K.name===$.name)){this.logger.warn(`${this.character.name}(${this.agentId}) - Plugin ${$.name} is already registered. Skipping re-registration.`);return}if(this.plugins.push($),this.logger.debug(`Success: Plugin ${$.name} added to active plugins for ${this.character.name}(${this.agentId}).`),$.init)try{await $.init($.config||{},this),this.logger.debug(`Success: Plugin ${$.name} initialized successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(P.includes("API key")||P.includes("environment variables")||P.includes("Invalid plugin configuration"))console.warn(`Plugin ${$.name} requires configuration. ${P}`),console.warn("Please check your environment variables and ensure all required API keys are set."),console.warn("You can set these in your .env file.");else throw K}if($.adapter)this.logger.debug(`Registering database adapter for plugin ${$.name}`),this.registerDatabaseAdapter($.adapter);if($.actions)for(let K of $.actions)this.registerAction(K);if($.evaluators)for(let K of $.evaluators)this.registerEvaluator(K);if($.providers)for(let K of $.providers)this.registerProvider(K);if($.models)for(let[K,P]of Object.entries($.models))this.registerModel(K,P,$.name,$?.priority);if($.routes)for(let K of $.routes){let P=K.path.startsWith("/")?K.path:`/${K.path}`;this.routes.push({...K,path:"/"+$.name+P})}if($.events)for(let[K,P]of Object.entries($.events))for(let _ of P)this.registerEvent(K,_);if($.services)for(let K of $.services){if(!this.servicePromises.has(K.serviceType))this._createServiceResolver(K.serviceType);this.serviceRegistrationStatus.set(K.serviceType,"pending"),this.registerService(K).catch((P)=>{this.logger.error(`Service registration failed for ${K.serviceType}: ${P instanceof Error?P.message:String(P)}`);let _=this.servicePromiseHandlers.get(K.serviceType);if(_){let O=Error(`Service ${K.serviceType} failed to register: ${P instanceof Error?P.message:String(P)}`);_.reject(O),this.servicePromiseHandlers.delete(K.serviceType),this.servicePromises.delete(K.serviceType)}this.serviceRegistrationStatus.set(K.serviceType,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug(`runtime::stop - character ${this.character.name}`);for(let[$,q]of this.services){this.logger.debug(`runtime::stop - requesting service stop for ${$}`);for(let K of q)await K.stop()}}async initialize(){try{let $=[],q=this.characterPlugins;for(let z of q)if(z)$.push(this.registerPlugin(z));if(await Promise.all($),!this.adapter)throw this.logger.error("Database adapter not initialized. Make sure @elizaos/plugin-sql is included in your plugins."),Error("Database adapter not initialized. The SQL plugin (@elizaos/plugin-sql) is required for agent initialization. Please ensure it is included in your character configuration.");if(!await this.adapter.isReady())await this.adapter.init();this.messageService=new sH,this.logger.info("Running plugin migrations..."),await this.runPluginMigrations(),this.logger.info("Plugin migrations completed.");let K=await this.ensureAgentExists({...this.character,id:this.agentId});if(!K){let z=`Agent ${this.agentId} does not exist in database after ensureAgentExists call`;throw Error(z)}let P=await this.getEntityById(this.agentId);if(!P){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:K.id})){let J=`Failed to create entity for agent ${this.agentId}`;throw Error(J)}if(P=await this.getEntityById(this.agentId),!P)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug(`Success: Agent entity created successfully for ${this.character.name}`)}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,serverId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId)){let J=`Failed to add agent ${this.agentId} as participant to its own room`;throw Error(J)}this.logger.debug(`Agent ${this.character.name} linked to its own room successfully`)}if(!this.getModel(I6.TEXT_EMBEDDING))this.logger.warn(`[AgentRuntime][${this.character.name}] No TEXT_EMBEDDING model registered. Skipping embedding dimension setup.`);else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}catch($){let q=$ instanceof Error?$.message:String($);if(this.logger.error(`Runtime initialization failed: ${q}`),this.initRejecter)this.initRejecter($),this.initRejecter=void 0;for(let[K,P]of this.servicePromises){let _=this.servicePromiseHandlers.get(K);if(_){let O=Error(`Service ${K} failed to start due to runtime initialization failure: ${q}`);_.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K),this.serviceRegistrationStatus.set(K,"failed")}}throw $}}async runPluginMigrations(){if(!this.adapter){this.logger.warn("Database adapter not found, skipping plugin migrations.");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn("Database adapter does not support plugin migrations.");return}let $=this.plugins.filter((q)=>q.schema).map((q)=>({name:q.name,schema:q.schema}));if($.length===0){this.logger.info("No plugins with schemas found, skipping migrations.");return}this.logger.info(`Found ${$.length} plugins with schemas to migrate.`);try{let P={verbose:!0,force:process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true",dryRun:!1};await this.adapter.runPluginMigrations($,P),this.logger.info("Plugin migrations completed successfully.")}catch(q){throw this.logger.error(q instanceof Error?q:Error(String(q)),"Failed to run plugin migrations"),q}}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,K=!1){if(K){if(!this.character.secrets)this.character.secrets={};this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};this.character.settings[$]=q}}getSetting($){let q=this.character.secrets?.[$]||this.character.settings?.[$]||typeof this.character.settings==="object"&&this.character.settings!==null&&"secrets"in this.character.settings&&this.character.settings.secrets?.[$]||this.settings[$],K=HO(q,u_());if(K==="true")return!0;if(K==="false")return!1;return K||null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn("Database adapter already registered. Additional adapters will be ignored. This may lead to unexpected behavior.");else this.adapter=$,this.logger.debug("Success: Database adapter registered successfully.")}registerProvider($){this.providers.push($),this.logger.debug(`Success: Provider ${$.name} registered successfully.`)}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn(`${this.character.name}(${this.agentId}) - Action ${$.name} already exists. Skipping registration.`);else try{this.actions.push($),this.logger.success(`${this.character.name}(${this.agentId}) - Action ${$.name} registered successfully.`)}catch(q){console.error("Error registering action",q)}}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,K){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn(`Invalid step index: ${q} for plan with ${$.steps?.length||0} steps`),$;return{...$,steps:$.steps.map((P,_)=>_===q?{...P,...K}:P)}}async processActions($,q,K,P){let _=[];for(let X of q)if(X.content?.actions&&X.content.actions.length>0)_.push(...X.content.actions);let O=_.length>1,j=this.getCurrentRunId(),z=this.createRunId(),J=null,w=q[0]?.content?.thought||`Executing ${_.length} actions: ${_.join(", ")}`;if(O)J={runId:z,totalSteps:_.length,currentStep:0,steps:_.map((X)=>({action:X,status:"pending"})),thought:w,startTime:Date.now()};let k=0;for(let X of q){let E=function(h){return h.toLowerCase().replace(/_/g,"")};if(!X.content?.actions||X.content.actions.length===0){this.logger.warn("No action found in the response content.");continue}let G=X.content.actions,V=[],C=K;this.logger.debug(`Found actions: ${this.actions.map((h)=>E(h.name))}`);for(let h of G){if(J)J=this.updateActionPlan(J,{currentStep:k+1});if(C=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),J&&C.data)C.data.actionPlan=J,C.data.actionResults=V;this.logger.debug(`Success: Calling action: ${h}`);let I=E(h),D=this.actions.find((g)=>E(g.name)===I);if(!D)D=this.actions.find((g)=>E(g.name).includes(I)||I.includes(E(g.name)));if(D)this.logger.debug(`Success: Found action: ${D?.name}`);else{this.logger.debug("Attempting to find action in similes.");for(let g of this.actions){if(g.similes?.find((p)=>E(p)===I)){D=g,this.logger.debug(`Success: Action found in similes (exact match): ${D.name}`);break}if(g.similes?.find((p)=>E(p).includes(I)||I.includes(E(p)))){D=g,this.logger.debug(`Success: Action found in similes (fuzzy match): ${D.name}`);break}}}if(!D){let g=`No action found for: ${h}`;if(this.logger.error(g),J&&J.steps[k])J=this.updateActionStep(J,k,{status:"failed",error:g});let u={id:Iq(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:g,source:"auto",type:"action_result",actionName:h,actionStatus:"failed",runId:z}};await this.createMemory(u,"messages"),k++;continue}if(!D.handler){if(this.logger.error(`Action ${D.name} has no handler.`),J&&J.steps[k])J=this.updateActionStep(J,k,{status:"failed",error:"No handler"});k++;continue}try{this.logger.debug(`Executing handler for action: ${D.name}`);let g=Iq();this.currentActionContext={actionName:D.name,actionId:g,prompts:[]};let y={actionContext:{previousResults:V,getPreviousResult:(M)=>{return V.find((Y)=>Y.data?.actionName===M)}}};if(J)y.actionPlan={totalSteps:J.totalSteps,currentStep:J.currentStep,steps:J.steps,thought:J.thought};try{this.logger.debug(`Creating action start message for: ${D.name}`),await this.emitEvent("ACTION_STARTED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${D.name}`,actions:[D.name],actionStatus:"executing",actionId:g,runId:z,type:"agent_action",thought:w,source:$.content?.source}})}catch(M){this.logger.error("Failed to create action start message:",String(M))}let p=[],l=async(M)=>{return p.push(M),[]},Q=await D.handler(this,$,C,y,l,q),e=Q===void 0||Q===null||typeof Q==="boolean",m=null;if(!e){if(typeof Q==="object"&&Q!==null&&(("values"in Q)||("data"in Q)||("text"in Q)))m={...Q,success:"success"in Q?Q.success:!0};else m={success:!0,data:{actionName:D.name,legacyResult:Q}};if(V.push(m),m.values)C={...C,values:{...C.values,...m.values},data:{...C.data||{},actionResults:[...C.data?.actionResults||[],m],actionPlan:J}};if(m&&C.data){if(!C.data.workingMemory)C.data.workingMemory={};let M=`action_${h}_${Iq()}`,Y={actionName:D.name,result:m,timestamp:Date.now()};C.data.workingMemory[M]=Y;let H=Object.entries(C.data.workingMemory);if(H.length>this.maxWorkingMemoryEntries){let T=H.sort((W,Z)=>{let S=W[1],N=Z[1],f=S?.timestamp??0;return(N?.timestamp??0)-f});C.data.workingMemory=Object.fromEntries(T.slice(0,this.maxWorkingMemoryEntries))}}if(J&&J.steps[k])J=this.updateActionStep(J,k,{status:"completed",result:m})}try{let Y=m?.success!==!1?"completed":"failed";await this.emitEvent("ACTION_COMPLETED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:`Action ${D.name} ${Y}`,actions:[D.name],actionStatus:Y,actionId:g,type:"agent_action",thought:w,actionResult:m,source:$.content?.source}})}catch(M){let Y=M instanceof Error?M.message:String(M);this.logger.error(`Failed to emit ACTION_COMPLETED event for action ${D.name} (${g}): ${Y}`)}if(P)for(let M of p)await P(M);let o={id:g,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:m?.text||`Executed action: ${D.name}`,source:"action",type:"action_result",actionName:D.name,actionStatus:m?.success?"completed":"failed",actionResult:e?{legacy:Q}:m,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},metadata:{type:"action_result",actionName:D.name,runId:z,parentRunId:j,actionId:g,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};await this.createMemory(o,"messages"),this.logger.debug(`Action ${D.name} completed`,JSON.stringify({isLegacyReturn:e,result:e?Q:void 0,hasValues:m?!!m.values:!1,hasData:m?!!m.data:!1,hasText:m?!!m.text:!1})),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:D.name,actionId:g,message:$.content.text,messageId:$.id,state:C,responses:q,result:e?{legacy:Q}:m,isLegacyReturn:e,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:z,parentRunId:j,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}}}),this.currentActionContext=void 0}catch(g){let u=g instanceof Error?g.message:String(g);if(this.logger.error(g),J&&J.steps[k])J=this.updateActionStep(J,k,{status:"failed",error:u});this.currentActionContext=void 0;let y={success:!1,data:{actionName:D.name,error:u,errorObject:g}};V.push(y);let p={id:Iq(),content:{thought:u,source:"auto",type:"action_result",actionName:D.name,actionStatus:"failed",error:u,runId:z,...J&&{planStep:`${J.currentStep}/${J.totalSteps}`,planThought:J.thought}},entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,metadata:{type:"action_result",actionName:D.name,runId:z,parentRunId:j,error:!0,...J&&{totalSteps:J.totalSteps,currentStep:J.currentStep}}};if(await this.createMemory(p,"messages"),g?.critical||g?.code==="CRITICAL_ERROR")throw g}k++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:V},data:{actionResults:V,actionPlan:J},text:JSON.stringify(V)})}}async evaluate($,q,K,P,_){try{let O=this.evaluators.map(async(z)=>{try{if(!z.handler)return null;if(!K&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}catch(J){return this.logger.error({error:J,evaluatorName:z.name},`Error validating evaluator ${z.name}`),null}}),j=(await Promise.all(O)).filter(Boolean);if(j.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(j.map(async(z)=>{try{if(z.handler)await z.handler(this,$,q,{},P,_),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})}catch(J){this.logger.error({error:J,evaluatorName:z.name},`Error executing evaluator ${z.name}`)}})),j}catch(O){return this.logger.error({error:O,messageId:$.id,roomId:$.roomId},"Error in evaluate method"),[]}}async ensureConnections($,q,K,P){if(!$){console.trace(),this.logger.error("ensureConnections - no entities");return}if(!q||q.length===0){console.trace(),this.logger.error("ensureConnections - no rooms");return}await this.ensureWorldExists({...P,agentId:this.agentId});let _=q[0],O=(u,y)=>u.reduce((p,l,Q)=>{if(Q%y===0)p.push([]);return p[p.length-1].push(l),p},[]),j=q.map((u)=>u.id),J=(await this.getRoomsByIds(j))?.map((u)=>u.id),w=j.filter((u)=>!J?.includes(u)),k={worldId:P.id,serverId:P.serverId,source:K,agentId:this.agentId};if(w.length){this.logger.debug("runtime/ensureConnections - create",w.length.toLocaleString(),"rooms");let u=q.filter((y)=>w.includes(y.id)).map((y)=>({...y,...k}));await this.createRooms(u)}let X=$.map((u)=>u.id),V=(await this.adapter.getEntitiesByIds(X))?.map((u)=>u.id),C=$.filter((u)=>!V?.includes(u.id)),E={roomId:_.id,channelId:_.channelId,type:_.type},h={worldId:P.id,serverId:P.serverId};if(C.length){this.logger.debug("runtime/ensureConnections - creating",C.length.toLocaleString(),"entities...");let u={...E,...h,source:K,agentId:this.agentId},y=C.map((l)=>({...l,...u})),p=O(y,5000);for(let l of p)await this.createEntities(l)}await this.ensureParticipantInRoom(this.agentId,_.id);let D=(await this.getParticipantsForRoom(_.id)).filter(Boolean),g=X.filter((u)=>!D.includes(u));if(g.length){this.logger.debug("runtime/ensureConnections - Missing",g.length.toLocaleString(),"connections in",_.id);let u=O(g,5000);for(let y of u)await this.addParticipantsRoom(y,_.id)}this.logger.success("Success: Successfully connected world")}async ensureConnection({entityId:$,roomId:q,worldId:K,worldName:P,userName:_,name:O,source:j,type:z,channelId:J,serverId:w,userId:k,metadata:X}){if(!K&&w)K=Q8(this,w);let G=[O,_].filter(Boolean),V={[j]:{id:k,name:O,userName:_}};try{let C=await this.getEntityById($);if(!C)try{if(await this.createEntity({id:$,names:G,metadata:V,agentId:this.agentId}))this.logger.debug(`Created new entity ${$} for user ${O||_||"unknown"}`);else throw Error(`Failed to create entity ${$}`)}catch(E){if(E.message?.includes("duplicate key")||E.code==="23505")this.logger.debug(`Entity ${$} exists in database but not for this agent. This is normal in multi-agent setups.`);else throw E}else await this.adapter.updateEntity({id:$,names:[...new Set([...C.names||[],...G])].filter(Boolean),metadata:{...C.metadata,[j]:{...C.metadata?.[j],id:k,name:O,userName:_}},agentId:this.agentId});await this.ensureWorldExists({id:K,name:P||w?`World for server ${w}`:`World for room ${q}`,agentId:this.agentId,serverId:w||"default",metadata:X}),await this.ensureRoomExists({id:q,name:O||"default",source:j||"default",type:z||"DM",channelId:J,serverId:w,worldId:K});try{await this.ensureParticipantInRoom($,q)}catch(E){if(E.message?.includes("not found")){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);this.logger.debug(`Added participant ${$} to room ${q} directly`)}else throw E}await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug(`Success: Successfully connected entity ${$} in room ${q}`)}catch(C){throw this.logger.error(`Failed to ensure connection: ${C instanceof Error?C.message:String(C)}`),C}}async ensureParticipantInRoom($,q){let K=await this.getEntityById($);if(!K&&$!==this.agentId)this.logger.warn(`Entity ${$} not directly accessible to agent ${this.agentId}. Will attempt to add as participant anyway.`);else if(!K&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!K)throw Error(`User entity ${$} not found, cannot add as participant.`);if(!(await this.adapter.getParticipantsForRoom(q)).includes($)){if(!await this.addParticipant($,q))throw Error(`Failed to add participant ${$} to room ${q}`);if($===this.agentId)this.logger.debug(`Agent ${this.character.name} linked to room ${q} successfully.`);else this.logger.debug(`User ${$} linked to room ${q} successfully.`)}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,serverId:K,metadata:P}){if(!await this.getWorld($))this.logger.debug("Creating world:",JSON.stringify({id:$,name:q,serverId:K,agentId:this.agentId})),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,serverId:K||"default",metadata:P}),this.logger.debug(`World ${$} created successfully.`)}async ensureRoomExists({id:$,name:q,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}){if(!j)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:K,type:P,channelId:_,serverId:O,worldId:j,metadata:z}),this.logger.debug(`Room ${$} created successfully.`)}async composeState($,q=null,K=!1,P=!1){let _=K?q:null,O={values:{},data:{},text:""},j=P||!$.id?O:await this.stateCache.get($.id)||O,z=new Set;if(_&&_.length>0)_.forEach((E)=>z.add(E));else this.providers.filter((E)=>!E.private&&!E.dynamic).forEach((E)=>z.add(E.name));if(!_&&q&&q.length>0)q.forEach((E)=>z.add(E));let J=Array.from(new Set(this.providers.filter((E)=>z.has(E.name)))).sort((E,h)=>(E.position||0)-(h.position||0)),w=await Promise.all(J.map(async(E)=>{let h=Date.now();try{let I=await E.get(this,$,j),D=Date.now()-h;if(D>100)this.logger.debug(`${E.name} Provider took ${D}ms to respond`);return{...I,providerName:E.name}}catch(I){return console.error("provider error",E.name,I),{values:{},text:"",data:{},providerName:E.name}}})),k={...j.data?.providers||{}};for(let E of w)k[E.providerName]=E;let X=[];for(let E of J){let h=k[E.name];if(h&&h.text&&h.text.trim()!=="")X.push(h.text)}let G=X.join(`
596
596
  `),V={...j.values||{}};for(let E of J){let h=k[E.name];if(h&&h.values&&typeof h.values==="object")Object.assign(V,h.values)}for(let E in k)if(!J.some((h)=>h.name===E)){let h=k[E];if(h&&h.values&&typeof h.values==="object")Object.assign(V,h.values)}let C={values:{...V,providers:G},data:{...j.data||{},providers:k},text:G};if($.id)this.stateCache.set($.id,C);return C}getService($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug(`Service ${$} not found`),null;return q[0]}getTypedService($){return this.getService($)}getServicesByType($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug(`No services found for type ${$}`),[];return q}getRegisteredServiceTypes(){return Array.from(this.services.keys())}hasService($){let q=this.services.get($);return q!==void 0&&q.length>0}getServiceRegistrationStatus($){return this.serviceRegistrationStatus.get($)||"unknown"}getServiceHealth(){let $={};for(let[q,K]of this.services)$[q]={status:this.getServiceRegistrationStatus(q),instances:K.length,hasPromise:this.servicePromises.has(q)};for(let[q,K]of this.serviceRegistrationStatus)if(!$[q])$[q]={status:K,instances:0,hasPromise:this.servicePromises.has(q)};return $}async registerService($){let q=$.serviceType;if(!q){this.logger.warn(`Service ${$.name} is missing serviceType. Please define a static serviceType property.`);return}this.logger.debug(`${this.character.name}(${this.agentId}) - Registering service:`,q),this.serviceRegistrationStatus.set(q,"registering");try{this.logger.debug(`Service ${q} waiting for initialization...`);let K=new Promise((O,j)=>{setTimeout(()=>{j(Error(`Service ${q} registration timed out waiting for runtime initialization (30s timeout)`))},30000)});await Promise.race([this.initPromise,K]),this.logger.debug(`Service ${q} proceeding - initialization complete`);let P=await $.start(this);if(!this.services.has(q))this.services.set(q,[]);if(!this.serviceTypes.has(q))this.serviceTypes.set(q,[]);this.services.get(q).push(P),this.serviceTypes.get(q).push($);let _=this.servicePromiseHandlers.get(q);if(_)_.resolve(P),this.servicePromiseHandlers.delete(q);else this.logger.debug(`${this.character.name} - Service ${q} has no servicePromiseHandler`);if(typeof $.registerSendHandlers==="function")$.registerSendHandlers(this,P);this.serviceRegistrationStatus.set(q,"registered"),this.logger.debug(`${this.character.name}(${this.agentId}) - Service ${q} registered successfully`)}catch(K){let P=K instanceof Error?K.message:String(K);if(this.logger.error(`${this.character.name}(${this.agentId}) - Failed to register service ${q}: ${P}`),K?.message?.includes("timed out waiting for runtime initialization"))this.logger.error(`Service ${q} failed due to runtime initialization timeout. Check if runtime.initialize() is being called and completing successfully.`);else if(K?.message?.includes("Service")&&K?.message?.includes("failed to start"))this.logger.error(`Service ${q} failed to start. Check service implementation and dependencies.`);this.serviceRegistrationStatus.set(q,"failed");let _=this.servicePromiseHandlers.get(q);if(_)_.reject(K),this.servicePromiseHandlers.delete(q),this.servicePromises.delete(q);throw K}}_createServiceResolver($){let q,K;if(this.servicePromises.set($,new Promise((P,_)=>{q=P,K=_})),!q)throw Error(`Failed to create resolver for service ${$}`);if(!K)throw Error(`Failed to create rejecter for service ${$}`);return this.servicePromiseHandlers.set($,{resolve:q,reject:K}),this.servicePromises.get($)}getServiceLoadPromise($){let q=this.servicePromises.get($);if(!q)q=this._createServiceResolver($);return q}registerModel($,q,K,P){let _=typeof $==="string"?$:I6[$];if(!this.models.has(_))this.models.set(_,[]);let O=Date.now();this.models.get(_)?.push({handler:q,provider:K,priority:P||0,registrationOrder:O}),this.models.get(_)?.sort((j,z)=>{if((z.priority||0)!==(j.priority||0))return(z.priority||0)-(j.priority||0);return(j.registrationOrder||0)-(z.registrationOrder||0)})}getModel($,q){let K=typeof $==="string"?$:I6[$],P=this.models.get(K);if(!P?.length)return;if(q){let _=P.find((O)=>O.provider===q);if(_)return this.logger.debug(`[AgentRuntime][${this.character.name}] Using model ${K} from provider ${q}`),_.handler;else this.logger.warn(`[AgentRuntime][${this.character.name}] No model found for provider ${q}`)}return this.logger.debug(`[AgentRuntime][${this.character.name}] Using model ${K} from provider ${P[0].provider}`),P[0].handler}getModelSettings($){let q={},K=(z,J)=>{if($){let G=`${$}_${z}`,V=this.getSetting(G);if(V!==null&&V!==void 0){let C=Number(V);if(!isNaN(C))return C}}let w=`DEFAULT_${z}`,k=this.getSetting(w);if(k!==null&&k!==void 0){let G=Number(k);if(!isNaN(G))return G}let X=this.getSetting(J);if(X!==null&&X!==void 0){let G=Number(X);if(!isNaN(G))return G}return null},P=K("MAX_TOKENS",Q4.MODEL_MAX_TOKEN),_=K("TEMPERATURE",Q4.MODEL_TEMPERATURE),O=K("FREQUENCY_PENALTY",Q4.MODEL_FREQ_PENALTY),j=K("PRESENCE_PENALTY",Q4.MODEL_PRESENCE_PENALTY);if(P!==null)q.maxTokens=P;if(_!==null)q.temperature=_;if(O!==null)q.frequencyPenalty=O;if(j!==null)q.presencePenalty=j;return Object.keys(q).length>0?q:null}async useModel($,q,K){let P=typeof $==="string"?$:I6[$],_=q?.prompt||q?.input||(Array.isArray(q?.messages)?JSON.stringify(q.messages):null),O=this.getModel(P,K);if(!O){let J=`No handler found for delegate type: ${P}`;throw Error(J)}this.logger.debug(`[useModel] ${P} input: `+JSON.stringify(q,UH(),2).replace(/\\n/g,`
597
597
  `));let j;if(q===null||q===void 0||typeof q!=="object"||Array.isArray(q)||FK.isBuffer(q))j=q;else{let J=this.getModelSettings(P);if(J)j={...J,...q};else j=q}let z=typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now();try{let J=await O(this,j),w=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-z;if(this.logger.debug(`[useModel] ${P} output (took ${Number(w.toFixed(2)).toLocaleString()}ms):`,Array.isArray(J)?`${JSON.stringify(J.slice(0,5))}...${JSON.stringify(J.slice(-5))} (${J.length} items)`:JSON.stringify(J,UH(),2).replace(/\\n/g,`
598
598
  `)),P!==I6.TEXT_EMBEDDING&&_){if(this.currentActionContext)this.currentActionContext.prompts.push({modelType:P,prompt:_,timestamp:Date.now()})}return this.adapter.log({entityId:this.agentId,roomId:this.agentId,body:{modelType:$,modelKey:P,params:{...typeof q==="object"&&!Array.isArray(q)&&q?q:{},prompt:_},prompt:_,runId:this.getCurrentRunId(),timestamp:Date.now(),executionTime:w,provider:K||this.models.get(P)?.[0]?.provider||"unknown",actionContext:this.currentActionContext?{actionName:this.currentActionContext.actionName,actionId:this.currentActionContext.actionId}:void 0,response:Array.isArray(J)&&J.every((k)=>typeof k==="number")?"[array]":J},type:`useModel:${P}`}),J}catch(J){throw J}}async generateText($,q){if(!$?.trim())throw Error("Input cannot be empty");let K=q?.includeCharacter??!0,P=q?.modelType??I6.TEXT_LARGE,_=$;if(K&&this.character){let z=this.character,J=[],w=Array.isArray(z.bio)?z.bio.join(" "):z.bio;if(w)J.push(`# About ${z.name}
@@ -643,5 +643,5 @@ Data: ${JSON.stringify(K.metadata)}
643
643
  `}`}).join(`
644
644
  `)}var $1$=!0,q1$=!1,K1$={check:async()=>({status:"not-applicable",environment:"browser"}),isHealthy:()=>!0};export{Zn as validateUuid,tM as validateCharacter,BM as uuidSchema,R7$ as updateWorldSettings,v0 as unsaltWorldSettings,Oi as unsaltSettingValue,rM as truncateToCompleteSentence,TP$ as trimTokens,Ln as toString,UM as toHex,Nn as templateTypeSchema,Cn as styleSchema,WO as stringToUuid,JP$ as splitChunks,xn as slice,FM as shouldRespondTemplate,En as settingsSchema,yo as setEnv,K1$ as serverHealth,hn as secretsSchema,Yi as saltWorldSettings,ji as saltSettingValue,UH as safeReplacer,s4$ as recentLogs,mn as randomBytes,wP$ as prewarmUuidCache,dP$ as postCreationTemplate,UK as parseKeyValueXml,HP$ as parseJSONObjectFromText,zO as parseBooleanFromText,GP$ as parseAndValidateCharacter,cM as normalizeJsonString,sM as multiStepSummaryTemplate,eM as multiStepDecisionTemplate,aM as messageHandlerTemplate,Vn as messageExampleSchema,An as mediaSchema,j6 as logger,lo as loadEnvConfig,Mn as knowledgeItemSchema,VP$ as isValidCharacter,q1$ as isNode,gP$ as isMessageMetadata,bP$ as isFragmentMetadata,cP$ as isFragmentMemory,LP$ as isDocumentMetadata,xP$ as isDocumentMemory,uP$ as isDescriptionMetadata,yP$ as isCustomMetadata,bn as isBuffer,$1$ as isBrowser,D7$ as initializeOnboarding,po as initBrowserEnvironment,QM as imageDescriptionTemplate,xo as hasEnv,I7$ as getWorldSettings,iP$ as getUserServerRole,Ni as getTypedService,u_ as getSalt,XH as getNumberEnv,pP$ as getMemoryText,iM as getLocalServerUrl,b_ as getEnvironment,VK as getEnv,Q7$ as getEntityDetails,ZP$ as getContentTypeFromMimeType,co as getBooleanEnv,Dn as fromString,In as fromHex,un as fromBytes,lM as formatTimestamp,zP$ as formatPosts,WP$ as formatMessages,e7$ as formatEntities,hP$ as formatActions,EP$ as formatActionNames,BP$ as findWorldsForOwner,jM as findEnvFile,a7$ as findEntityByName,cn as equals,L7$ as encryptedCharacter,Y0 as encryptStringValue,j0 as encryptObjectValues,e4$ as elizaLogger,Sn as directoryItemSchema,L_ as detectEnvironment,y7$ as defineService,b7$ as decryptedCharacter,HO as decryptStringValue,HO as decryptSecret,O0 as decryptObjectValues,Q4$ as customLevels,mo as currentRuntime,Q8 as createUniqueUuid,_i as createSettingFromConfig,Ci as createServiceError,vi as createService,DP$ as createMessageMemory,F7 as createLogger,Gn as contentSchema,yn as concat,a7 as composePromptFromState,mM as composePrompt,CP$ as composeActionExamples,h7$ as clearSaltCache,Rn as characterSchema,pn as byteLength,lP$ as booleanFooter,e7 as asUUID,gn as alloc,vP$ as addHeader,U4$ as __loggerTestHooks,Ri as VECTOR_DIMS,S0 as TeeType,V0 as TEEMode,Mi as ServiceType,z0 as ServiceBuilder,ZO as Service,sn as Semaphore,M0 as SOCKET_MESSAGE_TYPE,k0 as Role,G0 as PlatformPrefix,I6 as ModelType,X0 as MemoryType,Q4 as MODEL_SETTINGS,fO as EventType,fH as Environment,Zi as ElizaOS,sH as DefaultMessageService,ln as DatabaseAdapter,F4 as ContentType,a4 as ChannelType,FK as BufferUtils,qJ as BM25,A0 as AgentStatus,KJ as AgentRuntime};
645
645
 
646
- //# debugId=8FC762B1208BAEDC64756E2164756E21
646
+ //# debugId=5573B7DB2E82059164756E2164756E21
647
647
  //# sourceMappingURL=index.browser.js.map