@elizaos/core 1.7.0 → 1.7.1-alpha.10

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 JC=Object.create;var{getPrototypeOf:HC,defineProperty:YP,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 gp(){Object.keys(g5).forEach(function($){delete g5[$]})}});var u5=N$((Fp)=>{Fp.__esModule=!0;Fp.HandlebarsEnvironment=ZW;function kG($){return $&&$.__esModule?$:{default:$}}var IK=pq(),mp=G8(),wW=kG(mp),dp=JW(),lp=TG(),rp=HW(),y5=kG(rp),op=TW(),np="4.7.8";Fp.VERSION=np;var ip=8;Fp.COMPILER_REVISION=ip;var Bp=7;Fp.LAST_COMPATIBLE_COMPILER_REVISION=Bp;var tp={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"};Fp.REVISION_CHANGES=tp;var fW="[object Object]";function ZW($,q,_){this.helpers=$||{},this.partials=q||{},this.decorators=_||{},dp.registerDefaultHelpers(this),lp.registerDefaultDecorators(this)}ZW.prototype={constructor:ZW,logger:y5.default,log:y5.default.log,registerHelper:function(q,_){if(IK.toString.call(q)===fW){if(_)throw new wW.default("Arg not supported with multiple helpers");IK.extend(this.helpers,q)}else this.helpers[q]=_},unregisterHelper:function(q){delete this.helpers[q]},registerPartial:function(q,_){if(IK.toString.call(q)===fW)IK.extend(this.partials,q);else{if(typeof _>"u")throw new wW.default('Attempting to register a partial called "'+q+'" as undefined');this.partials[q]=_}},unregisterPartial:function(q){delete this.partials[q]},registerDecorator:function(q,_){if(IK.toString.call(q)===fW){if(_)throw new wW.default("Arg not supported with multiple decorators");IK.extend(this.decorators,q)}else this.decorators[q]=_},unregisterDecorator:function(q){delete this.decorators[q]},resetLoggedPropertyAccesses:function(){op.resetLoggedProperties()}};var Up=y5.default.log;Fp.log=Up;Fp.createFrame=IK.createFrame;Fp.logger=y5.default});var SG=N$((GG,VG)=>{GG.__esModule=!0;function XW($){this.string=$}XW.prototype.toString=XW.prototype.toHTML=function(){return""+this.string};GG.default=XW;VG.exports=GG.default});var MG=N$((vc)=>{vc.__esModule=!0;vc.wrapHelper=jc;function jc($,q){if(typeof $!=="function")return $;var _=function(){var P=arguments[arguments.length-1];return arguments[arguments.length-1]=q(P),$.apply(this,arguments)};return _}});var RG=N$((Mc)=>{Mc.__esModule=!0;Mc.checkRevision=Zc;Mc.template=Xc;Mc.wrapProgram=x5;Mc.resolvePartial=Ac;Mc.invokePartial=kc;Mc.noop=EG;function Jc($){return $&&$.__esModule?$:{default:$}}function Hc($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var _ in $)if(Object.prototype.hasOwnProperty.call($,_))q[_]=$[_]}return q.default=$,q}}var Tc=pq(),Z_=Hc(Tc),wc=G8(),X_=Jc(wc),A_=u5(),NG=JW(),fc=MG(),CG=TW();function Zc($){var q=$&&$[0]||1,_=A_.COMPILER_REVISION;if(q>=A_.LAST_COMPATIBLE_COMPILER_REVISION&&q<=A_.COMPILER_REVISION)return;if(q<A_.LAST_COMPATIBLE_COMPILER_REVISION){var K=A_.REVISION_CHANGES[_],P=A_.REVISION_CHANGES[q];throw new X_.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+K+") or downgrade your runtime to an older version ("+P+").")}else throw new X_.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+$[1]+").")}function Xc($,q){if(!q)throw new X_.default("No environment passed to template");if(!$||!$.main)throw new X_.default("Unknown template object: "+typeof $);$.main.decorator=$.main_d,q.VM.checkRevision($.compiler);var _=$.compiler&&$.compiler[0]===7;function K(O,z,T){if(T.hash){if(z=Z_.extend({},z,T.hash),T.ids)T.ids[0]=!0}O=q.VM.resolvePartial.call(this,O,z,T);var H=Z_.extend({},T,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),f=q.VM.invokePartial.call(this,O,z,H);if(f==null&&q.compile)T.partials[T.name]=q.compile(O,$.compilerOptions,q),f=T.partials[T.name](z,H);if(f!=null){if(T.indent){var w=f.split(`
4
4
  `);for(var k=0,S=w.length;k<S;k++){if(!w[k]&&k+1===S)break;w[k]=T.indent+w[k]}f=w.join(`
5
- `)}return f}else throw new X_.default("The partial "+T.name+" could not be compiled when running in runtime-only mode")}var P={strict:function(z,T,H){if(!z||!(T in z))throw new X_.default('"'+T+'" not defined in '+z,{loc:H});return P.lookupProperty(z,T)},lookupProperty:function(z,T){var H=z[T];if(H==null)return H;if(Object.prototype.hasOwnProperty.call(z,T))return H;if(CG.resultIsAllowed(H,P.protoAccessControl,T))return H;return},lookup:function(z,T){var H=z.length;for(var f=0;f<H;f++){var w=z[f]&&P.lookupProperty(z[f],T);if(w!=null)return z[f][T]}},lambda:function(z,T){return typeof z==="function"?z.call(T):z},escapeExpression:Z_.escapeExpression,invokePartial:K,fn:function(z){var T=$[z];return T.decorator=$[z+"_d"],T},programs:[],program:function(z,T,H,f,w){var k=this.programs[z],S=this.fn(z);if(T||w||f||H)k=x5(this,z,S,T,H,f,w);else if(!k)k=this.programs[z]=x5(this,z,S);return k},data:function(z,T){while(z&&T--)z=z._parent;return z},mergeIfNeeded:function(z,T){var H=z||T;if(z&&T&&z!==T)H=Z_.extend({},T,z);return H},nullContext:Object.seal({}),noop:q.VM.noop,compilerInfo:$.compiler};function Y(O){var z=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],T=z.data;if(Y._setup(z),!z.partial&&$.useData)T=Gc(O,T);var H=void 0,f=$.useBlockParams?[]:void 0;if($.useDepths)if(z.depths)H=O!=z.depths[0]?[O].concat(z.depths):z.depths;else H=[O];function w(k){return""+$.main(P,k,P.helpers,P.partials,T,f,H)}return w=hG($.main,w,P,z.depths||[],T,f),w(O,z)}return Y.isTop=!0,Y._setup=function(O){if(!O.partial){var z=Z_.extend({},q.helpers,O.helpers);if(Vc(z,P),P.helpers=z,$.usePartial)P.partials=P.mergeIfNeeded(O.partials,q.partials);if($.usePartial||$.useDecorators)P.decorators=Z_.extend({},q.decorators,O.decorators);P.hooks={},P.protoAccessControl=CG.createProtoAccessControl(O);var T=O.allowCallsToHelperMissing||_;NG.moveHelperToHooks(P,"helperMissing",T),NG.moveHelperToHooks(P,"blockHelperMissing",T)}else P.protoAccessControl=O.protoAccessControl,P.helpers=O.helpers,P.partials=O.partials,P.decorators=O.decorators,P.hooks=O.hooks},Y._child=function(O,z,T,H){if($.useBlockParams&&!T)throw new X_.default("must pass block params");if($.useDepths&&!H)throw new X_.default("must pass parent depths");return x5(P,O,$[O],z,0,T,H)},Y}function x5($,q,_,K,P,Y,O){function z(T){var H=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],f=O;if(O&&T!=O[0]&&!(T===$.nullContext&&O[0]===null))f=[T].concat(O);return _($,T,$.helpers,$.partials,H.data||K,Y&&[H.blockParams].concat(Y),f)}return z=hG(_,z,$,O,K,Y),z.program=q,z.depth=O?O.length:0,z.blockParams=P||0,z}function Ac($,q,_){if(!$)if(_.name==="@partial-block")$=_.data["partial-block"];else $=_.partials[_.name];else if(!$.call&&!_.name)_.name=$,$=_.partials[$];return $}function kc($,q,_){var K=_.data&&_.data["partial-block"];if(_.partial=!0,_.ids)_.data.contextPath=_.ids[0]||_.data.contextPath;var P=void 0;if(_.fn&&_.fn!==EG)(function(){_.data=A_.createFrame(_.data);var Y=_.fn;if(P=_.data["partial-block"]=function(z){var T=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return T.data=A_.createFrame(T.data),T.data["partial-block"]=K,Y(z,T)},Y.partials)_.partials=Z_.extend({},_.partials,Y.partials)})();if($===void 0&&P)$=P;if($===void 0)throw new X_.default("The partial "+_.name+" could not be found");else if($ instanceof Function)return $(q,_)}function EG(){return""}function Gc($,q){if(!q||!("root"in q))q=q?A_.createFrame(q):{},q.root=$;return q}function hG($,q,_,K,P,Y){if($.decorator){var O={};q=$.decorator(q,O,_,K&&K[0],P,Y,K),Z_.extend(q,O)}return q}function Vc($,q){Object.keys($).forEach(function(_){var K=$[_];$[_]=Sc(K,q)})}function Sc($,q){var _=q.lookupProperty;return fc.wrapHelper($,function(K){return Z_.extend({lookupProperty:_},K)})}});var AW=N$((IG,DG)=>{IG.__esModule=!0;IG.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 $}};DG.exports=IG.default});var xG=N$((yG,uG)=>{yG.__esModule=!0;function GW($){return $&&$.__esModule?$:{default:$}}function VW($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var _ in $)if(Object.prototype.hasOwnProperty.call($,_))q[_]=$[_]}return q.default=$,q}}var gc=u5(),LG=VW(gc),yc=SG(),uc=GW(yc),xc=G8(),pc=GW(xc),cc=pq(),kW=VW(cc),mc=RG(),bG=VW(mc),dc=AW(),lc=GW(dc);function gG(){var $=new LG.HandlebarsEnvironment;return kW.extend($,LG),$.SafeString=uc.default,$.Exception=pc.default,$.Utils=kW,$.escapeExpression=kW.escapeExpression,$.VM=bG,$.template=function(q){return bG.template(q,$)},$}var g7=gG();g7.create=gG;lc.default(g7);g7.default=g7;yG.default=g7;uG.exports=yG.default});var SW=N$((cG,mG)=>{cG.__esModule=!0;var pG={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&&!pG.helpers.scopedId(q)&&!q.depth}}};cG.default=pG;mG.exports=cG.default});var rG=N$((dG,lG)=>{dG.__esModule=!0;var Bc=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(P,Y,O,z,T,H,f){var w=H.length-1;switch(T){case 1:return H[w-1];case 2:this.$=z.prepareProgram(H[w]);break;case 3:this.$=H[w];break;case 4:this.$=H[w];break;case 5:this.$=H[w];break;case 6:this.$=H[w];break;case 7:this.$=H[w];break;case 8:this.$=H[w];break;case 9:this.$={type:"CommentStatement",value:z.stripComment(H[w]),strip:z.stripFlags(H[w],H[w]),loc:z.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:H[w],value:H[w],loc:z.locInfo(this._$)};break;case 11:this.$=z.prepareRawBlock(H[w-2],H[w-1],H[w],this._$);break;case 12:this.$={path:H[w-3],params:H[w-2],hash:H[w-1]};break;case 13:this.$=z.prepareBlock(H[w-3],H[w-2],H[w-1],H[w],!1,this._$);break;case 14:this.$=z.prepareBlock(H[w-3],H[w-2],H[w-1],H[w],!0,this._$);break;case 15:this.$={open:H[w-5],path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 16:this.$={path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 17:this.$={path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 18:this.$={strip:z.stripFlags(H[w-1],H[w-1]),program:H[w]};break;case 19:var k=z.prepareBlock(H[w-2],H[w-1],H[w],H[w],!1,this._$),S=z.prepareProgram([k],H[w-1].loc);S.chained=!0,this.$={strip:H[w-2].strip,program:S,chain:!0};break;case 20:this.$=H[w];break;case 21:this.$={path:H[w-1],strip:z.stripFlags(H[w-2],H[w])};break;case 22:this.$=z.prepareMustache(H[w-3],H[w-2],H[w-1],H[w-4],z.stripFlags(H[w-4],H[w]),this._$);break;case 23:this.$=z.prepareMustache(H[w-3],H[w-2],H[w-1],H[w-4],z.stripFlags(H[w-4],H[w]),this._$);break;case 24:this.$={type:"PartialStatement",name:H[w-3],params:H[w-2],hash:H[w-1],indent:"",strip:z.stripFlags(H[w-4],H[w]),loc:z.locInfo(this._$)};break;case 25:this.$=z.preparePartialBlock(H[w-2],H[w-1],H[w],this._$);break;case 26:this.$={path:H[w-3],params:H[w-2],hash:H[w-1],strip:z.stripFlags(H[w-4],H[w])};break;case 27:this.$=H[w];break;case 28:this.$=H[w];break;case 29:this.$={type:"SubExpression",path:H[w-3],params:H[w-2],hash:H[w-1],loc:z.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:H[w],loc:z.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:z.id(H[w-2]),value:H[w],loc:z.locInfo(this._$)};break;case 32:this.$=z.id(H[w-1]);break;case 33:this.$=H[w];break;case 34:this.$=H[w];break;case 35:this.$={type:"StringLiteral",value:H[w],original:H[w],loc:z.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(H[w]),original:Number(H[w]),loc:z.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:H[w]==="true",original:H[w]==="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.$=H[w];break;case 41:this.$=H[w];break;case 42:this.$=z.preparePath(!0,H[w],this._$);break;case 43:this.$=z.preparePath(!1,H[w],this._$);break;case 44:H[w-2].push({part:z.id(H[w]),original:H[w],separator:H[w-1]}),this.$=H[w-2];break;case 45:this.$=[{part:z.id(H[w]),original:H[w]}];break;case 46:this.$=[];break;case 47:H[w-1].push(H[w]);break;case 48:this.$=[];break;case 49:H[w-1].push(H[w]);break;case 50:this.$=[];break;case 51:H[w-1].push(H[w]);break;case 58:this.$=[];break;case 59:H[w-1].push(H[w]);break;case 64:this.$=[];break;case 65:H[w-1].push(H[w]);break;case 70:this.$=[];break;case 71:H[w-1].push(H[w]);break;case 78:this.$=[];break;case 79:H[w-1].push(H[w]);break;case 82:this.$=[];break;case 83:H[w-1].push(H[w]);break;case 86:this.$=[];break;case 87:H[w-1].push(H[w]);break;case 90:this.$=[];break;case 91:H[w-1].push(H[w]);break;case 94:this.$=[];break;case 95:H[w-1].push(H[w]);break;case 98:this.$=[H[w]];break;case 99:H[w-1].push(H[w]);break;case 100:this.$=[H[w]];break;case 101:H[w-1].push(H[w]);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(P,Y){throw Error(P)},parse:function(P){var Y=this,O=[0],z=[null],T=[],H=this.table,f="",w=0,k=0,S=0,N=2,h=1;if(this.lexer.setInput(P),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u")this.lexer.yylloc={};var C=this.lexer.yylloc;T.push(C);var I=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function D(Z){O.length=O.length-2*Z,z.length=z.length-Z,T.length=T.length-Z}function L(){var Z=Y.lexer.lex()||1;if(typeof Z!=="number")Z=Y.symbols_[Z]||Z;return Z}var g,y,c,o,s,F,p={},a,j,W,X;while(!0){if(c=O[O.length-1],this.defaultActions[c])o=this.defaultActions[c];else{if(g===null||typeof g>"u")g=L();o=H[c]&&H[c][g]}if(typeof o>"u"||!o.length||!o[0]){var J="";if(!S){X=[];for(a in H[c])if(this.terminals_[a]&&a>2)X.push("'"+this.terminals_[a]+"'");if(this.lexer.showPosition)J="Parse error on line "+(w+1)+`:
5
+ `)}return f}else throw new X_.default("The partial "+T.name+" could not be compiled when running in runtime-only mode")}var P={strict:function(z,T,H){if(!z||!(T in z))throw new X_.default('"'+T+'" not defined in '+z,{loc:H});return P.lookupProperty(z,T)},lookupProperty:function(z,T){var H=z[T];if(H==null)return H;if(Object.prototype.hasOwnProperty.call(z,T))return H;if(CG.resultIsAllowed(H,P.protoAccessControl,T))return H;return},lookup:function(z,T){var H=z.length;for(var f=0;f<H;f++){var w=z[f]&&P.lookupProperty(z[f],T);if(w!=null)return z[f][T]}},lambda:function(z,T){return typeof z==="function"?z.call(T):z},escapeExpression:Z_.escapeExpression,invokePartial:K,fn:function(z){var T=$[z];return T.decorator=$[z+"_d"],T},programs:[],program:function(z,T,H,f,w){var k=this.programs[z],S=this.fn(z);if(T||w||f||H)k=x5(this,z,S,T,H,f,w);else if(!k)k=this.programs[z]=x5(this,z,S);return k},data:function(z,T){while(z&&T--)z=z._parent;return z},mergeIfNeeded:function(z,T){var H=z||T;if(z&&T&&z!==T)H=Z_.extend({},T,z);return H},nullContext:Object.seal({}),noop:q.VM.noop,compilerInfo:$.compiler};function Y(O){var z=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],T=z.data;if(Y._setup(z),!z.partial&&$.useData)T=Gc(O,T);var H=void 0,f=$.useBlockParams?[]:void 0;if($.useDepths)if(z.depths)H=O!=z.depths[0]?[O].concat(z.depths):z.depths;else H=[O];function w(k){return""+$.main(P,k,P.helpers,P.partials,T,f,H)}return w=hG($.main,w,P,z.depths||[],T,f),w(O,z)}return Y.isTop=!0,Y._setup=function(O){if(!O.partial){var z=Z_.extend({},q.helpers,O.helpers);if(Vc(z,P),P.helpers=z,$.usePartial)P.partials=P.mergeIfNeeded(O.partials,q.partials);if($.usePartial||$.useDecorators)P.decorators=Z_.extend({},q.decorators,O.decorators);P.hooks={},P.protoAccessControl=CG.createProtoAccessControl(O);var T=O.allowCallsToHelperMissing||_;NG.moveHelperToHooks(P,"helperMissing",T),NG.moveHelperToHooks(P,"blockHelperMissing",T)}else P.protoAccessControl=O.protoAccessControl,P.helpers=O.helpers,P.partials=O.partials,P.decorators=O.decorators,P.hooks=O.hooks},Y._child=function(O,z,T,H){if($.useBlockParams&&!T)throw new X_.default("must pass block params");if($.useDepths&&!H)throw new X_.default("must pass parent depths");return x5(P,O,$[O],z,0,T,H)},Y}function x5($,q,_,K,P,Y,O){function z(T){var H=arguments.length<=1||arguments[1]===void 0?{}:arguments[1],f=O;if(O&&T!=O[0]&&!(T===$.nullContext&&O[0]===null))f=[T].concat(O);return _($,T,$.helpers,$.partials,H.data||K,Y&&[H.blockParams].concat(Y),f)}return z=hG(_,z,$,O,K,Y),z.program=q,z.depth=O?O.length:0,z.blockParams=P||0,z}function Ac($,q,_){if(!$)if(_.name==="@partial-block")$=_.data["partial-block"];else $=_.partials[_.name];else if(!$.call&&!_.name)_.name=$,$=_.partials[$];return $}function kc($,q,_){var K=_.data&&_.data["partial-block"];if(_.partial=!0,_.ids)_.data.contextPath=_.ids[0]||_.data.contextPath;var P=void 0;if(_.fn&&_.fn!==EG)(function(){_.data=A_.createFrame(_.data);var Y=_.fn;if(P=_.data["partial-block"]=function(z){var T=arguments.length<=1||arguments[1]===void 0?{}:arguments[1];return T.data=A_.createFrame(T.data),T.data["partial-block"]=K,Y(z,T)},Y.partials)_.partials=Z_.extend({},_.partials,Y.partials)})();if($===void 0&&P)$=P;if($===void 0)throw new X_.default("The partial "+_.name+" could not be found");else if($ instanceof Function)return $(q,_)}function EG(){return""}function Gc($,q){if(!q||!("root"in q))q=q?A_.createFrame(q):{},q.root=$;return q}function hG($,q,_,K,P,Y){if($.decorator){var O={};q=$.decorator(q,O,_,K&&K[0],P,Y,K),Z_.extend(q,O)}return q}function Vc($,q){Object.keys($).forEach(function(_){var K=$[_];$[_]=Sc(K,q)})}function Sc($,q){var _=q.lookupProperty;return fc.wrapHelper($,function(K){return Z_.extend({lookupProperty:_},K)})}});var AW=N$((IG,DG)=>{IG.__esModule=!0;IG.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 $}};DG.exports=IG.default});var xG=N$((yG,uG)=>{yG.__esModule=!0;function GW($){return $&&$.__esModule?$:{default:$}}function VW($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var _ in $)if(Object.prototype.hasOwnProperty.call($,_))q[_]=$[_]}return q.default=$,q}}var gc=u5(),LG=VW(gc),yc=SG(),uc=GW(yc),xc=G8(),pc=GW(xc),cc=pq(),kW=VW(cc),mc=RG(),bG=VW(mc),dc=AW(),lc=GW(dc);function gG(){var $=new LG.HandlebarsEnvironment;return kW.extend($,LG),$.SafeString=uc.default,$.Exception=pc.default,$.Utils=kW,$.escapeExpression=kW.escapeExpression,$.VM=bG,$.template=function(q){return bG.template(q,$)},$}var g7=gG();g7.create=gG;lc.default(g7);g7.default=g7;yG.default=g7;uG.exports=yG.default});var SW=N$((cG,mG)=>{cG.__esModule=!0;var pG={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&&!pG.helpers.scopedId(q)&&!q.depth}}};cG.default=pG;mG.exports=cG.default});var rG=N$((dG,lG)=>{dG.__esModule=!0;var Bc=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(P,Y,O,z,T,H,f){var w=H.length-1;switch(T){case 1:return H[w-1];case 2:this.$=z.prepareProgram(H[w]);break;case 3:this.$=H[w];break;case 4:this.$=H[w];break;case 5:this.$=H[w];break;case 6:this.$=H[w];break;case 7:this.$=H[w];break;case 8:this.$=H[w];break;case 9:this.$={type:"CommentStatement",value:z.stripComment(H[w]),strip:z.stripFlags(H[w],H[w]),loc:z.locInfo(this._$)};break;case 10:this.$={type:"ContentStatement",original:H[w],value:H[w],loc:z.locInfo(this._$)};break;case 11:this.$=z.prepareRawBlock(H[w-2],H[w-1],H[w],this._$);break;case 12:this.$={path:H[w-3],params:H[w-2],hash:H[w-1]};break;case 13:this.$=z.prepareBlock(H[w-3],H[w-2],H[w-1],H[w],!1,this._$);break;case 14:this.$=z.prepareBlock(H[w-3],H[w-2],H[w-1],H[w],!0,this._$);break;case 15:this.$={open:H[w-5],path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 16:this.$={path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 17:this.$={path:H[w-4],params:H[w-3],hash:H[w-2],blockParams:H[w-1],strip:z.stripFlags(H[w-5],H[w])};break;case 18:this.$={strip:z.stripFlags(H[w-1],H[w-1]),program:H[w]};break;case 19:var k=z.prepareBlock(H[w-2],H[w-1],H[w],H[w],!1,this._$),S=z.prepareProgram([k],H[w-1].loc);S.chained=!0,this.$={strip:H[w-2].strip,program:S,chain:!0};break;case 20:this.$=H[w];break;case 21:this.$={path:H[w-1],strip:z.stripFlags(H[w-2],H[w])};break;case 22:this.$=z.prepareMustache(H[w-3],H[w-2],H[w-1],H[w-4],z.stripFlags(H[w-4],H[w]),this._$);break;case 23:this.$=z.prepareMustache(H[w-3],H[w-2],H[w-1],H[w-4],z.stripFlags(H[w-4],H[w]),this._$);break;case 24:this.$={type:"PartialStatement",name:H[w-3],params:H[w-2],hash:H[w-1],indent:"",strip:z.stripFlags(H[w-4],H[w]),loc:z.locInfo(this._$)};break;case 25:this.$=z.preparePartialBlock(H[w-2],H[w-1],H[w],this._$);break;case 26:this.$={path:H[w-3],params:H[w-2],hash:H[w-1],strip:z.stripFlags(H[w-4],H[w])};break;case 27:this.$=H[w];break;case 28:this.$=H[w];break;case 29:this.$={type:"SubExpression",path:H[w-3],params:H[w-2],hash:H[w-1],loc:z.locInfo(this._$)};break;case 30:this.$={type:"Hash",pairs:H[w],loc:z.locInfo(this._$)};break;case 31:this.$={type:"HashPair",key:z.id(H[w-2]),value:H[w],loc:z.locInfo(this._$)};break;case 32:this.$=z.id(H[w-1]);break;case 33:this.$=H[w];break;case 34:this.$=H[w];break;case 35:this.$={type:"StringLiteral",value:H[w],original:H[w],loc:z.locInfo(this._$)};break;case 36:this.$={type:"NumberLiteral",value:Number(H[w]),original:Number(H[w]),loc:z.locInfo(this._$)};break;case 37:this.$={type:"BooleanLiteral",value:H[w]==="true",original:H[w]==="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.$=H[w];break;case 41:this.$=H[w];break;case 42:this.$=z.preparePath(!0,H[w],this._$);break;case 43:this.$=z.preparePath(!1,H[w],this._$);break;case 44:H[w-2].push({part:z.id(H[w]),original:H[w],separator:H[w-1]}),this.$=H[w-2];break;case 45:this.$=[{part:z.id(H[w]),original:H[w]}];break;case 46:this.$=[];break;case 47:H[w-1].push(H[w]);break;case 48:this.$=[];break;case 49:H[w-1].push(H[w]);break;case 50:this.$=[];break;case 51:H[w-1].push(H[w]);break;case 58:this.$=[];break;case 59:H[w-1].push(H[w]);break;case 64:this.$=[];break;case 65:H[w-1].push(H[w]);break;case 70:this.$=[];break;case 71:H[w-1].push(H[w]);break;case 78:this.$=[];break;case 79:H[w-1].push(H[w]);break;case 82:this.$=[];break;case 83:H[w-1].push(H[w]);break;case 86:this.$=[];break;case 87:H[w-1].push(H[w]);break;case 90:this.$=[];break;case 91:H[w-1].push(H[w]);break;case 94:this.$=[];break;case 95:H[w-1].push(H[w]);break;case 98:this.$=[H[w]];break;case 99:H[w-1].push(H[w]);break;case 100:this.$=[H[w]];break;case 101:H[w-1].push(H[w]);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(P,Y){throw Error(P)},parse:function(P){var Y=this,O=[0],z=[null],T=[],H=this.table,f="",w=0,k=0,S=0,N=2,h=1;if(this.lexer.setInput(P),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc>"u")this.lexer.yylloc={};var C=this.lexer.yylloc;T.push(C);var I=this.lexer.options&&this.lexer.options.ranges;if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function D(Z){O.length=O.length-2*Z,z.length=z.length-Z,T.length=T.length-Z}function L(){var Z=Y.lexer.lex()||1;if(typeof Z!=="number")Z=Y.symbols_[Z]||Z;return Z}var g,y,p,o,s,Q,m={},e,j,W,X;while(!0){if(p=O[O.length-1],this.defaultActions[p])o=this.defaultActions[p];else{if(g===null||typeof g>"u")g=L();o=H[p]&&H[p][g]}if(typeof o>"u"||!o.length||!o[0]){var J="";if(!S){X=[];for(e in H[p])if(this.terminals_[e]&&e>2)X.push("'"+this.terminals_[e]+"'");if(this.lexer.showPosition)J="Parse error on line "+(w+1)+`:
6
6
  `+this.lexer.showPosition()+`
7
- Expecting `+X.join(", ")+", got '"+(this.terminals_[g]||g)+"'";else J="Parse error on line "+(w+1)+": Unexpected "+(g==1?"end of input":"'"+(this.terminals_[g]||g)+"'");this.parseError(J,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:C,expected:X})}}if(o[0]instanceof Array&&o.length>1)throw Error("Parse Error: multiple actions possible at state: "+c+", token: "+g);switch(o[0]){case 1:if(O.push(g),z.push(this.lexer.yytext),T.push(this.lexer.yylloc),O.push(o[1]),g=null,!y){if(k=this.lexer.yyleng,f=this.lexer.yytext,w=this.lexer.yylineno,C=this.lexer.yylloc,S>0)S--}else g=y,y=null;break;case 2:if(j=this.productions_[o[1]][1],p.$=z[z.length-j],p._$={first_line:T[T.length-(j||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(j||1)].first_column,last_column:T[T.length-1].last_column},I)p._$.range=[T[T.length-(j||1)].range[0],T[T.length-1].range[1]];if(F=this.performAction.call(p,f,k,w,this.yy,o[1],z,T),typeof F<"u")return F;if(j)O=O.slice(0,-1*j*2),z=z.slice(0,-1*j),T=T.slice(0,-1*j);O.push(this.productions_[o[1]][0]),z.push(p.$),T.push(p._$),W=H[O[O.length-2]][O[O.length-1]],O.push(W);break;case 3:return!0}}return!0}},q=function(){var K={EOF:1,parseError:function(Y,O){if(this.yy.parser)this.yy.parser.parseError(Y,O);else throw Error(Y)},setInput:function(Y){if(this._input=Y,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 Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var O=Y.match(/(?:\r\n?|\n).*/g);if(O)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),Y},unput:function(Y){var O=Y.length,z=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O-1),this.offset-=O;var T=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 H=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===T.length?this.yylloc.first_column:0)+T[T.length-z.length].length-z[0].length:this.yylloc.first_column-O},this.options.ranges)this.yylloc.range=[H[0],H[0]+this.yyleng-O];return this},more:function(){return this._more=!0,this},less:function(Y){this.unput(this.match.slice(Y))},pastInput:function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Y=this.match;if(Y.length<20)Y+=this._input.substr(0,20-Y.length);return(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Y=this.pastInput(),O=Array(Y.length+1).join("-");return Y+this.upcomingInput()+`
7
+ Expecting `+X.join(", ")+", got '"+(this.terminals_[g]||g)+"'";else J="Parse error on line "+(w+1)+": Unexpected "+(g==1?"end of input":"'"+(this.terminals_[g]||g)+"'");this.parseError(J,{text:this.lexer.match,token:this.terminals_[g]||g,line:this.lexer.yylineno,loc:C,expected:X})}}if(o[0]instanceof Array&&o.length>1)throw Error("Parse Error: multiple actions possible at state: "+p+", token: "+g);switch(o[0]){case 1:if(O.push(g),z.push(this.lexer.yytext),T.push(this.lexer.yylloc),O.push(o[1]),g=null,!y){if(k=this.lexer.yyleng,f=this.lexer.yytext,w=this.lexer.yylineno,C=this.lexer.yylloc,S>0)S--}else g=y,y=null;break;case 2:if(j=this.productions_[o[1]][1],m.$=z[z.length-j],m._$={first_line:T[T.length-(j||1)].first_line,last_line:T[T.length-1].last_line,first_column:T[T.length-(j||1)].first_column,last_column:T[T.length-1].last_column},I)m._$.range=[T[T.length-(j||1)].range[0],T[T.length-1].range[1]];if(Q=this.performAction.call(m,f,k,w,this.yy,o[1],z,T),typeof Q<"u")return Q;if(j)O=O.slice(0,-1*j*2),z=z.slice(0,-1*j),T=T.slice(0,-1*j);O.push(this.productions_[o[1]][0]),z.push(m.$),T.push(m._$),W=H[O[O.length-2]][O[O.length-1]],O.push(W);break;case 3:return!0}}return!0}},q=function(){var K={EOF:1,parseError:function(Y,O){if(this.yy.parser)this.yy.parser.parseError(Y,O);else throw Error(Y)},setInput:function(Y){if(this._input=Y,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 Y=this._input[0];this.yytext+=Y,this.yyleng++,this.offset++,this.match+=Y,this.matched+=Y;var O=Y.match(/(?:\r\n?|\n).*/g);if(O)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),Y},unput:function(Y){var O=Y.length,z=Y.split(/(?:\r\n?|\n)/g);this._input=Y+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-O-1),this.offset-=O;var T=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 H=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===T.length?this.yylloc.first_column:0)+T[T.length-z.length].length-z[0].length:this.yylloc.first_column-O},this.options.ranges)this.yylloc.range=[H[0],H[0]+this.yyleng-O];return this},more:function(){return this._more=!0,this},less:function(Y){this.unput(this.match.slice(Y))},pastInput:function(){var Y=this.matched.substr(0,this.matched.length-this.match.length);return(Y.length>20?"...":"")+Y.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var Y=this.match;if(Y.length<20)Y+=this._input.substr(0,20-Y.length);return(Y.substr(0,20)+(Y.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var Y=this.pastInput(),O=Array(Y.length+1).join("-");return Y+this.upcomingInput()+`
8
8
  `+O+"^"},next:function(){if(this.done)return this.EOF;if(!this._input)this.done=!0;var Y,O,z,T,H,f;if(!this._more)this.yytext="",this.match="";var w=this._currentRules();for(var k=0;k<w.length;k++)if(z=this._input.match(this.rules[w[k]]),z&&(!O||z[0].length>O[0].length)){if(O=z,T=k,!this.options.flex)break}if(O){if(f=O[0].match(/(?:\r\n?|\n).*/g),f)this.yylineno+=f.length;if(this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:f?f[f.length-1].length-f[f.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+O[0].length},this.yytext+=O[0],this.match+=O[0],this.matches=O,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(O[0].length),this.matched+=O[0],Y=this.performAction.call(this,this.yy,this,w[T],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input)this.done=!1;if(Y)return Y;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 Y=this.next();if(typeof Y<"u")return Y;else return this.lex()},begin:function(Y){this.conditionStack.push(Y)},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(Y){this.begin(Y)}};return K.options={},K.performAction=function(Y,O,z,T){function H(w,k){return O.yytext=O.yytext.substring(w,O.yyleng-k+w)}var f=T;switch(z){case 0:if(O.yytext.slice(-2)==="\\\\")H(0,1),this.begin("mu");else if(O.yytext.slice(-1)==="\\")H(0,1),this.begin("emu");else this.begin("mu");if(O.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 H(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(O.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 O.yytext=H(1,2).replace(/\\"/g,'"'),80;break;case 32:return O.yytext=H(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 O.yytext=O.yytext.replace(/\\([\\\]])/g,"$1"),72;break;case 43:return"INVALID";case 44:return 5}},K.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\/.)|]))))/,/^(?:\[(\\\]|[^\]])*\])/,/^(?:.)/,/^(?:$)/],K.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}},K}();$.lexer=q;function _(){this.yy={}}return _.prototype=$,$.Parser=_,new _}();dG.default=Bc;lG.exports=dG.default});var m5=N$((iG,BG)=>{iG.__esModule=!0;function Fc($){return $&&$.__esModule?$:{default:$}}var Qc=G8(),MW=Fc(Qc);function p5(){this.parents=[]}p5.prototype={constructor:p5,mutating:!1,acceptKey:function(q,_){var K=this.accept(q[_]);if(this.mutating){if(K&&!p5.prototype[K.type])throw new MW.default('Unexpected node type "'+K.type+'" found when accepting '+_+" on "+q.type);q[_]=K}},acceptRequired:function(q,_){if(this.acceptKey(q,_),!q[_])throw new MW.default(q.type+" requires "+_)},acceptArray:function(q){for(var _=0,K=q.length;_<K;_++)if(this.acceptKey(q,_),!q[_])q.splice(_,1),_--,K--},accept:function(q){if(!q)return;if(!this[q.type])throw new MW.default("Unknown type: "+q.type,q);if(this.current)this.parents.unshift(this.current);this.current=q;var _=this[q.type](q);if(this.current=this.parents.shift(),!this.mutating||_)return _;else if(_!==!1)return q},Program:function(q){this.acceptArray(q.body)},MustacheStatement:c5,Decorator:c5,BlockStatement:oG,DecoratorBlock:oG,PartialStatement:nG,PartialBlockStatement:function(q){nG.call(this,q),this.acceptKey(q,"program")},ContentStatement:function(){},CommentStatement:function(){},SubExpression:c5,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 c5($){this.acceptRequired($,"path"),this.acceptArray($.params),this.acceptKey($,"hash")}function oG($){c5.call(this,$),this.acceptKey($,"program"),this.acceptKey($,"inverse")}function nG($){this.acceptRequired($,"name"),this.acceptArray($.params),this.acceptKey($,"hash")}iG.default=p5;BG.exports=iG.default});var FG=N$((tG,UG)=>{tG.__esModule=!0;function sc($){return $&&$.__esModule?$:{default:$}}var $m=m5(),qm=sc($m);function e8(){var $=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];this.options=$}e8.prototype=new qm.default;e8.prototype.Program=function($){var q=!this.options.ignoreStandalone,_=!this.isRootSeen;this.isRootSeen=!0;var K=$.body;for(var P=0,Y=K.length;P<Y;P++){var O=K[P],z=this.accept(O);if(!z)continue;var T=NW(K,P,_),H=CW(K,P,_),f=z.openStandalone&&T,w=z.closeStandalone&&H,k=z.inlineStandalone&&T&&H;if(z.close)DK(K,P,!0);if(z.open)$K(K,P,!0);if(q&&k){if(DK(K,P),$K(K,P)){if(O.type==="PartialStatement")O.indent=/([ \t]+$)/.exec(K[P-1].original)[1]}}if(q&&f)DK((O.program||O.inverse).body),$K(K,P);if(q&&w)DK(K,P),$K((O.inverse||O.program).body)}return $};e8.prototype.BlockStatement=e8.prototype.DecoratorBlock=e8.prototype.PartialBlockStatement=function($){this.accept($.program),this.accept($.inverse);var q=$.program||$.inverse,_=$.program&&$.inverse,K=_,P=_;if(_&&_.chained){K=_.body[0].program;while(P.chained)P=P.body[P.body.length-1].program}var Y={open:$.openStrip.open,close:$.closeStrip.close,openStandalone:CW(q.body),closeStandalone:NW((K||q).body)};if($.openStrip.close)DK(q.body,null,!0);if(_){var O=$.inverseStrip;if(O.open)$K(q.body,null,!0);if(O.close)DK(K.body,null,!0);if($.closeStrip.open)$K(P.body,null,!0);if(!this.options.ignoreStandalone&&NW(q.body)&&CW(K.body))$K(q.body),DK(K.body)}else if($.closeStrip.open)$K(q.body,null,!0);return Y};e8.prototype.Decorator=e8.prototype.MustacheStatement=function($){return $.strip};e8.prototype.PartialStatement=e8.prototype.CommentStatement=function($){var q=$.strip||{};return{inlineStandalone:!0,open:q.open,close:q.close}};function NW($,q,_){if(q===void 0)q=$.length;var K=$[q-1],P=$[q-2];if(!K)return _;if(K.type==="ContentStatement")return(P||!_?/\r?\n\s*?$/:/(^|\r?\n)\s*?$/).test(K.original)}function CW($,q,_){if(q===void 0)q=-1;var K=$[q+1],P=$[q+2];if(!K)return _;if(K.type==="ContentStatement")return(P||!_?/^\s*?\r?\n/:/^\s*?(\r?\n|$)/).test(K.original)}function DK($,q,_){var K=$[q==null?0:q+1];if(!K||K.type!=="ContentStatement"||!_&&K.rightStripped)return;var P=K.value;K.value=K.value.replace(_?/^\s+/:/^[ \t]*\r?\n?/,""),K.rightStripped=K.value!==P}function $K($,q,_){var K=$[q==null?$.length-1:q-1];if(!K||K.type!=="ContentStatement"||!_&&K.leftStripped)return;var P=K.value;return K.value=K.value.replace(_?/\s+$/:/[ \t]+$/,""),K.leftStripped=K.value!==P,K.leftStripped}tG.default=e8;UG.exports=tG.default});var QG=N$((Zm)=>{Zm.__esModule=!0;Zm.SourceLocation=Om;Zm.id=jm;Zm.stripFlags=vm;Zm.stripComment=zm;Zm.preparePath=Wm;Zm.prepareMustache=Jm;Zm.prepareRawBlock=Hm;Zm.prepareBlock=Tm;Zm.prepareProgram=wm;Zm.preparePartialBlock=fm;function Pm($){return $&&$.__esModule?$:{default:$}}var Ym=G8(),EW=Pm(Ym);function hW($,q){if(q=q.path?q.path.original:q,$.path.original!==q){var _={loc:$.path.loc};throw new EW.default($.path.original+" doesn't match "+q,_)}}function Om($,q){this.source=$,this.start={line:q.first_line,column:q.first_column},this.end={line:q.last_line,column:q.last_column}}function jm($){if(/^\[.*\]$/.test($))return $.substring(1,$.length-1);else return $}function vm($,q){return{open:$.charAt(2)==="~",close:q.charAt(q.length-3)==="~"}}function zm($){return $.replace(/^\{\{~?!-?-?/,"").replace(/-?-?~?\}\}$/,"")}function Wm($,q,_){_=this.locInfo(_);var K=$?"@":"",P=[],Y=0;for(var O=0,z=q.length;O<z;O++){var T=q[O].part,H=q[O].original!==T;if(K+=(q[O].separator||"")+T,!H&&(T===".."||T==="."||T==="this")){if(P.length>0)throw new EW.default("Invalid path: "+K,{loc:_});else if(T==="..")Y++}else P.push(T)}return{type:"PathExpression",data:$,depth:Y,parts:P,original:K,loc:_}}function Jm($,q,_,K,P,Y){var O=K.charAt(3)||K.charAt(2),z=O!=="{"&&O!=="&",T=/\*/.test(K);return{type:T?"Decorator":"MustacheStatement",path:$,params:q,hash:_,escaped:z,strip:P,loc:this.locInfo(Y)}}function Hm($,q,_,K){hW($,_),K=this.locInfo(K);var P={type:"Program",body:q,strip:{},loc:K};return{type:"BlockStatement",path:$.path,params:$.params,hash:$.hash,program:P,openStrip:{},inverseStrip:{},closeStrip:{},loc:K}}function Tm($,q,_,K,P,Y){if(K&&K.path)hW($,K);var O=/\*/.test($.open);q.blockParams=$.blockParams;var z=void 0,T=void 0;if(_){if(O)throw new EW.default("Unexpected inverse block on decorator",_);if(_.chain)_.program.body[0].closeStrip=K.strip;T=_.strip,z=_.program}if(P)P=z,z=q,q=P;return{type:O?"DecoratorBlock":"BlockStatement",path:$.path,params:$.params,hash:$.hash,program:q,inverse:z,openStrip:$.strip,inverseStrip:T,closeStrip:K&&K.strip,loc:this.locInfo(Y)}}function wm($,q){if(!q&&$.length){var _=$[0].loc,K=$[$.length-1].loc;if(_&&K)q={source:_.source,start:{line:_.start.line,column:_.start.column},end:{line:K.end.line,column:K.end.column}}}return{type:"Program",body:$,strip:{},loc:q}}function fm($,q,_,K){return hW($,_),{type:"PartialBlockStatement",name:$.path,params:$.params,hash:$.hash,program:q,openStrip:$.strip,closeStrip:_&&_.strip,loc:this.locInfo(K)}}});var sG=N$((xm)=>{xm.__esModule=!0;xm.parseWithoutProcessing=eG;xm.parse=um;function Rm($){if($&&$.__esModule)return $;else{var q={};if($!=null){for(var _ in $)if(Object.prototype.hasOwnProperty.call($,_))q[_]=$[_]}return q.default=$,q}}function aG($){return $&&$.__esModule?$:{default:$}}var Im=rG(),RW=aG(Im),Dm=FG(),Lm=aG(Dm),bm=QG(),gm=Rm(bm),ym=pq();xm.parser=RW.default;var d5={};ym.extend(d5,gm);function eG($,q){if($.type==="Program")return $;RW.default.yy=d5,d5.locInfo=function(K){return new d5.SourceLocation(q&&q.srcName,K)};var _=RW.default.parse($);return _}function um($,q){var _=eG($,q),K=new Lm.default(q);return K.accept(_)}});var KV=N$((Bm)=>{Bm.__esModule=!0;Bm.Compiler=IW;Bm.precompile=nm;Bm.compile=im;function qV($){return $&&$.__esModule?$:{default:$}}var lm=G8(),u7=qV(lm),x7=pq(),rm=SW(),y7=qV(rm),om=[].slice;function IW(){}IW.prototype={compiler:IW,equals:function(q){var _=this.opcodes.length;if(q.opcodes.length!==_)return!1;for(var K=0;K<_;K++){var P=this.opcodes[K],Y=q.opcodes[K];if(P.opcode!==Y.opcode||!_V(P.args,Y.args))return!1}_=this.children.length;for(var K=0;K<_;K++)if(!this.children[K].equals(q.children[K]))return!1;return!0},guid:0,compile:function(q,_){return this.sourceNode=[],this.opcodes=[],this.children=[],this.options=_,this.stringParams=_.stringParams,this.trackIds=_.trackIds,_.blockParams=_.blockParams||[],_.knownHelpers=x7.extend(Object.create(null),{helperMissing:!0,blockHelperMissing:!0,each:!0,if:!0,unless:!0,with:!0,log:!0,lookup:!0},_.knownHelpers),this.accept(q)},compileProgram:function(q){var _=new this.compiler,K=_.compile(q,this.options),P=this.guid++;return this.usePartial=this.usePartial||K.usePartial,this.children[P]=K,this.useDepths=this.useDepths||K.useDepths,P},accept:function(q){if(!this[q.type])throw new u7.default("Unknown type: "+q.type,q);this.sourceNode.unshift(q);var _=this[q.type](q);return this.sourceNode.shift(),_},Program:function(q){this.options.blockParams.unshift(q.blockParams);var _=q.body,K=_.length;for(var P=0;P<K;P++)this.accept(_[P]);return this.options.blockParams.shift(),this.isSimple=K===1,this.blockParams=q.blockParams?q.blockParams.length:0,this},BlockStatement:function(q){$V(q);var{program:_,inverse:K}=q;_=_&&this.compileProgram(_),K=K&&this.compileProgram(K);var P=this.classifySexpr(q);if(P==="helper")this.helperSexpr(q,_,K);else if(P==="simple")this.simpleSexpr(q),this.opcode("pushProgram",_),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("blockValue",q.path.original);else this.ambiguousSexpr(q,_,K),this.opcode("pushProgram",_),this.opcode("pushProgram",K),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue");this.opcode("append")},DecoratorBlock:function(q){var _=q.program&&this.compileProgram(q.program),K=this.setupFullMustacheParams(q,_,void 0),P=q.path;this.useDecorators=!0,this.opcode("registerDecorator",K.length,P.original)},PartialStatement:function(q){this.usePartial=!0;var _=q.program;if(_)_=this.compileProgram(q.program);var K=q.params;if(K.length>1)throw new u7.default("Unsupported number of partial arguments: "+K.length,q);else if(!K.length)if(this.options.explicitPartialContext)this.opcode("pushLiteral","undefined");else K.push({type:"PathExpression",parts:[],depth:0});var P=q.name.original,Y=q.name.type==="SubExpression";if(Y)this.accept(q.name);this.setupFullMustacheParams(q,_,void 0,!0);var O=q.indent||"";if(this.options.preventIndent&&O)this.opcode("appendContent",O),O="";this.opcode("invokePartial",Y,P,O),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){$V(q);var _=this.classifySexpr(q);if(_==="simple")this.simpleSexpr(q);else if(_==="helper")this.helperSexpr(q);else this.ambiguousSexpr(q)},ambiguousSexpr:function(q,_,K){var P=q.path,Y=P.parts[0],O=_!=null||K!=null;this.opcode("getContext",P.depth),this.opcode("pushProgram",_),this.opcode("pushProgram",K),P.strict=!0,this.accept(P),this.opcode("invokeAmbiguous",Y,O)},simpleSexpr:function(q){var _=q.path;_.strict=!0,this.accept(_),this.opcode("resolvePossibleLambda")},helperSexpr:function(q,_,K){var P=this.setupFullMustacheParams(q,_,K),Y=q.path,O=Y.parts[0];if(this.options.knownHelpers[O])this.opcode("invokeKnownHelper",P.length,O);else if(this.options.knownHelpersOnly)throw new u7.default("You specified knownHelpersOnly, but used the unknown helper "+O,q);else Y.strict=!0,Y.falsy=!0,this.accept(Y),this.opcode("invokeHelper",P.length,Y.original,y7.default.helpers.simpleId(Y))},PathExpression:function(q){this.addDepth(q.depth),this.opcode("getContext",q.depth);var _=q.parts[0],K=y7.default.helpers.scopedId(q),P=!q.depth&&!K&&this.blockParamIndex(_);if(P)this.opcode("lookupBlockParam",P,q.parts);else if(!_)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,K)},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 _=q.pairs,K=0,P=_.length;this.opcode("pushHash");for(;K<P;K++)this.pushParam(_[K].value);while(K--)this.opcode("assignToHash",_[K].key);this.opcode("popHash")},opcode:function(q){this.opcodes.push({opcode:q,args:om.call(arguments,1),loc:this.sourceNode[0].loc})},addDepth:function(q){if(!q)return;this.useDepths=!0},classifySexpr:function(q){var _=y7.default.helpers.simpleId(q.path),K=_&&!!this.blockParamIndex(q.path.parts[0]),P=!K&&y7.default.helpers.helperExpression(q),Y=!K&&(P||_);if(Y&&!P){var O=q.path.parts[0],z=this.options;if(z.knownHelpers[O])P=!0;else if(z.knownHelpersOnly)Y=!1}if(P)return"helper";else if(Y)return"ambiguous";else return"simple"},pushParams:function(q){for(var _=0,K=q.length;_<K;_++)this.pushParam(q[_])},pushParam:function(q){var _=q.value!=null?q.value:q.original||"";if(this.stringParams){if(_.replace)_=_.replace(/^(\.?\.\/)*/g,"").replace(/\//g,".");if(q.depth)this.addDepth(q.depth);if(this.opcode("getContext",q.depth||0),this.opcode("pushStringParam",_,q.type),q.type==="SubExpression")this.accept(q)}else{if(this.trackIds){var K=void 0;if(q.parts&&!y7.default.helpers.scopedId(q)&&!q.depth)K=this.blockParamIndex(q.parts[0]);if(K){var P=q.parts.slice(1).join(".");this.opcode("pushId","BlockParam",K,P)}else{if(_=q.original||_,_.replace)_=_.replace(/^this(?:\.|$)/,"").replace(/^\.\//,"").replace(/^\.$/,"");this.opcode("pushId",q.type,_)}}this.accept(q)}},setupFullMustacheParams:function(q,_,K,P){var Y=q.params;if(this.pushParams(Y),this.opcode("pushProgram",_),this.opcode("pushProgram",K),q.hash)this.accept(q.hash);else this.opcode("emptyHash",P);return Y},blockParamIndex:function(q){for(var _=0,K=this.options.blockParams.length;_<K;_++){var P=this.options.blockParams[_],Y=P&&x7.indexOf(P,q);if(P&&Y>=0)return[_,Y]}}};function nm($,q,_){if($==null||typeof $!=="string"&&$.type!=="Program")throw new u7.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 K=_.parse($,q),P=new _.Compiler().compile(K,q);return new _.JavaScriptCompiler().compile(P,q)}function im($,q,_){if(q===void 0)q={};if($==null||typeof $!=="string"&&$.type!=="Program")throw new u7.default("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+$);if(q=x7.extend({},q),!("data"in q))q.data=!0;if(q.compat)q.useDepths=!0;var K=void 0;function P(){var O=_.parse($,q),z=new _.Compiler().compile(O,q),T=new _.JavaScriptCompiler().compile(z,q,void 0,!0);return _.template(T)}function Y(O,z){if(!K)K=P();return K.call(this,O,z)}return Y._setup=function(O){if(!K)K=P();return K._setup(O)},Y._child=function(O,z,T,H){if(!K)K=P();return K._child(O,z,T,H)},Y}function _V($,q){if($===q)return!0;if(x7.isArray($)&&x7.isArray(q)&&$.length===q.length){for(var _=0;_<$.length;_++)if(!_V($[_],q[_]))return!1;return!0}}function $V($){if(!$.path.parts){var q=$.path;$.path={type:"PathExpression",data:!1,depth:0,parts:[q.original+""],original:q.original+"",loc:q.loc}}}});var YV=N$((am)=>{var PV="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");am.encode=function($){if(0<=$&&$<PV.length)return PV[$];throw TypeError("Must be between 0 and 63: "+$)};am.decode=function($){var q=65,_=90,K=97,P=122,Y=48,O=57,z=43,T=47,H=26,f=52;if(q<=$&&$<=_)return $-q;if(K<=$&&$<=P)return $-K+H;if(Y<=$&&$<=O)return $-Y+f;if($==z)return 62;if($==T)return 63;return-1}});var LW=N$((_d)=>{var OV=YV(),DW=5,jV=1<<DW,vV=jV-1,zV=jV;function $d($){return $<0?(-$<<1)+1:($<<1)+0}function qd($){var q=($&1)===1,_=$>>1;return q?-_:_}_d.encode=function(q){var _="",K,P=$d(q);do{if(K=P&vV,P>>>=DW,P>0)K|=zV;_+=OV.encode(K)}while(P>0);return _};_d.decode=function(q,_,K){var P=q.length,Y=0,O=0,z,T;do{if(_>=P)throw Error("Expected more digits in base 64 VLQ value.");if(T=OV.decode(q.charCodeAt(_++)),T===-1)throw Error("Invalid base64 digit: "+q.charAt(_-1));z=!!(T&zV),T&=vV,Y=Y+(T<<O),O+=DW}while(z);K.value=qd(Y),K.rest=_}});var b4=N$((fd)=>{function Yd($,q,_){if(q in $)return $[q];else if(arguments.length===3)return _;else throw Error('"'+q+'" is a required argument.')}fd.getArg=Yd;var WV=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,Od=/^data:.+\,.+$/;function p7($){var q=$.match(WV);if(!q)return null;return{scheme:q[1],auth:q[2],host:q[3],port:q[4],path:q[5]}}fd.urlParse=p7;function D4($){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}fd.urlGenerate=D4;function bW($){var q=$,_=p7($);if(_){if(!_.path)return $;q=_.path}var K=fd.isAbsolute(q),P=q.split(/\/+/);for(var Y,O=0,z=P.length-1;z>=0;z--)if(Y=P[z],Y===".")P.splice(z,1);else if(Y==="..")O++;else if(O>0)if(Y==="")P.splice(z+1,O),O=0;else P.splice(z,2),O--;if(q=P.join("/"),q==="")q=K?"/":".";if(_)return _.path=q,D4(_);return q}fd.normalize=bW;function JV($,q){if($==="")$=".";if(q==="")q=".";var _=p7(q),K=p7($);if(K)$=K.path||"/";if(_&&!_.scheme){if(K)_.scheme=K.scheme;return D4(_)}if(_||q.match(Od))return q;if(K&&!K.host&&!K.path)return K.host=q,D4(K);var P=q.charAt(0)==="/"?q:bW($.replace(/\/+$/,"")+"/"+q);if(K)return K.path=P,D4(K);return P}fd.join=JV;fd.isAbsolute=function($){return $.charAt(0)==="/"||WV.test($)};function jd($,q){if($==="")$=".";$=$.replace(/\/$/,"");var _=0;while(q.indexOf($+"/")!==0){var K=$.lastIndexOf("/");if(K<0)return q;if($=$.slice(0,K),$.match(/^([^\/]+:\/)?\/*$/))return q;++_}return Array(_+1).join("../")+q.substr($.length+1)}fd.relative=jd;var HV=function(){var $=Object.create(null);return!("__proto__"in $)}();function TV($){return $}function vd($){if(wV($))return"$"+$;return $}fd.toSetString=HV?TV:vd;function zd($){if(wV($))return $.slice(1);return $}fd.fromSetString=HV?TV:zd;function wV($){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 _=q-10;_>=0;_--)if($.charCodeAt(_)!==36)return!1;return!0}function Wd($,q,_){var K=L4($.source,q.source);if(K!==0)return K;if(K=$.originalLine-q.originalLine,K!==0)return K;if(K=$.originalColumn-q.originalColumn,K!==0||_)return K;if(K=$.generatedColumn-q.generatedColumn,K!==0)return K;if(K=$.generatedLine-q.generatedLine,K!==0)return K;return L4($.name,q.name)}fd.compareByOriginalPositions=Wd;function Jd($,q,_){var K=$.generatedLine-q.generatedLine;if(K!==0)return K;if(K=$.generatedColumn-q.generatedColumn,K!==0||_)return K;if(K=L4($.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 L4($.name,q.name)}fd.compareByGeneratedPositionsDeflated=Jd;function L4($,q){if($===q)return 0;if($===null)return 1;if(q===null)return-1;if($>q)return 1;return-1}function Hd($,q){var _=$.generatedLine-q.generatedLine;if(_!==0)return _;if(_=$.generatedColumn-q.generatedColumn,_!==0)return _;if(_=L4($.source,q.source),_!==0)return _;if(_=$.originalLine-q.originalLine,_!==0)return _;if(_=$.originalColumn-q.originalColumn,_!==0)return _;return L4($.name,q.name)}fd.compareByGeneratedPositionsInflated=Hd;function Td($){return JSON.parse($.replace(/^\)]}'[^\n]*\n/,""))}fd.parseSourceMapInput=Td;function wd($,q,_){if(q=q||"",$){if($[$.length-1]!=="/"&&q[0]!=="/")$+="/";q=$+q}if(_){var K=p7(_);if(!K)throw Error("sourceMapURL could not be parsed");if(K.path){var P=K.path.lastIndexOf("/");if(P>=0)K.path=K.path.substring(0,P+1)}q=JV(D4(K),q)}return bW(q)}fd.computeSourceURL=wd});var uW=N$((Dd)=>{var gW=b4(),yW=Object.prototype.hasOwnProperty,LK=typeof Map<"u";function k_(){this._array=[],this._set=LK?new Map:Object.create(null)}k_.fromArray=function(q,_){var K=new k_;for(var P=0,Y=q.length;P<Y;P++)K.add(q[P],_);return K};k_.prototype.size=function(){return LK?this._set.size:Object.getOwnPropertyNames(this._set).length};k_.prototype.add=function(q,_){var K=LK?q:gW.toSetString(q),P=LK?this.has(q):yW.call(this._set,K),Y=this._array.length;if(!P||_)this._array.push(q);if(!P)if(LK)this._set.set(q,Y);else this._set[K]=Y};k_.prototype.has=function(q){if(LK)return this._set.has(q);else{var _=gW.toSetString(q);return yW.call(this._set,_)}};k_.prototype.indexOf=function(q){if(LK){var _=this._set.get(q);if(_>=0)return _}else{var K=gW.toSetString(q);if(yW.call(this._set,K))return this._set[K]}throw Error('"'+q+'" is not in the set.')};k_.prototype.at=function(q){if(q>=0&&q<this._array.length)return this._array[q];throw Error("No element indexed by "+q)};k_.prototype.toArray=function(){return this._array.slice()};Dd.ArraySet=k_});var ZV=N$((gd)=>{var fV=b4();function bd($,q){var _=$.generatedLine,K=q.generatedLine,P=$.generatedColumn,Y=q.generatedColumn;return K>_||K==_&&Y>=P||fV.compareByGeneratedPositionsInflated($,q)<=0}function l5(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}l5.prototype.unsortedForEach=function(q,_){this._array.forEach(q,_)};l5.prototype.add=function(q){if(bd(this._last,q))this._last=q,this._array.push(q);else this._sorted=!1,this._array.push(q)};l5.prototype.toArray=function(){if(!this._sorted)this._array.sort(fV.compareByGeneratedPositionsInflated),this._sorted=!0;return this._array};gd.MappingList=l5});var xW=N$((xd)=>{var c7=LW(),B6=b4(),r5=uW().ArraySet,ud=ZV().MappingList;function V8($){if(!$)$={};this._file=B6.getArg($,"file",null),this._sourceRoot=B6.getArg($,"sourceRoot",null),this._skipValidation=B6.getArg($,"skipValidation",!1),this._sources=new r5,this._names=new r5,this._mappings=new ud,this._sourcesContents=null}V8.prototype._version=3;V8.fromSourceMap=function(q){var _=q.sourceRoot,K=new V8({file:q.file,sourceRoot:_});return q.eachMapping(function(P){var Y={generated:{line:P.generatedLine,column:P.generatedColumn}};if(P.source!=null){if(Y.source=P.source,_!=null)Y.source=B6.relative(_,Y.source);if(Y.original={line:P.originalLine,column:P.originalColumn},P.name!=null)Y.name=P.name}K.addMapping(Y)}),q.sources.forEach(function(P){var Y=P;if(_!==null)Y=B6.relative(_,P);if(!K._sources.has(Y))K._sources.add(Y);var O=q.sourceContentFor(P);if(O!=null)K.setSourceContent(P,O)}),K};V8.prototype.addMapping=function(q){var _=B6.getArg(q,"generated"),K=B6.getArg(q,"original",null),P=B6.getArg(q,"source",null),Y=B6.getArg(q,"name",null);if(!this._skipValidation)this._validateMapping(_,K,P,Y);if(P!=null){if(P=String(P),!this._sources.has(P))this._sources.add(P)}if(Y!=null){if(Y=String(Y),!this._names.has(Y))this._names.add(Y)}this._mappings.add({generatedLine:_.line,generatedColumn:_.column,originalLine:K!=null&&K.line,originalColumn:K!=null&&K.column,source:P,name:Y})};V8.prototype.setSourceContent=function(q,_){var K=q;if(this._sourceRoot!=null)K=B6.relative(this._sourceRoot,K);if(_!=null){if(!this._sourcesContents)this._sourcesContents=Object.create(null);this._sourcesContents[B6.toSetString(K)]=_}else if(this._sourcesContents){if(delete this._sourcesContents[B6.toSetString(K)],Object.keys(this._sourcesContents).length===0)this._sourcesContents=null}};V8.prototype.applySourceMap=function(q,_,K){var P=_;if(_==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.`);P=q.file}var Y=this._sourceRoot;if(Y!=null)P=B6.relative(Y,P);var O=new r5,z=new r5;this._mappings.unsortedForEach(function(T){if(T.source===P&&T.originalLine!=null){var H=q.originalPositionFor({line:T.originalLine,column:T.originalColumn});if(H.source!=null){if(T.source=H.source,K!=null)T.source=B6.join(K,T.source);if(Y!=null)T.source=B6.relative(Y,T.source);if(T.originalLine=H.line,T.originalColumn=H.column,H.name!=null)T.name=H.name}}var f=T.source;if(f!=null&&!O.has(f))O.add(f);var w=T.name;if(w!=null&&!z.has(w))z.add(w)},this),this._sources=O,this._names=z,q.sources.forEach(function(T){var H=q.sourceContentFor(T);if(H!=null){if(K!=null)T=B6.join(K,T);if(Y!=null)T=B6.relative(Y,T);this.setSourceContent(T,H)}},this)};V8.prototype._validateMapping=function(q,_,K,P){if(_&&typeof _.line!=="number"&&typeof _.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&&_&&"line"in _&&"column"in _&&q.line>0&&q.column>=0&&_.line>0&&_.column>=0&&K)return;else throw Error("Invalid mapping: "+JSON.stringify({generated:q,source:K,original:_,name:P}))};V8.prototype._serializeMappings=function(){var q=0,_=1,K=0,P=0,Y=0,O=0,z="",T,H,f,w,k=this._mappings.toArray();for(var S=0,N=k.length;S<N;S++){if(H=k[S],T="",H.generatedLine!==_){q=0;while(H.generatedLine!==_)T+=";",_++}else if(S>0){if(!B6.compareByGeneratedPositionsInflated(H,k[S-1]))continue;T+=","}if(T+=c7.encode(H.generatedColumn-q),q=H.generatedColumn,H.source!=null){if(w=this._sources.indexOf(H.source),T+=c7.encode(w-O),O=w,T+=c7.encode(H.originalLine-1-P),P=H.originalLine-1,T+=c7.encode(H.originalColumn-K),K=H.originalColumn,H.name!=null)f=this._names.indexOf(H.name),T+=c7.encode(f-Y),Y=f}z+=T}return z};V8.prototype._generateSourcesContent=function(q,_){return q.map(function(K){if(!this._sourcesContents)return null;if(_!=null)K=B6.relative(_,K);var P=B6.toSetString(K);return Object.prototype.hasOwnProperty.call(this._sourcesContents,P)?this._sourcesContents[P]:null},this)};V8.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};V8.prototype.toString=function(){return JSON.stringify(this.toJSON())};xd.SourceMapGenerator=V8});var AV=N$((cd)=>{cd.GREATEST_LOWER_BOUND=1;cd.LEAST_UPPER_BOUND=2;function pW($,q,_,K,P,Y){var O=Math.floor((q-$)/2)+$,z=P(_,K[O],!0);if(z===0)return O;else if(z>0){if(q-O>1)return pW(O,q,_,K,P,Y);if(Y==cd.LEAST_UPPER_BOUND)return q<K.length?q:-1;else return O}else{if(O-$>1)return pW($,O,_,K,P,Y);if(Y==cd.LEAST_UPPER_BOUND)return O;else return $<0?-1:$}}cd.search=function(q,_,K,P){if(_.length===0)return-1;var Y=pW(-1,_.length,q,_,K,P||cd.GREATEST_LOWER_BOUND);if(Y<0)return-1;while(Y-1>=0){if(K(_[Y],_[Y-1],!0)!==0)break;--Y}return Y}});var kV=N$((ld)=>{function mW($,q,_){var K=$[q];$[q]=$[_],$[_]=K}function dd($,q){return Math.round($+Math.random()*(q-$))}function dW($,q,_,K){if(_<K){var P=dd(_,K),Y=_-1;mW($,P,K);var O=$[K];for(var z=_;z<K;z++)if(q($[z],O)<=0)Y+=1,mW($,Y,z);mW($,Y+1,z);var T=Y+1;dW($,q,_,T-1),dW($,q,T+1,K)}}ld.quickSort=function($,q){dW($,q,0,$.length-1)}});var VV=N$((nd)=>{var a$=b4(),lW=AV(),g4=uW().ArraySet,od=LW(),m7=kV().quickSort;function L6($,q){var _=$;if(typeof $==="string")_=a$.parseSourceMapInput($);return _.sections!=null?new p8(_,q):new Gq(_,q)}L6.fromSourceMap=function($,q){return Gq.fromSourceMap($,q)};L6.prototype._version=3;L6.prototype.__generatedMappings=null;Object.defineProperty(L6.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__generatedMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__generatedMappings}});L6.prototype.__originalMappings=null;Object.defineProperty(L6.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){if(!this.__originalMappings)this._parseMappings(this._mappings,this.sourceRoot);return this.__originalMappings}});L6.prototype._charIsMappingSeparator=function(q,_){var K=q.charAt(_);return K===";"||K===","};L6.prototype._parseMappings=function(q,_){throw Error("Subclasses must implement _parseMappings")};L6.GENERATED_ORDER=1;L6.ORIGINAL_ORDER=2;L6.GREATEST_LOWER_BOUND=1;L6.LEAST_UPPER_BOUND=2;L6.prototype.eachMapping=function(q,_,K){var P=_||null,Y=K||L6.GENERATED_ORDER,O;switch(Y){case L6.GENERATED_ORDER:O=this._generatedMappings;break;case L6.ORIGINAL_ORDER:O=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var z=this.sourceRoot;O.map(function(T){var H=T.source===null?null:this._sources.at(T.source);return H=a$.computeSourceURL(z,H,this._sourceMapURL),{source:H,generatedLine:T.generatedLine,generatedColumn:T.generatedColumn,originalLine:T.originalLine,originalColumn:T.originalColumn,name:T.name===null?null:this._names.at(T.name)}},this).forEach(q,P)};L6.prototype.allGeneratedPositionsFor=function(q){var _=a$.getArg(q,"line"),K={source:a$.getArg(q,"source"),originalLine:_,originalColumn:a$.getArg(q,"column",0)};if(K.source=this._findSourceIndex(K.source),K.source<0)return[];var P=[],Y=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",a$.compareByOriginalPositions,lW.LEAST_UPPER_BOUND);if(Y>=0){var O=this._originalMappings[Y];if(q.column===void 0){var z=O.originalLine;while(O&&O.originalLine===z)P.push({line:a$.getArg(O,"generatedLine",null),column:a$.getArg(O,"generatedColumn",null),lastColumn:a$.getArg(O,"lastGeneratedColumn",null)}),O=this._originalMappings[++Y]}else{var T=O.originalColumn;while(O&&O.originalLine===_&&O.originalColumn==T)P.push({line:a$.getArg(O,"generatedLine",null),column:a$.getArg(O,"generatedColumn",null),lastColumn:a$.getArg(O,"lastGeneratedColumn",null)}),O=this._originalMappings[++Y]}}return P};nd.SourceMapConsumer=L6;function Gq($,q){var _=$;if(typeof $==="string")_=a$.parseSourceMapInput($);var K=a$.getArg(_,"version"),P=a$.getArg(_,"sources"),Y=a$.getArg(_,"names",[]),O=a$.getArg(_,"sourceRoot",null),z=a$.getArg(_,"sourcesContent",null),T=a$.getArg(_,"mappings"),H=a$.getArg(_,"file",null);if(K!=this._version)throw Error("Unsupported version: "+K);if(O)O=a$.normalize(O);P=P.map(String).map(a$.normalize).map(function(f){return O&&a$.isAbsolute(O)&&a$.isAbsolute(f)?a$.relative(O,f):f}),this._names=g4.fromArray(Y.map(String),!0),this._sources=g4.fromArray(P,!0),this._absoluteSources=this._sources.toArray().map(function(f){return a$.computeSourceURL(O,f,q)}),this.sourceRoot=O,this.sourcesContent=z,this._mappings=T,this._sourceMapURL=q,this.file=H}Gq.prototype=Object.create(L6.prototype);Gq.prototype.consumer=L6;Gq.prototype._findSourceIndex=function($){var q=$;if(this.sourceRoot!=null)q=a$.relative(this.sourceRoot,q);if(this._sources.has(q))return this._sources.indexOf(q);var _;for(_=0;_<this._absoluteSources.length;++_)if(this._absoluteSources[_]==$)return _;return-1};Gq.fromSourceMap=function(q,_){var K=Object.create(Gq.prototype),P=K._names=g4.fromArray(q._names.toArray(),!0),Y=K._sources=g4.fromArray(q._sources.toArray(),!0);K.sourceRoot=q._sourceRoot,K.sourcesContent=q._generateSourcesContent(K._sources.toArray(),K.sourceRoot),K.file=q._file,K._sourceMapURL=_,K._absoluteSources=K._sources.toArray().map(function(S){return a$.computeSourceURL(K.sourceRoot,S,_)});var O=q._mappings.toArray().slice(),z=K.__generatedMappings=[],T=K.__originalMappings=[];for(var H=0,f=O.length;H<f;H++){var w=O[H],k=new GV;if(k.generatedLine=w.generatedLine,k.generatedColumn=w.generatedColumn,w.source){if(k.source=Y.indexOf(w.source),k.originalLine=w.originalLine,k.originalColumn=w.originalColumn,w.name)k.name=P.indexOf(w.name);T.push(k)}z.push(k)}return m7(K.__originalMappings,a$.compareByOriginalPositions),K};Gq.prototype._version=3;Object.defineProperty(Gq.prototype,"sources",{get:function(){return this._absoluteSources.slice()}});function GV(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}Gq.prototype._parseMappings=function(q,_){var K=1,P=0,Y=0,O=0,z=0,T=0,H=q.length,f=0,w={},k={},S=[],N=[],h,C,I,D,L;while(f<H)if(q.charAt(f)===";")K++,f++,P=0;else if(q.charAt(f)===",")f++;else{h=new GV,h.generatedLine=K;for(D=f;D<H;D++)if(this._charIsMappingSeparator(q,D))break;if(C=q.slice(f,D),I=w[C],I)f+=C.length;else{I=[];while(f<D)od.decode(q,f,k),L=k.value,f=k.rest,I.push(L);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");w[C]=I}if(h.generatedColumn=P+I[0],P=h.generatedColumn,I.length>1){if(h.source=z+I[1],z+=I[1],h.originalLine=Y+I[2],Y=h.originalLine,h.originalLine+=1,h.originalColumn=O+I[3],O=h.originalColumn,I.length>4)h.name=T+I[4],T+=I[4]}if(N.push(h),typeof h.originalLine==="number")S.push(h)}m7(N,a$.compareByGeneratedPositionsDeflated),this.__generatedMappings=N,m7(S,a$.compareByOriginalPositions),this.__originalMappings=S};Gq.prototype._findMapping=function(q,_,K,P,Y,O){if(q[K]<=0)throw TypeError("Line must be greater than or equal to 1, got "+q[K]);if(q[P]<0)throw TypeError("Column must be greater than or equal to 0, got "+q[P]);return lW.search(q,_,Y,O)};Gq.prototype.computeColumnSpans=function(){for(var q=0;q<this._generatedMappings.length;++q){var _=this._generatedMappings[q];if(q+1<this._generatedMappings.length){var K=this._generatedMappings[q+1];if(_.generatedLine===K.generatedLine){_.lastGeneratedColumn=K.generatedColumn-1;continue}}_.lastGeneratedColumn=1/0}};Gq.prototype.originalPositionFor=function(q){var _={generatedLine:a$.getArg(q,"line"),generatedColumn:a$.getArg(q,"column")},K=this._findMapping(_,this._generatedMappings,"generatedLine","generatedColumn",a$.compareByGeneratedPositionsDeflated,a$.getArg(q,"bias",L6.GREATEST_LOWER_BOUND));if(K>=0){var P=this._generatedMappings[K];if(P.generatedLine===_.generatedLine){var Y=a$.getArg(P,"source",null);if(Y!==null)Y=this._sources.at(Y),Y=a$.computeSourceURL(this.sourceRoot,Y,this._sourceMapURL);var O=a$.getArg(P,"name",null);if(O!==null)O=this._names.at(O);return{source:Y,line:a$.getArg(P,"originalLine",null),column:a$.getArg(P,"originalColumn",null),name:O}}}return{source:null,line:null,column:null,name:null}};Gq.prototype.hasContentsOfAllSources=function(){if(!this.sourcesContent)return!1;return this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(q){return q==null})};Gq.prototype.sourceContentFor=function(q,_){if(!this.sourcesContent)return null;var K=this._findSourceIndex(q);if(K>=0)return this.sourcesContent[K];var P=q;if(this.sourceRoot!=null)P=a$.relative(this.sourceRoot,P);var Y;if(this.sourceRoot!=null&&(Y=a$.urlParse(this.sourceRoot))){var O=P.replace(/^file:\/\//,"");if(Y.scheme=="file"&&this._sources.has(O))return this.sourcesContent[this._sources.indexOf(O)];if((!Y.path||Y.path=="/")&&this._sources.has("/"+P))return this.sourcesContent[this._sources.indexOf("/"+P)]}if(_)return null;else throw Error('"'+P+'" is not in the SourceMap.')};Gq.prototype.generatedPositionFor=function(q){var _=a$.getArg(q,"source");if(_=this._findSourceIndex(_),_<0)return{line:null,column:null,lastColumn:null};var K={source:_,originalLine:a$.getArg(q,"line"),originalColumn:a$.getArg(q,"column")},P=this._findMapping(K,this._originalMappings,"originalLine","originalColumn",a$.compareByOriginalPositions,a$.getArg(q,"bias",L6.GREATEST_LOWER_BOUND));if(P>=0){var Y=this._originalMappings[P];if(Y.source===K.source)return{line:a$.getArg(Y,"generatedLine",null),column:a$.getArg(Y,"generatedColumn",null),lastColumn:a$.getArg(Y,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};nd.BasicSourceMapConsumer=Gq;function p8($,q){var _=$;if(typeof $==="string")_=a$.parseSourceMapInput($);var K=a$.getArg(_,"version"),P=a$.getArg(_,"sections");if(K!=this._version)throw Error("Unsupported version: "+K);this._sources=new g4,this._names=new g4;var Y={line:-1,column:0};this._sections=P.map(function(O){if(O.url)throw Error("Support for url field in sections not implemented.");var z=a$.getArg(O,"offset"),T=a$.getArg(z,"line"),H=a$.getArg(z,"column");if(T<Y.line||T===Y.line&&H<Y.column)throw Error("Section offsets must be ordered and non-overlapping.");return Y=z,{generatedOffset:{generatedLine:T+1,generatedColumn:H+1},consumer:new L6(a$.getArg(O,"map"),q)}})}p8.prototype=Object.create(L6.prototype);p8.prototype.constructor=L6;p8.prototype._version=3;Object.defineProperty(p8.prototype,"sources",{get:function(){var $=[];for(var q=0;q<this._sections.length;q++)for(var _=0;_<this._sections[q].consumer.sources.length;_++)$.push(this._sections[q].consumer.sources[_]);return $}});p8.prototype.originalPositionFor=function(q){var _={generatedLine:a$.getArg(q,"line"),generatedColumn:a$.getArg(q,"column")},K=lW.search(_,this._sections,function(Y,O){var z=Y.generatedLine-O.generatedOffset.generatedLine;if(z)return z;return Y.generatedColumn-O.generatedOffset.generatedColumn}),P=this._sections[K];if(!P)return{source:null,line:null,column:null,name:null};return P.consumer.originalPositionFor({line:_.generatedLine-(P.generatedOffset.generatedLine-1),column:_.generatedColumn-(P.generatedOffset.generatedLine===_.generatedLine?P.generatedOffset.generatedColumn-1:0),bias:q.bias})};p8.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(q){return q.consumer.hasContentsOfAllSources()})};p8.prototype.sourceContentFor=function(q,_){for(var K=0;K<this._sections.length;K++){var P=this._sections[K],Y=P.consumer.sourceContentFor(q,!0);if(Y)return Y}if(_)return null;else throw Error('"'+q+'" is not in the SourceMap.')};p8.prototype.generatedPositionFor=function(q){for(var _=0;_<this._sections.length;_++){var K=this._sections[_];if(K.consumer._findSourceIndex(a$.getArg(q,"source"))===-1)continue;var P=K.consumer.generatedPositionFor(q);if(P){var Y={line:P.line+(K.generatedOffset.generatedLine-1),column:P.column+(K.generatedOffset.generatedLine===P.line?K.generatedOffset.generatedColumn-1:0)};return Y}}return{line:null,column:null}};p8.prototype._parseMappings=function(q,_){this.__generatedMappings=[],this.__originalMappings=[];for(var K=0;K<this._sections.length;K++){var P=this._sections[K],Y=P.consumer._generatedMappings;for(var O=0;O<Y.length;O++){var z=Y[O],T=P.consumer._sources.at(z.source);T=a$.computeSourceURL(P.consumer.sourceRoot,T,this._sourceMapURL),this._sources.add(T),T=this._sources.indexOf(T);var H=null;if(z.name)H=P.consumer._names.at(z.name),this._names.add(H),H=this._names.indexOf(H);var f={source:T,generatedLine:z.generatedLine+(P.generatedOffset.generatedLine-1),generatedColumn:z.generatedColumn+(P.generatedOffset.generatedLine===z.generatedLine?P.generatedOffset.generatedColumn-1:0),originalLine:z.originalLine,originalColumn:z.originalColumn,name:H};if(this.__generatedMappings.push(f),typeof f.originalLine==="number")this.__originalMappings.push(f)}}m7(this.__generatedMappings,a$.compareByGeneratedPositionsDeflated),m7(this.__originalMappings,a$.compareByOriginalPositions)};nd.IndexedSourceMapConsumer=p8});var SV=N$((ad)=>{var Ud=xW().SourceMapGenerator,o5=b4(),Fd=/(\r?\n)/,Qd=10,y4="$$$isSourceNode$$$";function j8($,q,_,K,P){if(this.children=[],this.sourceContents={},this.line=$==null?null:$,this.column=q==null?null:q,this.source=_==null?null:_,this.name=P==null?null:P,this[y4]=!0,K!=null)this.add(K)}j8.fromStringWithSourceMap=function(q,_,K){var P=new j8,Y=q.split(Fd),O=0,z=function(){var k=N(),S=N()||"";return k+S;function N(){return O<Y.length?Y[O++]:void 0}},T=1,H=0,f=null;if(_.eachMapping(function(k){if(f!==null)if(T<k.generatedLine)w(f,z()),T++,H=0;else{var S=Y[O]||"",N=S.substr(0,k.generatedColumn-H);Y[O]=S.substr(k.generatedColumn-H),H=k.generatedColumn,w(f,N),f=k;return}while(T<k.generatedLine)P.add(z()),T++;if(H<k.generatedColumn){var S=Y[O]||"";P.add(S.substr(0,k.generatedColumn)),Y[O]=S.substr(k.generatedColumn),H=k.generatedColumn}f=k},this),O<Y.length){if(f)w(f,z());P.add(Y.splice(O).join(""))}return _.sources.forEach(function(k){var S=_.sourceContentFor(k);if(S!=null){if(K!=null)k=o5.join(K,k);P.setSourceContent(k,S)}}),P;function w(k,S){if(k===null||k.source===void 0)P.add(S);else{var N=K?o5.join(K,k.source):k.source;P.add(new j8(k.originalLine,k.originalColumn,N,S,k.name))}}};j8.prototype.add=function(q){if(Array.isArray(q))q.forEach(function(_){this.add(_)},this);else if(q[y4]||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};j8.prototype.prepend=function(q){if(Array.isArray(q))for(var _=q.length-1;_>=0;_--)this.prepend(q[_]);else if(q[y4]||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};j8.prototype.walk=function(q){var _;for(var K=0,P=this.children.length;K<P;K++)if(_=this.children[K],_[y4])_.walk(q);else if(_!=="")q(_,{source:this.source,line:this.line,column:this.column,name:this.name})};j8.prototype.join=function(q){var _,K,P=this.children.length;if(P>0){_=[];for(K=0;K<P-1;K++)_.push(this.children[K]),_.push(q);_.push(this.children[K]),this.children=_}return this};j8.prototype.replaceRight=function(q,_){var K=this.children[this.children.length-1];if(K[y4])K.replaceRight(q,_);else if(typeof K==="string")this.children[this.children.length-1]=K.replace(q,_);else this.children.push("".replace(q,_));return this};j8.prototype.setSourceContent=function(q,_){this.sourceContents[o5.toSetString(q)]=_};j8.prototype.walkSourceContents=function(q){for(var _=0,K=this.children.length;_<K;_++)if(this.children[_][y4])this.children[_].walkSourceContents(q);var P=Object.keys(this.sourceContents);for(var _=0,K=P.length;_<K;_++)q(o5.fromSetString(P[_]),this.sourceContents[P[_]])};j8.prototype.toString=function(){var q="";return this.walk(function(_){q+=_}),q};j8.prototype.toStringWithSourceMap=function(q){var _={code:"",line:1,column:0},K=new Ud(q),P=!1,Y=null,O=null,z=null,T=null;return this.walk(function(H,f){if(_.code+=H,f.source!==null&&f.line!==null&&f.column!==null){if(Y!==f.source||O!==f.line||z!==f.column||T!==f.name)K.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:_.line,column:_.column},name:f.name});Y=f.source,O=f.line,z=f.column,T=f.name,P=!0}else if(P)K.addMapping({generated:{line:_.line,column:_.column}}),Y=null,P=!1;for(var w=0,k=H.length;w<k;w++)if(H.charCodeAt(w)===Qd){if(_.line++,_.column=0,w+1===k)Y=null,P=!1;else if(P)K.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:_.line,column:_.column},name:f.name})}else _.column++}),this.walkSourceContents(function(H,f){K.setSourceContent(H,f)}),{code:_.code,map:K}};ad.SourceNode=j8});var MV=N$((sd)=>{sd.SourceMapGenerator=xW().SourceMapGenerator;sd.SourceMapConsumer=VV().SourceMapConsumer;sd.SourceNode=SV().SourceNode});var hV=N$((CV,EV)=>{CV.__esModule=!0;var oW=pq(),bK=void 0;try{if(typeof define!=="function"||!define.amd)nW=MV(),bK=nW.SourceNode}catch($){}var nW;if(!bK)bK=function($,q,_,K){if(this.src="",K)this.add(K)},bK.prototype={add:function(q){if(oW.isArray(q))q=q.join("");this.src+=q},prepend:function(q){if(oW.isArray(q))q=q.join("");this.src=q+this.src},toStringWithSourceMap:function(){return{code:this.toString()}},toString:function(){return this.src}};function rW($,q,_){if(oW.isArray($)){var K=[];for(var P=0,Y=$.length;P<Y;P++)K.push(q.wrap($[P],_));return K}else if(typeof $==="boolean"||typeof $==="number")return $+"";return $}function NV($){this.srcFile=$,this.source=[]}NV.prototype={isEmpty:function(){return!this.source.length},prepend:function(q,_){this.source.unshift(this.wrap(q,_))},push:function(q,_){this.source.push(this.wrap(q,_))},merge:function(){var q=this.empty();return this.each(function(_){q.add([" ",_,`
10
10
  `])}),q},each:function(q){for(var _=0,K=this.source.length;_<K;_++)q(this.source[_])},empty:function(){var q=this.currentLocation||{start:{}};return new bK(q.start.line,q.start.column,this.srcFile)},wrap:function(q){var _=arguments.length<=1||arguments[1]===void 0?this.currentLocation||{start:{}}:arguments[1];if(q instanceof bK)return q;return q=rW(q,this,_),new bK(_.start.line,_.start.column,this.srcFile,q)},functionCall:function(q,_,K){return K=this.generateList(K),this.wrap([q,_?"."+_+"(":"(",K,")"])},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 _=this,K=[];Object.keys(q).forEach(function(Y){var O=rW(q[Y],_);if(O!=="undefined")K.push([_.quotedString(Y),":",O])});var P=this.generateList(K);return P.prepend("{"),P.add("}"),P},generateList:function(q){var _=this.empty();for(var K=0,P=q.length;K<P;K++){if(K)_.add(",");_.add(rW(q[K],this))}return _},generateArray:function(q){var _=this.generateList(q);return _.prepend("["),_.add("]"),_}};CV.default=NV;EV.exports=CV.default});var gV=N$((LV,bV)=>{LV.__esModule=!0;function DV($){return $&&$.__esModule?$:{default:$}}var RV=u5(),Yl=G8(),iW=DV(Yl),Ol=pq(),jl=hV(),IV=DV(jl);function u4($){this.value=$}function x4(){}x4.prototype={nameLookup:function(q,_){return this.internalNameLookup(q,_)},depthedLookup:function(q){return[this.aliasable("container.lookup"),"(depths, ",JSON.stringify(q),")"]},compilerInfo:function(){var q=RV.COMPILER_REVISION,_=RV.REVISION_CHANGES[q];return[q,_]},appendToBuffer:function(q,_,K){if(!Ol.isArray(q))q=[q];if(q=this.source.wrap(q,_),this.environment.isSimple)return["return ",q,";"];else if(K)return["buffer += ",q,";"];else return q.appendToBuffer=!0,q},initializeBuffer:function(){return this.quotedString("")},internalNameLookup:function(q,_){return this.lookupPropertyFunctionIsUsed=!0,["lookupProperty(",q,",",JSON.stringify(_),")"]},lookupPropertyFunctionIsUsed:!1,compile:function(q,_,K,P){this.environment=q,this.options=_,this.stringParams=this.options.stringParams,this.trackIds=this.options.trackIds,this.precompile=!P,this.name=this.environment.name,this.isChild=!!K,this.context=K||{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,_),this.useDepths=this.useDepths||q.useDepths||q.useDecorators||this.options.compat,this.useBlockParams=this.useBlockParams||q.useBlockParams;var Y=q.opcodes,O=void 0,z=void 0,T=void 0,H=void 0;for(T=0,H=Y.length;T<H;T++)O=Y[T],this.source.currentLocation=O.loc,z=z||O.loc,this[O.opcode].apply(this,O.args);if(this.source.currentLocation=z,this.pushSource(""),this.stackSlot||this.inlineStack.length||this.compileStack.length)throw new iW.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 `+X.join(", ")+", got '"+(this.terminals_[g]||g)+"'";else J="Parse err
31
31
  `)>=0)K++;return Y+O.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(P>60)return _[0]+(q===""?"":q+`
32
32
  `)+" "+$.join(`,
33
33
  `)+" "+_[1];return _[0]+q+" "+$.join(", ")+" "+_[1]}function A0($){return Array.isArray($)}function jH($){return typeof $==="boolean"}function w2($){return $===null}function fn($){return $==null}function k0($){return typeof $==="number"}function f2($){return typeof $==="string"}function Zn($){return typeof $==="symbol"}function l4($){return $===void 0}function W2($){return r4($)&&vH($)==="[object RegExp]"}function r4($){return typeof $==="object"&&$!==null}function YH($){return r4($)&&vH($)==="[object Date]"}function J2($){return r4($)&&(vH($)==="[object Error]"||$ instanceof Error)}function H2($){return typeof $==="function"}function Xn($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function An($){return $ instanceof Buffer}function vH($){return Object.prototype.toString.call($)}function KH($){return $<10?"0"+$.toString(10):$.toString(10)}function Gn(){var $=new Date,q=[KH($.getHours()),KH($.getMinutes()),KH($.getSeconds())].join(":");return[$.getDate(),kn[$.getMonth()],q].join(" ")}function G0(...$){console.log("%s - %s",Gn(),OH.apply(null,$))}function V0($,q){if(q)$.super_=q,$.prototype=Object.create(q.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function zH($,q){if(!q||!r4(q))return $;var _=Object.keys(q),K=_.length;while(K--)$[_[K]]=q[_[K]];return $}function S0($,q){return Object.prototype.hasOwnProperty.call($,q)}function WH($,q){if(!$){var _=Error("Promise was rejected with a falsy value");_.reason=$,$=_}return q($)}function N0($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function q(..._){var K=_.pop();if(typeof K!=="function")throw TypeError("The last argument must be of type Function");var P=this,Y=function(...O){return K.apply(P,...O)};$.apply(this,_).then(function(O){process.nextTick(Y.bind(null,null,O))},function(O){process.nextTick(WH.bind(null,O,Y))})}return Object.setPrototypeOf(q,Object.getPrototypeOf($)),Object.defineProperties(q,Object.getOwnPropertyDescriptors($)),q}var Yn,jn,uK,wn=()=>{},kn,M0,C0,E0,Vn;var R0=lK(()=>{Yn=/%[sdj%]/g;jn=(($={},q={},_)=>((_=typeof process<"u"&&!1)&&(_=_.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),q=new RegExp("^"+_+"$","i"),(K)=>{if(K=K.toUpperCase(),!$[K])if(q.test(K))$[K]=function(...P){console.error("%s: %s",K,pid,OH.apply(null,...P))};else $[K]=function(){};return $[K]}))(),uK=(($)=>($.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,..._){var K={seen:[],stylize:zn};if(_.length>=1)K.depth=_[0];if(_.length>=2)K.colors=_[1];if(jH(q))K.showHidden=q;else if(q)zH(K,q);if(l4(K.showHidden))K.showHidden=!1;if(l4(K.depth))K.depth=2;if(l4(K.colors))K.colors=!1;if(K.colors)K.stylize=vn;return T2(K,$,K.depth)});kn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];M0=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&$[kCustomPromisifiedSymbol]){var q=$[kCustomPromisifiedSymbol];if(typeof q!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0}),q}function q(..._){var K,P,Y=new Promise(function(O,z){K=O,P=z});_.push(function(O,z){if(O)P(O);else K(z)});try{$.apply(this,_)}catch(O){P(O)}return Y}if(Object.setPrototypeOf(q,Object.getPrototypeOf($)),kCustomPromisifiedSymbol)Object.defineProperty(q,kCustomPromisifiedSymbol,{value:q,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(q,Object.getOwnPropertyDescriptors($))});({TextEncoder:C0,TextDecoder:E0}=globalThis),Vn={TextEncoder:C0,TextDecoder:E0,promisify:M0,log:G0,inherits:V0,_extend:zH,callbackifyOnRejected:WH,callbackify:N0}});var Q7={};rq(Q7,{setMaxListeners:()=>m0,once:()=>p0,listenerCount:()=>d0,init:()=>_K,getMaxListeners:()=>r0,getEventListeners:()=>c0,default:()=>Dn,captureRejectionSymbol:()=>g0,addAbortListener:()=>o0,EventEmitter:()=>_K});function y0($,q){var{_events:_}=$;if(q[0]??=Error("Unhandled error."),!_)throw q[0];var K=_[b0];if(K)for(var P of D0.call(K))P.apply($,q);var Y=_.error;if(!Y)throw q[0];for(var P of D0.call(Y))P.apply($,q);return!0}function Nn($,q,_,K){q.then(void 0,function(P){queueMicrotask(()=>Cn($,P,_,K))})}function Cn($,q,_,K){if(typeof $[I0]==="function")$[I0](q,_,...K);else try{$[xK]=!1,$.emit("error",q)}finally{$[xK]=!0}}function u0($,q,_){_.warned=!0;let K=Error(`Possible EventEmitter memory leak detected. ${_.length} ${String(q)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);K.name="MaxListenersExceededWarning",K.emitter=$,K.type=q,K.count=_.length,console.warn(K)}function x0($,q,..._){this.removeListener($,q),q.apply(this,_)}function p0($,q,_){var K=_?.signal;if(l0(K,"options.signal"),K?.aborted)throw new JH(void 0,{cause:K?.reason});let{resolve:P,reject:Y,promise:O}=$newPromiseCapability(Promise),z=(f)=>{if($.removeListener(q,T),K!=null)Z2(K,"abort",H);Y(f)},T=(...f)=>{if(typeof $.removeListener==="function")$.removeListener("error",z);if(K!=null)Z2(K,"abort",H);P(f)};if(L0($,q,T,{once:!0}),q!=="error"&&typeof $.once==="function")$.once("error",z);function H(){Z2($,q,T),Z2($,"error",z),Y(new JH(void 0,{cause:K?.reason}))}if(K!=null)L0(K,"abort",H,{once:!0});return O}function c0($,q){return $.listeners(q)}function m0($,...q){TH($,"setMaxListeners",0);var _;if(q&&(_=q.length))for(let K=0;K<_;K++)q[K].setMaxListeners($);else pK=$}function d0($,q){return $.listenerCount(q)}function Z2($,q,_,K){if(typeof $.removeListener==="function")$.removeListener(q,_);else $.removeEventListener(q,_,K)}function L0($,q,_,K){if(typeof $.on==="function")if(K.once)$.once(q,_);else $.on(q,_);else $.addEventListener(q,_,K)}function o4($,q,_){let K=TypeError(`The "${$}" argument must be of type ${q}. Received ${_}`);return K.code="ERR_INVALID_ARG_TYPE",K}function Rn($,q,_){let K=RangeError(`The "${$}" argument is out of range. It must be ${q}. Received ${_}`);return K.code="ERR_OUT_OF_RANGE",K}function l0($,q){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw o4(q,"AbortSignal",$)}function TH($,q,_,K){if(typeof $!=="number")throw o4(q,"number",$);if(_!=null&&$<_||K!=null&&$>K||(_!=null||K!=null)&&Number.isNaN($))throw Rn(q,`${_!=null?`>= ${_}`:""}${_!=null&&K!=null?" && ":""}${K!=null?`<= ${K}`:""}`,$)}function F7($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function In($,q){if(typeof $!=="boolean")throw o4(q,"boolean",$)}function r0($){return $?._maxListeners??pK}function o0($,q){if($===void 0)throw o4("signal","AbortSignal",$);if(l0($,"signal"),typeof q!=="function")throw o4("listener","function",q);let _;if($.aborted)queueMicrotask(()=>q());else $.addEventListener("abort",q,{__proto__:null,once:!0}),_=()=>{$.removeEventListener("abort",q)};return{__proto__:null,[Symbol.dispose](){_?.()}}}var HH,xK,b0,Sn,Mn,I0,g0,D0,pK=10,_K=function($){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[xK]=$?.captureRejections?Boolean($?.captureRejections):b6[xK])this.emit=hn},b6,En=function($,...q){if($==="error")return y0(this,q);var{_events:_}=this;if(_===void 0)return!1;var K=_[$];if(K===void 0)return!1;let P=K.length>1?K.slice():K;for(let Y=0,{length:O}=P;Y<O;Y++){let z=P[Y];switch(q.length){case 0:z.call(this);break;case 1:z.call(this,q[0]);break;case 2:z.call(this,q[0],q[1]);break;case 3:z.call(this,q[0],q[1],q[2]);break;default:z.apply(this,q);break}}return!0},hn=function($,...q){if($==="error")return y0(this,q);var{_events:_}=this;if(_===void 0)return!1;var K=_[$];if(K===void 0)return!1;let P=K.length>1?K.slice():K;for(let Y=0,{length:O}=P;Y<O;Y++){let z=P[Y],T;switch(q.length){case 0:T=z.call(this);break;case 1:T=z.call(this,q[0]);break;case 2:T=z.call(this,q[0],q[1]);break;case 3:T=z.call(this,q[0],q[1],q[2]);break;default:T=z.apply(this,q);break}if(T!==void 0&&typeof T?.then==="function"&&T.then===Promise.prototype.then)Nn(this,T,$,q)}return!0},JH,Dn;var a7=lK(()=>{HH=Symbol.for,xK=Symbol("kCapture"),b0=HH("events.errorMonitor"),Sn=Symbol("events.maxEventTargetListeners"),Mn=Symbol("events.maxEventTargetListenersWarned"),I0=HH("nodejs.rejection"),g0=HH("nodejs.rejection"),D0=Array.prototype.slice,b6=_K.prototype={};b6._events=void 0;b6._eventsCount=0;b6._maxListeners=void 0;b6.setMaxListeners=function($){return TH($,"setMaxListeners",0),this._maxListeners=$,this};b6.constructor=_K;b6.getMaxListeners=function(){return this?._maxListeners??pK};b6.emit=En;b6.addListener=function($,q){F7(q);var _=this._events;if(!_)_=this._events={__proto__:null},this._eventsCount=0;else if(_.newListener)this.emit("newListener",$,q.listener??q);var K=_[$];if(!K)_[$]=[q],this._eventsCount++;else{K.push(q);var P=this._maxListeners??pK;if(P>0&&K.length>P&&!K.warned)u0(this,$,K)}return this};b6.on=b6.addListener;b6.prependListener=function($,q){F7(q);var _=this._events;if(!_)_=this._events={__proto__:null},this._eventsCount=0;else if(_.newListener)this.emit("newListener",$,q.listener??q);var K=_[$];if(!K)_[$]=[q],this._eventsCount++;else{K.unshift(q);var P=this._maxListeners??pK;if(P>0&&K.length>P&&!K.warned)u0(this,$,K)}return this};b6.once=function($,q){F7(q);let _=x0.bind(this,$,q);return _.listener=q,this.addListener($,_),this};b6.prependOnceListener=function($,q){F7(q);let _=x0.bind(this,$,q);return _.listener=q,this.prependListener($,_),this};b6.removeListener=function($,q){F7(q);var{_events:_}=this;if(!_)return this;var K=_[$];if(!K)return this;var P=K.length;let Y=-1;for(let O=P-1;O>=0;O--)if(K[O]===q||K[O].listener===q){Y=O;break}if(Y<0)return this;if(Y===0)K.shift();else K.splice(Y,1);if(K.length===0)delete _[$],this._eventsCount--;return this};b6.off=b6.removeListener;b6.removeAllListeners=function($){var{_events:q}=this;if($&&q){if(q[$])delete q[$],this._eventsCount--}else this._events={__proto__:null};return this};b6.listeners=function($){var{_events:q}=this;if(!q)return[];var _=q[$];if(!_)return[];return _.map((K)=>K.listener??K)};b6.rawListeners=function($){var{_events:q}=this;if(!q)return[];var _=q[$];if(!_)return[];return _.slice()};b6.listenerCount=function($){var{_events:q}=this;if(!q)return 0;return q[$]?.length??0};b6.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};b6[xK]=!1;JH=class JH extends Error{constructor($="The operation was aborted",q=void 0){if(q!==void 0&&typeof q!=="object")throw o4("options","Object",q);super($,q);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(_K,{captureRejections:{get(){return b6[xK]},set($){In($,"EventEmitter.captureRejections"),b6[xK]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return pK},set:($)=>{TH($,"defaultMaxListeners",0),pK=$}},kMaxEventTargetListeners:{value:Sn,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:Mn,enumerable:!1,configurable:!1,writable:!1}});Object.assign(_K,{once:p0,getEventListeners:c0,getMaxListeners:r0,setMaxListeners:m0,EventEmitter:_K,usingDomains:!1,captureRejectionSymbol:g0,errorMonitor:b0,addAbortListener:o0,init:_K,listenerCount:d0});Dn=_K});var XH=N$((T5$,a0)=>{var S6=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),x6=S6(($,q)=>{class _ extends Error{constructor(K){if(!Array.isArray(K))throw TypeError(`Expected input to be an Array, got ${typeof K}`);let P="";for(let Y=0;Y<K.length;Y++)P+=` ${K[Y].stack}
34
- `;super(P);this.name="AggregateError",this.errors=K}}q.exports={AggregateError:_,ArrayIsArray(K){return Array.isArray(K)},ArrayPrototypeIncludes(K,P){return K.includes(P)},ArrayPrototypeIndexOf(K,P){return K.indexOf(P)},ArrayPrototypeJoin(K,P){return K.join(P)},ArrayPrototypeMap(K,P){return K.map(P)},ArrayPrototypePop(K,P){return K.pop(P)},ArrayPrototypePush(K,P){return K.push(P)},ArrayPrototypeSlice(K,P,Y){return K.slice(P,Y)},Error,FunctionPrototypeCall(K,P,...Y){return K.call(P,...Y)},FunctionPrototypeSymbolHasInstance(K,P){return Function.prototype[Symbol.hasInstance].call(K,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(K,P){return Object.defineProperties(K,P)},ObjectDefineProperty(K,P,Y){return Object.defineProperty(K,P,Y)},ObjectGetOwnPropertyDescriptor(K,P){return Object.getOwnPropertyDescriptor(K,P)},ObjectKeys(K){return Object.keys(K)},ObjectSetPrototypeOf(K,P){return Object.setPrototypeOf(K,P)},Promise,PromisePrototypeCatch(K,P){return K.catch(P)},PromisePrototypeThen(K,P,Y){return K.then(P,Y)},PromiseReject(K){return Promise.reject(K)},PromiseResolve(K){return Promise.resolve(K)},ReflectApply:Reflect.apply,RegExpPrototypeTest(K,P){return K.test(P)},SafeSet:Set,String,StringPrototypeSlice(K,P,Y){return K.slice(P,Y)},StringPrototypeToLowerCase(K){return K.toLowerCase()},StringPrototypeToUpperCase(K){return K.toUpperCase()},StringPrototypeTrim(K){return K.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(K,P,Y){return K.set(P,Y)},Boolean,Uint8Array}}),n0=S6(($,q)=>{q.exports={format(_,...K){return _.replace(/%([sdifj])/g,function(...[P,Y]){let O=K.shift();if(Y==="f")return O.toFixed(6);else if(Y==="j")return JSON.stringify(O);else if(Y==="s"&&typeof O==="object")return`${O.constructor!==Object?O.constructor.name:""} {}`.trim();else return O.toString()})},inspect(_){switch(typeof _){case"string":if(_.includes("'")){if(!_.includes('"'))return`"${_}"`;else if(!_.includes("`")&&!_.includes("${"))return`\`${_}\``}return`'${_}'`;case"number":if(isNaN(_))return"NaN";else if(Object.is(_,-0))return String(_);return _;case"bigint":return`${String(_)}n`;case"boolean":case"undefined":return String(_);case"object":return"{}"}}}}),cq=S6(($,q)=>{var{format:_,inspect:K}=n0(),{AggregateError:P}=x6(),Y=globalThis.AggregateError||P,O=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],T=/^([A-Z][a-z0-9]*)+$/,H={};function f(I,D){if(!I)throw new H.ERR_INTERNAL_ASSERTION(D)}function w(I){let D="",L=I.length,g=I[0]==="-"?1:0;for(;L>=g+4;L-=3)D=`_${I.slice(L-3,L)}${D}`;return`${I.slice(0,L)}${D}`}function k(I,D,L){if(typeof D==="function")return f(D.length<=L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${D.length}).`),D(...L);let g=(D.match(/%[dfijoOs]/g)||[]).length;if(f(g===L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${g}).`),L.length===0)return D;return _(D,...L)}function S(I,D,L){if(!L)L=Error;class g extends L{constructor(...y){super(k(I,D,y))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(g.prototype,{name:{value:L.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),g.prototype.code=I,g.prototype[O]=!0,H[I]=g}function N(I){let D="__node_internal_"+I.name;return Object.defineProperty(I,"name",{value:D}),I}function h(I,D){if(I&&D&&I!==D){if(Array.isArray(D.errors))return D.errors.push(I),D;let L=new Y([D,I],D.message);return L.code=D.code,L}return I||D}class C extends Error{constructor(I="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!=="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",D);super(I,D);this.code="ABORT_ERR",this.name="AbortError"}}S("ERR_ASSERTION","%s",Error),S("ERR_INVALID_ARG_TYPE",(I,D,L)=>{if(f(typeof I==="string","'name' must be a string"),!Array.isArray(D))D=[D];let g="The ";if(I.endsWith(" argument"))g+=`${I} `;else g+=`"${I}" ${I.includes(".")?"property":"argument"} `;g+="must be ";let y=[],c=[],o=[];for(let F of D)if(f(typeof F==="string","All expected entries have to be of type string"),z.includes(F))y.push(F.toLowerCase());else if(T.test(F))c.push(F);else f(F!=="object",'The value "object" should be written as "Object"'),o.push(F);if(c.length>0){let F=y.indexOf("object");if(F!==-1)y.splice(y,F,1),c.push("Object")}if(y.length>0){switch(y.length){case 1:g+=`of type ${y[0]}`;break;case 2:g+=`one of type ${y[0]} or ${y[1]}`;break;default:{let F=y.pop();g+=`one of type ${y.join(", ")}, or ${F}`}}if(c.length>0||o.length>0)g+=" or "}if(c.length>0){switch(c.length){case 1:g+=`an instance of ${c[0]}`;break;case 2:g+=`an instance of ${c[0]} or ${c[1]}`;break;default:{let F=c.pop();g+=`an instance of ${c.join(", ")}, or ${F}`}}if(o.length>0)g+=" or "}switch(o.length){case 0:break;case 1:if(o[0].toLowerCase()!==o[0])g+="an ";g+=`${o[0]}`;break;case 2:g+=`one of ${o[0]} or ${o[1]}`;break;default:{let F=o.pop();g+=`one of ${o.join(", ")}, or ${F}`}}if(L==null)g+=`. Received ${L}`;else if(typeof L==="function"&&L.name)g+=`. Received function ${L.name}`;else if(typeof L==="object"){var s;if((s=L.constructor)!==null&&s!==void 0&&s.name)g+=`. Received an instance of ${L.constructor.name}`;else{let F=K(L,{depth:-1});g+=`. Received ${F}`}}else{let F=K(L,{colors:!1});if(F.length>25)F=`${F.slice(0,25)}...`;g+=`. Received type ${typeof L} (${F})`}return g},TypeError),S("ERR_INVALID_ARG_VALUE",(I,D,L="is invalid")=>{let g=K(D);if(g.length>128)g=g.slice(0,128)+"...";return`The ${I.includes(".")?"property":"argument"} '${I}' ${L}. Received ${g}`},TypeError),S("ERR_INVALID_RETURN_VALUE",(I,D,L)=>{var g;let y=L!==null&&L!==void 0&&(g=L.constructor)!==null&&g!==void 0&&g.name?`instance of ${L.constructor.name}`:`type ${typeof L}`;return`Expected ${I} to be returned from the "${D}" function but got ${y}.`},TypeError),S("ERR_MISSING_ARGS",(...I)=>{f(I.length>0,"At least one arg needs to be specified");let D,L=I.length;switch(I=(Array.isArray(I)?I:[I]).map((g)=>`"${g}"`).join(" or "),L){case 1:D+=`The ${I[0]} argument`;break;case 2:D+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let g=I.pop();D+=`The ${I.join(", ")}, and ${g} arguments`}break}return`${D} must be specified`},TypeError),S("ERR_OUT_OF_RANGE",(I,D,L)=>{f(D,'Missing "range" argument');let g;if(Number.isInteger(L)&&Math.abs(L)>4294967296)g=w(String(L));else if(typeof L==="bigint"){g=String(L);let y=BigInt(2)**BigInt(32);if(L>y||L<-y)g=w(g);g+="n"}else g=K(L);return`The value of "${I}" is out of range. It must be ${D}. Received ${g}`},RangeError),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),S("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),S("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),S("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),S("ERR_STREAM_WRITE_AFTER_END","write after end",Error),S("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:C,aggregateTwoErrors:N(h),hideStackFrames:N,codes:H}}),Ln=S6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var _=new WeakMap,K=new WeakMap;function P(p){let a=_.get(p);return console.assert(a!=null,"'this' is expected an Event object, but got",p),a}function Y(p){if(p.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",p.passiveListener);return}if(!p.event.cancelable)return;if(p.canceled=!0,typeof p.event.preventDefault==="function")p.event.preventDefault()}function O(p,a){_.set(this,{eventTarget:p,event:a,eventPhase:2,currentTarget:p,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:a.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let j=Object.keys(a);for(let W=0;W<j.length;++W){let X=j[W];if(!(X in this))Object.defineProperty(this,X,z(X))}}if(O.prototype={get type(){return P(this).event.type},get target(){return P(this).eventTarget},get currentTarget(){return P(this).currentTarget},composedPath(){let p=P(this).currentTarget;if(p==null)return[];return[p]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return P(this).eventPhase},stopPropagation(){let p=P(this);if(p.stopped=!0,typeof p.event.stopPropagation==="function")p.event.stopPropagation()},stopImmediatePropagation(){let p=P(this);if(p.stopped=!0,p.immediateStopped=!0,typeof p.event.stopImmediatePropagation==="function")p.event.stopImmediatePropagation()},get bubbles(){return Boolean(P(this).event.bubbles)},get cancelable(){return Boolean(P(this).event.cancelable)},preventDefault(){Y(P(this))},get defaultPrevented(){return P(this).canceled},get composed(){return Boolean(P(this).event.composed)},get timeStamp(){return P(this).timeStamp},get srcElement(){return P(this).eventTarget},get cancelBubble(){return P(this).stopped},set cancelBubble(p){if(!p)return;let a=P(this);if(a.stopped=!0,typeof a.event.cancelBubble==="boolean")a.event.cancelBubble=!0},get returnValue(){return!P(this).canceled},set returnValue(p){if(!p)Y(P(this))},initEvent(){}},Object.defineProperty(O.prototype,"constructor",{value:O,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(O.prototype,window.Event.prototype),K.set(window.Event.prototype,O);function z(p){return{get(){return P(this).event[p]},set(a){P(this).event[p]=a},configurable:!0,enumerable:!0}}function T(p){return{value(){let a=P(this).event;return a[p].apply(a,arguments)},configurable:!0,enumerable:!0}}function H(p,a){let j=Object.keys(a);if(j.length===0)return p;function W(X,J){p.call(this,X,J)}W.prototype=Object.create(p.prototype,{constructor:{value:W,configurable:!0,writable:!0}});for(let X=0;X<j.length;++X){let J=j[X];if(!(J in p.prototype)){let Z=typeof Object.getOwnPropertyDescriptor(a,J).value==="function";Object.defineProperty(W.prototype,J,Z?T(J):z(J))}}return W}function f(p){if(p==null||p===Object.prototype)return O;let a=K.get(p);if(a==null)a=H(f(Object.getPrototypeOf(p)),p),K.set(p,a);return a}function w(p,a){return new(f(Object.getPrototypeOf(a)))(p,a)}function k(p){return P(p).immediateStopped}function S(p,a){P(p).eventPhase=a}function N(p,a){P(p).currentTarget=a}function h(p,a){P(p).passiveListener=a}var C=new WeakMap,I=1,D=2,L=3;function g(p){return p!==null&&typeof p==="object"}function y(p){let a=C.get(p);if(a==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return a}function c(p){return{get(){let a=y(this).get(p);while(a!=null){if(a.listenerType===L)return a.listener;a=a.next}return null},set(a){if(typeof a!=="function"&&!g(a))a=null;let j=y(this),W=null,X=j.get(p);while(X!=null){if(X.listenerType===L)if(W!==null)W.next=X.next;else if(X.next!==null)j.set(p,X.next);else j.delete(p);else W=X;X=X.next}if(a!==null){let J={listener:a,listenerType:L,passive:!1,once:!1,next:null};if(W===null)j.set(p,J);else W.next=J}},configurable:!0,enumerable:!0}}function o(p,a){Object.defineProperty(p,`on${a}`,c(a))}function s(p){function a(){F.call(this)}a.prototype=Object.create(F.prototype,{constructor:{value:a,configurable:!0,writable:!0}});for(let j=0;j<p.length;++j)o(a.prototype,p[j]);return a}function F(){if(this instanceof F){C.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return s(arguments[0]);if(arguments.length>0){let p=Array(arguments.length);for(let a=0;a<arguments.length;++a)p[a]=arguments[a];return s(p)}throw TypeError("Cannot call a class as a function")}if(F.prototype={addEventListener(p,a,j){if(a==null)return;if(typeof a!=="function"&&!g(a))throw TypeError("'listener' should be a function or an object.");let W=y(this),X=g(j),J=(X?Boolean(j.capture):Boolean(j))?I:D,Z={listener:a,listenerType:J,passive:X&&Boolean(j.passive),once:X&&Boolean(j.once),next:null},V=W.get(p);if(V===void 0){W.set(p,Z);return}let M=null;while(V!=null){if(V.listener===a&&V.listenerType===J)return;M=V,V=V.next}M.next=Z},removeEventListener(p,a,j){if(a==null)return;let W=y(this),X=(g(j)?Boolean(j.capture):Boolean(j))?I:D,J=null,Z=W.get(p);while(Z!=null){if(Z.listener===a&&Z.listenerType===X){if(J!==null)J.next=Z.next;else if(Z.next!==null)W.set(p,Z.next);else W.delete(p);return}J=Z,Z=Z.next}},dispatchEvent(p){if(p==null||typeof p.type!=="string")throw TypeError('"event.type" should be a string.');let a=y(this),j=p.type,W=a.get(j);if(W==null)return!0;let X=w(this,p),J=null;while(W!=null){if(W.once)if(J!==null)J.next=W.next;else if(W.next!==null)a.set(j,W.next);else a.delete(j);else J=W;if(h(X,W.passive?W.listener:null),typeof W.listener==="function")try{W.listener.call(this,X)}catch(Z){if(typeof console<"u"&&typeof console.error==="function")console.error(Z)}else if(W.listenerType!==L&&typeof W.listener.handleEvent==="function")W.listener.handleEvent(X);if(k(X))break;W=W.next}return h(X,null),S(X,0),N(X,null),!X.defaultPrevented}},Object.defineProperty(F.prototype,"constructor",{value:F,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(F.prototype,window.EventTarget.prototype);$.defineEventAttribute=o,$.EventTarget=F,$.default=F,q.exports=F,q.exports.EventTarget=q.exports.default=F,q.exports.defineEventAttribute=o}),e7=S6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var _=Ln();class K extends _.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let f=O.get(this);if(typeof f!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return f}}_.defineEventAttribute(K.prototype,"abort");function P(){let f=Object.create(K.prototype);return _.EventTarget.call(f),O.set(f,!1),f}function Y(f){if(O.get(f)!==!1)return;O.set(f,!0),f.dispatchEvent({type:"abort"})}var O=new WeakMap;if(Object.defineProperties(K.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){T.set(this,P())}get signal(){return H(this)}abort(){Y(H(this))}}var T=new WeakMap;function H(f){let w=T.get(f);if(w==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${f===null?"null":typeof f}`);return w}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=K,$.default=z,q.exports=z,q.exports.AbortController=q.exports.default=z,q.exports.AbortSignal=K}),$8=S6(($,q)=>{var _=(wq(),J6(Tq)),{format:K,inspect:P}=n0(),{codes:{ERR_INVALID_ARG_TYPE:Y}}=cq(),{kResistStopPropagation:O,AggregateError:z,SymbolDispose:T}=x6(),H=globalThis.AbortSignal||e7().AbortSignal,f=globalThis.AbortController||e7().AbortController,w=Object.getPrototypeOf(async function(){}).constructor,k=globalThis.Blob||_.Blob,S=typeof k<"u"?function(C){return C instanceof k}:function(C){return!1},N=(C,I)=>{if(C!==void 0&&(C===null||typeof C!=="object"||!("aborted"in C)))throw new Y(I,"AbortSignal",C)},h=(C,I)=>{if(typeof C!=="function")throw new Y(I,"Function",C)};q.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(C){let I=!1;return function(...D){if(I)return;I=!0,C.apply(this,D)}},createDeferredPromise:function(){let C,I;return{promise:new Promise((D,L)=>{C=D,I=L}),resolve:C,reject:I}},promisify(C){return new Promise((I,D)=>{C((L,...g)=>{if(L)return D(L);return I(...g)})})},debuglog(){return function(){}},format:K,inspect:P,types:{isAsyncFunction(C){return C instanceof w},isArrayBufferView(C){return ArrayBuffer.isView(C)}},isBlob:S,deprecate(C,I){return C},addAbortListener:(a7(),J6(Q7)).addAbortListener||function(C,I){if(C===void 0)throw new Y("signal","AbortSignal",C);N(C,"signal"),h(I,"listener");let D;if(C.aborted)queueMicrotask(()=>I());else C.addEventListener("abort",I,{__proto__:null,once:!0,[O]:!0}),D=()=>{C.removeEventListener("abort",I)};return{__proto__:null,[T](){var L;(L=D)===null||L===void 0||L()}}},AbortSignalAny:H.any||function(C){if(C.length===1)return C[0];let I=new f,D=()=>I.abort();return C.forEach((L)=>{N(L,"signals"),L.addEventListener("abort",D,{once:!0})}),I.signal.addEventListener("abort",()=>{C.forEach((L)=>L.removeEventListener("abort",D))},{once:!0}),I.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),s7=S6(($,q)=>{var{ArrayIsArray:_,ArrayPrototypeIncludes:K,ArrayPrototypeJoin:P,ArrayPrototypeMap:Y,NumberIsInteger:O,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:T,NumberMIN_SAFE_INTEGER:H,NumberParseInt:f,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:k,String:S,StringPrototypeToUpperCase:N,StringPrototypeTrim:h}=x6(),{hideStackFrames:C,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:D,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:g,ERR_UNKNOWN_SIGNAL:y}}=cq(),{normalizeEncoding:c}=$8(),{isAsyncFunction:o,isArrayBufferView:s}=$8().types,F={};function p(d){return d===(d|0)}function a(d){return d===d>>>0}var j=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function X(d,n,H$){if(typeof d>"u")d=H$;if(typeof d==="string"){if(k(j,d)===null)throw new L(n,d,W);d=f(d,8)}return V(d,n),d}var J=C((d,n,H$=H,t=T)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);if(d<H$||d>t)throw new g(n,`>= ${H$} && <= ${t}`,d)}),Z=C((d,n,H$=-2147483648,t=2147483647)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);if(d<H$||d>t)throw new g(n,`>= ${H$} && <= ${t}`,d)}),V=C((d,n,H$=!1)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);let t=H$?1:0,U=4294967295;if(d<t||d>U)throw new g(n,`>= ${t} && <= ${U}`,d)});function M(d,n){if(typeof d!=="string")throw new D(n,"string",d)}function A(d,n,H$=void 0,t){if(typeof d!=="number")throw new D(n,"number",d);if(H$!=null&&d<H$||t!=null&&d>t||(H$!=null||t!=null)&&z(d))throw new g(n,`${H$!=null?`>= ${H$}`:""}${H$!=null&&t!=null?" && ":""}${t!=null?`<= ${t}`:""}`,d)}var v=C((d,n,H$)=>{if(!K(H$,d)){let t="must be one of: "+P(Y(H$,(U)=>typeof U==="string"?`'${U}'`:S(U)),", ");throw new L(n,d,t)}});function G(d,n){if(typeof d!=="boolean")throw new D(n,"boolean",d)}function R(d,n,H$){return d==null||!w(d,n)?H$:d[n]}var E=C((d,n,H$=null)=>{let t=R(H$,"allowArray",!1),U=R(H$,"allowFunction",!1);if(!R(H$,"nullable",!1)&&d===null||!t&&_(d)||typeof d!=="object"&&(!U||typeof d!=="function"))throw new D(n,"Object",d)}),b=C((d,n)=>{if(d!=null&&typeof d!=="object"&&typeof d!=="function")throw new D(n,"a dictionary",d)}),x=C((d,n,H$=0)=>{if(!_(d))throw new D(n,"Array",d);if(d.length<H$){let t=`must be longer than ${H$}`;throw new L(n,d,t)}});function l(d,n){x(d,n);for(let H$=0;H$<d.length;H$++)M(d[H$],`${n}[${H$}]`)}function Q(d,n){x(d,n);for(let H$=0;H$<d.length;H$++)G(d[H$],`${n}[${H$}]`)}function f$(d,n){x(d,n);for(let H$=0;H$<d.length;H$++){let t=d[H$],U=`${n}[${H$}]`;if(t==null)throw new D(U,"AbortSignal",t);P$(t,U)}}function q$(d,n="signal"){if(M(d,n),F[d]===void 0){if(F[N(d)]!==void 0)throw new y(d+" (signals must use all capital letters)");throw new y(d)}}var B=C((d,n="buffer")=>{if(!s(d))throw new D(n,["Buffer","TypedArray","DataView"],d)});function v$(d,n){let H$=c(n),t=d.length;if(H$==="hex"&&t%2!==0)throw new L("encoding",n,`is invalid for data of length ${t}`)}function e(d,n="Port",H$=!0){if(typeof d!=="number"&&typeof d!=="string"||typeof d==="string"&&h(d).length===0||+d!==+d>>>0||d>65535||d===0&&!H$)throw new I(n,d,H$);return d|0}var P$=C((d,n)=>{if(d!==void 0&&(d===null||typeof d!=="object"||!("aborted"in d)))throw new D(n,"AbortSignal",d)}),o$=C((d,n)=>{if(typeof d!=="function")throw new D(n,"Function",d)}),m=C((d,n)=>{if(typeof d!=="function"||o(d))throw new D(n,"Function",d)}),r=C((d,n)=>{if(d!==void 0)throw new D(n,"undefined",d)});function J$(d,n,H$){if(!K(H$,d))throw new D(n,`('${P(H$,"|")}')`,d)}var $$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function _$(d,n){if(typeof d>"u"||!k($$,d))throw new L(n,d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function O$(d){if(typeof d==="string")return _$(d,"hints"),d;else if(_(d)){let n=d.length,H$="";if(n===0)return H$;for(let t=0;t<n;t++){let U=d[t];if(_$(U,"hints"),H$+=U,t!==n-1)H$+=", "}return H$}throw new L("hints",d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}q.exports={isInt32:p,isUint32:a,parseFileMode:X,validateArray:x,validateStringArray:l,validateBooleanArray:Q,validateAbortSignalArray:f$,validateBoolean:G,validateBuffer:B,validateDictionary:b,validateEncoding:v$,validateFunction:o$,validateInt32:Z,validateInteger:J,validateNumber:A,validateObject:E,validateOneOf:v,validatePlainFunction:m,validatePort:e,validateSignalName:q$,validateString:M,validateUint32:V,validateUndefined:r,validateUnion:J$,validateAbortSignal:P$,validateLinkHeaderValue:O$}}),cK=S6(($,q)=>{q.exports=globalThis.process}),M_=S6(($,q)=>{var{SymbolAsyncIterator:_,SymbolIterator:K,SymbolFor:P}=x6(),Y=P("nodejs.stream.destroyed"),O=P("nodejs.stream.errored"),z=P("nodejs.stream.readable"),T=P("nodejs.stream.writable"),H=P("nodejs.stream.disturbed"),f=P("nodejs.webstream.isClosedPromise"),w=P("nodejs.webstream.controllerErrorFunction");function k(R,E=!1){var b;return!!(R&&typeof R.pipe==="function"&&typeof R.on==="function"&&(!E||typeof R.pause==="function"&&typeof R.resume==="function")&&(!R._writableState||((b=R._readableState)===null||b===void 0?void 0:b.readable)!==!1)&&(!R._writableState||R._readableState))}function S(R){var E;return!!(R&&typeof R.write==="function"&&typeof R.on==="function"&&(!R._readableState||((E=R._writableState)===null||E===void 0?void 0:E.writable)!==!1))}function N(R){return!!(R&&typeof R.pipe==="function"&&R._readableState&&typeof R.on==="function"&&typeof R.write==="function")}function h(R){return R&&(R._readableState||R._writableState||typeof R.write==="function"&&typeof R.on==="function"||typeof R.pipe==="function"&&typeof R.on==="function")}function C(R){return!!(R&&!h(R)&&typeof R.pipeThrough==="function"&&typeof R.getReader==="function"&&typeof R.cancel==="function")}function I(R){return!!(R&&!h(R)&&typeof R.getWriter==="function"&&typeof R.abort==="function")}function D(R){return!!(R&&!h(R)&&typeof R.readable==="object"&&typeof R.writable==="object")}function L(R){return C(R)||I(R)||D(R)}function g(R,E){if(R==null)return!1;if(E===!0)return typeof R[_]==="function";if(E===!1)return typeof R[K]==="function";return typeof R[_]==="function"||typeof R[K]==="function"}function y(R){if(!h(R))return null;let{_writableState:E,_readableState:b}=R,x=E||b;return!!(R.destroyed||R[Y]||x!==null&&x!==void 0&&x.destroyed)}function c(R){if(!S(R))return null;if(R.writableEnded===!0)return!0;let E=R._writableState;if(E!==null&&E!==void 0&&E.errored)return!1;if(typeof(E===null||E===void 0?void 0:E.ended)!=="boolean")return null;return E.ended}function o(R,E){if(!S(R))return null;if(R.writableFinished===!0)return!0;let b=R._writableState;if(b!==null&&b!==void 0&&b.errored)return!1;if(typeof(b===null||b===void 0?void 0:b.finished)!=="boolean")return null;return!!(b.finished||E===!1&&b.ended===!0&&b.length===0)}function s(R){if(!k(R))return null;if(R.readableEnded===!0)return!0;let E=R._readableState;if(!E||E.errored)return!1;if(typeof(E===null||E===void 0?void 0:E.ended)!=="boolean")return null;return E.ended}function F(R,E){if(!k(R))return null;let b=R._readableState;if(b!==null&&b!==void 0&&b.errored)return!1;if(typeof(b===null||b===void 0?void 0:b.endEmitted)!=="boolean")return null;return!!(b.endEmitted||E===!1&&b.ended===!0&&b.length===0)}function p(R){if(R&&R[z]!=null)return R[z];if(typeof(R===null||R===void 0?void 0:R.readable)!=="boolean")return null;if(y(R))return!1;return k(R)&&R.readable&&!F(R)}function a(R){if(R&&R[T]!=null)return R[T];if(typeof(R===null||R===void 0?void 0:R.writable)!=="boolean")return null;if(y(R))return!1;return S(R)&&R.writable&&!c(R)}function j(R,E){if(!h(R))return null;if(y(R))return!0;if((E===null||E===void 0?void 0:E.readable)!==!1&&p(R))return!1;if((E===null||E===void 0?void 0:E.writable)!==!1&&a(R))return!1;return!0}function W(R){var E,b;if(!h(R))return null;if(R.writableErrored)return R.writableErrored;return(E=(b=R._writableState)===null||b===void 0?void 0:b.errored)!==null&&E!==void 0?E:null}function X(R){var E,b;if(!h(R))return null;if(R.readableErrored)return R.readableErrored;return(E=(b=R._readableState)===null||b===void 0?void 0:b.errored)!==null&&E!==void 0?E:null}function J(R){if(!h(R))return null;if(typeof R.closed==="boolean")return R.closed;let{_writableState:E,_readableState:b}=R;if(typeof(E===null||E===void 0?void 0:E.closed)==="boolean"||typeof(b===null||b===void 0?void 0:b.closed)==="boolean")return(E===null||E===void 0?void 0:E.closed)||(b===null||b===void 0?void 0:b.closed);if(typeof R._closed==="boolean"&&Z(R))return R._closed;return null}function Z(R){return typeof R._closed==="boolean"&&typeof R._defaultKeepAlive==="boolean"&&typeof R._removedConnection==="boolean"&&typeof R._removedContLen==="boolean"}function V(R){return typeof R._sent100==="boolean"&&Z(R)}function M(R){var E;return typeof R._consuming==="boolean"&&typeof R._dumped==="boolean"&&((E=R.req)===null||E===void 0?void 0:E.upgradeOrConnect)===void 0}function A(R){if(!h(R))return null;let{_writableState:E,_readableState:b}=R,x=E||b;return!x&&V(R)||!!(x&&x.autoDestroy&&x.emitClose&&x.closed===!1)}function v(R){var E;return!!(R&&((E=R[H])!==null&&E!==void 0?E:R.readableDidRead||R.readableAborted))}function G(R){var E,b,x,l,Q,f$,q$,B,v$,e;return!!(R&&((E=(b=(x=(l=(Q=(f$=R[O])!==null&&f$!==void 0?f$:R.readableErrored)!==null&&Q!==void 0?Q:R.writableErrored)!==null&&l!==void 0?l:(q$=R._readableState)===null||q$===void 0?void 0:q$.errorEmitted)!==null&&x!==void 0?x:(B=R._writableState)===null||B===void 0?void 0:B.errorEmitted)!==null&&b!==void 0?b:(v$=R._readableState)===null||v$===void 0?void 0:v$.errored)!==null&&E!==void 0?E:(e=R._writableState)===null||e===void 0?void 0:e.errored))}q.exports={isDestroyed:y,kIsDestroyed:Y,isDisturbed:v,kIsDisturbed:H,isErrored:G,kIsErrored:O,isReadable:p,kIsReadable:z,kIsClosedPromise:f,kControllerErrorFunction:w,kIsWritable:T,isClosed:J,isDuplexNodeStream:N,isFinished:j,isIterable:g,isReadableNodeStream:k,isReadableStream:C,isReadableEnded:s,isReadableFinished:F,isReadableErrored:X,isNodeStream:h,isWebStream:L,isWritable:a,isWritableNodeStream:S,isWritableStream:I,isWritableEnded:c,isWritableFinished:o,isWritableErrored:W,isServerRequest:M,isServerResponse:V,willEmitClose:A,isTransformStream:D}}),KK=S6(($,q)=>{var _=cK(),{AbortError:K,codes:P}=cq(),{ERR_INVALID_ARG_TYPE:Y,ERR_STREAM_PREMATURE_CLOSE:O}=P,{kEmptyObject:z,once:T}=$8(),{validateAbortSignal:H,validateFunction:f,validateObject:w,validateBoolean:k}=s7(),{Promise:S,PromisePrototypeThen:N,SymbolDispose:h}=x6(),{isClosed:C,isReadable:I,isReadableNodeStream:D,isReadableStream:L,isReadableFinished:g,isReadableErrored:y,isWritable:c,isWritableNodeStream:o,isWritableStream:s,isWritableFinished:F,isWritableErrored:p,isNodeStream:a,willEmitClose:j,kIsClosedPromise:W}=M_(),X;function J(v){return v.setHeader&&typeof v.abort==="function"}var Z=()=>{};function V(v,G,R){var E,b;if(arguments.length===2)R=G,G=z;else if(G==null)G=z;else w(G,"options");if(f(R,"callback"),H(G.signal,"options.signal"),R=T(R),L(v)||s(v))return M(v,G,R);if(!a(v))throw new Y("stream",["ReadableStream","WritableStream","Stream"],v);let x=(E=G.readable)!==null&&E!==void 0?E:D(v),l=(b=G.writable)!==null&&b!==void 0?b:o(v),Q=v._writableState,f$=v._readableState,q$=()=>{if(!v.writable)e()},B=j(v)&&D(v)===x&&o(v)===l,v$=F(v,!1),e=()=>{if(v$=!0,v.destroyed)B=!1;if(B&&(!v.readable||x))return;if(!x||P$)R.call(v)},P$=g(v,!1),o$=()=>{if(P$=!0,v.destroyed)B=!1;if(B&&(!v.writable||l))return;if(!l||v$)R.call(v)},m=(d)=>{R.call(v,d)},r=C(v),J$=()=>{r=!0;let d=p(v)||y(v);if(d&&typeof d!=="boolean")return R.call(v,d);if(x&&!P$&&D(v,!0)){if(!g(v,!1))return R.call(v,new O)}if(l&&!v$){if(!F(v,!1))return R.call(v,new O)}R.call(v)},$$=()=>{r=!0;let d=p(v)||y(v);if(d&&typeof d!=="boolean")return R.call(v,d);R.call(v)},_$=()=>{v.req.on("finish",e)};if(J(v)){if(v.on("complete",e),!B)v.on("abort",J$);if(v.req)_$();else v.on("request",_$)}else if(l&&!Q)v.on("end",q$),v.on("close",q$);if(!B&&typeof v.aborted==="boolean")v.on("aborted",J$);if(v.on("end",o$),v.on("finish",e),G.error!==!1)v.on("error",m);if(v.on("close",J$),r)_.nextTick(J$);else if(Q!==null&&Q!==void 0&&Q.errorEmitted||f$!==null&&f$!==void 0&&f$.errorEmitted){if(!B)_.nextTick($$)}else if(!x&&(!B||I(v))&&(v$||c(v)===!1))_.nextTick($$);else if(!l&&(!B||c(v))&&(P$||I(v)===!1))_.nextTick($$);else if(f$&&v.req&&v.aborted)_.nextTick($$);let O$=()=>{if(R=Z,v.removeListener("aborted",J$),v.removeListener("complete",e),v.removeListener("abort",J$),v.removeListener("request",_$),v.req)v.req.removeListener("finish",e);v.removeListener("end",q$),v.removeListener("close",q$),v.removeListener("finish",e),v.removeListener("end",o$),v.removeListener("error",m),v.removeListener("close",J$)};if(G.signal&&!r){let d=()=>{let n=R;O$(),n.call(v,new K(void 0,{cause:G.signal.reason}))};if(G.signal.aborted)_.nextTick(d);else{X=X||$8().addAbortListener;let n=X(G.signal,d),H$=R;R=T((...t)=>{n[h](),H$.apply(v,t)})}}return O$}function M(v,G,R){let E=!1,b=Z;if(G.signal)if(b=()=>{E=!0,R.call(v,new K(void 0,{cause:G.signal.reason}))},G.signal.aborted)_.nextTick(b);else{X=X||$8().addAbortListener;let l=X(G.signal,b),Q=R;R=T((...f$)=>{l[h](),Q.apply(v,f$)})}let x=(...l)=>{if(!E)_.nextTick(()=>R.apply(v,l))};return N(v[W].promise,x,x),Z}function A(v,G){var R;let E=!1;if(G===null)G=z;if((R=G)!==null&&R!==void 0&&R.cleanup)k(G.cleanup,"cleanup"),E=G.cleanup;return new S((b,x)=>{let l=V(v,G,(Q)=>{if(E)l();if(Q)x(Q);else b()})})}q.exports=V,q.exports.finished=A}),n4=S6(($,q)=>{var _=cK(),{aggregateTwoErrors:K,codes:{ERR_MULTIPLE_CALLBACK:P},AbortError:Y}=cq(),{Symbol:O}=x6(),{kIsDestroyed:z,isDestroyed:T,isFinished:H,isServerRequest:f}=M_(),w=O("kDestroy"),k=O("kConstruct");function S(j,W,X){if(j){if(j.stack,W&&!W.errored)W.errored=j;if(X&&!X.errored)X.errored=j}}function N(j,W){let X=this._readableState,J=this._writableState,Z=J||X;if(J!==null&&J!==void 0&&J.destroyed||X!==null&&X!==void 0&&X.destroyed){if(typeof W==="function")W();return this}if(S(j,J,X),J)J.destroyed=!0;if(X)X.destroyed=!0;if(!Z.constructed)this.once(w,function(V){h(this,K(V,j),W)});else h(this,j,W);return this}function h(j,W,X){let J=!1;function Z(V){if(J)return;J=!0;let{_readableState:M,_writableState:A}=j;if(S(V,A,M),A)A.closed=!0;if(M)M.closed=!0;if(typeof X==="function")X(V);if(V)_.nextTick(C,j,V);else _.nextTick(I,j)}try{j._destroy(W||null,Z)}catch(V){Z(V)}}function C(j,W){D(j,W),I(j)}function I(j){let{_readableState:W,_writableState:X}=j;if(X)X.closeEmitted=!0;if(W)W.closeEmitted=!0;if(X!==null&&X!==void 0&&X.emitClose||W!==null&&W!==void 0&&W.emitClose)j.emit("close")}function D(j,W){let{_readableState:X,_writableState:J}=j;if(J!==null&&J!==void 0&&J.errorEmitted||X!==null&&X!==void 0&&X.errorEmitted)return;if(J)J.errorEmitted=!0;if(X)X.errorEmitted=!0;j.emit("error",W)}function L(){let j=this._readableState,W=this._writableState;if(j)j.constructed=!0,j.closed=!1,j.closeEmitted=!1,j.destroyed=!1,j.errored=null,j.errorEmitted=!1,j.reading=!1,j.ended=j.readable===!1,j.endEmitted=j.readable===!1;if(W)W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1}function g(j,W,X){let{_readableState:J,_writableState:Z}=j;if(Z!==null&&Z!==void 0&&Z.destroyed||J!==null&&J!==void 0&&J.destroyed)return this;if(J!==null&&J!==void 0&&J.autoDestroy||Z!==null&&Z!==void 0&&Z.autoDestroy)j.destroy(W);else if(W){if(W.stack,Z&&!Z.errored)Z.errored=W;if(J&&!J.errored)J.errored=W;if(X)_.nextTick(D,j,W);else D(j,W)}}function y(j,W){if(typeof j._construct!=="function")return;let{_readableState:X,_writableState:J}=j;if(X)X.constructed=!1;if(J)J.constructed=!1;if(j.once(k,W),j.listenerCount(k)>1)return;_.nextTick(c,j)}function c(j){let W=!1;function X(J){if(W){g(j,J!==null&&J!==void 0?J:new P);return}W=!0;let{_readableState:Z,_writableState:V}=j,M=V||Z;if(Z)Z.constructed=!0;if(V)V.constructed=!0;if(M.destroyed)j.emit(w,J);else if(J)g(j,J,!0);else _.nextTick(o,j)}try{j._construct((J)=>{_.nextTick(X,J)})}catch(J){_.nextTick(X,J)}}function o(j){j.emit(k)}function s(j){return(j===null||j===void 0?void 0:j.setHeader)&&typeof j.abort==="function"}function F(j){j.emit("close")}function p(j,W){j.emit("error",W),_.nextTick(F,j)}function a(j,W){if(!j||T(j))return;if(!W&&!H(j))W=new Y;if(f(j))j.socket=null,j.destroy(W);else if(s(j))j.abort();else if(s(j.req))j.req.abort();else if(typeof j.destroy==="function")j.destroy(W);else if(typeof j.close==="function")j.close();else if(W)_.nextTick(p,j,W);else _.nextTick(F,j);if(!j.destroyed)j[z]=!0}q.exports={construct:y,destroyer:a,destroy:N,undestroy:L,errorOrDestroy:g}}),wH=S6(($,q)=>{var{ArrayIsArray:_,ObjectSetPrototypeOf:K}=x6(),{EventEmitter:P}=(a7(),J6(Q7));function Y(z){P.call(this,z)}K(Y.prototype,P.prototype),K(Y,P),Y.prototype.pipe=function(z,T){let H=this;function f(I){if(z.writable&&z.write(I)===!1&&H.pause)H.pause()}H.on("data",f);function w(){if(H.readable&&H.resume)H.resume()}if(z.on("drain",w),!z._isStdio&&(!T||T.end!==!1))H.on("end",S),H.on("close",N);let k=!1;function S(){if(k)return;k=!0,z.end()}function N(){if(k)return;if(k=!0,typeof z.destroy==="function")z.destroy()}function h(I){if(C(),P.listenerCount(this,"error")===0)this.emit("error",I)}O(H,"error",h),O(z,"error",h);function C(){H.removeListener("data",f),z.removeListener("drain",w),H.removeListener("end",S),H.removeListener("close",N),H.removeListener("error",h),z.removeListener("error",h),H.removeListener("end",C),H.removeListener("close",C),z.removeListener("close",C)}return H.on("end",C),H.on("close",C),z.on("close",C),z.emit("pipe",H),z};function O(z,T,H){if(typeof z.prependListener==="function")return z.prependListener(T,H);if(!z._events||!z._events[T])z.on(T,H);else if(_(z._events[T]))z._events[T].unshift(H);else z._events[T]=[H,z._events[T]]}q.exports={Stream:Y,prependListener:O}}),X2=S6(($,q)=>{var{SymbolDispose:_}=x6(),{AbortError:K,codes:P}=cq(),{isNodeStream:Y,isWebStream:O,kControllerErrorFunction:z}=M_(),T=KK(),{ERR_INVALID_ARG_TYPE:H}=P,f,w=(k,S)=>{if(typeof k!=="object"||!("aborted"in k))throw new H(S,"AbortSignal",k)};q.exports.addAbortSignal=function(k,S){if(w(k,"signal"),!Y(S)&&!O(S))throw new H("stream",["ReadableStream","WritableStream","Stream"],S);return q.exports.addAbortSignalNoValidate(k,S)},q.exports.addAbortSignalNoValidate=function(k,S){if(typeof k!=="object"||!("aborted"in k))return S;let N=Y(S)?()=>{S.destroy(new K(void 0,{cause:k.reason}))}:()=>{S[z](new K(void 0,{cause:k.reason}))};if(k.aborted)N();else{f=f||$8().addAbortListener;let h=f(k,N);T(S,h[_])}return S}}),bn=S6(($,q)=>{var{StringPrototypeSlice:_,SymbolIterator:K,TypedArrayPrototypeSet:P,Uint8Array:Y}=x6(),{Buffer:O}=(wq(),J6(Tq)),{inspect:z}=$8();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(T){let H={data:T,next:null};if(this.length>0)this.tail.next=H;else this.head=H;this.tail=H,++this.length}unshift(T){let H={data:T,next:this.head};if(this.length===0)this.tail=H;this.head=H,++this.length}shift(){if(this.length===0)return;let T=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,T}clear(){this.head=this.tail=null,this.length=0}join(T){if(this.length===0)return"";let H=this.head,f=""+H.data;while((H=H.next)!==null)f+=T+H.data;return f}concat(T){if(this.length===0)return O.alloc(0);let H=O.allocUnsafe(T>>>0),f=this.head,w=0;while(f)P(H,f.data,w),w+=f.data.length,f=f.next;return H}consume(T,H){let f=this.head.data;if(T<f.length){let w=f.slice(0,T);return this.head.data=f.slice(T),w}if(T===f.length)return this.shift();return H?this._getString(T):this._getBuffer(T)}first(){return this.head.data}*[K](){for(let T=this.head;T;T=T.next)yield T.data}_getString(T){let H="",f=this.head,w=0;do{let k=f.data;if(T>k.length)H+=k,T-=k.length;else{if(T===k.length)if(H+=k,++w,f.next)this.head=f.next;else this.head=this.tail=null;else H+=_(k,0,T),this.head=f,f.data=_(k,T);break}++w}while((f=f.next)!==null);return this.length-=w,H}_getBuffer(T){let H=O.allocUnsafe(T),f=T,w=this.head,k=0;do{let S=w.data;if(T>S.length)P(H,S,f-T),T-=S.length;else{if(T===S.length)if(P(H,S,f-T),++k,w.next)this.head=w.next;else this.head=this.tail=null;else P(H,new Y(S.buffer,S.byteOffset,T),f-T),this.head=w,w.data=S.slice(T);break}++k}while((w=w.next)!==null);return this.length-=k,H}[Symbol.for("nodejs.util.inspect.custom")](T,H){return z(this,{...H,depth:0,customInspect:!1})}}}),A2=S6(($,q)=>{var{MathFloor:_,NumberIsInteger:K}=x6(),{validateInteger:P}=s7(),{ERR_INVALID_ARG_VALUE:Y}=cq().codes,O=16384,z=16;function T(k,S,N){return k.highWaterMark!=null?k.highWaterMark:S?k[N]:null}function H(k){return k?z:O}function f(k,S){if(P(S,"value",0),k)z=S;else O=S}function w(k,S,N,h){let C=T(S,h,N);if(C!=null){if(!K(C)||C<0){let I=h?`options.${N}`:"options.highWaterMark";throw new Y(I,C)}return _(C)}return H(k.objectMode)}q.exports={getHighWaterMark:w,getDefaultHighWaterMark:H,setDefaultHighWaterMark:f}}),gn=S6(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _=(wq(),J6(Tq)),K=_.Buffer;function P(O,z){for(var T in O)z[T]=O[T]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=_;else P(_,$),$.Buffer=Y;function Y(O,z,T){return K(O,z,T)}Y.prototype=Object.create(K.prototype),P(K,Y),Y.from=function(O,z,T){if(typeof O==="number")throw TypeError("Argument must not be a number");return K(O,z,T)},Y.alloc=function(O,z,T){if(typeof O!=="number")throw TypeError("Argument must be a number");var H=K(O);if(z!==void 0)if(typeof T==="string")H.fill(z,T);else H.fill(z);else H.fill(0);return H},Y.allocUnsafe=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return K(O)},Y.allocUnsafeSlow=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return _.SlowBuffer(O)}}),yn=S6(($)=>{var q=gn().Buffer,_=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 K(D){if(!D)return"utf8";var L;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(L)return;D=(""+D).toLowerCase(),L=!0}}function P(D){var L=K(D);if(typeof L!=="string"&&(q.isEncoding===_||!_(D)))throw Error("Unknown encoding: "+D);return L||D}$.StringDecoder=Y;function Y(D){this.encoding=P(D);var L;switch(this.encoding){case"utf16le":this.text=k,this.end=S,L=4;break;case"utf8":this.fillLast=H,L=4;break;case"base64":this.text=N,this.end=h,L=3;break;default:this.write=C,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(L)}Y.prototype.write=function(D){if(D.length===0)return"";var L,g;if(this.lastNeed){if(L=this.fillLast(D),L===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;if(g<D.length)return L?L+this.text(D,g):this.text(D,g);return L||""},Y.prototype.end=w,Y.prototype.text=f,Y.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 O(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,L,g){var y=L.length-1;if(y<g)return 0;var c=O(L[y]);if(c>=0){if(c>0)D.lastNeed=c-1;return c}if(--y<g||c===-2)return 0;if(c=O(L[y]),c>=0){if(c>0)D.lastNeed=c-2;return c}if(--y<g||c===-2)return 0;if(c=O(L[y]),c>=0){if(c>0)if(c===2)c=0;else D.lastNeed=c-3;return c}return 0}function T(D,L,g){if((L[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&L.length>1){if((L[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&L.length>2){if((L[2]&192)!==128)return D.lastNeed=2,"�"}}}function H(D){var L=this.lastTotal-this.lastNeed,g=T(this,D,L);if(g!==void 0)return g;if(this.lastNeed<=D.length)return D.copy(this.lastChar,L,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,L,0,D.length),this.lastNeed-=D.length}function f(D,L){var g=z(this,D,L);if(!this.lastNeed)return D.toString("utf8",L);this.lastTotal=g;var y=D.length-(g-this.lastNeed);return D.copy(this.lastChar,0,y),D.toString("utf8",L,y)}function w(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed)return L+"�";return L}function k(D,L){if((D.length-L)%2===0){var g=D.toString("utf16le",L);if(g){var y=g.charCodeAt(g.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],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",L,D.length-1)}function S(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return L+this.lastChar.toString("utf16le",0,g)}return L}function N(D,L){var g=(D.length-L)%3;if(g===0)return D.toString("base64",L);if(this.lastNeed=3-g,this.lastTotal=3,g===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",L,D.length-g)}function h(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed)return L+this.lastChar.toString("base64",0,3-this.lastNeed);return L}function C(D){return D.toString(this.encoding)}function I(D){return D&&D.length?this.write(D):""}}),i0=S6(($,q)=>{var _=cK(),{PromisePrototypeThen:K,SymbolAsyncIterator:P,SymbolIterator:Y}=x6(),{Buffer:O}=(wq(),J6(Tq)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:T}=cq().codes;function H(f,w,k){let S;if(typeof w==="string"||w instanceof O)return new f({objectMode:!0,...k,read(){this.push(w),this.push(null)}});let N;if(w&&w[P])N=!0,S=w[P]();else if(w&&w[Y])N=!1,S=w[Y]();else throw new z("iterable",["Iterable"],w);let h=new f({objectMode:!0,highWaterMark:1,...k}),C=!1;h._read=function(){if(!C)C=!0,D()},h._destroy=function(L,g){K(I(L),()=>_.nextTick(g,L),(y)=>_.nextTick(g,y||L))};async function I(L){let g=L!==void 0&&L!==null,y=typeof S.throw==="function";if(g&&y){let{value:c,done:o}=await S.throw(L);if(await c,o)return}if(typeof S.return==="function"){let{value:c}=await S.return();await c}}async function D(){for(;;){try{let{value:L,done:g}=N?await S.next():S.next();if(g)h.push(null);else{let y=L&&typeof L.then==="function"?await L:L;if(y===null)throw C=!1,new T;else if(h.push(y))continue;else C=!1}}catch(L){h.destroy(L)}break}}return h}q.exports=H}),k2=S6(($,q)=>{var _=cK(),{ArrayPrototypeIndexOf:K,NumberIsInteger:P,NumberIsNaN:Y,NumberParseInt:O,ObjectDefineProperties:z,ObjectKeys:T,ObjectSetPrototypeOf:H,Promise:f,SafeSet:w,SymbolAsyncDispose:k,SymbolAsyncIterator:S,Symbol:N}=x6();q.exports=t,t.ReadableState=H$;var{EventEmitter:h}=(a7(),J6(Q7)),{Stream:C,prependListener:I}=wH(),{Buffer:D}=(wq(),J6(Tq)),{addAbortSignal:L}=X2(),g=KK(),y=$8().debuglog("stream",(u)=>{y=u}),c=bn(),o=n4(),{getHighWaterMark:s,getDefaultHighWaterMark:F}=A2(),{aggregateTwoErrors:p,codes:{ERR_INVALID_ARG_TYPE:a,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:J},AbortError:Z}=cq(),{validateObject:V}=s7(),M=N("kPaused"),{StringDecoder:A}=yn(),v=i0();H(t.prototype,C.prototype),H(t,C);var G=()=>{},{errorOrDestroy:R}=o,E=1,b=2,x=4,l=8,Q=16,f$=32,q$=64,B=128,v$=256,e=512,P$=1024,o$=2048,m=4096,r=8192,J$=16384,$$=32768,_$=65536,O$=131072,d=262144;function n(u){return{enumerable:!1,get(){return(this.state&u)!==0},set(i){if(i)this.state|=u;else this.state&=~u}}}z(H$.prototype,{objectMode:n(E),ended:n(b),endEmitted:n(x),reading:n(l),constructed:n(Q),sync:n(f$),needReadable:n(q$),emittedReadable:n(B),readableListening:n(v$),resumeScheduled:n(e),errorEmitted:n(P$),emitClose:n(o$),autoDestroy:n(m),destroyed:n(r),closed:n(J$),closeEmitted:n($$),multiAwaitDrain:n(_$),readingMore:n(O$),dataEmitted:n(d)});function H$(u,i,K$){if(typeof K$!=="boolean")K$=i instanceof S_();if(this.state=o$|m|Q|f$,u&&u.objectMode)this.state|=E;if(K$&&u&&u.readableObjectMode)this.state|=E;if(this.highWaterMark=u?s(this,u,"readableHighWaterMark",K$):F(!1),this.buffer=new c,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,u&&u.emitClose===!1)this.state&=~o$;if(u&&u.autoDestroy===!1)this.state&=~m;if(this.errored=null,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,u&&u.encoding)this.decoder=new A(u.encoding),this.encoding=u.encoding}function t(u){if(!(this instanceof t))return new t(u);let i=this instanceof S_();if(this._readableState=new H$(u,this,i),u){if(typeof u.read==="function")this._read=u.read;if(typeof u.destroy==="function")this._destroy=u.destroy;if(typeof u.construct==="function")this._construct=u.construct;if(u.signal&&!i)L(u.signal,this)}C.call(this,u),o.construct(this,()=>{if(this._readableState.needReadable)M$(this,this._readableState)})}t.prototype.destroy=o.destroy,t.prototype._undestroy=o.undestroy,t.prototype._destroy=function(u,i){i(u)},t.prototype[h.captureRejectionSymbol]=function(u){this.destroy(u)},t.prototype[k]=function(){let u;if(!this.destroyed)u=this.readableEnded?null:new Z,this.destroy(u);return new f((i,K$)=>g(this,(Y$)=>Y$&&Y$!==u?K$(Y$):i(null)))},t.prototype.push=function(u,i){return U(this,u,i,!1)},t.prototype.unshift=function(u,i){return U(this,u,i,!0)};function U(u,i,K$,Y$){y("readableAddChunk",i);let B$=u._readableState,G$;if((B$.state&E)===0){if(typeof i==="string"){if(K$=K$||B$.defaultEncoding,B$.encoding!==K$)if(Y$&&B$.encoding)i=D.from(i,K$).toString(B$.encoding);else i=D.from(i,K$),K$=""}else if(i instanceof D)K$="";else if(C._isUint8Array(i))i=C._uint8ArrayToBuffer(i),K$="";else if(i!=null)G$=new a("chunk",["string","Buffer","Uint8Array"],i)}if(G$)R(u,G$);else if(i===null)B$.state&=~l,X$(u,B$);else if((B$.state&E)!==0||i&&i.length>0)if(Y$)if((B$.state&x)!==0)R(u,new J);else if(B$.destroyed||B$.errored)return!1;else A$(u,B$,i,!0);else if(B$.ended)R(u,new X);else if(B$.destroyed||B$.errored)return!1;else if(B$.state&=~l,B$.decoder&&!K$)if(i=B$.decoder.write(i),B$.objectMode||i.length!==0)A$(u,B$,i,!1);else M$(u,B$);else A$(u,B$,i,!1);else if(!Y$)B$.state&=~l,M$(u,B$);return!B$.ended&&(B$.length<B$.highWaterMark||B$.length===0)}function A$(u,i,K$,Y$){if(i.flowing&&i.length===0&&!i.sync&&u.listenerCount("data")>0){if((i.state&_$)!==0)i.awaitDrainWriters.clear();else i.awaitDrainWriters=null;i.dataEmitted=!0,u.emit("data",K$)}else{if(i.length+=i.objectMode?1:K$.length,Y$)i.buffer.unshift(K$);else i.buffer.push(K$);if((i.state&q$)!==0)k$(u)}M$(u,i)}t.prototype.isPaused=function(){let u=this._readableState;return u[M]===!0||u.flowing===!1},t.prototype.setEncoding=function(u){let i=new A(u);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;let K$=this._readableState.buffer,Y$="";for(let B$ of K$)Y$+=i.write(B$);if(K$.clear(),Y$!=="")K$.push(Y$);return this._readableState.length=Y$.length,this};var W$=1073741824;function z$(u){if(u>W$)throw new W("size","<= 1GiB",u);else u--,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u++;return u}function Z6(u,i){if(u<=0||i.length===0&&i.ended)return 0;if((i.state&E)!==0)return 1;if(Y(u)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(u<=i.length)return u;return i.ended?i.length:0}t.prototype.read=function(u){if(y("read",u),u===void 0)u=NaN;else if(!P(u))u=O(u,10);let i=this._readableState,K$=u;if(u>i.highWaterMark)i.highWaterMark=z$(u);if(u!==0)i.state&=~B;if(u===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){if(y("read: emitReadable",i.length,i.ended),i.length===0&&i.ended)zq(this);else k$(this);return null}if(u=Z6(u,i),u===0&&i.ended){if(i.length===0)zq(this);return null}let Y$=(i.state&q$)!==0;if(y("need readable",Y$),i.length===0||i.length-u<i.highWaterMark)Y$=!0,y("length less than watermark",Y$);if(i.ended||i.reading||i.destroyed||i.errored||!i.constructed)Y$=!1,y("reading, ended or constructing",Y$);else if(Y$){if(y("do read"),i.state|=l|f$,i.length===0)i.state|=q$;try{this._read(i.highWaterMark)}catch(G$){R(this,G$)}if(i.state&=~f$,!i.reading)u=Z6(K$,i)}let B$;if(u>0)B$=R$(u,i);else B$=null;if(B$===null)i.needReadable=i.length<=i.highWaterMark,u=0;else if(i.length-=u,i.multiAwaitDrain)i.awaitDrainWriters.clear();else i.awaitDrainWriters=null;if(i.length===0){if(!i.ended)i.needReadable=!0;if(K$!==u&&i.ended)zq(this)}if(B$!==null&&!i.errorEmitted&&!i.closeEmitted)i.dataEmitted=!0,this.emit("data",B$);return B$};function X$(u,i){if(y("onEofChunk"),i.ended)return;if(i.decoder){let K$=i.decoder.end();if(K$&&K$.length)i.buffer.push(K$),i.length+=i.objectMode?1:K$.length}if(i.ended=!0,i.sync)k$(u);else i.needReadable=!1,i.emittedReadable=!0,o6(u)}function k$(u){let i=u._readableState;if(y("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,!i.emittedReadable)y("emitReadable",i.flowing),i.emittedReadable=!0,_.nextTick(o6,u)}function o6(u){let i=u._readableState;if(y("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&!i.errored&&(i.length||i.ended))u.emit("readable"),i.emittedReadable=!1;i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,h$(u)}function M$(u,i){if(!i.readingMore&&i.constructed)i.readingMore=!0,_.nextTick(S$,u,i)}function S$(u,i){while(!i.reading&&!i.ended&&(i.length<i.highWaterMark||i.flowing&&i.length===0)){let K$=i.length;if(y("maybeReadMore read 0"),u.read(0),K$===i.length)break}i.readingMore=!1}t.prototype._read=function(u){throw new j("_read()")},t.prototype.pipe=function(u,i){let K$=this,Y$=this._readableState;if(Y$.pipes.length===1){if(!Y$.multiAwaitDrain)Y$.multiAwaitDrain=!0,Y$.awaitDrainWriters=new w(Y$.awaitDrainWriters?[Y$.awaitDrainWriters]:[])}Y$.pipes.push(u),y("pipe count=%d opts=%j",Y$.pipes.length,i);let B$=(!i||i.end!==!1)&&u!==_.stdout&&u!==_.stderr?V$:j6;if(Y$.endEmitted)_.nextTick(B$);else K$.once("end",B$);u.on("unpipe",G$);function G$(E6,M6){if(y("onunpipe"),E6===K$){if(M6&&M6.hasUnpiped===!1)M6.hasUnpiped=!0,p$()}}function V$(){y("onend"),u.end()}let p6,D$=!1;function p$(){if(y("cleanup"),u.removeListener("close",c6),u.removeListener("finish",W6),p6)u.removeListener("drain",p6);if(u.removeListener("error",C$),u.removeListener("unpipe",G$),K$.removeListener("end",V$),K$.removeListener("end",j6),K$.removeListener("data",L$),D$=!0,p6&&Y$.awaitDrainWriters&&(!u._writableState||u._writableState.needDrain))p6()}function Zq(){if(!D$){if(Y$.pipes.length===1&&Y$.pipes[0]===u)y("false write response, pause",0),Y$.awaitDrainWriters=u,Y$.multiAwaitDrain=!1;else if(Y$.pipes.length>1&&Y$.pipes.includes(u))y("false write response, pause",Y$.awaitDrainWriters.size),Y$.awaitDrainWriters.add(u);K$.pause()}if(!p6)p6=Sq(K$,u),u.on("drain",p6)}K$.on("data",L$);function L$(E6){y("ondata");let M6=u.write(E6);if(y("dest.write",M6),M6===!1)Zq()}function C$(E6){if(y("onerror",E6),j6(),u.removeListener("error",C$),u.listenerCount("error")===0){let M6=u._writableState||u._readableState;if(M6&&!M6.errorEmitted)R(u,E6);else u.emit("error",E6)}}I(u,"error",C$);function c6(){u.removeListener("finish",W6),j6()}u.once("close",c6);function W6(){y("onfinish"),u.removeListener("close",c6),j6()}u.once("finish",W6);function j6(){y("unpipe"),K$.unpipe(u)}if(u.emit("pipe",K$),u.writableNeedDrain===!0)Zq();else if(!Y$.flowing)y("pipe resume"),K$.resume();return u};function Sq(u,i){return function(){let K$=u._readableState;if(K$.awaitDrainWriters===i)y("pipeOnDrain",1),K$.awaitDrainWriters=null;else if(K$.multiAwaitDrain)y("pipeOnDrain",K$.awaitDrainWriters.size),K$.awaitDrainWriters.delete(i);if((!K$.awaitDrainWriters||K$.awaitDrainWriters.size===0)&&u.listenerCount("data"))u.resume()}}t.prototype.unpipe=function(u){let i=this._readableState,K$={hasUnpiped:!1};if(i.pipes.length===0)return this;if(!u){let B$=i.pipes;i.pipes=[],this.pause();for(let G$=0;G$<B$.length;G$++)B$[G$].emit("unpipe",this,{hasUnpiped:!1});return this}let Y$=K(i.pipes,u);if(Y$===-1)return this;if(i.pipes.splice(Y$,1),i.pipes.length===0)this.pause();return u.emit("unpipe",this,K$),this},t.prototype.on=function(u,i){let K$=C.prototype.on.call(this,u,i),Y$=this._readableState;if(u==="data"){if(Y$.readableListening=this.listenerCount("readable")>0,Y$.flowing!==!1)this.resume()}else if(u==="readable"){if(!Y$.endEmitted&&!Y$.readableListening){if(Y$.readableListening=Y$.needReadable=!0,Y$.flowing=!1,Y$.emittedReadable=!1,y("on readable",Y$.length,Y$.reading),Y$.length)k$(this);else if(!Y$.reading)_.nextTick(b$,this)}}return K$},t.prototype.addListener=t.prototype.on,t.prototype.removeListener=function(u,i){let K$=C.prototype.removeListener.call(this,u,i);if(u==="readable")_.nextTick(E$,this);return K$},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(u){let i=C.prototype.removeAllListeners.apply(this,arguments);if(u==="readable"||u===void 0)_.nextTick(E$,this);return i};function E$(u){let i=u._readableState;if(i.readableListening=u.listenerCount("readable")>0,i.resumeScheduled&&i[M]===!1)i.flowing=!0;else if(u.listenerCount("data")>0)u.resume();else if(!i.readableListening)i.flowing=null}function b$(u){y("readable nexttick read 0"),u.read(0)}t.prototype.resume=function(){let u=this._readableState;if(!u.flowing)y("resume"),u.flowing=!u.readableListening,Mq(this,u);return u[M]=!1,this};function Mq(u,i){if(!i.resumeScheduled)i.resumeScheduled=!0,_.nextTick(g$,u,i)}function g$(u,i){if(y("resume",i.reading),!i.reading)u.read(0);if(i.resumeScheduled=!1,u.emit("resume"),h$(u),i.flowing&&!i.reading)u.read(0)}t.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[M]=!0,this};function h$(u){let i=u._readableState;y("flow",i.flowing);while(i.flowing&&u.read()!==null);}t.prototype.wrap=function(u){let i=!1;u.on("data",(Y$)=>{if(!this.push(Y$)&&u.pause)i=!0,u.pause()}),u.on("end",()=>{this.push(null)}),u.on("error",(Y$)=>{R(this,Y$)}),u.on("close",()=>{this.destroy()}),u.on("destroy",()=>{this.destroy()}),this._read=()=>{if(i&&u.resume)i=!1,u.resume()};let K$=T(u);for(let Y$=1;Y$<K$.length;Y$++){let B$=K$[Y$];if(this[B$]===void 0&&typeof u[B$]==="function")this[B$]=u[B$].bind(u)}return this},t.prototype[S]=function(){return fq(this)},t.prototype.iterator=function(u){if(u!==void 0)V(u,"options");return fq(this,u)};function fq(u,i){if(typeof u.read!=="function")u=t.wrap(u,{objectMode:!0});let K$=y$(u,i);return K$.stream=u,K$}async function*y$(u,i){let K$=G;function Y$(V$){if(this===u)K$(),K$=G;else K$=V$}u.on("readable",Y$);let B$,G$=g(u,{writable:!1},(V$)=>{B$=V$?p(B$,V$):null,K$(),K$=G});try{while(!0){let V$=u.destroyed?null:u.read();if(V$!==null)yield V$;else if(B$)throw B$;else if(B$===null)return;else await new f(Y$)}}catch(V$){throw B$=p(B$,V$),B$}finally{if((B$||(i===null||i===void 0?void 0:i.destroyOnReturn)!==!1)&&(B$===void 0||u._readableState.autoDestroy))o.destroyer(u,null);else u.off("readable",Y$),G$()}}z(t.prototype,{readable:{__proto__:null,get(){let u=this._readableState;return!!u&&u.readable!==!1&&!u.destroyed&&!u.errorEmitted&&!u.endEmitted},set(u){if(this._readableState)this._readableState.readable=!!u}},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(u){if(this._readableState)this._readableState.flowing=u}},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(u){if(!this._readableState)return;this._readableState.destroyed=u}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(H$.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(u){this[M]=!!u}}}),t._fromList=R$;function R$(u,i){if(i.length===0)return null;let K$;if(i.objectMode)K$=i.buffer.shift();else if(!u||u>=i.length){if(i.decoder)K$=i.buffer.join("");else if(i.buffer.length===1)K$=i.buffer.first();else K$=i.buffer.concat(i.length);i.buffer.clear()}else K$=i.buffer.consume(u,i.decoder);return K$}function zq(u){let i=u._readableState;if(y("endReadable",i.endEmitted),!i.endEmitted)i.ended=!0,_.nextTick(u$,i,u)}function u$(u,i){if(y("endReadableNT",u.endEmitted,u.length),!u.errored&&!u.closeEmitted&&!u.endEmitted&&u.length===0){if(u.endEmitted=!0,i.emit("end"),i.writable&&i.allowHalfOpen===!1)_.nextTick(x$,i);else if(u.autoDestroy){let K$=i._writableState;if(!K$||K$.autoDestroy&&(K$.finished||K$.writable===!1))i.destroy()}}}function x$(u){if(u.writable&&!u.writableEnded&&!u.destroyed)u.end()}t.from=function(u,i){return v(t,u,i)};var Wq;function I$(){if(Wq===void 0)Wq={};return Wq}t.fromWeb=function(u,i){return I$().newStreamReadableFromReadableStream(u,i)},t.toWeb=function(u,i){return I$().newReadableStreamFromStreamReadable(u,i)},t.wrap=function(u,i){var K$,Y$;return new t({objectMode:(K$=(Y$=u.readableObjectMode)!==null&&Y$!==void 0?Y$:u.objectMode)!==null&&K$!==void 0?K$:!0,...i,destroy(B$,G$){o.destroyer(u,B$),G$(B$)}}).wrap(u)}}),fH=S6(($,q)=>{var _=cK(),{ArrayPrototypeSlice:K,Error:P,FunctionPrototypeSymbolHasInstance:Y,ObjectDefineProperty:O,ObjectDefineProperties:z,ObjectSetPrototypeOf:T,StringPrototypeToLowerCase:H,Symbol:f,SymbolHasInstance:w}=x6();q.exports=V,V.WritableState=J;var{EventEmitter:k}=(a7(),J6(Q7)),S=wH().Stream,{Buffer:N}=(wq(),J6(Tq)),h=n4(),{addAbortSignal:C}=X2(),{getHighWaterMark:I,getDefaultHighWaterMark:D}=A2(),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:g,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:c,ERR_STREAM_DESTROYED:o,ERR_STREAM_ALREADY_FINISHED:s,ERR_STREAM_NULL_VALUES:F,ERR_STREAM_WRITE_AFTER_END:p,ERR_UNKNOWN_ENCODING:a}=cq().codes,{errorOrDestroy:j}=h;T(V.prototype,S.prototype),T(V,S);function W(){}var X=f("kOnFinished");function J(m,r,J$){if(typeof J$!=="boolean")J$=r instanceof S_();if(this.objectMode=!!(m&&m.objectMode),J$)this.objectMode=this.objectMode||!!(m&&m.writableObjectMode);this.highWaterMark=m?I(this,m,"writableHighWaterMark",J$):D(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let $$=!!(m&&m.decodeStrings===!1);this.decodeStrings=!$$,this.defaultEncoding=m&&m.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Z(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!m||m.emitClose!==!1,this.autoDestroy=!m||m.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function Z(m){m.buffered=[],m.bufferedIndex=0,m.allBuffers=!0,m.allNoop=!0}J.prototype.getBuffer=function(){return K(this.buffered,this.bufferedIndex)},O(J.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function V(m){let r=this instanceof S_();if(!r&&!Y(V,this))return new V(m);if(this._writableState=new J(m,this,r),m){if(typeof m.write==="function")this._write=m.write;if(typeof m.writev==="function")this._writev=m.writev;if(typeof m.destroy==="function")this._destroy=m.destroy;if(typeof m.final==="function")this._final=m.final;if(typeof m.construct==="function")this._construct=m.construct;if(m.signal)C(m.signal,this)}S.call(this,m),h.construct(this,()=>{let J$=this._writableState;if(!J$.writing)l(this,J$);B(this,J$)})}O(V,w,{__proto__:null,value:function(m){if(Y(this,m))return!0;if(this!==V)return!1;return m&&m._writableState instanceof J}}),V.prototype.pipe=function(){j(this,new c)};function M(m,r,J$,$$){let _$=m._writableState;if(typeof J$==="function")$$=J$,J$=_$.defaultEncoding;else{if(!J$)J$=_$.defaultEncoding;else if(J$!=="buffer"&&!N.isEncoding(J$))throw new a(J$);if(typeof $$!=="function")$$=W}if(r===null)throw new F;else if(!_$.objectMode)if(typeof r==="string"){if(_$.decodeStrings!==!1)r=N.from(r,J$),J$="buffer"}else if(r instanceof N)J$="buffer";else if(S._isUint8Array(r))r=S._uint8ArrayToBuffer(r),J$="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],r);let O$;if(_$.ending)O$=new p;else if(_$.destroyed)O$=new o("write");if(O$)return _.nextTick($$,O$),j(m,O$,!0),O$;return _$.pendingcb++,A(m,_$,r,J$,$$)}V.prototype.write=function(m,r,J$){return M(this,m,r,J$)===!0},V.prototype.cork=function(){this._writableState.corked++},V.prototype.uncork=function(){let m=this._writableState;if(m.corked){if(m.corked--,!m.writing)l(this,m)}},V.prototype.setDefaultEncoding=function(m){if(typeof m==="string")m=H(m);if(!N.isEncoding(m))throw new a(m);return this._writableState.defaultEncoding=m,this};function A(m,r,J$,$$,_$){let O$=r.objectMode?1:J$.length;r.length+=O$;let d=r.length<r.highWaterMark;if(!d)r.needDrain=!0;if(r.writing||r.corked||r.errored||!r.constructed){if(r.buffered.push({chunk:J$,encoding:$$,callback:_$}),r.allBuffers&&$$!=="buffer")r.allBuffers=!1;if(r.allNoop&&_$!==W)r.allNoop=!1}else r.writelen=O$,r.writecb=_$,r.writing=!0,r.sync=!0,m._write(J$,$$,r.onwrite),r.sync=!1;return d&&!r.errored&&!r.destroyed}function v(m,r,J$,$$,_$,O$,d){if(r.writelen=$$,r.writecb=d,r.writing=!0,r.sync=!0,r.destroyed)r.onwrite(new o("write"));else if(J$)m._writev(_$,r.onwrite);else m._write(_$,O$,r.onwrite);r.sync=!1}function G(m,r,J$,$$){--r.pendingcb,$$(J$),x(r),j(m,J$)}function R(m,r){let J$=m._writableState,$$=J$.sync,_$=J$.writecb;if(typeof _$!=="function"){j(m,new y);return}if(J$.writing=!1,J$.writecb=null,J$.length-=J$.writelen,J$.writelen=0,r){if(r.stack,!J$.errored)J$.errored=r;if(m._readableState&&!m._readableState.errored)m._readableState.errored=r;if($$)_.nextTick(G,m,J$,r,_$);else G(m,J$,r,_$)}else{if(J$.buffered.length>J$.bufferedIndex)l(m,J$);if($$)if(J$.afterWriteTickInfo!==null&&J$.afterWriteTickInfo.cb===_$)J$.afterWriteTickInfo.count++;else J$.afterWriteTickInfo={count:1,cb:_$,stream:m,state:J$},_.nextTick(E,J$.afterWriteTickInfo);else b(m,J$,1,_$)}}function E({stream:m,state:r,count:J$,cb:$$}){return r.afterWriteTickInfo=null,b(m,r,J$,$$)}function b(m,r,J$,$$){if(!r.ending&&!m.destroyed&&r.length===0&&r.needDrain)r.needDrain=!1,m.emit("drain");while(J$-- >0)r.pendingcb--,$$();if(r.destroyed)x(r);B(m,r)}function x(m){if(m.writing)return;for(let _$=m.bufferedIndex;_$<m.buffered.length;++_$){var r;let{chunk:O$,callback:d}=m.buffered[_$],n=m.objectMode?1:O$.length;m.length-=n,d((r=m.errored)!==null&&r!==void 0?r:new o("write"))}let J$=m[X].splice(0);for(let _$=0;_$<J$.length;_$++){var $$;J$[_$](($$=m.errored)!==null&&$$!==void 0?$$:new o("end"))}Z(m)}function l(m,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:J$,bufferedIndex:$$,objectMode:_$}=r,O$=J$.length-$$;if(!O$)return;let d=$$;if(r.bufferProcessing=!0,O$>1&&m._writev){r.pendingcb-=O$-1;let n=r.allNoop?W:(t)=>{for(let U=d;U<J$.length;++U)J$[U].callback(t)},H$=r.allNoop&&d===0?J$:K(J$,d);H$.allBuffers=r.allBuffers,v(m,r,!0,r.length,H$,"",n),Z(r)}else{do{let{chunk:n,encoding:H$,callback:t}=J$[d];J$[d++]=null;let U=_$?1:n.length;v(m,r,!1,U,n,H$,t)}while(d<J$.length&&!r.writing);if(d===J$.length)Z(r);else if(d>256)J$.splice(0,d),r.bufferedIndex=0;else r.bufferedIndex=d}r.bufferProcessing=!1}V.prototype._write=function(m,r,J$){if(this._writev)this._writev([{chunk:m,encoding:r}],J$);else throw new g("_write()")},V.prototype._writev=null,V.prototype.end=function(m,r,J$){let $$=this._writableState;if(typeof m==="function")J$=m,m=null,r=null;else if(typeof r==="function")J$=r,r=null;let _$;if(m!==null&&m!==void 0){let O$=M(this,m,r);if(O$ instanceof P)_$=O$}if($$.corked)$$.corked=1,this.uncork();if(_$);else if(!$$.errored&&!$$.ending)$$.ending=!0,B(this,$$,!0),$$.ended=!0;else if($$.finished)_$=new s("end");else if($$.destroyed)_$=new o("end");if(typeof J$==="function")if(_$||$$.finished)_.nextTick(J$,_$);else $$[X].push(J$);return this};function Q(m){return m.ending&&!m.destroyed&&m.constructed&&m.length===0&&!m.errored&&m.buffered.length===0&&!m.finished&&!m.writing&&!m.errorEmitted&&!m.closeEmitted}function f$(m,r){let J$=!1;function $$(_$){if(J$){j(m,_$!==null&&_$!==void 0?_$:y());return}if(J$=!0,r.pendingcb--,_$){let O$=r[X].splice(0);for(let d=0;d<O$.length;d++)O$[d](_$);j(m,_$,r.sync)}else if(Q(r))r.prefinished=!0,m.emit("prefinish"),r.pendingcb++,_.nextTick(v$,m,r)}r.sync=!0,r.pendingcb++;try{m._final($$)}catch(_$){$$(_$)}r.sync=!1}function q$(m,r){if(!r.prefinished&&!r.finalCalled)if(typeof m._final==="function"&&!r.destroyed)r.finalCalled=!0,f$(m,r);else r.prefinished=!0,m.emit("prefinish")}function B(m,r,J$){if(Q(r)){if(q$(m,r),r.pendingcb===0){if(J$)r.pendingcb++,_.nextTick(($$,_$)=>{if(Q(_$))v$($$,_$);else _$.pendingcb--},m,r);else if(Q(r))r.pendingcb++,v$(m,r)}}}function v$(m,r){r.pendingcb--,r.finished=!0;let J$=r[X].splice(0);for(let $$=0;$$<J$.length;$$++)J$[$$]();if(m.emit("finish"),r.autoDestroy){let $$=m._readableState;if(!$$||$$.autoDestroy&&($$.endEmitted||$$.readable===!1))m.destroy()}}z(V.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(m){if(this._writableState)this._writableState.destroyed=m}},writable:{__proto__:null,get(){let m=this._writableState;return!!m&&m.writable!==!1&&!m.destroyed&&!m.errored&&!m.ending&&!m.ended},set(m){if(this._writableState)this._writableState.writable=!!m}},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 m=this._writableState;if(!m)return!1;return!m.destroyed&&!m.ending&&m.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 e=h.destroy;V.prototype.destroy=function(m,r){let J$=this._writableState;if(!J$.destroyed&&(J$.bufferedIndex<J$.buffered.length||J$[X].length))_.nextTick(x,J$);return e.call(this,m,r),this},V.prototype._undestroy=h.undestroy,V.prototype._destroy=function(m,r){r(m)},V.prototype[k.captureRejectionSymbol]=function(m){this.destroy(m)};var P$;function o$(){if(P$===void 0)P$={};return P$}V.fromWeb=function(m,r){return o$().newStreamWritableFromWritableStream(m,r)},V.toWeb=function(m){return o$().newWritableStreamFromStreamWritable(m)}}),un=S6(($,q)=>{var _=cK(),K=(wq(),J6(Tq)),{isReadable:P,isWritable:Y,isIterable:O,isNodeStream:z,isReadableNodeStream:T,isWritableNodeStream:H,isDuplexNodeStream:f,isReadableStream:w,isWritableStream:k}=M_(),S=KK(),{AbortError:N,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:C}}=cq(),{destroyer:I}=n4(),D=S_(),L=k2(),g=fH(),{createDeferredPromise:y}=$8(),c=i0(),o=globalThis.Blob||K.Blob,s=typeof o<"u"?function(X){return X instanceof o}:function(X){return!1},F=globalThis.AbortController||e7().AbortController,{FunctionPrototypeCall:p}=x6();class a extends D{constructor(X){super(X);if((X===null||X===void 0?void 0:X.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((X===null||X===void 0?void 0:X.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function X(J,Z){if(f(J))return J;if(T(J))return W({readable:J});if(H(J))return W({writable:J});if(z(J))return W({writable:!1,readable:!1});if(w(J))return W({readable:L.fromWeb(J)});if(k(J))return W({writable:g.fromWeb(J)});if(typeof J==="function"){let{value:M,write:A,final:v,destroy:G}=j(J);if(O(M))return c(a,M,{objectMode:!0,write:A,final:v,destroy:G});let R=M===null||M===void 0?void 0:M.then;if(typeof R==="function"){let E,b=p(R,M,(x)=>{if(x!=null)throw new C("nully","body",x)},(x)=>{I(E,x)});return E=new a({objectMode:!0,readable:!1,write:A,final(x){v(async()=>{try{await b,_.nextTick(x,null)}catch(l){_.nextTick(x,l)}})},destroy:G})}throw new C("Iterable, AsyncIterable or AsyncFunction",Z,M)}if(s(J))return X(J.arrayBuffer());if(O(J))return c(a,J,{objectMode:!0,writable:!1});if(w(J===null||J===void 0?void 0:J.readable)&&k(J===null||J===void 0?void 0:J.writable))return a.fromWeb(J);if(typeof(J===null||J===void 0?void 0:J.writable)==="object"||typeof(J===null||J===void 0?void 0:J.readable)==="object"){let M=J!==null&&J!==void 0&&J.readable?T(J===null||J===void 0?void 0:J.readable)?J===null||J===void 0?void 0:J.readable:X(J.readable):void 0,A=J!==null&&J!==void 0&&J.writable?H(J===null||J===void 0?void 0:J.writable)?J===null||J===void 0?void 0:J.writable:X(J.writable):void 0;return W({readable:M,writable:A})}let V=J===null||J===void 0?void 0:J.then;if(typeof V==="function"){let M;return p(V,J,(A)=>{if(A!=null)M.push(A);M.push(null)},(A)=>{I(M,A)}),M=new a({objectMode:!0,writable:!1,read(){}})}throw new h(Z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],J)};function j(X){let{promise:J,resolve:Z}=y(),V=new F,M=V.signal;return{value:X(async function*(){while(!0){let A=J;J=null;let{chunk:v,done:G,cb:R}=await A;if(_.nextTick(R),G)return;if(M.aborted)throw new N(void 0,{cause:M.reason});({promise:J,resolve:Z}=y()),yield v}}(),{signal:M}),write(A,v,G){let R=Z;Z=null,R({chunk:A,done:!1,cb:G})},final(A){let v=Z;Z=null,v({done:!0,cb:A})},destroy(A,v){V.abort(),v(A)}}}function W(X){let J=X.readable&&typeof X.readable.read!=="function"?L.wrap(X.readable):X.readable,Z=X.writable,V=!!P(J),M=!!Y(Z),A,v,G,R,E;function b(x){let l=R;if(R=null,l)l(x);else if(x)E.destroy(x)}if(E=new a({readableObjectMode:!!(J!==null&&J!==void 0&&J.readableObjectMode),writableObjectMode:!!(Z!==null&&Z!==void 0&&Z.writableObjectMode),readable:V,writable:M}),M)S(Z,(x)=>{if(M=!1,x)I(J,x);b(x)}),E._write=function(x,l,Q){if(Z.write(x,l))Q();else A=Q},E._final=function(x){Z.end(),v=x},Z.on("drain",function(){if(A){let x=A;A=null,x()}}),Z.on("finish",function(){if(v){let x=v;v=null,x()}});if(V)S(J,(x)=>{if(V=!1,x)I(J,x);b(x)}),J.on("readable",function(){if(G){let x=G;G=null,x()}}),J.on("end",function(){E.push(null)}),E._read=function(){while(!0){let x=J.read();if(x===null){G=E._read;return}if(!E.push(x))return}};return E._destroy=function(x,l){if(!x&&R!==null)x=new N;if(G=null,A=null,v=null,R===null)l(x);else R=l,I(Z,x),I(J,x)},E}}),S_=S6(($,q)=>{var{ObjectDefineProperties:_,ObjectGetOwnPropertyDescriptor:K,ObjectKeys:P,ObjectSetPrototypeOf:Y}=x6();q.exports=T;var O=k2(),z=fH();Y(T.prototype,O.prototype),Y(T,O);{let k=P(z.prototype);for(let S=0;S<k.length;S++){let N=k[S];if(!T.prototype[N])T.prototype[N]=z.prototype[N]}}function T(k){if(!(this instanceof T))return new T(k);if(O.call(this,k),z.call(this,k),k){if(this.allowHalfOpen=k.allowHalfOpen!==!1,k.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(k.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}_(T.prototype,{writable:{__proto__:null,...K(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...K(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...K(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...K(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...K(z.prototype,"writableLength")},writableFinished:{__proto__:null,...K(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...K(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...K(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...K(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(k){if(this._readableState&&this._writableState)this._readableState.destroyed=k,this._writableState.destroyed=k}}});var H;function f(){if(H===void 0)H={};return H}T.fromWeb=function(k,S){return f().newStreamDuplexFromReadableWritablePair(k,S)},T.toWeb=function(k){return f().newReadableWritablePairFromDuplex(k)};var w;T.from=function(k){if(!w)w=un();return w(k,"body")}}),B0=S6(($,q)=>{var{ObjectSetPrototypeOf:_,Symbol:K}=x6();q.exports=T;var{ERR_METHOD_NOT_IMPLEMENTED:P}=cq().codes,Y=S_(),{getHighWaterMark:O}=A2();_(T.prototype,Y.prototype),_(T,Y);var z=K("kCallback");function T(w){if(!(this instanceof T))return new T(w);let k=w?O(this,w,"readableHighWaterMark",!0):null;if(k===0)w={...w,highWaterMark:null,readableHighWaterMark:k,writableHighWaterMark:w.writableHighWaterMark||0};if(Y.call(this,w),this._readableState.sync=!1,this[z]=null,w){if(typeof w.transform==="function")this._transform=w.transform;if(typeof w.flush==="function")this._flush=w.flush}this.on("prefinish",f)}function H(w){if(typeof this._flush==="function"&&!this.destroyed)this._flush((k,S)=>{if(k){if(w)w(k);else this.destroy(k);return}if(S!=null)this.push(S);if(this.push(null),w)w()});else if(this.push(null),w)w()}function f(){if(this._final!==H)H.call(this)}T.prototype._final=H,T.prototype._transform=function(w,k,S){throw new P("_transform()")},T.prototype._write=function(w,k,S){let N=this._readableState,h=this._writableState,C=N.length;this._transform(w,k,(I,D)=>{if(I){S(I);return}if(D!=null)this.push(D);if(h.ended||C===N.length||N.length<N.highWaterMark)S();else this[z]=S})},T.prototype._read=function(){if(this[z]){let w=this[z];this[z]=null,w()}}}),t0=S6(($,q)=>{var{ObjectSetPrototypeOf:_}=x6();q.exports=P;var K=B0();_(P.prototype,K.prototype),_(P,K);function P(Y){if(!(this instanceof P))return new P(Y);K.call(this,Y)}P.prototype._transform=function(Y,O,z){z(null,Y)}}),ZH=S6(($,q)=>{var _=cK(),{ArrayIsArray:K,Promise:P,SymbolAsyncIterator:Y,SymbolDispose:O}=x6(),z=KK(),{once:T}=$8(),H=n4(),f=S_(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:k,ERR_INVALID_RETURN_VALUE:S,ERR_MISSING_ARGS:N,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:C},AbortError:I}=cq(),{validateFunction:D,validateAbortSignal:L}=s7(),{isIterable:g,isReadable:y,isReadableNodeStream:c,isNodeStream:o,isTransformStream:s,isWebStream:F,isReadableStream:p,isReadableFinished:a}=M_(),j=globalThis.AbortController||e7().AbortController,W,X,J;function Z(x,l,Q){let f$=!1;x.on("close",()=>{f$=!0});let q$=z(x,{readable:l,writable:Q},(B)=>{f$=!B});return{destroy:(B)=>{if(f$)return;f$=!0,H.destroyer(x,B||new h("pipe"))},cleanup:q$}}function V(x){return D(x[x.length-1],"streams[stream.length - 1]"),x.pop()}function M(x){if(g(x))return x;else if(c(x))return A(x);throw new k("val",["Readable","Iterable","AsyncIterable"],x)}async function*A(x){if(!X)X=k2();yield*X.prototype[Y].call(x)}async function v(x,l,Q,{end:f$}){let q$,B=null,v$=(o$)=>{if(o$)q$=o$;if(B){let m=B;B=null,m()}},e=()=>new P((o$,m)=>{if(q$)m(q$);else B=()=>{if(q$)m(q$);else o$()}});l.on("drain",v$);let P$=z(l,{readable:!1},v$);try{if(l.writableNeedDrain)await e();for await(let o$ of x)if(!l.write(o$))await e();if(f$)l.end(),await e();Q()}catch(o$){Q(q$!==o$?w(q$,o$):o$)}finally{P$(),l.off("drain",v$)}}async function G(x,l,Q,{end:f$}){if(s(l))l=l.writable;let q$=l.getWriter();try{for await(let B of x)await q$.ready,q$.write(B).catch(()=>{});if(await q$.ready,f$)await q$.close();Q()}catch(B){try{await q$.abort(B),Q(B)}catch(v$){Q(v$)}}}function R(...x){return E(x,T(V(x)))}function E(x,l,Q){if(x.length===1&&K(x[0]))x=x[0];if(x.length<2)throw new N("streams");let f$=new j,q$=f$.signal,B=Q===null||Q===void 0?void 0:Q.signal,v$=[];L(B,"options.signal");function e(){_$(new I)}J=J||$8().addAbortListener;let P$;if(B)P$=J(B,e);let o$,m,r=[],J$=0;function $$(t){_$(t,--J$===0)}function _$(t,U){var A$;if(t&&(!o$||o$.code==="ERR_STREAM_PREMATURE_CLOSE"))o$=t;if(!o$&&!U)return;while(r.length)r.shift()(o$);if((A$=P$)===null||A$===void 0||A$[O](),f$.abort(),U){if(!o$)v$.forEach((W$)=>W$());_.nextTick(l,o$,m)}}let O$;for(let t=0;t<x.length;t++){let U=x[t],A$=t<x.length-1,W$=t>0,z$=A$||(Q===null||Q===void 0?void 0:Q.end)!==!1,Z6=t===x.length-1;if(o(U)){let X$=function(k$){if(k$&&k$.name!=="AbortError"&&k$.code!=="ERR_STREAM_PREMATURE_CLOSE")$$(k$)};var d=X$;if(z$){let{destroy:k$,cleanup:o6}=Z(U,A$,W$);if(r.push(k$),y(U)&&Z6)v$.push(o6)}if(U.on("error",X$),y(U)&&Z6)v$.push(()=>{U.removeListener("error",X$)})}if(t===0)if(typeof U==="function"){if(O$=U({signal:q$}),!g(O$))throw new S("Iterable, AsyncIterable or Stream","source",O$)}else if(g(U)||c(U)||s(U))O$=U;else O$=f.from(U);else if(typeof U==="function"){if(s(O$)){var n;O$=M((n=O$)===null||n===void 0?void 0:n.readable)}else O$=M(O$);if(O$=U(O$,{signal:q$}),A$){if(!g(O$,!0))throw new S("AsyncIterable",`transform[${t-1}]`,O$)}else{var H$;if(!W)W=t0();let X$=new W({objectMode:!0}),k$=(H$=O$)===null||H$===void 0?void 0:H$.then;if(typeof k$==="function")J$++,k$.call(O$,(S$)=>{if(m=S$,S$!=null)X$.write(S$);if(z$)X$.end();_.nextTick($$)},(S$)=>{X$.destroy(S$),_.nextTick($$,S$)});else if(g(O$,!0))J$++,v(O$,X$,$$,{end:z$});else if(p(O$)||s(O$)){let S$=O$.readable||O$;J$++,v(S$,X$,$$,{end:z$})}else throw new S("AsyncIterable or Promise","destination",O$);O$=X$;let{destroy:o6,cleanup:M$}=Z(O$,!1,!0);if(r.push(o6),Z6)v$.push(M$)}}else if(o(U)){if(c(O$)){J$+=2;let X$=b(O$,U,$$,{end:z$});if(y(U)&&Z6)v$.push(X$)}else if(s(O$)||p(O$)){let X$=O$.readable||O$;J$++,v(X$,U,$$,{end:z$})}else if(g(O$))J$++,v(O$,U,$$,{end:z$});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],O$);O$=U}else if(F(U)){if(c(O$))J$++,G(M(O$),U,$$,{end:z$});else if(p(O$)||g(O$))J$++,G(O$,U,$$,{end:z$});else if(s(O$))J$++,G(O$.readable,U,$$,{end:z$});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],O$);O$=U}else O$=f.from(U)}if(q$!==null&&q$!==void 0&&q$.aborted||B!==null&&B!==void 0&&B.aborted)_.nextTick(e);return O$}function b(x,l,Q,{end:f$}){let q$=!1;if(l.on("close",()=>{if(!q$)Q(new C)}),x.pipe(l,{end:!1}),f$){let v$=function(){q$=!0,l.end()};var B=v$;if(a(x))_.nextTick(v$);else x.once("end",v$)}else Q();return z(x,{readable:!0,writable:!1},(v$)=>{let e=x._readableState;if(v$&&v$.code==="ERR_STREAM_PREMATURE_CLOSE"&&e&&e.ended&&!e.errored&&!e.errorEmitted)x.once("end",Q).once("error",Q);else Q(v$)}),z(l,{readable:!1,writable:!0},Q)}q.exports={pipelineImpl:E,pipeline:R}}),U0=S6(($,q)=>{var{pipeline:_}=ZH(),K=S_(),{destroyer:P}=n4(),{isNodeStream:Y,isReadable:O,isWritable:z,isWebStream:T,isTransformStream:H,isWritableStream:f,isReadableStream:w}=M_(),{AbortError:k,codes:{ERR_INVALID_ARG_VALUE:S,ERR_MISSING_ARGS:N}}=cq(),h=KK();q.exports=function(...C){if(C.length===0)throw new N("streams");if(C.length===1)return K.from(C[0]);let I=[...C];if(typeof C[0]==="function")C[0]=K.from(C[0]);if(typeof C[C.length-1]==="function"){let j=C.length-1;C[j]=K.from(C[j])}for(let j=0;j<C.length;++j){if(!Y(C[j])&&!T(C[j]))continue;if(j<C.length-1&&!(O(C[j])||w(C[j])||H(C[j])))throw new S(`streams[${j}]`,I[j],"must be readable");if(j>0&&!(z(C[j])||f(C[j])||H(C[j])))throw new S(`streams[${j}]`,I[j],"must be writable")}let D,L,g,y,c;function o(j){let W=y;if(y=null,W)W(j);else if(j)c.destroy(j);else if(!a&&!p)c.destroy()}let s=C[0],F=_(C,o),p=!!(z(s)||f(s)||H(s)),a=!!(O(F)||w(F)||H(F));if(c=new K({writableObjectMode:!!(s!==null&&s!==void 0&&s.writableObjectMode),readableObjectMode:!!(F!==null&&F!==void 0&&F.readableObjectMode),writable:p,readable:a}),p){if(Y(s))c._write=function(W,X,J){if(s.write(W,X))J();else D=J},c._final=function(W){s.end(),L=W},s.on("drain",function(){if(D){let W=D;D=null,W()}});else if(T(s)){let W=(H(s)?s.writable:s).getWriter();c._write=async function(X,J,Z){try{await W.ready,W.write(X).catch(()=>{}),Z()}catch(V){Z(V)}},c._final=async function(X){try{await W.ready,W.close().catch(()=>{}),L=X}catch(J){X(J)}}}let j=H(F)?F.readable:F;h(j,()=>{if(L){let W=L;L=null,W()}})}if(a){if(Y(F))F.on("readable",function(){if(g){let j=g;g=null,j()}}),F.on("end",function(){c.push(null)}),c._read=function(){while(!0){let j=F.read();if(j===null){g=c._read;return}if(!c.push(j))return}};else if(T(F)){let j=(H(F)?F.readable:F).getReader();c._read=async function(){while(!0)try{let{value:W,done:X}=await j.read();if(!c.push(W))return;if(X){c.push(null);return}}catch{return}}}}return c._destroy=function(j,W){if(!j&&y!==null)j=new k;if(g=null,D=null,L=null,y===null)W(j);else if(y=W,Y(F))P(F,j)},c}}),xn=S6(($,q)=>{var _=globalThis.AbortController||e7().AbortController,{codes:{ERR_INVALID_ARG_VALUE:K,ERR_INVALID_ARG_TYPE:P,ERR_MISSING_ARGS:Y,ERR_OUT_OF_RANGE:O},AbortError:z}=cq(),{validateAbortSignal:T,validateInteger:H,validateObject:f}=s7(),w=x6().Symbol("kWeak"),k=x6().Symbol("kResistStopPropagation"),{finished:S}=KK(),N=U0(),{addAbortSignalNoValidate:h}=X2(),{isWritable:C,isNodeStream:I}=M_(),{deprecate:D}=$8(),{ArrayPrototypePush:L,Boolean:g,MathFloor:y,Number:c,NumberIsNaN:o,Promise:s,PromiseReject:F,PromiseResolve:p,PromisePrototypeThen:a,Symbol:j}=x6(),W=j("kEmpty"),X=j("kEof");function J(B,v$){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");if(I(B)&&!C(B))throw new K("stream",B,"must be writable");let e=N(this,B);if(v$!==null&&v$!==void 0&&v$.signal)h(v$.signal,e);return e}function Z(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");let e=1;if((v$===null||v$===void 0?void 0:v$.concurrency)!=null)e=y(v$.concurrency);let P$=e-1;if((v$===null||v$===void 0?void 0:v$.highWaterMark)!=null)P$=y(v$.highWaterMark);return H(e,"options.concurrency",1),H(P$,"options.highWaterMark",0),P$+=e,async function*(){let o$=$8().AbortSignalAny([v$===null||v$===void 0?void 0:v$.signal].filter(g)),m=this,r=[],J$={signal:o$},$$,_$,O$=!1,d=0;function n(){O$=!0,H$()}function H$(){d-=1,t()}function t(){if(_$&&!O$&&d<e&&r.length<P$)_$(),_$=null}async function U(){try{for await(let A$ of m){if(O$)return;if(o$.aborted)throw new z;try{if(A$=B(A$,J$),A$===W)continue;A$=p(A$)}catch(W$){A$=F(W$)}if(d+=1,a(A$,H$,n),r.push(A$),$$)$$(),$$=null;if(!O$&&(r.length>=P$||d>=e))await new s((W$)=>{_$=W$})}r.push(X)}catch(A$){let W$=F(A$);a(W$,H$,n),r.push(W$)}finally{if(O$=!0,$$)$$(),$$=null}}U();try{while(!0){while(r.length>0){let A$=await r[0];if(A$===X)return;if(o$.aborted)throw new z;if(A$!==W)yield A$;r.shift(),t()}await new s((A$)=>{$$=A$})}}finally{if(O$=!0,_$)_$(),_$=null}}.call(this)}function V(B=void 0){if(B!=null)f(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)T(B.signal,"options.signal");return async function*(){let v$=0;for await(let P$ of this){var e;if(B!==null&&B!==void 0&&(e=B.signal)!==null&&e!==void 0&&e.aborted)throw new z({cause:B.signal.reason});yield[v$++,P$]}}.call(this)}async function M(B,v$=void 0){for await(let e of R.call(this,B,v$))return!0;return!1}async function A(B,v$=void 0){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);return!await M.call(this,async(...e)=>{return!await B(...e)},v$)}async function v(B,v$){for await(let e of R.call(this,B,v$))return e;return}async function G(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);async function e(P$,o$){return await B(P$,o$),W}for await(let P$ of Z.call(this,e,v$));}function R(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);async function e(P$,o$){if(await B(P$,o$))return P$;return W}return Z.call(this,e,v$)}class E extends Y{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function b(B,v$,e){var P$;if(typeof B!=="function")throw new P("reducer",["Function","AsyncFunction"],B);if(e!=null)f(e,"options");if((e===null||e===void 0?void 0:e.signal)!=null)T(e.signal,"options.signal");let o$=arguments.length>1;if(e!==null&&e!==void 0&&(P$=e.signal)!==null&&P$!==void 0&&P$.aborted){let _$=new z(void 0,{cause:e.signal.reason});throw this.once("error",()=>{}),await S(this.destroy(_$)),_$}let m=new _,r=m.signal;if(e!==null&&e!==void 0&&e.signal){let _$={once:!0,[w]:this,[k]:!0};e.signal.addEventListener("abort",()=>m.abort(),_$)}let J$=!1;try{for await(let _$ of this){var $$;if(J$=!0,e!==null&&e!==void 0&&($$=e.signal)!==null&&$$!==void 0&&$$.aborted)throw new z;if(!o$)v$=_$,o$=!0;else v$=await B(v$,_$,{signal:r})}if(!J$&&!o$)throw new E}finally{m.abort()}return v$}async function x(B){if(B!=null)f(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)T(B.signal,"options.signal");let v$=[];for await(let P$ of this){var e;if(B!==null&&B!==void 0&&(e=B.signal)!==null&&e!==void 0&&e.aborted)throw new z(void 0,{cause:B.signal.reason});L(v$,P$)}return v$}function l(B,v$){let e=Z.call(this,B,v$);return async function*(){for await(let P$ of e)yield*P$}.call(this)}function Q(B){if(B=c(B),o(B))return 0;if(B<0)throw new O("number",">= 0",B);return B}function f$(B,v$=void 0){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");return B=Q(B),async function*(){var e;if(v$!==null&&v$!==void 0&&(e=v$.signal)!==null&&e!==void 0&&e.aborted)throw new z;for await(let o$ of this){var P$;if(v$!==null&&v$!==void 0&&(P$=v$.signal)!==null&&P$!==void 0&&P$.aborted)throw new z;if(B--<=0)yield o$}}.call(this)}function q$(B,v$=void 0){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");return B=Q(B),async function*(){var e;if(v$!==null&&v$!==void 0&&(e=v$.signal)!==null&&e!==void 0&&e.aborted)throw new z;for await(let o$ of this){var P$;if(v$!==null&&v$!==void 0&&(P$=v$.signal)!==null&&P$!==void 0&&P$.aborted)throw new z;if(B-- >0)yield o$;if(B<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:D(V,"readable.asIndexedPairs will be removed in a future version."),drop:f$,filter:R,flatMap:l,map:Z,take:q$,compose:J},q.exports.promiseReturningOperators={every:A,forEach:G,reduce:b,toArray:x,some:M,find:v}}),F0=S6(($,q)=>{var{ArrayPrototypePop:_,Promise:K}=x6(),{isIterable:P,isNodeStream:Y,isWebStream:O}=M_(),{pipelineImpl:z}=ZH(),{finished:T}=KK();Q0();function H(...f){return new K((w,k)=>{let S,N,h=f[f.length-1];if(h&&typeof h==="object"&&!Y(h)&&!P(h)&&!O(h)){let C=_(f);S=C.signal,N=C.end}z(f,(C,I)=>{if(C)k(C);else w(I)},{signal:S,end:N})})}q.exports={finished:T,pipeline:H}}),Q0=S6(($,q)=>{var{Buffer:_}=(wq(),J6(Tq)),{ObjectDefineProperty:K,ObjectKeys:P,ReflectApply:Y}=x6(),{promisify:{custom:O}}=$8(),{streamReturningOperators:z,promiseReturningOperators:T}=xn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=cq(),f=U0(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:k}=A2(),{pipeline:S}=ZH(),{destroyer:N}=n4(),h=KK(),C=F0(),I=M_(),D=q.exports=wH().Stream;D.isDestroyed=I.isDestroyed,D.isDisturbed=I.isDisturbed,D.isErrored=I.isErrored,D.isReadable=I.isReadable,D.isWritable=I.isWritable,D.Readable=k2();for(let g of P(z)){let y=function(...o){if(new.target)throw H();return D.Readable.from(Y(c,this,o))},c=z[g];K(y,"name",{__proto__:null,value:c.name}),K(y,"length",{__proto__:null,value:c.length}),K(D.Readable.prototype,g,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(let g of P(T)){let y=function(...o){if(new.target)throw H();return Y(c,this,o)},c=T[g];K(y,"name",{__proto__:null,value:c.name}),K(y,"length",{__proto__:null,value:c.length}),K(D.Readable.prototype,g,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}D.Writable=fH(),D.Duplex=S_(),D.Transform=B0(),D.PassThrough=t0(),D.pipeline=S;var{addAbortSignal:L}=X2();D.addAbortSignal=L,D.finished=h,D.destroy=N,D.compose=f,D.setDefaultHighWaterMark=w,D.getDefaultHighWaterMark=k,K(D,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return C}}),K(S,O,{__proto__:null,enumerable:!0,get(){return C.pipeline}}),K(h,O,{__proto__:null,enumerable:!0,get(){return C.finished}}),D.Stream=D,D._isUint8Array=function(g){return g instanceof Uint8Array},D._uint8ArrayToBuffer=function(g){return _.from(g.buffer,g.byteOffset,g.byteLength)}}),pn=S6(($,q)=>{var _=XH();{let K=Q0(),P=F0(),Y=K.Readable.destroy;q.exports=K.Readable,q.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer,q.exports._isUint8Array=K._isUint8Array,q.exports.isDisturbed=K.isDisturbed,q.exports.isErrored=K.isErrored,q.exports.isReadable=K.isReadable,q.exports.Readable=K.Readable,q.exports.Writable=K.Writable,q.exports.Duplex=K.Duplex,q.exports.Transform=K.Transform,q.exports.PassThrough=K.PassThrough,q.exports.addAbortSignal=K.addAbortSignal,q.exports.finished=K.finished,q.exports.destroy=K.destroy,q.exports.destroy=Y,q.exports.pipeline=K.pipeline,q.exports.compose=K.compose,Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return P}}),q.exports.Stream=K.Stream}q.exports.default=q.exports});a0.exports=pn()});var dq={};rq(dq,{webcrypto:()=>Jt,rng:()=>MB,randomUUID:()=>vt,randomFillSync:()=>Kt,randomFill:()=>_t,randomBytes:()=>NB,publicEncrypt:()=>eB,publicDecrypt:()=>$t,pseudoRandomBytes:()=>SB,prng:()=>VB,privateEncrypt:()=>sB,privateDecrypt:()=>qt,pbkdf2Sync:()=>LB,pbkdf2:()=>DB,listCiphers:()=>lB,getRandomValues:()=>jt,getHashes:()=>IB,getDiffieHellman:()=>nB,getCurves:()=>Wt,getCiphers:()=>dB,default:()=>Ht,createVerify:()=>FB,createSign:()=>tB,createHmac:()=>RB,createHash:()=>EB,createECDH:()=>aB,createDiffieHellmanGroup:()=>oB,createDiffieHellman:()=>iB,createDecipheriv:()=>mB,createDecipher:()=>pB,createCredentials:()=>Pt,createCipheriv:()=>uB,createCipher:()=>gB,constants:()=>Yt,Verify:()=>QB,Sign:()=>UB,Hmac:()=>hB,Hash:()=>CB,DiffieHellmanGroup:()=>rB,DiffieHellman:()=>BB,Decipheriv:()=>cB,Decipher:()=>xB,DEFAULT_ENCODING:()=>Ot,Cipheriv:()=>yB,Cipher:()=>bB});function Wt(){return zt}var cn,mn,e0,dn,ln,rn=($,q,_)=>{_=$!=null?cn(mn($)):{};let K=q||!$||!$.__esModule?e0(_,"default",{value:$,enumerable:!0}):_;for(let P of dn($))if(!ln.call(K,P))e0(K,P,{get:()=>$[P],enumerable:!0});return K},T$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),G2,V2,$M,on,kH,GH,mq,nn,q1,qM,Bn,tn,Un,Fn,_M,Qn,an,en,sn,$i,qi,_i,Ki,Pi,Yi,_1,S2,KM,Oi,PM,YM,ji,K1,VH,SH,vi,OM,MH,zi,jM,Wi,vM,zM,Ji,Hi,Ti,wi,fi,Zi,Xi,Ai,ki,Gi,Vi,Si,Mi,Ni,NH,WM,Ci,JM,Ei,hi,Ri,Ii,N_,PK,HM,M8,TM,M2,Di,v8,Li,bi,gi,wM,__,P1,fM,yi,ZM,ui,XM,xi,pi,ci,mi,CH,di,EH,li,ri,oi,ni,ii,Bi,ti,Ui,Fi,Qi,ai,ei,si,$B,s0,qB,$1,_B,AM,kM,KB,PB,GM,YB,OB,Y1,jB,vB,zB,WB,JB,HB,VM,TB,SM,MM,NM,hH,CM,wB,EM,fB,ZB,AH,XB,AB,kB,GB,w6,VB,SB,MB,NB,CB,EB,hB,RB,IB,DB,LB,bB,gB,yB,uB,xB,pB,cB,mB,dB,lB,rB,oB,nB,iB,BB,tB,UB,FB,QB,aB,eB,sB,$t,qt,_t,Kt,Pt,Yt,Ot="buffer",jt=($)=>{return crypto.getRandomValues($)},vt=()=>{return crypto.randomUUID()},zt,Jt,Ht;var lq=lK(()=>{cn=Object.create,{getPrototypeOf:mn,defineProperty:e0,getOwnPropertyNames:dn}=Object,ln=Object.prototype.hasOwnProperty,G2=T$(($,q)=>{q.exports=(lq(),J6(dq)).randomBytes}),V2=T$(($,q)=>{q.exports=(lq(),J6(dq)).createHash}),$M=T$(($,q)=>{q.exports=(lq(),J6(dq)).createHmac}),on=T$(($,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"}}}),kH=T$(($,q)=>{var _=isFinite,K=Math.pow(2,30)-1;q.exports=function(P,Y){if(typeof P!=="number")throw TypeError("Iterations not a number");if(P<0||!_(P))throw TypeError("Bad iterations");if(typeof Y!=="number")throw TypeError("Key length not a number");if(Y<0||Y>K||Y!==Y)throw TypeError("Bad key length")}}),GH=T$(($,q)=>{var _;if(globalThis.process&&globalThis.process.browser)_="utf-8";else if(globalThis.process&&globalThis.process.version)K=parseInt(process.version.split(".")[0].slice(1),10),_=K>=6?"utf-8":"binary";else _="utf-8";var K;q.exports=_}),mq=T$(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _=(wq(),J6(Tq)),K=_.Buffer;function P(O,z){for(var T in O)z[T]=O[T]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=_;else P(_,$),$.Buffer=Y;function Y(O,z,T){return K(O,z,T)}Y.prototype=Object.create(K.prototype),P(K,Y),Y.from=function(O,z,T){if(typeof O==="number")throw TypeError("Argument must not be a number");return K(O,z,T)},Y.alloc=function(O,z,T){if(typeof O!=="number")throw TypeError("Argument must be a number");var H=K(O);if(z!==void 0)if(typeof T==="string")H.fill(z,T);else H.fill(z);else H.fill(0);return H},Y.allocUnsafe=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return K(O)},Y.allocUnsafeSlow=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return _.SlowBuffer(O)}}),nn=T$(($,q)=>{var _={}.toString;q.exports=Array.isArray||function(K){return _.call(K)=="[object Array]"}}),q1=T$(($,q)=>{q.exports=TypeError}),qM=T$(($,q)=>{q.exports=Object}),Bn=T$(($,q)=>{q.exports=Error}),tn=T$(($,q)=>{q.exports=EvalError}),Un=T$(($,q)=>{q.exports=RangeError}),Fn=T$(($,q)=>{q.exports=ReferenceError}),_M=T$(($,q)=>{q.exports=SyntaxError}),Qn=T$(($,q)=>{q.exports=URIError}),an=T$(($,q)=>{q.exports=Math.abs}),en=T$(($,q)=>{q.exports=Math.floor}),sn=T$(($,q)=>{q.exports=Math.max}),$i=T$(($,q)=>{q.exports=Math.min}),qi=T$(($,q)=>{q.exports=Math.pow}),_i=T$(($,q)=>{q.exports=Math.round}),Ki=T$(($,q)=>{q.exports=Number.isNaN||function(_){return _!==_}}),Pi=T$(($,q)=>{var _=Ki();q.exports=function(K){if(_(K)||K===0)return K;return K<0?-1:1}}),Yi=T$(($,q)=>{q.exports=Object.getOwnPropertyDescriptor}),_1=T$(($,q)=>{var _=Yi();if(_)try{_([],"length")}catch(K){_=null}q.exports=_}),S2=T$(($,q)=>{var _=Object.defineProperty||!1;if(_)try{_({},"a",{value:1})}catch(K){_=!1}q.exports=_}),KM=T$(($,q)=>{q.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var _={},K=Symbol("test"),P=Object(K);if(typeof K==="string")return!1;if(Object.prototype.toString.call(K)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var Y=42;_[K]=Y;for(var O in _)return!1;if(typeof Object.keys==="function"&&Object.keys(_).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var z=Object.getOwnPropertySymbols(_);if(z.length!==1||z[0]!==K)return!1;if(!Object.prototype.propertyIsEnumerable.call(_,K))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var T=Object.getOwnPropertyDescriptor(_,K);if(T.value!==Y||T.enumerable!==!0)return!1}return!0}}),Oi=T$(($,q)=>{var _=typeof Symbol<"u"&&Symbol,K=KM();q.exports=function(){if(typeof _!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof _("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return K()}}),PM=T$(($,q)=>{q.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),YM=T$(($,q)=>{var _=qM();q.exports=_.getPrototypeOf||null}),ji=T$(($,q)=>{var _="Function.prototype.bind called on incompatible ",K=Object.prototype.toString,P=Math.max,Y="[object Function]",O=function(H,f){var w=[];for(var k=0;k<H.length;k+=1)w[k]=H[k];for(var S=0;S<f.length;S+=1)w[S+H.length]=f[S];return w},z=function(H,f){var w=[];for(var k=f||0,S=0;k<H.length;k+=1,S+=1)w[S]=H[k];return w},T=function(H,f){var w="";for(var k=0;k<H.length;k+=1)if(w+=H[k],k+1<H.length)w+=f;return w};q.exports=function(H){var f=this;if(typeof f!=="function"||K.apply(f)!==Y)throw TypeError(_+f);var w=z(arguments,1),k,S=function(){if(this instanceof k){var D=f.apply(this,O(w,arguments));if(Object(D)===D)return D;return this}return f.apply(H,O(w,arguments))},N=P(0,f.length-w.length),h=[];for(var C=0;C<N;C++)h[C]="$"+C;if(k=Function("binder","return function ("+T(h,",")+"){ return binder.apply(this,arguments); }")(S),f.prototype){var I=function(){};I.prototype=f.prototype,k.prototype=new I,I.prototype=null}return k}}),K1=T$(($,q)=>{var _=ji();q.exports=Function.prototype.bind||_}),VH=T$(($,q)=>{q.exports=Function.prototype.call}),SH=T$(($,q)=>{q.exports=Function.prototype.apply}),vi=T$(($,q)=>{q.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),OM=T$(($,q)=>{var _=K1(),K=SH(),P=VH(),Y=vi();q.exports=Y||_.call(P,K)}),MH=T$(($,q)=>{var _=K1(),K=q1(),P=VH(),Y=OM();q.exports=function(O){if(O.length<1||typeof O[0]!=="function")throw new K("a function is required");return Y(_,P,O)}}),zi=T$(($,q)=>{var _=MH(),K=_1(),P;try{P=[].__proto__===Array.prototype}catch(T){if(!T||typeof T!=="object"||!("code"in T)||T.code!=="ERR_PROTO_ACCESS")throw T}var Y=!!P&&K&&K(Object.prototype,"__proto__"),O=Object,z=O.getPrototypeOf;q.exports=Y&&typeof Y.get==="function"?_([Y.get]):typeof z==="function"?function(T){return z(T==null?T:O(T))}:!1}),jM=T$(($,q)=>{var _=PM(),K=YM(),P=zi();q.exports=_?function(Y){return _(Y)}:K?function(Y){if(!Y||typeof Y!=="object"&&typeof Y!=="function")throw TypeError("getProto: not an object");return K(Y)}:P?function(Y){return P(Y)}:null}),Wi=T$(($,q)=>{var _=Function.prototype.call,K=Object.prototype.hasOwnProperty,P=K1();q.exports=P.call(_,K)}),vM=T$(($,q)=>{var _,K=qM(),P=Bn(),Y=tn(),O=Un(),z=Fn(),T=_M(),H=q1(),f=Qn(),w=an(),k=en(),S=sn(),N=$i(),h=qi(),C=_i(),I=Pi(),D=Function,L=function(v$){try{return D('"use strict"; return ('+v$+").constructor;")()}catch(e){}},g=_1(),y=S2(),c=function(){throw new H},o=g?function(){try{return arguments.callee,c}catch(v$){try{return g(arguments,"callee").get}catch(e){return c}}}():c,s=Oi()(),F=jM(),p=YM(),a=PM(),j=SH(),W=VH(),X={},J=typeof Uint8Array>"u"||!F?_:F(Uint8Array),Z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?_:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?_:ArrayBuffer,"%ArrayIteratorPrototype%":s&&F?F([][Symbol.iterator]()):_,"%AsyncFromSyncIteratorPrototype%":_,"%AsyncFunction%":X,"%AsyncGenerator%":X,"%AsyncGeneratorFunction%":X,"%AsyncIteratorPrototype%":X,"%Atomics%":typeof Atomics>"u"?_:Atomics,"%BigInt%":typeof BigInt>"u"?_:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?_:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?_:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?_:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P,"%eval%":eval,"%EvalError%":Y,"%Float16Array%":typeof Float16Array>"u"?_:Float16Array,"%Float32Array%":typeof Float32Array>"u"?_:Float32Array,"%Float64Array%":typeof Float64Array>"u"?_:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?_:FinalizationRegistry,"%Function%":D,"%GeneratorFunction%":X,"%Int8Array%":typeof Int8Array>"u"?_:Int8Array,"%Int16Array%":typeof Int16Array>"u"?_:Int16Array,"%Int32Array%":typeof Int32Array>"u"?_:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s&&F?F(F([][Symbol.iterator]())):_,"%JSON%":typeof JSON==="object"?JSON:_,"%Map%":typeof Map>"u"?_:Map,"%MapIteratorPrototype%":typeof Map>"u"||!s||!F?_:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":K,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?_:Promise,"%Proxy%":typeof Proxy>"u"?_:Proxy,"%RangeError%":O,"%ReferenceError%":z,"%Reflect%":typeof Reflect>"u"?_:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?_:Set,"%SetIteratorPrototype%":typeof Set>"u"||!s||!F?_:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?_:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s&&F?F(""[Symbol.iterator]()):_,"%Symbol%":s?Symbol:_,"%SyntaxError%":T,"%ThrowTypeError%":o,"%TypedArray%":J,"%TypeError%":H,"%Uint8Array%":typeof Uint8Array>"u"?_:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?_:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?_:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?_:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?_:WeakMap,"%WeakRef%":typeof WeakRef>"u"?_:WeakRef,"%WeakSet%":typeof WeakSet>"u"?_:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":j,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":p,"%Math.abs%":w,"%Math.floor%":k,"%Math.max%":S,"%Math.min%":N,"%Math.pow%":h,"%Math.round%":C,"%Math.sign%":I,"%Reflect.getPrototypeOf%":a};if(F)try{null.error}catch(v$){V=F(F(v$)),Z["%Error.prototype%"]=V}var V,M=function v$(e){var P$;if(e==="%AsyncFunction%")P$=L("async function () {}");else if(e==="%GeneratorFunction%")P$=L("function* () {}");else if(e==="%AsyncGeneratorFunction%")P$=L("async function* () {}");else if(e==="%AsyncGenerator%"){var o$=v$("%AsyncGeneratorFunction%");if(o$)P$=o$.prototype}else if(e==="%AsyncIteratorPrototype%"){var m=v$("%AsyncGenerator%");if(m&&F)P$=F(m.prototype)}return Z[e]=P$,P$},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=K1(),G=Wi(),R=v.call(W,Array.prototype.concat),E=v.call(j,Array.prototype.splice),b=v.call(W,String.prototype.replace),x=v.call(W,String.prototype.slice),l=v.call(W,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,f$=/\\(\\)?/g,q$=function(v$){var e=x(v$,0,1),P$=x(v$,-1);if(e==="%"&&P$!=="%")throw new T("invalid intrinsic syntax, expected closing `%`");else if(P$==="%"&&e!=="%")throw new T("invalid intrinsic syntax, expected opening `%`");var o$=[];return b(v$,Q,function(m,r,J$,$$){o$[o$.length]=J$?b($$,f$,"$1"):r||m}),o$},B=function(v$,e){var P$=v$,o$;if(G(A,P$))o$=A[P$],P$="%"+o$[0]+"%";if(G(Z,P$)){var m=Z[P$];if(m===X)m=M(P$);if(typeof m>"u"&&!e)throw new H("intrinsic "+v$+" exists, but is not available. Please file an issue!");return{alias:o$,name:P$,value:m}}throw new T("intrinsic "+v$+" does not exist!")};q.exports=function(v$,e){if(typeof v$!=="string"||v$.length===0)throw new H("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!=="boolean")throw new H('"allowMissing" argument must be a boolean');if(l(/^%?[^%]*%?$/,v$)===null)throw new T("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var P$=q$(v$),o$=P$.length>0?P$[0]:"",m=B("%"+o$+"%",e),r=m.name,J$=m.value,$$=!1,_$=m.alias;if(_$)o$=_$[0],E(P$,R([0,1],_$));for(var O$=1,d=!0;O$<P$.length;O$+=1){var n=P$[O$],H$=x(n,0,1),t=x(n,-1);if((H$==='"'||H$==="'"||H$==="`"||(t==='"'||t==="'"||t==="`"))&&H$!==t)throw new T("property names with quotes must have matching quotes");if(n==="constructor"||!d)$$=!0;if(o$+="."+n,r="%"+o$+"%",G(Z,r))J$=Z[r];else if(J$!=null){if(!(n in J$)){if(!e)throw new H("base intrinsic for "+v$+" exists, but the property is not available.");return}if(g&&O$+1>=P$.length){var U=g(J$,n);if(d=!!U,d&&"get"in U&&!("originalValue"in U.get))J$=U.get;else J$=J$[n]}else d=G(J$,n),J$=J$[n];if(d&&!$$)Z[r]=J$}}return J$}}),zM=T$(($,q)=>{var _=vM(),K=MH(),P=K([_("%String.prototype.indexOf%")]);q.exports=function(Y,O){var z=_(Y,!!O);if(typeof z==="function"&&P(Y,".prototype.")>-1)return K([z]);return z}}),Ji=T$(($,q)=>{var _=Function.prototype.toString,K=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,P,Y;if(typeof K==="function"&&typeof Object.defineProperty==="function")try{P=Object.defineProperty({},"length",{get:function(){throw Y}}),Y={},K(function(){throw 42},null,P)}catch(g){if(g!==Y)K=null}else K=null;var O=/^\s*class\b/,z=function(g){try{var y=_.call(g);return O.test(y)}catch(c){return!1}},T=function(g){try{if(z(g))return!1;return _.call(g),!0}catch(y){return!1}},H=Object.prototype.toString,f="[object Object]",w="[object Function]",k="[object GeneratorFunction]",S="[object HTMLAllCollection]",N="[object HTML document.all class]",h="[object HTMLCollection]",C=typeof Symbol==="function"&&!!Symbol.toStringTag,I=!(0 in[,]),D=function(){return!1};if(typeof document==="object"){if(L=document.all,H.call(L)===H.call(document.all))D=function(g){if((I||!g)&&(typeof g>"u"||typeof g==="object"))try{var y=H.call(g);return(y===S||y===N||y===h||y===f)&&g("")==null}catch(c){}return!1}}var L;q.exports=K?function(g){if(D(g))return!0;if(!g)return!1;if(typeof g!=="function"&&typeof g!=="object")return!1;try{K(g,null,P)}catch(y){if(y!==Y)return!1}return!z(g)&&T(g)}:function(g){if(D(g))return!0;if(!g)return!1;if(typeof g!=="function"&&typeof g!=="object")return!1;if(C)return T(g);if(z(g))return!1;var y=H.call(g);if(y!==w&&y!==k&&!/^\[object HTML/.test(y))return!1;return T(g)}}),Hi=T$(($,q)=>{var _=Ji(),K=Object.prototype.toString,P=Object.prototype.hasOwnProperty,Y=function(H,f,w){for(var k=0,S=H.length;k<S;k++)if(P.call(H,k))if(w==null)f(H[k],k,H);else f.call(w,H[k],k,H)},O=function(H,f,w){for(var k=0,S=H.length;k<S;k++)if(w==null)f(H.charAt(k),k,H);else f.call(w,H.charAt(k),k,H)},z=function(H,f,w){for(var k in H)if(P.call(H,k))if(w==null)f(H[k],k,H);else f.call(w,H[k],k,H)};function T(H){return K.call(H)==="[object Array]"}q.exports=function(H,f,w){if(!_(f))throw TypeError("iterator must be a function");var k;if(arguments.length>=3)k=w;if(T(H))Y(H,f,k);else if(typeof H==="string")O(H,f,k);else z(H,f,k)}}),Ti=T$(($,q)=>{q.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),wi=T$(($,q)=>{var _=Ti(),K=typeof globalThis>"u"?globalThis:globalThis;q.exports=function(){var P=[];for(var Y=0;Y<_.length;Y++)if(typeof K[_[Y]]==="function")P[P.length]=_[Y];return P}}),fi=T$(($,q)=>{var _=S2(),K=_M(),P=q1(),Y=_1();q.exports=function(O,z,T){if(!O||typeof O!=="object"&&typeof O!=="function")throw new P("`obj` must be an object or a function`");if(typeof z!=="string"&&typeof z!=="symbol")throw new P("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new P("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new P("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new P("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new P("`loose`, if provided, must be a boolean");var H=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,w=arguments.length>5?arguments[5]:null,k=arguments.length>6?arguments[6]:!1,S=!!Y&&Y(O,z);if(_)_(O,z,{configurable:w===null&&S?S.configurable:!w,enumerable:H===null&&S?S.enumerable:!H,value:T,writable:f===null&&S?S.writable:!f});else if(k||!H&&!f&&!w)O[z]=T;else throw new K("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),Zi=T$(($,q)=>{var _=S2(),K=function(){return!!_};K.hasArrayLengthDefineBug=function(){if(!_)return null;try{return _([],"length",{value:1}).length!==1}catch(P){return!0}},q.exports=K}),Xi=T$(($,q)=>{var _=vM(),K=fi(),P=Zi()(),Y=_1(),O=q1(),z=_("%Math.floor%");q.exports=function(T,H){if(typeof T!=="function")throw new O("`fn` is not a function");if(typeof H!=="number"||H<0||H>4294967295||z(H)!==H)throw new O("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],w=!0,k=!0;if("length"in T&&Y){var S=Y(T,"length");if(S&&!S.configurable)w=!1;if(S&&!S.writable)k=!1}if(w||k||!f)if(P)K(T,"length",H,!0,!0);else K(T,"length",H);return T}}),Ai=T$(($,q)=>{var _=K1(),K=SH(),P=OM();q.exports=function(){return P(_,K,arguments)}}),ki=T$(($,q)=>{var _=Xi(),K=S2(),P=MH(),Y=Ai();if(q.exports=function(O){var z=P(arguments),T=O.length-(arguments.length-1);return _(z,1+(T>0?T:0),!0)},K)K(q.exports,"apply",{value:Y});else q.exports.apply=Y}),Gi=T$(($,q)=>{var _=KM();q.exports=function(){return _()&&!!Symbol.toStringTag}}),Vi=T$(($,q)=>{var _=Hi(),K=wi(),P=ki(),Y=zM(),O=_1(),z=jM(),T=Y("Object.prototype.toString"),H=Gi()(),f=typeof globalThis>"u"?globalThis:globalThis,w=K(),k=Y("String.prototype.slice"),S=Y("Array.prototype.indexOf",!0)||function(I,D){for(var L=0;L<I.length;L+=1)if(I[L]===D)return L;return-1},N={__proto__:null};if(H&&O&&z)_(w,function(I){var D=new f[I];if(Symbol.toStringTag in D&&z){var L=z(D),g=O(L,Symbol.toStringTag);if(!g&&L){var y=z(L);g=O(y,Symbol.toStringTag)}N["$"+I]=P(g.get)}});else _(w,function(I){var D=new f[I],L=D.slice||D.set;if(L)N["$"+I]=P(L)});var h=function(I){var D=!1;return _(N,function(L,g){if(!D)try{if("$"+L(I)===g)D=k(g,1)}catch(y){}}),D},C=function(I){var D=!1;return _(N,function(L,g){if(!D)try{L(I),D=k(g,1)}catch(y){}}),D};q.exports=function(I){if(!I||typeof I!=="object")return!1;if(!H){var D=k(T(I),8,-1);if(S(w,D)>-1)return D;if(D!=="Object")return!1;return C(I)}if(!O)return null;return h(I)}}),Si=T$(($,q)=>{var _=Vi();q.exports=function(K){return!!_(K)}}),Mi=T$(($,q)=>{var _=q1(),K=zM(),P=K("TypedArray.prototype.buffer",!0),Y=Si();q.exports=P||function(O){if(!Y(O))throw new _("Not a Typed Array");return O.buffer}}),Ni=T$(($,q)=>{var _=mq().Buffer,K=nn(),P=Mi(),Y=ArrayBuffer.isView||function(H){try{return P(H),!0}catch(f){return!1}},O=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",T=z&&(_.prototype instanceof Uint8Array||_.TYPED_ARRAY_SUPPORT);q.exports=function(H,f){if(_.isBuffer(H)){if(H.constructor&&!("isBuffer"in H))return _.from(H);return H}if(typeof H==="string")return _.from(H,f);if(z&&Y(H)){if(H.byteLength===0)return _.alloc(0);if(T){var w=_.from(H.buffer,H.byteOffset,H.byteLength);if(w.byteLength===H.byteLength)return w}var k=H instanceof Uint8Array?H:new Uint8Array(H.buffer,H.byteOffset,H.byteLength),S=_.from(k);if(S.length===H.byteLength)return S}if(O&&H instanceof Uint8Array)return _.from(H);var N=K(H);if(N)for(var h=0;h<H.length;h+=1){var C=H[h];if(typeof C!=="number"||C<0||C>255||~~C!==C)throw RangeError("Array items must be numbers in the range 0-255.")}if(N||_.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return _.from(H);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),NH=T$(($,q)=>{var _=mq().Buffer,K=Ni(),P=typeof Uint8Array<"u",Y=P&&typeof ArrayBuffer<"u",O=Y&&ArrayBuffer.isView;q.exports=function(z,T,H){if(typeof z==="string"||_.isBuffer(z)||P&&z instanceof Uint8Array||O&&O(z))return K(z,T);throw TypeError(H+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),WM=T$(($,q)=>{var _={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},K={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},P=$M(),Y=mq().Buffer,O=kH(),z=GH(),T=NH();function H(f,w,k,S,N){O(k,S),f=T(f,z,"Password"),w=T(w,z,"Salt");var h=(N||"sha1").toLowerCase(),C=K[h]||h,I=_[C];if(typeof I!=="number"||!I)throw TypeError("Digest algorithm not supported: "+N);var D=Y.allocUnsafe(S),L=Y.allocUnsafe(w.length+4);w.copy(L,0,0,w.length);var g=0,y=I,c=Math.ceil(S/y);for(var o=1;o<=c;o++){L.writeUInt32BE(o,w.length);var s=P(C,f).update(L).digest(),F=s;for(var p=1;p<k;p++){F=P(C,f).update(F).digest();for(var a=0;a<y;a++)s[a]^=F[a]}s.copy(D,g),g+=y}return D}q.exports=H}),Ci=T$(($,q)=>{var _=mq().Buffer,K=kH(),P=GH(),Y=WM(),O=NH(),z,T=globalThis.crypto&&globalThis.crypto.subtle,H={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[],w;function k(){if(w)return w;if(globalThis.process&&globalThis.process.nextTick)w=globalThis.process.nextTick;else if(globalThis.queueMicrotask)w=globalThis.queueMicrotask;else if(globalThis.setImmediate)w=globalThis.setImmediate;else w=globalThis.setTimeout;return w}function S(C,I,D,L,g){return T.importKey("raw",C,{name:"PBKDF2"},!1,["deriveBits"]).then(function(y){return T.deriveBits({name:"PBKDF2",salt:I,iterations:D,hash:{name:g}},y,L<<3)}).then(function(y){return _.from(y)})}function N(C){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!T||!T.importKey||!T.deriveBits)return Promise.resolve(!1);if(f[C]!==void 0)return f[C];z=z||_.alloc(8);var I=S(z,z,10,128,C).then(function(){return!0},function(){return!1});return f[C]=I,I}function h(C,I){C.then(function(D){k()(function(){I(null,D)})},function(D){k()(function(){I(D)})})}q.exports=function(C,I,D,L,g,y){if(typeof g==="function")y=g,g=void 0;if(K(D,L),C=O(C,P,"Password"),I=O(I,P,"Salt"),typeof y!=="function")throw Error("No callback provided to pbkdf2");g=g||"sha1";var c=H[g.toLowerCase()];if(!c||typeof globalThis.Promise!=="function"){k()(function(){var o;try{o=Y(C,I,D,L,g)}catch(s){y(s);return}y(null,o)});return}h(N(c).then(function(o){if(o)return S(C,I,D,L,c);return Y(C,I,D,L,g)}),y)}}),JM=T$(($)=>{var q=(lq(),J6(dq)),_=kH(),K=GH(),P=NH();function Y(z,T,H,f,w,k){if(_(H,f),z=P(z,K,"Password"),T=P(T,K,"Salt"),typeof w==="function")k=w,w="sha1";if(typeof k!=="function")throw Error("No callback provided to pbkdf2");return q.pbkdf2(z,T,H,f,w,k)}function O(z,T,H,f,w){return _(H,f),z=P(z,K,"Password"),T=P(T,K,"Salt"),w=w||"sha1",q.pbkdf2Sync(z,T,H,f,w)}if(!q.pbkdf2Sync||q.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=WM(),$.pbkdf2=Ci();else $.pbkdf2Sync=O,$.pbkdf2=Y}),Ei=T$(($)=>{var q=(lq(),J6(dq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),hi=T$(($)=>{var q=(lq(),J6(dq));$.DiffieHellmanGroup=q.DiffieHellmanGroup,$.createDiffieHellmanGroup=q.createDiffieHellmanGroup,$.getDiffieHellman=q.getDiffieHellman,$.createDiffieHellman=q.createDiffieHellman,$.DiffieHellman=q.DiffieHellman}),Ri=T$(($)=>{var q=(lq(),J6(dq));$.createSign=q.createSign,$.Sign=q.Sign,$.createVerify=q.createVerify,$.Verify=q.Verify}),Ii=T$(($,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"}}}),N_=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,V,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(V=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(V=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,V=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,V=Math.min(j.length,X);for(var M=W;M<V;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var V=j.length-X,M=V%J,A=Math.min(V,V-M)+X,v=0;for(var G=X;G<A;G+=J)if(v=f(j,G,G+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,G,j.length,W);for(G=0;G<M;G++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var V=0;V<this.length;V++){var M=this.words[V],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,V--;if(Z!==0||V!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],G=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(G).toString(j);if(R=R.idivn(G),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var V=W==="le",M=new j(Z),A,v,G=this.clone();if(!V){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[Z-v-1]=A}else{for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var V=0;V<J.length;V++)W=(X.words[V]|0)+(J.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;for(;Z!==0&&V<X.length;V++)W=(X.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;V<X.length;V++)this.words[V]=X.words[V];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var V=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;for(;V!==0&&M<J.length;M++)W=(J.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;if(V===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,V=W.words[0]|0,M=Z*V,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var G=1;G<J;G++){var R=v>>>26,E=v&67108863,b=Math.min(G,W.length-1);for(var x=Math.max(0,G-j.length+1);x<=b;x++){var l=G-x|0;Z=j.words[l]|0,V=W.words[x]|0,M=Z*V+E,R+=M/67108864|0,E=M&67108863}X.words[G]=E|0,v=R|0}if(v!==0)X.words[G]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,V=X.words,M=0,A,v,G,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,Q=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,e=v$&8191,P$=v$>>>13,o$=J[4]|0,m=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,G=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(Q,M$)|0,G=Math.imul(Q,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,G=G+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,G=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(Q,E$)|0,G=G+Math.imul(Q,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,G=G+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(e,M$),v=Math.imul(e,S$),v=v+Math.imul(P$,M$)|0,G=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,G=G+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(Q,g$)|0,G=G+Math.imul(Q,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,G=G+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(m,M$),v=Math.imul(m,S$),v=v+Math.imul(r,M$)|0,G=Math.imul(r,S$),A=A+Math.imul(e,E$)|0,v=v+Math.imul(e,b$)|0,v=v+Math.imul(P$,E$)|0,G=G+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,G=G+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(Q,y$)|0,G=G+Math.imul(Q,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,G=G+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,G=Math.imul(_$,S$),A=A+Math.imul(m,E$)|0,v=v+Math.imul(m,b$)|0,v=v+Math.imul(r,E$)|0,G=G+Math.imul(r,b$)|0,A=A+Math.imul(e,g$)|0,v=v+Math.imul(e,h$)|0,v=v+Math.imul(P$,g$)|0,G=G+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,G=G+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(Q,u$)|0,G=G+Math.imul(Q,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,G=G+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,G=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,G=G+Math.imul(_$,b$)|0,A=A+Math.imul(m,g$)|0,v=v+Math.imul(m,h$)|0,v=v+Math.imul(r,g$)|0,G=G+Math.imul(r,h$)|0,A=A+Math.imul(e,y$)|0,v=v+Math.imul(e,R$)|0,v=v+Math.imul(P$,y$)|0,G=G+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,G=G+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(Q,I$)|0,G=G+Math.imul(Q,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,G=G+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,G=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,G=G+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,G=G+Math.imul(_$,h$)|0,A=A+Math.imul(m,y$)|0,v=v+Math.imul(m,R$)|0,v=v+Math.imul(r,y$)|0,G=G+Math.imul(r,R$)|0,A=A+Math.imul(e,u$)|0,v=v+Math.imul(e,x$)|0,v=v+Math.imul(P$,u$)|0,G=G+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,G=G+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(Q,K$)|0,G=G+Math.imul(Q,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,G=G+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,G=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,G=G+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,G=G+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,G=G+Math.imul(_$,R$)|0,A=A+Math.imul(m,u$)|0,v=v+Math.imul(m,x$)|0,v=v+Math.imul(r,u$)|0,G=G+Math.imul(r,x$)|0,A=A+Math.imul(e,I$)|0,v=v+Math.imul(e,u)|0,v=v+Math.imul(P$,I$)|0,G=G+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,G=G+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(Q,G$)|0,G=G+Math.imul(Q,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,G=G+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,G=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,G=G+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,G=G+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,G=G+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,G=G+Math.imul(_$,x$)|0,A=A+Math.imul(m,I$)|0,v=v+Math.imul(m,u)|0,v=v+Math.imul(r,I$)|0,G=G+Math.imul(r,u)|0,A=A+Math.imul(e,K$)|0,v=v+Math.imul(e,Y$)|0,v=v+Math.imul(P$,K$)|0,G=G+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,G=G+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(Q,D$)|0,G=G+Math.imul(Q,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,G=G+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,G=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,G=G+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,G=G+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,G=G+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,G=G+Math.imul(_$,u)|0,A=A+Math.imul(m,K$)|0,v=v+Math.imul(m,Y$)|0,v=v+Math.imul(r,K$)|0,G=G+Math.imul(r,Y$)|0,A=A+Math.imul(e,G$)|0,v=v+Math.imul(e,V$)|0,v=v+Math.imul(P$,G$)|0,G=G+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,G=G+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(Q,L$)|0,G=G+Math.imul(Q,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,G=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,G=G+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,G=G+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,G=G+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,G=G+Math.imul(_$,Y$)|0,A=A+Math.imul(m,G$)|0,v=v+Math.imul(m,V$)|0,v=v+Math.imul(r,G$)|0,G=G+Math.imul(r,V$)|0,A=A+Math.imul(e,D$)|0,v=v+Math.imul(e,p$)|0,v=v+Math.imul(P$,D$)|0,G=G+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,G=G+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,G=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,G=G+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,G=G+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,G=G+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,G=G+Math.imul(_$,V$)|0,A=A+Math.imul(m,D$)|0,v=v+Math.imul(m,p$)|0,v=v+Math.imul(r,D$)|0,G=G+Math.imul(r,p$)|0,A=A+Math.imul(e,L$)|0,v=v+Math.imul(e,C$)|0,v=v+Math.imul(P$,L$)|0,G=G+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,G=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,G=G+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,G=G+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,G=G+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,G=G+Math.imul(_$,p$)|0,A=A+Math.imul(m,L$)|0,v=v+Math.imul(m,C$)|0,v=v+Math.imul(r,L$)|0,G=G+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,G=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,G=G+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,G=G+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,G=G+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,G=G+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,G=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,G=G+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,G=G+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,G=G+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,G=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,G=G+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,G=G+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,G=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,G=G+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,G=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(G+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,V[0]=c6,V[1]=W6,V[2]=j6,V[3]=E6,V[4]=M6,V[5]=t6,V[6]=U6,V[7]=F6,V[8]=Q6,V[9]=a6,V[10]=e6,V[11]=s6,V[12]=$q,V[13]=qq,V[14]=_q,V[15]=Kq,V[16]=Pq,V[17]=Yq,V[18]=Oq,M!==0)V[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var V=0;V<X.length-1;V++){var M=Z;Z=0;var A=J&67108863,v=Math.min(V,W.length-1);for(var G=Math.max(0,V-j.length+1);G<=v;G++){var R=V-G,E=j.words[R]|0,b=W.words[G]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[V]=A,J=M,M=Z}if(J!==0)X.words[V]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,V){for(var M=0;M<V;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,V){this.permute(V,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),G=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=G;for(var x=0;x<M;x++){var l=X[R+x],Q=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=Q+q$,X[R+x+M]=l-f$,J[R+x+M]=Q-q$,x!==A)B=v*E-G*b,b=v*b+G*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var V=0;V<W;V++)Z=Z+(j[V]|0),X[2*V]=Z&8191,Z=Z>>>13,X[2*V+1]=Z&8191,Z=Z>>>13;for(V=2*W;V<J;++V)X[V]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),V=this.stub(J),M=Array(J),A=Array(J),v=Array(J),G=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,G,J),this.transform(M,V,A,v,J,Z),this.transform(G,V,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,V,J,Z),this.conjugate(b,V,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var V=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|V,V=M>>>26-W}if(V)this.words[Z]=V,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,V=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=V,J=Math.max(0,J),A){for(var v=0;v<V;v++)A.words[v]=this.words[v];A.length=V}if(V===0);else if(this.length>V){this.length-=V;for(v=0;v<this.length;v++)this.words[v]=this.words[v+V]}else this.words[0]=0,this.length=1;var G=0;for(v=this.length-1;v>=0&&(G!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=G<<26-Z|R>>>Z,G=R&M}if(A&&G!==0)A.words[A.length++]=G;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var V,M=0;for(Z=0;Z<j.length;Z++){V=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;V-=A&67108863,M=(V>>26)-(A/67108864|0),this.words[Z+X]=V&67108863}for(;Z<this.length-X;Z++)V=(this.words[Z+X]|0)+M,M=V>>26,this.words[Z+X]=V&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)V=-(this.words[Z]|0)+M,M=V>>26,this.words[Z]=V&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,V=Z.words[Z.length-1]|0,M=this._countBits(V);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),V=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var G=0;G<v.length;G++)v.words[G]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/V|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,V;if(this.negative!==0&&j.negative===0){if(V=this.neg().divmod(j,W),W!=="mod")J=V.div.neg();if(W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(V=this.divmod(j.neg(),W),W!=="mod")J=V.div.neg();return{div:J,mod:V.mod}}if((this.negative&j.negative)!==0){if(V=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:V.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),V=X.cmp(J);if(V<0||Z===1&&V===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),G=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(G);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(V.isOdd()||M.isOdd())V.iadd(v),M.isub(G);V.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(V),Z.isub(M);else X.isub(W),V.isub(J),M.isub(Z)}return{a:V,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(V);J.iushrn(1)}}for(var v=0,G=1;(X.words[0]&G)===0&&v<26;++v,G<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(V);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var V=W;W=X,X=V}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var V=X;Z!==0&&V<this.length;V++){var M=this.words[V]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[V]=M}if(Z!==0)this.words[V]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new p(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(c,y),c.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var V=j.words[9];W.words[W.length++]=V&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|V>>>22,V=M}if(V>>>=22,j.words[Z-10]=V,V===0&&j.length>10)j.length-=10;else j.length-=9},c.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function F(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(F,y),F.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new c;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new F;else throw Error("Unknown prime "+j);return g[j]=W,W};function p(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}p.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},p.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},p.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},p.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},p.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},p.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},p.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},p.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},p.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},p.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},p.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},p.prototype.isqr=function(j){return this.imul(j,j.clone())},p.prototype.sqr=function(j){return this.mul(j,j)},p.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var V=new O(1).toRed(this),M=V.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var G=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(V)!==0){var x=E;for(var l=0;x.cmp(V)!==0;l++)x=x.redSqr();P(l<b);var Q=this.pow(G,new O(1).iushln(b-l-1));R=R.redMul(Q),G=Q.redSqr(),E=E.redMul(G),b=l}return R},p.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},p.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var V=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var G=W.words[Z];for(var R=v-1;R>=0;R--){var E=G>>R&1;if(V!==J[0])V=this.sqr(V);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;V=this.mul(V,J[M]),A=0,M=0}v=26}return V},p.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},p.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new a(j)};function a(j){if(p.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(a,p),a.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},a.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},a.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),PK=T$(($,q)=>{q.exports=_;function _(K,P){if(!K)throw Error(P||"Assertion failed")}_.equal=function(K,P,Y){if(K!=P)throw Error(Y||"Assertion failed: "+K+" != "+P)}}),HM=T$(($)=>{var q=$;function _(Y,O){if(Array.isArray(Y))return Y.slice();if(!Y)return[];var z=[];if(typeof Y!=="string"){for(var T=0;T<Y.length;T++)z[T]=Y[T]|0;return z}if(O==="hex"){if(Y=Y.replace(/[^a-z0-9]+/ig,""),Y.length%2!==0)Y="0"+Y;for(var T=0;T<Y.length;T+=2)z.push(parseInt(Y[T]+Y[T+1],16))}else for(var T=0;T<Y.length;T++){var H=Y.charCodeAt(T),f=H>>8,w=H&255;if(f)z.push(f,w);else z.push(w)}return z}q.toArray=_;function K(Y){if(Y.length===1)return"0"+Y;else return Y}q.zero2=K;function P(Y){var O="";for(var z=0;z<Y.length;z++)O+=K(Y[z].toString(16));return O}q.toHex=P,q.encode=function(Y,O){if(O==="hex")return P(Y);else return Y}}),M8=T$(($)=>{var q=$,_=N_(),K=PK(),P=HM();q.assert=K,q.toArray=P.toArray,q.zero2=P.zero2,q.toHex=P.toHex,q.encode=P.encode;function Y(f,w,k){var S=Array(Math.max(f.bitLength(),k)+1),N;for(N=0;N<S.length;N+=1)S[N]=0;var h=1<<w+1,C=f.clone();for(N=0;N<S.length;N++){var I,D=C.andln(h-1);if(C.isOdd()){if(D>(h>>1)-1)I=(h>>1)-D;else I=D;C.isubn(I)}else I=0;S[N]=I,C.iushrn(1)}return S}q.getNAF=Y;function O(f,w){var k=[[],[]];f=f.clone(),w=w.clone();var S=0,N=0,h;while(f.cmpn(-S)>0||w.cmpn(-N)>0){var C=f.andln(3)+S&3,I=w.andln(3)+N&3;if(C===3)C=-1;if(I===3)I=-1;var D;if((C&1)===0)D=0;else if(h=f.andln(7)+S&7,(h===3||h===5)&&I===2)D=-C;else D=C;k[0].push(D);var L;if((I&1)===0)L=0;else if(h=w.andln(7)+N&7,(h===3||h===5)&&C===2)L=-I;else L=I;if(k[1].push(L),2*S===D+1)S=1-S;if(2*N===L+1)N=1-N;f.iushrn(1),w.iushrn(1)}return k}q.getJSF=O;function z(f,w,k){var S="_"+w;f.prototype[w]=function(){return this[S]!==void 0?this[S]:this[S]=k.call(this)}}q.cachedProperty=z;function T(f){return typeof f==="string"?q.toArray(f,"hex"):f}q.parseBytes=T;function H(f){return new _(f,"hex","le")}q.intFromLE=H}),TM=T$(($,q)=>{var _;q.exports=function(Y){if(!_)_=new K(null);return _.generate(Y)};function K(Y){this.rand=Y}if(q.exports.Rand=K,K.prototype.generate=function(Y){return this._rand(Y)},K.prototype._rand=function(Y){if(this.rand.getBytes)return this.rand.getBytes(Y);var O=new Uint8Array(Y);for(var z=0;z<O.length;z++)O[z]=this.rand.getByte();return O},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)K.prototype._rand=function(Y){var O=new Uint8Array(Y);return self.crypto.getRandomValues(O),O};else if(self.msCrypto&&self.msCrypto.getRandomValues)K.prototype._rand=function(Y){var O=new Uint8Array(Y);return self.msCrypto.getRandomValues(O),O};else if(typeof window==="object")K.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(P=(lq(),J6(dq)),typeof P.randomBytes!=="function")throw Error("Not supported");K.prototype._rand=function(Y){return P.randomBytes(Y)}}catch(Y){}var P}),M2=T$(($,q)=>{var _=N_(),K=M8(),P=K.getNAF,Y=K.getJSF,O=K.assert;function z(H,f){this.type=H,this.p=new _(f.p,16),this.red=f.prime?_.red(f.prime):_.mont(this.p),this.zero=new _(0).toRed(this.red),this.one=new _(1).toRed(this.red),this.two=new _(2).toRed(this.red),this.n=f.n&&new _(f.n,16),this.g=f.g&&this.pointFromJSON(f.g,f.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var w=this.n&&this.p.div(this.n);if(!w||w.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(H,f){O(H.precomputed);var w=H._getDoubles(),k=P(f,1,this._bitLength),S=(1<<w.step+1)-(w.step%2===0?2:1);S/=3;var N=[],h,C;for(h=0;h<k.length;h+=w.step){C=0;for(var I=h+w.step-1;I>=h;I--)C=(C<<1)+k[I];N.push(C)}var D=this.jpoint(null,null,null),L=this.jpoint(null,null,null);for(var g=S;g>0;g--){for(h=0;h<N.length;h++)if(C=N[h],C===g)L=L.mixedAdd(w.points[h]);else if(C===-g)L=L.mixedAdd(w.points[h].neg());D=D.add(L)}return D.toP()},z.prototype._wnafMul=function(H,f){var w=4,k=H._getNAFPoints(w);w=k.wnd;var S=k.points,N=P(f,w,this._bitLength),h=this.jpoint(null,null,null);for(var C=N.length-1;C>=0;C--){for(var I=0;C>=0&&N[C]===0;C--)I++;if(C>=0)I++;if(h=h.dblp(I),C<0)break;var D=N[C];if(O(D!==0),H.type==="affine")if(D>0)h=h.mixedAdd(S[D-1>>1]);else h=h.mixedAdd(S[-D-1>>1].neg());else if(D>0)h=h.add(S[D-1>>1]);else h=h.add(S[-D-1>>1].neg())}return H.type==="affine"?h.toP():h},z.prototype._wnafMulAdd=function(H,f,w,k,S){var N=this._wnafT1,h=this._wnafT2,C=this._wnafT3,I=0,D,L,g;for(D=0;D<k;D++){g=f[D];var y=g._getNAFPoints(H);N[D]=y.wnd,h[D]=y.points}for(D=k-1;D>=1;D-=2){var c=D-1,o=D;if(N[c]!==1||N[o]!==1){C[c]=P(w[c],N[c],this._bitLength),C[o]=P(w[o],N[o],this._bitLength),I=Math.max(C[c].length,I),I=Math.max(C[o].length,I);continue}var s=[f[c],null,null,f[o]];if(f[c].y.cmp(f[o].y)===0)s[1]=f[c].add(f[o]),s[2]=f[c].toJ().mixedAdd(f[o].neg());else if(f[c].y.cmp(f[o].y.redNeg())===0)s[1]=f[c].toJ().mixedAdd(f[o]),s[2]=f[c].add(f[o].neg());else s[1]=f[c].toJ().mixedAdd(f[o]),s[2]=f[c].toJ().mixedAdd(f[o].neg());var F=[-3,-1,-5,-7,0,7,5,1,3],p=Y(w[c],w[o]);I=Math.max(p[0].length,I),C[c]=Array(I),C[o]=Array(I);for(L=0;L<I;L++){var a=p[0][L]|0,j=p[1][L]|0;C[c][L]=F[(a+1)*3+(j+1)],C[o][L]=0,h[c]=s}}var W=this.jpoint(null,null,null),X=this._wnafT4;for(D=I;D>=0;D--){var J=0;while(D>=0){var Z=!0;for(L=0;L<k;L++)if(X[L]=C[L][D]|0,X[L]!==0)Z=!1;if(!Z)break;J++,D--}if(D>=0)J++;if(W=W.dblp(J),D<0)break;for(L=0;L<k;L++){var V=X[L];if(V===0)continue;else if(V>0)g=h[L][V-1>>1];else if(V<0)g=h[L][-V-1>>1].neg();if(g.type==="affine")W=W.mixedAdd(g);else W=W.add(g)}}for(D=0;D<k;D++)h[D]=null;if(S)return W;else return W.toP()};function T(H,f){this.curve=H,this.type=f,this.precomputed=null}z.BasePoint=T,T.prototype.eq=function(){throw Error("Not implemented")},T.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(H,f){H=K.toArray(H,f);var w=this.p.byteLength();if((H[0]===4||H[0]===6||H[0]===7)&&H.length-1===2*w){if(H[0]===6)O(H[H.length-1]%2===0);else if(H[0]===7)O(H[H.length-1]%2===1);var k=this.point(H.slice(1,1+w),H.slice(1+w,1+2*w));return k}else if((H[0]===2||H[0]===3)&&H.length-1===w)return this.pointFromX(H.slice(1,1+w),H[0]===3);throw Error("Unknown point format")},T.prototype.encodeCompressed=function(H){return this.encode(H,!0)},T.prototype._encode=function(H){var f=this.curve.p.byteLength(),w=this.getX().toArray("be",f);if(H)return[this.getY().isEven()?2:3].concat(w);return[4].concat(w,this.getY().toArray("be",f))},T.prototype.encode=function(H,f){return K.encode(this._encode(f),H)},T.prototype.precompute=function(H){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,H),f.beta=this._getBeta(),this.precomputed=f,this},T.prototype._hasDoubles=function(H){if(!this.precomputed)return!1;var f=this.precomputed.doubles;if(!f)return!1;return f.points.length>=Math.ceil((H.bitLength()+1)/f.step)},T.prototype._getDoubles=function(H,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var w=[this],k=this;for(var S=0;S<f;S+=H){for(var N=0;N<H;N++)k=k.dbl();w.push(k)}return{step:H,points:w}},T.prototype._getNAFPoints=function(H){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var f=[this],w=(1<<H)-1,k=w===1?null:this.dbl();for(var S=1;S<w;S++)f[S]=f[S-1].add(k);return{wnd:H,points:f}},T.prototype._getBeta=function(){return null},T.prototype.dblp=function(H){var f=this;for(var w=0;w<H;w++)f=f.dbl();return f}}),Di=T$(($,q)=>{if(typeof Object.create==="function")q.exports=function(_,K){if(K)_.super_=K,_.prototype=Object.create(K.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(_,K){if(K){_.super_=K;var P=function(){};P.prototype=K.prototype,_.prototype=new P,_.prototype.constructor=_}}}),v8=T$(($,q)=>{try{if(_=(R0(),J6(h0)),typeof _.inherits!=="function")throw"";q.exports=_.inherits}catch(K){q.exports=Di()}var _}),Li=T$(($,q)=>{var _=M8(),K=N_(),P=v8(),Y=M2(),O=_.assert;function z(f){Y.call(this,"short",f),this.a=new K(f.a,16).toRed(this.red),this.b=new K(f.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(f),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}P(z,Y),q.exports=z,z.prototype._getEndomorphism=function(f){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var w,k;if(f.beta)w=new K(f.beta,16).toRed(this.red);else{var S=this._getEndoRoots(this.p);w=S[0].cmp(S[1])<0?S[0]:S[1],w=w.toRed(this.red)}if(f.lambda)k=new K(f.lambda,16);else{var N=this._getEndoRoots(this.n);if(this.g.mul(N[0]).x.cmp(this.g.x.redMul(w))===0)k=N[0];else k=N[1],O(this.g.mul(k).x.cmp(this.g.x.redMul(w))===0)}var h;if(f.basis)h=f.basis.map(function(C){return{a:new K(C.a,16),b:new K(C.b,16)}});else h=this._getEndoBasis(k);return{beta:w,lambda:k,basis:h}},z.prototype._getEndoRoots=function(f){var w=f===this.p?this.red:K.mont(f),k=new K(2).toRed(w).redInvm(),S=k.redNeg(),N=new K(3).toRed(w).redNeg().redSqrt().redMul(k),h=S.redAdd(N).fromRed(),C=S.redSub(N).fromRed();return[h,C]},z.prototype._getEndoBasis=function(f){var w=this.n.ushrn(Math.floor(this.n.bitLength()/2)),k=f,S=this.n.clone(),N=new K(1),h=new K(0),C=new K(0),I=new K(1),D,L,g,y,c,o,s,F=0,p,a;while(k.cmpn(0)!==0){var j=S.div(k);p=S.sub(j.mul(k)),a=C.sub(j.mul(N));var W=I.sub(j.mul(h));if(!g&&p.cmp(w)<0)D=s.neg(),L=N,g=p.neg(),y=a;else if(g&&++F===2)break;s=p,S=k,k=p,C=N,N=a,I=h,h=W}c=p.neg(),o=a;var X=g.sqr().add(y.sqr()),J=c.sqr().add(o.sqr());if(J.cmp(X)>=0)c=D,o=L;if(g.negative)g=g.neg(),y=y.neg();if(c.negative)c=c.neg(),o=o.neg();return[{a:g,b:y},{a:c,b:o}]},z.prototype._endoSplit=function(f){var w=this.endo.basis,k=w[0],S=w[1],N=S.b.mul(f).divRound(this.n),h=k.b.neg().mul(f).divRound(this.n),C=N.mul(k.a),I=h.mul(S.a),D=N.mul(k.b),L=h.mul(S.b),g=f.sub(C).sub(I),y=D.add(L).neg();return{k1:g,k2:y}},z.prototype.pointFromX=function(f,w){if(f=new K(f,16),!f.red)f=f.toRed(this.red);var k=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),S=k.redSqrt();if(S.redSqr().redSub(k).cmp(this.zero)!==0)throw Error("invalid point");var N=S.fromRed().isOdd();if(w&&!N||!w&&N)S=S.redNeg();return this.point(f,S)},z.prototype.validate=function(f){if(f.inf)return!0;var{x:w,y:k}=f,S=this.a.redMul(w),N=w.redSqr().redMul(w).redIAdd(S).redIAdd(this.b);return k.redSqr().redISub(N).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(f,w,k){var S=this._endoWnafT1,N=this._endoWnafT2;for(var h=0;h<f.length;h++){var C=this._endoSplit(w[h]),I=f[h],D=I._getBeta();if(C.k1.negative)C.k1.ineg(),I=I.neg(!0);if(C.k2.negative)C.k2.ineg(),D=D.neg(!0);S[h*2]=I,S[h*2+1]=D,N[h*2]=C.k1,N[h*2+1]=C.k2}var L=this._wnafMulAdd(1,S,N,h*2,k);for(var g=0;g<h*2;g++)S[g]=null,N[g]=null;return L};function T(f,w,k,S){if(Y.BasePoint.call(this,f,"affine"),w===null&&k===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new K(w,16),this.y=new K(k,16),S)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}}P(T,Y.BasePoint),z.prototype.point=function(f,w,k){return new T(this,f,w,k)},z.prototype.pointFromJSON=function(f,w){return T.fromJSON(this,f,w)},T.prototype._getBeta=function(){if(!this.curve.endo)return;var f=this.precomputed;if(f&&f.beta)return f.beta;var w=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var k=this.curve,S=function(N){return k.point(N.x.redMul(k.endo.beta),N.y)};f.beta=w,w.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(S)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(S)}}}return w},T.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)}}]},T.fromJSON=function(f,w,k){if(typeof w==="string")w=JSON.parse(w);var S=f.point(w[0],w[1],k);if(!w[2])return S;function N(C){return f.point(C[0],C[1],k)}var h=w[2];return S.precomputed={beta:null,doubles:h.doubles&&{step:h.doubles.step,points:[S].concat(h.doubles.points.map(N))},naf:h.naf&&{wnd:h.naf.wnd,points:[S].concat(h.naf.points.map(N))}},S},T.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)+">"},T.prototype.isInfinity=function(){return this.inf},T.prototype.add=function(f){if(this.inf)return f;if(f.inf)return this;if(this.eq(f))return this.dbl();if(this.neg().eq(f))return this.curve.point(null,null);if(this.x.cmp(f.x)===0)return this.curve.point(null,null);var w=this.y.redSub(f.y);if(w.cmpn(0)!==0)w=w.redMul(this.x.redSub(f.x).redInvm());var k=w.redSqr().redISub(this.x).redISub(f.x),S=w.redMul(this.x.redSub(k)).redISub(this.y);return this.curve.point(k,S)},T.prototype.dbl=function(){if(this.inf)return this;var f=this.y.redAdd(this.y);if(f.cmpn(0)===0)return this.curve.point(null,null);var w=this.curve.a,k=this.x.redSqr(),S=f.redInvm(),N=k.redAdd(k).redIAdd(k).redIAdd(w).redMul(S),h=N.redSqr().redISub(this.x.redAdd(this.x)),C=N.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,C)},T.prototype.getX=function(){return this.x.fromRed()},T.prototype.getY=function(){return this.y.fromRed()},T.prototype.mul=function(f){if(f=new K(f,16),this.isInfinity())return this;else if(this._hasDoubles(f))return this.curve._fixedNafMul(this,f);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[f]);else return this.curve._wnafMul(this,f)},T.prototype.mulAdd=function(f,w,k){var S=[this,w],N=[f,k];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,N);else return this.curve._wnafMulAdd(1,S,N,2)},T.prototype.jmulAdd=function(f,w,k){var S=[this,w],N=[f,k];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,N,!0);else return this.curve._wnafMulAdd(1,S,N,2,!0)},T.prototype.eq=function(f){return this===f||this.inf===f.inf&&(this.inf||this.x.cmp(f.x)===0&&this.y.cmp(f.y)===0)},T.prototype.neg=function(f){if(this.inf)return this;var w=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var k=this.precomputed,S=function(N){return N.neg()};w.precomputed={naf:k.naf&&{wnd:k.naf.wnd,points:k.naf.points.map(S)},doubles:k.doubles&&{step:k.doubles.step,points:k.doubles.points.map(S)}}}return w},T.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var f=this.curve.jpoint(this.x,this.y,this.curve.one);return f};function H(f,w,k,S){if(Y.BasePoint.call(this,f,"jacobian"),w===null&&k===null&&S===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new K(0);else this.x=new K(w,16),this.y=new K(k,16),this.z=new K(S,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}P(H,Y.BasePoint),z.prototype.jpoint=function(f,w,k){return new H(this,f,w,k)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),w=f.redSqr(),k=this.x.redMul(w),S=this.y.redMul(w).redMul(f);return this.curve.point(k,S)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var w=f.z.redSqr(),k=this.z.redSqr(),S=this.x.redMul(w),N=f.x.redMul(k),h=this.y.redMul(w.redMul(f.z)),C=f.y.redMul(k.redMul(this.z)),I=S.redSub(N),D=h.redSub(C);if(I.cmpn(0)===0)if(D.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var L=I.redSqr(),g=L.redMul(I),y=S.redMul(L),c=D.redSqr().redIAdd(g).redISub(y).redISub(y),o=D.redMul(y.redISub(c)).redISub(h.redMul(g)),s=this.z.redMul(f.z).redMul(I);return this.curve.jpoint(c,o,s)},H.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var w=this.z.redSqr(),k=this.x,S=f.x.redMul(w),N=this.y,h=f.y.redMul(w).redMul(this.z),C=k.redSub(S),I=N.redSub(h);if(C.cmpn(0)===0)if(I.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var D=C.redSqr(),L=D.redMul(C),g=k.redMul(D),y=I.redSqr().redIAdd(L).redISub(g).redISub(g),c=I.redMul(g.redISub(y)).redISub(N.redMul(L)),o=this.z.redMul(C);return this.curve.jpoint(y,c,o)},H.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var w;if(this.curve.zeroA||this.curve.threeA){var k=this;for(w=0;w<f;w++)k=k.dbl();return k}var S=this.curve.a,N=this.curve.tinv,h=this.x,C=this.y,I=this.z,D=I.redSqr().redSqr(),L=C.redAdd(C);for(w=0;w<f;w++){var g=h.redSqr(),y=L.redSqr(),c=y.redSqr(),o=g.redAdd(g).redIAdd(g).redIAdd(S.redMul(D)),s=h.redMul(y),F=o.redSqr().redISub(s.redAdd(s)),p=s.redISub(F),a=o.redMul(p);a=a.redIAdd(a).redISub(c);var j=L.redMul(I);if(w+1<f)D=D.redMul(c);h=F,I=j,L=a}return this.curve.jpoint(h,L.redMul(N),I)},H.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()},H.prototype._zeroDbl=function(){var f,w,k;if(this.zOne){var S=this.x.redSqr(),N=this.y.redSqr(),h=N.redSqr(),C=this.x.redAdd(N).redSqr().redISub(S).redISub(h);C=C.redIAdd(C);var I=S.redAdd(S).redIAdd(S),D=I.redSqr().redISub(C).redISub(C),L=h.redIAdd(h);L=L.redIAdd(L),L=L.redIAdd(L),f=D,w=I.redMul(C.redISub(D)).redISub(L),k=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),y=this.y.redSqr(),c=y.redSqr(),o=this.x.redAdd(y).redSqr().redISub(g).redISub(c);o=o.redIAdd(o);var s=g.redAdd(g).redIAdd(g),F=s.redSqr(),p=c.redIAdd(c);p=p.redIAdd(p),p=p.redIAdd(p),f=F.redISub(o).redISub(o),w=s.redMul(o.redISub(f)).redISub(p),k=this.y.redMul(this.z),k=k.redIAdd(k)}return this.curve.jpoint(f,w,k)},H.prototype._threeDbl=function(){var f,w,k;if(this.zOne){var S=this.x.redSqr(),N=this.y.redSqr(),h=N.redSqr(),C=this.x.redAdd(N).redSqr().redISub(S).redISub(h);C=C.redIAdd(C);var I=S.redAdd(S).redIAdd(S).redIAdd(this.curve.a),D=I.redSqr().redISub(C).redISub(C);f=D;var L=h.redIAdd(h);L=L.redIAdd(L),L=L.redIAdd(L),w=I.redMul(C.redISub(D)).redISub(L),k=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),y=this.y.redSqr(),c=this.x.redMul(y),o=this.x.redSub(g).redMul(this.x.redAdd(g));o=o.redAdd(o).redIAdd(o);var s=c.redIAdd(c);s=s.redIAdd(s);var F=s.redAdd(s);f=o.redSqr().redISub(F),k=this.y.redAdd(this.z).redSqr().redISub(y).redISub(g);var p=y.redSqr();p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p),w=o.redMul(s.redISub(f)).redISub(p)}return this.curve.jpoint(f,w,k)},H.prototype._dbl=function(){var f=this.curve.a,w=this.x,k=this.y,S=this.z,N=S.redSqr().redSqr(),h=w.redSqr(),C=k.redSqr(),I=h.redAdd(h).redIAdd(h).redIAdd(f.redMul(N)),D=w.redAdd(w);D=D.redIAdd(D);var L=D.redMul(C),g=I.redSqr().redISub(L.redAdd(L)),y=L.redISub(g),c=C.redSqr();c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var o=I.redMul(y).redISub(c),s=k.redAdd(k).redMul(S);return this.curve.jpoint(g,o,s)},H.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),w=this.y.redSqr(),k=this.z.redSqr(),S=w.redSqr(),N=f.redAdd(f).redIAdd(f),h=N.redSqr(),C=this.x.redAdd(w).redSqr().redISub(f).redISub(S);C=C.redIAdd(C),C=C.redAdd(C).redIAdd(C),C=C.redISub(h);var I=C.redSqr(),D=S.redIAdd(S);D=D.redIAdd(D),D=D.redIAdd(D),D=D.redIAdd(D);var L=N.redIAdd(C).redSqr().redISub(h).redISub(I).redISub(D),g=w.redMul(L);g=g.redIAdd(g),g=g.redIAdd(g);var y=this.x.redMul(I).redISub(g);y=y.redIAdd(y),y=y.redIAdd(y);var c=this.y.redMul(L.redMul(D.redISub(L)).redISub(C.redMul(I)));c=c.redIAdd(c),c=c.redIAdd(c),c=c.redIAdd(c);var o=this.z.redAdd(C).redSqr().redISub(k).redISub(I);return this.curve.jpoint(y,c,o)},H.prototype.mul=function(f,w){return f=new K(f,w),this.curve._wnafMul(this,f)},H.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var w=this.z.redSqr(),k=f.z.redSqr();if(this.x.redMul(k).redISub(f.x.redMul(w)).cmpn(0)!==0)return!1;var S=w.redMul(this.z),N=k.redMul(f.z);return this.y.redMul(N).redISub(f.y.redMul(S)).cmpn(0)===0},H.prototype.eqXToP=function(f){var w=this.z.redSqr(),k=f.toRed(this.curve.red).redMul(w);if(this.x.cmp(k)===0)return!0;var S=f.clone(),N=this.curve.redN.redMul(w);for(;;){if(S.iadd(this.curve.n),S.cmp(this.curve.p)>=0)return!1;if(k.redIAdd(N),this.x.cmp(k)===0)return!0}},H.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)+">"},H.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),bi=T$(($,q)=>{var _=N_(),K=v8(),P=M2(),Y=M8();function O(T){P.call(this,"mont",T),this.a=new _(T.a,16).toRed(this.red),this.b=new _(T.b,16).toRed(this.red),this.i4=new _(4).toRed(this.red).redInvm(),this.two=new _(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}K(O,P),q.exports=O,O.prototype.validate=function(T){var H=T.normalize().x,f=H.redSqr(),w=f.redMul(H).redAdd(f.redMul(this.a)).redAdd(H),k=w.redSqrt();return k.redSqr().cmp(w)===0};function z(T,H,f){if(P.BasePoint.call(this,T,"projective"),H===null&&f===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new _(H,16),this.z=new _(f,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}K(z,P.BasePoint),O.prototype.decodePoint=function(T,H){return this.point(Y.toArray(T,H),1)},O.prototype.point=function(T,H){return new z(this,T,H)},O.prototype.pointFromJSON=function(T){return z.fromJSON(this,T)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(T,H){return new z(T,H[0],H[1]||T.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 T=this.x.redAdd(this.z),H=T.redSqr(),f=this.x.redSub(this.z),w=f.redSqr(),k=H.redSub(w),S=H.redMul(w),N=k.redMul(w.redAdd(this.curve.a24.redMul(k)));return this.curve.point(S,N)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(T,H){var f=this.x.redAdd(this.z),w=this.x.redSub(this.z),k=T.x.redAdd(T.z),S=T.x.redSub(T.z),N=S.redMul(f),h=k.redMul(w),C=H.z.redMul(N.redAdd(h).redSqr()),I=H.x.redMul(N.redISub(h).redSqr());return this.curve.point(C,I)},z.prototype.mul=function(T){var H=T.clone(),f=this,w=this.curve.point(null,null),k=this;for(var S=[];H.cmpn(0)!==0;H.iushrn(1))S.push(H.andln(1));for(var N=S.length-1;N>=0;N--)if(S[N]===0)f=f.diffAdd(w,k),w=w.dbl();else w=f.diffAdd(w,k),f=f.dbl();return w},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(T){return this.getX().cmp(T.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()}}),gi=T$(($,q)=>{var _=M8(),K=N_(),P=v8(),Y=M2(),O=_.assert;function z(H){this.twisted=(H.a|0)!==1,this.mOneA=this.twisted&&(H.a|0)===-1,this.extended=this.mOneA,Y.call(this,"edwards",H),this.a=new K(H.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new K(H.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new K(H.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),O(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(H.c|0)===1}P(z,Y),q.exports=z,z.prototype._mulA=function(H){if(this.mOneA)return H.redNeg();else return this.a.redMul(H)},z.prototype._mulC=function(H){if(this.oneC)return H;else return this.c.redMul(H)},z.prototype.jpoint=function(H,f,w,k){return this.point(H,f,w,k)},z.prototype.pointFromX=function(H,f){if(H=new K(H,16),!H.red)H=H.toRed(this.red);var w=H.redSqr(),k=this.c2.redSub(this.a.redMul(w)),S=this.one.redSub(this.c2.redMul(this.d).redMul(w)),N=k.redMul(S.redInvm()),h=N.redSqrt();if(h.redSqr().redSub(N).cmp(this.zero)!==0)throw Error("invalid point");var C=h.fromRed().isOdd();if(f&&!C||!f&&C)h=h.redNeg();return this.point(H,h)},z.prototype.pointFromY=function(H,f){if(H=new K(H,16),!H.red)H=H.toRed(this.red);var w=H.redSqr(),k=w.redSub(this.c2),S=w.redMul(this.d).redMul(this.c2).redSub(this.a),N=k.redMul(S.redInvm());if(N.cmp(this.zero)===0)if(f)throw Error("invalid point");else return this.point(this.zero,H);var h=N.redSqrt();if(h.redSqr().redSub(N).cmp(this.zero)!==0)throw Error("invalid point");if(h.fromRed().isOdd()!==f)h=h.redNeg();return this.point(h,H)},z.prototype.validate=function(H){if(H.isInfinity())return!0;H.normalize();var f=H.x.redSqr(),w=H.y.redSqr(),k=f.redMul(this.a).redAdd(w),S=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(w)));return k.cmp(S)===0};function T(H,f,w,k,S){if(Y.BasePoint.call(this,H,"projective"),f===null&&w===null&&k===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 K(f,16),this.y=new K(w,16),this.z=k?new K(k,16):this.curve.one,this.t=S&&new K(S,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())}}}P(T,Y.BasePoint),z.prototype.pointFromJSON=function(H){return T.fromJSON(this,H)},z.prototype.point=function(H,f,w,k){return new T(this,H,f,w,k)},T.fromJSON=function(H,f){return new T(H,f[0],f[1],f[2])},T.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)+">"},T.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},T.prototype._extDbl=function(){var H=this.x.redSqr(),f=this.y.redSqr(),w=this.z.redSqr();w=w.redIAdd(w);var k=this.curve._mulA(H),S=this.x.redAdd(this.y).redSqr().redISub(H).redISub(f),N=k.redAdd(f),h=N.redSub(w),C=k.redSub(f),I=S.redMul(h),D=N.redMul(C),L=S.redMul(C),g=h.redMul(N);return this.curve.point(I,D,g,L)},T.prototype._projDbl=function(){var H=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),w=this.y.redSqr(),k,S,N,h,C,I;if(this.curve.twisted){h=this.curve._mulA(f);var D=h.redAdd(w);if(this.zOne)k=H.redSub(f).redSub(w).redMul(D.redSub(this.curve.two)),S=D.redMul(h.redSub(w)),N=D.redSqr().redSub(D).redSub(D);else C=this.z.redSqr(),I=D.redSub(C).redISub(C),k=H.redSub(f).redISub(w).redMul(I),S=D.redMul(h.redSub(w)),N=D.redMul(I)}else h=f.redAdd(w),C=this.curve._mulC(this.z).redSqr(),I=h.redSub(C).redSub(C),k=this.curve._mulC(H.redISub(h)).redMul(I),S=this.curve._mulC(h).redMul(f.redISub(w)),N=h.redMul(I);return this.curve.point(k,S,N)},T.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},T.prototype._extAdd=function(H){var f=this.y.redSub(this.x).redMul(H.y.redSub(H.x)),w=this.y.redAdd(this.x).redMul(H.y.redAdd(H.x)),k=this.t.redMul(this.curve.dd).redMul(H.t),S=this.z.redMul(H.z.redAdd(H.z)),N=w.redSub(f),h=S.redSub(k),C=S.redAdd(k),I=w.redAdd(f),D=N.redMul(h),L=C.redMul(I),g=N.redMul(I),y=h.redMul(C);return this.curve.point(D,L,y,g)},T.prototype._projAdd=function(H){var f=this.z.redMul(H.z),w=f.redSqr(),k=this.x.redMul(H.x),S=this.y.redMul(H.y),N=this.curve.d.redMul(k).redMul(S),h=w.redSub(N),C=w.redAdd(N),I=this.x.redAdd(this.y).redMul(H.x.redAdd(H.y)).redISub(k).redISub(S),D=f.redMul(h).redMul(I),L,g;if(this.curve.twisted)L=f.redMul(C).redMul(S.redSub(this.curve._mulA(k))),g=h.redMul(C);else L=f.redMul(C).redMul(S.redSub(k)),g=this.curve._mulC(h).redMul(C);return this.curve.point(D,L,g)},T.prototype.add=function(H){if(this.isInfinity())return H;if(H.isInfinity())return this;if(this.curve.extended)return this._extAdd(H);else return this._projAdd(H)},T.prototype.mul=function(H){if(this._hasDoubles(H))return this.curve._fixedNafMul(this,H);else return this.curve._wnafMul(this,H)},T.prototype.mulAdd=function(H,f,w){return this.curve._wnafMulAdd(1,[this,f],[H,w],2,!1)},T.prototype.jmulAdd=function(H,f,w){return this.curve._wnafMulAdd(1,[this,f],[H,w],2,!0)},T.prototype.normalize=function(){if(this.zOne)return this;var H=this.z.redInvm();if(this.x=this.x.redMul(H),this.y=this.y.redMul(H),this.t)this.t=this.t.redMul(H);return this.z=this.curve.one,this.zOne=!0,this},T.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},T.prototype.getX=function(){return this.normalize(),this.x.fromRed()},T.prototype.getY=function(){return this.normalize(),this.y.fromRed()},T.prototype.eq=function(H){return this===H||this.getX().cmp(H.getX())===0&&this.getY().cmp(H.getY())===0},T.prototype.eqXToP=function(H){var f=H.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;var w=H.clone(),k=this.curve.redN.redMul(this.z);for(;;){if(w.iadd(this.curve.n),w.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(k),this.x.cmp(f)===0)return!0}},T.prototype.toP=T.prototype.normalize,T.prototype.mixedAdd=T.prototype.add}),wM=T$(($)=>{var q=$;q.base=M2(),q.short=Li(),q.mont=bi(),q.edwards=gi()}),__=T$(($)=>{var q=PK(),_=v8();$.inherits=_;function K(W,X){if((W.charCodeAt(X)&64512)!==55296)return!1;if(X<0||X+1>=W.length)return!1;return(W.charCodeAt(X+1)&64512)===56320}function P(W,X){if(Array.isArray(W))return W.slice();if(!W)return[];var J=[];if(typeof W==="string"){if(!X){var Z=0;for(var V=0;V<W.length;V++){var M=W.charCodeAt(V);if(M<128)J[Z++]=M;else if(M<2048)J[Z++]=M>>6|192,J[Z++]=M&63|128;else if(K(W,V))M=65536+((M&1023)<<10)+(W.charCodeAt(++V)&1023),J[Z++]=M>>18|240,J[Z++]=M>>12&63|128,J[Z++]=M>>6&63|128,J[Z++]=M&63|128;else J[Z++]=M>>12|224,J[Z++]=M>>6&63|128,J[Z++]=M&63|128}}else if(X==="hex"){if(W=W.replace(/[^a-z0-9]+/ig,""),W.length%2!==0)W="0"+W;for(V=0;V<W.length;V+=2)J.push(parseInt(W[V]+W[V+1],16))}}else for(V=0;V<W.length;V++)J[V]=W[V]|0;return J}$.toArray=P;function Y(W){var X="";for(var J=0;J<W.length;J++)X+=T(W[J].toString(16));return X}$.toHex=Y;function O(W){var X=W>>>24|W>>>8&65280|W<<8&16711680|(W&255)<<24;return X>>>0}$.htonl=O;function z(W,X){var J="";for(var Z=0;Z<W.length;Z++){var V=W[Z];if(X==="little")V=O(V);J+=H(V.toString(16))}return J}$.toHex32=z;function T(W){if(W.length===1)return"0"+W;else return W}$.zero2=T;function H(W){if(W.length===7)return"0"+W;else if(W.length===6)return"00"+W;else if(W.length===5)return"000"+W;else if(W.length===4)return"0000"+W;else if(W.length===3)return"00000"+W;else if(W.length===2)return"000000"+W;else if(W.length===1)return"0000000"+W;else return W}$.zero8=H;function f(W,X,J,Z){var V=J-X;q(V%4===0);var M=Array(V/4);for(var A=0,v=X;A<M.length;A++,v+=4){var G;if(Z==="big")G=W[v]<<24|W[v+1]<<16|W[v+2]<<8|W[v+3];else G=W[v+3]<<24|W[v+2]<<16|W[v+1]<<8|W[v];M[A]=G>>>0}return M}$.join32=f;function w(W,X){var J=Array(W.length*4);for(var Z=0,V=0;Z<W.length;Z++,V+=4){var M=W[Z];if(X==="big")J[V]=M>>>24,J[V+1]=M>>>16&255,J[V+2]=M>>>8&255,J[V+3]=M&255;else J[V+3]=M>>>24,J[V+2]=M>>>16&255,J[V+1]=M>>>8&255,J[V]=M&255}return J}$.split32=w;function k(W,X){return W>>>X|W<<32-X}$.rotr32=k;function S(W,X){return W<<X|W>>>32-X}$.rotl32=S;function N(W,X){return W+X>>>0}$.sum32=N;function h(W,X,J){return W+X+J>>>0}$.sum32_3=h;function C(W,X,J,Z){return W+X+J+Z>>>0}$.sum32_4=C;function I(W,X,J,Z,V){return W+X+J+Z+V>>>0}$.sum32_5=I;function D(W,X,J,Z){var V=W[X],M=W[X+1],A=Z+M>>>0,v=(A<Z?1:0)+J+V;W[X]=v>>>0,W[X+1]=A}$.sum64=D;function L(W,X,J,Z){var V=X+Z>>>0,M=(V<X?1:0)+W+J;return M>>>0}$.sum64_hi=L;function g(W,X,J,Z){var V=X+Z;return V>>>0}$.sum64_lo=g;function y(W,X,J,Z,V,M,A,v){var G=0,R=X;R=R+Z>>>0,G+=R<X?1:0,R=R+M>>>0,G+=R<M?1:0,R=R+v>>>0,G+=R<v?1:0;var E=W+J+V+A+G;return E>>>0}$.sum64_4_hi=y;function c(W,X,J,Z,V,M,A,v){var G=X+Z+M+v;return G>>>0}$.sum64_4_lo=c;function o(W,X,J,Z,V,M,A,v,G,R){var E=0,b=X;b=b+Z>>>0,E+=b<X?1:0,b=b+M>>>0,E+=b<M?1:0,b=b+v>>>0,E+=b<v?1:0,b=b+R>>>0,E+=b<R?1:0;var x=W+J+V+A+G+E;return x>>>0}$.sum64_5_hi=o;function s(W,X,J,Z,V,M,A,v,G,R){var E=X+Z+M+v+R;return E>>>0}$.sum64_5_lo=s;function F(W,X,J){var Z=X<<32-J|W>>>J;return Z>>>0}$.rotr64_hi=F;function p(W,X,J){var Z=W<<32-J|X>>>J;return Z>>>0}$.rotr64_lo=p;function a(W,X,J){return W>>>J}$.shr64_hi=a;function j(W,X,J){var Z=W<<32-J|X>>>J;return Z>>>0}$.shr64_lo=j}),P1=T$(($)=>{var q=__(),_=PK();function K(){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=K,K.prototype.update=function(P,Y){if(P=q.toArray(P,Y),!this.pending)this.pending=P;else this.pending=this.pending.concat(P);if(this.pendingTotal+=P.length,this.pending.length>=this._delta8){P=this.pending;var O=P.length%this._delta8;if(this.pending=P.slice(P.length-O,P.length),this.pending.length===0)this.pending=null;P=q.join32(P,0,P.length-O,this.endian);for(var z=0;z<P.length;z+=this._delta32)this._update(P,z,z+this._delta32)}return this},K.prototype.digest=function(P){return this.update(this._pad()),_(this.pending===null),this._digest(P)},K.prototype._pad=function(){var P=this.pendingTotal,Y=this._delta8,O=Y-(P+this.padLength)%Y,z=Array(O+this.padLength);z[0]=128;for(var T=1;T<O;T++)z[T]=0;if(P<<=3,this.endian==="big"){for(var H=8;H<this.padLength;H++)z[T++]=0;z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=P>>>24&255,z[T++]=P>>>16&255,z[T++]=P>>>8&255,z[T++]=P&255}else{z[T++]=P&255,z[T++]=P>>>8&255,z[T++]=P>>>16&255,z[T++]=P>>>24&255,z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=0;for(H=8;H<this.padLength;H++)z[T++]=0}return z}}),fM=T$(($)=>{var q=__(),_=q.rotr32;function K(w,k,S,N){if(w===0)return P(k,S,N);if(w===1||w===3)return O(k,S,N);if(w===2)return Y(k,S,N)}$.ft_1=K;function P(w,k,S){return w&k^~w&S}$.ch32=P;function Y(w,k,S){return w&k^w&S^k&S}$.maj32=Y;function O(w,k,S){return w^k^S}$.p32=O;function z(w){return _(w,2)^_(w,13)^_(w,22)}$.s0_256=z;function T(w){return _(w,6)^_(w,11)^_(w,25)}$.s1_256=T;function H(w){return _(w,7)^_(w,18)^w>>>3}$.g0_256=H;function f(w){return _(w,17)^_(w,19)^w>>>10}$.g1_256=f}),yi=T$(($,q)=>{var _=__(),K=P1(),P=fM(),Y=_.rotl32,O=_.sum32,z=_.sum32_5,T=P.ft_1,H=K.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function w(){if(!(this instanceof w))return new w;H.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}_.inherits(w,H),q.exports=w,w.blockSize=512,w.outSize=160,w.hmacStrength=80,w.padLength=64,w.prototype._update=function(k,S){var N=this.W;for(var h=0;h<16;h++)N[h]=k[S+h];for(;h<N.length;h++)N[h]=Y(N[h-3]^N[h-8]^N[h-14]^N[h-16],1);var C=this.h[0],I=this.h[1],D=this.h[2],L=this.h[3],g=this.h[4];for(h=0;h<N.length;h++){var y=~~(h/20),c=z(Y(C,5),T(y,I,D,L),g,N[h],f[y]);g=L,L=D,D=Y(I,30),I=C,C=c}this.h[0]=O(this.h[0],C),this.h[1]=O(this.h[1],I),this.h[2]=O(this.h[2],D),this.h[3]=O(this.h[3],L),this.h[4]=O(this.h[4],g)},w.prototype._digest=function(k){if(k==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")}}),ZM=T$(($,q)=>{var _=__(),K=P1(),P=fM(),Y=PK(),O=_.sum32,z=_.sum32_4,T=_.sum32_5,H=P.ch32,f=P.maj32,w=P.s0_256,k=P.s1_256,S=P.g0_256,N=P.g1_256,h=K.BlockHash,C=[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;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=C,this.W=Array(64)}_.inherits(I,h),q.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(D,L){var g=this.W;for(var y=0;y<16;y++)g[y]=D[L+y];for(;y<g.length;y++)g[y]=z(N(g[y-2]),g[y-7],S(g[y-15]),g[y-16]);var c=this.h[0],o=this.h[1],s=this.h[2],F=this.h[3],p=this.h[4],a=this.h[5],j=this.h[6],W=this.h[7];Y(this.k.length===g.length);for(y=0;y<g.length;y++){var X=T(W,k(p),H(p,a,j),this.k[y],g[y]),J=O(w(c),f(c,o,s));W=j,j=a,a=p,p=O(F,X),F=s,s=o,o=c,c=O(X,J)}this.h[0]=O(this.h[0],c),this.h[1]=O(this.h[1],o),this.h[2]=O(this.h[2],s),this.h[3]=O(this.h[3],F),this.h[4]=O(this.h[4],p),this.h[5]=O(this.h[5],a),this.h[6]=O(this.h[6],j),this.h[7]=O(this.h[7],W)},I.prototype._digest=function(D){if(D==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")}}),ui=T$(($,q)=>{var _=__(),K=ZM();function P(){if(!(this instanceof P))return new P;K.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}_.inherits(P,K),q.exports=P,P.blockSize=512,P.outSize=224,P.hmacStrength=192,P.padLength=64,P.prototype._digest=function(Y){if(Y==="hex")return _.toHex32(this.h.slice(0,7),"big");else return _.split32(this.h.slice(0,7),"big")}}),XM=T$(($,q)=>{var _=__(),K=P1(),P=PK(),Y=_.rotr64_hi,O=_.rotr64_lo,z=_.shr64_hi,T=_.shr64_lo,H=_.sum64,f=_.sum64_hi,w=_.sum64_lo,k=_.sum64_4_hi,S=_.sum64_4_lo,N=_.sum64_5_hi,h=_.sum64_5_lo,C=K.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;C.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)}_.inherits(D,C),q.exports=D,D.blockSize=1024,D.outSize=512,D.hmacStrength=192,D.padLength=128,D.prototype._prepareBlock=function(J,Z){var V=this.W;for(var M=0;M<32;M++)V[M]=J[Z+M];for(;M<V.length;M+=2){var A=W(V[M-4],V[M-3]),v=X(V[M-4],V[M-3]),G=V[M-14],R=V[M-13],E=a(V[M-30],V[M-29]),b=j(V[M-30],V[M-29]),x=V[M-32],l=V[M-31];V[M]=k(A,v,G,R,E,b,x,l),V[M+1]=S(A,v,G,R,E,b,x,l)}},D.prototype._update=function(J,Z){this._prepareBlock(J,Z);var V=this.W,M=this.h[0],A=this.h[1],v=this.h[2],G=this.h[3],R=this.h[4],E=this.h[5],b=this.h[6],x=this.h[7],l=this.h[8],Q=this.h[9],f$=this.h[10],q$=this.h[11],B=this.h[12],v$=this.h[13],e=this.h[14],P$=this.h[15];P(this.k.length===V.length);for(var o$=0;o$<V.length;o$+=2){var m=e,r=P$,J$=F(l,Q),$$=p(l,Q),_$=L(l,Q,f$,q$,B,v$),O$=g(l,Q,f$,q$,B,v$),d=this.k[o$],n=this.k[o$+1],H$=V[o$],t=V[o$+1],U=N(m,r,J$,$$,_$,O$,d,n,H$,t),A$=h(m,r,J$,$$,_$,O$,d,n,H$,t);m=o(M,A),r=s(M,A),J$=y(M,A,v,G,R,E),$$=c(M,A,v,G,R,E);var W$=f(m,r,J$,$$),z$=w(m,r,J$,$$);e=B,P$=v$,B=f$,v$=q$,f$=l,q$=Q,l=f(b,x,U,A$),Q=w(x,x,U,A$),b=R,x=E,R=v,E=G,v=M,G=A,M=f(U,A$,W$,z$),A=w(U,A$,W$,z$)}H(this.h,0,M,A),H(this.h,2,v,G),H(this.h,4,R,E),H(this.h,6,b,x),H(this.h,8,l,Q),H(this.h,10,f$,q$),H(this.h,12,B,v$),H(this.h,14,e,P$)},D.prototype._digest=function(J){if(J==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")};function L(J,Z,V,M,A){var v=J&V^~J&A;if(v<0)v+=4294967296;return v}function g(J,Z,V,M,A,v){var G=Z&M^~Z&v;if(G<0)G+=4294967296;return G}function y(J,Z,V,M,A){var v=J&V^J&A^V&A;if(v<0)v+=4294967296;return v}function c(J,Z,V,M,A,v){var G=Z&M^Z&v^M&v;if(G<0)G+=4294967296;return G}function o(J,Z){var V=Y(J,Z,28),M=Y(Z,J,2),A=Y(Z,J,7),v=V^M^A;if(v<0)v+=4294967296;return v}function s(J,Z){var V=O(J,Z,28),M=O(Z,J,2),A=O(Z,J,7),v=V^M^A;if(v<0)v+=4294967296;return v}function F(J,Z){var V=Y(J,Z,14),M=Y(J,Z,18),A=Y(Z,J,9),v=V^M^A;if(v<0)v+=4294967296;return v}function p(J,Z){var V=O(J,Z,14),M=O(J,Z,18),A=O(Z,J,9),v=V^M^A;if(v<0)v+=4294967296;return v}function a(J,Z){var V=Y(J,Z,1),M=Y(J,Z,8),A=z(J,Z,7),v=V^M^A;if(v<0)v+=4294967296;return v}function j(J,Z){var V=O(J,Z,1),M=O(J,Z,8),A=T(J,Z,7),v=V^M^A;if(v<0)v+=4294967296;return v}function W(J,Z){var V=Y(J,Z,19),M=Y(Z,J,29),A=z(J,Z,6),v=V^M^A;if(v<0)v+=4294967296;return v}function X(J,Z){var V=O(J,Z,19),M=O(Z,J,29),A=T(J,Z,6),v=V^M^A;if(v<0)v+=4294967296;return v}}),xi=T$(($,q)=>{var _=__(),K=XM();function P(){if(!(this instanceof P))return new P;K.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}_.inherits(P,K),q.exports=P,P.blockSize=1024,P.outSize=384,P.hmacStrength=192,P.padLength=128,P.prototype._digest=function(Y){if(Y==="hex")return _.toHex32(this.h.slice(0,12),"big");else return _.split32(this.h.slice(0,12),"big")}}),pi=T$(($)=>{$.sha1=yi(),$.sha224=ui(),$.sha256=ZM(),$.sha384=xi(),$.sha512=XM()}),ci=T$(($)=>{var q=__(),_=P1(),K=q.rotl32,P=q.sum32,Y=q.sum32_3,O=q.sum32_4,z=_.BlockHash;function T(){if(!(this instanceof T))return new T;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}q.inherits(T,z),$.ripemd160=T,T.blockSize=512,T.outSize=160,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(C,I){var D=this.h[0],L=this.h[1],g=this.h[2],y=this.h[3],c=this.h[4],o=D,s=L,F=g,p=y,a=c;for(var j=0;j<80;j++){var W=P(K(O(D,H(j,L,g,y),C[k[j]+I],f(j)),N[j]),c);D=c,c=y,y=K(g,10),g=L,L=W,W=P(K(O(o,H(79-j,s,F,p),C[S[j]+I],w(j)),h[j]),a),o=a,a=p,p=K(F,10),F=s,s=W}W=Y(this.h[1],g,p),this.h[1]=Y(this.h[2],y,a),this.h[2]=Y(this.h[3],c,o),this.h[3]=Y(this.h[4],D,s),this.h[4]=Y(this.h[0],L,F),this.h[0]=W},T.prototype._digest=function(C){if(C==="hex")return q.toHex32(this.h,"little");else return q.split32(this.h,"little")};function H(C,I,D,L){if(C<=15)return I^D^L;else if(C<=31)return I&D|~I&L;else if(C<=47)return(I|~D)^L;else if(C<=63)return I&L|D&~L;else return I^(D|~L)}function f(C){if(C<=15)return 0;else if(C<=31)return 1518500249;else if(C<=47)return 1859775393;else if(C<=63)return 2400959708;else return 2840853838}function w(C){if(C<=15)return 1352829926;else if(C<=31)return 1548603684;else if(C<=47)return 1836072691;else if(C<=63)return 2053994217;else return 0}var k=[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],S=[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],N=[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],h=[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]}),mi=T$(($,q)=>{var _=__(),K=PK();function P(Y,O,z){if(!(this instanceof P))return new P(Y,O,z);this.Hash=Y,this.blockSize=Y.blockSize/8,this.outSize=Y.outSize/8,this.inner=null,this.outer=null,this._init(_.toArray(O,z))}q.exports=P,P.prototype._init=function(Y){if(Y.length>this.blockSize)Y=new this.Hash().update(Y).digest();K(Y.length<=this.blockSize);for(var O=Y.length;O<this.blockSize;O++)Y.push(0);for(O=0;O<Y.length;O++)Y[O]^=54;this.inner=new this.Hash().update(Y);for(O=0;O<Y.length;O++)Y[O]^=106;this.outer=new this.Hash().update(Y)},P.prototype.update=function(Y,O){return this.inner.update(Y,O),this},P.prototype.digest=function(Y){return this.outer.update(this.inner.digest()),this.outer.digest(Y)}}),CH=T$(($)=>{var q=$;q.utils=__(),q.common=P1(),q.sha=pi(),q.ripemd=ci(),q.hmac=mi(),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}),di=T$(($,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"]]}}}),EH=T$(($)=>{var q=$,_=CH(),K=wM(),P=M8(),Y=P.assert;function O(H){if(H.type==="short")this.curve=new K.short(H);else if(H.type==="edwards")this.curve=new K.edwards(H);else this.curve=new K.mont(H);this.g=this.curve.g,this.n=this.curve.n,this.hash=H.hash,Y(this.g.validate(),"Invalid curve"),Y(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}q.PresetCurve=O;function z(H,f){Object.defineProperty(q,H,{configurable:!0,enumerable:!0,get:function(){var w=new O(f);return Object.defineProperty(q,H,{configurable:!0,enumerable:!0,value:w}),w}})}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:_.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:_.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:_.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:_.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:_.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:_.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:_.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var T;try{T=di()}catch(H){T=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:_.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",T]})}),li=T$(($,q)=>{var _=CH(),K=HM(),P=PK();function Y(O){if(!(this instanceof Y))return new Y(O);this.hash=O.hash,this.predResist=!!O.predResist,this.outLen=this.hash.outSize,this.minEntropy=O.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=K.toArray(O.entropy,O.entropyEnc||"hex"),T=K.toArray(O.nonce,O.nonceEnc||"hex"),H=K.toArray(O.pers,O.persEnc||"hex");P(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,T,H)}q.exports=Y,Y.prototype._init=function(O,z,T){var H=O.concat(z).concat(T);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(H),this._reseed=1,this.reseedInterval=281474976710656},Y.prototype._hmac=function(){return new _.hmac(this.hash,this.K)},Y.prototype._update=function(O){var z=this._hmac().update(this.V).update([0]);if(O)z=z.update(O);if(this.K=z.digest(),this.V=this._hmac().update(this.V).digest(),!O)return;this.K=this._hmac().update(this.V).update([1]).update(O).digest(),this.V=this._hmac().update(this.V).digest()},Y.prototype.reseed=function(O,z,T,H){if(typeof z!=="string")H=T,T=z,z=null;O=K.toArray(O,z),T=K.toArray(T,H),P(O.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(O.concat(T||[])),this._reseed=1},Y.prototype.generate=function(O,z,T,H){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof z!=="string")H=T,T=z,z=null;if(T)T=K.toArray(T,H||"hex"),this._update(T);var f=[];while(f.length<O)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var w=f.slice(0,O);return this._update(T),this._reseed++,K.encode(w,z)}}),ri=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert;function Y(O,z){if(this.ec=O,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=Y,Y.fromPublic=function(O,z,T){if(z instanceof Y)return z;return new Y(O,{pub:z,pubEnc:T})},Y.fromPrivate=function(O,z,T){if(z instanceof Y)return z;return new Y(O,{priv:z,privEnc:T})},Y.prototype.validate=function(){var O=this.getPublic();if(O.isInfinity())return{result:!1,reason:"Invalid public key"};if(!O.validate())return{result:!1,reason:"Public key is not a point"};if(!O.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},Y.prototype.getPublic=function(O,z){if(typeof O==="string")z=O,O=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!z)return this.pub;return this.pub.encode(z,O)},Y.prototype.getPrivate=function(O){if(O==="hex")return this.priv.toString(16,2);else return this.priv},Y.prototype._importPrivate=function(O,z){this.priv=new _(O,z||16),this.priv=this.priv.umod(this.ec.curve.n)},Y.prototype._importPublic=function(O,z){if(O.x||O.y){if(this.ec.curve.type==="mont")P(O.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")P(O.x&&O.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(O.x,O.y);return}this.pub=this.ec.curve.decodePoint(O,z)},Y.prototype.derive=function(O){if(!O.validate())P(O.validate(),"public point not validated");return O.mul(this.priv).getX()},Y.prototype.sign=function(O,z,T){return this.ec.sign(O,this,z,T)},Y.prototype.verify=function(O,z,T){return this.ec.verify(O,z,this,void 0,T)},Y.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),oi=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert;function Y(f,w){if(f instanceof Y)return f;if(this._importDER(f,w))return;if(P(f.r&&f.s,"Signature without r or s"),this.r=new _(f.r,16),this.s=new _(f.s,16),f.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=f.recoveryParam}q.exports=Y;function O(){this.place=0}function z(f,w){var k=f[w.place++];if(!(k&128))return k;var S=k&15;if(S===0||S>4)return!1;if(f[w.place]===0)return!1;var N=0;for(var h=0,C=w.place;h<S;h++,C++)N<<=8,N|=f[C],N>>>=0;if(N<=127)return!1;return w.place=C,N}function T(f){var w=0,k=f.length-1;while(!f[w]&&!(f[w+1]&128)&&w<k)w++;if(w===0)return f;return f.slice(w)}Y.prototype._importDER=function(f,w){f=K.toArray(f,w);var k=new O;if(f[k.place++]!==48)return!1;var S=z(f,k);if(S===!1)return!1;if(S+k.place!==f.length)return!1;if(f[k.place++]!==2)return!1;var N=z(f,k);if(N===!1)return!1;if((f[k.place]&128)!==0)return!1;var h=f.slice(k.place,N+k.place);if(k.place+=N,f[k.place++]!==2)return!1;var C=z(f,k);if(C===!1)return!1;if(f.length!==C+k.place)return!1;if((f[k.place]&128)!==0)return!1;var I=f.slice(k.place,C+k.place);if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;return this.r=new _(h),this.s=new _(I),this.recoveryParam=null,!0};function H(f,w){if(w<128){f.push(w);return}var k=1+(Math.log(w)/Math.LN2>>>3);f.push(k|128);while(--k)f.push(w>>>(k<<3)&255);f.push(w)}Y.prototype.toDER=function(f){var w=this.r.toArray(),k=this.s.toArray();if(w[0]&128)w=[0].concat(w);if(k[0]&128)k=[0].concat(k);w=T(w),k=T(k);while(!k[0]&&!(k[1]&128))k=k.slice(1);var S=[2];H(S,w.length),S=S.concat(w),S.push(2),H(S,k.length);var N=S.concat(k),h=[48];return H(h,N.length),h=h.concat(N),K.encode(h,f)}}),ni=T$(($,q)=>{var _=N_(),K=li(),P=M8(),Y=EH(),O=TM(),z=P.assert,T=ri(),H=oi();function f(w){if(!(this instanceof f))return new f(w);if(typeof w==="string")z(Object.prototype.hasOwnProperty.call(Y,w),"Unknown curve "+w),w=Y[w];if(w instanceof Y.PresetCurve)w={curve:w};this.curve=w.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=w.curve.g,this.g.precompute(w.curve.n.bitLength()+1),this.hash=w.hash||w.curve.hash}q.exports=f,f.prototype.keyPair=function(w){return new T(this,w)},f.prototype.keyFromPrivate=function(w,k){return T.fromPrivate(this,w,k)},f.prototype.keyFromPublic=function(w,k){return T.fromPublic(this,w,k)},f.prototype.genKeyPair=function(w){if(!w)w={};var k=new K({hash:this.hash,pers:w.pers,persEnc:w.persEnc||"utf8",entropy:w.entropy||O(this.hash.hmacStrength),entropyEnc:w.entropy&&w.entropyEnc||"utf8",nonce:this.n.toArray()}),S=this.n.byteLength(),N=this.n.sub(new _(2));for(;;){var h=new _(k.generate(S));if(h.cmp(N)>0)continue;return h.iaddn(1),this.keyFromPrivate(h)}},f.prototype._truncateToN=function(w,k,S){var N;if(_.isBN(w)||typeof w==="number")w=new _(w,16),N=w.byteLength();else if(typeof w==="object")N=w.length,w=new _(w,16);else{var h=w.toString();N=h.length+1>>>1,w=new _(h,16)}if(typeof S!=="number")S=N*8;var C=S-this.n.bitLength();if(C>0)w=w.ushrn(C);if(!k&&w.cmp(this.n)>=0)return w.sub(this.n);else return w},f.prototype.sign=function(w,k,S,N){if(typeof S==="object")N=S,S=null;if(!N)N={};if(typeof w!=="string"&&typeof w!=="number"&&!_.isBN(w)){z(typeof w==="object"&&w&&typeof w.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(w.length>>>0===w.length);for(var h=0;h<w.length;h++)z((w[h]&255)===w[h])}k=this.keyFromPrivate(k,S),w=this._truncateToN(w,!1,N.msgBitLength),z(!w.isNeg(),"Can not sign a negative message");var C=this.n.byteLength(),I=k.getPrivate().toArray("be",C),D=w.toArray("be",C);z(new _(D).eq(w),"Can not sign message");var L=new K({hash:this.hash,entropy:I,nonce:D,pers:N.pers,persEnc:N.persEnc||"utf8"}),g=this.n.sub(new _(1));for(var y=0;;y++){var c=N.k?N.k(y):new _(L.generate(this.n.byteLength()));if(c=this._truncateToN(c,!0),c.cmpn(1)<=0||c.cmp(g)>=0)continue;var o=this.g.mul(c);if(o.isInfinity())continue;var s=o.getX(),F=s.umod(this.n);if(F.cmpn(0)===0)continue;var p=c.invm(this.n).mul(F.mul(k.getPrivate()).iadd(w));if(p=p.umod(this.n),p.cmpn(0)===0)continue;var a=(o.getY().isOdd()?1:0)|(s.cmp(F)!==0?2:0);if(N.canonical&&p.cmp(this.nh)>0)p=this.n.sub(p),a^=1;return new H({r:F,s:p,recoveryParam:a})}},f.prototype.verify=function(w,k,S,N,h){if(!h)h={};w=this._truncateToN(w,!1,h.msgBitLength),S=this.keyFromPublic(S,N),k=new H(k,"hex");var{r:C,s:I}=k;if(C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;var D=I.invm(this.n),L=D.mul(w).umod(this.n),g=D.mul(C).umod(this.n),y;if(!this.curve._maxwellTrick){if(y=this.g.mulAdd(L,S.getPublic(),g),y.isInfinity())return!1;return y.getX().umod(this.n).cmp(C)===0}if(y=this.g.jmulAdd(L,S.getPublic(),g),y.isInfinity())return!1;return y.eqXToP(C)},f.prototype.recoverPubKey=function(w,k,S,N){z((3&S)===S,"The recovery param is more than two bits"),k=new H(k,N);var h=this.n,C=new _(w),I=k.r,D=k.s,L=S&1,g=S>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw Error("Unable to find sencond key candinate");if(g)I=this.curve.pointFromX(I.add(this.curve.n),L);else I=this.curve.pointFromX(I,L);var y=k.r.invm(h),c=h.sub(C).mul(y).umod(h),o=D.mul(y).umod(h);return this.g.mulAdd(c,I,o)},f.prototype.getKeyRecoveryParam=function(w,k,S,N){if(k=new H(k,N),k.recoveryParam!==null)return k.recoveryParam;for(var h=0;h<4;h++){var C;try{C=this.recoverPubKey(w,k,h)}catch(I){continue}if(C.eq(S))return h}throw Error("Unable to find valid recovery factor")}}),ii=T$(($,q)=>{var _=M8(),K=_.assert,P=_.parseBytes,Y=_.cachedProperty;function O(z,T){if(this.eddsa=z,this._secret=P(T.secret),z.isPoint(T.pub))this._pub=T.pub;else this._pubBytes=P(T.pub)}O.fromPublic=function(z,T){if(T instanceof O)return T;return new O(z,{pub:T})},O.fromSecret=function(z,T){if(T instanceof O)return T;return new O(z,{secret:T})},O.prototype.secret=function(){return this._secret},Y(O,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Y(O,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),Y(O,"privBytes",function(){var z=this.eddsa,T=this.hash(),H=z.encodingLength-1,f=T.slice(0,z.encodingLength);return f[0]&=248,f[H]&=127,f[H]|=64,f}),Y(O,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Y(O,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Y(O,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),O.prototype.sign=function(z){return K(this._secret,"KeyPair can only verify"),this.eddsa.sign(z,this)},O.prototype.verify=function(z,T){return this.eddsa.verify(z,T,this)},O.prototype.getSecret=function(z){return K(this._secret,"KeyPair is public only"),_.encode(this.secret(),z)},O.prototype.getPublic=function(z){return _.encode(this.pubBytes(),z)},q.exports=O}),Bi=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert,Y=K.cachedProperty,O=K.parseBytes;function z(T,H){if(this.eddsa=T,typeof H!=="object")H=O(H);if(Array.isArray(H))P(H.length===T.encodingLength*2,"Signature has invalid size"),H={R:H.slice(0,T.encodingLength),S:H.slice(T.encodingLength)};if(P(H.R&&H.S,"Signature without R or S"),T.isPoint(H.R))this._R=H.R;if(H.S instanceof _)this._S=H.S;this._Rencoded=Array.isArray(H.R)?H.R:H.Rencoded,this._Sencoded=Array.isArray(H.S)?H.S:H.Sencoded}Y(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Y(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Y(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Y(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return K.encode(this.toBytes(),"hex").toUpperCase()},q.exports=z}),ti=T$(($,q)=>{var _=CH(),K=EH(),P=M8(),Y=P.assert,O=P.parseBytes,z=ii(),T=Bi();function H(f){if(Y(f==="ed25519","only tested with ed25519 so far"),!(this instanceof H))return new H(f);f=K[f].curve,this.curve=f,this.g=f.g,this.g.precompute(f.n.bitLength()+1),this.pointClass=f.point().constructor,this.encodingLength=Math.ceil(f.n.bitLength()/8),this.hash=_.sha512}q.exports=H,H.prototype.sign=function(f,w){f=O(f);var k=this.keyFromSecret(w),S=this.hashInt(k.messagePrefix(),f),N=this.g.mul(S),h=this.encodePoint(N),C=this.hashInt(h,k.pubBytes(),f).mul(k.priv()),I=S.add(C).umod(this.curve.n);return this.makeSignature({R:N,S:I,Rencoded:h})},H.prototype.verify=function(f,w,k){if(f=O(f),w=this.makeSignature(w),w.S().gte(w.eddsa.curve.n)||w.S().isNeg())return!1;var S=this.keyFromPublic(k),N=this.hashInt(w.Rencoded(),S.pubBytes(),f),h=this.g.mul(w.S()),C=w.R().add(S.pub().mul(N));return C.eq(h)},H.prototype.hashInt=function(){var f=this.hash();for(var w=0;w<arguments.length;w++)f.update(arguments[w]);return P.intFromLE(f.digest()).umod(this.curve.n)},H.prototype.keyFromPublic=function(f){return z.fromPublic(this,f)},H.prototype.keyFromSecret=function(f){return z.fromSecret(this,f)},H.prototype.makeSignature=function(f){if(f instanceof T)return f;return new T(this,f)},H.prototype.encodePoint=function(f){var w=f.getY().toArray("le",this.encodingLength);return w[this.encodingLength-1]|=f.getX().isOdd()?128:0,w},H.prototype.decodePoint=function(f){f=P.parseBytes(f);var w=f.length-1,k=f.slice(0,w).concat(f[w]&-129),S=(f[w]&128)!==0,N=P.intFromLE(k);return this.curve.pointFromY(N,S)},H.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},H.prototype.decodeInt=function(f){return P.intFromLE(f)},H.prototype.isPoint=function(f){return f instanceof this.pointClass}}),Ui=T$(($)=>{var q=$;q.version=Ii().version,q.utils=M8(),q.rand=TM(),q.curve=wM(),q.curves=EH(),q.ec=ni(),q.eddsa=ti()}),Fi=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,V,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(V=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(V=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,V=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,V=Math.min(j.length,X);for(var M=W;M<V;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var V=j.length-X,M=V%J,A=Math.min(V,V-M)+X,v=0;for(var G=X;G<A;G+=J)if(v=f(j,G,G+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,G,j.length,W);for(G=0;G<M;G++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var V=0;V<this.length;V++){var M=this.words[V],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,V--;if(Z!==0||V!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],G=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(G).toString(j);if(R=R.idivn(G),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var V=W==="le",M=new j(Z),A,v,G=this.clone();if(!V){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[Z-v-1]=A}else{for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var V=0;V<J.length;V++)W=(X.words[V]|0)+(J.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;for(;Z!==0&&V<X.length;V++)W=(X.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;V<X.length;V++)this.words[V]=X.words[V];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var V=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;for(;V!==0&&M<J.length;M++)W=(J.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;if(V===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,V=W.words[0]|0,M=Z*V,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var G=1;G<J;G++){var R=v>>>26,E=v&67108863,b=Math.min(G,W.length-1);for(var x=Math.max(0,G-j.length+1);x<=b;x++){var l=G-x|0;Z=j.words[l]|0,V=W.words[x]|0,M=Z*V+E,R+=M/67108864|0,E=M&67108863}X.words[G]=E|0,v=R|0}if(v!==0)X.words[G]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,V=X.words,M=0,A,v,G,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,Q=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,e=v$&8191,P$=v$>>>13,o$=J[4]|0,m=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,G=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(Q,M$)|0,G=Math.imul(Q,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,G=G+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,G=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(Q,E$)|0,G=G+Math.imul(Q,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,G=G+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(e,M$),v=Math.imul(e,S$),v=v+Math.imul(P$,M$)|0,G=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,G=G+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(Q,g$)|0,G=G+Math.imul(Q,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,G=G+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(m,M$),v=Math.imul(m,S$),v=v+Math.imul(r,M$)|0,G=Math.imul(r,S$),A=A+Math.imul(e,E$)|0,v=v+Math.imul(e,b$)|0,v=v+Math.imul(P$,E$)|0,G=G+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,G=G+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(Q,y$)|0,G=G+Math.imul(Q,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,G=G+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,G=Math.imul(_$,S$),A=A+Math.imul(m,E$)|0,v=v+Math.imul(m,b$)|0,v=v+Math.imul(r,E$)|0,G=G+Math.imul(r,b$)|0,A=A+Math.imul(e,g$)|0,v=v+Math.imul(e,h$)|0,v=v+Math.imul(P$,g$)|0,G=G+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,G=G+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(Q,u$)|0,G=G+Math.imul(Q,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,G=G+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,G=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,G=G+Math.imul(_$,b$)|0,A=A+Math.imul(m,g$)|0,v=v+Math.imul(m,h$)|0,v=v+Math.imul(r,g$)|0,G=G+Math.imul(r,h$)|0,A=A+Math.imul(e,y$)|0,v=v+Math.imul(e,R$)|0,v=v+Math.imul(P$,y$)|0,G=G+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,G=G+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(Q,I$)|0,G=G+Math.imul(Q,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,G=G+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,G=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,G=G+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,G=G+Math.imul(_$,h$)|0,A=A+Math.imul(m,y$)|0,v=v+Math.imul(m,R$)|0,v=v+Math.imul(r,y$)|0,G=G+Math.imul(r,R$)|0,A=A+Math.imul(e,u$)|0,v=v+Math.imul(e,x$)|0,v=v+Math.imul(P$,u$)|0,G=G+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,G=G+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(Q,K$)|0,G=G+Math.imul(Q,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,G=G+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,G=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,G=G+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,G=G+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,G=G+Math.imul(_$,R$)|0,A=A+Math.imul(m,u$)|0,v=v+Math.imul(m,x$)|0,v=v+Math.imul(r,u$)|0,G=G+Math.imul(r,x$)|0,A=A+Math.imul(e,I$)|0,v=v+Math.imul(e,u)|0,v=v+Math.imul(P$,I$)|0,G=G+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,G=G+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(Q,G$)|0,G=G+Math.imul(Q,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,G=G+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,G=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,G=G+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,G=G+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,G=G+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,G=G+Math.imul(_$,x$)|0,A=A+Math.imul(m,I$)|0,v=v+Math.imul(m,u)|0,v=v+Math.imul(r,I$)|0,G=G+Math.imul(r,u)|0,A=A+Math.imul(e,K$)|0,v=v+Math.imul(e,Y$)|0,v=v+Math.imul(P$,K$)|0,G=G+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,G=G+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(Q,D$)|0,G=G+Math.imul(Q,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,G=G+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,G=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,G=G+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,G=G+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,G=G+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,G=G+Math.imul(_$,u)|0,A=A+Math.imul(m,K$)|0,v=v+Math.imul(m,Y$)|0,v=v+Math.imul(r,K$)|0,G=G+Math.imul(r,Y$)|0,A=A+Math.imul(e,G$)|0,v=v+Math.imul(e,V$)|0,v=v+Math.imul(P$,G$)|0,G=G+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,G=G+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(Q,L$)|0,G=G+Math.imul(Q,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,G=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,G=G+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,G=G+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,G=G+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,G=G+Math.imul(_$,Y$)|0,A=A+Math.imul(m,G$)|0,v=v+Math.imul(m,V$)|0,v=v+Math.imul(r,G$)|0,G=G+Math.imul(r,V$)|0,A=A+Math.imul(e,D$)|0,v=v+Math.imul(e,p$)|0,v=v+Math.imul(P$,D$)|0,G=G+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,G=G+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,G=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,G=G+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,G=G+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,G=G+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,G=G+Math.imul(_$,V$)|0,A=A+Math.imul(m,D$)|0,v=v+Math.imul(m,p$)|0,v=v+Math.imul(r,D$)|0,G=G+Math.imul(r,p$)|0,A=A+Math.imul(e,L$)|0,v=v+Math.imul(e,C$)|0,v=v+Math.imul(P$,L$)|0,G=G+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,G=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,G=G+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,G=G+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,G=G+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,G=G+Math.imul(_$,p$)|0,A=A+Math.imul(m,L$)|0,v=v+Math.imul(m,C$)|0,v=v+Math.imul(r,L$)|0,G=G+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,G=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,G=G+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,G=G+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,G=G+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,G=G+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,G=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,G=G+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,G=G+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,G=G+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,G=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,G=G+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,G=G+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,G=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,G=G+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,G=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(G+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,V[0]=c6,V[1]=W6,V[2]=j6,V[3]=E6,V[4]=M6,V[5]=t6,V[6]=U6,V[7]=F6,V[8]=Q6,V[9]=a6,V[10]=e6,V[11]=s6,V[12]=$q,V[13]=qq,V[14]=_q,V[15]=Kq,V[16]=Pq,V[17]=Yq,V[18]=Oq,M!==0)V[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var V=0;V<X.length-1;V++){var M=Z;Z=0;var A=J&67108863,v=Math.min(V,W.length-1);for(var G=Math.max(0,V-j.length+1);G<=v;G++){var R=V-G,E=j.words[R]|0,b=W.words[G]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[V]=A,J=M,M=Z}if(J!==0)X.words[V]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,V){for(var M=0;M<V;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,V){this.permute(V,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),G=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=G;for(var x=0;x<M;x++){var l=X[R+x],Q=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=Q+q$,X[R+x+M]=l-f$,J[R+x+M]=Q-q$,x!==A)B=v*E-G*b,b=v*b+G*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var V=0;V<W;V++)Z=Z+(j[V]|0),X[2*V]=Z&8191,Z=Z>>>13,X[2*V+1]=Z&8191,Z=Z>>>13;for(V=2*W;V<J;++V)X[V]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),V=this.stub(J),M=Array(J),A=Array(J),v=Array(J),G=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,G,J),this.transform(M,V,A,v,J,Z),this.transform(G,V,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,V,J,Z),this.conjugate(b,V,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var V=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|V,V=M>>>26-W}if(V)this.words[Z]=V,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,V=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=V,J=Math.max(0,J),A){for(var v=0;v<V;v++)A.words[v]=this.words[v];A.length=V}if(V===0);else if(this.length>V){this.length-=V;for(v=0;v<this.length;v++)this.words[v]=this.words[v+V]}else this.words[0]=0,this.length=1;var G=0;for(v=this.length-1;v>=0&&(G!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=G<<26-Z|R>>>Z,G=R&M}if(A&&G!==0)A.words[A.length++]=G;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var V,M=0;for(Z=0;Z<j.length;Z++){V=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;V-=A&67108863,M=(V>>26)-(A/67108864|0),this.words[Z+X]=V&67108863}for(;Z<this.length-X;Z++)V=(this.words[Z+X]|0)+M,M=V>>26,this.words[Z+X]=V&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)V=-(this.words[Z]|0)+M,M=V>>26,this.words[Z]=V&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,V=Z.words[Z.length-1]|0,M=this._countBits(V);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),V=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var G=0;G<v.length;G++)v.words[G]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/V|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,V;if(this.negative!==0&&j.negative===0){if(V=this.neg().divmod(j,W),W!=="mod")J=V.div.neg();if(W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(V=this.divmod(j.neg(),W),W!=="mod")J=V.div.neg();return{div:J,mod:V.mod}}if((this.negative&j.negative)!==0){if(V=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:V.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),V=X.cmp(J);if(V<0||Z===1&&V===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),G=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(G);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(V.isOdd()||M.isOdd())V.iadd(v),M.isub(G);V.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(V),Z.isub(M);else X.isub(W),V.isub(J),M.isub(Z)}return{a:V,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(V);J.iushrn(1)}}for(var v=0,G=1;(X.words[0]&G)===0&&v<26;++v,G<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(V);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var V=W;W=X,X=V}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var V=X;Z!==0&&V<this.length;V++){var M=this.words[V]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[V]=M}if(Z!==0)this.words[V]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new p(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(c,y),c.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var V=j.words[9];W.words[W.length++]=V&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|V>>>22,V=M}if(V>>>=22,j.words[Z-10]=V,V===0&&j.length>10)j.length-=10;else j.length-=9},c.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function F(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(F,y),F.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new c;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new F;else throw Error("Unknown prime "+j);return g[j]=W,W};function p(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}p.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},p.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},p.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},p.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},p.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},p.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},p.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},p.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},p.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},p.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},p.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},p.prototype.isqr=function(j){return this.imul(j,j.clone())},p.prototype.sqr=function(j){return this.mul(j,j)},p.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var V=new O(1).toRed(this),M=V.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var G=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(V)!==0){var x=E;for(var l=0;x.cmp(V)!==0;l++)x=x.redSqr();P(l<b);var Q=this.pow(G,new O(1).iushln(b-l-1));R=R.redMul(Q),G=Q.redSqr(),E=E.redMul(G),b=l}return R},p.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},p.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var V=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var G=W.words[Z];for(var R=v-1;R>=0;R--){var E=G>>R&1;if(V!==J[0])V=this.sqr(V);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;V=this.mul(V,J[M]),A=0,M=0}v=26}return V},p.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},p.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new a(j)};function a(j){if(p.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(a,p),a.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},a.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},a.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),Qi=T$(($,q)=>{var _=Ui(),K=Fi();q.exports=function(z){return new Y(z)};var P={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}};P.p224=P.secp224r1,P.p256=P.secp256r1=P.prime256v1,P.p192=P.secp192r1=P.prime192v1,P.p384=P.secp384r1,P.p521=P.secp521r1;function Y(z){if(this.curveType=P[z],!this.curveType)this.curveType={name:z};this.curve=new _.ec(this.curveType.name),this.keys=void 0}Y.prototype.generateKeys=function(z,T){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,T)},Y.prototype.computeSecret=function(z,T,H){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);var f=this.curve.keyFromPublic(z).getPublic(),w=f.mul(this.keys.getPrivate()).getX();return O(w,H,this.curveType.byteLength)},Y.prototype.getPublicKey=function(z,T){var H=this.keys.getPublic(T==="compressed",!0);if(T==="hybrid")if(H[H.length-1]%2)H[0]=7;else H[0]=6;return O(H,z)},Y.prototype.getPrivateKey=function(z){return O(this.keys.getPrivate(),z)},Y.prototype.setPublicKey=function(z,T){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);return this.keys._importPublic(z),this},Y.prototype.setPrivateKey=function(z,T){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);var H=new K(z);return H=H.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(H),this};function O(z,T,H){if(!Array.isArray(z))z=z.toArray();var f=new Buffer(z);if(H&&f.length<H){var w=new Buffer(H-f.length);w.fill(0),f=Buffer.concat([w,f])}if(!T)return f;else return f.toString(T)}}),ai=T$(($,q)=>{var _=(lq(),J6(dq)).createECDH;q.exports=_||Qi()}),ei=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,V,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(V=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(V=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,V=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,V=Math.min(j.length,X);for(var M=W;M<V;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var V=j.length-X,M=V%J,A=Math.min(V,V-M)+X,v=0;for(var G=X;G<A;G+=J)if(v=f(j,G,G+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,G,j.length,W);for(G=0;G<M;G++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var V=0;V<this.length;V++){var M=this.words[V],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,V--;if(Z!==0||V!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],G=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(G).toString(j);if(R=R.idivn(G),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var V=W==="le",M=new j(Z),A,v,G=this.clone();if(!V){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[Z-v-1]=A}else{for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var V=0;V<J.length;V++)W=(X.words[V]|0)+(J.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;for(;Z!==0&&V<X.length;V++)W=(X.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;V<X.length;V++)this.words[V]=X.words[V];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var V=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;for(;V!==0&&M<J.length;M++)W=(J.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;if(V===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,V=W.words[0]|0,M=Z*V,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var G=1;G<J;G++){var R=v>>>26,E=v&67108863,b=Math.min(G,W.length-1);for(var x=Math.max(0,G-j.length+1);x<=b;x++){var l=G-x|0;Z=j.words[l]|0,V=W.words[x]|0,M=Z*V+E,R+=M/67108864|0,E=M&67108863}X.words[G]=E|0,v=R|0}if(v!==0)X.words[G]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,V=X.words,M=0,A,v,G,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,Q=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,e=v$&8191,P$=v$>>>13,o$=J[4]|0,m=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,G=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(Q,M$)|0,G=Math.imul(Q,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,G=G+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,G=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(Q,E$)|0,G=G+Math.imul(Q,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,G=G+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(e,M$),v=Math.imul(e,S$),v=v+Math.imul(P$,M$)|0,G=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,G=G+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(Q,g$)|0,G=G+Math.imul(Q,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,G=G+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(m,M$),v=Math.imul(m,S$),v=v+Math.imul(r,M$)|0,G=Math.imul(r,S$),A=A+Math.imul(e,E$)|0,v=v+Math.imul(e,b$)|0,v=v+Math.imul(P$,E$)|0,G=G+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,G=G+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(Q,y$)|0,G=G+Math.imul(Q,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,G=G+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,G=Math.imul(_$,S$),A=A+Math.imul(m,E$)|0,v=v+Math.imul(m,b$)|0,v=v+Math.imul(r,E$)|0,G=G+Math.imul(r,b$)|0,A=A+Math.imul(e,g$)|0,v=v+Math.imul(e,h$)|0,v=v+Math.imul(P$,g$)|0,G=G+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,G=G+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(Q,u$)|0,G=G+Math.imul(Q,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,G=G+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,G=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,G=G+Math.imul(_$,b$)|0,A=A+Math.imul(m,g$)|0,v=v+Math.imul(m,h$)|0,v=v+Math.imul(r,g$)|0,G=G+Math.imul(r,h$)|0,A=A+Math.imul(e,y$)|0,v=v+Math.imul(e,R$)|0,v=v+Math.imul(P$,y$)|0,G=G+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,G=G+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(Q,I$)|0,G=G+Math.imul(Q,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,G=G+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,G=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,G=G+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,G=G+Math.imul(_$,h$)|0,A=A+Math.imul(m,y$)|0,v=v+Math.imul(m,R$)|0,v=v+Math.imul(r,y$)|0,G=G+Math.imul(r,R$)|0,A=A+Math.imul(e,u$)|0,v=v+Math.imul(e,x$)|0,v=v+Math.imul(P$,u$)|0,G=G+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,G=G+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(Q,K$)|0,G=G+Math.imul(Q,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,G=G+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,G=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,G=G+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,G=G+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,G=G+Math.imul(_$,R$)|0,A=A+Math.imul(m,u$)|0,v=v+Math.imul(m,x$)|0,v=v+Math.imul(r,u$)|0,G=G+Math.imul(r,x$)|0,A=A+Math.imul(e,I$)|0,v=v+Math.imul(e,u)|0,v=v+Math.imul(P$,I$)|0,G=G+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,G=G+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(Q,G$)|0,G=G+Math.imul(Q,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,G=G+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,G=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,G=G+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,G=G+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,G=G+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,G=G+Math.imul(_$,x$)|0,A=A+Math.imul(m,I$)|0,v=v+Math.imul(m,u)|0,v=v+Math.imul(r,I$)|0,G=G+Math.imul(r,u)|0,A=A+Math.imul(e,K$)|0,v=v+Math.imul(e,Y$)|0,v=v+Math.imul(P$,K$)|0,G=G+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,G=G+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(Q,D$)|0,G=G+Math.imul(Q,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,G=G+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,G=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,G=G+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,G=G+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,G=G+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,G=G+Math.imul(_$,u)|0,A=A+Math.imul(m,K$)|0,v=v+Math.imul(m,Y$)|0,v=v+Math.imul(r,K$)|0,G=G+Math.imul(r,Y$)|0,A=A+Math.imul(e,G$)|0,v=v+Math.imul(e,V$)|0,v=v+Math.imul(P$,G$)|0,G=G+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,G=G+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(Q,L$)|0,G=G+Math.imul(Q,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,G=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,G=G+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,G=G+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,G=G+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,G=G+Math.imul(_$,Y$)|0,A=A+Math.imul(m,G$)|0,v=v+Math.imul(m,V$)|0,v=v+Math.imul(r,G$)|0,G=G+Math.imul(r,V$)|0,A=A+Math.imul(e,D$)|0,v=v+Math.imul(e,p$)|0,v=v+Math.imul(P$,D$)|0,G=G+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,G=G+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,G=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,G=G+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,G=G+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,G=G+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,G=G+Math.imul(_$,V$)|0,A=A+Math.imul(m,D$)|0,v=v+Math.imul(m,p$)|0,v=v+Math.imul(r,D$)|0,G=G+Math.imul(r,p$)|0,A=A+Math.imul(e,L$)|0,v=v+Math.imul(e,C$)|0,v=v+Math.imul(P$,L$)|0,G=G+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,G=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,G=G+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,G=G+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,G=G+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,G=G+Math.imul(_$,p$)|0,A=A+Math.imul(m,L$)|0,v=v+Math.imul(m,C$)|0,v=v+Math.imul(r,L$)|0,G=G+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,G=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,G=G+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,G=G+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,G=G+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,G=G+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,G=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,G=G+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,G=G+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,G=G+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,G=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,G=G+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,G=G+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,G=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,G=G+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,G=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(G+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,V[0]=c6,V[1]=W6,V[2]=j6,V[3]=E6,V[4]=M6,V[5]=t6,V[6]=U6,V[7]=F6,V[8]=Q6,V[9]=a6,V[10]=e6,V[11]=s6,V[12]=$q,V[13]=qq,V[14]=_q,V[15]=Kq,V[16]=Pq,V[17]=Yq,V[18]=Oq,M!==0)V[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var V=0;V<X.length-1;V++){var M=Z;Z=0;var A=J&67108863,v=Math.min(V,W.length-1);for(var G=Math.max(0,V-j.length+1);G<=v;G++){var R=V-G,E=j.words[R]|0,b=W.words[G]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[V]=A,J=M,M=Z}if(J!==0)X.words[V]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,V){for(var M=0;M<V;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,V){this.permute(V,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),G=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=G;for(var x=0;x<M;x++){var l=X[R+x],Q=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=Q+q$,X[R+x+M]=l-f$,J[R+x+M]=Q-q$,x!==A)B=v*E-G*b,b=v*b+G*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var V=0;V<W;V++)Z=Z+(j[V]|0),X[2*V]=Z&8191,Z=Z>>>13,X[2*V+1]=Z&8191,Z=Z>>>13;for(V=2*W;V<J;++V)X[V]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),V=this.stub(J),M=Array(J),A=Array(J),v=Array(J),G=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,G,J),this.transform(M,V,A,v,J,Z),this.transform(G,V,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,V,J,Z),this.conjugate(b,V,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var V=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|V,V=M>>>26-W}if(V)this.words[Z]=V,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,V=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=V,J=Math.max(0,J),A){for(var v=0;v<V;v++)A.words[v]=this.words[v];A.length=V}if(V===0);else if(this.length>V){this.length-=V;for(v=0;v<this.length;v++)this.words[v]=this.words[v+V]}else this.words[0]=0,this.length=1;var G=0;for(v=this.length-1;v>=0&&(G!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=G<<26-Z|R>>>Z,G=R&M}if(A&&G!==0)A.words[A.length++]=G;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var V,M=0;for(Z=0;Z<j.length;Z++){V=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;V-=A&67108863,M=(V>>26)-(A/67108864|0),this.words[Z+X]=V&67108863}for(;Z<this.length-X;Z++)V=(this.words[Z+X]|0)+M,M=V>>26,this.words[Z+X]=V&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)V=-(this.words[Z]|0)+M,M=V>>26,this.words[Z]=V&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,V=Z.words[Z.length-1]|0,M=this._countBits(V);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),V=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var G=0;G<v.length;G++)v.words[G]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/V|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,V;if(this.negative!==0&&j.negative===0){if(V=this.neg().divmod(j,W),W!=="mod")J=V.div.neg();if(W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(V=this.divmod(j.neg(),W),W!=="mod")J=V.div.neg();return{div:J,mod:V.mod}}if((this.negative&j.negative)!==0){if(V=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:V.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),V=X.cmp(J);if(V<0||Z===1&&V===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),G=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(G);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(V.isOdd()||M.isOdd())V.iadd(v),M.isub(G);V.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(V),Z.isub(M);else X.isub(W),V.isub(J),M.isub(Z)}return{a:V,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(V);J.iushrn(1)}}for(var v=0,G=1;(X.words[0]&G)===0&&v<26;++v,G<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(V);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var V=W;W=X,X=V}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var V=X;Z!==0&&V<this.length;V++){var M=this.words[V]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[V]=M}if(Z!==0)this.words[V]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new p(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(c,y),c.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var V=j.words[9];W.words[W.length++]=V&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|V>>>22,V=M}if(V>>>=22,j.words[Z-10]=V,V===0&&j.length>10)j.length-=10;else j.length-=9},c.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function F(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(F,y),F.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new c;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new F;else throw Error("Unknown prime "+j);return g[j]=W,W};function p(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}p.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},p.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},p.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},p.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},p.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},p.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},p.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},p.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},p.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},p.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},p.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},p.prototype.isqr=function(j){return this.imul(j,j.clone())},p.prototype.sqr=function(j){return this.mul(j,j)},p.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var V=new O(1).toRed(this),M=V.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var G=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(V)!==0){var x=E;for(var l=0;x.cmp(V)!==0;l++)x=x.redSqr();P(l<b);var Q=this.pow(G,new O(1).iushln(b-l-1));R=R.redMul(Q),G=Q.redSqr(),E=E.redMul(G),b=l}return R},p.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},p.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var V=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var G=W.words[Z];for(var R=v-1;R>=0;R--){var E=G>>R&1;if(V!==J[0])V=this.sqr(V);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;V=this.mul(V,J[M]),A=0,M=0}v=26}return V},p.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},p.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new a(j)};function a(j){if(p.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(a,p),a.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},a.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},a.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),si=T$(($)=>{var q=Y1(),_=v8(),K=$;K.define=function(Y,O){return new P(Y,O)};function P(Y,O){this.name=Y,this.body=O,this.decoders={},this.encoders={}}P.prototype._createNamed=function(Y){var O;try{O=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
34
+ `;super(P);this.name="AggregateError",this.errors=K}}q.exports={AggregateError:_,ArrayIsArray(K){return Array.isArray(K)},ArrayPrototypeIncludes(K,P){return K.includes(P)},ArrayPrototypeIndexOf(K,P){return K.indexOf(P)},ArrayPrototypeJoin(K,P){return K.join(P)},ArrayPrototypeMap(K,P){return K.map(P)},ArrayPrototypePop(K,P){return K.pop(P)},ArrayPrototypePush(K,P){return K.push(P)},ArrayPrototypeSlice(K,P,Y){return K.slice(P,Y)},Error,FunctionPrototypeCall(K,P,...Y){return K.call(P,...Y)},FunctionPrototypeSymbolHasInstance(K,P){return Function.prototype[Symbol.hasInstance].call(K,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(K,P){return Object.defineProperties(K,P)},ObjectDefineProperty(K,P,Y){return Object.defineProperty(K,P,Y)},ObjectGetOwnPropertyDescriptor(K,P){return Object.getOwnPropertyDescriptor(K,P)},ObjectKeys(K){return Object.keys(K)},ObjectSetPrototypeOf(K,P){return Object.setPrototypeOf(K,P)},Promise,PromisePrototypeCatch(K,P){return K.catch(P)},PromisePrototypeThen(K,P,Y){return K.then(P,Y)},PromiseReject(K){return Promise.reject(K)},PromiseResolve(K){return Promise.resolve(K)},ReflectApply:Reflect.apply,RegExpPrototypeTest(K,P){return K.test(P)},SafeSet:Set,String,StringPrototypeSlice(K,P,Y){return K.slice(P,Y)},StringPrototypeToLowerCase(K){return K.toLowerCase()},StringPrototypeToUpperCase(K){return K.toUpperCase()},StringPrototypeTrim(K){return K.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(K,P,Y){return K.set(P,Y)},Boolean,Uint8Array}}),n0=S6(($,q)=>{q.exports={format(_,...K){return _.replace(/%([sdifj])/g,function(...[P,Y]){let O=K.shift();if(Y==="f")return O.toFixed(6);else if(Y==="j")return JSON.stringify(O);else if(Y==="s"&&typeof O==="object")return`${O.constructor!==Object?O.constructor.name:""} {}`.trim();else return O.toString()})},inspect(_){switch(typeof _){case"string":if(_.includes("'")){if(!_.includes('"'))return`"${_}"`;else if(!_.includes("`")&&!_.includes("${"))return`\`${_}\``}return`'${_}'`;case"number":if(isNaN(_))return"NaN";else if(Object.is(_,-0))return String(_);return _;case"bigint":return`${String(_)}n`;case"boolean":case"undefined":return String(_);case"object":return"{}"}}}}),cq=S6(($,q)=>{var{format:_,inspect:K}=n0(),{AggregateError:P}=x6(),Y=globalThis.AggregateError||P,O=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],T=/^([A-Z][a-z0-9]*)+$/,H={};function f(I,D){if(!I)throw new H.ERR_INTERNAL_ASSERTION(D)}function w(I){let D="",L=I.length,g=I[0]==="-"?1:0;for(;L>=g+4;L-=3)D=`_${I.slice(L-3,L)}${D}`;return`${I.slice(0,L)}${D}`}function k(I,D,L){if(typeof D==="function")return f(D.length<=L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${D.length}).`),D(...L);let g=(D.match(/%[dfijoOs]/g)||[]).length;if(f(g===L.length,`Code: ${I}; The provided arguments length (${L.length}) does not match the required ones (${g}).`),L.length===0)return D;return _(D,...L)}function S(I,D,L){if(!L)L=Error;class g extends L{constructor(...y){super(k(I,D,y))}toString(){return`${this.name} [${I}]: ${this.message}`}}Object.defineProperties(g.prototype,{name:{value:L.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${I}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),g.prototype.code=I,g.prototype[O]=!0,H[I]=g}function N(I){let D="__node_internal_"+I.name;return Object.defineProperty(I,"name",{value:D}),I}function h(I,D){if(I&&D&&I!==D){if(Array.isArray(D.errors))return D.errors.push(I),D;let L=new Y([D,I],D.message);return L.code=D.code,L}return I||D}class C extends Error{constructor(I="The operation was aborted",D=void 0){if(D!==void 0&&typeof D!=="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",D);super(I,D);this.code="ABORT_ERR",this.name="AbortError"}}S("ERR_ASSERTION","%s",Error),S("ERR_INVALID_ARG_TYPE",(I,D,L)=>{if(f(typeof I==="string","'name' must be a string"),!Array.isArray(D))D=[D];let g="The ";if(I.endsWith(" argument"))g+=`${I} `;else g+=`"${I}" ${I.includes(".")?"property":"argument"} `;g+="must be ";let y=[],p=[],o=[];for(let Q of D)if(f(typeof Q==="string","All expected entries have to be of type string"),z.includes(Q))y.push(Q.toLowerCase());else if(T.test(Q))p.push(Q);else f(Q!=="object",'The value "object" should be written as "Object"'),o.push(Q);if(p.length>0){let Q=y.indexOf("object");if(Q!==-1)y.splice(y,Q,1),p.push("Object")}if(y.length>0){switch(y.length){case 1:g+=`of type ${y[0]}`;break;case 2:g+=`one of type ${y[0]} or ${y[1]}`;break;default:{let Q=y.pop();g+=`one of type ${y.join(", ")}, or ${Q}`}}if(p.length>0||o.length>0)g+=" or "}if(p.length>0){switch(p.length){case 1:g+=`an instance of ${p[0]}`;break;case 2:g+=`an instance of ${p[0]} or ${p[1]}`;break;default:{let Q=p.pop();g+=`an instance of ${p.join(", ")}, or ${Q}`}}if(o.length>0)g+=" or "}switch(o.length){case 0:break;case 1:if(o[0].toLowerCase()!==o[0])g+="an ";g+=`${o[0]}`;break;case 2:g+=`one of ${o[0]} or ${o[1]}`;break;default:{let Q=o.pop();g+=`one of ${o.join(", ")}, or ${Q}`}}if(L==null)g+=`. Received ${L}`;else if(typeof L==="function"&&L.name)g+=`. Received function ${L.name}`;else if(typeof L==="object"){var s;if((s=L.constructor)!==null&&s!==void 0&&s.name)g+=`. Received an instance of ${L.constructor.name}`;else{let Q=K(L,{depth:-1});g+=`. Received ${Q}`}}else{let Q=K(L,{colors:!1});if(Q.length>25)Q=`${Q.slice(0,25)}...`;g+=`. Received type ${typeof L} (${Q})`}return g},TypeError),S("ERR_INVALID_ARG_VALUE",(I,D,L="is invalid")=>{let g=K(D);if(g.length>128)g=g.slice(0,128)+"...";return`The ${I.includes(".")?"property":"argument"} '${I}' ${L}. Received ${g}`},TypeError),S("ERR_INVALID_RETURN_VALUE",(I,D,L)=>{var g;let y=L!==null&&L!==void 0&&(g=L.constructor)!==null&&g!==void 0&&g.name?`instance of ${L.constructor.name}`:`type ${typeof L}`;return`Expected ${I} to be returned from the "${D}" function but got ${y}.`},TypeError),S("ERR_MISSING_ARGS",(...I)=>{f(I.length>0,"At least one arg needs to be specified");let D,L=I.length;switch(I=(Array.isArray(I)?I:[I]).map((g)=>`"${g}"`).join(" or "),L){case 1:D+=`The ${I[0]} argument`;break;case 2:D+=`The ${I[0]} and ${I[1]} arguments`;break;default:{let g=I.pop();D+=`The ${I.join(", ")}, and ${g} arguments`}break}return`${D} must be specified`},TypeError),S("ERR_OUT_OF_RANGE",(I,D,L)=>{f(D,'Missing "range" argument');let g;if(Number.isInteger(L)&&Math.abs(L)>4294967296)g=w(String(L));else if(typeof L==="bigint"){g=String(L);let y=BigInt(2)**BigInt(32);if(L>y||L<-y)g=w(g);g+="n"}else g=K(L);return`The value of "${I}" is out of range. It must be ${D}. Received ${g}`},RangeError),S("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),S("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),S("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),S("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),S("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),S("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),S("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),S("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),S("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),S("ERR_STREAM_WRITE_AFTER_END","write after end",Error),S("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),q.exports={AbortError:C,aggregateTwoErrors:N(h),hideStackFrames:N,codes:H}}),Ln=S6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var _=new WeakMap,K=new WeakMap;function P(m){let e=_.get(m);return console.assert(e!=null,"'this' is expected an Event object, but got",m),e}function Y(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 O(m,e){_.set(this,{eventTarget:m,event:e,eventPhase:2,currentTarget:m,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:e.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let j=Object.keys(e);for(let W=0;W<j.length;++W){let X=j[W];if(!(X in this))Object.defineProperty(this,X,z(X))}}if(O.prototype={get type(){return P(this).event.type},get target(){return P(this).eventTarget},get currentTarget(){return P(this).currentTarget},composedPath(){let m=P(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 P(this).eventPhase},stopPropagation(){let m=P(this);if(m.stopped=!0,typeof m.event.stopPropagation==="function")m.event.stopPropagation()},stopImmediatePropagation(){let m=P(this);if(m.stopped=!0,m.immediateStopped=!0,typeof m.event.stopImmediatePropagation==="function")m.event.stopImmediatePropagation()},get bubbles(){return Boolean(P(this).event.bubbles)},get cancelable(){return Boolean(P(this).event.cancelable)},preventDefault(){Y(P(this))},get defaultPrevented(){return P(this).canceled},get composed(){return Boolean(P(this).event.composed)},get timeStamp(){return P(this).timeStamp},get srcElement(){return P(this).eventTarget},get cancelBubble(){return P(this).stopped},set cancelBubble(m){if(!m)return;let e=P(this);if(e.stopped=!0,typeof e.event.cancelBubble==="boolean")e.event.cancelBubble=!0},get returnValue(){return!P(this).canceled},set returnValue(m){if(!m)Y(P(this))},initEvent(){}},Object.defineProperty(O.prototype,"constructor",{value:O,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(O.prototype,window.Event.prototype),K.set(window.Event.prototype,O);function z(m){return{get(){return P(this).event[m]},set(e){P(this).event[m]=e},configurable:!0,enumerable:!0}}function T(m){return{value(){let e=P(this).event;return e[m].apply(e,arguments)},configurable:!0,enumerable:!0}}function H(m,e){let j=Object.keys(e);if(j.length===0)return m;function W(X,J){m.call(this,X,J)}W.prototype=Object.create(m.prototype,{constructor:{value:W,configurable:!0,writable:!0}});for(let X=0;X<j.length;++X){let J=j[X];if(!(J in m.prototype)){let Z=typeof Object.getOwnPropertyDescriptor(e,J).value==="function";Object.defineProperty(W.prototype,J,Z?T(J):z(J))}}return W}function f(m){if(m==null||m===Object.prototype)return O;let e=K.get(m);if(e==null)e=H(f(Object.getPrototypeOf(m)),m),K.set(m,e);return e}function w(m,e){return new(f(Object.getPrototypeOf(e)))(m,e)}function k(m){return P(m).immediateStopped}function S(m,e){P(m).eventPhase=e}function N(m,e){P(m).currentTarget=e}function h(m,e){P(m).passiveListener=e}var C=new WeakMap,I=1,D=2,L=3;function g(m){return m!==null&&typeof m==="object"}function y(m){let e=C.get(m);if(e==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return e}function p(m){return{get(){let e=y(this).get(m);while(e!=null){if(e.listenerType===L)return e.listener;e=e.next}return null},set(e){if(typeof e!=="function"&&!g(e))e=null;let j=y(this),W=null,X=j.get(m);while(X!=null){if(X.listenerType===L)if(W!==null)W.next=X.next;else if(X.next!==null)j.set(m,X.next);else j.delete(m);else W=X;X=X.next}if(e!==null){let J={listener:e,listenerType:L,passive:!1,once:!1,next:null};if(W===null)j.set(m,J);else W.next=J}},configurable:!0,enumerable:!0}}function o(m,e){Object.defineProperty(m,`on${e}`,p(e))}function s(m){function e(){Q.call(this)}e.prototype=Object.create(Q.prototype,{constructor:{value:e,configurable:!0,writable:!0}});for(let j=0;j<m.length;++j)o(e.prototype,m[j]);return e}function Q(){if(this instanceof Q){C.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return s(arguments[0]);if(arguments.length>0){let m=Array(arguments.length);for(let e=0;e<arguments.length;++e)m[e]=arguments[e];return s(m)}throw TypeError("Cannot call a class as a function")}if(Q.prototype={addEventListener(m,e,j){if(e==null)return;if(typeof e!=="function"&&!g(e))throw TypeError("'listener' should be a function or an object.");let W=y(this),X=g(j),J=(X?Boolean(j.capture):Boolean(j))?I:D,Z={listener:e,listenerType:J,passive:X&&Boolean(j.passive),once:X&&Boolean(j.once),next:null},G=W.get(m);if(G===void 0){W.set(m,Z);return}let M=null;while(G!=null){if(G.listener===e&&G.listenerType===J)return;M=G,G=G.next}M.next=Z},removeEventListener(m,e,j){if(e==null)return;let W=y(this),X=(g(j)?Boolean(j.capture):Boolean(j))?I:D,J=null,Z=W.get(m);while(Z!=null){if(Z.listener===e&&Z.listenerType===X){if(J!==null)J.next=Z.next;else if(Z.next!==null)W.set(m,Z.next);else W.delete(m);return}J=Z,Z=Z.next}},dispatchEvent(m){if(m==null||typeof m.type!=="string")throw TypeError('"event.type" should be a string.');let e=y(this),j=m.type,W=e.get(j);if(W==null)return!0;let X=w(this,m),J=null;while(W!=null){if(W.once)if(J!==null)J.next=W.next;else if(W.next!==null)e.set(j,W.next);else e.delete(j);else J=W;if(h(X,W.passive?W.listener:null),typeof W.listener==="function")try{W.listener.call(this,X)}catch(Z){if(typeof console<"u"&&typeof console.error==="function")console.error(Z)}else if(W.listenerType!==L&&typeof W.listener.handleEvent==="function")W.listener.handleEvent(X);if(k(X))break;W=W.next}return h(X,null),S(X,0),N(X,null),!X.defaultPrevented}},Object.defineProperty(Q.prototype,"constructor",{value:Q,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(Q.prototype,window.EventTarget.prototype);$.defineEventAttribute=o,$.EventTarget=Q,$.default=Q,q.exports=Q,q.exports.EventTarget=q.exports.default=Q,q.exports.defineEventAttribute=o}),e7=S6(($,q)=>{Object.defineProperty($,"__esModule",{value:!0});var _=Ln();class K extends _.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let f=O.get(this);if(typeof f!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return f}}_.defineEventAttribute(K.prototype,"abort");function P(){let f=Object.create(K.prototype);return _.EventTarget.call(f),O.set(f,!1),f}function Y(f){if(O.get(f)!==!1)return;O.set(f,!0),f.dispatchEvent({type:"abort"})}var O=new WeakMap;if(Object.defineProperties(K.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(K.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){T.set(this,P())}get signal(){return H(this)}abort(){Y(H(this))}}var T=new WeakMap;function H(f){let w=T.get(f);if(w==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${f===null?"null":typeof f}`);return w}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=K,$.default=z,q.exports=z,q.exports.AbortController=q.exports.default=z,q.exports.AbortSignal=K}),$8=S6(($,q)=>{var _=(wq(),J6(Tq)),{format:K,inspect:P}=n0(),{codes:{ERR_INVALID_ARG_TYPE:Y}}=cq(),{kResistStopPropagation:O,AggregateError:z,SymbolDispose:T}=x6(),H=globalThis.AbortSignal||e7().AbortSignal,f=globalThis.AbortController||e7().AbortController,w=Object.getPrototypeOf(async function(){}).constructor,k=globalThis.Blob||_.Blob,S=typeof k<"u"?function(C){return C instanceof k}:function(C){return!1},N=(C,I)=>{if(C!==void 0&&(C===null||typeof C!=="object"||!("aborted"in C)))throw new Y(I,"AbortSignal",C)},h=(C,I)=>{if(typeof C!=="function")throw new Y(I,"Function",C)};q.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(C){let I=!1;return function(...D){if(I)return;I=!0,C.apply(this,D)}},createDeferredPromise:function(){let C,I;return{promise:new Promise((D,L)=>{C=D,I=L}),resolve:C,reject:I}},promisify(C){return new Promise((I,D)=>{C((L,...g)=>{if(L)return D(L);return I(...g)})})},debuglog(){return function(){}},format:K,inspect:P,types:{isAsyncFunction(C){return C instanceof w},isArrayBufferView(C){return ArrayBuffer.isView(C)}},isBlob:S,deprecate(C,I){return C},addAbortListener:(a7(),J6(Q7)).addAbortListener||function(C,I){if(C===void 0)throw new Y("signal","AbortSignal",C);N(C,"signal"),h(I,"listener");let D;if(C.aborted)queueMicrotask(()=>I());else C.addEventListener("abort",I,{__proto__:null,once:!0,[O]:!0}),D=()=>{C.removeEventListener("abort",I)};return{__proto__:null,[T](){var L;(L=D)===null||L===void 0||L()}}},AbortSignalAny:H.any||function(C){if(C.length===1)return C[0];let I=new f,D=()=>I.abort();return C.forEach((L)=>{N(L,"signals"),L.addEventListener("abort",D,{once:!0})}),I.signal.addEventListener("abort",()=>{C.forEach((L)=>L.removeEventListener("abort",D))},{once:!0}),I.signal}},q.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),s7=S6(($,q)=>{var{ArrayIsArray:_,ArrayPrototypeIncludes:K,ArrayPrototypeJoin:P,ArrayPrototypeMap:Y,NumberIsInteger:O,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:T,NumberMIN_SAFE_INTEGER:H,NumberParseInt:f,ObjectPrototypeHasOwnProperty:w,RegExpPrototypeExec:k,String:S,StringPrototypeToUpperCase:N,StringPrototypeTrim:h}=x6(),{hideStackFrames:C,codes:{ERR_SOCKET_BAD_PORT:I,ERR_INVALID_ARG_TYPE:D,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:g,ERR_UNKNOWN_SIGNAL:y}}=cq(),{normalizeEncoding:p}=$8(),{isAsyncFunction:o,isArrayBufferView:s}=$8().types,Q={};function m(d){return d===(d|0)}function e(d){return d===d>>>0}var j=/^[0-7]+$/,W="must be a 32-bit unsigned integer or an octal string";function X(d,n,H$){if(typeof d>"u")d=H$;if(typeof d==="string"){if(k(j,d)===null)throw new L(n,d,W);d=f(d,8)}return G(d,n),d}var J=C((d,n,H$=H,t=T)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);if(d<H$||d>t)throw new g(n,`>= ${H$} && <= ${t}`,d)}),Z=C((d,n,H$=-2147483648,t=2147483647)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);if(d<H$||d>t)throw new g(n,`>= ${H$} && <= ${t}`,d)}),G=C((d,n,H$=!1)=>{if(typeof d!=="number")throw new D(n,"number",d);if(!O(d))throw new g(n,"an integer",d);let t=H$?1:0,U=4294967295;if(d<t||d>U)throw new g(n,`>= ${t} && <= ${U}`,d)});function M(d,n){if(typeof d!=="string")throw new D(n,"string",d)}function A(d,n,H$=void 0,t){if(typeof d!=="number")throw new D(n,"number",d);if(H$!=null&&d<H$||t!=null&&d>t||(H$!=null||t!=null)&&z(d))throw new g(n,`${H$!=null?`>= ${H$}`:""}${H$!=null&&t!=null?" && ":""}${t!=null?`<= ${t}`:""}`,d)}var v=C((d,n,H$)=>{if(!K(H$,d)){let t="must be one of: "+P(Y(H$,(U)=>typeof U==="string"?`'${U}'`:S(U)),", ");throw new L(n,d,t)}});function V(d,n){if(typeof d!=="boolean")throw new D(n,"boolean",d)}function R(d,n,H$){return d==null||!w(d,n)?H$:d[n]}var E=C((d,n,H$=null)=>{let t=R(H$,"allowArray",!1),U=R(H$,"allowFunction",!1);if(!R(H$,"nullable",!1)&&d===null||!t&&_(d)||typeof d!=="object"&&(!U||typeof d!=="function"))throw new D(n,"Object",d)}),b=C((d,n)=>{if(d!=null&&typeof d!=="object"&&typeof d!=="function")throw new D(n,"a dictionary",d)}),x=C((d,n,H$=0)=>{if(!_(d))throw new D(n,"Array",d);if(d.length<H$){let t=`must be longer than ${H$}`;throw new L(n,d,t)}});function l(d,n){x(d,n);for(let H$=0;H$<d.length;H$++)M(d[H$],`${n}[${H$}]`)}function F(d,n){x(d,n);for(let H$=0;H$<d.length;H$++)V(d[H$],`${n}[${H$}]`)}function f$(d,n){x(d,n);for(let H$=0;H$<d.length;H$++){let t=d[H$],U=`${n}[${H$}]`;if(t==null)throw new D(U,"AbortSignal",t);P$(t,U)}}function q$(d,n="signal"){if(M(d,n),Q[d]===void 0){if(Q[N(d)]!==void 0)throw new y(d+" (signals must use all capital letters)");throw new y(d)}}var B=C((d,n="buffer")=>{if(!s(d))throw new D(n,["Buffer","TypedArray","DataView"],d)});function v$(d,n){let H$=p(n),t=d.length;if(H$==="hex"&&t%2!==0)throw new L("encoding",n,`is invalid for data of length ${t}`)}function a(d,n="Port",H$=!0){if(typeof d!=="number"&&typeof d!=="string"||typeof d==="string"&&h(d).length===0||+d!==+d>>>0||d>65535||d===0&&!H$)throw new I(n,d,H$);return d|0}var P$=C((d,n)=>{if(d!==void 0&&(d===null||typeof d!=="object"||!("aborted"in d)))throw new D(n,"AbortSignal",d)}),o$=C((d,n)=>{if(typeof d!=="function")throw new D(n,"Function",d)}),c=C((d,n)=>{if(typeof d!=="function"||o(d))throw new D(n,"Function",d)}),r=C((d,n)=>{if(d!==void 0)throw new D(n,"undefined",d)});function J$(d,n,H$){if(!K(H$,d))throw new D(n,`('${P(H$,"|")}')`,d)}var $$=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function _$(d,n){if(typeof d>"u"||!k($$,d))throw new L(n,d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function O$(d){if(typeof d==="string")return _$(d,"hints"),d;else if(_(d)){let n=d.length,H$="";if(n===0)return H$;for(let t=0;t<n;t++){let U=d[t];if(_$(U,"hints"),H$+=U,t!==n-1)H$+=", "}return H$}throw new L("hints",d,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}q.exports={isInt32:m,isUint32:e,parseFileMode:X,validateArray:x,validateStringArray:l,validateBooleanArray:F,validateAbortSignalArray:f$,validateBoolean:V,validateBuffer:B,validateDictionary:b,validateEncoding:v$,validateFunction:o$,validateInt32:Z,validateInteger:J,validateNumber:A,validateObject:E,validateOneOf:v,validatePlainFunction:c,validatePort:a,validateSignalName:q$,validateString:M,validateUint32:G,validateUndefined:r,validateUnion:J$,validateAbortSignal:P$,validateLinkHeaderValue:O$}}),cK=S6(($,q)=>{q.exports=globalThis.process}),M_=S6(($,q)=>{var{SymbolAsyncIterator:_,SymbolIterator:K,SymbolFor:P}=x6(),Y=P("nodejs.stream.destroyed"),O=P("nodejs.stream.errored"),z=P("nodejs.stream.readable"),T=P("nodejs.stream.writable"),H=P("nodejs.stream.disturbed"),f=P("nodejs.webstream.isClosedPromise"),w=P("nodejs.webstream.controllerErrorFunction");function k(R,E=!1){var b;return!!(R&&typeof R.pipe==="function"&&typeof R.on==="function"&&(!E||typeof R.pause==="function"&&typeof R.resume==="function")&&(!R._writableState||((b=R._readableState)===null||b===void 0?void 0:b.readable)!==!1)&&(!R._writableState||R._readableState))}function S(R){var E;return!!(R&&typeof R.write==="function"&&typeof R.on==="function"&&(!R._readableState||((E=R._writableState)===null||E===void 0?void 0:E.writable)!==!1))}function N(R){return!!(R&&typeof R.pipe==="function"&&R._readableState&&typeof R.on==="function"&&typeof R.write==="function")}function h(R){return R&&(R._readableState||R._writableState||typeof R.write==="function"&&typeof R.on==="function"||typeof R.pipe==="function"&&typeof R.on==="function")}function C(R){return!!(R&&!h(R)&&typeof R.pipeThrough==="function"&&typeof R.getReader==="function"&&typeof R.cancel==="function")}function I(R){return!!(R&&!h(R)&&typeof R.getWriter==="function"&&typeof R.abort==="function")}function D(R){return!!(R&&!h(R)&&typeof R.readable==="object"&&typeof R.writable==="object")}function L(R){return C(R)||I(R)||D(R)}function g(R,E){if(R==null)return!1;if(E===!0)return typeof R[_]==="function";if(E===!1)return typeof R[K]==="function";return typeof R[_]==="function"||typeof R[K]==="function"}function y(R){if(!h(R))return null;let{_writableState:E,_readableState:b}=R,x=E||b;return!!(R.destroyed||R[Y]||x!==null&&x!==void 0&&x.destroyed)}function p(R){if(!S(R))return null;if(R.writableEnded===!0)return!0;let E=R._writableState;if(E!==null&&E!==void 0&&E.errored)return!1;if(typeof(E===null||E===void 0?void 0:E.ended)!=="boolean")return null;return E.ended}function o(R,E){if(!S(R))return null;if(R.writableFinished===!0)return!0;let b=R._writableState;if(b!==null&&b!==void 0&&b.errored)return!1;if(typeof(b===null||b===void 0?void 0:b.finished)!=="boolean")return null;return!!(b.finished||E===!1&&b.ended===!0&&b.length===0)}function s(R){if(!k(R))return null;if(R.readableEnded===!0)return!0;let E=R._readableState;if(!E||E.errored)return!1;if(typeof(E===null||E===void 0?void 0:E.ended)!=="boolean")return null;return E.ended}function Q(R,E){if(!k(R))return null;let b=R._readableState;if(b!==null&&b!==void 0&&b.errored)return!1;if(typeof(b===null||b===void 0?void 0:b.endEmitted)!=="boolean")return null;return!!(b.endEmitted||E===!1&&b.ended===!0&&b.length===0)}function m(R){if(R&&R[z]!=null)return R[z];if(typeof(R===null||R===void 0?void 0:R.readable)!=="boolean")return null;if(y(R))return!1;return k(R)&&R.readable&&!Q(R)}function e(R){if(R&&R[T]!=null)return R[T];if(typeof(R===null||R===void 0?void 0:R.writable)!=="boolean")return null;if(y(R))return!1;return S(R)&&R.writable&&!p(R)}function j(R,E){if(!h(R))return null;if(y(R))return!0;if((E===null||E===void 0?void 0:E.readable)!==!1&&m(R))return!1;if((E===null||E===void 0?void 0:E.writable)!==!1&&e(R))return!1;return!0}function W(R){var E,b;if(!h(R))return null;if(R.writableErrored)return R.writableErrored;return(E=(b=R._writableState)===null||b===void 0?void 0:b.errored)!==null&&E!==void 0?E:null}function X(R){var E,b;if(!h(R))return null;if(R.readableErrored)return R.readableErrored;return(E=(b=R._readableState)===null||b===void 0?void 0:b.errored)!==null&&E!==void 0?E:null}function J(R){if(!h(R))return null;if(typeof R.closed==="boolean")return R.closed;let{_writableState:E,_readableState:b}=R;if(typeof(E===null||E===void 0?void 0:E.closed)==="boolean"||typeof(b===null||b===void 0?void 0:b.closed)==="boolean")return(E===null||E===void 0?void 0:E.closed)||(b===null||b===void 0?void 0:b.closed);if(typeof R._closed==="boolean"&&Z(R))return R._closed;return null}function Z(R){return typeof R._closed==="boolean"&&typeof R._defaultKeepAlive==="boolean"&&typeof R._removedConnection==="boolean"&&typeof R._removedContLen==="boolean"}function G(R){return typeof R._sent100==="boolean"&&Z(R)}function M(R){var E;return typeof R._consuming==="boolean"&&typeof R._dumped==="boolean"&&((E=R.req)===null||E===void 0?void 0:E.upgradeOrConnect)===void 0}function A(R){if(!h(R))return null;let{_writableState:E,_readableState:b}=R,x=E||b;return!x&&G(R)||!!(x&&x.autoDestroy&&x.emitClose&&x.closed===!1)}function v(R){var E;return!!(R&&((E=R[H])!==null&&E!==void 0?E:R.readableDidRead||R.readableAborted))}function V(R){var E,b,x,l,F,f$,q$,B,v$,a;return!!(R&&((E=(b=(x=(l=(F=(f$=R[O])!==null&&f$!==void 0?f$:R.readableErrored)!==null&&F!==void 0?F:R.writableErrored)!==null&&l!==void 0?l:(q$=R._readableState)===null||q$===void 0?void 0:q$.errorEmitted)!==null&&x!==void 0?x:(B=R._writableState)===null||B===void 0?void 0:B.errorEmitted)!==null&&b!==void 0?b:(v$=R._readableState)===null||v$===void 0?void 0:v$.errored)!==null&&E!==void 0?E:(a=R._writableState)===null||a===void 0?void 0:a.errored))}q.exports={isDestroyed:y,kIsDestroyed:Y,isDisturbed:v,kIsDisturbed:H,isErrored:V,kIsErrored:O,isReadable:m,kIsReadable:z,kIsClosedPromise:f,kControllerErrorFunction:w,kIsWritable:T,isClosed:J,isDuplexNodeStream:N,isFinished:j,isIterable:g,isReadableNodeStream:k,isReadableStream:C,isReadableEnded:s,isReadableFinished:Q,isReadableErrored:X,isNodeStream:h,isWebStream:L,isWritable:e,isWritableNodeStream:S,isWritableStream:I,isWritableEnded:p,isWritableFinished:o,isWritableErrored:W,isServerRequest:M,isServerResponse:G,willEmitClose:A,isTransformStream:D}}),KK=S6(($,q)=>{var _=cK(),{AbortError:K,codes:P}=cq(),{ERR_INVALID_ARG_TYPE:Y,ERR_STREAM_PREMATURE_CLOSE:O}=P,{kEmptyObject:z,once:T}=$8(),{validateAbortSignal:H,validateFunction:f,validateObject:w,validateBoolean:k}=s7(),{Promise:S,PromisePrototypeThen:N,SymbolDispose:h}=x6(),{isClosed:C,isReadable:I,isReadableNodeStream:D,isReadableStream:L,isReadableFinished:g,isReadableErrored:y,isWritable:p,isWritableNodeStream:o,isWritableStream:s,isWritableFinished:Q,isWritableErrored:m,isNodeStream:e,willEmitClose:j,kIsClosedPromise:W}=M_(),X;function J(v){return v.setHeader&&typeof v.abort==="function"}var Z=()=>{};function G(v,V,R){var E,b;if(arguments.length===2)R=V,V=z;else if(V==null)V=z;else w(V,"options");if(f(R,"callback"),H(V.signal,"options.signal"),R=T(R),L(v)||s(v))return M(v,V,R);if(!e(v))throw new Y("stream",["ReadableStream","WritableStream","Stream"],v);let x=(E=V.readable)!==null&&E!==void 0?E:D(v),l=(b=V.writable)!==null&&b!==void 0?b:o(v),F=v._writableState,f$=v._readableState,q$=()=>{if(!v.writable)a()},B=j(v)&&D(v)===x&&o(v)===l,v$=Q(v,!1),a=()=>{if(v$=!0,v.destroyed)B=!1;if(B&&(!v.readable||x))return;if(!x||P$)R.call(v)},P$=g(v,!1),o$=()=>{if(P$=!0,v.destroyed)B=!1;if(B&&(!v.writable||l))return;if(!l||v$)R.call(v)},c=(d)=>{R.call(v,d)},r=C(v),J$=()=>{r=!0;let d=m(v)||y(v);if(d&&typeof d!=="boolean")return R.call(v,d);if(x&&!P$&&D(v,!0)){if(!g(v,!1))return R.call(v,new O)}if(l&&!v$){if(!Q(v,!1))return R.call(v,new O)}R.call(v)},$$=()=>{r=!0;let d=m(v)||y(v);if(d&&typeof d!=="boolean")return R.call(v,d);R.call(v)},_$=()=>{v.req.on("finish",a)};if(J(v)){if(v.on("complete",a),!B)v.on("abort",J$);if(v.req)_$();else v.on("request",_$)}else if(l&&!F)v.on("end",q$),v.on("close",q$);if(!B&&typeof v.aborted==="boolean")v.on("aborted",J$);if(v.on("end",o$),v.on("finish",a),V.error!==!1)v.on("error",c);if(v.on("close",J$),r)_.nextTick(J$);else if(F!==null&&F!==void 0&&F.errorEmitted||f$!==null&&f$!==void 0&&f$.errorEmitted){if(!B)_.nextTick($$)}else if(!x&&(!B||I(v))&&(v$||p(v)===!1))_.nextTick($$);else if(!l&&(!B||p(v))&&(P$||I(v)===!1))_.nextTick($$);else if(f$&&v.req&&v.aborted)_.nextTick($$);let O$=()=>{if(R=Z,v.removeListener("aborted",J$),v.removeListener("complete",a),v.removeListener("abort",J$),v.removeListener("request",_$),v.req)v.req.removeListener("finish",a);v.removeListener("end",q$),v.removeListener("close",q$),v.removeListener("finish",a),v.removeListener("end",o$),v.removeListener("error",c),v.removeListener("close",J$)};if(V.signal&&!r){let d=()=>{let n=R;O$(),n.call(v,new K(void 0,{cause:V.signal.reason}))};if(V.signal.aborted)_.nextTick(d);else{X=X||$8().addAbortListener;let n=X(V.signal,d),H$=R;R=T((...t)=>{n[h](),H$.apply(v,t)})}}return O$}function M(v,V,R){let E=!1,b=Z;if(V.signal)if(b=()=>{E=!0,R.call(v,new K(void 0,{cause:V.signal.reason}))},V.signal.aborted)_.nextTick(b);else{X=X||$8().addAbortListener;let l=X(V.signal,b),F=R;R=T((...f$)=>{l[h](),F.apply(v,f$)})}let x=(...l)=>{if(!E)_.nextTick(()=>R.apply(v,l))};return N(v[W].promise,x,x),Z}function A(v,V){var R;let E=!1;if(V===null)V=z;if((R=V)!==null&&R!==void 0&&R.cleanup)k(V.cleanup,"cleanup"),E=V.cleanup;return new S((b,x)=>{let l=G(v,V,(F)=>{if(E)l();if(F)x(F);else b()})})}q.exports=G,q.exports.finished=A}),n4=S6(($,q)=>{var _=cK(),{aggregateTwoErrors:K,codes:{ERR_MULTIPLE_CALLBACK:P},AbortError:Y}=cq(),{Symbol:O}=x6(),{kIsDestroyed:z,isDestroyed:T,isFinished:H,isServerRequest:f}=M_(),w=O("kDestroy"),k=O("kConstruct");function S(j,W,X){if(j){if(j.stack,W&&!W.errored)W.errored=j;if(X&&!X.errored)X.errored=j}}function N(j,W){let X=this._readableState,J=this._writableState,Z=J||X;if(J!==null&&J!==void 0&&J.destroyed||X!==null&&X!==void 0&&X.destroyed){if(typeof W==="function")W();return this}if(S(j,J,X),J)J.destroyed=!0;if(X)X.destroyed=!0;if(!Z.constructed)this.once(w,function(G){h(this,K(G,j),W)});else h(this,j,W);return this}function h(j,W,X){let J=!1;function Z(G){if(J)return;J=!0;let{_readableState:M,_writableState:A}=j;if(S(G,A,M),A)A.closed=!0;if(M)M.closed=!0;if(typeof X==="function")X(G);if(G)_.nextTick(C,j,G);else _.nextTick(I,j)}try{j._destroy(W||null,Z)}catch(G){Z(G)}}function C(j,W){D(j,W),I(j)}function I(j){let{_readableState:W,_writableState:X}=j;if(X)X.closeEmitted=!0;if(W)W.closeEmitted=!0;if(X!==null&&X!==void 0&&X.emitClose||W!==null&&W!==void 0&&W.emitClose)j.emit("close")}function D(j,W){let{_readableState:X,_writableState:J}=j;if(J!==null&&J!==void 0&&J.errorEmitted||X!==null&&X!==void 0&&X.errorEmitted)return;if(J)J.errorEmitted=!0;if(X)X.errorEmitted=!0;j.emit("error",W)}function L(){let j=this._readableState,W=this._writableState;if(j)j.constructed=!0,j.closed=!1,j.closeEmitted=!1,j.destroyed=!1,j.errored=null,j.errorEmitted=!1,j.reading=!1,j.ended=j.readable===!1,j.endEmitted=j.readable===!1;if(W)W.constructed=!0,W.destroyed=!1,W.closed=!1,W.closeEmitted=!1,W.errored=null,W.errorEmitted=!1,W.finalCalled=!1,W.prefinished=!1,W.ended=W.writable===!1,W.ending=W.writable===!1,W.finished=W.writable===!1}function g(j,W,X){let{_readableState:J,_writableState:Z}=j;if(Z!==null&&Z!==void 0&&Z.destroyed||J!==null&&J!==void 0&&J.destroyed)return this;if(J!==null&&J!==void 0&&J.autoDestroy||Z!==null&&Z!==void 0&&Z.autoDestroy)j.destroy(W);else if(W){if(W.stack,Z&&!Z.errored)Z.errored=W;if(J&&!J.errored)J.errored=W;if(X)_.nextTick(D,j,W);else D(j,W)}}function y(j,W){if(typeof j._construct!=="function")return;let{_readableState:X,_writableState:J}=j;if(X)X.constructed=!1;if(J)J.constructed=!1;if(j.once(k,W),j.listenerCount(k)>1)return;_.nextTick(p,j)}function p(j){let W=!1;function X(J){if(W){g(j,J!==null&&J!==void 0?J:new P);return}W=!0;let{_readableState:Z,_writableState:G}=j,M=G||Z;if(Z)Z.constructed=!0;if(G)G.constructed=!0;if(M.destroyed)j.emit(w,J);else if(J)g(j,J,!0);else _.nextTick(o,j)}try{j._construct((J)=>{_.nextTick(X,J)})}catch(J){_.nextTick(X,J)}}function o(j){j.emit(k)}function s(j){return(j===null||j===void 0?void 0:j.setHeader)&&typeof j.abort==="function"}function Q(j){j.emit("close")}function m(j,W){j.emit("error",W),_.nextTick(Q,j)}function e(j,W){if(!j||T(j))return;if(!W&&!H(j))W=new Y;if(f(j))j.socket=null,j.destroy(W);else if(s(j))j.abort();else if(s(j.req))j.req.abort();else if(typeof j.destroy==="function")j.destroy(W);else if(typeof j.close==="function")j.close();else if(W)_.nextTick(m,j,W);else _.nextTick(Q,j);if(!j.destroyed)j[z]=!0}q.exports={construct:y,destroyer:e,destroy:N,undestroy:L,errorOrDestroy:g}}),wH=S6(($,q)=>{var{ArrayIsArray:_,ObjectSetPrototypeOf:K}=x6(),{EventEmitter:P}=(a7(),J6(Q7));function Y(z){P.call(this,z)}K(Y.prototype,P.prototype),K(Y,P),Y.prototype.pipe=function(z,T){let H=this;function f(I){if(z.writable&&z.write(I)===!1&&H.pause)H.pause()}H.on("data",f);function w(){if(H.readable&&H.resume)H.resume()}if(z.on("drain",w),!z._isStdio&&(!T||T.end!==!1))H.on("end",S),H.on("close",N);let k=!1;function S(){if(k)return;k=!0,z.end()}function N(){if(k)return;if(k=!0,typeof z.destroy==="function")z.destroy()}function h(I){if(C(),P.listenerCount(this,"error")===0)this.emit("error",I)}O(H,"error",h),O(z,"error",h);function C(){H.removeListener("data",f),z.removeListener("drain",w),H.removeListener("end",S),H.removeListener("close",N),H.removeListener("error",h),z.removeListener("error",h),H.removeListener("end",C),H.removeListener("close",C),z.removeListener("close",C)}return H.on("end",C),H.on("close",C),z.on("close",C),z.emit("pipe",H),z};function O(z,T,H){if(typeof z.prependListener==="function")return z.prependListener(T,H);if(!z._events||!z._events[T])z.on(T,H);else if(_(z._events[T]))z._events[T].unshift(H);else z._events[T]=[H,z._events[T]]}q.exports={Stream:Y,prependListener:O}}),X2=S6(($,q)=>{var{SymbolDispose:_}=x6(),{AbortError:K,codes:P}=cq(),{isNodeStream:Y,isWebStream:O,kControllerErrorFunction:z}=M_(),T=KK(),{ERR_INVALID_ARG_TYPE:H}=P,f,w=(k,S)=>{if(typeof k!=="object"||!("aborted"in k))throw new H(S,"AbortSignal",k)};q.exports.addAbortSignal=function(k,S){if(w(k,"signal"),!Y(S)&&!O(S))throw new H("stream",["ReadableStream","WritableStream","Stream"],S);return q.exports.addAbortSignalNoValidate(k,S)},q.exports.addAbortSignalNoValidate=function(k,S){if(typeof k!=="object"||!("aborted"in k))return S;let N=Y(S)?()=>{S.destroy(new K(void 0,{cause:k.reason}))}:()=>{S[z](new K(void 0,{cause:k.reason}))};if(k.aborted)N();else{f=f||$8().addAbortListener;let h=f(k,N);T(S,h[_])}return S}}),bn=S6(($,q)=>{var{StringPrototypeSlice:_,SymbolIterator:K,TypedArrayPrototypeSet:P,Uint8Array:Y}=x6(),{Buffer:O}=(wq(),J6(Tq)),{inspect:z}=$8();q.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(T){let H={data:T,next:null};if(this.length>0)this.tail.next=H;else this.head=H;this.tail=H,++this.length}unshift(T){let H={data:T,next:this.head};if(this.length===0)this.tail=H;this.head=H,++this.length}shift(){if(this.length===0)return;let T=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,T}clear(){this.head=this.tail=null,this.length=0}join(T){if(this.length===0)return"";let H=this.head,f=""+H.data;while((H=H.next)!==null)f+=T+H.data;return f}concat(T){if(this.length===0)return O.alloc(0);let H=O.allocUnsafe(T>>>0),f=this.head,w=0;while(f)P(H,f.data,w),w+=f.data.length,f=f.next;return H}consume(T,H){let f=this.head.data;if(T<f.length){let w=f.slice(0,T);return this.head.data=f.slice(T),w}if(T===f.length)return this.shift();return H?this._getString(T):this._getBuffer(T)}first(){return this.head.data}*[K](){for(let T=this.head;T;T=T.next)yield T.data}_getString(T){let H="",f=this.head,w=0;do{let k=f.data;if(T>k.length)H+=k,T-=k.length;else{if(T===k.length)if(H+=k,++w,f.next)this.head=f.next;else this.head=this.tail=null;else H+=_(k,0,T),this.head=f,f.data=_(k,T);break}++w}while((f=f.next)!==null);return this.length-=w,H}_getBuffer(T){let H=O.allocUnsafe(T),f=T,w=this.head,k=0;do{let S=w.data;if(T>S.length)P(H,S,f-T),T-=S.length;else{if(T===S.length)if(P(H,S,f-T),++k,w.next)this.head=w.next;else this.head=this.tail=null;else P(H,new Y(S.buffer,S.byteOffset,T),f-T),this.head=w,w.data=S.slice(T);break}++k}while((w=w.next)!==null);return this.length-=k,H}[Symbol.for("nodejs.util.inspect.custom")](T,H){return z(this,{...H,depth:0,customInspect:!1})}}}),A2=S6(($,q)=>{var{MathFloor:_,NumberIsInteger:K}=x6(),{validateInteger:P}=s7(),{ERR_INVALID_ARG_VALUE:Y}=cq().codes,O=16384,z=16;function T(k,S,N){return k.highWaterMark!=null?k.highWaterMark:S?k[N]:null}function H(k){return k?z:O}function f(k,S){if(P(S,"value",0),k)z=S;else O=S}function w(k,S,N,h){let C=T(S,h,N);if(C!=null){if(!K(C)||C<0){let I=h?`options.${N}`:"options.highWaterMark";throw new Y(I,C)}return _(C)}return H(k.objectMode)}q.exports={getHighWaterMark:w,getDefaultHighWaterMark:H,setDefaultHighWaterMark:f}}),gn=S6(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _=(wq(),J6(Tq)),K=_.Buffer;function P(O,z){for(var T in O)z[T]=O[T]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=_;else P(_,$),$.Buffer=Y;function Y(O,z,T){return K(O,z,T)}Y.prototype=Object.create(K.prototype),P(K,Y),Y.from=function(O,z,T){if(typeof O==="number")throw TypeError("Argument must not be a number");return K(O,z,T)},Y.alloc=function(O,z,T){if(typeof O!=="number")throw TypeError("Argument must be a number");var H=K(O);if(z!==void 0)if(typeof T==="string")H.fill(z,T);else H.fill(z);else H.fill(0);return H},Y.allocUnsafe=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return K(O)},Y.allocUnsafeSlow=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return _.SlowBuffer(O)}}),yn=S6(($)=>{var q=gn().Buffer,_=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 K(D){if(!D)return"utf8";var L;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(L)return;D=(""+D).toLowerCase(),L=!0}}function P(D){var L=K(D);if(typeof L!=="string"&&(q.isEncoding===_||!_(D)))throw Error("Unknown encoding: "+D);return L||D}$.StringDecoder=Y;function Y(D){this.encoding=P(D);var L;switch(this.encoding){case"utf16le":this.text=k,this.end=S,L=4;break;case"utf8":this.fillLast=H,L=4;break;case"base64":this.text=N,this.end=h,L=3;break;default:this.write=C,this.end=I;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=q.allocUnsafe(L)}Y.prototype.write=function(D){if(D.length===0)return"";var L,g;if(this.lastNeed){if(L=this.fillLast(D),L===void 0)return"";g=this.lastNeed,this.lastNeed=0}else g=0;if(g<D.length)return L?L+this.text(D,g):this.text(D,g);return L||""},Y.prototype.end=w,Y.prototype.text=f,Y.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 O(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,L,g){var y=L.length-1;if(y<g)return 0;var p=O(L[y]);if(p>=0){if(p>0)D.lastNeed=p-1;return p}if(--y<g||p===-2)return 0;if(p=O(L[y]),p>=0){if(p>0)D.lastNeed=p-2;return p}if(--y<g||p===-2)return 0;if(p=O(L[y]),p>=0){if(p>0)if(p===2)p=0;else D.lastNeed=p-3;return p}return 0}function T(D,L,g){if((L[0]&192)!==128)return D.lastNeed=0,"�";if(D.lastNeed>1&&L.length>1){if((L[1]&192)!==128)return D.lastNeed=1,"�";if(D.lastNeed>2&&L.length>2){if((L[2]&192)!==128)return D.lastNeed=2,"�"}}}function H(D){var L=this.lastTotal-this.lastNeed,g=T(this,D,L);if(g!==void 0)return g;if(this.lastNeed<=D.length)return D.copy(this.lastChar,L,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);D.copy(this.lastChar,L,0,D.length),this.lastNeed-=D.length}function f(D,L){var g=z(this,D,L);if(!this.lastNeed)return D.toString("utf8",L);this.lastTotal=g;var y=D.length-(g-this.lastNeed);return D.copy(this.lastChar,0,y),D.toString("utf8",L,y)}function w(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed)return L+"�";return L}function k(D,L){if((D.length-L)%2===0){var g=D.toString("utf16le",L);if(g){var y=g.charCodeAt(g.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],g.slice(0,-1)}return g}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=D[D.length-1],D.toString("utf16le",L,D.length-1)}function S(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed){var g=this.lastTotal-this.lastNeed;return L+this.lastChar.toString("utf16le",0,g)}return L}function N(D,L){var g=(D.length-L)%3;if(g===0)return D.toString("base64",L);if(this.lastNeed=3-g,this.lastTotal=3,g===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",L,D.length-g)}function h(D){var L=D&&D.length?this.write(D):"";if(this.lastNeed)return L+this.lastChar.toString("base64",0,3-this.lastNeed);return L}function C(D){return D.toString(this.encoding)}function I(D){return D&&D.length?this.write(D):""}}),i0=S6(($,q)=>{var _=cK(),{PromisePrototypeThen:K,SymbolAsyncIterator:P,SymbolIterator:Y}=x6(),{Buffer:O}=(wq(),J6(Tq)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:T}=cq().codes;function H(f,w,k){let S;if(typeof w==="string"||w instanceof O)return new f({objectMode:!0,...k,read(){this.push(w),this.push(null)}});let N;if(w&&w[P])N=!0,S=w[P]();else if(w&&w[Y])N=!1,S=w[Y]();else throw new z("iterable",["Iterable"],w);let h=new f({objectMode:!0,highWaterMark:1,...k}),C=!1;h._read=function(){if(!C)C=!0,D()},h._destroy=function(L,g){K(I(L),()=>_.nextTick(g,L),(y)=>_.nextTick(g,y||L))};async function I(L){let g=L!==void 0&&L!==null,y=typeof S.throw==="function";if(g&&y){let{value:p,done:o}=await S.throw(L);if(await p,o)return}if(typeof S.return==="function"){let{value:p}=await S.return();await p}}async function D(){for(;;){try{let{value:L,done:g}=N?await S.next():S.next();if(g)h.push(null);else{let y=L&&typeof L.then==="function"?await L:L;if(y===null)throw C=!1,new T;else if(h.push(y))continue;else C=!1}}catch(L){h.destroy(L)}break}}return h}q.exports=H}),k2=S6(($,q)=>{var _=cK(),{ArrayPrototypeIndexOf:K,NumberIsInteger:P,NumberIsNaN:Y,NumberParseInt:O,ObjectDefineProperties:z,ObjectKeys:T,ObjectSetPrototypeOf:H,Promise:f,SafeSet:w,SymbolAsyncDispose:k,SymbolAsyncIterator:S,Symbol:N}=x6();q.exports=t,t.ReadableState=H$;var{EventEmitter:h}=(a7(),J6(Q7)),{Stream:C,prependListener:I}=wH(),{Buffer:D}=(wq(),J6(Tq)),{addAbortSignal:L}=X2(),g=KK(),y=$8().debuglog("stream",(u)=>{y=u}),p=bn(),o=n4(),{getHighWaterMark:s,getDefaultHighWaterMark:Q}=A2(),{aggregateTwoErrors:m,codes:{ERR_INVALID_ARG_TYPE:e,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:J},AbortError:Z}=cq(),{validateObject:G}=s7(),M=N("kPaused"),{StringDecoder:A}=yn(),v=i0();H(t.prototype,C.prototype),H(t,C);var V=()=>{},{errorOrDestroy:R}=o,E=1,b=2,x=4,l=8,F=16,f$=32,q$=64,B=128,v$=256,a=512,P$=1024,o$=2048,c=4096,r=8192,J$=16384,$$=32768,_$=65536,O$=131072,d=262144;function n(u){return{enumerable:!1,get(){return(this.state&u)!==0},set(i){if(i)this.state|=u;else this.state&=~u}}}z(H$.prototype,{objectMode:n(E),ended:n(b),endEmitted:n(x),reading:n(l),constructed:n(F),sync:n(f$),needReadable:n(q$),emittedReadable:n(B),readableListening:n(v$),resumeScheduled:n(a),errorEmitted:n(P$),emitClose:n(o$),autoDestroy:n(c),destroyed:n(r),closed:n(J$),closeEmitted:n($$),multiAwaitDrain:n(_$),readingMore:n(O$),dataEmitted:n(d)});function H$(u,i,K$){if(typeof K$!=="boolean")K$=i instanceof S_();if(this.state=o$|c|F|f$,u&&u.objectMode)this.state|=E;if(K$&&u&&u.readableObjectMode)this.state|=E;if(this.highWaterMark=u?s(this,u,"readableHighWaterMark",K$):Q(!1),this.buffer=new p,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,u&&u.emitClose===!1)this.state&=~o$;if(u&&u.autoDestroy===!1)this.state&=~c;if(this.errored=null,this.defaultEncoding=u&&u.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,u&&u.encoding)this.decoder=new A(u.encoding),this.encoding=u.encoding}function t(u){if(!(this instanceof t))return new t(u);let i=this instanceof S_();if(this._readableState=new H$(u,this,i),u){if(typeof u.read==="function")this._read=u.read;if(typeof u.destroy==="function")this._destroy=u.destroy;if(typeof u.construct==="function")this._construct=u.construct;if(u.signal&&!i)L(u.signal,this)}C.call(this,u),o.construct(this,()=>{if(this._readableState.needReadable)M$(this,this._readableState)})}t.prototype.destroy=o.destroy,t.prototype._undestroy=o.undestroy,t.prototype._destroy=function(u,i){i(u)},t.prototype[h.captureRejectionSymbol]=function(u){this.destroy(u)},t.prototype[k]=function(){let u;if(!this.destroyed)u=this.readableEnded?null:new Z,this.destroy(u);return new f((i,K$)=>g(this,(Y$)=>Y$&&Y$!==u?K$(Y$):i(null)))},t.prototype.push=function(u,i){return U(this,u,i,!1)},t.prototype.unshift=function(u,i){return U(this,u,i,!0)};function U(u,i,K$,Y$){y("readableAddChunk",i);let B$=u._readableState,G$;if((B$.state&E)===0){if(typeof i==="string"){if(K$=K$||B$.defaultEncoding,B$.encoding!==K$)if(Y$&&B$.encoding)i=D.from(i,K$).toString(B$.encoding);else i=D.from(i,K$),K$=""}else if(i instanceof D)K$="";else if(C._isUint8Array(i))i=C._uint8ArrayToBuffer(i),K$="";else if(i!=null)G$=new e("chunk",["string","Buffer","Uint8Array"],i)}if(G$)R(u,G$);else if(i===null)B$.state&=~l,X$(u,B$);else if((B$.state&E)!==0||i&&i.length>0)if(Y$)if((B$.state&x)!==0)R(u,new J);else if(B$.destroyed||B$.errored)return!1;else A$(u,B$,i,!0);else if(B$.ended)R(u,new X);else if(B$.destroyed||B$.errored)return!1;else if(B$.state&=~l,B$.decoder&&!K$)if(i=B$.decoder.write(i),B$.objectMode||i.length!==0)A$(u,B$,i,!1);else M$(u,B$);else A$(u,B$,i,!1);else if(!Y$)B$.state&=~l,M$(u,B$);return!B$.ended&&(B$.length<B$.highWaterMark||B$.length===0)}function A$(u,i,K$,Y$){if(i.flowing&&i.length===0&&!i.sync&&u.listenerCount("data")>0){if((i.state&_$)!==0)i.awaitDrainWriters.clear();else i.awaitDrainWriters=null;i.dataEmitted=!0,u.emit("data",K$)}else{if(i.length+=i.objectMode?1:K$.length,Y$)i.buffer.unshift(K$);else i.buffer.push(K$);if((i.state&q$)!==0)k$(u)}M$(u,i)}t.prototype.isPaused=function(){let u=this._readableState;return u[M]===!0||u.flowing===!1},t.prototype.setEncoding=function(u){let i=new A(u);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;let K$=this._readableState.buffer,Y$="";for(let B$ of K$)Y$+=i.write(B$);if(K$.clear(),Y$!=="")K$.push(Y$);return this._readableState.length=Y$.length,this};var W$=1073741824;function z$(u){if(u>W$)throw new W("size","<= 1GiB",u);else u--,u|=u>>>1,u|=u>>>2,u|=u>>>4,u|=u>>>8,u|=u>>>16,u++;return u}function Z6(u,i){if(u<=0||i.length===0&&i.ended)return 0;if((i.state&E)!==0)return 1;if(Y(u)){if(i.flowing&&i.length)return i.buffer.first().length;return i.length}if(u<=i.length)return u;return i.ended?i.length:0}t.prototype.read=function(u){if(y("read",u),u===void 0)u=NaN;else if(!P(u))u=O(u,10);let i=this._readableState,K$=u;if(u>i.highWaterMark)i.highWaterMark=z$(u);if(u!==0)i.state&=~B;if(u===0&&i.needReadable&&((i.highWaterMark!==0?i.length>=i.highWaterMark:i.length>0)||i.ended)){if(y("read: emitReadable",i.length,i.ended),i.length===0&&i.ended)zq(this);else k$(this);return null}if(u=Z6(u,i),u===0&&i.ended){if(i.length===0)zq(this);return null}let Y$=(i.state&q$)!==0;if(y("need readable",Y$),i.length===0||i.length-u<i.highWaterMark)Y$=!0,y("length less than watermark",Y$);if(i.ended||i.reading||i.destroyed||i.errored||!i.constructed)Y$=!1,y("reading, ended or constructing",Y$);else if(Y$){if(y("do read"),i.state|=l|f$,i.length===0)i.state|=q$;try{this._read(i.highWaterMark)}catch(G$){R(this,G$)}if(i.state&=~f$,!i.reading)u=Z6(K$,i)}let B$;if(u>0)B$=R$(u,i);else B$=null;if(B$===null)i.needReadable=i.length<=i.highWaterMark,u=0;else if(i.length-=u,i.multiAwaitDrain)i.awaitDrainWriters.clear();else i.awaitDrainWriters=null;if(i.length===0){if(!i.ended)i.needReadable=!0;if(K$!==u&&i.ended)zq(this)}if(B$!==null&&!i.errorEmitted&&!i.closeEmitted)i.dataEmitted=!0,this.emit("data",B$);return B$};function X$(u,i){if(y("onEofChunk"),i.ended)return;if(i.decoder){let K$=i.decoder.end();if(K$&&K$.length)i.buffer.push(K$),i.length+=i.objectMode?1:K$.length}if(i.ended=!0,i.sync)k$(u);else i.needReadable=!1,i.emittedReadable=!0,o6(u)}function k$(u){let i=u._readableState;if(y("emitReadable",i.needReadable,i.emittedReadable),i.needReadable=!1,!i.emittedReadable)y("emitReadable",i.flowing),i.emittedReadable=!0,_.nextTick(o6,u)}function o6(u){let i=u._readableState;if(y("emitReadable_",i.destroyed,i.length,i.ended),!i.destroyed&&!i.errored&&(i.length||i.ended))u.emit("readable"),i.emittedReadable=!1;i.needReadable=!i.flowing&&!i.ended&&i.length<=i.highWaterMark,h$(u)}function M$(u,i){if(!i.readingMore&&i.constructed)i.readingMore=!0,_.nextTick(S$,u,i)}function S$(u,i){while(!i.reading&&!i.ended&&(i.length<i.highWaterMark||i.flowing&&i.length===0)){let K$=i.length;if(y("maybeReadMore read 0"),u.read(0),K$===i.length)break}i.readingMore=!1}t.prototype._read=function(u){throw new j("_read()")},t.prototype.pipe=function(u,i){let K$=this,Y$=this._readableState;if(Y$.pipes.length===1){if(!Y$.multiAwaitDrain)Y$.multiAwaitDrain=!0,Y$.awaitDrainWriters=new w(Y$.awaitDrainWriters?[Y$.awaitDrainWriters]:[])}Y$.pipes.push(u),y("pipe count=%d opts=%j",Y$.pipes.length,i);let B$=(!i||i.end!==!1)&&u!==_.stdout&&u!==_.stderr?V$:j6;if(Y$.endEmitted)_.nextTick(B$);else K$.once("end",B$);u.on("unpipe",G$);function G$(E6,M6){if(y("onunpipe"),E6===K$){if(M6&&M6.hasUnpiped===!1)M6.hasUnpiped=!0,p$()}}function V$(){y("onend"),u.end()}let p6,D$=!1;function p$(){if(y("cleanup"),u.removeListener("close",c6),u.removeListener("finish",W6),p6)u.removeListener("drain",p6);if(u.removeListener("error",C$),u.removeListener("unpipe",G$),K$.removeListener("end",V$),K$.removeListener("end",j6),K$.removeListener("data",L$),D$=!0,p6&&Y$.awaitDrainWriters&&(!u._writableState||u._writableState.needDrain))p6()}function Zq(){if(!D$){if(Y$.pipes.length===1&&Y$.pipes[0]===u)y("false write response, pause",0),Y$.awaitDrainWriters=u,Y$.multiAwaitDrain=!1;else if(Y$.pipes.length>1&&Y$.pipes.includes(u))y("false write response, pause",Y$.awaitDrainWriters.size),Y$.awaitDrainWriters.add(u);K$.pause()}if(!p6)p6=Sq(K$,u),u.on("drain",p6)}K$.on("data",L$);function L$(E6){y("ondata");let M6=u.write(E6);if(y("dest.write",M6),M6===!1)Zq()}function C$(E6){if(y("onerror",E6),j6(),u.removeListener("error",C$),u.listenerCount("error")===0){let M6=u._writableState||u._readableState;if(M6&&!M6.errorEmitted)R(u,E6);else u.emit("error",E6)}}I(u,"error",C$);function c6(){u.removeListener("finish",W6),j6()}u.once("close",c6);function W6(){y("onfinish"),u.removeListener("close",c6),j6()}u.once("finish",W6);function j6(){y("unpipe"),K$.unpipe(u)}if(u.emit("pipe",K$),u.writableNeedDrain===!0)Zq();else if(!Y$.flowing)y("pipe resume"),K$.resume();return u};function Sq(u,i){return function(){let K$=u._readableState;if(K$.awaitDrainWriters===i)y("pipeOnDrain",1),K$.awaitDrainWriters=null;else if(K$.multiAwaitDrain)y("pipeOnDrain",K$.awaitDrainWriters.size),K$.awaitDrainWriters.delete(i);if((!K$.awaitDrainWriters||K$.awaitDrainWriters.size===0)&&u.listenerCount("data"))u.resume()}}t.prototype.unpipe=function(u){let i=this._readableState,K$={hasUnpiped:!1};if(i.pipes.length===0)return this;if(!u){let B$=i.pipes;i.pipes=[],this.pause();for(let G$=0;G$<B$.length;G$++)B$[G$].emit("unpipe",this,{hasUnpiped:!1});return this}let Y$=K(i.pipes,u);if(Y$===-1)return this;if(i.pipes.splice(Y$,1),i.pipes.length===0)this.pause();return u.emit("unpipe",this,K$),this},t.prototype.on=function(u,i){let K$=C.prototype.on.call(this,u,i),Y$=this._readableState;if(u==="data"){if(Y$.readableListening=this.listenerCount("readable")>0,Y$.flowing!==!1)this.resume()}else if(u==="readable"){if(!Y$.endEmitted&&!Y$.readableListening){if(Y$.readableListening=Y$.needReadable=!0,Y$.flowing=!1,Y$.emittedReadable=!1,y("on readable",Y$.length,Y$.reading),Y$.length)k$(this);else if(!Y$.reading)_.nextTick(b$,this)}}return K$},t.prototype.addListener=t.prototype.on,t.prototype.removeListener=function(u,i){let K$=C.prototype.removeListener.call(this,u,i);if(u==="readable")_.nextTick(E$,this);return K$},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(u){let i=C.prototype.removeAllListeners.apply(this,arguments);if(u==="readable"||u===void 0)_.nextTick(E$,this);return i};function E$(u){let i=u._readableState;if(i.readableListening=u.listenerCount("readable")>0,i.resumeScheduled&&i[M]===!1)i.flowing=!0;else if(u.listenerCount("data")>0)u.resume();else if(!i.readableListening)i.flowing=null}function b$(u){y("readable nexttick read 0"),u.read(0)}t.prototype.resume=function(){let u=this._readableState;if(!u.flowing)y("resume"),u.flowing=!u.readableListening,Mq(this,u);return u[M]=!1,this};function Mq(u,i){if(!i.resumeScheduled)i.resumeScheduled=!0,_.nextTick(g$,u,i)}function g$(u,i){if(y("resume",i.reading),!i.reading)u.read(0);if(i.resumeScheduled=!1,u.emit("resume"),h$(u),i.flowing&&!i.reading)u.read(0)}t.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[M]=!0,this};function h$(u){let i=u._readableState;y("flow",i.flowing);while(i.flowing&&u.read()!==null);}t.prototype.wrap=function(u){let i=!1;u.on("data",(Y$)=>{if(!this.push(Y$)&&u.pause)i=!0,u.pause()}),u.on("end",()=>{this.push(null)}),u.on("error",(Y$)=>{R(this,Y$)}),u.on("close",()=>{this.destroy()}),u.on("destroy",()=>{this.destroy()}),this._read=()=>{if(i&&u.resume)i=!1,u.resume()};let K$=T(u);for(let Y$=1;Y$<K$.length;Y$++){let B$=K$[Y$];if(this[B$]===void 0&&typeof u[B$]==="function")this[B$]=u[B$].bind(u)}return this},t.prototype[S]=function(){return fq(this)},t.prototype.iterator=function(u){if(u!==void 0)G(u,"options");return fq(this,u)};function fq(u,i){if(typeof u.read!=="function")u=t.wrap(u,{objectMode:!0});let K$=y$(u,i);return K$.stream=u,K$}async function*y$(u,i){let K$=V;function Y$(V$){if(this===u)K$(),K$=V;else K$=V$}u.on("readable",Y$);let B$,G$=g(u,{writable:!1},(V$)=>{B$=V$?m(B$,V$):null,K$(),K$=V});try{while(!0){let V$=u.destroyed?null:u.read();if(V$!==null)yield V$;else if(B$)throw B$;else if(B$===null)return;else await new f(Y$)}}catch(V$){throw B$=m(B$,V$),B$}finally{if((B$||(i===null||i===void 0?void 0:i.destroyOnReturn)!==!1)&&(B$===void 0||u._readableState.autoDestroy))o.destroyer(u,null);else u.off("readable",Y$),G$()}}z(t.prototype,{readable:{__proto__:null,get(){let u=this._readableState;return!!u&&u.readable!==!1&&!u.destroyed&&!u.errorEmitted&&!u.endEmitted},set(u){if(this._readableState)this._readableState.readable=!!u}},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(u){if(this._readableState)this._readableState.flowing=u}},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(u){if(!this._readableState)return;this._readableState.destroyed=u}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(H$.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[M]!==!1},set(u){this[M]=!!u}}}),t._fromList=R$;function R$(u,i){if(i.length===0)return null;let K$;if(i.objectMode)K$=i.buffer.shift();else if(!u||u>=i.length){if(i.decoder)K$=i.buffer.join("");else if(i.buffer.length===1)K$=i.buffer.first();else K$=i.buffer.concat(i.length);i.buffer.clear()}else K$=i.buffer.consume(u,i.decoder);return K$}function zq(u){let i=u._readableState;if(y("endReadable",i.endEmitted),!i.endEmitted)i.ended=!0,_.nextTick(u$,i,u)}function u$(u,i){if(y("endReadableNT",u.endEmitted,u.length),!u.errored&&!u.closeEmitted&&!u.endEmitted&&u.length===0){if(u.endEmitted=!0,i.emit("end"),i.writable&&i.allowHalfOpen===!1)_.nextTick(x$,i);else if(u.autoDestroy){let K$=i._writableState;if(!K$||K$.autoDestroy&&(K$.finished||K$.writable===!1))i.destroy()}}}function x$(u){if(u.writable&&!u.writableEnded&&!u.destroyed)u.end()}t.from=function(u,i){return v(t,u,i)};var Wq;function I$(){if(Wq===void 0)Wq={};return Wq}t.fromWeb=function(u,i){return I$().newStreamReadableFromReadableStream(u,i)},t.toWeb=function(u,i){return I$().newReadableStreamFromStreamReadable(u,i)},t.wrap=function(u,i){var K$,Y$;return new t({objectMode:(K$=(Y$=u.readableObjectMode)!==null&&Y$!==void 0?Y$:u.objectMode)!==null&&K$!==void 0?K$:!0,...i,destroy(B$,G$){o.destroyer(u,B$),G$(B$)}}).wrap(u)}}),fH=S6(($,q)=>{var _=cK(),{ArrayPrototypeSlice:K,Error:P,FunctionPrototypeSymbolHasInstance:Y,ObjectDefineProperty:O,ObjectDefineProperties:z,ObjectSetPrototypeOf:T,StringPrototypeToLowerCase:H,Symbol:f,SymbolHasInstance:w}=x6();q.exports=G,G.WritableState=J;var{EventEmitter:k}=(a7(),J6(Q7)),S=wH().Stream,{Buffer:N}=(wq(),J6(Tq)),h=n4(),{addAbortSignal:C}=X2(),{getHighWaterMark:I,getDefaultHighWaterMark:D}=A2(),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:g,ERR_MULTIPLE_CALLBACK:y,ERR_STREAM_CANNOT_PIPE:p,ERR_STREAM_DESTROYED:o,ERR_STREAM_ALREADY_FINISHED:s,ERR_STREAM_NULL_VALUES:Q,ERR_STREAM_WRITE_AFTER_END:m,ERR_UNKNOWN_ENCODING:e}=cq().codes,{errorOrDestroy:j}=h;T(G.prototype,S.prototype),T(G,S);function W(){}var X=f("kOnFinished");function J(c,r,J$){if(typeof J$!=="boolean")J$=r instanceof S_();if(this.objectMode=!!(c&&c.objectMode),J$)this.objectMode=this.objectMode||!!(c&&c.writableObjectMode);this.highWaterMark=c?I(this,c,"writableHighWaterMark",J$):D(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let $$=!!(c&&c.decodeStrings===!1);this.decodeStrings=!$$,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Z(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!c||c.emitClose!==!1,this.autoDestroy=!c||c.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function Z(c){c.buffered=[],c.bufferedIndex=0,c.allBuffers=!0,c.allNoop=!0}J.prototype.getBuffer=function(){return K(this.buffered,this.bufferedIndex)},O(J.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function G(c){let r=this instanceof S_();if(!r&&!Y(G,this))return new G(c);if(this._writableState=new J(c,this,r),c){if(typeof c.write==="function")this._write=c.write;if(typeof c.writev==="function")this._writev=c.writev;if(typeof c.destroy==="function")this._destroy=c.destroy;if(typeof c.final==="function")this._final=c.final;if(typeof c.construct==="function")this._construct=c.construct;if(c.signal)C(c.signal,this)}S.call(this,c),h.construct(this,()=>{let J$=this._writableState;if(!J$.writing)l(this,J$);B(this,J$)})}O(G,w,{__proto__:null,value:function(c){if(Y(this,c))return!0;if(this!==G)return!1;return c&&c._writableState instanceof J}}),G.prototype.pipe=function(){j(this,new p)};function M(c,r,J$,$$){let _$=c._writableState;if(typeof J$==="function")$$=J$,J$=_$.defaultEncoding;else{if(!J$)J$=_$.defaultEncoding;else if(J$!=="buffer"&&!N.isEncoding(J$))throw new e(J$);if(typeof $$!=="function")$$=W}if(r===null)throw new Q;else if(!_$.objectMode)if(typeof r==="string"){if(_$.decodeStrings!==!1)r=N.from(r,J$),J$="buffer"}else if(r instanceof N)J$="buffer";else if(S._isUint8Array(r))r=S._uint8ArrayToBuffer(r),J$="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],r);let O$;if(_$.ending)O$=new m;else if(_$.destroyed)O$=new o("write");if(O$)return _.nextTick($$,O$),j(c,O$,!0),O$;return _$.pendingcb++,A(c,_$,r,J$,$$)}G.prototype.write=function(c,r,J$){return M(this,c,r,J$)===!0},G.prototype.cork=function(){this._writableState.corked++},G.prototype.uncork=function(){let c=this._writableState;if(c.corked){if(c.corked--,!c.writing)l(this,c)}},G.prototype.setDefaultEncoding=function(c){if(typeof c==="string")c=H(c);if(!N.isEncoding(c))throw new e(c);return this._writableState.defaultEncoding=c,this};function A(c,r,J$,$$,_$){let O$=r.objectMode?1:J$.length;r.length+=O$;let d=r.length<r.highWaterMark;if(!d)r.needDrain=!0;if(r.writing||r.corked||r.errored||!r.constructed){if(r.buffered.push({chunk:J$,encoding:$$,callback:_$}),r.allBuffers&&$$!=="buffer")r.allBuffers=!1;if(r.allNoop&&_$!==W)r.allNoop=!1}else r.writelen=O$,r.writecb=_$,r.writing=!0,r.sync=!0,c._write(J$,$$,r.onwrite),r.sync=!1;return d&&!r.errored&&!r.destroyed}function v(c,r,J$,$$,_$,O$,d){if(r.writelen=$$,r.writecb=d,r.writing=!0,r.sync=!0,r.destroyed)r.onwrite(new o("write"));else if(J$)c._writev(_$,r.onwrite);else c._write(_$,O$,r.onwrite);r.sync=!1}function V(c,r,J$,$$){--r.pendingcb,$$(J$),x(r),j(c,J$)}function R(c,r){let J$=c._writableState,$$=J$.sync,_$=J$.writecb;if(typeof _$!=="function"){j(c,new y);return}if(J$.writing=!1,J$.writecb=null,J$.length-=J$.writelen,J$.writelen=0,r){if(r.stack,!J$.errored)J$.errored=r;if(c._readableState&&!c._readableState.errored)c._readableState.errored=r;if($$)_.nextTick(V,c,J$,r,_$);else V(c,J$,r,_$)}else{if(J$.buffered.length>J$.bufferedIndex)l(c,J$);if($$)if(J$.afterWriteTickInfo!==null&&J$.afterWriteTickInfo.cb===_$)J$.afterWriteTickInfo.count++;else J$.afterWriteTickInfo={count:1,cb:_$,stream:c,state:J$},_.nextTick(E,J$.afterWriteTickInfo);else b(c,J$,1,_$)}}function E({stream:c,state:r,count:J$,cb:$$}){return r.afterWriteTickInfo=null,b(c,r,J$,$$)}function b(c,r,J$,$$){if(!r.ending&&!c.destroyed&&r.length===0&&r.needDrain)r.needDrain=!1,c.emit("drain");while(J$-- >0)r.pendingcb--,$$();if(r.destroyed)x(r);B(c,r)}function x(c){if(c.writing)return;for(let _$=c.bufferedIndex;_$<c.buffered.length;++_$){var r;let{chunk:O$,callback:d}=c.buffered[_$],n=c.objectMode?1:O$.length;c.length-=n,d((r=c.errored)!==null&&r!==void 0?r:new o("write"))}let J$=c[X].splice(0);for(let _$=0;_$<J$.length;_$++){var $$;J$[_$](($$=c.errored)!==null&&$$!==void 0?$$:new o("end"))}Z(c)}function l(c,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:J$,bufferedIndex:$$,objectMode:_$}=r,O$=J$.length-$$;if(!O$)return;let d=$$;if(r.bufferProcessing=!0,O$>1&&c._writev){r.pendingcb-=O$-1;let n=r.allNoop?W:(t)=>{for(let U=d;U<J$.length;++U)J$[U].callback(t)},H$=r.allNoop&&d===0?J$:K(J$,d);H$.allBuffers=r.allBuffers,v(c,r,!0,r.length,H$,"",n),Z(r)}else{do{let{chunk:n,encoding:H$,callback:t}=J$[d];J$[d++]=null;let U=_$?1:n.length;v(c,r,!1,U,n,H$,t)}while(d<J$.length&&!r.writing);if(d===J$.length)Z(r);else if(d>256)J$.splice(0,d),r.bufferedIndex=0;else r.bufferedIndex=d}r.bufferProcessing=!1}G.prototype._write=function(c,r,J$){if(this._writev)this._writev([{chunk:c,encoding:r}],J$);else throw new g("_write()")},G.prototype._writev=null,G.prototype.end=function(c,r,J$){let $$=this._writableState;if(typeof c==="function")J$=c,c=null,r=null;else if(typeof r==="function")J$=r,r=null;let _$;if(c!==null&&c!==void 0){let O$=M(this,c,r);if(O$ instanceof P)_$=O$}if($$.corked)$$.corked=1,this.uncork();if(_$);else if(!$$.errored&&!$$.ending)$$.ending=!0,B(this,$$,!0),$$.ended=!0;else if($$.finished)_$=new s("end");else if($$.destroyed)_$=new o("end");if(typeof J$==="function")if(_$||$$.finished)_.nextTick(J$,_$);else $$[X].push(J$);return this};function F(c){return c.ending&&!c.destroyed&&c.constructed&&c.length===0&&!c.errored&&c.buffered.length===0&&!c.finished&&!c.writing&&!c.errorEmitted&&!c.closeEmitted}function f$(c,r){let J$=!1;function $$(_$){if(J$){j(c,_$!==null&&_$!==void 0?_$:y());return}if(J$=!0,r.pendingcb--,_$){let O$=r[X].splice(0);for(let d=0;d<O$.length;d++)O$[d](_$);j(c,_$,r.sync)}else if(F(r))r.prefinished=!0,c.emit("prefinish"),r.pendingcb++,_.nextTick(v$,c,r)}r.sync=!0,r.pendingcb++;try{c._final($$)}catch(_$){$$(_$)}r.sync=!1}function q$(c,r){if(!r.prefinished&&!r.finalCalled)if(typeof c._final==="function"&&!r.destroyed)r.finalCalled=!0,f$(c,r);else r.prefinished=!0,c.emit("prefinish")}function B(c,r,J$){if(F(r)){if(q$(c,r),r.pendingcb===0){if(J$)r.pendingcb++,_.nextTick(($$,_$)=>{if(F(_$))v$($$,_$);else _$.pendingcb--},c,r);else if(F(r))r.pendingcb++,v$(c,r)}}}function v$(c,r){r.pendingcb--,r.finished=!0;let J$=r[X].splice(0);for(let $$=0;$$<J$.length;$$++)J$[$$]();if(c.emit("finish"),r.autoDestroy){let $$=c._readableState;if(!$$||$$.autoDestroy&&($$.endEmitted||$$.readable===!1))c.destroy()}}z(G.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(c){if(this._writableState)this._writableState.destroyed=c}},writable:{__proto__:null,get(){let c=this._writableState;return!!c&&c.writable!==!1&&!c.destroyed&&!c.errored&&!c.ending&&!c.ended},set(c){if(this._writableState)this._writableState.writable=!!c}},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 c=this._writableState;if(!c)return!1;return!c.destroyed&&!c.ending&&c.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 a=h.destroy;G.prototype.destroy=function(c,r){let J$=this._writableState;if(!J$.destroyed&&(J$.bufferedIndex<J$.buffered.length||J$[X].length))_.nextTick(x,J$);return a.call(this,c,r),this},G.prototype._undestroy=h.undestroy,G.prototype._destroy=function(c,r){r(c)},G.prototype[k.captureRejectionSymbol]=function(c){this.destroy(c)};var P$;function o$(){if(P$===void 0)P$={};return P$}G.fromWeb=function(c,r){return o$().newStreamWritableFromWritableStream(c,r)},G.toWeb=function(c){return o$().newWritableStreamFromStreamWritable(c)}}),un=S6(($,q)=>{var _=cK(),K=(wq(),J6(Tq)),{isReadable:P,isWritable:Y,isIterable:O,isNodeStream:z,isReadableNodeStream:T,isWritableNodeStream:H,isDuplexNodeStream:f,isReadableStream:w,isWritableStream:k}=M_(),S=KK(),{AbortError:N,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:C}}=cq(),{destroyer:I}=n4(),D=S_(),L=k2(),g=fH(),{createDeferredPromise:y}=$8(),p=i0(),o=globalThis.Blob||K.Blob,s=typeof o<"u"?function(X){return X instanceof o}:function(X){return!1},Q=globalThis.AbortController||e7().AbortController,{FunctionPrototypeCall:m}=x6();class e extends D{constructor(X){super(X);if((X===null||X===void 0?void 0:X.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((X===null||X===void 0?void 0:X.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}q.exports=function X(J,Z){if(f(J))return J;if(T(J))return W({readable:J});if(H(J))return W({writable:J});if(z(J))return W({writable:!1,readable:!1});if(w(J))return W({readable:L.fromWeb(J)});if(k(J))return W({writable:g.fromWeb(J)});if(typeof J==="function"){let{value:M,write:A,final:v,destroy:V}=j(J);if(O(M))return p(e,M,{objectMode:!0,write:A,final:v,destroy:V});let R=M===null||M===void 0?void 0:M.then;if(typeof R==="function"){let E,b=m(R,M,(x)=>{if(x!=null)throw new C("nully","body",x)},(x)=>{I(E,x)});return E=new e({objectMode:!0,readable:!1,write:A,final(x){v(async()=>{try{await b,_.nextTick(x,null)}catch(l){_.nextTick(x,l)}})},destroy:V})}throw new C("Iterable, AsyncIterable or AsyncFunction",Z,M)}if(s(J))return X(J.arrayBuffer());if(O(J))return p(e,J,{objectMode:!0,writable:!1});if(w(J===null||J===void 0?void 0:J.readable)&&k(J===null||J===void 0?void 0:J.writable))return e.fromWeb(J);if(typeof(J===null||J===void 0?void 0:J.writable)==="object"||typeof(J===null||J===void 0?void 0:J.readable)==="object"){let M=J!==null&&J!==void 0&&J.readable?T(J===null||J===void 0?void 0:J.readable)?J===null||J===void 0?void 0:J.readable:X(J.readable):void 0,A=J!==null&&J!==void 0&&J.writable?H(J===null||J===void 0?void 0:J.writable)?J===null||J===void 0?void 0:J.writable:X(J.writable):void 0;return W({readable:M,writable:A})}let G=J===null||J===void 0?void 0:J.then;if(typeof G==="function"){let M;return m(G,J,(A)=>{if(A!=null)M.push(A);M.push(null)},(A)=>{I(M,A)}),M=new e({objectMode:!0,writable:!1,read(){}})}throw new h(Z,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],J)};function j(X){let{promise:J,resolve:Z}=y(),G=new Q,M=G.signal;return{value:X(async function*(){while(!0){let A=J;J=null;let{chunk:v,done:V,cb:R}=await A;if(_.nextTick(R),V)return;if(M.aborted)throw new N(void 0,{cause:M.reason});({promise:J,resolve:Z}=y()),yield v}}(),{signal:M}),write(A,v,V){let R=Z;Z=null,R({chunk:A,done:!1,cb:V})},final(A){let v=Z;Z=null,v({done:!0,cb:A})},destroy(A,v){G.abort(),v(A)}}}function W(X){let J=X.readable&&typeof X.readable.read!=="function"?L.wrap(X.readable):X.readable,Z=X.writable,G=!!P(J),M=!!Y(Z),A,v,V,R,E;function b(x){let l=R;if(R=null,l)l(x);else if(x)E.destroy(x)}if(E=new e({readableObjectMode:!!(J!==null&&J!==void 0&&J.readableObjectMode),writableObjectMode:!!(Z!==null&&Z!==void 0&&Z.writableObjectMode),readable:G,writable:M}),M)S(Z,(x)=>{if(M=!1,x)I(J,x);b(x)}),E._write=function(x,l,F){if(Z.write(x,l))F();else A=F},E._final=function(x){Z.end(),v=x},Z.on("drain",function(){if(A){let x=A;A=null,x()}}),Z.on("finish",function(){if(v){let x=v;v=null,x()}});if(G)S(J,(x)=>{if(G=!1,x)I(J,x);b(x)}),J.on("readable",function(){if(V){let x=V;V=null,x()}}),J.on("end",function(){E.push(null)}),E._read=function(){while(!0){let x=J.read();if(x===null){V=E._read;return}if(!E.push(x))return}};return E._destroy=function(x,l){if(!x&&R!==null)x=new N;if(V=null,A=null,v=null,R===null)l(x);else R=l,I(Z,x),I(J,x)},E}}),S_=S6(($,q)=>{var{ObjectDefineProperties:_,ObjectGetOwnPropertyDescriptor:K,ObjectKeys:P,ObjectSetPrototypeOf:Y}=x6();q.exports=T;var O=k2(),z=fH();Y(T.prototype,O.prototype),Y(T,O);{let k=P(z.prototype);for(let S=0;S<k.length;S++){let N=k[S];if(!T.prototype[N])T.prototype[N]=z.prototype[N]}}function T(k){if(!(this instanceof T))return new T(k);if(O.call(this,k),z.call(this,k),k){if(this.allowHalfOpen=k.allowHalfOpen!==!1,k.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(k.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}_(T.prototype,{writable:{__proto__:null,...K(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...K(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...K(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...K(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...K(z.prototype,"writableLength")},writableFinished:{__proto__:null,...K(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...K(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...K(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...K(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(k){if(this._readableState&&this._writableState)this._readableState.destroyed=k,this._writableState.destroyed=k}}});var H;function f(){if(H===void 0)H={};return H}T.fromWeb=function(k,S){return f().newStreamDuplexFromReadableWritablePair(k,S)},T.toWeb=function(k){return f().newReadableWritablePairFromDuplex(k)};var w;T.from=function(k){if(!w)w=un();return w(k,"body")}}),B0=S6(($,q)=>{var{ObjectSetPrototypeOf:_,Symbol:K}=x6();q.exports=T;var{ERR_METHOD_NOT_IMPLEMENTED:P}=cq().codes,Y=S_(),{getHighWaterMark:O}=A2();_(T.prototype,Y.prototype),_(T,Y);var z=K("kCallback");function T(w){if(!(this instanceof T))return new T(w);let k=w?O(this,w,"readableHighWaterMark",!0):null;if(k===0)w={...w,highWaterMark:null,readableHighWaterMark:k,writableHighWaterMark:w.writableHighWaterMark||0};if(Y.call(this,w),this._readableState.sync=!1,this[z]=null,w){if(typeof w.transform==="function")this._transform=w.transform;if(typeof w.flush==="function")this._flush=w.flush}this.on("prefinish",f)}function H(w){if(typeof this._flush==="function"&&!this.destroyed)this._flush((k,S)=>{if(k){if(w)w(k);else this.destroy(k);return}if(S!=null)this.push(S);if(this.push(null),w)w()});else if(this.push(null),w)w()}function f(){if(this._final!==H)H.call(this)}T.prototype._final=H,T.prototype._transform=function(w,k,S){throw new P("_transform()")},T.prototype._write=function(w,k,S){let N=this._readableState,h=this._writableState,C=N.length;this._transform(w,k,(I,D)=>{if(I){S(I);return}if(D!=null)this.push(D);if(h.ended||C===N.length||N.length<N.highWaterMark)S();else this[z]=S})},T.prototype._read=function(){if(this[z]){let w=this[z];this[z]=null,w()}}}),t0=S6(($,q)=>{var{ObjectSetPrototypeOf:_}=x6();q.exports=P;var K=B0();_(P.prototype,K.prototype),_(P,K);function P(Y){if(!(this instanceof P))return new P(Y);K.call(this,Y)}P.prototype._transform=function(Y,O,z){z(null,Y)}}),ZH=S6(($,q)=>{var _=cK(),{ArrayIsArray:K,Promise:P,SymbolAsyncIterator:Y,SymbolDispose:O}=x6(),z=KK(),{once:T}=$8(),H=n4(),f=S_(),{aggregateTwoErrors:w,codes:{ERR_INVALID_ARG_TYPE:k,ERR_INVALID_RETURN_VALUE:S,ERR_MISSING_ARGS:N,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:C},AbortError:I}=cq(),{validateFunction:D,validateAbortSignal:L}=s7(),{isIterable:g,isReadable:y,isReadableNodeStream:p,isNodeStream:o,isTransformStream:s,isWebStream:Q,isReadableStream:m,isReadableFinished:e}=M_(),j=globalThis.AbortController||e7().AbortController,W,X,J;function Z(x,l,F){let f$=!1;x.on("close",()=>{f$=!0});let q$=z(x,{readable:l,writable:F},(B)=>{f$=!B});return{destroy:(B)=>{if(f$)return;f$=!0,H.destroyer(x,B||new h("pipe"))},cleanup:q$}}function G(x){return D(x[x.length-1],"streams[stream.length - 1]"),x.pop()}function M(x){if(g(x))return x;else if(p(x))return A(x);throw new k("val",["Readable","Iterable","AsyncIterable"],x)}async function*A(x){if(!X)X=k2();yield*X.prototype[Y].call(x)}async function v(x,l,F,{end:f$}){let q$,B=null,v$=(o$)=>{if(o$)q$=o$;if(B){let c=B;B=null,c()}},a=()=>new P((o$,c)=>{if(q$)c(q$);else B=()=>{if(q$)c(q$);else o$()}});l.on("drain",v$);let P$=z(l,{readable:!1},v$);try{if(l.writableNeedDrain)await a();for await(let o$ of x)if(!l.write(o$))await a();if(f$)l.end(),await a();F()}catch(o$){F(q$!==o$?w(q$,o$):o$)}finally{P$(),l.off("drain",v$)}}async function V(x,l,F,{end:f$}){if(s(l))l=l.writable;let q$=l.getWriter();try{for await(let B of x)await q$.ready,q$.write(B).catch(()=>{});if(await q$.ready,f$)await q$.close();F()}catch(B){try{await q$.abort(B),F(B)}catch(v$){F(v$)}}}function R(...x){return E(x,T(G(x)))}function E(x,l,F){if(x.length===1&&K(x[0]))x=x[0];if(x.length<2)throw new N("streams");let f$=new j,q$=f$.signal,B=F===null||F===void 0?void 0:F.signal,v$=[];L(B,"options.signal");function a(){_$(new I)}J=J||$8().addAbortListener;let P$;if(B)P$=J(B,a);let o$,c,r=[],J$=0;function $$(t){_$(t,--J$===0)}function _$(t,U){var A$;if(t&&(!o$||o$.code==="ERR_STREAM_PREMATURE_CLOSE"))o$=t;if(!o$&&!U)return;while(r.length)r.shift()(o$);if((A$=P$)===null||A$===void 0||A$[O](),f$.abort(),U){if(!o$)v$.forEach((W$)=>W$());_.nextTick(l,o$,c)}}let O$;for(let t=0;t<x.length;t++){let U=x[t],A$=t<x.length-1,W$=t>0,z$=A$||(F===null||F===void 0?void 0:F.end)!==!1,Z6=t===x.length-1;if(o(U)){let X$=function(k$){if(k$&&k$.name!=="AbortError"&&k$.code!=="ERR_STREAM_PREMATURE_CLOSE")$$(k$)};var d=X$;if(z$){let{destroy:k$,cleanup:o6}=Z(U,A$,W$);if(r.push(k$),y(U)&&Z6)v$.push(o6)}if(U.on("error",X$),y(U)&&Z6)v$.push(()=>{U.removeListener("error",X$)})}if(t===0)if(typeof U==="function"){if(O$=U({signal:q$}),!g(O$))throw new S("Iterable, AsyncIterable or Stream","source",O$)}else if(g(U)||p(U)||s(U))O$=U;else O$=f.from(U);else if(typeof U==="function"){if(s(O$)){var n;O$=M((n=O$)===null||n===void 0?void 0:n.readable)}else O$=M(O$);if(O$=U(O$,{signal:q$}),A$){if(!g(O$,!0))throw new S("AsyncIterable",`transform[${t-1}]`,O$)}else{var H$;if(!W)W=t0();let X$=new W({objectMode:!0}),k$=(H$=O$)===null||H$===void 0?void 0:H$.then;if(typeof k$==="function")J$++,k$.call(O$,(S$)=>{if(c=S$,S$!=null)X$.write(S$);if(z$)X$.end();_.nextTick($$)},(S$)=>{X$.destroy(S$),_.nextTick($$,S$)});else if(g(O$,!0))J$++,v(O$,X$,$$,{end:z$});else if(m(O$)||s(O$)){let S$=O$.readable||O$;J$++,v(S$,X$,$$,{end:z$})}else throw new S("AsyncIterable or Promise","destination",O$);O$=X$;let{destroy:o6,cleanup:M$}=Z(O$,!1,!0);if(r.push(o6),Z6)v$.push(M$)}}else if(o(U)){if(p(O$)){J$+=2;let X$=b(O$,U,$$,{end:z$});if(y(U)&&Z6)v$.push(X$)}else if(s(O$)||m(O$)){let X$=O$.readable||O$;J$++,v(X$,U,$$,{end:z$})}else if(g(O$))J$++,v(O$,U,$$,{end:z$});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],O$);O$=U}else if(Q(U)){if(p(O$))J$++,V(M(O$),U,$$,{end:z$});else if(m(O$)||g(O$))J$++,V(O$,U,$$,{end:z$});else if(s(O$))J$++,V(O$.readable,U,$$,{end:z$});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],O$);O$=U}else O$=f.from(U)}if(q$!==null&&q$!==void 0&&q$.aborted||B!==null&&B!==void 0&&B.aborted)_.nextTick(a);return O$}function b(x,l,F,{end:f$}){let q$=!1;if(l.on("close",()=>{if(!q$)F(new C)}),x.pipe(l,{end:!1}),f$){let v$=function(){q$=!0,l.end()};var B=v$;if(e(x))_.nextTick(v$);else x.once("end",v$)}else F();return z(x,{readable:!0,writable:!1},(v$)=>{let a=x._readableState;if(v$&&v$.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted)x.once("end",F).once("error",F);else F(v$)}),z(l,{readable:!1,writable:!0},F)}q.exports={pipelineImpl:E,pipeline:R}}),U0=S6(($,q)=>{var{pipeline:_}=ZH(),K=S_(),{destroyer:P}=n4(),{isNodeStream:Y,isReadable:O,isWritable:z,isWebStream:T,isTransformStream:H,isWritableStream:f,isReadableStream:w}=M_(),{AbortError:k,codes:{ERR_INVALID_ARG_VALUE:S,ERR_MISSING_ARGS:N}}=cq(),h=KK();q.exports=function(...C){if(C.length===0)throw new N("streams");if(C.length===1)return K.from(C[0]);let I=[...C];if(typeof C[0]==="function")C[0]=K.from(C[0]);if(typeof C[C.length-1]==="function"){let j=C.length-1;C[j]=K.from(C[j])}for(let j=0;j<C.length;++j){if(!Y(C[j])&&!T(C[j]))continue;if(j<C.length-1&&!(O(C[j])||w(C[j])||H(C[j])))throw new S(`streams[${j}]`,I[j],"must be readable");if(j>0&&!(z(C[j])||f(C[j])||H(C[j])))throw new S(`streams[${j}]`,I[j],"must be writable")}let D,L,g,y,p;function o(j){let W=y;if(y=null,W)W(j);else if(j)p.destroy(j);else if(!e&&!m)p.destroy()}let s=C[0],Q=_(C,o),m=!!(z(s)||f(s)||H(s)),e=!!(O(Q)||w(Q)||H(Q));if(p=new K({writableObjectMode:!!(s!==null&&s!==void 0&&s.writableObjectMode),readableObjectMode:!!(Q!==null&&Q!==void 0&&Q.readableObjectMode),writable:m,readable:e}),m){if(Y(s))p._write=function(W,X,J){if(s.write(W,X))J();else D=J},p._final=function(W){s.end(),L=W},s.on("drain",function(){if(D){let W=D;D=null,W()}});else if(T(s)){let W=(H(s)?s.writable:s).getWriter();p._write=async function(X,J,Z){try{await W.ready,W.write(X).catch(()=>{}),Z()}catch(G){Z(G)}},p._final=async function(X){try{await W.ready,W.close().catch(()=>{}),L=X}catch(J){X(J)}}}let j=H(Q)?Q.readable:Q;h(j,()=>{if(L){let W=L;L=null,W()}})}if(e){if(Y(Q))Q.on("readable",function(){if(g){let j=g;g=null,j()}}),Q.on("end",function(){p.push(null)}),p._read=function(){while(!0){let j=Q.read();if(j===null){g=p._read;return}if(!p.push(j))return}};else if(T(Q)){let j=(H(Q)?Q.readable:Q).getReader();p._read=async function(){while(!0)try{let{value:W,done:X}=await j.read();if(!p.push(W))return;if(X){p.push(null);return}}catch{return}}}}return p._destroy=function(j,W){if(!j&&y!==null)j=new k;if(g=null,D=null,L=null,y===null)W(j);else if(y=W,Y(Q))P(Q,j)},p}}),xn=S6(($,q)=>{var _=globalThis.AbortController||e7().AbortController,{codes:{ERR_INVALID_ARG_VALUE:K,ERR_INVALID_ARG_TYPE:P,ERR_MISSING_ARGS:Y,ERR_OUT_OF_RANGE:O},AbortError:z}=cq(),{validateAbortSignal:T,validateInteger:H,validateObject:f}=s7(),w=x6().Symbol("kWeak"),k=x6().Symbol("kResistStopPropagation"),{finished:S}=KK(),N=U0(),{addAbortSignalNoValidate:h}=X2(),{isWritable:C,isNodeStream:I}=M_(),{deprecate:D}=$8(),{ArrayPrototypePush:L,Boolean:g,MathFloor:y,Number:p,NumberIsNaN:o,Promise:s,PromiseReject:Q,PromiseResolve:m,PromisePrototypeThen:e,Symbol:j}=x6(),W=j("kEmpty"),X=j("kEof");function J(B,v$){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");if(I(B)&&!C(B))throw new K("stream",B,"must be writable");let a=N(this,B);if(v$!==null&&v$!==void 0&&v$.signal)h(v$.signal,a);return a}function Z(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");let a=1;if((v$===null||v$===void 0?void 0:v$.concurrency)!=null)a=y(v$.concurrency);let P$=a-1;if((v$===null||v$===void 0?void 0:v$.highWaterMark)!=null)P$=y(v$.highWaterMark);return H(a,"options.concurrency",1),H(P$,"options.highWaterMark",0),P$+=a,async function*(){let o$=$8().AbortSignalAny([v$===null||v$===void 0?void 0:v$.signal].filter(g)),c=this,r=[],J$={signal:o$},$$,_$,O$=!1,d=0;function n(){O$=!0,H$()}function H$(){d-=1,t()}function t(){if(_$&&!O$&&d<a&&r.length<P$)_$(),_$=null}async function U(){try{for await(let A$ of c){if(O$)return;if(o$.aborted)throw new z;try{if(A$=B(A$,J$),A$===W)continue;A$=m(A$)}catch(W$){A$=Q(W$)}if(d+=1,e(A$,H$,n),r.push(A$),$$)$$(),$$=null;if(!O$&&(r.length>=P$||d>=a))await new s((W$)=>{_$=W$})}r.push(X)}catch(A$){let W$=Q(A$);e(W$,H$,n),r.push(W$)}finally{if(O$=!0,$$)$$(),$$=null}}U();try{while(!0){while(r.length>0){let A$=await r[0];if(A$===X)return;if(o$.aborted)throw new z;if(A$!==W)yield A$;r.shift(),t()}await new s((A$)=>{$$=A$})}}finally{if(O$=!0,_$)_$(),_$=null}}.call(this)}function G(B=void 0){if(B!=null)f(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)T(B.signal,"options.signal");return async function*(){let v$=0;for await(let P$ of this){var a;if(B!==null&&B!==void 0&&(a=B.signal)!==null&&a!==void 0&&a.aborted)throw new z({cause:B.signal.reason});yield[v$++,P$]}}.call(this)}async function M(B,v$=void 0){for await(let a of R.call(this,B,v$))return!0;return!1}async function A(B,v$=void 0){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);return!await M.call(this,async(...a)=>{return!await B(...a)},v$)}async function v(B,v$){for await(let a of R.call(this,B,v$))return a;return}async function V(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);async function a(P$,o$){return await B(P$,o$),W}for await(let P$ of Z.call(this,a,v$));}function R(B,v$){if(typeof B!=="function")throw new P("fn",["Function","AsyncFunction"],B);async function a(P$,o$){if(await B(P$,o$))return P$;return W}return Z.call(this,a,v$)}class E extends Y{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function b(B,v$,a){var P$;if(typeof B!=="function")throw new P("reducer",["Function","AsyncFunction"],B);if(a!=null)f(a,"options");if((a===null||a===void 0?void 0:a.signal)!=null)T(a.signal,"options.signal");let o$=arguments.length>1;if(a!==null&&a!==void 0&&(P$=a.signal)!==null&&P$!==void 0&&P$.aborted){let _$=new z(void 0,{cause:a.signal.reason});throw this.once("error",()=>{}),await S(this.destroy(_$)),_$}let c=new _,r=c.signal;if(a!==null&&a!==void 0&&a.signal){let _$={once:!0,[w]:this,[k]:!0};a.signal.addEventListener("abort",()=>c.abort(),_$)}let J$=!1;try{for await(let _$ of this){var $$;if(J$=!0,a!==null&&a!==void 0&&($$=a.signal)!==null&&$$!==void 0&&$$.aborted)throw new z;if(!o$)v$=_$,o$=!0;else v$=await B(v$,_$,{signal:r})}if(!J$&&!o$)throw new E}finally{c.abort()}return v$}async function x(B){if(B!=null)f(B,"options");if((B===null||B===void 0?void 0:B.signal)!=null)T(B.signal,"options.signal");let v$=[];for await(let P$ of this){var a;if(B!==null&&B!==void 0&&(a=B.signal)!==null&&a!==void 0&&a.aborted)throw new z(void 0,{cause:B.signal.reason});L(v$,P$)}return v$}function l(B,v$){let a=Z.call(this,B,v$);return async function*(){for await(let P$ of a)yield*P$}.call(this)}function F(B){if(B=p(B),o(B))return 0;if(B<0)throw new O("number",">= 0",B);return B}function f$(B,v$=void 0){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");return B=F(B),async function*(){var a;if(v$!==null&&v$!==void 0&&(a=v$.signal)!==null&&a!==void 0&&a.aborted)throw new z;for await(let o$ of this){var P$;if(v$!==null&&v$!==void 0&&(P$=v$.signal)!==null&&P$!==void 0&&P$.aborted)throw new z;if(B--<=0)yield o$}}.call(this)}function q$(B,v$=void 0){if(v$!=null)f(v$,"options");if((v$===null||v$===void 0?void 0:v$.signal)!=null)T(v$.signal,"options.signal");return B=F(B),async function*(){var a;if(v$!==null&&v$!==void 0&&(a=v$.signal)!==null&&a!==void 0&&a.aborted)throw new z;for await(let o$ of this){var P$;if(v$!==null&&v$!==void 0&&(P$=v$.signal)!==null&&P$!==void 0&&P$.aborted)throw new z;if(B-- >0)yield o$;if(B<=0)return}}.call(this)}q.exports.streamReturningOperators={asIndexedPairs:D(G,"readable.asIndexedPairs will be removed in a future version."),drop:f$,filter:R,flatMap:l,map:Z,take:q$,compose:J},q.exports.promiseReturningOperators={every:A,forEach:V,reduce:b,toArray:x,some:M,find:v}}),F0=S6(($,q)=>{var{ArrayPrototypePop:_,Promise:K}=x6(),{isIterable:P,isNodeStream:Y,isWebStream:O}=M_(),{pipelineImpl:z}=ZH(),{finished:T}=KK();Q0();function H(...f){return new K((w,k)=>{let S,N,h=f[f.length-1];if(h&&typeof h==="object"&&!Y(h)&&!P(h)&&!O(h)){let C=_(f);S=C.signal,N=C.end}z(f,(C,I)=>{if(C)k(C);else w(I)},{signal:S,end:N})})}q.exports={finished:T,pipeline:H}}),Q0=S6(($,q)=>{var{Buffer:_}=(wq(),J6(Tq)),{ObjectDefineProperty:K,ObjectKeys:P,ReflectApply:Y}=x6(),{promisify:{custom:O}}=$8(),{streamReturningOperators:z,promiseReturningOperators:T}=xn(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=cq(),f=U0(),{setDefaultHighWaterMark:w,getDefaultHighWaterMark:k}=A2(),{pipeline:S}=ZH(),{destroyer:N}=n4(),h=KK(),C=F0(),I=M_(),D=q.exports=wH().Stream;D.isDestroyed=I.isDestroyed,D.isDisturbed=I.isDisturbed,D.isErrored=I.isErrored,D.isReadable=I.isReadable,D.isWritable=I.isWritable,D.Readable=k2();for(let g of P(z)){let y=function(...o){if(new.target)throw H();return D.Readable.from(Y(p,this,o))},p=z[g];K(y,"name",{__proto__:null,value:p.name}),K(y,"length",{__proto__:null,value:p.length}),K(D.Readable.prototype,g,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}for(let g of P(T)){let y=function(...o){if(new.target)throw H();return Y(p,this,o)},p=T[g];K(y,"name",{__proto__:null,value:p.name}),K(y,"length",{__proto__:null,value:p.length}),K(D.Readable.prototype,g,{__proto__:null,value:y,enumerable:!1,configurable:!0,writable:!0})}D.Writable=fH(),D.Duplex=S_(),D.Transform=B0(),D.PassThrough=t0(),D.pipeline=S;var{addAbortSignal:L}=X2();D.addAbortSignal=L,D.finished=h,D.destroy=N,D.compose=f,D.setDefaultHighWaterMark=w,D.getDefaultHighWaterMark=k,K(D,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return C}}),K(S,O,{__proto__:null,enumerable:!0,get(){return C.pipeline}}),K(h,O,{__proto__:null,enumerable:!0,get(){return C.finished}}),D.Stream=D,D._isUint8Array=function(g){return g instanceof Uint8Array},D._uint8ArrayToBuffer=function(g){return _.from(g.buffer,g.byteOffset,g.byteLength)}}),pn=S6(($,q)=>{var _=XH();{let K=Q0(),P=F0(),Y=K.Readable.destroy;q.exports=K.Readable,q.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer,q.exports._isUint8Array=K._isUint8Array,q.exports.isDisturbed=K.isDisturbed,q.exports.isErrored=K.isErrored,q.exports.isReadable=K.isReadable,q.exports.Readable=K.Readable,q.exports.Writable=K.Writable,q.exports.Duplex=K.Duplex,q.exports.Transform=K.Transform,q.exports.PassThrough=K.PassThrough,q.exports.addAbortSignal=K.addAbortSignal,q.exports.finished=K.finished,q.exports.destroy=K.destroy,q.exports.destroy=Y,q.exports.pipeline=K.pipeline,q.exports.compose=K.compose,Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return P}}),q.exports.Stream=K.Stream}q.exports.default=q.exports});a0.exports=pn()});var dq={};rq(dq,{webcrypto:()=>Jt,rng:()=>MB,randomUUID:()=>vt,randomFillSync:()=>Kt,randomFill:()=>_t,randomBytes:()=>NB,publicEncrypt:()=>eB,publicDecrypt:()=>$t,pseudoRandomBytes:()=>SB,prng:()=>VB,privateEncrypt:()=>sB,privateDecrypt:()=>qt,pbkdf2Sync:()=>LB,pbkdf2:()=>DB,listCiphers:()=>lB,getRandomValues:()=>jt,getHashes:()=>IB,getDiffieHellman:()=>nB,getCurves:()=>Wt,getCiphers:()=>dB,default:()=>Ht,createVerify:()=>FB,createSign:()=>tB,createHmac:()=>RB,createHash:()=>EB,createECDH:()=>aB,createDiffieHellmanGroup:()=>oB,createDiffieHellman:()=>iB,createDecipheriv:()=>mB,createDecipher:()=>pB,createCredentials:()=>Pt,createCipheriv:()=>uB,createCipher:()=>gB,constants:()=>Yt,Verify:()=>QB,Sign:()=>UB,Hmac:()=>hB,Hash:()=>CB,DiffieHellmanGroup:()=>rB,DiffieHellman:()=>BB,Decipheriv:()=>cB,Decipher:()=>xB,DEFAULT_ENCODING:()=>Ot,Cipheriv:()=>yB,Cipher:()=>bB});function Wt(){return zt}var cn,mn,e0,dn,ln,rn=($,q,_)=>{_=$!=null?cn(mn($)):{};let K=q||!$||!$.__esModule?e0(_,"default",{value:$,enumerable:!0}):_;for(let P of dn($))if(!ln.call(K,P))e0(K,P,{get:()=>$[P],enumerable:!0});return K},T$=($,q)=>()=>(q||$((q={exports:{}}).exports,q),q.exports),G2,V2,$M,on,kH,GH,mq,nn,q1,qM,Bn,tn,Un,Fn,_M,Qn,an,en,sn,$i,qi,_i,Ki,Pi,Yi,_1,S2,KM,Oi,PM,YM,ji,K1,VH,SH,vi,OM,MH,zi,jM,Wi,vM,zM,Ji,Hi,Ti,wi,fi,Zi,Xi,Ai,ki,Gi,Vi,Si,Mi,Ni,NH,WM,Ci,JM,Ei,hi,Ri,Ii,N_,PK,HM,M8,TM,M2,Di,v8,Li,bi,gi,wM,__,P1,fM,yi,ZM,ui,XM,xi,pi,ci,mi,CH,di,EH,li,ri,oi,ni,ii,Bi,ti,Ui,Fi,Qi,ai,ei,si,$B,s0,qB,$1,_B,AM,kM,KB,PB,GM,YB,OB,Y1,jB,vB,zB,WB,JB,HB,VM,TB,SM,MM,NM,hH,CM,wB,EM,fB,ZB,AH,XB,AB,kB,GB,w6,VB,SB,MB,NB,CB,EB,hB,RB,IB,DB,LB,bB,gB,yB,uB,xB,pB,cB,mB,dB,lB,rB,oB,nB,iB,BB,tB,UB,FB,QB,aB,eB,sB,$t,qt,_t,Kt,Pt,Yt,Ot="buffer",jt=($)=>{return crypto.getRandomValues($)},vt=()=>{return crypto.randomUUID()},zt,Jt,Ht;var lq=lK(()=>{cn=Object.create,{getPrototypeOf:mn,defineProperty:e0,getOwnPropertyNames:dn}=Object,ln=Object.prototype.hasOwnProperty,G2=T$(($,q)=>{q.exports=(lq(),J6(dq)).randomBytes}),V2=T$(($,q)=>{q.exports=(lq(),J6(dq)).createHash}),$M=T$(($,q)=>{q.exports=(lq(),J6(dq)).createHmac}),on=T$(($,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"}}}),kH=T$(($,q)=>{var _=isFinite,K=Math.pow(2,30)-1;q.exports=function(P,Y){if(typeof P!=="number")throw TypeError("Iterations not a number");if(P<0||!_(P))throw TypeError("Bad iterations");if(typeof Y!=="number")throw TypeError("Key length not a number");if(Y<0||Y>K||Y!==Y)throw TypeError("Bad key length")}}),GH=T$(($,q)=>{var _;if(globalThis.process&&globalThis.process.browser)_="utf-8";else if(globalThis.process&&globalThis.process.version)K=parseInt(process.version.split(".")[0].slice(1),10),_=K>=6?"utf-8":"binary";else _="utf-8";var K;q.exports=_}),mq=T$(($,q)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var _=(wq(),J6(Tq)),K=_.Buffer;function P(O,z){for(var T in O)z[T]=O[T]}if(K.from&&K.alloc&&K.allocUnsafe&&K.allocUnsafeSlow)q.exports=_;else P(_,$),$.Buffer=Y;function Y(O,z,T){return K(O,z,T)}Y.prototype=Object.create(K.prototype),P(K,Y),Y.from=function(O,z,T){if(typeof O==="number")throw TypeError("Argument must not be a number");return K(O,z,T)},Y.alloc=function(O,z,T){if(typeof O!=="number")throw TypeError("Argument must be a number");var H=K(O);if(z!==void 0)if(typeof T==="string")H.fill(z,T);else H.fill(z);else H.fill(0);return H},Y.allocUnsafe=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return K(O)},Y.allocUnsafeSlow=function(O){if(typeof O!=="number")throw TypeError("Argument must be a number");return _.SlowBuffer(O)}}),nn=T$(($,q)=>{var _={}.toString;q.exports=Array.isArray||function(K){return _.call(K)=="[object Array]"}}),q1=T$(($,q)=>{q.exports=TypeError}),qM=T$(($,q)=>{q.exports=Object}),Bn=T$(($,q)=>{q.exports=Error}),tn=T$(($,q)=>{q.exports=EvalError}),Un=T$(($,q)=>{q.exports=RangeError}),Fn=T$(($,q)=>{q.exports=ReferenceError}),_M=T$(($,q)=>{q.exports=SyntaxError}),Qn=T$(($,q)=>{q.exports=URIError}),an=T$(($,q)=>{q.exports=Math.abs}),en=T$(($,q)=>{q.exports=Math.floor}),sn=T$(($,q)=>{q.exports=Math.max}),$i=T$(($,q)=>{q.exports=Math.min}),qi=T$(($,q)=>{q.exports=Math.pow}),_i=T$(($,q)=>{q.exports=Math.round}),Ki=T$(($,q)=>{q.exports=Number.isNaN||function(_){return _!==_}}),Pi=T$(($,q)=>{var _=Ki();q.exports=function(K){if(_(K)||K===0)return K;return K<0?-1:1}}),Yi=T$(($,q)=>{q.exports=Object.getOwnPropertyDescriptor}),_1=T$(($,q)=>{var _=Yi();if(_)try{_([],"length")}catch(K){_=null}q.exports=_}),S2=T$(($,q)=>{var _=Object.defineProperty||!1;if(_)try{_({},"a",{value:1})}catch(K){_=!1}q.exports=_}),KM=T$(($,q)=>{q.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var _={},K=Symbol("test"),P=Object(K);if(typeof K==="string")return!1;if(Object.prototype.toString.call(K)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(P)!=="[object Symbol]")return!1;var Y=42;_[K]=Y;for(var O in _)return!1;if(typeof Object.keys==="function"&&Object.keys(_).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(_).length!==0)return!1;var z=Object.getOwnPropertySymbols(_);if(z.length!==1||z[0]!==K)return!1;if(!Object.prototype.propertyIsEnumerable.call(_,K))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var T=Object.getOwnPropertyDescriptor(_,K);if(T.value!==Y||T.enumerable!==!0)return!1}return!0}}),Oi=T$(($,q)=>{var _=typeof Symbol<"u"&&Symbol,K=KM();q.exports=function(){if(typeof _!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof _("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return K()}}),PM=T$(($,q)=>{q.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),YM=T$(($,q)=>{var _=qM();q.exports=_.getPrototypeOf||null}),ji=T$(($,q)=>{var _="Function.prototype.bind called on incompatible ",K=Object.prototype.toString,P=Math.max,Y="[object Function]",O=function(H,f){var w=[];for(var k=0;k<H.length;k+=1)w[k]=H[k];for(var S=0;S<f.length;S+=1)w[S+H.length]=f[S];return w},z=function(H,f){var w=[];for(var k=f||0,S=0;k<H.length;k+=1,S+=1)w[S]=H[k];return w},T=function(H,f){var w="";for(var k=0;k<H.length;k+=1)if(w+=H[k],k+1<H.length)w+=f;return w};q.exports=function(H){var f=this;if(typeof f!=="function"||K.apply(f)!==Y)throw TypeError(_+f);var w=z(arguments,1),k,S=function(){if(this instanceof k){var D=f.apply(this,O(w,arguments));if(Object(D)===D)return D;return this}return f.apply(H,O(w,arguments))},N=P(0,f.length-w.length),h=[];for(var C=0;C<N;C++)h[C]="$"+C;if(k=Function("binder","return function ("+T(h,",")+"){ return binder.apply(this,arguments); }")(S),f.prototype){var I=function(){};I.prototype=f.prototype,k.prototype=new I,I.prototype=null}return k}}),K1=T$(($,q)=>{var _=ji();q.exports=Function.prototype.bind||_}),VH=T$(($,q)=>{q.exports=Function.prototype.call}),SH=T$(($,q)=>{q.exports=Function.prototype.apply}),vi=T$(($,q)=>{q.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),OM=T$(($,q)=>{var _=K1(),K=SH(),P=VH(),Y=vi();q.exports=Y||_.call(P,K)}),MH=T$(($,q)=>{var _=K1(),K=q1(),P=VH(),Y=OM();q.exports=function(O){if(O.length<1||typeof O[0]!=="function")throw new K("a function is required");return Y(_,P,O)}}),zi=T$(($,q)=>{var _=MH(),K=_1(),P;try{P=[].__proto__===Array.prototype}catch(T){if(!T||typeof T!=="object"||!("code"in T)||T.code!=="ERR_PROTO_ACCESS")throw T}var Y=!!P&&K&&K(Object.prototype,"__proto__"),O=Object,z=O.getPrototypeOf;q.exports=Y&&typeof Y.get==="function"?_([Y.get]):typeof z==="function"?function(T){return z(T==null?T:O(T))}:!1}),jM=T$(($,q)=>{var _=PM(),K=YM(),P=zi();q.exports=_?function(Y){return _(Y)}:K?function(Y){if(!Y||typeof Y!=="object"&&typeof Y!=="function")throw TypeError("getProto: not an object");return K(Y)}:P?function(Y){return P(Y)}:null}),Wi=T$(($,q)=>{var _=Function.prototype.call,K=Object.prototype.hasOwnProperty,P=K1();q.exports=P.call(_,K)}),vM=T$(($,q)=>{var _,K=qM(),P=Bn(),Y=tn(),O=Un(),z=Fn(),T=_M(),H=q1(),f=Qn(),w=an(),k=en(),S=sn(),N=$i(),h=qi(),C=_i(),I=Pi(),D=Function,L=function(v$){try{return D('"use strict"; return ('+v$+").constructor;")()}catch(a){}},g=_1(),y=S2(),p=function(){throw new H},o=g?function(){try{return arguments.callee,p}catch(v$){try{return g(arguments,"callee").get}catch(a){return p}}}():p,s=Oi()(),Q=jM(),m=YM(),e=PM(),j=SH(),W=VH(),X={},J=typeof Uint8Array>"u"||!Q?_:Q(Uint8Array),Z={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?_:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?_:ArrayBuffer,"%ArrayIteratorPrototype%":s&&Q?Q([][Symbol.iterator]()):_,"%AsyncFromSyncIteratorPrototype%":_,"%AsyncFunction%":X,"%AsyncGenerator%":X,"%AsyncGeneratorFunction%":X,"%AsyncIteratorPrototype%":X,"%Atomics%":typeof Atomics>"u"?_:Atomics,"%BigInt%":typeof BigInt>"u"?_:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?_:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?_:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?_:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":P,"%eval%":eval,"%EvalError%":Y,"%Float16Array%":typeof Float16Array>"u"?_:Float16Array,"%Float32Array%":typeof Float32Array>"u"?_:Float32Array,"%Float64Array%":typeof Float64Array>"u"?_:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?_:FinalizationRegistry,"%Function%":D,"%GeneratorFunction%":X,"%Int8Array%":typeof Int8Array>"u"?_:Int8Array,"%Int16Array%":typeof Int16Array>"u"?_:Int16Array,"%Int32Array%":typeof Int32Array>"u"?_:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s&&Q?Q(Q([][Symbol.iterator]())):_,"%JSON%":typeof JSON==="object"?JSON:_,"%Map%":typeof Map>"u"?_:Map,"%MapIteratorPrototype%":typeof Map>"u"||!s||!Q?_:Q(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":K,"%Object.getOwnPropertyDescriptor%":g,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?_:Promise,"%Proxy%":typeof Proxy>"u"?_:Proxy,"%RangeError%":O,"%ReferenceError%":z,"%Reflect%":typeof Reflect>"u"?_:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?_:Set,"%SetIteratorPrototype%":typeof Set>"u"||!s||!Q?_:Q(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?_:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s&&Q?Q(""[Symbol.iterator]()):_,"%Symbol%":s?Symbol:_,"%SyntaxError%":T,"%ThrowTypeError%":o,"%TypedArray%":J,"%TypeError%":H,"%Uint8Array%":typeof Uint8Array>"u"?_:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?_:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?_:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?_:Uint32Array,"%URIError%":f,"%WeakMap%":typeof WeakMap>"u"?_:WeakMap,"%WeakRef%":typeof WeakRef>"u"?_:WeakRef,"%WeakSet%":typeof WeakSet>"u"?_:WeakSet,"%Function.prototype.call%":W,"%Function.prototype.apply%":j,"%Object.defineProperty%":y,"%Object.getPrototypeOf%":m,"%Math.abs%":w,"%Math.floor%":k,"%Math.max%":S,"%Math.min%":N,"%Math.pow%":h,"%Math.round%":C,"%Math.sign%":I,"%Reflect.getPrototypeOf%":e};if(Q)try{null.error}catch(v$){G=Q(Q(v$)),Z["%Error.prototype%"]=G}var G,M=function v$(a){var P$;if(a==="%AsyncFunction%")P$=L("async function () {}");else if(a==="%GeneratorFunction%")P$=L("function* () {}");else if(a==="%AsyncGeneratorFunction%")P$=L("async function* () {}");else if(a==="%AsyncGenerator%"){var o$=v$("%AsyncGeneratorFunction%");if(o$)P$=o$.prototype}else if(a==="%AsyncIteratorPrototype%"){var c=v$("%AsyncGenerator%");if(c&&Q)P$=Q(c.prototype)}return Z[a]=P$,P$},A={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=K1(),V=Wi(),R=v.call(W,Array.prototype.concat),E=v.call(j,Array.prototype.splice),b=v.call(W,String.prototype.replace),x=v.call(W,String.prototype.slice),l=v.call(W,RegExp.prototype.exec),F=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,f$=/\\(\\)?/g,q$=function(v$){var a=x(v$,0,1),P$=x(v$,-1);if(a==="%"&&P$!=="%")throw new T("invalid intrinsic syntax, expected closing `%`");else if(P$==="%"&&a!=="%")throw new T("invalid intrinsic syntax, expected opening `%`");var o$=[];return b(v$,F,function(c,r,J$,$$){o$[o$.length]=J$?b($$,f$,"$1"):r||c}),o$},B=function(v$,a){var P$=v$,o$;if(V(A,P$))o$=A[P$],P$="%"+o$[0]+"%";if(V(Z,P$)){var c=Z[P$];if(c===X)c=M(P$);if(typeof c>"u"&&!a)throw new H("intrinsic "+v$+" exists, but is not available. Please file an issue!");return{alias:o$,name:P$,value:c}}throw new T("intrinsic "+v$+" does not exist!")};q.exports=function(v$,a){if(typeof v$!=="string"||v$.length===0)throw new H("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof a!=="boolean")throw new H('"allowMissing" argument must be a boolean');if(l(/^%?[^%]*%?$/,v$)===null)throw new T("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var P$=q$(v$),o$=P$.length>0?P$[0]:"",c=B("%"+o$+"%",a),r=c.name,J$=c.value,$$=!1,_$=c.alias;if(_$)o$=_$[0],E(P$,R([0,1],_$));for(var O$=1,d=!0;O$<P$.length;O$+=1){var n=P$[O$],H$=x(n,0,1),t=x(n,-1);if((H$==='"'||H$==="'"||H$==="`"||(t==='"'||t==="'"||t==="`"))&&H$!==t)throw new T("property names with quotes must have matching quotes");if(n==="constructor"||!d)$$=!0;if(o$+="."+n,r="%"+o$+"%",V(Z,r))J$=Z[r];else if(J$!=null){if(!(n in J$)){if(!a)throw new H("base intrinsic for "+v$+" exists, but the property is not available.");return}if(g&&O$+1>=P$.length){var U=g(J$,n);if(d=!!U,d&&"get"in U&&!("originalValue"in U.get))J$=U.get;else J$=J$[n]}else d=V(J$,n),J$=J$[n];if(d&&!$$)Z[r]=J$}}return J$}}),zM=T$(($,q)=>{var _=vM(),K=MH(),P=K([_("%String.prototype.indexOf%")]);q.exports=function(Y,O){var z=_(Y,!!O);if(typeof z==="function"&&P(Y,".prototype.")>-1)return K([z]);return z}}),Ji=T$(($,q)=>{var _=Function.prototype.toString,K=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,P,Y;if(typeof K==="function"&&typeof Object.defineProperty==="function")try{P=Object.defineProperty({},"length",{get:function(){throw Y}}),Y={},K(function(){throw 42},null,P)}catch(g){if(g!==Y)K=null}else K=null;var O=/^\s*class\b/,z=function(g){try{var y=_.call(g);return O.test(y)}catch(p){return!1}},T=function(g){try{if(z(g))return!1;return _.call(g),!0}catch(y){return!1}},H=Object.prototype.toString,f="[object Object]",w="[object Function]",k="[object GeneratorFunction]",S="[object HTMLAllCollection]",N="[object HTML document.all class]",h="[object HTMLCollection]",C=typeof Symbol==="function"&&!!Symbol.toStringTag,I=!(0 in[,]),D=function(){return!1};if(typeof document==="object"){if(L=document.all,H.call(L)===H.call(document.all))D=function(g){if((I||!g)&&(typeof g>"u"||typeof g==="object"))try{var y=H.call(g);return(y===S||y===N||y===h||y===f)&&g("")==null}catch(p){}return!1}}var L;q.exports=K?function(g){if(D(g))return!0;if(!g)return!1;if(typeof g!=="function"&&typeof g!=="object")return!1;try{K(g,null,P)}catch(y){if(y!==Y)return!1}return!z(g)&&T(g)}:function(g){if(D(g))return!0;if(!g)return!1;if(typeof g!=="function"&&typeof g!=="object")return!1;if(C)return T(g);if(z(g))return!1;var y=H.call(g);if(y!==w&&y!==k&&!/^\[object HTML/.test(y))return!1;return T(g)}}),Hi=T$(($,q)=>{var _=Ji(),K=Object.prototype.toString,P=Object.prototype.hasOwnProperty,Y=function(H,f,w){for(var k=0,S=H.length;k<S;k++)if(P.call(H,k))if(w==null)f(H[k],k,H);else f.call(w,H[k],k,H)},O=function(H,f,w){for(var k=0,S=H.length;k<S;k++)if(w==null)f(H.charAt(k),k,H);else f.call(w,H.charAt(k),k,H)},z=function(H,f,w){for(var k in H)if(P.call(H,k))if(w==null)f(H[k],k,H);else f.call(w,H[k],k,H)};function T(H){return K.call(H)==="[object Array]"}q.exports=function(H,f,w){if(!_(f))throw TypeError("iterator must be a function");var k;if(arguments.length>=3)k=w;if(T(H))Y(H,f,k);else if(typeof H==="string")O(H,f,k);else z(H,f,k)}}),Ti=T$(($,q)=>{q.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),wi=T$(($,q)=>{var _=Ti(),K=typeof globalThis>"u"?globalThis:globalThis;q.exports=function(){var P=[];for(var Y=0;Y<_.length;Y++)if(typeof K[_[Y]]==="function")P[P.length]=_[Y];return P}}),fi=T$(($,q)=>{var _=S2(),K=_M(),P=q1(),Y=_1();q.exports=function(O,z,T){if(!O||typeof O!=="object"&&typeof O!=="function")throw new P("`obj` must be an object or a function`");if(typeof z!=="string"&&typeof z!=="symbol")throw new P("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new P("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new P("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new P("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new P("`loose`, if provided, must be a boolean");var H=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,w=arguments.length>5?arguments[5]:null,k=arguments.length>6?arguments[6]:!1,S=!!Y&&Y(O,z);if(_)_(O,z,{configurable:w===null&&S?S.configurable:!w,enumerable:H===null&&S?S.enumerable:!H,value:T,writable:f===null&&S?S.writable:!f});else if(k||!H&&!f&&!w)O[z]=T;else throw new K("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),Zi=T$(($,q)=>{var _=S2(),K=function(){return!!_};K.hasArrayLengthDefineBug=function(){if(!_)return null;try{return _([],"length",{value:1}).length!==1}catch(P){return!0}},q.exports=K}),Xi=T$(($,q)=>{var _=vM(),K=fi(),P=Zi()(),Y=_1(),O=q1(),z=_("%Math.floor%");q.exports=function(T,H){if(typeof T!=="function")throw new O("`fn` is not a function");if(typeof H!=="number"||H<0||H>4294967295||z(H)!==H)throw new O("`length` must be a positive 32-bit integer");var f=arguments.length>2&&!!arguments[2],w=!0,k=!0;if("length"in T&&Y){var S=Y(T,"length");if(S&&!S.configurable)w=!1;if(S&&!S.writable)k=!1}if(w||k||!f)if(P)K(T,"length",H,!0,!0);else K(T,"length",H);return T}}),Ai=T$(($,q)=>{var _=K1(),K=SH(),P=OM();q.exports=function(){return P(_,K,arguments)}}),ki=T$(($,q)=>{var _=Xi(),K=S2(),P=MH(),Y=Ai();if(q.exports=function(O){var z=P(arguments),T=O.length-(arguments.length-1);return _(z,1+(T>0?T:0),!0)},K)K(q.exports,"apply",{value:Y});else q.exports.apply=Y}),Gi=T$(($,q)=>{var _=KM();q.exports=function(){return _()&&!!Symbol.toStringTag}}),Vi=T$(($,q)=>{var _=Hi(),K=wi(),P=ki(),Y=zM(),O=_1(),z=jM(),T=Y("Object.prototype.toString"),H=Gi()(),f=typeof globalThis>"u"?globalThis:globalThis,w=K(),k=Y("String.prototype.slice"),S=Y("Array.prototype.indexOf",!0)||function(I,D){for(var L=0;L<I.length;L+=1)if(I[L]===D)return L;return-1},N={__proto__:null};if(H&&O&&z)_(w,function(I){var D=new f[I];if(Symbol.toStringTag in D&&z){var L=z(D),g=O(L,Symbol.toStringTag);if(!g&&L){var y=z(L);g=O(y,Symbol.toStringTag)}N["$"+I]=P(g.get)}});else _(w,function(I){var D=new f[I],L=D.slice||D.set;if(L)N["$"+I]=P(L)});var h=function(I){var D=!1;return _(N,function(L,g){if(!D)try{if("$"+L(I)===g)D=k(g,1)}catch(y){}}),D},C=function(I){var D=!1;return _(N,function(L,g){if(!D)try{L(I),D=k(g,1)}catch(y){}}),D};q.exports=function(I){if(!I||typeof I!=="object")return!1;if(!H){var D=k(T(I),8,-1);if(S(w,D)>-1)return D;if(D!=="Object")return!1;return C(I)}if(!O)return null;return h(I)}}),Si=T$(($,q)=>{var _=Vi();q.exports=function(K){return!!_(K)}}),Mi=T$(($,q)=>{var _=q1(),K=zM(),P=K("TypedArray.prototype.buffer",!0),Y=Si();q.exports=P||function(O){if(!Y(O))throw new _("Not a Typed Array");return O.buffer}}),Ni=T$(($,q)=>{var _=mq().Buffer,K=nn(),P=Mi(),Y=ArrayBuffer.isView||function(H){try{return P(H),!0}catch(f){return!1}},O=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",T=z&&(_.prototype instanceof Uint8Array||_.TYPED_ARRAY_SUPPORT);q.exports=function(H,f){if(_.isBuffer(H)){if(H.constructor&&!("isBuffer"in H))return _.from(H);return H}if(typeof H==="string")return _.from(H,f);if(z&&Y(H)){if(H.byteLength===0)return _.alloc(0);if(T){var w=_.from(H.buffer,H.byteOffset,H.byteLength);if(w.byteLength===H.byteLength)return w}var k=H instanceof Uint8Array?H:new Uint8Array(H.buffer,H.byteOffset,H.byteLength),S=_.from(k);if(S.length===H.byteLength)return S}if(O&&H instanceof Uint8Array)return _.from(H);var N=K(H);if(N)for(var h=0;h<H.length;h+=1){var C=H[h];if(typeof C!=="number"||C<0||C>255||~~C!==C)throw RangeError("Array items must be numbers in the range 0-255.")}if(N||_.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return _.from(H);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),NH=T$(($,q)=>{var _=mq().Buffer,K=Ni(),P=typeof Uint8Array<"u",Y=P&&typeof ArrayBuffer<"u",O=Y&&ArrayBuffer.isView;q.exports=function(z,T,H){if(typeof z==="string"||_.isBuffer(z)||P&&z instanceof Uint8Array||O&&O(z))return K(z,T);throw TypeError(H+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),WM=T$(($,q)=>{var _={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},K={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},P=$M(),Y=mq().Buffer,O=kH(),z=GH(),T=NH();function H(f,w,k,S,N){O(k,S),f=T(f,z,"Password"),w=T(w,z,"Salt");var h=(N||"sha1").toLowerCase(),C=K[h]||h,I=_[C];if(typeof I!=="number"||!I)throw TypeError("Digest algorithm not supported: "+N);var D=Y.allocUnsafe(S),L=Y.allocUnsafe(w.length+4);w.copy(L,0,0,w.length);var g=0,y=I,p=Math.ceil(S/y);for(var o=1;o<=p;o++){L.writeUInt32BE(o,w.length);var s=P(C,f).update(L).digest(),Q=s;for(var m=1;m<k;m++){Q=P(C,f).update(Q).digest();for(var e=0;e<y;e++)s[e]^=Q[e]}s.copy(D,g),g+=y}return D}q.exports=H}),Ci=T$(($,q)=>{var _=mq().Buffer,K=kH(),P=GH(),Y=WM(),O=NH(),z,T=globalThis.crypto&&globalThis.crypto.subtle,H={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[],w;function k(){if(w)return w;if(globalThis.process&&globalThis.process.nextTick)w=globalThis.process.nextTick;else if(globalThis.queueMicrotask)w=globalThis.queueMicrotask;else if(globalThis.setImmediate)w=globalThis.setImmediate;else w=globalThis.setTimeout;return w}function S(C,I,D,L,g){return T.importKey("raw",C,{name:"PBKDF2"},!1,["deriveBits"]).then(function(y){return T.deriveBits({name:"PBKDF2",salt:I,iterations:D,hash:{name:g}},y,L<<3)}).then(function(y){return _.from(y)})}function N(C){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!T||!T.importKey||!T.deriveBits)return Promise.resolve(!1);if(f[C]!==void 0)return f[C];z=z||_.alloc(8);var I=S(z,z,10,128,C).then(function(){return!0},function(){return!1});return f[C]=I,I}function h(C,I){C.then(function(D){k()(function(){I(null,D)})},function(D){k()(function(){I(D)})})}q.exports=function(C,I,D,L,g,y){if(typeof g==="function")y=g,g=void 0;if(K(D,L),C=O(C,P,"Password"),I=O(I,P,"Salt"),typeof y!=="function")throw Error("No callback provided to pbkdf2");g=g||"sha1";var p=H[g.toLowerCase()];if(!p||typeof globalThis.Promise!=="function"){k()(function(){var o;try{o=Y(C,I,D,L,g)}catch(s){y(s);return}y(null,o)});return}h(N(p).then(function(o){if(o)return S(C,I,D,L,p);return Y(C,I,D,L,g)}),y)}}),JM=T$(($)=>{var q=(lq(),J6(dq)),_=kH(),K=GH(),P=NH();function Y(z,T,H,f,w,k){if(_(H,f),z=P(z,K,"Password"),T=P(T,K,"Salt"),typeof w==="function")k=w,w="sha1";if(typeof k!=="function")throw Error("No callback provided to pbkdf2");return q.pbkdf2(z,T,H,f,w,k)}function O(z,T,H,f,w){return _(H,f),z=P(z,K,"Password"),T=P(T,K,"Salt"),w=w||"sha1",q.pbkdf2Sync(z,T,H,f,w)}if(!q.pbkdf2Sync||q.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=WM(),$.pbkdf2=Ci();else $.pbkdf2Sync=O,$.pbkdf2=Y}),Ei=T$(($)=>{var q=(lq(),J6(dq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),hi=T$(($)=>{var q=(lq(),J6(dq));$.DiffieHellmanGroup=q.DiffieHellmanGroup,$.createDiffieHellmanGroup=q.createDiffieHellmanGroup,$.getDiffieHellman=q.getDiffieHellman,$.createDiffieHellman=q.createDiffieHellman,$.DiffieHellman=q.DiffieHellman}),Ri=T$(($)=>{var q=(lq(),J6(dq));$.createSign=q.createSign,$.Sign=q.Sign,$.createVerify=q.createVerify,$.Verify=q.Verify}),Ii=T$(($,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"}}}),N_=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,G,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(G=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(G=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,G=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,G=Math.min(j.length,X);for(var M=W;M<G;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var G=j.length-X,M=G%J,A=Math.min(G,G-M)+X,v=0;for(var V=X;V<A;V+=J)if(v=f(j,V,V+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,V,j.length,W);for(V=0;V<M;V++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var G=0;G<this.length;G++){var M=this.words[G],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,G--;if(Z!==0||G!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],V=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(V).toString(j);if(R=R.idivn(V),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var G=W==="le",M=new j(Z),A,v,V=this.clone();if(!G){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[Z-v-1]=A}else{for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var G=0;G<J.length;G++)W=(X.words[G]|0)+(J.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;for(;Z!==0&&G<X.length;G++)W=(X.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;G<X.length;G++)this.words[G]=X.words[G];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var G=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;for(;G!==0&&M<J.length;M++)W=(J.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;if(G===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,G=W.words[0]|0,M=Z*G,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var V=1;V<J;V++){var R=v>>>26,E=v&67108863,b=Math.min(V,W.length-1);for(var x=Math.max(0,V-j.length+1);x<=b;x++){var l=V-x|0;Z=j.words[l]|0,G=W.words[x]|0,M=Z*G+E,R+=M/67108864|0,E=M&67108863}X.words[V]=E|0,v=R|0}if(v!==0)X.words[V]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,G=X.words,M=0,A,v,V,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,F=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,a=v$&8191,P$=v$>>>13,o$=J[4]|0,c=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,V=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(F,M$)|0,V=Math.imul(F,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,V=V+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,V=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(F,E$)|0,V=V+Math.imul(F,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,V=V+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(a,M$),v=Math.imul(a,S$),v=v+Math.imul(P$,M$)|0,V=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,V=V+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(F,g$)|0,V=V+Math.imul(F,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,V=V+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(c,M$),v=Math.imul(c,S$),v=v+Math.imul(r,M$)|0,V=Math.imul(r,S$),A=A+Math.imul(a,E$)|0,v=v+Math.imul(a,b$)|0,v=v+Math.imul(P$,E$)|0,V=V+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,V=V+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(F,y$)|0,V=V+Math.imul(F,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,V=V+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,V=Math.imul(_$,S$),A=A+Math.imul(c,E$)|0,v=v+Math.imul(c,b$)|0,v=v+Math.imul(r,E$)|0,V=V+Math.imul(r,b$)|0,A=A+Math.imul(a,g$)|0,v=v+Math.imul(a,h$)|0,v=v+Math.imul(P$,g$)|0,V=V+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,V=V+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(F,u$)|0,V=V+Math.imul(F,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,V=V+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,V=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,V=V+Math.imul(_$,b$)|0,A=A+Math.imul(c,g$)|0,v=v+Math.imul(c,h$)|0,v=v+Math.imul(r,g$)|0,V=V+Math.imul(r,h$)|0,A=A+Math.imul(a,y$)|0,v=v+Math.imul(a,R$)|0,v=v+Math.imul(P$,y$)|0,V=V+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,V=V+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(F,I$)|0,V=V+Math.imul(F,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,V=V+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,V=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,V=V+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,V=V+Math.imul(_$,h$)|0,A=A+Math.imul(c,y$)|0,v=v+Math.imul(c,R$)|0,v=v+Math.imul(r,y$)|0,V=V+Math.imul(r,R$)|0,A=A+Math.imul(a,u$)|0,v=v+Math.imul(a,x$)|0,v=v+Math.imul(P$,u$)|0,V=V+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,V=V+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(F,K$)|0,V=V+Math.imul(F,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,V=V+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,V=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,V=V+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,V=V+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,V=V+Math.imul(_$,R$)|0,A=A+Math.imul(c,u$)|0,v=v+Math.imul(c,x$)|0,v=v+Math.imul(r,u$)|0,V=V+Math.imul(r,x$)|0,A=A+Math.imul(a,I$)|0,v=v+Math.imul(a,u)|0,v=v+Math.imul(P$,I$)|0,V=V+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,V=V+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(F,G$)|0,V=V+Math.imul(F,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,V=V+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,V=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,V=V+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,V=V+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,V=V+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,V=V+Math.imul(_$,x$)|0,A=A+Math.imul(c,I$)|0,v=v+Math.imul(c,u)|0,v=v+Math.imul(r,I$)|0,V=V+Math.imul(r,u)|0,A=A+Math.imul(a,K$)|0,v=v+Math.imul(a,Y$)|0,v=v+Math.imul(P$,K$)|0,V=V+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,V=V+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(F,D$)|0,V=V+Math.imul(F,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,V=V+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,V=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,V=V+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,V=V+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,V=V+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,V=V+Math.imul(_$,u)|0,A=A+Math.imul(c,K$)|0,v=v+Math.imul(c,Y$)|0,v=v+Math.imul(r,K$)|0,V=V+Math.imul(r,Y$)|0,A=A+Math.imul(a,G$)|0,v=v+Math.imul(a,V$)|0,v=v+Math.imul(P$,G$)|0,V=V+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,V=V+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(F,L$)|0,V=V+Math.imul(F,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,V=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,V=V+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,V=V+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,V=V+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,V=V+Math.imul(_$,Y$)|0,A=A+Math.imul(c,G$)|0,v=v+Math.imul(c,V$)|0,v=v+Math.imul(r,G$)|0,V=V+Math.imul(r,V$)|0,A=A+Math.imul(a,D$)|0,v=v+Math.imul(a,p$)|0,v=v+Math.imul(P$,D$)|0,V=V+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,V=V+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,V=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,V=V+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,V=V+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,V=V+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,V=V+Math.imul(_$,V$)|0,A=A+Math.imul(c,D$)|0,v=v+Math.imul(c,p$)|0,v=v+Math.imul(r,D$)|0,V=V+Math.imul(r,p$)|0,A=A+Math.imul(a,L$)|0,v=v+Math.imul(a,C$)|0,v=v+Math.imul(P$,L$)|0,V=V+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,V=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,V=V+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,V=V+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,V=V+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,V=V+Math.imul(_$,p$)|0,A=A+Math.imul(c,L$)|0,v=v+Math.imul(c,C$)|0,v=v+Math.imul(r,L$)|0,V=V+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,V=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,V=V+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,V=V+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,V=V+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,V=V+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,V=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,V=V+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,V=V+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,V=V+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,V=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,V=V+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,V=V+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,V=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,V=V+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,V=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(V+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,G[0]=c6,G[1]=W6,G[2]=j6,G[3]=E6,G[4]=M6,G[5]=t6,G[6]=U6,G[7]=F6,G[8]=Q6,G[9]=a6,G[10]=e6,G[11]=s6,G[12]=$q,G[13]=qq,G[14]=_q,G[15]=Kq,G[16]=Pq,G[17]=Yq,G[18]=Oq,M!==0)G[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var G=0;G<X.length-1;G++){var M=Z;Z=0;var A=J&67108863,v=Math.min(G,W.length-1);for(var V=Math.max(0,G-j.length+1);V<=v;V++){var R=G-V,E=j.words[R]|0,b=W.words[V]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[G]=A,J=M,M=Z}if(J!==0)X.words[G]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,G){for(var M=0;M<G;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,G){this.permute(G,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=V;for(var x=0;x<M;x++){var l=X[R+x],F=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=F+q$,X[R+x+M]=l-f$,J[R+x+M]=F-q$,x!==A)B=v*E-V*b,b=v*b+V*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var G=0;G<W;G++)Z=Z+(j[G]|0),X[2*G]=Z&8191,Z=Z>>>13,X[2*G+1]=Z&8191,Z=Z>>>13;for(G=2*W;G<J;++G)X[G]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),G=this.stub(J),M=Array(J),A=Array(J),v=Array(J),V=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,V,J),this.transform(M,G,A,v,J,Z),this.transform(V,G,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,G,J,Z),this.conjugate(b,G,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var G=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|G,G=M>>>26-W}if(G)this.words[Z]=G,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,G=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=G,J=Math.max(0,J),A){for(var v=0;v<G;v++)A.words[v]=this.words[v];A.length=G}if(G===0);else if(this.length>G){this.length-=G;for(v=0;v<this.length;v++)this.words[v]=this.words[v+G]}else this.words[0]=0,this.length=1;var V=0;for(v=this.length-1;v>=0&&(V!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=V<<26-Z|R>>>Z,V=R&M}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var G,M=0;for(Z=0;Z<j.length;Z++){G=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;G-=A&67108863,M=(G>>26)-(A/67108864|0),this.words[Z+X]=G&67108863}for(;Z<this.length-X;Z++)G=(this.words[Z+X]|0)+M,M=G>>26,this.words[Z+X]=G&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)G=-(this.words[Z]|0)+M,M=G>>26,this.words[Z]=G&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,G=Z.words[Z.length-1]|0,M=this._countBits(G);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),G=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var V=0;V<v.length;V++)v.words[V]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/G|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,G;if(this.negative!==0&&j.negative===0){if(G=this.neg().divmod(j,W),W!=="mod")J=G.div.neg();if(W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(G=this.divmod(j.neg(),W),W!=="mod")J=G.div.neg();return{div:J,mod:G.mod}}if((this.negative&j.negative)!==0){if(G=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:G.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),G=X.cmp(J);if(G<0||Z===1&&G===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),V=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(V);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(G.isOdd()||M.isOdd())G.iadd(v),M.isub(V);G.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(G),Z.isub(M);else X.isub(W),G.isub(J),M.isub(Z)}return{a:G,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(G);J.iushrn(1)}}for(var v=0,V=1;(X.words[0]&V)===0&&v<26;++v,V<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(G);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var G=W;W=X,X=G}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var G=X;Z!==0&&G<this.length;G++){var M=this.words[G]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[G]=M}if(Z!==0)this.words[G]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new m(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(p,y),p.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var G=j.words[9];W.words[W.length++]=G&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|G>>>22,G=M}if(G>>>=22,j.words[Z-10]=G,G===0&&j.length>10)j.length-=10;else j.length-=9},p.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function Q(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(Q,y),Q.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new p;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new Q;else throw Error("Unknown prime "+j);return g[j]=W,W};function m(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}m.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},m.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},m.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},m.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},m.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},m.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},m.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},m.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},m.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},m.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},m.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},m.prototype.isqr=function(j){return this.imul(j,j.clone())},m.prototype.sqr=function(j){return this.mul(j,j)},m.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var G=new O(1).toRed(this),M=G.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var V=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(G)!==0){var x=E;for(var l=0;x.cmp(G)!==0;l++)x=x.redSqr();P(l<b);var F=this.pow(V,new O(1).iushln(b-l-1));R=R.redMul(F),V=F.redSqr(),E=E.redMul(V),b=l}return R},m.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},m.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var G=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var V=W.words[Z];for(var R=v-1;R>=0;R--){var E=V>>R&1;if(G!==J[0])G=this.sqr(G);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;G=this.mul(G,J[M]),A=0,M=0}v=26}return G},m.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},m.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new e(j)};function e(j){if(m.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(e,m),e.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},e.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},e.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),PK=T$(($,q)=>{q.exports=_;function _(K,P){if(!K)throw Error(P||"Assertion failed")}_.equal=function(K,P,Y){if(K!=P)throw Error(Y||"Assertion failed: "+K+" != "+P)}}),HM=T$(($)=>{var q=$;function _(Y,O){if(Array.isArray(Y))return Y.slice();if(!Y)return[];var z=[];if(typeof Y!=="string"){for(var T=0;T<Y.length;T++)z[T]=Y[T]|0;return z}if(O==="hex"){if(Y=Y.replace(/[^a-z0-9]+/ig,""),Y.length%2!==0)Y="0"+Y;for(var T=0;T<Y.length;T+=2)z.push(parseInt(Y[T]+Y[T+1],16))}else for(var T=0;T<Y.length;T++){var H=Y.charCodeAt(T),f=H>>8,w=H&255;if(f)z.push(f,w);else z.push(w)}return z}q.toArray=_;function K(Y){if(Y.length===1)return"0"+Y;else return Y}q.zero2=K;function P(Y){var O="";for(var z=0;z<Y.length;z++)O+=K(Y[z].toString(16));return O}q.toHex=P,q.encode=function(Y,O){if(O==="hex")return P(Y);else return Y}}),M8=T$(($)=>{var q=$,_=N_(),K=PK(),P=HM();q.assert=K,q.toArray=P.toArray,q.zero2=P.zero2,q.toHex=P.toHex,q.encode=P.encode;function Y(f,w,k){var S=Array(Math.max(f.bitLength(),k)+1),N;for(N=0;N<S.length;N+=1)S[N]=0;var h=1<<w+1,C=f.clone();for(N=0;N<S.length;N++){var I,D=C.andln(h-1);if(C.isOdd()){if(D>(h>>1)-1)I=(h>>1)-D;else I=D;C.isubn(I)}else I=0;S[N]=I,C.iushrn(1)}return S}q.getNAF=Y;function O(f,w){var k=[[],[]];f=f.clone(),w=w.clone();var S=0,N=0,h;while(f.cmpn(-S)>0||w.cmpn(-N)>0){var C=f.andln(3)+S&3,I=w.andln(3)+N&3;if(C===3)C=-1;if(I===3)I=-1;var D;if((C&1)===0)D=0;else if(h=f.andln(7)+S&7,(h===3||h===5)&&I===2)D=-C;else D=C;k[0].push(D);var L;if((I&1)===0)L=0;else if(h=w.andln(7)+N&7,(h===3||h===5)&&C===2)L=-I;else L=I;if(k[1].push(L),2*S===D+1)S=1-S;if(2*N===L+1)N=1-N;f.iushrn(1),w.iushrn(1)}return k}q.getJSF=O;function z(f,w,k){var S="_"+w;f.prototype[w]=function(){return this[S]!==void 0?this[S]:this[S]=k.call(this)}}q.cachedProperty=z;function T(f){return typeof f==="string"?q.toArray(f,"hex"):f}q.parseBytes=T;function H(f){return new _(f,"hex","le")}q.intFromLE=H}),TM=T$(($,q)=>{var _;q.exports=function(Y){if(!_)_=new K(null);return _.generate(Y)};function K(Y){this.rand=Y}if(q.exports.Rand=K,K.prototype.generate=function(Y){return this._rand(Y)},K.prototype._rand=function(Y){if(this.rand.getBytes)return this.rand.getBytes(Y);var O=new Uint8Array(Y);for(var z=0;z<O.length;z++)O[z]=this.rand.getByte();return O},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)K.prototype._rand=function(Y){var O=new Uint8Array(Y);return self.crypto.getRandomValues(O),O};else if(self.msCrypto&&self.msCrypto.getRandomValues)K.prototype._rand=function(Y){var O=new Uint8Array(Y);return self.msCrypto.getRandomValues(O),O};else if(typeof window==="object")K.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(P=(lq(),J6(dq)),typeof P.randomBytes!=="function")throw Error("Not supported");K.prototype._rand=function(Y){return P.randomBytes(Y)}}catch(Y){}var P}),M2=T$(($,q)=>{var _=N_(),K=M8(),P=K.getNAF,Y=K.getJSF,O=K.assert;function z(H,f){this.type=H,this.p=new _(f.p,16),this.red=f.prime?_.red(f.prime):_.mont(this.p),this.zero=new _(0).toRed(this.red),this.one=new _(1).toRed(this.red),this.two=new _(2).toRed(this.red),this.n=f.n&&new _(f.n,16),this.g=f.g&&this.pointFromJSON(f.g,f.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var w=this.n&&this.p.div(this.n);if(!w||w.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(H,f){O(H.precomputed);var w=H._getDoubles(),k=P(f,1,this._bitLength),S=(1<<w.step+1)-(w.step%2===0?2:1);S/=3;var N=[],h,C;for(h=0;h<k.length;h+=w.step){C=0;for(var I=h+w.step-1;I>=h;I--)C=(C<<1)+k[I];N.push(C)}var D=this.jpoint(null,null,null),L=this.jpoint(null,null,null);for(var g=S;g>0;g--){for(h=0;h<N.length;h++)if(C=N[h],C===g)L=L.mixedAdd(w.points[h]);else if(C===-g)L=L.mixedAdd(w.points[h].neg());D=D.add(L)}return D.toP()},z.prototype._wnafMul=function(H,f){var w=4,k=H._getNAFPoints(w);w=k.wnd;var S=k.points,N=P(f,w,this._bitLength),h=this.jpoint(null,null,null);for(var C=N.length-1;C>=0;C--){for(var I=0;C>=0&&N[C]===0;C--)I++;if(C>=0)I++;if(h=h.dblp(I),C<0)break;var D=N[C];if(O(D!==0),H.type==="affine")if(D>0)h=h.mixedAdd(S[D-1>>1]);else h=h.mixedAdd(S[-D-1>>1].neg());else if(D>0)h=h.add(S[D-1>>1]);else h=h.add(S[-D-1>>1].neg())}return H.type==="affine"?h.toP():h},z.prototype._wnafMulAdd=function(H,f,w,k,S){var N=this._wnafT1,h=this._wnafT2,C=this._wnafT3,I=0,D,L,g;for(D=0;D<k;D++){g=f[D];var y=g._getNAFPoints(H);N[D]=y.wnd,h[D]=y.points}for(D=k-1;D>=1;D-=2){var p=D-1,o=D;if(N[p]!==1||N[o]!==1){C[p]=P(w[p],N[p],this._bitLength),C[o]=P(w[o],N[o],this._bitLength),I=Math.max(C[p].length,I),I=Math.max(C[o].length,I);continue}var s=[f[p],null,null,f[o]];if(f[p].y.cmp(f[o].y)===0)s[1]=f[p].add(f[o]),s[2]=f[p].toJ().mixedAdd(f[o].neg());else if(f[p].y.cmp(f[o].y.redNeg())===0)s[1]=f[p].toJ().mixedAdd(f[o]),s[2]=f[p].add(f[o].neg());else s[1]=f[p].toJ().mixedAdd(f[o]),s[2]=f[p].toJ().mixedAdd(f[o].neg());var Q=[-3,-1,-5,-7,0,7,5,1,3],m=Y(w[p],w[o]);I=Math.max(m[0].length,I),C[p]=Array(I),C[o]=Array(I);for(L=0;L<I;L++){var e=m[0][L]|0,j=m[1][L]|0;C[p][L]=Q[(e+1)*3+(j+1)],C[o][L]=0,h[p]=s}}var W=this.jpoint(null,null,null),X=this._wnafT4;for(D=I;D>=0;D--){var J=0;while(D>=0){var Z=!0;for(L=0;L<k;L++)if(X[L]=C[L][D]|0,X[L]!==0)Z=!1;if(!Z)break;J++,D--}if(D>=0)J++;if(W=W.dblp(J),D<0)break;for(L=0;L<k;L++){var G=X[L];if(G===0)continue;else if(G>0)g=h[L][G-1>>1];else if(G<0)g=h[L][-G-1>>1].neg();if(g.type==="affine")W=W.mixedAdd(g);else W=W.add(g)}}for(D=0;D<k;D++)h[D]=null;if(S)return W;else return W.toP()};function T(H,f){this.curve=H,this.type=f,this.precomputed=null}z.BasePoint=T,T.prototype.eq=function(){throw Error("Not implemented")},T.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(H,f){H=K.toArray(H,f);var w=this.p.byteLength();if((H[0]===4||H[0]===6||H[0]===7)&&H.length-1===2*w){if(H[0]===6)O(H[H.length-1]%2===0);else if(H[0]===7)O(H[H.length-1]%2===1);var k=this.point(H.slice(1,1+w),H.slice(1+w,1+2*w));return k}else if((H[0]===2||H[0]===3)&&H.length-1===w)return this.pointFromX(H.slice(1,1+w),H[0]===3);throw Error("Unknown point format")},T.prototype.encodeCompressed=function(H){return this.encode(H,!0)},T.prototype._encode=function(H){var f=this.curve.p.byteLength(),w=this.getX().toArray("be",f);if(H)return[this.getY().isEven()?2:3].concat(w);return[4].concat(w,this.getY().toArray("be",f))},T.prototype.encode=function(H,f){return K.encode(this._encode(f),H)},T.prototype.precompute=function(H){if(this.precomputed)return this;var f={doubles:null,naf:null,beta:null};return f.naf=this._getNAFPoints(8),f.doubles=this._getDoubles(4,H),f.beta=this._getBeta(),this.precomputed=f,this},T.prototype._hasDoubles=function(H){if(!this.precomputed)return!1;var f=this.precomputed.doubles;if(!f)return!1;return f.points.length>=Math.ceil((H.bitLength()+1)/f.step)},T.prototype._getDoubles=function(H,f){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var w=[this],k=this;for(var S=0;S<f;S+=H){for(var N=0;N<H;N++)k=k.dbl();w.push(k)}return{step:H,points:w}},T.prototype._getNAFPoints=function(H){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var f=[this],w=(1<<H)-1,k=w===1?null:this.dbl();for(var S=1;S<w;S++)f[S]=f[S-1].add(k);return{wnd:H,points:f}},T.prototype._getBeta=function(){return null},T.prototype.dblp=function(H){var f=this;for(var w=0;w<H;w++)f=f.dbl();return f}}),Di=T$(($,q)=>{if(typeof Object.create==="function")q.exports=function(_,K){if(K)_.super_=K,_.prototype=Object.create(K.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}})};else q.exports=function(_,K){if(K){_.super_=K;var P=function(){};P.prototype=K.prototype,_.prototype=new P,_.prototype.constructor=_}}}),v8=T$(($,q)=>{try{if(_=(R0(),J6(h0)),typeof _.inherits!=="function")throw"";q.exports=_.inherits}catch(K){q.exports=Di()}var _}),Li=T$(($,q)=>{var _=M8(),K=N_(),P=v8(),Y=M2(),O=_.assert;function z(f){Y.call(this,"short",f),this.a=new K(f.a,16).toRed(this.red),this.b=new K(f.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(f),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}P(z,Y),q.exports=z,z.prototype._getEndomorphism=function(f){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var w,k;if(f.beta)w=new K(f.beta,16).toRed(this.red);else{var S=this._getEndoRoots(this.p);w=S[0].cmp(S[1])<0?S[0]:S[1],w=w.toRed(this.red)}if(f.lambda)k=new K(f.lambda,16);else{var N=this._getEndoRoots(this.n);if(this.g.mul(N[0]).x.cmp(this.g.x.redMul(w))===0)k=N[0];else k=N[1],O(this.g.mul(k).x.cmp(this.g.x.redMul(w))===0)}var h;if(f.basis)h=f.basis.map(function(C){return{a:new K(C.a,16),b:new K(C.b,16)}});else h=this._getEndoBasis(k);return{beta:w,lambda:k,basis:h}},z.prototype._getEndoRoots=function(f){var w=f===this.p?this.red:K.mont(f),k=new K(2).toRed(w).redInvm(),S=k.redNeg(),N=new K(3).toRed(w).redNeg().redSqrt().redMul(k),h=S.redAdd(N).fromRed(),C=S.redSub(N).fromRed();return[h,C]},z.prototype._getEndoBasis=function(f){var w=this.n.ushrn(Math.floor(this.n.bitLength()/2)),k=f,S=this.n.clone(),N=new K(1),h=new K(0),C=new K(0),I=new K(1),D,L,g,y,p,o,s,Q=0,m,e;while(k.cmpn(0)!==0){var j=S.div(k);m=S.sub(j.mul(k)),e=C.sub(j.mul(N));var W=I.sub(j.mul(h));if(!g&&m.cmp(w)<0)D=s.neg(),L=N,g=m.neg(),y=e;else if(g&&++Q===2)break;s=m,S=k,k=m,C=N,N=e,I=h,h=W}p=m.neg(),o=e;var X=g.sqr().add(y.sqr()),J=p.sqr().add(o.sqr());if(J.cmp(X)>=0)p=D,o=L;if(g.negative)g=g.neg(),y=y.neg();if(p.negative)p=p.neg(),o=o.neg();return[{a:g,b:y},{a:p,b:o}]},z.prototype._endoSplit=function(f){var w=this.endo.basis,k=w[0],S=w[1],N=S.b.mul(f).divRound(this.n),h=k.b.neg().mul(f).divRound(this.n),C=N.mul(k.a),I=h.mul(S.a),D=N.mul(k.b),L=h.mul(S.b),g=f.sub(C).sub(I),y=D.add(L).neg();return{k1:g,k2:y}},z.prototype.pointFromX=function(f,w){if(f=new K(f,16),!f.red)f=f.toRed(this.red);var k=f.redSqr().redMul(f).redIAdd(f.redMul(this.a)).redIAdd(this.b),S=k.redSqrt();if(S.redSqr().redSub(k).cmp(this.zero)!==0)throw Error("invalid point");var N=S.fromRed().isOdd();if(w&&!N||!w&&N)S=S.redNeg();return this.point(f,S)},z.prototype.validate=function(f){if(f.inf)return!0;var{x:w,y:k}=f,S=this.a.redMul(w),N=w.redSqr().redMul(w).redIAdd(S).redIAdd(this.b);return k.redSqr().redISub(N).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(f,w,k){var S=this._endoWnafT1,N=this._endoWnafT2;for(var h=0;h<f.length;h++){var C=this._endoSplit(w[h]),I=f[h],D=I._getBeta();if(C.k1.negative)C.k1.ineg(),I=I.neg(!0);if(C.k2.negative)C.k2.ineg(),D=D.neg(!0);S[h*2]=I,S[h*2+1]=D,N[h*2]=C.k1,N[h*2+1]=C.k2}var L=this._wnafMulAdd(1,S,N,h*2,k);for(var g=0;g<h*2;g++)S[g]=null,N[g]=null;return L};function T(f,w,k,S){if(Y.BasePoint.call(this,f,"affine"),w===null&&k===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new K(w,16),this.y=new K(k,16),S)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}}P(T,Y.BasePoint),z.prototype.point=function(f,w,k){return new T(this,f,w,k)},z.prototype.pointFromJSON=function(f,w){return T.fromJSON(this,f,w)},T.prototype._getBeta=function(){if(!this.curve.endo)return;var f=this.precomputed;if(f&&f.beta)return f.beta;var w=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(f){var k=this.curve,S=function(N){return k.point(N.x.redMul(k.endo.beta),N.y)};f.beta=w,w.precomputed={beta:null,naf:f.naf&&{wnd:f.naf.wnd,points:f.naf.points.map(S)},doubles:f.doubles&&{step:f.doubles.step,points:f.doubles.points.map(S)}}}return w},T.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)}}]},T.fromJSON=function(f,w,k){if(typeof w==="string")w=JSON.parse(w);var S=f.point(w[0],w[1],k);if(!w[2])return S;function N(C){return f.point(C[0],C[1],k)}var h=w[2];return S.precomputed={beta:null,doubles:h.doubles&&{step:h.doubles.step,points:[S].concat(h.doubles.points.map(N))},naf:h.naf&&{wnd:h.naf.wnd,points:[S].concat(h.naf.points.map(N))}},S},T.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)+">"},T.prototype.isInfinity=function(){return this.inf},T.prototype.add=function(f){if(this.inf)return f;if(f.inf)return this;if(this.eq(f))return this.dbl();if(this.neg().eq(f))return this.curve.point(null,null);if(this.x.cmp(f.x)===0)return this.curve.point(null,null);var w=this.y.redSub(f.y);if(w.cmpn(0)!==0)w=w.redMul(this.x.redSub(f.x).redInvm());var k=w.redSqr().redISub(this.x).redISub(f.x),S=w.redMul(this.x.redSub(k)).redISub(this.y);return this.curve.point(k,S)},T.prototype.dbl=function(){if(this.inf)return this;var f=this.y.redAdd(this.y);if(f.cmpn(0)===0)return this.curve.point(null,null);var w=this.curve.a,k=this.x.redSqr(),S=f.redInvm(),N=k.redAdd(k).redIAdd(k).redIAdd(w).redMul(S),h=N.redSqr().redISub(this.x.redAdd(this.x)),C=N.redMul(this.x.redSub(h)).redISub(this.y);return this.curve.point(h,C)},T.prototype.getX=function(){return this.x.fromRed()},T.prototype.getY=function(){return this.y.fromRed()},T.prototype.mul=function(f){if(f=new K(f,16),this.isInfinity())return this;else if(this._hasDoubles(f))return this.curve._fixedNafMul(this,f);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[f]);else return this.curve._wnafMul(this,f)},T.prototype.mulAdd=function(f,w,k){var S=[this,w],N=[f,k];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,N);else return this.curve._wnafMulAdd(1,S,N,2)},T.prototype.jmulAdd=function(f,w,k){var S=[this,w],N=[f,k];if(this.curve.endo)return this.curve._endoWnafMulAdd(S,N,!0);else return this.curve._wnafMulAdd(1,S,N,2,!0)},T.prototype.eq=function(f){return this===f||this.inf===f.inf&&(this.inf||this.x.cmp(f.x)===0&&this.y.cmp(f.y)===0)},T.prototype.neg=function(f){if(this.inf)return this;var w=this.curve.point(this.x,this.y.redNeg());if(f&&this.precomputed){var k=this.precomputed,S=function(N){return N.neg()};w.precomputed={naf:k.naf&&{wnd:k.naf.wnd,points:k.naf.points.map(S)},doubles:k.doubles&&{step:k.doubles.step,points:k.doubles.points.map(S)}}}return w},T.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var f=this.curve.jpoint(this.x,this.y,this.curve.one);return f};function H(f,w,k,S){if(Y.BasePoint.call(this,f,"jacobian"),w===null&&k===null&&S===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new K(0);else this.x=new K(w,16),this.y=new K(k,16),this.z=new K(S,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}P(H,Y.BasePoint),z.prototype.jpoint=function(f,w,k){return new H(this,f,w,k)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var f=this.z.redInvm(),w=f.redSqr(),k=this.x.redMul(w),S=this.y.redMul(w).redMul(f);return this.curve.point(k,S)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(f){if(this.isInfinity())return f;if(f.isInfinity())return this;var w=f.z.redSqr(),k=this.z.redSqr(),S=this.x.redMul(w),N=f.x.redMul(k),h=this.y.redMul(w.redMul(f.z)),C=f.y.redMul(k.redMul(this.z)),I=S.redSub(N),D=h.redSub(C);if(I.cmpn(0)===0)if(D.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var L=I.redSqr(),g=L.redMul(I),y=S.redMul(L),p=D.redSqr().redIAdd(g).redISub(y).redISub(y),o=D.redMul(y.redISub(p)).redISub(h.redMul(g)),s=this.z.redMul(f.z).redMul(I);return this.curve.jpoint(p,o,s)},H.prototype.mixedAdd=function(f){if(this.isInfinity())return f.toJ();if(f.isInfinity())return this;var w=this.z.redSqr(),k=this.x,S=f.x.redMul(w),N=this.y,h=f.y.redMul(w).redMul(this.z),C=k.redSub(S),I=N.redSub(h);if(C.cmpn(0)===0)if(I.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var D=C.redSqr(),L=D.redMul(C),g=k.redMul(D),y=I.redSqr().redIAdd(L).redISub(g).redISub(g),p=I.redMul(g.redISub(y)).redISub(N.redMul(L)),o=this.z.redMul(C);return this.curve.jpoint(y,p,o)},H.prototype.dblp=function(f){if(f===0)return this;if(this.isInfinity())return this;if(!f)return this.dbl();var w;if(this.curve.zeroA||this.curve.threeA){var k=this;for(w=0;w<f;w++)k=k.dbl();return k}var S=this.curve.a,N=this.curve.tinv,h=this.x,C=this.y,I=this.z,D=I.redSqr().redSqr(),L=C.redAdd(C);for(w=0;w<f;w++){var g=h.redSqr(),y=L.redSqr(),p=y.redSqr(),o=g.redAdd(g).redIAdd(g).redIAdd(S.redMul(D)),s=h.redMul(y),Q=o.redSqr().redISub(s.redAdd(s)),m=s.redISub(Q),e=o.redMul(m);e=e.redIAdd(e).redISub(p);var j=L.redMul(I);if(w+1<f)D=D.redMul(p);h=Q,I=j,L=e}return this.curve.jpoint(h,L.redMul(N),I)},H.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()},H.prototype._zeroDbl=function(){var f,w,k;if(this.zOne){var S=this.x.redSqr(),N=this.y.redSqr(),h=N.redSqr(),C=this.x.redAdd(N).redSqr().redISub(S).redISub(h);C=C.redIAdd(C);var I=S.redAdd(S).redIAdd(S),D=I.redSqr().redISub(C).redISub(C),L=h.redIAdd(h);L=L.redIAdd(L),L=L.redIAdd(L),f=D,w=I.redMul(C.redISub(D)).redISub(L),k=this.y.redAdd(this.y)}else{var g=this.x.redSqr(),y=this.y.redSqr(),p=y.redSqr(),o=this.x.redAdd(y).redSqr().redISub(g).redISub(p);o=o.redIAdd(o);var s=g.redAdd(g).redIAdd(g),Q=s.redSqr(),m=p.redIAdd(p);m=m.redIAdd(m),m=m.redIAdd(m),f=Q.redISub(o).redISub(o),w=s.redMul(o.redISub(f)).redISub(m),k=this.y.redMul(this.z),k=k.redIAdd(k)}return this.curve.jpoint(f,w,k)},H.prototype._threeDbl=function(){var f,w,k;if(this.zOne){var S=this.x.redSqr(),N=this.y.redSqr(),h=N.redSqr(),C=this.x.redAdd(N).redSqr().redISub(S).redISub(h);C=C.redIAdd(C);var I=S.redAdd(S).redIAdd(S).redIAdd(this.curve.a),D=I.redSqr().redISub(C).redISub(C);f=D;var L=h.redIAdd(h);L=L.redIAdd(L),L=L.redIAdd(L),w=I.redMul(C.redISub(D)).redISub(L),k=this.y.redAdd(this.y)}else{var g=this.z.redSqr(),y=this.y.redSqr(),p=this.x.redMul(y),o=this.x.redSub(g).redMul(this.x.redAdd(g));o=o.redAdd(o).redIAdd(o);var s=p.redIAdd(p);s=s.redIAdd(s);var Q=s.redAdd(s);f=o.redSqr().redISub(Q),k=this.y.redAdd(this.z).redSqr().redISub(y).redISub(g);var m=y.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m),w=o.redMul(s.redISub(f)).redISub(m)}return this.curve.jpoint(f,w,k)},H.prototype._dbl=function(){var f=this.curve.a,w=this.x,k=this.y,S=this.z,N=S.redSqr().redSqr(),h=w.redSqr(),C=k.redSqr(),I=h.redAdd(h).redIAdd(h).redIAdd(f.redMul(N)),D=w.redAdd(w);D=D.redIAdd(D);var L=D.redMul(C),g=I.redSqr().redISub(L.redAdd(L)),y=L.redISub(g),p=C.redSqr();p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var o=I.redMul(y).redISub(p),s=k.redAdd(k).redMul(S);return this.curve.jpoint(g,o,s)},H.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var f=this.x.redSqr(),w=this.y.redSqr(),k=this.z.redSqr(),S=w.redSqr(),N=f.redAdd(f).redIAdd(f),h=N.redSqr(),C=this.x.redAdd(w).redSqr().redISub(f).redISub(S);C=C.redIAdd(C),C=C.redAdd(C).redIAdd(C),C=C.redISub(h);var I=C.redSqr(),D=S.redIAdd(S);D=D.redIAdd(D),D=D.redIAdd(D),D=D.redIAdd(D);var L=N.redIAdd(C).redSqr().redISub(h).redISub(I).redISub(D),g=w.redMul(L);g=g.redIAdd(g),g=g.redIAdd(g);var y=this.x.redMul(I).redISub(g);y=y.redIAdd(y),y=y.redIAdd(y);var p=this.y.redMul(L.redMul(D.redISub(L)).redISub(C.redMul(I)));p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var o=this.z.redAdd(C).redSqr().redISub(k).redISub(I);return this.curve.jpoint(y,p,o)},H.prototype.mul=function(f,w){return f=new K(f,w),this.curve._wnafMul(this,f)},H.prototype.eq=function(f){if(f.type==="affine")return this.eq(f.toJ());if(this===f)return!0;var w=this.z.redSqr(),k=f.z.redSqr();if(this.x.redMul(k).redISub(f.x.redMul(w)).cmpn(0)!==0)return!1;var S=w.redMul(this.z),N=k.redMul(f.z);return this.y.redMul(N).redISub(f.y.redMul(S)).cmpn(0)===0},H.prototype.eqXToP=function(f){var w=this.z.redSqr(),k=f.toRed(this.curve.red).redMul(w);if(this.x.cmp(k)===0)return!0;var S=f.clone(),N=this.curve.redN.redMul(w);for(;;){if(S.iadd(this.curve.n),S.cmp(this.curve.p)>=0)return!1;if(k.redIAdd(N),this.x.cmp(k)===0)return!0}},H.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)+">"},H.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),bi=T$(($,q)=>{var _=N_(),K=v8(),P=M2(),Y=M8();function O(T){P.call(this,"mont",T),this.a=new _(T.a,16).toRed(this.red),this.b=new _(T.b,16).toRed(this.red),this.i4=new _(4).toRed(this.red).redInvm(),this.two=new _(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}K(O,P),q.exports=O,O.prototype.validate=function(T){var H=T.normalize().x,f=H.redSqr(),w=f.redMul(H).redAdd(f.redMul(this.a)).redAdd(H),k=w.redSqrt();return k.redSqr().cmp(w)===0};function z(T,H,f){if(P.BasePoint.call(this,T,"projective"),H===null&&f===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new _(H,16),this.z=new _(f,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}K(z,P.BasePoint),O.prototype.decodePoint=function(T,H){return this.point(Y.toArray(T,H),1)},O.prototype.point=function(T,H){return new z(this,T,H)},O.prototype.pointFromJSON=function(T){return z.fromJSON(this,T)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(T,H){return new z(T,H[0],H[1]||T.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 T=this.x.redAdd(this.z),H=T.redSqr(),f=this.x.redSub(this.z),w=f.redSqr(),k=H.redSub(w),S=H.redMul(w),N=k.redMul(w.redAdd(this.curve.a24.redMul(k)));return this.curve.point(S,N)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(T,H){var f=this.x.redAdd(this.z),w=this.x.redSub(this.z),k=T.x.redAdd(T.z),S=T.x.redSub(T.z),N=S.redMul(f),h=k.redMul(w),C=H.z.redMul(N.redAdd(h).redSqr()),I=H.x.redMul(N.redISub(h).redSqr());return this.curve.point(C,I)},z.prototype.mul=function(T){var H=T.clone(),f=this,w=this.curve.point(null,null),k=this;for(var S=[];H.cmpn(0)!==0;H.iushrn(1))S.push(H.andln(1));for(var N=S.length-1;N>=0;N--)if(S[N]===0)f=f.diffAdd(w,k),w=w.dbl();else w=f.diffAdd(w,k),f=f.dbl();return w},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(T){return this.getX().cmp(T.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()}}),gi=T$(($,q)=>{var _=M8(),K=N_(),P=v8(),Y=M2(),O=_.assert;function z(H){this.twisted=(H.a|0)!==1,this.mOneA=this.twisted&&(H.a|0)===-1,this.extended=this.mOneA,Y.call(this,"edwards",H),this.a=new K(H.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new K(H.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new K(H.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),O(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(H.c|0)===1}P(z,Y),q.exports=z,z.prototype._mulA=function(H){if(this.mOneA)return H.redNeg();else return this.a.redMul(H)},z.prototype._mulC=function(H){if(this.oneC)return H;else return this.c.redMul(H)},z.prototype.jpoint=function(H,f,w,k){return this.point(H,f,w,k)},z.prototype.pointFromX=function(H,f){if(H=new K(H,16),!H.red)H=H.toRed(this.red);var w=H.redSqr(),k=this.c2.redSub(this.a.redMul(w)),S=this.one.redSub(this.c2.redMul(this.d).redMul(w)),N=k.redMul(S.redInvm()),h=N.redSqrt();if(h.redSqr().redSub(N).cmp(this.zero)!==0)throw Error("invalid point");var C=h.fromRed().isOdd();if(f&&!C||!f&&C)h=h.redNeg();return this.point(H,h)},z.prototype.pointFromY=function(H,f){if(H=new K(H,16),!H.red)H=H.toRed(this.red);var w=H.redSqr(),k=w.redSub(this.c2),S=w.redMul(this.d).redMul(this.c2).redSub(this.a),N=k.redMul(S.redInvm());if(N.cmp(this.zero)===0)if(f)throw Error("invalid point");else return this.point(this.zero,H);var h=N.redSqrt();if(h.redSqr().redSub(N).cmp(this.zero)!==0)throw Error("invalid point");if(h.fromRed().isOdd()!==f)h=h.redNeg();return this.point(h,H)},z.prototype.validate=function(H){if(H.isInfinity())return!0;H.normalize();var f=H.x.redSqr(),w=H.y.redSqr(),k=f.redMul(this.a).redAdd(w),S=this.c2.redMul(this.one.redAdd(this.d.redMul(f).redMul(w)));return k.cmp(S)===0};function T(H,f,w,k,S){if(Y.BasePoint.call(this,H,"projective"),f===null&&w===null&&k===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 K(f,16),this.y=new K(w,16),this.z=k?new K(k,16):this.curve.one,this.t=S&&new K(S,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())}}}P(T,Y.BasePoint),z.prototype.pointFromJSON=function(H){return T.fromJSON(this,H)},z.prototype.point=function(H,f,w,k){return new T(this,H,f,w,k)},T.fromJSON=function(H,f){return new T(H,f[0],f[1],f[2])},T.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)+">"},T.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},T.prototype._extDbl=function(){var H=this.x.redSqr(),f=this.y.redSqr(),w=this.z.redSqr();w=w.redIAdd(w);var k=this.curve._mulA(H),S=this.x.redAdd(this.y).redSqr().redISub(H).redISub(f),N=k.redAdd(f),h=N.redSub(w),C=k.redSub(f),I=S.redMul(h),D=N.redMul(C),L=S.redMul(C),g=h.redMul(N);return this.curve.point(I,D,g,L)},T.prototype._projDbl=function(){var H=this.x.redAdd(this.y).redSqr(),f=this.x.redSqr(),w=this.y.redSqr(),k,S,N,h,C,I;if(this.curve.twisted){h=this.curve._mulA(f);var D=h.redAdd(w);if(this.zOne)k=H.redSub(f).redSub(w).redMul(D.redSub(this.curve.two)),S=D.redMul(h.redSub(w)),N=D.redSqr().redSub(D).redSub(D);else C=this.z.redSqr(),I=D.redSub(C).redISub(C),k=H.redSub(f).redISub(w).redMul(I),S=D.redMul(h.redSub(w)),N=D.redMul(I)}else h=f.redAdd(w),C=this.curve._mulC(this.z).redSqr(),I=h.redSub(C).redSub(C),k=this.curve._mulC(H.redISub(h)).redMul(I),S=this.curve._mulC(h).redMul(f.redISub(w)),N=h.redMul(I);return this.curve.point(k,S,N)},T.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},T.prototype._extAdd=function(H){var f=this.y.redSub(this.x).redMul(H.y.redSub(H.x)),w=this.y.redAdd(this.x).redMul(H.y.redAdd(H.x)),k=this.t.redMul(this.curve.dd).redMul(H.t),S=this.z.redMul(H.z.redAdd(H.z)),N=w.redSub(f),h=S.redSub(k),C=S.redAdd(k),I=w.redAdd(f),D=N.redMul(h),L=C.redMul(I),g=N.redMul(I),y=h.redMul(C);return this.curve.point(D,L,y,g)},T.prototype._projAdd=function(H){var f=this.z.redMul(H.z),w=f.redSqr(),k=this.x.redMul(H.x),S=this.y.redMul(H.y),N=this.curve.d.redMul(k).redMul(S),h=w.redSub(N),C=w.redAdd(N),I=this.x.redAdd(this.y).redMul(H.x.redAdd(H.y)).redISub(k).redISub(S),D=f.redMul(h).redMul(I),L,g;if(this.curve.twisted)L=f.redMul(C).redMul(S.redSub(this.curve._mulA(k))),g=h.redMul(C);else L=f.redMul(C).redMul(S.redSub(k)),g=this.curve._mulC(h).redMul(C);return this.curve.point(D,L,g)},T.prototype.add=function(H){if(this.isInfinity())return H;if(H.isInfinity())return this;if(this.curve.extended)return this._extAdd(H);else return this._projAdd(H)},T.prototype.mul=function(H){if(this._hasDoubles(H))return this.curve._fixedNafMul(this,H);else return this.curve._wnafMul(this,H)},T.prototype.mulAdd=function(H,f,w){return this.curve._wnafMulAdd(1,[this,f],[H,w],2,!1)},T.prototype.jmulAdd=function(H,f,w){return this.curve._wnafMulAdd(1,[this,f],[H,w],2,!0)},T.prototype.normalize=function(){if(this.zOne)return this;var H=this.z.redInvm();if(this.x=this.x.redMul(H),this.y=this.y.redMul(H),this.t)this.t=this.t.redMul(H);return this.z=this.curve.one,this.zOne=!0,this},T.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},T.prototype.getX=function(){return this.normalize(),this.x.fromRed()},T.prototype.getY=function(){return this.normalize(),this.y.fromRed()},T.prototype.eq=function(H){return this===H||this.getX().cmp(H.getX())===0&&this.getY().cmp(H.getY())===0},T.prototype.eqXToP=function(H){var f=H.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(f)===0)return!0;var w=H.clone(),k=this.curve.redN.redMul(this.z);for(;;){if(w.iadd(this.curve.n),w.cmp(this.curve.p)>=0)return!1;if(f.redIAdd(k),this.x.cmp(f)===0)return!0}},T.prototype.toP=T.prototype.normalize,T.prototype.mixedAdd=T.prototype.add}),wM=T$(($)=>{var q=$;q.base=M2(),q.short=Li(),q.mont=bi(),q.edwards=gi()}),__=T$(($)=>{var q=PK(),_=v8();$.inherits=_;function K(W,X){if((W.charCodeAt(X)&64512)!==55296)return!1;if(X<0||X+1>=W.length)return!1;return(W.charCodeAt(X+1)&64512)===56320}function P(W,X){if(Array.isArray(W))return W.slice();if(!W)return[];var J=[];if(typeof W==="string"){if(!X){var Z=0;for(var G=0;G<W.length;G++){var M=W.charCodeAt(G);if(M<128)J[Z++]=M;else if(M<2048)J[Z++]=M>>6|192,J[Z++]=M&63|128;else if(K(W,G))M=65536+((M&1023)<<10)+(W.charCodeAt(++G)&1023),J[Z++]=M>>18|240,J[Z++]=M>>12&63|128,J[Z++]=M>>6&63|128,J[Z++]=M&63|128;else J[Z++]=M>>12|224,J[Z++]=M>>6&63|128,J[Z++]=M&63|128}}else if(X==="hex"){if(W=W.replace(/[^a-z0-9]+/ig,""),W.length%2!==0)W="0"+W;for(G=0;G<W.length;G+=2)J.push(parseInt(W[G]+W[G+1],16))}}else for(G=0;G<W.length;G++)J[G]=W[G]|0;return J}$.toArray=P;function Y(W){var X="";for(var J=0;J<W.length;J++)X+=T(W[J].toString(16));return X}$.toHex=Y;function O(W){var X=W>>>24|W>>>8&65280|W<<8&16711680|(W&255)<<24;return X>>>0}$.htonl=O;function z(W,X){var J="";for(var Z=0;Z<W.length;Z++){var G=W[Z];if(X==="little")G=O(G);J+=H(G.toString(16))}return J}$.toHex32=z;function T(W){if(W.length===1)return"0"+W;else return W}$.zero2=T;function H(W){if(W.length===7)return"0"+W;else if(W.length===6)return"00"+W;else if(W.length===5)return"000"+W;else if(W.length===4)return"0000"+W;else if(W.length===3)return"00000"+W;else if(W.length===2)return"000000"+W;else if(W.length===1)return"0000000"+W;else return W}$.zero8=H;function f(W,X,J,Z){var G=J-X;q(G%4===0);var M=Array(G/4);for(var A=0,v=X;A<M.length;A++,v+=4){var V;if(Z==="big")V=W[v]<<24|W[v+1]<<16|W[v+2]<<8|W[v+3];else V=W[v+3]<<24|W[v+2]<<16|W[v+1]<<8|W[v];M[A]=V>>>0}return M}$.join32=f;function w(W,X){var J=Array(W.length*4);for(var Z=0,G=0;Z<W.length;Z++,G+=4){var M=W[Z];if(X==="big")J[G]=M>>>24,J[G+1]=M>>>16&255,J[G+2]=M>>>8&255,J[G+3]=M&255;else J[G+3]=M>>>24,J[G+2]=M>>>16&255,J[G+1]=M>>>8&255,J[G]=M&255}return J}$.split32=w;function k(W,X){return W>>>X|W<<32-X}$.rotr32=k;function S(W,X){return W<<X|W>>>32-X}$.rotl32=S;function N(W,X){return W+X>>>0}$.sum32=N;function h(W,X,J){return W+X+J>>>0}$.sum32_3=h;function C(W,X,J,Z){return W+X+J+Z>>>0}$.sum32_4=C;function I(W,X,J,Z,G){return W+X+J+Z+G>>>0}$.sum32_5=I;function D(W,X,J,Z){var G=W[X],M=W[X+1],A=Z+M>>>0,v=(A<Z?1:0)+J+G;W[X]=v>>>0,W[X+1]=A}$.sum64=D;function L(W,X,J,Z){var G=X+Z>>>0,M=(G<X?1:0)+W+J;return M>>>0}$.sum64_hi=L;function g(W,X,J,Z){var G=X+Z;return G>>>0}$.sum64_lo=g;function y(W,X,J,Z,G,M,A,v){var V=0,R=X;R=R+Z>>>0,V+=R<X?1:0,R=R+M>>>0,V+=R<M?1:0,R=R+v>>>0,V+=R<v?1:0;var E=W+J+G+A+V;return E>>>0}$.sum64_4_hi=y;function p(W,X,J,Z,G,M,A,v){var V=X+Z+M+v;return V>>>0}$.sum64_4_lo=p;function o(W,X,J,Z,G,M,A,v,V,R){var E=0,b=X;b=b+Z>>>0,E+=b<X?1:0,b=b+M>>>0,E+=b<M?1:0,b=b+v>>>0,E+=b<v?1:0,b=b+R>>>0,E+=b<R?1:0;var x=W+J+G+A+V+E;return x>>>0}$.sum64_5_hi=o;function s(W,X,J,Z,G,M,A,v,V,R){var E=X+Z+M+v+R;return E>>>0}$.sum64_5_lo=s;function Q(W,X,J){var Z=X<<32-J|W>>>J;return Z>>>0}$.rotr64_hi=Q;function m(W,X,J){var Z=W<<32-J|X>>>J;return Z>>>0}$.rotr64_lo=m;function e(W,X,J){return W>>>J}$.shr64_hi=e;function j(W,X,J){var Z=W<<32-J|X>>>J;return Z>>>0}$.shr64_lo=j}),P1=T$(($)=>{var q=__(),_=PK();function K(){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=K,K.prototype.update=function(P,Y){if(P=q.toArray(P,Y),!this.pending)this.pending=P;else this.pending=this.pending.concat(P);if(this.pendingTotal+=P.length,this.pending.length>=this._delta8){P=this.pending;var O=P.length%this._delta8;if(this.pending=P.slice(P.length-O,P.length),this.pending.length===0)this.pending=null;P=q.join32(P,0,P.length-O,this.endian);for(var z=0;z<P.length;z+=this._delta32)this._update(P,z,z+this._delta32)}return this},K.prototype.digest=function(P){return this.update(this._pad()),_(this.pending===null),this._digest(P)},K.prototype._pad=function(){var P=this.pendingTotal,Y=this._delta8,O=Y-(P+this.padLength)%Y,z=Array(O+this.padLength);z[0]=128;for(var T=1;T<O;T++)z[T]=0;if(P<<=3,this.endian==="big"){for(var H=8;H<this.padLength;H++)z[T++]=0;z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=P>>>24&255,z[T++]=P>>>16&255,z[T++]=P>>>8&255,z[T++]=P&255}else{z[T++]=P&255,z[T++]=P>>>8&255,z[T++]=P>>>16&255,z[T++]=P>>>24&255,z[T++]=0,z[T++]=0,z[T++]=0,z[T++]=0;for(H=8;H<this.padLength;H++)z[T++]=0}return z}}),fM=T$(($)=>{var q=__(),_=q.rotr32;function K(w,k,S,N){if(w===0)return P(k,S,N);if(w===1||w===3)return O(k,S,N);if(w===2)return Y(k,S,N)}$.ft_1=K;function P(w,k,S){return w&k^~w&S}$.ch32=P;function Y(w,k,S){return w&k^w&S^k&S}$.maj32=Y;function O(w,k,S){return w^k^S}$.p32=O;function z(w){return _(w,2)^_(w,13)^_(w,22)}$.s0_256=z;function T(w){return _(w,6)^_(w,11)^_(w,25)}$.s1_256=T;function H(w){return _(w,7)^_(w,18)^w>>>3}$.g0_256=H;function f(w){return _(w,17)^_(w,19)^w>>>10}$.g1_256=f}),yi=T$(($,q)=>{var _=__(),K=P1(),P=fM(),Y=_.rotl32,O=_.sum32,z=_.sum32_5,T=P.ft_1,H=K.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function w(){if(!(this instanceof w))return new w;H.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}_.inherits(w,H),q.exports=w,w.blockSize=512,w.outSize=160,w.hmacStrength=80,w.padLength=64,w.prototype._update=function(k,S){var N=this.W;for(var h=0;h<16;h++)N[h]=k[S+h];for(;h<N.length;h++)N[h]=Y(N[h-3]^N[h-8]^N[h-14]^N[h-16],1);var C=this.h[0],I=this.h[1],D=this.h[2],L=this.h[3],g=this.h[4];for(h=0;h<N.length;h++){var y=~~(h/20),p=z(Y(C,5),T(y,I,D,L),g,N[h],f[y]);g=L,L=D,D=Y(I,30),I=C,C=p}this.h[0]=O(this.h[0],C),this.h[1]=O(this.h[1],I),this.h[2]=O(this.h[2],D),this.h[3]=O(this.h[3],L),this.h[4]=O(this.h[4],g)},w.prototype._digest=function(k){if(k==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")}}),ZM=T$(($,q)=>{var _=__(),K=P1(),P=fM(),Y=PK(),O=_.sum32,z=_.sum32_4,T=_.sum32_5,H=P.ch32,f=P.maj32,w=P.s0_256,k=P.s1_256,S=P.g0_256,N=P.g1_256,h=K.BlockHash,C=[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;h.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=C,this.W=Array(64)}_.inherits(I,h),q.exports=I,I.blockSize=512,I.outSize=256,I.hmacStrength=192,I.padLength=64,I.prototype._update=function(D,L){var g=this.W;for(var y=0;y<16;y++)g[y]=D[L+y];for(;y<g.length;y++)g[y]=z(N(g[y-2]),g[y-7],S(g[y-15]),g[y-16]);var p=this.h[0],o=this.h[1],s=this.h[2],Q=this.h[3],m=this.h[4],e=this.h[5],j=this.h[6],W=this.h[7];Y(this.k.length===g.length);for(y=0;y<g.length;y++){var X=T(W,k(m),H(m,e,j),this.k[y],g[y]),J=O(w(p),f(p,o,s));W=j,j=e,e=m,m=O(Q,X),Q=s,s=o,o=p,p=O(X,J)}this.h[0]=O(this.h[0],p),this.h[1]=O(this.h[1],o),this.h[2]=O(this.h[2],s),this.h[3]=O(this.h[3],Q),this.h[4]=O(this.h[4],m),this.h[5]=O(this.h[5],e),this.h[6]=O(this.h[6],j),this.h[7]=O(this.h[7],W)},I.prototype._digest=function(D){if(D==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")}}),ui=T$(($,q)=>{var _=__(),K=ZM();function P(){if(!(this instanceof P))return new P;K.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}_.inherits(P,K),q.exports=P,P.blockSize=512,P.outSize=224,P.hmacStrength=192,P.padLength=64,P.prototype._digest=function(Y){if(Y==="hex")return _.toHex32(this.h.slice(0,7),"big");else return _.split32(this.h.slice(0,7),"big")}}),XM=T$(($,q)=>{var _=__(),K=P1(),P=PK(),Y=_.rotr64_hi,O=_.rotr64_lo,z=_.shr64_hi,T=_.shr64_lo,H=_.sum64,f=_.sum64_hi,w=_.sum64_lo,k=_.sum64_4_hi,S=_.sum64_4_lo,N=_.sum64_5_hi,h=_.sum64_5_lo,C=K.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;C.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)}_.inherits(D,C),q.exports=D,D.blockSize=1024,D.outSize=512,D.hmacStrength=192,D.padLength=128,D.prototype._prepareBlock=function(J,Z){var G=this.W;for(var M=0;M<32;M++)G[M]=J[Z+M];for(;M<G.length;M+=2){var A=W(G[M-4],G[M-3]),v=X(G[M-4],G[M-3]),V=G[M-14],R=G[M-13],E=e(G[M-30],G[M-29]),b=j(G[M-30],G[M-29]),x=G[M-32],l=G[M-31];G[M]=k(A,v,V,R,E,b,x,l),G[M+1]=S(A,v,V,R,E,b,x,l)}},D.prototype._update=function(J,Z){this._prepareBlock(J,Z);var G=this.W,M=this.h[0],A=this.h[1],v=this.h[2],V=this.h[3],R=this.h[4],E=this.h[5],b=this.h[6],x=this.h[7],l=this.h[8],F=this.h[9],f$=this.h[10],q$=this.h[11],B=this.h[12],v$=this.h[13],a=this.h[14],P$=this.h[15];P(this.k.length===G.length);for(var o$=0;o$<G.length;o$+=2){var c=a,r=P$,J$=Q(l,F),$$=m(l,F),_$=L(l,F,f$,q$,B,v$),O$=g(l,F,f$,q$,B,v$),d=this.k[o$],n=this.k[o$+1],H$=G[o$],t=G[o$+1],U=N(c,r,J$,$$,_$,O$,d,n,H$,t),A$=h(c,r,J$,$$,_$,O$,d,n,H$,t);c=o(M,A),r=s(M,A),J$=y(M,A,v,V,R,E),$$=p(M,A,v,V,R,E);var W$=f(c,r,J$,$$),z$=w(c,r,J$,$$);a=B,P$=v$,B=f$,v$=q$,f$=l,q$=F,l=f(b,x,U,A$),F=w(x,x,U,A$),b=R,x=E,R=v,E=V,v=M,V=A,M=f(U,A$,W$,z$),A=w(U,A$,W$,z$)}H(this.h,0,M,A),H(this.h,2,v,V),H(this.h,4,R,E),H(this.h,6,b,x),H(this.h,8,l,F),H(this.h,10,f$,q$),H(this.h,12,B,v$),H(this.h,14,a,P$)},D.prototype._digest=function(J){if(J==="hex")return _.toHex32(this.h,"big");else return _.split32(this.h,"big")};function L(J,Z,G,M,A){var v=J&G^~J&A;if(v<0)v+=4294967296;return v}function g(J,Z,G,M,A,v){var V=Z&M^~Z&v;if(V<0)V+=4294967296;return V}function y(J,Z,G,M,A){var v=J&G^J&A^G&A;if(v<0)v+=4294967296;return v}function p(J,Z,G,M,A,v){var V=Z&M^Z&v^M&v;if(V<0)V+=4294967296;return V}function o(J,Z){var G=Y(J,Z,28),M=Y(Z,J,2),A=Y(Z,J,7),v=G^M^A;if(v<0)v+=4294967296;return v}function s(J,Z){var G=O(J,Z,28),M=O(Z,J,2),A=O(Z,J,7),v=G^M^A;if(v<0)v+=4294967296;return v}function Q(J,Z){var G=Y(J,Z,14),M=Y(J,Z,18),A=Y(Z,J,9),v=G^M^A;if(v<0)v+=4294967296;return v}function m(J,Z){var G=O(J,Z,14),M=O(J,Z,18),A=O(Z,J,9),v=G^M^A;if(v<0)v+=4294967296;return v}function e(J,Z){var G=Y(J,Z,1),M=Y(J,Z,8),A=z(J,Z,7),v=G^M^A;if(v<0)v+=4294967296;return v}function j(J,Z){var G=O(J,Z,1),M=O(J,Z,8),A=T(J,Z,7),v=G^M^A;if(v<0)v+=4294967296;return v}function W(J,Z){var G=Y(J,Z,19),M=Y(Z,J,29),A=z(J,Z,6),v=G^M^A;if(v<0)v+=4294967296;return v}function X(J,Z){var G=O(J,Z,19),M=O(Z,J,29),A=T(J,Z,6),v=G^M^A;if(v<0)v+=4294967296;return v}}),xi=T$(($,q)=>{var _=__(),K=XM();function P(){if(!(this instanceof P))return new P;K.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}_.inherits(P,K),q.exports=P,P.blockSize=1024,P.outSize=384,P.hmacStrength=192,P.padLength=128,P.prototype._digest=function(Y){if(Y==="hex")return _.toHex32(this.h.slice(0,12),"big");else return _.split32(this.h.slice(0,12),"big")}}),pi=T$(($)=>{$.sha1=yi(),$.sha224=ui(),$.sha256=ZM(),$.sha384=xi(),$.sha512=XM()}),ci=T$(($)=>{var q=__(),_=P1(),K=q.rotl32,P=q.sum32,Y=q.sum32_3,O=q.sum32_4,z=_.BlockHash;function T(){if(!(this instanceof T))return new T;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}q.inherits(T,z),$.ripemd160=T,T.blockSize=512,T.outSize=160,T.hmacStrength=192,T.padLength=64,T.prototype._update=function(C,I){var D=this.h[0],L=this.h[1],g=this.h[2],y=this.h[3],p=this.h[4],o=D,s=L,Q=g,m=y,e=p;for(var j=0;j<80;j++){var W=P(K(O(D,H(j,L,g,y),C[k[j]+I],f(j)),N[j]),p);D=p,p=y,y=K(g,10),g=L,L=W,W=P(K(O(o,H(79-j,s,Q,m),C[S[j]+I],w(j)),h[j]),e),o=e,e=m,m=K(Q,10),Q=s,s=W}W=Y(this.h[1],g,m),this.h[1]=Y(this.h[2],y,e),this.h[2]=Y(this.h[3],p,o),this.h[3]=Y(this.h[4],D,s),this.h[4]=Y(this.h[0],L,Q),this.h[0]=W},T.prototype._digest=function(C){if(C==="hex")return q.toHex32(this.h,"little");else return q.split32(this.h,"little")};function H(C,I,D,L){if(C<=15)return I^D^L;else if(C<=31)return I&D|~I&L;else if(C<=47)return(I|~D)^L;else if(C<=63)return I&L|D&~L;else return I^(D|~L)}function f(C){if(C<=15)return 0;else if(C<=31)return 1518500249;else if(C<=47)return 1859775393;else if(C<=63)return 2400959708;else return 2840853838}function w(C){if(C<=15)return 1352829926;else if(C<=31)return 1548603684;else if(C<=47)return 1836072691;else if(C<=63)return 2053994217;else return 0}var k=[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],S=[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],N=[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],h=[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]}),mi=T$(($,q)=>{var _=__(),K=PK();function P(Y,O,z){if(!(this instanceof P))return new P(Y,O,z);this.Hash=Y,this.blockSize=Y.blockSize/8,this.outSize=Y.outSize/8,this.inner=null,this.outer=null,this._init(_.toArray(O,z))}q.exports=P,P.prototype._init=function(Y){if(Y.length>this.blockSize)Y=new this.Hash().update(Y).digest();K(Y.length<=this.blockSize);for(var O=Y.length;O<this.blockSize;O++)Y.push(0);for(O=0;O<Y.length;O++)Y[O]^=54;this.inner=new this.Hash().update(Y);for(O=0;O<Y.length;O++)Y[O]^=106;this.outer=new this.Hash().update(Y)},P.prototype.update=function(Y,O){return this.inner.update(Y,O),this},P.prototype.digest=function(Y){return this.outer.update(this.inner.digest()),this.outer.digest(Y)}}),CH=T$(($)=>{var q=$;q.utils=__(),q.common=P1(),q.sha=pi(),q.ripemd=ci(),q.hmac=mi(),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}),di=T$(($,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"]]}}}),EH=T$(($)=>{var q=$,_=CH(),K=wM(),P=M8(),Y=P.assert;function O(H){if(H.type==="short")this.curve=new K.short(H);else if(H.type==="edwards")this.curve=new K.edwards(H);else this.curve=new K.mont(H);this.g=this.curve.g,this.n=this.curve.n,this.hash=H.hash,Y(this.g.validate(),"Invalid curve"),Y(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}q.PresetCurve=O;function z(H,f){Object.defineProperty(q,H,{configurable:!0,enumerable:!0,get:function(){var w=new O(f);return Object.defineProperty(q,H,{configurable:!0,enumerable:!0,value:w}),w}})}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:_.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:_.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:_.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:_.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:_.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:_.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:_.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var T;try{T=di()}catch(H){T=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:_.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",T]})}),li=T$(($,q)=>{var _=CH(),K=HM(),P=PK();function Y(O){if(!(this instanceof Y))return new Y(O);this.hash=O.hash,this.predResist=!!O.predResist,this.outLen=this.hash.outSize,this.minEntropy=O.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=K.toArray(O.entropy,O.entropyEnc||"hex"),T=K.toArray(O.nonce,O.nonceEnc||"hex"),H=K.toArray(O.pers,O.persEnc||"hex");P(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,T,H)}q.exports=Y,Y.prototype._init=function(O,z,T){var H=O.concat(z).concat(T);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var f=0;f<this.V.length;f++)this.K[f]=0,this.V[f]=1;this._update(H),this._reseed=1,this.reseedInterval=281474976710656},Y.prototype._hmac=function(){return new _.hmac(this.hash,this.K)},Y.prototype._update=function(O){var z=this._hmac().update(this.V).update([0]);if(O)z=z.update(O);if(this.K=z.digest(),this.V=this._hmac().update(this.V).digest(),!O)return;this.K=this._hmac().update(this.V).update([1]).update(O).digest(),this.V=this._hmac().update(this.V).digest()},Y.prototype.reseed=function(O,z,T,H){if(typeof z!=="string")H=T,T=z,z=null;O=K.toArray(O,z),T=K.toArray(T,H),P(O.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(O.concat(T||[])),this._reseed=1},Y.prototype.generate=function(O,z,T,H){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof z!=="string")H=T,T=z,z=null;if(T)T=K.toArray(T,H||"hex"),this._update(T);var f=[];while(f.length<O)this.V=this._hmac().update(this.V).digest(),f=f.concat(this.V);var w=f.slice(0,O);return this._update(T),this._reseed++,K.encode(w,z)}}),ri=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert;function Y(O,z){if(this.ec=O,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=Y,Y.fromPublic=function(O,z,T){if(z instanceof Y)return z;return new Y(O,{pub:z,pubEnc:T})},Y.fromPrivate=function(O,z,T){if(z instanceof Y)return z;return new Y(O,{priv:z,privEnc:T})},Y.prototype.validate=function(){var O=this.getPublic();if(O.isInfinity())return{result:!1,reason:"Invalid public key"};if(!O.validate())return{result:!1,reason:"Public key is not a point"};if(!O.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},Y.prototype.getPublic=function(O,z){if(typeof O==="string")z=O,O=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!z)return this.pub;return this.pub.encode(z,O)},Y.prototype.getPrivate=function(O){if(O==="hex")return this.priv.toString(16,2);else return this.priv},Y.prototype._importPrivate=function(O,z){this.priv=new _(O,z||16),this.priv=this.priv.umod(this.ec.curve.n)},Y.prototype._importPublic=function(O,z){if(O.x||O.y){if(this.ec.curve.type==="mont")P(O.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")P(O.x&&O.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(O.x,O.y);return}this.pub=this.ec.curve.decodePoint(O,z)},Y.prototype.derive=function(O){if(!O.validate())P(O.validate(),"public point not validated");return O.mul(this.priv).getX()},Y.prototype.sign=function(O,z,T){return this.ec.sign(O,this,z,T)},Y.prototype.verify=function(O,z,T){return this.ec.verify(O,z,this,void 0,T)},Y.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),oi=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert;function Y(f,w){if(f instanceof Y)return f;if(this._importDER(f,w))return;if(P(f.r&&f.s,"Signature without r or s"),this.r=new _(f.r,16),this.s=new _(f.s,16),f.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=f.recoveryParam}q.exports=Y;function O(){this.place=0}function z(f,w){var k=f[w.place++];if(!(k&128))return k;var S=k&15;if(S===0||S>4)return!1;if(f[w.place]===0)return!1;var N=0;for(var h=0,C=w.place;h<S;h++,C++)N<<=8,N|=f[C],N>>>=0;if(N<=127)return!1;return w.place=C,N}function T(f){var w=0,k=f.length-1;while(!f[w]&&!(f[w+1]&128)&&w<k)w++;if(w===0)return f;return f.slice(w)}Y.prototype._importDER=function(f,w){f=K.toArray(f,w);var k=new O;if(f[k.place++]!==48)return!1;var S=z(f,k);if(S===!1)return!1;if(S+k.place!==f.length)return!1;if(f[k.place++]!==2)return!1;var N=z(f,k);if(N===!1)return!1;if((f[k.place]&128)!==0)return!1;var h=f.slice(k.place,N+k.place);if(k.place+=N,f[k.place++]!==2)return!1;var C=z(f,k);if(C===!1)return!1;if(f.length!==C+k.place)return!1;if((f[k.place]&128)!==0)return!1;var I=f.slice(k.place,C+k.place);if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;if(I[0]===0)if(I[1]&128)I=I.slice(1);else return!1;return this.r=new _(h),this.s=new _(I),this.recoveryParam=null,!0};function H(f,w){if(w<128){f.push(w);return}var k=1+(Math.log(w)/Math.LN2>>>3);f.push(k|128);while(--k)f.push(w>>>(k<<3)&255);f.push(w)}Y.prototype.toDER=function(f){var w=this.r.toArray(),k=this.s.toArray();if(w[0]&128)w=[0].concat(w);if(k[0]&128)k=[0].concat(k);w=T(w),k=T(k);while(!k[0]&&!(k[1]&128))k=k.slice(1);var S=[2];H(S,w.length),S=S.concat(w),S.push(2),H(S,k.length);var N=S.concat(k),h=[48];return H(h,N.length),h=h.concat(N),K.encode(h,f)}}),ni=T$(($,q)=>{var _=N_(),K=li(),P=M8(),Y=EH(),O=TM(),z=P.assert,T=ri(),H=oi();function f(w){if(!(this instanceof f))return new f(w);if(typeof w==="string")z(Object.prototype.hasOwnProperty.call(Y,w),"Unknown curve "+w),w=Y[w];if(w instanceof Y.PresetCurve)w={curve:w};this.curve=w.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=w.curve.g,this.g.precompute(w.curve.n.bitLength()+1),this.hash=w.hash||w.curve.hash}q.exports=f,f.prototype.keyPair=function(w){return new T(this,w)},f.prototype.keyFromPrivate=function(w,k){return T.fromPrivate(this,w,k)},f.prototype.keyFromPublic=function(w,k){return T.fromPublic(this,w,k)},f.prototype.genKeyPair=function(w){if(!w)w={};var k=new K({hash:this.hash,pers:w.pers,persEnc:w.persEnc||"utf8",entropy:w.entropy||O(this.hash.hmacStrength),entropyEnc:w.entropy&&w.entropyEnc||"utf8",nonce:this.n.toArray()}),S=this.n.byteLength(),N=this.n.sub(new _(2));for(;;){var h=new _(k.generate(S));if(h.cmp(N)>0)continue;return h.iaddn(1),this.keyFromPrivate(h)}},f.prototype._truncateToN=function(w,k,S){var N;if(_.isBN(w)||typeof w==="number")w=new _(w,16),N=w.byteLength();else if(typeof w==="object")N=w.length,w=new _(w,16);else{var h=w.toString();N=h.length+1>>>1,w=new _(h,16)}if(typeof S!=="number")S=N*8;var C=S-this.n.bitLength();if(C>0)w=w.ushrn(C);if(!k&&w.cmp(this.n)>=0)return w.sub(this.n);else return w},f.prototype.sign=function(w,k,S,N){if(typeof S==="object")N=S,S=null;if(!N)N={};if(typeof w!=="string"&&typeof w!=="number"&&!_.isBN(w)){z(typeof w==="object"&&w&&typeof w.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(w.length>>>0===w.length);for(var h=0;h<w.length;h++)z((w[h]&255)===w[h])}k=this.keyFromPrivate(k,S),w=this._truncateToN(w,!1,N.msgBitLength),z(!w.isNeg(),"Can not sign a negative message");var C=this.n.byteLength(),I=k.getPrivate().toArray("be",C),D=w.toArray("be",C);z(new _(D).eq(w),"Can not sign message");var L=new K({hash:this.hash,entropy:I,nonce:D,pers:N.pers,persEnc:N.persEnc||"utf8"}),g=this.n.sub(new _(1));for(var y=0;;y++){var p=N.k?N.k(y):new _(L.generate(this.n.byteLength()));if(p=this._truncateToN(p,!0),p.cmpn(1)<=0||p.cmp(g)>=0)continue;var o=this.g.mul(p);if(o.isInfinity())continue;var s=o.getX(),Q=s.umod(this.n);if(Q.cmpn(0)===0)continue;var m=p.invm(this.n).mul(Q.mul(k.getPrivate()).iadd(w));if(m=m.umod(this.n),m.cmpn(0)===0)continue;var e=(o.getY().isOdd()?1:0)|(s.cmp(Q)!==0?2:0);if(N.canonical&&m.cmp(this.nh)>0)m=this.n.sub(m),e^=1;return new H({r:Q,s:m,recoveryParam:e})}},f.prototype.verify=function(w,k,S,N,h){if(!h)h={};w=this._truncateToN(w,!1,h.msgBitLength),S=this.keyFromPublic(S,N),k=new H(k,"hex");var{r:C,s:I}=k;if(C.cmpn(1)<0||C.cmp(this.n)>=0)return!1;if(I.cmpn(1)<0||I.cmp(this.n)>=0)return!1;var D=I.invm(this.n),L=D.mul(w).umod(this.n),g=D.mul(C).umod(this.n),y;if(!this.curve._maxwellTrick){if(y=this.g.mulAdd(L,S.getPublic(),g),y.isInfinity())return!1;return y.getX().umod(this.n).cmp(C)===0}if(y=this.g.jmulAdd(L,S.getPublic(),g),y.isInfinity())return!1;return y.eqXToP(C)},f.prototype.recoverPubKey=function(w,k,S,N){z((3&S)===S,"The recovery param is more than two bits"),k=new H(k,N);var h=this.n,C=new _(w),I=k.r,D=k.s,L=S&1,g=S>>1;if(I.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw Error("Unable to find sencond key candinate");if(g)I=this.curve.pointFromX(I.add(this.curve.n),L);else I=this.curve.pointFromX(I,L);var y=k.r.invm(h),p=h.sub(C).mul(y).umod(h),o=D.mul(y).umod(h);return this.g.mulAdd(p,I,o)},f.prototype.getKeyRecoveryParam=function(w,k,S,N){if(k=new H(k,N),k.recoveryParam!==null)return k.recoveryParam;for(var h=0;h<4;h++){var C;try{C=this.recoverPubKey(w,k,h)}catch(I){continue}if(C.eq(S))return h}throw Error("Unable to find valid recovery factor")}}),ii=T$(($,q)=>{var _=M8(),K=_.assert,P=_.parseBytes,Y=_.cachedProperty;function O(z,T){if(this.eddsa=z,this._secret=P(T.secret),z.isPoint(T.pub))this._pub=T.pub;else this._pubBytes=P(T.pub)}O.fromPublic=function(z,T){if(T instanceof O)return T;return new O(z,{pub:T})},O.fromSecret=function(z,T){if(T instanceof O)return T;return new O(z,{secret:T})},O.prototype.secret=function(){return this._secret},Y(O,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Y(O,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),Y(O,"privBytes",function(){var z=this.eddsa,T=this.hash(),H=z.encodingLength-1,f=T.slice(0,z.encodingLength);return f[0]&=248,f[H]&=127,f[H]|=64,f}),Y(O,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Y(O,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Y(O,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),O.prototype.sign=function(z){return K(this._secret,"KeyPair can only verify"),this.eddsa.sign(z,this)},O.prototype.verify=function(z,T){return this.eddsa.verify(z,T,this)},O.prototype.getSecret=function(z){return K(this._secret,"KeyPair is public only"),_.encode(this.secret(),z)},O.prototype.getPublic=function(z){return _.encode(this.pubBytes(),z)},q.exports=O}),Bi=T$(($,q)=>{var _=N_(),K=M8(),P=K.assert,Y=K.cachedProperty,O=K.parseBytes;function z(T,H){if(this.eddsa=T,typeof H!=="object")H=O(H);if(Array.isArray(H))P(H.length===T.encodingLength*2,"Signature has invalid size"),H={R:H.slice(0,T.encodingLength),S:H.slice(T.encodingLength)};if(P(H.R&&H.S,"Signature without R or S"),T.isPoint(H.R))this._R=H.R;if(H.S instanceof _)this._S=H.S;this._Rencoded=Array.isArray(H.R)?H.R:H.Rencoded,this._Sencoded=Array.isArray(H.S)?H.S:H.Sencoded}Y(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Y(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Y(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Y(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return K.encode(this.toBytes(),"hex").toUpperCase()},q.exports=z}),ti=T$(($,q)=>{var _=CH(),K=EH(),P=M8(),Y=P.assert,O=P.parseBytes,z=ii(),T=Bi();function H(f){if(Y(f==="ed25519","only tested with ed25519 so far"),!(this instanceof H))return new H(f);f=K[f].curve,this.curve=f,this.g=f.g,this.g.precompute(f.n.bitLength()+1),this.pointClass=f.point().constructor,this.encodingLength=Math.ceil(f.n.bitLength()/8),this.hash=_.sha512}q.exports=H,H.prototype.sign=function(f,w){f=O(f);var k=this.keyFromSecret(w),S=this.hashInt(k.messagePrefix(),f),N=this.g.mul(S),h=this.encodePoint(N),C=this.hashInt(h,k.pubBytes(),f).mul(k.priv()),I=S.add(C).umod(this.curve.n);return this.makeSignature({R:N,S:I,Rencoded:h})},H.prototype.verify=function(f,w,k){if(f=O(f),w=this.makeSignature(w),w.S().gte(w.eddsa.curve.n)||w.S().isNeg())return!1;var S=this.keyFromPublic(k),N=this.hashInt(w.Rencoded(),S.pubBytes(),f),h=this.g.mul(w.S()),C=w.R().add(S.pub().mul(N));return C.eq(h)},H.prototype.hashInt=function(){var f=this.hash();for(var w=0;w<arguments.length;w++)f.update(arguments[w]);return P.intFromLE(f.digest()).umod(this.curve.n)},H.prototype.keyFromPublic=function(f){return z.fromPublic(this,f)},H.prototype.keyFromSecret=function(f){return z.fromSecret(this,f)},H.prototype.makeSignature=function(f){if(f instanceof T)return f;return new T(this,f)},H.prototype.encodePoint=function(f){var w=f.getY().toArray("le",this.encodingLength);return w[this.encodingLength-1]|=f.getX().isOdd()?128:0,w},H.prototype.decodePoint=function(f){f=P.parseBytes(f);var w=f.length-1,k=f.slice(0,w).concat(f[w]&-129),S=(f[w]&128)!==0,N=P.intFromLE(k);return this.curve.pointFromY(N,S)},H.prototype.encodeInt=function(f){return f.toArray("le",this.encodingLength)},H.prototype.decodeInt=function(f){return P.intFromLE(f)},H.prototype.isPoint=function(f){return f instanceof this.pointClass}}),Ui=T$(($)=>{var q=$;q.version=Ii().version,q.utils=M8(),q.rand=TM(),q.curve=wM(),q.curves=EH(),q.ec=ni(),q.eddsa=ti()}),Fi=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,G,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(G=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(G=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,G=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,G=Math.min(j.length,X);for(var M=W;M<G;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var G=j.length-X,M=G%J,A=Math.min(G,G-M)+X,v=0;for(var V=X;V<A;V+=J)if(v=f(j,V,V+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,V,j.length,W);for(V=0;V<M;V++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var G=0;G<this.length;G++){var M=this.words[G],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,G--;if(Z!==0||G!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],V=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(V).toString(j);if(R=R.idivn(V),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var G=W==="le",M=new j(Z),A,v,V=this.clone();if(!G){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[Z-v-1]=A}else{for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var G=0;G<J.length;G++)W=(X.words[G]|0)+(J.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;for(;Z!==0&&G<X.length;G++)W=(X.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;G<X.length;G++)this.words[G]=X.words[G];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var G=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;for(;G!==0&&M<J.length;M++)W=(J.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;if(G===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,G=W.words[0]|0,M=Z*G,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var V=1;V<J;V++){var R=v>>>26,E=v&67108863,b=Math.min(V,W.length-1);for(var x=Math.max(0,V-j.length+1);x<=b;x++){var l=V-x|0;Z=j.words[l]|0,G=W.words[x]|0,M=Z*G+E,R+=M/67108864|0,E=M&67108863}X.words[V]=E|0,v=R|0}if(v!==0)X.words[V]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,G=X.words,M=0,A,v,V,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,F=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,a=v$&8191,P$=v$>>>13,o$=J[4]|0,c=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,V=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(F,M$)|0,V=Math.imul(F,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,V=V+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,V=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(F,E$)|0,V=V+Math.imul(F,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,V=V+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(a,M$),v=Math.imul(a,S$),v=v+Math.imul(P$,M$)|0,V=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,V=V+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(F,g$)|0,V=V+Math.imul(F,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,V=V+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(c,M$),v=Math.imul(c,S$),v=v+Math.imul(r,M$)|0,V=Math.imul(r,S$),A=A+Math.imul(a,E$)|0,v=v+Math.imul(a,b$)|0,v=v+Math.imul(P$,E$)|0,V=V+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,V=V+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(F,y$)|0,V=V+Math.imul(F,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,V=V+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,V=Math.imul(_$,S$),A=A+Math.imul(c,E$)|0,v=v+Math.imul(c,b$)|0,v=v+Math.imul(r,E$)|0,V=V+Math.imul(r,b$)|0,A=A+Math.imul(a,g$)|0,v=v+Math.imul(a,h$)|0,v=v+Math.imul(P$,g$)|0,V=V+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,V=V+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(F,u$)|0,V=V+Math.imul(F,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,V=V+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,V=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,V=V+Math.imul(_$,b$)|0,A=A+Math.imul(c,g$)|0,v=v+Math.imul(c,h$)|0,v=v+Math.imul(r,g$)|0,V=V+Math.imul(r,h$)|0,A=A+Math.imul(a,y$)|0,v=v+Math.imul(a,R$)|0,v=v+Math.imul(P$,y$)|0,V=V+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,V=V+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(F,I$)|0,V=V+Math.imul(F,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,V=V+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,V=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,V=V+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,V=V+Math.imul(_$,h$)|0,A=A+Math.imul(c,y$)|0,v=v+Math.imul(c,R$)|0,v=v+Math.imul(r,y$)|0,V=V+Math.imul(r,R$)|0,A=A+Math.imul(a,u$)|0,v=v+Math.imul(a,x$)|0,v=v+Math.imul(P$,u$)|0,V=V+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,V=V+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(F,K$)|0,V=V+Math.imul(F,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,V=V+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,V=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,V=V+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,V=V+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,V=V+Math.imul(_$,R$)|0,A=A+Math.imul(c,u$)|0,v=v+Math.imul(c,x$)|0,v=v+Math.imul(r,u$)|0,V=V+Math.imul(r,x$)|0,A=A+Math.imul(a,I$)|0,v=v+Math.imul(a,u)|0,v=v+Math.imul(P$,I$)|0,V=V+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,V=V+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(F,G$)|0,V=V+Math.imul(F,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,V=V+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,V=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,V=V+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,V=V+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,V=V+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,V=V+Math.imul(_$,x$)|0,A=A+Math.imul(c,I$)|0,v=v+Math.imul(c,u)|0,v=v+Math.imul(r,I$)|0,V=V+Math.imul(r,u)|0,A=A+Math.imul(a,K$)|0,v=v+Math.imul(a,Y$)|0,v=v+Math.imul(P$,K$)|0,V=V+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,V=V+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(F,D$)|0,V=V+Math.imul(F,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,V=V+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,V=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,V=V+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,V=V+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,V=V+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,V=V+Math.imul(_$,u)|0,A=A+Math.imul(c,K$)|0,v=v+Math.imul(c,Y$)|0,v=v+Math.imul(r,K$)|0,V=V+Math.imul(r,Y$)|0,A=A+Math.imul(a,G$)|0,v=v+Math.imul(a,V$)|0,v=v+Math.imul(P$,G$)|0,V=V+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,V=V+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(F,L$)|0,V=V+Math.imul(F,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,V=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,V=V+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,V=V+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,V=V+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,V=V+Math.imul(_$,Y$)|0,A=A+Math.imul(c,G$)|0,v=v+Math.imul(c,V$)|0,v=v+Math.imul(r,G$)|0,V=V+Math.imul(r,V$)|0,A=A+Math.imul(a,D$)|0,v=v+Math.imul(a,p$)|0,v=v+Math.imul(P$,D$)|0,V=V+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,V=V+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,V=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,V=V+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,V=V+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,V=V+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,V=V+Math.imul(_$,V$)|0,A=A+Math.imul(c,D$)|0,v=v+Math.imul(c,p$)|0,v=v+Math.imul(r,D$)|0,V=V+Math.imul(r,p$)|0,A=A+Math.imul(a,L$)|0,v=v+Math.imul(a,C$)|0,v=v+Math.imul(P$,L$)|0,V=V+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,V=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,V=V+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,V=V+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,V=V+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,V=V+Math.imul(_$,p$)|0,A=A+Math.imul(c,L$)|0,v=v+Math.imul(c,C$)|0,v=v+Math.imul(r,L$)|0,V=V+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,V=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,V=V+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,V=V+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,V=V+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,V=V+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,V=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,V=V+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,V=V+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,V=V+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,V=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,V=V+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,V=V+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,V=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,V=V+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,V=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(V+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,G[0]=c6,G[1]=W6,G[2]=j6,G[3]=E6,G[4]=M6,G[5]=t6,G[6]=U6,G[7]=F6,G[8]=Q6,G[9]=a6,G[10]=e6,G[11]=s6,G[12]=$q,G[13]=qq,G[14]=_q,G[15]=Kq,G[16]=Pq,G[17]=Yq,G[18]=Oq,M!==0)G[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var G=0;G<X.length-1;G++){var M=Z;Z=0;var A=J&67108863,v=Math.min(G,W.length-1);for(var V=Math.max(0,G-j.length+1);V<=v;V++){var R=G-V,E=j.words[R]|0,b=W.words[V]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[G]=A,J=M,M=Z}if(J!==0)X.words[G]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,G){for(var M=0;M<G;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,G){this.permute(G,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=V;for(var x=0;x<M;x++){var l=X[R+x],F=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=F+q$,X[R+x+M]=l-f$,J[R+x+M]=F-q$,x!==A)B=v*E-V*b,b=v*b+V*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var G=0;G<W;G++)Z=Z+(j[G]|0),X[2*G]=Z&8191,Z=Z>>>13,X[2*G+1]=Z&8191,Z=Z>>>13;for(G=2*W;G<J;++G)X[G]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),G=this.stub(J),M=Array(J),A=Array(J),v=Array(J),V=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,V,J),this.transform(M,G,A,v,J,Z),this.transform(V,G,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,G,J,Z),this.conjugate(b,G,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var G=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|G,G=M>>>26-W}if(G)this.words[Z]=G,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,G=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=G,J=Math.max(0,J),A){for(var v=0;v<G;v++)A.words[v]=this.words[v];A.length=G}if(G===0);else if(this.length>G){this.length-=G;for(v=0;v<this.length;v++)this.words[v]=this.words[v+G]}else this.words[0]=0,this.length=1;var V=0;for(v=this.length-1;v>=0&&(V!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=V<<26-Z|R>>>Z,V=R&M}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var G,M=0;for(Z=0;Z<j.length;Z++){G=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;G-=A&67108863,M=(G>>26)-(A/67108864|0),this.words[Z+X]=G&67108863}for(;Z<this.length-X;Z++)G=(this.words[Z+X]|0)+M,M=G>>26,this.words[Z+X]=G&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)G=-(this.words[Z]|0)+M,M=G>>26,this.words[Z]=G&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,G=Z.words[Z.length-1]|0,M=this._countBits(G);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),G=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var V=0;V<v.length;V++)v.words[V]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/G|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,G;if(this.negative!==0&&j.negative===0){if(G=this.neg().divmod(j,W),W!=="mod")J=G.div.neg();if(W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(G=this.divmod(j.neg(),W),W!=="mod")J=G.div.neg();return{div:J,mod:G.mod}}if((this.negative&j.negative)!==0){if(G=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:G.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),G=X.cmp(J);if(G<0||Z===1&&G===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),V=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(V);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(G.isOdd()||M.isOdd())G.iadd(v),M.isub(V);G.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(G),Z.isub(M);else X.isub(W),G.isub(J),M.isub(Z)}return{a:G,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(G);J.iushrn(1)}}for(var v=0,V=1;(X.words[0]&V)===0&&v<26;++v,V<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(G);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var G=W;W=X,X=G}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var G=X;Z!==0&&G<this.length;G++){var M=this.words[G]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[G]=M}if(Z!==0)this.words[G]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new m(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(p,y),p.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var G=j.words[9];W.words[W.length++]=G&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|G>>>22,G=M}if(G>>>=22,j.words[Z-10]=G,G===0&&j.length>10)j.length-=10;else j.length-=9},p.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function Q(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(Q,y),Q.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new p;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new Q;else throw Error("Unknown prime "+j);return g[j]=W,W};function m(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}m.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},m.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},m.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},m.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},m.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},m.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},m.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},m.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},m.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},m.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},m.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},m.prototype.isqr=function(j){return this.imul(j,j.clone())},m.prototype.sqr=function(j){return this.mul(j,j)},m.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var G=new O(1).toRed(this),M=G.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var V=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(G)!==0){var x=E;for(var l=0;x.cmp(G)!==0;l++)x=x.redSqr();P(l<b);var F=this.pow(V,new O(1).iushln(b-l-1));R=R.redMul(F),V=F.redSqr(),E=E.redMul(V),b=l}return R},m.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},m.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var G=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var V=W.words[Z];for(var R=v-1;R>=0;R--){var E=V>>R&1;if(G!==J[0])G=this.sqr(G);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;G=this.mul(G,J[M]),A=0,M=0}v=26}return G},m.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},m.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new e(j)};function e(j){if(m.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(e,m),e.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},e.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},e.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),Qi=T$(($,q)=>{var _=Ui(),K=Fi();q.exports=function(z){return new Y(z)};var P={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}};P.p224=P.secp224r1,P.p256=P.secp256r1=P.prime256v1,P.p192=P.secp192r1=P.prime192v1,P.p384=P.secp384r1,P.p521=P.secp521r1;function Y(z){if(this.curveType=P[z],!this.curveType)this.curveType={name:z};this.curve=new _.ec(this.curveType.name),this.keys=void 0}Y.prototype.generateKeys=function(z,T){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,T)},Y.prototype.computeSecret=function(z,T,H){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);var f=this.curve.keyFromPublic(z).getPublic(),w=f.mul(this.keys.getPrivate()).getX();return O(w,H,this.curveType.byteLength)},Y.prototype.getPublicKey=function(z,T){var H=this.keys.getPublic(T==="compressed",!0);if(T==="hybrid")if(H[H.length-1]%2)H[0]=7;else H[0]=6;return O(H,z)},Y.prototype.getPrivateKey=function(z){return O(this.keys.getPrivate(),z)},Y.prototype.setPublicKey=function(z,T){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);return this.keys._importPublic(z),this},Y.prototype.setPrivateKey=function(z,T){if(T=T||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,T);var H=new K(z);return H=H.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(H),this};function O(z,T,H){if(!Array.isArray(z))z=z.toArray();var f=new Buffer(z);if(H&&f.length<H){var w=new Buffer(H-f.length);w.fill(0),f=Buffer.concat([w,f])}if(!T)return f;else return f.toString(T)}}),ai=T$(($,q)=>{var _=(lq(),J6(dq)).createECDH;q.exports=_||Qi()}),ei=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,G,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(G=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(G=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,G=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,G=Math.min(j.length,X);for(var M=W;M<G;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var G=j.length-X,M=G%J,A=Math.min(G,G-M)+X,v=0;for(var V=X;V<A;V+=J)if(v=f(j,V,V+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,V,j.length,W);for(V=0;V<M;V++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var G=0;G<this.length;G++){var M=this.words[G],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,G--;if(Z!==0||G!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],V=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(V).toString(j);if(R=R.idivn(V),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var G=W==="le",M=new j(Z),A,v,V=this.clone();if(!G){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[Z-v-1]=A}else{for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var G=0;G<J.length;G++)W=(X.words[G]|0)+(J.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;for(;Z!==0&&G<X.length;G++)W=(X.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;G<X.length;G++)this.words[G]=X.words[G];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var G=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;for(;G!==0&&M<J.length;M++)W=(J.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;if(G===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,G=W.words[0]|0,M=Z*G,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var V=1;V<J;V++){var R=v>>>26,E=v&67108863,b=Math.min(V,W.length-1);for(var x=Math.max(0,V-j.length+1);x<=b;x++){var l=V-x|0;Z=j.words[l]|0,G=W.words[x]|0,M=Z*G+E,R+=M/67108864|0,E=M&67108863}X.words[V]=E|0,v=R|0}if(v!==0)X.words[V]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,G=X.words,M=0,A,v,V,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,F=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,a=v$&8191,P$=v$>>>13,o$=J[4]|0,c=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,V=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(F,M$)|0,V=Math.imul(F,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,V=V+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,V=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(F,E$)|0,V=V+Math.imul(F,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,V=V+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(a,M$),v=Math.imul(a,S$),v=v+Math.imul(P$,M$)|0,V=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,V=V+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(F,g$)|0,V=V+Math.imul(F,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,V=V+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(c,M$),v=Math.imul(c,S$),v=v+Math.imul(r,M$)|0,V=Math.imul(r,S$),A=A+Math.imul(a,E$)|0,v=v+Math.imul(a,b$)|0,v=v+Math.imul(P$,E$)|0,V=V+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,V=V+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(F,y$)|0,V=V+Math.imul(F,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,V=V+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,V=Math.imul(_$,S$),A=A+Math.imul(c,E$)|0,v=v+Math.imul(c,b$)|0,v=v+Math.imul(r,E$)|0,V=V+Math.imul(r,b$)|0,A=A+Math.imul(a,g$)|0,v=v+Math.imul(a,h$)|0,v=v+Math.imul(P$,g$)|0,V=V+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,V=V+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(F,u$)|0,V=V+Math.imul(F,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,V=V+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,V=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,V=V+Math.imul(_$,b$)|0,A=A+Math.imul(c,g$)|0,v=v+Math.imul(c,h$)|0,v=v+Math.imul(r,g$)|0,V=V+Math.imul(r,h$)|0,A=A+Math.imul(a,y$)|0,v=v+Math.imul(a,R$)|0,v=v+Math.imul(P$,y$)|0,V=V+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,V=V+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(F,I$)|0,V=V+Math.imul(F,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,V=V+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,V=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,V=V+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,V=V+Math.imul(_$,h$)|0,A=A+Math.imul(c,y$)|0,v=v+Math.imul(c,R$)|0,v=v+Math.imul(r,y$)|0,V=V+Math.imul(r,R$)|0,A=A+Math.imul(a,u$)|0,v=v+Math.imul(a,x$)|0,v=v+Math.imul(P$,u$)|0,V=V+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,V=V+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(F,K$)|0,V=V+Math.imul(F,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,V=V+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,V=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,V=V+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,V=V+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,V=V+Math.imul(_$,R$)|0,A=A+Math.imul(c,u$)|0,v=v+Math.imul(c,x$)|0,v=v+Math.imul(r,u$)|0,V=V+Math.imul(r,x$)|0,A=A+Math.imul(a,I$)|0,v=v+Math.imul(a,u)|0,v=v+Math.imul(P$,I$)|0,V=V+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,V=V+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(F,G$)|0,V=V+Math.imul(F,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,V=V+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,V=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,V=V+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,V=V+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,V=V+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,V=V+Math.imul(_$,x$)|0,A=A+Math.imul(c,I$)|0,v=v+Math.imul(c,u)|0,v=v+Math.imul(r,I$)|0,V=V+Math.imul(r,u)|0,A=A+Math.imul(a,K$)|0,v=v+Math.imul(a,Y$)|0,v=v+Math.imul(P$,K$)|0,V=V+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,V=V+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(F,D$)|0,V=V+Math.imul(F,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,V=V+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,V=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,V=V+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,V=V+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,V=V+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,V=V+Math.imul(_$,u)|0,A=A+Math.imul(c,K$)|0,v=v+Math.imul(c,Y$)|0,v=v+Math.imul(r,K$)|0,V=V+Math.imul(r,Y$)|0,A=A+Math.imul(a,G$)|0,v=v+Math.imul(a,V$)|0,v=v+Math.imul(P$,G$)|0,V=V+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,V=V+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(F,L$)|0,V=V+Math.imul(F,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,V=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,V=V+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,V=V+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,V=V+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,V=V+Math.imul(_$,Y$)|0,A=A+Math.imul(c,G$)|0,v=v+Math.imul(c,V$)|0,v=v+Math.imul(r,G$)|0,V=V+Math.imul(r,V$)|0,A=A+Math.imul(a,D$)|0,v=v+Math.imul(a,p$)|0,v=v+Math.imul(P$,D$)|0,V=V+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,V=V+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,V=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,V=V+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,V=V+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,V=V+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,V=V+Math.imul(_$,V$)|0,A=A+Math.imul(c,D$)|0,v=v+Math.imul(c,p$)|0,v=v+Math.imul(r,D$)|0,V=V+Math.imul(r,p$)|0,A=A+Math.imul(a,L$)|0,v=v+Math.imul(a,C$)|0,v=v+Math.imul(P$,L$)|0,V=V+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,V=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,V=V+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,V=V+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,V=V+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,V=V+Math.imul(_$,p$)|0,A=A+Math.imul(c,L$)|0,v=v+Math.imul(c,C$)|0,v=v+Math.imul(r,L$)|0,V=V+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,V=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,V=V+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,V=V+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,V=V+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,V=V+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,V=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,V=V+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,V=V+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,V=V+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,V=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,V=V+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,V=V+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,V=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,V=V+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,V=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(V+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,G[0]=c6,G[1]=W6,G[2]=j6,G[3]=E6,G[4]=M6,G[5]=t6,G[6]=U6,G[7]=F6,G[8]=Q6,G[9]=a6,G[10]=e6,G[11]=s6,G[12]=$q,G[13]=qq,G[14]=_q,G[15]=Kq,G[16]=Pq,G[17]=Yq,G[18]=Oq,M!==0)G[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var G=0;G<X.length-1;G++){var M=Z;Z=0;var A=J&67108863,v=Math.min(G,W.length-1);for(var V=Math.max(0,G-j.length+1);V<=v;V++){var R=G-V,E=j.words[R]|0,b=W.words[V]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[G]=A,J=M,M=Z}if(J!==0)X.words[G]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,G){for(var M=0;M<G;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,G){this.permute(G,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=V;for(var x=0;x<M;x++){var l=X[R+x],F=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=F+q$,X[R+x+M]=l-f$,J[R+x+M]=F-q$,x!==A)B=v*E-V*b,b=v*b+V*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var G=0;G<W;G++)Z=Z+(j[G]|0),X[2*G]=Z&8191,Z=Z>>>13,X[2*G+1]=Z&8191,Z=Z>>>13;for(G=2*W;G<J;++G)X[G]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),G=this.stub(J),M=Array(J),A=Array(J),v=Array(J),V=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,V,J),this.transform(M,G,A,v,J,Z),this.transform(V,G,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,G,J,Z),this.conjugate(b,G,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var G=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|G,G=M>>>26-W}if(G)this.words[Z]=G,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,G=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=G,J=Math.max(0,J),A){for(var v=0;v<G;v++)A.words[v]=this.words[v];A.length=G}if(G===0);else if(this.length>G){this.length-=G;for(v=0;v<this.length;v++)this.words[v]=this.words[v+G]}else this.words[0]=0,this.length=1;var V=0;for(v=this.length-1;v>=0&&(V!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=V<<26-Z|R>>>Z,V=R&M}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var G,M=0;for(Z=0;Z<j.length;Z++){G=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;G-=A&67108863,M=(G>>26)-(A/67108864|0),this.words[Z+X]=G&67108863}for(;Z<this.length-X;Z++)G=(this.words[Z+X]|0)+M,M=G>>26,this.words[Z+X]=G&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)G=-(this.words[Z]|0)+M,M=G>>26,this.words[Z]=G&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,G=Z.words[Z.length-1]|0,M=this._countBits(G);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),G=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var V=0;V<v.length;V++)v.words[V]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/G|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,G;if(this.negative!==0&&j.negative===0){if(G=this.neg().divmod(j,W),W!=="mod")J=G.div.neg();if(W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(G=this.divmod(j.neg(),W),W!=="mod")J=G.div.neg();return{div:J,mod:G.mod}}if((this.negative&j.negative)!==0){if(G=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:G.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),G=X.cmp(J);if(G<0||Z===1&&G===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),V=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(V);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(G.isOdd()||M.isOdd())G.iadd(v),M.isub(V);G.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(G),Z.isub(M);else X.isub(W),G.isub(J),M.isub(Z)}return{a:G,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(G);J.iushrn(1)}}for(var v=0,V=1;(X.words[0]&V)===0&&v<26;++v,V<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(G);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var G=W;W=X,X=G}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var G=X;Z!==0&&G<this.length;G++){var M=this.words[G]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[G]=M}if(Z!==0)this.words[G]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new m(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(p,y),p.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var G=j.words[9];W.words[W.length++]=G&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|G>>>22,G=M}if(G>>>=22,j.words[Z-10]=G,G===0&&j.length>10)j.length-=10;else j.length-=9},p.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function Q(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(Q,y),Q.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new p;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new Q;else throw Error("Unknown prime "+j);return g[j]=W,W};function m(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}m.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},m.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},m.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},m.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},m.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},m.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},m.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},m.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},m.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},m.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},m.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},m.prototype.isqr=function(j){return this.imul(j,j.clone())},m.prototype.sqr=function(j){return this.mul(j,j)},m.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var G=new O(1).toRed(this),M=G.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var V=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(G)!==0){var x=E;for(var l=0;x.cmp(G)!==0;l++)x=x.redSqr();P(l<b);var F=this.pow(V,new O(1).iushln(b-l-1));R=R.redMul(F),V=F.redSqr(),E=E.redMul(V),b=l}return R},m.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},m.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var G=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var V=W.words[Z];for(var R=v-1;R>=0;R--){var E=V>>R&1;if(G!==J[0])G=this.sqr(G);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;G=this.mul(G,J[M]),A=0,M=0}v=26}return G},m.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},m.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new e(j)};function e(j){if(m.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(e,m),e.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},e.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},e.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),si=T$(($)=>{var q=Y1(),_=v8(),K=$;K.define=function(Y,O){return new P(Y,O)};function P(Y,O){this.name=Y,this.body=O,this.decoders={},this.encoders={}}P.prototype._createNamed=function(Y){var O;try{O=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
35
35
  this._initNamed(entity);
36
- })`)}catch(z){O=function(T){this._initNamed(T)}}return _(O,Y),O.prototype._initNamed=function(z){Y.call(this,z)},new O(this)},P.prototype._getDecoder=function(Y){if(Y=Y||"der",!this.decoders.hasOwnProperty(Y))this.decoders[Y]=this._createNamed(q.decoders[Y]);return this.decoders[Y]},P.prototype.decode=function(Y,O,z){return this._getDecoder(O).decode(Y,z)},P.prototype._getEncoder=function(Y){if(Y=Y||"der",!this.encoders.hasOwnProperty(Y))this.encoders[Y]=this._createNamed(q.encoders[Y]);return this.encoders[Y]},P.prototype.encode=function(Y,O,z){return this._getEncoder(O).encode(Y,z)}}),$B=T$(($)=>{var q=v8();function _(P){this._reporterState={obj:null,path:[],options:P||{},errors:[]}}$.Reporter=_,_.prototype.isError=function(P){return P instanceof K},_.prototype.save=function(){var P=this._reporterState;return{obj:P.obj,pathLen:P.path.length}},_.prototype.restore=function(P){var Y=this._reporterState;Y.obj=P.obj,Y.path=Y.path.slice(0,P.pathLen)},_.prototype.enterKey=function(P){return this._reporterState.path.push(P)},_.prototype.exitKey=function(P){var Y=this._reporterState;Y.path=Y.path.slice(0,P-1)},_.prototype.leaveKey=function(P,Y,O){var z=this._reporterState;if(this.exitKey(P),z.obj!==null)z.obj[Y]=O},_.prototype.path=function(){return this._reporterState.path.join("/")},_.prototype.enterObject=function(){var P=this._reporterState,Y=P.obj;return P.obj={},Y},_.prototype.leaveObject=function(P){var Y=this._reporterState,O=Y.obj;return Y.obj=P,O},_.prototype.error=function(P){var Y,O=this._reporterState,z=P instanceof K;if(z)Y=P;else Y=new K(O.path.map(function(T){return"["+JSON.stringify(T)+"]"}).join(""),P.message||P,P.stack);if(!O.options.partial)throw Y;if(!z)O.errors.push(Y);return Y},_.prototype.wrapResult=function(P){var Y=this._reporterState;if(!Y.options.partial)return P;return{result:this.isError(P)?null:P,errors:Y.errors}};function K(P,Y){this.path=P,this.rethrow(Y)}q(K,Error),K.prototype.rethrow=function(P){if(this.message=P+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,K);if(!this.stack)try{throw Error(this.message)}catch(Y){this.stack=Y.stack}return this}}),s0=T$(($)=>{var q=v8(),_=$1().Reporter,K=(wq(),J6(Tq)).Buffer;function P(O,z){if(_.call(this,z),!K.isBuffer(O)){this.error("Input not Buffer");return}this.base=O,this.offset=0,this.length=O.length}q(P,_),$.DecoderBuffer=P,P.prototype.save=function(){return{offset:this.offset,reporter:_.prototype.save.call(this)}},P.prototype.restore=function(O){var z=new P(this.base);return z.offset=O.offset,z.length=this.offset,this.offset=O.offset,_.prototype.restore.call(this,O.reporter),z},P.prototype.isEmpty=function(){return this.offset===this.length},P.prototype.readUInt8=function(O){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(O||"DecoderBuffer overrun")},P.prototype.skip=function(O,z){if(!(this.offset+O<=this.length))return this.error(z||"DecoderBuffer overrun");var T=new P(this.base);return T._reporterState=this._reporterState,T.offset=this.offset,T.length=this.offset+O,this.offset+=O,T},P.prototype.raw=function(O){return this.base.slice(O?O.offset:this.offset,this.length)};function Y(O,z){if(Array.isArray(O))this.length=0,this.value=O.map(function(T){if(!(T instanceof Y))T=new Y(T,z);return this.length+=T.length,T},this);else if(typeof O==="number"){if(!(0<=O&&O<=255))return z.error("non-byte EncoderBuffer value");this.value=O,this.length=1}else if(typeof O==="string")this.value=O,this.length=K.byteLength(O);else if(K.isBuffer(O))this.value=O,this.length=O.length;else return z.error("Unsupported type: "+typeof O)}$.EncoderBuffer=Y,Y.prototype.join=function(O,z){if(!O)O=new K(this.length);if(!z)z=0;if(this.length===0)return O;if(Array.isArray(this.value))this.value.forEach(function(T){T.join(O,z),z+=T.length});else{if(typeof this.value==="number")O[z]=this.value;else if(typeof this.value==="string")O.write(this.value,z);else if(K.isBuffer(this.value))this.value.copy(O,z);z+=this.length}return O}}),qB=T$(($,q)=>{var _=$1().Reporter,K=$1().EncoderBuffer,P=$1().DecoderBuffer,Y=PK(),O=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(O),T=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function H(w,k){var S={};if(this._baseState=S,S.enc=w,S.parent=k||null,S.children=null,S.tag=null,S.args=null,S.reverseArgs=null,S.choice=null,S.optional=!1,S.any=!1,S.obj=!1,S.use=null,S.useDecoder=null,S.key=null,S.default=null,S.explicit=null,S.implicit=null,S.contains=null,!S.parent)S.children=[],this._wrap()}q.exports=H;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];H.prototype.clone=function(){var w=this._baseState,k={};f.forEach(function(N){k[N]=w[N]});var S=new this.constructor(k.parent);return S._baseState=k,S},H.prototype._wrap=function(){var w=this._baseState;z.forEach(function(k){this[k]=function(){var S=new this.constructor(this);return w.children.push(S),S[k].apply(S,arguments)}},this)},H.prototype._init=function(w){var k=this._baseState;Y(k.parent===null),w.call(this),k.children=k.children.filter(function(S){return S._baseState.parent===this},this),Y.equal(k.children.length,1,"Root node can have only one child")},H.prototype._useArgs=function(w){var k=this._baseState,S=w.filter(function(N){return N instanceof this.constructor},this);if(w=w.filter(function(N){return!(N instanceof this.constructor)},this),S.length!==0)Y(k.children===null),k.children=S,S.forEach(function(N){N._baseState.parent=this},this);if(w.length!==0)Y(k.args===null),k.args=w,k.reverseArgs=w.map(function(N){if(typeof N!=="object"||N.constructor!==Object)return N;var h={};return Object.keys(N).forEach(function(C){if(C==(C|0))C|=0;var I=N[C];h[I]=C}),h})},T.forEach(function(w){H.prototype[w]=function(){var k=this._baseState;throw Error(w+" not implemented for encoding: "+k.enc)}}),O.forEach(function(w){H.prototype[w]=function(){var k=this._baseState,S=Array.prototype.slice.call(arguments);return Y(k.tag===null),k.tag=w,this._useArgs(S),this}}),H.prototype.use=function(w){Y(w);var k=this._baseState;return Y(k.use===null),k.use=w,this},H.prototype.optional=function(){var w=this._baseState;return w.optional=!0,this},H.prototype.def=function(w){var k=this._baseState;return Y(k.default===null),k.default=w,k.optional=!0,this},H.prototype.explicit=function(w){var k=this._baseState;return Y(k.explicit===null&&k.implicit===null),k.explicit=w,this},H.prototype.implicit=function(w){var k=this._baseState;return Y(k.explicit===null&&k.implicit===null),k.implicit=w,this},H.prototype.obj=function(){var w=this._baseState,k=Array.prototype.slice.call(arguments);if(w.obj=!0,k.length!==0)this._useArgs(k);return this},H.prototype.key=function(w){var k=this._baseState;return Y(k.key===null),k.key=w,this},H.prototype.any=function(){var w=this._baseState;return w.any=!0,this},H.prototype.choice=function(w){var k=this._baseState;return Y(k.choice===null),k.choice=w,this._useArgs(Object.keys(w).map(function(S){return w[S]})),this},H.prototype.contains=function(w){var k=this._baseState;return Y(k.use===null),k.contains=w,this},H.prototype._decode=function(w,k){var S=this._baseState;if(S.parent===null)return w.wrapResult(S.children[0]._decode(w,k));var N=S.default,h=!0,C=null;if(S.key!==null)C=w.enterKey(S.key);if(S.optional){var I=null;if(S.explicit!==null)I=S.explicit;else if(S.implicit!==null)I=S.implicit;else if(S.tag!==null)I=S.tag;if(I===null&&!S.any){var D=w.save();try{if(S.choice===null)this._decodeGeneric(S.tag,w,k);else this._decodeChoice(w,k);h=!0}catch(s){h=!1}w.restore(D)}else if(h=this._peekTag(w,I,S.any),w.isError(h))return h}var L;if(S.obj&&h)L=w.enterObject();if(h){if(S.explicit!==null){var g=this._decodeTag(w,S.explicit);if(w.isError(g))return g;w=g}var y=w.offset;if(S.use===null&&S.choice===null){if(S.any)var D=w.save();var c=this._decodeTag(w,S.implicit!==null?S.implicit:S.tag,S.any);if(w.isError(c))return c;if(S.any)N=w.raw(D);else w=c}if(k&&k.track&&S.tag!==null)k.track(w.path(),y,w.length,"tagged");if(k&&k.track&&S.tag!==null)k.track(w.path(),w.offset,w.length,"content");if(S.any)N=N;else if(S.choice===null)N=this._decodeGeneric(S.tag,w,k);else N=this._decodeChoice(w,k);if(w.isError(N))return N;if(!S.any&&S.choice===null&&S.children!==null)S.children.forEach(function(s){s._decode(w,k)});if(S.contains&&(S.tag==="octstr"||S.tag==="bitstr")){var o=new P(N);N=this._getUse(S.contains,w._reporterState.obj)._decode(o,k)}}if(S.obj&&h)N=w.leaveObject(L);if(S.key!==null&&(N!==null||h===!0))w.leaveKey(C,S.key,N);else if(C!==null)w.exitKey(C);return N},H.prototype._decodeGeneric=function(w,k,S){var N=this._baseState;if(w==="seq"||w==="set")return null;if(w==="seqof"||w==="setof")return this._decodeList(k,w,N.args[0],S);else if(/str$/.test(w))return this._decodeStr(k,w,S);else if(w==="objid"&&N.args)return this._decodeObjid(k,N.args[0],N.args[1],S);else if(w==="objid")return this._decodeObjid(k,null,null,S);else if(w==="gentime"||w==="utctime")return this._decodeTime(k,w,S);else if(w==="null_")return this._decodeNull(k,S);else if(w==="bool")return this._decodeBool(k,S);else if(w==="objDesc")return this._decodeStr(k,w,S);else if(w==="int"||w==="enum")return this._decodeInt(k,N.args&&N.args[0],S);if(N.use!==null)return this._getUse(N.use,k._reporterState.obj)._decode(k,S);else return k.error("unknown tag: "+w)},H.prototype._getUse=function(w,k){var S=this._baseState;if(S.useDecoder=this._use(w,k),Y(S.useDecoder._baseState.parent===null),S.useDecoder=S.useDecoder._baseState.children[0],S.implicit!==S.useDecoder._baseState.implicit)S.useDecoder=S.useDecoder.clone(),S.useDecoder._baseState.implicit=S.implicit;return S.useDecoder},H.prototype._decodeChoice=function(w,k){var S=this._baseState,N=null,h=!1;if(Object.keys(S.choice).some(function(C){var I=w.save(),D=S.choice[C];try{var L=D._decode(w,k);if(w.isError(L))return!1;N={type:C,value:L},h=!0}catch(g){return w.restore(I),!1}return!0},this),!h)return w.error("Choice not matched");return N},H.prototype._createEncoderBuffer=function(w){return new K(w,this.reporter)},H.prototype._encode=function(w,k,S){var N=this._baseState;if(N.default!==null&&N.default===w)return;var h=this._encodeValue(w,k,S);if(h===void 0)return;if(this._skipDefault(h,k,S))return;return h},H.prototype._encodeValue=function(w,k,S){var N=this._baseState;if(N.parent===null)return N.children[0]._encode(w,k||new _);var D=null;if(this.reporter=k,N.optional&&w===void 0)if(N.default!==null)w=N.default;else return;var h=null,C=!1;if(N.any)D=this._createEncoderBuffer(w);else if(N.choice)D=this._encodeChoice(w,k);else if(N.contains)h=this._getUse(N.contains,S)._encode(w,k),C=!0;else if(N.children)h=N.children.map(function(y){if(y._baseState.tag==="null_")return y._encode(null,k,w);if(y._baseState.key===null)return k.error("Child should have a key");var c=k.enterKey(y._baseState.key);if(typeof w!=="object")return k.error("Child expected, but input is not object");var o=y._encode(w[y._baseState.key],k,w);return k.leaveKey(c),o},this).filter(function(y){return y}),h=this._createEncoderBuffer(h);else if(N.tag==="seqof"||N.tag==="setof"){if(!(N.args&&N.args.length===1))return k.error("Too many args for : "+N.tag);if(!Array.isArray(w))return k.error("seqof/setof, but data is not Array");var I=this.clone();I._baseState.implicit=null,h=this._createEncoderBuffer(w.map(function(y){var c=this._baseState;return this._getUse(c.args[0],w)._encode(y,k)},I))}else if(N.use!==null)D=this._getUse(N.use,S)._encode(w,k);else h=this._encodePrimitive(N.tag,w),C=!0;var D;if(!N.any&&N.choice===null){var L=N.implicit!==null?N.implicit:N.tag,g=N.implicit===null?"universal":"context";if(L===null){if(N.use===null)k.error("Tag could be omitted only for .use()")}else if(N.use===null)D=this._encodeComposite(L,C,g,h)}if(N.explicit!==null)D=this._encodeComposite(N.explicit,!1,"context",D);return D},H.prototype._encodeChoice=function(w,k){var S=this._baseState,N=S.choice[w.type];if(!N)Y(!1,w.type+" not found in "+JSON.stringify(Object.keys(S.choice)));return N._encode(w.value,k)},H.prototype._encodePrimitive=function(w,k){var S=this._baseState;if(/str$/.test(w))return this._encodeStr(k,w);else if(w==="objid"&&S.args)return this._encodeObjid(k,S.reverseArgs[0],S.args[1]);else if(w==="objid")return this._encodeObjid(k,null,null);else if(w==="gentime"||w==="utctime")return this._encodeTime(k,w);else if(w==="null_")return this._encodeNull();else if(w==="int"||w==="enum")return this._encodeInt(k,S.args&&S.reverseArgs[0]);else if(w==="bool")return this._encodeBool(k);else if(w==="objDesc")return this._encodeStr(k,w);else throw Error("Unsupported tag: "+w)},H.prototype._isNumstr=function(w){return/^[0-9 ]*$/.test(w)},H.prototype._isPrintstr=function(w){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(w)}}),$1=T$(($)=>{var q=$;q.Reporter=$B().Reporter,q.DecoderBuffer=s0().DecoderBuffer,q.EncoderBuffer=s0().EncoderBuffer,q.Node=qB()}),_B=T$(($)=>{var q=AM();$.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)}),AM=T$(($)=>{var q=$;q._reverse=function(_){var K={};return Object.keys(_).forEach(function(P){if((P|0)==P)P=P|0;var Y=_[P];K[Y]=P}),K},q.der=_B()}),kM=T$(($,q)=>{var _=v8(),K=Y1(),P=K.base,Y=K.bignum,O=K.constants.der;function z(w){this.enc="der",this.name=w.name,this.entity=w,this.tree=new T,this.tree._init(w.body)}q.exports=z,z.prototype.decode=function(w,k){if(!(w instanceof P.DecoderBuffer))w=new P.DecoderBuffer(w,k);return this.tree._decode(w,k)};function T(w){P.Node.call(this,"der",w)}_(T,P.Node),T.prototype._peekTag=function(w,k,S){if(w.isEmpty())return!1;var N=w.save(),h=H(w,'Failed to peek tag: "'+k+'"');if(w.isError(h))return h;return w.restore(N),h.tag===k||h.tagStr===k||h.tagStr+"of"===k||S},T.prototype._decodeTag=function(w,k,S){var N=H(w,'Failed to decode tag of "'+k+'"');if(w.isError(N))return N;var h=f(w,N.primitive,'Failed to get length of "'+k+'"');if(w.isError(h))return h;if(!S&&N.tag!==k&&N.tagStr!==k&&N.tagStr+"of"!==k)return w.error('Failed to match tag: "'+k+'"');if(N.primitive||h!==null)return w.skip(h,'Failed to match body of: "'+k+'"');var C=w.save(),I=this._skipUntilEnd(w,'Failed to skip indefinite length body: "'+this.tag+'"');if(w.isError(I))return I;return h=w.offset-C.offset,w.restore(C),w.skip(h,'Failed to match body of: "'+k+'"')},T.prototype._skipUntilEnd=function(w,k){while(!0){var S=H(w,k);if(w.isError(S))return S;var N=f(w,S.primitive,k);if(w.isError(N))return N;var h;if(S.primitive||N!==null)h=w.skip(N);else h=this._skipUntilEnd(w,k);if(w.isError(h))return h;if(S.tagStr==="end")break}},T.prototype._decodeList=function(w,k,S,N){var h=[];while(!w.isEmpty()){var C=this._peekTag(w,"end");if(w.isError(C))return C;var I=S.decode(w,"der",N);if(w.isError(I)&&C)break;h.push(I)}return h},T.prototype._decodeStr=function(w,k){if(k==="bitstr"){var S=w.readUInt8();if(w.isError(S))return S;return{unused:S,data:w.raw()}}else if(k==="bmpstr"){var N=w.raw();if(N.length%2===1)return w.error("Decoding of string type: bmpstr length mismatch");var h="";for(var C=0;C<N.length/2;C++)h+=String.fromCharCode(N.readUInt16BE(C*2));return h}else if(k==="numstr"){var I=w.raw().toString("ascii");if(!this._isNumstr(I))return w.error("Decoding of string type: numstr unsupported characters");return I}else if(k==="octstr")return w.raw();else if(k==="objDesc")return w.raw();else if(k==="printstr"){var D=w.raw().toString("ascii");if(!this._isPrintstr(D))return w.error("Decoding of string type: printstr unsupported characters");return D}else if(/str$/.test(k))return w.raw().toString();else return w.error("Decoding of string type: "+k+" unsupported")},T.prototype._decodeObjid=function(w,k,S){var N,h=[],C=0;while(!w.isEmpty()){var I=w.readUInt8();if(C<<=7,C|=I&127,(I&128)===0)h.push(C),C=0}if(I&128)h.push(C);var D=h[0]/40|0,L=h[0]%40;if(S)N=h;else N=[D,L].concat(h.slice(1));if(k){var g=k[N.join(" ")];if(g===void 0)g=k[N.join(".")];if(g!==void 0)N=g}return N},T.prototype._decodeTime=function(w,k){var S=w.raw().toString();if(k==="gentime")var N=S.slice(0,4)|0,h=S.slice(4,6)|0,C=S.slice(6,8)|0,I=S.slice(8,10)|0,D=S.slice(10,12)|0,L=S.slice(12,14)|0;else if(k==="utctime"){var N=S.slice(0,2)|0,h=S.slice(2,4)|0,C=S.slice(4,6)|0,I=S.slice(6,8)|0,D=S.slice(8,10)|0,L=S.slice(10,12)|0;if(N<70)N=2000+N;else N=1900+N}else return w.error("Decoding "+k+" time is not supported yet");return Date.UTC(N,h-1,C,I,D,L,0)},T.prototype._decodeNull=function(w){return null},T.prototype._decodeBool=function(w){var k=w.readUInt8();if(w.isError(k))return k;else return k!==0},T.prototype._decodeInt=function(w,k){var S=w.raw(),N=new Y(S);if(k)N=k[N.toString(10)]||N;return N},T.prototype._use=function(w,k){if(typeof w==="function")w=w(k);return w._getDecoder("der").tree};function H(w,k){var S=w.readUInt8(k);if(w.isError(S))return S;var N=O.tagClass[S>>6],h=(S&32)===0;if((S&31)===31){var C=S;S=0;while((C&128)===128){if(C=w.readUInt8(k),w.isError(C))return C;S<<=7,S|=C&127}}else S&=31;var I=O.tag[S];return{cls:N,primitive:h,tag:S,tagStr:I}}function f(w,k,S){var N=w.readUInt8(S);if(w.isError(N))return N;if(!k&&N===128)return null;if((N&128)===0)return N;var h=N&127;if(h>4)return w.error("length octect is too long");N=0;for(var C=0;C<h;C++){N<<=8;var I=w.readUInt8(S);if(w.isError(I))return I;N|=I}return N}}),KB=T$(($,q)=>{var _=v8(),K=(wq(),J6(Tq)).Buffer,P=kM();function Y(O){P.call(this,O),this.enc="pem"}_(Y,P),q.exports=Y,Y.prototype.decode=function(O,z){var T=O.toString().split(/[\r\n]+/g),H=z.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,w=-1,k=-1;for(var S=0;S<T.length;S++){var N=T[S].match(f);if(N===null)continue;if(N[2]!==H)continue;if(w===-1){if(N[1]!=="BEGIN")break;w=S}else{if(N[1]!=="END")break;k=S;break}}if(w===-1||k===-1)throw Error("PEM section not found for: "+H);var h=T.slice(w+1,k).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var C=new K(h,"base64");return P.prototype.decode.call(this,C,z)}}),PB=T$(($)=>{var q=$;q.der=kM(),q.pem=KB()}),GM=T$(($,q)=>{var _=v8(),K=(wq(),J6(Tq)).Buffer,P=Y1(),Y=P.base,O=P.constants.der;function z(w){this.enc="der",this.name=w.name,this.entity=w,this.tree=new T,this.tree._init(w.body)}q.exports=z,z.prototype.encode=function(w,k){return this.tree._encode(w,k).join()};function T(w){Y.Node.call(this,"der",w)}_(T,Y.Node),T.prototype._encodeComposite=function(w,k,S,N){var h=f(w,k,S,this.reporter);if(N.length<128){var D=new K(2);return D[0]=h,D[1]=N.length,this._createEncoderBuffer([D,N])}var C=1;for(var I=N.length;I>=256;I>>=8)C++;var D=new K(2+C);D[0]=h,D[1]=128|C;for(var I=1+C,L=N.length;L>0;I--,L>>=8)D[I]=L&255;return this._createEncoderBuffer([D,N])},T.prototype._encodeStr=function(w,k){if(k==="bitstr")return this._createEncoderBuffer([w.unused|0,w.data]);else if(k==="bmpstr"){var S=new K(w.length*2);for(var N=0;N<w.length;N++)S.writeUInt16BE(w.charCodeAt(N),N*2);return this._createEncoderBuffer(S)}else if(k==="numstr"){if(!this._isNumstr(w))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(w)}else if(k==="printstr"){if(!this._isPrintstr(w))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(w)}else if(/str$/.test(k))return this._createEncoderBuffer(w);else if(k==="objDesc")return this._createEncoderBuffer(w);else return this.reporter.error("Encoding of string type: "+k+" unsupported")},T.prototype._encodeObjid=function(w,k,S){if(typeof w==="string"){if(!k)return this.reporter.error("string objid given, but no values map found");if(!k.hasOwnProperty(w))return this.reporter.error("objid not found in values map");w=k[w].split(/[\s\.]+/g);for(var N=0;N<w.length;N++)w[N]|=0}else if(Array.isArray(w)){w=w.slice();for(var N=0;N<w.length;N++)w[N]|=0}if(!Array.isArray(w))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(w));if(!S){if(w[1]>=40)return this.reporter.error("Second objid identifier OOB");w.splice(0,2,w[0]*40+w[1])}var h=0;for(var N=0;N<w.length;N++){var C=w[N];for(h++;C>=128;C>>=7)h++}var I=new K(h),D=I.length-1;for(var N=w.length-1;N>=0;N--){var C=w[N];I[D--]=C&127;while((C>>=7)>0)I[D--]=128|C&127}return this._createEncoderBuffer(I)};function H(w){if(w<10)return"0"+w;else return w}T.prototype._encodeTime=function(w,k){var S,N=new Date(w);if(k==="gentime")S=[H(N.getFullYear()),H(N.getUTCMonth()+1),H(N.getUTCDate()),H(N.getUTCHours()),H(N.getUTCMinutes()),H(N.getUTCSeconds()),"Z"].join("");else if(k==="utctime")S=[H(N.getFullYear()%100),H(N.getUTCMonth()+1),H(N.getUTCDate()),H(N.getUTCHours()),H(N.getUTCMinutes()),H(N.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+k+" time is not supported yet");return this._encodeStr(S,"octstr")},T.prototype._encodeNull=function(){return this._createEncoderBuffer("")},T.prototype._encodeInt=function(w,k){if(typeof w==="string"){if(!k)return this.reporter.error("String int or enum given, but no values map");if(!k.hasOwnProperty(w))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(w));w=k[w]}if(typeof w!=="number"&&!K.isBuffer(w)){var S=w.toArray();if(!w.sign&&S[0]&128)S.unshift(0);w=new K(S)}if(K.isBuffer(w)){var N=w.length;if(w.length===0)N++;var C=new K(N);if(w.copy(C),w.length===0)C[0]=0;return this._createEncoderBuffer(C)}if(w<128)return this._createEncoderBuffer(w);if(w<256)return this._createEncoderBuffer([0,w]);var N=1;for(var h=w;h>=256;h>>=8)N++;var C=Array(N);for(var h=C.length-1;h>=0;h--)C[h]=w&255,w>>=8;if(C[0]&128)C.unshift(0);return this._createEncoderBuffer(new K(C))},T.prototype._encodeBool=function(w){return this._createEncoderBuffer(w?255:0)},T.prototype._use=function(w,k){if(typeof w==="function")w=w(k);return w._getEncoder("der").tree},T.prototype._skipDefault=function(w,k,S){var N=this._baseState,h;if(N.default===null)return!1;var C=w.join();if(N.defaultBuffer===void 0)N.defaultBuffer=this._encodeValue(N.default,k,S).join();if(C.length!==N.defaultBuffer.length)return!1;for(h=0;h<C.length;h++)if(C[h]!==N.defaultBuffer[h])return!1;return!0};function f(w,k,S,N){var h;if(w==="seqof")w="seq";else if(w==="setof")w="set";if(O.tagByName.hasOwnProperty(w))h=O.tagByName[w];else if(typeof w==="number"&&(w|0)===w)h=w;else return N.error("Unknown tag: "+w);if(h>=31)return N.error("Multi-octet tag encoding unsupported");if(!k)h|=32;return h|=O.tagClassByName[S||"universal"]<<6,h}}),YB=T$(($,q)=>{var _=v8(),K=GM();function P(Y){K.call(this,Y),this.enc="pem"}_(P,K),q.exports=P,P.prototype.encode=function(Y,O){var z=K.prototype.encode.call(this,Y),T=z.toString("base64"),H=["-----BEGIN "+O.label+"-----"];for(var f=0;f<T.length;f+=64)H.push(T.slice(f,f+64));return H.push("-----END "+O.label+"-----"),H.join(`
37
- `)}}),OB=T$(($)=>{var q=$;q.der=GM(),q.pem=YB()}),Y1=T$(($)=>{var q=$;q.bignum=ei(),q.define=si().define,q.base=$1(),q.constants=AM(),q.decoders=PB(),q.encoders=OB()}),jB=T$(($,q)=>{var _=Y1(),K=_.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),P=_.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Y=_.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),O=_.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Y),this.key("subjectPublicKey").bitstr())}),z=_.define("RelativeDistinguishedName",function(){this.setof(P)}),T=_.define("RDNSequence",function(){this.seqof(z)}),H=_.define("Name",function(){this.choice({rdnSequence:this.use(T)})}),f=_.define("Validity",function(){this.seq().obj(this.key("notBefore").use(K),this.key("notAfter").use(K))}),w=_.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),k=_.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Y),this.key("issuer").use(H),this.key("validity").use(f),this.key("subject").use(H),this.key("subjectPublicKeyInfo").use(O),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(w).optional())}),S=_.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(k),this.key("signatureAlgorithm").use(Y),this.key("signatureValue").bitstr())});q.exports=S}),vB=T$(($)=>{var q=Y1();$.certificate=jB();var _=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=_;var K=q.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=K;var P=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())}),Y=q.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(P),this.key("subjectPublicKey").bitstr())});$.PublicKey=Y;var O=q.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(P),this.key("subjectPrivateKey").octstr())});$.PrivateKey=O;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 T=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=T,$.DSAparam=q.define("DSAparam",function(){this.int()});var H=q.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),f=q.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(H),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=f,$.signature=q.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),zB=T$(($,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"}}),WB=T$(($,q)=>{var _=mq().Buffer,K=XH().Transform,P=v8();function Y(H){K.call(this),this._block=_.allocUnsafe(H),this._blockSize=H,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}P(Y,K),Y.prototype._transform=function(H,f,w){var k=null;try{this.update(H,f)}catch(S){k=S}w(k)},Y.prototype._flush=function(H){var f=null;try{this.push(this.digest())}catch(w){f=w}H(f)};var O=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(_.prototype instanceof Uint8Array||_.TYPED_ARRAY_SUPPORT);function T(H,f){if(H instanceof _)return H;if(typeof H==="string")return _.from(H,f);if(z&&ArrayBuffer.isView(H)){if(H.byteLength===0)return _.alloc(0);var w=_.from(H.buffer,H.byteOffset,H.byteLength);if(w.byteLength===H.byteLength)return w}if(O&&H instanceof Uint8Array)return _.from(H);if(_.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return _.from(H);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Y.prototype.update=function(H,f){if(this._finalized)throw Error("Digest already called");H=T(H,f);var w=this._block,k=0;while(this._blockOffset+H.length-k>=this._blockSize){for(var S=this._blockOffset;S<this._blockSize;)w[S++]=H[k++];this._update(),this._blockOffset=0}while(k<H.length)w[this._blockOffset++]=H[k++];for(var N=0,h=H.length*8;h>0;++N)if(this._length[N]+=h,h=this._length[N]/4294967296|0,h>0)this._length[N]-=4294967296*h;return this},Y.prototype._update=function(){throw Error("_update is not implemented")},Y.prototype.digest=function(H){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var f=this._digest();if(H!==void 0)f=f.toString(H);this._block.fill(0),this._blockOffset=0;for(var w=0;w<4;++w)this._length[w]=0;return f},Y.prototype._digest=function(){throw Error("_digest is not implemented")},q.exports=Y}),JB=T$(($,q)=>{var _=v8(),K=WB(),P=mq().Buffer,Y=Array(16);function O(){K.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}_(O,K),O.prototype._update=function(){var k=Y;for(var S=0;S<16;++S)k[S]=this._block.readInt32LE(S*4);var N=this._a,h=this._b,C=this._c,I=this._d;N=T(N,h,C,I,k[0],3614090360,7),I=T(I,N,h,C,k[1],3905402710,12),C=T(C,I,N,h,k[2],606105819,17),h=T(h,C,I,N,k[3],3250441966,22),N=T(N,h,C,I,k[4],4118548399,7),I=T(I,N,h,C,k[5],1200080426,12),C=T(C,I,N,h,k[6],2821735955,17),h=T(h,C,I,N,k[7],4249261313,22),N=T(N,h,C,I,k[8],1770035416,7),I=T(I,N,h,C,k[9],2336552879,12),C=T(C,I,N,h,k[10],4294925233,17),h=T(h,C,I,N,k[11],2304563134,22),N=T(N,h,C,I,k[12],1804603682,7),I=T(I,N,h,C,k[13],4254626195,12),C=T(C,I,N,h,k[14],2792965006,17),h=T(h,C,I,N,k[15],1236535329,22),N=H(N,h,C,I,k[1],4129170786,5),I=H(I,N,h,C,k[6],3225465664,9),C=H(C,I,N,h,k[11],643717713,14),h=H(h,C,I,N,k[0],3921069994,20),N=H(N,h,C,I,k[5],3593408605,5),I=H(I,N,h,C,k[10],38016083,9),C=H(C,I,N,h,k[15],3634488961,14),h=H(h,C,I,N,k[4],3889429448,20),N=H(N,h,C,I,k[9],568446438,5),I=H(I,N,h,C,k[14],3275163606,9),C=H(C,I,N,h,k[3],4107603335,14),h=H(h,C,I,N,k[8],1163531501,20),N=H(N,h,C,I,k[13],2850285829,5),I=H(I,N,h,C,k[2],4243563512,9),C=H(C,I,N,h,k[7],1735328473,14),h=H(h,C,I,N,k[12],2368359562,20),N=f(N,h,C,I,k[5],4294588738,4),I=f(I,N,h,C,k[8],2272392833,11),C=f(C,I,N,h,k[11],1839030562,16),h=f(h,C,I,N,k[14],4259657740,23),N=f(N,h,C,I,k[1],2763975236,4),I=f(I,N,h,C,k[4],1272893353,11),C=f(C,I,N,h,k[7],4139469664,16),h=f(h,C,I,N,k[10],3200236656,23),N=f(N,h,C,I,k[13],681279174,4),I=f(I,N,h,C,k[0],3936430074,11),C=f(C,I,N,h,k[3],3572445317,16),h=f(h,C,I,N,k[6],76029189,23),N=f(N,h,C,I,k[9],3654602809,4),I=f(I,N,h,C,k[12],3873151461,11),C=f(C,I,N,h,k[15],530742520,16),h=f(h,C,I,N,k[2],3299628645,23),N=w(N,h,C,I,k[0],4096336452,6),I=w(I,N,h,C,k[7],1126891415,10),C=w(C,I,N,h,k[14],2878612391,15),h=w(h,C,I,N,k[5],4237533241,21),N=w(N,h,C,I,k[12],1700485571,6),I=w(I,N,h,C,k[3],2399980690,10),C=w(C,I,N,h,k[10],4293915773,15),h=w(h,C,I,N,k[1],2240044497,21),N=w(N,h,C,I,k[8],1873313359,6),I=w(I,N,h,C,k[15],4264355552,10),C=w(C,I,N,h,k[6],2734768916,15),h=w(h,C,I,N,k[13],1309151649,21),N=w(N,h,C,I,k[4],4149444226,6),I=w(I,N,h,C,k[11],3174756917,10),C=w(C,I,N,h,k[2],718787259,15),h=w(h,C,I,N,k[9],3951481745,21),this._a=this._a+N|0,this._b=this._b+h|0,this._c=this._c+C|0,this._d=this._d+I|0},O.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 k=P.allocUnsafe(16);return k.writeInt32LE(this._a,0),k.writeInt32LE(this._b,4),k.writeInt32LE(this._c,8),k.writeInt32LE(this._d,12),k};function z(k,S){return k<<S|k>>>32-S}function T(k,S,N,h,C,I,D){return z(k+(S&N|~S&h)+C+I|0,D)+S|0}function H(k,S,N,h,C,I,D){return z(k+(S&h|N&~h)+C+I|0,D)+S|0}function f(k,S,N,h,C,I,D){return z(k+(S^N^h)+C+I|0,D)+S|0}function w(k,S,N,h,C,I,D){return z(k+(N^(S|~h))+C+I|0,D)+S|0}q.exports=O}),HB=T$(($,q)=>{var _=mq().Buffer,K=JB();function P(Y,O,z,T){if(!_.isBuffer(Y))Y=_.from(Y,"binary");if(O){if(!_.isBuffer(O))O=_.from(O,"binary");if(O.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var H=z/8,f=_.alloc(H),w=_.alloc(T||0),k=_.alloc(0);while(H>0||T>0){var S=new K;if(S.update(k),S.update(Y),O)S.update(O);k=S.digest();var N=0;if(H>0){var h=f.length-H;N=Math.min(H,k.length),k.copy(f,h,0,N),H-=N}if(N<k.length&&T>0){var C=w.length-T,I=Math.min(T,k.length-N);k.copy(w,C,N,N+I),T-=I}}return k.fill(0),{key:f,iv:w}}q.exports=P}),VM=T$(($)=>{var q=(lq(),J6(dq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),TB=T$(($,q)=>{var _=/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,K=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,P=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,Y=HB(),O=VM(),z=mq().Buffer;q.exports=function(T,H){var f=T.toString(),w=f.match(_),k;if(!w){var S=f.match(P);k=z.from(S[2].replace(/[\r\n]/g,""),"base64")}else{var N="aes"+w[1],h=z.from(w[2],"hex"),C=z.from(w[3].replace(/[\r\n]/g,""),"base64"),I=Y(H,h.slice(0,8),parseInt(w[1],10)).key,D=[],L=O.createDecipheriv(N,I,h);D.push(L.update(C)),D.push(L.final()),k=z.concat(D)}var g=f.match(K)[1];return{tag:g,data:k}}}),SM=T$(($,q)=>{var _=vB(),K=zB(),P=TB(),Y=VM(),O=JM().pbkdf2Sync,z=mq().Buffer;function T(f,w){var k=f.algorithm.decrypt.kde.kdeparams.salt,S=parseInt(f.algorithm.decrypt.kde.kdeparams.iters.toString(),10),N=K[f.algorithm.decrypt.cipher.algo.join(".")],h=f.algorithm.decrypt.cipher.iv,C=f.subjectPrivateKey,I=parseInt(N.split("-")[1],10)/8,D=O(w,k,S,I,"sha1"),L=Y.createDecipheriv(N,D,h),g=[];return g.push(L.update(C)),g.push(L.final()),z.concat(g)}function H(f){var w;if(typeof f==="object"&&!z.isBuffer(f))w=f.passphrase,f=f.key;if(typeof f==="string")f=z.from(f);var k=P(f,w),S=k.tag,N=k.data,h,C;switch(S){case"CERTIFICATE":C=_.certificate.decode(N,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!C)C=_.PublicKey.decode(N,"der");switch(h=C.algorithm.algorithm.join("."),h){case"1.2.840.113549.1.1.1":return _.RSAPublicKey.decode(C.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return C.subjectPrivateKey=C.subjectPublicKey,{type:"ec",data:C};case"1.2.840.10040.4.1":return C.algorithm.params.pub_key=_.DSAparam.decode(C.subjectPublicKey.data,"der"),{type:"dsa",data:C.algorithm.params};default:throw Error("unknown key id "+h)}case"ENCRYPTED PRIVATE KEY":N=_.EncryptedPrivateKey.decode(N,"der"),N=T(N,w);case"PRIVATE KEY":switch(C=_.PrivateKey.decode(N,"der"),h=C.algorithm.algorithm.join("."),h){case"1.2.840.113549.1.1.1":return _.RSAPrivateKey.decode(C.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:C.algorithm.curve,privateKey:_.ECPrivateKey.decode(C.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return C.algorithm.params.priv_key=_.DSAparam.decode(C.subjectPrivateKey,"der"),{type:"dsa",params:C.algorithm.params};default:throw Error("unknown key id "+h)}case"RSA PUBLIC KEY":return _.RSAPublicKey.decode(N,"der");case"RSA PRIVATE KEY":return _.RSAPrivateKey.decode(N,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:_.DSAPrivateKey.decode(N,"der")};case"EC PRIVATE KEY":return N=_.ECPrivateKey.decode(N,"der"),{curve:N.parameters.value,privateKey:N.privateKey};default:throw Error("unknown key type "+S)}}H.signature=_.signature,q.exports=H}),MM=T$(($,q)=>{var _=V2(),K=mq().Buffer;q.exports=function(Y,O){var z=K.alloc(0),T=0,H;while(z.length<O)H=P(T++),z=K.concat([z,_("sha1").update(Y).update(H).digest()]);return z.slice(0,O)};function P(Y){var O=K.allocUnsafe(4);return O.writeUInt32BE(Y,0),O}}),NM=T$(($,q)=>{q.exports=function(_,K){var P=_.length,Y=-1;while(++Y<P)_[Y]^=K[Y];return _}}),hH=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,V,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(V=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(V=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=V<<M&67108863,this.words[Z+1]=V>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,V=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[V]|=M&67108863,Z>=18)Z-=18,V+=1,this.words[V]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,V=Math.min(j.length,X);for(var M=W;M<V;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var V=j.length-X,M=V%J,A=Math.min(V,V-M)+X,v=0;for(var G=X;G<A;G+=J)if(v=f(j,G,G+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,G,j.length,W);for(G=0;G<M;G++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var V=0;V<this.length;V++){var M=this.words[V],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,V--;if(Z!==0||V!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],G=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(G).toString(j);if(R=R.idivn(G),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var V=W==="le",M=new j(Z),A,v,G=this.clone();if(!V){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[Z-v-1]=A}else{for(v=0;!G.isZero();v++)A=G.andln(255),G.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var V=0;V<J.length;V++)W=(X.words[V]|0)+(J.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;for(;Z!==0&&V<X.length;V++)W=(X.words[V]|0)+Z,this.words[V]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;V<X.length;V++)this.words[V]=X.words[V];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var V=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;for(;V!==0&&M<J.length;M++)W=(J.words[M]|0)+V,V=W>>26,this.words[M]=W&67108863;if(V===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,V=W.words[0]|0,M=Z*V,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var G=1;G<J;G++){var R=v>>>26,E=v&67108863,b=Math.min(G,W.length-1);for(var x=Math.max(0,G-j.length+1);x<=b;x++){var l=G-x|0;Z=j.words[l]|0,V=W.words[x]|0,M=Z*V+E,R+=M/67108864|0,E=M&67108863}X.words[G]=E|0,v=R|0}if(v!==0)X.words[G]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,V=X.words,M=0,A,v,G,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,Q=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,e=v$&8191,P$=v$>>>13,o$=J[4]|0,m=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,G=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(Q,M$)|0,G=Math.imul(Q,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,G=G+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,G=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(Q,E$)|0,G=G+Math.imul(Q,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,G=G+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(e,M$),v=Math.imul(e,S$),v=v+Math.imul(P$,M$)|0,G=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,G=G+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(Q,g$)|0,G=G+Math.imul(Q,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,G=G+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(m,M$),v=Math.imul(m,S$),v=v+Math.imul(r,M$)|0,G=Math.imul(r,S$),A=A+Math.imul(e,E$)|0,v=v+Math.imul(e,b$)|0,v=v+Math.imul(P$,E$)|0,G=G+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,G=G+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(Q,y$)|0,G=G+Math.imul(Q,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,G=G+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,G=Math.imul(_$,S$),A=A+Math.imul(m,E$)|0,v=v+Math.imul(m,b$)|0,v=v+Math.imul(r,E$)|0,G=G+Math.imul(r,b$)|0,A=A+Math.imul(e,g$)|0,v=v+Math.imul(e,h$)|0,v=v+Math.imul(P$,g$)|0,G=G+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,G=G+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(Q,u$)|0,G=G+Math.imul(Q,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,G=G+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,G=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,G=G+Math.imul(_$,b$)|0,A=A+Math.imul(m,g$)|0,v=v+Math.imul(m,h$)|0,v=v+Math.imul(r,g$)|0,G=G+Math.imul(r,h$)|0,A=A+Math.imul(e,y$)|0,v=v+Math.imul(e,R$)|0,v=v+Math.imul(P$,y$)|0,G=G+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,G=G+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(Q,I$)|0,G=G+Math.imul(Q,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,G=G+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,G=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,G=G+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,G=G+Math.imul(_$,h$)|0,A=A+Math.imul(m,y$)|0,v=v+Math.imul(m,R$)|0,v=v+Math.imul(r,y$)|0,G=G+Math.imul(r,R$)|0,A=A+Math.imul(e,u$)|0,v=v+Math.imul(e,x$)|0,v=v+Math.imul(P$,u$)|0,G=G+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,G=G+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(Q,K$)|0,G=G+Math.imul(Q,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,G=G+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,G=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,G=G+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,G=G+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,G=G+Math.imul(_$,R$)|0,A=A+Math.imul(m,u$)|0,v=v+Math.imul(m,x$)|0,v=v+Math.imul(r,u$)|0,G=G+Math.imul(r,x$)|0,A=A+Math.imul(e,I$)|0,v=v+Math.imul(e,u)|0,v=v+Math.imul(P$,I$)|0,G=G+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,G=G+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(Q,G$)|0,G=G+Math.imul(Q,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,G=G+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,G=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,G=G+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,G=G+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,G=G+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,G=G+Math.imul(_$,x$)|0,A=A+Math.imul(m,I$)|0,v=v+Math.imul(m,u)|0,v=v+Math.imul(r,I$)|0,G=G+Math.imul(r,u)|0,A=A+Math.imul(e,K$)|0,v=v+Math.imul(e,Y$)|0,v=v+Math.imul(P$,K$)|0,G=G+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,G=G+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(Q,D$)|0,G=G+Math.imul(Q,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,G=G+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,G=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,G=G+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,G=G+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,G=G+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,G=G+Math.imul(_$,u)|0,A=A+Math.imul(m,K$)|0,v=v+Math.imul(m,Y$)|0,v=v+Math.imul(r,K$)|0,G=G+Math.imul(r,Y$)|0,A=A+Math.imul(e,G$)|0,v=v+Math.imul(e,V$)|0,v=v+Math.imul(P$,G$)|0,G=G+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,G=G+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(Q,L$)|0,G=G+Math.imul(Q,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,G=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,G=G+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,G=G+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,G=G+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,G=G+Math.imul(_$,Y$)|0,A=A+Math.imul(m,G$)|0,v=v+Math.imul(m,V$)|0,v=v+Math.imul(r,G$)|0,G=G+Math.imul(r,V$)|0,A=A+Math.imul(e,D$)|0,v=v+Math.imul(e,p$)|0,v=v+Math.imul(P$,D$)|0,G=G+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,G=G+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,G=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,G=G+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,G=G+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,G=G+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,G=G+Math.imul(_$,V$)|0,A=A+Math.imul(m,D$)|0,v=v+Math.imul(m,p$)|0,v=v+Math.imul(r,D$)|0,G=G+Math.imul(r,p$)|0,A=A+Math.imul(e,L$)|0,v=v+Math.imul(e,C$)|0,v=v+Math.imul(P$,L$)|0,G=G+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,G=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,G=G+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,G=G+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,G=G+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,G=G+Math.imul(_$,p$)|0,A=A+Math.imul(m,L$)|0,v=v+Math.imul(m,C$)|0,v=v+Math.imul(r,L$)|0,G=G+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,G=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,G=G+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,G=G+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,G=G+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,G=G+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,G=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,G=G+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,G=G+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,G=G+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,G=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,G=G+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,G=G+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,G=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,G=G+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(G+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,G=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(G+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,V[0]=c6,V[1]=W6,V[2]=j6,V[3]=E6,V[4]=M6,V[5]=t6,V[6]=U6,V[7]=F6,V[8]=Q6,V[9]=a6,V[10]=e6,V[11]=s6,V[12]=$q,V[13]=qq,V[14]=_q,V[15]=Kq,V[16]=Pq,V[17]=Yq,V[18]=Oq,M!==0)V[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var V=0;V<X.length-1;V++){var M=Z;Z=0;var A=J&67108863,v=Math.min(V,W.length-1);for(var G=Math.max(0,V-j.length+1);G<=v;G++){var R=V-G,E=j.words[R]|0,b=W.words[G]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[V]=A,J=M,M=Z}if(J!==0)X.words[V]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,V){for(var M=0;M<V;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,V){this.permute(V,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),G=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=G;for(var x=0;x<M;x++){var l=X[R+x],Q=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=Q+q$,X[R+x+M]=l-f$,J[R+x+M]=Q-q$,x!==A)B=v*E-G*b,b=v*b+G*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var V=0;V<W;V++)Z=Z+(j[V]|0),X[2*V]=Z&8191,Z=Z>>>13,X[2*V+1]=Z&8191,Z=Z>>>13;for(V=2*W;V<J;++V)X[V]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),V=this.stub(J),M=Array(J),A=Array(J),v=Array(J),G=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,G,J),this.transform(M,V,A,v,J,Z),this.transform(G,V,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,V,J,Z),this.conjugate(b,V,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var V=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|V,V=M>>>26-W}if(V)this.words[Z]=V,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,V=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=V,J=Math.max(0,J),A){for(var v=0;v<V;v++)A.words[v]=this.words[v];A.length=V}if(V===0);else if(this.length>V){this.length-=V;for(v=0;v<this.length;v++)this.words[v]=this.words[v+V]}else this.words[0]=0,this.length=1;var G=0;for(v=this.length-1;v>=0&&(G!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=G<<26-Z|R>>>Z,G=R&M}if(A&&G!==0)A.words[A.length++]=G;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var V,M=0;for(Z=0;Z<j.length;Z++){V=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;V-=A&67108863,M=(V>>26)-(A/67108864|0),this.words[Z+X]=V&67108863}for(;Z<this.length-X;Z++)V=(this.words[Z+X]|0)+M,M=V>>26,this.words[Z+X]=V&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)V=-(this.words[Z]|0)+M,M=V>>26,this.words[Z]=V&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,V=Z.words[Z.length-1]|0,M=this._countBits(V);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),V=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var G=0;G<v.length;G++)v.words[G]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/V|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,V;if(this.negative!==0&&j.negative===0){if(V=this.neg().divmod(j,W),W!=="mod")J=V.div.neg();if(W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(V=this.divmod(j.neg(),W),W!=="mod")J=V.div.neg();return{div:J,mod:V.mod}}if((this.negative&j.negative)!==0){if(V=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=V.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:V.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),V=X.cmp(J);if(V<0||Z===1&&V===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),G=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(G);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(V.isOdd()||M.isOdd())V.iadd(v),M.isub(G);V.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(V),Z.isub(M);else X.isub(W),V.isub(J),M.isub(Z)}return{a:V,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),V=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(V);J.iushrn(1)}}for(var v=0,G=1;(X.words[0]&G)===0&&v<26;++v,G<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(V);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var V=W;W=X,X=V}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var V=X;Z!==0&&V<this.length;V++){var M=this.words[V]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[V]=M}if(Z!==0)this.words[V]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new p(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function c(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(c,y),c.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var V=j.words[9];W.words[W.length++]=V&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|V>>>22,V=M}if(V>>>=22,j.words[Z-10]=V,V===0&&j.length>10)j.length-=10;else j.length-=9},c.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function F(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(F,y),F.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new c;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new F;else throw Error("Unknown prime "+j);return g[j]=W,W};function p(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}p.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},p.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},p.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},p.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},p.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},p.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},p.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},p.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},p.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},p.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},p.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},p.prototype.isqr=function(j){return this.imul(j,j.clone())},p.prototype.sqr=function(j){return this.mul(j,j)},p.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var V=new O(1).toRed(this),M=V.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var G=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(V)!==0){var x=E;for(var l=0;x.cmp(V)!==0;l++)x=x.redSqr();P(l<b);var Q=this.pow(G,new O(1).iushln(b-l-1));R=R.redMul(Q),G=Q.redSqr(),E=E.redMul(G),b=l}return R},p.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},p.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var V=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var G=W.words[Z];for(var R=v-1;R>=0;R--){var E=G>>R&1;if(V!==J[0])V=this.sqr(V);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;V=this.mul(V,J[M]),A=0,M=0}v=26}return V},p.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},p.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new a(j)};function a(j){if(p.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(a,p),a.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},a.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},a.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),V=Z;if(Z.cmp(this.m)>=0)V=Z.isub(this.m);else if(Z.cmpn(0)<0)V=Z.iadd(this.m);return V._forceRed(this)},a.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),CM=T$(($,q)=>{var _=hH(),K=mq().Buffer;function P(Y,O){return K.from(Y.toRed(_.mont(O.modulus)).redPow(new _(O.publicExponent)).fromRed().toArray())}q.exports=P}),wB=T$(($,q)=>{(function(_,K){function P(J,Z){if(!J)throw Error(Z||"Assertion failed")}function Y(J,Z){J.super_=Z;var V=function(){};V.prototype=Z.prototype,J.prototype=new V,J.prototype.constructor=J}function O(J,Z,V){if(O.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(Z==="le"||Z==="be")V=Z,Z=10;this._init(J||0,Z||10,V||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(J){}O.isBN=function(J){if(J instanceof O)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===O.wordSize&&Array.isArray(J.words)},O.max=function(J,Z){if(J.cmp(Z)>0)return J;return Z},O.min=function(J,Z){if(J.cmp(Z)<0)return J;return Z},O.prototype._init=function(J,Z,V){if(typeof J==="number")return this._initNumber(J,Z,V);if(typeof J==="object")return this._initArray(J,Z,V);if(Z==="hex")Z=16;P(Z===(Z|0)&&Z>=2&&Z<=36),J=J.toString().replace(/\s+/g,"");var M=0;if(J[0]==="-")M++,this.negative=1;if(M<J.length){if(Z===16)this._parseHex(J,M,V);else if(this._parseBase(J,Z,M),V==="le")this._initArray(this.toArray(),Z,V)}},O.prototype._initNumber=function(J,Z,V){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else P(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(V!=="le")return;this._initArray(this.toArray(),Z,V)},O.prototype._initArray=function(J,Z,V){if(P(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var A,v,G=0;if(V==="be"){for(M=J.length-1,A=0;M>=0;M-=3)if(v=J[M]|J[M-1]<<8|J[M-2]<<16,this.words[A]|=v<<G&67108863,this.words[A+1]=v>>>26-G&67108863,G+=24,G>=26)G-=26,A++}else if(V==="le"){for(M=0,A=0;M<J.length;M+=3)if(v=J[M]|J[M+1]<<8|J[M+2]<<16,this.words[A]|=v<<G&67108863,this.words[A+1]=v>>>26-G&67108863,G+=24,G>=26)G-=26,A++}return this._strip()};function T(J,Z){var V=J.charCodeAt(Z);if(V>=48&&V<=57)return V-48;else if(V>=65&&V<=70)return V-55;else if(V>=97&&V<=102)return V-87;else P(!1,"Invalid character in "+J)}function H(J,Z,V){var M=T(J,V);if(V-1>=Z)M|=T(J,V-1)<<4;return M}O.prototype._parseHex=function(J,Z,V){this.length=Math.ceil((J.length-Z)/6),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var A=0,v=0,G;if(V==="be")for(M=J.length-1;M>=Z;M-=2)if(G=H(J,Z,M)<<A,this.words[v]|=G&67108863,A>=18)A-=18,v+=1,this.words[v]|=G>>>26;else A+=8;else{var R=J.length-Z;for(M=R%2===0?Z+1:Z;M<J.length;M+=2)if(G=H(J,Z,M)<<A,this.words[v]|=G&67108863,A>=18)A-=18,v+=1,this.words[v]|=G>>>26;else A+=8}this._strip()};function f(J,Z,V,M){var A=0,v=0,G=Math.min(J.length,V);for(var R=Z;R<G;R++){var E=J.charCodeAt(R)-48;if(A*=M,E>=49)v=E-49+10;else if(E>=17)v=E-17+10;else v=E;P(E>=0&&v<M,"Invalid character"),A+=v}return A}O.prototype._parseBase=function(J,Z,V){this.words=[0],this.length=1;for(var M=0,A=1;A<=67108863;A*=Z)M++;M--,A=A/Z|0;var v=J.length-V,G=v%M,R=Math.min(v,v-G)+V,E=0;for(var b=V;b<R;b+=M)if(E=f(J,b,b+M,Z),this.imuln(A),this.words[0]+E<67108864)this.words[0]+=E;else this._iaddn(E);if(G!==0){var x=1;E=f(J,b,J.length,Z);for(b=0;b<G;b++)x*=Z;if(this.imuln(x),this.words[0]+E<67108864)this.words[0]+=E;else this._iaddn(E)}this._strip()},O.prototype.copy=function(J){J.words=Array(this.length);for(var Z=0;Z<this.length;Z++)J.words[Z]=this.words[Z];J.length=this.length,J.negative=this.negative,J.red=this.red};function w(J,Z){J.words=Z.words,J.length=Z.length,J.negative=Z.negative,J.red=Z.red}if(O.prototype._move=function(J){w(J,this)},O.prototype.clone=function(){var J=new O(null);return this.copy(J),J},O.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},O.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{O.prototype[Symbol.for("nodejs.util.inspect.custom")]=k}catch(J){O.prototype.inspect=k}else O.prototype.inspect=k;function k(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","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"],N=[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],h=[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(O.prototype.toString=function(J,Z){J=J||10,Z=Z|0||1;var V;if(J===16||J==="hex"){V="";var M=0,A=0;for(var v=0;v<this.length;v++){var G=this.words[v],R=((G<<M|A)&16777215).toString(16);if(A=G>>>24-M&16777215,M+=2,M>=26)M-=26,v--;if(A!==0||v!==this.length-1)V=S[6-R.length]+R+V;else V=R+V}if(A!==0)V=A.toString(16)+V;while(V.length%Z!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}if(J===(J|0)&&J>=2&&J<=36){var E=N[J],b=h[J];V="";var x=this.clone();x.negative=0;while(!x.isZero()){var l=x.modrn(b).toString(J);if(x=x.idivn(b),!x.isZero())V=S[E-l.length]+l+V;else V=l+V}if(this.isZero())V="0"+V;while(V.length%Z!==0)V="0"+V;if(this.negative!==0)V="-"+V;return V}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},O.prototype.toJSON=function(){return this.toString(16,2)},z)O.prototype.toBuffer=function(J,Z){return this.toArrayLike(z,J,Z)};O.prototype.toArray=function(J,Z){return this.toArrayLike(Array,J,Z)};var C=function(J,Z){if(J.allocUnsafe)return J.allocUnsafe(Z);return new J(Z)};if(O.prototype.toArrayLike=function(J,Z,V){this._strip();var M=this.byteLength(),A=V||Math.max(1,M);P(M<=A,"byte array longer than desired length"),P(A>0,"Requested array length <= 0");var v=C(J,A),G=Z==="le"?"LE":"BE";return this["_toArrayLike"+G](v,M),v},O.prototype._toArrayLikeLE=function(J,Z){var V=0,M=0;for(var A=0,v=0;A<this.length;A++){var G=this.words[A]<<v|M;if(J[V++]=G&255,V<J.length)J[V++]=G>>8&255;if(V<J.length)J[V++]=G>>16&255;if(v===6){if(V<J.length)J[V++]=G>>24&255;M=0,v=0}else M=G>>>24,v+=2}if(V<J.length){J[V++]=M;while(V<J.length)J[V++]=0}},O.prototype._toArrayLikeBE=function(J,Z){var V=J.length-1,M=0;for(var A=0,v=0;A<this.length;A++){var G=this.words[A]<<v|M;if(J[V--]=G&255,V>=0)J[V--]=G>>8&255;if(V>=0)J[V--]=G>>16&255;if(v===6){if(V>=0)J[V--]=G>>24&255;M=0,v=0}else M=G>>>24,v+=2}if(V>=0){J[V--]=M;while(V>=0)J[V--]=0}},Math.clz32)O.prototype._countBits=function(J){return 32-Math.clz32(J)};else O.prototype._countBits=function(J){var Z=J,V=0;if(Z>=4096)V+=13,Z>>>=13;if(Z>=64)V+=7,Z>>>=7;if(Z>=8)V+=4,Z>>>=4;if(Z>=2)V+=2,Z>>>=2;return V+Z};O.prototype._zeroBits=function(J){if(J===0)return 26;var Z=J,V=0;if((Z&8191)===0)V+=13,Z>>>=13;if((Z&127)===0)V+=7,Z>>>=7;if((Z&15)===0)V+=4,Z>>>=4;if((Z&3)===0)V+=2,Z>>>=2;if((Z&1)===0)V++;return V},O.prototype.bitLength=function(){var J=this.words[this.length-1],Z=this._countBits(J);return(this.length-1)*26+Z};function I(J){var Z=Array(J.bitLength());for(var V=0;V<Z.length;V++){var M=V/26|0,A=V%26;Z[V]=J.words[M]>>>A&1}return Z}O.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var Z=0;Z<this.length;Z++){var V=this._zeroBits(this.words[Z]);if(J+=V,V!==26)break}return J},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},O.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var Z=0;Z<J.length;Z++)this.words[Z]=this.words[Z]|J.words[Z];return this._strip()},O.prototype.ior=function(J){return P((this.negative|J.negative)===0),this.iuor(J)},O.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},O.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},O.prototype.iuand=function(J){var Z;if(this.length>J.length)Z=J;else Z=this;for(var V=0;V<Z.length;V++)this.words[V]=this.words[V]&J.words[V];return this.length=Z.length,this._strip()},O.prototype.iand=function(J){return P((this.negative|J.negative)===0),this.iuand(J)},O.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},O.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},O.prototype.iuxor=function(J){var Z,V;if(this.length>J.length)Z=this,V=J;else Z=J,V=this;for(var M=0;M<V.length;M++)this.words[M]=Z.words[M]^V.words[M];if(this!==Z)for(;M<Z.length;M++)this.words[M]=Z.words[M];return this.length=Z.length,this._strip()},O.prototype.ixor=function(J){return P((this.negative|J.negative)===0),this.iuxor(J)},O.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},O.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},O.prototype.inotn=function(J){P(typeof J==="number"&&J>=0);var Z=Math.ceil(J/26)|0,V=J%26;if(this._expand(Z),V>0)Z--;for(var M=0;M<Z;M++)this.words[M]=~this.words[M]&67108863;if(V>0)this.words[M]=~this.words[M]&67108863>>26-V;return this._strip()},O.prototype.notn=function(J){return this.clone().inotn(J)},O.prototype.setn=function(J,Z){P(typeof J==="number"&&J>=0);var V=J/26|0,M=J%26;if(this._expand(V+1),Z)this.words[V]=this.words[V]|1<<M;else this.words[V]=this.words[V]&~(1<<M);return this._strip()},O.prototype.iadd=function(J){var Z;if(this.negative!==0&&J.negative===0)return this.negative=0,Z=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,Z=this.isub(J),J.negative=1,Z._normSign();var V,M;if(this.length>J.length)V=this,M=J;else V=J,M=this;var A=0;for(var v=0;v<M.length;v++)Z=(V.words[v]|0)+(M.words[v]|0)+A,this.words[v]=Z&67108863,A=Z>>>26;for(;A!==0&&v<V.length;v++)Z=(V.words[v]|0)+A,this.words[v]=Z&67108863,A=Z>>>26;if(this.length=V.length,A!==0)this.words[this.length]=A,this.length++;else if(V!==this)for(;v<V.length;v++)this.words[v]=V.words[v];return this},O.prototype.add=function(J){var Z;if(J.negative!==0&&this.negative===0)return J.negative=0,Z=this.sub(J),J.negative^=1,Z;else if(J.negative===0&&this.negative!==0)return this.negative=0,Z=J.sub(this),this.negative=1,Z;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},O.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var Z=this.iadd(J);return J.negative=1,Z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var V=this.cmp(J);if(V===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,A;if(V>0)M=this,A=J;else M=J,A=this;var v=0;for(var G=0;G<A.length;G++)Z=(M.words[G]|0)-(A.words[G]|0)+v,v=Z>>26,this.words[G]=Z&67108863;for(;v!==0&&G<M.length;G++)Z=(M.words[G]|0)+v,v=Z>>26,this.words[G]=Z&67108863;if(v===0&&G<M.length&&M!==this)for(;G<M.length;G++)this.words[G]=M.words[G];if(this.length=Math.max(this.length,G),M!==this)this.negative=1;return this._strip()},O.prototype.sub=function(J){return this.clone().isub(J)};function D(J,Z,V){V.negative=Z.negative^J.negative;var M=J.length+Z.length|0;V.length=M,M=M-1|0;var A=J.words[0]|0,v=Z.words[0]|0,G=A*v,R=G&67108863,E=G/67108864|0;V.words[0]=R;for(var b=1;b<M;b++){var x=E>>>26,l=E&67108863,Q=Math.min(b,Z.length-1);for(var f$=Math.max(0,b-J.length+1);f$<=Q;f$++){var q$=b-f$|0;A=J.words[q$]|0,v=Z.words[f$]|0,G=A*v+l,x+=G/67108864|0,l=G&67108863}V.words[b]=l|0,E=x|0}if(E!==0)V.words[b]=E|0;else V.length--;return V._strip()}var L=function(J,Z,V){var M=J.words,A=Z.words,v=V.words,G=0,R,E,b,x=M[0]|0,l=x&8191,Q=x>>>13,f$=M[1]|0,q$=f$&8191,B=f$>>>13,v$=M[2]|0,e=v$&8191,P$=v$>>>13,o$=M[3]|0,m=o$&8191,r=o$>>>13,J$=M[4]|0,$$=J$&8191,_$=J$>>>13,O$=M[5]|0,d=O$&8191,n=O$>>>13,H$=M[6]|0,t=H$&8191,U=H$>>>13,A$=M[7]|0,W$=A$&8191,z$=A$>>>13,Z6=M[8]|0,X$=Z6&8191,k$=Z6>>>13,o6=M[9]|0,M$=o6&8191,S$=o6>>>13,Sq=A[0]|0,E$=Sq&8191,b$=Sq>>>13,Mq=A[1]|0,g$=Mq&8191,h$=Mq>>>13,fq=A[2]|0,y$=fq&8191,R$=fq>>>13,zq=A[3]|0,u$=zq&8191,x$=zq>>>13,Wq=A[4]|0,I$=Wq&8191,u=Wq>>>13,i=A[5]|0,K$=i&8191,Y$=i>>>13,B$=A[6]|0,G$=B$&8191,V$=B$>>>13,p6=A[7]|0,D$=p6&8191,p$=p6>>>13,Zq=A[8]|0,L$=Zq&8191,C$=Zq>>>13,c6=A[9]|0,W6=c6&8191,j6=c6>>>13;V.negative=J.negative^Z.negative,V.length=19,R=Math.imul(l,E$),E=Math.imul(l,b$),E=E+Math.imul(Q,E$)|0,b=Math.imul(Q,b$);var E6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(E6>>>26)|0,E6&=67108863,R=Math.imul(q$,E$),E=Math.imul(q$,b$),E=E+Math.imul(B,E$)|0,b=Math.imul(B,b$),R=R+Math.imul(l,g$)|0,E=E+Math.imul(l,h$)|0,E=E+Math.imul(Q,g$)|0,b=b+Math.imul(Q,h$)|0;var M6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(M6>>>26)|0,M6&=67108863,R=Math.imul(e,E$),E=Math.imul(e,b$),E=E+Math.imul(P$,E$)|0,b=Math.imul(P$,b$),R=R+Math.imul(q$,g$)|0,E=E+Math.imul(q$,h$)|0,E=E+Math.imul(B,g$)|0,b=b+Math.imul(B,h$)|0,R=R+Math.imul(l,y$)|0,E=E+Math.imul(l,R$)|0,E=E+Math.imul(Q,y$)|0,b=b+Math.imul(Q,R$)|0;var t6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(t6>>>26)|0,t6&=67108863,R=Math.imul(m,E$),E=Math.imul(m,b$),E=E+Math.imul(r,E$)|0,b=Math.imul(r,b$),R=R+Math.imul(e,g$)|0,E=E+Math.imul(e,h$)|0,E=E+Math.imul(P$,g$)|0,b=b+Math.imul(P$,h$)|0,R=R+Math.imul(q$,y$)|0,E=E+Math.imul(q$,R$)|0,E=E+Math.imul(B,y$)|0,b=b+Math.imul(B,R$)|0,R=R+Math.imul(l,u$)|0,E=E+Math.imul(l,x$)|0,E=E+Math.imul(Q,u$)|0,b=b+Math.imul(Q,x$)|0;var U6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(U6>>>26)|0,U6&=67108863,R=Math.imul($$,E$),E=Math.imul($$,b$),E=E+Math.imul(_$,E$)|0,b=Math.imul(_$,b$),R=R+Math.imul(m,g$)|0,E=E+Math.imul(m,h$)|0,E=E+Math.imul(r,g$)|0,b=b+Math.imul(r,h$)|0,R=R+Math.imul(e,y$)|0,E=E+Math.imul(e,R$)|0,E=E+Math.imul(P$,y$)|0,b=b+Math.imul(P$,R$)|0,R=R+Math.imul(q$,u$)|0,E=E+Math.imul(q$,x$)|0,E=E+Math.imul(B,u$)|0,b=b+Math.imul(B,x$)|0,R=R+Math.imul(l,I$)|0,E=E+Math.imul(l,u)|0,E=E+Math.imul(Q,I$)|0,b=b+Math.imul(Q,u)|0;var F6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(F6>>>26)|0,F6&=67108863,R=Math.imul(d,E$),E=Math.imul(d,b$),E=E+Math.imul(n,E$)|0,b=Math.imul(n,b$),R=R+Math.imul($$,g$)|0,E=E+Math.imul($$,h$)|0,E=E+Math.imul(_$,g$)|0,b=b+Math.imul(_$,h$)|0,R=R+Math.imul(m,y$)|0,E=E+Math.imul(m,R$)|0,E=E+Math.imul(r,y$)|0,b=b+Math.imul(r,R$)|0,R=R+Math.imul(e,u$)|0,E=E+Math.imul(e,x$)|0,E=E+Math.imul(P$,u$)|0,b=b+Math.imul(P$,x$)|0,R=R+Math.imul(q$,I$)|0,E=E+Math.imul(q$,u)|0,E=E+Math.imul(B,I$)|0,b=b+Math.imul(B,u)|0,R=R+Math.imul(l,K$)|0,E=E+Math.imul(l,Y$)|0,E=E+Math.imul(Q,K$)|0,b=b+Math.imul(Q,Y$)|0;var Q6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,R=Math.imul(t,E$),E=Math.imul(t,b$),E=E+Math.imul(U,E$)|0,b=Math.imul(U,b$),R=R+Math.imul(d,g$)|0,E=E+Math.imul(d,h$)|0,E=E+Math.imul(n,g$)|0,b=b+Math.imul(n,h$)|0,R=R+Math.imul($$,y$)|0,E=E+Math.imul($$,R$)|0,E=E+Math.imul(_$,y$)|0,b=b+Math.imul(_$,R$)|0,R=R+Math.imul(m,u$)|0,E=E+Math.imul(m,x$)|0,E=E+Math.imul(r,u$)|0,b=b+Math.imul(r,x$)|0,R=R+Math.imul(e,I$)|0,E=E+Math.imul(e,u)|0,E=E+Math.imul(P$,I$)|0,b=b+Math.imul(P$,u)|0,R=R+Math.imul(q$,K$)|0,E=E+Math.imul(q$,Y$)|0,E=E+Math.imul(B,K$)|0,b=b+Math.imul(B,Y$)|0,R=R+Math.imul(l,G$)|0,E=E+Math.imul(l,V$)|0,E=E+Math.imul(Q,G$)|0,b=b+Math.imul(Q,V$)|0;var a6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(a6>>>26)|0,a6&=67108863,R=Math.imul(W$,E$),E=Math.imul(W$,b$),E=E+Math.imul(z$,E$)|0,b=Math.imul(z$,b$),R=R+Math.imul(t,g$)|0,E=E+Math.imul(t,h$)|0,E=E+Math.imul(U,g$)|0,b=b+Math.imul(U,h$)|0,R=R+Math.imul(d,y$)|0,E=E+Math.imul(d,R$)|0,E=E+Math.imul(n,y$)|0,b=b+Math.imul(n,R$)|0,R=R+Math.imul($$,u$)|0,E=E+Math.imul($$,x$)|0,E=E+Math.imul(_$,u$)|0,b=b+Math.imul(_$,x$)|0,R=R+Math.imul(m,I$)|0,E=E+Math.imul(m,u)|0,E=E+Math.imul(r,I$)|0,b=b+Math.imul(r,u)|0,R=R+Math.imul(e,K$)|0,E=E+Math.imul(e,Y$)|0,E=E+Math.imul(P$,K$)|0,b=b+Math.imul(P$,Y$)|0,R=R+Math.imul(q$,G$)|0,E=E+Math.imul(q$,V$)|0,E=E+Math.imul(B,G$)|0,b=b+Math.imul(B,V$)|0,R=R+Math.imul(l,D$)|0,E=E+Math.imul(l,p$)|0,E=E+Math.imul(Q,D$)|0,b=b+Math.imul(Q,p$)|0;var e6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(e6>>>26)|0,e6&=67108863,R=Math.imul(X$,E$),E=Math.imul(X$,b$),E=E+Math.imul(k$,E$)|0,b=Math.imul(k$,b$),R=R+Math.imul(W$,g$)|0,E=E+Math.imul(W$,h$)|0,E=E+Math.imul(z$,g$)|0,b=b+Math.imul(z$,h$)|0,R=R+Math.imul(t,y$)|0,E=E+Math.imul(t,R$)|0,E=E+Math.imul(U,y$)|0,b=b+Math.imul(U,R$)|0,R=R+Math.imul(d,u$)|0,E=E+Math.imul(d,x$)|0,E=E+Math.imul(n,u$)|0,b=b+Math.imul(n,x$)|0,R=R+Math.imul($$,I$)|0,E=E+Math.imul($$,u)|0,E=E+Math.imul(_$,I$)|0,b=b+Math.imul(_$,u)|0,R=R+Math.imul(m,K$)|0,E=E+Math.imul(m,Y$)|0,E=E+Math.imul(r,K$)|0,b=b+Math.imul(r,Y$)|0,R=R+Math.imul(e,G$)|0,E=E+Math.imul(e,V$)|0,E=E+Math.imul(P$,G$)|0,b=b+Math.imul(P$,V$)|0,R=R+Math.imul(q$,D$)|0,E=E+Math.imul(q$,p$)|0,E=E+Math.imul(B,D$)|0,b=b+Math.imul(B,p$)|0,R=R+Math.imul(l,L$)|0,E=E+Math.imul(l,C$)|0,E=E+Math.imul(Q,L$)|0,b=b+Math.imul(Q,C$)|0;var s6=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(s6>>>26)|0,s6&=67108863,R=Math.imul(M$,E$),E=Math.imul(M$,b$),E=E+Math.imul(S$,E$)|0,b=Math.imul(S$,b$),R=R+Math.imul(X$,g$)|0,E=E+Math.imul(X$,h$)|0,E=E+Math.imul(k$,g$)|0,b=b+Math.imul(k$,h$)|0,R=R+Math.imul(W$,y$)|0,E=E+Math.imul(W$,R$)|0,E=E+Math.imul(z$,y$)|0,b=b+Math.imul(z$,R$)|0,R=R+Math.imul(t,u$)|0,E=E+Math.imul(t,x$)|0,E=E+Math.imul(U,u$)|0,b=b+Math.imul(U,x$)|0,R=R+Math.imul(d,I$)|0,E=E+Math.imul(d,u)|0,E=E+Math.imul(n,I$)|0,b=b+Math.imul(n,u)|0,R=R+Math.imul($$,K$)|0,E=E+Math.imul($$,Y$)|0,E=E+Math.imul(_$,K$)|0,b=b+Math.imul(_$,Y$)|0,R=R+Math.imul(m,G$)|0,E=E+Math.imul(m,V$)|0,E=E+Math.imul(r,G$)|0,b=b+Math.imul(r,V$)|0,R=R+Math.imul(e,D$)|0,E=E+Math.imul(e,p$)|0,E=E+Math.imul(P$,D$)|0,b=b+Math.imul(P$,p$)|0,R=R+Math.imul(q$,L$)|0,E=E+Math.imul(q$,C$)|0,E=E+Math.imul(B,L$)|0,b=b+Math.imul(B,C$)|0,R=R+Math.imul(l,W6)|0,E=E+Math.imul(l,j6)|0,E=E+Math.imul(Q,W6)|0,b=b+Math.imul(Q,j6)|0;var $q=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+($q>>>26)|0,$q&=67108863,R=Math.imul(M$,g$),E=Math.imul(M$,h$),E=E+Math.imul(S$,g$)|0,b=Math.imul(S$,h$),R=R+Math.imul(X$,y$)|0,E=E+Math.imul(X$,R$)|0,E=E+Math.imul(k$,y$)|0,b=b+Math.imul(k$,R$)|0,R=R+Math.imul(W$,u$)|0,E=E+Math.imul(W$,x$)|0,E=E+Math.imul(z$,u$)|0,b=b+Math.imul(z$,x$)|0,R=R+Math.imul(t,I$)|0,E=E+Math.imul(t,u)|0,E=E+Math.imul(U,I$)|0,b=b+Math.imul(U,u)|0,R=R+Math.imul(d,K$)|0,E=E+Math.imul(d,Y$)|0,E=E+Math.imul(n,K$)|0,b=b+Math.imul(n,Y$)|0,R=R+Math.imul($$,G$)|0,E=E+Math.imul($$,V$)|0,E=E+Math.imul(_$,G$)|0,b=b+Math.imul(_$,V$)|0,R=R+Math.imul(m,D$)|0,E=E+Math.imul(m,p$)|0,E=E+Math.imul(r,D$)|0,b=b+Math.imul(r,p$)|0,R=R+Math.imul(e,L$)|0,E=E+Math.imul(e,C$)|0,E=E+Math.imul(P$,L$)|0,b=b+Math.imul(P$,C$)|0,R=R+Math.imul(q$,W6)|0,E=E+Math.imul(q$,j6)|0,E=E+Math.imul(B,W6)|0,b=b+Math.imul(B,j6)|0;var qq=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(qq>>>26)|0,qq&=67108863,R=Math.imul(M$,y$),E=Math.imul(M$,R$),E=E+Math.imul(S$,y$)|0,b=Math.imul(S$,R$),R=R+Math.imul(X$,u$)|0,E=E+Math.imul(X$,x$)|0,E=E+Math.imul(k$,u$)|0,b=b+Math.imul(k$,x$)|0,R=R+Math.imul(W$,I$)|0,E=E+Math.imul(W$,u)|0,E=E+Math.imul(z$,I$)|0,b=b+Math.imul(z$,u)|0,R=R+Math.imul(t,K$)|0,E=E+Math.imul(t,Y$)|0,E=E+Math.imul(U,K$)|0,b=b+Math.imul(U,Y$)|0,R=R+Math.imul(d,G$)|0,E=E+Math.imul(d,V$)|0,E=E+Math.imul(n,G$)|0,b=b+Math.imul(n,V$)|0,R=R+Math.imul($$,D$)|0,E=E+Math.imul($$,p$)|0,E=E+Math.imul(_$,D$)|0,b=b+Math.imul(_$,p$)|0,R=R+Math.imul(m,L$)|0,E=E+Math.imul(m,C$)|0,E=E+Math.imul(r,L$)|0,b=b+Math.imul(r,C$)|0,R=R+Math.imul(e,W6)|0,E=E+Math.imul(e,j6)|0,E=E+Math.imul(P$,W6)|0,b=b+Math.imul(P$,j6)|0;var _q=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(_q>>>26)|0,_q&=67108863,R=Math.imul(M$,u$),E=Math.imul(M$,x$),E=E+Math.imul(S$,u$)|0,b=Math.imul(S$,x$),R=R+Math.imul(X$,I$)|0,E=E+Math.imul(X$,u)|0,E=E+Math.imul(k$,I$)|0,b=b+Math.imul(k$,u)|0,R=R+Math.imul(W$,K$)|0,E=E+Math.imul(W$,Y$)|0,E=E+Math.imul(z$,K$)|0,b=b+Math.imul(z$,Y$)|0,R=R+Math.imul(t,G$)|0,E=E+Math.imul(t,V$)|0,E=E+Math.imul(U,G$)|0,b=b+Math.imul(U,V$)|0,R=R+Math.imul(d,D$)|0,E=E+Math.imul(d,p$)|0,E=E+Math.imul(n,D$)|0,b=b+Math.imul(n,p$)|0,R=R+Math.imul($$,L$)|0,E=E+Math.imul($$,C$)|0,E=E+Math.imul(_$,L$)|0,b=b+Math.imul(_$,C$)|0,R=R+Math.imul(m,W6)|0,E=E+Math.imul(m,j6)|0,E=E+Math.imul(r,W6)|0,b=b+Math.imul(r,j6)|0;var Kq=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,R=Math.imul(M$,I$),E=Math.imul(M$,u),E=E+Math.imul(S$,I$)|0,b=Math.imul(S$,u),R=R+Math.imul(X$,K$)|0,E=E+Math.imul(X$,Y$)|0,E=E+Math.imul(k$,K$)|0,b=b+Math.imul(k$,Y$)|0,R=R+Math.imul(W$,G$)|0,E=E+Math.imul(W$,V$)|0,E=E+Math.imul(z$,G$)|0,b=b+Math.imul(z$,V$)|0,R=R+Math.imul(t,D$)|0,E=E+Math.imul(t,p$)|0,E=E+Math.imul(U,D$)|0,b=b+Math.imul(U,p$)|0,R=R+Math.imul(d,L$)|0,E=E+Math.imul(d,C$)|0,E=E+Math.imul(n,L$)|0,b=b+Math.imul(n,C$)|0,R=R+Math.imul($$,W6)|0,E=E+Math.imul($$,j6)|0,E=E+Math.imul(_$,W6)|0,b=b+Math.imul(_$,j6)|0;var Pq=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,R=Math.imul(M$,K$),E=Math.imul(M$,Y$),E=E+Math.imul(S$,K$)|0,b=Math.imul(S$,Y$),R=R+Math.imul(X$,G$)|0,E=E+Math.imul(X$,V$)|0,E=E+Math.imul(k$,G$)|0,b=b+Math.imul(k$,V$)|0,R=R+Math.imul(W$,D$)|0,E=E+Math.imul(W$,p$)|0,E=E+Math.imul(z$,D$)|0,b=b+Math.imul(z$,p$)|0,R=R+Math.imul(t,L$)|0,E=E+Math.imul(t,C$)|0,E=E+Math.imul(U,L$)|0,b=b+Math.imul(U,C$)|0,R=R+Math.imul(d,W6)|0,E=E+Math.imul(d,j6)|0,E=E+Math.imul(n,W6)|0,b=b+Math.imul(n,j6)|0;var Yq=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,R=Math.imul(M$,G$),E=Math.imul(M$,V$),E=E+Math.imul(S$,G$)|0,b=Math.imul(S$,V$),R=R+Math.imul(X$,D$)|0,E=E+Math.imul(X$,p$)|0,E=E+Math.imul(k$,D$)|0,b=b+Math.imul(k$,p$)|0,R=R+Math.imul(W$,L$)|0,E=E+Math.imul(W$,C$)|0,E=E+Math.imul(z$,L$)|0,b=b+Math.imul(z$,C$)|0,R=R+Math.imul(t,W6)|0,E=E+Math.imul(t,j6)|0,E=E+Math.imul(U,W6)|0,b=b+Math.imul(U,j6)|0;var Oq=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,R=Math.imul(M$,D$),E=Math.imul(M$,p$),E=E+Math.imul(S$,D$)|0,b=Math.imul(S$,p$),R=R+Math.imul(X$,L$)|0,E=E+Math.imul(X$,C$)|0,E=E+Math.imul(k$,L$)|0,b=b+Math.imul(k$,C$)|0,R=R+Math.imul(W$,W6)|0,E=E+Math.imul(W$,j6)|0,E=E+Math.imul(z$,W6)|0,b=b+Math.imul(z$,j6)|0;var U2=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(U2>>>26)|0,U2&=67108863,R=Math.imul(M$,L$),E=Math.imul(M$,C$),E=E+Math.imul(S$,L$)|0,b=Math.imul(S$,C$),R=R+Math.imul(X$,W6)|0,E=E+Math.imul(X$,j6)|0,E=E+Math.imul(k$,W6)|0,b=b+Math.imul(k$,j6)|0;var F2=(G+R|0)+((E&8191)<<13)|0;G=(b+(E>>>13)|0)+(F2>>>26)|0,F2&=67108863,R=Math.imul(M$,W6),E=Math.imul(M$,j6),E=E+Math.imul(S$,W6)|0,b=Math.imul(S$,j6);var Q2=(G+R|0)+((E&8191)<<13)|0;if(G=(b+(E>>>13)|0)+(Q2>>>26)|0,Q2&=67108863,v[0]=E6,v[1]=M6,v[2]=t6,v[3]=U6,v[4]=F6,v[5]=Q6,v[6]=a6,v[7]=e6,v[8]=s6,v[9]=$q,v[10]=qq,v[11]=_q,v[12]=Kq,v[13]=Pq,v[14]=Yq,v[15]=Oq,v[16]=U2,v[17]=F2,v[18]=Q2,G!==0)v[19]=G,V.length++;return V};if(!Math.imul)L=D;function g(J,Z,V){V.negative=Z.negative^J.negative,V.length=J.length+Z.length;var M=0,A=0;for(var v=0;v<V.length-1;v++){var G=A;A=0;var R=M&67108863,E=Math.min(v,Z.length-1);for(var b=Math.max(0,v-J.length+1);b<=E;b++){var x=v-b,l=J.words[x]|0,Q=Z.words[b]|0,f$=l*Q,q$=f$&67108863;G=G+(f$/67108864|0)|0,q$=q$+R|0,R=q$&67108863,G=G+(q$>>>26)|0,A+=G>>>26,G&=67108863}V.words[v]=R,M=G,G=A}if(M!==0)V.words[v]=M;else V.length--;return V._strip()}function y(J,Z,V){return g(J,Z,V)}O.prototype.mulTo=function(J,Z){var V,M=this.length+J.length;if(this.length===10&&J.length===10)V=L(this,J,Z);else if(M<63)V=D(this,J,Z);else if(M<1024)V=g(this,J,Z);else V=y(this,J,Z);return V};function c(J,Z){this.x=J,this.y=Z}c.prototype.makeRBT=function(J){var Z=Array(J),V=O.prototype._countBits(J)-1;for(var M=0;M<J;M++)Z[M]=this.revBin(M,V,J);return Z},c.prototype.revBin=function(J,Z,V){if(J===0||J===V-1)return J;var M=0;for(var A=0;A<Z;A++)M|=(J&1)<<Z-A-1,J>>=1;return M},c.prototype.permute=function(J,Z,V,M,A,v){for(var G=0;G<v;G++)M[G]=Z[J[G]],A[G]=V[J[G]]},c.prototype.transform=function(J,Z,V,M,A,v){this.permute(v,J,Z,V,M,A);for(var G=1;G<A;G<<=1){var R=G<<1,E=Math.cos(2*Math.PI/R),b=Math.sin(2*Math.PI/R);for(var x=0;x<A;x+=R){var l=E,Q=b;for(var f$=0;f$<G;f$++){var q$=V[x+f$],B=M[x+f$],v$=V[x+f$+G],e=M[x+f$+G],P$=l*v$-Q*e;if(e=l*e+Q*v$,v$=P$,V[x+f$]=q$+v$,M[x+f$]=B+e,V[x+f$+G]=q$-v$,M[x+f$+G]=B-e,f$!==R)P$=E*l-b*Q,Q=E*Q+b*l,l=P$}}}},c.prototype.guessLen13b=function(J,Z){var V=Math.max(Z,J)|1,M=V&1,A=0;for(V=V/2|0;V;V=V>>>1)A++;return 1<<A+1+M},c.prototype.conjugate=function(J,Z,V){if(V<=1)return;for(var M=0;M<V/2;M++){var A=J[M];J[M]=J[V-M-1],J[V-M-1]=A,A=Z[M],Z[M]=-Z[V-M-1],Z[V-M-1]=-A}},c.prototype.normalize13b=function(J,Z){var V=0;for(var M=0;M<Z/2;M++){var A=Math.round(J[2*M+1]/Z)*8192+Math.round(J[2*M]/Z)+V;if(J[M]=A&67108863,A<67108864)V=0;else V=A/67108864|0}return J},c.prototype.convert13b=function(J,Z,V,M){var A=0;for(var v=0;v<Z;v++)A=A+(J[v]|0),V[2*v]=A&8191,A=A>>>13,V[2*v+1]=A&8191,A=A>>>13;for(v=2*Z;v<M;++v)V[v]=0;P(A===0),P((A&-8192)===0)},c.prototype.stub=function(J){var Z=Array(J);for(var V=0;V<J;V++)Z[V]=0;return Z},c.prototype.mulp=function(J,Z,V){var M=2*this.guessLen13b(J.length,Z.length),A=this.makeRBT(M),v=this.stub(M),G=Array(M),R=Array(M),E=Array(M),b=Array(M),x=Array(M),l=Array(M),Q=V.words;Q.length=M,this.convert13b(J.words,J.length,G,M),this.convert13b(Z.words,Z.length,b,M),this.transform(G,v,R,E,M,A),this.transform(b,v,x,l,M,A);for(var f$=0;f$<M;f$++){var q$=R[f$]*x[f$]-E[f$]*l[f$];E[f$]=R[f$]*l[f$]+E[f$]*x[f$],R[f$]=q$}return this.conjugate(R,E,M),this.transform(R,E,Q,v,M,A),this.conjugate(Q,v,M),this.normalize13b(Q,M),V.negative=J.negative^Z.negative,V.length=J.length+Z.length,V._strip()},O.prototype.mul=function(J){var Z=new O(null);return Z.words=Array(this.length+J.length),this.mulTo(J,Z)},O.prototype.mulf=function(J){var Z=new O(null);return Z.words=Array(this.length+J.length),y(this,J,Z)},O.prototype.imul=function(J){return this.clone().mulTo(J,this)},O.prototype.imuln=function(J){var Z=J<0;if(Z)J=-J;P(typeof J==="number"),P(J<67108864);var V=0;for(var M=0;M<this.length;M++){var A=(this.words[M]|0)*J,v=(A&67108863)+(V&67108863);V>>=26,V+=A/67108864|0,V+=v>>>26,this.words[M]=v&67108863}if(V!==0)this.words[M]=V,this.length++;return this.length=J===0?1:this.length,Z?this.ineg():this},O.prototype.muln=function(J){return this.clone().imuln(J)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(J){var Z=I(J);if(Z.length===0)return new O(1);var V=this;for(var M=0;M<Z.length;M++,V=V.sqr())if(Z[M]!==0)break;if(++M<Z.length)for(var A=V.sqr();M<Z.length;M++,A=A.sqr()){if(Z[M]===0)continue;V=V.mul(A)}return V},O.prototype.iushln=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,V=(J-Z)/26,M=67108863>>>26-Z<<26-Z,A;if(Z!==0){var v=0;for(A=0;A<this.length;A++){var G=this.words[A]&M,R=(this.words[A]|0)-G<<Z;this.words[A]=R|v,v=G>>>26-Z}if(v)this.words[A]=v,this.length++}if(V!==0){for(A=this.length-1;A>=0;A--)this.words[A+V]=this.words[A];for(A=0;A<V;A++)this.words[A]=0;this.length+=V}return this._strip()},O.prototype.ishln=function(J){return P(this.negative===0),this.iushln(J)},O.prototype.iushrn=function(J,Z,V){P(typeof J==="number"&&J>=0);var M;if(Z)M=(Z-Z%26)/26;else M=0;var A=J%26,v=Math.min((J-A)/26,this.length),G=67108863^67108863>>>A<<A,R=V;if(M-=v,M=Math.max(0,M),R){for(var E=0;E<v;E++)R.words[E]=this.words[E];R.length=v}if(v===0);else if(this.length>v){this.length-=v;for(E=0;E<this.length;E++)this.words[E]=this.words[E+v]}else this.words[0]=0,this.length=1;var b=0;for(E=this.length-1;E>=0&&(b!==0||E>=M);E--){var x=this.words[E]|0;this.words[E]=b<<26-A|x>>>A,b=x&G}if(R&&b!==0)R.words[R.length++]=b;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},O.prototype.ishrn=function(J,Z,V){return P(this.negative===0),this.iushrn(J,Z,V)},O.prototype.shln=function(J){return this.clone().ishln(J)},O.prototype.ushln=function(J){return this.clone().iushln(J)},O.prototype.shrn=function(J){return this.clone().ishrn(J)},O.prototype.ushrn=function(J){return this.clone().iushrn(J)},O.prototype.testn=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,V=(J-Z)/26,M=1<<Z;if(this.length<=V)return!1;var A=this.words[V];return!!(A&M)},O.prototype.imaskn=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,V=(J-Z)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=V)return this;if(Z!==0)V++;if(this.length=Math.min(V,this.length),Z!==0){var M=67108863^67108863>>>Z<<Z;this.words[this.length-1]&=M}return this._strip()},O.prototype.maskn=function(J){return this.clone().imaskn(J)},O.prototype.iaddn=function(J){if(P(typeof J==="number"),P(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},O.prototype._iaddn=function(J){this.words[0]+=J;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},O.prototype.isubn=function(J){if(P(typeof J==="number"),P(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,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()},O.prototype.addn=function(J){return this.clone().iaddn(J)},O.prototype.subn=function(J){return this.clone().isubn(J)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(J,Z,V){var M=J.length+V,A;this._expand(M);var v,G=0;for(A=0;A<J.length;A++){v=(this.words[A+V]|0)+G;var R=(J.words[A]|0)*Z;v-=R&67108863,G=(v>>26)-(R/67108864|0),this.words[A+V]=v&67108863}for(;A<this.length-V;A++)v=(this.words[A+V]|0)+G,G=v>>26,this.words[A+V]=v&67108863;if(G===0)return this._strip();P(G===-1),G=0;for(A=0;A<this.length;A++)v=-(this.words[A]|0)+G,G=v>>26,this.words[A]=v&67108863;return this.negative=1,this._strip()},O.prototype._wordDiv=function(J,Z){var V=this.length-J.length,M=this.clone(),A=J,v=A.words[A.length-1]|0,G=this._countBits(v);if(V=26-G,V!==0)A=A.ushln(V),M.iushln(V),v=A.words[A.length-1]|0;var R=M.length-A.length,E;if(Z!=="mod"){E=new O(null),E.length=R+1,E.words=Array(E.length);for(var b=0;b<E.length;b++)E.words[b]=0}var x=M.clone()._ishlnsubmul(A,1,R);if(x.negative===0){if(M=x,E)E.words[R]=1}for(var l=R-1;l>=0;l--){var Q=(M.words[A.length+l]|0)*67108864+(M.words[A.length+l-1]|0);Q=Math.min(Q/v|0,67108863),M._ishlnsubmul(A,Q,l);while(M.negative!==0)if(Q--,M.negative=0,M._ishlnsubmul(A,1,l),!M.isZero())M.negative^=1;if(E)E.words[l]=Q}if(E)E._strip();if(M._strip(),Z!=="div"&&V!==0)M.iushrn(V);return{div:E||null,mod:M}},O.prototype.divmod=function(J,Z,V){if(P(!J.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var M,A,v;if(this.negative!==0&&J.negative===0){if(v=this.neg().divmod(J,Z),Z!=="mod")M=v.div.neg();if(Z!=="div"){if(A=v.mod.neg(),V&&A.negative!==0)A.iadd(J)}return{div:M,mod:A}}if(this.negative===0&&J.negative!==0){if(v=this.divmod(J.neg(),Z),Z!=="mod")M=v.div.neg();return{div:M,mod:v.mod}}if((this.negative&J.negative)!==0){if(v=this.neg().divmod(J.neg(),Z),Z!=="div"){if(A=v.mod.neg(),V&&A.negative!==0)A.isub(J)}return{div:v.div,mod:A}}if(J.length>this.length||this.cmp(J)<0)return{div:new O(0),mod:this};if(J.length===1){if(Z==="div")return{div:this.divn(J.words[0]),mod:null};if(Z==="mod")return{div:null,mod:new O(this.modrn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new O(this.modrn(J.words[0]))}}return this._wordDiv(J,Z)},O.prototype.div=function(J){return this.divmod(J,"div",!1).div},O.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},O.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},O.prototype.divRound=function(J){var Z=this.divmod(J);if(Z.mod.isZero())return Z.div;var V=Z.div.negative!==0?Z.mod.isub(J):Z.mod,M=J.ushrn(1),A=J.andln(1),v=V.cmp(M);if(v<0||A===1&&v===0)return Z.div;return Z.div.negative!==0?Z.div.isubn(1):Z.div.iaddn(1)},O.prototype.modrn=function(J){var Z=J<0;if(Z)J=-J;P(J<=67108863);var V=67108864%J,M=0;for(var A=this.length-1;A>=0;A--)M=(V*M+(this.words[A]|0))%J;return Z?-M:M},O.prototype.modn=function(J){return this.modrn(J)},O.prototype.idivn=function(J){var Z=J<0;if(Z)J=-J;P(J<=67108863);var V=0;for(var M=this.length-1;M>=0;M--){var A=(this.words[M]|0)+V*67108864;this.words[M]=A/J|0,V=A%J}return this._strip(),Z?this.ineg():this},O.prototype.divn=function(J){return this.clone().idivn(J)},O.prototype.egcd=function(J){P(J.negative===0),P(!J.isZero());var Z=this,V=J.clone();if(Z.negative!==0)Z=Z.umod(J);else Z=Z.clone();var M=new O(1),A=new O(0),v=new O(0),G=new O(1),R=0;while(Z.isEven()&&V.isEven())Z.iushrn(1),V.iushrn(1),++R;var E=V.clone(),b=Z.clone();while(!Z.isZero()){for(var x=0,l=1;(Z.words[0]&l)===0&&x<26;++x,l<<=1);if(x>0){Z.iushrn(x);while(x-- >0){if(M.isOdd()||A.isOdd())M.iadd(E),A.isub(b);M.iushrn(1),A.iushrn(1)}}for(var Q=0,f$=1;(V.words[0]&f$)===0&&Q<26;++Q,f$<<=1);if(Q>0){V.iushrn(Q);while(Q-- >0){if(v.isOdd()||G.isOdd())v.iadd(E),G.isub(b);v.iushrn(1),G.iushrn(1)}}if(Z.cmp(V)>=0)Z.isub(V),M.isub(v),A.isub(G);else V.isub(Z),v.isub(M),G.isub(A)}return{a:v,b:G,gcd:V.iushln(R)}},O.prototype._invmp=function(J){P(J.negative===0),P(!J.isZero());var Z=this,V=J.clone();if(Z.negative!==0)Z=Z.umod(J);else Z=Z.clone();var M=new O(1),A=new O(0),v=V.clone();while(Z.cmpn(1)>0&&V.cmpn(1)>0){for(var G=0,R=1;(Z.words[0]&R)===0&&G<26;++G,R<<=1);if(G>0){Z.iushrn(G);while(G-- >0){if(M.isOdd())M.iadd(v);M.iushrn(1)}}for(var E=0,b=1;(V.words[0]&b)===0&&E<26;++E,b<<=1);if(E>0){V.iushrn(E);while(E-- >0){if(A.isOdd())A.iadd(v);A.iushrn(1)}}if(Z.cmp(V)>=0)Z.isub(V),M.isub(A);else V.isub(Z),A.isub(M)}var x;if(Z.cmpn(1)===0)x=M;else x=A;if(x.cmpn(0)<0)x.iadd(J);return x},O.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var Z=this.clone(),V=J.clone();Z.negative=0,V.negative=0;for(var M=0;Z.isEven()&&V.isEven();M++)Z.iushrn(1),V.iushrn(1);do{while(Z.isEven())Z.iushrn(1);while(V.isEven())V.iushrn(1);var A=Z.cmp(V);if(A<0){var v=Z;Z=V,V=v}else if(A===0||V.cmpn(1)===0)break;Z.isub(V)}while(!0);return V.iushln(M)},O.prototype.invm=function(J){return this.egcd(J).a.umod(J)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(J){return this.words[0]&J},O.prototype.bincn=function(J){P(typeof J==="number");var Z=J%26,V=(J-Z)/26,M=1<<Z;if(this.length<=V)return this._expand(V+1),this.words[V]|=M,this;var A=M;for(var v=V;A!==0&&v<this.length;v++){var G=this.words[v]|0;G+=A,A=G>>>26,G&=67108863,this.words[v]=G}if(A!==0)this.words[v]=A,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(J){var Z=J<0;if(this.negative!==0&&!Z)return-1;if(this.negative===0&&Z)return 1;this._strip();var V;if(this.length>1)V=1;else{if(Z)J=-J;P(J<=67108863,"Number is too big");var M=this.words[0]|0;V=M===J?0:M<J?-1:1}if(this.negative!==0)return-V|0;return V},O.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var Z=this.ucmp(J);if(this.negative!==0)return-Z|0;return Z},O.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var Z=0;for(var V=this.length-1;V>=0;V--){var M=this.words[V]|0,A=J.words[V]|0;if(M===A)continue;if(M<A)Z=-1;else if(M>A)Z=1;break}return Z},O.prototype.gtn=function(J){return this.cmpn(J)===1},O.prototype.gt=function(J){return this.cmp(J)===1},O.prototype.gten=function(J){return this.cmpn(J)>=0},O.prototype.gte=function(J){return this.cmp(J)>=0},O.prototype.ltn=function(J){return this.cmpn(J)===-1},O.prototype.lt=function(J){return this.cmp(J)===-1},O.prototype.lten=function(J){return this.cmpn(J)<=0},O.prototype.lte=function(J){return this.cmp(J)<=0},O.prototype.eqn=function(J){return this.cmpn(J)===0},O.prototype.eq=function(J){return this.cmp(J)===0},O.red=function(J){return new W(J)},O.prototype.toRed=function(J){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(J){return this.red=J,this},O.prototype.forceRed=function(J){return P(!this.red,"Already a number in reduction context"),this._forceRed(J)},O.prototype.redAdd=function(J){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},O.prototype.redIAdd=function(J){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},O.prototype.redSub=function(J){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},O.prototype.redISub=function(J){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},O.prototype.redShl=function(J){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},O.prototype.redMul=function(J){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},O.prototype.redIMul=function(J){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(J){return P(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var o={k256:null,p224:null,p192:null,p25519:null};function s(J,Z){this.name=J,this.p=new O(Z,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}s.prototype._tmp=function(){var J=new O(null);return J.words=Array(Math.ceil(this.n/13)),J},s.prototype.ireduce=function(J){var Z=J,V;do this.split(Z,this.tmp),Z=this.imulK(Z),Z=Z.iadd(this.tmp),V=Z.bitLength();while(V>this.n);var M=V<this.n?-1:Z.ucmp(this.p);if(M===0)Z.words[0]=0,Z.length=1;else if(M>0)Z.isub(this.p);else if(Z.strip!==void 0)Z.strip();else Z._strip();return Z},s.prototype.split=function(J,Z){J.iushrn(this.n,0,Z)},s.prototype.imulK=function(J){return J.imul(this.k)};function F(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(F,s),F.prototype.split=function(J,Z){var V=4194303,M=Math.min(J.length,9);for(var A=0;A<M;A++)Z.words[A]=J.words[A];if(Z.length=M,J.length<=9){J.words[0]=0,J.length=1;return}var v=J.words[9];Z.words[Z.length++]=v&V;for(A=10;A<J.length;A++){var G=J.words[A]|0;J.words[A-10]=(G&V)<<4|v>>>22,v=G}if(v>>>=22,J.words[A-10]=v,v===0&&J.length>10)J.length-=10;else J.length-=9},F.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var Z=0;for(var V=0;V<J.length;V++){var M=J.words[V]|0;Z+=M*977,J.words[V]=Z&67108863,Z=M*64+(Z/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function p(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(p,s);function a(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(a,s);function j(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(j,s),j.prototype.imulK=function(J){var Z=0;for(var V=0;V<J.length;V++){var M=(J.words[V]|0)*19+Z,A=M&67108863;M>>>=26,J.words[V]=A,Z=M}if(Z!==0)J.words[J.length++]=Z;return J},O._prime=function(J){if(o[J])return o[J];var Z;if(J==="k256")Z=new F;else if(J==="p224")Z=new p;else if(J==="p192")Z=new a;else if(J==="p25519")Z=new j;else throw Error("Unknown prime "+J);return o[J]=Z,Z};function W(J){if(typeof J==="string"){var Z=O._prime(J);this.m=Z.p,this.prime=Z}else P(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}W.prototype._verify1=function(J){P(J.negative===0,"red works only with positives"),P(J.red,"red works only with red numbers")},W.prototype._verify2=function(J,Z){P((J.negative|Z.negative)===0,"red works only with positives"),P(J.red&&J.red===Z.red,"red works only with red numbers")},W.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return w(J,J.umod(this.m)._forceRed(this)),J},W.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},W.prototype.add=function(J,Z){this._verify2(J,Z);var V=J.add(Z);if(V.cmp(this.m)>=0)V.isub(this.m);return V._forceRed(this)},W.prototype.iadd=function(J,Z){this._verify2(J,Z);var V=J.iadd(Z);if(V.cmp(this.m)>=0)V.isub(this.m);return V},W.prototype.sub=function(J,Z){this._verify2(J,Z);var V=J.sub(Z);if(V.cmpn(0)<0)V.iadd(this.m);return V._forceRed(this)},W.prototype.isub=function(J,Z){this._verify2(J,Z);var V=J.isub(Z);if(V.cmpn(0)<0)V.iadd(this.m);return V},W.prototype.shl=function(J,Z){return this._verify1(J),this.imod(J.ushln(Z))},W.prototype.imul=function(J,Z){return this._verify2(J,Z),this.imod(J.imul(Z))},W.prototype.mul=function(J,Z){return this._verify2(J,Z),this.imod(J.mul(Z))},W.prototype.isqr=function(J){return this.imul(J,J.clone())},W.prototype.sqr=function(J){return this.mul(J,J)},W.prototype.sqrt=function(J){if(J.isZero())return J.clone();var Z=this.m.andln(3);if(P(Z%2===1),Z===3){var V=this.m.add(new O(1)).iushrn(2);return this.pow(J,V)}var M=this.m.subn(1),A=0;while(!M.isZero()&&M.andln(1)===0)A++,M.iushrn(1);P(!M.isZero());var v=new O(1).toRed(this),G=v.redNeg(),R=this.m.subn(1).iushrn(1),E=this.m.bitLength();E=new O(2*E*E).toRed(this);while(this.pow(E,R).cmp(G)!==0)E.redIAdd(G);var b=this.pow(E,M),x=this.pow(J,M.addn(1).iushrn(1)),l=this.pow(J,M),Q=A;while(l.cmp(v)!==0){var f$=l;for(var q$=0;f$.cmp(v)!==0;q$++)f$=f$.redSqr();P(q$<Q);var B=this.pow(b,new O(1).iushln(Q-q$-1));x=x.redMul(B),b=B.redSqr(),l=l.redMul(b),Q=q$}return x},W.prototype.invm=function(J){var Z=J._invmp(this.m);if(Z.negative!==0)return Z.negative=0,this.imod(Z).redNeg();else return this.imod(Z)},W.prototype.pow=function(J,Z){if(Z.isZero())return new O(1).toRed(this);if(Z.cmpn(1)===0)return J.clone();var V=4,M=Array(1<<V);M[0]=new O(1).toRed(this),M[1]=J;for(var A=2;A<M.length;A++)M[A]=this.mul(M[A-1],J);var v=M[0],G=0,R=0,E=Z.bitLength()%26;if(E===0)E=26;for(A=Z.length-1;A>=0;A--){var b=Z.words[A];for(var x=E-1;x>=0;x--){var l=b>>x&1;if(v!==M[0])v=this.sqr(v);if(l===0&&G===0){R=0;continue}if(G<<=1,G|=l,R++,R!==V&&(A!==0||x!==0))continue;v=this.mul(v,M[G]),R=0,G=0}E=26}return v},W.prototype.convertTo=function(J){var Z=J.umod(this.m);return Z===J?Z.clone():Z},W.prototype.convertFrom=function(J){var Z=J.clone();return Z.red=null,Z},O.mont=function(J){return new X(J)};function X(J){if(W.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(X,W),X.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X.prototype.convertFrom=function(J){var Z=this.imod(J.mul(this.rinv));return Z.red=null,Z},X.prototype.imul=function(J,Z){if(J.isZero()||Z.isZero())return J.words[0]=0,J.length=1,J;var V=J.imul(Z),M=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=V.isub(M).iushrn(this.shift),v=A;if(A.cmp(this.m)>=0)v=A.isub(this.m);else if(A.cmpn(0)<0)v=A.iadd(this.m);return v._forceRed(this)},X.prototype.mul=function(J,Z){if(J.isZero()||Z.isZero())return new O(0)._forceRed(this);var V=J.mul(Z),M=V.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=V.isub(M).iushrn(this.shift),v=A;if(A.cmp(this.m)>=0)v=A.isub(this.m);else if(A.cmpn(0)<0)v=A.iadd(this.m);return v._forceRed(this)},X.prototype.invm=function(J){var Z=this.imod(J._invmp(this.m).mul(this.r2));return Z._forceRed(this)}})(typeof q>"u"||q,$)}),EM=T$(($,q)=>{var _=wB(),K=G2(),P=mq().Buffer;function Y(T){var H=T.modulus.byteLength(),f;do f=new _(K(H));while(f.cmp(T.modulus)>=0||!f.umod(T.prime1)||!f.umod(T.prime2));return f}function O(T){var H=Y(T),f=H.toRed(_.mont(T.modulus)).redPow(new _(T.publicExponent)).fromRed();return{blinder:f,unblinder:H.invm(T.modulus)}}function z(T,H){var f=O(H),w=H.modulus.byteLength(),k=new _(T).mul(f.blinder).umod(H.modulus),S=k.toRed(_.mont(H.prime1)),N=k.toRed(_.mont(H.prime2)),h=H.coefficient,C=H.prime1,I=H.prime2,D=S.redPow(H.exponent1).fromRed(),L=N.redPow(H.exponent2).fromRed(),g=D.isub(L).imul(h).umod(C).imul(I);return L.iadd(g).imul(f.unblinder).umod(H.modulus).toArrayLike(P,"be",w)}z.getr=Y,q.exports=z}),fB=T$(($,q)=>{var _=SM(),K=G2(),P=V2(),Y=MM(),O=NM(),z=hH(),T=CM(),H=EM(),f=mq().Buffer;q.exports=function(N,h,C){var I;if(N.padding)I=N.padding;else if(C)I=1;else I=4;var D=_(N),L;if(I===4)L=w(D,h);else if(I===1)L=k(D,h,C);else if(I===3){if(L=new z(h),L.cmp(D.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(C)return H(L,D);else return T(L,D)};function w(N,h){var C=N.modulus.byteLength(),I=h.length,D=P("sha1").update(f.alloc(0)).digest(),L=D.length,g=2*L;if(I>C-g-2)throw Error("message too long");var y=f.alloc(C-I-g-2),c=C-L-1,o=K(L),s=O(f.concat([D,y,f.alloc(1,1),h],c),Y(o,c)),F=O(o,Y(s,L));return new z(f.concat([f.alloc(1),F,s],C))}function k(N,h,C){var I=h.length,D=N.modulus.byteLength();if(I>D-11)throw Error("message too long");var L;if(C)L=f.alloc(D-I-3,255);else L=S(D-I-3);return new z(f.concat([f.from([0,C?1:2]),L,f.alloc(1),h],D))}function S(N){var h=f.allocUnsafe(N),C=0,I=K(N*2),D=0,L;while(C<N){if(D===I.length)I=K(N*2),D=0;if(L=I[D++],L)h[C++]=L}return h}}),ZB=T$(($,q)=>{var _=SM(),K=MM(),P=NM(),Y=hH(),O=EM(),z=V2(),T=CM(),H=mq().Buffer;q.exports=function(S,N,h){var C;if(S.padding)C=S.padding;else if(h)C=1;else C=4;var I=_(S),D=I.modulus.byteLength();if(N.length>D||new Y(N).cmp(I.modulus)>=0)throw Error("decryption error");var L;if(h)L=T(new Y(N),I);else L=O(N,I);var g=H.alloc(D-L.length);if(L=H.concat([g,L],D),C===4)return f(I,L);else if(C===1)return w(I,L,h);else if(C===3)return L;else throw Error("unknown padding")};function f(S,N){var h=S.modulus.byteLength(),C=z("sha1").update(H.alloc(0)).digest(),I=C.length;if(N[0]!==0)throw Error("decryption error");var D=N.slice(1,I+1),L=N.slice(I+1),g=P(D,K(L,I)),y=P(L,K(g,h-I-1));if(k(C,y.slice(0,I)))throw Error("decryption error");var c=I;while(y[c]===0)c++;if(y[c++]!==1)throw Error("decryption error");return y.slice(c)}function w(S,N,h){var C=N.slice(0,2),I=2,D=0;while(N[I++]!==0)if(I>=N.length){D++;break}var L=N.slice(2,I-1);if(C.toString("hex")!=="0002"&&!h||C.toString("hex")!=="0001"&&h)D++;if(L.length<8)D++;if(D)throw Error("decryption error");return N.slice(I)}function k(S,N){S=H.from(S),N=H.from(N);var h=0,C=S.length;if(S.length!==N.length)h++,C=Math.min(S.length,N.length);var I=-1;while(++I<C)h+=S[I]^N[I];return h}}),AH=T$(($)=>{$.publicEncrypt=fB(),$.privateDecrypt=ZB(),$.privateEncrypt=function(q,_){return $.publicEncrypt(q,_,!0)},$.publicDecrypt=function(q,_){return $.privateDecrypt(q,_,!0)}}),XB=T$(($)=>{var q=(lq(),J6(dq));if(typeof q.publicEncrypt!=="function")q=AH();if($.publicEncrypt=q.publicEncrypt,$.privateDecrypt=q.privateDecrypt,typeof q.privateEncrypt!=="function")$.privateEncrypt=AH().privateEncrypt;else $.privateEncrypt=q.privateEncrypt;if(typeof q.publicDecrypt!=="function")$.publicDecrypt=AH().publicDecrypt;else $.publicDecrypt=q.publicDecrypt}),AB=T$(($)=>{var q=mq(),_=G2(),K=q.Buffer,P=q.kMaxLength,Y=globalThis.crypto||globalThis.msCrypto,O=Math.pow(2,32)-1;function z(k,S){if(typeof k!=="number"||k!==k)throw TypeError("offset must be a number");if(k>O||k<0)throw TypeError("offset must be a uint32");if(k>P||k>S)throw RangeError("offset out of range")}function T(k,S,N){if(typeof k!=="number"||k!==k)throw TypeError("size must be a number");if(k>O||k<0)throw TypeError("size must be a uint32");if(k+S>N||k>P)throw RangeError("buffer too small")}Y&&Y.getRandomValues,$.randomFill=H,$.randomFillSync=w;function H(k,S,N,h){if(!K.isBuffer(k)&&!(k instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof S==="function")h=S,S=0,N=k.length;else if(typeof N==="function")h=N,N=k.length-S;else if(typeof h!=="function")throw TypeError('"cb" argument must be a function');return z(S,k.length),T(N,S,k.length),f(k,S,N,h)}function f(k,S,N,h){if(!1)var C,I;if(h){_(N,function(L,g){if(L)return h(L);g.copy(k,S),h(null,k)});return}var D=_(N);return D.copy(k,S),k}function w(k,S,N){if(typeof S>"u")S=0;if(!K.isBuffer(k)&&!(k instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(S,k.length),N===void 0)N=k.length-S;return T(N,S,k.length),f(k,S,N)}}),kB=T$(($,q)=>{var _=(lq(),J6(dq));if(typeof _.randomFill==="function"&&typeof _.randomFillSync==="function")$.randomFill=_.randomFill,$.randomFillSync=_.randomFillSync;else q.exports=AB()}),GB=T$(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=G2(),$.createHash=$.Hash=V2(),$.createHmac=$.Hmac=$M();var q=on(),_=Object.keys(q),K=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(_);$.getHashes=function(){return K};var P=JM();$.pbkdf2=P.pbkdf2,$.pbkdf2Sync=P.pbkdf2Sync;var Y=Ei();$.Cipher=Y.Cipher,$.createCipher=Y.createCipher,$.Cipheriv=Y.Cipheriv,$.createCipheriv=Y.createCipheriv,$.Decipher=Y.Decipher,$.createDecipher=Y.createDecipher,$.Decipheriv=Y.Decipheriv,$.createDecipheriv=Y.createDecipheriv,$.getCiphers=Y.getCiphers,$.listCiphers=Y.listCiphers;var O=hi();$.DiffieHellmanGroup=O.DiffieHellmanGroup,$.createDiffieHellmanGroup=O.createDiffieHellmanGroup,$.getDiffieHellman=O.getDiffieHellman,$.createDiffieHellman=O.createDiffieHellman,$.DiffieHellman=O.DiffieHellman;var z=Ri();$.createSign=z.createSign,$.Sign=z.Sign,$.createVerify=z.createVerify,$.Verify=z.Verify,$.createECDH=ai();var T=XB();$.publicEncrypt=T.publicEncrypt,$.privateEncrypt=T.privateEncrypt,$.publicDecrypt=T.publicDecrypt,$.privateDecrypt=T.privateDecrypt;var H=kB();$.randomFill=H.randomFill,$.randomFillSync=H.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
36
+ })`)}catch(z){O=function(T){this._initNamed(T)}}return _(O,Y),O.prototype._initNamed=function(z){Y.call(this,z)},new O(this)},P.prototype._getDecoder=function(Y){if(Y=Y||"der",!this.decoders.hasOwnProperty(Y))this.decoders[Y]=this._createNamed(q.decoders[Y]);return this.decoders[Y]},P.prototype.decode=function(Y,O,z){return this._getDecoder(O).decode(Y,z)},P.prototype._getEncoder=function(Y){if(Y=Y||"der",!this.encoders.hasOwnProperty(Y))this.encoders[Y]=this._createNamed(q.encoders[Y]);return this.encoders[Y]},P.prototype.encode=function(Y,O,z){return this._getEncoder(O).encode(Y,z)}}),$B=T$(($)=>{var q=v8();function _(P){this._reporterState={obj:null,path:[],options:P||{},errors:[]}}$.Reporter=_,_.prototype.isError=function(P){return P instanceof K},_.prototype.save=function(){var P=this._reporterState;return{obj:P.obj,pathLen:P.path.length}},_.prototype.restore=function(P){var Y=this._reporterState;Y.obj=P.obj,Y.path=Y.path.slice(0,P.pathLen)},_.prototype.enterKey=function(P){return this._reporterState.path.push(P)},_.prototype.exitKey=function(P){var Y=this._reporterState;Y.path=Y.path.slice(0,P-1)},_.prototype.leaveKey=function(P,Y,O){var z=this._reporterState;if(this.exitKey(P),z.obj!==null)z.obj[Y]=O},_.prototype.path=function(){return this._reporterState.path.join("/")},_.prototype.enterObject=function(){var P=this._reporterState,Y=P.obj;return P.obj={},Y},_.prototype.leaveObject=function(P){var Y=this._reporterState,O=Y.obj;return Y.obj=P,O},_.prototype.error=function(P){var Y,O=this._reporterState,z=P instanceof K;if(z)Y=P;else Y=new K(O.path.map(function(T){return"["+JSON.stringify(T)+"]"}).join(""),P.message||P,P.stack);if(!O.options.partial)throw Y;if(!z)O.errors.push(Y);return Y},_.prototype.wrapResult=function(P){var Y=this._reporterState;if(!Y.options.partial)return P;return{result:this.isError(P)?null:P,errors:Y.errors}};function K(P,Y){this.path=P,this.rethrow(Y)}q(K,Error),K.prototype.rethrow=function(P){if(this.message=P+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,K);if(!this.stack)try{throw Error(this.message)}catch(Y){this.stack=Y.stack}return this}}),s0=T$(($)=>{var q=v8(),_=$1().Reporter,K=(wq(),J6(Tq)).Buffer;function P(O,z){if(_.call(this,z),!K.isBuffer(O)){this.error("Input not Buffer");return}this.base=O,this.offset=0,this.length=O.length}q(P,_),$.DecoderBuffer=P,P.prototype.save=function(){return{offset:this.offset,reporter:_.prototype.save.call(this)}},P.prototype.restore=function(O){var z=new P(this.base);return z.offset=O.offset,z.length=this.offset,this.offset=O.offset,_.prototype.restore.call(this,O.reporter),z},P.prototype.isEmpty=function(){return this.offset===this.length},P.prototype.readUInt8=function(O){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(O||"DecoderBuffer overrun")},P.prototype.skip=function(O,z){if(!(this.offset+O<=this.length))return this.error(z||"DecoderBuffer overrun");var T=new P(this.base);return T._reporterState=this._reporterState,T.offset=this.offset,T.length=this.offset+O,this.offset+=O,T},P.prototype.raw=function(O){return this.base.slice(O?O.offset:this.offset,this.length)};function Y(O,z){if(Array.isArray(O))this.length=0,this.value=O.map(function(T){if(!(T instanceof Y))T=new Y(T,z);return this.length+=T.length,T},this);else if(typeof O==="number"){if(!(0<=O&&O<=255))return z.error("non-byte EncoderBuffer value");this.value=O,this.length=1}else if(typeof O==="string")this.value=O,this.length=K.byteLength(O);else if(K.isBuffer(O))this.value=O,this.length=O.length;else return z.error("Unsupported type: "+typeof O)}$.EncoderBuffer=Y,Y.prototype.join=function(O,z){if(!O)O=new K(this.length);if(!z)z=0;if(this.length===0)return O;if(Array.isArray(this.value))this.value.forEach(function(T){T.join(O,z),z+=T.length});else{if(typeof this.value==="number")O[z]=this.value;else if(typeof this.value==="string")O.write(this.value,z);else if(K.isBuffer(this.value))this.value.copy(O,z);z+=this.length}return O}}),qB=T$(($,q)=>{var _=$1().Reporter,K=$1().EncoderBuffer,P=$1().DecoderBuffer,Y=PK(),O=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(O),T=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function H(w,k){var S={};if(this._baseState=S,S.enc=w,S.parent=k||null,S.children=null,S.tag=null,S.args=null,S.reverseArgs=null,S.choice=null,S.optional=!1,S.any=!1,S.obj=!1,S.use=null,S.useDecoder=null,S.key=null,S.default=null,S.explicit=null,S.implicit=null,S.contains=null,!S.parent)S.children=[],this._wrap()}q.exports=H;var f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];H.prototype.clone=function(){var w=this._baseState,k={};f.forEach(function(N){k[N]=w[N]});var S=new this.constructor(k.parent);return S._baseState=k,S},H.prototype._wrap=function(){var w=this._baseState;z.forEach(function(k){this[k]=function(){var S=new this.constructor(this);return w.children.push(S),S[k].apply(S,arguments)}},this)},H.prototype._init=function(w){var k=this._baseState;Y(k.parent===null),w.call(this),k.children=k.children.filter(function(S){return S._baseState.parent===this},this),Y.equal(k.children.length,1,"Root node can have only one child")},H.prototype._useArgs=function(w){var k=this._baseState,S=w.filter(function(N){return N instanceof this.constructor},this);if(w=w.filter(function(N){return!(N instanceof this.constructor)},this),S.length!==0)Y(k.children===null),k.children=S,S.forEach(function(N){N._baseState.parent=this},this);if(w.length!==0)Y(k.args===null),k.args=w,k.reverseArgs=w.map(function(N){if(typeof N!=="object"||N.constructor!==Object)return N;var h={};return Object.keys(N).forEach(function(C){if(C==(C|0))C|=0;var I=N[C];h[I]=C}),h})},T.forEach(function(w){H.prototype[w]=function(){var k=this._baseState;throw Error(w+" not implemented for encoding: "+k.enc)}}),O.forEach(function(w){H.prototype[w]=function(){var k=this._baseState,S=Array.prototype.slice.call(arguments);return Y(k.tag===null),k.tag=w,this._useArgs(S),this}}),H.prototype.use=function(w){Y(w);var k=this._baseState;return Y(k.use===null),k.use=w,this},H.prototype.optional=function(){var w=this._baseState;return w.optional=!0,this},H.prototype.def=function(w){var k=this._baseState;return Y(k.default===null),k.default=w,k.optional=!0,this},H.prototype.explicit=function(w){var k=this._baseState;return Y(k.explicit===null&&k.implicit===null),k.explicit=w,this},H.prototype.implicit=function(w){var k=this._baseState;return Y(k.explicit===null&&k.implicit===null),k.implicit=w,this},H.prototype.obj=function(){var w=this._baseState,k=Array.prototype.slice.call(arguments);if(w.obj=!0,k.length!==0)this._useArgs(k);return this},H.prototype.key=function(w){var k=this._baseState;return Y(k.key===null),k.key=w,this},H.prototype.any=function(){var w=this._baseState;return w.any=!0,this},H.prototype.choice=function(w){var k=this._baseState;return Y(k.choice===null),k.choice=w,this._useArgs(Object.keys(w).map(function(S){return w[S]})),this},H.prototype.contains=function(w){var k=this._baseState;return Y(k.use===null),k.contains=w,this},H.prototype._decode=function(w,k){var S=this._baseState;if(S.parent===null)return w.wrapResult(S.children[0]._decode(w,k));var N=S.default,h=!0,C=null;if(S.key!==null)C=w.enterKey(S.key);if(S.optional){var I=null;if(S.explicit!==null)I=S.explicit;else if(S.implicit!==null)I=S.implicit;else if(S.tag!==null)I=S.tag;if(I===null&&!S.any){var D=w.save();try{if(S.choice===null)this._decodeGeneric(S.tag,w,k);else this._decodeChoice(w,k);h=!0}catch(s){h=!1}w.restore(D)}else if(h=this._peekTag(w,I,S.any),w.isError(h))return h}var L;if(S.obj&&h)L=w.enterObject();if(h){if(S.explicit!==null){var g=this._decodeTag(w,S.explicit);if(w.isError(g))return g;w=g}var y=w.offset;if(S.use===null&&S.choice===null){if(S.any)var D=w.save();var p=this._decodeTag(w,S.implicit!==null?S.implicit:S.tag,S.any);if(w.isError(p))return p;if(S.any)N=w.raw(D);else w=p}if(k&&k.track&&S.tag!==null)k.track(w.path(),y,w.length,"tagged");if(k&&k.track&&S.tag!==null)k.track(w.path(),w.offset,w.length,"content");if(S.any)N=N;else if(S.choice===null)N=this._decodeGeneric(S.tag,w,k);else N=this._decodeChoice(w,k);if(w.isError(N))return N;if(!S.any&&S.choice===null&&S.children!==null)S.children.forEach(function(s){s._decode(w,k)});if(S.contains&&(S.tag==="octstr"||S.tag==="bitstr")){var o=new P(N);N=this._getUse(S.contains,w._reporterState.obj)._decode(o,k)}}if(S.obj&&h)N=w.leaveObject(L);if(S.key!==null&&(N!==null||h===!0))w.leaveKey(C,S.key,N);else if(C!==null)w.exitKey(C);return N},H.prototype._decodeGeneric=function(w,k,S){var N=this._baseState;if(w==="seq"||w==="set")return null;if(w==="seqof"||w==="setof")return this._decodeList(k,w,N.args[0],S);else if(/str$/.test(w))return this._decodeStr(k,w,S);else if(w==="objid"&&N.args)return this._decodeObjid(k,N.args[0],N.args[1],S);else if(w==="objid")return this._decodeObjid(k,null,null,S);else if(w==="gentime"||w==="utctime")return this._decodeTime(k,w,S);else if(w==="null_")return this._decodeNull(k,S);else if(w==="bool")return this._decodeBool(k,S);else if(w==="objDesc")return this._decodeStr(k,w,S);else if(w==="int"||w==="enum")return this._decodeInt(k,N.args&&N.args[0],S);if(N.use!==null)return this._getUse(N.use,k._reporterState.obj)._decode(k,S);else return k.error("unknown tag: "+w)},H.prototype._getUse=function(w,k){var S=this._baseState;if(S.useDecoder=this._use(w,k),Y(S.useDecoder._baseState.parent===null),S.useDecoder=S.useDecoder._baseState.children[0],S.implicit!==S.useDecoder._baseState.implicit)S.useDecoder=S.useDecoder.clone(),S.useDecoder._baseState.implicit=S.implicit;return S.useDecoder},H.prototype._decodeChoice=function(w,k){var S=this._baseState,N=null,h=!1;if(Object.keys(S.choice).some(function(C){var I=w.save(),D=S.choice[C];try{var L=D._decode(w,k);if(w.isError(L))return!1;N={type:C,value:L},h=!0}catch(g){return w.restore(I),!1}return!0},this),!h)return w.error("Choice not matched");return N},H.prototype._createEncoderBuffer=function(w){return new K(w,this.reporter)},H.prototype._encode=function(w,k,S){var N=this._baseState;if(N.default!==null&&N.default===w)return;var h=this._encodeValue(w,k,S);if(h===void 0)return;if(this._skipDefault(h,k,S))return;return h},H.prototype._encodeValue=function(w,k,S){var N=this._baseState;if(N.parent===null)return N.children[0]._encode(w,k||new _);var D=null;if(this.reporter=k,N.optional&&w===void 0)if(N.default!==null)w=N.default;else return;var h=null,C=!1;if(N.any)D=this._createEncoderBuffer(w);else if(N.choice)D=this._encodeChoice(w,k);else if(N.contains)h=this._getUse(N.contains,S)._encode(w,k),C=!0;else if(N.children)h=N.children.map(function(y){if(y._baseState.tag==="null_")return y._encode(null,k,w);if(y._baseState.key===null)return k.error("Child should have a key");var p=k.enterKey(y._baseState.key);if(typeof w!=="object")return k.error("Child expected, but input is not object");var o=y._encode(w[y._baseState.key],k,w);return k.leaveKey(p),o},this).filter(function(y){return y}),h=this._createEncoderBuffer(h);else if(N.tag==="seqof"||N.tag==="setof"){if(!(N.args&&N.args.length===1))return k.error("Too many args for : "+N.tag);if(!Array.isArray(w))return k.error("seqof/setof, but data is not Array");var I=this.clone();I._baseState.implicit=null,h=this._createEncoderBuffer(w.map(function(y){var p=this._baseState;return this._getUse(p.args[0],w)._encode(y,k)},I))}else if(N.use!==null)D=this._getUse(N.use,S)._encode(w,k);else h=this._encodePrimitive(N.tag,w),C=!0;var D;if(!N.any&&N.choice===null){var L=N.implicit!==null?N.implicit:N.tag,g=N.implicit===null?"universal":"context";if(L===null){if(N.use===null)k.error("Tag could be omitted only for .use()")}else if(N.use===null)D=this._encodeComposite(L,C,g,h)}if(N.explicit!==null)D=this._encodeComposite(N.explicit,!1,"context",D);return D},H.prototype._encodeChoice=function(w,k){var S=this._baseState,N=S.choice[w.type];if(!N)Y(!1,w.type+" not found in "+JSON.stringify(Object.keys(S.choice)));return N._encode(w.value,k)},H.prototype._encodePrimitive=function(w,k){var S=this._baseState;if(/str$/.test(w))return this._encodeStr(k,w);else if(w==="objid"&&S.args)return this._encodeObjid(k,S.reverseArgs[0],S.args[1]);else if(w==="objid")return this._encodeObjid(k,null,null);else if(w==="gentime"||w==="utctime")return this._encodeTime(k,w);else if(w==="null_")return this._encodeNull();else if(w==="int"||w==="enum")return this._encodeInt(k,S.args&&S.reverseArgs[0]);else if(w==="bool")return this._encodeBool(k);else if(w==="objDesc")return this._encodeStr(k,w);else throw Error("Unsupported tag: "+w)},H.prototype._isNumstr=function(w){return/^[0-9 ]*$/.test(w)},H.prototype._isPrintstr=function(w){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(w)}}),$1=T$(($)=>{var q=$;q.Reporter=$B().Reporter,q.DecoderBuffer=s0().DecoderBuffer,q.EncoderBuffer=s0().EncoderBuffer,q.Node=qB()}),_B=T$(($)=>{var q=AM();$.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)}),AM=T$(($)=>{var q=$;q._reverse=function(_){var K={};return Object.keys(_).forEach(function(P){if((P|0)==P)P=P|0;var Y=_[P];K[Y]=P}),K},q.der=_B()}),kM=T$(($,q)=>{var _=v8(),K=Y1(),P=K.base,Y=K.bignum,O=K.constants.der;function z(w){this.enc="der",this.name=w.name,this.entity=w,this.tree=new T,this.tree._init(w.body)}q.exports=z,z.prototype.decode=function(w,k){if(!(w instanceof P.DecoderBuffer))w=new P.DecoderBuffer(w,k);return this.tree._decode(w,k)};function T(w){P.Node.call(this,"der",w)}_(T,P.Node),T.prototype._peekTag=function(w,k,S){if(w.isEmpty())return!1;var N=w.save(),h=H(w,'Failed to peek tag: "'+k+'"');if(w.isError(h))return h;return w.restore(N),h.tag===k||h.tagStr===k||h.tagStr+"of"===k||S},T.prototype._decodeTag=function(w,k,S){var N=H(w,'Failed to decode tag of "'+k+'"');if(w.isError(N))return N;var h=f(w,N.primitive,'Failed to get length of "'+k+'"');if(w.isError(h))return h;if(!S&&N.tag!==k&&N.tagStr!==k&&N.tagStr+"of"!==k)return w.error('Failed to match tag: "'+k+'"');if(N.primitive||h!==null)return w.skip(h,'Failed to match body of: "'+k+'"');var C=w.save(),I=this._skipUntilEnd(w,'Failed to skip indefinite length body: "'+this.tag+'"');if(w.isError(I))return I;return h=w.offset-C.offset,w.restore(C),w.skip(h,'Failed to match body of: "'+k+'"')},T.prototype._skipUntilEnd=function(w,k){while(!0){var S=H(w,k);if(w.isError(S))return S;var N=f(w,S.primitive,k);if(w.isError(N))return N;var h;if(S.primitive||N!==null)h=w.skip(N);else h=this._skipUntilEnd(w,k);if(w.isError(h))return h;if(S.tagStr==="end")break}},T.prototype._decodeList=function(w,k,S,N){var h=[];while(!w.isEmpty()){var C=this._peekTag(w,"end");if(w.isError(C))return C;var I=S.decode(w,"der",N);if(w.isError(I)&&C)break;h.push(I)}return h},T.prototype._decodeStr=function(w,k){if(k==="bitstr"){var S=w.readUInt8();if(w.isError(S))return S;return{unused:S,data:w.raw()}}else if(k==="bmpstr"){var N=w.raw();if(N.length%2===1)return w.error("Decoding of string type: bmpstr length mismatch");var h="";for(var C=0;C<N.length/2;C++)h+=String.fromCharCode(N.readUInt16BE(C*2));return h}else if(k==="numstr"){var I=w.raw().toString("ascii");if(!this._isNumstr(I))return w.error("Decoding of string type: numstr unsupported characters");return I}else if(k==="octstr")return w.raw();else if(k==="objDesc")return w.raw();else if(k==="printstr"){var D=w.raw().toString("ascii");if(!this._isPrintstr(D))return w.error("Decoding of string type: printstr unsupported characters");return D}else if(/str$/.test(k))return w.raw().toString();else return w.error("Decoding of string type: "+k+" unsupported")},T.prototype._decodeObjid=function(w,k,S){var N,h=[],C=0;while(!w.isEmpty()){var I=w.readUInt8();if(C<<=7,C|=I&127,(I&128)===0)h.push(C),C=0}if(I&128)h.push(C);var D=h[0]/40|0,L=h[0]%40;if(S)N=h;else N=[D,L].concat(h.slice(1));if(k){var g=k[N.join(" ")];if(g===void 0)g=k[N.join(".")];if(g!==void 0)N=g}return N},T.prototype._decodeTime=function(w,k){var S=w.raw().toString();if(k==="gentime")var N=S.slice(0,4)|0,h=S.slice(4,6)|0,C=S.slice(6,8)|0,I=S.slice(8,10)|0,D=S.slice(10,12)|0,L=S.slice(12,14)|0;else if(k==="utctime"){var N=S.slice(0,2)|0,h=S.slice(2,4)|0,C=S.slice(4,6)|0,I=S.slice(6,8)|0,D=S.slice(8,10)|0,L=S.slice(10,12)|0;if(N<70)N=2000+N;else N=1900+N}else return w.error("Decoding "+k+" time is not supported yet");return Date.UTC(N,h-1,C,I,D,L,0)},T.prototype._decodeNull=function(w){return null},T.prototype._decodeBool=function(w){var k=w.readUInt8();if(w.isError(k))return k;else return k!==0},T.prototype._decodeInt=function(w,k){var S=w.raw(),N=new Y(S);if(k)N=k[N.toString(10)]||N;return N},T.prototype._use=function(w,k){if(typeof w==="function")w=w(k);return w._getDecoder("der").tree};function H(w,k){var S=w.readUInt8(k);if(w.isError(S))return S;var N=O.tagClass[S>>6],h=(S&32)===0;if((S&31)===31){var C=S;S=0;while((C&128)===128){if(C=w.readUInt8(k),w.isError(C))return C;S<<=7,S|=C&127}}else S&=31;var I=O.tag[S];return{cls:N,primitive:h,tag:S,tagStr:I}}function f(w,k,S){var N=w.readUInt8(S);if(w.isError(N))return N;if(!k&&N===128)return null;if((N&128)===0)return N;var h=N&127;if(h>4)return w.error("length octect is too long");N=0;for(var C=0;C<h;C++){N<<=8;var I=w.readUInt8(S);if(w.isError(I))return I;N|=I}return N}}),KB=T$(($,q)=>{var _=v8(),K=(wq(),J6(Tq)).Buffer,P=kM();function Y(O){P.call(this,O),this.enc="pem"}_(Y,P),q.exports=Y,Y.prototype.decode=function(O,z){var T=O.toString().split(/[\r\n]+/g),H=z.label.toUpperCase(),f=/^-----(BEGIN|END) ([^-]+)-----$/,w=-1,k=-1;for(var S=0;S<T.length;S++){var N=T[S].match(f);if(N===null)continue;if(N[2]!==H)continue;if(w===-1){if(N[1]!=="BEGIN")break;w=S}else{if(N[1]!=="END")break;k=S;break}}if(w===-1||k===-1)throw Error("PEM section not found for: "+H);var h=T.slice(w+1,k).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var C=new K(h,"base64");return P.prototype.decode.call(this,C,z)}}),PB=T$(($)=>{var q=$;q.der=kM(),q.pem=KB()}),GM=T$(($,q)=>{var _=v8(),K=(wq(),J6(Tq)).Buffer,P=Y1(),Y=P.base,O=P.constants.der;function z(w){this.enc="der",this.name=w.name,this.entity=w,this.tree=new T,this.tree._init(w.body)}q.exports=z,z.prototype.encode=function(w,k){return this.tree._encode(w,k).join()};function T(w){Y.Node.call(this,"der",w)}_(T,Y.Node),T.prototype._encodeComposite=function(w,k,S,N){var h=f(w,k,S,this.reporter);if(N.length<128){var D=new K(2);return D[0]=h,D[1]=N.length,this._createEncoderBuffer([D,N])}var C=1;for(var I=N.length;I>=256;I>>=8)C++;var D=new K(2+C);D[0]=h,D[1]=128|C;for(var I=1+C,L=N.length;L>0;I--,L>>=8)D[I]=L&255;return this._createEncoderBuffer([D,N])},T.prototype._encodeStr=function(w,k){if(k==="bitstr")return this._createEncoderBuffer([w.unused|0,w.data]);else if(k==="bmpstr"){var S=new K(w.length*2);for(var N=0;N<w.length;N++)S.writeUInt16BE(w.charCodeAt(N),N*2);return this._createEncoderBuffer(S)}else if(k==="numstr"){if(!this._isNumstr(w))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(w)}else if(k==="printstr"){if(!this._isPrintstr(w))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(w)}else if(/str$/.test(k))return this._createEncoderBuffer(w);else if(k==="objDesc")return this._createEncoderBuffer(w);else return this.reporter.error("Encoding of string type: "+k+" unsupported")},T.prototype._encodeObjid=function(w,k,S){if(typeof w==="string"){if(!k)return this.reporter.error("string objid given, but no values map found");if(!k.hasOwnProperty(w))return this.reporter.error("objid not found in values map");w=k[w].split(/[\s\.]+/g);for(var N=0;N<w.length;N++)w[N]|=0}else if(Array.isArray(w)){w=w.slice();for(var N=0;N<w.length;N++)w[N]|=0}if(!Array.isArray(w))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(w));if(!S){if(w[1]>=40)return this.reporter.error("Second objid identifier OOB");w.splice(0,2,w[0]*40+w[1])}var h=0;for(var N=0;N<w.length;N++){var C=w[N];for(h++;C>=128;C>>=7)h++}var I=new K(h),D=I.length-1;for(var N=w.length-1;N>=0;N--){var C=w[N];I[D--]=C&127;while((C>>=7)>0)I[D--]=128|C&127}return this._createEncoderBuffer(I)};function H(w){if(w<10)return"0"+w;else return w}T.prototype._encodeTime=function(w,k){var S,N=new Date(w);if(k==="gentime")S=[H(N.getFullYear()),H(N.getUTCMonth()+1),H(N.getUTCDate()),H(N.getUTCHours()),H(N.getUTCMinutes()),H(N.getUTCSeconds()),"Z"].join("");else if(k==="utctime")S=[H(N.getFullYear()%100),H(N.getUTCMonth()+1),H(N.getUTCDate()),H(N.getUTCHours()),H(N.getUTCMinutes()),H(N.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+k+" time is not supported yet");return this._encodeStr(S,"octstr")},T.prototype._encodeNull=function(){return this._createEncoderBuffer("")},T.prototype._encodeInt=function(w,k){if(typeof w==="string"){if(!k)return this.reporter.error("String int or enum given, but no values map");if(!k.hasOwnProperty(w))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(w));w=k[w]}if(typeof w!=="number"&&!K.isBuffer(w)){var S=w.toArray();if(!w.sign&&S[0]&128)S.unshift(0);w=new K(S)}if(K.isBuffer(w)){var N=w.length;if(w.length===0)N++;var C=new K(N);if(w.copy(C),w.length===0)C[0]=0;return this._createEncoderBuffer(C)}if(w<128)return this._createEncoderBuffer(w);if(w<256)return this._createEncoderBuffer([0,w]);var N=1;for(var h=w;h>=256;h>>=8)N++;var C=Array(N);for(var h=C.length-1;h>=0;h--)C[h]=w&255,w>>=8;if(C[0]&128)C.unshift(0);return this._createEncoderBuffer(new K(C))},T.prototype._encodeBool=function(w){return this._createEncoderBuffer(w?255:0)},T.prototype._use=function(w,k){if(typeof w==="function")w=w(k);return w._getEncoder("der").tree},T.prototype._skipDefault=function(w,k,S){var N=this._baseState,h;if(N.default===null)return!1;var C=w.join();if(N.defaultBuffer===void 0)N.defaultBuffer=this._encodeValue(N.default,k,S).join();if(C.length!==N.defaultBuffer.length)return!1;for(h=0;h<C.length;h++)if(C[h]!==N.defaultBuffer[h])return!1;return!0};function f(w,k,S,N){var h;if(w==="seqof")w="seq";else if(w==="setof")w="set";if(O.tagByName.hasOwnProperty(w))h=O.tagByName[w];else if(typeof w==="number"&&(w|0)===w)h=w;else return N.error("Unknown tag: "+w);if(h>=31)return N.error("Multi-octet tag encoding unsupported");if(!k)h|=32;return h|=O.tagClassByName[S||"universal"]<<6,h}}),YB=T$(($,q)=>{var _=v8(),K=GM();function P(Y){K.call(this,Y),this.enc="pem"}_(P,K),q.exports=P,P.prototype.encode=function(Y,O){var z=K.prototype.encode.call(this,Y),T=z.toString("base64"),H=["-----BEGIN "+O.label+"-----"];for(var f=0;f<T.length;f+=64)H.push(T.slice(f,f+64));return H.push("-----END "+O.label+"-----"),H.join(`
37
+ `)}}),OB=T$(($)=>{var q=$;q.der=GM(),q.pem=YB()}),Y1=T$(($)=>{var q=$;q.bignum=ei(),q.define=si().define,q.base=$1(),q.constants=AM(),q.decoders=PB(),q.encoders=OB()}),jB=T$(($,q)=>{var _=Y1(),K=_.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),P=_.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),Y=_.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),O=_.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(Y),this.key("subjectPublicKey").bitstr())}),z=_.define("RelativeDistinguishedName",function(){this.setof(P)}),T=_.define("RDNSequence",function(){this.seqof(z)}),H=_.define("Name",function(){this.choice({rdnSequence:this.use(T)})}),f=_.define("Validity",function(){this.seq().obj(this.key("notBefore").use(K),this.key("notAfter").use(K))}),w=_.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),k=_.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(Y),this.key("issuer").use(H),this.key("validity").use(f),this.key("subject").use(H),this.key("subjectPublicKeyInfo").use(O),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(w).optional())}),S=_.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(k),this.key("signatureAlgorithm").use(Y),this.key("signatureValue").bitstr())});q.exports=S}),vB=T$(($)=>{var q=Y1();$.certificate=jB();var _=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=_;var K=q.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=K;var P=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())}),Y=q.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(P),this.key("subjectPublicKey").bitstr())});$.PublicKey=Y;var O=q.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(P),this.key("subjectPrivateKey").octstr())});$.PrivateKey=O;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 T=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=T,$.DSAparam=q.define("DSAparam",function(){this.int()});var H=q.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),f=q.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(H),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=f,$.signature=q.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),zB=T$(($,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"}}),WB=T$(($,q)=>{var _=mq().Buffer,K=XH().Transform,P=v8();function Y(H){K.call(this),this._block=_.allocUnsafe(H),this._blockSize=H,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}P(Y,K),Y.prototype._transform=function(H,f,w){var k=null;try{this.update(H,f)}catch(S){k=S}w(k)},Y.prototype._flush=function(H){var f=null;try{this.push(this.digest())}catch(w){f=w}H(f)};var O=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(_.prototype instanceof Uint8Array||_.TYPED_ARRAY_SUPPORT);function T(H,f){if(H instanceof _)return H;if(typeof H==="string")return _.from(H,f);if(z&&ArrayBuffer.isView(H)){if(H.byteLength===0)return _.alloc(0);var w=_.from(H.buffer,H.byteOffset,H.byteLength);if(w.byteLength===H.byteLength)return w}if(O&&H instanceof Uint8Array)return _.from(H);if(_.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return _.from(H);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}Y.prototype.update=function(H,f){if(this._finalized)throw Error("Digest already called");H=T(H,f);var w=this._block,k=0;while(this._blockOffset+H.length-k>=this._blockSize){for(var S=this._blockOffset;S<this._blockSize;)w[S++]=H[k++];this._update(),this._blockOffset=0}while(k<H.length)w[this._blockOffset++]=H[k++];for(var N=0,h=H.length*8;h>0;++N)if(this._length[N]+=h,h=this._length[N]/4294967296|0,h>0)this._length[N]-=4294967296*h;return this},Y.prototype._update=function(){throw Error("_update is not implemented")},Y.prototype.digest=function(H){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var f=this._digest();if(H!==void 0)f=f.toString(H);this._block.fill(0),this._blockOffset=0;for(var w=0;w<4;++w)this._length[w]=0;return f},Y.prototype._digest=function(){throw Error("_digest is not implemented")},q.exports=Y}),JB=T$(($,q)=>{var _=v8(),K=WB(),P=mq().Buffer,Y=Array(16);function O(){K.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}_(O,K),O.prototype._update=function(){var k=Y;for(var S=0;S<16;++S)k[S]=this._block.readInt32LE(S*4);var N=this._a,h=this._b,C=this._c,I=this._d;N=T(N,h,C,I,k[0],3614090360,7),I=T(I,N,h,C,k[1],3905402710,12),C=T(C,I,N,h,k[2],606105819,17),h=T(h,C,I,N,k[3],3250441966,22),N=T(N,h,C,I,k[4],4118548399,7),I=T(I,N,h,C,k[5],1200080426,12),C=T(C,I,N,h,k[6],2821735955,17),h=T(h,C,I,N,k[7],4249261313,22),N=T(N,h,C,I,k[8],1770035416,7),I=T(I,N,h,C,k[9],2336552879,12),C=T(C,I,N,h,k[10],4294925233,17),h=T(h,C,I,N,k[11],2304563134,22),N=T(N,h,C,I,k[12],1804603682,7),I=T(I,N,h,C,k[13],4254626195,12),C=T(C,I,N,h,k[14],2792965006,17),h=T(h,C,I,N,k[15],1236535329,22),N=H(N,h,C,I,k[1],4129170786,5),I=H(I,N,h,C,k[6],3225465664,9),C=H(C,I,N,h,k[11],643717713,14),h=H(h,C,I,N,k[0],3921069994,20),N=H(N,h,C,I,k[5],3593408605,5),I=H(I,N,h,C,k[10],38016083,9),C=H(C,I,N,h,k[15],3634488961,14),h=H(h,C,I,N,k[4],3889429448,20),N=H(N,h,C,I,k[9],568446438,5),I=H(I,N,h,C,k[14],3275163606,9),C=H(C,I,N,h,k[3],4107603335,14),h=H(h,C,I,N,k[8],1163531501,20),N=H(N,h,C,I,k[13],2850285829,5),I=H(I,N,h,C,k[2],4243563512,9),C=H(C,I,N,h,k[7],1735328473,14),h=H(h,C,I,N,k[12],2368359562,20),N=f(N,h,C,I,k[5],4294588738,4),I=f(I,N,h,C,k[8],2272392833,11),C=f(C,I,N,h,k[11],1839030562,16),h=f(h,C,I,N,k[14],4259657740,23),N=f(N,h,C,I,k[1],2763975236,4),I=f(I,N,h,C,k[4],1272893353,11),C=f(C,I,N,h,k[7],4139469664,16),h=f(h,C,I,N,k[10],3200236656,23),N=f(N,h,C,I,k[13],681279174,4),I=f(I,N,h,C,k[0],3936430074,11),C=f(C,I,N,h,k[3],3572445317,16),h=f(h,C,I,N,k[6],76029189,23),N=f(N,h,C,I,k[9],3654602809,4),I=f(I,N,h,C,k[12],3873151461,11),C=f(C,I,N,h,k[15],530742520,16),h=f(h,C,I,N,k[2],3299628645,23),N=w(N,h,C,I,k[0],4096336452,6),I=w(I,N,h,C,k[7],1126891415,10),C=w(C,I,N,h,k[14],2878612391,15),h=w(h,C,I,N,k[5],4237533241,21),N=w(N,h,C,I,k[12],1700485571,6),I=w(I,N,h,C,k[3],2399980690,10),C=w(C,I,N,h,k[10],4293915773,15),h=w(h,C,I,N,k[1],2240044497,21),N=w(N,h,C,I,k[8],1873313359,6),I=w(I,N,h,C,k[15],4264355552,10),C=w(C,I,N,h,k[6],2734768916,15),h=w(h,C,I,N,k[13],1309151649,21),N=w(N,h,C,I,k[4],4149444226,6),I=w(I,N,h,C,k[11],3174756917,10),C=w(C,I,N,h,k[2],718787259,15),h=w(h,C,I,N,k[9],3951481745,21),this._a=this._a+N|0,this._b=this._b+h|0,this._c=this._c+C|0,this._d=this._d+I|0},O.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 k=P.allocUnsafe(16);return k.writeInt32LE(this._a,0),k.writeInt32LE(this._b,4),k.writeInt32LE(this._c,8),k.writeInt32LE(this._d,12),k};function z(k,S){return k<<S|k>>>32-S}function T(k,S,N,h,C,I,D){return z(k+(S&N|~S&h)+C+I|0,D)+S|0}function H(k,S,N,h,C,I,D){return z(k+(S&h|N&~h)+C+I|0,D)+S|0}function f(k,S,N,h,C,I,D){return z(k+(S^N^h)+C+I|0,D)+S|0}function w(k,S,N,h,C,I,D){return z(k+(N^(S|~h))+C+I|0,D)+S|0}q.exports=O}),HB=T$(($,q)=>{var _=mq().Buffer,K=JB();function P(Y,O,z,T){if(!_.isBuffer(Y))Y=_.from(Y,"binary");if(O){if(!_.isBuffer(O))O=_.from(O,"binary");if(O.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var H=z/8,f=_.alloc(H),w=_.alloc(T||0),k=_.alloc(0);while(H>0||T>0){var S=new K;if(S.update(k),S.update(Y),O)S.update(O);k=S.digest();var N=0;if(H>0){var h=f.length-H;N=Math.min(H,k.length),k.copy(f,h,0,N),H-=N}if(N<k.length&&T>0){var C=w.length-T,I=Math.min(T,k.length-N);k.copy(w,C,N,N+I),T-=I}}return k.fill(0),{key:f,iv:w}}q.exports=P}),VM=T$(($)=>{var q=(lq(),J6(dq));$.createCipher=$.Cipher=q.createCipher,$.createCipheriv=$.Cipheriv=q.createCipheriv,$.createDecipher=$.Decipher=q.createDecipher,$.createDecipheriv=$.Decipheriv=q.createDecipheriv,$.listCiphers=$.getCiphers=q.getCiphers}),TB=T$(($,q)=>{var _=/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,K=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,P=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,Y=HB(),O=VM(),z=mq().Buffer;q.exports=function(T,H){var f=T.toString(),w=f.match(_),k;if(!w){var S=f.match(P);k=z.from(S[2].replace(/[\r\n]/g,""),"base64")}else{var N="aes"+w[1],h=z.from(w[2],"hex"),C=z.from(w[3].replace(/[\r\n]/g,""),"base64"),I=Y(H,h.slice(0,8),parseInt(w[1],10)).key,D=[],L=O.createDecipheriv(N,I,h);D.push(L.update(C)),D.push(L.final()),k=z.concat(D)}var g=f.match(K)[1];return{tag:g,data:k}}}),SM=T$(($,q)=>{var _=vB(),K=zB(),P=TB(),Y=VM(),O=JM().pbkdf2Sync,z=mq().Buffer;function T(f,w){var k=f.algorithm.decrypt.kde.kdeparams.salt,S=parseInt(f.algorithm.decrypt.kde.kdeparams.iters.toString(),10),N=K[f.algorithm.decrypt.cipher.algo.join(".")],h=f.algorithm.decrypt.cipher.iv,C=f.subjectPrivateKey,I=parseInt(N.split("-")[1],10)/8,D=O(w,k,S,I,"sha1"),L=Y.createDecipheriv(N,D,h),g=[];return g.push(L.update(C)),g.push(L.final()),z.concat(g)}function H(f){var w;if(typeof f==="object"&&!z.isBuffer(f))w=f.passphrase,f=f.key;if(typeof f==="string")f=z.from(f);var k=P(f,w),S=k.tag,N=k.data,h,C;switch(S){case"CERTIFICATE":C=_.certificate.decode(N,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!C)C=_.PublicKey.decode(N,"der");switch(h=C.algorithm.algorithm.join("."),h){case"1.2.840.113549.1.1.1":return _.RSAPublicKey.decode(C.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return C.subjectPrivateKey=C.subjectPublicKey,{type:"ec",data:C};case"1.2.840.10040.4.1":return C.algorithm.params.pub_key=_.DSAparam.decode(C.subjectPublicKey.data,"der"),{type:"dsa",data:C.algorithm.params};default:throw Error("unknown key id "+h)}case"ENCRYPTED PRIVATE KEY":N=_.EncryptedPrivateKey.decode(N,"der"),N=T(N,w);case"PRIVATE KEY":switch(C=_.PrivateKey.decode(N,"der"),h=C.algorithm.algorithm.join("."),h){case"1.2.840.113549.1.1.1":return _.RSAPrivateKey.decode(C.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:C.algorithm.curve,privateKey:_.ECPrivateKey.decode(C.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return C.algorithm.params.priv_key=_.DSAparam.decode(C.subjectPrivateKey,"der"),{type:"dsa",params:C.algorithm.params};default:throw Error("unknown key id "+h)}case"RSA PUBLIC KEY":return _.RSAPublicKey.decode(N,"der");case"RSA PRIVATE KEY":return _.RSAPrivateKey.decode(N,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:_.DSAPrivateKey.decode(N,"der")};case"EC PRIVATE KEY":return N=_.ECPrivateKey.decode(N,"der"),{curve:N.parameters.value,privateKey:N.privateKey};default:throw Error("unknown key type "+S)}}H.signature=_.signature,q.exports=H}),MM=T$(($,q)=>{var _=V2(),K=mq().Buffer;q.exports=function(Y,O){var z=K.alloc(0),T=0,H;while(z.length<O)H=P(T++),z=K.concat([z,_("sha1").update(Y).update(H).digest()]);return z.slice(0,O)};function P(Y){var O=K.allocUnsafe(4);return O.writeUInt32BE(Y,0),O}}),NM=T$(($,q)=>{q.exports=function(_,K){var P=_.length,Y=-1;while(++Y<P)_[Y]^=K[Y];return _}}),hH=T$(($,q)=>{(function(_,K){function P(j,W){if(!j)throw Error(W||"Assertion failed")}function Y(j,W){j.super_=W;var X=function(){};X.prototype=W.prototype,j.prototype=new X,j.prototype.constructor=j}function O(j,W,X){if(O.isBN(j))return j;if(this.negative=0,this.words=null,this.length=0,this.red=null,j!==null){if(W==="le"||W==="be")X=W,W=10;this._init(j||0,W||10,X||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(j){}O.isBN=function(j){if(j instanceof O)return!0;return j!==null&&typeof j==="object"&&j.constructor.wordSize===O.wordSize&&Array.isArray(j.words)},O.max=function(j,W){if(j.cmp(W)>0)return j;return W},O.min=function(j,W){if(j.cmp(W)<0)return j;return W},O.prototype._init=function(j,W,X){if(typeof j==="number")return this._initNumber(j,W,X);if(typeof j==="object")return this._initArray(j,W,X);if(W==="hex")W=16;P(W===(W|0)&&W>=2&&W<=36),j=j.toString().replace(/\s+/g,"");var J=0;if(j[0]==="-")J++,this.negative=1;if(J<j.length){if(W===16)this._parseHex(j,J,X);else if(this._parseBase(j,W,J),X==="le")this._initArray(this.toArray(),W,X)}},O.prototype._initNumber=function(j,W,X){if(j<0)this.negative=1,j=-j;if(j<67108864)this.words=[j&67108863],this.length=1;else if(j<4503599627370496)this.words=[j&67108863,j/67108864&67108863],this.length=2;else P(j<9007199254740992),this.words=[j&67108863,j/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),W,X)},O.prototype._initArray=function(j,W,X){if(P(typeof j.length==="number"),j.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(j.length/3),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z,G,M=0;if(X==="be"){for(J=j.length-1,Z=0;J>=0;J-=3)if(G=j[J]|j[J-1]<<8|j[J-2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}else if(X==="le"){for(J=0,Z=0;J<j.length;J+=3)if(G=j[J]|j[J+1]<<8|j[J+2]<<16,this.words[Z]|=G<<M&67108863,this.words[Z+1]=G>>>26-M&67108863,M+=24,M>=26)M-=26,Z++}return this.strip()};function T(j,W){var X=j.charCodeAt(W);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(j,W,X){var J=T(j,X);if(X-1>=W)J|=T(j,X-1)<<4;return J}O.prototype._parseHex=function(j,W,X){this.length=Math.ceil((j.length-W)/6),this.words=Array(this.length);for(var J=0;J<this.length;J++)this.words[J]=0;var Z=0,G=0,M;if(X==="be")for(J=j.length-1;J>=W;J-=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8;else{var A=j.length-W;for(J=A%2===0?W+1:W;J<j.length;J+=2)if(M=H(j,W,J)<<Z,this.words[G]|=M&67108863,Z>=18)Z-=18,G+=1,this.words[G]|=M>>>26;else Z+=8}this.strip()};function f(j,W,X,J){var Z=0,G=Math.min(j.length,X);for(var M=W;M<G;M++){var A=j.charCodeAt(M)-48;if(Z*=J,A>=49)Z+=A-49+10;else if(A>=17)Z+=A-17+10;else Z+=A}return Z}O.prototype._parseBase=function(j,W,X){this.words=[0],this.length=1;for(var J=0,Z=1;Z<=67108863;Z*=W)J++;J--,Z=Z/W|0;var G=j.length-X,M=G%J,A=Math.min(G,G-M)+X,v=0;for(var V=X;V<A;V+=J)if(v=f(j,V,V+J,W),this.imuln(Z),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v);if(M!==0){var R=1;v=f(j,V,j.length,W);for(V=0;V<M;V++)R*=W;if(this.imuln(R),this.words[0]+v<67108864)this.words[0]+=v;else this._iaddn(v)}this.strip()},O.prototype.copy=function(j){j.words=Array(this.length);for(var W=0;W<this.length;W++)j.words[W]=this.words[W];j.length=this.length,j.negative=this.negative,j.red=this.red},O.prototype.clone=function(){var j=new O(null);return this.copy(j),j},O.prototype._expand=function(j){while(this.length<j)this.words[this.length++]=0;return this},O.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},O.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var w=["","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"],k=[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],S=[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(O.prototype.toString=function(j,W){j=j||10,W=W|0||1;var X;if(j===16||j==="hex"){X="";var J=0,Z=0;for(var G=0;G<this.length;G++){var M=this.words[G],A=((M<<J|Z)&16777215).toString(16);if(Z=M>>>24-J&16777215,J+=2,J>=26)J-=26,G--;if(Z!==0||G!==this.length-1)X=w[6-A.length]+A+X;else X=A+X}if(Z!==0)X=Z.toString(16)+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(j===(j|0)&&j>=2&&j<=36){var v=k[j],V=S[j];X="";var R=this.clone();R.negative=0;while(!R.isZero()){var E=R.modn(V).toString(j);if(R=R.idivn(V),!R.isZero())X=w[v-E.length]+E+X;else X=E+X}if(this.isZero())X="0"+X;while(X.length%W!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var j=this.words[0];if(this.length===2)j+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)j+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-j:j},O.prototype.toJSON=function(){return this.toString(16)},O.prototype.toBuffer=function(j,W){return P(typeof z<"u"),this.toArrayLike(z,j,W)},O.prototype.toArray=function(j,W){return this.toArrayLike(Array,j,W)},O.prototype.toArrayLike=function(j,W,X){var J=this.byteLength(),Z=X||Math.max(1,J);P(J<=Z,"byte array longer than desired length"),P(Z>0,"Requested array length <= 0"),this.strip();var G=W==="le",M=new j(Z),A,v,V=this.clone();if(!G){for(v=0;v<Z-J;v++)M[v]=0;for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[Z-v-1]=A}else{for(v=0;!V.isZero();v++)A=V.andln(255),V.iushrn(8),M[v]=A;for(;v<Z;v++)M[v]=0}return M},Math.clz32)O.prototype._countBits=function(j){return 32-Math.clz32(j)};else O.prototype._countBits=function(j){var W=j,X=0;if(W>=4096)X+=13,W>>>=13;if(W>=64)X+=7,W>>>=7;if(W>=8)X+=4,W>>>=4;if(W>=2)X+=2,W>>>=2;return X+W};O.prototype._zeroBits=function(j){if(j===0)return 26;var W=j,X=0;if((W&8191)===0)X+=13,W>>>=13;if((W&127)===0)X+=7,W>>>=7;if((W&15)===0)X+=4,W>>>=4;if((W&3)===0)X+=2,W>>>=2;if((W&1)===0)X++;return X},O.prototype.bitLength=function(){var j=this.words[this.length-1],W=this._countBits(j);return(this.length-1)*26+W};function N(j){var W=Array(j.bitLength());for(var X=0;X<W.length;X++){var J=X/26|0,Z=X%26;W[X]=(j.words[J]&1<<Z)>>>Z}return W}O.prototype.zeroBits=function(){if(this.isZero())return 0;var j=0;for(var W=0;W<this.length;W++){var X=this._zeroBits(this.words[W]);if(j+=X,X!==26)break}return j},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(j){if(this.negative!==0)return this.abs().inotn(j).iaddn(1);return this.clone()},O.prototype.fromTwos=function(j){if(this.testn(j-1))return this.notn(j).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(j){while(this.length<j.length)this.words[this.length++]=0;for(var W=0;W<j.length;W++)this.words[W]=this.words[W]|j.words[W];return this.strip()},O.prototype.ior=function(j){return P((this.negative|j.negative)===0),this.iuor(j)},O.prototype.or=function(j){if(this.length>j.length)return this.clone().ior(j);return j.clone().ior(this)},O.prototype.uor=function(j){if(this.length>j.length)return this.clone().iuor(j);return j.clone().iuor(this)},O.prototype.iuand=function(j){var W;if(this.length>j.length)W=j;else W=this;for(var X=0;X<W.length;X++)this.words[X]=this.words[X]&j.words[X];return this.length=W.length,this.strip()},O.prototype.iand=function(j){return P((this.negative|j.negative)===0),this.iuand(j)},O.prototype.and=function(j){if(this.length>j.length)return this.clone().iand(j);return j.clone().iand(this)},O.prototype.uand=function(j){if(this.length>j.length)return this.clone().iuand(j);return j.clone().iuand(this)},O.prototype.iuxor=function(j){var W,X;if(this.length>j.length)W=this,X=j;else W=j,X=this;for(var J=0;J<X.length;J++)this.words[J]=W.words[J]^X.words[J];if(this!==W)for(;J<W.length;J++)this.words[J]=W.words[J];return this.length=W.length,this.strip()},O.prototype.ixor=function(j){return P((this.negative|j.negative)===0),this.iuxor(j)},O.prototype.xor=function(j){if(this.length>j.length)return this.clone().ixor(j);return j.clone().ixor(this)},O.prototype.uxor=function(j){if(this.length>j.length)return this.clone().iuxor(j);return j.clone().iuxor(this)},O.prototype.inotn=function(j){P(typeof j==="number"&&j>=0);var W=Math.ceil(j/26)|0,X=j%26;if(this._expand(W),X>0)W--;for(var J=0;J<W;J++)this.words[J]=~this.words[J]&67108863;if(X>0)this.words[J]=~this.words[J]&67108863>>26-X;return this.strip()},O.prototype.notn=function(j){return this.clone().inotn(j)},O.prototype.setn=function(j,W){P(typeof j==="number"&&j>=0);var X=j/26|0,J=j%26;if(this._expand(X+1),W)this.words[X]=this.words[X]|1<<J;else this.words[X]=this.words[X]&~(1<<J);return this.strip()},O.prototype.iadd=function(j){var W;if(this.negative!==0&&j.negative===0)return this.negative=0,W=this.isub(j),this.negative^=1,this._normSign();else if(this.negative===0&&j.negative!==0)return j.negative=0,W=this.isub(j),j.negative=1,W._normSign();var X,J;if(this.length>j.length)X=this,J=j;else X=j,J=this;var Z=0;for(var G=0;G<J.length;G++)W=(X.words[G]|0)+(J.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;for(;Z!==0&&G<X.length;G++)W=(X.words[G]|0)+Z,this.words[G]=W&67108863,Z=W>>>26;if(this.length=X.length,Z!==0)this.words[this.length]=Z,this.length++;else if(X!==this)for(;G<X.length;G++)this.words[G]=X.words[G];return this},O.prototype.add=function(j){var W;if(j.negative!==0&&this.negative===0)return j.negative=0,W=this.sub(j),j.negative^=1,W;else if(j.negative===0&&this.negative!==0)return this.negative=0,W=j.sub(this),this.negative=1,W;if(this.length>j.length)return this.clone().iadd(j);return j.clone().iadd(this)},O.prototype.isub=function(j){if(j.negative!==0){j.negative=0;var W=this.iadd(j);return j.negative=1,W._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(j),this.negative=1,this._normSign();var X=this.cmp(j);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var J,Z;if(X>0)J=this,Z=j;else J=j,Z=this;var G=0;for(var M=0;M<Z.length;M++)W=(J.words[M]|0)-(Z.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;for(;G!==0&&M<J.length;M++)W=(J.words[M]|0)+G,G=W>>26,this.words[M]=W&67108863;if(G===0&&M<J.length&&J!==this)for(;M<J.length;M++)this.words[M]=J.words[M];if(this.length=Math.max(this.length,M),J!==this)this.negative=1;return this.strip()},O.prototype.sub=function(j){return this.clone().isub(j)};function h(j,W,X){X.negative=W.negative^j.negative;var J=j.length+W.length|0;X.length=J,J=J-1|0;var Z=j.words[0]|0,G=W.words[0]|0,M=Z*G,A=M&67108863,v=M/67108864|0;X.words[0]=A;for(var V=1;V<J;V++){var R=v>>>26,E=v&67108863,b=Math.min(V,W.length-1);for(var x=Math.max(0,V-j.length+1);x<=b;x++){var l=V-x|0;Z=j.words[l]|0,G=W.words[x]|0,M=Z*G+E,R+=M/67108864|0,E=M&67108863}X.words[V]=E|0,v=R|0}if(v!==0)X.words[V]=v|0;else X.length--;return X.strip()}var C=function(j,W,X){var J=j.words,Z=W.words,G=X.words,M=0,A,v,V,R=J[0]|0,E=R&8191,b=R>>>13,x=J[1]|0,l=x&8191,F=x>>>13,f$=J[2]|0,q$=f$&8191,B=f$>>>13,v$=J[3]|0,a=v$&8191,P$=v$>>>13,o$=J[4]|0,c=o$&8191,r=o$>>>13,J$=J[5]|0,$$=J$&8191,_$=J$>>>13,O$=J[6]|0,d=O$&8191,n=O$>>>13,H$=J[7]|0,t=H$&8191,U=H$>>>13,A$=J[8]|0,W$=A$&8191,z$=A$>>>13,Z6=J[9]|0,X$=Z6&8191,k$=Z6>>>13,o6=Z[0]|0,M$=o6&8191,S$=o6>>>13,Sq=Z[1]|0,E$=Sq&8191,b$=Sq>>>13,Mq=Z[2]|0,g$=Mq&8191,h$=Mq>>>13,fq=Z[3]|0,y$=fq&8191,R$=fq>>>13,zq=Z[4]|0,u$=zq&8191,x$=zq>>>13,Wq=Z[5]|0,I$=Wq&8191,u=Wq>>>13,i=Z[6]|0,K$=i&8191,Y$=i>>>13,B$=Z[7]|0,G$=B$&8191,V$=B$>>>13,p6=Z[8]|0,D$=p6&8191,p$=p6>>>13,Zq=Z[9]|0,L$=Zq&8191,C$=Zq>>>13;X.negative=j.negative^W.negative,X.length=19,A=Math.imul(E,M$),v=Math.imul(E,S$),v=v+Math.imul(b,M$)|0,V=Math.imul(b,S$);var c6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(c6>>>26)|0,c6&=67108863,A=Math.imul(l,M$),v=Math.imul(l,S$),v=v+Math.imul(F,M$)|0,V=Math.imul(F,S$),A=A+Math.imul(E,E$)|0,v=v+Math.imul(E,b$)|0,v=v+Math.imul(b,E$)|0,V=V+Math.imul(b,b$)|0;var W6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(W6>>>26)|0,W6&=67108863,A=Math.imul(q$,M$),v=Math.imul(q$,S$),v=v+Math.imul(B,M$)|0,V=Math.imul(B,S$),A=A+Math.imul(l,E$)|0,v=v+Math.imul(l,b$)|0,v=v+Math.imul(F,E$)|0,V=V+Math.imul(F,b$)|0,A=A+Math.imul(E,g$)|0,v=v+Math.imul(E,h$)|0,v=v+Math.imul(b,g$)|0,V=V+Math.imul(b,h$)|0;var j6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(j6>>>26)|0,j6&=67108863,A=Math.imul(a,M$),v=Math.imul(a,S$),v=v+Math.imul(P$,M$)|0,V=Math.imul(P$,S$),A=A+Math.imul(q$,E$)|0,v=v+Math.imul(q$,b$)|0,v=v+Math.imul(B,E$)|0,V=V+Math.imul(B,b$)|0,A=A+Math.imul(l,g$)|0,v=v+Math.imul(l,h$)|0,v=v+Math.imul(F,g$)|0,V=V+Math.imul(F,h$)|0,A=A+Math.imul(E,y$)|0,v=v+Math.imul(E,R$)|0,v=v+Math.imul(b,y$)|0,V=V+Math.imul(b,R$)|0;var E6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(E6>>>26)|0,E6&=67108863,A=Math.imul(c,M$),v=Math.imul(c,S$),v=v+Math.imul(r,M$)|0,V=Math.imul(r,S$),A=A+Math.imul(a,E$)|0,v=v+Math.imul(a,b$)|0,v=v+Math.imul(P$,E$)|0,V=V+Math.imul(P$,b$)|0,A=A+Math.imul(q$,g$)|0,v=v+Math.imul(q$,h$)|0,v=v+Math.imul(B,g$)|0,V=V+Math.imul(B,h$)|0,A=A+Math.imul(l,y$)|0,v=v+Math.imul(l,R$)|0,v=v+Math.imul(F,y$)|0,V=V+Math.imul(F,R$)|0,A=A+Math.imul(E,u$)|0,v=v+Math.imul(E,x$)|0,v=v+Math.imul(b,u$)|0,V=V+Math.imul(b,x$)|0;var M6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(M6>>>26)|0,M6&=67108863,A=Math.imul($$,M$),v=Math.imul($$,S$),v=v+Math.imul(_$,M$)|0,V=Math.imul(_$,S$),A=A+Math.imul(c,E$)|0,v=v+Math.imul(c,b$)|0,v=v+Math.imul(r,E$)|0,V=V+Math.imul(r,b$)|0,A=A+Math.imul(a,g$)|0,v=v+Math.imul(a,h$)|0,v=v+Math.imul(P$,g$)|0,V=V+Math.imul(P$,h$)|0,A=A+Math.imul(q$,y$)|0,v=v+Math.imul(q$,R$)|0,v=v+Math.imul(B,y$)|0,V=V+Math.imul(B,R$)|0,A=A+Math.imul(l,u$)|0,v=v+Math.imul(l,x$)|0,v=v+Math.imul(F,u$)|0,V=V+Math.imul(F,x$)|0,A=A+Math.imul(E,I$)|0,v=v+Math.imul(E,u)|0,v=v+Math.imul(b,I$)|0,V=V+Math.imul(b,u)|0;var t6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(t6>>>26)|0,t6&=67108863,A=Math.imul(d,M$),v=Math.imul(d,S$),v=v+Math.imul(n,M$)|0,V=Math.imul(n,S$),A=A+Math.imul($$,E$)|0,v=v+Math.imul($$,b$)|0,v=v+Math.imul(_$,E$)|0,V=V+Math.imul(_$,b$)|0,A=A+Math.imul(c,g$)|0,v=v+Math.imul(c,h$)|0,v=v+Math.imul(r,g$)|0,V=V+Math.imul(r,h$)|0,A=A+Math.imul(a,y$)|0,v=v+Math.imul(a,R$)|0,v=v+Math.imul(P$,y$)|0,V=V+Math.imul(P$,R$)|0,A=A+Math.imul(q$,u$)|0,v=v+Math.imul(q$,x$)|0,v=v+Math.imul(B,u$)|0,V=V+Math.imul(B,x$)|0,A=A+Math.imul(l,I$)|0,v=v+Math.imul(l,u)|0,v=v+Math.imul(F,I$)|0,V=V+Math.imul(F,u)|0,A=A+Math.imul(E,K$)|0,v=v+Math.imul(E,Y$)|0,v=v+Math.imul(b,K$)|0,V=V+Math.imul(b,Y$)|0;var U6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(U6>>>26)|0,U6&=67108863,A=Math.imul(t,M$),v=Math.imul(t,S$),v=v+Math.imul(U,M$)|0,V=Math.imul(U,S$),A=A+Math.imul(d,E$)|0,v=v+Math.imul(d,b$)|0,v=v+Math.imul(n,E$)|0,V=V+Math.imul(n,b$)|0,A=A+Math.imul($$,g$)|0,v=v+Math.imul($$,h$)|0,v=v+Math.imul(_$,g$)|0,V=V+Math.imul(_$,h$)|0,A=A+Math.imul(c,y$)|0,v=v+Math.imul(c,R$)|0,v=v+Math.imul(r,y$)|0,V=V+Math.imul(r,R$)|0,A=A+Math.imul(a,u$)|0,v=v+Math.imul(a,x$)|0,v=v+Math.imul(P$,u$)|0,V=V+Math.imul(P$,x$)|0,A=A+Math.imul(q$,I$)|0,v=v+Math.imul(q$,u)|0,v=v+Math.imul(B,I$)|0,V=V+Math.imul(B,u)|0,A=A+Math.imul(l,K$)|0,v=v+Math.imul(l,Y$)|0,v=v+Math.imul(F,K$)|0,V=V+Math.imul(F,Y$)|0,A=A+Math.imul(E,G$)|0,v=v+Math.imul(E,V$)|0,v=v+Math.imul(b,G$)|0,V=V+Math.imul(b,V$)|0;var F6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(F6>>>26)|0,F6&=67108863,A=Math.imul(W$,M$),v=Math.imul(W$,S$),v=v+Math.imul(z$,M$)|0,V=Math.imul(z$,S$),A=A+Math.imul(t,E$)|0,v=v+Math.imul(t,b$)|0,v=v+Math.imul(U,E$)|0,V=V+Math.imul(U,b$)|0,A=A+Math.imul(d,g$)|0,v=v+Math.imul(d,h$)|0,v=v+Math.imul(n,g$)|0,V=V+Math.imul(n,h$)|0,A=A+Math.imul($$,y$)|0,v=v+Math.imul($$,R$)|0,v=v+Math.imul(_$,y$)|0,V=V+Math.imul(_$,R$)|0,A=A+Math.imul(c,u$)|0,v=v+Math.imul(c,x$)|0,v=v+Math.imul(r,u$)|0,V=V+Math.imul(r,x$)|0,A=A+Math.imul(a,I$)|0,v=v+Math.imul(a,u)|0,v=v+Math.imul(P$,I$)|0,V=V+Math.imul(P$,u)|0,A=A+Math.imul(q$,K$)|0,v=v+Math.imul(q$,Y$)|0,v=v+Math.imul(B,K$)|0,V=V+Math.imul(B,Y$)|0,A=A+Math.imul(l,G$)|0,v=v+Math.imul(l,V$)|0,v=v+Math.imul(F,G$)|0,V=V+Math.imul(F,V$)|0,A=A+Math.imul(E,D$)|0,v=v+Math.imul(E,p$)|0,v=v+Math.imul(b,D$)|0,V=V+Math.imul(b,p$)|0;var Q6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,A=Math.imul(X$,M$),v=Math.imul(X$,S$),v=v+Math.imul(k$,M$)|0,V=Math.imul(k$,S$),A=A+Math.imul(W$,E$)|0,v=v+Math.imul(W$,b$)|0,v=v+Math.imul(z$,E$)|0,V=V+Math.imul(z$,b$)|0,A=A+Math.imul(t,g$)|0,v=v+Math.imul(t,h$)|0,v=v+Math.imul(U,g$)|0,V=V+Math.imul(U,h$)|0,A=A+Math.imul(d,y$)|0,v=v+Math.imul(d,R$)|0,v=v+Math.imul(n,y$)|0,V=V+Math.imul(n,R$)|0,A=A+Math.imul($$,u$)|0,v=v+Math.imul($$,x$)|0,v=v+Math.imul(_$,u$)|0,V=V+Math.imul(_$,x$)|0,A=A+Math.imul(c,I$)|0,v=v+Math.imul(c,u)|0,v=v+Math.imul(r,I$)|0,V=V+Math.imul(r,u)|0,A=A+Math.imul(a,K$)|0,v=v+Math.imul(a,Y$)|0,v=v+Math.imul(P$,K$)|0,V=V+Math.imul(P$,Y$)|0,A=A+Math.imul(q$,G$)|0,v=v+Math.imul(q$,V$)|0,v=v+Math.imul(B,G$)|0,V=V+Math.imul(B,V$)|0,A=A+Math.imul(l,D$)|0,v=v+Math.imul(l,p$)|0,v=v+Math.imul(F,D$)|0,V=V+Math.imul(F,p$)|0,A=A+Math.imul(E,L$)|0,v=v+Math.imul(E,C$)|0,v=v+Math.imul(b,L$)|0,V=V+Math.imul(b,C$)|0;var a6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(a6>>>26)|0,a6&=67108863,A=Math.imul(X$,E$),v=Math.imul(X$,b$),v=v+Math.imul(k$,E$)|0,V=Math.imul(k$,b$),A=A+Math.imul(W$,g$)|0,v=v+Math.imul(W$,h$)|0,v=v+Math.imul(z$,g$)|0,V=V+Math.imul(z$,h$)|0,A=A+Math.imul(t,y$)|0,v=v+Math.imul(t,R$)|0,v=v+Math.imul(U,y$)|0,V=V+Math.imul(U,R$)|0,A=A+Math.imul(d,u$)|0,v=v+Math.imul(d,x$)|0,v=v+Math.imul(n,u$)|0,V=V+Math.imul(n,x$)|0,A=A+Math.imul($$,I$)|0,v=v+Math.imul($$,u)|0,v=v+Math.imul(_$,I$)|0,V=V+Math.imul(_$,u)|0,A=A+Math.imul(c,K$)|0,v=v+Math.imul(c,Y$)|0,v=v+Math.imul(r,K$)|0,V=V+Math.imul(r,Y$)|0,A=A+Math.imul(a,G$)|0,v=v+Math.imul(a,V$)|0,v=v+Math.imul(P$,G$)|0,V=V+Math.imul(P$,V$)|0,A=A+Math.imul(q$,D$)|0,v=v+Math.imul(q$,p$)|0,v=v+Math.imul(B,D$)|0,V=V+Math.imul(B,p$)|0,A=A+Math.imul(l,L$)|0,v=v+Math.imul(l,C$)|0,v=v+Math.imul(F,L$)|0,V=V+Math.imul(F,C$)|0;var e6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(e6>>>26)|0,e6&=67108863,A=Math.imul(X$,g$),v=Math.imul(X$,h$),v=v+Math.imul(k$,g$)|0,V=Math.imul(k$,h$),A=A+Math.imul(W$,y$)|0,v=v+Math.imul(W$,R$)|0,v=v+Math.imul(z$,y$)|0,V=V+Math.imul(z$,R$)|0,A=A+Math.imul(t,u$)|0,v=v+Math.imul(t,x$)|0,v=v+Math.imul(U,u$)|0,V=V+Math.imul(U,x$)|0,A=A+Math.imul(d,I$)|0,v=v+Math.imul(d,u)|0,v=v+Math.imul(n,I$)|0,V=V+Math.imul(n,u)|0,A=A+Math.imul($$,K$)|0,v=v+Math.imul($$,Y$)|0,v=v+Math.imul(_$,K$)|0,V=V+Math.imul(_$,Y$)|0,A=A+Math.imul(c,G$)|0,v=v+Math.imul(c,V$)|0,v=v+Math.imul(r,G$)|0,V=V+Math.imul(r,V$)|0,A=A+Math.imul(a,D$)|0,v=v+Math.imul(a,p$)|0,v=v+Math.imul(P$,D$)|0,V=V+Math.imul(P$,p$)|0,A=A+Math.imul(q$,L$)|0,v=v+Math.imul(q$,C$)|0,v=v+Math.imul(B,L$)|0,V=V+Math.imul(B,C$)|0;var s6=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(s6>>>26)|0,s6&=67108863,A=Math.imul(X$,y$),v=Math.imul(X$,R$),v=v+Math.imul(k$,y$)|0,V=Math.imul(k$,R$),A=A+Math.imul(W$,u$)|0,v=v+Math.imul(W$,x$)|0,v=v+Math.imul(z$,u$)|0,V=V+Math.imul(z$,x$)|0,A=A+Math.imul(t,I$)|0,v=v+Math.imul(t,u)|0,v=v+Math.imul(U,I$)|0,V=V+Math.imul(U,u)|0,A=A+Math.imul(d,K$)|0,v=v+Math.imul(d,Y$)|0,v=v+Math.imul(n,K$)|0,V=V+Math.imul(n,Y$)|0,A=A+Math.imul($$,G$)|0,v=v+Math.imul($$,V$)|0,v=v+Math.imul(_$,G$)|0,V=V+Math.imul(_$,V$)|0,A=A+Math.imul(c,D$)|0,v=v+Math.imul(c,p$)|0,v=v+Math.imul(r,D$)|0,V=V+Math.imul(r,p$)|0,A=A+Math.imul(a,L$)|0,v=v+Math.imul(a,C$)|0,v=v+Math.imul(P$,L$)|0,V=V+Math.imul(P$,C$)|0;var $q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+($q>>>26)|0,$q&=67108863,A=Math.imul(X$,u$),v=Math.imul(X$,x$),v=v+Math.imul(k$,u$)|0,V=Math.imul(k$,x$),A=A+Math.imul(W$,I$)|0,v=v+Math.imul(W$,u)|0,v=v+Math.imul(z$,I$)|0,V=V+Math.imul(z$,u)|0,A=A+Math.imul(t,K$)|0,v=v+Math.imul(t,Y$)|0,v=v+Math.imul(U,K$)|0,V=V+Math.imul(U,Y$)|0,A=A+Math.imul(d,G$)|0,v=v+Math.imul(d,V$)|0,v=v+Math.imul(n,G$)|0,V=V+Math.imul(n,V$)|0,A=A+Math.imul($$,D$)|0,v=v+Math.imul($$,p$)|0,v=v+Math.imul(_$,D$)|0,V=V+Math.imul(_$,p$)|0,A=A+Math.imul(c,L$)|0,v=v+Math.imul(c,C$)|0,v=v+Math.imul(r,L$)|0,V=V+Math.imul(r,C$)|0;var qq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(qq>>>26)|0,qq&=67108863,A=Math.imul(X$,I$),v=Math.imul(X$,u),v=v+Math.imul(k$,I$)|0,V=Math.imul(k$,u),A=A+Math.imul(W$,K$)|0,v=v+Math.imul(W$,Y$)|0,v=v+Math.imul(z$,K$)|0,V=V+Math.imul(z$,Y$)|0,A=A+Math.imul(t,G$)|0,v=v+Math.imul(t,V$)|0,v=v+Math.imul(U,G$)|0,V=V+Math.imul(U,V$)|0,A=A+Math.imul(d,D$)|0,v=v+Math.imul(d,p$)|0,v=v+Math.imul(n,D$)|0,V=V+Math.imul(n,p$)|0,A=A+Math.imul($$,L$)|0,v=v+Math.imul($$,C$)|0,v=v+Math.imul(_$,L$)|0,V=V+Math.imul(_$,C$)|0;var _q=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(_q>>>26)|0,_q&=67108863,A=Math.imul(X$,K$),v=Math.imul(X$,Y$),v=v+Math.imul(k$,K$)|0,V=Math.imul(k$,Y$),A=A+Math.imul(W$,G$)|0,v=v+Math.imul(W$,V$)|0,v=v+Math.imul(z$,G$)|0,V=V+Math.imul(z$,V$)|0,A=A+Math.imul(t,D$)|0,v=v+Math.imul(t,p$)|0,v=v+Math.imul(U,D$)|0,V=V+Math.imul(U,p$)|0,A=A+Math.imul(d,L$)|0,v=v+Math.imul(d,C$)|0,v=v+Math.imul(n,L$)|0,V=V+Math.imul(n,C$)|0;var Kq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,A=Math.imul(X$,G$),v=Math.imul(X$,V$),v=v+Math.imul(k$,G$)|0,V=Math.imul(k$,V$),A=A+Math.imul(W$,D$)|0,v=v+Math.imul(W$,p$)|0,v=v+Math.imul(z$,D$)|0,V=V+Math.imul(z$,p$)|0,A=A+Math.imul(t,L$)|0,v=v+Math.imul(t,C$)|0,v=v+Math.imul(U,L$)|0,V=V+Math.imul(U,C$)|0;var Pq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,A=Math.imul(X$,D$),v=Math.imul(X$,p$),v=v+Math.imul(k$,D$)|0,V=Math.imul(k$,p$),A=A+Math.imul(W$,L$)|0,v=v+Math.imul(W$,C$)|0,v=v+Math.imul(z$,L$)|0,V=V+Math.imul(z$,C$)|0;var Yq=(M+A|0)+((v&8191)<<13)|0;M=(V+(v>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,A=Math.imul(X$,L$),v=Math.imul(X$,C$),v=v+Math.imul(k$,L$)|0,V=Math.imul(k$,C$);var Oq=(M+A|0)+((v&8191)<<13)|0;if(M=(V+(v>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,G[0]=c6,G[1]=W6,G[2]=j6,G[3]=E6,G[4]=M6,G[5]=t6,G[6]=U6,G[7]=F6,G[8]=Q6,G[9]=a6,G[10]=e6,G[11]=s6,G[12]=$q,G[13]=qq,G[14]=_q,G[15]=Kq,G[16]=Pq,G[17]=Yq,G[18]=Oq,M!==0)G[19]=M,X.length++;return X};if(!Math.imul)C=h;function I(j,W,X){X.negative=W.negative^j.negative,X.length=j.length+W.length;var J=0,Z=0;for(var G=0;G<X.length-1;G++){var M=Z;Z=0;var A=J&67108863,v=Math.min(G,W.length-1);for(var V=Math.max(0,G-j.length+1);V<=v;V++){var R=G-V,E=j.words[R]|0,b=W.words[V]|0,x=E*b,l=x&67108863;M=M+(x/67108864|0)|0,l=l+A|0,A=l&67108863,M=M+(l>>>26)|0,Z+=M>>>26,M&=67108863}X.words[G]=A,J=M,M=Z}if(J!==0)X.words[G]=J;else X.length--;return X.strip()}function D(j,W,X){var J=new L;return J.mulp(j,W,X)}O.prototype.mulTo=function(j,W){var X,J=this.length+j.length;if(this.length===10&&j.length===10)X=C(this,j,W);else if(J<63)X=h(this,j,W);else if(J<1024)X=I(this,j,W);else X=D(this,j,W);return X};function L(j,W){this.x=j,this.y=W}L.prototype.makeRBT=function(j){var W=Array(j),X=O.prototype._countBits(j)-1;for(var J=0;J<j;J++)W[J]=this.revBin(J,X,j);return W},L.prototype.revBin=function(j,W,X){if(j===0||j===X-1)return j;var J=0;for(var Z=0;Z<W;Z++)J|=(j&1)<<W-Z-1,j>>=1;return J},L.prototype.permute=function(j,W,X,J,Z,G){for(var M=0;M<G;M++)J[M]=W[j[M]],Z[M]=X[j[M]]},L.prototype.transform=function(j,W,X,J,Z,G){this.permute(G,j,W,X,J,Z);for(var M=1;M<Z;M<<=1){var A=M<<1,v=Math.cos(2*Math.PI/A),V=Math.sin(2*Math.PI/A);for(var R=0;R<Z;R+=A){var E=v,b=V;for(var x=0;x<M;x++){var l=X[R+x],F=J[R+x],f$=X[R+x+M],q$=J[R+x+M],B=E*f$-b*q$;if(q$=E*q$+b*f$,f$=B,X[R+x]=l+f$,J[R+x]=F+q$,X[R+x+M]=l-f$,J[R+x+M]=F-q$,x!==A)B=v*E-V*b,b=v*b+V*E,E=B}}}},L.prototype.guessLen13b=function(j,W){var X=Math.max(W,j)|1,J=X&1,Z=0;for(X=X/2|0;X;X=X>>>1)Z++;return 1<<Z+1+J},L.prototype.conjugate=function(j,W,X){if(X<=1)return;for(var J=0;J<X/2;J++){var Z=j[J];j[J]=j[X-J-1],j[X-J-1]=Z,Z=W[J],W[J]=-W[X-J-1],W[X-J-1]=-Z}},L.prototype.normalize13b=function(j,W){var X=0;for(var J=0;J<W/2;J++){var Z=Math.round(j[2*J+1]/W)*8192+Math.round(j[2*J]/W)+X;if(j[J]=Z&67108863,Z<67108864)X=0;else X=Z/67108864|0}return j},L.prototype.convert13b=function(j,W,X,J){var Z=0;for(var G=0;G<W;G++)Z=Z+(j[G]|0),X[2*G]=Z&8191,Z=Z>>>13,X[2*G+1]=Z&8191,Z=Z>>>13;for(G=2*W;G<J;++G)X[G]=0;P(Z===0),P((Z&-8192)===0)},L.prototype.stub=function(j){var W=Array(j);for(var X=0;X<j;X++)W[X]=0;return W},L.prototype.mulp=function(j,W,X){var J=2*this.guessLen13b(j.length,W.length),Z=this.makeRBT(J),G=this.stub(J),M=Array(J),A=Array(J),v=Array(J),V=Array(J),R=Array(J),E=Array(J),b=X.words;b.length=J,this.convert13b(j.words,j.length,M,J),this.convert13b(W.words,W.length,V,J),this.transform(M,G,A,v,J,Z),this.transform(V,G,R,E,J,Z);for(var x=0;x<J;x++){var l=A[x]*R[x]-v[x]*E[x];v[x]=A[x]*E[x]+v[x]*R[x],A[x]=l}return this.conjugate(A,v,J),this.transform(A,v,b,G,J,Z),this.conjugate(b,G,J),this.normalize13b(b,J),X.negative=j.negative^W.negative,X.length=j.length+W.length,X.strip()},O.prototype.mul=function(j){var W=new O(null);return W.words=Array(this.length+j.length),this.mulTo(j,W)},O.prototype.mulf=function(j){var W=new O(null);return W.words=Array(this.length+j.length),D(this,j,W)},O.prototype.imul=function(j){return this.clone().mulTo(j,this)},O.prototype.imuln=function(j){P(typeof j==="number"),P(j<67108864);var W=0;for(var X=0;X<this.length;X++){var J=(this.words[X]|0)*j,Z=(J&67108863)+(W&67108863);W>>=26,W+=J/67108864|0,W+=Z>>>26,this.words[X]=Z&67108863}if(W!==0)this.words[X]=W,this.length++;return this.length=j===0?1:this.length,this},O.prototype.muln=function(j){return this.clone().imuln(j)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(j){var W=N(j);if(W.length===0)return new O(1);var X=this;for(var J=0;J<W.length;J++,X=X.sqr())if(W[J]!==0)break;if(++J<W.length)for(var Z=X.sqr();J<W.length;J++,Z=Z.sqr()){if(W[J]===0)continue;X=X.mul(Z)}return X},O.prototype.iushln=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=67108863>>>26-W<<26-W,Z;if(W!==0){var G=0;for(Z=0;Z<this.length;Z++){var M=this.words[Z]&J,A=(this.words[Z]|0)-M<<W;this.words[Z]=A|G,G=M>>>26-W}if(G)this.words[Z]=G,this.length++}if(X!==0){for(Z=this.length-1;Z>=0;Z--)this.words[Z+X]=this.words[Z];for(Z=0;Z<X;Z++)this.words[Z]=0;this.length+=X}return this.strip()},O.prototype.ishln=function(j){return P(this.negative===0),this.iushln(j)},O.prototype.iushrn=function(j,W,X){P(typeof j==="number"&&j>=0);var J;if(W)J=(W-W%26)/26;else J=0;var Z=j%26,G=Math.min((j-Z)/26,this.length),M=67108863^67108863>>>Z<<Z,A=X;if(J-=G,J=Math.max(0,J),A){for(var v=0;v<G;v++)A.words[v]=this.words[v];A.length=G}if(G===0);else if(this.length>G){this.length-=G;for(v=0;v<this.length;v++)this.words[v]=this.words[v+G]}else this.words[0]=0,this.length=1;var V=0;for(v=this.length-1;v>=0&&(V!==0||v>=J);v--){var R=this.words[v]|0;this.words[v]=V<<26-Z|R>>>Z,V=R&M}if(A&&V!==0)A.words[A.length++]=V;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},O.prototype.ishrn=function(j,W,X){return P(this.negative===0),this.iushrn(j,W,X)},O.prototype.shln=function(j){return this.clone().ishln(j)},O.prototype.ushln=function(j){return this.clone().iushln(j)},O.prototype.shrn=function(j){return this.clone().ishrn(j)},O.prototype.ushrn=function(j){return this.clone().iushrn(j)},O.prototype.testn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return!1;var Z=this.words[X];return!!(Z&J)},O.prototype.imaskn=function(j){P(typeof j==="number"&&j>=0);var W=j%26,X=(j-W)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(W!==0)X++;if(this.length=Math.min(X,this.length),W!==0){var J=67108863^67108863>>>W<<W;this.words[this.length-1]&=J}return this.strip()},O.prototype.maskn=function(j){return this.clone().imaskn(j)},O.prototype.iaddn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.isubn(-j);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<j)return this.words[0]=j-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(j),this.negative=1,this}return this._iaddn(j)},O.prototype._iaddn=function(j){this.words[0]+=j;for(var W=0;W<this.length&&this.words[W]>=67108864;W++)if(this.words[W]-=67108864,W===this.length-1)this.words[W+1]=1;else this.words[W+1]++;return this.length=Math.max(this.length,W+1),this},O.prototype.isubn=function(j){if(P(typeof j==="number"),P(j<67108864),j<0)return this.iaddn(-j);if(this.negative!==0)return this.negative=0,this.iaddn(j),this.negative=1,this;if(this.words[0]-=j,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var W=0;W<this.length&&this.words[W]<0;W++)this.words[W]+=67108864,this.words[W+1]-=1;return this.strip()},O.prototype.addn=function(j){return this.clone().iaddn(j)},O.prototype.subn=function(j){return this.clone().isubn(j)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(j,W,X){var J=j.length+X,Z;this._expand(J);var G,M=0;for(Z=0;Z<j.length;Z++){G=(this.words[Z+X]|0)+M;var A=(j.words[Z]|0)*W;G-=A&67108863,M=(G>>26)-(A/67108864|0),this.words[Z+X]=G&67108863}for(;Z<this.length-X;Z++)G=(this.words[Z+X]|0)+M,M=G>>26,this.words[Z+X]=G&67108863;if(M===0)return this.strip();P(M===-1),M=0;for(Z=0;Z<this.length;Z++)G=-(this.words[Z]|0)+M,M=G>>26,this.words[Z]=G&67108863;return this.negative=1,this.strip()},O.prototype._wordDiv=function(j,W){var X=this.length-j.length,J=this.clone(),Z=j,G=Z.words[Z.length-1]|0,M=this._countBits(G);if(X=26-M,X!==0)Z=Z.ushln(X),J.iushln(X),G=Z.words[Z.length-1]|0;var A=J.length-Z.length,v;if(W!=="mod"){v=new O(null),v.length=A+1,v.words=Array(v.length);for(var V=0;V<v.length;V++)v.words[V]=0}var R=J.clone()._ishlnsubmul(Z,1,A);if(R.negative===0){if(J=R,v)v.words[A]=1}for(var E=A-1;E>=0;E--){var b=(J.words[Z.length+E]|0)*67108864+(J.words[Z.length+E-1]|0);b=Math.min(b/G|0,67108863),J._ishlnsubmul(Z,b,E);while(J.negative!==0)if(b--,J.negative=0,J._ishlnsubmul(Z,1,E),!J.isZero())J.negative^=1;if(v)v.words[E]=b}if(v)v.strip();if(J.strip(),W!=="div"&&X!==0)J.iushrn(X);return{div:v||null,mod:J}},O.prototype.divmod=function(j,W,X){if(P(!j.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var J,Z,G;if(this.negative!==0&&j.negative===0){if(G=this.neg().divmod(j,W),W!=="mod")J=G.div.neg();if(W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.iadd(j)}return{div:J,mod:Z}}if(this.negative===0&&j.negative!==0){if(G=this.divmod(j.neg(),W),W!=="mod")J=G.div.neg();return{div:J,mod:G.mod}}if((this.negative&j.negative)!==0){if(G=this.neg().divmod(j.neg(),W),W!=="div"){if(Z=G.mod.neg(),X&&Z.negative!==0)Z.isub(j)}return{div:G.div,mod:Z}}if(j.length>this.length||this.cmp(j)<0)return{div:new O(0),mod:this};if(j.length===1){if(W==="div")return{div:this.divn(j.words[0]),mod:null};if(W==="mod")return{div:null,mod:new O(this.modn(j.words[0]))};return{div:this.divn(j.words[0]),mod:new O(this.modn(j.words[0]))}}return this._wordDiv(j,W)},O.prototype.div=function(j){return this.divmod(j,"div",!1).div},O.prototype.mod=function(j){return this.divmod(j,"mod",!1).mod},O.prototype.umod=function(j){return this.divmod(j,"mod",!0).mod},O.prototype.divRound=function(j){var W=this.divmod(j);if(W.mod.isZero())return W.div;var X=W.div.negative!==0?W.mod.isub(j):W.mod,J=j.ushrn(1),Z=j.andln(1),G=X.cmp(J);if(G<0||Z===1&&G===0)return W.div;return W.div.negative!==0?W.div.isubn(1):W.div.iaddn(1)},O.prototype.modn=function(j){P(j<=67108863);var W=67108864%j,X=0;for(var J=this.length-1;J>=0;J--)X=(W*X+(this.words[J]|0))%j;return X},O.prototype.idivn=function(j){P(j<=67108863);var W=0;for(var X=this.length-1;X>=0;X--){var J=(this.words[X]|0)+W*67108864;this.words[X]=J/j|0,W=J%j}return this.strip()},O.prototype.divn=function(j){return this.clone().idivn(j)},O.prototype.egcd=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=new O(0),M=new O(1),A=0;while(W.isEven()&&X.isEven())W.iushrn(1),X.iushrn(1),++A;var v=X.clone(),V=W.clone();while(!W.isZero()){for(var R=0,E=1;(W.words[0]&E)===0&&R<26;++R,E<<=1);if(R>0){W.iushrn(R);while(R-- >0){if(J.isOdd()||Z.isOdd())J.iadd(v),Z.isub(V);J.iushrn(1),Z.iushrn(1)}}for(var b=0,x=1;(X.words[0]&x)===0&&b<26;++b,x<<=1);if(b>0){X.iushrn(b);while(b-- >0){if(G.isOdd()||M.isOdd())G.iadd(v),M.isub(V);G.iushrn(1),M.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(G),Z.isub(M);else X.isub(W),G.isub(J),M.isub(Z)}return{a:G,b:M,gcd:X.iushln(A)}},O.prototype._invmp=function(j){P(j.negative===0),P(!j.isZero());var W=this,X=j.clone();if(W.negative!==0)W=W.umod(j);else W=W.clone();var J=new O(1),Z=new O(0),G=X.clone();while(W.cmpn(1)>0&&X.cmpn(1)>0){for(var M=0,A=1;(W.words[0]&A)===0&&M<26;++M,A<<=1);if(M>0){W.iushrn(M);while(M-- >0){if(J.isOdd())J.iadd(G);J.iushrn(1)}}for(var v=0,V=1;(X.words[0]&V)===0&&v<26;++v,V<<=1);if(v>0){X.iushrn(v);while(v-- >0){if(Z.isOdd())Z.iadd(G);Z.iushrn(1)}}if(W.cmp(X)>=0)W.isub(X),J.isub(Z);else X.isub(W),Z.isub(J)}var R;if(W.cmpn(1)===0)R=J;else R=Z;if(R.cmpn(0)<0)R.iadd(j);return R},O.prototype.gcd=function(j){if(this.isZero())return j.abs();if(j.isZero())return this.abs();var W=this.clone(),X=j.clone();W.negative=0,X.negative=0;for(var J=0;W.isEven()&&X.isEven();J++)W.iushrn(1),X.iushrn(1);do{while(W.isEven())W.iushrn(1);while(X.isEven())X.iushrn(1);var Z=W.cmp(X);if(Z<0){var G=W;W=X,X=G}else if(Z===0||X.cmpn(1)===0)break;W.isub(X)}while(!0);return X.iushln(J)},O.prototype.invm=function(j){return this.egcd(j).a.umod(j)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(j){return this.words[0]&j},O.prototype.bincn=function(j){P(typeof j==="number");var W=j%26,X=(j-W)/26,J=1<<W;if(this.length<=X)return this._expand(X+1),this.words[X]|=J,this;var Z=J;for(var G=X;Z!==0&&G<this.length;G++){var M=this.words[G]|0;M+=Z,Z=M>>>26,M&=67108863,this.words[G]=M}if(Z!==0)this.words[G]=Z,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(j){var W=j<0;if(this.negative!==0&&!W)return-1;if(this.negative===0&&W)return 1;this.strip();var X;if(this.length>1)X=1;else{if(W)j=-j;P(j<=67108863,"Number is too big");var J=this.words[0]|0;X=J===j?0:J<j?-1:1}if(this.negative!==0)return-X|0;return X},O.prototype.cmp=function(j){if(this.negative!==0&&j.negative===0)return-1;if(this.negative===0&&j.negative!==0)return 1;var W=this.ucmp(j);if(this.negative!==0)return-W|0;return W},O.prototype.ucmp=function(j){if(this.length>j.length)return 1;if(this.length<j.length)return-1;var W=0;for(var X=this.length-1;X>=0;X--){var J=this.words[X]|0,Z=j.words[X]|0;if(J===Z)continue;if(J<Z)W=-1;else if(J>Z)W=1;break}return W},O.prototype.gtn=function(j){return this.cmpn(j)===1},O.prototype.gt=function(j){return this.cmp(j)===1},O.prototype.gten=function(j){return this.cmpn(j)>=0},O.prototype.gte=function(j){return this.cmp(j)>=0},O.prototype.ltn=function(j){return this.cmpn(j)===-1},O.prototype.lt=function(j){return this.cmp(j)===-1},O.prototype.lten=function(j){return this.cmpn(j)<=0},O.prototype.lte=function(j){return this.cmp(j)<=0},O.prototype.eqn=function(j){return this.cmpn(j)===0},O.prototype.eq=function(j){return this.cmp(j)===0},O.red=function(j){return new m(j)},O.prototype.toRed=function(j){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),j.convertTo(this)._forceRed(j)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(j){return this.red=j,this},O.prototype.forceRed=function(j){return P(!this.red,"Already a number in reduction context"),this._forceRed(j)},O.prototype.redAdd=function(j){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,j)},O.prototype.redIAdd=function(j){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,j)},O.prototype.redSub=function(j){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,j)},O.prototype.redISub=function(j){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,j)},O.prototype.redShl=function(j){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,j)},O.prototype.redMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.mul(this,j)},O.prototype.redIMul=function(j){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,j),this.red.imul(this,j)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(j){return P(this.red&&!j.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,j)};var g={k256:null,p224:null,p192:null,p25519:null};function y(j,W){this.name=j,this.p=new O(W,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}y.prototype._tmp=function(){var j=new O(null);return j.words=Array(Math.ceil(this.n/13)),j},y.prototype.ireduce=function(j){var W=j,X;do this.split(W,this.tmp),W=this.imulK(W),W=W.iadd(this.tmp),X=W.bitLength();while(X>this.n);var J=X<this.n?-1:W.ucmp(this.p);if(J===0)W.words[0]=0,W.length=1;else if(J>0)W.isub(this.p);else if(W.strip!==void 0)W.strip();else W._strip();return W},y.prototype.split=function(j,W){j.iushrn(this.n,0,W)},y.prototype.imulK=function(j){return j.imul(this.k)};function p(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(p,y),p.prototype.split=function(j,W){var X=4194303,J=Math.min(j.length,9);for(var Z=0;Z<J;Z++)W.words[Z]=j.words[Z];if(W.length=J,j.length<=9){j.words[0]=0,j.length=1;return}var G=j.words[9];W.words[W.length++]=G&X;for(Z=10;Z<j.length;Z++){var M=j.words[Z]|0;j.words[Z-10]=(M&X)<<4|G>>>22,G=M}if(G>>>=22,j.words[Z-10]=G,G===0&&j.length>10)j.length-=10;else j.length-=9},p.prototype.imulK=function(j){j.words[j.length]=0,j.words[j.length+1]=0,j.length+=2;var W=0;for(var X=0;X<j.length;X++){var J=j.words[X]|0;W+=J*977,j.words[X]=W&67108863,W=J*64+(W/67108864|0)}if(j.words[j.length-1]===0){if(j.length--,j.words[j.length-1]===0)j.length--}return j};function o(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(o,y);function s(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(s,y);function Q(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(Q,y),Q.prototype.imulK=function(j){var W=0;for(var X=0;X<j.length;X++){var J=(j.words[X]|0)*19+W,Z=J&67108863;J>>>=26,j.words[X]=Z,W=J}if(W!==0)j.words[j.length++]=W;return j},O._prime=function(j){if(g[j])return g[j];var W;if(j==="k256")W=new p;else if(j==="p224")W=new o;else if(j==="p192")W=new s;else if(j==="p25519")W=new Q;else throw Error("Unknown prime "+j);return g[j]=W,W};function m(j){if(typeof j==="string"){var W=O._prime(j);this.m=W.p,this.prime=W}else P(j.gtn(1),"modulus must be greater than 1"),this.m=j,this.prime=null}m.prototype._verify1=function(j){P(j.negative===0,"red works only with positives"),P(j.red,"red works only with red numbers")},m.prototype._verify2=function(j,W){P((j.negative|W.negative)===0,"red works only with positives"),P(j.red&&j.red===W.red,"red works only with red numbers")},m.prototype.imod=function(j){if(this.prime)return this.prime.ireduce(j)._forceRed(this);return j.umod(this.m)._forceRed(this)},m.prototype.neg=function(j){if(j.isZero())return j.clone();return this.m.sub(j)._forceRed(this)},m.prototype.add=function(j,W){this._verify2(j,W);var X=j.add(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},m.prototype.iadd=function(j,W){this._verify2(j,W);var X=j.iadd(W);if(X.cmp(this.m)>=0)X.isub(this.m);return X},m.prototype.sub=function(j,W){this._verify2(j,W);var X=j.sub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},m.prototype.isub=function(j,W){this._verify2(j,W);var X=j.isub(W);if(X.cmpn(0)<0)X.iadd(this.m);return X},m.prototype.shl=function(j,W){return this._verify1(j),this.imod(j.ushln(W))},m.prototype.imul=function(j,W){return this._verify2(j,W),this.imod(j.imul(W))},m.prototype.mul=function(j,W){return this._verify2(j,W),this.imod(j.mul(W))},m.prototype.isqr=function(j){return this.imul(j,j.clone())},m.prototype.sqr=function(j){return this.mul(j,j)},m.prototype.sqrt=function(j){if(j.isZero())return j.clone();var W=this.m.andln(3);if(P(W%2===1),W===3){var X=this.m.add(new O(1)).iushrn(2);return this.pow(j,X)}var J=this.m.subn(1),Z=0;while(!J.isZero()&&J.andln(1)===0)Z++,J.iushrn(1);P(!J.isZero());var G=new O(1).toRed(this),M=G.redNeg(),A=this.m.subn(1).iushrn(1),v=this.m.bitLength();v=new O(2*v*v).toRed(this);while(this.pow(v,A).cmp(M)!==0)v.redIAdd(M);var V=this.pow(v,J),R=this.pow(j,J.addn(1).iushrn(1)),E=this.pow(j,J),b=Z;while(E.cmp(G)!==0){var x=E;for(var l=0;x.cmp(G)!==0;l++)x=x.redSqr();P(l<b);var F=this.pow(V,new O(1).iushln(b-l-1));R=R.redMul(F),V=F.redSqr(),E=E.redMul(V),b=l}return R},m.prototype.invm=function(j){var W=j._invmp(this.m);if(W.negative!==0)return W.negative=0,this.imod(W).redNeg();else return this.imod(W)},m.prototype.pow=function(j,W){if(W.isZero())return new O(1).toRed(this);if(W.cmpn(1)===0)return j.clone();var X=4,J=Array(1<<X);J[0]=new O(1).toRed(this),J[1]=j;for(var Z=2;Z<J.length;Z++)J[Z]=this.mul(J[Z-1],j);var G=J[0],M=0,A=0,v=W.bitLength()%26;if(v===0)v=26;for(Z=W.length-1;Z>=0;Z--){var V=W.words[Z];for(var R=v-1;R>=0;R--){var E=V>>R&1;if(G!==J[0])G=this.sqr(G);if(E===0&&M===0){A=0;continue}if(M<<=1,M|=E,A++,A!==X&&(Z!==0||R!==0))continue;G=this.mul(G,J[M]),A=0,M=0}v=26}return G},m.prototype.convertTo=function(j){var W=j.umod(this.m);return W===j?W.clone():W},m.prototype.convertFrom=function(j){var W=j.clone();return W.red=null,W},O.mont=function(j){return new e(j)};function e(j){if(m.call(this,j),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(e,m),e.prototype.convertTo=function(j){return this.imod(j.ushln(this.shift))},e.prototype.convertFrom=function(j){var W=this.imod(j.mul(this.rinv));return W.red=null,W},e.prototype.imul=function(j,W){if(j.isZero()||W.isZero())return j.words[0]=0,j.length=1,j;var X=j.imul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.mul=function(j,W){if(j.isZero()||W.isZero())return new O(0)._forceRed(this);var X=j.mul(W),J=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Z=X.isub(J).iushrn(this.shift),G=Z;if(Z.cmp(this.m)>=0)G=Z.isub(this.m);else if(Z.cmpn(0)<0)G=Z.iadd(this.m);return G._forceRed(this)},e.prototype.invm=function(j){var W=this.imod(j._invmp(this.m).mul(this.r2));return W._forceRed(this)}})(typeof q>"u"||q,$)}),CM=T$(($,q)=>{var _=hH(),K=mq().Buffer;function P(Y,O){return K.from(Y.toRed(_.mont(O.modulus)).redPow(new _(O.publicExponent)).fromRed().toArray())}q.exports=P}),wB=T$(($,q)=>{(function(_,K){function P(J,Z){if(!J)throw Error(Z||"Assertion failed")}function Y(J,Z){J.super_=Z;var G=function(){};G.prototype=Z.prototype,J.prototype=new G,J.prototype.constructor=J}function O(J,Z,G){if(O.isBN(J))return J;if(this.negative=0,this.words=null,this.length=0,this.red=null,J!==null){if(Z==="le"||Z==="be")G=Z,Z=10;this._init(J||0,Z||10,G||"be")}}if(typeof _==="object")_.exports=O;else K.BN=O;O.BN=O,O.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(wq(),J6(Tq)).Buffer}catch(J){}O.isBN=function(J){if(J instanceof O)return!0;return J!==null&&typeof J==="object"&&J.constructor.wordSize===O.wordSize&&Array.isArray(J.words)},O.max=function(J,Z){if(J.cmp(Z)>0)return J;return Z},O.min=function(J,Z){if(J.cmp(Z)<0)return J;return Z},O.prototype._init=function(J,Z,G){if(typeof J==="number")return this._initNumber(J,Z,G);if(typeof J==="object")return this._initArray(J,Z,G);if(Z==="hex")Z=16;P(Z===(Z|0)&&Z>=2&&Z<=36),J=J.toString().replace(/\s+/g,"");var M=0;if(J[0]==="-")M++,this.negative=1;if(M<J.length){if(Z===16)this._parseHex(J,M,G);else if(this._parseBase(J,Z,M),G==="le")this._initArray(this.toArray(),Z,G)}},O.prototype._initNumber=function(J,Z,G){if(J<0)this.negative=1,J=-J;if(J<67108864)this.words=[J&67108863],this.length=1;else if(J<4503599627370496)this.words=[J&67108863,J/67108864&67108863],this.length=2;else P(J<9007199254740992),this.words=[J&67108863,J/67108864&67108863,1],this.length=3;if(G!=="le")return;this._initArray(this.toArray(),Z,G)},O.prototype._initArray=function(J,Z,G){if(P(typeof J.length==="number"),J.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(J.length/3),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var A,v,V=0;if(G==="be"){for(M=J.length-1,A=0;M>=0;M-=3)if(v=J[M]|J[M-1]<<8|J[M-2]<<16,this.words[A]|=v<<V&67108863,this.words[A+1]=v>>>26-V&67108863,V+=24,V>=26)V-=26,A++}else if(G==="le"){for(M=0,A=0;M<J.length;M+=3)if(v=J[M]|J[M+1]<<8|J[M+2]<<16,this.words[A]|=v<<V&67108863,this.words[A+1]=v>>>26-V&67108863,V+=24,V>=26)V-=26,A++}return this._strip()};function T(J,Z){var G=J.charCodeAt(Z);if(G>=48&&G<=57)return G-48;else if(G>=65&&G<=70)return G-55;else if(G>=97&&G<=102)return G-87;else P(!1,"Invalid character in "+J)}function H(J,Z,G){var M=T(J,G);if(G-1>=Z)M|=T(J,G-1)<<4;return M}O.prototype._parseHex=function(J,Z,G){this.length=Math.ceil((J.length-Z)/6),this.words=Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var A=0,v=0,V;if(G==="be")for(M=J.length-1;M>=Z;M-=2)if(V=H(J,Z,M)<<A,this.words[v]|=V&67108863,A>=18)A-=18,v+=1,this.words[v]|=V>>>26;else A+=8;else{var R=J.length-Z;for(M=R%2===0?Z+1:Z;M<J.length;M+=2)if(V=H(J,Z,M)<<A,this.words[v]|=V&67108863,A>=18)A-=18,v+=1,this.words[v]|=V>>>26;else A+=8}this._strip()};function f(J,Z,G,M){var A=0,v=0,V=Math.min(J.length,G);for(var R=Z;R<V;R++){var E=J.charCodeAt(R)-48;if(A*=M,E>=49)v=E-49+10;else if(E>=17)v=E-17+10;else v=E;P(E>=0&&v<M,"Invalid character"),A+=v}return A}O.prototype._parseBase=function(J,Z,G){this.words=[0],this.length=1;for(var M=0,A=1;A<=67108863;A*=Z)M++;M--,A=A/Z|0;var v=J.length-G,V=v%M,R=Math.min(v,v-V)+G,E=0;for(var b=G;b<R;b+=M)if(E=f(J,b,b+M,Z),this.imuln(A),this.words[0]+E<67108864)this.words[0]+=E;else this._iaddn(E);if(V!==0){var x=1;E=f(J,b,J.length,Z);for(b=0;b<V;b++)x*=Z;if(this.imuln(x),this.words[0]+E<67108864)this.words[0]+=E;else this._iaddn(E)}this._strip()},O.prototype.copy=function(J){J.words=Array(this.length);for(var Z=0;Z<this.length;Z++)J.words[Z]=this.words[Z];J.length=this.length,J.negative=this.negative,J.red=this.red};function w(J,Z){J.words=Z.words,J.length=Z.length,J.negative=Z.negative,J.red=Z.red}if(O.prototype._move=function(J){w(J,this)},O.prototype.clone=function(){var J=new O(null);return this.copy(J),J},O.prototype._expand=function(J){while(this.length<J)this.words[this.length++]=0;return this},O.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},O.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{O.prototype[Symbol.for("nodejs.util.inspect.custom")]=k}catch(J){O.prototype.inspect=k}else O.prototype.inspect=k;function k(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","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"],N=[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],h=[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(O.prototype.toString=function(J,Z){J=J||10,Z=Z|0||1;var G;if(J===16||J==="hex"){G="";var M=0,A=0;for(var v=0;v<this.length;v++){var V=this.words[v],R=((V<<M|A)&16777215).toString(16);if(A=V>>>24-M&16777215,M+=2,M>=26)M-=26,v--;if(A!==0||v!==this.length-1)G=S[6-R.length]+R+G;else G=R+G}if(A!==0)G=A.toString(16)+G;while(G.length%Z!==0)G="0"+G;if(this.negative!==0)G="-"+G;return G}if(J===(J|0)&&J>=2&&J<=36){var E=N[J],b=h[J];G="";var x=this.clone();x.negative=0;while(!x.isZero()){var l=x.modrn(b).toString(J);if(x=x.idivn(b),!x.isZero())G=S[E-l.length]+l+G;else G=l+G}if(this.isZero())G="0"+G;while(G.length%Z!==0)G="0"+G;if(this.negative!==0)G="-"+G;return G}P(!1,"Base should be between 2 and 36")},O.prototype.toNumber=function(){var J=this.words[0];if(this.length===2)J+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)J+=4503599627370496+this.words[1]*67108864;else if(this.length>2)P(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-J:J},O.prototype.toJSON=function(){return this.toString(16,2)},z)O.prototype.toBuffer=function(J,Z){return this.toArrayLike(z,J,Z)};O.prototype.toArray=function(J,Z){return this.toArrayLike(Array,J,Z)};var C=function(J,Z){if(J.allocUnsafe)return J.allocUnsafe(Z);return new J(Z)};if(O.prototype.toArrayLike=function(J,Z,G){this._strip();var M=this.byteLength(),A=G||Math.max(1,M);P(M<=A,"byte array longer than desired length"),P(A>0,"Requested array length <= 0");var v=C(J,A),V=Z==="le"?"LE":"BE";return this["_toArrayLike"+V](v,M),v},O.prototype._toArrayLikeLE=function(J,Z){var G=0,M=0;for(var A=0,v=0;A<this.length;A++){var V=this.words[A]<<v|M;if(J[G++]=V&255,G<J.length)J[G++]=V>>8&255;if(G<J.length)J[G++]=V>>16&255;if(v===6){if(G<J.length)J[G++]=V>>24&255;M=0,v=0}else M=V>>>24,v+=2}if(G<J.length){J[G++]=M;while(G<J.length)J[G++]=0}},O.prototype._toArrayLikeBE=function(J,Z){var G=J.length-1,M=0;for(var A=0,v=0;A<this.length;A++){var V=this.words[A]<<v|M;if(J[G--]=V&255,G>=0)J[G--]=V>>8&255;if(G>=0)J[G--]=V>>16&255;if(v===6){if(G>=0)J[G--]=V>>24&255;M=0,v=0}else M=V>>>24,v+=2}if(G>=0){J[G--]=M;while(G>=0)J[G--]=0}},Math.clz32)O.prototype._countBits=function(J){return 32-Math.clz32(J)};else O.prototype._countBits=function(J){var Z=J,G=0;if(Z>=4096)G+=13,Z>>>=13;if(Z>=64)G+=7,Z>>>=7;if(Z>=8)G+=4,Z>>>=4;if(Z>=2)G+=2,Z>>>=2;return G+Z};O.prototype._zeroBits=function(J){if(J===0)return 26;var Z=J,G=0;if((Z&8191)===0)G+=13,Z>>>=13;if((Z&127)===0)G+=7,Z>>>=7;if((Z&15)===0)G+=4,Z>>>=4;if((Z&3)===0)G+=2,Z>>>=2;if((Z&1)===0)G++;return G},O.prototype.bitLength=function(){var J=this.words[this.length-1],Z=this._countBits(J);return(this.length-1)*26+Z};function I(J){var Z=Array(J.bitLength());for(var G=0;G<Z.length;G++){var M=G/26|0,A=G%26;Z[G]=J.words[M]>>>A&1}return Z}O.prototype.zeroBits=function(){if(this.isZero())return 0;var J=0;for(var Z=0;Z<this.length;Z++){var G=this._zeroBits(this.words[Z]);if(J+=G,G!==26)break}return J},O.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},O.prototype.toTwos=function(J){if(this.negative!==0)return this.abs().inotn(J).iaddn(1);return this.clone()},O.prototype.fromTwos=function(J){if(this.testn(J-1))return this.notn(J).iaddn(1).ineg();return this.clone()},O.prototype.isNeg=function(){return this.negative!==0},O.prototype.neg=function(){return this.clone().ineg()},O.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},O.prototype.iuor=function(J){while(this.length<J.length)this.words[this.length++]=0;for(var Z=0;Z<J.length;Z++)this.words[Z]=this.words[Z]|J.words[Z];return this._strip()},O.prototype.ior=function(J){return P((this.negative|J.negative)===0),this.iuor(J)},O.prototype.or=function(J){if(this.length>J.length)return this.clone().ior(J);return J.clone().ior(this)},O.prototype.uor=function(J){if(this.length>J.length)return this.clone().iuor(J);return J.clone().iuor(this)},O.prototype.iuand=function(J){var Z;if(this.length>J.length)Z=J;else Z=this;for(var G=0;G<Z.length;G++)this.words[G]=this.words[G]&J.words[G];return this.length=Z.length,this._strip()},O.prototype.iand=function(J){return P((this.negative|J.negative)===0),this.iuand(J)},O.prototype.and=function(J){if(this.length>J.length)return this.clone().iand(J);return J.clone().iand(this)},O.prototype.uand=function(J){if(this.length>J.length)return this.clone().iuand(J);return J.clone().iuand(this)},O.prototype.iuxor=function(J){var Z,G;if(this.length>J.length)Z=this,G=J;else Z=J,G=this;for(var M=0;M<G.length;M++)this.words[M]=Z.words[M]^G.words[M];if(this!==Z)for(;M<Z.length;M++)this.words[M]=Z.words[M];return this.length=Z.length,this._strip()},O.prototype.ixor=function(J){return P((this.negative|J.negative)===0),this.iuxor(J)},O.prototype.xor=function(J){if(this.length>J.length)return this.clone().ixor(J);return J.clone().ixor(this)},O.prototype.uxor=function(J){if(this.length>J.length)return this.clone().iuxor(J);return J.clone().iuxor(this)},O.prototype.inotn=function(J){P(typeof J==="number"&&J>=0);var Z=Math.ceil(J/26)|0,G=J%26;if(this._expand(Z),G>0)Z--;for(var M=0;M<Z;M++)this.words[M]=~this.words[M]&67108863;if(G>0)this.words[M]=~this.words[M]&67108863>>26-G;return this._strip()},O.prototype.notn=function(J){return this.clone().inotn(J)},O.prototype.setn=function(J,Z){P(typeof J==="number"&&J>=0);var G=J/26|0,M=J%26;if(this._expand(G+1),Z)this.words[G]=this.words[G]|1<<M;else this.words[G]=this.words[G]&~(1<<M);return this._strip()},O.prototype.iadd=function(J){var Z;if(this.negative!==0&&J.negative===0)return this.negative=0,Z=this.isub(J),this.negative^=1,this._normSign();else if(this.negative===0&&J.negative!==0)return J.negative=0,Z=this.isub(J),J.negative=1,Z._normSign();var G,M;if(this.length>J.length)G=this,M=J;else G=J,M=this;var A=0;for(var v=0;v<M.length;v++)Z=(G.words[v]|0)+(M.words[v]|0)+A,this.words[v]=Z&67108863,A=Z>>>26;for(;A!==0&&v<G.length;v++)Z=(G.words[v]|0)+A,this.words[v]=Z&67108863,A=Z>>>26;if(this.length=G.length,A!==0)this.words[this.length]=A,this.length++;else if(G!==this)for(;v<G.length;v++)this.words[v]=G.words[v];return this},O.prototype.add=function(J){var Z;if(J.negative!==0&&this.negative===0)return J.negative=0,Z=this.sub(J),J.negative^=1,Z;else if(J.negative===0&&this.negative!==0)return this.negative=0,Z=J.sub(this),this.negative=1,Z;if(this.length>J.length)return this.clone().iadd(J);return J.clone().iadd(this)},O.prototype.isub=function(J){if(J.negative!==0){J.negative=0;var Z=this.iadd(J);return J.negative=1,Z._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(J),this.negative=1,this._normSign();var G=this.cmp(J);if(G===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,A;if(G>0)M=this,A=J;else M=J,A=this;var v=0;for(var V=0;V<A.length;V++)Z=(M.words[V]|0)-(A.words[V]|0)+v,v=Z>>26,this.words[V]=Z&67108863;for(;v!==0&&V<M.length;V++)Z=(M.words[V]|0)+v,v=Z>>26,this.words[V]=Z&67108863;if(v===0&&V<M.length&&M!==this)for(;V<M.length;V++)this.words[V]=M.words[V];if(this.length=Math.max(this.length,V),M!==this)this.negative=1;return this._strip()},O.prototype.sub=function(J){return this.clone().isub(J)};function D(J,Z,G){G.negative=Z.negative^J.negative;var M=J.length+Z.length|0;G.length=M,M=M-1|0;var A=J.words[0]|0,v=Z.words[0]|0,V=A*v,R=V&67108863,E=V/67108864|0;G.words[0]=R;for(var b=1;b<M;b++){var x=E>>>26,l=E&67108863,F=Math.min(b,Z.length-1);for(var f$=Math.max(0,b-J.length+1);f$<=F;f$++){var q$=b-f$|0;A=J.words[q$]|0,v=Z.words[f$]|0,V=A*v+l,x+=V/67108864|0,l=V&67108863}G.words[b]=l|0,E=x|0}if(E!==0)G.words[b]=E|0;else G.length--;return G._strip()}var L=function(J,Z,G){var M=J.words,A=Z.words,v=G.words,V=0,R,E,b,x=M[0]|0,l=x&8191,F=x>>>13,f$=M[1]|0,q$=f$&8191,B=f$>>>13,v$=M[2]|0,a=v$&8191,P$=v$>>>13,o$=M[3]|0,c=o$&8191,r=o$>>>13,J$=M[4]|0,$$=J$&8191,_$=J$>>>13,O$=M[5]|0,d=O$&8191,n=O$>>>13,H$=M[6]|0,t=H$&8191,U=H$>>>13,A$=M[7]|0,W$=A$&8191,z$=A$>>>13,Z6=M[8]|0,X$=Z6&8191,k$=Z6>>>13,o6=M[9]|0,M$=o6&8191,S$=o6>>>13,Sq=A[0]|0,E$=Sq&8191,b$=Sq>>>13,Mq=A[1]|0,g$=Mq&8191,h$=Mq>>>13,fq=A[2]|0,y$=fq&8191,R$=fq>>>13,zq=A[3]|0,u$=zq&8191,x$=zq>>>13,Wq=A[4]|0,I$=Wq&8191,u=Wq>>>13,i=A[5]|0,K$=i&8191,Y$=i>>>13,B$=A[6]|0,G$=B$&8191,V$=B$>>>13,p6=A[7]|0,D$=p6&8191,p$=p6>>>13,Zq=A[8]|0,L$=Zq&8191,C$=Zq>>>13,c6=A[9]|0,W6=c6&8191,j6=c6>>>13;G.negative=J.negative^Z.negative,G.length=19,R=Math.imul(l,E$),E=Math.imul(l,b$),E=E+Math.imul(F,E$)|0,b=Math.imul(F,b$);var E6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(E6>>>26)|0,E6&=67108863,R=Math.imul(q$,E$),E=Math.imul(q$,b$),E=E+Math.imul(B,E$)|0,b=Math.imul(B,b$),R=R+Math.imul(l,g$)|0,E=E+Math.imul(l,h$)|0,E=E+Math.imul(F,g$)|0,b=b+Math.imul(F,h$)|0;var M6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(M6>>>26)|0,M6&=67108863,R=Math.imul(a,E$),E=Math.imul(a,b$),E=E+Math.imul(P$,E$)|0,b=Math.imul(P$,b$),R=R+Math.imul(q$,g$)|0,E=E+Math.imul(q$,h$)|0,E=E+Math.imul(B,g$)|0,b=b+Math.imul(B,h$)|0,R=R+Math.imul(l,y$)|0,E=E+Math.imul(l,R$)|0,E=E+Math.imul(F,y$)|0,b=b+Math.imul(F,R$)|0;var t6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(t6>>>26)|0,t6&=67108863,R=Math.imul(c,E$),E=Math.imul(c,b$),E=E+Math.imul(r,E$)|0,b=Math.imul(r,b$),R=R+Math.imul(a,g$)|0,E=E+Math.imul(a,h$)|0,E=E+Math.imul(P$,g$)|0,b=b+Math.imul(P$,h$)|0,R=R+Math.imul(q$,y$)|0,E=E+Math.imul(q$,R$)|0,E=E+Math.imul(B,y$)|0,b=b+Math.imul(B,R$)|0,R=R+Math.imul(l,u$)|0,E=E+Math.imul(l,x$)|0,E=E+Math.imul(F,u$)|0,b=b+Math.imul(F,x$)|0;var U6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(U6>>>26)|0,U6&=67108863,R=Math.imul($$,E$),E=Math.imul($$,b$),E=E+Math.imul(_$,E$)|0,b=Math.imul(_$,b$),R=R+Math.imul(c,g$)|0,E=E+Math.imul(c,h$)|0,E=E+Math.imul(r,g$)|0,b=b+Math.imul(r,h$)|0,R=R+Math.imul(a,y$)|0,E=E+Math.imul(a,R$)|0,E=E+Math.imul(P$,y$)|0,b=b+Math.imul(P$,R$)|0,R=R+Math.imul(q$,u$)|0,E=E+Math.imul(q$,x$)|0,E=E+Math.imul(B,u$)|0,b=b+Math.imul(B,x$)|0,R=R+Math.imul(l,I$)|0,E=E+Math.imul(l,u)|0,E=E+Math.imul(F,I$)|0,b=b+Math.imul(F,u)|0;var F6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(F6>>>26)|0,F6&=67108863,R=Math.imul(d,E$),E=Math.imul(d,b$),E=E+Math.imul(n,E$)|0,b=Math.imul(n,b$),R=R+Math.imul($$,g$)|0,E=E+Math.imul($$,h$)|0,E=E+Math.imul(_$,g$)|0,b=b+Math.imul(_$,h$)|0,R=R+Math.imul(c,y$)|0,E=E+Math.imul(c,R$)|0,E=E+Math.imul(r,y$)|0,b=b+Math.imul(r,R$)|0,R=R+Math.imul(a,u$)|0,E=E+Math.imul(a,x$)|0,E=E+Math.imul(P$,u$)|0,b=b+Math.imul(P$,x$)|0,R=R+Math.imul(q$,I$)|0,E=E+Math.imul(q$,u)|0,E=E+Math.imul(B,I$)|0,b=b+Math.imul(B,u)|0,R=R+Math.imul(l,K$)|0,E=E+Math.imul(l,Y$)|0,E=E+Math.imul(F,K$)|0,b=b+Math.imul(F,Y$)|0;var Q6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(Q6>>>26)|0,Q6&=67108863,R=Math.imul(t,E$),E=Math.imul(t,b$),E=E+Math.imul(U,E$)|0,b=Math.imul(U,b$),R=R+Math.imul(d,g$)|0,E=E+Math.imul(d,h$)|0,E=E+Math.imul(n,g$)|0,b=b+Math.imul(n,h$)|0,R=R+Math.imul($$,y$)|0,E=E+Math.imul($$,R$)|0,E=E+Math.imul(_$,y$)|0,b=b+Math.imul(_$,R$)|0,R=R+Math.imul(c,u$)|0,E=E+Math.imul(c,x$)|0,E=E+Math.imul(r,u$)|0,b=b+Math.imul(r,x$)|0,R=R+Math.imul(a,I$)|0,E=E+Math.imul(a,u)|0,E=E+Math.imul(P$,I$)|0,b=b+Math.imul(P$,u)|0,R=R+Math.imul(q$,K$)|0,E=E+Math.imul(q$,Y$)|0,E=E+Math.imul(B,K$)|0,b=b+Math.imul(B,Y$)|0,R=R+Math.imul(l,G$)|0,E=E+Math.imul(l,V$)|0,E=E+Math.imul(F,G$)|0,b=b+Math.imul(F,V$)|0;var a6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(a6>>>26)|0,a6&=67108863,R=Math.imul(W$,E$),E=Math.imul(W$,b$),E=E+Math.imul(z$,E$)|0,b=Math.imul(z$,b$),R=R+Math.imul(t,g$)|0,E=E+Math.imul(t,h$)|0,E=E+Math.imul(U,g$)|0,b=b+Math.imul(U,h$)|0,R=R+Math.imul(d,y$)|0,E=E+Math.imul(d,R$)|0,E=E+Math.imul(n,y$)|0,b=b+Math.imul(n,R$)|0,R=R+Math.imul($$,u$)|0,E=E+Math.imul($$,x$)|0,E=E+Math.imul(_$,u$)|0,b=b+Math.imul(_$,x$)|0,R=R+Math.imul(c,I$)|0,E=E+Math.imul(c,u)|0,E=E+Math.imul(r,I$)|0,b=b+Math.imul(r,u)|0,R=R+Math.imul(a,K$)|0,E=E+Math.imul(a,Y$)|0,E=E+Math.imul(P$,K$)|0,b=b+Math.imul(P$,Y$)|0,R=R+Math.imul(q$,G$)|0,E=E+Math.imul(q$,V$)|0,E=E+Math.imul(B,G$)|0,b=b+Math.imul(B,V$)|0,R=R+Math.imul(l,D$)|0,E=E+Math.imul(l,p$)|0,E=E+Math.imul(F,D$)|0,b=b+Math.imul(F,p$)|0;var e6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(e6>>>26)|0,e6&=67108863,R=Math.imul(X$,E$),E=Math.imul(X$,b$),E=E+Math.imul(k$,E$)|0,b=Math.imul(k$,b$),R=R+Math.imul(W$,g$)|0,E=E+Math.imul(W$,h$)|0,E=E+Math.imul(z$,g$)|0,b=b+Math.imul(z$,h$)|0,R=R+Math.imul(t,y$)|0,E=E+Math.imul(t,R$)|0,E=E+Math.imul(U,y$)|0,b=b+Math.imul(U,R$)|0,R=R+Math.imul(d,u$)|0,E=E+Math.imul(d,x$)|0,E=E+Math.imul(n,u$)|0,b=b+Math.imul(n,x$)|0,R=R+Math.imul($$,I$)|0,E=E+Math.imul($$,u)|0,E=E+Math.imul(_$,I$)|0,b=b+Math.imul(_$,u)|0,R=R+Math.imul(c,K$)|0,E=E+Math.imul(c,Y$)|0,E=E+Math.imul(r,K$)|0,b=b+Math.imul(r,Y$)|0,R=R+Math.imul(a,G$)|0,E=E+Math.imul(a,V$)|0,E=E+Math.imul(P$,G$)|0,b=b+Math.imul(P$,V$)|0,R=R+Math.imul(q$,D$)|0,E=E+Math.imul(q$,p$)|0,E=E+Math.imul(B,D$)|0,b=b+Math.imul(B,p$)|0,R=R+Math.imul(l,L$)|0,E=E+Math.imul(l,C$)|0,E=E+Math.imul(F,L$)|0,b=b+Math.imul(F,C$)|0;var s6=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(s6>>>26)|0,s6&=67108863,R=Math.imul(M$,E$),E=Math.imul(M$,b$),E=E+Math.imul(S$,E$)|0,b=Math.imul(S$,b$),R=R+Math.imul(X$,g$)|0,E=E+Math.imul(X$,h$)|0,E=E+Math.imul(k$,g$)|0,b=b+Math.imul(k$,h$)|0,R=R+Math.imul(W$,y$)|0,E=E+Math.imul(W$,R$)|0,E=E+Math.imul(z$,y$)|0,b=b+Math.imul(z$,R$)|0,R=R+Math.imul(t,u$)|0,E=E+Math.imul(t,x$)|0,E=E+Math.imul(U,u$)|0,b=b+Math.imul(U,x$)|0,R=R+Math.imul(d,I$)|0,E=E+Math.imul(d,u)|0,E=E+Math.imul(n,I$)|0,b=b+Math.imul(n,u)|0,R=R+Math.imul($$,K$)|0,E=E+Math.imul($$,Y$)|0,E=E+Math.imul(_$,K$)|0,b=b+Math.imul(_$,Y$)|0,R=R+Math.imul(c,G$)|0,E=E+Math.imul(c,V$)|0,E=E+Math.imul(r,G$)|0,b=b+Math.imul(r,V$)|0,R=R+Math.imul(a,D$)|0,E=E+Math.imul(a,p$)|0,E=E+Math.imul(P$,D$)|0,b=b+Math.imul(P$,p$)|0,R=R+Math.imul(q$,L$)|0,E=E+Math.imul(q$,C$)|0,E=E+Math.imul(B,L$)|0,b=b+Math.imul(B,C$)|0,R=R+Math.imul(l,W6)|0,E=E+Math.imul(l,j6)|0,E=E+Math.imul(F,W6)|0,b=b+Math.imul(F,j6)|0;var $q=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+($q>>>26)|0,$q&=67108863,R=Math.imul(M$,g$),E=Math.imul(M$,h$),E=E+Math.imul(S$,g$)|0,b=Math.imul(S$,h$),R=R+Math.imul(X$,y$)|0,E=E+Math.imul(X$,R$)|0,E=E+Math.imul(k$,y$)|0,b=b+Math.imul(k$,R$)|0,R=R+Math.imul(W$,u$)|0,E=E+Math.imul(W$,x$)|0,E=E+Math.imul(z$,u$)|0,b=b+Math.imul(z$,x$)|0,R=R+Math.imul(t,I$)|0,E=E+Math.imul(t,u)|0,E=E+Math.imul(U,I$)|0,b=b+Math.imul(U,u)|0,R=R+Math.imul(d,K$)|0,E=E+Math.imul(d,Y$)|0,E=E+Math.imul(n,K$)|0,b=b+Math.imul(n,Y$)|0,R=R+Math.imul($$,G$)|0,E=E+Math.imul($$,V$)|0,E=E+Math.imul(_$,G$)|0,b=b+Math.imul(_$,V$)|0,R=R+Math.imul(c,D$)|0,E=E+Math.imul(c,p$)|0,E=E+Math.imul(r,D$)|0,b=b+Math.imul(r,p$)|0,R=R+Math.imul(a,L$)|0,E=E+Math.imul(a,C$)|0,E=E+Math.imul(P$,L$)|0,b=b+Math.imul(P$,C$)|0,R=R+Math.imul(q$,W6)|0,E=E+Math.imul(q$,j6)|0,E=E+Math.imul(B,W6)|0,b=b+Math.imul(B,j6)|0;var qq=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(qq>>>26)|0,qq&=67108863,R=Math.imul(M$,y$),E=Math.imul(M$,R$),E=E+Math.imul(S$,y$)|0,b=Math.imul(S$,R$),R=R+Math.imul(X$,u$)|0,E=E+Math.imul(X$,x$)|0,E=E+Math.imul(k$,u$)|0,b=b+Math.imul(k$,x$)|0,R=R+Math.imul(W$,I$)|0,E=E+Math.imul(W$,u)|0,E=E+Math.imul(z$,I$)|0,b=b+Math.imul(z$,u)|0,R=R+Math.imul(t,K$)|0,E=E+Math.imul(t,Y$)|0,E=E+Math.imul(U,K$)|0,b=b+Math.imul(U,Y$)|0,R=R+Math.imul(d,G$)|0,E=E+Math.imul(d,V$)|0,E=E+Math.imul(n,G$)|0,b=b+Math.imul(n,V$)|0,R=R+Math.imul($$,D$)|0,E=E+Math.imul($$,p$)|0,E=E+Math.imul(_$,D$)|0,b=b+Math.imul(_$,p$)|0,R=R+Math.imul(c,L$)|0,E=E+Math.imul(c,C$)|0,E=E+Math.imul(r,L$)|0,b=b+Math.imul(r,C$)|0,R=R+Math.imul(a,W6)|0,E=E+Math.imul(a,j6)|0,E=E+Math.imul(P$,W6)|0,b=b+Math.imul(P$,j6)|0;var _q=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(_q>>>26)|0,_q&=67108863,R=Math.imul(M$,u$),E=Math.imul(M$,x$),E=E+Math.imul(S$,u$)|0,b=Math.imul(S$,x$),R=R+Math.imul(X$,I$)|0,E=E+Math.imul(X$,u)|0,E=E+Math.imul(k$,I$)|0,b=b+Math.imul(k$,u)|0,R=R+Math.imul(W$,K$)|0,E=E+Math.imul(W$,Y$)|0,E=E+Math.imul(z$,K$)|0,b=b+Math.imul(z$,Y$)|0,R=R+Math.imul(t,G$)|0,E=E+Math.imul(t,V$)|0,E=E+Math.imul(U,G$)|0,b=b+Math.imul(U,V$)|0,R=R+Math.imul(d,D$)|0,E=E+Math.imul(d,p$)|0,E=E+Math.imul(n,D$)|0,b=b+Math.imul(n,p$)|0,R=R+Math.imul($$,L$)|0,E=E+Math.imul($$,C$)|0,E=E+Math.imul(_$,L$)|0,b=b+Math.imul(_$,C$)|0,R=R+Math.imul(c,W6)|0,E=E+Math.imul(c,j6)|0,E=E+Math.imul(r,W6)|0,b=b+Math.imul(r,j6)|0;var Kq=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(Kq>>>26)|0,Kq&=67108863,R=Math.imul(M$,I$),E=Math.imul(M$,u),E=E+Math.imul(S$,I$)|0,b=Math.imul(S$,u),R=R+Math.imul(X$,K$)|0,E=E+Math.imul(X$,Y$)|0,E=E+Math.imul(k$,K$)|0,b=b+Math.imul(k$,Y$)|0,R=R+Math.imul(W$,G$)|0,E=E+Math.imul(W$,V$)|0,E=E+Math.imul(z$,G$)|0,b=b+Math.imul(z$,V$)|0,R=R+Math.imul(t,D$)|0,E=E+Math.imul(t,p$)|0,E=E+Math.imul(U,D$)|0,b=b+Math.imul(U,p$)|0,R=R+Math.imul(d,L$)|0,E=E+Math.imul(d,C$)|0,E=E+Math.imul(n,L$)|0,b=b+Math.imul(n,C$)|0,R=R+Math.imul($$,W6)|0,E=E+Math.imul($$,j6)|0,E=E+Math.imul(_$,W6)|0,b=b+Math.imul(_$,j6)|0;var Pq=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(Pq>>>26)|0,Pq&=67108863,R=Math.imul(M$,K$),E=Math.imul(M$,Y$),E=E+Math.imul(S$,K$)|0,b=Math.imul(S$,Y$),R=R+Math.imul(X$,G$)|0,E=E+Math.imul(X$,V$)|0,E=E+Math.imul(k$,G$)|0,b=b+Math.imul(k$,V$)|0,R=R+Math.imul(W$,D$)|0,E=E+Math.imul(W$,p$)|0,E=E+Math.imul(z$,D$)|0,b=b+Math.imul(z$,p$)|0,R=R+Math.imul(t,L$)|0,E=E+Math.imul(t,C$)|0,E=E+Math.imul(U,L$)|0,b=b+Math.imul(U,C$)|0,R=R+Math.imul(d,W6)|0,E=E+Math.imul(d,j6)|0,E=E+Math.imul(n,W6)|0,b=b+Math.imul(n,j6)|0;var Yq=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(Yq>>>26)|0,Yq&=67108863,R=Math.imul(M$,G$),E=Math.imul(M$,V$),E=E+Math.imul(S$,G$)|0,b=Math.imul(S$,V$),R=R+Math.imul(X$,D$)|0,E=E+Math.imul(X$,p$)|0,E=E+Math.imul(k$,D$)|0,b=b+Math.imul(k$,p$)|0,R=R+Math.imul(W$,L$)|0,E=E+Math.imul(W$,C$)|0,E=E+Math.imul(z$,L$)|0,b=b+Math.imul(z$,C$)|0,R=R+Math.imul(t,W6)|0,E=E+Math.imul(t,j6)|0,E=E+Math.imul(U,W6)|0,b=b+Math.imul(U,j6)|0;var Oq=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(Oq>>>26)|0,Oq&=67108863,R=Math.imul(M$,D$),E=Math.imul(M$,p$),E=E+Math.imul(S$,D$)|0,b=Math.imul(S$,p$),R=R+Math.imul(X$,L$)|0,E=E+Math.imul(X$,C$)|0,E=E+Math.imul(k$,L$)|0,b=b+Math.imul(k$,C$)|0,R=R+Math.imul(W$,W6)|0,E=E+Math.imul(W$,j6)|0,E=E+Math.imul(z$,W6)|0,b=b+Math.imul(z$,j6)|0;var U2=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(U2>>>26)|0,U2&=67108863,R=Math.imul(M$,L$),E=Math.imul(M$,C$),E=E+Math.imul(S$,L$)|0,b=Math.imul(S$,C$),R=R+Math.imul(X$,W6)|0,E=E+Math.imul(X$,j6)|0,E=E+Math.imul(k$,W6)|0,b=b+Math.imul(k$,j6)|0;var F2=(V+R|0)+((E&8191)<<13)|0;V=(b+(E>>>13)|0)+(F2>>>26)|0,F2&=67108863,R=Math.imul(M$,W6),E=Math.imul(M$,j6),E=E+Math.imul(S$,W6)|0,b=Math.imul(S$,j6);var Q2=(V+R|0)+((E&8191)<<13)|0;if(V=(b+(E>>>13)|0)+(Q2>>>26)|0,Q2&=67108863,v[0]=E6,v[1]=M6,v[2]=t6,v[3]=U6,v[4]=F6,v[5]=Q6,v[6]=a6,v[7]=e6,v[8]=s6,v[9]=$q,v[10]=qq,v[11]=_q,v[12]=Kq,v[13]=Pq,v[14]=Yq,v[15]=Oq,v[16]=U2,v[17]=F2,v[18]=Q2,V!==0)v[19]=V,G.length++;return G};if(!Math.imul)L=D;function g(J,Z,G){G.negative=Z.negative^J.negative,G.length=J.length+Z.length;var M=0,A=0;for(var v=0;v<G.length-1;v++){var V=A;A=0;var R=M&67108863,E=Math.min(v,Z.length-1);for(var b=Math.max(0,v-J.length+1);b<=E;b++){var x=v-b,l=J.words[x]|0,F=Z.words[b]|0,f$=l*F,q$=f$&67108863;V=V+(f$/67108864|0)|0,q$=q$+R|0,R=q$&67108863,V=V+(q$>>>26)|0,A+=V>>>26,V&=67108863}G.words[v]=R,M=V,V=A}if(M!==0)G.words[v]=M;else G.length--;return G._strip()}function y(J,Z,G){return g(J,Z,G)}O.prototype.mulTo=function(J,Z){var G,M=this.length+J.length;if(this.length===10&&J.length===10)G=L(this,J,Z);else if(M<63)G=D(this,J,Z);else if(M<1024)G=g(this,J,Z);else G=y(this,J,Z);return G};function p(J,Z){this.x=J,this.y=Z}p.prototype.makeRBT=function(J){var Z=Array(J),G=O.prototype._countBits(J)-1;for(var M=0;M<J;M++)Z[M]=this.revBin(M,G,J);return Z},p.prototype.revBin=function(J,Z,G){if(J===0||J===G-1)return J;var M=0;for(var A=0;A<Z;A++)M|=(J&1)<<Z-A-1,J>>=1;return M},p.prototype.permute=function(J,Z,G,M,A,v){for(var V=0;V<v;V++)M[V]=Z[J[V]],A[V]=G[J[V]]},p.prototype.transform=function(J,Z,G,M,A,v){this.permute(v,J,Z,G,M,A);for(var V=1;V<A;V<<=1){var R=V<<1,E=Math.cos(2*Math.PI/R),b=Math.sin(2*Math.PI/R);for(var x=0;x<A;x+=R){var l=E,F=b;for(var f$=0;f$<V;f$++){var q$=G[x+f$],B=M[x+f$],v$=G[x+f$+V],a=M[x+f$+V],P$=l*v$-F*a;if(a=l*a+F*v$,v$=P$,G[x+f$]=q$+v$,M[x+f$]=B+a,G[x+f$+V]=q$-v$,M[x+f$+V]=B-a,f$!==R)P$=E*l-b*F,F=E*F+b*l,l=P$}}}},p.prototype.guessLen13b=function(J,Z){var G=Math.max(Z,J)|1,M=G&1,A=0;for(G=G/2|0;G;G=G>>>1)A++;return 1<<A+1+M},p.prototype.conjugate=function(J,Z,G){if(G<=1)return;for(var M=0;M<G/2;M++){var A=J[M];J[M]=J[G-M-1],J[G-M-1]=A,A=Z[M],Z[M]=-Z[G-M-1],Z[G-M-1]=-A}},p.prototype.normalize13b=function(J,Z){var G=0;for(var M=0;M<Z/2;M++){var A=Math.round(J[2*M+1]/Z)*8192+Math.round(J[2*M]/Z)+G;if(J[M]=A&67108863,A<67108864)G=0;else G=A/67108864|0}return J},p.prototype.convert13b=function(J,Z,G,M){var A=0;for(var v=0;v<Z;v++)A=A+(J[v]|0),G[2*v]=A&8191,A=A>>>13,G[2*v+1]=A&8191,A=A>>>13;for(v=2*Z;v<M;++v)G[v]=0;P(A===0),P((A&-8192)===0)},p.prototype.stub=function(J){var Z=Array(J);for(var G=0;G<J;G++)Z[G]=0;return Z},p.prototype.mulp=function(J,Z,G){var M=2*this.guessLen13b(J.length,Z.length),A=this.makeRBT(M),v=this.stub(M),V=Array(M),R=Array(M),E=Array(M),b=Array(M),x=Array(M),l=Array(M),F=G.words;F.length=M,this.convert13b(J.words,J.length,V,M),this.convert13b(Z.words,Z.length,b,M),this.transform(V,v,R,E,M,A),this.transform(b,v,x,l,M,A);for(var f$=0;f$<M;f$++){var q$=R[f$]*x[f$]-E[f$]*l[f$];E[f$]=R[f$]*l[f$]+E[f$]*x[f$],R[f$]=q$}return this.conjugate(R,E,M),this.transform(R,E,F,v,M,A),this.conjugate(F,v,M),this.normalize13b(F,M),G.negative=J.negative^Z.negative,G.length=J.length+Z.length,G._strip()},O.prototype.mul=function(J){var Z=new O(null);return Z.words=Array(this.length+J.length),this.mulTo(J,Z)},O.prototype.mulf=function(J){var Z=new O(null);return Z.words=Array(this.length+J.length),y(this,J,Z)},O.prototype.imul=function(J){return this.clone().mulTo(J,this)},O.prototype.imuln=function(J){var Z=J<0;if(Z)J=-J;P(typeof J==="number"),P(J<67108864);var G=0;for(var M=0;M<this.length;M++){var A=(this.words[M]|0)*J,v=(A&67108863)+(G&67108863);G>>=26,G+=A/67108864|0,G+=v>>>26,this.words[M]=v&67108863}if(G!==0)this.words[M]=G,this.length++;return this.length=J===0?1:this.length,Z?this.ineg():this},O.prototype.muln=function(J){return this.clone().imuln(J)},O.prototype.sqr=function(){return this.mul(this)},O.prototype.isqr=function(){return this.imul(this.clone())},O.prototype.pow=function(J){var Z=I(J);if(Z.length===0)return new O(1);var G=this;for(var M=0;M<Z.length;M++,G=G.sqr())if(Z[M]!==0)break;if(++M<Z.length)for(var A=G.sqr();M<Z.length;M++,A=A.sqr()){if(Z[M]===0)continue;G=G.mul(A)}return G},O.prototype.iushln=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,G=(J-Z)/26,M=67108863>>>26-Z<<26-Z,A;if(Z!==0){var v=0;for(A=0;A<this.length;A++){var V=this.words[A]&M,R=(this.words[A]|0)-V<<Z;this.words[A]=R|v,v=V>>>26-Z}if(v)this.words[A]=v,this.length++}if(G!==0){for(A=this.length-1;A>=0;A--)this.words[A+G]=this.words[A];for(A=0;A<G;A++)this.words[A]=0;this.length+=G}return this._strip()},O.prototype.ishln=function(J){return P(this.negative===0),this.iushln(J)},O.prototype.iushrn=function(J,Z,G){P(typeof J==="number"&&J>=0);var M;if(Z)M=(Z-Z%26)/26;else M=0;var A=J%26,v=Math.min((J-A)/26,this.length),V=67108863^67108863>>>A<<A,R=G;if(M-=v,M=Math.max(0,M),R){for(var E=0;E<v;E++)R.words[E]=this.words[E];R.length=v}if(v===0);else if(this.length>v){this.length-=v;for(E=0;E<this.length;E++)this.words[E]=this.words[E+v]}else this.words[0]=0,this.length=1;var b=0;for(E=this.length-1;E>=0&&(b!==0||E>=M);E--){var x=this.words[E]|0;this.words[E]=b<<26-A|x>>>A,b=x&V}if(R&&b!==0)R.words[R.length++]=b;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},O.prototype.ishrn=function(J,Z,G){return P(this.negative===0),this.iushrn(J,Z,G)},O.prototype.shln=function(J){return this.clone().ishln(J)},O.prototype.ushln=function(J){return this.clone().iushln(J)},O.prototype.shrn=function(J){return this.clone().ishrn(J)},O.prototype.ushrn=function(J){return this.clone().iushrn(J)},O.prototype.testn=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,G=(J-Z)/26,M=1<<Z;if(this.length<=G)return!1;var A=this.words[G];return!!(A&M)},O.prototype.imaskn=function(J){P(typeof J==="number"&&J>=0);var Z=J%26,G=(J-Z)/26;if(P(this.negative===0,"imaskn works only with positive numbers"),this.length<=G)return this;if(Z!==0)G++;if(this.length=Math.min(G,this.length),Z!==0){var M=67108863^67108863>>>Z<<Z;this.words[this.length-1]&=M}return this._strip()},O.prototype.maskn=function(J){return this.clone().imaskn(J)},O.prototype.iaddn=function(J){if(P(typeof J==="number"),P(J<67108864),J<0)return this.isubn(-J);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=J)return this.words[0]=J-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(J),this.negative=1,this}return this._iaddn(J)},O.prototype._iaddn=function(J){this.words[0]+=J;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},O.prototype.isubn=function(J){if(P(typeof J==="number"),P(J<67108864),J<0)return this.iaddn(-J);if(this.negative!==0)return this.negative=0,this.iaddn(J),this.negative=1,this;if(this.words[0]-=J,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()},O.prototype.addn=function(J){return this.clone().iaddn(J)},O.prototype.subn=function(J){return this.clone().isubn(J)},O.prototype.iabs=function(){return this.negative=0,this},O.prototype.abs=function(){return this.clone().iabs()},O.prototype._ishlnsubmul=function(J,Z,G){var M=J.length+G,A;this._expand(M);var v,V=0;for(A=0;A<J.length;A++){v=(this.words[A+G]|0)+V;var R=(J.words[A]|0)*Z;v-=R&67108863,V=(v>>26)-(R/67108864|0),this.words[A+G]=v&67108863}for(;A<this.length-G;A++)v=(this.words[A+G]|0)+V,V=v>>26,this.words[A+G]=v&67108863;if(V===0)return this._strip();P(V===-1),V=0;for(A=0;A<this.length;A++)v=-(this.words[A]|0)+V,V=v>>26,this.words[A]=v&67108863;return this.negative=1,this._strip()},O.prototype._wordDiv=function(J,Z){var G=this.length-J.length,M=this.clone(),A=J,v=A.words[A.length-1]|0,V=this._countBits(v);if(G=26-V,G!==0)A=A.ushln(G),M.iushln(G),v=A.words[A.length-1]|0;var R=M.length-A.length,E;if(Z!=="mod"){E=new O(null),E.length=R+1,E.words=Array(E.length);for(var b=0;b<E.length;b++)E.words[b]=0}var x=M.clone()._ishlnsubmul(A,1,R);if(x.negative===0){if(M=x,E)E.words[R]=1}for(var l=R-1;l>=0;l--){var F=(M.words[A.length+l]|0)*67108864+(M.words[A.length+l-1]|0);F=Math.min(F/v|0,67108863),M._ishlnsubmul(A,F,l);while(M.negative!==0)if(F--,M.negative=0,M._ishlnsubmul(A,1,l),!M.isZero())M.negative^=1;if(E)E.words[l]=F}if(E)E._strip();if(M._strip(),Z!=="div"&&G!==0)M.iushrn(G);return{div:E||null,mod:M}},O.prototype.divmod=function(J,Z,G){if(P(!J.isZero()),this.isZero())return{div:new O(0),mod:new O(0)};var M,A,v;if(this.negative!==0&&J.negative===0){if(v=this.neg().divmod(J,Z),Z!=="mod")M=v.div.neg();if(Z!=="div"){if(A=v.mod.neg(),G&&A.negative!==0)A.iadd(J)}return{div:M,mod:A}}if(this.negative===0&&J.negative!==0){if(v=this.divmod(J.neg(),Z),Z!=="mod")M=v.div.neg();return{div:M,mod:v.mod}}if((this.negative&J.negative)!==0){if(v=this.neg().divmod(J.neg(),Z),Z!=="div"){if(A=v.mod.neg(),G&&A.negative!==0)A.isub(J)}return{div:v.div,mod:A}}if(J.length>this.length||this.cmp(J)<0)return{div:new O(0),mod:this};if(J.length===1){if(Z==="div")return{div:this.divn(J.words[0]),mod:null};if(Z==="mod")return{div:null,mod:new O(this.modrn(J.words[0]))};return{div:this.divn(J.words[0]),mod:new O(this.modrn(J.words[0]))}}return this._wordDiv(J,Z)},O.prototype.div=function(J){return this.divmod(J,"div",!1).div},O.prototype.mod=function(J){return this.divmod(J,"mod",!1).mod},O.prototype.umod=function(J){return this.divmod(J,"mod",!0).mod},O.prototype.divRound=function(J){var Z=this.divmod(J);if(Z.mod.isZero())return Z.div;var G=Z.div.negative!==0?Z.mod.isub(J):Z.mod,M=J.ushrn(1),A=J.andln(1),v=G.cmp(M);if(v<0||A===1&&v===0)return Z.div;return Z.div.negative!==0?Z.div.isubn(1):Z.div.iaddn(1)},O.prototype.modrn=function(J){var Z=J<0;if(Z)J=-J;P(J<=67108863);var G=67108864%J,M=0;for(var A=this.length-1;A>=0;A--)M=(G*M+(this.words[A]|0))%J;return Z?-M:M},O.prototype.modn=function(J){return this.modrn(J)},O.prototype.idivn=function(J){var Z=J<0;if(Z)J=-J;P(J<=67108863);var G=0;for(var M=this.length-1;M>=0;M--){var A=(this.words[M]|0)+G*67108864;this.words[M]=A/J|0,G=A%J}return this._strip(),Z?this.ineg():this},O.prototype.divn=function(J){return this.clone().idivn(J)},O.prototype.egcd=function(J){P(J.negative===0),P(!J.isZero());var Z=this,G=J.clone();if(Z.negative!==0)Z=Z.umod(J);else Z=Z.clone();var M=new O(1),A=new O(0),v=new O(0),V=new O(1),R=0;while(Z.isEven()&&G.isEven())Z.iushrn(1),G.iushrn(1),++R;var E=G.clone(),b=Z.clone();while(!Z.isZero()){for(var x=0,l=1;(Z.words[0]&l)===0&&x<26;++x,l<<=1);if(x>0){Z.iushrn(x);while(x-- >0){if(M.isOdd()||A.isOdd())M.iadd(E),A.isub(b);M.iushrn(1),A.iushrn(1)}}for(var F=0,f$=1;(G.words[0]&f$)===0&&F<26;++F,f$<<=1);if(F>0){G.iushrn(F);while(F-- >0){if(v.isOdd()||V.isOdd())v.iadd(E),V.isub(b);v.iushrn(1),V.iushrn(1)}}if(Z.cmp(G)>=0)Z.isub(G),M.isub(v),A.isub(V);else G.isub(Z),v.isub(M),V.isub(A)}return{a:v,b:V,gcd:G.iushln(R)}},O.prototype._invmp=function(J){P(J.negative===0),P(!J.isZero());var Z=this,G=J.clone();if(Z.negative!==0)Z=Z.umod(J);else Z=Z.clone();var M=new O(1),A=new O(0),v=G.clone();while(Z.cmpn(1)>0&&G.cmpn(1)>0){for(var V=0,R=1;(Z.words[0]&R)===0&&V<26;++V,R<<=1);if(V>0){Z.iushrn(V);while(V-- >0){if(M.isOdd())M.iadd(v);M.iushrn(1)}}for(var E=0,b=1;(G.words[0]&b)===0&&E<26;++E,b<<=1);if(E>0){G.iushrn(E);while(E-- >0){if(A.isOdd())A.iadd(v);A.iushrn(1)}}if(Z.cmp(G)>=0)Z.isub(G),M.isub(A);else G.isub(Z),A.isub(M)}var x;if(Z.cmpn(1)===0)x=M;else x=A;if(x.cmpn(0)<0)x.iadd(J);return x},O.prototype.gcd=function(J){if(this.isZero())return J.abs();if(J.isZero())return this.abs();var Z=this.clone(),G=J.clone();Z.negative=0,G.negative=0;for(var M=0;Z.isEven()&&G.isEven();M++)Z.iushrn(1),G.iushrn(1);do{while(Z.isEven())Z.iushrn(1);while(G.isEven())G.iushrn(1);var A=Z.cmp(G);if(A<0){var v=Z;Z=G,G=v}else if(A===0||G.cmpn(1)===0)break;Z.isub(G)}while(!0);return G.iushln(M)},O.prototype.invm=function(J){return this.egcd(J).a.umod(J)},O.prototype.isEven=function(){return(this.words[0]&1)===0},O.prototype.isOdd=function(){return(this.words[0]&1)===1},O.prototype.andln=function(J){return this.words[0]&J},O.prototype.bincn=function(J){P(typeof J==="number");var Z=J%26,G=(J-Z)/26,M=1<<Z;if(this.length<=G)return this._expand(G+1),this.words[G]|=M,this;var A=M;for(var v=G;A!==0&&v<this.length;v++){var V=this.words[v]|0;V+=A,A=V>>>26,V&=67108863,this.words[v]=V}if(A!==0)this.words[v]=A,this.length++;return this},O.prototype.isZero=function(){return this.length===1&&this.words[0]===0},O.prototype.cmpn=function(J){var Z=J<0;if(this.negative!==0&&!Z)return-1;if(this.negative===0&&Z)return 1;this._strip();var G;if(this.length>1)G=1;else{if(Z)J=-J;P(J<=67108863,"Number is too big");var M=this.words[0]|0;G=M===J?0:M<J?-1:1}if(this.negative!==0)return-G|0;return G},O.prototype.cmp=function(J){if(this.negative!==0&&J.negative===0)return-1;if(this.negative===0&&J.negative!==0)return 1;var Z=this.ucmp(J);if(this.negative!==0)return-Z|0;return Z},O.prototype.ucmp=function(J){if(this.length>J.length)return 1;if(this.length<J.length)return-1;var Z=0;for(var G=this.length-1;G>=0;G--){var M=this.words[G]|0,A=J.words[G]|0;if(M===A)continue;if(M<A)Z=-1;else if(M>A)Z=1;break}return Z},O.prototype.gtn=function(J){return this.cmpn(J)===1},O.prototype.gt=function(J){return this.cmp(J)===1},O.prototype.gten=function(J){return this.cmpn(J)>=0},O.prototype.gte=function(J){return this.cmp(J)>=0},O.prototype.ltn=function(J){return this.cmpn(J)===-1},O.prototype.lt=function(J){return this.cmp(J)===-1},O.prototype.lten=function(J){return this.cmpn(J)<=0},O.prototype.lte=function(J){return this.cmp(J)<=0},O.prototype.eqn=function(J){return this.cmpn(J)===0},O.prototype.eq=function(J){return this.cmp(J)===0},O.red=function(J){return new W(J)},O.prototype.toRed=function(J){return P(!this.red,"Already a number in reduction context"),P(this.negative===0,"red works only with positives"),J.convertTo(this)._forceRed(J)},O.prototype.fromRed=function(){return P(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},O.prototype._forceRed=function(J){return this.red=J,this},O.prototype.forceRed=function(J){return P(!this.red,"Already a number in reduction context"),this._forceRed(J)},O.prototype.redAdd=function(J){return P(this.red,"redAdd works only with red numbers"),this.red.add(this,J)},O.prototype.redIAdd=function(J){return P(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,J)},O.prototype.redSub=function(J){return P(this.red,"redSub works only with red numbers"),this.red.sub(this,J)},O.prototype.redISub=function(J){return P(this.red,"redISub works only with red numbers"),this.red.isub(this,J)},O.prototype.redShl=function(J){return P(this.red,"redShl works only with red numbers"),this.red.shl(this,J)},O.prototype.redMul=function(J){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.mul(this,J)},O.prototype.redIMul=function(J){return P(this.red,"redMul works only with red numbers"),this.red._verify2(this,J),this.red.imul(this,J)},O.prototype.redSqr=function(){return P(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},O.prototype.redISqr=function(){return P(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},O.prototype.redSqrt=function(){return P(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},O.prototype.redInvm=function(){return P(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},O.prototype.redNeg=function(){return P(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},O.prototype.redPow=function(J){return P(this.red&&!J.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,J)};var o={k256:null,p224:null,p192:null,p25519:null};function s(J,Z){this.name=J,this.p=new O(Z,16),this.n=this.p.bitLength(),this.k=new O(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}s.prototype._tmp=function(){var J=new O(null);return J.words=Array(Math.ceil(this.n/13)),J},s.prototype.ireduce=function(J){var Z=J,G;do this.split(Z,this.tmp),Z=this.imulK(Z),Z=Z.iadd(this.tmp),G=Z.bitLength();while(G>this.n);var M=G<this.n?-1:Z.ucmp(this.p);if(M===0)Z.words[0]=0,Z.length=1;else if(M>0)Z.isub(this.p);else if(Z.strip!==void 0)Z.strip();else Z._strip();return Z},s.prototype.split=function(J,Z){J.iushrn(this.n,0,Z)},s.prototype.imulK=function(J){return J.imul(this.k)};function Q(){s.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}Y(Q,s),Q.prototype.split=function(J,Z){var G=4194303,M=Math.min(J.length,9);for(var A=0;A<M;A++)Z.words[A]=J.words[A];if(Z.length=M,J.length<=9){J.words[0]=0,J.length=1;return}var v=J.words[9];Z.words[Z.length++]=v&G;for(A=10;A<J.length;A++){var V=J.words[A]|0;J.words[A-10]=(V&G)<<4|v>>>22,v=V}if(v>>>=22,J.words[A-10]=v,v===0&&J.length>10)J.length-=10;else J.length-=9},Q.prototype.imulK=function(J){J.words[J.length]=0,J.words[J.length+1]=0,J.length+=2;var Z=0;for(var G=0;G<J.length;G++){var M=J.words[G]|0;Z+=M*977,J.words[G]=Z&67108863,Z=M*64+(Z/67108864|0)}if(J.words[J.length-1]===0){if(J.length--,J.words[J.length-1]===0)J.length--}return J};function m(){s.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}Y(m,s);function e(){s.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}Y(e,s);function j(){s.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}Y(j,s),j.prototype.imulK=function(J){var Z=0;for(var G=0;G<J.length;G++){var M=(J.words[G]|0)*19+Z,A=M&67108863;M>>>=26,J.words[G]=A,Z=M}if(Z!==0)J.words[J.length++]=Z;return J},O._prime=function(J){if(o[J])return o[J];var Z;if(J==="k256")Z=new Q;else if(J==="p224")Z=new m;else if(J==="p192")Z=new e;else if(J==="p25519")Z=new j;else throw Error("Unknown prime "+J);return o[J]=Z,Z};function W(J){if(typeof J==="string"){var Z=O._prime(J);this.m=Z.p,this.prime=Z}else P(J.gtn(1),"modulus must be greater than 1"),this.m=J,this.prime=null}W.prototype._verify1=function(J){P(J.negative===0,"red works only with positives"),P(J.red,"red works only with red numbers")},W.prototype._verify2=function(J,Z){P((J.negative|Z.negative)===0,"red works only with positives"),P(J.red&&J.red===Z.red,"red works only with red numbers")},W.prototype.imod=function(J){if(this.prime)return this.prime.ireduce(J)._forceRed(this);return w(J,J.umod(this.m)._forceRed(this)),J},W.prototype.neg=function(J){if(J.isZero())return J.clone();return this.m.sub(J)._forceRed(this)},W.prototype.add=function(J,Z){this._verify2(J,Z);var G=J.add(Z);if(G.cmp(this.m)>=0)G.isub(this.m);return G._forceRed(this)},W.prototype.iadd=function(J,Z){this._verify2(J,Z);var G=J.iadd(Z);if(G.cmp(this.m)>=0)G.isub(this.m);return G},W.prototype.sub=function(J,Z){this._verify2(J,Z);var G=J.sub(Z);if(G.cmpn(0)<0)G.iadd(this.m);return G._forceRed(this)},W.prototype.isub=function(J,Z){this._verify2(J,Z);var G=J.isub(Z);if(G.cmpn(0)<0)G.iadd(this.m);return G},W.prototype.shl=function(J,Z){return this._verify1(J),this.imod(J.ushln(Z))},W.prototype.imul=function(J,Z){return this._verify2(J,Z),this.imod(J.imul(Z))},W.prototype.mul=function(J,Z){return this._verify2(J,Z),this.imod(J.mul(Z))},W.prototype.isqr=function(J){return this.imul(J,J.clone())},W.prototype.sqr=function(J){return this.mul(J,J)},W.prototype.sqrt=function(J){if(J.isZero())return J.clone();var Z=this.m.andln(3);if(P(Z%2===1),Z===3){var G=this.m.add(new O(1)).iushrn(2);return this.pow(J,G)}var M=this.m.subn(1),A=0;while(!M.isZero()&&M.andln(1)===0)A++,M.iushrn(1);P(!M.isZero());var v=new O(1).toRed(this),V=v.redNeg(),R=this.m.subn(1).iushrn(1),E=this.m.bitLength();E=new O(2*E*E).toRed(this);while(this.pow(E,R).cmp(V)!==0)E.redIAdd(V);var b=this.pow(E,M),x=this.pow(J,M.addn(1).iushrn(1)),l=this.pow(J,M),F=A;while(l.cmp(v)!==0){var f$=l;for(var q$=0;f$.cmp(v)!==0;q$++)f$=f$.redSqr();P(q$<F);var B=this.pow(b,new O(1).iushln(F-q$-1));x=x.redMul(B),b=B.redSqr(),l=l.redMul(b),F=q$}return x},W.prototype.invm=function(J){var Z=J._invmp(this.m);if(Z.negative!==0)return Z.negative=0,this.imod(Z).redNeg();else return this.imod(Z)},W.prototype.pow=function(J,Z){if(Z.isZero())return new O(1).toRed(this);if(Z.cmpn(1)===0)return J.clone();var G=4,M=Array(1<<G);M[0]=new O(1).toRed(this),M[1]=J;for(var A=2;A<M.length;A++)M[A]=this.mul(M[A-1],J);var v=M[0],V=0,R=0,E=Z.bitLength()%26;if(E===0)E=26;for(A=Z.length-1;A>=0;A--){var b=Z.words[A];for(var x=E-1;x>=0;x--){var l=b>>x&1;if(v!==M[0])v=this.sqr(v);if(l===0&&V===0){R=0;continue}if(V<<=1,V|=l,R++,R!==G&&(A!==0||x!==0))continue;v=this.mul(v,M[V]),R=0,V=0}E=26}return v},W.prototype.convertTo=function(J){var Z=J.umod(this.m);return Z===J?Z.clone():Z},W.prototype.convertFrom=function(J){var Z=J.clone();return Z.red=null,Z},O.mont=function(J){return new X(J)};function X(J){if(W.call(this,J),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new O(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}Y(X,W),X.prototype.convertTo=function(J){return this.imod(J.ushln(this.shift))},X.prototype.convertFrom=function(J){var Z=this.imod(J.mul(this.rinv));return Z.red=null,Z},X.prototype.imul=function(J,Z){if(J.isZero()||Z.isZero())return J.words[0]=0,J.length=1,J;var G=J.imul(Z),M=G.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=G.isub(M).iushrn(this.shift),v=A;if(A.cmp(this.m)>=0)v=A.isub(this.m);else if(A.cmpn(0)<0)v=A.iadd(this.m);return v._forceRed(this)},X.prototype.mul=function(J,Z){if(J.isZero()||Z.isZero())return new O(0)._forceRed(this);var G=J.mul(Z),M=G.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),A=G.isub(M).iushrn(this.shift),v=A;if(A.cmp(this.m)>=0)v=A.isub(this.m);else if(A.cmpn(0)<0)v=A.iadd(this.m);return v._forceRed(this)},X.prototype.invm=function(J){var Z=this.imod(J._invmp(this.m).mul(this.r2));return Z._forceRed(this)}})(typeof q>"u"||q,$)}),EM=T$(($,q)=>{var _=wB(),K=G2(),P=mq().Buffer;function Y(T){var H=T.modulus.byteLength(),f;do f=new _(K(H));while(f.cmp(T.modulus)>=0||!f.umod(T.prime1)||!f.umod(T.prime2));return f}function O(T){var H=Y(T),f=H.toRed(_.mont(T.modulus)).redPow(new _(T.publicExponent)).fromRed();return{blinder:f,unblinder:H.invm(T.modulus)}}function z(T,H){var f=O(H),w=H.modulus.byteLength(),k=new _(T).mul(f.blinder).umod(H.modulus),S=k.toRed(_.mont(H.prime1)),N=k.toRed(_.mont(H.prime2)),h=H.coefficient,C=H.prime1,I=H.prime2,D=S.redPow(H.exponent1).fromRed(),L=N.redPow(H.exponent2).fromRed(),g=D.isub(L).imul(h).umod(C).imul(I);return L.iadd(g).imul(f.unblinder).umod(H.modulus).toArrayLike(P,"be",w)}z.getr=Y,q.exports=z}),fB=T$(($,q)=>{var _=SM(),K=G2(),P=V2(),Y=MM(),O=NM(),z=hH(),T=CM(),H=EM(),f=mq().Buffer;q.exports=function(N,h,C){var I;if(N.padding)I=N.padding;else if(C)I=1;else I=4;var D=_(N),L;if(I===4)L=w(D,h);else if(I===1)L=k(D,h,C);else if(I===3){if(L=new z(h),L.cmp(D.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(C)return H(L,D);else return T(L,D)};function w(N,h){var C=N.modulus.byteLength(),I=h.length,D=P("sha1").update(f.alloc(0)).digest(),L=D.length,g=2*L;if(I>C-g-2)throw Error("message too long");var y=f.alloc(C-I-g-2),p=C-L-1,o=K(L),s=O(f.concat([D,y,f.alloc(1,1),h],p),Y(o,p)),Q=O(o,Y(s,L));return new z(f.concat([f.alloc(1),Q,s],C))}function k(N,h,C){var I=h.length,D=N.modulus.byteLength();if(I>D-11)throw Error("message too long");var L;if(C)L=f.alloc(D-I-3,255);else L=S(D-I-3);return new z(f.concat([f.from([0,C?1:2]),L,f.alloc(1),h],D))}function S(N){var h=f.allocUnsafe(N),C=0,I=K(N*2),D=0,L;while(C<N){if(D===I.length)I=K(N*2),D=0;if(L=I[D++],L)h[C++]=L}return h}}),ZB=T$(($,q)=>{var _=SM(),K=MM(),P=NM(),Y=hH(),O=EM(),z=V2(),T=CM(),H=mq().Buffer;q.exports=function(S,N,h){var C;if(S.padding)C=S.padding;else if(h)C=1;else C=4;var I=_(S),D=I.modulus.byteLength();if(N.length>D||new Y(N).cmp(I.modulus)>=0)throw Error("decryption error");var L;if(h)L=T(new Y(N),I);else L=O(N,I);var g=H.alloc(D-L.length);if(L=H.concat([g,L],D),C===4)return f(I,L);else if(C===1)return w(I,L,h);else if(C===3)return L;else throw Error("unknown padding")};function f(S,N){var h=S.modulus.byteLength(),C=z("sha1").update(H.alloc(0)).digest(),I=C.length;if(N[0]!==0)throw Error("decryption error");var D=N.slice(1,I+1),L=N.slice(I+1),g=P(D,K(L,I)),y=P(L,K(g,h-I-1));if(k(C,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 w(S,N,h){var C=N.slice(0,2),I=2,D=0;while(N[I++]!==0)if(I>=N.length){D++;break}var L=N.slice(2,I-1);if(C.toString("hex")!=="0002"&&!h||C.toString("hex")!=="0001"&&h)D++;if(L.length<8)D++;if(D)throw Error("decryption error");return N.slice(I)}function k(S,N){S=H.from(S),N=H.from(N);var h=0,C=S.length;if(S.length!==N.length)h++,C=Math.min(S.length,N.length);var I=-1;while(++I<C)h+=S[I]^N[I];return h}}),AH=T$(($)=>{$.publicEncrypt=fB(),$.privateDecrypt=ZB(),$.privateEncrypt=function(q,_){return $.publicEncrypt(q,_,!0)},$.publicDecrypt=function(q,_){return $.privateDecrypt(q,_,!0)}}),XB=T$(($)=>{var q=(lq(),J6(dq));if(typeof q.publicEncrypt!=="function")q=AH();if($.publicEncrypt=q.publicEncrypt,$.privateDecrypt=q.privateDecrypt,typeof q.privateEncrypt!=="function")$.privateEncrypt=AH().privateEncrypt;else $.privateEncrypt=q.privateEncrypt;if(typeof q.publicDecrypt!=="function")$.publicDecrypt=AH().publicDecrypt;else $.publicDecrypt=q.publicDecrypt}),AB=T$(($)=>{var q=mq(),_=G2(),K=q.Buffer,P=q.kMaxLength,Y=globalThis.crypto||globalThis.msCrypto,O=Math.pow(2,32)-1;function z(k,S){if(typeof k!=="number"||k!==k)throw TypeError("offset must be a number");if(k>O||k<0)throw TypeError("offset must be a uint32");if(k>P||k>S)throw RangeError("offset out of range")}function T(k,S,N){if(typeof k!=="number"||k!==k)throw TypeError("size must be a number");if(k>O||k<0)throw TypeError("size must be a uint32");if(k+S>N||k>P)throw RangeError("buffer too small")}Y&&Y.getRandomValues,$.randomFill=H,$.randomFillSync=w;function H(k,S,N,h){if(!K.isBuffer(k)&&!(k instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof S==="function")h=S,S=0,N=k.length;else if(typeof N==="function")h=N,N=k.length-S;else if(typeof h!=="function")throw TypeError('"cb" argument must be a function');return z(S,k.length),T(N,S,k.length),f(k,S,N,h)}function f(k,S,N,h){if(!1)var C,I;if(h){_(N,function(L,g){if(L)return h(L);g.copy(k,S),h(null,k)});return}var D=_(N);return D.copy(k,S),k}function w(k,S,N){if(typeof S>"u")S=0;if(!K.isBuffer(k)&&!(k instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(S,k.length),N===void 0)N=k.length-S;return T(N,S,k.length),f(k,S,N)}}),kB=T$(($,q)=>{var _=(lq(),J6(dq));if(typeof _.randomFill==="function"&&typeof _.randomFillSync==="function")$.randomFill=_.randomFill,$.randomFillSync=_.randomFillSync;else q.exports=AB()}),GB=T$(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=G2(),$.createHash=$.Hash=V2(),$.createHmac=$.Hmac=$M();var q=on(),_=Object.keys(q),K=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(_);$.getHashes=function(){return K};var P=JM();$.pbkdf2=P.pbkdf2,$.pbkdf2Sync=P.pbkdf2Sync;var Y=Ei();$.Cipher=Y.Cipher,$.createCipher=Y.createCipher,$.Cipheriv=Y.Cipheriv,$.createCipheriv=Y.createCipheriv,$.Decipher=Y.Decipher,$.createDecipher=Y.createDecipher,$.Decipheriv=Y.Decipheriv,$.createDecipheriv=Y.createDecipheriv,$.getCiphers=Y.getCiphers,$.listCiphers=Y.listCiphers;var O=hi();$.DiffieHellmanGroup=O.DiffieHellmanGroup,$.createDiffieHellmanGroup=O.createDiffieHellmanGroup,$.getDiffieHellman=O.getDiffieHellman,$.createDiffieHellman=O.createDiffieHellman,$.DiffieHellman=O.DiffieHellman;var z=Ri();$.createSign=z.createSign,$.Sign=z.Sign,$.createVerify=z.createVerify,$.Verify=z.Verify,$.createECDH=ai();var T=XB();$.publicEncrypt=T.publicEncrypt,$.privateEncrypt=T.privateEncrypt,$.publicDecrypt=T.publicDecrypt,$.privateDecrypt=T.privateDecrypt;var H=kB();$.randomFill=H.randomFill,$.randomFillSync=H.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}}),w6=rn(GB(),1),VB=w6.prng,SB=w6.pseudoRandomBytes,MB=w6.rng,NB=w6.randomBytes,CB=w6.Hash,EB=w6.createHash,hB=w6.Hmac,RB=w6.createHmac,IB=w6.getHashes,DB=w6.pbkdf2,LB=w6.pbkdf2Sync,bB=w6.Cipher,gB=w6.createCipher,yB=w6.Cipheriv,uB=w6.createCipheriv,xB=w6.Decipher,pB=w6.createDecipher,cB=w6.Decipheriv,mB=w6.createDecipheriv,dB=w6.getCiphers,lB=w6.listCiphers,rB=w6.DiffieHellmanGroup,oB=w6.createDiffieHellmanGroup,nB=w6.getDiffieHellman,iB=w6.createDiffieHellman,BB=w6.DiffieHellman,tB=w6.createSign,UB=w6.Sign,FB=w6.createVerify,QB=w6.Verify,aB=w6.createECDH,eB=w6.publicEncrypt,sB=w6.privateEncrypt,$t=w6.publicDecrypt,qt=w6.privateDecrypt,_t=w6.randomFill,Kt=w6.randomFillSync,Pt=w6.createCredentials,Yt=w6.constants,zt=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];Jt=crypto,Ht=crypto});var hM=N$((f5$,Tt)=>{Tt.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 gM=N$((Z5$,C_)=>{var RH=(()=>({})),N2=(nJ(),J6(oJ)),wt=(BJ(),J6(iJ)),ft=(lq(),J6(dq)),Zt=hM(),IH=Zt.version,RM=["\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 Xt(){return RM[Math.floor(Math.random()*RM.length)]}function i4($){if(typeof $==="string")return!["false","0","no","off",""].includes($.toLowerCase());return Boolean($)}function At(){return process.stdout.isTTY}function kt($){return At()?`\x1B[2m${$}\x1B[0m`:$}var Gt=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function Vt($){let q={},_=$.toString();_=_.replace(/\r\n?/mg,`
40
40
  `);let K;while((K=Gt.exec(_))!=null){let P=K[1],Y=K[2]||"";Y=Y.trim();let O=Y[0];if(Y=Y.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),O==='"')Y=Y.replace(/\\n/g,`
@@ -95,7 +95,7 @@ https://github.com/browserify/crypto-browserify`)},$.constants={DH_CHECK_P_NOT_S
95
95
  var s = this.serialize(o)
96
96
  this.restore(o)
97
97
  return s
98
- `}function WU($,q){return $===!0?"throw Error('fast-redact: primitives cannot be redacted')":q===!1?"return o":"return this.serialize(o)"}});var PT=N$((MY$,AN)=>{AN.exports={groupRedact:HU,groupRestore:JU,nestedRedact:wU,nestedRestore:TU};function JU({keys:$,values:q,target:_}){if(_==null||typeof _==="string")return;let K=$.length;for(var P=0;P<K;P++){let Y=$[P];_[Y]=q[P]}}function HU($,q,_,K,P){let Y=ZN($,q);if(Y==null||typeof Y==="string")return{keys:null,values:null,target:Y,flat:!0};let O=Object.keys(Y),z=O.length,T=q.length,H=P?[...q]:void 0,f=Array(z);for(var w=0;w<z;w++){let k=O[w];if(f[w]=Y[k],P)H[T]=k,Y[k]=_(Y[k],H);else if(K)Y[k]=_(Y[k]);else Y[k]=_}return{keys:O,values:f,target:Y,flat:!0}}function TU($){for(let q=0;q<$.length;q++){let{target:_,path:K,value:P}=$[q],Y=_;for(let O=K.length-1;O>0;O--)Y=Y[K[O]];Y[K[0]]=P}}function wU($,q,_,K,P,Y,O){let z=ZN(q,_);if(z==null)return;let T=Object.keys(z),H=T.length;for(var f=0;f<H;f++){let w=T[f];fU($,z,w,_,K,P,Y,O)}return $}function KT($,q){return $!==void 0&&$!==null?"hasOwn"in Object?Object.hasOwn($,q):Object.prototype.hasOwnProperty.call($,q):!1}function fU($,q,_,K,P,Y,O,z){let T=P.length,H=T-1,f=_;var w=-1,k,S,N,h=null,C=null,I,D,L=!1,g=0,y=0,c=ZU();if(N=k=q[_],typeof k!=="object")return;while(k!=null&&++w<T){if(y+=1,_=P[w],h=N,_!=="*"&&!C&&!(typeof k==="object"&&(_ in k)))break;if(_==="*"){if(C==="*")L=!0;if(C=_,w!==H)continue}if(C){let s=Object.keys(k);for(var o=0;o<s.length;o++){let F=s[o];if(D=k[F],I=_==="*",L)c=R_(c,F,y),g=w,N=XN(D,g-1,_,K,P,Y,O,z,f,k,S,N,I,F,w,H,c,$,q[f],y+1);else if(I||typeof D==="object"&&D!==null&&_ in D){if(I)N=D;else N=D[_];if(S=w!==H?N:O?z?Y(N,[...K,f,...P]):Y(N):Y,I){let p=f1(R_(c,F,y),N,q[f]);$.push(p),k[F]=S}else if(D[_]===S);else if(S===void 0&&Y!==void 0||KT(D,_)&&S===N)c=R_(c,F,y);else{c=R_(c,F,y);let p=f1(R_(c,_,y+1),N,q[f]);$.push(p),D[_]=S}}}C=null}else{if(N=k[_],c=R_(c,_,y),S=w!==H?N:O?z?Y(N,[...K,f,...P]):Y(N):Y,KT(k,_)&&S===N||S===void 0&&Y!==void 0);else{let s=f1(c,N,q[f]);$.push(s),k[_]=S}k=k[_]}if(typeof k!=="object")break}}function ZN($,q){var _=-1,K=q.length,P=$;while(P!=null&&++_<K)P=P[q[_]];return P}function XN($,q,_,K,P,Y,O,z,T,H,f,w,k,S,N,h,C,I,D,L){if(q===0){if(k||typeof $==="object"&&$!==null&&_ in $){if(k)w=$;else w=$[_];if(f=N!==h?w:O?z?Y(w,[...K,T,...P]):Y(w):Y,k){let g=f1(C,w,D);I.push(g),H[S]=f}else if($[_]===f);else if(f===void 0&&Y!==void 0||KT($,_)&&f===w);else{let g=f1(R_(C,_,L+1),w,D);I.push(g),$[_]=f}}}for(let g in $)if(typeof $[g]==="object")C=R_(C,g,L),XN($[g],q-1,_,K,P,Y,O,z,T,H,f,w,k,S,N,h,C,I,D,L+1)}function ZU(){return{parent:null,key:null,children:[],depth:0}}function R_($,q,_){if($.depth===_)return R_($.parent,q,_);var K={parent:$,key:q,depth:_,children:[]};return $.children.push(K),K}function f1($,q,_){let K=$,P=[];do P.push(K.key),K=K.parent;while(K.parent!=null);return{path:P,value:q,target:_}}});var GN=N$((NY$,kN)=>{var{groupRestore:XU,nestedRestore:AU}=PT();kN.exports=kU;function kU(){return function(){if(this.restore){this.restore.state.secret=this.secret;return}let{secret:q,wcLen:_}=this,K=Object.keys(q),P=GU(q,K),Y=_>0,O=Y?{secret:q,groupRestore:XU,nestedRestore:AU}:{secret:q};this.restore=Function("o",VU(P,K,Y)).bind(O),this.restore.state=O}}function GU($,q){return q.map((_)=>{let{circle:K,escPath:P,leadingBracket:Y}=$[_],z=K?`o.${K} = secret[${P}].val`:`o${Y?"":"."}${_} = secret[${P}].val`,T=`secret[${P}].val = undefined`;return`
98
+ `}function WU($,q){return $===!0?"throw Error('fast-redact: primitives cannot be redacted')":q===!1?"return o":"return this.serialize(o)"}});var PT=N$((MY$,AN)=>{AN.exports={groupRedact:HU,groupRestore:JU,nestedRedact:wU,nestedRestore:TU};function JU({keys:$,values:q,target:_}){if(_==null||typeof _==="string")return;let K=$.length;for(var P=0;P<K;P++){let Y=$[P];_[Y]=q[P]}}function HU($,q,_,K,P){let Y=ZN($,q);if(Y==null||typeof Y==="string")return{keys:null,values:null,target:Y,flat:!0};let O=Object.keys(Y),z=O.length,T=q.length,H=P?[...q]:void 0,f=Array(z);for(var w=0;w<z;w++){let k=O[w];if(f[w]=Y[k],P)H[T]=k,Y[k]=_(Y[k],H);else if(K)Y[k]=_(Y[k]);else Y[k]=_}return{keys:O,values:f,target:Y,flat:!0}}function TU($){for(let q=0;q<$.length;q++){let{target:_,path:K,value:P}=$[q],Y=_;for(let O=K.length-1;O>0;O--)Y=Y[K[O]];Y[K[0]]=P}}function wU($,q,_,K,P,Y,O){let z=ZN(q,_);if(z==null)return;let T=Object.keys(z),H=T.length;for(var f=0;f<H;f++){let w=T[f];fU($,z,w,_,K,P,Y,O)}return $}function KT($,q){return $!==void 0&&$!==null?"hasOwn"in Object?Object.hasOwn($,q):Object.prototype.hasOwnProperty.call($,q):!1}function fU($,q,_,K,P,Y,O,z){let T=P.length,H=T-1,f=_;var w=-1,k,S,N,h=null,C=null,I,D,L=!1,g=0,y=0,p=ZU();if(N=k=q[_],typeof k!=="object")return;while(k!=null&&++w<T){if(y+=1,_=P[w],h=N,_!=="*"&&!C&&!(typeof k==="object"&&(_ in k)))break;if(_==="*"){if(C==="*")L=!0;if(C=_,w!==H)continue}if(C){let s=Object.keys(k);for(var o=0;o<s.length;o++){let Q=s[o];if(D=k[Q],I=_==="*",L)p=R_(p,Q,y),g=w,N=XN(D,g-1,_,K,P,Y,O,z,f,k,S,N,I,Q,w,H,p,$,q[f],y+1);else if(I||typeof D==="object"&&D!==null&&_ in D){if(I)N=D;else N=D[_];if(S=w!==H?N:O?z?Y(N,[...K,f,...P]):Y(N):Y,I){let m=f1(R_(p,Q,y),N,q[f]);$.push(m),k[Q]=S}else if(D[_]===S);else if(S===void 0&&Y!==void 0||KT(D,_)&&S===N)p=R_(p,Q,y);else{p=R_(p,Q,y);let m=f1(R_(p,_,y+1),N,q[f]);$.push(m),D[_]=S}}}C=null}else{if(N=k[_],p=R_(p,_,y),S=w!==H?N:O?z?Y(N,[...K,f,...P]):Y(N):Y,KT(k,_)&&S===N||S===void 0&&Y!==void 0);else{let s=f1(p,N,q[f]);$.push(s),k[_]=S}k=k[_]}if(typeof k!=="object")break}}function ZN($,q){var _=-1,K=q.length,P=$;while(P!=null&&++_<K)P=P[q[_]];return P}function XN($,q,_,K,P,Y,O,z,T,H,f,w,k,S,N,h,C,I,D,L){if(q===0){if(k||typeof $==="object"&&$!==null&&_ in $){if(k)w=$;else w=$[_];if(f=N!==h?w:O?z?Y(w,[...K,T,...P]):Y(w):Y,k){let g=f1(C,w,D);I.push(g),H[S]=f}else if($[_]===f);else if(f===void 0&&Y!==void 0||KT($,_)&&f===w);else{let g=f1(R_(C,_,L+1),w,D);I.push(g),$[_]=f}}}for(let g in $)if(typeof $[g]==="object")C=R_(C,g,L),XN($[g],q-1,_,K,P,Y,O,z,T,H,f,w,k,S,N,h,C,I,D,L+1)}function ZU(){return{parent:null,key:null,children:[],depth:0}}function R_($,q,_){if($.depth===_)return R_($.parent,q,_);var K={parent:$,key:q,depth:_,children:[]};return $.children.push(K),K}function f1($,q,_){let K=$,P=[];do P.push(K.key),K=K.parent;while(K.parent!=null);return{path:P,value:q,target:_}}});var GN=N$((NY$,kN)=>{var{groupRestore:XU,nestedRestore:AU}=PT();kN.exports=kU;function kU(){return function(){if(this.restore){this.restore.state.secret=this.secret;return}let{secret:q,wcLen:_}=this,K=Object.keys(q),P=GU(q,K),Y=_>0,O=Y?{secret:q,groupRestore:XU,nestedRestore:AU}:{secret:q};this.restore=Function("o",VU(P,K,Y)).bind(O),this.restore.state=O}}function GU($,q){return q.map((_)=>{let{circle:K,escPath:P,leadingBracket:Y}=$[_],z=K?`o.${K} = secret[${P}].val`:`o${Y?"":"."}${_} = secret[${P}].val`,T=`secret[${P}].val = undefined`;return`
99
99
  if (secret[${P}].val !== undefined) {
100
100
  try { ${z} } catch (e) {}
101
101
  ${T}
@@ -124,12 +124,12 @@ Right ${typeof q}`);else if(typeof $==="string"&&typeof q==="string")return $+q;
124
124
  Left ${$}
125
125
  Right ${q}`)}var x_=class $ extends Y_{static isInstance(q){if(!super.isInstance(q))return!1;let _=Object.getPrototypeOf(q);while(_!==null){if(_===$.prototype)return!0;_=Object.getPrototypeOf(_)}return!1}};var dC={};f6(dC,{ToolMessage:()=>zw,ToolMessageChunk:()=>rC,defaultToolCallParser:()=>Ww,isDirectToolOutput:()=>lC,isToolMessage:()=>oC,isToolMessageChunk:()=>nC});function lC($){return $!=null&&typeof $==="object"&&"lc_direct_tool_output"in $&&$.lc_direct_tool_output===!0}var zw=class extends Y_{static lc_name(){return"ToolMessage"}get lc_aliases(){return{tool_call_id:"tool_call_id"}}lc_direct_tool_output=!0;type="tool";status;tool_call_id;metadata;artifact;constructor($,q,_){let K=typeof $==="string"||Array.isArray($)?{content:$,name:_,tool_call_id:q}:$;super(K);this.tool_call_id=K.tool_call_id,this.artifact=K.artifact,this.status=K.status,this.metadata=K.metadata}static isInstance($){return super.isInstance($)&&$.type==="tool"}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}},rC=class extends x_{type="tool";tool_call_id;status;artifact;constructor($){super($);this.tool_call_id=$.tool_call_id,this.artifact=$.artifact,this.status=$.status}static lc_name(){return"ToolMessageChunk"}concat($){return new this.constructor({content:u_(this.content,$.content),additional_kwargs:nq(this.additional_kwargs,$.additional_kwargs),response_metadata:nq(this.response_metadata,$.response_metadata),artifact:vw(this.artifact,$.artifact),tool_call_id:this.tool_call_id,id:this.id??$.id,status:jw(this.status,$.status)})}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}};function Ww($){let q=[],_=[];for(let K of $)if(!K.function)continue;else{let P=K.function.name;try{let Y=JSON.parse(K.function.arguments);q.push({name:P||"",args:Y||{},id:K.id})}catch{_.push({name:P,args:K.function.arguments,id:K.id,error:"Malformed args."})}}return[q,_]}function oC($){return typeof $==="object"&&$!==null&&"getType"in $&&typeof $.getType==="function"&&$.getType()==="tool"}function nC($){return $._getType()==="tool"}function iC($){try{return JSON.parse($)}catch{}let q=$.trim();if(q.length===0)throw Error("Unexpected end of JSON input");let _=0;function K(){while(_<q.length&&/\s/.test(q[_]))_+=1}function P(){if(q[_]!=='"')throw Error(`Expected '"' at position ${_}, got '${q[_]}'`);_+=1;let f="",w=!1;while(_<q.length){let k=q[_];if(w){if(k==="n")f+=`
126
126
  `;else if(k==="t")f+="\t";else if(k==="r")f+="\r";else if(k==="\\")f+="\\";else if(k==='"')f+='"';else if(k==="b")f+="\b";else if(k==="f")f+="\f";else if(k==="/")f+="/";else if(k==="u"){let S=q.substring(_+1,_+5);if(/^[0-9A-Fa-f]{0,4}$/.test(S)){if(S.length===4)f+=String.fromCharCode(Number.parseInt(S,16));else f+=`u${S}`;_+=S.length}else throw Error(`Invalid unicode escape sequence '\\u${S}' at position ${_}`)}else throw Error(`Invalid escape sequence '\\${k}' at position ${_}`);w=!1}else if(k==="\\")w=!0;else if(k==='"')return _+=1,f;else f+=k;_+=1}if(w)f+="\\";return f}function Y(){let f=_,w="";if(q[_]==="-")w+="-",_+=1;if(_<q.length&&q[_]==="0"){if(w+="0",_+=1,q[_]>="0"&&q[_]<="9")throw Error(`Invalid number at position ${f}`)}if(_<q.length&&q[_]>="1"&&q[_]<="9")while(_<q.length&&q[_]>="0"&&q[_]<="9")w+=q[_],_+=1;if(_<q.length&&q[_]==="."){w+=".",_+=1;while(_<q.length&&q[_]>="0"&&q[_]<="9")w+=q[_],_+=1}if(_<q.length&&(q[_]==="e"||q[_]==="E")){if(w+=q[_],_+=1,_<q.length&&(q[_]==="+"||q[_]==="-"))w+=q[_],_+=1;while(_<q.length&&q[_]>="0"&&q[_]<="9")w+=q[_],_+=1}if(w==="-")return-0;let k=Number.parseFloat(w);if(Number.isNaN(k))throw _=f,Error(`Invalid number '${w}' at position ${f}`);return k}function O(){if(K(),_>=q.length)throw Error(`Unexpected end of input at position ${_}`);let f=q[_];if(f==="{")return T();if(f==="[")return z();if(f==='"')return P();if("null".startsWith(q.substring(_,_+4)))return _+=Math.min(4,q.length-_),null;if("true".startsWith(q.substring(_,_+4)))return _+=Math.min(4,q.length-_),!0;if("false".startsWith(q.substring(_,_+5)))return _+=Math.min(5,q.length-_),!1;if(f==="-"||f>="0"&&f<="9")return Y();throw Error(`Unexpected character '${f}' at position ${_}`)}function z(){if(q[_]!=="[")throw Error(`Expected '[' at position ${_}, got '${q[_]}'`);let f=[];if(_+=1,K(),_>=q.length)return f;if(q[_]==="]")return _+=1,f;while(_<q.length){if(K(),_>=q.length)return f;if(f.push(O()),K(),_>=q.length)return f;if(q[_]==="]")return _+=1,f;else if(q[_]===","){_+=1;continue}throw Error(`Expected ',' or ']' at position ${_}, got '${q[_]}'`)}return f}function T(){if(q[_]!=="{")throw Error(`Expected '{' at position ${_}, got '${q[_]}'`);let f={};if(_+=1,K(),_>=q.length)return f;if(q[_]==="}")return _+=1,f;while(_<q.length){if(K(),_>=q.length)return f;let w=P();if(K(),_>=q.length)return f;if(q[_]!==":")throw Error(`Expected ':' at position ${_}, got '${q[_]}'`);if(_+=1,K(),_>=q.length)return f;if(f[w]=O(),K(),_>=q.length)return f;if(q[_]==="}")return _+=1,f;else if(q[_]===","){_+=1;continue}throw Error(`Expected ',' or '}' at position ${_}, got '${q[_]}'`)}return f}let H=O();if(K(),_<q.length)throw Error(`Unexpected character '${q[_]}' at position ${_}`);return H}function Jw($){try{if(typeof $>"u")return null;return iC($)}catch{return null}}function OY($){switch($){case"csv":return"text/csv";case"doc":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"html":return"text/html";case"md":return"text/markdown";case"pdf":return"application/pdf";case"txt":return"text/plain";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"gif":return"image/gif";case"jpeg":return"image/jpeg";case"jpg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp";case"flv":return"video/flv";case"mkv":return"video/mkv";case"mov":return"video/mov";case"mp4":return"video/mp4";case"mpeg":return"video/mpeg";case"mpg":return"video/mpg";case"three_gp":return"video/three_gp";case"webm":return"video/webm";case"wmv":return"video/wmv";default:return"application/octet-stream"}}function BC($){if(K6($.document)&&K6($.document.source)){let q=K6($.document)&&U$($.document.format)?$.document.format:"",_=OY(q);if(K6($.document.source)){if(K6($.document.source.s3Location)&&U$($.document.source.s3Location.uri))return{type:"file",mimeType:_,fileId:$.document.source.s3Location.uri};if(R1($.document.source.bytes))return{type:"file",mimeType:_,data:$.document.source.bytes};if(U$($.document.source.text))return{type:"file",mimeType:_,data:Buffer.from($.document.source.text).toString("base64")};if(oq($.document.source.content)){let K=$.document.source.content.reduce((P,Y)=>{if(K6(Y)&&U$(Y.text))return P+Y.text;return P},"");return{type:"file",mimeType:_,data:K}}}}return{type:"non_standard",value:$}}function tC($){if(e$($,"image")&&K6($.image)){let q=K6($.image)&&U$($.image.format)?$.image.format:"",_=OY(q);if(K6($.image.source)){if(K6($.image.source.s3Location)&&U$($.image.source.s3Location.uri))return{type:"image",mimeType:_,fileId:$.image.source.s3Location.uri};if(R1($.image.source.bytes))return{type:"image",mimeType:_,data:$.image.source.bytes}}}return{type:"non_standard",value:$}}function UC($){if(e$($,"video")&&K6($.video)){let q=K6($.video)&&U$($.video.format)?$.video.format:"",_=OY(q);if(K6($.video.source)){if(K6($.video.source.s3Location)&&U$($.video.source.s3Location.uri))return{type:"video",mimeType:_,fileId:$.video.source.s3Location.uri};if(R1($.video.source.bytes))return{type:"video",mimeType:_,data:$.video.source.bytes}}}return{type:"non_standard",value:$}}function Hw($){function*q(){let _=typeof $.content==="string"?[{type:"text",text:$.content}]:$.content;for(let K of _){if(e$(K,"cache_point")){yield{type:"non_standard",value:K};continue}else if(e$(K,"citations_content")&&K6(K.citationsContent)){let P=oq(K.citationsContent.content)?K.citationsContent.content.reduce((O,z)=>{if(K6(z)&&U$(z.text))return O+z.text;return O},""):"",Y=oq(K.citationsContent.citations)?K.citationsContent.citations.reduce((O,z)=>{if(K6(z)){let T=oq(z.sourceContent)?z.sourceContent.reduce((f,w)=>{if(K6(w)&&U$(w.text))return f+w.text;return f},""):"",H=P_(()=>{if(K6(z.location)){let f=z.location.documentChar||z.location.documentPage||z.location.documentChunk;if(K6(f))return{source:_8(f.documentIndex)?f.documentIndex.toString():void 0,startIndex:_8(f.start)?f.start:void 0,endIndex:_8(f.end)?f.end:void 0}}return{}});O.push({type:"citation",citedText:T,...H})}return O},[]):[];yield{type:"text",text:P,annotations:Y};continue}else if(e$(K,"document")&&K6(K.document)){yield BC(K);continue}else if(e$(K,"guard_content")){yield{type:"non_standard",value:K};continue}else if(e$(K,"image")&&K6(K.image)){yield tC(K);continue}else if(e$(K,"reasoning_content")&&U$(K.reasoningText)){yield{type:"reasoning",reasoning:K.reasoningText};continue}else if(e$(K,"text")&&U$(K.text)){yield{type:"text",text:K.text};continue}else if(e$(K,"tool_result")){yield{type:"non_standard",value:K};continue}else if(e$(K,"tool_call"))continue;else if(e$(K,"video")&&K6(K.video)){yield UC(K);continue}yield{type:"non_standard",value:K}}}return Array.from(q())}var Tw={translateContent:Hw,translateContentChunk:Hw};function ww($){function*q(){let _=typeof $.content==="string"?[{type:"text",text:$.content}]:$.content;for(let K of _){if(e$(K,"text")&&U$(K.text)){yield{type:"text",text:K.text};continue}else if(e$(K,"inlineData")&&K6(K.inlineData)&&U$(K.inlineData.mimeType)&&U$(K.inlineData.data)){yield{type:"file",mimeType:K.inlineData.mimeType,data:K.inlineData.data};continue}else if(e$(K,"functionCall")&&K6(K.functionCall)&&U$(K.functionCall.name)&&K6(K.functionCall.args)){yield{type:"tool_call",id:$.id,name:K.functionCall.name,args:K.functionCall.args};continue}else if(e$(K,"functionResponse")){yield{type:"non_standard",value:K};continue}else if(e$(K,"fileData")&&K6(K.fileData)&&U$(K.fileData.mimeType)&&U$(K.fileData.fileUri)){yield{type:"file",mimeType:K.fileData.mimeType,fileId:K.fileData.fileUri};continue}else if(e$(K,"executableCode")){yield{type:"non_standard",value:K};continue}else if(e$(K,"codeExecutionResult")){yield{type:"non_standard",value:K};continue}yield{type:"non_standard",value:K}}}return Array.from(q())}var fw={translateContent:ww,translateContentChunk:ww};function Zw($){function*q(){let _=typeof $.content==="string"?[{type:"text",text:$.content}]:$.content;for(let K of _){if(e$(K,"reasoning")&&U$(K.reasoning)){let P=P_(()=>{let Y=_.indexOf(K);if(oq($.additional_kwargs?.signatures)&&Y>=0)return $.additional_kwargs.signatures.at(Y);return});if(U$(P))yield{type:"reasoning",reasoning:K.reasoning,signature:P};else yield{type:"reasoning",reasoning:K.reasoning};continue}else if(e$(K,"text")&&U$(K.text)){yield{type:"text",text:K.text};continue}else if(e$(K,"image_url")){if(U$(K.image_url))if(K.image_url.startsWith("data:")){let P=/^data:([^;]+);base64,(.+)$/,Y=K.image_url.match(P);if(Y)yield{type:"image",data:Y[2],mimeType:Y[1]};else yield{type:"image",url:K.image_url}}else yield{type:"image",url:K.image_url};continue}else if(e$(K,"media")&&U$(K.mimeType)&&U$(K.data)){yield{type:"file",mimeType:K.mimeType,data:K.data};continue}yield{type:"non_standard",value:K}}}return Array.from(q())}var Xw={translateContent:Zw,translateContentChunk:Zw};globalThis.lc_block_translators_registry??=new Map([["anthropic",sT],["bedrock-converse",Tw],["google-genai",fw],["google-vertexai",Xw],["openai",Pw]]);function Aw($){return globalThis.lc_block_translators_registry.get($)}function kw($,q){return nq($??{},q??{})}function Gw($,q){let _={};if($?.audio!==void 0||q?.audio!==void 0)_.audio=($?.audio??0)+(q?.audio??0);if($?.image!==void 0||q?.image!==void 0)_.image=($?.image??0)+(q?.image??0);if($?.video!==void 0||q?.video!==void 0)_.video=($?.video??0)+(q?.video??0);if($?.document!==void 0||q?.document!==void 0)_.document=($?.document??0)+(q?.document??0);if($?.text!==void 0||q?.text!==void 0)_.text=($?.text??0)+(q?.text??0);return _}function FC($,q){let _={...Gw($,q)};if($?.cache_read!==void 0||q?.cache_read!==void 0)_.cache_read=($?.cache_read??0)+(q?.cache_read??0);if($?.cache_creation!==void 0||q?.cache_creation!==void 0)_.cache_creation=($?.cache_creation??0)+(q?.cache_creation??0);return _}function QC($,q){let _={...Gw($,q)};if($?.reasoning!==void 0||q?.reasoning!==void 0)_.reasoning=($?.reasoning??0)+(q?.reasoning??0);return _}function Vw($,q){return{input_tokens:($?.input_tokens??0)+(q?.input_tokens??0),output_tokens:($?.output_tokens??0)+(q?.output_tokens??0),total_tokens:($?.total_tokens??0)+(q?.total_tokens??0),input_token_details:FC($?.input_token_details,q?.input_token_details),output_token_details:QC($?.output_token_details,q?.output_token_details)}}var WP=class extends x_{type="ai";tool_calls=[];invalid_tool_calls=[];tool_call_chunks=[];usage_metadata;constructor($){let q;if(typeof $==="string"||Array.isArray($))q={content:$,tool_calls:[],invalid_tool_calls:[],tool_call_chunks:[]};else if($.tool_call_chunks===void 0||$.tool_call_chunks.length===0)q={...$,tool_calls:$.tool_calls??[],invalid_tool_calls:[],tool_call_chunks:[],usage_metadata:$.usage_metadata!==void 0?$.usage_metadata:void 0};else q={...$,...Sw($.tool_call_chunks??[]),usage_metadata:$.usage_metadata!==void 0?$.usage_metadata:void 0};super(q);this.tool_call_chunks=q.tool_call_chunks??this.tool_call_chunks,this.tool_calls=q.tool_calls??this.tool_calls,this.invalid_tool_calls=q.invalid_tool_calls??this.invalid_tool_calls,this.usage_metadata=q.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",tool_call_chunks:"tool_call_chunks"}}static lc_name(){return"AIMessageChunk"}get contentBlocks(){if(this.response_metadata&&"output_version"in this.response_metadata&&this.response_metadata.output_version==="v1")return this.content;if(this.response_metadata&&"model_provider"in this.response_metadata&&typeof this.response_metadata.model_provider==="string"){let q=Aw(this.response_metadata.model_provider);if(q)return q.translateContent(this)}let $=super.contentBlocks;if(this.tool_calls){if(typeof this.content!=="string"){let q=this.content.filter((_)=>_.type==="tool_call").map((_)=>_.id);for(let _ of this.tool_calls)if(_.id&&!q.includes(_.id))$.push({..._,type:"tool_call",id:_.id,name:_.name,args:_.args})}}return $}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,tool_call_chunks:this.tool_call_chunks,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}concat($){let q={content:u_(this.content,$.content),additional_kwargs:nq(this.additional_kwargs,$.additional_kwargs),response_metadata:kw(this.response_metadata,$.response_metadata),tool_call_chunks:[],id:this.id??$.id};if(this.tool_call_chunks!==void 0||$.tool_call_chunks!==void 0){let K=zP(this.tool_call_chunks,$.tool_call_chunks);if(K!==void 0&&K.length>0)q.tool_call_chunks=K}if(this.usage_metadata!==void 0||$.usage_metadata!==void 0)q.usage_metadata=Vw(this.usage_metadata,$.usage_metadata);return new this.constructor(q)}static isInstance($){return super.isInstance($)&&$.type==="ai"}};function Mw($,q="Human",_="AI"){let K=[];for(let P of $){let Y;if(P._getType()==="human")Y=q;else if(P._getType()==="ai")Y=_;else if(P._getType()==="system")Y="System";else if(P._getType()==="tool")Y="Tool";else if(P._getType()==="generic")Y=P.role;else throw Error(`Got unsupported message type: ${P._getType()}`);let O=P.name?`${P.name}, `:"",z=typeof P.content==="string"?P.content:JSON.stringify(P.content,null,2);K.push(`${Y}: ${O}${z}`)}return K.join(`
127
- `)}function Sw($){let q=$.reduce((P,Y)=>{let O=P.findIndex(([z])=>{if("id"in Y&&Y.id&&"index"in Y&&Y.index!==void 0)return Y.id===z.id&&Y.index===z.index;if("id"in Y&&Y.id)return Y.id===z.id;if("index"in Y&&Y.index!==void 0)return Y.index===z.index;return!1});if(O!==-1)P[O].push(Y);else P.push([Y]);return P},[]),_=[],K=[];for(let P of q){let Y=null,O=P[0]?.name??"",z=P.map((f)=>f.args||"").join("").trim(),T=z.length?z:"{}",H=P[0]?.id;try{if(Y=Jw(T),!H||Y===null||typeof Y!=="object"||Array.isArray(Y))throw Error("Malformed tool call chunk args.");_.push({name:O,args:Y,id:H,type:"tool_call"})}catch{K.push({name:O,args:T,id:H,error:"Malformed args.",type:"invalid_tool_call"})}}return{tool_call_chunks:$,tool_calls:_,invalid_tool_calls:K}}var aC={};f6(aC,{getEnv:()=>Rw,getEnvironmentVariable:()=>C8,getRuntimeEnvironment:()=>vY,isBrowser:()=>Nw,isDeno:()=>D1,isJsDom:()=>Ew,isNode:()=>hw,isWebWorker:()=>Cw});var Nw=()=>typeof window<"u"&&typeof window.document<"u",Cw=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",Ew=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),D1=()=>typeof Deno<"u",hw=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!D1(),Rw=()=>{let $;if(Nw())$="browser";else if(hw())$="node";else if(Cw())$="webworker";else if(Ew())$="jsdom";else if(D1())$="deno";else $="other";return $},jY;function vY(){if(jY===void 0)jY={library:"langchain-js",runtime:Rw()};return jY}function C8($){try{if(typeof process<"u")return process.env?.[$];else if(D1())return Deno?.env.get($);else return}catch{return}}var Iw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function eC($){return typeof $==="string"&&Iw.test($)}var oK=eC;var Xq=[];for(JP=0;JP<256;++JP)Xq.push((JP+256).toString(16).slice(1));var JP;function Dw($,q=0){return(Xq[$[q+0]]+Xq[$[q+1]]+Xq[$[q+2]]+Xq[$[q+3]]+"-"+Xq[$[q+4]]+Xq[$[q+5]]+"-"+Xq[$[q+6]]+Xq[$[q+7]]+"-"+Xq[$[q+8]]+Xq[$[q+9]]+"-"+Xq[$[q+10]]+Xq[$[q+11]]+Xq[$[q+12]]+Xq[$[q+13]]+Xq[$[q+14]]+Xq[$[q+15]]).toLowerCase()}var L1,sC=new Uint8Array(16);function zY(){if(!L1){if(L1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return L1(sC)}var $E=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),WY={randomUUID:$E};function qE($,q,_){if(WY.randomUUID&&!q&&!$)return WY.randomUUID();$=$||{};var K=$.random||($.rng||zY)();if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){_=_||0;for(var P=0;P<16;++P)q[_+P]=K[P];return q}return Dw(K)}var iq=qE;var KE={};f6(KE,{BaseCallbackHandler:()=>jK,callbackHandlerPrefersStreaming:()=>YE,isBaseCallbackHandler:()=>JY});var PE=class{};function YE($){return"lc_prefer_streaming"in $&&$.lc_prefer_streaming}var jK=class extends PE{lc_serializable=!1;get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){return}get lc_attributes(){return}get lc_aliases(){return}get lc_serializable_keys(){return}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,h1(this.constructor)]}lc_kwargs;ignoreLLM=!1;ignoreChain=!1;ignoreAgent=!1;ignoreRetriever=!1;ignoreCustomEvent=!1;raiseError=!1;awaitHandlers=C8("LANGCHAIN_CALLBACKS_BACKGROUND")==="false";constructor($){super();if(this.lc_kwargs=$||{},$)this.ignoreLLM=$.ignoreLLM??this.ignoreLLM,this.ignoreChain=$.ignoreChain??this.ignoreChain,this.ignoreAgent=$.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=$.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=$.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=$.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||($._awaitHandler??this.awaitHandlers)}copy(){return new this.constructor(this)}toJSON(){return b_.prototype.toJSON.call(this)}toJSONNotImplemented(){return b_.prototype.toJSONNotImplemented.call(this)}static fromMethods($){class q extends jK{name=iq();constructor(){super();Object.assign(this,$)}}return new q}},JY=($)=>{let q=$;return q!==void 0&&typeof q.copy==="function"&&typeof q.name==="string"&&typeof q.awaitHandlers==="boolean"};var Lw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function OE($){return typeof $==="string"&&Lw.test($)}var bw=OE;function jE($){if(!bw($))throw TypeError("Invalid UUID");var q,_=new Uint8Array(16);return _[0]=(q=parseInt($.slice(0,8),16))>>>24,_[1]=q>>>16&255,_[2]=q>>>8&255,_[3]=q&255,_[4]=(q=parseInt($.slice(9,13),16))>>>8,_[5]=q&255,_[6]=(q=parseInt($.slice(14,18),16))>>>8,_[7]=q&255,_[8]=(q=parseInt($.slice(19,23),16))>>>8,_[9]=q&255,_[10]=(q=parseInt($.slice(24,36),16))/1099511627776&255,_[11]=q/4294967296&255,_[12]=q>>>24&255,_[13]=q>>>16&255,_[14]=q>>>8&255,_[15]=q&255,_}var gw=jE;var Aq=[];for(HP=0;HP<256;++HP)Aq.push((HP+256).toString(16).slice(1));var HP;function nK($,q=0){return(Aq[$[q+0]]+Aq[$[q+1]]+Aq[$[q+2]]+Aq[$[q+3]]+"-"+Aq[$[q+4]]+Aq[$[q+5]]+"-"+Aq[$[q+6]]+Aq[$[q+7]]+"-"+Aq[$[q+8]]+Aq[$[q+9]]+"-"+Aq[$[q+10]]+Aq[$[q+11]]+Aq[$[q+12]]+Aq[$[q+13]]+Aq[$[q+14]]+Aq[$[q+15]]).toLowerCase()}var b1,vE=new Uint8Array(16);function TP(){if(!b1){if(b1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!b1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return b1(vE)}function zE($){$=unescape(encodeURIComponent($));var q=[];for(var _=0;_<$.length;++_)q.push($.charCodeAt(_));return q}var WE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",JE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function HY($,q,_){function K(P,Y,O,z){var T;if(typeof P==="string")P=zE(P);if(typeof Y==="string")Y=gw(Y);if(((T=Y)===null||T===void 0?void 0:T.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var H=new Uint8Array(16+P.length);if(H.set(Y),H.set(P,Y.length),H=_(H),H[6]=H[6]&15|q,H[8]=H[8]&63|128,O){z=z||0;for(var f=0;f<16;++f)O[z+f]=H[f];return O}return nK(H)}try{K.name=$}catch(P){}return K.DNS=WE,K.URL=JE,K}var HE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),TY={randomUUID:HE};function TE($,q,_){if(TY.randomUUID&&!q&&!$)return TY.randomUUID();$=$||{};var K=$.random||($.rng||TP)();if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){_=_||0;for(var P=0;P<16;++P)q[_+P]=K[P];return q}return nK(K)}var vK=TE;function wE($,q,_,K){switch($){case 0:return q&_^~q&K;case 1:return q^_^K;case 2:return q&_^q&K^_&K;case 3:return q^_^K}}function wY($,q){return $<<q|$>>>32-q}function fE($){var q=[1518500249,1859775393,2400959708,3395469782],_=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof $==="string"){var K=unescape(encodeURIComponent($));$=[];for(var P=0;P<K.length;++P)$.push(K.charCodeAt(P))}else if(!Array.isArray($))$=Array.prototype.slice.call($);$.push(128);var Y=$.length/4+2,O=Math.ceil(Y/16),z=Array(O);for(var T=0;T<O;++T){var H=new Uint32Array(16);for(var f=0;f<16;++f)H[f]=$[T*64+f*4]<<24|$[T*64+f*4+1]<<16|$[T*64+f*4+2]<<8|$[T*64+f*4+3];z[T]=H}z[O-1][14]=($.length-1)*8/Math.pow(2,32),z[O-1][14]=Math.floor(z[O-1][14]),z[O-1][15]=($.length-1)*8&4294967295;for(var w=0;w<O;++w){var k=new Uint32Array(80);for(var S=0;S<16;++S)k[S]=z[w][S];for(var N=16;N<80;++N)k[N]=wY(k[N-3]^k[N-8]^k[N-14]^k[N-16],1);var h=_[0],C=_[1],I=_[2],D=_[3],L=_[4];for(var g=0;g<80;++g){var y=Math.floor(g/20),c=wY(h,5)+wE(y,C,I,D)+L+q[y]+k[g]>>>0;L=D,D=I,I=wY(C,30)>>>0,C=h,h=c}_[0]=_[0]+h>>>0,_[1]=_[1]+C>>>0,_[2]=_[2]+I>>>0,_[3]=_[3]+D>>>0,_[4]=_[4]+L>>>0}return[_[0]>>24&255,_[0]>>16&255,_[0]>>8&255,_[0]&255,_[1]>>24&255,_[1]>>16&255,_[1]>>8&255,_[1]&255,_[2]>>24&255,_[2]>>16&255,_[2]>>8&255,_[2]&255,_[3]>>24&255,_[3]>>16&255,_[3]>>8&255,_[3]&255,_[4]>>24&255,_[4]>>16&255,_[4]>>8&255,_[4]&255]}var yw=fE;var ZE=HY("v5",80,yw),zK=ZE;var uw=null,xw=null,E8=0;function XE($,q,_){$=$||{};var K=q&&_||0,P=q||new Uint8Array(16),Y=$.random||($.rng||TP)(),O=$.msecs!==void 0?$.msecs:Date.now(),z=$.seq!==void 0?$.seq:null,T=xw,H=uw;if(O>E8&&$.msecs===void 0){if(E8=O,z!==null)T=null,H=null}if(z!==null){if(z>2147483647)z=2147483647;T=z>>>19&4095,H=z&524287}if(T===null||H===null)T=Y[6]&127,T=T<<8|Y[7],H=Y[8]&63,H=H<<8|Y[9],H=H<<5|Y[10]>>>3;if(O+1e4>E8&&z===null){if(++H>524287){if(H=0,++T>4095)T=0,E8++}}else E8=O;return xw=T,uw=H,P[K++]=E8/1099511627776&255,P[K++]=E8/4294967296&255,P[K++]=E8/16777216&255,P[K++]=E8/65536&255,P[K++]=E8/256&255,P[K++]=E8&255,P[K++]=T>>>4&15|112,P[K++]=T&255,P[K++]=H>>>13&63|128,P[K++]=H>>>5&255,P[K++]=H<<3&255|Y[10]&7,P[K++]=Y[11],P[K++]=Y[12],P[K++]=Y[13],P[K++]=Y[14],P[K++]=Y[15],q||nK(P)}var fY=XE;var pw="gen_ai.operation.name",cw="gen_ai.system",ZY="gen_ai.request.model",mw="gen_ai.response.model",XY="gen_ai.usage.input_tokens",AY="gen_ai.usage.output_tokens",kY="gen_ai.usage.total_tokens",dw="gen_ai.request.max_tokens",lw="gen_ai.request.temperature",rw="gen_ai.request.top_p",ow="gen_ai.request.frequency_penalty",nw="gen_ai.request.presence_penalty",iw="gen_ai.response.finish_reasons",Bw="gen_ai.prompt",tw="gen_ai.completion",Uw="gen_ai.request.extra_query",Fw="gen_ai.request.extra_body",Qw="gen_ai.serialized.name",aw="gen_ai.serialized.signature",ew="gen_ai.serialized.doc",sw="gen_ai.response.id",$f="gen_ai.response.service_tier",qf="gen_ai.response.system_fingerprint",_f="gen_ai.usage.input_token_details",Kf="gen_ai.usage.output_token_details",Pf="langsmith.trace.session_id",Yf="langsmith.trace.session_name",Of="langsmith.span.kind",jf="langsmith.trace.name",vf="langsmith.metadata",GY="langsmith.span.tags";var zf="langsmith.request.streaming",Wf="langsmith.request.headers";var GE=(...$)=>fetch(...$),Jf=Symbol.for("ls:fetch_implementation");var Hf=()=>{let $=globalThis[Jf];if(!$)return!1;return typeof $==="function"&&"Headers"in $&&"Request"in $&&"Response"in $},Tf=($)=>{return async(...q)=>{if($||n6("DEBUG")==="true"){let[K,P]=q;console.log(`→ ${P?.method||"GET"} ${K}`)}let _=await(globalThis[Jf]??GE)(...q);if($||n6("DEBUG")==="true")console.log(`← ${_.status} ${_.statusText} ${_.url}`);return _}};var wP=()=>{return n6("PROJECT")??K8("LANGCHAIN_SESSION")??"default"};var wf={};function iK($){if(!wf[$])console.warn($),wf[$]=!0}var VE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Y6($,q){if(!VE.test($)){let _=q!==void 0?`Invalid UUID for ${q}: ${$}`:`Invalid UUID: ${$}`;throw Error(_)}return $}function g1($){let q=typeof $==="string"?Date.parse($):$;return fY({msecs:q,seq:0})}var y1="0.3.82";var d8,SE=()=>typeof window<"u"&&typeof window.document<"u",ME=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",NE=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),ff=()=>typeof Deno<"u",CE=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!ff(),MY=()=>{if(d8)return d8;if(typeof Bun<"u")d8="bun";else if(SE())d8="browser";else if(CE())d8="node";else if(ME())d8="webworker";else if(NE())d8="jsdom";else if(ff())d8="deno";else d8="other";return d8},VY;function u1(){if(VY===void 0){let $=MY(),q=hE();VY={library:"langsmith",runtime:$,sdk:"langsmith-js",sdk_version:y1,...q}}return VY}function NY(){let $=EE(),q={},_=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[K,P]of Object.entries($))if(typeof P==="string"&&!_.includes(K)&&!K.toLowerCase().includes("key")&&!K.toLowerCase().includes("secret")&&!K.toLowerCase().includes("token"))if(K==="LANGCHAIN_REVISION_ID")q.revision_id=P;else q[K]=P;return q}function EE(){let $={};try{if(typeof process<"u"&&process.env){for(let[q,_]of Object.entries(process.env))if((q.startsWith("LANGCHAIN_")||q.startsWith("LANGSMITH_"))&&_!=null)if((q.toLowerCase().includes("key")||q.toLowerCase().includes("secret")||q.toLowerCase().includes("token"))&&typeof _==="string")$[q]=_.slice(0,2)+"*".repeat(_.length-4)+_.slice(-2);else $[q]=_}}catch(q){}return $}function K8($){try{return typeof process<"u"?process.env?.[$]:void 0}catch(q){return}}function n6($){return K8(`LANGSMITH_${$}`)||K8(`LANGCHAIN_${$}`)}var SY;function hE(){if(SY!==void 0)return SY;let $=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],q={};for(let _ of $){let K=K8(_);if(K!==void 0)q[_]=K}return SY=q,q}function x1(){return K8("OTEL_ENABLED")==="true"||n6("OTEL_ENABLED")==="true"}class Xf{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan($,...q){if(!this.hasWarned&&x1())console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0;let _;if(q.length===1&&typeof q[0]==="function")_=q[0];else if(q.length===2&&typeof q[1]==="function")_=q[1];else if(q.length===3&&typeof q[2]==="function")_=q[2];if(typeof _==="function")return _();return}}class Af{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new Xf})}getTracer($,q){return this.mockTracer}getActiveSpan(){return}setSpan($,q){return $}getSpan($){return}setSpanContext($,q){return $}getTracerProvider(){return}setGlobalTracerProvider($){return!1}}class kf{active(){return{}}with($,q){return q()}}var CY=Symbol.for("ls:otel_trace"),EY=Symbol.for("ls:otel_context"),Zf=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),RE=new Af,IE=new kf;class Gf{getTraceInstance(){return globalThis[CY]??RE}getContextInstance(){return globalThis[EY]??IE}initializeGlobalInstances($){if(globalThis[CY]===void 0)globalThis[CY]=$.trace;if(globalThis[EY]===void 0)globalThis[EY]=$.context}setDefaultOTLPTracerComponents($){globalThis[Zf]=$}getDefaultOTLPTracerComponents(){return globalThis[Zf]??void 0}}var hY=new Gf;function p1(){return hY.getTraceInstance()}function Vf(){return hY.getContextInstance()}function Sf(){return hY.getDefaultOTLPTracerComponents()}var DE={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};function LE($){return DE[$]||$}class RY{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch($,q){for(let _ of $)try{if(!_.run)continue;if(_.operation==="post"){let K=this.createSpanForRun(_,_.run,q.get(_.id));if(K&&!_.run.end_time)this.spans.set(_.id,K)}else this.updateSpanForRun(_,_.run)}catch(K){console.error(`Error processing operation ${_.id}:`,K)}}createSpanForRun($,q,_){let K=_&&p1().getSpan(_);if(!K)return;try{return this.finishSpanSetup(K,q,$)}catch(P){console.error(`Failed to create span for run ${$.id}:`,P);return}}finishSpanSetup($,q,_){if(this.setSpanAttributes($,q,_),q.error)$.setStatus({code:2}),$.recordException(Error(q.error));else $.setStatus({code:1});if(q.end_time)$.end(new Date(q.end_time));return $}updateSpanForRun($,q){try{let _=this.spans.get($.id);if(!_){console.debug(`No span found for run ${$.id} during update`);return}if(this.setSpanAttributes(_,q,$),q.error)_.setStatus({code:2}),_.recordException(Error(q.error));else _.setStatus({code:1});let K=q.end_time;if(K)_.end(new Date(K)),this.spans.delete($.id)}catch(_){console.error(`Failed to update span for run ${$.id}:`,_)}}extractModelName($){if($.extra?.metadata){let q=$.extra.metadata;if(q.ls_model_name)return q.ls_model_name;if(q.invocation_params){let _=q.invocation_params;if(_.model)return _.model;else if(_.model_name)return _.model_name}}return}setSpanAttributes($,q,_){if("run_type"in q&&q.run_type){$.setAttribute(Of,q.run_type);let O=LE(q.run_type||"chain");$.setAttribute(pw,O)}if("name"in q&&q.name)$.setAttribute(jf,q.name);if("session_id"in q&&q.session_id)$.setAttribute(Pf,q.session_id);if("session_name"in q&&q.session_name)$.setAttribute(Yf,q.session_name);this.setGenAiSystem($,q);let K=this.extractModelName(q);if(K)$.setAttribute(ZY,K);if("prompt_tokens"in q&&typeof q.prompt_tokens==="number")$.setAttribute(XY,q.prompt_tokens);if("completion_tokens"in q&&typeof q.completion_tokens==="number")$.setAttribute(AY,q.completion_tokens);if("total_tokens"in q&&typeof q.total_tokens==="number")$.setAttribute(kY,q.total_tokens);this.setInvocationParameters($,q);let P=q.extra?.metadata||{};for(let[O,z]of Object.entries(P))if(z!==null&&z!==void 0)$.setAttribute(`${vf}.${O}`,String(z));let Y=q.tags;if(Y&&Array.isArray(Y))$.setAttribute(GY,Y.join(", "));else if(Y)$.setAttribute(GY,String(Y));if("serialized"in q&&typeof q.serialized==="object"){let O=q.serialized;if(O.name)$.setAttribute(Qw,String(O.name));if(O.signature)$.setAttribute(aw,String(O.signature));if(O.doc)$.setAttribute(ew,String(O.doc))}this.setIOAttributes($,_)}setGenAiSystem($,q){let _="langchain",K=this.extractModelName(q);if(K){let P=K.toLowerCase();if(P.includes("anthropic")||P.startsWith("claude"))_="anthropic";else if(P.includes("bedrock"))_="aws.bedrock";else if(P.includes("azure")&&P.includes("openai"))_="az.ai.openai";else if(P.includes("azure")&&P.includes("inference"))_="az.ai.inference";else if(P.includes("cohere"))_="cohere";else if(P.includes("deepseek"))_="deepseek";else if(P.includes("gemini"))_="gemini";else if(P.includes("groq"))_="groq";else if(P.includes("watson")||P.includes("ibm"))_="ibm.watsonx.ai";else if(P.includes("mistral"))_="mistral_ai";else if(P.includes("gpt")||P.includes("openai"))_="openai";else if(P.includes("perplexity")||P.includes("sonar"))_="perplexity";else if(P.includes("vertex"))_="vertex_ai";else if(P.includes("xai")||P.includes("grok"))_="xai"}$.setAttribute(cw,_)}setInvocationParameters($,q){if(!q.extra?.metadata?.invocation_params)return;let _=q.extra.metadata.invocation_params;if(_.max_tokens!==void 0)$.setAttribute(dw,_.max_tokens);if(_.temperature!==void 0)$.setAttribute(lw,_.temperature);if(_.top_p!==void 0)$.setAttribute(rw,_.top_p);if(_.frequency_penalty!==void 0)$.setAttribute(ow,_.frequency_penalty);if(_.presence_penalty!==void 0)$.setAttribute(nw,_.presence_penalty)}setIOAttributes($,q){if(q.run.inputs)try{let _=q.run.inputs;if(typeof _==="object"&&_!==null){if(_.model&&Array.isArray(_.messages))$.setAttribute(ZY,_.model);if(_.stream!==void 0)$.setAttribute(zf,_.stream);if(_.extra_headers)$.setAttribute(Wf,JSON.stringify(_.extra_headers));if(_.extra_query)$.setAttribute(Uw,JSON.stringify(_.extra_query));if(_.extra_body)$.setAttribute(Fw,JSON.stringify(_.extra_body))}$.setAttribute(Bw,JSON.stringify(_))}catch(_){console.debug(`Failed to process inputs for run ${q.id}`,_)}if(q.run.outputs)try{let _=q.run.outputs,K=this.getUnifiedRunTokens(_);if(K)$.setAttribute(XY,K[0]),$.setAttribute(AY,K[1]),$.setAttribute(kY,K[0]+K[1]);if(_&&typeof _==="object"){if(_.model)$.setAttribute(mw,String(_.model));if(_.id)$.setAttribute(sw,_.id);if(_.choices&&Array.isArray(_.choices)){let P=_.choices.map((Y)=>Y.finish_reason).filter((Y)=>Y).map(String);if(P.length>0)$.setAttribute(iw,P.join(", "))}if(_.service_tier)$.setAttribute($f,_.service_tier);if(_.system_fingerprint)$.setAttribute(qf,_.system_fingerprint);if(_.usage_metadata&&typeof _.usage_metadata==="object"){let P=_.usage_metadata;if(P.input_token_details)$.setAttribute(_f,JSON.stringify(P.input_token_details));if(P.output_token_details)$.setAttribute(Kf,JSON.stringify(P.output_token_details))}}$.setAttribute(tw,JSON.stringify(_))}catch(_){console.debug(`Failed to process outputs for run ${q.id}`,_)}}getUnifiedRunTokens($){if(!$)return null;let q=this.extractUnifiedRunTokens($.usage_metadata);if(q)return q;let _=Object.keys($);for(let Y of _){let O=$[Y];if(!O||typeof O!=="object")continue;if(q=this.extractUnifiedRunTokens(O.usage_metadata),q)return q;if(O.lc===1&&O.kwargs&&typeof O.kwargs==="object"){if(q=this.extractUnifiedRunTokens(O.kwargs.usage_metadata),q)return q}}let K=$.generations||[];if(!Array.isArray(K))return null;let P=Array.isArray(K[0])?K.flat():K;for(let Y of P)if(typeof Y==="object"&&Y.message&&typeof Y.message==="object"&&Y.message.kwargs&&typeof Y.message.kwargs==="object"){if(q=this.extractUnifiedRunTokens(Y.message.kwargs.usage_metadata),q)return q}return null}extractUnifiedRunTokens($){if(!$||typeof $!=="object")return null;if(typeof $.input_tokens!=="number"||typeof $.output_tokens!=="number")return null;return[$.input_tokens,$.output_tokens]}}var bE=Object.prototype.toString,gE=($)=>bE.call($)==="[object Error]",yE=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function IY($){if(!($&&gE($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:_,stack:K}=$;if(_==="Load failed")return K===void 0||"__sentry_captured__"in $;if(_.startsWith("error sending request for url"))return!0;return yE.has(_)}function uE($){if(typeof $==="number"){if($<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN($))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if($!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function c1($,q,{min:_=0,allowInfinity:K=!1}={}){if(q===void 0)return;if(typeof q!=="number"||Number.isNaN(q))throw TypeError(`Expected \`${$}\` to be a number${K?" or Infinity":""}.`);if(!K&&!Number.isFinite(q))throw TypeError(`Expected \`${$}\` to be a finite number.`);if(q<_)throw TypeError(`Expected \`${$}\` to be ≥ ${_}.`)}class Nf extends Error{constructor($){super();if($ instanceof Error)this.originalError=$,{message:$}=$;else this.originalError=Error($),this.originalError.stack=this.stack;this.name="AbortError",this.message=$}}function xE($,q){let _=Math.max(1,$+1),K=q.randomize?Math.random()+1:1,P=Math.round(K*q.minTimeout*q.factor**(_-1));return P=Math.min(P,q.maxTimeout),P}function Mf($,q){if(!Number.isFinite(q))return q;return q-(performance.now()-$)}async function pE({error:$,attemptNumber:q,retriesConsumed:_,startTime:K,options:P}){let Y=$ instanceof Error?$:TypeError(`Non-error was thrown: "${$}". You should only throw errors.`);if(Y instanceof Nf)throw Y.originalError;let O=Number.isFinite(P.retries)?Math.max(0,P.retries-_):P.retries,z=P.maxRetryTime??Number.POSITIVE_INFINITY,T=Object.freeze({error:Y,attemptNumber:q,retriesLeft:O,retriesConsumed:_});if(await P.onFailedAttempt(T),Mf(K,z)<=0)throw Y;let H=await P.shouldConsumeRetry(T),f=Mf(K,z);if(f<=0||O<=0)throw Y;if(Y instanceof TypeError&&!IY(Y)){if(H)throw Y;return P.signal?.throwIfAborted(),!1}if(!await P.shouldRetry(T))throw Y;if(!H)return P.signal?.throwIfAborted(),!1;let w=xE(_,P),k=Math.min(w,f);if(k>0)await new Promise((S,N)=>{let h=()=>{clearTimeout(C),P.signal?.removeEventListener("abort",h),N(P.signal.reason)},C=setTimeout(()=>{P.signal?.removeEventListener("abort",h),S()},k);if(P.unref)C.unref?.();P.signal?.addEventListener("abort",h,{once:!0})});return P.signal?.throwIfAborted(),!0}async function DY($,q={}){if(q={...q},uE(q.retries),Object.hasOwn(q,"forever"))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");if(q.retries??=10,q.factor??=2,q.minTimeout??=1000,q.maxTimeout??=Number.POSITIVE_INFINITY,q.maxRetryTime??=Number.POSITIVE_INFINITY,q.randomize??=!1,q.onFailedAttempt??=()=>{},q.shouldRetry??=()=>!0,q.shouldConsumeRetry??=()=>!0,c1("factor",q.factor,{min:0,allowInfinity:!1}),c1("minTimeout",q.minTimeout,{min:0,allowInfinity:!1}),c1("maxTimeout",q.maxTimeout,{min:0,allowInfinity:!0}),c1("maxRetryTime",q.maxRetryTime,{min:0,allowInfinity:!0}),!(q.factor>0))q.factor=1;q.signal?.throwIfAborted();let _=0,K=0,P=performance.now();while(Number.isFinite(q.retries)?K<=q.retries:!0){_++;try{q.signal?.throwIfAborted();let Y=await $(_);return q.signal?.throwIfAborted(),Y}catch(Y){if(await pE({error:Y,attemptNumber:_,retriesConsumed:K,startTime:P,options:q}))K++}}throw Error("Retry attempts exhausted without throwing an error.")}var o1=N8(r1(),1),FE=[408,425,429,500,502,503,504];class n1{constructor($){if(Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxQueueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.maxConcurrency=$.maxConcurrency??1/0,this.maxRetries=$.maxRetries??6,this.maxQueueSizeBytes=$.maxQueueSizeBytes,"default"in o1.default)this.queue=new o1.default.default({concurrency:this.maxConcurrency});else this.queue=new o1.default({concurrency:this.maxConcurrency});this.onFailedResponseHook=$?.onFailedResponseHook}call($,...q){return this.callWithOptions({},$,...q)}callWithOptions($,q,..._){let K=$.sizeBytes??0;if(this.maxQueueSizeBytes!==void 0&&K>0&&this.queueSizeBytes+K>this.maxQueueSizeBytes)return Promise.reject(Error(`Queue size limit (${this.maxQueueSizeBytes} bytes) exceeded. Current queue size: ${this.queueSizeBytes} bytes, attempted addition: ${K} bytes.`));if(K>0)this.queueSizeBytes+=K;let P=this.onFailedResponseHook,Y=this.queue.add(()=>DY(()=>q(..._).catch((O)=>{if(O instanceof Error)throw O;else throw Error(O)}),{async onFailedAttempt({error:O}){if(O.message.startsWith("Cancel")||O.message.startsWith("TimeoutError")||O.name==="TimeoutError"||O.message.startsWith("AbortError"))throw O;if(O?.code==="ECONNABORTED")throw O;let z=O?.response;if(P){if(await P(z))return}let T=z?.status??O?.status;if(T){if(!FE.includes(+T))throw O}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0});if(K>0)Y=Y.finally(()=>{this.queueSizeBytes-=K});if($.signal)return Promise.race([Y,new Promise((O,z)=>{$.signal?.addEventListener("abort",()=>{z(Error("AbortError"))})})]);return Y}}function gY($){return typeof $?._getType==="function"}function yY($){let q={type:$._getType(),data:{content:$.content}};if($?.additional_kwargs&&Object.keys($.additional_kwargs).length>0)q.data.additional_kwargs={...$.additional_kwargs};return q}var rI=N8(IX(),1);function O_($){if(!$||$.split("/").length>2||$.startsWith("/")||$.endsWith("/")||$.split(":").length>2)throw Error(`Invalid identifier format: ${$}`);let[q,_]=$.split(":"),K=_||"latest";if(q.includes("/")){let[P,Y]=q.split("/",2);if(!P||!Y)throw Error(`Invalid identifier format: ${$}`);return[P,Y,K]}else{if(!q)throw Error(`Invalid identifier format: ${$}`);return["-",q,K]}}class DX extends Error{constructor($){super($);Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}}async function $6($,q,_){let K;if($.ok){if(_)K=await $.text();return}if($.status===403)try{if((await $.json())?.error==="org_scoped_key_requires_workspace")K="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable."}catch(O){let z=Error(`${$.status} ${$.statusText}`);throw z.status=$?.status,z}if(K===void 0)try{K=await $.text()}catch(O){K=""}let P=`Failed to ${q}. Received status [${$.status}]: ${$.statusText}. Message: ${K}`;if($.status===409)throw new DX(P);let Y=Error(P);throw Y.status=$.status,Y}var LX="ERR_CONFLICTING_ENDPOINTS";class QY extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS.");Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:LX}),this.name="ConflictingEndpointsError"}}function bX($){return typeof $==="object"&&$!==null&&$.code===LX}var gX="[...]",oI={result:"[Circular]"},Y9=[],tK=[],nI=new TextEncoder;function iI(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function P9($){return nI.encode($)}function yX($){if($&&typeof $==="object"&&$!==null){if($ instanceof Map)return Object.fromEntries($);else if($ instanceof Set)return Array.from($);else if($ instanceof Date)return $.toISOString();else if($ instanceof RegExp)return $.toString();else if($ instanceof Error)return{name:$.name,message:$.message}}else if(typeof $==="bigint")return $.toString();return $}function BI($){return function(q,_){if($){let K=$.call(this,q,_);if(K!==void 0)return K}return yX(_)}}function Bq($,q,_,K,P){try{let Y=JSON.stringify($,BI(_),K);return P9(Y)}catch(Y){if(!Y.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${q?`
127
+ `)}function Sw($){let q=$.reduce((P,Y)=>{let O=P.findIndex(([z])=>{if("id"in Y&&Y.id&&"index"in Y&&Y.index!==void 0)return Y.id===z.id&&Y.index===z.index;if("id"in Y&&Y.id)return Y.id===z.id;if("index"in Y&&Y.index!==void 0)return Y.index===z.index;return!1});if(O!==-1)P[O].push(Y);else P.push([Y]);return P},[]),_=[],K=[];for(let P of q){let Y=null,O=P[0]?.name??"",z=P.map((f)=>f.args||"").join("").trim(),T=z.length?z:"{}",H=P[0]?.id;try{if(Y=Jw(T),!H||Y===null||typeof Y!=="object"||Array.isArray(Y))throw Error("Malformed tool call chunk args.");_.push({name:O,args:Y,id:H,type:"tool_call"})}catch{K.push({name:O,args:T,id:H,error:"Malformed args.",type:"invalid_tool_call"})}}return{tool_call_chunks:$,tool_calls:_,invalid_tool_calls:K}}var aC={};f6(aC,{getEnv:()=>Rw,getEnvironmentVariable:()=>C8,getRuntimeEnvironment:()=>vY,isBrowser:()=>Nw,isDeno:()=>D1,isJsDom:()=>Ew,isNode:()=>hw,isWebWorker:()=>Cw});var Nw=()=>typeof window<"u"&&typeof window.document<"u",Cw=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",Ew=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),D1=()=>typeof Deno<"u",hw=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!D1(),Rw=()=>{let $;if(Nw())$="browser";else if(hw())$="node";else if(Cw())$="webworker";else if(Ew())$="jsdom";else if(D1())$="deno";else $="other";return $},jY;function vY(){if(jY===void 0)jY={library:"langchain-js",runtime:Rw()};return jY}function C8($){try{if(typeof process<"u")return process.env?.[$];else if(D1())return Deno?.env.get($);else return}catch{return}}var Iw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function eC($){return typeof $==="string"&&Iw.test($)}var oK=eC;var Xq=[];for(JP=0;JP<256;++JP)Xq.push((JP+256).toString(16).slice(1));var JP;function Dw($,q=0){return(Xq[$[q+0]]+Xq[$[q+1]]+Xq[$[q+2]]+Xq[$[q+3]]+"-"+Xq[$[q+4]]+Xq[$[q+5]]+"-"+Xq[$[q+6]]+Xq[$[q+7]]+"-"+Xq[$[q+8]]+Xq[$[q+9]]+"-"+Xq[$[q+10]]+Xq[$[q+11]]+Xq[$[q+12]]+Xq[$[q+13]]+Xq[$[q+14]]+Xq[$[q+15]]).toLowerCase()}var L1,sC=new Uint8Array(16);function zY(){if(!L1){if(L1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!L1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return L1(sC)}var $E=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),WY={randomUUID:$E};function qE($,q,_){if(WY.randomUUID&&!q&&!$)return WY.randomUUID();$=$||{};var K=$.random||($.rng||zY)();if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){_=_||0;for(var P=0;P<16;++P)q[_+P]=K[P];return q}return Dw(K)}var iq=qE;var KE={};f6(KE,{BaseCallbackHandler:()=>jK,callbackHandlerPrefersStreaming:()=>YE,isBaseCallbackHandler:()=>JY});var PE=class{};function YE($){return"lc_prefer_streaming"in $&&$.lc_prefer_streaming}var jK=class extends PE{lc_serializable=!1;get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){return}get lc_attributes(){return}get lc_aliases(){return}get lc_serializable_keys(){return}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,h1(this.constructor)]}lc_kwargs;ignoreLLM=!1;ignoreChain=!1;ignoreAgent=!1;ignoreRetriever=!1;ignoreCustomEvent=!1;raiseError=!1;awaitHandlers=C8("LANGCHAIN_CALLBACKS_BACKGROUND")==="false";constructor($){super();if(this.lc_kwargs=$||{},$)this.ignoreLLM=$.ignoreLLM??this.ignoreLLM,this.ignoreChain=$.ignoreChain??this.ignoreChain,this.ignoreAgent=$.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=$.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=$.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=$.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||($._awaitHandler??this.awaitHandlers)}copy(){return new this.constructor(this)}toJSON(){return b_.prototype.toJSON.call(this)}toJSONNotImplemented(){return b_.prototype.toJSONNotImplemented.call(this)}static fromMethods($){class q extends jK{name=iq();constructor(){super();Object.assign(this,$)}}return new q}},JY=($)=>{let q=$;return q!==void 0&&typeof q.copy==="function"&&typeof q.name==="string"&&typeof q.awaitHandlers==="boolean"};var Lw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function OE($){return typeof $==="string"&&Lw.test($)}var bw=OE;function jE($){if(!bw($))throw TypeError("Invalid UUID");var q,_=new Uint8Array(16);return _[0]=(q=parseInt($.slice(0,8),16))>>>24,_[1]=q>>>16&255,_[2]=q>>>8&255,_[3]=q&255,_[4]=(q=parseInt($.slice(9,13),16))>>>8,_[5]=q&255,_[6]=(q=parseInt($.slice(14,18),16))>>>8,_[7]=q&255,_[8]=(q=parseInt($.slice(19,23),16))>>>8,_[9]=q&255,_[10]=(q=parseInt($.slice(24,36),16))/1099511627776&255,_[11]=q/4294967296&255,_[12]=q>>>24&255,_[13]=q>>>16&255,_[14]=q>>>8&255,_[15]=q&255,_}var gw=jE;var Aq=[];for(HP=0;HP<256;++HP)Aq.push((HP+256).toString(16).slice(1));var HP;function nK($,q=0){return(Aq[$[q+0]]+Aq[$[q+1]]+Aq[$[q+2]]+Aq[$[q+3]]+"-"+Aq[$[q+4]]+Aq[$[q+5]]+"-"+Aq[$[q+6]]+Aq[$[q+7]]+"-"+Aq[$[q+8]]+Aq[$[q+9]]+"-"+Aq[$[q+10]]+Aq[$[q+11]]+Aq[$[q+12]]+Aq[$[q+13]]+Aq[$[q+14]]+Aq[$[q+15]]).toLowerCase()}var b1,vE=new Uint8Array(16);function TP(){if(!b1){if(b1=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!b1)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported")}return b1(vE)}function zE($){$=unescape(encodeURIComponent($));var q=[];for(var _=0;_<$.length;++_)q.push($.charCodeAt(_));return q}var WE="6ba7b810-9dad-11d1-80b4-00c04fd430c8",JE="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function HY($,q,_){function K(P,Y,O,z){var T;if(typeof P==="string")P=zE(P);if(typeof Y==="string")Y=gw(Y);if(((T=Y)===null||T===void 0?void 0:T.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var H=new Uint8Array(16+P.length);if(H.set(Y),H.set(P,Y.length),H=_(H),H[6]=H[6]&15|q,H[8]=H[8]&63|128,O){z=z||0;for(var f=0;f<16;++f)O[z+f]=H[f];return O}return nK(H)}try{K.name=$}catch(P){}return K.DNS=WE,K.URL=JE,K}var HE=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),TY={randomUUID:HE};function TE($,q,_){if(TY.randomUUID&&!q&&!$)return TY.randomUUID();$=$||{};var K=$.random||($.rng||TP)();if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){_=_||0;for(var P=0;P<16;++P)q[_+P]=K[P];return q}return nK(K)}var vK=TE;function wE($,q,_,K){switch($){case 0:return q&_^~q&K;case 1:return q^_^K;case 2:return q&_^q&K^_&K;case 3:return q^_^K}}function wY($,q){return $<<q|$>>>32-q}function fE($){var q=[1518500249,1859775393,2400959708,3395469782],_=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof $==="string"){var K=unescape(encodeURIComponent($));$=[];for(var P=0;P<K.length;++P)$.push(K.charCodeAt(P))}else if(!Array.isArray($))$=Array.prototype.slice.call($);$.push(128);var Y=$.length/4+2,O=Math.ceil(Y/16),z=Array(O);for(var T=0;T<O;++T){var H=new Uint32Array(16);for(var f=0;f<16;++f)H[f]=$[T*64+f*4]<<24|$[T*64+f*4+1]<<16|$[T*64+f*4+2]<<8|$[T*64+f*4+3];z[T]=H}z[O-1][14]=($.length-1)*8/Math.pow(2,32),z[O-1][14]=Math.floor(z[O-1][14]),z[O-1][15]=($.length-1)*8&4294967295;for(var w=0;w<O;++w){var k=new Uint32Array(80);for(var S=0;S<16;++S)k[S]=z[w][S];for(var N=16;N<80;++N)k[N]=wY(k[N-3]^k[N-8]^k[N-14]^k[N-16],1);var h=_[0],C=_[1],I=_[2],D=_[3],L=_[4];for(var g=0;g<80;++g){var y=Math.floor(g/20),p=wY(h,5)+wE(y,C,I,D)+L+q[y]+k[g]>>>0;L=D,D=I,I=wY(C,30)>>>0,C=h,h=p}_[0]=_[0]+h>>>0,_[1]=_[1]+C>>>0,_[2]=_[2]+I>>>0,_[3]=_[3]+D>>>0,_[4]=_[4]+L>>>0}return[_[0]>>24&255,_[0]>>16&255,_[0]>>8&255,_[0]&255,_[1]>>24&255,_[1]>>16&255,_[1]>>8&255,_[1]&255,_[2]>>24&255,_[2]>>16&255,_[2]>>8&255,_[2]&255,_[3]>>24&255,_[3]>>16&255,_[3]>>8&255,_[3]&255,_[4]>>24&255,_[4]>>16&255,_[4]>>8&255,_[4]&255]}var yw=fE;var ZE=HY("v5",80,yw),zK=ZE;var uw=null,xw=null,E8=0;function XE($,q,_){$=$||{};var K=q&&_||0,P=q||new Uint8Array(16),Y=$.random||($.rng||TP)(),O=$.msecs!==void 0?$.msecs:Date.now(),z=$.seq!==void 0?$.seq:null,T=xw,H=uw;if(O>E8&&$.msecs===void 0){if(E8=O,z!==null)T=null,H=null}if(z!==null){if(z>2147483647)z=2147483647;T=z>>>19&4095,H=z&524287}if(T===null||H===null)T=Y[6]&127,T=T<<8|Y[7],H=Y[8]&63,H=H<<8|Y[9],H=H<<5|Y[10]>>>3;if(O+1e4>E8&&z===null){if(++H>524287){if(H=0,++T>4095)T=0,E8++}}else E8=O;return xw=T,uw=H,P[K++]=E8/1099511627776&255,P[K++]=E8/4294967296&255,P[K++]=E8/16777216&255,P[K++]=E8/65536&255,P[K++]=E8/256&255,P[K++]=E8&255,P[K++]=T>>>4&15|112,P[K++]=T&255,P[K++]=H>>>13&63|128,P[K++]=H>>>5&255,P[K++]=H<<3&255|Y[10]&7,P[K++]=Y[11],P[K++]=Y[12],P[K++]=Y[13],P[K++]=Y[14],P[K++]=Y[15],q||nK(P)}var fY=XE;var pw="gen_ai.operation.name",cw="gen_ai.system",ZY="gen_ai.request.model",mw="gen_ai.response.model",XY="gen_ai.usage.input_tokens",AY="gen_ai.usage.output_tokens",kY="gen_ai.usage.total_tokens",dw="gen_ai.request.max_tokens",lw="gen_ai.request.temperature",rw="gen_ai.request.top_p",ow="gen_ai.request.frequency_penalty",nw="gen_ai.request.presence_penalty",iw="gen_ai.response.finish_reasons",Bw="gen_ai.prompt",tw="gen_ai.completion",Uw="gen_ai.request.extra_query",Fw="gen_ai.request.extra_body",Qw="gen_ai.serialized.name",aw="gen_ai.serialized.signature",ew="gen_ai.serialized.doc",sw="gen_ai.response.id",$f="gen_ai.response.service_tier",qf="gen_ai.response.system_fingerprint",_f="gen_ai.usage.input_token_details",Kf="gen_ai.usage.output_token_details",Pf="langsmith.trace.session_id",Yf="langsmith.trace.session_name",Of="langsmith.span.kind",jf="langsmith.trace.name",vf="langsmith.metadata",GY="langsmith.span.tags";var zf="langsmith.request.streaming",Wf="langsmith.request.headers";var GE=(...$)=>fetch(...$),Jf=Symbol.for("ls:fetch_implementation");var Hf=()=>{let $=globalThis[Jf];if(!$)return!1;return typeof $==="function"&&"Headers"in $&&"Request"in $&&"Response"in $},Tf=($)=>{return async(...q)=>{if($||n6("DEBUG")==="true"){let[K,P]=q;console.log(`→ ${P?.method||"GET"} ${K}`)}let _=await(globalThis[Jf]??GE)(...q);if($||n6("DEBUG")==="true")console.log(`← ${_.status} ${_.statusText} ${_.url}`);return _}};var wP=()=>{return n6("PROJECT")??K8("LANGCHAIN_SESSION")??"default"};var wf={};function iK($){if(!wf[$])console.warn($),wf[$]=!0}var VE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function Y6($,q){if(!VE.test($)){let _=q!==void 0?`Invalid UUID for ${q}: ${$}`:`Invalid UUID: ${$}`;throw Error(_)}return $}function g1($){let q=typeof $==="string"?Date.parse($):$;return fY({msecs:q,seq:0})}var y1="0.3.82";var d8,SE=()=>typeof window<"u"&&typeof window.document<"u",ME=()=>typeof globalThis==="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",NE=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),ff=()=>typeof Deno<"u",CE=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!ff(),MY=()=>{if(d8)return d8;if(typeof Bun<"u")d8="bun";else if(SE())d8="browser";else if(CE())d8="node";else if(ME())d8="webworker";else if(NE())d8="jsdom";else if(ff())d8="deno";else d8="other";return d8},VY;function u1(){if(VY===void 0){let $=MY(),q=hE();VY={library:"langsmith",runtime:$,sdk:"langsmith-js",sdk_version:y1,...q}}return VY}function NY(){let $=EE(),q={},_=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[K,P]of Object.entries($))if(typeof P==="string"&&!_.includes(K)&&!K.toLowerCase().includes("key")&&!K.toLowerCase().includes("secret")&&!K.toLowerCase().includes("token"))if(K==="LANGCHAIN_REVISION_ID")q.revision_id=P;else q[K]=P;return q}function EE(){let $={};try{if(typeof process<"u"&&process.env){for(let[q,_]of Object.entries(process.env))if((q.startsWith("LANGCHAIN_")||q.startsWith("LANGSMITH_"))&&_!=null)if((q.toLowerCase().includes("key")||q.toLowerCase().includes("secret")||q.toLowerCase().includes("token"))&&typeof _==="string")$[q]=_.slice(0,2)+"*".repeat(_.length-4)+_.slice(-2);else $[q]=_}}catch(q){}return $}function K8($){try{return typeof process<"u"?process.env?.[$]:void 0}catch(q){return}}function n6($){return K8(`LANGSMITH_${$}`)||K8(`LANGCHAIN_${$}`)}var SY;function hE(){if(SY!==void 0)return SY;let $=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],q={};for(let _ of $){let K=K8(_);if(K!==void 0)q[_]=K}return SY=q,q}function x1(){return K8("OTEL_ENABLED")==="true"||n6("OTEL_ENABLED")==="true"}class Xf{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan($,...q){if(!this.hasWarned&&x1())console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0;let _;if(q.length===1&&typeof q[0]==="function")_=q[0];else if(q.length===2&&typeof q[1]==="function")_=q[1];else if(q.length===3&&typeof q[2]==="function")_=q[2];if(typeof _==="function")return _();return}}class Af{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new Xf})}getTracer($,q){return this.mockTracer}getActiveSpan(){return}setSpan($,q){return $}getSpan($){return}setSpanContext($,q){return $}getTracerProvider(){return}setGlobalTracerProvider($){return!1}}class kf{active(){return{}}with($,q){return q()}}var CY=Symbol.for("ls:otel_trace"),EY=Symbol.for("ls:otel_context"),Zf=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),RE=new Af,IE=new kf;class Gf{getTraceInstance(){return globalThis[CY]??RE}getContextInstance(){return globalThis[EY]??IE}initializeGlobalInstances($){if(globalThis[CY]===void 0)globalThis[CY]=$.trace;if(globalThis[EY]===void 0)globalThis[EY]=$.context}setDefaultOTLPTracerComponents($){globalThis[Zf]=$}getDefaultOTLPTracerComponents(){return globalThis[Zf]??void 0}}var hY=new Gf;function p1(){return hY.getTraceInstance()}function Vf(){return hY.getContextInstance()}function Sf(){return hY.getDefaultOTLPTracerComponents()}var DE={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};function LE($){return DE[$]||$}class RY{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch($,q){for(let _ of $)try{if(!_.run)continue;if(_.operation==="post"){let K=this.createSpanForRun(_,_.run,q.get(_.id));if(K&&!_.run.end_time)this.spans.set(_.id,K)}else this.updateSpanForRun(_,_.run)}catch(K){console.error(`Error processing operation ${_.id}:`,K)}}createSpanForRun($,q,_){let K=_&&p1().getSpan(_);if(!K)return;try{return this.finishSpanSetup(K,q,$)}catch(P){console.error(`Failed to create span for run ${$.id}:`,P);return}}finishSpanSetup($,q,_){if(this.setSpanAttributes($,q,_),q.error)$.setStatus({code:2}),$.recordException(Error(q.error));else $.setStatus({code:1});if(q.end_time)$.end(new Date(q.end_time));return $}updateSpanForRun($,q){try{let _=this.spans.get($.id);if(!_){console.debug(`No span found for run ${$.id} during update`);return}if(this.setSpanAttributes(_,q,$),q.error)_.setStatus({code:2}),_.recordException(Error(q.error));else _.setStatus({code:1});let K=q.end_time;if(K)_.end(new Date(K)),this.spans.delete($.id)}catch(_){console.error(`Failed to update span for run ${$.id}:`,_)}}extractModelName($){if($.extra?.metadata){let q=$.extra.metadata;if(q.ls_model_name)return q.ls_model_name;if(q.invocation_params){let _=q.invocation_params;if(_.model)return _.model;else if(_.model_name)return _.model_name}}return}setSpanAttributes($,q,_){if("run_type"in q&&q.run_type){$.setAttribute(Of,q.run_type);let O=LE(q.run_type||"chain");$.setAttribute(pw,O)}if("name"in q&&q.name)$.setAttribute(jf,q.name);if("session_id"in q&&q.session_id)$.setAttribute(Pf,q.session_id);if("session_name"in q&&q.session_name)$.setAttribute(Yf,q.session_name);this.setGenAiSystem($,q);let K=this.extractModelName(q);if(K)$.setAttribute(ZY,K);if("prompt_tokens"in q&&typeof q.prompt_tokens==="number")$.setAttribute(XY,q.prompt_tokens);if("completion_tokens"in q&&typeof q.completion_tokens==="number")$.setAttribute(AY,q.completion_tokens);if("total_tokens"in q&&typeof q.total_tokens==="number")$.setAttribute(kY,q.total_tokens);this.setInvocationParameters($,q);let P=q.extra?.metadata||{};for(let[O,z]of Object.entries(P))if(z!==null&&z!==void 0)$.setAttribute(`${vf}.${O}`,String(z));let Y=q.tags;if(Y&&Array.isArray(Y))$.setAttribute(GY,Y.join(", "));else if(Y)$.setAttribute(GY,String(Y));if("serialized"in q&&typeof q.serialized==="object"){let O=q.serialized;if(O.name)$.setAttribute(Qw,String(O.name));if(O.signature)$.setAttribute(aw,String(O.signature));if(O.doc)$.setAttribute(ew,String(O.doc))}this.setIOAttributes($,_)}setGenAiSystem($,q){let _="langchain",K=this.extractModelName(q);if(K){let P=K.toLowerCase();if(P.includes("anthropic")||P.startsWith("claude"))_="anthropic";else if(P.includes("bedrock"))_="aws.bedrock";else if(P.includes("azure")&&P.includes("openai"))_="az.ai.openai";else if(P.includes("azure")&&P.includes("inference"))_="az.ai.inference";else if(P.includes("cohere"))_="cohere";else if(P.includes("deepseek"))_="deepseek";else if(P.includes("gemini"))_="gemini";else if(P.includes("groq"))_="groq";else if(P.includes("watson")||P.includes("ibm"))_="ibm.watsonx.ai";else if(P.includes("mistral"))_="mistral_ai";else if(P.includes("gpt")||P.includes("openai"))_="openai";else if(P.includes("perplexity")||P.includes("sonar"))_="perplexity";else if(P.includes("vertex"))_="vertex_ai";else if(P.includes("xai")||P.includes("grok"))_="xai"}$.setAttribute(cw,_)}setInvocationParameters($,q){if(!q.extra?.metadata?.invocation_params)return;let _=q.extra.metadata.invocation_params;if(_.max_tokens!==void 0)$.setAttribute(dw,_.max_tokens);if(_.temperature!==void 0)$.setAttribute(lw,_.temperature);if(_.top_p!==void 0)$.setAttribute(rw,_.top_p);if(_.frequency_penalty!==void 0)$.setAttribute(ow,_.frequency_penalty);if(_.presence_penalty!==void 0)$.setAttribute(nw,_.presence_penalty)}setIOAttributes($,q){if(q.run.inputs)try{let _=q.run.inputs;if(typeof _==="object"&&_!==null){if(_.model&&Array.isArray(_.messages))$.setAttribute(ZY,_.model);if(_.stream!==void 0)$.setAttribute(zf,_.stream);if(_.extra_headers)$.setAttribute(Wf,JSON.stringify(_.extra_headers));if(_.extra_query)$.setAttribute(Uw,JSON.stringify(_.extra_query));if(_.extra_body)$.setAttribute(Fw,JSON.stringify(_.extra_body))}$.setAttribute(Bw,JSON.stringify(_))}catch(_){console.debug(`Failed to process inputs for run ${q.id}`,_)}if(q.run.outputs)try{let _=q.run.outputs,K=this.getUnifiedRunTokens(_);if(K)$.setAttribute(XY,K[0]),$.setAttribute(AY,K[1]),$.setAttribute(kY,K[0]+K[1]);if(_&&typeof _==="object"){if(_.model)$.setAttribute(mw,String(_.model));if(_.id)$.setAttribute(sw,_.id);if(_.choices&&Array.isArray(_.choices)){let P=_.choices.map((Y)=>Y.finish_reason).filter((Y)=>Y).map(String);if(P.length>0)$.setAttribute(iw,P.join(", "))}if(_.service_tier)$.setAttribute($f,_.service_tier);if(_.system_fingerprint)$.setAttribute(qf,_.system_fingerprint);if(_.usage_metadata&&typeof _.usage_metadata==="object"){let P=_.usage_metadata;if(P.input_token_details)$.setAttribute(_f,JSON.stringify(P.input_token_details));if(P.output_token_details)$.setAttribute(Kf,JSON.stringify(P.output_token_details))}}$.setAttribute(tw,JSON.stringify(_))}catch(_){console.debug(`Failed to process outputs for run ${q.id}`,_)}}getUnifiedRunTokens($){if(!$)return null;let q=this.extractUnifiedRunTokens($.usage_metadata);if(q)return q;let _=Object.keys($);for(let Y of _){let O=$[Y];if(!O||typeof O!=="object")continue;if(q=this.extractUnifiedRunTokens(O.usage_metadata),q)return q;if(O.lc===1&&O.kwargs&&typeof O.kwargs==="object"){if(q=this.extractUnifiedRunTokens(O.kwargs.usage_metadata),q)return q}}let K=$.generations||[];if(!Array.isArray(K))return null;let P=Array.isArray(K[0])?K.flat():K;for(let Y of P)if(typeof Y==="object"&&Y.message&&typeof Y.message==="object"&&Y.message.kwargs&&typeof Y.message.kwargs==="object"){if(q=this.extractUnifiedRunTokens(Y.message.kwargs.usage_metadata),q)return q}return null}extractUnifiedRunTokens($){if(!$||typeof $!=="object")return null;if(typeof $.input_tokens!=="number"||typeof $.output_tokens!=="number")return null;return[$.input_tokens,$.output_tokens]}}var bE=Object.prototype.toString,gE=($)=>bE.call($)==="[object Error]",yE=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function IY($){if(!($&&gE($)&&$.name==="TypeError"&&typeof $.message==="string"))return!1;let{message:_,stack:K}=$;if(_==="Load failed")return K===void 0||"__sentry_captured__"in $;if(_.startsWith("error sending request for url"))return!0;return yE.has(_)}function uE($){if(typeof $==="number"){if($<0)throw TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN($))throw TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if($!==void 0)throw TypeError("Expected `retries` to be a number or Infinity.")}function c1($,q,{min:_=0,allowInfinity:K=!1}={}){if(q===void 0)return;if(typeof q!=="number"||Number.isNaN(q))throw TypeError(`Expected \`${$}\` to be a number${K?" or Infinity":""}.`);if(!K&&!Number.isFinite(q))throw TypeError(`Expected \`${$}\` to be a finite number.`);if(q<_)throw TypeError(`Expected \`${$}\` to be ≥ ${_}.`)}class Nf extends Error{constructor($){super();if($ instanceof Error)this.originalError=$,{message:$}=$;else this.originalError=Error($),this.originalError.stack=this.stack;this.name="AbortError",this.message=$}}function xE($,q){let _=Math.max(1,$+1),K=q.randomize?Math.random()+1:1,P=Math.round(K*q.minTimeout*q.factor**(_-1));return P=Math.min(P,q.maxTimeout),P}function Mf($,q){if(!Number.isFinite(q))return q;return q-(performance.now()-$)}async function pE({error:$,attemptNumber:q,retriesConsumed:_,startTime:K,options:P}){let Y=$ instanceof Error?$:TypeError(`Non-error was thrown: "${$}". You should only throw errors.`);if(Y instanceof Nf)throw Y.originalError;let O=Number.isFinite(P.retries)?Math.max(0,P.retries-_):P.retries,z=P.maxRetryTime??Number.POSITIVE_INFINITY,T=Object.freeze({error:Y,attemptNumber:q,retriesLeft:O,retriesConsumed:_});if(await P.onFailedAttempt(T),Mf(K,z)<=0)throw Y;let H=await P.shouldConsumeRetry(T),f=Mf(K,z);if(f<=0||O<=0)throw Y;if(Y instanceof TypeError&&!IY(Y)){if(H)throw Y;return P.signal?.throwIfAborted(),!1}if(!await P.shouldRetry(T))throw Y;if(!H)return P.signal?.throwIfAborted(),!1;let w=xE(_,P),k=Math.min(w,f);if(k>0)await new Promise((S,N)=>{let h=()=>{clearTimeout(C),P.signal?.removeEventListener("abort",h),N(P.signal.reason)},C=setTimeout(()=>{P.signal?.removeEventListener("abort",h),S()},k);if(P.unref)C.unref?.();P.signal?.addEventListener("abort",h,{once:!0})});return P.signal?.throwIfAborted(),!0}async function DY($,q={}){if(q={...q},uE(q.retries),Object.hasOwn(q,"forever"))throw Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");if(q.retries??=10,q.factor??=2,q.minTimeout??=1000,q.maxTimeout??=Number.POSITIVE_INFINITY,q.maxRetryTime??=Number.POSITIVE_INFINITY,q.randomize??=!1,q.onFailedAttempt??=()=>{},q.shouldRetry??=()=>!0,q.shouldConsumeRetry??=()=>!0,c1("factor",q.factor,{min:0,allowInfinity:!1}),c1("minTimeout",q.minTimeout,{min:0,allowInfinity:!1}),c1("maxTimeout",q.maxTimeout,{min:0,allowInfinity:!0}),c1("maxRetryTime",q.maxRetryTime,{min:0,allowInfinity:!0}),!(q.factor>0))q.factor=1;q.signal?.throwIfAborted();let _=0,K=0,P=performance.now();while(Number.isFinite(q.retries)?K<=q.retries:!0){_++;try{q.signal?.throwIfAborted();let Y=await $(_);return q.signal?.throwIfAborted(),Y}catch(Y){if(await pE({error:Y,attemptNumber:_,retriesConsumed:K,startTime:P,options:q}))K++}}throw Error("Retry attempts exhausted without throwing an error.")}var o1=N8(r1(),1),FE=[408,425,429,500,502,503,504];class n1{constructor($){if(Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxQueueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queueSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0}),this.maxConcurrency=$.maxConcurrency??1/0,this.maxRetries=$.maxRetries??6,this.maxQueueSizeBytes=$.maxQueueSizeBytes,"default"in o1.default)this.queue=new o1.default.default({concurrency:this.maxConcurrency});else this.queue=new o1.default({concurrency:this.maxConcurrency});this.onFailedResponseHook=$?.onFailedResponseHook}call($,...q){return this.callWithOptions({},$,...q)}callWithOptions($,q,..._){let K=$.sizeBytes??0;if(this.maxQueueSizeBytes!==void 0&&K>0&&this.queueSizeBytes+K>this.maxQueueSizeBytes)return Promise.reject(Error(`Queue size limit (${this.maxQueueSizeBytes} bytes) exceeded. Current queue size: ${this.queueSizeBytes} bytes, attempted addition: ${K} bytes.`));if(K>0)this.queueSizeBytes+=K;let P=this.onFailedResponseHook,Y=this.queue.add(()=>DY(()=>q(..._).catch((O)=>{if(O instanceof Error)throw O;else throw Error(O)}),{async onFailedAttempt({error:O}){if(O.message.startsWith("Cancel")||O.message.startsWith("TimeoutError")||O.name==="TimeoutError"||O.message.startsWith("AbortError"))throw O;if(O?.code==="ECONNABORTED")throw O;let z=O?.response;if(P){if(await P(z))return}let T=z?.status??O?.status;if(T){if(!FE.includes(+T))throw O}},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0});if(K>0)Y=Y.finally(()=>{this.queueSizeBytes-=K});if($.signal)return Promise.race([Y,new Promise((O,z)=>{$.signal?.addEventListener("abort",()=>{z(Error("AbortError"))})})]);return Y}}function gY($){return typeof $?._getType==="function"}function yY($){let q={type:$._getType(),data:{content:$.content}};if($?.additional_kwargs&&Object.keys($.additional_kwargs).length>0)q.data.additional_kwargs={...$.additional_kwargs};return q}var rI=N8(IX(),1);function O_($){if(!$||$.split("/").length>2||$.startsWith("/")||$.endsWith("/")||$.split(":").length>2)throw Error(`Invalid identifier format: ${$}`);let[q,_]=$.split(":"),K=_||"latest";if(q.includes("/")){let[P,Y]=q.split("/",2);if(!P||!Y)throw Error(`Invalid identifier format: ${$}`);return[P,Y,K]}else{if(!q)throw Error(`Invalid identifier format: ${$}`);return["-",q,K]}}class DX extends Error{constructor($){super($);Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}}async function $6($,q,_){let K;if($.ok){if(_)K=await $.text();return}if($.status===403)try{if((await $.json())?.error==="org_scoped_key_requires_workspace")K="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable."}catch(O){let z=Error(`${$.status} ${$.statusText}`);throw z.status=$?.status,z}if(K===void 0)try{K=await $.text()}catch(O){K=""}let P=`Failed to ${q}. Received status [${$.status}]: ${$.statusText}. Message: ${K}`;if($.status===409)throw new DX(P);let Y=Error(P);throw Y.status=$.status,Y}var LX="ERR_CONFLICTING_ENDPOINTS";class QY extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS.");Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:LX}),this.name="ConflictingEndpointsError"}}function bX($){return typeof $==="object"&&$!==null&&$.code===LX}var gX="[...]",oI={result:"[Circular]"},Y9=[],tK=[],nI=new TextEncoder;function iI(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function P9($){return nI.encode($)}function yX($){if($&&typeof $==="object"&&$!==null){if($ instanceof Map)return Object.fromEntries($);else if($ instanceof Set)return Array.from($);else if($ instanceof Date)return $.toISOString();else if($ instanceof RegExp)return $.toString();else if($ instanceof Error)return{name:$.name,message:$.message}}else if(typeof $==="bigint")return $.toString();return $}function BI($){return function(q,_){if($){let K=$.call(this,q,_);if(K!==void 0)return K}return yX(_)}}function Bq($,q,_,K,P){try{let Y=JSON.stringify($,BI(_),K);return P9(Y)}catch(Y){if(!Y.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${q?`
128
128
  Context: ${q}`:""}`),P9("[Unserializable]");if(n6("SUPPRESS_CIRCULAR_JSON_WARNINGS")!=="true"&&console.warn(`[WARNING]: LangSmith received circular JSON. This will decrease tracer performance. ${q?`
129
129
  Context: ${q}`:""}`),typeof P>"u")P=iI();eY($,"",0,[],void 0,0,P);let O;try{if(tK.length===0)O=JSON.stringify($,_,K);else O=JSON.stringify($,tI(_),K)}catch(z){return P9("[unable to serialize, circular reference is too complex to analyze]")}finally{while(Y9.length!==0){let z=Y9.pop();if(z.length===4)Object.defineProperty(z[0],z[1],z[3]);else z[0][z[1]]=z[2]}}return P9(O)}}function aY($,q,_,K){var P=Object.getOwnPropertyDescriptor(K,_);if(P.get!==void 0)if(P.configurable)Object.defineProperty(K,_,{value:$}),Y9.push([K,_,q,P]);else tK.push([q,_,$]);else K[_]=$,Y9.push([K,_,q])}function eY($,q,_,K,P,Y,O){Y+=1;var z;if(typeof $==="object"&&$!==null){for(z=0;z<K.length;z++)if(K[z]===$){aY(oI,$,q,P);return}if(typeof O.depthLimit<"u"&&Y>O.depthLimit){aY(gX,$,q,P);return}if(typeof O.edgesLimit<"u"&&_+1>O.edgesLimit){aY(gX,$,q,P);return}if(K.push($),Array.isArray($))for(z=0;z<$.length;z++)eY($[z],z,z,K,$,Y,O);else{$=yX($);var T=Object.keys($);for(z=0;z<T.length;z++){var H=T[z];eY($[H],H,z,K,$,Y,O)}}K.pop()}}function tI($){return $=typeof $<"u"?$:function(q,_){return _},function(q,_){if(tK.length>0)for(var K=0;K<tK.length;K++){var P=tK[K];if(P[1]===q&&P[0]===_){_=P[2],tK.splice(K,1);break}}return $.call(this,q,_)}}function uX($,q){let _=u1(),K=q??NY(),P=$.extra??{},Y=P.metadata;return $.extra={...P,runtime:{..._,...P?.runtime},metadata:{...K,...K.revision_id||"revision_id"in $&&$.revision_id?{revision_id:("revision_id"in $?$.revision_id:void 0)??K.revision_id}:{},...Y}},$}var UI=($)=>{let q=$?.toString()??n6("TRACING_SAMPLING_RATE");if(q===void 0)return;let _=parseFloat(q);if(_<0||_>1)throw Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${_}`);return _},FI=($)=>{let _=$.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return _==="localhost"||_==="127.0.0.1"||_==="::1"};async function QI($){let q=[];for await(let _ of $)q.push(_);return q}function O9($){if($===void 0)return;return $.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}var aI=async($)=>{if($?.status===429){let q=parseInt($.headers.get("retry-after")??"10",10)*1000;if(q>0)return await new Promise((_)=>setTimeout(_,q)),!0}return!1};function xX($){if(typeof $==="number")return Number($.toFixed(4));return $}var eI=25165824,mX=1073741824,sI=1e4,$D=100,pX="https://api.smith.langchain.com";class dX{constructor($){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maxSizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSizeBytes=$??mX}peek(){return this.items[0]}push($){let q,_=new Promise((P)=>{q=P}),K=Bq($.item,`Serializing run with id: ${$.item.id}`).length;if(this.sizeBytes+K>this.maxSizeBytes&&this.items.length>0)return console.warn(`AutoBatchQueue size limit (${this.maxSizeBytes} bytes) exceeded. Dropping run with id: ${$.item.id}. Current queue size: ${this.sizeBytes} bytes, attempted addition: ${K} bytes.`),q(),_;return this.items.push({action:$.action,payload:$.item,otelContext:$.otelContext,apiKey:$.apiKey,apiUrl:$.apiUrl,itemPromiseResolve:q,itemPromise:_,size:K}),this.sizeBytes+=K,_}pop({upToSizeBytes:$,upToSize:q}){if($<1)throw Error("Number of bytes to pop off may not be less than 1.");let _=[],K=0;while(K+(this.peek()?.size??0)<$&&this.items.length>0&&_.length<q){let P=this.items.shift();if(P)_.push(P),K+=P.size,this.sizeBytes-=P.size}if(_.length===0&&this.items.length>0){let P=this.items.shift();_.push(P),K+=P.size,this.sizeBytes-=P.size}return[_.map((P)=>({action:P.action,item:P.payload,otelContext:P.otelContext,apiKey:P.apiKey,apiUrl:P.apiUrl,size:P.size})),()=>_.forEach((P)=>P.itemPromiseResolve())]}}class p_{get _fetch(){return this.fetchImplementation||Tf(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:void 0}),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:K8("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:K8("LANGSMITH_DEBUG")==="true"});let q=p_.getDefaultClientConfig();if(this.tracingSampleRate=UI($.tracingSamplingRate),this.apiUrl=O9($.apiUrl??q.apiUrl)??"",this.apiUrl.endsWith("/"))this.apiUrl=this.apiUrl.slice(0,-1);if(this.apiKey=O9($.apiKey??q.apiKey),this.webUrl=O9($.webUrl??q.webUrl),this.webUrl?.endsWith("/"))this.webUrl=this.webUrl.slice(0,-1);if(this.workspaceId=O9($.workspaceId??n6("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.");this.debug=$.debug??this.debug,this.fetchImplementation=$.fetchImplementation;let _=$.maxIngestMemoryBytes??mX;if(this.batchIngestCaller=new n1({maxRetries:4,maxConcurrency:this.traceBatchConcurrency,maxQueueSizeBytes:_,...$.callerOptions??{},onFailedResponseHook:aI,debug:$.debug??this.debug}),this.hideInputs=$.hideInputs??$.anonymizer??q.hideInputs,this.hideOutputs=$.hideOutputs??$.anonymizer??q.hideOutputs,this.autoBatchTracing=$.autoBatchTracing??this.autoBatchTracing,this.autoBatchQueue=new dX(_),this.blockOnRootRunFinalization=$.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=$.batchSizeBytesLimit,this.batchSizeLimit=$.batchSizeLimit,this.fetchOptions=$.fetchOptions||{},this.manualFlushMode=$.manualFlushMode??this.manualFlushMode,x1())this.langSmithToOTELTranslator=new RY;this.cachedLSEnvVarsForMetadata=NY()}static getDefaultClientConfig(){let $=n6("API_KEY"),q=n6("ENDPOINT")??pX,_=n6("HIDE_INPUTS")==="true",K=n6("HIDE_OUTPUTS")==="true";return{apiUrl:q,apiKey:$,webUrl:void 0,hideInputs:_,hideOutputs:K}}getHostUrl(){if(this.webUrl)return this.webUrl;else if(FI(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/${y1}`};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 _=q?.toString()??"",K=`${this.apiUrl}${$}?${_}`;return await this.caller.call(async()=>{let Y=await this._fetch(K,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(Y,`fetch ${$}`),Y})}async _get($,q){return(await this._getResponse($,q)).json()}async*_getPaginated($,q=new URLSearchParams,_){let K=Number(q.get("offset"))||0,P=Number(q.get("limit"))||100;while(!0){q.set("offset",String(K)),q.set("limit",String(P));let Y=`${this.apiUrl}${$}?${q}`,O=await this.caller.call(async()=>{let T=await this._fetch(Y,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(T,`fetch ${$}`),T}),z=_?_(await O.json()):await O.json();if(z.length===0)break;if(yield z,z.length<P)break;K+=z.length}}async*_getCursorPaginatedList($,q=null,_="POST",K="runs"){let P=q?{...q}:{};while(!0){let Y=JSON.stringify(P),z=await(await this.caller.call(async()=>{let H=await this._fetch(`${this.apiUrl}${$}`,{method:_,headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(H,`fetch ${$}`),H})).json();if(!z)break;if(!z[K])break;yield z[K];let T=z.cursors;if(!T)break;if(!T.next)break;P.cursor=T.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 _=[];for(let K of $)if(!this.filteredPostUuids.has(K.trace_id))_.push(K);else if(K.id===K.trace_id)this.filteredPostUuids.delete(K.trace_id);return _}else{let _=[];for(let K of $){let P=K.trace_id??K.id;if(this.filteredPostUuids.has(P))continue;if(K.id===P)if(this._shouldSample())_.push(K);else this.filteredPostUuids.add(P);else _.push(K)}return _}}async _getBatchSizeLimitBytes(){let $=await this._ensureServerInfo();return this.batchSizeBytesLimit??$.batch_ingest_config?.size_limit_bytes??eI}async _getBatchSizeLimit(){let $=await this._ensureServerInfo();return this.batchSizeLimit??$.batch_ingest_config?.size_limit??$D}async _getDatasetExamplesMultiPartSupport(){return(await this._ensureServerInfo()).instance_flags?.dataset_examples_multipart_enabled??!1}drainAutoBatchQueue({batchSizeLimitBytes:$,batchSizeLimit:q}){let _=[];while(this.autoBatchQueue.items.length>0){let[K,P]=this.autoBatchQueue.pop({upToSizeBytes:$,upToSize:q});if(!K.length){P();break}let Y=K.reduce((T,H)=>{let f=H.apiUrl??this.apiUrl,w=H.apiKey??this.apiKey,S=H.apiKey===this.apiKey&&H.apiUrl===this.apiUrl?"default":`${f}|${w}`;if(!T[S])T[S]=[];return T[S].push(H),T},{}),O=[];for(let[T,H]of Object.entries(Y)){let f=this._processBatch(H,{apiUrl:T==="default"?void 0:T.split("|")[0],apiKey:T==="default"?void 0:T.split("|")[1]});O.push(f)}let z=Promise.all(O).finally(P);_.push(z)}return Promise.all(_)}async _processBatch($,q){if(!$.length)return;let _=$.reduce((K,P)=>K+(P.size??0),0);try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator($);else{let K={runCreates:$.filter((Y)=>Y.action==="create").map((Y)=>Y.item),runUpdates:$.filter((Y)=>Y.action==="update").map((Y)=>Y.item)},P=await this._ensureServerInfo();if(P?.batch_ingest_config?.use_multipart_endpoint){let Y=P?.instance_flags?.gzip_body_enabled;await this.multipartIngestRuns(K,{...q,useGzip:Y,sizeBytes:_})}else await this.batchIngestRuns(K,{...q,sizeBytes:_})}}catch(K){console.error("Error exporting batch:",K)}}_sendBatchToOTELTranslator($){if(this.langSmithToOTELTranslator!==void 0){let q=new Map,_=[];for(let K of $)if(K.item.id&&K.otelContext)if(q.set(K.item.id,K.otelContext),K.action==="create")_.push({operation:"post",id:K.item.id,trace_id:K.item.trace_id??K.item.id,run:K.item});else _.push({operation:"patch",id:K.item.id,trace_id:K.item.trace_id??K.item.id,run:K.item});this.langSmithToOTELTranslator.exportBatch(_,q)}}async processRunOperation($){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,$.item=uX($.item,this.cachedLSEnvVarsForMetadata);let q=this.autoBatchQueue.push($);if(this.manualFlushMode)return q;let _=await this._getBatchSizeLimitBytes(),K=await this._getBatchSizeLimit();if(this.autoBatchQueue.sizeBytes>_||this.autoBatchQueue.items.length>K)this.drainAutoBatchQueue({batchSizeLimitBytes:_,batchSizeLimit:K});if(this.autoBatchQueue.items.length>0)this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue({batchSizeLimitBytes:_,batchSizeLimit:K})},this.autoBatchAggregationDelayMs);return q}async _getServerInfo(){let q=await(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(sI),...this.fetchOptions});return await $6(_,"get server info"),_})).json();if(this.debug)console.log(`
130
130
  === LangSmith Server Configuration ===
131
131
  `+JSON.stringify(q,null,2)+`
132
- `);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 $=p1(),q=Vf();if(this.langSmithToOTELTranslator!==void 0){let _=$.getActiveSpan();if(_)return $.setSpan(q.active(),_)}return}async createRun($,q){if(!this._filterForSampling([$]).length)return;let _={...this.headers,"Content-Type":"application/json"},K=$.project_name;delete $.project_name;let P=await this.prepareRunCreateOrUpdateInputs({session_name:K,...$,start_time:$.start_time??Date.now()});if(this.autoBatchTracing&&P.trace_id!==void 0&&P.dotted_order!==void 0){let z=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:P,otelContext:z,apiKey:q?.apiKey,apiUrl:q?.apiUrl}).catch(console.error);return}let Y=uX(P,this.cachedLSEnvVarsForMetadata);if(q?.apiKey!==void 0)_["x-api-key"]=q.apiKey;if(q?.workspaceId!==void 0)_["x-tenant-id"]=q.workspaceId;let O=Bq(Y,`Creating run with id: ${Y.id}`);await this.caller.call(async()=>{let z=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await $6(z,"create run",!0),z})}async batchIngestRuns({runCreates:$,runUpdates:q},_){if($===void 0&&q===void 0)return;let K=await Promise.all($?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]),P=await Promise.all(q?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]);if(K.length>0&&P.length>0){let z=K.reduce((H,f)=>{if(!f.id)return H;return H[f.id]=f,H},{}),T=[];for(let H of P)if(H.id!==void 0&&z[H.id])z[H.id]={...z[H.id],...H};else T.push(H);K=Object.values(z),P=T}let Y={post:K,patch:P};if(!Y.post.length&&!Y.patch.length)return;let O={post:[],patch:[]};for(let z of["post","patch"]){let T=z,H=Y[T].reverse(),f=H.pop();while(f!==void 0)O[T].push(f),f=H.pop()}if(O.post.length>0||O.patch.length>0){let z=O.post.map((T)=>T.id).concat(O.patch.map((T)=>T.id)).join(",");await this._postBatchIngestRuns(Bq(O,`Ingesting runs with ids: ${z}`),_)}}async _postBatchIngestRuns($,q){let _={...this.headers,"Content-Type":"application/json",Accept:"application/json"};if(q?.apiKey!==void 0)_["x-api-key"]=q.apiKey;await this.batchIngestCaller.callWithOptions({sizeBytes:q?.sizeBytes},async()=>{let K=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:$});return await $6(K,"batch create run",!0),K})}async multipartIngestRuns({runCreates:$,runUpdates:q},_){if($===void 0&&q===void 0)return;let K={},P=[];for(let f of $??[]){let w=await this.prepareRunCreateOrUpdateInputs(f);if(w.id!==void 0&&w.attachments!==void 0)K[w.id]=w.attachments;delete w.attachments,P.push(w)}let Y=[];for(let f of q??[])Y.push(await this.prepareRunCreateOrUpdateInputs(f));if(P.find((f)=>{return f.trace_id===void 0||f.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(Y.find((f)=>{return f.trace_id===void 0||f.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(P.length>0&&Y.length>0){let f=P.reduce((k,S)=>{if(!S.id)return k;return k[S.id]=S,k},{}),w=[];for(let k of Y)if(k.id!==void 0&&f[k.id])f[k.id]={...f[k.id],...k};else w.push(k);P=Object.values(f),Y=w}if(P.length===0&&Y.length===0)return;let T=[],H=[];for(let[f,w]of[["post",P],["patch",Y]])for(let k of w){let{inputs:S,outputs:N,events:h,extra:C,error:I,serialized:D,attachments:L,...g}=k,y={inputs:S,outputs:N,events:h,extra:C,error:I,serialized:D},c=Bq(g,`Serializing for multipart ingestion of run with id: ${g.id}`);H.push({name:`${f}.${g.id}`,payload:new Blob([c],{type:`application/json; length=${c.length}`})});for(let[o,s]of Object.entries(y)){if(s===void 0)continue;let F=Bq(s,`Serializing ${o} for multipart ingestion of run with id: ${g.id}`);H.push({name:`${f}.${g.id}.${o}`,payload:new Blob([F],{type:`application/json; length=${F.length}`})})}if(g.id!==void 0){let o=K[g.id];if(o){delete K[g.id];for(let[s,F]of Object.entries(o)){let p,a;if(Array.isArray(F))[p,a]=F;else p=F.mimeType,a=F.data;if(s.includes(".")){console.warn(`Skipping attachment '${s}' for run ${g.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}H.push({name:`attachment.${g.id}.${s}`,payload:new Blob([a],{type:`${p}; length=${a.byteLength}`})})}}}T.push(`trace=${g.trace_id},id=${g.id}`)}await this._sendMultipartRequest(H,T.join("; "),_)}async _createNodeFetchBody($,q){let _=[];for(let Y of $)_.push(new Blob([`--${q}\r
132
+ `);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 $=p1(),q=Vf();if(this.langSmithToOTELTranslator!==void 0){let _=$.getActiveSpan();if(_)return $.setSpan(q.active(),_)}return}async createRun($,q){if(!this._filterForSampling([$]).length)return;let _={...this.headers,"Content-Type":"application/json"},K=$.project_name;delete $.project_name;let P=await this.prepareRunCreateOrUpdateInputs({session_name:K,...$,start_time:$.start_time??Date.now()});if(this.autoBatchTracing&&P.trace_id!==void 0&&P.dotted_order!==void 0){let z=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:P,otelContext:z,apiKey:q?.apiKey,apiUrl:q?.apiUrl}).catch(console.error);return}let Y=uX(P,this.cachedLSEnvVarsForMetadata);if(q?.apiKey!==void 0)_["x-api-key"]=q.apiKey;if(q?.workspaceId!==void 0)_["x-tenant-id"]=q.workspaceId;let O=Bq(Y,`Creating run with id: ${Y.id}`);await this.caller.call(async()=>{let z=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await $6(z,"create run",!0),z})}async batchIngestRuns({runCreates:$,runUpdates:q},_){if($===void 0&&q===void 0)return;let K=await Promise.all($?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]),P=await Promise.all(q?.map((z)=>this.prepareRunCreateOrUpdateInputs(z))??[]);if(K.length>0&&P.length>0){let z=K.reduce((H,f)=>{if(!f.id)return H;return H[f.id]=f,H},{}),T=[];for(let H of P)if(H.id!==void 0&&z[H.id])z[H.id]={...z[H.id],...H};else T.push(H);K=Object.values(z),P=T}let Y={post:K,patch:P};if(!Y.post.length&&!Y.patch.length)return;let O={post:[],patch:[]};for(let z of["post","patch"]){let T=z,H=Y[T].reverse(),f=H.pop();while(f!==void 0)O[T].push(f),f=H.pop()}if(O.post.length>0||O.patch.length>0){let z=O.post.map((T)=>T.id).concat(O.patch.map((T)=>T.id)).join(",");await this._postBatchIngestRuns(Bq(O,`Ingesting runs with ids: ${z}`),_)}}async _postBatchIngestRuns($,q){let _={...this.headers,"Content-Type":"application/json",Accept:"application/json"};if(q?.apiKey!==void 0)_["x-api-key"]=q.apiKey;await this.batchIngestCaller.callWithOptions({sizeBytes:q?.sizeBytes},async()=>{let K=await this._fetch(`${q?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:_,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:$});return await $6(K,"batch create run",!0),K})}async multipartIngestRuns({runCreates:$,runUpdates:q},_){if($===void 0&&q===void 0)return;let K={},P=[];for(let f of $??[]){let w=await this.prepareRunCreateOrUpdateInputs(f);if(w.id!==void 0&&w.attachments!==void 0)K[w.id]=w.attachments;delete w.attachments,P.push(w)}let Y=[];for(let f of q??[])Y.push(await this.prepareRunCreateOrUpdateInputs(f));if(P.find((f)=>{return f.trace_id===void 0||f.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(Y.find((f)=>{return f.trace_id===void 0||f.dotted_order===void 0})!==void 0)throw Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(P.length>0&&Y.length>0){let f=P.reduce((k,S)=>{if(!S.id)return k;return k[S.id]=S,k},{}),w=[];for(let k of Y)if(k.id!==void 0&&f[k.id])f[k.id]={...f[k.id],...k};else w.push(k);P=Object.values(f),Y=w}if(P.length===0&&Y.length===0)return;let T=[],H=[];for(let[f,w]of[["post",P],["patch",Y]])for(let k of w){let{inputs:S,outputs:N,events:h,extra:C,error:I,serialized:D,attachments:L,...g}=k,y={inputs:S,outputs:N,events:h,extra:C,error:I,serialized:D},p=Bq(g,`Serializing for multipart ingestion of run with id: ${g.id}`);H.push({name:`${f}.${g.id}`,payload:new Blob([p],{type:`application/json; length=${p.length}`})});for(let[o,s]of Object.entries(y)){if(s===void 0)continue;let Q=Bq(s,`Serializing ${o} for multipart ingestion of run with id: ${g.id}`);H.push({name:`${f}.${g.id}.${o}`,payload:new Blob([Q],{type:`application/json; length=${Q.length}`})})}if(g.id!==void 0){let o=K[g.id];if(o){delete K[g.id];for(let[s,Q]of Object.entries(o)){let m,e;if(Array.isArray(Q))[m,e]=Q;else m=Q.mimeType,e=Q.data;if(s.includes(".")){console.warn(`Skipping attachment '${s}' for run ${g.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}H.push({name:`attachment.${g.id}.${s}`,payload:new Blob([e],{type:`${m}; length=${e.byteLength}`})})}}}T.push(`trace=${g.trace_id},id=${g.id}`)}await this._sendMultipartRequest(H,T.join("; "),_)}async _createNodeFetchBody($,q){let _=[];for(let Y of $)_.push(new Blob([`--${q}\r
133
133
  `])),_.push(new Blob([`Content-Disposition: form-data; name="${Y.name}"\r
134
134
  `,`Content-Type: ${Y.payload.type}\r
135
135
  \r
@@ -143,11 +143,11 @@ Context: ${q}`:""}`),typeof P>"u")P=iI();eY($,"",0,[],void 0,0,P);let O;try{if(t
143
143
  `)}await Y(`--${q}--\r
144
144
  `),P.close()}})}async _sendMultipartRequest($,q,_){let K="----LangSmithFormBoundary"+Math.random().toString(36).slice(2),P=Hf(),Y=()=>this._createNodeFetchBody($,K),O=()=>this._createMultipartStream($,K),z=async(T)=>{return this.batchIngestCaller.callWithOptions({sizeBytes:_?.sizeBytes},async()=>{let H=await T(),f={...this.headers,"Content-Type":`multipart/form-data; boundary=${K}`};if(_?.apiKey!==void 0)f["x-api-key"]=_.apiKey;let w=H;if(_?.useGzip&&typeof H==="object"&&"pipeThrough"in H)w=H.pipeThrough(new CompressionStream("gzip")),f["Content-Encoding"]="gzip";let k=await this._fetch(`${_?.apiUrl??this.apiUrl}/runs/multipart`,{method:"POST",headers:f,body:w,duplex:"half",signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(k,"Failed to send multipart request",!0),k})};try{let T,H=!1;if(!P&&!this.multipartStreamingDisabled&&MY()!=="bun")H=!0,T=await z(O);else T=await z(Y);if((!this.multipartStreamingDisabled||H)&&T.status===422&&(_?.apiUrl??this.apiUrl)!==pX)console.warn(`Streaming multipart upload to ${_?.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,T=await z(Y)}catch(T){console.warn(`${T.message.trim()}
145
145
 
146
- Context: ${q}`)}}async updateRun($,q,_){if(Y6($),q.inputs)q.inputs=await this.processInputs(q.inputs);if(q.outputs)q.outputs=await this.processOutputs(q.outputs);let K={...q,id:$};if(!this._filterForSampling([K],!0).length)return;if(this.autoBatchTracing&&K.trace_id!==void 0&&K.dotted_order!==void 0){let O=this._cloneCurrentOTELContext();if(q.end_time!==void 0&&K.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:K,otelContext:O,apiKey:_?.apiKey,apiUrl:_?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:K,otelContext:O,apiKey:_?.apiKey,apiUrl:_?.apiUrl}).catch(console.error);return}let P={...this.headers,"Content-Type":"application/json"};if(_?.apiKey!==void 0)P["x-api-key"]=_.apiKey;if(_?.workspaceId!==void 0)P["x-tenant-id"]=_.workspaceId;let Y=Bq(q,`Serializing payload to update run with id: ${$}`);await this.caller.call(async()=>{let O=await this._fetch(`${_?.apiUrl??this.apiUrl}/runs/${$}`,{method:"PATCH",headers:P,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(O,"update run",!0),O})}async readRun($,{loadChildRuns:q}={loadChildRuns:!1}){Y6($);let _=await this._get(`/runs/${$}`);if(q)_=await this._loadChildRuns(_);return _}async getRunUrl({runId:$,run:q,projectOpts:_}){if(q!==void 0){let K;if(q.session_id)K=q.session_id;else if(_?.projectName)K=(await this.readProject({projectName:_?.projectName})).id;else if(_?.projectId)K=_?.projectId;else K=(await this.readProject({projectName:n6("PROJECT")||"default"})).id;let P=await this._getTenantId();return`${this.getHostUrl()}/o/${P}/projects/p/${K}/r/${q.id}?poll=true`}else if($!==void 0){let K=await this.readRun($);if(!K.app_path)throw Error(`Run ${$} has no app_path`);return`${this.getHostUrl()}${K.app_path}`}else throw Error("Must provide either runId or run")}async _loadChildRuns($){let q=await QI(this.listRuns({isRoot:!1,projectId:$.session_id,traceId:$.trace_id})),_={},K={};q.sort((P,Y)=>(P?.dotted_order??"").localeCompare(Y?.dotted_order??""));for(let P of q){if(P.parent_run_id===null||P.parent_run_id===void 0)throw Error(`Child run ${P.id} has no parent`);if(P.dotted_order?.startsWith($.dotted_order??"")&&P.id!==$.id){if(!(P.parent_run_id in _))_[P.parent_run_id]=[];_[P.parent_run_id].push(P),K[P.id]=P}}$.child_runs=_[$.id]||[];for(let P in _)if(P!==$.id)K[P].child_runs=_[P];return $}async*listRuns($){let{projectId:q,projectName:_,parentRunId:K,traceId:P,referenceExampleId:Y,startTime:O,executionOrder:z,isRoot:T,runType:H,error:f,id:w,query:k,filter:S,traceFilter:N,treeFilter:h,limit:C,select:I,order:D}=$,L=[];if(q)L=Array.isArray(q)?q:[q];if(_){let o=Array.isArray(_)?_:[_],s=await Promise.all(o.map((F)=>this.readProject({projectName:F}).then((p)=>p.id)));L.push(...s)}let g=["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:L.length?L:null,run_type:H,reference_example:Y,query:k,filter:S,trace_filter:N,tree_filter:h,execution_order:z,parent_run:K,start_time:O?O.toISOString():null,error:f,id:w,limit:C,trace:P,select:I?I:g,is_root:T,order:D};if(y.select.includes("child_run_ids"))iK("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");let c=0;for await(let o of this._getCursorPaginatedList("/runs/query",y))if(C){if(c>=C)break;if(o.length+c>C){yield*o.slice(0,C-c);break}c+=o.length,yield*o}else yield*o}async*listGroupRuns($){let{projectId:q,projectName:_,groupBy:K,filter:P,startTime:Y,endTime:O,limit:z,offset:T}=$,f={session_id:q||(await this.readProject({projectName:_})).id,group_by:K,filter:P,start_time:Y?Y.toISOString():null,end_time:O?O.toISOString():null,limit:Number(z)||100},w=Number(T)||0,k="/runs/group",S=`${this.apiUrl}${k}`;while(!0){let N={...f,offset:w},h=Object.fromEntries(Object.entries(N).filter(([y,c])=>c!==void 0)),C=JSON.stringify(h),D=await(await this.caller.call(async()=>{let y=await this._fetch(S,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:C});return await $6(y,`Failed to fetch ${k}`),y})).json(),{groups:L,total:g}=D;if(L.length===0)break;for(let y of L)yield y;if(w+=L.length,w>=g)break}}async getRunStats({id:$,trace:q,parentRun:_,runType:K,projectNames:P,projectIds:Y,referenceExampleIds:O,startTime:z,endTime:T,error:H,query:f,filter:w,traceFilter:k,treeFilter:S,isRoot:N,dataSourceType:h}){let C=Y||[];if(P)C=[...Y||[],...await Promise.all(P.map((c)=>this.readProject({projectName:c}).then((o)=>o.id)))];let D=Object.fromEntries(Object.entries({id:$,trace:q,parent_run:_,run_type:K,session:C,reference_example:O,start_time:z,end_time:T,error:H,query:f,filter:w,trace_filter:k,tree_filter:S,is_root:N,data_source_type:h}).filter(([c,o])=>o!==void 0)),L=JSON.stringify(D);return await(await this.caller.call(async()=>{let c=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:L});return await $6(c,"get run stats"),c})).json()}async shareRun($,{shareId:q}={}){let _={run_id:$,share_token:q||vK()};Y6($);let K=JSON.stringify(_),Y=await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await $6(O,"share run"),O})).json();if(Y===null||!("share_token"in Y))throw Error("Invalid response from server");return`${this.getHostUrl()}/public/${Y.share_token}/r`}async unshareRun($){Y6($),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 $6(q,"unshare run",!0),q})}async readRunSharedLink($){Y6($);let _=await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(K,"read run shared link"),K})).json();if(_===null||!("share_token"in _))return;return`${this.getHostUrl()}/public/${_.share_token}/r`}async listSharedRuns($,{runIds:q}={}){let _=new URLSearchParams({share_token:$});if(q!==void 0)for(let Y of q)_.append("id",Y);return Y6($),await(await this.caller.call(async()=>{let Y=await this._fetch(`${this.apiUrl}/public/${$}/runs${_}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(Y,"list shared runs"),Y})).json()}async readDatasetSharedSchema($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;Y6($);let K=await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,"read dataset shared schema"),P})).json();return K.url=`${this.getHostUrl()}/public/${K.share_token}/d`,K}async shareDataset($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;let _={dataset_id:$};Y6($);let K=JSON.stringify(_),Y=await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await $6(O,"share dataset"),O})).json();return Y.url=`${this.getHostUrl()}/public/${Y.share_token}/d`,Y}async unshareDataset($){Y6($),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 $6(q,"unshare dataset",!0),q})}async readSharedDataset($){return Y6($),await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/public/${$}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(K,"read shared dataset"),K})).json()}async listSharedExamples($,q){let _={};if(q?.exampleIds)_.id=q.exampleIds;let K=new URLSearchParams;Object.entries(_).forEach(([O,z])=>{if(Array.isArray(z))z.forEach((T)=>K.append(O,T));else K.append(O,z)});let P=await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/public/${$}/examples?${K.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(O,"list shared examples"),O}),Y=await P.json();if(!P.ok){if("detail"in Y)throw Error(`Failed to list shared examples.
146
+ Context: ${q}`)}}async updateRun($,q,_){if(Y6($),q.inputs)q.inputs=await this.processInputs(q.inputs);if(q.outputs)q.outputs=await this.processOutputs(q.outputs);let K={...q,id:$};if(!this._filterForSampling([K],!0).length)return;if(this.autoBatchTracing&&K.trace_id!==void 0&&K.dotted_order!==void 0){let O=this._cloneCurrentOTELContext();if(q.end_time!==void 0&&K.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:K,otelContext:O,apiKey:_?.apiKey,apiUrl:_?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:K,otelContext:O,apiKey:_?.apiKey,apiUrl:_?.apiUrl}).catch(console.error);return}let P={...this.headers,"Content-Type":"application/json"};if(_?.apiKey!==void 0)P["x-api-key"]=_.apiKey;if(_?.workspaceId!==void 0)P["x-tenant-id"]=_.workspaceId;let Y=Bq(q,`Serializing payload to update run with id: ${$}`);await this.caller.call(async()=>{let O=await this._fetch(`${_?.apiUrl??this.apiUrl}/runs/${$}`,{method:"PATCH",headers:P,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(O,"update run",!0),O})}async readRun($,{loadChildRuns:q}={loadChildRuns:!1}){Y6($);let _=await this._get(`/runs/${$}`);if(q)_=await this._loadChildRuns(_);return _}async getRunUrl({runId:$,run:q,projectOpts:_}){if(q!==void 0){let K;if(q.session_id)K=q.session_id;else if(_?.projectName)K=(await this.readProject({projectName:_?.projectName})).id;else if(_?.projectId)K=_?.projectId;else K=(await this.readProject({projectName:n6("PROJECT")||"default"})).id;let P=await this._getTenantId();return`${this.getHostUrl()}/o/${P}/projects/p/${K}/r/${q.id}?poll=true`}else if($!==void 0){let K=await this.readRun($);if(!K.app_path)throw Error(`Run ${$} has no app_path`);return`${this.getHostUrl()}${K.app_path}`}else throw Error("Must provide either runId or run")}async _loadChildRuns($){let q=await QI(this.listRuns({isRoot:!1,projectId:$.session_id,traceId:$.trace_id})),_={},K={};q.sort((P,Y)=>(P?.dotted_order??"").localeCompare(Y?.dotted_order??""));for(let P of q){if(P.parent_run_id===null||P.parent_run_id===void 0)throw Error(`Child run ${P.id} has no parent`);if(P.dotted_order?.startsWith($.dotted_order??"")&&P.id!==$.id){if(!(P.parent_run_id in _))_[P.parent_run_id]=[];_[P.parent_run_id].push(P),K[P.id]=P}}$.child_runs=_[$.id]||[];for(let P in _)if(P!==$.id)K[P].child_runs=_[P];return $}async*listRuns($){let{projectId:q,projectName:_,parentRunId:K,traceId:P,referenceExampleId:Y,startTime:O,executionOrder:z,isRoot:T,runType:H,error:f,id:w,query:k,filter:S,traceFilter:N,treeFilter:h,limit:C,select:I,order:D}=$,L=[];if(q)L=Array.isArray(q)?q:[q];if(_){let o=Array.isArray(_)?_:[_],s=await Promise.all(o.map((Q)=>this.readProject({projectName:Q}).then((m)=>m.id)));L.push(...s)}let g=["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:L.length?L:null,run_type:H,reference_example:Y,query:k,filter:S,trace_filter:N,tree_filter:h,execution_order:z,parent_run:K,start_time:O?O.toISOString():null,error:f,id:w,limit:C,trace:P,select:I?I:g,is_root:T,order:D};if(y.select.includes("child_run_ids"))iK("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 o of this._getCursorPaginatedList("/runs/query",y))if(C){if(p>=C)break;if(o.length+p>C){yield*o.slice(0,C-p);break}p+=o.length,yield*o}else yield*o}async*listGroupRuns($){let{projectId:q,projectName:_,groupBy:K,filter:P,startTime:Y,endTime:O,limit:z,offset:T}=$,f={session_id:q||(await this.readProject({projectName:_})).id,group_by:K,filter:P,start_time:Y?Y.toISOString():null,end_time:O?O.toISOString():null,limit:Number(z)||100},w=Number(T)||0,k="/runs/group",S=`${this.apiUrl}${k}`;while(!0){let N={...f,offset:w},h=Object.fromEntries(Object.entries(N).filter(([y,p])=>p!==void 0)),C=JSON.stringify(h),D=await(await this.caller.call(async()=>{let y=await this._fetch(S,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:C});return await $6(y,`Failed to fetch ${k}`),y})).json(),{groups:L,total:g}=D;if(L.length===0)break;for(let y of L)yield y;if(w+=L.length,w>=g)break}}async getRunStats({id:$,trace:q,parentRun:_,runType:K,projectNames:P,projectIds:Y,referenceExampleIds:O,startTime:z,endTime:T,error:H,query:f,filter:w,traceFilter:k,treeFilter:S,isRoot:N,dataSourceType:h}){let C=Y||[];if(P)C=[...Y||[],...await Promise.all(P.map((p)=>this.readProject({projectName:p}).then((o)=>o.id)))];let D=Object.fromEntries(Object.entries({id:$,trace:q,parent_run:_,run_type:K,session:C,reference_example:O,start_time:z,end_time:T,error:H,query:f,filter:w,trace_filter:k,tree_filter:S,is_root:N,data_source_type:h}).filter(([p,o])=>o!==void 0)),L=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:L});return await $6(p,"get run stats"),p})).json()}async shareRun($,{shareId:q}={}){let _={run_id:$,share_token:q||vK()};Y6($);let K=JSON.stringify(_),Y=await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await $6(O,"share run"),O})).json();if(Y===null||!("share_token"in Y))throw Error("Invalid response from server");return`${this.getHostUrl()}/public/${Y.share_token}/r`}async unshareRun($){Y6($),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 $6(q,"unshare run",!0),q})}async readRunSharedLink($){Y6($);let _=await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/runs/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(K,"read run shared link"),K})).json();if(_===null||!("share_token"in _))return;return`${this.getHostUrl()}/public/${_.share_token}/r`}async listSharedRuns($,{runIds:q}={}){let _=new URLSearchParams({share_token:$});if(q!==void 0)for(let Y of q)_.append("id",Y);return Y6($),await(await this.caller.call(async()=>{let Y=await this._fetch(`${this.apiUrl}/public/${$}/runs${_}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(Y,"list shared runs"),Y})).json()}async readDatasetSharedSchema($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;Y6($);let K=await(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,"read dataset shared schema"),P})).json();return K.url=`${this.getHostUrl()}/public/${K.share_token}/d`,K}async shareDataset($,q){if(!$&&!q)throw Error("Either datasetId or datasetName must be given");if(!$)$=(await this.readDataset({datasetName:q})).id;let _={dataset_id:$};Y6($);let K=JSON.stringify(_),Y=await(await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/datasets/${$}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:K});return await $6(O,"share dataset"),O})).json();return Y.url=`${this.getHostUrl()}/public/${Y.share_token}/d`,Y}async unshareDataset($){Y6($),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 $6(q,"unshare dataset",!0),q})}async readSharedDataset($){return Y6($),await(await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/public/${$}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(K,"read shared dataset"),K})).json()}async listSharedExamples($,q){let _={};if(q?.exampleIds)_.id=q.exampleIds;let K=new URLSearchParams;Object.entries(_).forEach(([O,z])=>{if(Array.isArray(z))z.forEach((T)=>K.append(O,T));else K.append(O,z)});let P=await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/public/${$}/examples?${K.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(O,"list shared examples"),O}),Y=await P.json();if(!P.ok){if("detail"in Y)throw Error(`Failed to list shared examples.
147
147
  Status: ${P.status}
148
148
  Message: ${Array.isArray(Y.detail)?Y.detail.join(`
149
149
  `):"Unspecified error"}`);throw Error(`Failed to list shared examples: ${P.status} ${P.statusText}`)}return Y.map((O)=>({...O,_hostUrl:this.getHostUrl()}))}async createProject({projectName:$,description:q=null,metadata:_=null,upsert:K=!1,projectExtra:P=null,referenceDatasetId:Y=null}){let O=K?"?upsert=true":"",z=`${this.apiUrl}/sessions${O}`,T=P||{};if(_)T.metadata=_;let H={name:$,extra:T,description:q};if(Y!==null)H.reference_dataset_id=Y;let f=JSON.stringify(H);return await(await this.caller.call(async()=>{let S=await this._fetch(z,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:f});return await $6(S,"create project"),S})).json()}async updateProject($,{name:q=null,description:_=null,metadata:K=null,projectExtra:P=null,endTime:Y=null}){let O=`${this.apiUrl}/sessions/${$}`,z=P;if(K)z={...z||{},metadata:K};let T=JSON.stringify({name:q,extra:z,description:_,end_time:Y?new Date(Y).toISOString():null});return await(await this.caller.call(async()=>{let w=await this._fetch(O,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:T});return await $6(w,"update project"),w})).json()}async hasProject({projectId:$,projectName:q}){let _="/sessions",K=new URLSearchParams;if($!==void 0&&q!==void 0)throw Error("Must provide either projectName or projectId, not both");else if($!==void 0)Y6($),_+=`/${$}`;else if(q!==void 0)K.append("name",q);else throw Error("Must provide projectName or projectId");let P=await this.caller.call(async()=>{let Y=await this._fetch(`${this.apiUrl}${_}?${K}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(Y,"has project"),Y});try{let Y=await P.json();if(!P.ok)return!1;if(Array.isArray(Y))return Y.length>0;return!0}catch(Y){return!1}}async readProject({projectId:$,projectName:q,includeStats:_}){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)Y6($),K+=`/${$}`;else if(q!==void 0)P.append("name",q);else throw Error("Must provide projectName or projectId");if(_!==void 0)P.append("include_stats",_.toString());let Y=await this._get(K,P),O;if(Array.isArray(Y)){if(Y.length===0)throw Error(`Project[id=${$}, name=${q}] not found`);O=Y[0]}else O=Y;return O}async getProjectUrl({projectId:$,projectName:q}){if($===void 0&&q===void 0)throw Error("Must provide either projectName or projectId");let _=await this.readProject({projectId:$,projectName:q}),K=await this._getTenantId();return`${this.getHostUrl()}/o/${K}/projects/p/${_.id}`}async getDatasetUrl({datasetId:$,datasetName:q}){if($===void 0&&q===void 0)throw Error("Must provide either datasetName or datasetId");let _=await this.readDataset({datasetId:$,datasetName:q}),K=await this._getTenantId();return`${this.getHostUrl()}/o/${K}/datasets/${_.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:_,referenceDatasetId:K,referenceDatasetName:P,includeStats:Y,datasetVersion:O,referenceFree:z,metadata:T}={}){let H=new URLSearchParams;if($!==void 0)for(let f of $)H.append("id",f);if(q!==void 0)H.append("name",q);if(_!==void 0)H.append("name_contains",_);if(K!==void 0)H.append("reference_dataset",K);else if(P!==void 0){let f=await this.readDataset({datasetName:P});H.append("reference_dataset",f.id)}if(Y!==void 0)H.append("include_stats",Y.toString());if(O!==void 0)H.append("dataset_version",O);if(z!==void 0)H.append("reference_free",z.toString());if(T!==void 0)H.append("metadata",JSON.stringify(T));for await(let f of this._getPaginated("/sessions",H))yield*f}async deleteProject({projectId:$,projectName:q}){let _;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)_=(await this.readProject({projectName:q})).id;else _=$;Y6(_),await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/sessions/${_}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(K,`delete session ${_} (${q})`,!0),K})}async uploadCsv({csvFile:$,fileName:q,inputKeys:_,outputKeys:K,description:P,dataType:Y,name:O}){let z=`${this.apiUrl}/datasets/upload`,T=new FormData;if(T.append("file",$,q),_.forEach((w)=>{T.append("input_keys",w)}),K.forEach((w)=>{T.append("output_keys",w)}),P)T.append("description",P);if(Y)T.append("data_type",Y);if(O)T.append("name",O);return await(await this.caller.call(async()=>{let w=await this._fetch(z,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:T});return await $6(w,"upload CSV"),w})).json()}async createDataset($,{description:q,dataType:_,inputsSchema:K,outputsSchema:P,metadata:Y}={}){let O={name:$,description:q,extra:Y?{metadata:Y}:void 0};if(_)O.data_type=_;if(K)O.inputs_schema_definition=K;if(P)O.outputs_schema_definition=P;let z=JSON.stringify(O);return await(await this.caller.call(async()=>{let f=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 $6(f,"create dataset"),f})).json()}async readDataset({datasetId:$,datasetName:q}){let _="/datasets",K=new URLSearchParams({limit:"1"});if($&&q)throw Error("Must provide either datasetName or datasetId, not both");else if($)Y6($),_+=`/${$}`;else if(q)K.append("name",q);else throw Error("Must provide datasetName or datasetId");let P=await this._get(_,K),Y;if(Array.isArray(P)){if(P.length===0)throw Error(`Dataset[id=${$}, name=${q}] not found`);Y=P[0]}else Y=P;return Y}async hasDataset({datasetId:$,datasetName:q}){try{return await this.readDataset({datasetId:$,datasetName:q}),!0}catch(_){if(_ instanceof Error&&_.message.toLocaleLowerCase().includes("not found"))return!1;throw _}}async diffDatasetVersions({datasetId:$,datasetName:q,fromVersion:_,toVersion:K}){let P=$;if(P===void 0&&q===void 0)throw Error("Must provide either datasetName or datasetId");else if(P!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(P===void 0)P=(await this.readDataset({datasetName:q})).id;let Y=new URLSearchParams({from_version:typeof _==="string"?_:_.toISOString(),to_version:typeof K==="string"?K:K.toISOString()});return await this._get(`/datasets/${P}/versions/diff`,Y)}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(`
150
- `).map((O)=>JSON.parse(O))}async*listDatasets({limit:$=100,offset:q=0,datasetIds:_,datasetName:K,datasetNameContains:P,metadata:Y}={}){let z=new URLSearchParams({limit:$.toString(),offset:q.toString()});if(_!==void 0)for(let T of _)z.append("id",T);if(K!==void 0)z.append("name",K);if(P!==void 0)z.append("name_contains",P);if(Y!==void 0)z.append("metadata",JSON.stringify(Y));for await(let T of this._getPaginated("/datasets",z))yield*T}async updateDataset($){let{datasetId:q,datasetName:_,...K}=$;if(!q&&!_)throw Error("Must provide either datasetName or datasetId");let P=q??(await this.readDataset({datasetName:_})).id;Y6(P);let Y=JSON.stringify(K);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(z,"update dataset"),z})).json()}async updateDatasetTag($){let{datasetId:q,datasetName:_,asOf:K,tag:P}=$;if(!q&&!_)throw Error("Must provide either datasetName or datasetId");let Y=q??(await this.readDataset({datasetName:_})).id;Y6(Y);let O=JSON.stringify({as_of:typeof K==="string"?K:K.toISOString(),tag:P});await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${Y}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await $6(z,"update dataset tags",!0),z})}async deleteDataset({datasetId:$,datasetName:q}){let _="/datasets",K=$;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(q!==void 0)K=(await this.readDataset({datasetName:q})).id;if(K!==void 0)Y6(K),_+=`/${K}`;else throw Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let P=await this._fetch(this.apiUrl+_,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,`delete ${_}`,!0),P})}async indexDataset({datasetId:$,datasetName:q,tag:_}){let K=$;if(!K&&!q)throw Error("Must provide either datasetName or datasetId");else if(K&&q)throw Error("Must provide either datasetName or datasetId, not both");else if(!K)K=(await this.readDataset({datasetName:q})).id;Y6(K);let Y=JSON.stringify({tag:_});await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${K}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(z,"index dataset"),z})).json()}async similarExamples($,q,_,{filter:K}={}){let P={limit:_,inputs:$};if(K!==void 0)P.filter=K;Y6(q);let Y=JSON.stringify(P);return(await(await this.caller.call(async()=>{let T=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:Y});return await $6(T,"fetch similar examples"),T})).json()).examples}async createExample($,q,_){if(cX($)){if(q!==void 0||_!==void 0)throw Error("Cannot provide outputs or options when using ExampleCreate object")}let K=q?_?.datasetId:$.dataset_id,P=q?_?.datasetName:$.dataset_name;if(K===void 0&&P===void 0)throw Error("Must provide either datasetName or datasetId");else if(K!==void 0&&P!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(K===void 0)K=(await this.readDataset({datasetName:P})).id;let Y=(q?_?.createdAt:$.created_at)||new Date,O;if(!cX($))O={inputs:$,outputs:q,created_at:Y?.toISOString(),id:_?.exampleId,metadata:_?.metadata,split:_?.split,source_run_id:_?.sourceRunId,use_source_run_io:_?.useSourceRunIO,use_source_run_attachments:_?.useSourceRunAttachments,attachments:_?.attachments};else O=$;let z=await this._uploadExamplesMultipart(K,[O]);return await this.readExample(z.example_ids?.[0]??vK())}async createExamples($){if(Array.isArray($)){if($.length===0)return[];let I=$,D=I[0].dataset_id,L=I[0].dataset_name;if(D===void 0&&L===void 0)throw Error("Must provide either datasetName or datasetId");else if(D!==void 0&&L!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(D===void 0)D=(await this.readDataset({datasetName:L})).id;let g=await this._uploadExamplesMultipart(D,I);return await Promise.all(g.example_ids.map((c)=>this.readExample(c)))}let{inputs:q,outputs:_,metadata:K,splits:P,sourceRunIds:Y,useSourceRunIOs:O,useSourceRunAttachments:z,attachments:T,exampleIds:H,datasetId:f,datasetName:w}=$;if(q===void 0)throw Error("Must provide inputs when using legacy parameters");let k=f,S=w;if(k===void 0&&S===void 0)throw Error("Must provide either datasetName or datasetId");else if(k!==void 0&&S!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(k===void 0)k=(await this.readDataset({datasetName:S})).id;let N=q.map((I,D)=>{return{dataset_id:k,inputs:I,outputs:_?.[D],metadata:K?.[D],split:P?.[D],id:H?.[D],attachments:T?.[D],source_run_id:Y?.[D],use_source_run_io:O?.[D],use_source_run_attachments:z?.[D]}}),h=await this._uploadExamplesMultipart(k,N);return await Promise.all(h.example_ids.map((I)=>this.readExample(I)))}async createLLMExample($,q,_){return this.createExample({input:$},{output:q},_)}async createChatExample($,q,_){let K=$.map((Y)=>{if(gY(Y))return yY(Y);return Y}),P=gY(q)?yY(q):q;return this.createExample({input:K},{output:P},_)}async readExample($){Y6($);let q=`/examples/${$}`,_=await this._get(q),{attachment_urls:K,...P}=_,Y=P;if(K)Y.attachments=Object.entries(K).reduce((O,[z,T])=>{return O[z.slice(11)]={presigned_url:T.presigned_url,mime_type:T.mime_type},O},{});return Y}async*listExamples({datasetId:$,datasetName:q,exampleIds:_,asOf:K,splits:P,inlineS3Urls:Y,metadata:O,limit:z,offset:T,filter:H,includeAttachments:f}={}){let w;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($!==void 0)w=$;else if(q!==void 0)w=(await this.readDataset({datasetName:q})).id;else throw Error("Must provide a datasetName or datasetId");let k=new URLSearchParams({dataset:w}),S=K?typeof K==="string"?K:K?.toISOString():void 0;if(S)k.append("as_of",S);let N=Y??!0;if(k.append("inline_s3_urls",N.toString()),_!==void 0)for(let C of _)k.append("id",C);if(P!==void 0)for(let C of P)k.append("splits",C);if(O!==void 0){let C=JSON.stringify(O);k.append("metadata",C)}if(z!==void 0)k.append("limit",z.toString());if(T!==void 0)k.append("offset",T.toString());if(H!==void 0)k.append("filter",H);if(f===!0)["attachment_urls","outputs","metadata"].forEach((C)=>k.append("select",C));let h=0;for await(let C of this._getPaginated("/examples",k)){for(let I of C){let{attachment_urls:D,...L}=I,g=L;if(D)g.attachments=Object.entries(D).reduce((y,[c,o])=>{return y[c.slice(11)]={presigned_url:o.presigned_url,mime_type:o.mime_type||void 0},y},{});yield g,h++}if(z!==void 0&&h>=z)break}}async deleteExample($){Y6($);let q=`/examples/${$}`;await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,`delete ${q}`,!0),_})}async updateExample($,q){let _;if(q)_=$;else _=$.id;Y6(_);let K;if(q)K={id:_,...q};else K=$;let P;if(K.dataset_id!==void 0)P=K.dataset_id;else P=(await this.readExample(_)).dataset_id;return this._updateExamplesMultipart(P,[K])}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:_,tag:K}){let P;if(!$)P=(await this.readDataset({datasetName:q})).id;else P=$;if(Y6(P),_&&K||!_&&!K)throw Error("Exactly one of asOf and tag must be specified.");let Y=new URLSearchParams;if(_!==void 0)Y.append("as_of",typeof _==="string"?_:_.toISOString());if(K!==void 0)Y.append("tag",K);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}/version?${Y.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(z,"read dataset version"),z})).json()}async listDatasetSplits({datasetId:$,datasetName:q,asOf:_}){let K;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)K=(await this.readDataset({datasetName:q})).id;else K=$;Y6(K);let P=new URLSearchParams,Y=_?typeof _==="string"?_:_?.toISOString():void 0;if(Y)P.append("as_of",Y);return await this._get(`/datasets/${K}/splits`,P)}async updateDatasetSplits({datasetId:$,datasetName:q,splitName:_,exampleIds:K,remove:P=!1}){let Y;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)Y=(await this.readDataset({datasetName:q})).id;else Y=$;Y6(Y);let O={split_name:_,examples:K.map((T)=>{return Y6(T),T}),remove:P},z=JSON.stringify(O);await this.caller.call(async()=>{let T=await this._fetch(`${this.apiUrl}/datasets/${Y}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:z});return await $6(T,"update dataset splits",!0),T})}async evaluateRun($,q,{sourceInfo:_,loadChildRuns:K,referenceExample:P}={loadChildRuns:!1}){iK("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let Y;if(typeof $==="string")Y=await this.readRun($,{loadChildRuns:K});else if(typeof $==="object"&&"id"in $)Y=$;else throw Error(`Invalid run type: ${typeof $}`);if(Y.reference_example_id!==null&&Y.reference_example_id!==void 0)P=await this.readExample(Y.reference_example_id);let O=await q.evaluateRun(Y,P),[z,T]=await this._logEvaluationFeedback(O,Y,_);return T[0]}async createFeedback($,q,{score:_,value:K,correction:P,comment:Y,sourceInfo:O,feedbackSourceType:z="api",sourceRunId:T,feedbackId:H,feedbackConfig:f,projectId:w,comparativeExperimentId:k}){if(!$&&!w)throw Error("One of runId or projectId must be provided");if($&&w)throw Error("Only one of runId or projectId can be provided");let S={type:z??"api",metadata:O??{}};if(T!==void 0&&S?.metadata!==void 0&&!S.metadata.__run)S.metadata.__run={run_id:T};if(S?.metadata!==void 0&&S.metadata.__run?.run_id!==void 0)Y6(S.metadata.__run.run_id);let N={id:H??vK(),run_id:$,key:q,score:xX(_),value:K,correction:P,comment:Y,feedback_source:S,comparative_experiment_id:k,feedbackConfig:f,session_id:w},h=JSON.stringify(N),C=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let I=await this._fetch(C,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:h});return await $6(I,"create feedback",!0),I}),N}async updateFeedback($,{score:q,value:_,correction:K,comment:P}){let Y={};if(q!==void 0&&q!==null)Y.score=xX(q);if(_!==void 0&&_!==null)Y.value=_;if(K!==void 0&&K!==null)Y.correction=K;if(P!==void 0&&P!==null)Y.comment=P;Y6($);let O=JSON.stringify(Y);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:O});return await $6(z,"update feedback",!0),z})}async readFeedback($){Y6($);let q=`/feedback/${$}`;return await this._get(q)}async deleteFeedback($){Y6($);let q=`/feedback/${$}`;await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,`delete ${q}`,!0),_})}async*listFeedback({runIds:$,feedbackKeys:q,feedbackSourceTypes:_}={}){let K=new URLSearchParams;if($)for(let P of $)Y6(P),K.append("run",P);if(q)for(let P of q)K.append("key",P);if(_)for(let P of _)K.append("source",P);for await(let P of this._getPaginated("/feedback",K))yield*P}async createPresignedFeedbackToken($,q,{expiration:_,feedbackConfig:K}={}){let P={run_id:$,feedback_key:q,feedback_config:K};if(_){if(typeof _==="string")P.expires_at=_;else if(_?.hours||_?.minutes||_?.days)P.expires_in=_}else P.expires_in={hours:3};let Y=JSON.stringify(P);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:Y});return await $6(z,"create presigned feedback token"),z})).json()}async createComparativeExperiment({name:$,experimentIds:q,referenceDatasetId:_,createdAt:K,description:P,metadata:Y,id:O}){if(q.length===0)throw Error("At least one experiment is required");if(!_)_=(await this.readProject({projectId:q[0]})).reference_dataset_id;if(!_==null)throw Error("A reference dataset is required");let z={id:O,name:$,experiment_ids:q,reference_dataset_id:_,description:P,created_at:(K??new Date)?.toISOString(),extra:{}};if(Y)z.extra.metadata=Y;let T=JSON.stringify(z);return(await this.caller.call(async()=>{let f=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:T});return await $6(f,"create comparative experiment"),f})).json()}async*listPresignedFeedbackTokens($){Y6($);let q=new URLSearchParams({run_id:$});for await(let _ of this._getPaginated("/feedback/tokens",q))yield*_}_selectEvalResults($){let q;if("results"in $)q=$.results;else if(Array.isArray($))q=$;else q=[$];return q}async _logEvaluationFeedback($,q,_){let K=this._selectEvalResults($),P=[];for(let Y of K){let O=_||{};if(Y.evaluatorInfo)O={...Y.evaluatorInfo,...O};let z=null;if(Y.targetRunId)z=Y.targetRunId;else if(q)z=q.id;P.push(await this.createFeedback(z,Y.key,{score:Y.score,value:Y.value,comment:Y.comment,correction:Y.correction,sourceInfo:O,sourceRunId:Y.sourceRunId,feedbackConfig:Y.feedbackConfig,feedbackSourceType:"model"}))}return[K,P]}async logEvaluationFeedback($,q,_){let[K]=await this._logEvaluationFeedback($,q,_);return K}async*listAnnotationQueues($={}){let{queueIds:q,name:_,nameContains:K,limit:P}=$,Y=new URLSearchParams;if(q)q.forEach((z,T)=>{Y6(z,`queueIds[${T}]`),Y.append("ids",z)});if(_)Y.append("name",_);if(K)Y.append("name_contains",K);Y.append("limit",(P!==void 0?Math.min(P,100):100).toString());let O=0;for await(let z of this._getPaginated("/annotation-queues",Y))if(yield*z,O++,P!==void 0&&O>=P)break}async createAnnotationQueue($){let{name:q,description:_,queueId:K,rubricInstructions:P}=$,Y={name:q,description:_,id:K||vK(),rubric_instructions:P},O=JSON.stringify(Object.fromEntries(Object.entries(Y).filter(([T,H])=>H!==void 0)));return(await this.caller.call(async()=>{let T=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:O});return await $6(T,"create annotation queue"),T})).json()}async readAnnotationQueue($){return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"read annotation queue"),_})).json()}async updateAnnotationQueue($,q){let{name:_,description:K,rubricInstructions:P}=q,Y=JSON.stringify({name:_,description:K,rubric_instructions:P});await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(O,"update annotation queue",!0),O})}async deleteAnnotationQueue($){await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(q,"delete annotation queue",!0),q})}async addRunsToAnnotationQueue($,q){let _=JSON.stringify(q.map((K,P)=>Y6(K,`runIds[${P}]`).toString()));await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:_});return await $6(K,"add runs to annotation queue",!0),K})}async getRunFromAnnotationQueue($,q){let _=`/annotation-queues/${Y6($,"queueId")}/run`;return(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}${_}/${q}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,"get run from annotation queue"),P})).json()}async deleteRunFromAnnotationQueue($,q){await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/runs/${Y6(q,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"delete run from annotation queue",!0),_})}async getSizeFromAnnotationQueue($){return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"get size from annotation queue"),_})).json()}async _currentTenantIsOwner($){let q=await this._getSettings();return $=="-"||q.tenant_handle===$}async _ownerConflictError($,q){let _=await this._getSettings();return Error(`Cannot ${$} for another tenant.
150
+ `).map((O)=>JSON.parse(O))}async*listDatasets({limit:$=100,offset:q=0,datasetIds:_,datasetName:K,datasetNameContains:P,metadata:Y}={}){let z=new URLSearchParams({limit:$.toString(),offset:q.toString()});if(_!==void 0)for(let T of _)z.append("id",T);if(K!==void 0)z.append("name",K);if(P!==void 0)z.append("name_contains",P);if(Y!==void 0)z.append("metadata",JSON.stringify(Y));for await(let T of this._getPaginated("/datasets",z))yield*T}async updateDataset($){let{datasetId:q,datasetName:_,...K}=$;if(!q&&!_)throw Error("Must provide either datasetName or datasetId");let P=q??(await this.readDataset({datasetName:_})).id;Y6(P);let Y=JSON.stringify(K);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(z,"update dataset"),z})).json()}async updateDatasetTag($){let{datasetId:q,datasetName:_,asOf:K,tag:P}=$;if(!q&&!_)throw Error("Must provide either datasetName or datasetId");let Y=q??(await this.readDataset({datasetName:_})).id;Y6(Y);let O=JSON.stringify({as_of:typeof K==="string"?K:K.toISOString(),tag:P});await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${Y}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:O});return await $6(z,"update dataset tags",!0),z})}async deleteDataset({datasetId:$,datasetName:q}){let _="/datasets",K=$;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(q!==void 0)K=(await this.readDataset({datasetName:q})).id;if(K!==void 0)Y6(K),_+=`/${K}`;else throw Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let P=await this._fetch(this.apiUrl+_,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,`delete ${_}`,!0),P})}async indexDataset({datasetId:$,datasetName:q,tag:_}){let K=$;if(!K&&!q)throw Error("Must provide either datasetName or datasetId");else if(K&&q)throw Error("Must provide either datasetName or datasetId, not both");else if(!K)K=(await this.readDataset({datasetName:q})).id;Y6(K);let Y=JSON.stringify({tag:_});await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${K}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(z,"index dataset"),z})).json()}async similarExamples($,q,_,{filter:K}={}){let P={limit:_,inputs:$};if(K!==void 0)P.filter=K;Y6(q);let Y=JSON.stringify(P);return(await(await this.caller.call(async()=>{let T=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:Y});return await $6(T,"fetch similar examples"),T})).json()).examples}async createExample($,q,_){if(cX($)){if(q!==void 0||_!==void 0)throw Error("Cannot provide outputs or options when using ExampleCreate object")}let K=q?_?.datasetId:$.dataset_id,P=q?_?.datasetName:$.dataset_name;if(K===void 0&&P===void 0)throw Error("Must provide either datasetName or datasetId");else if(K!==void 0&&P!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(K===void 0)K=(await this.readDataset({datasetName:P})).id;let Y=(q?_?.createdAt:$.created_at)||new Date,O;if(!cX($))O={inputs:$,outputs:q,created_at:Y?.toISOString(),id:_?.exampleId,metadata:_?.metadata,split:_?.split,source_run_id:_?.sourceRunId,use_source_run_io:_?.useSourceRunIO,use_source_run_attachments:_?.useSourceRunAttachments,attachments:_?.attachments};else O=$;let z=await this._uploadExamplesMultipart(K,[O]);return await this.readExample(z.example_ids?.[0]??vK())}async createExamples($){if(Array.isArray($)){if($.length===0)return[];let I=$,D=I[0].dataset_id,L=I[0].dataset_name;if(D===void 0&&L===void 0)throw Error("Must provide either datasetName or datasetId");else if(D!==void 0&&L!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(D===void 0)D=(await this.readDataset({datasetName:L})).id;let g=await this._uploadExamplesMultipart(D,I);return await Promise.all(g.example_ids.map((p)=>this.readExample(p)))}let{inputs:q,outputs:_,metadata:K,splits:P,sourceRunIds:Y,useSourceRunIOs:O,useSourceRunAttachments:z,attachments:T,exampleIds:H,datasetId:f,datasetName:w}=$;if(q===void 0)throw Error("Must provide inputs when using legacy parameters");let k=f,S=w;if(k===void 0&&S===void 0)throw Error("Must provide either datasetName or datasetId");else if(k!==void 0&&S!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if(k===void 0)k=(await this.readDataset({datasetName:S})).id;let N=q.map((I,D)=>{return{dataset_id:k,inputs:I,outputs:_?.[D],metadata:K?.[D],split:P?.[D],id:H?.[D],attachments:T?.[D],source_run_id:Y?.[D],use_source_run_io:O?.[D],use_source_run_attachments:z?.[D]}}),h=await this._uploadExamplesMultipart(k,N);return await Promise.all(h.example_ids.map((I)=>this.readExample(I)))}async createLLMExample($,q,_){return this.createExample({input:$},{output:q},_)}async createChatExample($,q,_){let K=$.map((Y)=>{if(gY(Y))return yY(Y);return Y}),P=gY(q)?yY(q):q;return this.createExample({input:K},{output:P},_)}async readExample($){Y6($);let q=`/examples/${$}`,_=await this._get(q),{attachment_urls:K,...P}=_,Y=P;if(K)Y.attachments=Object.entries(K).reduce((O,[z,T])=>{return O[z.slice(11)]={presigned_url:T.presigned_url,mime_type:T.mime_type},O},{});return Y}async*listExamples({datasetId:$,datasetName:q,exampleIds:_,asOf:K,splits:P,inlineS3Urls:Y,metadata:O,limit:z,offset:T,filter:H,includeAttachments:f}={}){let w;if($!==void 0&&q!==void 0)throw Error("Must provide either datasetName or datasetId, not both");else if($!==void 0)w=$;else if(q!==void 0)w=(await this.readDataset({datasetName:q})).id;else throw Error("Must provide a datasetName or datasetId");let k=new URLSearchParams({dataset:w}),S=K?typeof K==="string"?K:K?.toISOString():void 0;if(S)k.append("as_of",S);let N=Y??!0;if(k.append("inline_s3_urls",N.toString()),_!==void 0)for(let C of _)k.append("id",C);if(P!==void 0)for(let C of P)k.append("splits",C);if(O!==void 0){let C=JSON.stringify(O);k.append("metadata",C)}if(z!==void 0)k.append("limit",z.toString());if(T!==void 0)k.append("offset",T.toString());if(H!==void 0)k.append("filter",H);if(f===!0)["attachment_urls","outputs","metadata"].forEach((C)=>k.append("select",C));let h=0;for await(let C of this._getPaginated("/examples",k)){for(let I of C){let{attachment_urls:D,...L}=I,g=L;if(D)g.attachments=Object.entries(D).reduce((y,[p,o])=>{return y[p.slice(11)]={presigned_url:o.presigned_url,mime_type:o.mime_type||void 0},y},{});yield g,h++}if(z!==void 0&&h>=z)break}}async deleteExample($){Y6($);let q=`/examples/${$}`;await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,`delete ${q}`,!0),_})}async updateExample($,q){let _;if(q)_=$;else _=$.id;Y6(_);let K;if(q)K={id:_,...q};else K=$;let P;if(K.dataset_id!==void 0)P=K.dataset_id;else P=(await this.readExample(_)).dataset_id;return this._updateExamplesMultipart(P,[K])}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:_,tag:K}){let P;if(!$)P=(await this.readDataset({datasetName:q})).id;else P=$;if(Y6(P),_&&K||!_&&!K)throw Error("Exactly one of asOf and tag must be specified.");let Y=new URLSearchParams;if(_!==void 0)Y.append("as_of",typeof _==="string"?_:_.toISOString());if(K!==void 0)Y.append("tag",K);return await(await this.caller.call(async()=>{let z=await this._fetch(`${this.apiUrl}/datasets/${P}/version?${Y.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(z,"read dataset version"),z})).json()}async listDatasetSplits({datasetId:$,datasetName:q,asOf:_}){let K;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)K=(await this.readDataset({datasetName:q})).id;else K=$;Y6(K);let P=new URLSearchParams,Y=_?typeof _==="string"?_:_?.toISOString():void 0;if(Y)P.append("as_of",Y);return await this._get(`/datasets/${K}/splits`,P)}async updateDatasetSplits({datasetId:$,datasetName:q,splitName:_,exampleIds:K,remove:P=!1}){let Y;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)Y=(await this.readDataset({datasetName:q})).id;else Y=$;Y6(Y);let O={split_name:_,examples:K.map((T)=>{return Y6(T),T}),remove:P},z=JSON.stringify(O);await this.caller.call(async()=>{let T=await this._fetch(`${this.apiUrl}/datasets/${Y}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:z});return await $6(T,"update dataset splits",!0),T})}async evaluateRun($,q,{sourceInfo:_,loadChildRuns:K,referenceExample:P}={loadChildRuns:!1}){iK("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let Y;if(typeof $==="string")Y=await this.readRun($,{loadChildRuns:K});else if(typeof $==="object"&&"id"in $)Y=$;else throw Error(`Invalid run type: ${typeof $}`);if(Y.reference_example_id!==null&&Y.reference_example_id!==void 0)P=await this.readExample(Y.reference_example_id);let O=await q.evaluateRun(Y,P),[z,T]=await this._logEvaluationFeedback(O,Y,_);return T[0]}async createFeedback($,q,{score:_,value:K,correction:P,comment:Y,sourceInfo:O,feedbackSourceType:z="api",sourceRunId:T,feedbackId:H,feedbackConfig:f,projectId:w,comparativeExperimentId:k}){if(!$&&!w)throw Error("One of runId or projectId must be provided");if($&&w)throw Error("Only one of runId or projectId can be provided");let S={type:z??"api",metadata:O??{}};if(T!==void 0&&S?.metadata!==void 0&&!S.metadata.__run)S.metadata.__run={run_id:T};if(S?.metadata!==void 0&&S.metadata.__run?.run_id!==void 0)Y6(S.metadata.__run.run_id);let N={id:H??vK(),run_id:$,key:q,score:xX(_),value:K,correction:P,comment:Y,feedback_source:S,comparative_experiment_id:k,feedbackConfig:f,session_id:w},h=JSON.stringify(N),C=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let I=await this._fetch(C,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:h});return await $6(I,"create feedback",!0),I}),N}async updateFeedback($,{score:q,value:_,correction:K,comment:P}){let Y={};if(q!==void 0&&q!==null)Y.score=xX(q);if(_!==void 0&&_!==null)Y.value=_;if(K!==void 0&&K!==null)Y.correction=K;if(P!==void 0&&P!==null)Y.comment=P;Y6($);let O=JSON.stringify(Y);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:O});return await $6(z,"update feedback",!0),z})}async readFeedback($){Y6($);let q=`/feedback/${$}`;return await this._get(q)}async deleteFeedback($){Y6($);let q=`/feedback/${$}`;await this.caller.call(async()=>{let _=await this._fetch(this.apiUrl+q,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,`delete ${q}`,!0),_})}async*listFeedback({runIds:$,feedbackKeys:q,feedbackSourceTypes:_}={}){let K=new URLSearchParams;if($)for(let P of $)Y6(P),K.append("run",P);if(q)for(let P of q)K.append("key",P);if(_)for(let P of _)K.append("source",P);for await(let P of this._getPaginated("/feedback",K))yield*P}async createPresignedFeedbackToken($,q,{expiration:_,feedbackConfig:K}={}){let P={run_id:$,feedback_key:q,feedback_config:K};if(_){if(typeof _==="string")P.expires_at=_;else if(_?.hours||_?.minutes||_?.days)P.expires_in=_}else P.expires_in={hours:3};let Y=JSON.stringify(P);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:Y});return await $6(z,"create presigned feedback token"),z})).json()}async createComparativeExperiment({name:$,experimentIds:q,referenceDatasetId:_,createdAt:K,description:P,metadata:Y,id:O}){if(q.length===0)throw Error("At least one experiment is required");if(!_)_=(await this.readProject({projectId:q[0]})).reference_dataset_id;if(!_==null)throw Error("A reference dataset is required");let z={id:O,name:$,experiment_ids:q,reference_dataset_id:_,description:P,created_at:(K??new Date)?.toISOString(),extra:{}};if(Y)z.extra.metadata=Y;let T=JSON.stringify(z);return(await this.caller.call(async()=>{let f=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:T});return await $6(f,"create comparative experiment"),f})).json()}async*listPresignedFeedbackTokens($){Y6($);let q=new URLSearchParams({run_id:$});for await(let _ of this._getPaginated("/feedback/tokens",q))yield*_}_selectEvalResults($){let q;if("results"in $)q=$.results;else if(Array.isArray($))q=$;else q=[$];return q}async _logEvaluationFeedback($,q,_){let K=this._selectEvalResults($),P=[];for(let Y of K){let O=_||{};if(Y.evaluatorInfo)O={...Y.evaluatorInfo,...O};let z=null;if(Y.targetRunId)z=Y.targetRunId;else if(q)z=q.id;P.push(await this.createFeedback(z,Y.key,{score:Y.score,value:Y.value,comment:Y.comment,correction:Y.correction,sourceInfo:O,sourceRunId:Y.sourceRunId,feedbackConfig:Y.feedbackConfig,feedbackSourceType:"model"}))}return[K,P]}async logEvaluationFeedback($,q,_){let[K]=await this._logEvaluationFeedback($,q,_);return K}async*listAnnotationQueues($={}){let{queueIds:q,name:_,nameContains:K,limit:P}=$,Y=new URLSearchParams;if(q)q.forEach((z,T)=>{Y6(z,`queueIds[${T}]`),Y.append("ids",z)});if(_)Y.append("name",_);if(K)Y.append("name_contains",K);Y.append("limit",(P!==void 0?Math.min(P,100):100).toString());let O=0;for await(let z of this._getPaginated("/annotation-queues",Y))if(yield*z,O++,P!==void 0&&O>=P)break}async createAnnotationQueue($){let{name:q,description:_,queueId:K,rubricInstructions:P}=$,Y={name:q,description:_,id:K||vK(),rubric_instructions:P},O=JSON.stringify(Object.fromEntries(Object.entries(Y).filter(([T,H])=>H!==void 0)));return(await this.caller.call(async()=>{let T=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:O});return await $6(T,"create annotation queue"),T})).json()}async readAnnotationQueue($){return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"read annotation queue"),_})).json()}async updateAnnotationQueue($,q){let{name:_,description:K,rubricInstructions:P}=q,Y=JSON.stringify({name:_,description:K,rubric_instructions:P});await this.caller.call(async()=>{let O=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:Y});return await $6(O,"update annotation queue",!0),O})}async deleteAnnotationQueue($){await this.caller.call(async()=>{let q=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(q,"delete annotation queue",!0),q})}async addRunsToAnnotationQueue($,q){let _=JSON.stringify(q.map((K,P)=>Y6(K,`runIds[${P}]`).toString()));await this.caller.call(async()=>{let K=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:_});return await $6(K,"add runs to annotation queue",!0),K})}async getRunFromAnnotationQueue($,q){let _=`/annotation-queues/${Y6($,"queueId")}/run`;return(await this.caller.call(async()=>{let P=await this._fetch(`${this.apiUrl}${_}/${q}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(P,"get run from annotation queue"),P})).json()}async deleteRunFromAnnotationQueue($,q){await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/runs/${Y6(q,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"delete run from annotation queue",!0),_})}async getSizeFromAnnotationQueue($){return(await this.caller.call(async()=>{let _=await this._fetch(`${this.apiUrl}/annotation-queues/${Y6($,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $6(_,"get size from annotation queue"),_})).json()}async _currentTenantIsOwner($){let q=await this._getSettings();return $=="-"||q.tenant_handle===$}async _ownerConflictError($,q){let _=await this._getSettings();return Error(`Cannot ${$} for another tenant.
151
151
 
152
152
  Current tenant: ${_.tenant_handle}
153
153
 
@@ -191,20 +191,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
191
191
  `;return q}function Ok($,q,_){let{firstNode:K,lastNode:P,nodeColors:Y,withStyles:O=!0,curveStyle:z="linear",wrapLabelNWords:T=9}=_??{},H=O?`%%{init: {'flowchart': {'curve': '${z}'}}}%%
192
192
  graph TD;
193
193
  `:`graph TD;
194
- `;if(O){let N={["default"]:"{0}({1})"};if(K!==void 0)N[K]="{0}([{1}]):::first";if(P!==void 0)N[P]="{0}([{1}]):::last";for(let[h,C]of Object.entries($)){let I=C.name.split(":").pop()??"",L=Mg.some((y)=>I.startsWith(y)&&I.endsWith(y))?`<p>${I}</p>`:I;if(Object.keys(C.metadata??{}).length)L+=`<hr/><small><em>${Object.entries(C.metadata??{}).map(([y,c])=>`${y} = ${c}`).join(`
194
+ `;if(O){let N={["default"]:"{0}({1})"};if(K!==void 0)N[K]="{0}([{1}]):::first";if(P!==void 0)N[P]="{0}([{1}]):::last";for(let[h,C]of Object.entries($)){let I=C.name.split(":").pop()??"",L=Mg.some((y)=>I.startsWith(y)&&I.endsWith(y))?`<p>${I}</p>`:I;if(Object.keys(C.metadata??{}).length)L+=`<hr/><small><em>${Object.entries(C.metadata??{}).map(([y,p])=>`${y} = ${p}`).join(`
195
195
  `)}</em></small>`;let g=(N[h]??N.default).replace("{0}",Jz(h)).replace("{1}",L);H+=` ${g}
196
196
  `}}let f={};for(let S of q){let N=S.source.split(":"),h=S.target.split(":"),C=N.filter((I,D)=>I===h[D]).join(":");if(!f[C])f[C]=[];f[C].push(S)}let w=new Set;function k(S,N){let h=S.length===1&&S[0].source===S[0].target;if(N&&!h){let C=N.split(":").pop();if(w.has(C))throw Error(`Found duplicate subgraph '${C}' -- 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.`);w.add(C),H+=` subgraph ${C}
197
- `}for(let C of S){let{source:I,target:D,data:L,conditional:g}=C,y="";if(L!==void 0){let c=L,o=c.split(" ");if(o.length>T)c=Array.from({length:Math.ceil(o.length/T)},(s,F)=>o.slice(F*T,(F+1)*T).join(" ")).join("&nbsp;<br>&nbsp;");y=g?` -. &nbsp;${c}&nbsp; .-> `:` -- &nbsp;${c}&nbsp; --> `}else y=g?" -.-> ":" --> ";H+=` ${Jz(I)}${y}${Jz(D)};
197
+ `}for(let C of S){let{source:I,target:D,data:L,conditional:g}=C,y="";if(L!==void 0){let p=L,o=p.split(" ");if(o.length>T)p=Array.from({length:Math.ceil(o.length/T)},(s,Q)=>o.slice(Q*T,(Q+1)*T).join(" ")).join("&nbsp;<br>&nbsp;");y=g?` -. &nbsp;${p}&nbsp; .-> `:` -- &nbsp;${p}&nbsp; --> `}else y=g?" -.-> ":" --> ";H+=` ${Jz(I)}${y}${Jz(D)};
198
198
  `}for(let C in f)if(C.startsWith(`${N}:`)&&C!==N)k(f[C],C);if(N&&!h)H+=` end
199
199
  `}k(f[""]??[],"");for(let S in f)if(!S.includes(":")&&S!=="")k(f[S],S);if(O)H+=Ng(Y??{});return H}async function jk($,q){let _=q?.backgroundColor??"white",K=q?.imageType??"png",P=VA($);if(_!==void 0){if(!/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(_))_=`!${_}`}let Y=`https://mermaid.ink/img/${P}?bgColor=${_}&type=${K}`,O=await fetch(Y);if(!O.ok)throw Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${O.status}`,`Status text: ${O.statusText}`].join(`
200
200
  `));return await O.blob()}var Tz=Symbol("Let zodToJsonSchema decide on which parser to use"),Hz={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},wz=($)=>typeof $==="string"?{...Hz,name:$}:{...Hz,...$};var fz=($)=>{let q=wz($),_=q.name!==void 0?[...q.basePath,q.definitionPath,q.name]:q.basePath;return{...q,flags:{hasReferencedOpenAiAnyType:!1},currentPath:_,propertyPath:void 0,seen:new Map(Object.entries(q.definitions).map(([K,P])=>[P._def,{def:P._def,path:[...q.basePath,q.definitionPath,K],jsonSchema:void 0}]))}};var k7=($,q)=>{let _=0;for(;_<$.length&&_<q.length;_++)if($[_]!==q[_])break;return[($.length-_).toString(),...q.slice(_)].join("/")};function D6($){if($.target!=="openAi")return{};let q=[...$.basePath,$.definitionPath,$.openAiAnyTypeName];return $.flags.hasReferencedOpenAiAnyType=!0,{$ref:$.$refStrategy==="relative"?k7(q,$.currentPath):q.join("/")}}function G5($,q,_,K){if(!K?.errorMessages)return;if(_)$.errorMessage={...$.errorMessage,[q]:_}}function G6($,q,_,K,P){$[q]=_,G5($,q,K,P)}var EK={};rq(EK,{void:()=>vy,util:()=>A6,unknown:()=>Oy,union:()=>Hy,undefined:()=>Ky,tuple:()=>fy,transformer:()=>Cy,symbol:()=>_y,string:()=>Zk,strictObject:()=>Jy,setErrorMap:()=>hg,set:()=>Ay,record:()=>Zy,quotelessJson:()=>Cg,promise:()=>Ny,preprocess:()=>Ry,pipeline:()=>Iy,ostring:()=>Dy,optional:()=>Ey,onumber:()=>Ly,oboolean:()=>by,objectUtil:()=>Zz,object:()=>Wy,number:()=>Xk,nullable:()=>hy,null:()=>Py,never:()=>jy,nativeEnum:()=>My,nan:()=>sg,map:()=>Xy,makeIssue:()=>G7,literal:()=>Vy,lazy:()=>Gy,late:()=>ag,isValid:()=>t_,isDirty:()=>S5,isAsync:()=>w4,isAborted:()=>V5,intersection:()=>wy,instanceof:()=>eg,getParsedType:()=>t8,getErrorMap:()=>T4,function:()=>ky,enum:()=>Sy,effect:()=>Cy,discriminatedUnion:()=>Ty,defaultErrorMap:()=>T_,datetimeRegex:()=>Tk,date:()=>qy,custom:()=>fk,coerce:()=>gy,boolean:()=>Ak,bigint:()=>$y,array:()=>zy,any:()=>Yy,addIssueToContext:()=>t$,ZodVoid:()=>S7,ZodUnknown:()=>U_,ZodUnion:()=>G4,ZodUndefined:()=>A4,ZodType:()=>T6,ZodTuple:()=>F8,ZodTransformer:()=>y8,ZodSymbol:()=>V7,ZodString:()=>D8,ZodSet:()=>NK,ZodSchema:()=>T6,ZodRecord:()=>M7,ZodReadonly:()=>h4,ZodPromise:()=>CK,ZodPipeline:()=>E7,ZodParsedType:()=>n$,ZodOptional:()=>b8,ZodObject:()=>u6,ZodNumber:()=>F_,ZodNullable:()=>f_,ZodNull:()=>k4,ZodNever:()=>U8,ZodNativeEnum:()=>N4,ZodNaN:()=>C7,ZodMap:()=>N7,ZodLiteral:()=>M4,ZodLazy:()=>S4,ZodIssueCode:()=>c$,ZodIntersection:()=>V4,ZodFunction:()=>Z4,ZodFirstPartyTypeKind:()=>m$,ZodError:()=>aq,ZodEnum:()=>a_,ZodEffects:()=>y8,ZodDiscriminatedUnion:()=>M5,ZodDefault:()=>C4,ZodDate:()=>SK,ZodCatch:()=>E4,ZodBranded:()=>N5,ZodBoolean:()=>X4,ZodBigInt:()=>Q_,ZodArray:()=>L8,ZodAny:()=>MK,Schema:()=>T6,ParseStatus:()=>kq,OK:()=>Rq,NEVER:()=>yy,INVALID:()=>q6,EMPTY_PATH:()=>Rg,DIRTY:()=>VK,BRAND:()=>Qg});var A6;(function($){$.assertEqual=(P)=>{};function q(P){}$.assertIs=q;function _(P){throw Error()}$.assertNever=_,$.arrayToEnum=(P)=>{let Y={};for(let O of P)Y[O]=O;return Y},$.getValidEnumValues=(P)=>{let Y=$.objectKeys(P).filter((z)=>typeof P[P[z]]!=="number"),O={};for(let z of Y)O[z]=P[z];return $.objectValues(O)},$.objectValues=(P)=>{return $.objectKeys(P).map(function(Y){return P[Y]})},$.objectKeys=typeof Object.keys==="function"?(P)=>Object.keys(P):(P)=>{let Y=[];for(let O in P)if(Object.prototype.hasOwnProperty.call(P,O))Y.push(O);return Y},$.find=(P,Y)=>{for(let O of P)if(Y(O))return O;return},$.isInteger=typeof Number.isInteger==="function"?(P)=>Number.isInteger(P):(P)=>typeof P==="number"&&Number.isFinite(P)&&Math.floor(P)===P;function K(P,Y=" | "){return P.map((O)=>typeof O==="string"?`'${O}'`:O).join(Y)}$.joinValues=K,$.jsonStringifyReplacer=(P,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(A6||(A6={}));var Zz;(function($){$.mergeShapes=(q,_)=>{return{...q,..._}}})(Zz||(Zz={}));var n$=A6.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),t8=($)=>{switch(typeof $){case"undefined":return n$.undefined;case"string":return n$.string;case"number":return Number.isNaN($)?n$.nan:n$.number;case"boolean":return n$.boolean;case"function":return n$.function;case"bigint":return n$.bigint;case"symbol":return n$.symbol;case"object":if(Array.isArray($))return n$.array;if($===null)return n$.null;if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return n$.promise;if(typeof Map<"u"&&$ instanceof Map)return n$.map;if(typeof Set<"u"&&$ instanceof Set)return n$.set;if(typeof Date<"u"&&$ instanceof Date)return n$.date;return n$.object;default:return n$.unknown}};var c$=A6.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Cg=($)=>{return JSON.stringify($,null,2).replace(/"([^"]+)":/g,"$1:")};class aq extends Error{get errors(){return this.issues}constructor($){super();this.issues=[],this.addIssue=(_)=>{this.issues=[...this.issues,_]},this.addIssues=(_=[])=>{this.issues=[...this.issues,..._]};let q=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,q);else this.__proto__=q;this.name="ZodError",this.issues=$}format($){let q=$||function(P){return P.message},_={_errors:[]},K=(P)=>{for(let Y of P.issues)if(Y.code==="invalid_union")Y.unionErrors.map(K);else if(Y.code==="invalid_return_type")K(Y.returnTypeError);else if(Y.code==="invalid_arguments")K(Y.argumentsError);else if(Y.path.length===0)_._errors.push(q(Y));else{let O=_,z=0;while(z<Y.path.length){let T=Y.path[z];if(z!==Y.path.length-1)O[T]=O[T]||{_errors:[]};else O[T]=O[T]||{_errors:[]},O[T]._errors.push(q(Y));O=O[T],z++}}};return K(this),_}static assert($){if(!($ instanceof aq))throw Error(`Not a ZodError: ${$}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,A6.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten($=(q)=>q.message){let q=Object.create(null),_=[];for(let K of this.issues)if(K.path.length>0){let P=K.path[0];q[P]=q[P]||[],q[P].push($(K))}else _.push($(K));return{formErrors:_,fieldErrors:q}}get formErrors(){return this.flatten()}}aq.create=($)=>{return new aq($)};var Eg=($,q)=>{let _;switch($.code){case c$.invalid_type:if($.received===n$.undefined)_="Required";else _=`Expected ${$.expected}, received ${$.received}`;break;case c$.invalid_literal:_=`Invalid literal value, expected ${JSON.stringify($.expected,A6.jsonStringifyReplacer)}`;break;case c$.unrecognized_keys:_=`Unrecognized key(s) in object: ${A6.joinValues($.keys,", ")}`;break;case c$.invalid_union:_="Invalid input";break;case c$.invalid_union_discriminator:_=`Invalid discriminator value. Expected ${A6.joinValues($.options)}`;break;case c$.invalid_enum_value:_=`Invalid enum value. Expected ${A6.joinValues($.options)}, received '${$.received}'`;break;case c$.invalid_arguments:_="Invalid function arguments";break;case c$.invalid_return_type:_="Invalid function return type";break;case c$.invalid_date:_="Invalid date";break;case c$.invalid_string:if(typeof $.validation==="object")if("includes"in $.validation){if(_=`Invalid input: must include "${$.validation.includes}"`,typeof $.validation.position==="number")_=`${_} at one or more positions greater than or equal to ${$.validation.position}`}else if("startsWith"in $.validation)_=`Invalid input: must start with "${$.validation.startsWith}"`;else if("endsWith"in $.validation)_=`Invalid input: must end with "${$.validation.endsWith}"`;else A6.assertNever($.validation);else if($.validation!=="regex")_=`Invalid ${$.validation}`;else _="Invalid";break;case c$.too_small:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at least":"more than"} ${$.minimum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at least":"over"} ${$.minimum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="bigint")_=`Number must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${$.minimum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly equal to ":$.inclusive?"greater than or equal to ":"greater than "}${new Date(Number($.minimum))}`;else _="Invalid input";break;case c$.too_big:if($.type==="array")_=`Array must contain ${$.exact?"exactly":$.inclusive?"at most":"less than"} ${$.maximum} element(s)`;else if($.type==="string")_=`String must contain ${$.exact?"exactly":$.inclusive?"at most":"under"} ${$.maximum} character(s)`;else if($.type==="number")_=`Number must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="bigint")_=`BigInt must be ${$.exact?"exactly":$.inclusive?"less than or equal to":"less than"} ${$.maximum}`;else if($.type==="date")_=`Date must be ${$.exact?"exactly":$.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number($.maximum))}`;else _="Invalid input";break;case c$.custom:_="Invalid input";break;case c$.invalid_intersection_types:_="Intersection results could not be merged";break;case c$.not_multiple_of:_=`Number must be a multiple of ${$.multipleOf}`;break;case c$.not_finite:_="Number must be finite";break;default:_=q.defaultError,A6.assertNever($)}return{message:_}},T_=Eg;var vk=T_;function hg($){vk=$}function T4(){return vk}var G7=($)=>{let{data:q,path:_,errorMaps:K,issueData:P}=$,Y=[..._,...P.path||[]],O={...P,path:Y};if(P.message!==void 0)return{...P,path:Y,message:P.message};let z="",T=K.filter((H)=>!!H).slice().reverse();for(let H of T)z=H(O,{data:q,defaultError:z}).message;return{...P,path:Y,message:z}},Rg=[];function t$($,q){let _=T4(),K=G7({issueData:q,data:$.data,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,_,_===T_?void 0:T_].filter((P)=>!!P)});$.common.issues.push(K)}class kq{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray($,q){let _=[];for(let K of q){if(K.status==="aborted")return q6;if(K.status==="dirty")$.dirty();_.push(K.value)}return{status:$.value,value:_}}static async mergeObjectAsync($,q){let _=[];for(let K of q){let P=await K.key,Y=await K.value;_.push({key:P,value:Y})}return kq.mergeObjectSync($,_)}static mergeObjectSync($,q){let _={};for(let K of q){let{key:P,value:Y}=K;if(P.status==="aborted")return q6;if(Y.status==="aborted")return q6;if(P.status==="dirty")$.dirty();if(Y.status==="dirty")$.dirty();if(P.value!=="__proto__"&&(typeof Y.value<"u"||K.alwaysSet))_[P.value]=Y.value}return{status:$.value,value:_}}}var q6=Object.freeze({status:"aborted"}),VK=($)=>({status:"dirty",value:$}),Rq=($)=>({status:"valid",value:$}),V5=($)=>$.status==="aborted",S5=($)=>$.status==="dirty",t_=($)=>$.status==="valid",w4=($)=>typeof Promise<"u"&&$ instanceof Promise;var s$;(function($){$.errToObj=(q)=>typeof q==="string"?{message:q}:q||{},$.toString=(q)=>typeof q==="string"?q:q?.message})(s$||(s$={}));class g8{constructor($,q,_,K){this._cachedPath=[],this.parent=$,this.data=q,this._path=_,this._key=K}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var zk=($,q)=>{if(t_(q))return{success:!0,data:q.value};else{if(!$.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let _=new aq($.common.issues);return this._error=_,this._error}}}};function v6($){if(!$)return{};let{errorMap:q,invalid_type_error:_,required_error:K,description:P}=$;if(q&&(_||K))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(q)return{errorMap:q,description:P};return{errorMap:(O,z)=>{let{message:T}=$;if(O.code==="invalid_enum_value")return{message:T??z.defaultError};if(typeof z.data>"u")return{message:T??K??z.defaultError};if(O.code!=="invalid_type")return{message:z.defaultError};return{message:T??_??z.defaultError}},description:P}}class T6{get description(){return this._def.description}_getType($){return t8($.data)}_getOrReturnCtx($,q){return q||{common:$.parent.common,data:$.data,parsedType:t8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}_processInputParams($){return{status:new kq,ctx:{common:$.parent.common,data:$.data,parsedType:t8($.data),schemaErrorMap:this._def.errorMap,path:$.path,parent:$.parent}}}_parseSync($){let q=this._parse($);if(w4(q))throw Error("Synchronous parse encountered promise.");return q}_parseAsync($){let q=this._parse($);return Promise.resolve(q)}parse($,q){let _=this.safeParse($,q);if(_.success)return _.data;throw _.error}safeParse($,q){let _={common:{issues:[],async:q?.async??!1,contextualErrorMap:q?.errorMap},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:t8($)},K=this._parseSync({data:$,path:_.path,parent:_});return zk(_,K)}"~validate"($){let q={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:t8($)};if(!this["~standard"].async)try{let _=this._parseSync({data:$,path:[],parent:q});return t_(_)?{value:_.value}:{issues:q.common.issues}}catch(_){if(_?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;q.common={issues:[],async:!0}}return this._parseAsync({data:$,path:[],parent:q}).then((_)=>t_(_)?{value:_.value}:{issues:q.common.issues})}async parseAsync($,q){let _=await this.safeParseAsync($,q);if(_.success)return _.data;throw _.error}async safeParseAsync($,q){let _={common:{issues:[],contextualErrorMap:q?.errorMap,async:!0},path:q?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:$,parsedType:t8($)},K=this._parse({data:$,path:_.path,parent:_}),P=await(w4(K)?K:Promise.resolve(K));return zk(_,P)}refine($,q){let _=(K)=>{if(typeof q==="string"||typeof q>"u")return{message:q};else if(typeof q==="function")return q(K);else return q};return this._refinement((K,P)=>{let Y=$(K),O=()=>P.addIssue({code:c$.custom,..._(K)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((z)=>{if(!z)return O(),!1;else return!0});if(!Y)return O(),!1;else return!0})}refinement($,q){return this._refinement((_,K)=>{if(!$(_))return K.addIssue(typeof q==="function"?q(_,K):q),!1;else return!0})}_refinement($){return new y8({schema:this,typeName:m$.ZodEffects,effect:{type:"refinement",refinement:$}})}superRefine($){return this._refinement($)}constructor($){this.spa=this.safeParseAsync,this._def=$,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(q)=>this["~validate"](q)}}optional(){return b8.create(this,this._def)}nullable(){return f_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return L8.create(this)}promise(){return CK.create(this,this._def)}or($){return G4.create([this,$],this._def)}and($){return V4.create(this,$,this._def)}transform($){return new y8({...v6(this._def),schema:this,typeName:m$.ZodEffects,effect:{type:"transform",transform:$}})}default($){let q=typeof $==="function"?$:()=>$;return new C4({...v6(this._def),innerType:this,defaultValue:q,typeName:m$.ZodDefault})}brand(){return new N5({typeName:m$.ZodBranded,type:this,...v6(this._def)})}catch($){let q=typeof $==="function"?$:()=>$;return new E4({...v6(this._def),innerType:this,catchValue:q,typeName:m$.ZodCatch})}describe($){return new this.constructor({...this._def,description:$})}pipe($){return E7.create(this,$)}readonly(){return h4.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var Ig=/^c[^\s-]{8,}$/i,Dg=/^[0-9a-z]+$/,Lg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,bg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,gg=/^[a-z0-9_-]{21}$/i,yg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ug=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,xg=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,pg="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Xz,cg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,mg=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,dg=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,lg=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,rg=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,og=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Jk="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",ng=new RegExp(`^${Jk}$`);function Hk($){let q="[0-5]\\d";if($.precision)q=`${q}\\.\\d{${$.precision}}`;else if($.precision==null)q=`${q}(\\.\\d+)?`;let _=$.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${q})${_}`}function ig($){return new RegExp(`^${Hk($)}$`)}function Tk($){let q=`${Jk}T${Hk($)}`,_=[];if(_.push($.local?"Z?":"Z"),$.offset)_.push("([+-]\\d{2}:?\\d{2})");return q=`${q}(${_.join("|")})`,new RegExp(`^${q}$`)}function Bg($,q){if((q==="v4"||!q)&&cg.test($))return!0;if((q==="v6"||!q)&&dg.test($))return!0;return!1}function tg($,q){if(!yg.test($))return!1;try{let[_]=$.split(".");if(!_)return!1;let K=_.replace(/-/g,"+").replace(/_/g,"/").padEnd(_.length+(4-_.length%4)%4,"="),P=JSON.parse(atob(K));if(typeof P!=="object"||P===null)return!1;if("typ"in P&&P?.typ!=="JWT")return!1;if(!P.alg)return!1;if(q&&P.alg!==q)return!1;return!0}catch{return!1}}function Ug($,q){if((q==="v4"||!q)&&mg.test($))return!0;if((q==="v6"||!q)&&lg.test($))return!0;return!1}class D8 extends T6{_parse($){if(this._def.coerce)$.data=String($.data);if(this._getType($)!==n$.string){let P=this._getOrReturnCtx($);return t$(P,{code:c$.invalid_type,expected:n$.string,received:P.parsedType}),q6}let _=new kq,K=void 0;for(let P of this._def.checks)if(P.kind==="min"){if($.data.length<P.value)K=this._getOrReturnCtx($,K),t$(K,{code:c$.too_small,minimum:P.value,type:"string",inclusive:!0,exact:!1,message:P.message}),_.dirty()}else if(P.kind==="max"){if($.data.length>P.value)K=this._getOrReturnCtx($,K),t$(K,{code:c$.too_big,maximum:P.value,type:"string",inclusive:!0,exact:!1,message:P.message}),_.dirty()}else if(P.kind==="length"){let Y=$.data.length>P.value,O=$.data.length<P.value;if(Y||O){if(K=this._getOrReturnCtx($,K),Y)t$(K,{code:c$.too_big,maximum:P.value,type:"string",inclusive:!0,exact:!0,message:P.message});else if(O)t$(K,{code:c$.too_small,minimum:P.value,type:"string",inclusive:!0,exact:!0,message:P.message});_.dirty()}}else if(P.kind==="email"){if(!xg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"email",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="emoji"){if(!Xz)Xz=new RegExp(pg,"u");if(!Xz.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"emoji",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="uuid"){if(!bg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"uuid",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="nanoid"){if(!gg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"nanoid",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="cuid"){if(!Ig.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"cuid",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="cuid2"){if(!Dg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"cuid2",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="ulid"){if(!Lg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"ulid",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="url")try{new URL($.data)}catch{K=this._getOrReturnCtx($,K),t$(K,{validation:"url",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="regex"){if(P.regex.lastIndex=0,!P.regex.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"regex",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="trim")$.data=$.data.trim();else if(P.kind==="includes"){if(!$.data.includes(P.value,P.position))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:{includes:P.value,position:P.position},message:P.message}),_.dirty()}else if(P.kind==="toLowerCase")$.data=$.data.toLowerCase();else if(P.kind==="toUpperCase")$.data=$.data.toUpperCase();else if(P.kind==="startsWith"){if(!$.data.startsWith(P.value))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:{startsWith:P.value},message:P.message}),_.dirty()}else if(P.kind==="endsWith"){if(!$.data.endsWith(P.value))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:{endsWith:P.value},message:P.message}),_.dirty()}else if(P.kind==="datetime"){if(!Tk(P).test($.data))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:"datetime",message:P.message}),_.dirty()}else if(P.kind==="date"){if(!ng.test($.data))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:"date",message:P.message}),_.dirty()}else if(P.kind==="time"){if(!ig(P).test($.data))K=this._getOrReturnCtx($,K),t$(K,{code:c$.invalid_string,validation:"time",message:P.message}),_.dirty()}else if(P.kind==="duration"){if(!ug.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"duration",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="ip"){if(!Bg($.data,P.version))K=this._getOrReturnCtx($,K),t$(K,{validation:"ip",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="jwt"){if(!tg($.data,P.alg))K=this._getOrReturnCtx($,K),t$(K,{validation:"jwt",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="cidr"){if(!Ug($.data,P.version))K=this._getOrReturnCtx($,K),t$(K,{validation:"cidr",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="base64"){if(!rg.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"base64",code:c$.invalid_string,message:P.message}),_.dirty()}else if(P.kind==="base64url"){if(!og.test($.data))K=this._getOrReturnCtx($,K),t$(K,{validation:"base64url",code:c$.invalid_string,message:P.message}),_.dirty()}else A6.assertNever(P);return{status:_.value,value:$.data}}_regex($,q,_){return this.refinement((K)=>$.test(K),{validation:q,code:c$.invalid_string,...s$.errToObj(_)})}_addCheck($){return new D8({...this._def,checks:[...this._def.checks,$]})}email($){return this._addCheck({kind:"email",...s$.errToObj($)})}url($){return this._addCheck({kind:"url",...s$.errToObj($)})}emoji($){return this._addCheck({kind:"emoji",...s$.errToObj($)})}uuid($){return this._addCheck({kind:"uuid",...s$.errToObj($)})}nanoid($){return this._addCheck({kind:"nanoid",...s$.errToObj($)})}cuid($){return this._addCheck({kind:"cuid",...s$.errToObj($)})}cuid2($){return this._addCheck({kind:"cuid2",...s$.errToObj($)})}ulid($){return this._addCheck({kind:"ulid",...s$.errToObj($)})}base64($){return this._addCheck({kind:"base64",...s$.errToObj($)})}base64url($){return this._addCheck({kind:"base64url",...s$.errToObj($)})}jwt($){return this._addCheck({kind:"jwt",...s$.errToObj($)})}ip($){return this._addCheck({kind:"ip",...s$.errToObj($)})}cidr($){return this._addCheck({kind:"cidr",...s$.errToObj($)})}datetime($){if(typeof $==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:$});return this._addCheck({kind:"datetime",precision:typeof $?.precision>"u"?null:$?.precision,offset:$?.offset??!1,local:$?.local??!1,...s$.errToObj($?.message)})}date($){return this._addCheck({kind:"date",message:$})}time($){if(typeof $==="string")return this._addCheck({kind:"time",precision:null,message:$});return this._addCheck({kind:"time",precision:typeof $?.precision>"u"?null:$?.precision,...s$.errToObj($?.message)})}duration($){return this._addCheck({kind:"duration",...s$.errToObj($)})}regex($,q){return this._addCheck({kind:"regex",regex:$,...s$.errToObj(q)})}includes($,q){return this._addCheck({kind:"includes",value:$,position:q?.position,...s$.errToObj(q?.message)})}startsWith($,q){return this._addCheck({kind:"startsWith",value:$,...s$.errToObj(q)})}endsWith($,q){return this._addCheck({kind:"endsWith",value:$,...s$.errToObj(q)})}min($,q){return this._addCheck({kind:"min",value:$,...s$.errToObj(q)})}max($,q){return this._addCheck({kind:"max",value:$,...s$.errToObj(q)})}length($,q){return this._addCheck({kind:"length",value:$,...s$.errToObj(q)})}nonempty($){return this.min(1,s$.errToObj($))}trim(){return new D8({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new D8({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new D8({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(($)=>$.kind==="datetime")}get isDate(){return!!this._def.checks.find(($)=>$.kind==="date")}get isTime(){return!!this._def.checks.find(($)=>$.kind==="time")}get isDuration(){return!!this._def.checks.find(($)=>$.kind==="duration")}get isEmail(){return!!this._def.checks.find(($)=>$.kind==="email")}get isURL(){return!!this._def.checks.find(($)=>$.kind==="url")}get isEmoji(){return!!this._def.checks.find(($)=>$.kind==="emoji")}get isUUID(){return!!this._def.checks.find(($)=>$.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(($)=>$.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(($)=>$.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(($)=>$.kind==="cuid2")}get isULID(){return!!this._def.checks.find(($)=>$.kind==="ulid")}get isIP(){return!!this._def.checks.find(($)=>$.kind==="ip")}get isCIDR(){return!!this._def.checks.find(($)=>$.kind==="cidr")}get isBase64(){return!!this._def.checks.find(($)=>$.kind==="base64")}get isBase64url(){return!!this._def.checks.find(($)=>$.kind==="base64url")}get minLength(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxLength(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}D8.create=($)=>{return new D8({checks:[],typeName:m$.ZodString,coerce:$?.coerce??!1,...v6($)})};function Fg($,q){let _=($.toString().split(".")[1]||"").length,K=(q.toString().split(".")[1]||"").length,P=_>K?_:K,Y=Number.parseInt($.toFixed(P).replace(".","")),O=Number.parseInt(q.toFixed(P).replace(".",""));return Y%O/10**P}class F_ extends T6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse($){if(this._def.coerce)$.data=Number($.data);if(this._getType($)!==n$.number){let P=this._getOrReturnCtx($);return t$(P,{code:c$.invalid_type,expected:n$.number,received:P.parsedType}),q6}let _=void 0,K=new kq;for(let P of this._def.checks)if(P.kind==="int"){if(!A6.isInteger($.data))_=this._getOrReturnCtx($,_),t$(_,{code:c$.invalid_type,expected:"integer",received:"float",message:P.message}),K.dirty()}else if(P.kind==="min"){if(P.inclusive?$.data<P.value:$.data<=P.value)_=this._getOrReturnCtx($,_),t$(_,{code:c$.too_small,minimum:P.value,type:"number",inclusive:P.inclusive,exact:!1,message:P.message}),K.dirty()}else if(P.kind==="max"){if(P.inclusive?$.data>P.value:$.data>=P.value)_=this._getOrReturnCtx($,_),t$(_,{code:c$.too_big,maximum:P.value,type:"number",inclusive:P.inclusive,exact:!1,message:P.message}),K.dirty()}else if(P.kind==="multipleOf"){if(Fg($.data,P.value)!==0)_=this._getOrReturnCtx($,_),t$(_,{code:c$.not_multiple_of,multipleOf:P.value,message:P.message}),K.dirty()}else if(P.kind==="finite"){if(!Number.isFinite($.data))_=this._getOrReturnCtx($,_),t$(_,{code:c$.not_finite,message:P.message}),K.dirty()}else A6.assertNever(P);return{status:K.value,value:$.data}}gte($,q){return this.setLimit("min",$,!0,s$.toString(q))}gt($,q){return this.setLimit("min",$,!1,s$.toString(q))}lte($,q){return this.setLimit("max",$,!0,s$.toString(q))}lt($,q){return this.setLimit("max",$,!1,s$.toString(q))}setLimit($,q,_,K){return new F_({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:s$.toString(K)}]})}_addCheck($){return new F_({...this._def,checks:[...this._def.checks,$]})}int($){return this._addCheck({kind:"int",message:s$.toString($)})}positive($){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s$.toString($)})}negative($){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:s$.toString(q)})}finite($){return this._addCheck({kind:"finite",message:s$.toString($)})}safe($){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s$.toString($)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s$.toString($)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}get isInt(){return!!this._def.checks.find(($)=>$.kind==="int"||$.kind==="multipleOf"&&A6.isInteger($.value))}get isFinite(){let $=null,q=null;for(let _ of this._def.checks)if(_.kind==="finite"||_.kind==="int"||_.kind==="multipleOf")return!0;else if(_.kind==="min"){if(q===null||_.value>q)q=_.value}else if(_.kind==="max"){if($===null||_.value<$)$=_.value}return Number.isFinite(q)&&Number.isFinite($)}}F_.create=($)=>{return new F_({checks:[],typeName:m$.ZodNumber,coerce:$?.coerce||!1,...v6($)})};class Q_ extends T6{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse($){if(this._def.coerce)try{$.data=BigInt($.data)}catch{return this._getInvalidInput($)}if(this._getType($)!==n$.bigint)return this._getInvalidInput($);let _=void 0,K=new kq;for(let P of this._def.checks)if(P.kind==="min"){if(P.inclusive?$.data<P.value:$.data<=P.value)_=this._getOrReturnCtx($,_),t$(_,{code:c$.too_small,type:"bigint",minimum:P.value,inclusive:P.inclusive,message:P.message}),K.dirty()}else if(P.kind==="max"){if(P.inclusive?$.data>P.value:$.data>=P.value)_=this._getOrReturnCtx($,_),t$(_,{code:c$.too_big,type:"bigint",maximum:P.value,inclusive:P.inclusive,message:P.message}),K.dirty()}else if(P.kind==="multipleOf"){if($.data%P.value!==BigInt(0))_=this._getOrReturnCtx($,_),t$(_,{code:c$.not_multiple_of,multipleOf:P.value,message:P.message}),K.dirty()}else A6.assertNever(P);return{status:K.value,value:$.data}}_getInvalidInput($){let q=this._getOrReturnCtx($);return t$(q,{code:c$.invalid_type,expected:n$.bigint,received:q.parsedType}),q6}gte($,q){return this.setLimit("min",$,!0,s$.toString(q))}gt($,q){return this.setLimit("min",$,!1,s$.toString(q))}lte($,q){return this.setLimit("max",$,!0,s$.toString(q))}lt($,q){return this.setLimit("max",$,!1,s$.toString(q))}setLimit($,q,_,K){return new Q_({...this._def,checks:[...this._def.checks,{kind:$,value:q,inclusive:_,message:s$.toString(K)}]})}_addCheck($){return new Q_({...this._def,checks:[...this._def.checks,$]})}positive($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s$.toString($)})}negative($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s$.toString($)})}nonpositive($){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s$.toString($)})}nonnegative($){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s$.toString($)})}multipleOf($,q){return this._addCheck({kind:"multipleOf",value:$,message:s$.toString(q)})}get minValue(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $}get maxValue(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $}}Q_.create=($)=>{return new Q_({checks:[],typeName:m$.ZodBigInt,coerce:$?.coerce??!1,...v6($)})};class X4 extends T6{_parse($){if(this._def.coerce)$.data=Boolean($.data);if(this._getType($)!==n$.boolean){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.boolean,received:_.parsedType}),q6}return Rq($.data)}}X4.create=($)=>{return new X4({typeName:m$.ZodBoolean,coerce:$?.coerce||!1,...v6($)})};class SK extends T6{_parse($){if(this._def.coerce)$.data=new Date($.data);if(this._getType($)!==n$.date){let P=this._getOrReturnCtx($);return t$(P,{code:c$.invalid_type,expected:n$.date,received:P.parsedType}),q6}if(Number.isNaN($.data.getTime())){let P=this._getOrReturnCtx($);return t$(P,{code:c$.invalid_date}),q6}let _=new kq,K=void 0;for(let P of this._def.checks)if(P.kind==="min"){if($.data.getTime()<P.value)K=this._getOrReturnCtx($,K),t$(K,{code:c$.too_small,message:P.message,inclusive:!0,exact:!1,minimum:P.value,type:"date"}),_.dirty()}else if(P.kind==="max"){if($.data.getTime()>P.value)K=this._getOrReturnCtx($,K),t$(K,{code:c$.too_big,message:P.message,inclusive:!0,exact:!1,maximum:P.value,type:"date"}),_.dirty()}else A6.assertNever(P);return{status:_.value,value:new Date($.data.getTime())}}_addCheck($){return new SK({...this._def,checks:[...this._def.checks,$]})}min($,q){return this._addCheck({kind:"min",value:$.getTime(),message:s$.toString(q)})}max($,q){return this._addCheck({kind:"max",value:$.getTime(),message:s$.toString(q)})}get minDate(){let $=null;for(let q of this._def.checks)if(q.kind==="min"){if($===null||q.value>$)$=q.value}return $!=null?new Date($):null}get maxDate(){let $=null;for(let q of this._def.checks)if(q.kind==="max"){if($===null||q.value<$)$=q.value}return $!=null?new Date($):null}}SK.create=($)=>{return new SK({checks:[],coerce:$?.coerce||!1,typeName:m$.ZodDate,...v6($)})};class V7 extends T6{_parse($){if(this._getType($)!==n$.symbol){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.symbol,received:_.parsedType}),q6}return Rq($.data)}}V7.create=($)=>{return new V7({typeName:m$.ZodSymbol,...v6($)})};class A4 extends T6{_parse($){if(this._getType($)!==n$.undefined){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.undefined,received:_.parsedType}),q6}return Rq($.data)}}A4.create=($)=>{return new A4({typeName:m$.ZodUndefined,...v6($)})};class k4 extends T6{_parse($){if(this._getType($)!==n$.null){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.null,received:_.parsedType}),q6}return Rq($.data)}}k4.create=($)=>{return new k4({typeName:m$.ZodNull,...v6($)})};class MK extends T6{constructor(){super(...arguments);this._any=!0}_parse($){return Rq($.data)}}MK.create=($)=>{return new MK({typeName:m$.ZodAny,...v6($)})};class U_ extends T6{constructor(){super(...arguments);this._unknown=!0}_parse($){return Rq($.data)}}U_.create=($)=>{return new U_({typeName:m$.ZodUnknown,...v6($)})};class U8 extends T6{_parse($){let q=this._getOrReturnCtx($);return t$(q,{code:c$.invalid_type,expected:n$.never,received:q.parsedType}),q6}}U8.create=($)=>{return new U8({typeName:m$.ZodNever,...v6($)})};class S7 extends T6{_parse($){if(this._getType($)!==n$.undefined){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.void,received:_.parsedType}),q6}return Rq($.data)}}S7.create=($)=>{return new S7({typeName:m$.ZodVoid,...v6($)})};class L8 extends T6{_parse($){let{ctx:q,status:_}=this._processInputParams($),K=this._def;if(q.parsedType!==n$.array)return t$(q,{code:c$.invalid_type,expected:n$.array,received:q.parsedType}),q6;if(K.exactLength!==null){let Y=q.data.length>K.exactLength.value,O=q.data.length<K.exactLength.value;if(Y||O)t$(q,{code:Y?c$.too_big:c$.too_small,minimum:O?K.exactLength.value:void 0,maximum:Y?K.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:K.exactLength.message}),_.dirty()}if(K.minLength!==null){if(q.data.length<K.minLength.value)t$(q,{code:c$.too_small,minimum:K.minLength.value,type:"array",inclusive:!0,exact:!1,message:K.minLength.message}),_.dirty()}if(K.maxLength!==null){if(q.data.length>K.maxLength.value)t$(q,{code:c$.too_big,maximum:K.maxLength.value,type:"array",inclusive:!0,exact:!1,message:K.maxLength.message}),_.dirty()}if(q.common.async)return Promise.all([...q.data].map((Y,O)=>{return K.type._parseAsync(new g8(q,Y,q.path,O))})).then((Y)=>{return kq.mergeArray(_,Y)});let P=[...q.data].map((Y,O)=>{return K.type._parseSync(new g8(q,Y,q.path,O))});return kq.mergeArray(_,P)}get element(){return this._def.type}min($,q){return new L8({...this._def,minLength:{value:$,message:s$.toString(q)}})}max($,q){return new L8({...this._def,maxLength:{value:$,message:s$.toString(q)}})}length($,q){return new L8({...this._def,exactLength:{value:$,message:s$.toString(q)}})}nonempty($){return this.min(1,$)}}L8.create=($,q)=>{return new L8({type:$,minLength:null,maxLength:null,exactLength:null,typeName:m$.ZodArray,...v6(q)})};function f4($){if($ instanceof u6){let q={};for(let _ in $.shape){let K=$.shape[_];q[_]=b8.create(f4(K))}return new u6({...$._def,shape:()=>q})}else if($ instanceof L8)return new L8({...$._def,type:f4($.element)});else if($ instanceof b8)return b8.create(f4($.unwrap()));else if($ instanceof f_)return f_.create(f4($.unwrap()));else if($ instanceof F8)return F8.create($.items.map((q)=>f4(q)));else return $}class u6 extends T6{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let $=this._def.shape(),q=A6.objectKeys($);return this._cached={shape:$,keys:q},this._cached}_parse($){if(this._getType($)!==n$.object){let T=this._getOrReturnCtx($);return t$(T,{code:c$.invalid_type,expected:n$.object,received:T.parsedType}),q6}let{status:_,ctx:K}=this._processInputParams($),{shape:P,keys:Y}=this._getCached(),O=[];if(!(this._def.catchall instanceof U8&&this._def.unknownKeys==="strip")){for(let T in K.data)if(!Y.includes(T))O.push(T)}let z=[];for(let T of Y){let H=P[T],f=K.data[T];z.push({key:{status:"valid",value:T},value:H._parse(new g8(K,f,K.path,T)),alwaysSet:T in K.data})}if(this._def.catchall instanceof U8){let T=this._def.unknownKeys;if(T==="passthrough")for(let H of O)z.push({key:{status:"valid",value:H},value:{status:"valid",value:K.data[H]}});else if(T==="strict"){if(O.length>0)t$(K,{code:c$.unrecognized_keys,keys:O}),_.dirty()}else if(T==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let T=this._def.catchall;for(let H of O){let f=K.data[H];z.push({key:{status:"valid",value:H},value:T._parse(new g8(K,f,K.path,H)),alwaysSet:H in K.data})}}if(K.common.async)return Promise.resolve().then(async()=>{let T=[];for(let H of z){let f=await H.key,w=await H.value;T.push({key:f,value:w,alwaysSet:H.alwaysSet})}return T}).then((T)=>{return kq.mergeObjectSync(_,T)});else return kq.mergeObjectSync(_,z)}get shape(){return this._def.shape()}strict($){return s$.errToObj,new u6({...this._def,unknownKeys:"strict",...$!==void 0?{errorMap:(q,_)=>{let K=this._def.errorMap?.(q,_).message??_.defaultError;if(q.code==="unrecognized_keys")return{message:s$.errToObj($).message??K};return{message:K}}}:{}})}strip(){return new u6({...this._def,unknownKeys:"strip"})}passthrough(){return new u6({...this._def,unknownKeys:"passthrough"})}extend($){return new u6({...this._def,shape:()=>({...this._def.shape(),...$})})}merge($){return new u6({unknownKeys:$._def.unknownKeys,catchall:$._def.catchall,shape:()=>({...this._def.shape(),...$._def.shape()}),typeName:m$.ZodObject})}setKey($,q){return this.augment({[$]:q})}catchall($){return new u6({...this._def,catchall:$})}pick($){let q={};for(let _ of A6.objectKeys($))if($[_]&&this.shape[_])q[_]=this.shape[_];return new u6({...this._def,shape:()=>q})}omit($){let q={};for(let _ of A6.objectKeys(this.shape))if(!$[_])q[_]=this.shape[_];return new u6({...this._def,shape:()=>q})}deepPartial(){return f4(this)}partial($){let q={};for(let _ of A6.objectKeys(this.shape)){let K=this.shape[_];if($&&!$[_])q[_]=K;else q[_]=K.optional()}return new u6({...this._def,shape:()=>q})}required($){let q={};for(let _ of A6.objectKeys(this.shape))if($&&!$[_])q[_]=this.shape[_];else{let P=this.shape[_];while(P instanceof b8)P=P._def.innerType;q[_]=P}return new u6({...this._def,shape:()=>q})}keyof(){return wk(A6.objectKeys(this.shape))}}u6.create=($,q)=>{return new u6({shape:()=>$,unknownKeys:"strip",catchall:U8.create(),typeName:m$.ZodObject,...v6(q)})};u6.strictCreate=($,q)=>{return new u6({shape:()=>$,unknownKeys:"strict",catchall:U8.create(),typeName:m$.ZodObject,...v6(q)})};u6.lazycreate=($,q)=>{return new u6({shape:$,unknownKeys:"strip",catchall:U8.create(),typeName:m$.ZodObject,...v6(q)})};class G4 extends T6{_parse($){let{ctx:q}=this._processInputParams($),_=this._def.options;function K(P){for(let O of P)if(O.result.status==="valid")return O.result;for(let O of P)if(O.result.status==="dirty")return q.common.issues.push(...O.ctx.common.issues),O.result;let Y=P.map((O)=>new aq(O.ctx.common.issues));return t$(q,{code:c$.invalid_union,unionErrors:Y}),q6}if(q.common.async)return Promise.all(_.map(async(P)=>{let Y={...q,common:{...q.common,issues:[]},parent:null};return{result:await P._parseAsync({data:q.data,path:q.path,parent:Y}),ctx:Y}})).then(K);else{let P=void 0,Y=[];for(let z of _){let T={...q,common:{...q.common,issues:[]},parent:null},H=z._parseSync({data:q.data,path:q.path,parent:T});if(H.status==="valid")return H;else if(H.status==="dirty"&&!P)P={result:H,ctx:T};if(T.common.issues.length)Y.push(T.common.issues)}if(P)return q.common.issues.push(...P.ctx.common.issues),P.result;let O=Y.map((z)=>new aq(z));return t$(q,{code:c$.invalid_union,unionErrors:O}),q6}}get options(){return this._def.options}}G4.create=($,q)=>{return new G4({options:$,typeName:m$.ZodUnion,...v6(q)})};var w_=($)=>{if($ instanceof S4)return w_($.schema);else if($ instanceof y8)return w_($.innerType());else if($ instanceof M4)return[$.value];else if($ instanceof a_)return $.options;else if($ instanceof N4)return A6.objectValues($.enum);else if($ instanceof C4)return w_($._def.innerType);else if($ instanceof A4)return[void 0];else if($ instanceof k4)return[null];else if($ instanceof b8)return[void 0,...w_($.unwrap())];else if($ instanceof f_)return[null,...w_($.unwrap())];else if($ instanceof N5)return w_($.unwrap());else if($ instanceof h4)return w_($.unwrap());else if($ instanceof E4)return w_($._def.innerType);else return[]};class M5 extends T6{_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==n$.object)return t$(q,{code:c$.invalid_type,expected:n$.object,received:q.parsedType}),q6;let _=this.discriminator,K=q.data[_],P=this.optionsMap.get(K);if(!P)return t$(q,{code:c$.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[_]}),q6;if(q.common.async)return P._parseAsync({data:q.data,path:q.path,parent:q});else return P._parseSync({data:q.data,path:q.path,parent:q})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create($,q,_){let K=new Map;for(let P of q){let Y=w_(P.shape[$]);if(!Y.length)throw Error(`A discriminator value for key \`${$}\` could not be extracted from all schema options`);for(let O of Y){if(K.has(O))throw Error(`Discriminator property ${String($)} has duplicate value ${String(O)}`);K.set(O,P)}}return new M5({typeName:m$.ZodDiscriminatedUnion,discriminator:$,options:q,optionsMap:K,...v6(_)})}}function Az($,q){let _=t8($),K=t8(q);if($===q)return{valid:!0,data:$};else if(_===n$.object&&K===n$.object){let P=A6.objectKeys(q),Y=A6.objectKeys($).filter((z)=>P.indexOf(z)!==-1),O={...$,...q};for(let z of Y){let T=Az($[z],q[z]);if(!T.valid)return{valid:!1};O[z]=T.data}return{valid:!0,data:O}}else if(_===n$.array&&K===n$.array){if($.length!==q.length)return{valid:!1};let P=[];for(let Y=0;Y<$.length;Y++){let O=$[Y],z=q[Y],T=Az(O,z);if(!T.valid)return{valid:!1};P.push(T.data)}return{valid:!0,data:P}}else if(_===n$.date&&K===n$.date&&+$===+q)return{valid:!0,data:$};else return{valid:!1}}class V4 extends T6{_parse($){let{status:q,ctx:_}=this._processInputParams($),K=(P,Y)=>{if(V5(P)||V5(Y))return q6;let O=Az(P.value,Y.value);if(!O.valid)return t$(_,{code:c$.invalid_intersection_types}),q6;if(S5(P)||S5(Y))q.dirty();return{status:q.value,value:O.data}};if(_.common.async)return Promise.all([this._def.left._parseAsync({data:_.data,path:_.path,parent:_}),this._def.right._parseAsync({data:_.data,path:_.path,parent:_})]).then(([P,Y])=>K(P,Y));else return K(this._def.left._parseSync({data:_.data,path:_.path,parent:_}),this._def.right._parseSync({data:_.data,path:_.path,parent:_}))}}V4.create=($,q,_)=>{return new V4({left:$,right:q,typeName:m$.ZodIntersection,...v6(_)})};class F8 extends T6{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==n$.array)return t$(_,{code:c$.invalid_type,expected:n$.array,received:_.parsedType}),q6;if(_.data.length<this._def.items.length)return t$(_,{code:c$.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q6;if(!this._def.rest&&_.data.length>this._def.items.length)t$(_,{code:c$.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),q.dirty();let P=[..._.data].map((Y,O)=>{let z=this._def.items[O]||this._def.rest;if(!z)return null;return z._parse(new g8(_,Y,_.path,O))}).filter((Y)=>!!Y);if(_.common.async)return Promise.all(P).then((Y)=>{return kq.mergeArray(q,Y)});else return kq.mergeArray(q,P)}get items(){return this._def.items}rest($){return new F8({...this._def,rest:$})}}F8.create=($,q)=>{if(!Array.isArray($))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new F8({items:$,typeName:m$.ZodTuple,rest:null,...v6(q)})};class M7 extends T6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==n$.object)return t$(_,{code:c$.invalid_type,expected:n$.object,received:_.parsedType}),q6;let K=[],P=this._def.keyType,Y=this._def.valueType;for(let O in _.data)K.push({key:P._parse(new g8(_,O,_.path,O)),value:Y._parse(new g8(_,_.data[O],_.path,O)),alwaysSet:O in _.data});if(_.common.async)return kq.mergeObjectAsync(q,K);else return kq.mergeObjectSync(q,K)}get element(){return this._def.valueType}static create($,q,_){if(q instanceof T6)return new M7({keyType:$,valueType:q,typeName:m$.ZodRecord,...v6(_)});return new M7({keyType:D8.create(),valueType:$,typeName:m$.ZodRecord,...v6(q)})}}class N7 extends T6{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==n$.map)return t$(_,{code:c$.invalid_type,expected:n$.map,received:_.parsedType}),q6;let K=this._def.keyType,P=this._def.valueType,Y=[..._.data.entries()].map(([O,z],T)=>{return{key:K._parse(new g8(_,O,_.path,[T,"key"])),value:P._parse(new g8(_,z,_.path,[T,"value"]))}});if(_.common.async){let O=new Map;return Promise.resolve().then(async()=>{for(let z of Y){let T=await z.key,H=await z.value;if(T.status==="aborted"||H.status==="aborted")return q6;if(T.status==="dirty"||H.status==="dirty")q.dirty();O.set(T.value,H.value)}return{status:q.value,value:O}})}else{let O=new Map;for(let z of Y){let{key:T,value:H}=z;if(T.status==="aborted"||H.status==="aborted")return q6;if(T.status==="dirty"||H.status==="dirty")q.dirty();O.set(T.value,H.value)}return{status:q.value,value:O}}}}N7.create=($,q,_)=>{return new N7({valueType:q,keyType:$,typeName:m$.ZodMap,...v6(_)})};class NK extends T6{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.parsedType!==n$.set)return t$(_,{code:c$.invalid_type,expected:n$.set,received:_.parsedType}),q6;let K=this._def;if(K.minSize!==null){if(_.data.size<K.minSize.value)t$(_,{code:c$.too_small,minimum:K.minSize.value,type:"set",inclusive:!0,exact:!1,message:K.minSize.message}),q.dirty()}if(K.maxSize!==null){if(_.data.size>K.maxSize.value)t$(_,{code:c$.too_big,maximum:K.maxSize.value,type:"set",inclusive:!0,exact:!1,message:K.maxSize.message}),q.dirty()}let P=this._def.valueType;function Y(z){let T=new Set;for(let H of z){if(H.status==="aborted")return q6;if(H.status==="dirty")q.dirty();T.add(H.value)}return{status:q.value,value:T}}let O=[..._.data.values()].map((z,T)=>P._parse(new g8(_,z,_.path,T)));if(_.common.async)return Promise.all(O).then((z)=>Y(z));else return Y(O)}min($,q){return new NK({...this._def,minSize:{value:$,message:s$.toString(q)}})}max($,q){return new NK({...this._def,maxSize:{value:$,message:s$.toString(q)}})}size($,q){return this.min($,q).max($,q)}nonempty($){return this.min(1,$)}}NK.create=($,q)=>{return new NK({valueType:$,minSize:null,maxSize:null,typeName:m$.ZodSet,...v6(q)})};class Z4 extends T6{constructor(){super(...arguments);this.validate=this.implement}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==n$.function)return t$(q,{code:c$.invalid_type,expected:n$.function,received:q.parsedType}),q6;function _(O,z){return G7({data:O,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,T4(),T_].filter((T)=>!!T),issueData:{code:c$.invalid_arguments,argumentsError:z}})}function K(O,z){return G7({data:O,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,T4(),T_].filter((T)=>!!T),issueData:{code:c$.invalid_return_type,returnTypeError:z}})}let P={errorMap:q.common.contextualErrorMap},Y=q.data;if(this._def.returns instanceof CK){let O=this;return Rq(async function(...z){let T=new aq([]),H=await O._def.args.parseAsync(z,P).catch((k)=>{throw T.addIssue(_(z,k)),T}),f=await Reflect.apply(Y,this,H);return await O._def.returns._def.type.parseAsync(f,P).catch((k)=>{throw T.addIssue(K(f,k)),T})})}else{let O=this;return Rq(function(...z){let T=O._def.args.safeParse(z,P);if(!T.success)throw new aq([_(z,T.error)]);let H=Reflect.apply(Y,this,T.data),f=O._def.returns.safeParse(H,P);if(!f.success)throw new aq([K(H,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...$){return new Z4({...this._def,args:F8.create($).rest(U_.create())})}returns($){return new Z4({...this._def,returns:$})}implement($){return this.parse($)}strictImplement($){return this.parse($)}static create($,q,_){return new Z4({args:$?$:F8.create([]).rest(U_.create()),returns:q||U_.create(),typeName:m$.ZodFunction,...v6(_)})}}class S4 extends T6{get schema(){return this._def.getter()}_parse($){let{ctx:q}=this._processInputParams($);return this._def.getter()._parse({data:q.data,path:q.path,parent:q})}}S4.create=($,q)=>{return new S4({getter:$,typeName:m$.ZodLazy,...v6(q)})};class M4 extends T6{_parse($){if($.data!==this._def.value){let q=this._getOrReturnCtx($);return t$(q,{received:q.data,code:c$.invalid_literal,expected:this._def.value}),q6}return{status:"valid",value:$.data}}get value(){return this._def.value}}M4.create=($,q)=>{return new M4({value:$,typeName:m$.ZodLiteral,...v6(q)})};function wk($,q){return new a_({values:$,typeName:m$.ZodEnum,...v6(q)})}class a_ extends T6{_parse($){if(typeof $.data!=="string"){let q=this._getOrReturnCtx($),_=this._def.values;return t$(q,{expected:A6.joinValues(_),received:q.parsedType,code:c$.invalid_type}),q6}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has($.data)){let q=this._getOrReturnCtx($),_=this._def.values;return t$(q,{received:q.data,code:c$.invalid_enum_value,options:_}),q6}return Rq($.data)}get options(){return this._def.values}get enum(){let $={};for(let q of this._def.values)$[q]=q;return $}get Values(){let $={};for(let q of this._def.values)$[q]=q;return $}get Enum(){let $={};for(let q of this._def.values)$[q]=q;return $}extract($,q=this._def){return a_.create($,{...this._def,...q})}exclude($,q=this._def){return a_.create(this.options.filter((_)=>!$.includes(_)),{...this._def,...q})}}a_.create=wk;class N4 extends T6{_parse($){let q=A6.getValidEnumValues(this._def.values),_=this._getOrReturnCtx($);if(_.parsedType!==n$.string&&_.parsedType!==n$.number){let K=A6.objectValues(q);return t$(_,{expected:A6.joinValues(K),received:_.parsedType,code:c$.invalid_type}),q6}if(!this._cache)this._cache=new Set(A6.getValidEnumValues(this._def.values));if(!this._cache.has($.data)){let K=A6.objectValues(q);return t$(_,{received:_.data,code:c$.invalid_enum_value,options:K}),q6}return Rq($.data)}get enum(){return this._def.values}}N4.create=($,q)=>{return new N4({values:$,typeName:m$.ZodNativeEnum,...v6(q)})};class CK extends T6{unwrap(){return this._def.type}_parse($){let{ctx:q}=this._processInputParams($);if(q.parsedType!==n$.promise&&q.common.async===!1)return t$(q,{code:c$.invalid_type,expected:n$.promise,received:q.parsedType}),q6;let _=q.parsedType===n$.promise?q.data:Promise.resolve(q.data);return Rq(_.then((K)=>{return this._def.type.parseAsync(K,{path:q.path,errorMap:q.common.contextualErrorMap})}))}}CK.create=($,q)=>{return new CK({type:$,typeName:m$.ZodPromise,...v6(q)})};class y8 extends T6{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===m$.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse($){let{status:q,ctx:_}=this._processInputParams($),K=this._def.effect||null,P={addIssue:(Y)=>{if(t$(_,Y),Y.fatal)q.abort();else q.dirty()},get path(){return _.path}};if(P.addIssue=P.addIssue.bind(P),K.type==="preprocess"){let Y=K.transform(_.data,P);if(_.common.async)return Promise.resolve(Y).then(async(O)=>{if(q.value==="aborted")return q6;let z=await this._def.schema._parseAsync({data:O,path:_.path,parent:_});if(z.status==="aborted")return q6;if(z.status==="dirty")return VK(z.value);if(q.value==="dirty")return VK(z.value);return z});else{if(q.value==="aborted")return q6;let O=this._def.schema._parseSync({data:Y,path:_.path,parent:_});if(O.status==="aborted")return q6;if(O.status==="dirty")return VK(O.value);if(q.value==="dirty")return VK(O.value);return O}}if(K.type==="refinement"){let Y=(O)=>{let z=K.refinement(O,P);if(_.common.async)return Promise.resolve(z);if(z instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return O};if(_.common.async===!1){let O=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(O.status==="aborted")return q6;if(O.status==="dirty")q.dirty();return Y(O.value),{status:q.value,value:O.value}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((O)=>{if(O.status==="aborted")return q6;if(O.status==="dirty")q.dirty();return Y(O.value).then(()=>{return{status:q.value,value:O.value}})})}if(K.type==="transform")if(_.common.async===!1){let Y=this._def.schema._parseSync({data:_.data,path:_.path,parent:_});if(!t_(Y))return q6;let O=K.transform(Y.value,P);if(O instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:q.value,value:O}}else return this._def.schema._parseAsync({data:_.data,path:_.path,parent:_}).then((Y)=>{if(!t_(Y))return q6;return Promise.resolve(K.transform(Y.value,P)).then((O)=>({status:q.value,value:O}))});A6.assertNever(K)}}y8.create=($,q,_)=>{return new y8({schema:$,typeName:m$.ZodEffects,effect:q,...v6(_)})};y8.createWithPreprocess=($,q,_)=>{return new y8({schema:q,effect:{type:"preprocess",transform:$},typeName:m$.ZodEffects,...v6(_)})};class b8 extends T6{_parse($){if(this._getType($)===n$.undefined)return Rq(void 0);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}b8.create=($,q)=>{return new b8({innerType:$,typeName:m$.ZodOptional,...v6(q)})};class f_ extends T6{_parse($){if(this._getType($)===n$.null)return Rq(null);return this._def.innerType._parse($)}unwrap(){return this._def.innerType}}f_.create=($,q)=>{return new f_({innerType:$,typeName:m$.ZodNullable,...v6(q)})};class C4 extends T6{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;if(q.parsedType===n$.undefined)_=this._def.defaultValue();return this._def.innerType._parse({data:_,path:q.path,parent:q})}removeDefault(){return this._def.innerType}}C4.create=($,q)=>{return new C4({innerType:$,typeName:m$.ZodDefault,defaultValue:typeof q.default==="function"?q.default:()=>q.default,...v6(q)})};class E4 extends T6{_parse($){let{ctx:q}=this._processInputParams($),_={...q,common:{...q.common,issues:[]}},K=this._def.innerType._parse({data:_.data,path:_.path,parent:{..._}});if(w4(K))return K.then((P)=>{return{status:"valid",value:P.status==="valid"?P.value:this._def.catchValue({get error(){return new aq(_.common.issues)},input:_.data})}});else return{status:"valid",value:K.status==="valid"?K.value:this._def.catchValue({get error(){return new aq(_.common.issues)},input:_.data})}}removeCatch(){return this._def.innerType}}E4.create=($,q)=>{return new E4({innerType:$,typeName:m$.ZodCatch,catchValue:typeof q.catch==="function"?q.catch:()=>q.catch,...v6(q)})};class C7 extends T6{_parse($){if(this._getType($)!==n$.nan){let _=this._getOrReturnCtx($);return t$(_,{code:c$.invalid_type,expected:n$.nan,received:_.parsedType}),q6}return{status:"valid",value:$.data}}}C7.create=($)=>{return new C7({typeName:m$.ZodNaN,...v6($)})};var Qg=Symbol("zod_brand");class N5 extends T6{_parse($){let{ctx:q}=this._processInputParams($),_=q.data;return this._def.type._parse({data:_,path:q.path,parent:q})}unwrap(){return this._def.type}}class E7 extends T6{_parse($){let{status:q,ctx:_}=this._processInputParams($);if(_.common.async)return(async()=>{let P=await this._def.in._parseAsync({data:_.data,path:_.path,parent:_});if(P.status==="aborted")return q6;if(P.status==="dirty")return q.dirty(),VK(P.value);else return this._def.out._parseAsync({data:P.value,path:_.path,parent:_})})();else{let K=this._def.in._parseSync({data:_.data,path:_.path,parent:_});if(K.status==="aborted")return q6;if(K.status==="dirty")return q.dirty(),{status:"dirty",value:K.value};else return this._def.out._parseSync({data:K.value,path:_.path,parent:_})}}static create($,q){return new E7({in:$,out:q,typeName:m$.ZodPipeline})}}class h4 extends T6{_parse($){let q=this._def.innerType._parse($),_=(K)=>{if(t_(K))K.value=Object.freeze(K.value);return K};return w4(q)?q.then((K)=>_(K)):_(q)}unwrap(){return this._def.innerType}}h4.create=($,q)=>{return new h4({innerType:$,typeName:m$.ZodReadonly,...v6(q)})};function Wk($,q){let _=typeof $==="function"?$(q):typeof $==="string"?{message:$}:$;return typeof _==="string"?{message:_}:_}function fk($,q={},_){if($)return MK.create().superRefine((K,P)=>{let Y=$(K);if(Y instanceof Promise)return Y.then((O)=>{if(!O){let z=Wk(q,K),T=z.fatal??_??!0;P.addIssue({code:"custom",...z,fatal:T})}});if(!Y){let O=Wk(q,K),z=O.fatal??_??!0;P.addIssue({code:"custom",...O,fatal:z})}return});return MK.create()}var ag={object:u6.lazycreate},m$;(function($){$.ZodString="ZodString",$.ZodNumber="ZodNumber",$.ZodNaN="ZodNaN",$.ZodBigInt="ZodBigInt",$.ZodBoolean="ZodBoolean",$.ZodDate="ZodDate",$.ZodSymbol="ZodSymbol",$.ZodUndefined="ZodUndefined",$.ZodNull="ZodNull",$.ZodAny="ZodAny",$.ZodUnknown="ZodUnknown",$.ZodNever="ZodNever",$.ZodVoid="ZodVoid",$.ZodArray="ZodArray",$.ZodObject="ZodObject",$.ZodUnion="ZodUnion",$.ZodDiscriminatedUnion="ZodDiscriminatedUnion",$.ZodIntersection="ZodIntersection",$.ZodTuple="ZodTuple",$.ZodRecord="ZodRecord",$.ZodMap="ZodMap",$.ZodSet="ZodSet",$.ZodFunction="ZodFunction",$.ZodLazy="ZodLazy",$.ZodLiteral="ZodLiteral",$.ZodEnum="ZodEnum",$.ZodEffects="ZodEffects",$.ZodNativeEnum="ZodNativeEnum",$.ZodOptional="ZodOptional",$.ZodNullable="ZodNullable",$.ZodDefault="ZodDefault",$.ZodCatch="ZodCatch",$.ZodPromise="ZodPromise",$.ZodBranded="ZodBranded",$.ZodPipeline="ZodPipeline",$.ZodReadonly="ZodReadonly"})(m$||(m$={}));var eg=($,q={message:`Input not instance of ${$.name}`})=>fk((_)=>_ instanceof $,q),Zk=D8.create,Xk=F_.create,sg=C7.create,$y=Q_.create,Ak=X4.create,qy=SK.create,_y=V7.create,Ky=A4.create,Py=k4.create,Yy=MK.create,Oy=U_.create,jy=U8.create,vy=S7.create,zy=L8.create,Wy=u6.create,Jy=u6.strictCreate,Hy=G4.create,Ty=M5.create,wy=V4.create,fy=F8.create,Zy=M7.create,Xy=N7.create,Ay=NK.create,ky=Z4.create,Gy=S4.create,Vy=M4.create,Sy=a_.create,My=N4.create,Ny=CK.create,Cy=y8.create,Ey=b8.create,hy=f_.create,Ry=y8.createWithPreprocess,Iy=E7.create,Dy=()=>Zk().optional(),Ly=()=>Xk().optional(),by=()=>Ak().optional(),gy={string:($)=>D8.create({...$,coerce:!0}),number:($)=>F_.create({...$,coerce:!0}),boolean:($)=>X4.create({...$,coerce:!0}),bigint:($)=>Q_.create({...$,coerce:!0}),date:($)=>SK.create({...$,coerce:!0})};var yy=q6;function kz($,q){let _={type:"array"};if($.type?._def&&$.type?._def?.typeName!==m$.ZodAny)_.items=_6($.type._def,{...q,currentPath:[...q.currentPath,"items"]});if($.minLength)G6(_,"minItems",$.minLength.value,$.minLength.message,q);if($.maxLength)G6(_,"maxItems",$.maxLength.value,$.maxLength.message,q);if($.exactLength)G6(_,"minItems",$.exactLength.value,$.exactLength.message,q),G6(_,"maxItems",$.exactLength.value,$.exactLength.message,q);return _}function Gz($,q){let _={type:"integer",format:"int64"};if(!$.checks)return _;for(let K of $.checks)switch(K.kind){case"min":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"minimum",K.value,K.message,q);else G6(_,"exclusiveMinimum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMinimum=!0;G6(_,"minimum",K.value,K.message,q)}break;case"max":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"maximum",K.value,K.message,q);else G6(_,"exclusiveMaximum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMaximum=!0;G6(_,"maximum",K.value,K.message,q)}break;case"multipleOf":G6(_,"multipleOf",K.value,K.message,q);break}return _}function Vz(){return{type:"boolean"}}function h7($,q){return _6($.type._def,q)}var Sz=($,q)=>{return _6($.innerType._def,q)};function C5($,q,_){let K=_??q.dateStrategy;if(Array.isArray(K))return{anyOf:K.map((P)=>C5($,q,P))};switch(K){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return uy($,q)}}var uy=($,q)=>{let _={type:"integer",format:"unix-time"};if(q.target==="openApi3")return _;for(let K of $.checks)switch(K.kind){case"min":G6(_,"minimum",K.value,K.message,q);break;case"max":G6(_,"maximum",K.value,K.message,q);break}return _};function Mz($,q){return{..._6($.innerType._def,q),default:$.defaultValue()}}function Nz($,q){return q.effectStrategy==="input"?_6($.schema._def,q):D6(q)}function Cz($){return{type:"string",enum:Array.from($.values)}}var xy=($)=>{if("type"in $&&$.type==="string")return!1;return"allOf"in $};function Ez($,q){let _=[_6($.left._def,{...q,currentPath:[...q.currentPath,"allOf","0"]}),_6($.right._def,{...q,currentPath:[...q.currentPath,"allOf","1"]})].filter((Y)=>!!Y),K=q.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,P=[];return _.forEach((Y)=>{if(xy(Y)){if(P.push(...Y.allOf),Y.unevaluatedProperties===void 0)K=void 0}else{let O=Y;if("additionalProperties"in Y&&Y.additionalProperties===!1){let{additionalProperties:z,...T}=Y;O=T}else K=void 0;P.push(O)}}),P.length?{allOf:P,...K}:void 0}function hz($,q){let _=typeof $.value;if(_!=="bigint"&&_!=="number"&&_!=="boolean"&&_!=="string")return{type:Array.isArray($.value)?"array":"object"};if(q.target==="openApi3")return{type:_==="bigint"?"integer":_,enum:[$.value]};return{type:_==="bigint"?"integer":_,const:$.value}}var Rz=void 0,A8={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>{if(Rz===void 0)Rz=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u");return Rz},uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function R7($,q){let _={type:"string"};if($.checks)for(let K of $.checks)switch(K.kind){case"min":G6(_,"minLength",typeof _.minLength==="number"?Math.max(_.minLength,K.value):K.value,K.message,q);break;case"max":G6(_,"maxLength",typeof _.maxLength==="number"?Math.min(_.maxLength,K.value):K.value,K.message,q);break;case"email":switch(q.emailStrategy){case"format:email":u8(_,"email",K.message,q);break;case"format:idn-email":u8(_,"idn-email",K.message,q);break;case"pattern:zod":uq(_,A8.email,K.message,q);break}break;case"url":u8(_,"uri",K.message,q);break;case"uuid":u8(_,"uuid",K.message,q);break;case"regex":uq(_,K.regex,K.message,q);break;case"cuid":uq(_,A8.cuid,K.message,q);break;case"cuid2":uq(_,A8.cuid2,K.message,q);break;case"startsWith":uq(_,RegExp(`^${Iz(K.value,q)}`),K.message,q);break;case"endsWith":uq(_,RegExp(`${Iz(K.value,q)}$`),K.message,q);break;case"datetime":u8(_,"date-time",K.message,q);break;case"date":u8(_,"date",K.message,q);break;case"time":u8(_,"time",K.message,q);break;case"duration":u8(_,"duration",K.message,q);break;case"length":G6(_,"minLength",typeof _.minLength==="number"?Math.max(_.minLength,K.value):K.value,K.message,q),G6(_,"maxLength",typeof _.maxLength==="number"?Math.min(_.maxLength,K.value):K.value,K.message,q);break;case"includes":uq(_,RegExp(Iz(K.value,q)),K.message,q);break;case"ip":if(K.version!=="v6")u8(_,"ipv4",K.message,q);if(K.version!=="v4")u8(_,"ipv6",K.message,q);break;case"base64url":uq(_,A8.base64url,K.message,q);break;case"jwt":uq(_,A8.jwt,K.message,q);break;case"cidr":if(K.version!=="v6")uq(_,A8.ipv4Cidr,K.message,q);if(K.version!=="v4")uq(_,A8.ipv6Cidr,K.message,q);break;case"emoji":uq(_,A8.emoji(),K.message,q);break;case"ulid":uq(_,A8.ulid,K.message,q);break;case"base64":switch(q.base64Strategy){case"format:binary":u8(_,"binary",K.message,q);break;case"contentEncoding:base64":G6(_,"contentEncoding","base64",K.message,q);break;case"pattern:zod":uq(_,A8.base64,K.message,q);break}break;case"nanoid":uq(_,A8.nanoid,K.message,q);break;case"toLowerCase":case"toUpperCase":case"trim":break;default:((P)=>{})(K)}return _}function Iz($,q){return q.patternStrategy==="escape"?cy($):$}var py=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function cy($){let q="";for(let _=0;_<$.length;_++){if(!py.has($[_]))q+="\\";q+=$[_]}return q}function u8($,q,_,K){if($.format||$.anyOf?.some((P)=>P.format)){if(!$.anyOf)$.anyOf=[];if($.format){if($.anyOf.push({format:$.format,...$.errorMessage&&K.errorMessages&&{errorMessage:{format:$.errorMessage.format}}}),delete $.format,$.errorMessage){if(delete $.errorMessage.format,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.anyOf.push({format:q,..._&&K.errorMessages&&{errorMessage:{format:_}}})}else G6($,"format",q,_,K)}function uq($,q,_,K){if($.pattern||$.allOf?.some((P)=>P.pattern)){if(!$.allOf)$.allOf=[];if($.pattern){if($.allOf.push({pattern:$.pattern,...$.errorMessage&&K.errorMessages&&{errorMessage:{pattern:$.errorMessage.pattern}}}),delete $.pattern,$.errorMessage){if(delete $.errorMessage.pattern,Object.keys($.errorMessage).length===0)delete $.errorMessage}}$.allOf.push({pattern:kk(q,K),..._&&K.errorMessages&&{errorMessage:{pattern:_}}})}else G6($,"pattern",kk(q,K),_,K)}function kk($,q){if(!q.applyRegexFlags||!$.flags)return $.source;let _={i:$.flags.includes("i"),m:$.flags.includes("m"),s:$.flags.includes("s")},K=_.i?$.source.toLowerCase():$.source,P="",Y=!1,O=!1,z=!1;for(let T=0;T<K.length;T++){if(Y){P+=K[T],Y=!1;continue}if(_.i){if(O){if(K[T].match(/[a-z]/)){if(z)P+=K[T],P+=`${K[T-2]}-${K[T]}`.toUpperCase(),z=!1;else if(K[T+1]==="-"&&K[T+2]?.match(/[a-z]/))P+=K[T],z=!0;else P+=`${K[T]}${K[T].toUpperCase()}`;continue}}else if(K[T].match(/[a-z]/)){P+=`[${K[T]}${K[T].toUpperCase()}]`;continue}}if(_.m){if(K[T]==="^"){P+=`(^|(?<=[\r
201
201
  ]))`;continue}else if(K[T]==="$"){P+=`($|(?=[\r
202
202
  ]))`;continue}}if(_.s&&K[T]==="."){P+=O?`${K[T]}\r
203
203
  `:`[${K[T]}\r
204
- ]`;continue}if(P+=K[T],K[T]==="\\")Y=!0;else if(O&&K[T]==="]")O=!1;else if(!O&&K[T]==="[")O=!0}try{new RegExp(P)}catch{return console.warn(`Could not convert regex pattern at ${q.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return P}function I7($,q){if(q.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(q.target==="openApi3"&&$.keyType?._def.typeName===m$.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((K,P)=>({...K,[P]:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"properties",P]})??D6(q)}),{}),additionalProperties:q.rejectedAdditionalProperties};let _={type:"object",additionalProperties:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]})??q.allowedAdditionalProperties};if(q.target==="openApi3")return _;if($.keyType?._def.typeName===m$.ZodString&&$.keyType._def.checks?.length){let{type:K,...P}=R7($.keyType._def,q);return{..._,propertyNames:P}}else if($.keyType?._def.typeName===m$.ZodEnum)return{..._,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===m$.ZodBranded&&$.keyType._def.type._def.typeName===m$.ZodString&&$.keyType._def.type._def.checks?.length){let{type:K,...P}=h7($.keyType._def,q);return{..._,propertyNames:P}}return _}function Dz($,q){if(q.mapStrategy==="record")return I7($,q);let _=_6($.keyType._def,{...q,currentPath:[...q.currentPath,"items","items","0"]})||D6(q),K=_6($.valueType._def,{...q,currentPath:[...q.currentPath,"items","items","1"]})||D6(q);return{type:"array",maxItems:125,items:{type:"array",items:[_,K],minItems:2,maxItems:2}}}function Lz($){let q=$.values,K=Object.keys($.values).filter((Y)=>{return typeof q[q[Y]]!=="number"}).map((Y)=>q[Y]),P=Array.from(new Set(K.map((Y)=>typeof Y)));return{type:P.length===1?P[0]==="string"?"string":"number":["string","number"],enum:K}}function bz($){return $.target==="openAi"?void 0:{not:D6({...$,currentPath:[...$.currentPath,"not"]})}}function gz($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var R4={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function yz($,q){if(q.target==="openApi3")return Gk($,q);let _=$.options instanceof Map?Array.from($.options.values()):$.options;if(_.every((K)=>(K._def.typeName in R4)&&(!K._def.checks||!K._def.checks.length))){let K=_.reduce((P,Y)=>{let O=R4[Y._def.typeName];return O&&!P.includes(O)?[...P,O]:P},[]);return{type:K.length>1?K:K[0]}}else if(_.every((K)=>K._def.typeName==="ZodLiteral"&&!K.description)){let K=_.reduce((P,Y)=>{let O=typeof Y._def.value;switch(O){case"string":case"number":case"boolean":return[...P,O];case"bigint":return[...P,"integer"];case"object":if(Y._def.value===null)return[...P,"null"];return P;case"symbol":case"undefined":case"function":default:return P}},[]);if(K.length===_.length){let P=K.filter((Y,O,z)=>z.indexOf(Y)===O);return{type:P.length>1?P:P[0],enum:_.reduce((Y,O)=>{return Y.includes(O._def.value)?Y:[...Y,O._def.value]},[])}}}else if(_.every((K)=>K._def.typeName==="ZodEnum"))return{type:"string",enum:_.reduce((K,P)=>[...K,...P._def.values.filter((Y)=>!K.includes(Y))],[])};return Gk($,q)}var Gk=($,q)=>{let _=($.options instanceof Map?Array.from($.options.values()):$.options).map((K,P)=>_6(K._def,{...q,currentPath:[...q.currentPath,"anyOf",`${P}`]})).filter((K)=>!!K&&(!q.strictUnions||typeof K==="object"&&Object.keys(K).length>0));return _.length?{anyOf:_}:void 0};function uz($,q){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(q.target==="openApi3")return{type:R4[$.innerType._def.typeName],nullable:!0};return{type:[R4[$.innerType._def.typeName],"null"]}}if(q.target==="openApi3"){let K=_6($.innerType._def,{...q,currentPath:[...q.currentPath]});if(K&&"$ref"in K)return{allOf:[K],nullable:!0};return K&&{...K,nullable:!0}}let _=_6($.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","0"]});return _&&{anyOf:[_,{type:"null"}]}}function xz($,q){let _={type:"number"};if(!$.checks)return _;for(let K of $.checks)switch(K.kind){case"int":_.type="integer",G5(_,"type",K.message,q);break;case"min":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"minimum",K.value,K.message,q);else G6(_,"exclusiveMinimum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMinimum=!0;G6(_,"minimum",K.value,K.message,q)}break;case"max":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"maximum",K.value,K.message,q);else G6(_,"exclusiveMaximum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMaximum=!0;G6(_,"maximum",K.value,K.message,q)}break;case"multipleOf":G6(_,"multipleOf",K.value,K.message,q);break}return _}function pz($,q){let _=q.target==="openAi",K={type:"object",properties:{}},P=[],Y=$.shape();for(let z in Y){let T=Y[z];if(T===void 0||T._def===void 0)continue;let H=dy(T);if(H&&_){if(T._def.typeName==="ZodOptional")T=T._def.innerType;if(!T.isNullable())T=T.nullable();H=!1}let f=_6(T._def,{...q,currentPath:[...q.currentPath,"properties",z],propertyPath:[...q.currentPath,"properties",z]});if(f===void 0)continue;if(K.properties[z]=f,!H)P.push(z)}if(P.length)K.required=P;let O=my($,q);if(O!==void 0)K.additionalProperties=O;return K}function my($,q){if($.catchall._def.typeName!=="ZodNever")return _6($.catchall._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return q.allowedAdditionalProperties;case"strict":return q.rejectedAdditionalProperties;case"strip":return q.removeAdditionalStrategy==="strict"?q.allowedAdditionalProperties:q.rejectedAdditionalProperties}}function dy($){try{return $.isOptional()}catch{return!0}}var cz=($,q)=>{if(q.currentPath.toString()===q.propertyPath?.toString())return _6($.innerType._def,q);let _=_6($.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","1"]});return _?{anyOf:[{not:D6(q)},_]}:D6(q)};var mz=($,q)=>{if(q.pipeStrategy==="input")return _6($.in._def,q);else if(q.pipeStrategy==="output")return _6($.out._def,q);let _=_6($.in._def,{...q,currentPath:[...q.currentPath,"allOf","0"]}),K=_6($.out._def,{...q,currentPath:[...q.currentPath,"allOf",_?"1":"0"]});return{allOf:[_,K].filter((P)=>P!==void 0)}};function dz($,q){return _6($.type._def,q)}function lz($,q){let K={type:"array",uniqueItems:!0,items:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"items"]})};if($.minSize)G6(K,"minItems",$.minSize.value,$.minSize.message,q);if($.maxSize)G6(K,"maxItems",$.maxSize.value,$.maxSize.message,q);return K}function rz($,q){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((_,K)=>_6(_._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((_,K)=>K===void 0?_:[..._,K],[]),additionalItems:_6($.rest._def,{...q,currentPath:[...q.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((_,K)=>_6(_._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((_,K)=>K===void 0?_:[..._,K],[])}}function oz($){return{not:D6($)}}function nz($){return D6($)}var iz=($,q)=>{return _6($.innerType._def,q)};var Bz=($,q,_)=>{switch(q){case m$.ZodString:return R7($,_);case m$.ZodNumber:return xz($,_);case m$.ZodObject:return pz($,_);case m$.ZodBigInt:return Gz($,_);case m$.ZodBoolean:return Vz();case m$.ZodDate:return C5($,_);case m$.ZodUndefined:return oz(_);case m$.ZodNull:return gz(_);case m$.ZodArray:return kz($,_);case m$.ZodUnion:case m$.ZodDiscriminatedUnion:return yz($,_);case m$.ZodIntersection:return Ez($,_);case m$.ZodTuple:return rz($,_);case m$.ZodRecord:return I7($,_);case m$.ZodLiteral:return hz($,_);case m$.ZodEnum:return Cz($);case m$.ZodNativeEnum:return Lz($);case m$.ZodNullable:return uz($,_);case m$.ZodOptional:return cz($,_);case m$.ZodMap:return Dz($,_);case m$.ZodSet:return lz($,_);case m$.ZodLazy:return()=>$.getter()._def;case m$.ZodPromise:return dz($,_);case m$.ZodNaN:case m$.ZodNever:return bz(_);case m$.ZodEffects:return Nz($,_);case m$.ZodAny:return D6(_);case m$.ZodUnknown:return nz(_);case m$.ZodDefault:return Mz($,_);case m$.ZodBranded:return h7($,_);case m$.ZodReadonly:return iz($,_);case m$.ZodCatch:return Sz($,_);case m$.ZodPipeline:return mz($,_);case m$.ZodFunction:case m$.ZodVoid:case m$.ZodSymbol:return;default:return((K)=>{return})(q)}};function _6($,q,_=!1){let K=q.seen.get($);if(q.override){let z=q.override?.($,q,K,_);if(z!==Tz)return z}if(K&&!_){let z=ly(K,q);if(z!==void 0)return z}let P={def:$,path:q.currentPath,jsonSchema:void 0};q.seen.set($,P);let Y=Bz($,$.typeName,q),O=typeof Y==="function"?_6(Y(),q):Y;if(O)ry($,q,O);if(q.postProcess){let z=q.postProcess(O,$,q);return P.jsonSchema=O,z}return P.jsonSchema=O,O}var ly=($,q)=>{switch(q.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:k7(q.currentPath,$.path)};case"none":case"seen":if($.path.length<q.currentPath.length&&$.path.every((_,K)=>q.currentPath[K]===_))return console.warn(`Recursive reference detected at ${q.currentPath.join("/")}! Defaulting to any`),D6(q);return q.$refStrategy==="seen"?D6(q):void 0}},ry=($,q,_)=>{if($.description){if(_.description=$.description,q.markdownDescription)_.markdownDescription=$.description}return _};var tz=($,q)=>{let _=fz(q),K=typeof q==="object"&&q.definitions?Object.entries(q.definitions).reduce((T,[H,f])=>({...T,[H]:_6(f._def,{..._,currentPath:[..._.basePath,_.definitionPath,H]},!0)??D6(_)}),{}):void 0,P=typeof q==="string"?q:q?.nameStrategy==="title"?void 0:q?.name,Y=_6($._def,P===void 0?_:{..._,currentPath:[..._.basePath,_.definitionPath,P]},!1)??D6(_),O=typeof q==="object"&&q.name!==void 0&&q.nameStrategy==="title"?q.name:void 0;if(O!==void 0)Y.title=O;if(_.flags.hasReferencedOpenAiAnyType){if(!K)K={};if(!K[_.openAiAnyTypeName])K[_.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:_.$refStrategy==="relative"?"1":[..._.basePath,_.definitionPath,_.openAiAnyTypeName].join("/")}}}let z=P===void 0?K?{...Y,[_.definitionPath]:K}:Y:{$ref:[..._.$refStrategy==="relative"?[]:_.basePath,_.definitionPath,P].join("/"),[_.definitionPath]:{...K,[P]:Y}};if(_.target==="jsonSchema7")z.$schema="http://json-schema.org/draft-07/schema#";else if(_.target==="jsonSchema2019-09"||_.target==="openAi")z.$schema="https://json-schema.org/draft/2019-09/schema#";if(_.target==="openAi"&&(("anyOf"in z)||("oneOf"in z)||("allOf"in z)||("type"in z)&&Array.isArray(z.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return z};function e_($,q){let _=typeof $;if(_!==typeof q)return!1;if(Array.isArray($)){if(!Array.isArray(q))return!1;let K=$.length;if(K!==q.length)return!1;for(let P=0;P<K;P++)if(!e_($[P],q[P]))return!1;return!0}if(_==="object"){if(!$||!q)return $===q;let K=Object.keys($),P=Object.keys(q);if(K.length!==P.length)return!1;for(let O of K)if(!e_($[O],q[O]))return!1;return!0}return $===q}function O8($){return encodeURI(oy($))}function oy($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}var ny={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},iy={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},By={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},ty=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function x8($,q=Object.create(null),_=ty,K=""){if($&&typeof $==="object"&&!Array.isArray($)){let Y=$.$id||$.id;if(Y){let O=new URL(Y,_.href);if(O.hash.length>1)q[O.href]=$;else if(O.hash="",K==="")_=O;else x8($,q,_)}}else if($!==!0&&$!==!1)return q;let P=_.href+(K?"#"+K:"");if(q[P]!==void 0)throw Error(`Duplicate schema URI "${P}".`);if(q[P]=$,$===!0||$===!1)return q;if($.__absolute_uri__===void 0)Object.defineProperty($,"__absolute_uri__",{enumerable:!1,value:P});if($.$ref&&$.__absolute_ref__===void 0){let Y=new URL($.$ref,_.href);Y.hash=Y.hash,Object.defineProperty($,"__absolute_ref__",{enumerable:!1,value:Y.href})}if($.$recursiveRef&&$.__absolute_recursive_ref__===void 0){let Y=new URL($.$recursiveRef,_.href);Y.hash=Y.hash,Object.defineProperty($,"__absolute_recursive_ref__",{enumerable:!1,value:Y.href})}if($.$anchor){let Y=new URL("#"+$.$anchor,_.href);q[Y.href]=$}for(let Y in $){if(By[Y])continue;let O=`${K}/${O8(Y)}`,z=$[Y];if(Array.isArray(z)){if(ny[Y]){let T=z.length;for(let H=0;H<T;H++)x8(z[H],q,_,`${O}/${H}`)}}else if(iy[Y])for(let T in z)x8(z[T],q,_,`${O}/${O8(T)}`);else x8(z,q,_,O)}return q}var Uy=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Fy=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qy=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,ay=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ey=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,sy=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,$u=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,qu=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,_u=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ku=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Pu=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Yu=($)=>{if($[0]==='"')return!1;let[q,_,...K]=$.split("@");if(!q||!_||K.length!==0||q.length>64||_.length>253)return!1;if(q[0]==="."||q.endsWith(".")||q.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(_)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(q))return!1;return _.split(".").every((P)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(P))},Ou=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ju=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,vu=($)=>$.length>1&&$.length<80&&(/^P\d+([.,]\d+)?W$/.test($)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test($)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test($));function Q8($){return $.test.bind($)}var Uz={date:Vk,time:Sk.bind(void 0,!1),"date-time":Ju,duration:vu,uri:wu,"uri-reference":Q8(ey),"uri-template":Q8(sy),url:Q8($u),email:Yu,hostname:Q8(ay),ipv4:Q8(Ou),ipv6:Q8(ju),regex:Zu,uuid:Q8(qu),"json-pointer":Q8(_u),"json-pointer-uri-fragment":Q8(Ku),"relative-json-pointer":Q8(Pu)};function zu($){return $%4===0&&($%100!==0||$%400===0)}function Vk($){let q=$.match(Uy);if(!q)return!1;let _=+q[1],K=+q[2],P=+q[3];return K>=1&&K<=12&&P>=1&&P<=(K==2&&zu(_)?29:Fy[K])}function Sk($,q){let _=q.match(Qy);if(!_)return!1;let K=+_[1],P=+_[2],Y=+_[3],O=!!_[5];return(K<=23&&P<=59&&Y<=59||K==23&&P==59&&Y==60)&&(!$||O)}var Wu=/t|\s/i;function Ju($){let q=$.split(Wu);return q.length==2&&Vk(q[0])&&Sk(!0,q[1])}var Hu=/\/|:/,Tu=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function wu($){return Hu.test($)&&Tu.test($)}var fu=/[^\\]\\Z/;function Zu($){if(fu.test($))return!1;try{return new RegExp($,"u"),!0}catch(q){return!1}}function Mk($){let q=0,_=$.length,K=0,P;while(K<_)if(q++,P=$.charCodeAt(K++),P>=55296&&P<=56319&&K<_){if(P=$.charCodeAt(K),(P&64512)==56320)K++}return q}function g6($,q,_="2019-09",K=x8(q),P=!0,Y=null,O="#",z="#",T=Object.create(null)){if(q===!0)return{valid:!0,errors:[]};if(q===!1)return{valid:!1,errors:[{instanceLocation:O,keyword:"false",keywordLocation:O,error:"False boolean schema."}]};let H=typeof $,f;switch(H){case"boolean":case"number":case"string":f=H;break;case"object":if($===null)f="null";else if(Array.isArray($))f="array";else f="object";break;default:throw Error(`Instances of "${H}" type are not supported.`)}let{$ref:w,$recursiveRef:k,$recursiveAnchor:S,type:N,const:h,enum:C,required:I,not:D,anyOf:L,allOf:g,oneOf:y,if:c,then:o,else:s,format:F,properties:p,patternProperties:a,additionalProperties:j,unevaluatedProperties:W,minProperties:X,maxProperties:J,propertyNames:Z,dependentRequired:V,dependentSchemas:M,dependencies:A,prefixItems:v,items:G,additionalItems:R,unevaluatedItems:E,contains:b,minContains:x,maxContains:l,minItems:Q,maxItems:f$,uniqueItems:q$,minimum:B,maximum:v$,exclusiveMinimum:e,exclusiveMaximum:P$,multipleOf:o$,minLength:m,maxLength:r,pattern:J$,__absolute_ref__:$$,__absolute_recursive_ref__:_$}=q,O$=[];if(S===!0&&Y===null)Y=q;if(k==="#"){let n=Y===null?K[_$]:Y,H$=`${z}/$recursiveRef`,t=g6($,Y===null?q:Y,_,K,P,n,O,H$,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"$recursiveRef",keywordLocation:H$,error:"A subschema had errors."},...t.errors)}if(w!==void 0){let H$=K[$$||w];if(H$===void 0){let A$=`Unresolved $ref "${w}".`;if($$&&$$!==w)A$+=` Absolute URI "${$$}".`;throw A$+=`
204
+ ]`;continue}if(P+=K[T],K[T]==="\\")Y=!0;else if(O&&K[T]==="]")O=!1;else if(!O&&K[T]==="[")O=!0}try{new RegExp(P)}catch{return console.warn(`Could not convert regex pattern at ${q.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),$.source}return P}function I7($,q){if(q.target==="openAi")console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead.");if(q.target==="openApi3"&&$.keyType?._def.typeName===m$.ZodEnum)return{type:"object",required:$.keyType._def.values,properties:$.keyType._def.values.reduce((K,P)=>({...K,[P]:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"properties",P]})??D6(q)}),{}),additionalProperties:q.rejectedAdditionalProperties};let _={type:"object",additionalProperties:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]})??q.allowedAdditionalProperties};if(q.target==="openApi3")return _;if($.keyType?._def.typeName===m$.ZodString&&$.keyType._def.checks?.length){let{type:K,...P}=R7($.keyType._def,q);return{..._,propertyNames:P}}else if($.keyType?._def.typeName===m$.ZodEnum)return{..._,propertyNames:{enum:$.keyType._def.values}};else if($.keyType?._def.typeName===m$.ZodBranded&&$.keyType._def.type._def.typeName===m$.ZodString&&$.keyType._def.type._def.checks?.length){let{type:K,...P}=h7($.keyType._def,q);return{..._,propertyNames:P}}return _}function Dz($,q){if(q.mapStrategy==="record")return I7($,q);let _=_6($.keyType._def,{...q,currentPath:[...q.currentPath,"items","items","0"]})||D6(q),K=_6($.valueType._def,{...q,currentPath:[...q.currentPath,"items","items","1"]})||D6(q);return{type:"array",maxItems:125,items:{type:"array",items:[_,K],minItems:2,maxItems:2}}}function Lz($){let q=$.values,K=Object.keys($.values).filter((Y)=>{return typeof q[q[Y]]!=="number"}).map((Y)=>q[Y]),P=Array.from(new Set(K.map((Y)=>typeof Y)));return{type:P.length===1?P[0]==="string"?"string":"number":["string","number"],enum:K}}function bz($){return $.target==="openAi"?void 0:{not:D6({...$,currentPath:[...$.currentPath,"not"]})}}function gz($){return $.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var R4={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function yz($,q){if(q.target==="openApi3")return Gk($,q);let _=$.options instanceof Map?Array.from($.options.values()):$.options;if(_.every((K)=>(K._def.typeName in R4)&&(!K._def.checks||!K._def.checks.length))){let K=_.reduce((P,Y)=>{let O=R4[Y._def.typeName];return O&&!P.includes(O)?[...P,O]:P},[]);return{type:K.length>1?K:K[0]}}else if(_.every((K)=>K._def.typeName==="ZodLiteral"&&!K.description)){let K=_.reduce((P,Y)=>{let O=typeof Y._def.value;switch(O){case"string":case"number":case"boolean":return[...P,O];case"bigint":return[...P,"integer"];case"object":if(Y._def.value===null)return[...P,"null"];return P;case"symbol":case"undefined":case"function":default:return P}},[]);if(K.length===_.length){let P=K.filter((Y,O,z)=>z.indexOf(Y)===O);return{type:P.length>1?P:P[0],enum:_.reduce((Y,O)=>{return Y.includes(O._def.value)?Y:[...Y,O._def.value]},[])}}}else if(_.every((K)=>K._def.typeName==="ZodEnum"))return{type:"string",enum:_.reduce((K,P)=>[...K,...P._def.values.filter((Y)=>!K.includes(Y))],[])};return Gk($,q)}var Gk=($,q)=>{let _=($.options instanceof Map?Array.from($.options.values()):$.options).map((K,P)=>_6(K._def,{...q,currentPath:[...q.currentPath,"anyOf",`${P}`]})).filter((K)=>!!K&&(!q.strictUnions||typeof K==="object"&&Object.keys(K).length>0));return _.length?{anyOf:_}:void 0};function uz($,q){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length)){if(q.target==="openApi3")return{type:R4[$.innerType._def.typeName],nullable:!0};return{type:[R4[$.innerType._def.typeName],"null"]}}if(q.target==="openApi3"){let K=_6($.innerType._def,{...q,currentPath:[...q.currentPath]});if(K&&"$ref"in K)return{allOf:[K],nullable:!0};return K&&{...K,nullable:!0}}let _=_6($.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","0"]});return _&&{anyOf:[_,{type:"null"}]}}function xz($,q){let _={type:"number"};if(!$.checks)return _;for(let K of $.checks)switch(K.kind){case"int":_.type="integer",G5(_,"type",K.message,q);break;case"min":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"minimum",K.value,K.message,q);else G6(_,"exclusiveMinimum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMinimum=!0;G6(_,"minimum",K.value,K.message,q)}break;case"max":if(q.target==="jsonSchema7")if(K.inclusive)G6(_,"maximum",K.value,K.message,q);else G6(_,"exclusiveMaximum",K.value,K.message,q);else{if(!K.inclusive)_.exclusiveMaximum=!0;G6(_,"maximum",K.value,K.message,q)}break;case"multipleOf":G6(_,"multipleOf",K.value,K.message,q);break}return _}function pz($,q){let _=q.target==="openAi",K={type:"object",properties:{}},P=[],Y=$.shape();for(let z in Y){let T=Y[z];if(T===void 0||T._def===void 0)continue;let H=dy(T);if(H&&_){if(T._def.typeName==="ZodOptional")T=T._def.innerType;if(!T.isNullable())T=T.nullable();H=!1}let f=_6(T._def,{...q,currentPath:[...q.currentPath,"properties",z],propertyPath:[...q.currentPath,"properties",z]});if(f===void 0)continue;if(K.properties[z]=f,!H)P.push(z)}if(P.length)K.required=P;let O=my($,q);if(O!==void 0)K.additionalProperties=O;return K}function my($,q){if($.catchall._def.typeName!=="ZodNever")return _6($.catchall._def,{...q,currentPath:[...q.currentPath,"additionalProperties"]});switch($.unknownKeys){case"passthrough":return q.allowedAdditionalProperties;case"strict":return q.rejectedAdditionalProperties;case"strip":return q.removeAdditionalStrategy==="strict"?q.allowedAdditionalProperties:q.rejectedAdditionalProperties}}function dy($){try{return $.isOptional()}catch{return!0}}var cz=($,q)=>{if(q.currentPath.toString()===q.propertyPath?.toString())return _6($.innerType._def,q);let _=_6($.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","1"]});return _?{anyOf:[{not:D6(q)},_]}:D6(q)};var mz=($,q)=>{if(q.pipeStrategy==="input")return _6($.in._def,q);else if(q.pipeStrategy==="output")return _6($.out._def,q);let _=_6($.in._def,{...q,currentPath:[...q.currentPath,"allOf","0"]}),K=_6($.out._def,{...q,currentPath:[...q.currentPath,"allOf",_?"1":"0"]});return{allOf:[_,K].filter((P)=>P!==void 0)}};function dz($,q){return _6($.type._def,q)}function lz($,q){let K={type:"array",uniqueItems:!0,items:_6($.valueType._def,{...q,currentPath:[...q.currentPath,"items"]})};if($.minSize)G6(K,"minItems",$.minSize.value,$.minSize.message,q);if($.maxSize)G6(K,"maxItems",$.maxSize.value,$.maxSize.message,q);return K}function rz($,q){if($.rest)return{type:"array",minItems:$.items.length,items:$.items.map((_,K)=>_6(_._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((_,K)=>K===void 0?_:[..._,K],[]),additionalItems:_6($.rest._def,{...q,currentPath:[...q.currentPath,"additionalItems"]})};else return{type:"array",minItems:$.items.length,maxItems:$.items.length,items:$.items.map((_,K)=>_6(_._def,{...q,currentPath:[...q.currentPath,"items",`${K}`]})).reduce((_,K)=>K===void 0?_:[..._,K],[])}}function oz($){return{not:D6($)}}function nz($){return D6($)}var iz=($,q)=>{return _6($.innerType._def,q)};var Bz=($,q,_)=>{switch(q){case m$.ZodString:return R7($,_);case m$.ZodNumber:return xz($,_);case m$.ZodObject:return pz($,_);case m$.ZodBigInt:return Gz($,_);case m$.ZodBoolean:return Vz();case m$.ZodDate:return C5($,_);case m$.ZodUndefined:return oz(_);case m$.ZodNull:return gz(_);case m$.ZodArray:return kz($,_);case m$.ZodUnion:case m$.ZodDiscriminatedUnion:return yz($,_);case m$.ZodIntersection:return Ez($,_);case m$.ZodTuple:return rz($,_);case m$.ZodRecord:return I7($,_);case m$.ZodLiteral:return hz($,_);case m$.ZodEnum:return Cz($);case m$.ZodNativeEnum:return Lz($);case m$.ZodNullable:return uz($,_);case m$.ZodOptional:return cz($,_);case m$.ZodMap:return Dz($,_);case m$.ZodSet:return lz($,_);case m$.ZodLazy:return()=>$.getter()._def;case m$.ZodPromise:return dz($,_);case m$.ZodNaN:case m$.ZodNever:return bz(_);case m$.ZodEffects:return Nz($,_);case m$.ZodAny:return D6(_);case m$.ZodUnknown:return nz(_);case m$.ZodDefault:return Mz($,_);case m$.ZodBranded:return h7($,_);case m$.ZodReadonly:return iz($,_);case m$.ZodCatch:return Sz($,_);case m$.ZodPipeline:return mz($,_);case m$.ZodFunction:case m$.ZodVoid:case m$.ZodSymbol:return;default:return((K)=>{return})(q)}};function _6($,q,_=!1){let K=q.seen.get($);if(q.override){let z=q.override?.($,q,K,_);if(z!==Tz)return z}if(K&&!_){let z=ly(K,q);if(z!==void 0)return z}let P={def:$,path:q.currentPath,jsonSchema:void 0};q.seen.set($,P);let Y=Bz($,$.typeName,q),O=typeof Y==="function"?_6(Y(),q):Y;if(O)ry($,q,O);if(q.postProcess){let z=q.postProcess(O,$,q);return P.jsonSchema=O,z}return P.jsonSchema=O,O}var ly=($,q)=>{switch(q.$refStrategy){case"root":return{$ref:$.path.join("/")};case"relative":return{$ref:k7(q.currentPath,$.path)};case"none":case"seen":if($.path.length<q.currentPath.length&&$.path.every((_,K)=>q.currentPath[K]===_))return console.warn(`Recursive reference detected at ${q.currentPath.join("/")}! Defaulting to any`),D6(q);return q.$refStrategy==="seen"?D6(q):void 0}},ry=($,q,_)=>{if($.description){if(_.description=$.description,q.markdownDescription)_.markdownDescription=$.description}return _};var tz=($,q)=>{let _=fz(q),K=typeof q==="object"&&q.definitions?Object.entries(q.definitions).reduce((T,[H,f])=>({...T,[H]:_6(f._def,{..._,currentPath:[..._.basePath,_.definitionPath,H]},!0)??D6(_)}),{}):void 0,P=typeof q==="string"?q:q?.nameStrategy==="title"?void 0:q?.name,Y=_6($._def,P===void 0?_:{..._,currentPath:[..._.basePath,_.definitionPath,P]},!1)??D6(_),O=typeof q==="object"&&q.name!==void 0&&q.nameStrategy==="title"?q.name:void 0;if(O!==void 0)Y.title=O;if(_.flags.hasReferencedOpenAiAnyType){if(!K)K={};if(!K[_.openAiAnyTypeName])K[_.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:_.$refStrategy==="relative"?"1":[..._.basePath,_.definitionPath,_.openAiAnyTypeName].join("/")}}}let z=P===void 0?K?{...Y,[_.definitionPath]:K}:Y:{$ref:[..._.$refStrategy==="relative"?[]:_.basePath,_.definitionPath,P].join("/"),[_.definitionPath]:{...K,[P]:Y}};if(_.target==="jsonSchema7")z.$schema="http://json-schema.org/draft-07/schema#";else if(_.target==="jsonSchema2019-09"||_.target==="openAi")z.$schema="https://json-schema.org/draft/2019-09/schema#";if(_.target==="openAi"&&(("anyOf"in z)||("oneOf"in z)||("allOf"in z)||("type"in z)&&Array.isArray(z.type)))console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property.");return z};function e_($,q){let _=typeof $;if(_!==typeof q)return!1;if(Array.isArray($)){if(!Array.isArray(q))return!1;let K=$.length;if(K!==q.length)return!1;for(let P=0;P<K;P++)if(!e_($[P],q[P]))return!1;return!0}if(_==="object"){if(!$||!q)return $===q;let K=Object.keys($),P=Object.keys(q);if(K.length!==P.length)return!1;for(let O of K)if(!e_($[O],q[O]))return!1;return!0}return $===q}function O8($){return encodeURI(oy($))}function oy($){return $.replace(/~/g,"~0").replace(/\//g,"~1")}var ny={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},iy={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},By={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0},ty=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker");function x8($,q=Object.create(null),_=ty,K=""){if($&&typeof $==="object"&&!Array.isArray($)){let Y=$.$id||$.id;if(Y){let O=new URL(Y,_.href);if(O.hash.length>1)q[O.href]=$;else if(O.hash="",K==="")_=O;else x8($,q,_)}}else if($!==!0&&$!==!1)return q;let P=_.href+(K?"#"+K:"");if(q[P]!==void 0)throw Error(`Duplicate schema URI "${P}".`);if(q[P]=$,$===!0||$===!1)return q;if($.__absolute_uri__===void 0)Object.defineProperty($,"__absolute_uri__",{enumerable:!1,value:P});if($.$ref&&$.__absolute_ref__===void 0){let Y=new URL($.$ref,_.href);Y.hash=Y.hash,Object.defineProperty($,"__absolute_ref__",{enumerable:!1,value:Y.href})}if($.$recursiveRef&&$.__absolute_recursive_ref__===void 0){let Y=new URL($.$recursiveRef,_.href);Y.hash=Y.hash,Object.defineProperty($,"__absolute_recursive_ref__",{enumerable:!1,value:Y.href})}if($.$anchor){let Y=new URL("#"+$.$anchor,_.href);q[Y.href]=$}for(let Y in $){if(By[Y])continue;let O=`${K}/${O8(Y)}`,z=$[Y];if(Array.isArray(z)){if(ny[Y]){let T=z.length;for(let H=0;H<T;H++)x8(z[H],q,_,`${O}/${H}`)}}else if(iy[Y])for(let T in z)x8(z[T],q,_,`${O}/${O8(T)}`);else x8(z,q,_,O)}return q}var Uy=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Fy=[0,31,28,31,30,31,30,31,31,30,31,30,31],Qy=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,ay=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ey=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,sy=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,$u=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,qu=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,_u=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ku=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Pu=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Yu=($)=>{if($[0]==='"')return!1;let[q,_,...K]=$.split("@");if(!q||!_||K.length!==0||q.length>64||_.length>253)return!1;if(q[0]==="."||q.endsWith(".")||q.includes(".."))return!1;if(!/^[a-z0-9.-]+$/i.test(_)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(q))return!1;return _.split(".").every((P)=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(P))},Ou=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ju=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,vu=($)=>$.length>1&&$.length<80&&(/^P\d+([.,]\d+)?W$/.test($)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test($)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test($));function Q8($){return $.test.bind($)}var Uz={date:Vk,time:Sk.bind(void 0,!1),"date-time":Ju,duration:vu,uri:wu,"uri-reference":Q8(ey),"uri-template":Q8(sy),url:Q8($u),email:Yu,hostname:Q8(ay),ipv4:Q8(Ou),ipv6:Q8(ju),regex:Zu,uuid:Q8(qu),"json-pointer":Q8(_u),"json-pointer-uri-fragment":Q8(Ku),"relative-json-pointer":Q8(Pu)};function zu($){return $%4===0&&($%100!==0||$%400===0)}function Vk($){let q=$.match(Uy);if(!q)return!1;let _=+q[1],K=+q[2],P=+q[3];return K>=1&&K<=12&&P>=1&&P<=(K==2&&zu(_)?29:Fy[K])}function Sk($,q){let _=q.match(Qy);if(!_)return!1;let K=+_[1],P=+_[2],Y=+_[3],O=!!_[5];return(K<=23&&P<=59&&Y<=59||K==23&&P==59&&Y==60)&&(!$||O)}var Wu=/t|\s/i;function Ju($){let q=$.split(Wu);return q.length==2&&Vk(q[0])&&Sk(!0,q[1])}var Hu=/\/|:/,Tu=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function wu($){return Hu.test($)&&Tu.test($)}var fu=/[^\\]\\Z/;function Zu($){if(fu.test($))return!1;try{return new RegExp($,"u"),!0}catch(q){return!1}}function Mk($){let q=0,_=$.length,K=0,P;while(K<_)if(q++,P=$.charCodeAt(K++),P>=55296&&P<=56319&&K<_){if(P=$.charCodeAt(K),(P&64512)==56320)K++}return q}function g6($,q,_="2019-09",K=x8(q),P=!0,Y=null,O="#",z="#",T=Object.create(null)){if(q===!0)return{valid:!0,errors:[]};if(q===!1)return{valid:!1,errors:[{instanceLocation:O,keyword:"false",keywordLocation:O,error:"False boolean schema."}]};let H=typeof $,f;switch(H){case"boolean":case"number":case"string":f=H;break;case"object":if($===null)f="null";else if(Array.isArray($))f="array";else f="object";break;default:throw Error(`Instances of "${H}" type are not supported.`)}let{$ref:w,$recursiveRef:k,$recursiveAnchor:S,type:N,const:h,enum:C,required:I,not:D,anyOf:L,allOf:g,oneOf:y,if:p,then:o,else:s,format:Q,properties:m,patternProperties:e,additionalProperties:j,unevaluatedProperties:W,minProperties:X,maxProperties:J,propertyNames:Z,dependentRequired:G,dependentSchemas:M,dependencies:A,prefixItems:v,items:V,additionalItems:R,unevaluatedItems:E,contains:b,minContains:x,maxContains:l,minItems:F,maxItems:f$,uniqueItems:q$,minimum:B,maximum:v$,exclusiveMinimum:a,exclusiveMaximum:P$,multipleOf:o$,minLength:c,maxLength:r,pattern:J$,__absolute_ref__:$$,__absolute_recursive_ref__:_$}=q,O$=[];if(S===!0&&Y===null)Y=q;if(k==="#"){let n=Y===null?K[_$]:Y,H$=`${z}/$recursiveRef`,t=g6($,Y===null?q:Y,_,K,P,n,O,H$,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"$recursiveRef",keywordLocation:H$,error:"A subschema had errors."},...t.errors)}if(w!==void 0){let H$=K[$$||w];if(H$===void 0){let A$=`Unresolved $ref "${w}".`;if($$&&$$!==w)A$+=` Absolute URI "${$$}".`;throw A$+=`
205
205
  Known schemas:
206
206
  - ${Object.keys(K).join(`
207
- - `)}`,Error(A$)}let t=`${z}/$ref`,U=g6($,H$,_,K,P,Y,O,t,T);if(!U.valid)O$.push({instanceLocation:O,keyword:"$ref",keywordLocation:t,error:"A subschema had errors."},...U.errors);if(_==="4"||_==="7")return{valid:O$.length===0,errors:O$}}if(Array.isArray(N)){let n=N.length,H$=!1;for(let t=0;t<n;t++)if(f===N[t]||N[t]==="integer"&&f==="number"&&$%1===0&&$===$){H$=!0;break}if(!H$)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N.join('", "')}".`})}else if(N==="integer"){if(f!=="number"||$%1||$!==$)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N}".`})}else if(N!==void 0&&f!==N)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N}".`});if(h!==void 0){if(f==="object"||f==="array"){if(!e_($,h))O$.push({instanceLocation:O,keyword:"const",keywordLocation:`${z}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})}else if($!==h)O$.push({instanceLocation:O,keyword:"const",keywordLocation:`${z}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})}if(C!==void 0){if(f==="object"||f==="array"){if(!C.some((n)=>e_($,n)))O$.push({instanceLocation:O,keyword:"enum",keywordLocation:`${z}/enum`,error:`Instance does not match any of ${JSON.stringify(C)}.`})}else if(!C.some((n)=>$===n))O$.push({instanceLocation:O,keyword:"enum",keywordLocation:`${z}/enum`,error:`Instance does not match any of ${JSON.stringify(C)}.`})}if(D!==void 0){let n=`${z}/not`;if(g6($,D,_,K,P,Y,O,n).valid)O$.push({instanceLocation:O,keyword:"not",keywordLocation:n,error:'Instance matched "not" schema.'})}let d=[];if(L!==void 0){let n=`${z}/anyOf`,H$=O$.length,t=!1;for(let U=0;U<L.length;U++){let A$=L[U],W$=Object.create(T),z$=g6($,A$,_,K,P,S===!0?Y:null,O,`${n}/${U}`,W$);if(O$.push(...z$.errors),t=t||z$.valid,z$.valid)d.push(W$)}if(t)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"anyOf",keywordLocation:n,error:"Instance does not match any subschemas."})}if(g!==void 0){let n=`${z}/allOf`,H$=O$.length,t=!0;for(let U=0;U<g.length;U++){let A$=g[U],W$=Object.create(T),z$=g6($,A$,_,K,P,S===!0?Y:null,O,`${n}/${U}`,W$);if(O$.push(...z$.errors),t=t&&z$.valid,z$.valid)d.push(W$)}if(t)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"allOf",keywordLocation:n,error:"Instance does not match every subschema."})}if(y!==void 0){let n=`${z}/oneOf`,H$=O$.length,t=y.filter((U,A$)=>{let W$=Object.create(T),z$=g6($,U,_,K,P,S===!0?Y:null,O,`${n}/${A$}`,W$);if(O$.push(...z$.errors),z$.valid)d.push(W$);return z$.valid}).length;if(t===1)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"oneOf",keywordLocation:n,error:`Instance does not match exactly one subschema (${t} matches).`})}if(f==="object"||f==="array")Object.assign(T,...d);if(c!==void 0){let n=`${z}/if`;if(g6($,c,_,K,P,Y,O,n,T).valid){if(o!==void 0){let t=g6($,o,_,K,P,Y,O,`${z}/then`,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"if",keywordLocation:n,error:'Instance does not match "then" schema.'},...t.errors)}}else if(s!==void 0){let t=g6($,s,_,K,P,Y,O,`${z}/else`,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"if",keywordLocation:n,error:'Instance does not match "else" schema.'},...t.errors)}}if(f==="object"){if(I!==void 0){for(let U of I)if(!(U in $))O$.push({instanceLocation:O,keyword:"required",keywordLocation:`${z}/required`,error:`Instance does not have required property "${U}".`})}let n=Object.keys($);if(X!==void 0&&n.length<X)O$.push({instanceLocation:O,keyword:"minProperties",keywordLocation:`${z}/minProperties`,error:`Instance does not have at least ${X} properties.`});if(J!==void 0&&n.length>J)O$.push({instanceLocation:O,keyword:"maxProperties",keywordLocation:`${z}/maxProperties`,error:`Instance does not have at least ${J} properties.`});if(Z!==void 0){let U=`${z}/propertyNames`;for(let A$ in $){let W$=`${O}/${O8(A$)}`,z$=g6(A$,Z,_,K,P,Y,W$,U);if(!z$.valid)O$.push({instanceLocation:O,keyword:"propertyNames",keywordLocation:U,error:`Property name "${A$}" does not match schema.`},...z$.errors)}}if(V!==void 0){let U=`${z}/dependantRequired`;for(let A$ in V)if(A$ in $){let W$=V[A$];for(let z$ of W$)if(!(z$ in $))O$.push({instanceLocation:O,keyword:"dependentRequired",keywordLocation:U,error:`Instance has "${A$}" but does not have "${z$}".`})}}if(M!==void 0)for(let U in M){let A$=`${z}/dependentSchemas`;if(U in $){let W$=g6($,M[U],_,K,P,Y,O,`${A$}/${O8(U)}`,T);if(!W$.valid)O$.push({instanceLocation:O,keyword:"dependentSchemas",keywordLocation:A$,error:`Instance has "${U}" but does not match dependant schema.`},...W$.errors)}}if(A!==void 0){let U=`${z}/dependencies`;for(let A$ in A)if(A$ in $){let W$=A[A$];if(Array.isArray(W$)){for(let z$ of W$)if(!(z$ in $))O$.push({instanceLocation:O,keyword:"dependencies",keywordLocation:U,error:`Instance has "${A$}" but does not have "${z$}".`})}else{let z$=g6($,W$,_,K,P,Y,O,`${U}/${O8(A$)}`);if(!z$.valid)O$.push({instanceLocation:O,keyword:"dependencies",keywordLocation:U,error:`Instance has "${A$}" but does not match dependant schema.`},...z$.errors)}}}let H$=Object.create(null),t=!1;if(p!==void 0){let U=`${z}/properties`;for(let A$ in p){if(!(A$ in $))continue;let W$=`${O}/${O8(A$)}`,z$=g6($[A$],p[A$],_,K,P,Y,W$,`${U}/${O8(A$)}`);if(z$.valid)T[A$]=H$[A$]=!0;else if(t=P,O$.push({instanceLocation:O,keyword:"properties",keywordLocation:U,error:`Property "${A$}" does not match schema.`},...z$.errors),t)break}}if(!t&&a!==void 0){let U=`${z}/patternProperties`;for(let A$ in a){let W$=new RegExp(A$,"u"),z$=a[A$];for(let Z6 in $){if(!W$.test(Z6))continue;let X$=`${O}/${O8(Z6)}`,k$=g6($[Z6],z$,_,K,P,Y,X$,`${U}/${O8(A$)}`);if(k$.valid)T[Z6]=H$[Z6]=!0;else t=P,O$.push({instanceLocation:O,keyword:"patternProperties",keywordLocation:U,error:`Property "${Z6}" matches pattern "${A$}" but does not match associated schema.`},...k$.errors)}}}if(!t&&j!==void 0){let U=`${z}/additionalProperties`;for(let A$ in $){if(H$[A$])continue;let W$=`${O}/${O8(A$)}`,z$=g6($[A$],j,_,K,P,Y,W$,U);if(z$.valid)T[A$]=!0;else t=P,O$.push({instanceLocation:O,keyword:"additionalProperties",keywordLocation:U,error:`Property "${A$}" does not match additional properties schema.`},...z$.errors)}}else if(!t&&W!==void 0){let U=`${z}/unevaluatedProperties`;for(let A$ in $)if(!T[A$]){let W$=`${O}/${O8(A$)}`,z$=g6($[A$],W,_,K,P,Y,W$,U);if(z$.valid)T[A$]=!0;else O$.push({instanceLocation:O,keyword:"unevaluatedProperties",keywordLocation:U,error:`Property "${A$}" does not match unevaluated properties schema.`},...z$.errors)}}}else if(f==="array"){if(f$!==void 0&&$.length>f$)O$.push({instanceLocation:O,keyword:"maxItems",keywordLocation:`${z}/maxItems`,error:`Array has too many items (${$.length} > ${f$}).`});if(Q!==void 0&&$.length<Q)O$.push({instanceLocation:O,keyword:"minItems",keywordLocation:`${z}/minItems`,error:`Array has too few items (${$.length} < ${Q}).`});let n=$.length,H$=0,t=!1;if(v!==void 0){let U=`${z}/prefixItems`,A$=Math.min(v.length,n);for(;H$<A$;H$++){let W$=g6($[H$],v[H$],_,K,P,Y,`${O}/${H$}`,`${U}/${H$}`);if(T[H$]=!0,!W$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"prefixItems",keywordLocation:U,error:"Items did not match schema."},...W$.errors),t)break}}}if(G!==void 0){let U=`${z}/items`;if(Array.isArray(G)){let A$=Math.min(G.length,n);for(;H$<A$;H$++){let W$=g6($[H$],G[H$],_,K,P,Y,`${O}/${H$}`,`${U}/${H$}`);if(T[H$]=!0,!W$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"items",keywordLocation:U,error:"Items did not match schema."},...W$.errors),t)break}}}else for(;H$<n;H$++){let A$=g6($[H$],G,_,K,P,Y,`${O}/${H$}`,U);if(T[H$]=!0,!A$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"items",keywordLocation:U,error:"Items did not match schema."},...A$.errors),t)break}}if(!t&&R!==void 0){let A$=`${z}/additionalItems`;for(;H$<n;H$++){let W$=g6($[H$],R,_,K,P,Y,`${O}/${H$}`,A$);if(T[H$]=!0,!W$.valid)t=P,O$.push({instanceLocation:O,keyword:"additionalItems",keywordLocation:A$,error:"Items did not match additional items schema."},...W$.errors)}}}if(b!==void 0)if(n===0&&x===void 0)O$.push({instanceLocation:O,keyword:"contains",keywordLocation:`${z}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(x!==void 0&&n<x)O$.push({instanceLocation:O,keyword:"minContains",keywordLocation:`${z}/minContains`,error:`Array has less items (${n}) than minContains (${x}).`});else{let U=`${z}/contains`,A$=O$.length,W$=0;for(let z$=0;z$<n;z$++){let Z6=g6($[z$],b,_,K,P,Y,`${O}/${z$}`,U);if(Z6.valid)T[z$]=!0,W$++;else O$.push(...Z6.errors)}if(W$>=(x||0))O$.length=A$;if(x===void 0&&l===void 0&&W$===0)O$.splice(A$,0,{instanceLocation:O,keyword:"contains",keywordLocation:U,error:"Array does not contain item matching schema."});else if(x!==void 0&&W$<x)O$.push({instanceLocation:O,keyword:"minContains",keywordLocation:`${z}/minContains`,error:`Array must contain at least ${x} items matching schema. Only ${W$} items were found.`});else if(l!==void 0&&W$>l)O$.push({instanceLocation:O,keyword:"maxContains",keywordLocation:`${z}/maxContains`,error:`Array may contain at most ${l} items matching schema. ${W$} items were found.`})}if(!t&&E!==void 0){let U=`${z}/unevaluatedItems`;for(H$;H$<n;H$++){if(T[H$])continue;let A$=g6($[H$],E,_,K,P,Y,`${O}/${H$}`,U);if(T[H$]=!0,!A$.valid)O$.push({instanceLocation:O,keyword:"unevaluatedItems",keywordLocation:U,error:"Items did not match unevaluated items schema."},...A$.errors)}}if(q$)for(let U=0;U<n;U++){let A$=$[U],W$=typeof A$==="object"&&A$!==null;for(let z$=0;z$<n;z$++){if(U===z$)continue;let Z6=$[z$];if(A$===Z6||W$&&(typeof Z6==="object"&&Z6!==null)&&e_(A$,Z6))O$.push({instanceLocation:O,keyword:"uniqueItems",keywordLocation:`${z}/uniqueItems`,error:`Duplicate items at indexes ${U} and ${z$}.`}),U=Number.MAX_SAFE_INTEGER,z$=Number.MAX_SAFE_INTEGER}}}else if(f==="number"){if(_==="4"){if(B!==void 0&&(e===!0&&$<=B||$<B))O$.push({instanceLocation:O,keyword:"minimum",keywordLocation:`${z}/minimum`,error:`${$} is less than ${e?"or equal to ":""} ${B}.`});if(v$!==void 0&&(P$===!0&&$>=v$||$>v$))O$.push({instanceLocation:O,keyword:"maximum",keywordLocation:`${z}/maximum`,error:`${$} is greater than ${P$?"or equal to ":""} ${v$}.`})}else{if(B!==void 0&&$<B)O$.push({instanceLocation:O,keyword:"minimum",keywordLocation:`${z}/minimum`,error:`${$} is less than ${B}.`});if(v$!==void 0&&$>v$)O$.push({instanceLocation:O,keyword:"maximum",keywordLocation:`${z}/maximum`,error:`${$} is greater than ${v$}.`});if(e!==void 0&&$<=e)O$.push({instanceLocation:O,keyword:"exclusiveMinimum",keywordLocation:`${z}/exclusiveMinimum`,error:`${$} is less than ${e}.`});if(P$!==void 0&&$>=P$)O$.push({instanceLocation:O,keyword:"exclusiveMaximum",keywordLocation:`${z}/exclusiveMaximum`,error:`${$} is greater than or equal to ${P$}.`})}if(o$!==void 0){let n=$%o$;if(Math.abs(0-n)>=0.00000011920929&&Math.abs(o$-n)>=0.00000011920929)O$.push({instanceLocation:O,keyword:"multipleOf",keywordLocation:`${z}/multipleOf`,error:`${$} is not a multiple of ${o$}.`})}}else if(f==="string"){let n=m===void 0&&r===void 0?0:Mk($);if(m!==void 0&&n<m)O$.push({instanceLocation:O,keyword:"minLength",keywordLocation:`${z}/minLength`,error:`String is too short (${n} < ${m}).`});if(r!==void 0&&n>r)O$.push({instanceLocation:O,keyword:"maxLength",keywordLocation:`${z}/maxLength`,error:`String is too long (${n} > ${r}).`});if(J$!==void 0&&!new RegExp(J$,"u").test($))O$.push({instanceLocation:O,keyword:"pattern",keywordLocation:`${z}/pattern`,error:"String does not match pattern."});if(F!==void 0&&Uz[F]&&!Uz[F]($))O$.push({instanceLocation:O,keyword:"format",keywordLocation:`${z}/format`,error:`String does not match format "${F}".`})}return{valid:O$.length===0,errors:O$}}class Fz{schema;draft;shortCircuit;lookup;constructor($,q="2019-09",_=!0){this.schema=$,this.draft=q,this.shortCircuit=_,this.lookup=x8($)}validate($){return g6($,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema($,q){if(q)$={...$,$id:q};x8($,this.lookup)}}var Xu={};f6(Xu,{Validator:()=>Fz,deepCompareStrict:()=>e_,toJsonSchema:()=>Qz,validatesOnlyStrings:()=>E5});function Qz($){if(X8($)){let q=Yk($,!0);if(H4(q)){let _=k5(q,!0);return J4(_)}else return J4($)}if(H_($))return tz($);return $}function E5($){if(!$||typeof $!=="object"||Object.keys($).length===0||Array.isArray($))return!1;if("type"in $){if(typeof $.type==="string")return $.type==="string";if(Array.isArray($.type))return $.type.every((q)=>q==="string");return!1}if("enum"in $)return Array.isArray($.enum)&&$.enum.length>0&&$.enum.every((q)=>typeof q==="string");if("const"in $)return typeof $.const==="string";if("allOf"in $&&Array.isArray($.allOf))return $.allOf.some((q)=>E5(q));if("anyOf"in $&&Array.isArray($.anyOf)||"oneOf"in $&&Array.isArray($.oneOf)){let q="anyOf"in $?$.anyOf:$.oneOf;return q.length>0&&q.every((_)=>E5(_))}if("not"in $)return!1;if("$ref"in $&&typeof $.$ref==="string"){let q=$.$ref,_=x8($);if(_[q])return E5(_[q]);return!1}return!1}var Au={};f6(Au,{Graph:()=>h5});function ku($,q){if($!==void 0&&!oK($))return $;else if(gP(q))try{let _=q.getName();return _=_.startsWith("Runnable")?_.slice(8):_,_}catch{return q.getName()}else return q.name??"UnknownSchema"}function Gu($){if(gP($.data))return{type:"runnable",data:{id:$.data.lc_id,name:$.data.getName()}};else return{type:"schema",data:{...Qz($.data.schema),title:$.data.name}}}var h5=class ${nodes={};edges=[];constructor(q){this.nodes=q?.nodes??this.nodes,this.edges=q?.edges??this.edges}toJSON(){let q={};return Object.values(this.nodes).forEach((_,K)=>{q[_.id]=oK(_.id)?K:_.id}),{nodes:Object.values(this.nodes).map((_)=>({id:q[_.id],...Gu(_)})),edges:this.edges.map((_)=>{let K={source:q[_.source],target:q[_.target]};if(typeof _.data<"u")K.data=_.data;if(typeof _.conditional<"u")K.conditional=_.conditional;return K})}}addNode(q,_,K){if(_!==void 0&&this.nodes[_]!==void 0)throw Error(`Node with id ${_} already exists`);let P=_??iq(),Y={id:P,data:q,name:ku(_,q),metadata:K};return this.nodes[P]=Y,Y}removeNode(q){delete this.nodes[q.id],this.edges=this.edges.filter((_)=>_.source!==q.id&&_.target!==q.id)}addEdge(q,_,K,P){if(this.nodes[q.id]===void 0)throw Error(`Source node ${q.id} not in graph`);if(this.nodes[_.id]===void 0)throw Error(`Target node ${_.id} not in graph`);let Y={source:q.id,target:_.id,data:K,conditional:P};return this.edges.push(Y),Y}firstNode(){return Nk(this)}lastNode(){return Ck(this)}extend(q,_=""){let K=_;if(Object.values(q.nodes).map((H)=>H.id).every(oK))K="";let Y=(H)=>{return K?`${K}:${H}`:H};Object.entries(q.nodes).forEach(([H,f])=>{this.nodes[Y(H)]={...f,id:Y(H)}});let O=q.edges.map((H)=>{return{...H,source:Y(H.source),target:Y(H.target)}});this.edges=[...this.edges,...O];let z=q.firstNode(),T=q.lastNode();return[z?{id:Y(z.id),data:z.data}:void 0,T?{id:Y(T.id),data:T.data}:void 0]}trimFirstNode(){let q=this.firstNode();if(q&&Nk(this,[q.id]))this.removeNode(q)}trimLastNode(){let q=this.lastNode();if(q&&Ck(this,[q.id]))this.removeNode(q)}reid(){let q=Object.fromEntries(Object.values(this.nodes).map((P)=>[P.id,P.name])),_=new Map;Object.values(q).forEach((P)=>{_.set(P,(_.get(P)||0)+1)});let K=(P)=>{let Y=q[P];if(oK(P)&&_.get(Y)===1)return Y;else return P};return new $({nodes:Object.fromEntries(Object.entries(this.nodes).map(([P,Y])=>[K(P),{...Y,id:K(P)}])),edges:this.edges.map((P)=>({...P,source:K(P.source),target:K(P.target)}))})}drawMermaid(q){let{withStyles:_,curveStyle:K,nodeColors:P={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:Y}=q??{},O=this.reid(),z=O.firstNode(),T=O.lastNode();return Ok(O.nodes,O.edges,{firstNode:z?.id,lastNode:T?.id,withStyles:_,curveStyle:K,nodeColors:P,wrapLabelNWords:Y})}async drawMermaidPng(q){let _=this.drawMermaid(q);return jk(_,{backgroundColor:q?.backgroundColor})}};function Nk($,q=[]){let _=new Set($.edges.filter((P)=>!q.includes(P.source)).map((P)=>P.target)),K=[];for(let P of Object.values($.nodes))if(!q.includes(P.id)&&!_.has(P.id))K.push(P);return K.length===1?K[0]:void 0}function Ck($,q=[]){let _=new Set($.edges.filter((P)=>!q.includes(P.target)).map((P)=>P.source)),K=[];for(let P of Object.values($.nodes))if(!q.includes(P.id)&&!_.has(P.id))K.push(P);return K.length===1?K[0]:void 0}function Ek($){let q=new TextEncoder,_=new ReadableStream({async start(K){for await(let P of $)K.enqueue(q.encode(`event: data
207
+ - `)}`,Error(A$)}let t=`${z}/$ref`,U=g6($,H$,_,K,P,Y,O,t,T);if(!U.valid)O$.push({instanceLocation:O,keyword:"$ref",keywordLocation:t,error:"A subschema had errors."},...U.errors);if(_==="4"||_==="7")return{valid:O$.length===0,errors:O$}}if(Array.isArray(N)){let n=N.length,H$=!1;for(let t=0;t<n;t++)if(f===N[t]||N[t]==="integer"&&f==="number"&&$%1===0&&$===$){H$=!0;break}if(!H$)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N.join('", "')}".`})}else if(N==="integer"){if(f!=="number"||$%1||$!==$)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N}".`})}else if(N!==void 0&&f!==N)O$.push({instanceLocation:O,keyword:"type",keywordLocation:`${z}/type`,error:`Instance type "${f}" is invalid. Expected "${N}".`});if(h!==void 0){if(f==="object"||f==="array"){if(!e_($,h))O$.push({instanceLocation:O,keyword:"const",keywordLocation:`${z}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})}else if($!==h)O$.push({instanceLocation:O,keyword:"const",keywordLocation:`${z}/const`,error:`Instance does not match ${JSON.stringify(h)}.`})}if(C!==void 0){if(f==="object"||f==="array"){if(!C.some((n)=>e_($,n)))O$.push({instanceLocation:O,keyword:"enum",keywordLocation:`${z}/enum`,error:`Instance does not match any of ${JSON.stringify(C)}.`})}else if(!C.some((n)=>$===n))O$.push({instanceLocation:O,keyword:"enum",keywordLocation:`${z}/enum`,error:`Instance does not match any of ${JSON.stringify(C)}.`})}if(D!==void 0){let n=`${z}/not`;if(g6($,D,_,K,P,Y,O,n).valid)O$.push({instanceLocation:O,keyword:"not",keywordLocation:n,error:'Instance matched "not" schema.'})}let d=[];if(L!==void 0){let n=`${z}/anyOf`,H$=O$.length,t=!1;for(let U=0;U<L.length;U++){let A$=L[U],W$=Object.create(T),z$=g6($,A$,_,K,P,S===!0?Y:null,O,`${n}/${U}`,W$);if(O$.push(...z$.errors),t=t||z$.valid,z$.valid)d.push(W$)}if(t)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"anyOf",keywordLocation:n,error:"Instance does not match any subschemas."})}if(g!==void 0){let n=`${z}/allOf`,H$=O$.length,t=!0;for(let U=0;U<g.length;U++){let A$=g[U],W$=Object.create(T),z$=g6($,A$,_,K,P,S===!0?Y:null,O,`${n}/${U}`,W$);if(O$.push(...z$.errors),t=t&&z$.valid,z$.valid)d.push(W$)}if(t)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"allOf",keywordLocation:n,error:"Instance does not match every subschema."})}if(y!==void 0){let n=`${z}/oneOf`,H$=O$.length,t=y.filter((U,A$)=>{let W$=Object.create(T),z$=g6($,U,_,K,P,S===!0?Y:null,O,`${n}/${A$}`,W$);if(O$.push(...z$.errors),z$.valid)d.push(W$);return z$.valid}).length;if(t===1)O$.length=H$;else O$.splice(H$,0,{instanceLocation:O,keyword:"oneOf",keywordLocation:n,error:`Instance does not match exactly one subschema (${t} matches).`})}if(f==="object"||f==="array")Object.assign(T,...d);if(p!==void 0){let n=`${z}/if`;if(g6($,p,_,K,P,Y,O,n,T).valid){if(o!==void 0){let t=g6($,o,_,K,P,Y,O,`${z}/then`,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"if",keywordLocation:n,error:'Instance does not match "then" schema.'},...t.errors)}}else if(s!==void 0){let t=g6($,s,_,K,P,Y,O,`${z}/else`,T);if(!t.valid)O$.push({instanceLocation:O,keyword:"if",keywordLocation:n,error:'Instance does not match "else" schema.'},...t.errors)}}if(f==="object"){if(I!==void 0){for(let U of I)if(!(U in $))O$.push({instanceLocation:O,keyword:"required",keywordLocation:`${z}/required`,error:`Instance does not have required property "${U}".`})}let n=Object.keys($);if(X!==void 0&&n.length<X)O$.push({instanceLocation:O,keyword:"minProperties",keywordLocation:`${z}/minProperties`,error:`Instance does not have at least ${X} properties.`});if(J!==void 0&&n.length>J)O$.push({instanceLocation:O,keyword:"maxProperties",keywordLocation:`${z}/maxProperties`,error:`Instance does not have at least ${J} properties.`});if(Z!==void 0){let U=`${z}/propertyNames`;for(let A$ in $){let W$=`${O}/${O8(A$)}`,z$=g6(A$,Z,_,K,P,Y,W$,U);if(!z$.valid)O$.push({instanceLocation:O,keyword:"propertyNames",keywordLocation:U,error:`Property name "${A$}" does not match schema.`},...z$.errors)}}if(G!==void 0){let U=`${z}/dependantRequired`;for(let A$ in G)if(A$ in $){let W$=G[A$];for(let z$ of W$)if(!(z$ in $))O$.push({instanceLocation:O,keyword:"dependentRequired",keywordLocation:U,error:`Instance has "${A$}" but does not have "${z$}".`})}}if(M!==void 0)for(let U in M){let A$=`${z}/dependentSchemas`;if(U in $){let W$=g6($,M[U],_,K,P,Y,O,`${A$}/${O8(U)}`,T);if(!W$.valid)O$.push({instanceLocation:O,keyword:"dependentSchemas",keywordLocation:A$,error:`Instance has "${U}" but does not match dependant schema.`},...W$.errors)}}if(A!==void 0){let U=`${z}/dependencies`;for(let A$ in A)if(A$ in $){let W$=A[A$];if(Array.isArray(W$)){for(let z$ of W$)if(!(z$ in $))O$.push({instanceLocation:O,keyword:"dependencies",keywordLocation:U,error:`Instance has "${A$}" but does not have "${z$}".`})}else{let z$=g6($,W$,_,K,P,Y,O,`${U}/${O8(A$)}`);if(!z$.valid)O$.push({instanceLocation:O,keyword:"dependencies",keywordLocation:U,error:`Instance has "${A$}" but does not match dependant schema.`},...z$.errors)}}}let H$=Object.create(null),t=!1;if(m!==void 0){let U=`${z}/properties`;for(let A$ in m){if(!(A$ in $))continue;let W$=`${O}/${O8(A$)}`,z$=g6($[A$],m[A$],_,K,P,Y,W$,`${U}/${O8(A$)}`);if(z$.valid)T[A$]=H$[A$]=!0;else if(t=P,O$.push({instanceLocation:O,keyword:"properties",keywordLocation:U,error:`Property "${A$}" does not match schema.`},...z$.errors),t)break}}if(!t&&e!==void 0){let U=`${z}/patternProperties`;for(let A$ in e){let W$=new RegExp(A$,"u"),z$=e[A$];for(let Z6 in $){if(!W$.test(Z6))continue;let X$=`${O}/${O8(Z6)}`,k$=g6($[Z6],z$,_,K,P,Y,X$,`${U}/${O8(A$)}`);if(k$.valid)T[Z6]=H$[Z6]=!0;else t=P,O$.push({instanceLocation:O,keyword:"patternProperties",keywordLocation:U,error:`Property "${Z6}" matches pattern "${A$}" but does not match associated schema.`},...k$.errors)}}}if(!t&&j!==void 0){let U=`${z}/additionalProperties`;for(let A$ in $){if(H$[A$])continue;let W$=`${O}/${O8(A$)}`,z$=g6($[A$],j,_,K,P,Y,W$,U);if(z$.valid)T[A$]=!0;else t=P,O$.push({instanceLocation:O,keyword:"additionalProperties",keywordLocation:U,error:`Property "${A$}" does not match additional properties schema.`},...z$.errors)}}else if(!t&&W!==void 0){let U=`${z}/unevaluatedProperties`;for(let A$ in $)if(!T[A$]){let W$=`${O}/${O8(A$)}`,z$=g6($[A$],W,_,K,P,Y,W$,U);if(z$.valid)T[A$]=!0;else O$.push({instanceLocation:O,keyword:"unevaluatedProperties",keywordLocation:U,error:`Property "${A$}" does not match unevaluated properties schema.`},...z$.errors)}}}else if(f==="array"){if(f$!==void 0&&$.length>f$)O$.push({instanceLocation:O,keyword:"maxItems",keywordLocation:`${z}/maxItems`,error:`Array has too many items (${$.length} > ${f$}).`});if(F!==void 0&&$.length<F)O$.push({instanceLocation:O,keyword:"minItems",keywordLocation:`${z}/minItems`,error:`Array has too few items (${$.length} < ${F}).`});let n=$.length,H$=0,t=!1;if(v!==void 0){let U=`${z}/prefixItems`,A$=Math.min(v.length,n);for(;H$<A$;H$++){let W$=g6($[H$],v[H$],_,K,P,Y,`${O}/${H$}`,`${U}/${H$}`);if(T[H$]=!0,!W$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"prefixItems",keywordLocation:U,error:"Items did not match schema."},...W$.errors),t)break}}}if(V!==void 0){let U=`${z}/items`;if(Array.isArray(V)){let A$=Math.min(V.length,n);for(;H$<A$;H$++){let W$=g6($[H$],V[H$],_,K,P,Y,`${O}/${H$}`,`${U}/${H$}`);if(T[H$]=!0,!W$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"items",keywordLocation:U,error:"Items did not match schema."},...W$.errors),t)break}}}else for(;H$<n;H$++){let A$=g6($[H$],V,_,K,P,Y,`${O}/${H$}`,U);if(T[H$]=!0,!A$.valid){if(t=P,O$.push({instanceLocation:O,keyword:"items",keywordLocation:U,error:"Items did not match schema."},...A$.errors),t)break}}if(!t&&R!==void 0){let A$=`${z}/additionalItems`;for(;H$<n;H$++){let W$=g6($[H$],R,_,K,P,Y,`${O}/${H$}`,A$);if(T[H$]=!0,!W$.valid)t=P,O$.push({instanceLocation:O,keyword:"additionalItems",keywordLocation:A$,error:"Items did not match additional items schema."},...W$.errors)}}}if(b!==void 0)if(n===0&&x===void 0)O$.push({instanceLocation:O,keyword:"contains",keywordLocation:`${z}/contains`,error:"Array is empty. It must contain at least one item matching the schema."});else if(x!==void 0&&n<x)O$.push({instanceLocation:O,keyword:"minContains",keywordLocation:`${z}/minContains`,error:`Array has less items (${n}) than minContains (${x}).`});else{let U=`${z}/contains`,A$=O$.length,W$=0;for(let z$=0;z$<n;z$++){let Z6=g6($[z$],b,_,K,P,Y,`${O}/${z$}`,U);if(Z6.valid)T[z$]=!0,W$++;else O$.push(...Z6.errors)}if(W$>=(x||0))O$.length=A$;if(x===void 0&&l===void 0&&W$===0)O$.splice(A$,0,{instanceLocation:O,keyword:"contains",keywordLocation:U,error:"Array does not contain item matching schema."});else if(x!==void 0&&W$<x)O$.push({instanceLocation:O,keyword:"minContains",keywordLocation:`${z}/minContains`,error:`Array must contain at least ${x} items matching schema. Only ${W$} items were found.`});else if(l!==void 0&&W$>l)O$.push({instanceLocation:O,keyword:"maxContains",keywordLocation:`${z}/maxContains`,error:`Array may contain at most ${l} items matching schema. ${W$} items were found.`})}if(!t&&E!==void 0){let U=`${z}/unevaluatedItems`;for(H$;H$<n;H$++){if(T[H$])continue;let A$=g6($[H$],E,_,K,P,Y,`${O}/${H$}`,U);if(T[H$]=!0,!A$.valid)O$.push({instanceLocation:O,keyword:"unevaluatedItems",keywordLocation:U,error:"Items did not match unevaluated items schema."},...A$.errors)}}if(q$)for(let U=0;U<n;U++){let A$=$[U],W$=typeof A$==="object"&&A$!==null;for(let z$=0;z$<n;z$++){if(U===z$)continue;let Z6=$[z$];if(A$===Z6||W$&&(typeof Z6==="object"&&Z6!==null)&&e_(A$,Z6))O$.push({instanceLocation:O,keyword:"uniqueItems",keywordLocation:`${z}/uniqueItems`,error:`Duplicate items at indexes ${U} and ${z$}.`}),U=Number.MAX_SAFE_INTEGER,z$=Number.MAX_SAFE_INTEGER}}}else if(f==="number"){if(_==="4"){if(B!==void 0&&(a===!0&&$<=B||$<B))O$.push({instanceLocation:O,keyword:"minimum",keywordLocation:`${z}/minimum`,error:`${$} is less than ${a?"or equal to ":""} ${B}.`});if(v$!==void 0&&(P$===!0&&$>=v$||$>v$))O$.push({instanceLocation:O,keyword:"maximum",keywordLocation:`${z}/maximum`,error:`${$} is greater than ${P$?"or equal to ":""} ${v$}.`})}else{if(B!==void 0&&$<B)O$.push({instanceLocation:O,keyword:"minimum",keywordLocation:`${z}/minimum`,error:`${$} is less than ${B}.`});if(v$!==void 0&&$>v$)O$.push({instanceLocation:O,keyword:"maximum",keywordLocation:`${z}/maximum`,error:`${$} is greater than ${v$}.`});if(a!==void 0&&$<=a)O$.push({instanceLocation:O,keyword:"exclusiveMinimum",keywordLocation:`${z}/exclusiveMinimum`,error:`${$} is less than ${a}.`});if(P$!==void 0&&$>=P$)O$.push({instanceLocation:O,keyword:"exclusiveMaximum",keywordLocation:`${z}/exclusiveMaximum`,error:`${$} is greater than or equal to ${P$}.`})}if(o$!==void 0){let n=$%o$;if(Math.abs(0-n)>=0.00000011920929&&Math.abs(o$-n)>=0.00000011920929)O$.push({instanceLocation:O,keyword:"multipleOf",keywordLocation:`${z}/multipleOf`,error:`${$} is not a multiple of ${o$}.`})}}else if(f==="string"){let n=c===void 0&&r===void 0?0:Mk($);if(c!==void 0&&n<c)O$.push({instanceLocation:O,keyword:"minLength",keywordLocation:`${z}/minLength`,error:`String is too short (${n} < ${c}).`});if(r!==void 0&&n>r)O$.push({instanceLocation:O,keyword:"maxLength",keywordLocation:`${z}/maxLength`,error:`String is too long (${n} > ${r}).`});if(J$!==void 0&&!new RegExp(J$,"u").test($))O$.push({instanceLocation:O,keyword:"pattern",keywordLocation:`${z}/pattern`,error:"String does not match pattern."});if(Q!==void 0&&Uz[Q]&&!Uz[Q]($))O$.push({instanceLocation:O,keyword:"format",keywordLocation:`${z}/format`,error:`String does not match format "${Q}".`})}return{valid:O$.length===0,errors:O$}}class Fz{schema;draft;shortCircuit;lookup;constructor($,q="2019-09",_=!0){this.schema=$,this.draft=q,this.shortCircuit=_,this.lookup=x8($)}validate($){return g6($,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema($,q){if(q)$={...$,$id:q};x8($,this.lookup)}}var Xu={};f6(Xu,{Validator:()=>Fz,deepCompareStrict:()=>e_,toJsonSchema:()=>Qz,validatesOnlyStrings:()=>E5});function Qz($){if(X8($)){let q=Yk($,!0);if(H4(q)){let _=k5(q,!0);return J4(_)}else return J4($)}if(H_($))return tz($);return $}function E5($){if(!$||typeof $!=="object"||Object.keys($).length===0||Array.isArray($))return!1;if("type"in $){if(typeof $.type==="string")return $.type==="string";if(Array.isArray($.type))return $.type.every((q)=>q==="string");return!1}if("enum"in $)return Array.isArray($.enum)&&$.enum.length>0&&$.enum.every((q)=>typeof q==="string");if("const"in $)return typeof $.const==="string";if("allOf"in $&&Array.isArray($.allOf))return $.allOf.some((q)=>E5(q));if("anyOf"in $&&Array.isArray($.anyOf)||"oneOf"in $&&Array.isArray($.oneOf)){let q="anyOf"in $?$.anyOf:$.oneOf;return q.length>0&&q.every((_)=>E5(_))}if("not"in $)return!1;if("$ref"in $&&typeof $.$ref==="string"){let q=$.$ref,_=x8($);if(_[q])return E5(_[q]);return!1}return!1}var Au={};f6(Au,{Graph:()=>h5});function ku($,q){if($!==void 0&&!oK($))return $;else if(gP(q))try{let _=q.getName();return _=_.startsWith("Runnable")?_.slice(8):_,_}catch{return q.getName()}else return q.name??"UnknownSchema"}function Gu($){if(gP($.data))return{type:"runnable",data:{id:$.data.lc_id,name:$.data.getName()}};else return{type:"schema",data:{...Qz($.data.schema),title:$.data.name}}}var h5=class ${nodes={};edges=[];constructor(q){this.nodes=q?.nodes??this.nodes,this.edges=q?.edges??this.edges}toJSON(){let q={};return Object.values(this.nodes).forEach((_,K)=>{q[_.id]=oK(_.id)?K:_.id}),{nodes:Object.values(this.nodes).map((_)=>({id:q[_.id],...Gu(_)})),edges:this.edges.map((_)=>{let K={source:q[_.source],target:q[_.target]};if(typeof _.data<"u")K.data=_.data;if(typeof _.conditional<"u")K.conditional=_.conditional;return K})}}addNode(q,_,K){if(_!==void 0&&this.nodes[_]!==void 0)throw Error(`Node with id ${_} already exists`);let P=_??iq(),Y={id:P,data:q,name:ku(_,q),metadata:K};return this.nodes[P]=Y,Y}removeNode(q){delete this.nodes[q.id],this.edges=this.edges.filter((_)=>_.source!==q.id&&_.target!==q.id)}addEdge(q,_,K,P){if(this.nodes[q.id]===void 0)throw Error(`Source node ${q.id} not in graph`);if(this.nodes[_.id]===void 0)throw Error(`Target node ${_.id} not in graph`);let Y={source:q.id,target:_.id,data:K,conditional:P};return this.edges.push(Y),Y}firstNode(){return Nk(this)}lastNode(){return Ck(this)}extend(q,_=""){let K=_;if(Object.values(q.nodes).map((H)=>H.id).every(oK))K="";let Y=(H)=>{return K?`${K}:${H}`:H};Object.entries(q.nodes).forEach(([H,f])=>{this.nodes[Y(H)]={...f,id:Y(H)}});let O=q.edges.map((H)=>{return{...H,source:Y(H.source),target:Y(H.target)}});this.edges=[...this.edges,...O];let z=q.firstNode(),T=q.lastNode();return[z?{id:Y(z.id),data:z.data}:void 0,T?{id:Y(T.id),data:T.data}:void 0]}trimFirstNode(){let q=this.firstNode();if(q&&Nk(this,[q.id]))this.removeNode(q)}trimLastNode(){let q=this.lastNode();if(q&&Ck(this,[q.id]))this.removeNode(q)}reid(){let q=Object.fromEntries(Object.values(this.nodes).map((P)=>[P.id,P.name])),_=new Map;Object.values(q).forEach((P)=>{_.set(P,(_.get(P)||0)+1)});let K=(P)=>{let Y=q[P];if(oK(P)&&_.get(Y)===1)return Y;else return P};return new $({nodes:Object.fromEntries(Object.entries(this.nodes).map(([P,Y])=>[K(P),{...Y,id:K(P)}])),edges:this.edges.map((P)=>({...P,source:K(P.source),target:K(P.target)}))})}drawMermaid(q){let{withStyles:_,curveStyle:K,nodeColors:P={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:Y}=q??{},O=this.reid(),z=O.firstNode(),T=O.lastNode();return Ok(O.nodes,O.edges,{firstNode:z?.id,lastNode:T?.id,withStyles:_,curveStyle:K,nodeColors:P,wrapLabelNWords:Y})}async drawMermaidPng(q){let _=this.drawMermaid(q);return jk(_,{backgroundColor:q?.backgroundColor})}};function Nk($,q=[]){let _=new Set($.edges.filter((P)=>!q.includes(P.source)).map((P)=>P.target)),K=[];for(let P of Object.values($.nodes))if(!q.includes(P.id)&&!_.has(P.id))K.push(P);return K.length===1?K[0]:void 0}function Ck($,q=[]){let _=new Set($.edges.filter((P)=>!q.includes(P.target)).map((P)=>P.source)),K=[];for(let P of Object.values($.nodes))if(!q.includes(P.id)&&!_.has(P.id))K.push(P);return K.length===1?K[0]:void 0}function Ek($){let q=new TextEncoder,_=new ReadableStream({async start(K){for await(let P of $)K.enqueue(q.encode(`event: data
208
208
  data: ${JSON.stringify(P)}
209
209
 
210
210
  `));K.enqueue(q.encode(`event: end
@@ -412,7 +412,7 @@ assembly `,`
412
412
  `," ",""];else throw Error(`Language ${q} is not supported.`)}};var vT=N8(rV(),1);var oV=($)=>{$=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 iV{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:_,dictionaries:K,style:P,seed:Y}=$;this.dictionaries=K,this.separator=_,this.length=q,this.style=P,this.seed=Y}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.
413
413
  Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let $=this.seed;return this.dictionaries.slice(0,this.length).reduce((q,_)=>{let K;$?(K=((Y)=>{if(typeof Y=="string"){let O=Y.split("").map((T)=>T.charCodeAt(0)).reduce((T,H)=>T+H,1),z=Math.floor(Number(O));return oV(z)}return oV(Y)})($),$=4294967296*K):K=Math.random();let P=_[Math.floor(K*_.length)]||"";if(this.style==="lowerCase")P=P.toLowerCase();else if(this.style==="capital"){let[Y,...O]=P.split("");P=Y.toUpperCase()+O.join("")}else this.style==="upperCase"&&(P=P.toUpperCase());return q?`${q}${this.separator}${P}`:`${P}`},"")}}var nV={separator:"_",dictionaries:[]},i5=($)=>{let q=[...$&&$.dictionaries||nV.dictionaries],_={...nV,...$,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 iV(_).generate()};var B5=["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"];var i$={};rq(i$,{xid:()=>Ul,void:()=>kr,uuidv7:()=>dl,uuidv6:()=>ml,uuidv4:()=>cl,uuid:()=>pl,util:()=>l$,url:()=>ll,uppercase:()=>z7,unknown:()=>c4,union:()=>bJ,undefined:()=>Xr,ulid:()=>tl,uint64:()=>fr,uint32:()=>Hr,tuple:()=>WS,trim:()=>f7,treeifyError:()=>hO,transform:()=>uJ,toUpperCase:()=>X7,toLowerCase:()=>Z7,toJSONSchema:()=>J4,templateLiteral:()=>xr,symbol:()=>Zr,superRefine:()=>uS,success:()=>gr,stringbool:()=>nr,stringFormat:()=>Yr,string:()=>WJ,strictObject:()=>Mr,startsWith:()=>J7,slugify:()=>A7,size:()=>O7,setErrorMap:()=>Ur,set:()=>Rr,safeParseAsync:()=>qJ,safeParse:()=>$J,safeEncodeAsync:()=>vJ,safeEncode:()=>OJ,safeDecodeAsync:()=>zJ,safeDecode:()=>jJ,registry:()=>Q9,regexes:()=>f8,regex:()=>j7,refine:()=>yS,record:()=>JS,readonly:()=>RS,property:()=>_z,promise:()=>pr,prettifyError:()=>RO,preprocess:()=>Br,prefault:()=>VS,positive:()=>ev,pipe:()=>q2,partialRecord:()=>Er,parseAsync:()=>sW,parse:()=>eW,overwrite:()=>B8,optional:()=>s5,object:()=>Sr,number:()=>FV,nullish:()=>br,nullable:()=>$2,null:()=>$S,normalize:()=>w7,nonpositive:()=>$z,nonoptional:()=>SS,nonnegative:()=>qz,never:()=>DJ,negative:()=>sv,nativeEnum:()=>Ir,nanoid:()=>nl,nan:()=>yr,multipleOf:()=>AK,minSize:()=>kK,minLength:()=>B_,mime:()=>T7,meta:()=>rr,maxSize:()=>j4,maxLength:()=>v4,map:()=>hr,mac:()=>al,lte:()=>Z8,lt:()=>z_,lowercase:()=>v7,looseObject:()=>Nr,locales:()=>q7,literal:()=>Dr,length:()=>z4,lazy:()=>LS,ksuid:()=>Fl,keyof:()=>Vr,jwt:()=>Pr,json:()=>ir,iso:()=>a5,ipv6:()=>el,ipv4:()=>Ql,intersection:()=>vS,int64:()=>wr,int32:()=>Jr,int:()=>JJ,instanceof:()=>or,includes:()=>W7,httpUrl:()=>rl,hostname:()=>Or,hex:()=>jr,hash:()=>vr,guid:()=>xl,gte:()=>Qq,gt:()=>W_,globalRegistry:()=>y6,getErrorMap:()=>Fr,function:()=>cr,formatError:()=>oP,float64:()=>Wr,float32:()=>zr,flattenError:()=>rP,file:()=>Lr,enum:()=>yJ,endsWith:()=>H7,encodeAsync:()=>PJ,encode:()=>_J,emoji:()=>ol,email:()=>ul,e164:()=>Kr,discriminatedUnion:()=>Cr,describe:()=>lr,decodeAsync:()=>YJ,decode:()=>KJ,date:()=>Gr,custom:()=>dr,cuid2:()=>Bl,cuid:()=>il,core:()=>J_,config:()=>i6,coerce:()=>lJ,codec:()=>ur,clone:()=>l6,cidrv6:()=>$r,cidrv4:()=>sl,check:()=>mr,catch:()=>CS,boolean:()=>QV,bigint:()=>Tr,base64url:()=>_r,base64:()=>qr,array:()=>P2,any:()=>Ar,_function:()=>cr,_default:()=>kS,_ZodString:()=>HJ,ZodXID:()=>kJ,ZodVoid:()=>PS,ZodUnknown:()=>_S,ZodUnion:()=>LJ,ZodUndefined:()=>eV,ZodUUID:()=>G_,ZodURL:()=>_2,ZodULID:()=>AJ,ZodType:()=>H6,ZodTuple:()=>zS,ZodTransform:()=>ZS,ZodTemplateLiteral:()=>IS,ZodSymbol:()=>aV,ZodSuccess:()=>MS,ZodStringFormat:()=>R6,ZodString:()=>r7,ZodSet:()=>TS,ZodRecord:()=>gJ,ZodRealError:()=>eq,ZodReadonly:()=>hS,ZodPromise:()=>bS,ZodPrefault:()=>GS,ZodPipe:()=>cJ,ZodOptional:()=>xJ,ZodObject:()=>Y2,ZodNumberFormat:()=>m4,ZodNumber:()=>n7,ZodNullable:()=>XS,ZodNull:()=>sV,ZodNonOptional:()=>pJ,ZodNever:()=>KS,ZodNanoID:()=>fJ,ZodNaN:()=>ES,ZodMap:()=>HS,ZodMAC:()=>UV,ZodLiteral:()=>wS,ZodLazy:()=>DS,ZodKSUID:()=>GJ,ZodJWT:()=>RJ,ZodIssueCode:()=>tr,ZodIntersection:()=>jS,ZodISOTime:()=>F5,ZodISODuration:()=>Q5,ZodISODateTime:()=>t5,ZodISODate:()=>U5,ZodIPv6:()=>SJ,ZodIPv4:()=>VJ,ZodGUID:()=>e5,ZodFunction:()=>gS,ZodFirstPartyTypeKind:()=>dJ,ZodFile:()=>fS,ZodError:()=>gl,ZodEnum:()=>l7,ZodEmoji:()=>wJ,ZodEmail:()=>TJ,ZodE164:()=>hJ,ZodDiscriminatedUnion:()=>OS,ZodDefault:()=>AS,ZodDate:()=>K2,ZodCustomStringFormat:()=>o7,ZodCustom:()=>O2,ZodCodec:()=>mJ,ZodCatch:()=>NS,ZodCUID2:()=>XJ,ZodCUID:()=>ZJ,ZodCIDRv6:()=>NJ,ZodCIDRv4:()=>MJ,ZodBoolean:()=>i7,ZodBigIntFormat:()=>IJ,ZodBigInt:()=>B7,ZodBase64URL:()=>EJ,ZodBase64:()=>CJ,ZodArray:()=>YS,ZodAny:()=>qS,TimePrecision:()=>Ev,NEVER:()=>ZO,$output:()=>Vv,$input:()=>Sv,$brand:()=>XO});var a5={};rq(a5,{time:()=>QW,duration:()=>aW,datetime:()=>UW,date:()=>FW,ZodISOTime:()=>F5,ZodISODuration:()=>Q5,ZodISODateTime:()=>t5,ZodISODate:()=>U5});var t5=j$("ZodISODateTime",($,q)=>{p3.init($,q),R6.init($,q)});function UW($){return hv(t5,$)}var U5=j$("ZodISODate",($,q)=>{c3.init($,q),R6.init($,q)});function FW($){return Rv(U5,$)}var F5=j$("ZodISOTime",($,q)=>{m3.init($,q),R6.init($,q)});function QW($){return Iv(F5,$)}var Q5=j$("ZodISODuration",($,q)=>{d3.init($,q),R6.init($,q)});function aW($){return Dv(Q5,$)}var tV=($,q)=>{lP.init($,q),$.name="ZodError",Object.defineProperties($,{format:{value:(_)=>oP($,_)},flatten:{value:(_)=>rP($,_)},addIssue:{value:(_)=>{$.issues.push(_),$.message=JSON.stringify($.issues,eK,2)}},addIssues:{value:(_)=>{$.issues.push(..._),$.message=JSON.stringify($.issues,eK,2)}},isEmpty:{get(){return $.issues.length===0}}})},gl=j$("ZodError",tV),eq=j$("ZodError",tV,{Parent:Error});var eW=q4(eq),sW=_4(eq),$J=P4(eq),qJ=Y4(eq),_J=h9(eq),KJ=R9(eq),PJ=I9(eq),YJ=D9(eq),OJ=L9(eq),jJ=b9(eq),vJ=g9(eq),zJ=y9(eq);var H6=j$("ZodType",($,q)=>{return P6.init($,q),$.def=q,$.type=q.type,Object.defineProperty($,"_def",{value:q}),$.check=(..._)=>{return $.clone(l$.mergeDefs(q,{checks:[...q.checks??[],..._.map((K)=>typeof K==="function"?{_zod:{check:K,def:{check:"custom"},onattach:[]}}:K)]}))},$.clone=(_,K)=>l6($,_,K),$.brand=()=>$,$.register=(_,K)=>{return _.add($,K),$},$.parse=(_,K)=>eW($,_,K,{callee:$.parse}),$.safeParse=(_,K)=>$J($,_,K),$.parseAsync=async(_,K)=>sW($,_,K,{callee:$.parseAsync}),$.safeParseAsync=async(_,K)=>qJ($,_,K),$.spa=$.safeParseAsync,$.encode=(_,K)=>_J($,_,K),$.decode=(_,K)=>KJ($,_,K),$.encodeAsync=async(_,K)=>PJ($,_,K),$.decodeAsync=async(_,K)=>YJ($,_,K),$.safeEncode=(_,K)=>OJ($,_,K),$.safeDecode=(_,K)=>jJ($,_,K),$.safeEncodeAsync=async(_,K)=>vJ($,_,K),$.safeDecodeAsync=async(_,K)=>zJ($,_,K),$.refine=(_,K)=>$.check(yS(_,K)),$.superRefine=(_)=>$.check(uS(_)),$.overwrite=(_)=>$.check(B8(_)),$.optional=()=>s5($),$.nullable=()=>$2($),$.nullish=()=>s5($2($)),$.nonoptional=(_)=>SS($,_),$.array=()=>P2($),$.or=(_)=>bJ([$,_]),$.and=(_)=>vS($,_),$.transform=(_)=>q2($,uJ(_)),$.default=(_)=>kS($,_),$.prefault=(_)=>VS($,_),$.catch=(_)=>CS($,_),$.pipe=(_)=>q2($,_),$.readonly=()=>RS($),$.describe=(_)=>{let K=$.clone();return y6.add(K,{description:_}),K},Object.defineProperty($,"description",{get(){return y6.get($)?.description},configurable:!0}),$.meta=(..._)=>{if(_.length===0)return y6.get($);let K=$.clone();return y6.add(K,_[0]),K},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$}),HJ=j$("_ZodString",($,q)=>{XK.init($,q),H6.init($,q);let _=$._zod.bag;$.format=_.format??null,$.minLength=_.minimum??null,$.maxLength=_.maximum??null,$.regex=(...K)=>$.check(j7(...K)),$.includes=(...K)=>$.check(W7(...K)),$.startsWith=(...K)=>$.check(J7(...K)),$.endsWith=(...K)=>$.check(H7(...K)),$.min=(...K)=>$.check(B_(...K)),$.max=(...K)=>$.check(v4(...K)),$.length=(...K)=>$.check(z4(...K)),$.nonempty=(...K)=>$.check(B_(1,...K)),$.lowercase=(K)=>$.check(v7(K)),$.uppercase=(K)=>$.check(z7(K)),$.trim=()=>$.check(f7()),$.normalize=(...K)=>$.check(w7(...K)),$.toLowerCase=()=>$.check(Z7()),$.toUpperCase=()=>$.check(X7()),$.slugify=()=>$.check(A7())}),r7=j$("ZodString",($,q)=>{XK.init($,q),HJ.init($,q),$.email=(_)=>$.check(a9(TJ,_)),$.url=(_)=>$.check(P7(_2,_)),$.jwt=(_)=>$.check(Z5(RJ,_)),$.emoji=(_)=>$.check(_5(wJ,_)),$.guid=(_)=>$.check(K7(e5,_)),$.uuid=(_)=>$.check(e9(G_,_)),$.uuidv4=(_)=>$.check(s9(G_,_)),$.uuidv6=(_)=>$.check($5(G_,_)),$.uuidv7=(_)=>$.check(q5(G_,_)),$.nanoid=(_)=>$.check(K5(fJ,_)),$.guid=(_)=>$.check(K7(e5,_)),$.cuid=(_)=>$.check(P5(ZJ,_)),$.cuid2=(_)=>$.check(Y5(XJ,_)),$.ulid=(_)=>$.check(O5(AJ,_)),$.base64=(_)=>$.check(T5(CJ,_)),$.base64url=(_)=>$.check(w5(EJ,_)),$.xid=(_)=>$.check(j5(kJ,_)),$.ksuid=(_)=>$.check(v5(GJ,_)),$.ipv4=(_)=>$.check(z5(VJ,_)),$.ipv6=(_)=>$.check(W5(SJ,_)),$.cidrv4=(_)=>$.check(J5(MJ,_)),$.cidrv6=(_)=>$.check(H5(NJ,_)),$.e164=(_)=>$.check(f5(hJ,_)),$.datetime=(_)=>$.check(UW(_)),$.date=(_)=>$.check(FW(_)),$.time=(_)=>$.check(QW(_)),$.duration=(_)=>$.check(aW(_))});function WJ($){return Mv(r7,$)}var R6=j$("ZodStringFormat",($,q)=>{C6.init($,q),HJ.init($,q)}),TJ=j$("ZodEmail",($,q)=>{R3.init($,q),R6.init($,q)});function ul($){return a9(TJ,$)}var e5=j$("ZodGUID",($,q)=>{E3.init($,q),R6.init($,q)});function xl($){return K7(e5,$)}var G_=j$("ZodUUID",($,q)=>{h3.init($,q),R6.init($,q)});function pl($){return e9(G_,$)}function cl($){return s9(G_,$)}function ml($){return $5(G_,$)}function dl($){return q5(G_,$)}var _2=j$("ZodURL",($,q)=>{I3.init($,q),R6.init($,q)});function ll($){return P7(_2,$)}function rl($){return P7(_2,{protocol:/^https?$/,hostname:f8.domain,...l$.normalizeParams($)})}var wJ=j$("ZodEmoji",($,q)=>{D3.init($,q),R6.init($,q)});function ol($){return _5(wJ,$)}var fJ=j$("ZodNanoID",($,q)=>{L3.init($,q),R6.init($,q)});function nl($){return K5(fJ,$)}var ZJ=j$("ZodCUID",($,q)=>{b3.init($,q),R6.init($,q)});function il($){return P5(ZJ,$)}var XJ=j$("ZodCUID2",($,q)=>{g3.init($,q),R6.init($,q)});function Bl($){return Y5(XJ,$)}var AJ=j$("ZodULID",($,q)=>{y3.init($,q),R6.init($,q)});function tl($){return O5(AJ,$)}var kJ=j$("ZodXID",($,q)=>{u3.init($,q),R6.init($,q)});function Ul($){return j5(kJ,$)}var GJ=j$("ZodKSUID",($,q)=>{x3.init($,q),R6.init($,q)});function Fl($){return v5(GJ,$)}var VJ=j$("ZodIPv4",($,q)=>{l3.init($,q),R6.init($,q)});function Ql($){return z5(VJ,$)}var UV=j$("ZodMAC",($,q)=>{o3.init($,q),R6.init($,q)});function al($){return Cv(UV,$)}var SJ=j$("ZodIPv6",($,q)=>{r3.init($,q),R6.init($,q)});function el($){return W5(SJ,$)}var MJ=j$("ZodCIDRv4",($,q)=>{n3.init($,q),R6.init($,q)});function sl($){return J5(MJ,$)}var NJ=j$("ZodCIDRv6",($,q)=>{i3.init($,q),R6.init($,q)});function $r($){return H5(NJ,$)}var CJ=j$("ZodBase64",($,q)=>{t3.init($,q),R6.init($,q)});function qr($){return T5(CJ,$)}var EJ=j$("ZodBase64URL",($,q)=>{U3.init($,q),R6.init($,q)});function _r($){return w5(EJ,$)}var hJ=j$("ZodE164",($,q)=>{F3.init($,q),R6.init($,q)});function Kr($){return f5(hJ,$)}var RJ=j$("ZodJWT",($,q)=>{Q3.init($,q),R6.init($,q)});function Pr($){return Z5(RJ,$)}var o7=j$("ZodCustomStringFormat",($,q)=>{a3.init($,q),R6.init($,q)});function Yr($,q,_={}){return W4(o7,$,q,_)}function Or($){return W4(o7,"hostname",f8.hostname,$)}function jr($){return W4(o7,"hex",f8.hex,$)}function vr($,q){let _=q?.enc??"hex",K=`${$}_${_}`,P=f8[K];if(!P)throw Error(`Unrecognized hash format: ${K}`);return W4(o7,K,P,q)}var n7=j$("ZodNumber",($,q)=>{n9.init($,q),H6.init($,q),$.gt=(K,P)=>$.check(W_(K,P)),$.gte=(K,P)=>$.check(Qq(K,P)),$.min=(K,P)=>$.check(Qq(K,P)),$.lt=(K,P)=>$.check(z_(K,P)),$.lte=(K,P)=>$.check(Z8(K,P)),$.max=(K,P)=>$.check(Z8(K,P)),$.int=(K)=>$.check(JJ(K)),$.safe=(K)=>$.check(JJ(K)),$.positive=(K)=>$.check(W_(0,K)),$.nonnegative=(K)=>$.check(Qq(0,K)),$.negative=(K)=>$.check(z_(0,K)),$.nonpositive=(K)=>$.check(Z8(0,K)),$.multipleOf=(K,P)=>$.check(AK(K,P)),$.step=(K,P)=>$.check(AK(K,P)),$.finite=()=>$;let _=$._zod.bag;$.minValue=Math.max(_.minimum??Number.NEGATIVE_INFINITY,_.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(_.maximum??Number.POSITIVE_INFINITY,_.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(_.format??"").includes("int")||Number.isSafeInteger(_.multipleOf??0.5),$.isFinite=!0,$.format=_.format??null});function FV($){return Lv(n7,$)}var m4=j$("ZodNumberFormat",($,q)=>{e3.init($,q),n7.init($,q)});function JJ($){return gv(m4,$)}function zr($){return yv(m4,$)}function Wr($){return uv(m4,$)}function Jr($){return xv(m4,$)}function Hr($){return pv(m4,$)}var i7=j$("ZodBoolean",($,q)=>{tP.init($,q),H6.init($,q)});function QV($){return cv(i7,$)}var B7=j$("ZodBigInt",($,q)=>{i9.init($,q),H6.init($,q),$.gte=(K,P)=>$.check(Qq(K,P)),$.min=(K,P)=>$.check(Qq(K,P)),$.gt=(K,P)=>$.check(W_(K,P)),$.gte=(K,P)=>$.check(Qq(K,P)),$.min=(K,P)=>$.check(Qq(K,P)),$.lt=(K,P)=>$.check(z_(K,P)),$.lte=(K,P)=>$.check(Z8(K,P)),$.max=(K,P)=>$.check(Z8(K,P)),$.positive=(K)=>$.check(W_(BigInt(0),K)),$.negative=(K)=>$.check(z_(BigInt(0),K)),$.nonpositive=(K)=>$.check(Z8(BigInt(0),K)),$.nonnegative=(K)=>$.check(Qq(BigInt(0),K)),$.multipleOf=(K,P)=>$.check(AK(K,P));let _=$._zod.bag;$.minValue=_.minimum??null,$.maxValue=_.maximum??null,$.format=_.format??null});function Tr($){return dv(B7,$)}var IJ=j$("ZodBigIntFormat",($,q)=>{s3.init($,q),B7.init($,q)});function wr($){return rv(IJ,$)}function fr($){return ov(IJ,$)}var aV=j$("ZodSymbol",($,q)=>{$j.init($,q),H6.init($,q)});function Zr($){return nv(aV,$)}var eV=j$("ZodUndefined",($,q)=>{qj.init($,q),H6.init($,q)});function Xr($){return iv(eV,$)}var sV=j$("ZodNull",($,q)=>{_j.init($,q),H6.init($,q)});function $S($){return Bv(sV,$)}var qS=j$("ZodAny",($,q)=>{Kj.init($,q),H6.init($,q)});function Ar(){return tv(qS)}var _S=j$("ZodUnknown",($,q)=>{B9.init($,q),H6.init($,q)});function c4(){return X5(_S)}var KS=j$("ZodNever",($,q)=>{UP.init($,q),H6.init($,q)});function DJ($){return Y7(KS,$)}var PS=j$("ZodVoid",($,q)=>{Pj.init($,q),H6.init($,q)});function kr($){return Uv(PS,$)}var K2=j$("ZodDate",($,q)=>{Yj.init($,q),H6.init($,q),$.min=(K,P)=>$.check(Qq(K,P)),$.max=(K,P)=>$.check(Z8(K,P));let _=$._zod.bag;$.minDate=_.minimum?new Date(_.minimum):null,$.maxDate=_.maximum?new Date(_.maximum):null});function Gr($){return Fv(K2,$)}var YS=j$("ZodArray",($,q)=>{Oj.init($,q),H6.init($,q),$.element=q.element,$.min=(_,K)=>$.check(B_(_,K)),$.nonempty=(_)=>$.check(B_(1,_)),$.max=(_,K)=>$.check(v4(_,K)),$.length=(_,K)=>$.check(z4(_,K)),$.unwrap=()=>$.element});function P2($,q){return Kz(YS,$,q)}function Vr($){let q=$._zod.def.shape;return yJ(Object.keys(q))}var Y2=j$("ZodObject",($,q)=>{jj.init($,q),H6.init($,q),l$.defineLazy($,"shape",()=>{return q.shape}),$.keyof=()=>yJ(Object.keys($._zod.def.shape)),$.catchall=(_)=>$.clone({...$._zod.def,catchall:_}),$.passthrough=()=>$.clone({...$._zod.def,catchall:c4()}),$.loose=()=>$.clone({...$._zod.def,catchall:c4()}),$.strict=()=>$.clone({...$._zod.def,catchall:DJ()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(_)=>{return l$.extend($,_)},$.safeExtend=(_)=>{return l$.safeExtend($,_)},$.merge=(_)=>l$.merge($,_),$.pick=(_)=>l$.pick($,_),$.omit=(_)=>l$.omit($,_),$.partial=(..._)=>l$.partial(xJ,$,_[0]),$.required=(..._)=>l$.required(pJ,$,_[0])});function Sr($,q){let _={type:"object",shape:$??{},...l$.normalizeParams(q)};return new Y2(_)}function Mr($,q){return new Y2({type:"object",shape:$,catchall:DJ(),...l$.normalizeParams(q)})}function Nr($,q){return new Y2({type:"object",shape:$,catchall:c4(),...l$.normalizeParams(q)})}var LJ=j$("ZodUnion",($,q)=>{t9.init($,q),H6.init($,q),$.options=q.options});function bJ($,q){return new LJ({type:"union",options:$,...l$.normalizeParams(q)})}var OS=j$("ZodDiscriminatedUnion",($,q)=>{LJ.init($,q),vj.init($,q)});function Cr($,q,_){return new OS({type:"union",options:q,discriminator:$,...l$.normalizeParams(_)})}var jS=j$("ZodIntersection",($,q)=>{zj.init($,q),H6.init($,q)});function vS($,q){return new jS({type:"intersection",left:$,right:q})}var zS=j$("ZodTuple",($,q)=>{U9.init($,q),H6.init($,q),$.rest=(_)=>$.clone({...$._zod.def,rest:_})});function WS($,q,_){let K=q instanceof P6,P=K?_:q;return new zS({type:"tuple",items:$,rest:K?q:null,...l$.normalizeParams(P)})}var gJ=j$("ZodRecord",($,q)=>{Wj.init($,q),H6.init($,q),$.keyType=q.keyType,$.valueType=q.valueType});function JS($,q,_){return new gJ({type:"record",keyType:$,valueType:q,...l$.normalizeParams(_)})}function Er($,q,_){let K=l6($);return K._zod.values=void 0,new gJ({type:"record",keyType:K,valueType:q,...l$.normalizeParams(_)})}var HS=j$("ZodMap",($,q)=>{Jj.init($,q),H6.init($,q),$.keyType=q.keyType,$.valueType=q.valueType});function hr($,q,_){return new HS({type:"map",keyType:$,valueType:q,...l$.normalizeParams(_)})}var TS=j$("ZodSet",($,q)=>{Hj.init($,q),H6.init($,q),$.min=(..._)=>$.check(kK(..._)),$.nonempty=(_)=>$.check(kK(1,_)),$.max=(..._)=>$.check(j4(..._)),$.size=(..._)=>$.check(O7(..._))});function Rr($,q){return new TS({type:"set",valueType:$,...l$.normalizeParams(q)})}var l7=j$("ZodEnum",($,q)=>{Tj.init($,q),H6.init($,q),$.enum=q.entries,$.options=Object.values(q.entries);let _=new Set(Object.keys(q.entries));$.extract=(K,P)=>{let Y={};for(let O of K)if(_.has(O))Y[O]=q.entries[O];else throw Error(`Key ${O} not found in enum`);return new l7({...q,checks:[],...l$.normalizeParams(P),entries:Y})},$.exclude=(K,P)=>{let Y={...q.entries};for(let O of K)if(_.has(O))delete Y[O];else throw Error(`Key ${O} not found in enum`);return new l7({...q,checks:[],...l$.normalizeParams(P),entries:Y})}});function yJ($,q){let _=Array.isArray($)?Object.fromEntries($.map((K)=>[K,K])):$;return new l7({type:"enum",entries:_,...l$.normalizeParams(q)})}function Ir($,q){return new l7({type:"enum",entries:$,...l$.normalizeParams(q)})}var wS=j$("ZodLiteral",($,q)=>{wj.init($,q),H6.init($,q),$.values=new Set(q.values),Object.defineProperty($,"value",{get(){if(q.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return q.values[0]}})});function Dr($,q){return new wS({type:"literal",values:Array.isArray($)?$:[$],...l$.normalizeParams(q)})}var fS=j$("ZodFile",($,q)=>{fj.init($,q),H6.init($,q),$.min=(_,K)=>$.check(kK(_,K)),$.max=(_,K)=>$.check(j4(_,K)),$.mime=(_,K)=>$.check(T7(Array.isArray(_)?_:[_],K))});function Lr($){return Pz(fS,$)}var ZS=j$("ZodTransform",($,q)=>{Zj.init($,q),H6.init($,q),$._zod.parse=(_,K)=>{if(K.direction==="backward")throw new wK($.constructor.name);_.addIssue=(Y)=>{if(typeof Y==="string")_.issues.push(l$.issue(Y,_.value,q));else{let O=Y;if(O.fatal)O.continue=!1;O.code??(O.code="custom"),O.input??(O.input=_.value),O.inst??(O.inst=$),_.issues.push(l$.issue(O))}};let P=q.transform(_.value,_);if(P instanceof Promise)return P.then((Y)=>{return _.value=Y,_});return _.value=P,_}});function uJ($){return new ZS({type:"transform",transform:$})}var xJ=j$("ZodOptional",($,q)=>{F9.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function s5($){return new xJ({type:"optional",innerType:$})}var XS=j$("ZodNullable",($,q)=>{Xj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function $2($){return new XS({type:"nullable",innerType:$})}function br($){return s5($2($))}var AS=j$("ZodDefault",($,q)=>{Aj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function kS($,q){return new AS({type:"default",innerType:$,get defaultValue(){return typeof q==="function"?q():l$.shallowClone(q)}})}var GS=j$("ZodPrefault",($,q)=>{kj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function VS($,q){return new GS({type:"prefault",innerType:$,get defaultValue(){return typeof q==="function"?q():l$.shallowClone(q)}})}var pJ=j$("ZodNonOptional",($,q)=>{Gj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function SS($,q){return new pJ({type:"nonoptional",innerType:$,...l$.normalizeParams(q)})}var MS=j$("ZodSuccess",($,q)=>{Vj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function gr($){return new MS({type:"success",innerType:$})}var NS=j$("ZodCatch",($,q)=>{Sj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function CS($,q){return new NS({type:"catch",innerType:$,catchValue:typeof q==="function"?q:()=>q})}var ES=j$("ZodNaN",($,q)=>{Mj.init($,q),H6.init($,q)});function yr($){return av(ES,$)}var cJ=j$("ZodPipe",($,q)=>{Nj.init($,q),H6.init($,q),$.in=q.in,$.out=q.out});function q2($,q){return new cJ({type:"pipe",in:$,out:q})}var mJ=j$("ZodCodec",($,q)=>{cJ.init($,q),FP.init($,q)});function ur($,q,_){return new mJ({type:"pipe",in:$,out:q,transform:_.decode,reverseTransform:_.encode})}var hS=j$("ZodReadonly",($,q)=>{Cj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function RS($){return new hS({type:"readonly",innerType:$})}var IS=j$("ZodTemplateLiteral",($,q)=>{Ej.init($,q),H6.init($,q)});function xr($,q){return new IS({type:"template_literal",parts:$,...l$.normalizeParams(q)})}var DS=j$("ZodLazy",($,q)=>{Ij.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.getter()});function LS($){return new DS({type:"lazy",getter:$})}var bS=j$("ZodPromise",($,q)=>{Rj.init($,q),H6.init($,q),$.unwrap=()=>$._zod.def.innerType});function pr($){return new bS({type:"promise",innerType:$})}var gS=j$("ZodFunction",($,q)=>{hj.init($,q),H6.init($,q)});function cr($){return new gS({type:"function",input:Array.isArray($?.input)?WS($?.input):$?.input??P2(c4()),output:$?.output??c4()})}var O2=j$("ZodCustom",($,q)=>{Dj.init($,q),H6.init($,q)});function mr($){let q=new h6({check:"custom"});return q._zod.check=$,q}function dr($,q){return Yz(O2,$??(()=>!0),q)}function yS($,q={}){return Oz(O2,$,q)}function uS($){return jz($)}var lr=vz,rr=zz;function or($,q={error:`Input not instance of ${$.name}`}){let _=new O2({type:"custom",check:"custom",fn:(K)=>K instanceof $,abort:!0,...l$.normalizeParams(q)});return _._zod.bag.Class=$,_}var nr=(...$)=>Wz({Codec:mJ,Boolean:i7,String:r7},...$);function ir($){let q=LS(()=>{return bJ([WJ($),FV(),QV(),$S(),P2(q),JS(WJ(),q)])});return q}function Br($,q){return q2(uJ($),q)}var tr={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function Ur($){i6({customError:$})}function Fr(){return i6().customError}var dJ;(function($){})(dJ||(dJ={}));var lJ={};rq(lJ,{string:()=>Qr,number:()=>ar,date:()=>$o,boolean:()=>er,bigint:()=>sr});function Qr($){return Nv(r7,$)}function ar($){return bv(n7,$)}function er($){return mv(i7,$)}function sr($){return lv(B7,$)}function $o($){return Qv(K2,$)}i6(QP());function B4(){if(typeof process<"u"&&process.versions&&process.versions.node)return"node";if(typeof globalThis<"u"&&typeof globalThis.window<"u"&&typeof globalThis.window?.document<"u")return"browser";return"unknown"}class yM{store={};constructor(){let $=globalThis;if(typeof globalThis<"u"&&$.window&&$.window.ENV)this.store={...$.window.ENV};let q=globalThis;if(typeof globalThis<"u"&&q.__ENV__)this.store={...this.store,...q.__ENV__}}get($){let q=this.store[$];return q!==void 0?String(q):void 0}set($,q){this.store[$]=q}has($){return $ in this.store}getAll(){return{...this.store}}}class uM{runtime;browserStore;cache=new Map;constructor(){if(this.runtime=B4(),this.runtime==="browser")this.browserStore=new yM}getRuntime(){return this.runtime}isNode(){return this.runtime==="node"}isBrowser(){return this.runtime==="browser"}get($,q){if(this.cache.has($)){let K=this.cache.get($);return K===void 0&&q!==void 0?q:K}let _;switch(this.runtime){case"node":if(typeof process<"u"&&process.env)_=process.env[$];break;case"browser":if(this.browserStore)_=this.browserStore.get($);break;default:_=void 0}return this.cache.set($,_),_===void 0&&q!==void 0?q:_}set($,q){let _=String(q);switch(this.cache.delete($),this.runtime){case"node":if(typeof process<"u"&&process.env)process.env[$]=_;break;case"browser":if(this.browserStore)this.browserStore.set($,q);break}}has($){return this.get($)!==void 0}getAll(){switch(this.runtime){case"node":if(typeof process<"u"&&process.env)return{...process.env};break;case"browser":if(this.browserStore)return this.browserStore.getAll();break}return{}}getBoolean($,q=!1){let _=this.get($);if(_===void 0)return q;return["true","1","yes","on"].includes(_.toLowerCase())}getNumber($,q){let _=this.get($);if(_===void 0)return q;let K=Number(_);return isNaN(K)?q:K}clearCache(){this.cache.clear()}}var DH=null;function t4(){if(!DH)DH=new uM;return DH}function E_($,q){return t4().get($,q)}function X5$($,q){t4().set($,q)}function A5$($){return t4().has($)}function k5$($,q=!1){return t4().getBoolean($,q)}function xM($,q){return t4().getNumber($,q)}function G5$($){let q=t4();if(q.isBrowser())Object.entries($).forEach(([_,K])=>{if(K!==void 0)q.set(_,K)})}var V5$=B4();function pt($,q=[".env",".env.local"]){if(typeof process>"u"||!process.cwd)return null;let _=(()=>({})),K=(nJ(),J6(oJ)),P=$||process.cwd();while(!0){for(let O of q){let z=K.join(P,O);if(_.existsSync(z))return z}let Y=K.dirname(P);if(Y===P)break;P=Y}return null}function S5$($){if(typeof process>"u"||!process.cwd)return!1;let q=gM(),_=$||pt();if(!_)return!1;let K=q.config({path:_});if(K.error){if(typeof console<"u"&&console.warn)console.warn(`Failed to parse .env file at ${_}:`,K.error);return!1}return!0}class C2{globalStore;constructor($){this.globalStore=$}clear(){console.clear()}filterByLabel($){pM($,this.globalStore.cache).forEach((_)=>{j1(_)})}filterByNamespace(...$){cM($,this.globalStore.cache).forEach((_)=>{j1(_)})}filterByLevel($){mM($,this.globalStore.cache).forEach((_)=>{j1(_)})}renderAll(){this.globalStore.cache.forEach(($)=>{j1($)})}}class U4{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 C2(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 _=this._listenerCounter+=1;return v1({...z8.levels,...this.config.levels??{}},$).forEach((P)=>{if(this._levelsToListeners.has(P))this._levelsToListeners.get(P).set(_,q);else this._levelsToListeners.set(P,new Map([[_,q]]))}),_}removeListener($){this._levelsToListeners.forEach((q)=>{q.delete($)})}getListeners($){return Array.from(this._levelsToListeners.get($)?.values()??[])}}function LH($){return globalThis.$adzeGlobal=new U4($),globalThis.$adzeGlobal}function E2($){let q=globalThis.$adzeGlobal;if(ct(q))return q;let _=new U4($);return globalThis.$adzeGlobal=_,_}function ct($){return $ instanceof U4}function h_(){return typeof window<"u"&&typeof window.location<"u"&&typeof window.navigator.userAgent<"u"&&!mt()}function mt(){return typeof Deno<"u"}function dM($){return h_()}function lM(){let $=!1;if(h_())$=new URLSearchParams(globalThis.location.search).get("ADZE_ENV")==="test";return globalThis.$ADZE_ENV==="test"||$}function rM(){let $=globalThis;if(dM($))return $.navigator.userAgent.includes("Firefox");return!1}function F4($){return Object.prototype.toString.call($)==="[object String]"}function Q4($){return $!==null&&typeof $==="number"&&!isNaN(Number($))}function h2($){return yH.includes($)}function oM($){return BM.includes($)}function nM($){return gH.includes($)}function bH($){return $.every((q)=>F4(q))}function iM($){return Array.isArray($)&&$.length===3&&$[1]==="-"}function tM(){return Error().stack?.replace(/^Error\n/,`
414
414
  `)}function UM($){if(Q4($.activeLevel))return $.activeLevel;return $.levels[$.activeLevel].level}var pH=N8(QM(),1),aM=pH.default??pH;function cH($){return $.charAt(0).toUpperCase()+$.slice(1)}function mH($){return Object.values($).map((q)=>q.level)}function dH($,q,_){return $.filter((K)=>K>=q&&K<=_)}function lH($,q=!1,_){let P=(q&&_?9+_.length:9)-$.length,Y=$;for(let O=0;O<=P;O+=1)Y+=" ";return Y}function rH($,q){return q.reduce((_,K)=>{return aM[K](_)},$)}function j1($){if($.data)console[$.data.method](...$.data.message)}function eM($){return $.filter((q)=>q!=="")}function sM($){return typeof $==="object"&&$!==null}function v1($,q){if(q==="*")return Object.values($).map((_)=>_.level);if(F4(q))return[$[q].level];if(Q4(q))return[q];if(iM(q)){if(bH(q)){let _=$[q[0]].level,K=$[q[2]].level;return dH(mH($),_,K)}return dH(mH($),q[0],q[2])}if(Array.isArray(q)&&bH(q))return q.map((_)=>$[_].level);return q}function oH($,q,_){if(q.length===0)return!1;return $==="include"?!q.includes(_):q.includes(_)}function nH($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return!q.map((_)=>$.includes(_)).includes(!0)}function iH($,q){if($.length===0)return!1;if($.length>0&&q.length===0)return!0;return q.map((_)=>$.includes(_)).includes(!0)}function pM($,q){return q.filter((_)=>_.data?.label?.name===$)}function cM($,q){return q.filter((_)=>{if(_.data?.namespace)return _.data.namespace.map((P)=>$.includes(P)).includes(!0);return!1})}function mM($,q){return q.filter((_)=>{let K=v1(_.configuration.levels,$);if(_.data?.level===void 0)return!1;return oH("exclude",K,_.data.level)})}function BH($){if($&&$.length>0)return $.reduce((q,_)=>`${q}#${_} `,"");return""}function tH($){return $?`[${$.name}] `:""}function UH($){return $!==void 0?`(Count: ${$}) `:""}function FH($,q){return $!==void 0&&!$?`${q?"❌ ":""}Assertion failed:`:""}function QH($,q){return $!==void 0&&$?`${q?"✅ ":""}Expression passed:`:""}var R2=-1,a4=0,e4=1,s4=2,z1=3,W1=4,J1=5,H1=6,I2=7,D2=8;var $N=typeof self==="object"?self:globalThis,dt=($,q)=>{let _=(P,Y)=>{return $.set(Y,P),P},K=(P)=>{if($.has(P))return $.get(P);let[Y,O]=q[P];switch(Y){case a4:case R2:return _(O,P);case e4:{let z=_([],P);for(let T of O)z.push(K(T));return z}case s4:{let z=_({},P);for(let[T,H]of O)z[K(T)]=K(H);return z}case z1:return _(new Date(O),P);case W1:{let{source:z,flags:T}=O;return _(new RegExp(z,T),P)}case J1:{let z=_(new Map,P);for(let[T,H]of O)z.set(K(T),K(H));return z}case H1:{let z=_(new Set,P);for(let T of O)z.add(K(T));return z}case I2:{let{name:z,message:T}=O;return _(new $N[z](T),P)}case D2:return _(BigInt(O),P);case"BigInt":return _(Object(BigInt(O)),P)}return _(new $N[Y](O),P)};return K},aH=($)=>dt(new Map,$)(0);var $P="",{toString:lt}={},{keys:rt}=Object,T1=($)=>{let q=typeof $;if(q!=="object"||!$)return[a4,q];let _=lt.call($).slice(8,-1);switch(_){case"Array":return[e4,$P];case"Object":return[s4,$P];case"Date":return[z1,$P];case"RegExp":return[W1,$P];case"Map":return[J1,$P];case"Set":return[H1,$P]}if(_.includes("Array"))return[e4,_];if(_.includes("Error"))return[I2,_];return[s4,_]},L2=([$,q])=>$===a4&&(q==="function"||q==="symbol"),ot=($,q,_,K)=>{let P=(O,z)=>{let T=K.push(O)-1;return _.set(z,T),T},Y=(O)=>{if(_.has(O))return _.get(O);let[z,T]=T1(O);switch(z){case a4:{let f=O;switch(T){case"bigint":z=D2,f=O.toString();break;case"function":case"symbol":if($)throw TypeError("unable to serialize "+T);f=null;break;case"undefined":return P([R2],O)}return P([z,f],O)}case e4:{if(T)return P([T,[...O]],O);let f=[],w=P([z,f],O);for(let k of O)f.push(Y(k));return w}case s4:{if(T)switch(T){case"BigInt":return P([T,O.toString()],O);case"Boolean":case"Number":case"String":return P([T,O.valueOf()],O)}if(q&&"toJSON"in O)return Y(O.toJSON());let f=[],w=P([z,f],O);for(let k of rt(O))if($||!L2(T1(O[k])))f.push([Y(k),Y(O[k])]);return w}case z1:return P([z,O.toISOString()],O);case W1:{let{source:f,flags:w}=O;return P([z,{source:f,flags:w}],O)}case J1:{let f=[],w=P([z,f],O);for(let[k,S]of O)if($||!(L2(T1(k))||L2(T1(S))))f.push([Y(k),Y(S)]);return w}case H1:{let f=[],w=P([z,f],O);for(let k of O)if($||!L2(T1(k)))f.push(Y(k));return w}}let{message:H}=O;return P([z,{name:T,message:H}],O)};return Y},eH=($,{json:q,lossy:_}={})=>{let K=[];return ot(!(q||_),!!q,new Map,K)($),K};var sH=typeof structuredClone==="function"?($,q)=>q&&(("json"in q)||("lossy"in q))?aH(eH($,q)):structuredClone($):($,q)=>aH(eH($,q));function $T($,q,_,K){let{formatters:P,middleware:Y=[],...O}=q.exportValues();return class extends ${_cfg=new qP({...sH(O),formatters:{...P},middleware:[...Y]});_modifierData=sH(_);modifierQueue=[...K]}}function qT([$,q]){return`${$}s ${q/1e6}ms`}function qN(){return qT(b2())}function b2($){let q=performance.now()*0.001,_=Math.floor(q),K=Math.floor(q%1*1e9);if($===void 0)return[_,K];let P=_-$[0],Y=K-$[1];if(Y<0)P-=1,Y+=1e9;return[P,Y]}function _P($){let q=(Y)=>`${Math.floor(Math.abs(Y))}`.padStart(2,"0"),_=-$.getTimezoneOffset(),P=`${_>=0?"+":"-"}${q(_/60)}:${q(_%60)}`;return`${$.getFullYear()}-${q($.getMonth()+1)}-${q($.getDate())}T${q($.getHours())}:${q($.getMinutes())}:${q($.getSeconds())}${P}`}function _N($){let q=(h,C=2)=>String(h).padStart(C,"0"),_=q($.getDate()),P=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][$.getMonth()],Y=$.getFullYear(),O=q($.getHours()),z=q($.getMinutes()),T=q($.getSeconds()),H=-$.getTimezoneOffset(),f=H>=0?"+":"-",w=Math.abs(H),k=q(Math.floor(w/60)),S=q(w%60),N=`${f}${k}${S}`;return`${_}/${P}/${Y}:${O}:${z}:${T} ${N}`}class c8{cfg;level;timestampFormatFunction=($)=>_P($);constructor($,q){this.cfg=$,this.level=q}get timestampFormatter(){return this.cfg.timestampFormatter?this.cfg.timestampFormatter:this.timestampFormatFunction}print($,q,_){if(this.level.level>UM(this.cfg))return[];if(this.failsFilters($))return[];if($.assertion===!0)return[];if($.if===!1)return[];if($.method&&!nM($.method)){if(oM($.method)&&h2($.method))return _}let K=h_()?this.formatBrowser($,q,_):this.formatServer($,q,_);if($.stacktrace)K.push($.stacktrace);return K}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 $=v1(this.cfg.levels,this.cfg.filters.levels.values);if(oH(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 _=$.namespace??[];return nH(this.cfg.filters.namespaces.values,_)}let q=$.namespace??[];return iH(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 nH(this.cfg.filters.labels.values,q);return iH(this.cfg.filters.labels.values,q)}}class g2 extends c8{timestampFormatFunction=($)=>_N($);formatBrowser($,q,_){return this.formatMessage($,q,_)}formatServer($,q,_){return this.formatMessage($,q,_)}formatMessage($,q,_){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 K=this.cfg.meta.hostname,P=this.cfg.meta.ident??"-",Y=this.cfg.meta.user??"-",O=_[0];return[`${K} ${P} ${Y} [${q}] ${O}`]}}var KN=g2;function PN($){return typeof $.name==="string"&&typeof $.hostname==="string"}class y2 extends c8{timestampFormatFunction=($)=>_P($);formatBrowser($,q,_){return this.formatMessage($,q,_)}formatServer($,q,_){return this.formatMessage($,q,_)}formatMessage($,q,_){let K=E2(),P=[..._],Y=P.shift();if(PN(this.cfg.meta)){let{src:O,err:z,req_id:T,req:H,res:f,latency:w,hostname:k,name:S,...N}=this.cfg.meta,{namespace:h,label:C}=$,I={v:1,level:this.level.level,levelName:this.level.levelName,name:S,hostname:k,msg:Y,args:P,pid:K.pid,time:q,meta:Object.keys(N).length>0?N:void 0,namespace:h,label:C?.name,src:O,err:z,req_id:T,req:H,res:f,latency:w};return[JSON.stringify(I)]}return console.warn(Error("Adze: Required fields are missing from the log meta for generating a JSON log.")),[...P]}}var YN=y2;class u2 extends c8{formatBrowser($,q,_){let K=this.formatLeader(),P=this.formatMeta($,q);if(this.cfg.withEmoji)return[K,"font-size: 12px;",this.level.style,P,..._];return[K,this.level.style,P,..._]}formatServer($,q,_){let K=[],Y=`${lH(this.formatLeader(!1),this.cfg.withEmoji,this.level.emoji)} `,O=this.formatMeta($,q),z=rH(Y,this.level.terminalStyle);return K.push(z),O!==""&&K.push(O),[z,O,..._]}formatLeader($=!0){let q=$?"%c":"",_=" "+cH(this.level.levelName);if(this.cfg.withEmoji)return`${q}${this.formatEmoji($)}${q}${_}`;return`${q}${_}`}formatEmoji($){let q=$?" ":"";return this.level.emoji?`${this.level.emoji}${q}`:""}formatMeta($,q){let _=this.cfg.showTimestamp?`${q} `:"",K=BH($.namespace),P=tH($.label),Y=this.formatTime($),O=UH($.label?.count),z=FH($.assertion,this.cfg.withEmoji),T=QH($.if,this.cfg.withEmoji),H=z!==""?z:T!==""?T:"";return _+K+P+Y+O+H}formatTime($){let q=this.cfg.withEmoji?"⏱ ":"Time elapsed: ";if($.timeNow)return`(${q}${$.timeNow})`;return $.label?.timeElapsed?`(${q}${$.label.timeElapsed})`:""}}var _T=u2;class w1 extends c8{timestampFormatFunction=($)=>_P($);formatBrowser($,q,_){return this.formatMessage(q,$,_)}formatServer($,q,_){return this.formatMessage(q,$,_)}formatMessage($,q,_){let K="",{appname:P,hostname:Y,port:O}=this.cfg.meta,z=Q4(O)?`/${O}`:"",T=F4(P)?`${P}${z}`:"",H=F4(Y)?` on ${Y}: `:"",f=this.formatNamespace(q.namespace),w=q.label?`[${q.label.name}] `:"";return K=`${T}${H}${f}${w}`,[`[${$}] ${this.level.levelName.toUpperCase()}: ${K}${_[0]} `,_.map((k)=>sM(k)?JSON.stringify(k):k).slice(1).join(" ")]}formatNamespace($){if($&&$.length>0)return`${$.reduce((_,K,P)=>{return P===$.length-1?`${_}${K}`:`${_}${K}/`},"")} `;return""}}var gH=["group","groupCollapsed"],ON=["dir","dirxml","table",...gH],yH=["error","warn","info","log","debug",...ON],uH=["clear","groupEnd"],BM=[...ON,...uH],B2$=[...yH,...uH];var z8={activeLevel:"log",cache:!1,cacheSize:300,dump:!1,format:"pretty",meta:{},middleware:[],showTimestamp:!1,silent:!1,withEmoji:!1,levels:{alert:nt(),error:it(),warn:Bt(),info:tt(),fail:Ut(),success:Ft(),log:Qt(),debug:at(),verbose:et()},formatters:{default:_T,pretty:_T,standard:w1,common:KN,json:YN}};function nt($={}){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 it($={}){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 Bt($={}){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: ${rM()?"44px":"30px"};`,terminalStyle:["white","bgYellow"],method:"warn",emoji:"\uD83D\uDD14",...$}}function tt($={}){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 Ut($={}){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 Ft($={}){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 Qt($={}){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 at($={}){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 et($={}){return{levelName:"verbose",level:8,style:"font-size: 12px; padding-right: 22px; color: #999999;",terminalStyle:["black","italic"],method:"debug",emoji:"\uD83D\uDCAC",...$}}class qP{logCfg;glblCfg;constructor($){this.logCfg=$??{},this.glblCfg=globalThis.$adzeGlobal?.configuration}updateConfiguration($){this.logCfg=$}get activeLevel(){return this.glblCfg?.activeLevel??this.logCfg.activeLevel??z8.activeLevel}set activeLevel($){this.logCfg.activeLevel=$}get cache(){return this.glblCfg?.cache??this.logCfg.cache??z8.cache}set cache($){this.logCfg.cache=$}get cacheSize(){return this.glblCfg?.cacheSize??this.logCfg.cacheSize??z8.cacheSize}set cacheSize($){this.logCfg.cacheSize=$}get dump(){return this.glblCfg?.dump??this.logCfg.dump??z8.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??z8.silent}set silent($){this.logCfg.silent=$}get showTimestamp(){return this.glblCfg?.showTimestamp??this.logCfg.showTimestamp??z8.showTimestamp}set showTimestamp($){this.logCfg.showTimestamp=$}get withEmoji(){return this.glblCfg?.withEmoji??this.logCfg.withEmoji??z8.withEmoji}set withEmoji($){this.logCfg.withEmoji=$}get format(){return this.glblCfg?.format??this.logCfg.format??z8.format}set format($){this.logCfg.format=$}get levels(){return{...z8.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{...z8.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 st($){return typeof $==="function"}class KP{globalStore;_cfg;_modifierData;_data;modifierQueue=[];constructor($,q){this.globalStore=E2($),this._modifierData=q??{},this._cfg=new qP($),this.doHook((_)=>{if(_.constructed)_.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 $T(KP,this._cfg,this.modifierData,this.modifierQueue)}static seal($){return new this().seal($)}sealTag($,q){return this._cfg=new qP({...this._cfg.exportValues(),...q}),(_,...K)=>{let P=String.raw({raw:_},...K),Y=$T(KP,this._cfg,this.modifierData,this.modifierQueue),O=$;if(st(Y[O]))Y[O](P)}}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,_)=>{if(Object.keys(_._cfg.formatters).includes($))return _._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 _=this.globalStore.getLabel($)??{name:$};return q.label=_,this.globalStore.setLabel($,_),q}]),this}static label($){return new this().label($)}meta($){return this.modifierQueue.push(["meta",(q,_)=>{return _._cfg.meta={..._._cfg.meta,...$},q}]),this}static meta($){return new this().meta($)}namespace(...$){return this.modifierQueue.push(["namespace",(q)=>{let _=q.namespace??[];return q.namespace=_.length>0?[..._,...$]:$,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=b2();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=qT(b2($.label.timeStart));return $}]),this}static get timeEnd(){return new this().timeEnd}get timeNow(){return this.modifierQueue.push(["timeNow",($)=>{return $.timeNow=qN(),$}]),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=tM(),$}]),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(lM())return;if($.silent)return;if($.message.length<1)return;if(h2($.method))console[$.method](...$.message);else console[$.method]()}terminate($,q){this.doHook((I)=>{if(I.beforeTerminated)I.beforeTerminated(this,$,q)}),this.runModifierQueue();let _=this.getLevelConfig($),P=new(this.selectFormatter(this._cfg.format))(this._cfg,_),Y=P.timestampFormatter(new Date),O=eM(P.print(this.modifierData,Y,q));if(this._cfg.dump&&this.modifierData.label?.context)O.push(this.modifierData.label.context);this.doHook((I)=>{if(I.beforeFormatApplied)O=I.beforeFormatApplied(this,this._cfg.format,O)});let{activeLevel:z,cache:T,cacheSize:H,dump:f,format:w,meta:k,showTimestamp:S,silent:N,withEmoji:h}=this._cfg,C={activeLevel:z,cache:T,cacheSize:H,dump:f,format:w,meta:k,showTimestamp:S,silent:N,withEmoji:h,..._,...this._modifierData,terminator:$,args:q,timestamp:Y,message:O};if(this.doHook((I)=>{if(I.afterFormatApplied)I.afterFormatApplied(this,this._cfg.format,O)}),this._data=C,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(_.level).forEach((I)=>{I(this)})}selectFormatter($){return this._cfg.formatters[$]}getLevelConfig($){return this._cfg.levels[$]}runModifierQueue(){this.modifierQueue.forEach(([$,q])=>{let _=q(this.modifierData,this);this.doHook((K)=>{if(K.beforeModifierApplied)K.beforeModifierApplied(this,$,_)}),this._modifierData=_,this.doHook((K)=>{if(K.afterModifierApplied)K.afterModifierApplied(this,$,_)})})}doHook($){this._cfg.middleware?.forEach((q)=>{$(q)})}}class $U{targetEnvironment;environment=h_()?"browser":"server";dependencyLoaders=[];constructor($){if(this.targetEnvironment=$??"both",!h_()&&(this.targetEnvironment==="server"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadServerDependencies());if(h_()&&(this.targetEnvironment==="browser"||this.targetEnvironment==="both"))this.dependencyLoaders.push(this.loadBrowserDependencies())}async load(){await Promise.all(this.dependencyLoaders)}async loadServerDependencies(){}async loadBrowserDependencies(){}}var qU=["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"],jN=Object.freeze(qU);var vN=KP;var RN=N8(CN(),1),hY$={__noop:()=>{}},c2=new Set;function DY$($){return c2.add($),()=>c2.delete($)}function LY$($){c2.delete($)}var m2={trace:10,verbose:10,debug:20,success:27,progress:28,log:29,info:30,warn:40,error:50,fatal:60,alert:60},bU={10:"trace",20:"debug",27:"success",28:"progress",29:"log",30:"info",40:"warn",50:"error",60:"fatal"};function EN($,q){let _=m2[$.toLowerCase()]||30,K=m2[q.toLowerCase()]||30;return _>=K}function d2($){try{let q=new WeakSet;return JSON.stringify($,(_,K)=>{if(typeof K==="object"&&K!==null){if(q.has(K))return"[Circular]";q.add(K)}return K})}catch{return String($)}}function IN($){if(!$)return!1;let q=$.toLowerCase().trim();return q==="true"||q==="1"||q==="yes"||q==="on"}function gU($){if($===null)return"null";if($===void 0)return"undefined";if(typeof $==="string")return $;if(typeof $==="number"||typeof $==="boolean")return String($);if($ instanceof Error)return $.message;return d2($)}function p2($,q,_){if(_)return q;let K=$.src,P=K?`[${K.toUpperCase()}] `:"",Y=["src","agentId","agentName"],O=[];for(let[T,H]of Object.entries($)){if(Y.includes(T))continue;if(H===void 0)continue;O.push(`${T}=${gU(H)}`)}let z=O.length>0?` (${O.join(", ")})`:"";return`${P}${q}${z}`}var yU="info",l2=E_("LOG_LEVEL")||yU,bY$={fatal:60,error:50,warn:40,info:30,log:29,progress:28,success:27,debug:20,trace:10},mK=IN(E_("LOG_JSON_FORMAT")),jT=IN(E_("LOG_TIMESTAMPS")??"true"),uU=E_("SERVER_ID")||(typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID().slice(0,8):Math.random().toString(36).slice(2,10)),hN=RN.default({paths:["password","passwd","secret","token","apiKey","api_key","apiSecret","api_secret","authorization","auth","credential","credentials","privateKey","private_key","accessToken","access_token","refreshToken","refresh_token","cookie","session","jwt","bearer","*.password","*.secret","*.token","*.apiKey","*.api_key","*.authorization","*.credential","*.credentials","*.privateKey","*.accessToken","*.refreshToken"],serialize:!1,censor:"[REDACTED]"});function xU($=100){let q=[];return{write(_){if(q.push(_),q.length>$)q.shift();for(let K of c2)try{K(_)}catch{}},clear(){q.length=0},recentLogs(){return q.map((_)=>{let K=jT?new Date(_.time).toISOString():"",P=bU[_.level??30]||"info";return`${K} ${P} ${_.msg}`.trim()}).join(`
415
- `)}}}var Z1=xU(),DN=()=>{let $=l2.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"},pU=DN(),LN={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:""}},cU=LH({activeLevel:pU,format:mK?"json":"pretty",timestampFormatter:jT?void 0:()=>"",withEmoji:!1,levels:LN});cU.addListener("*",($)=>{try{let q=$.data,_=Array.isArray(q?.message)?q.message.map((P)=>typeof P==="string"?P:d2(P)).join(" "):typeof q?.message==="string"?q.message:"",K={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:_};Z1.write(K)}catch{}});function mU($){let q=vN,_=[];if(typeof $.namespace==="string")_.push($.namespace);if(Array.isArray($.namespaces))_.push(...$.namespaces);if(_.length>0)q=q.ns(..._);let K={...$};if(delete K.namespace,delete K.namespaces,!K.name)K.name="elizaos";if(!K.pid&&typeof process<"u"&&process.pid)K.pid=process.pid;if(!K.environment&&typeof process<"u"&&process.env)K.environment="development";if(!K.serverId)K.serverId=uU;if(mK&&!K.hostname){let Y="unknown";if(typeof process<"u"&&process.platform)Y=(BJ(),J6(iJ)).hostname();else if(typeof window<"u"&&window.location)Y=window.location.hostname||"browser";K.hostname=Y}let P={activeLevel:DN(),format:mK?"json":"pretty",timestampFormatter:jT?void 0:()=>"",withEmoji:!1,levels:LN};return q.meta(K).seal(P)}function dU($){let q=l2,_={},K;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")K=$.maxMemoryLogs;let{level:P,maxMemoryLogs:Y,...O}=$;_=O}return{level:q,base:_,maxMemoryLogs:K}}function X1($=!1){let{level:q,base:_,maxMemoryLogs:K}=dU($);if(typeof K==="number"&&K>0)Z1.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let s=(typeof q==="number"?"info":q||l2).toLowerCase(),F=(...W)=>{return W.map((X)=>{if(typeof X==="string")return X;if(X instanceof Error)return X.message;return d2(X)}).join(" ")},p=(W,...X)=>{if(!EN(W,s))return;let J=F(...X),Z=W==="fatal"?"error":W==="trace"||W==="verbose"?"debug":W==="success"||W==="progress"?"info":W==="log"?"log":(W in console)&&typeof console[W]==="function"?W:"log",V=console[Z];if(V&&typeof V==="function")V(J)},a=(W)=>{try{let X={...W};return hN(X),X}catch{return W}},j=(W,X,...J)=>{if(typeof W==="string")return X!==void 0?[W,X,...J]:[W,...J];if(W instanceof Error)return X!==void 0?[W.message,X,...J]:[W.message,...J];let Z=a(W);if(X!==void 0)return[p2(Z,X,!1),...J];let V=p2(Z,"",!1);return V?[V,...J]:[...J]};return{level:s,trace:(W,X,...J)=>p("trace",...j(W,X,...J)),debug:(W,X,...J)=>p("debug",...j(W,X,...J)),info:(W,X,...J)=>p("info",...j(W,X,...J)),warn:(W,X,...J)=>p("warn",...j(W,X,...J)),error:(W,X,...J)=>p("error",...j(W,X,...J)),fatal:(W,X,...J)=>p("fatal",...j(W,X,...J)),success:(W,X,...J)=>p("success",...j(W,X,...J)),progress:(W,X,...J)=>p("progress",...j(W,X,...J)),log:(W,X,...J)=>p("log",...j(W,X,...J)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(W)=>X1({level:s,..._,...W,__forceType:"browser"})}}let Y=mU(_),z=(typeof q==="number"?"info":q||l2).toLowerCase(),T=(o,s)=>{},H=(o,...s)=>{if(!EN(o,z))return;T(o,s);let F="";if(s.length>0)F=s.map((W)=>{if(typeof W==="string")return W;if(W instanceof Error)return W.message;return d2(W)}).join(" ");if(_.namespace)F=`#${_.namespace} ${F}`;let p={time:Date.now(),level:m2[o.toLowerCase()]||m2.info,msg:F};Z1.write(p);let a=o,j=s;if(o==="fatal")a="alert";else if(o==="progress")a="info",j=["[PROGRESS]",...s];else if(o==="success")a="info",j=["[SUCCESS]",...s];else if(o==="trace")a="verbose";try{let W=Y;if(a in W&&typeof W[a]==="function")W[a](...j)}catch{console.log(`[${o.toUpperCase()}]`,...s)}},f=(o)=>{try{let s={...o};return hN(s),s}catch{return o}},w=(o,s,...F)=>{if(typeof o==="string")return s!==void 0?[o,s,...F]:[o,...F];if(o instanceof Error)return s!==void 0?[o.message,{error:o},s,...F]:[o.message,{error:o},...F];let p=f(o);if(s!==void 0){if(!mK)return[p2(p,s,mK),...F];return[s,p,...F]}if(!mK){let a=p2(p,"",mK);return a?[a,...F]:[...F]}return[p,...F]};return{level:z,trace:(o,s,...F)=>H("verbose",...w(o,s,...F)),debug:(o,s,...F)=>H("debug",...w(o,s,...F)),info:(o,s,...F)=>H("info",...w(o,s,...F)),warn:(o,s,...F)=>H("warn",...w(o,s,...F)),error:(o,s,...F)=>H("error",...w(o,s,...F)),fatal:(o,s,...F)=>H("fatal",...w(o,s,...F)),success:(o,s,...F)=>H("success",...w(o,s,...F)),progress:(o,s,...F)=>H("progress",...w(o,s,...F)),log:(o,s,...F)=>H("log",...w(o,s,...F)),clear:()=>{if(typeof console?.clear==="function")console.clear();Z1.clear()},child:(o)=>{return X1({level:z,..._,...o})}}}var V6=X1(),gY$=V6,yY$=()=>Z1.recentLogs();var r2=V6;function gN($){return $.replace(/(?<!{){{(?![{#\/!>])([\s\S]*?)}}/g,(q,_)=>{if(_.trim()==="else")return`{{${_}}}`;return`{{{${_}}}}`})}var yN=({state:$,template:q})=>{let _=typeof q==="function"?q({state:$}):q,K=vT.default.compile(gN(_));return uN(K($),10)},A1=({state:$,template:q})=>{let _=typeof q==="function"?q({state:$}):q,K=vT.default.compile(gN(_)),O=Object.keys($).filter((T)=>!["text","values","data"].includes(T)).reduce((T,H)=>{return T[H]=$[H],T},{});return uN(K({...O,...$.values}),10)},oY$=($,q)=>{return q.length>0?`${$?`${$}
415
+ `)}}}var Z1=xU(),DN=()=>{let $=l2.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"},pU=DN(),LN={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:""}},cU=LH({activeLevel:pU,format:mK?"json":"pretty",timestampFormatter:jT?void 0:()=>"",withEmoji:!1,levels:LN});cU.addListener("*",($)=>{try{let q=$.data,_=Array.isArray(q?.message)?q.message.map((P)=>typeof P==="string"?P:d2(P)).join(" "):typeof q?.message==="string"?q.message:"",K={time:Date.now(),level:typeof q?.level==="number"?q.level:void 0,msg:_};Z1.write(K)}catch{}});function mU($){let q=vN,_=[];if(typeof $.namespace==="string")_.push($.namespace);if(Array.isArray($.namespaces))_.push(...$.namespaces);if(_.length>0)q=q.ns(..._);let K={...$};if(delete K.namespace,delete K.namespaces,!K.name)K.name="elizaos";if(!K.pid&&typeof process<"u"&&process.pid)K.pid=process.pid;if(!K.environment&&typeof process<"u"&&process.env)K.environment="development";if(!K.serverId)K.serverId=uU;if(mK&&!K.hostname){let Y="unknown";if(typeof process<"u"&&process.platform)Y=(BJ(),J6(iJ)).hostname();else if(typeof window<"u"&&window.location)Y=window.location.hostname||"browser";K.hostname=Y}let P={activeLevel:DN(),format:mK?"json":"pretty",timestampFormatter:jT?void 0:()=>"",withEmoji:!1,levels:LN};return q.meta(K).seal(P)}function dU($){let q=l2,_={},K;if(typeof $==="object"&&$!==null){if("level"in $)q=$.level;if("maxMemoryLogs"in $&&typeof $.maxMemoryLogs==="number")K=$.maxMemoryLogs;let{level:P,maxMemoryLogs:Y,...O}=$;_=O}return{level:q,base:_,maxMemoryLogs:K}}function X1($=!1){let{level:q,base:_,maxMemoryLogs:K}=dU($);if(typeof K==="number"&&K>0)Z1.clear();if(typeof $==="object"&&$&&"__forceType"in $&&$.__forceType==="browser"){let s=(typeof q==="number"?"info":q||l2).toLowerCase(),Q=(...W)=>{return W.map((X)=>{if(typeof X==="string")return X;if(X instanceof Error)return X.message;return d2(X)}).join(" ")},m=(W,...X)=>{if(!EN(W,s))return;let J=Q(...X),Z=W==="fatal"?"error":W==="trace"||W==="verbose"?"debug":W==="success"||W==="progress"?"info":W==="log"?"log":(W in console)&&typeof console[W]==="function"?W:"log",G=console[Z];if(G&&typeof G==="function")G(J)},e=(W)=>{try{let X={...W};return hN(X),X}catch{return W}},j=(W,X,...J)=>{if(typeof W==="string")return X!==void 0?[W,X,...J]:[W,...J];if(W instanceof Error)return X!==void 0?[W.message,X,...J]:[W.message,...J];let Z=e(W);if(X!==void 0)return[p2(Z,X,!1),...J];let G=p2(Z,"",!1);return G?[G,...J]:[...J]};return{level:s,trace:(W,X,...J)=>m("trace",...j(W,X,...J)),debug:(W,X,...J)=>m("debug",...j(W,X,...J)),info:(W,X,...J)=>m("info",...j(W,X,...J)),warn:(W,X,...J)=>m("warn",...j(W,X,...J)),error:(W,X,...J)=>m("error",...j(W,X,...J)),fatal:(W,X,...J)=>m("fatal",...j(W,X,...J)),success:(W,X,...J)=>m("success",...j(W,X,...J)),progress:(W,X,...J)=>m("progress",...j(W,X,...J)),log:(W,X,...J)=>m("log",...j(W,X,...J)),clear:()=>{if(typeof console.clear==="function")console.clear()},child:(W)=>X1({level:s,..._,...W,__forceType:"browser"})}}let Y=mU(_),z=(typeof q==="number"?"info":q||l2).toLowerCase(),T=(o,s)=>{},H=(o,...s)=>{if(!EN(o,z))return;T(o,s);let Q="";if(s.length>0)Q=s.map((W)=>{if(typeof W==="string")return W;if(W instanceof Error)return W.message;return d2(W)}).join(" ");if(_.namespace)Q=`#${_.namespace} ${Q}`;let m={time:Date.now(),level:m2[o.toLowerCase()]||m2.info,msg:Q};Z1.write(m);let e=o,j=s;if(o==="fatal")e="alert";else if(o==="progress")e="info",j=["[PROGRESS]",...s];else if(o==="success")e="info",j=["[SUCCESS]",...s];else if(o==="trace")e="verbose";try{let W=Y;if(e in W&&typeof W[e]==="function")W[e](...j)}catch{console.log(`[${o.toUpperCase()}]`,...s)}},f=(o)=>{try{let s={...o};return hN(s),s}catch{return o}},w=(o,s,...Q)=>{if(typeof o==="string")return s!==void 0?[o,s,...Q]:[o,...Q];if(o instanceof Error)return s!==void 0?[o.message,{error:o},s,...Q]:[o.message,{error:o},...Q];let m=f(o);if(s!==void 0){if(!mK)return[p2(m,s,mK),...Q];return[s,m,...Q]}if(!mK){let e=p2(m,"",mK);return e?[e,...Q]:[...Q]}return[m,...Q]};return{level:z,trace:(o,s,...Q)=>H("verbose",...w(o,s,...Q)),debug:(o,s,...Q)=>H("debug",...w(o,s,...Q)),info:(o,s,...Q)=>H("info",...w(o,s,...Q)),warn:(o,s,...Q)=>H("warn",...w(o,s,...Q)),error:(o,s,...Q)=>H("error",...w(o,s,...Q)),fatal:(o,s,...Q)=>H("fatal",...w(o,s,...Q)),success:(o,s,...Q)=>H("success",...w(o,s,...Q)),progress:(o,s,...Q)=>H("progress",...w(o,s,...Q)),log:(o,s,...Q)=>H("log",...w(o,s,...Q)),clear:()=>{if(typeof console?.clear==="function")console.clear();Z1.clear()},child:(o)=>{return X1({level:z,..._,...o})}}}var V6=X1(),gY$=V6,yY$=()=>Z1.recentLogs();var r2=V6;function gN($){return $.replace(/(?<!{){{(?![{#\/!>])([\s\S]*?)}}/g,(q,_)=>{if(_.trim()==="else")return`{{${_}}}`;return`{{{${_}}}}`})}var yN=({state:$,template:q})=>{let _=typeof q==="function"?q({state:$}):q,K=vT.default.compile(gN(_));return uN(K($),10)},A1=({state:$,template:q})=>{let _=typeof q==="function"?q({state:$}):q,K=vT.default.compile(gN(_)),O=Object.keys($).filter((T)=>!["text","values","data"].includes(T)).reduce((T,H)=>{return T[H]=$[H],T},{});return uN(K({...O,...$.values}),10)},oY$=($,q)=>{return q.length>0?`${$?`${$}
416
416
  `:$}${q}
417
417
  `:""},uN=($,q)=>{let _=Array.from({length:q},()=>i5({dictionaries:[B5]})),K=$;for(let P=0;P<_.length;P++)K=K.replaceAll(`{{name${P+1}}}`,_[P]);return K},nY$=({messages:$,entities:q,conversationHeader:_=!0})=>{let K={};return $.forEach((O)=>{if(O.roomId){if(!K[O.roomId])K[O.roomId]=[];K[O.roomId].push(O)}}),Object.values(K).forEach((O)=>{O.sort((z,T)=>(z.createdAt||0)-(T.createdAt||0))}),Object.entries(K).sort(([,O],[,z])=>(z[z.length-1]?.createdAt||0)-(O[O.length-1]?.createdAt||0)).map(([O,z])=>{let T=z.filter((f)=>f.entityId).map((f)=>{let w=q.find((N)=>N.id===f.entityId);if(!w)r2.warn({src:"core:utils",entityId:f.entityId},"No entity found for message");let k=w?.names[0]||"Unknown User",S=w?.names[0]||"unknown";return`Name: ${k} (@${S} EntityID:${f.entityId})
418
418
  MessageID: ${f.id}${f.content.inReplyTo?`
@@ -429,7 +429,7 @@ ${f.content.text}`});return`${_?`Conversation: ${O.slice(-5)}
429
429
  `)}).join(T.every((g)=>!g.text&&!g.description)?", ":`
430
430
  `)})`:null,f=new Date(K.createdAt||0),w=f.getHours().toString().padStart(2,"0"),k=f.getMinutes().toString().padStart(2,"0"),S=`${w}:${k}`,N=xN(K.createdAt||0),h=O?`(${z}'s internal thought: ${O})`:null,C=`${S} (${N}) [${K.entityId}]`,I=P?`${C} ${z}: ${P}`:null,D=Y&&Y.length>0?`${I?"":C} (${z}'s actions: ${Y.join(", ")})`:null;return[I,h,D,H].filter(Boolean).join(`
431
431
  `)}).join(`
432
- `)},xN=($)=>{let _=new Date().getTime()-$,K=Math.abs(_),P=Math.floor(K/1000),Y=Math.floor(P/60),O=Math.floor(Y/60),z=Math.floor(O/24);if(K<60000)return"just now";if(Y<60)return`${Y} minute${Y!==1?"s":""} ago`;if(O<24)return`${O} hour${O!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},lU=/```json\n([\s\S]*?)\n```/;function YK($){if(!$)return null;let q=null,_=$.indexOf("<response>");if(_!==-1){let O=_+10,z=$.indexOf("</response>",O);if(z!==-1)q=$.slice(O,z)}if(!q){let z=((T)=>{let H=0,f=T.length;while(H<f){let w=T.indexOf("<",H);if(w===-1)break;if(T.startsWith("</",w)||T.startsWith("<!--",w)||T.startsWith("<?",w)){H=w+1;continue}let k=w+1,S="";while(k<f){let L=T[k];if(/^[A-Za-z0-9_-]$/.test(L)){S+=L,k++;continue}break}if(!S){H=w+1;continue}let N=T.indexOf(">",k);if(N===-1)break;let h=T.slice(w,N+1);if(/\/\s*>$/.test(h)){H=N+1;continue}let C=`</${S}>`,I=1,D=N+1;while(I>0&&D<f){let L=T.indexOf(`<${S}`,D),g=T.indexOf(C,D);if(g===-1)break;if(L!==-1&&L<g){let y=T.indexOf(">",L+1);if(y===-1)break;let c=T.slice(L,y+1);if(/\/\s*>$/.test(c))D=y+1;else I++,D=y+1}else I--,D=g+C.length}if(I===0){let L=D-C.length,g=T.slice(N+1,L);return{tag:S,content:g}}H=N+1}return null})($);if(!z)return r2.warn({src:"core:utils"},"Could not find XML block in text"),null;q=z.content}let K={},Y=((O)=>{let z=[],T=O.length,H=0;while(H<T){let f=O.indexOf("<",H);if(f===-1)break;if(O.startsWith("</",f)||O.startsWith("<!--",f)||O.startsWith("<?",f)){H=f+1;continue}let w=f+1,k="";while(w<T){let y=O[w];if(/^[A-Za-z0-9_-]$/.test(y)){k+=y,w++;continue}break}if(!k){H=f+1;continue}let S=O.indexOf(">",w);if(S===-1)break;let N=O.slice(f,S+1);if(/\/\s*>$/.test(N)){H=S+1;continue}let h=`</${k}>`,C=1,I=S+1;while(C>0&&I<T){let y=O.indexOf(`<${k}`,I),c=O.indexOf(h,I);if(c===-1)break;if(y!==-1&&y<c){let o=O.indexOf(">",y+1);if(o===-1)break;let s=O.slice(y,o+1);if(!/\/\s*>$/.test(s))C++;I=o+1}else C--,I=c+h.length}if(C!==0){H=S+1;continue}let D=I-h.length,g=O.slice(S+1,D).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'").trim();z.push({key:k,value:g}),H=I}return z})(q);for(let{key:O,value:z}of Y)if(O==="actions"||O==="providers"||O==="evaluators")K[O]=z?z.split(",").map((T)=>T.trim()):[];else if(O==="simple")K[O]=z.toLowerCase()==="true";else K[O]=z;if(Object.keys(K).length===0)return r2.warn({src:"core:utils"},"No key-value pairs extracted from XML content"),null;return K}function BY$($){let q=$.match(lU),_=null;try{if(q)_=JSON.parse(bN(q[1].trim()));else _=JSON.parse(bN($.trim()))}catch{return null}if(_&&typeof _==="object"&&!Array.isArray(_))return _;return null}var bN=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,_,K)=>`"${_}": "${K}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function pN($,q){if($.length<=q)return $;let _=$.lastIndexOf(".",q-1);if(_!==-1){let Y=$.slice(0,_+1).trim();if(Y.length>0)return Y}let K=$.lastIndexOf(" ",q-1);if(K!==-1){let Y=$.slice(0,K).trim();if(Y.length>0)return`${Y}...`}return`${$.slice(0,q-3).trim()}...`}async function tY$($,q=512,_=20){return await new YW({chunkSize:Number(Math.floor(q*3.5)),chunkOverlap:Number(Math.floor(_*3.5))}).splitText($)}async function UY$($,q,_){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let K=await _.useModel(k6.TEXT_TOKENIZER_ENCODE,{prompt:$,modelType:k6.TEXT_TOKENIZER_ENCODE});if(K.length<=q)return $;let P=K.slice(-q);return await _.useModel(k6.TEXT_TOKENIZER_DECODE,{tokens:P,modelType:k6.TEXT_TOKENIZER_DECODE})}function FY$(){let $=new WeakSet;return function(q,_){if(typeof _==="object"&&_!==null){if($.has(_))return"[Circular]";$.add(_)}return _}}function n2($){if(!$)return!1;if(typeof $==="boolean")return $;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],_=["NO","N","FALSE","F","0","OFF","DISABLE"],K=$.trim().toUpperCase();if(q.includes(K))return!0;if(_.includes(K))return!1;return!1}var rU=i$.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 oU($){let q=rU.safeParse($);return q.success?q.data:null}function i2($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=oU($);if(q)return q;let _=encodeURIComponent($),P=nU(_).slice(0,16);return P[8]=P[8]&63|128,P[6]=P[6]&15|0,BU(P)}async function QY$($){if(!zT())return;let q=$.map(async(_)=>{let K=encodeURIComponent(_),P=await cN(K);dK.set(K,P)});await Promise.all(q)}var dK=new Map,o2=null;function zT(){if(o2!==null)return o2;if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return o2=!0,!0;return o2=!1,!1}function nU($){let q=dK.get($);if(q)return q;let _=mN($);if(dK.set($,_),zT())cN($).then((K)=>{dK.set($,K)}).catch(()=>{});if(dK.size>1e4)Array.from(dK.keys()).slice(0,5000).forEach((P)=>dK.delete(P));return _}async function cN($){if(zT()){let _=new TextEncoder().encode($),K=await globalThis.crypto.subtle.digest("SHA-1",_);return new Uint8Array(K)}return mN($)}function mN($){let q=iU($),_=q.length,K=new Uint8Array(_+9+63>>>6<<6);K.set(q),K[_]=128;let P=_*8,Y=new DataView(K.buffer);Y.setUint32(K.length-4,P>>>0,!1),Y.setUint32(K.length-8,Math.floor(P/4294967296)>>>0,!1);let O=1732584193,z=4023233417,T=2562383102,H=271733878,f=3285377520,w=new Uint32Array(80);for(let N=0;N<K.length;N+=64){for(let g=0;g<16;g++)w[g]=Y.getUint32(N+g*4,!1);for(let g=16;g<80;g++){let y=w[g-3]^w[g-8]^w[g-14]^w[g-16];w[g]=y<<1|y>>>31}let h=O,C=z,I=T,D=H,L=f;for(let g=0;g<80;g++){let y,c;if(g<20)y=C&I|~C&D,c=1518500249;else if(g<40)y=C^I^D,c=1859775393;else if(g<60)y=C&I|C&D|I&D,c=2400959708;else y=C^I^D,c=3395469782;let o=(h<<5|h>>>27)+y+L+c+w[g]>>>0;L=D,D=I,I=(C<<30|C>>>2)>>>0,C=h,h=o}O=O+h>>>0,z=z+C>>>0,T=T+I>>>0,H=H+D>>>0,f=f+L>>>0}let k=new Uint8Array(20),S=new DataView(k.buffer);return S.setUint32(0,O,!1),S.setUint32(4,z,!1),S.setUint32(8,T,!1),S.setUint32(12,H,!1),S.setUint32(16,f,!1),k}function iU($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let _=0;_<$.length;_++){let K=$.charCodeAt(_);if(K<128)q.push(K);else if(K<2048)q.push(192|K>>6,128|K&63);else if(K<55296||K>=57344)q.push(224|K>>12,128|K>>6&63,128|K&63);else{_++;let P=65536+((K&1023)<<10|$.charCodeAt(_)&1023);q.push(240|P>>18,128|P>>12&63,128|P>>6&63,128|P&63)}}return new Uint8Array(q)}function BU($){let q=[];for(let _=0;_<$.length;_++){let K=$[_].toString(16).padStart(2,"0");q.push(K)}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 aY$=($)=>{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 dN($){return`http://localhost:${E_("SERVER_PORT","3000")}${$}`}var lN=i$.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"),tU=i$.object({id:i$.string().describe("Unique identifier for the media"),url:i$.string().describe("URL of the media file"),title:i$.string().optional().describe("Media title"),source:i$.string().optional().describe("Media source"),description:i$.string().optional().describe("Media description"),text:i$.string().optional().describe("Text content associated with the media"),contentType:i$.nativeEnum(OP).optional().describe("Type of media content")}).loose().describe("Media attachment with URL and metadata"),UU=i$.object({text:i$.string().optional().describe("The main text content of the message"),thought:i$.string().optional().describe("Internal thought process or reasoning"),actions:i$.array(i$.string()).optional().describe("Actions to be taken in response"),providers:i$.array(i$.string()).optional().describe("Data providers to use (e.g., KNOWLEDGE)"),source:i$.string().optional().describe("Source of the content"),target:i$.string().optional().describe("Target of the content"),url:i$.string().optional().describe("Related URL"),inReplyTo:lN.optional().describe("UUID of message this is replying to"),attachments:i$.array(tU).optional().describe("Array of media attachments (images, videos, documents, etc.)"),channelType:i$.enum(jP).optional().describe("Type of channel this content is for")}).catchall(i$.unknown()).describe("Content structure for messages in conversation examples"),FU=i$.object({name:i$.string().describe("Name of the speaker (can use {{name1}} placeholder for dynamic names)"),content:UU}).describe("A single message in a conversation example"),QU=i$.object({directory:i$.string().describe("Path to a directory containing knowledge files"),shared:i$.boolean().optional().describe("Whether this knowledge is shared across characters")}).describe("Directory-based knowledge source"),aU=i$.union([i$.string().describe("File path to a knowledge document"),i$.object({path:i$.string().describe("Path to a knowledge file"),shared:i$.boolean().optional().describe("Whether this knowledge is shared across characters")}),QU]).describe("Knowledge source - can be a file path, file object, or directory"),eU=i$.union([i$.string().describe("Template string with placeholders"),i$.function().optional()]).describe("Template for generating text - can be a string template or function"),sU=i$.object({all:i$.array(i$.string()).optional().describe("Style guidelines applied to all types of responses"),chat:i$.array(i$.string()).optional().describe("Style guidelines specific to chat/conversation responses"),post:i$.array(i$.string()).optional().describe("Style guidelines specific to social media posts")}).optional().describe("Style configuration defining how the character communicates across different contexts"),$F=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number(),i$.object({}).loose(),i$.array(i$.unknown())])).optional().describe("Character-specific settings like avatar URL, preferences, and configuration"),qF=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number()])).optional().describe("Secret values and API keys (should not be committed to version control)"),_F=i$.object({id:lN.optional().describe("Unique identifier for the character"),name:i$.string().min(1,"Character name is required").describe('The name of the character (e.g., "Eliza")'),username:i$.string().optional().describe("Username for the character on various platforms"),system:i$.string().optional().describe("System prompt that defines the character's core behavior and response style"),templates:i$.record(i$.string(),eU).optional().describe("Custom templates for generating different types of content"),bio:i$.union([i$.string(),i$.array(i$.string())]).describe("Character biography - can be a single string or array of biographical points"),messageExamples:i$.array(i$.array(FU)).optional().describe("Example conversations showing how the character responds in different scenarios"),postExamples:i$.array(i$.string()).optional().describe("Example social media posts demonstrating the character's voice and topics"),topics:i$.array(i$.string()).optional().describe("Topics the character is knowledgeable about and engages with"),adjectives:i$.array(i$.string()).optional().describe("Adjectives that describe the character's personality and traits"),knowledge:i$.array(aU).optional().describe("Knowledge sources (files, directories) the character can reference"),plugins:i$.array(i$.string()).optional().describe('List of plugin package names to load (e.g., ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"] - these are commonly required)'),settings:$F,secrets:qF,style:sU}).strict().describe("Complete character definition including personality, behavior, and capabilities");function rN($){let q=_F.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 _O$($){try{let q=JSON.parse($);return rN(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function KO$($){return rN($).success}function I_(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function KF($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(I_())return Buffer.from(q,"hex");let _=new Uint8Array(q.length/2);for(let K=0;K<_.length;K++)_[K]=parseInt(q.substr(K*2,2),16);return _}function PF($,q="utf8"){if(I_()){let K=q==="utf-8"?"utf8":q;return Buffer.from($,K)}if(q==="base64"){let K=atob($),P=new Uint8Array(K.length);for(let Y=0;Y<K.length;Y++)P[Y]=K.charCodeAt(Y);return P}return new TextEncoder().encode($)}function oN($){if(I_()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),_="";for(let K=0;K<q.length;K++){let P=q[K].toString(16);_+=P.length===1?"0"+P:P}return _}function YF($,q="utf8"){if(I_()&&Buffer.isBuffer($)){let P=q==="utf-8"?"utf8":q;return $.toString(P)}let _=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return oN(_);if(q==="base64"){let P="";for(let Y=0;Y<_.length;Y++)P+=String.fromCharCode(_[Y]);return btoa(P)}return new TextDecoder().decode(_)}function WT($){if(!$)return!1;if(I_()&&Buffer.isBuffer($))return!0;if($ instanceof Uint8Array||$ instanceof ArrayBuffer)return!0;if(typeof $==="object"&&$!==null&&!Array.isArray($)){let q=$;return q.buffer instanceof ArrayBuffer&&typeof q.byteLength==="number"}return!1}function OF($){if(I_())return Buffer.alloc($);return new Uint8Array($)}function jF($){if(I_())return Buffer.from($);return new Uint8Array($)}function vF($){if(I_()&&$.every((P)=>Buffer.isBuffer(P)))return Buffer.concat($);let q=0;for(let P of $)q+=P.length;let _=new Uint8Array(q),K=0;for(let P of $){let Y=P instanceof Uint8Array?P:new Uint8Array(P);_.set(Y,K),K+=Y.length}return _}function zF($,q,_){if(I_()&&Buffer.isBuffer($))return $.slice(q,_);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,_)}function WF($,q){if($.length!==q.length)return!1;let _=$ instanceof Uint8Array?$:new Uint8Array($),K=q instanceof Uint8Array?q:new Uint8Array(q);for(let P=0;P<_.length;P++)if(_[P]!==K[P])return!1;return!0}function JF($){return $.length}function HF($){let q=new Uint8Array($),_=typeof globalThis<"u"?globalThis.crypto||globalThis.webcrypto:void 0;if(_&&typeof _.getRandomValues==="function")_.getRandomValues(q);else for(let K=0;K<$;K++)q[K]=Math.floor(Math.random()*256);return q}var OK={fromHex:KF,fromString:PF,fromBytes:jF,toHex:oN,toString:YF,isBuffer:WT,alloc:OF,concat:vF,slice:zF,equals:WF,byteLength:JF,randomBytes:HF};var jO$=($,q)=>{if(!$.length||q<=0)return"";let _=$.filter((O)=>O.examples&&Array.isArray(O.examples)&&O.examples.length>0);if(!_.length)return"";let K=_.map((O)=>[...O.examples||[]]),P=[],Y=K.map((O,z)=>O.length>0?z:-1).filter((O)=>O!==-1);while(P.length<q&&Y.length>0){let O=Math.floor(Math.random()*Y.length),z=Y[O],T=K[z],H=Math.floor(Math.random()*T.length);if(P.push(T.splice(H,1)[0]),T.length===0)Y.splice(O,1)}return TF(P)},TF=($)=>{return $.map((_)=>{let K=Array.from({length:5},()=>i5({dictionaries:[B5]}));return`
432
+ `)},xN=($)=>{let _=new Date().getTime()-$,K=Math.abs(_),P=Math.floor(K/1000),Y=Math.floor(P/60),O=Math.floor(Y/60),z=Math.floor(O/24);if(K<60000)return"just now";if(Y<60)return`${Y} minute${Y!==1?"s":""} ago`;if(O<24)return`${O} hour${O!==1?"s":""} ago`;return`${z} day${z!==1?"s":""} ago`},lU=/```json\n([\s\S]*?)\n```/;function YK($){if(!$)return null;let q=null,_=$.indexOf("<response>");if(_!==-1){let O=_+10,z=$.indexOf("</response>",O);if(z!==-1)q=$.slice(O,z)}if(!q){let z=((T)=>{let H=0,f=T.length;while(H<f){let w=T.indexOf("<",H);if(w===-1)break;if(T.startsWith("</",w)||T.startsWith("<!--",w)||T.startsWith("<?",w)){H=w+1;continue}let k=w+1,S="";while(k<f){let L=T[k];if(/^[A-Za-z0-9_-]$/.test(L)){S+=L,k++;continue}break}if(!S){H=w+1;continue}let N=T.indexOf(">",k);if(N===-1)break;let h=T.slice(w,N+1);if(/\/\s*>$/.test(h)){H=N+1;continue}let C=`</${S}>`,I=1,D=N+1;while(I>0&&D<f){let L=T.indexOf(`<${S}`,D),g=T.indexOf(C,D);if(g===-1)break;if(L!==-1&&L<g){let y=T.indexOf(">",L+1);if(y===-1)break;let p=T.slice(L,y+1);if(/\/\s*>$/.test(p))D=y+1;else I++,D=y+1}else I--,D=g+C.length}if(I===0){let L=D-C.length,g=T.slice(N+1,L);return{tag:S,content:g}}H=N+1}return null})($);if(!z)return r2.warn({src:"core:utils"},"Could not find XML block in text"),null;q=z.content}let K={},Y=((O)=>{let z=[],T=O.length,H=0;while(H<T){let f=O.indexOf("<",H);if(f===-1)break;if(O.startsWith("</",f)||O.startsWith("<!--",f)||O.startsWith("<?",f)){H=f+1;continue}let w=f+1,k="";while(w<T){let y=O[w];if(/^[A-Za-z0-9_-]$/.test(y)){k+=y,w++;continue}break}if(!k){H=f+1;continue}let S=O.indexOf(">",w);if(S===-1)break;let N=O.slice(f,S+1);if(/\/\s*>$/.test(N)){H=S+1;continue}let h=`</${k}>`,C=1,I=S+1;while(C>0&&I<T){let y=O.indexOf(`<${k}`,I),p=O.indexOf(h,I);if(p===-1)break;if(y!==-1&&y<p){let o=O.indexOf(">",y+1);if(o===-1)break;let s=O.slice(y,o+1);if(!/\/\s*>$/.test(s))C++;I=o+1}else C--,I=p+h.length}if(C!==0){H=S+1;continue}let D=I-h.length,g=O.slice(S+1,D).replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&").replace(/&quot;/g,'"').replace(/&apos;/g,"'").trim();z.push({key:k,value:g}),H=I}return z})(q);for(let{key:O,value:z}of Y)if(O==="actions"||O==="providers"||O==="evaluators")K[O]=z?z.split(",").map((T)=>T.trim()):[];else if(O==="simple")K[O]=z.toLowerCase()==="true";else K[O]=z;if(Object.keys(K).length===0)return r2.warn({src:"core:utils"},"No key-value pairs extracted from XML content"),null;return K}function BY$($){let q=$.match(lU),_=null;try{if(q)_=JSON.parse(bN(q[1].trim()));else _=JSON.parse(bN($.trim()))}catch{return null}if(_&&typeof _==="object"&&!Array.isArray(_))return _;return null}var bN=($)=>{return $=$.replace(/\{\s+/,"{").replace(/\s+\}/,"}").trim(),$=$.replace(/("[\w\d_-]+")\s*: \s*(?!"|\[)([\s\S]+?)(?=(,\s*"|\}$))/g,'$1: "$2"'),$=$.replace(/"([^"]+)"\s*:\s*'([^']*)'/g,(q,_,K)=>`"${_}": "${K}"`),$=$.replace(/("[\w\d_-]+")\s*:\s*([A-Za-z_]+)(?!["\w])/g,'$1: "$2"'),$};function pN($,q){if($.length<=q)return $;let _=$.lastIndexOf(".",q-1);if(_!==-1){let Y=$.slice(0,_+1).trim();if(Y.length>0)return Y}let K=$.lastIndexOf(" ",q-1);if(K!==-1){let Y=$.slice(0,K).trim();if(Y.length>0)return`${Y}...`}return`${$.slice(0,q-3).trim()}...`}async function tY$($,q=512,_=20){return await new YW({chunkSize:Number(Math.floor(q*3.5)),chunkOverlap:Number(Math.floor(_*3.5))}).splitText($)}async function UY$($,q,_){if(!$)throw Error("Trim tokens received a null prompt");if($.length<q/5)return $;if(q<=0)throw Error("maxTokens must be positive");let K=await _.useModel(k6.TEXT_TOKENIZER_ENCODE,{prompt:$,modelType:k6.TEXT_TOKENIZER_ENCODE});if(K.length<=q)return $;let P=K.slice(-q);return await _.useModel(k6.TEXT_TOKENIZER_DECODE,{tokens:P,modelType:k6.TEXT_TOKENIZER_DECODE})}function FY$(){let $=new WeakSet;return function(q,_){if(typeof _==="object"&&_!==null){if($.has(_))return"[Circular]";$.add(_)}return _}}function n2($){if(!$)return!1;if(typeof $==="boolean")return $;let q=["YES","Y","TRUE","T","1","ON","ENABLE"],_=["NO","N","FALSE","F","0","OFF","DISABLE"],K=$.trim().toUpperCase();if(q.includes(K))return!0;if(_.includes(K))return!1;return!1}var rU=i$.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 oU($){let q=rU.safeParse($);return q.success?q.data:null}function i2($){if(typeof $==="number")$=$.toString();if(typeof $!=="string")throw TypeError("Value must be string");let q=oU($);if(q)return q;let _=encodeURIComponent($),P=nU(_).slice(0,16);return P[8]=P[8]&63|128,P[6]=P[6]&15|0,BU(P)}async function QY$($){if(!zT())return;let q=$.map(async(_)=>{let K=encodeURIComponent(_),P=await cN(K);dK.set(K,P)});await Promise.all(q)}var dK=new Map,o2=null;function zT(){if(o2!==null)return o2;if(typeof globalThis<"u"&&globalThis.crypto&&globalThis.crypto.subtle&&typeof globalThis.crypto.subtle.digest==="function")return o2=!0,!0;return o2=!1,!1}function nU($){let q=dK.get($);if(q)return q;let _=mN($);if(dK.set($,_),zT())cN($).then((K)=>{dK.set($,K)}).catch(()=>{});if(dK.size>1e4)Array.from(dK.keys()).slice(0,5000).forEach((P)=>dK.delete(P));return _}async function cN($){if(zT()){let _=new TextEncoder().encode($),K=await globalThis.crypto.subtle.digest("SHA-1",_);return new Uint8Array(K)}return mN($)}function mN($){let q=iU($),_=q.length,K=new Uint8Array(_+9+63>>>6<<6);K.set(q),K[_]=128;let P=_*8,Y=new DataView(K.buffer);Y.setUint32(K.length-4,P>>>0,!1),Y.setUint32(K.length-8,Math.floor(P/4294967296)>>>0,!1);let O=1732584193,z=4023233417,T=2562383102,H=271733878,f=3285377520,w=new Uint32Array(80);for(let N=0;N<K.length;N+=64){for(let g=0;g<16;g++)w[g]=Y.getUint32(N+g*4,!1);for(let g=16;g<80;g++){let y=w[g-3]^w[g-8]^w[g-14]^w[g-16];w[g]=y<<1|y>>>31}let h=O,C=z,I=T,D=H,L=f;for(let g=0;g<80;g++){let y,p;if(g<20)y=C&I|~C&D,p=1518500249;else if(g<40)y=C^I^D,p=1859775393;else if(g<60)y=C&I|C&D|I&D,p=2400959708;else y=C^I^D,p=3395469782;let o=(h<<5|h>>>27)+y+L+p+w[g]>>>0;L=D,D=I,I=(C<<30|C>>>2)>>>0,C=h,h=o}O=O+h>>>0,z=z+C>>>0,T=T+I>>>0,H=H+D>>>0,f=f+L>>>0}let k=new Uint8Array(20),S=new DataView(k.buffer);return S.setUint32(0,O,!1),S.setUint32(4,z,!1),S.setUint32(8,T,!1),S.setUint32(12,H,!1),S.setUint32(16,f,!1),k}function iU($){if(typeof TextEncoder<"u")return new TextEncoder().encode($);let q=[];for(let _=0;_<$.length;_++){let K=$.charCodeAt(_);if(K<128)q.push(K);else if(K<2048)q.push(192|K>>6,128|K&63);else if(K<55296||K>=57344)q.push(224|K>>12,128|K>>6&63,128|K&63);else{_++;let P=65536+((K&1023)<<10|$.charCodeAt(_)&1023);q.push(240|P>>18,128|P>>12&63,128|P>>6&63,128|P&63)}}return new Uint8Array(q)}function BU($){let q=[];for(let _=0;_<$.length;_++){let K=$[_].toString(16).padStart(2,"0");q.push(K)}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 aY$=($)=>{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 dN($){return`http://localhost:${E_("SERVER_PORT","3000")}${$}`}var lN=i$.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"),tU=i$.object({id:i$.string().describe("Unique identifier for the media"),url:i$.string().describe("URL of the media file"),title:i$.string().optional().describe("Media title"),source:i$.string().optional().describe("Media source"),description:i$.string().optional().describe("Media description"),text:i$.string().optional().describe("Text content associated with the media"),contentType:i$.nativeEnum(OP).optional().describe("Type of media content")}).loose().describe("Media attachment with URL and metadata"),UU=i$.object({text:i$.string().optional().describe("The main text content of the message"),thought:i$.string().optional().describe("Internal thought process or reasoning"),actions:i$.array(i$.string()).optional().describe("Actions to be taken in response"),providers:i$.array(i$.string()).optional().describe("Data providers to use (e.g., KNOWLEDGE)"),source:i$.string().optional().describe("Source of the content"),target:i$.string().optional().describe("Target of the content"),url:i$.string().optional().describe("Related URL"),inReplyTo:lN.optional().describe("UUID of message this is replying to"),attachments:i$.array(tU).optional().describe("Array of media attachments (images, videos, documents, etc.)"),channelType:i$.enum(jP).optional().describe("Type of channel this content is for")}).catchall(i$.unknown()).describe("Content structure for messages in conversation examples"),FU=i$.object({name:i$.string().describe("Name of the speaker (can use {{name1}} placeholder for dynamic names)"),content:UU}).describe("A single message in a conversation example"),QU=i$.object({directory:i$.string().describe("Path to a directory containing knowledge files"),shared:i$.boolean().optional().describe("Whether this knowledge is shared across characters")}).describe("Directory-based knowledge source"),aU=i$.union([i$.string().describe("File path to a knowledge document"),i$.object({path:i$.string().describe("Path to a knowledge file"),shared:i$.boolean().optional().describe("Whether this knowledge is shared across characters")}),QU]).describe("Knowledge source - can be a file path, file object, or directory"),eU=i$.union([i$.string().describe("Template string with placeholders"),i$.function().optional()]).describe("Template for generating text - can be a string template or function"),sU=i$.object({all:i$.array(i$.string()).optional().describe("Style guidelines applied to all types of responses"),chat:i$.array(i$.string()).optional().describe("Style guidelines specific to chat/conversation responses"),post:i$.array(i$.string()).optional().describe("Style guidelines specific to social media posts")}).optional().describe("Style configuration defining how the character communicates across different contexts"),$F=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number(),i$.object({}).loose(),i$.array(i$.unknown())])).optional().describe("Character-specific settings like avatar URL, preferences, and configuration"),qF=i$.record(i$.string(),i$.union([i$.string(),i$.boolean(),i$.number()])).optional().describe("Secret values and API keys (should not be committed to version control)"),_F=i$.object({id:lN.optional().describe("Unique identifier for the character"),name:i$.string().min(1,"Character name is required").describe('The name of the character (e.g., "Eliza")'),username:i$.string().optional().describe("Username for the character on various platforms"),system:i$.string().optional().describe("System prompt that defines the character's core behavior and response style"),templates:i$.record(i$.string(),eU).optional().describe("Custom templates for generating different types of content"),bio:i$.union([i$.string(),i$.array(i$.string())]).describe("Character biography - can be a single string or array of biographical points"),messageExamples:i$.array(i$.array(FU)).optional().describe("Example conversations showing how the character responds in different scenarios"),postExamples:i$.array(i$.string()).optional().describe("Example social media posts demonstrating the character's voice and topics"),topics:i$.array(i$.string()).optional().describe("Topics the character is knowledgeable about and engages with"),adjectives:i$.array(i$.string()).optional().describe("Adjectives that describe the character's personality and traits"),knowledge:i$.array(aU).optional().describe("Knowledge sources (files, directories) the character can reference"),plugins:i$.array(i$.string()).optional().describe('List of plugin package names to load (e.g., ["@elizaos/plugin-sql", "@elizaos/plugin-bootstrap"] - these are commonly required)'),settings:$F,secrets:qF,style:sU}).strict().describe("Complete character definition including personality, behavior, and capabilities");function rN($){let q=_F.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 _O$($){try{let q=JSON.parse($);return rN(q)}catch(q){return{success:!1,error:{message:`Invalid JSON: ${q instanceof Error?q.message:"Unknown JSON parsing error"}`}}}}function KO$($){return rN($).success}function I_(){return typeof Buffer<"u"&&typeof Buffer.from==="function"}function KF($){let q=$.replace(/[^0-9a-fA-F]/g,"");if(I_())return Buffer.from(q,"hex");let _=new Uint8Array(q.length/2);for(let K=0;K<_.length;K++)_[K]=parseInt(q.substr(K*2,2),16);return _}function PF($,q="utf8"){if(I_()){let K=q==="utf-8"?"utf8":q;return Buffer.from($,K)}if(q==="base64"){let K=atob($),P=new Uint8Array(K.length);for(let Y=0;Y<K.length;Y++)P[Y]=K.charCodeAt(Y);return P}return new TextEncoder().encode($)}function oN($){if(I_()&&Buffer.isBuffer($))return $.toString("hex");let q=$ instanceof Uint8Array?$:new Uint8Array($),_="";for(let K=0;K<q.length;K++){let P=q[K].toString(16);_+=P.length===1?"0"+P:P}return _}function YF($,q="utf8"){if(I_()&&Buffer.isBuffer($)){let P=q==="utf-8"?"utf8":q;return $.toString(P)}let _=$ instanceof Uint8Array?$:new Uint8Array($);if(q==="hex")return oN(_);if(q==="base64"){let P="";for(let Y=0;Y<_.length;Y++)P+=String.fromCharCode(_[Y]);return btoa(P)}return new TextDecoder().decode(_)}function WT($){if(!$)return!1;if(I_()&&Buffer.isBuffer($))return!0;if($ instanceof Uint8Array||$ instanceof ArrayBuffer)return!0;if(typeof $==="object"&&$!==null&&!Array.isArray($)){let q=$;return q.buffer instanceof ArrayBuffer&&typeof q.byteLength==="number"}return!1}function OF($){if(I_())return Buffer.alloc($);return new Uint8Array($)}function jF($){if(I_())return Buffer.from($);return new Uint8Array($)}function vF($){if(I_()&&$.every((P)=>Buffer.isBuffer(P)))return Buffer.concat($);let q=0;for(let P of $)q+=P.length;let _=new Uint8Array(q),K=0;for(let P of $){let Y=P instanceof Uint8Array?P:new Uint8Array(P);_.set(Y,K),K+=Y.length}return _}function zF($,q,_){if(I_()&&Buffer.isBuffer($))return $.slice(q,_);return($ instanceof Uint8Array?$:new Uint8Array($)).slice(q,_)}function WF($,q){if($.length!==q.length)return!1;let _=$ instanceof Uint8Array?$:new Uint8Array($),K=q instanceof Uint8Array?q:new Uint8Array(q);for(let P=0;P<_.length;P++)if(_[P]!==K[P])return!1;return!0}function JF($){return $.length}function HF($){let q=new Uint8Array($),_=typeof globalThis<"u"?globalThis.crypto||globalThis.webcrypto:void 0;if(_&&typeof _.getRandomValues==="function")_.getRandomValues(q);else for(let K=0;K<$;K++)q[K]=Math.floor(Math.random()*256);return q}var OK={fromHex:KF,fromString:PF,fromBytes:jF,toHex:oN,toString:YF,isBuffer:WT,alloc:OF,concat:vF,slice:zF,equals:WF,byteLength:JF,randomBytes:HF};var jO$=($,q)=>{if(!$.length||q<=0)return"";let _=$.filter((O)=>O.examples&&Array.isArray(O.examples)&&O.examples.length>0);if(!_.length)return"";let K=_.map((O)=>[...O.examples||[]]),P=[],Y=K.map((O,z)=>O.length>0?z:-1).filter((O)=>O!==-1);while(P.length<q&&Y.length>0){let O=Math.floor(Math.random()*Y.length),z=Y[O],T=K[z],H=Math.floor(Math.random()*T.length);if(P.push(T.splice(H,1)[0]),T.length===0)Y.splice(O,1)}return TF(P)},TF=($)=>{return $.map((_)=>{let K=Array.from({length:5},()=>i5({dictionaries:[B5]}));return`
433
433
  ${_.map((Y)=>{let O=`${Y.name}: ${Y.content.text}`;for(let z=0;z<K.length;z++)O=O.replaceAll(`{{name${z+1}}}`,K[z]);return O}).join(`
434
434
  `)}`}).join(`
435
435
  `)};function vO$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>q.name).join(", ")}function zO$($){if(!$?.length)return"";return[...$].sort(()=>Math.random()-0.5).map((q)=>`- **${q.name}**: ${q.description||"No description available"}`).join(`
@@ -672,8 +672,8 @@ Here are the actions taken by the assistant to fulfill the request:
672
672
  <text>Your final message to the user</text>
673
673
  </response>
674
674
  </output>
675
- `;async function RO$($,q,_){let K=K_($,_),P=await $.getWorld(K);if(!P||!P.metadata?.roles)return"NONE";if(P.metadata.roles[q])return P.metadata.roles[q];return"NONE"}async function IO$($,q){if(!q)return V6.error({src:"core:roles",agentId:$.agentId},"User ID is required to find server"),null;let _=await $.getAllWorlds();if(!_||_.length===0)return V6.debug({src:"core:roles",agentId:$.agentId},"No worlds found for agent"),null;let K=[];for(let P of _)if(P.metadata?.ownership?.ownerId===q)K.push(P);return K.length?K:null}var Vq=[];for(let $=0;$<256;++$)Vq.push(($+256).toString(16).slice(1));function aN($,q=0){return(Vq[$[q+0]]+Vq[$[q+1]]+Vq[$[q+2]]+Vq[$[q+3]]+"-"+Vq[$[q+4]]+Vq[$[q+5]]+"-"+Vq[$[q+6]]+Vq[$[q+7]]+"-"+Vq[$[q+8]]+Vq[$[q+9]]+"-"+Vq[$[q+10]]+Vq[$[q+11]]+Vq[$[q+12]]+Vq[$[q+13]]+Vq[$[q+14]]+Vq[$[q+15]]).toLowerCase()}var wT,AF=new Uint8Array(16);function fT(){if(!wT){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wT=crypto.getRandomValues.bind(crypto)}return wT(AF)}var kF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZT={randomUUID:kF};function GF($,q,_){$=$||{};let K=$.random??$.rng?.()??fT();if(K.length<16)throw Error("Random bytes length must be >= 16");if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){if(_=_||0,_<0||_+16>q.length)throw RangeError(`UUID byte range ${_}:${_+15} is out of buffer bounds`);for(let P=0;P<16;++P)q[_+P]=K[P];return q}return aN(K)}function VF($,q,_){if(ZT.randomUUID&&!q&&!$)return ZT.randomUUID();return GF($,q,_)}var q8=VF;function G1($){if(typeof $!=="object"||$===null)return!1;if(Array.isArray($))return!1;if(WT($))return!1;if($ instanceof Date)return!1;if($ instanceof RegExp)return!1;if($ instanceof Map)return!1;if($ instanceof Set)return!1;if($ instanceof WeakMap)return!1;if($ instanceof WeakSet)return!1;if($ instanceof Error)return!1;if($ instanceof Promise)return!1;return!0}var V1=new Map;class XT{async handleMessage($,q,_,K){let P={maxRetries:K?.maxRetries??3,timeoutDuration:K?.timeoutDuration??3600000,useMultiStep:K?.useMultiStep??n2(String($.getSetting("USE_MULTI_STEP")||"")),maxMultiStepIterations:K?.maxMultiStepIterations??parseInt(String($.getSetting("MAX_MULTISTEP_ITERATIONS")||"6")),onStreamChunk:K?.onStreamChunk},Y=void 0,O=e2(q8());try{if($.logger.info({src:"service:message",agentId:$.agentId,entityId:q.entityId,roomId:q.roomId},"Message received"),!V1.has($.agentId))V1.set($.agentId,new Map);let z=V1.get($.agentId);if(!z)throw Error("Agent responses map not found");let T=z.get(q.roomId);if(T)V6.debug({src:"service:message",roomId:q.roomId,previousResponseId:T,responseId:O},"Updating response ID");z.set(q.roomId,O);let H=$.startRun(q.roomId),f=Date.now();await $.emitEvent("RUN_STARTED",{runtime:$,source:"messageHandler",runId:H,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:f,status:"started"});let w=new Promise((h,C)=>{Y=setTimeout(async()=>{await $.emitEvent("RUN_TIMEOUT",{runtime:$,source:"messageHandler",runId:H,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:f,status:"timeout",endTime:Date.now(),duration:Date.now()-f,error:"Run exceeded timeout"}),C(Error("Run exceeded timeout"))},P.timeoutDuration)}),k;if(P.onStreamChunk){let h=new B2;k={onStreamChunk:async(C,I)=>{if(h.done)return;let D=h.push(C);if(D)await P.onStreamChunk(D,I)},messageId:O}}let S=C1(k,()=>this.processMessage($,q,_,O,H,f,P)),N=await Promise.race([S,w]);return clearTimeout(Y),N}finally{clearTimeout(Y)}}async processMessage($,q,_,K,P,Y,O){try{let z=V1.get($.agentId);if(!z)throw Error("Agent responses map not found");if(q.entityId===$.agentId)return $.logger.debug({src:"service:message",agentId:$.agentId},"Skipping message from self"),await this.emitRunEnded($,P,q,Y,"self"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};$.logger.debug({src:"service:message",messagePreview:pN(q.content.text||"",50)},"Processing message"),$.logger.debug({src:"service:message"},"Saving message to memory");let T;if(q.id){let j=await $.getMemoryById(q.id);if(j)$.logger.debug({src:"service:message"},"Memory already exists, skipping creation"),T=j;else{let W=await $.createMemory(q,"messages");T={...q,id:W}}await $.queueEmbeddingGeneration(T,"high")}else{let j=await $.createMemory(q,"messages");q.id=j,T={...q,id:j},await $.queueEmbeddingGeneration(T,"normal")}let H=await $.getParticipantUserState(q.roomId,$.agentId);if(n2(String($.getSetting("BOOTSTRAP_DEFLLMOFF")||""))&&H===null)return $.logger.debug({src:"service:message"},"LLM is off by default"),await this.emitRunEnded($,P,q,Y,"off"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};if(H==="MUTED"&&!q.content.text?.toLowerCase().includes($.character.name.toLowerCase()))return $.logger.debug({src:"service:message",roomId:q.roomId},"Ignoring muted room"),await this.emitRunEnded($,P,q,Y,"muted"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};let w=await $.composeState(q,["ANXIETY","ENTITIES","CHARACTER","RECENT_MESSAGES","ACTIONS"],!0),k=q.content.mentionContext,S=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 N=this.shouldRespond($,q,S??void 0,k);$.logger.debug({src:"service:message",responseDecision:N},"Response decision");let h=!0;if(N.skipEvaluation)$.logger.debug({src:"service:message",agentName:$.character.name,reason:N.reason},"Skipping LLM evaluation"),h=N.shouldRespond;else{let j=A1({state:w,template:$.character.templates?.shouldRespondTemplate||BN});$.logger.debug({src:"service:message",agentName:$.character.name,reason:N.reason},"Using LLM evaluation");let W=await $.useModel(k6.TEXT_SMALL,{prompt:j});$.logger.debug({src:"service:message",response:W},"LLM evaluation result");let X=YK(W);$.logger.debug({src:"service:message",responseObject:X},"Parsed evaluation result");let J=["IGNORE","NONE"],Z=X?.action;h=typeof Z==="string"&&!J.includes(Z.toUpperCase())}let C=null,I=[],D="none";if(h){let j=O.useMultiStep?await this.runMultiStepCore($,q,w,_,O,K):await this.runSingleShotCore($,q,w,O,K);if(C=j.responseContent,I=j.responseMessages,w=j.state,D=j.mode,z.get(q.roomId)!==K)return $.logger.info({src:"service:message",agentId:$.agentId,roomId:q.roomId},"Response discarded - newer message being processed"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};if(C&&q.id)C.inReplyTo=K_($,q.id);if(C?.providers?.length&&C.providers.length>0)w=await $.composeState(q,C.providers||[]);if(C){if(D==="simple"){if(C.providers&&C.providers.length>0)$.logger.debug({src:"service:message",providers:C.providers},"Simple response used providers");if(_)await _(C)}else if(D==="actions")await $.processActions(q,I,w,async(X)=>{if($.logger.debug({src:"service:message",content:X},"Action callback"),C.actionCallbacks=X,_)return _(X);return[]},{onStreamChunk:O.onStreamChunk})}}else{$.logger.debug({src:"service:message"},"Agent decided not to respond");let j=z.get(q.roomId),W=n2(String($.getSetting("BOOTSTRAP_KEEP_RESP")||""));if(j!==K&&!W)return $.logger.info({src:"service:message",agentId:$.agentId,roomId:q.roomId},"Ignore response discarded - newer message being processed"),await this.emitRunEnded($,P,q,Y,"replaced"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};if(!q.id)return $.logger.error({src:"service:message",agentId:$.agentId},"Message ID is missing, cannot create ignore response"),await this.emitRunEnded($,P,q,Y,"noMessageId"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};let X={thought:"Agent decided not to respond to this message.",actions:["IGNORE"],simple:!0,inReplyTo:K_($,q.id)};if(_)await _(X);let J={id:e2(q8()),entityId:$.agentId,agentId:$.agentId,content:X,roomId:q.roomId,createdAt:Date.now()};await $.createMemory(J,"messages"),$.logger.debug({src:"service:message",memoryId:J.id},"Saved ignore response to memory")}if(z.delete(q.roomId),z.size===0)V1.delete($.agentId);await $.evaluate(q,w,h,async(j)=>{if($.logger.debug({src:"service:message",content:j},"Evaluate callback"),C)C.evalCallbacks=j;if(_)return _(j);return[]},I);let L="noname";if(q.metadata&&"entityName"in q.metadata&&typeof q.metadata.entityName==="string")L=q.metadata.entityName;let g=q.content?.channelType==="DM",y=L;if(!g){let j=await $.getRoomsByIds([q.roomId]);if(j?.length){let W=j[0];if(W.name)y=W.name;if(W.worldId){let X=await $.getWorld(W.worldId);if(X)y=X.name+"-"+y}}}let c=new Date,o=w.data?.providers,F=(typeof o==="object"&&o!==null&&"ACTIONS"in o?o.ACTIONS:void 0)?.data?.actionsData,p=Array.isArray(F)?F.map((j)=>j.name):[-1],a={at:c.toString(),timestamp:parseInt(""+c.getTime()/1000),messageId:q.id,userEntityId:q.entityId,input:q.content.text,thought:C?.thought,simple:C?.simple,availableActions:p,actions:C?.actions,providers:C?.providers,irt:C?.inReplyTo,output:C?.text,entityName:L,source:q.content.source,channelType:q.content.channelType,roomName:y};return await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:P,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:Y,status:"completed",endTime:Date.now(),duration:Date.now()-Y}),{didRespond:h,responseContent:C,responseMessages:I,state:w,mode:D}}catch(z){let T=z instanceof Error?z.message:String(z);throw $.logger.error({src:"service:message",agentId:$.agentId,error:z},"Error processing message"),await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:P,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:Y,status:"completed",endTime:Date.now(),duration:Date.now()-Y,error:T}),z}}shouldRespond($,q,_,K){if(!_)return{shouldRespond:!1,skipEvaluation:!0,reason:"no room context"};function P(N){if(!N||typeof N!=="string")return[];return N.trim().replace(/^\[|\]$/g,"").split(",").map((C)=>C.trim()).filter(Boolean)}let Y=["DM","VOICE_DM","SELF","API"],O=["client_chat"],z=P($.getSetting("ALWAYS_RESPOND_CHANNELS")||$.getSetting("SHOULD_RESPOND_BYPASS_TYPES")),T=P($.getSetting("ALWAYS_RESPOND_SOURCES")||$.getSetting("SHOULD_RESPOND_BYPASS_SOURCES")),H=new Set([...Y.map((N)=>N.toString()),...z].map((N)=>N.trim().toLowerCase())),f=[...O,...T].map((N)=>N.trim().toLowerCase()),w=_.type?.toString().toLowerCase(),k=q.content.source?.toLowerCase()||"";if(H.has(w))return{shouldRespond:!0,skipEvaluation:!0,reason:`private channel: ${w}`};if(f.some((N)=>k.includes(N)))return{shouldRespond:!0,skipEvaluation:!0,reason:`whitelisted source: ${k}`};if(!!(K?.isMention||K?.isReply))return{shouldRespond:!0,skipEvaluation:!0,reason:`platform ${K?.isMention?"mention":"reply"}`};return{shouldRespond:!1,skipEvaluation:!1,reason:"needs LLM evaluation"}}async processAttachments($,q){if(!q||q.length===0)return[];$.logger.debug({src:"service:message",count:q.length},"Processing attachments");let _=[];for(let K of q){let P={...K},Y=/^(http|https):\/\//.test(K.url),O=Y?K.url:dN(K.url);if(K.contentType==="image"&&!K.description){$.logger.debug({src:"service:message",imageUrl:K.url},"Generating image description");let z=O;if(!Y){let H=await fetch(O);if(!H.ok)throw Error(`Failed to fetch image: ${H.statusText}`);let f=await H.arrayBuffer(),w=Buffer.from(f);z=`data:${H.headers.get("content-type")||"application/octet-stream"};base64,${w.toString("base64")}`}let T=await $.useModel(k6.IMAGE_DESCRIPTION,{prompt:UN,imageUrl:z});if(typeof T==="string"){let H=YK(T);if(H&&(H.description||H.text))P.description=(typeof H.description==="string"?H.description:"")||"",P.title=(typeof H.title==="string"?H.title:"Image")||"Image",P.text=(typeof H.text==="string"?H.text:"")||(typeof H.description==="string"?H.description:"")||"",$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Generated image description");else{let f=T,w=f.match(/<title>([^<]+)<\/title>/),k=f.match(/<description>([^<]+)<\/description>/),S=f.match(/<text>([^<]+)<\/text>/);if(w||k||S)P.title=w?.[1]||"Image",P.description=k?.[1]||"",P.text=S?.[1]||k?.[1]||"",$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Used fallback XML parsing for description");else $.logger.warn({src:"service:message"},"Failed to parse XML response for image description")}}else if(T&&typeof T==="object"&&"description"in T){let H=T;P.description=H.description,P.title=H.title||"Image",P.text=H.description,$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Generated image description")}else $.logger.warn({src:"service:message"},"Unexpected response format for image description")}else if(K.contentType==="document"&&!K.text){let z=await fetch(O);if(!z.ok)throw Error(`Failed to fetch document: ${z.statusText}`);let T=z.headers.get("content-type")||"";if(T.startsWith("text/plain")){$.logger.debug({src:"service:message",documentUrl:K.url},"Processing plain text document");let f=await z.text();P.text=f,P.title=P.title||"Text File",$.logger.debug({src:"service:message",textPreview:P.text?.substring(0,100)},"Extracted text content")}else $.logger.warn({src:"service:message",contentType:T},"Skipping non-plain-text document")}_.push(P)}return _}async runSingleShotCore($,q,_,K,P){if(_=await $.composeState(q,["ACTIONS"]),!_.values?.actionNames)$.logger.warn({src:"service:message"},"actionNames data missing from state");let Y=A1({state:_,template:$.character.templates?.messageHandlerTemplate||tN}),O=null,z=0;while(z<K.maxRetries&&(!O?.thought||!O?.actions)){let f=await $.useModel(k6.TEXT_LARGE,{prompt:Y});$.logger.info({src:"service:message",responseLength:f.length,responsePreview:f.substring(0,500)},"Raw LLM response received");let w=YK(f);if($.logger.info({src:"service:message",parsedXml:w?{hasThought:!!w.thought,thoughtPreview:typeof w.thought==="string"?w.thought.substring(0,100):null,hasActions:!!w.actions,actions:w.actions,hasText:!!w.text,textPreview:typeof w.text==="string"?w.text.substring(0,100):null}:null},"Parsed XML content"),w){let k=typeof w.thought==="string"?w.thought:"",S=Array.isArray(w.actions)?w.actions.filter((I)=>typeof I==="string"):typeof w.actions==="string"?[w.actions]:["IGNORE"],N=Array.isArray(w.providers)?w.providers.filter((I)=>typeof I==="string"):[],h=typeof w.text==="string"?w.text:"",C=typeof w.simple==="boolean"?w.simple:!1;O={...w,thought:k,actions:S,providers:N,text:h,simple:C}}else O=null,$.logger.warn({src:"service:message",responsePreview:f.substring(0,300)},"parseKeyValueXml returned null - XML parsing failed");if(z++,!O?.thought||!O?.actions)$.logger.warn({src:"service:message",retries:z,maxRetries:K.maxRetries,hasThought:!!O?.thought,hasActions:!!O?.actions,actionsValue:O?.actions},"Missing required fields (thought or actions), retrying")}if(!O)return{responseContent:null,responseMessages:[],state:_,mode:"none"};if(O.actions&&O.actions.length>1){let f=(k)=>typeof k==="string"&&k.toUpperCase()==="IGNORE";if(O.actions.some(f))if(!O.text||O.text.trim()==="")O.actions=["IGNORE"];else{let k=O.actions.filter((S)=>!f(S));O.actions=k.length?k:["REPLY"]}}let T=O.actions?.length===1&&typeof O.actions[0]==="string"&&O.actions[0].toUpperCase()==="REPLY"&&(!O.providers||O.providers.length===0);O.simple=T,O.responseId=P;let H=[{id:P,entityId:$.agentId,agentId:$.agentId,content:O,roomId:q.roomId,createdAt:Date.now()}];return{responseContent:O,responseMessages:H,state:_,mode:T&&O.text?"simple":"actions"}}async runMultiStepCore($,q,_,K,P,Y){let O=[],z=_,T=0;while(T<P.maxMultiStepIterations){T++,$.logger.debug({src:"service:message",iteration:T,maxIterations:P.maxMultiStepIterations},"Starting multi-step iteration"),z=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]),z.data.actionResults=O;let h=A1({state:z,template:$.character.templates?.multiStepDecisionTemplate||FN}),C=await $.useModel(k6.TEXT_LARGE,{prompt:h}),I=YK(C);if(!I){$.logger.warn({src:"service:message",iteration:T},"Failed to parse multi-step result"),O.push({data:{actionName:"parse_error"},success:!1,error:"Failed to parse step result"});break}let D=typeof I.thought==="string"?I.thought:void 0,L=Array.isArray(I.providers)?I.providers:[],g=typeof I.action==="string"?I.action:void 0,y=I.isFinish;if(y==="true"||y===!0){if($.logger.info({src:"service:message",agentId:$.agentId,iteration:T},"Multi-step task completed"),K)await K({text:"",thought:typeof D==="string"?D:""});break}let c=Array.isArray(L)?L:[];if((!c||c.length===0)&&!g){$.logger.warn({src:"service:message",iteration:T},"No providers or action specified, forcing completion");break}for(let o of c){if(typeof o!=="string")continue;let s=$.providers.find((a)=>a.name===o);if(!s){$.logger.warn({src:"service:message",providerName:o},"Provider not found"),O.push({data:{actionName:o},success:!1,error:`Provider not found: ${o}`});continue}let F=await s.get($,q,_);if(!F){$.logger.warn({src:"service:message",providerName:o},"Provider returned no result"),O.push({data:{actionName:o},success:!1,error:"Provider returned no result"});continue}let p=!!F.text;if(O.push({data:{actionName:o},success:p,text:p?F.text:void 0,error:p?void 0:"Provider returned no result"}),K)await K({text:`\uD83D\uDD0E Provider executed: ${o}`,actions:[o],thought:typeof D==="string"?D:""})}if(g){let o={text:`\uD83D\uDD0E Executing action: ${g}`,actions:[g],thought:D||""};await $.processActions(q,[{id:q8(),entityId:$.agentId,roomId:q.roomId,createdAt:Date.now(),content:o}],_,async()=>{return[]});let s=$.stateCache?.get(`${q.id}_action_results`),F=Array.isArray(s?.values?.actionResults)?s.values.actionResults:[],p=F.length>0&&typeof F[0]==="object"&&F[0]!==null?F[0]:null,a=p&&"success"in p&&typeof p.success==="boolean"?p.success:!1;O.push({data:{actionName:typeof g==="string"?g:"unknown"},success:a,text:p&&"text"in p&&typeof p.text==="string"?p.text:void 0,values:p&&"values"in p&&typeof p.values==="object"&&p.values!==null?p.values:void 0,error:a?void 0:p&&("text"in p)&&typeof p.text==="string"?p.text:void 0})}}if(T>=P.maxMultiStepIterations)$.logger.warn({src:"service:message",maxIterations:P.maxMultiStepIterations},"Reached maximum iterations, forcing completion");z=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]);let H=A1({state:z,template:$.character.templates?.multiStepSummaryTemplate||QN}),f=await $.useModel(k6.TEXT_LARGE,{prompt:H}),w=YK(f),k=null,S=w?.text;if(typeof S==="string"&&S)k={actions:["MULTI_STEP_SUMMARY"],text:S,thought:(typeof w.thought==="string"?w.thought:"Final user-facing message after task completion.")||"Final user-facing message after task completion.",simple:!0,responseId:Y};let N=k?[{id:Y,entityId:$.agentId,agentId:$.agentId,content:k,roomId:q.roomId,createdAt:Date.now()}]:[];return{responseContent:k,responseMessages:N,state:z,mode:k?"simple":"none"}}async emitRunEnded($,q,_,K,P){await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:q,messageId:_.id,roomId:_.roomId,entityId:_.entityId,startTime:K,status:P,endTime:Date.now(),duration:Date.now()-K})}async deleteMessage($,q){try{if(!q.id){$.logger.error({src:"service:message",agentId:$.agentId},"Cannot delete memory: message ID is missing");return}$.logger.info({src:"service:message",agentId:$.agentId,messageId:q.id,roomId:q.roomId},"Deleting memory"),await $.deleteMemory(q.id),$.logger.debug({src:"service:message",messageId:q.id},"Successfully deleted memory")}catch(_){throw $.logger.error({src:"service:message",agentId:$.agentId,error:_},"Error in deleteMessage"),_}}async clearChannel($,q,_){try{$.logger.info({src:"service:message",agentId:$.agentId,channelId:_,roomId:q},"Clearing message memories from channel");let K=await $.getMemoriesByRoomIds({tableName:"messages",roomIds:[q]});$.logger.debug({src:"service:message",channelId:_,count:K.length},"Found message memories to delete");let P=0;for(let Y of K)if(Y.id)try{await $.deleteMemory(Y.id),P++}catch(O){$.logger.warn({src:"service:message",error:O,memoryId:Y.id},"Failed to delete message memory")}$.logger.info({src:"service:message",agentId:$.agentId,channelId:_,deletedCount:P,totalCount:K.length},"Cleared message memories from channel")}catch(K){throw $.logger.error({src:"service:message",agentId:$.agentId,error:K},"Error in clearChannel"),K}}}var D_=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},SF=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},MF=($)=>{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}},NF=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},eN=($,q)=>{return q>=2&&D_($[q-2])&&(q===2&&!D_($[q-1])||q>=3&&!D_($[q-3])&&!SF($[q-1]))},CF=($)=>{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,_=$.length-q,K=Array(_),P=!1;for(let f=0;f<_;++f){let w=$.charCodeAt(f+q);if(w===121&&(f===0||D_(K[f-1]))){P=!0,K[f]=89;continue}K[f]=w}if(K[_-1]===39)--_;if(_>=2&&K[_-2]===39&&K[_-1]===115)_-=2;let Y=0;while(Y<_&&!D_(K[Y]))++Y;if(Y<_)++Y;let O=Y;if(_>=5&&(K[0]===103&&K[1]===101&&K[2]===110&&K[3]===101&&K[4]===114||K[0]===97&&K[1]===114&&K[2]===115&&K[3]===101&&K[4]===110))O=5;else if(_>=6&&K[0]===99&&K[1]===111&&K[2]===109&&K[3]===109&&K[4]===117&&K[5]===110)O=6;else{while(O<_&&D_(K[O]))++O;if(O<_)++O}let z=O;while(z<_&&!D_(K[z]))++z;while(z<_&&D_(K[z]))++z;if(z<_)++z;if(_>=3){if(K[_-1]===115){if(_>=4&&K[_-2]===101&&K[_-3]===115&&K[_-4]===115)_-=2;else if(K[_-2]===101&&K[_-3]===105)_-=_>=5?2:1;else if(K[_-2]!==117&&K[_-2]!==115&&Y<_-1)_-=1}else if(K[_-1]===100&&K[_-2]===101&&K[_-3]===105)_-=_>=5?2:1}if(_===6&&(K[0]===105&&K[1]===110&&K[2]===110&&K[3]===105&&K[4]===110&&K[5]===103||K[0]===111&&K[1]===117&&K[2]===116&&K[3]===105&&K[4]===110&&K[5]===103||K[0]===101&&K[1]===120&&K[2]===99&&K[3]===101&&K[4]===101&&K[5]===100)||_===7&&(K[0]===99&&K[1]===97&&K[2]===110&&K[3]===110&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===104&&K[1]===101&&K[2]===114&&K[3]===114&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===101&&K[1]===97&&K[2]===114&&K[3]===114&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===112&&K[1]===114&&K[2]===111&&K[3]===99&&K[4]===101&&K[5]===101&&K[6]===100||K[0]===115&&K[1]===117&&K[2]===99&&K[3]===99&&K[4]===101&&K[5]===101&&K[6]===100)){let f="";for(let w=0;w<_;++w)f+=String.fromCharCode(K[w]);return f}let T=_>=2&&K[_-1]===121&&K[_-2]===108?_-2:_;if(T>=3)if(K[T-3]===101&&K[T-2]===101&&K[T-1]===100){if(T>=O+3)_=T-1}else{if(K[T-2]===101&&K[T-1]===100)T-=2;else if(K[T-3]===105&&K[T-2]===110&&K[T-1]===103)T-=3;else T=-1;if(T>=0&&Y<=T){if(_=T,_>=2){if(K[_-1]===116&&K[_-2]===97||K[_-1]===108&&K[_-2]===98||K[_-1]===122&&K[_-2]===105)K[_]=101,++_;else if(K[_-2]===K[_-1]&&NF(K[_-1]))--_;else if(O>=_&&eN(K,_))K[_]=101,++_}}}if(_>=3&&(K[_-1]===89||K[_-1]===121)&&!D_(K[_-2]))K[_-1]=105;if(_>=O+2)switch(K[_-1]){case 108:if(_>=O+6&&K[_-2]===97&&K[_-3]===110&&K[_-4]===111&&K[_-5]===105&&K[_-6]===116)if(_>=7&&K[_-7]===97){if(_>=O+7)_-=4,K[_-1]=101}else _-=2;break;case 110:if(_>=O+5&&K[_-2]===111&&K[_-3]===105&&K[_-4]===116&&K[_-5]===97)if(_>=7&&K[_-6]===122&&K[_-7]===105){if(_>=O+7)_-=4,K[_-1]=101}else _-=2,K[_-1]=101;break;case 114:if(_>=O+4){if(K[_-2]===101){if(K[_-3]===122&&K[_-4]===105)--_}else if(K[_-2]===111){if(K[_-3]===116&&K[_-4]===97)--_,K[_-1]=101}}break;case 115:if(_>=O+7&&K[_-2]===115&&K[_-3]===101&&K[_-4]===110&&(K[_-5]===108&&K[_-6]===117&&K[_-7]===102||K[_-5]===115&&K[_-6]===117&&K[_-7]===111||K[_-5]===101&&K[_-6]===118&&K[_-7]===105))_-=4;break;case 109:if(_>=O+5&&K[_-2]===115&&K[_-3]===105&&K[_-4]===108&&K[_-5]===97)_-=3;break;case 105:if(K[_-2]===99){if(_>=O+4&&(K[_-4]===101||K[_-4]===97)&&K[_-3]===110)K[_-1]=101}else if(K[_-2]===103){if(_>=O+3&&_>=4&&K[_-2]===103&&K[_-3]===111&&K[_-4]===108)--_}else if(K[_-2]===116){if(_>=O+5&&K[_-3]===105){if(K[_-4]===108){if(_>=6&&K[_-5]===105&&K[_-6]===98){if(_>=O+6)_-=3,K[_-2]=108,K[_-1]=101}else if(K[_-4]===108&&K[_-5]===97)_-=3}else if(K[_-4]===118&&K[_-5]===105)_-=2,K[_-1]=101}}else if(K[_-2]===108&&_>=3){if(K[_-3]===98){if(_>=4&&K[_-4]===97){if(_>=O+4)K[_-1]=101}else if(_>=O+3)K[_-1]=101}else if(K[_-3]===108){if(_>=5&&K[_-4]===117&&K[_-5]===102){if(_>=O+5)_-=2}else if(_>=O+4&&K[_-4]===97)_-=2}else if(K[_-3]===115){if(_>=6&&K[_-4]===115&&K[_-5]===101&&K[_-6]===108){if(_>=O+6)_-=2}else if(_>=O+5&&K[_-4]===117&&K[_-5]===111)_-=2}else if(_>=5&&K[_-3]===116&&K[_-4]===110&&K[_-5]===101){if(_>=O+5)_-=2}else if(MF(K[_-3]))_-=2}}if(_>=O+3)switch(K[_-1]){case 108:if(K[_-3]===99){if(_>=O+4&&K[_-4]===105&&K[_-2]===97)_-=2}else if(K[_-3]===102){if(K[_-2]===117)_-=3}else if(K[_-3]===110){if(_>=O+6&&K[_-2]===97&&K[_-4]===111&&K[_-5]===105&&K[_-6]===116)if(_>=7&&K[_-7]===97){if(_>=O+7)_-=4,K[_-1]=101}else _-=2}break;case 101:if(K[_-2]===122){if(_>=O+5&&K[_-3]===105&&K[_-4]===108&&K[_-5]===97)_-=3}else if(K[_-2]===116){if(_>=O+5&&K[_-3]===97&&K[_-4]===99&&K[_-5]===105)_-=3}else if(K[_-2]===118){if(_>=z+5&&K[_-3]===105&&K[_-4]===116&&K[_-5]===97)_-=5}break;case 105:if(_>=O+5&&K[_-2]===116&&K[_-3]===105&&K[_-4]===99&&K[_-5]===105)_-=3;break;case 115:if(_>=O+4&&K[_-2]===115&&K[_-3]===101&&K[_-4]===110)_-=4}if(_>=z+2)switch(K[_-1]){case 110:if(_>=z+3&&K[_-2]===111&&K[_-3]===105&&(K[_-4]===115||K[_-4]===116))_-=3;break;case 108:if(K[_-2]===97)_-=2;break;case 114:if(K[_-2]===101)_-=2;break;case 99:if(K[_-2]===105)_-=2;break;case 109:if(_>=z+3&&K[_-2]===115&&K[_-3]===105)_-=3;break;case 105:if(_>=z+3&&K[_-2]===116&&K[_-3]===105)_-=3;break;case 115:if(_>=z+3&&K[_-2]===117&&K[_-3]===111)_-=3;break;case 116:if(_>=z+3&&K[_-2]===110){if(K[_-3]===97)_-=3;else if(K[_-3]===101)if(_>=4&&K[_-4]===109){if(_>=5&&K[_-5]===101){if(_>=z+5)_-=5}else if(_>=z+4)_-=4}else _-=3}break;case 101:if(K[_-2]===99){if(_>=z+4&&K[_-3]===110&&(K[_-4]===97||K[_-4]===101))_-=4}else if(K[_-2]===108){if(_>=z+4&&K[_-3]===98&&(K[_-4]===97||K[_-4]===105))_-=4}else if(K[_-2]===116){if(_>=z+3&&K[_-3]===97)_-=3}else if(_>=z+3&&(K[_-2]===118||K[_-2]===122)&&K[_-3]===105)_-=3}if(_>=O+1&&(_>=z+1&&K[_-1]===108&&K[_-2]===108||K[_-1]===101&&(_>=z+1||!eN(K,_-1))))--_;let H="";if(P)for(let f=0;f<_;++f)H+=String.fromCharCode(K[f]===89?121:K[f]);else for(let f=0;f<_;++f)H+=String.fromCharCode(K[f]);return H},EF={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 AT{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...AT.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((_)=>({..._,pattern:typeof _.pattern==="string"?new RegExp(_.pattern):_.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let _=Date.now(),K=$.split(/\s+/).filter((z)=>z.length>0),Y=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),O=q?{originalWordCount:K.length,stopWordsRemoved:K.length-Y.length,stemmedWords:this.stemming?Y.length:0,processingTimeMs:Date.now()-_}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:Y,stats:O}}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,_=$;for(let K of this.stemmingRules){let P=_.match(K.pattern);if(P){if(!K.minMeasure||this.measure(_.substring(0,P.index))>=K.minMeasure){if(typeof K.replacement==="string")_=_.replace(K.pattern,K.replacement);else _=_.replace(K.pattern,(...Y)=>K.replacement(...Y));q=!0}}}if(q&&_!==$)return _;return CF(_)}isConsonant($,q){let _=$[q];if("aeiou".includes(_))return!1;return _!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,_=!1;for(let K=0;K<$.length;K++)if(this.isConsonant($,K)){if(_)q++,_=!1}else _=!0;return q}}class kT{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let _={...EF,...q};if(this.termFrequencySaturation=_.k1,this.lengthNormalizationFactor=_.b,this.tokenizer=new AT(_),this.fieldBoosts=_.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:K,termToIndex:P,documentFrequency:Y,averageDocLength:O,termFrequencies:z}=this.processDocuments($);this.documentLengths=K,this.termToIndex=P,this.documentFrequency=Y,this.averageDocLength=O,this.termFrequencies=z}}processDocuments($){let q=$.length,_=new Uint32Array(q),K=new Map,P=new Map,Y=new Map,O=0,z=0;$.forEach((H,f)=>{let w=0,k=new Map;Object.entries(H).forEach(([S,N])=>{if(typeof N!=="string")return;let h=this.fieldBoosts[S]||1,{tokens:C}=this.tokenizer.tokenize(N),I=C.length*h;w+=I,C.forEach((D)=>{if(!K.has(D))K.set(D,z++);let L=K.get(D);if(!P.has(D))P.set(D,new Set);P.get(D).add(f);let g=k.get(L)||0;k.set(L,g+h)})}),_[f]=w,O+=w,k.forEach((S,N)=>{if(!Y.has(N))Y.set(N,new Map);Y.get(N).set(f,S)})});let T=new Uint32Array(K.size);return P.forEach((H,f)=>{let w=K.get(f);T[w]=H.size}),{documentLengths:_,termToIndex:K,documentFrequency:T,averageDocLength:q>0?O/q:0,termFrequencies:Y}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,_)=>q+_,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:_}=this.tokenizer.tokenize($),K=new Float32Array(this.documentLengths.length).fill(0);return _.forEach((P)=>{let Y=this.termToIndex.get(P);if(Y===void 0)return;let O=this.calculateIdf(Y);if(O<=0)return;let z=this.termFrequencies.get(Y);if(!z)return;z.forEach((T,H)=>{let f=this.documentLengths[H],w=T*(this.termFrequencySaturation+1),k=T+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*f/this.averageDocLength);K[H]+=O*(w/k)})}),Array.from({length:K.length},(P,Y)=>({index:Y,score:K[Y]})).filter((P)=>P.score>0).sort((P,Y)=>Y.score-P.score).slice(0,q)}searchPhrase($,q=10){let{tokens:_}=this.tokenizer.tokenize($);if(_.length===0)return[];let K=null;for(let Y of _){let O=this.termToIndex.get(Y);if(O===void 0)return[];let z=this.termFrequencies.get(O)?.keys();if(!z)return[];let T=new Set(z);if(K===null)K=T;else K=new Set([...K].filter((H)=>T.has(H)));if(K.size===0)return[]}if(K===null||K.size===0)return[];let P=new Map;return K.forEach((Y)=>{let O=this.getDocument(Y),z=!1;Object.entries(O).forEach(([T,H])=>{if(typeof H!=="string"||z)return;let f=this.fieldBoosts[T]||1,{tokens:w}=this.tokenizer.tokenize(H);for(let k=0;k<=w.length-_.length;k++){let S=!0;for(let N=0;N<_.length;N++)if(w[k+N]!==_[N]){S=!1;break}if(S){let N=this.calculatePhraseScore(_,Y)*f;P.set(Y,(P.get(Y)||0)+N),z=!0;break}}})}),Array.from(P.entries()).map(([Y,O])=>({index:Y,score:O})).sort((Y,O)=>O.score-Y.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((_,K)=>{let P=this.termToIndex.get(K);if(P===void 0)return _;let Y=this.calculateIdf(P),O=this.termFrequencies.get(P)?.get(q)||0,z=this.documentLengths[q],T=O*(this.termFrequencySaturation+1),H=O+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return _+Y*(T/H)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let _=new Uint32Array(q+1);_.set(this.documentLengths,0),this.documentLengths=_;let K=0,P=new Map;Object.entries($).forEach(([Y,O])=>{if(typeof O!=="string")return;let z=this.fieldBoosts[Y]||1,{tokens:T}=this.tokenizer.tokenize(O);K+=T.length*z,T.forEach((H)=>{let f;if(!this.termToIndex.has(H)){if(f=this.termToIndex.size,this.termToIndex.set(H,f),this.documentFrequency.length<=f){let k=this.documentFrequency,S=Math.max(f+1,k.length*2||1);this.documentFrequency=new Uint32Array(S),this.documentFrequency.set(k,0)}this.documentFrequency[f]=0}else f=this.termToIndex.get(H);let w=P.get(f)||0;P.set(f,w+z)})}),this.documentLengths[q]=K,P.forEach((Y,O)=>{if(!this.termFrequencies.has(O))this.termFrequencies.set(O,new Map);if(this.termFrequencies.get(O).set(q,Y),O<this.documentFrequency.length)this.documentFrequency[O]++}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let K=this.documentLengths.length-q+0.5,P=q+0.5;return Math.log(1+K/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 hF={};class RF{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 GT{#$=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;elizaOS;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;currentRunId;currentRoomId;currentActionContext;maxWorkingMemoryEntries=50;messageService=null;constructor($){if(this.agentId=$.character?.id??$?.agentId??i2($.character?.name??q8()),this.character=$.character,this.initPromise=new Promise((q,_)=>{this.initResolver=q,this.initRejecter=_}),this.logger=X1({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??hF,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug({src:"agent",agentId:this.agentId,agentName:this.character?.name},"Initialized"),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=xM("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return q8()}startRun($){return this.currentRunId=this.createRunId(),this.currentRoomId=$,this.currentRunId}endRun(){this.currentRunId=void 0,this.currentRoomId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error({src:"agent",agentId:this.agentId,error:"Plugin or plugin name is undefined"},"Plugin registration failed"),Error("registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((_)=>_.name===$.name)){this.logger.warn({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin already registered, skipping");return}if(this.plugins.push($),this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin added"),$.init){let _={};if($.config){for(let[K,P]of Object.entries($.config))if(P!==null&&P!==void 0)_[K]=String(P)}await $.init(_,this),this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin initialized")}if($.adapter)this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Registering database adapter"),this.registerDatabaseAdapter($.adapter);if($.actions)for(let _ of $.actions)this.registerAction(_);if($.evaluators)for(let _ of $.evaluators)this.registerEvaluator(_);if($.providers)for(let _ of $.providers)this.registerProvider(_);if($.models)for(let[_,K]of Object.entries($.models))this.registerModel(_,K,$.name,$?.priority);if($.routes)for(let _ of $.routes){let K=_.path.startsWith("/")?_.path:`/${_.path}`;this.routes.push({..._,path:"/"+$.name+K})}if($.events)for(let[_,K]of Object.entries($.events))for(let P of K)this.registerEvent(_,P);if($.services)for(let _ of $.services){let K=_.serviceType;if(this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name,serviceType:K},"Registering service"),!this.servicePromises.has(K))this._createServiceResolver(K);this.serviceRegistrationStatus.set(K,"pending"),this.registerService(_).catch((P)=>{this.logger.error({src:"agent",agentId:this.agentId,plugin:$.name,serviceType:K,error:P instanceof Error?P.message:String(P)},"Service registration failed");let Y=this.servicePromiseHandlers.get(K);if(Y){let O=Error(`Service ${K} from plugin ${$.name} failed to register: ${P instanceof Error?P.message:String(P)}`);Y.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K)}this.serviceRegistrationStatus.set(K,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug({src:"agent",agentId:this.agentId},"Stopping runtime");for(let[$,q]of this.services){this.logger.debug({src:"agent",agentId:this.agentId,serviceType:$},"Stopping service");for(let _ of q)await _.stop()}this.elizaOS=void 0}async initialize($){let q=[],_=this.characterPlugins;for(let H of _)if(H)q.push(this.registerPlugin(H));if(await Promise.all(q),!this.adapter)throw this.logger.error({src:"agent",agentId:this.agentId},"Database adapter not initialized"),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();if(this.messageService=new XT,$?.skipMigrations??!1)this.logger.debug({src:"agent",agentId:this.agentId},"Skipping plugin migrations");else this.logger.debug({src:"agent",agentId:this.agentId},"Running plugin migrations"),await this.runPluginMigrations(),this.logger.debug({src:"agent",agentId:this.agentId},"Plugin migrations completed");let P=await this.ensureAgentExists({...this.character,id:this.agentId});if(!P){let H=`Agent ${this.agentId} does not exist in database after ensureAgentExists call`;throw Error(H)}if(P.settings){this.character.settings={...P.settings,...this.character.settings};let H=P.settings.secrets&&typeof P.settings.secrets==="object"?P.settings.secrets:{},f=this.character.settings.secrets&&typeof this.character.settings.secrets==="object"?this.character.settings.secrets:{},w=this.character.secrets&&typeof this.character.secrets==="object"?this.character.secrets:{},k={...H,...w,...f};if(Object.keys(k).length>0){let S={};for(let[N,h]of Object.entries(k))if(h!==null&&h!==void 0)S[N]=h;if(Object.keys(S).length>0)this.character.secrets=S,this.character.settings.secrets=S}}let Y=await this.getEntityById(this.agentId);if(!Y){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:P.id})){let f=`Failed to create entity for agent ${this.agentId}`;throw Error(f)}if(Y=await this.getEntityById(this.agentId),!Y)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug({src:"agent",agentId:this.agentId},"Agent entity created")}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,messageServerId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId))throw Error(`Failed to add agent ${this.agentId} as participant to its own room`);this.logger.debug({src:"agent",agentId:this.agentId},"Agent linked to room")}if(!this.getModel(k6.TEXT_EMBEDDING))this.logger.warn({src:"agent",agentId:this.agentId},"No TEXT_EMBEDDING model registered, skipping embedding setup");else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}async runPluginMigrations(){if(!this.adapter){this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter not found, skipping plugin migrations");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter does not support plugin migrations");return}let $=this.plugins.filter((K)=>K.schema).map((K)=>{let P=K.schema||{},Y={};for(let[O,z]of Object.entries(P))if(typeof z==="string"||typeof z==="number"||typeof z==="boolean"||z===null||typeof z==="object"&&z!==null&&!Array.isArray(z))Y[O]=z;return{name:K.name,schema:Y}});if($.length===0){this.logger.debug({src:"agent",agentId:this.agentId},"No plugins with schemas, skipping migrations");return}this.logger.debug({src:"agent",agentId:this.agentId,count:$.length},"Found plugins with schemas");let q=!1,_=process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true";await this.adapter.runPluginMigrations($,{verbose:!q,force:_,dryRun:!1}),this.logger.debug({src:"agent",agentId:this.agentId},"Plugin migrations completed")}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,_=!1){if(_){if(!this.character.secrets)this.character.secrets={};if(q!==null&&q!==void 0)this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};if(q!==null&&q!==void 0)this.character.settings[$]=q}}getSetting($){let q=this.character.settings,_=this.character.secrets,K=typeof q==="object"&&q!==null&&"secrets"in q&&typeof q.secrets==="object"&&q.secrets!==null?q.secrets:void 0,P=_?.[$]||q?.[$]||K?.[$]||this.settings[$];if(P===void 0||P===null)return null;if(typeof P==="number")return P;if(typeof P==="boolean")return P;if(typeof P==="string"){let Y=t2(P,L_());if(Y==="true")return!0;if(Y==="false")return!1;return Y}return null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter already registered, ignoring");else this.adapter=$,this.logger.debug({src:"agent",agentId:this.agentId},"Database adapter registered")}registerProvider($){this.providers.push($),this.logger.debug({src:"agent",agentId:this.agentId,provider:$.name},"Provider registered")}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn({src:"agent",agentId:this.agentId,action:$.name},"Action already registered, skipping");else this.actions.push($),this.logger.debug({src:"agent",agentId:this.agentId,action:$.name},"Action registered")}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,_){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn({src:"agent",agentId:this.agentId,index:q,stepsCount:$.steps?.length||0},"Invalid step index"),$;return{...$,steps:$.steps.map((K,P)=>P===q?{...K,..._}:K)}}async processActions($,q,_,K,P){let Y=[];for(let k of q)if(k.content?.actions&&k.content.actions.length>0)Y.push(...k.content.actions);let O=Y.length>1,z=this.getCurrentRunId(),T=this.createRunId(),H=void 0,f=q[0]?.content?.thought||`Executing ${Y.length} actions: ${Y.join(", ")}`;if(O)H={runId:T,totalSteps:Y.length,currentStep:0,steps:Y.map((k)=>({action:k,status:"pending"})),thought:f,startTime:Date.now()};let w=0;for(let k of q){let C=function(I){return I.toLowerCase().replace(/_/g,"")};if(!k.content?.actions||k.content.actions.length===0){this.logger.warn({src:"agent",agentId:this.agentId},"No action found in response");continue}let S=k.content.actions,N=[],h=_;this.logger.trace({src:"agent",agentId:this.agentId,actions:this.actions.map((I)=>C(I.name))},"Available actions");for(let I of S){if(H)H=this.updateActionPlan(H,{currentStep:w+1});if(h=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),H&&h.data)h.data.actionPlan=H,h.data.actionResults=N;this.logger.debug({src:"agent",agentId:this.agentId,action:I},"Processing action");let D=C(I),L=this.actions.find((V)=>C(V.name)===D);if(!L)L=this.actions.find((V)=>C(V.name).includes(D)||D.includes(C(V.name)));if(!L)for(let V of this.actions){if(V.similes?.find((v)=>C(v)===D)){L=V,this.logger.debug({src:"agent",agentId:this.agentId,action:L.name,match:"simile"},"Action resolved via simile");break}if(V.similes?.find((v)=>C(v).includes(D)||D.includes(C(v)))){L=V,this.logger.debug({src:"agent",agentId:this.agentId,action:L.name,match:"fuzzy"},"Action resolved via fuzzy match");break}}if(!L){let V=`Action not found: ${I}`;if(this.logger.error({src:"agent",agentId:this.agentId,action:I},"Action not found"),H&&H.steps[w])H=this.updateActionStep(H,w,{status:"failed",error:V});let M={id:q8(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:V,source:"auto",type:"action_result",actionName:I,actionStatus:"failed",runId:T}};await this.createMemory(M,"messages"),w++;continue}if(!L.handler){if(this.logger.error({src:"agent",agentId:this.agentId,action:L.name},"Action has no handler"),H&&H.steps[w])H=this.updateActionStep(H,w,{status:"failed",error:"No handler"});w++;continue}this.logger.debug({src:"agent",agentId:this.agentId,action:L.name},"Executing action");let g=q8(),y=q8();this.currentActionContext={actionName:L.name,actionId:g,prompts:[]};let o={actionContext:{previousResults:N,getPreviousResult:(V)=>{return N.find((M)=>M.data?.actionName===V)}}};if(H)o.actionPlan={totalSteps:H.totalSteps,currentStep:H.currentStep,steps:H.steps,thought:H.thought};if(P?.onStreamChunk)o.onStreamChunk=P.onStreamChunk;await this.emitEvent("ACTION_STARTED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${L.name}`,actions:[L.name],actionStatus:"executing",actionId:g,runId:T,type:"agent_action",thought:f,source:$.content?.source}});let s=[],F=async(V)=>{return V.responseId=y,s.push(V),[]},p;if(P?.onStreamChunk){let V=null;p={messageId:y,onStreamChunk:async(M,A)=>{if(!V)V=new TT;let v=V.push(M);if(v)await P.onStreamChunk(v,A)},onStreamEnd:()=>{V=null}}}let a=await C1(p,()=>L.handler(this,$,h,o,F,q)),j=a===void 0||a===null||typeof a==="boolean",W=null;if(!j){if(typeof a==="object"&&a!==null&&(("values"in a)||("data"in a)||("text"in a)))W={...a,success:"success"in a?a.success:!0};else W={success:!0,data:{actionName:L.name,legacyResult:a}};if(N.push(W),W.values){let V=Array.isArray(h.data?.actionResults)?h.data.actionResults:[];h={...h,values:{...h.values,...W.values},data:{...h.data||{},actionResults:[...V,W],actionPlan:H}}}if(W&&h.data){if(!h.data.workingMemory)h.data.workingMemory={};let M=`action_${W.data?.actionName||L.name}_${q8()}`,A={actionName:L.name,result:W,timestamp:Date.now()},v=h.data.workingMemory;v[M]=A;let G=Object.entries(v);if(G.length>this.maxWorkingMemoryEntries){let R=G.sort((E,b)=>{let x=E[1],l=b[1],Q=x?.timestamp??0;return(l?.timestamp??0)-Q});h.data.workingMemory=Object.fromEntries(R.slice(0,this.maxWorkingMemoryEntries))}}if(H&&H.steps[w])H=this.updateActionStep(H,w,{status:"completed",result:W})}let J=W?.success!==!1?"completed":"failed";if(await this.emitEvent("ACTION_COMPLETED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:W?.text||"",actions:[L.name],actionStatus:J,actionId:g,type:"agent_action",thought:f,actionResult:W,source:$.content?.source}}),K)for(let V of s)await K(V);let Z={id:g,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:W?.text||`Executed action: ${L.name}`,source:"action",type:"action_result",actionName:L.name,actionStatus:W?.success?"completed":"failed",actionResult:j?{legacy:a}:W,runId:T,...H&&{planStep:`${H.currentStep}/${H.totalSteps}`,planThought:H.thought}},metadata:{type:"action_result",actionName:L.name,runId:T,parentRunId:z,actionId:g,...H&&{totalSteps:H.totalSteps,currentStep:H.currentStep}}};await this.createMemory(Z,"messages"),this.logger.debug({src:"agent",agentId:this.agentId,action:L.name},"Action completed"),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:L.name,actionId:g,message:$.content.text,messageId:$.id,state:h,responses:q,result:j?{legacy:a}:W,isLegacyReturn:j,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:T,parentRunId:z,...H&&{planStep:`${H.currentStep}/${H.totalSteps}`,planThought:H.thought}}}),this.currentActionContext=void 0,w++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:N},data:{actionResults:N,actionPlan:H},text:JSON.stringify(N)})}}getActionResults($){return this.stateCache?.get(`${$}_action_results`)?.data?.actionResults||[]}async evaluate($,q,_,K,P){let Y=this.evaluators.map(async(z)=>{if(!z.handler)return null;if(!_&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}),O=(await Promise.all(Y)).filter(Boolean);if(O.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(O.map(async(z)=>{if(z.handler)await z.handler(this,$,q,{},K,P),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})})),O}async ensureConnections($,q,_,K){if(!$){this.logger.error({src:"agent",agentId:this.agentId},"ensureConnections called without entities");return}if(!q||q.length===0){this.logger.error({src:"agent",agentId:this.agentId},"ensureConnections called without rooms");return}await this.ensureWorldExists({...K,agentId:this.agentId});let P=q[0],Y=(g,y)=>g.reduce((c,o,s)=>{if(s%y===0)c.push([]);return c[c.length-1].push(o),c},[]),O=q.map((g)=>g.id),T=(await this.getRoomsByIds(O))?.map((g)=>g.id),H=O.filter((g)=>!T?.includes(g)),f={worldId:K.id,messageServerId:K.messageServerId,source:_,agentId:this.agentId};if(H.length){this.logger.debug({src:"agent",agentId:this.agentId,count:H.length},"Creating rooms");let g=q.filter((y)=>H.includes(y.id)).map((y)=>({...y,...f,type:y.type||"GROUP"}));await this.createRooms(g)}let w=$.map((g)=>g.id).filter((g)=>g!==void 0),S=(await this.adapter.getEntitiesByIds(w))?.map((g)=>g.id).filter((g)=>g!==void 0)||[],N=$.filter((g)=>g.id!==void 0&&!S.includes(g.id)),h={roomId:P.id,channelId:P.channelId,type:P.type},C={worldId:K.id,messageServerId:K.messageServerId};if(N.length){this.logger.debug({src:"agent",agentId:this.agentId,count:N.length},"Creating entities");let g={...h,...C,source:_,agentId:this.agentId},y=N.map((o)=>({...o,...g,metadata:o.metadata||{}})),c=Y(y,5000);for(let o of c)await this.createEntities(o)}await this.ensureParticipantInRoom(this.agentId,P.id);let D=(await this.getParticipantsForRoom(P.id)).filter((g)=>g!==void 0),L=w.filter((g)=>!D.includes(g));if(L.length){this.logger.debug({src:"agent",agentId:this.agentId,count:L.length,channelId:P.id},"Adding missing participants");let g=Y(L,5000);for(let y of g)await this.addParticipantsRoom(y,P.id)}this.logger.success({src:"agent",agentId:this.agentId,worldId:K.id},"World connected")}async ensureConnection({entityId:$,roomId:q,worldId:_,worldName:K,userName:P,name:Y,source:O,type:z,channelId:T,messageServerId:H,userId:f,metadata:w}){if(!_&&H)_=K_(this,H);let k=[Y,P].filter(Boolean),S={[O]:{id:f,name:Y,userName:P}},N=await this.getEntityById($);if(!N)if(await this.createEntity({id:$,names:k,metadata:S,agentId:this.agentId}))this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,userName:Y||P},"Entity created");else throw Error(`Failed to create entity ${$}`);else await this.adapter.updateEntity({id:$,names:[...new Set([...N.names||[],...k])].filter(Boolean),metadata:{...N.metadata,[O]:{...N.metadata?.[O]&&typeof N.metadata[O]==="object"?N.metadata[O]:{},id:f,name:Y,userName:P}},agentId:this.agentId});await this.ensureWorldExists({id:_,name:K||H?`World for server ${H}`:`World for room ${q}`,agentId:this.agentId,messageServerId:H,metadata:w}),await this.ensureRoomExists({id:q,name:Y||"default",source:O||"default",type:z||"DM",channelId:T,messageServerId:H,worldId:_}),await this.ensureParticipantInRoom($,q),await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,channelId:q},"Entity connected")}async ensureParticipantInRoom($,q){let _=await this.getEntityById($);if(!_&&$!==this.agentId)this.logger.warn({src:"agent",agentId:this.agentId,entityId:$},"Entity not accessible, attempting to add as participant");else if(!_&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!_)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({src:"agent",agentId:this.agentId,channelId:q},"Agent linked to room");else this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,channelId:q},"User linked to room")}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async isRoomParticipant($,q){return await this.adapter.isRoomParticipant($,q)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,messageServerId:_,metadata:K}){if(!await this.getWorld($))this.logger.debug({src:"agent",agentId:this.agentId,worldId:$,name:q,messageServerId:_},"Creating world"),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,messageServerId:_,metadata:K}),this.logger.debug({src:"agent",agentId:this.agentId,worldId:$,messageServerId:_},"World created")}async ensureRoomExists({id:$,name:q,source:_,type:K,channelId:P,messageServerId:Y,worldId:O,metadata:z}){if(!O)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:_,type:K,channelId:P,messageServerId:Y,worldId:O,metadata:z}),this.logger.debug({src:"agent",agentId:this.agentId,channelId:$},"Room created")}async composeState($,q=null,_=!1,K=!1){let P=_?q:null,Y={values:{},data:{},text:""},O=K||!$.id?Y:await this.stateCache.get($.id)||Y,z=new Set;if(P&&P.length>0)P.forEach((h)=>z.add(h));else this.providers.filter((h)=>!h.private&&!h.dynamic).forEach((h)=>z.add(h.name));if(!P&&q&&q.length>0)q.forEach((h)=>z.add(h));let T=Array.from(new Set(this.providers.filter((h)=>z.has(h.name)))).sort((h,C)=>(h.position||0)-(C.position||0)),H=await Promise.all(T.map(async(h)=>{let C=Date.now(),I=await h.get(this,$,O),D=Date.now()-C;if(D>100)this.logger.debug({src:"agent",agentId:this.agentId,provider:h.name,duration:D},"Slow provider");return{...I,providerName:h.name}})),f={...O.data?.providers||{}};for(let h of H)f[h.providerName]=h;let w=[];for(let h of T){let C=f[h.name];if(C&&C.text&&typeof C.text==="string"&&C.text.trim()!=="")w.push(C.text)}let k=w.join(`
676
- `),S={...O.values||{}};for(let h of T){let C=f[h.name];if(C&&C.values&&typeof C.values==="object"&&C.values!==null)Object.assign(S,C.values)}for(let h in f)if(!T.some((C)=>C.name===h)){let C=f[h];if(C&&C.values&&typeof C.values==="object"&&C.values!==null)Object.assign(S,C.values)}let N={values:{...S,providers:k},data:{...O.data||{},providers:f},text:k};if($.id)this.stateCache.set($.id,N);return N}getService($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug({src:"agent",agentId:this.agentId,serviceName:$},"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({src:"agent",agentId:this.agentId,serviceName:$},"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,_]of this.services)$[q]={status:this.getServiceRegistrationStatus(q),instances:_.length,hasPromise:this.servicePromises.has(q)};for(let[q,_]of this.serviceRegistrationStatus)if(!$[q])$[q]={status:_,instances:0,hasPromise:this.servicePromises.has(q)};return $}async registerService($){let q=$.serviceType,_=$.name||"Unknown";if(!q){this.logger.warn({src:"agent",agentId:this.agentId,serviceName:_},"Service missing serviceType property");return}this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Registering service"),this.serviceRegistrationStatus.set(q,"registering"),this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service waiting for init");let K=new Promise((O,z)=>{setTimeout(()=>{z(Error(`Service ${q} registration timed out waiting for runtime initialization (30s timeout)`))},30000)});if(await Promise.race([this.initPromise,K]),typeof $.start!=="function")throw Error(`Service ${q} does not have a static start method. All services must implement static async start(runtime: IAgentRuntime): Promise<Service>.`);let P=await $.start(this);if(!P)throw Error(`Service ${q} start() method returned null or undefined. It must return a Service instance.`);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 Y=this.servicePromiseHandlers.get(q);if(Y)Y.resolve(P),this.servicePromiseHandlers.delete(q);else this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service has no promise handler");if($.registerSendHandlers)$.constructor.registerSendHandlers?.(this,P);this.serviceRegistrationStatus.set(q,"registered"),this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service registered")}_createServiceResolver($){let q,_;if(this.servicePromises.set($,new Promise((K,P)=>{q=K,_=P})),!q)throw Error(`Failed to create resolver for service ${$}`);if(!_)throw Error(`Failed to create rejecter for service ${$}`);return this.servicePromiseHandlers.set($,{resolve:q,reject:_}),this.servicePromises.get($)}getServiceLoadPromise($){let q=this.servicePromises.get($);if(!q)q=this._createServiceResolver($);return q}registerModel($,q,_,K){let P=typeof $==="string"?$:k6[$];if(!this.models.has(P))this.models.set(P,[]);let Y=Date.now();this.models.get(P)?.push({handler:q,provider:_,priority:K||0,registrationOrder:Y}),this.models.get(P)?.sort((O,z)=>{if((z.priority||0)!==(O.priority||0))return(z.priority||0)-(O.priority||0);return(O.registrationOrder||0)-(z.registrationOrder||0)})}getModel($){let q=typeof $==="string"?$:k6[$],_=this.models.get(q);if(!_?.length)return;return this.logger.debug({src:"agent",agentId:this.agentId,model:q,provider:_[0].provider},"Using model"),_[0].handler}getModelSettings($){let q={},_=(k,S)=>{if($){let C=`${$}_${k}`,I=this.getSetting(C);if(I!==null&&I!==void 0){let D=Number(I);if(!isNaN(D))return D}}let N=`DEFAULT_${k}`,h=this.getSetting(N);if(h!==null&&h!==void 0){let C=Number(h);if(!isNaN(C))return C}if(S){let C=this.getSetting(S);if(C!==null&&C!==void 0){let I=Number(C);if(!isNaN(I))return I}}return null},K=_("MAX_TOKENS",vP.MODEL_MAX_TOKEN),P=_("TEMPERATURE",vP.MODEL_TEMPERATURE),Y=_("TOP_P"),O=_("TOP_K"),z=_("MIN_P"),T=_("SEED"),H=_("REPETITION_PENALTY"),f=_("FREQUENCY_PENALTY",vP.MODEL_FREQ_PENALTY),w=_("PRESENCE_PENALTY",vP.MODEL_PRESENCE_PENALTY);if(K!==null)q.maxTokens=K;if(P!==null)q.temperature=P;if(Y!==null)q.topP=Y;if(O!==null)q.topK=O;if(z!==null)q.minP=z;if(T!==null)q.seed=T;if(H!==null)q.repetitionPenalty=H;if(f!==null)q.frequencyPenalty=f;if(w!==null)q.presencePenalty=w;return Object.keys(q).length>0?q:null}async useModel($,q,_){let K=typeof $==="string"?$:k6[$],P=q,Y=(P&&"prompt"in P&&typeof P.prompt==="string"?P.prompt:null)||(P&&"input"in P&&typeof P.input==="string"?P.input:null)||(P&&"messages"in P&&Array.isArray(P.messages)?JSON.stringify(P.messages):null),O=this.getModel(K),z=_&&this.models.get(K)?.find((y)=>y.provider===_),T=z?z.handler:O;if(!T){let y=`No handler found for delegate type: ${K}`;throw Error(y)}if(![k6.TRANSCRIPTION,k6.IMAGE,k6.AUDIO,k6.VIDEO].includes(K))this.logger.trace({src:"agent",agentId:this.agentId,model:K,params:q},"Model input");else{let y="unknown size";if(Buffer.isBuffer(q))y=`${q.length} bytes`;else if(typeof Blob<"u"&&q instanceof Blob)y=`${q.size} bytes`;else if(typeof q==="object"&&q!==null){if("audio"in q&&Buffer.isBuffer(q.audio))y=`${q.audio.length} bytes`;else if("audio"in q&&typeof Blob<"u"&&q.audio instanceof Blob)y=`${q.audio.size} bytes`}this.logger.trace({src:"agent",agentId:this.agentId,model:K,size:y},"Model input (binary)")}let f;if(q===null||q===void 0||typeof q!=="object"||Array.isArray(q)||OK.isBuffer(q))f=q;else{let y=this.getModelSettings(K);if(y)f={...y,...q};else f=q;if(G1(f)){if(f.user===void 0&&this.character?.name){if(typeof f==="object"&&f!==null&&!Array.isArray(f))f.user=this.character.name}}}let w=typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now(),k=a2(),S=G1(f)?f.onStreamChunk:void 0,N=k?.onStreamChunk,h=k?.messageId,C=k?.abortSignal,I=G1(f)?f.stream:void 0,D=I===!1?!1:!!(S||N||I);if(G1(f))f.stream=D,delete f.onStreamChunk;let L=await T(this,f);if(D&&(S||N)&&L&&typeof L==="object"&&"textStream"in L){let y="";for await(let s of L.textStream){if(C?.aborted)break;y+=s;try{if(S)await S(s,h)}catch{}try{if(N)await N(s,h)}catch{}}let c=a2()?.onStreamEnd;if(c)c();let o=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-w;return this.logger.trace({src:"agent",agentId:this.agentId,model:K,duration:Number(o.toFixed(2)),streaming:!0},"Model output (stream with callback complete)"),y}let g=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-w;if(this.logger.trace({src:"agent",agentId:this.agentId,model:K,duration:Number(g.toFixed(2))},"Model output"),K!==k6.TEXT_EMBEDDING&&Y){if(this.currentActionContext)this.currentActionContext.prompts.push({modelType:K,prompt:Y,timestamp:Date.now()})}return this.adapter.log({entityId:this.agentId,roomId:this.currentRoomId??this.agentId,body:{modelType:$,modelKey:K,params:{...typeof q==="object"&&!Array.isArray(q)&&q?q:{},prompt:Y},prompt:Y,systemPrompt:this.character?.system||null,runId:this.getCurrentRunId(),timestamp:Date.now(),executionTime:g,provider:_||this.models.get(K)?.[0]?.provider||"unknown",actionContext:this.currentActionContext?{actionName:this.currentActionContext.actionName,actionId:this.currentActionContext.actionId}:void 0,response:Array.isArray(L)&&L.every((y)=>typeof y==="number")?"[array]":L},type:`useModel:${K}`}),L}async generateText($,q){if(!$?.trim())throw Error("Input cannot be empty");let _=q?.includeCharacter??!0,K=q?.modelType??k6.TEXT_LARGE,P=$;if(_&&this.character){let z=this.character,T=[],H=Array.isArray(z.bio)?z.bio.join(" "):z.bio;if(H)T.push(`# About ${z.name}
675
+ `;async function RO$($,q,_){let K=K_($,_),P=await $.getWorld(K);if(!P||!P.metadata?.roles)return"NONE";if(P.metadata.roles[q])return P.metadata.roles[q];return"NONE"}async function IO$($,q){if(!q)return V6.error({src:"core:roles",agentId:$.agentId},"User ID is required to find server"),null;let _=await $.getAllWorlds();if(!_||_.length===0)return V6.debug({src:"core:roles",agentId:$.agentId},"No worlds found for agent"),null;let K=[];for(let P of _)if(P.metadata?.ownership?.ownerId===q)K.push(P);return K.length?K:null}var Vq=[];for(let $=0;$<256;++$)Vq.push(($+256).toString(16).slice(1));function aN($,q=0){return(Vq[$[q+0]]+Vq[$[q+1]]+Vq[$[q+2]]+Vq[$[q+3]]+"-"+Vq[$[q+4]]+Vq[$[q+5]]+"-"+Vq[$[q+6]]+Vq[$[q+7]]+"-"+Vq[$[q+8]]+Vq[$[q+9]]+"-"+Vq[$[q+10]]+Vq[$[q+11]]+Vq[$[q+12]]+Vq[$[q+13]]+Vq[$[q+14]]+Vq[$[q+15]]).toLowerCase()}var wT,AF=new Uint8Array(16);function fT(){if(!wT){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");wT=crypto.getRandomValues.bind(crypto)}return wT(AF)}var kF=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ZT={randomUUID:kF};function GF($,q,_){$=$||{};let K=$.random??$.rng?.()??fT();if(K.length<16)throw Error("Random bytes length must be >= 16");if(K[6]=K[6]&15|64,K[8]=K[8]&63|128,q){if(_=_||0,_<0||_+16>q.length)throw RangeError(`UUID byte range ${_}:${_+15} is out of buffer bounds`);for(let P=0;P<16;++P)q[_+P]=K[P];return q}return aN(K)}function VF($,q,_){if(ZT.randomUUID&&!q&&!$)return ZT.randomUUID();return GF($,q,_)}var q8=VF;function G1($){if(typeof $!=="object"||$===null)return!1;if(Array.isArray($))return!1;if(WT($))return!1;if($ instanceof Date)return!1;if($ instanceof RegExp)return!1;if($ instanceof Map)return!1;if($ instanceof Set)return!1;if($ instanceof WeakMap)return!1;if($ instanceof WeakSet)return!1;if($ instanceof Error)return!1;if($ instanceof Promise)return!1;return!0}var V1=new Map;class XT{async handleMessage($,q,_,K){let P={maxRetries:K?.maxRetries??3,timeoutDuration:K?.timeoutDuration??3600000,useMultiStep:K?.useMultiStep??n2(String($.getSetting("USE_MULTI_STEP")||"")),maxMultiStepIterations:K?.maxMultiStepIterations??parseInt(String($.getSetting("MAX_MULTISTEP_ITERATIONS")||"6")),onStreamChunk:K?.onStreamChunk},Y=void 0,O=e2(q8());try{if($.logger.info({src:"service:message",agentId:$.agentId,entityId:q.entityId,roomId:q.roomId},"Message received"),!V1.has($.agentId))V1.set($.agentId,new Map);let z=V1.get($.agentId);if(!z)throw Error("Agent responses map not found");let T=z.get(q.roomId);if(T)V6.debug({src:"service:message",roomId:q.roomId,previousResponseId:T,responseId:O},"Updating response ID");z.set(q.roomId,O);let H=$.startRun(q.roomId),f=Date.now();await $.emitEvent("RUN_STARTED",{runtime:$,source:"messageHandler",runId:H,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:f,status:"started"});let w=new Promise((h,C)=>{Y=setTimeout(async()=>{await $.emitEvent("RUN_TIMEOUT",{runtime:$,source:"messageHandler",runId:H,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:f,status:"timeout",endTime:Date.now(),duration:Date.now()-f,error:"Run exceeded timeout"}),C(Error("Run exceeded timeout"))},P.timeoutDuration)}),k;if(P.onStreamChunk){let h=new B2;k={onStreamChunk:async(C,I)=>{if(h.done)return;let D=h.push(C);if(D)await P.onStreamChunk(D,I)},messageId:O}}let S=C1(k,()=>this.processMessage($,q,_,O,H,f,P)),N=await Promise.race([S,w]);return clearTimeout(Y),N}finally{clearTimeout(Y)}}async processMessage($,q,_,K,P,Y,O){try{let z=V1.get($.agentId);if(!z)throw Error("Agent responses map not found");if(q.entityId===$.agentId)return $.logger.debug({src:"service:message",agentId:$.agentId},"Skipping message from self"),await this.emitRunEnded($,P,q,Y,"self"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};$.logger.debug({src:"service:message",messagePreview:pN(q.content.text||"",50)},"Processing message"),$.logger.debug({src:"service:message"},"Saving message to memory");let T;if(q.id){let j=await $.getMemoryById(q.id);if(j)$.logger.debug({src:"service:message"},"Memory already exists, skipping creation"),T=j;else{let W=await $.createMemory(q,"messages");T={...q,id:W}}await $.queueEmbeddingGeneration(T,"high")}else{let j=await $.createMemory(q,"messages");q.id=j,T={...q,id:j},await $.queueEmbeddingGeneration(T,"normal")}let H=await $.getParticipantUserState(q.roomId,$.agentId);if(n2(String($.getSetting("BOOTSTRAP_DEFLLMOFF")||""))&&H===null)return $.logger.debug({src:"service:message"},"LLM is off by default"),await this.emitRunEnded($,P,q,Y,"off"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};if(H==="MUTED"&&!q.content.text?.toLowerCase().includes($.character.name.toLowerCase()))return $.logger.debug({src:"service:message",roomId:q.roomId},"Ignoring muted room"),await this.emitRunEnded($,P,q,Y,"muted"),{didRespond:!1,responseContent:null,responseMessages:[],state:{values:{},data:{},text:""},mode:"none"};let w=await $.composeState(q,["ANXIETY","ENTITIES","CHARACTER","RECENT_MESSAGES","ACTIONS"],!0),k=q.content.mentionContext,S=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 N=this.shouldRespond($,q,S??void 0,k);$.logger.debug({src:"service:message",responseDecision:N},"Response decision");let h=!0;if(N.skipEvaluation)$.logger.debug({src:"service:message",agentName:$.character.name,reason:N.reason},"Skipping LLM evaluation"),h=N.shouldRespond;else{let j=A1({state:w,template:$.character.templates?.shouldRespondTemplate||BN});$.logger.debug({src:"service:message",agentName:$.character.name,reason:N.reason},"Using LLM evaluation");let W=await $.useModel(k6.TEXT_SMALL,{prompt:j});$.logger.debug({src:"service:message",response:W},"LLM evaluation result");let X=YK(W);$.logger.debug({src:"service:message",responseObject:X},"Parsed evaluation result");let J=["IGNORE","NONE"],Z=X?.action;h=typeof Z==="string"&&!J.includes(Z.toUpperCase())}let C=null,I=[],D="none";if(h){let j=O.useMultiStep?await this.runMultiStepCore($,q,w,_,O,K):await this.runSingleShotCore($,q,w,O,K);if(C=j.responseContent,I=j.responseMessages,w=j.state,D=j.mode,z.get(q.roomId)!==K)return $.logger.info({src:"service:message",agentId:$.agentId,roomId:q.roomId},"Response discarded - newer message being processed"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};if(C&&q.id)C.inReplyTo=K_($,q.id);if(C?.providers?.length&&C.providers.length>0)w=await $.composeState(q,C.providers||[]);if(C){if(D==="simple"){if(C.providers&&C.providers.length>0)$.logger.debug({src:"service:message",providers:C.providers},"Simple response used providers");if(_)await _(C)}else if(D==="actions")await $.processActions(q,I,w,async(X)=>{if($.logger.debug({src:"service:message",content:X},"Action callback"),C.actionCallbacks=X,_)return _(X);return[]},{onStreamChunk:O.onStreamChunk})}}else{$.logger.debug({src:"service:message"},"Agent decided not to respond");let j=z.get(q.roomId),W=n2(String($.getSetting("BOOTSTRAP_KEEP_RESP")||""));if(j!==K&&!W)return $.logger.info({src:"service:message",agentId:$.agentId,roomId:q.roomId},"Ignore response discarded - newer message being processed"),await this.emitRunEnded($,P,q,Y,"replaced"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};if(!q.id)return $.logger.error({src:"service:message",agentId:$.agentId},"Message ID is missing, cannot create ignore response"),await this.emitRunEnded($,P,q,Y,"noMessageId"),{didRespond:!1,responseContent:null,responseMessages:[],state:w,mode:"none"};let X={thought:"Agent decided not to respond to this message.",actions:["IGNORE"],simple:!0,inReplyTo:K_($,q.id)};if(_)await _(X);let J={id:e2(q8()),entityId:$.agentId,agentId:$.agentId,content:X,roomId:q.roomId,createdAt:Date.now()};await $.createMemory(J,"messages"),$.logger.debug({src:"service:message",memoryId:J.id},"Saved ignore response to memory")}if(z.delete(q.roomId),z.size===0)V1.delete($.agentId);await $.evaluate(q,w,h,async(j)=>{if($.logger.debug({src:"service:message",content:j},"Evaluate callback"),C)C.evalCallbacks=j;if(_)return _(j);return[]},I);let L="noname";if(q.metadata&&"entityName"in q.metadata&&typeof q.metadata.entityName==="string")L=q.metadata.entityName;let g=q.content?.channelType==="DM",y=L;if(!g){let j=await $.getRoomsByIds([q.roomId]);if(j?.length){let W=j[0];if(W.name)y=W.name;if(W.worldId){let X=await $.getWorld(W.worldId);if(X)y=X.name+"-"+y}}}let p=new Date,o=w.data?.providers,Q=(typeof o==="object"&&o!==null&&"ACTIONS"in o?o.ACTIONS:void 0)?.data?.actionsData,m=Array.isArray(Q)?Q.map((j)=>j.name):[-1],e={at:p.toString(),timestamp:parseInt(""+p.getTime()/1000),messageId:q.id,userEntityId:q.entityId,input:q.content.text,thought:C?.thought,simple:C?.simple,availableActions:m,actions:C?.actions,providers:C?.providers,irt:C?.inReplyTo,output:C?.text,entityName:L,source:q.content.source,channelType:q.content.channelType,roomName:y};return await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:P,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:Y,status:"completed",endTime:Date.now(),duration:Date.now()-Y}),{didRespond:h,responseContent:C,responseMessages:I,state:w,mode:D}}catch(z){let T=z instanceof Error?z.message:String(z);throw $.logger.error({src:"service:message",agentId:$.agentId,error:z},"Error processing message"),await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:P,messageId:q.id,roomId:q.roomId,entityId:q.entityId,startTime:Y,status:"completed",endTime:Date.now(),duration:Date.now()-Y,error:T}),z}}shouldRespond($,q,_,K){if(!_)return{shouldRespond:!1,skipEvaluation:!0,reason:"no room context"};function P(N){if(!N||typeof N!=="string")return[];return N.trim().replace(/^\[|\]$/g,"").split(",").map((C)=>C.trim()).filter(Boolean)}let Y=["DM","VOICE_DM","SELF","API"],O=["client_chat"],z=P($.getSetting("ALWAYS_RESPOND_CHANNELS")||$.getSetting("SHOULD_RESPOND_BYPASS_TYPES")),T=P($.getSetting("ALWAYS_RESPOND_SOURCES")||$.getSetting("SHOULD_RESPOND_BYPASS_SOURCES")),H=new Set([...Y.map((N)=>N.toString()),...z].map((N)=>N.trim().toLowerCase())),f=[...O,...T].map((N)=>N.trim().toLowerCase()),w=_.type?.toString().toLowerCase(),k=q.content.source?.toLowerCase()||"";if(H.has(w))return{shouldRespond:!0,skipEvaluation:!0,reason:`private channel: ${w}`};if(f.some((N)=>k.includes(N)))return{shouldRespond:!0,skipEvaluation:!0,reason:`whitelisted source: ${k}`};if(!!(K?.isMention||K?.isReply))return{shouldRespond:!0,skipEvaluation:!0,reason:`platform ${K?.isMention?"mention":"reply"}`};return{shouldRespond:!1,skipEvaluation:!1,reason:"needs LLM evaluation"}}async processAttachments($,q){if(!q||q.length===0)return[];$.logger.debug({src:"service:message",count:q.length},"Processing attachments");let _=[];for(let K of q){let P={...K},Y=/^(http|https):\/\//.test(K.url),O=Y?K.url:dN(K.url);if(K.contentType==="image"&&!K.description){$.logger.debug({src:"service:message",imageUrl:K.url},"Generating image description");let z=O;if(!Y){let H=await fetch(O);if(!H.ok)throw Error(`Failed to fetch image: ${H.statusText}`);let f=await H.arrayBuffer(),w=Buffer.from(f);z=`data:${H.headers.get("content-type")||"application/octet-stream"};base64,${w.toString("base64")}`}let T=await $.useModel(k6.IMAGE_DESCRIPTION,{prompt:UN,imageUrl:z});if(typeof T==="string"){let H=YK(T);if(H&&(H.description||H.text))P.description=(typeof H.description==="string"?H.description:"")||"",P.title=(typeof H.title==="string"?H.title:"Image")||"Image",P.text=(typeof H.text==="string"?H.text:"")||(typeof H.description==="string"?H.description:"")||"",$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Generated image description");else{let f=T,w=f.match(/<title>([^<]+)<\/title>/),k=f.match(/<description>([^<]+)<\/description>/),S=f.match(/<text>([^<]+)<\/text>/);if(w||k||S)P.title=w?.[1]||"Image",P.description=k?.[1]||"",P.text=S?.[1]||k?.[1]||"",$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Used fallback XML parsing for description");else $.logger.warn({src:"service:message"},"Failed to parse XML response for image description")}}else if(T&&typeof T==="object"&&"description"in T){let H=T;P.description=H.description,P.title=H.title||"Image",P.text=H.description,$.logger.debug({src:"service:message",descriptionPreview:P.description?.substring(0,100)},"Generated image description")}else $.logger.warn({src:"service:message"},"Unexpected response format for image description")}else if(K.contentType==="document"&&!K.text){let z=await fetch(O);if(!z.ok)throw Error(`Failed to fetch document: ${z.statusText}`);let T=z.headers.get("content-type")||"";if(T.startsWith("text/plain")){$.logger.debug({src:"service:message",documentUrl:K.url},"Processing plain text document");let f=await z.text();P.text=f,P.title=P.title||"Text File",$.logger.debug({src:"service:message",textPreview:P.text?.substring(0,100)},"Extracted text content")}else $.logger.warn({src:"service:message",contentType:T},"Skipping non-plain-text document")}_.push(P)}return _}async runSingleShotCore($,q,_,K,P){if(_=await $.composeState(q,["ACTIONS"]),!_.values?.actionNames)$.logger.warn({src:"service:message"},"actionNames data missing from state");let Y=A1({state:_,template:$.character.templates?.messageHandlerTemplate||tN}),O=null,z=0;while(z<K.maxRetries&&(!O?.thought||!O?.actions)){let f=await $.useModel(k6.TEXT_LARGE,{prompt:Y});$.logger.info({src:"service:message",responseLength:f.length,responsePreview:f.substring(0,500)},"Raw LLM response received");let w=YK(f);if($.logger.info({src:"service:message",parsedXml:w?{hasThought:!!w.thought,thoughtPreview:typeof w.thought==="string"?w.thought.substring(0,100):null,hasActions:!!w.actions,actions:w.actions,hasText:!!w.text,textPreview:typeof w.text==="string"?w.text.substring(0,100):null}:null},"Parsed XML content"),w){let k=typeof w.thought==="string"?w.thought:"",S=Array.isArray(w.actions)?w.actions.filter((I)=>typeof I==="string"):typeof w.actions==="string"?[w.actions]:["IGNORE"],N=Array.isArray(w.providers)?w.providers.filter((I)=>typeof I==="string"):[],h=typeof w.text==="string"?w.text:"",C=typeof w.simple==="boolean"?w.simple:!1;O={...w,thought:k,actions:S,providers:N,text:h,simple:C}}else O=null,$.logger.warn({src:"service:message",responsePreview:f.substring(0,300)},"parseKeyValueXml returned null - XML parsing failed");if(z++,!O?.thought||!O?.actions)$.logger.warn({src:"service:message",retries:z,maxRetries:K.maxRetries,hasThought:!!O?.thought,hasActions:!!O?.actions,actionsValue:O?.actions},"Missing required fields (thought or actions), retrying")}if(!O)return{responseContent:null,responseMessages:[],state:_,mode:"none"};if(O.actions&&O.actions.length>1){let f=(k)=>typeof k==="string"&&k.toUpperCase()==="IGNORE";if(O.actions.some(f))if(!O.text||O.text.trim()==="")O.actions=["IGNORE"];else{let k=O.actions.filter((S)=>!f(S));O.actions=k.length?k:["REPLY"]}}let T=O.actions?.length===1&&typeof O.actions[0]==="string"&&O.actions[0].toUpperCase()==="REPLY"&&(!O.providers||O.providers.length===0);O.simple=T,O.responseId=P;let H=[{id:P,entityId:$.agentId,agentId:$.agentId,content:O,roomId:q.roomId,createdAt:Date.now()}];return{responseContent:O,responseMessages:H,state:_,mode:T&&O.text?"simple":"actions"}}async runMultiStepCore($,q,_,K,P,Y){let O=[],z=_,T=0;while(T<P.maxMultiStepIterations){T++,$.logger.debug({src:"service:message",iteration:T,maxIterations:P.maxMultiStepIterations},"Starting multi-step iteration"),z=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]),z.data.actionResults=O;let h=A1({state:z,template:$.character.templates?.multiStepDecisionTemplate||FN}),C=await $.useModel(k6.TEXT_LARGE,{prompt:h}),I=YK(C);if(!I){$.logger.warn({src:"service:message",iteration:T},"Failed to parse multi-step result"),O.push({data:{actionName:"parse_error"},success:!1,error:"Failed to parse step result"});break}let D=typeof I.thought==="string"?I.thought:void 0,L=Array.isArray(I.providers)?I.providers:[],g=typeof I.action==="string"?I.action:void 0,y=I.isFinish;if(y==="true"||y===!0){if($.logger.info({src:"service:message",agentId:$.agentId,iteration:T},"Multi-step task completed"),K)await K({text:"",thought:typeof D==="string"?D:""});break}let p=Array.isArray(L)?L:[];if((!p||p.length===0)&&!g){$.logger.warn({src:"service:message",iteration:T},"No providers or action specified, forcing completion");break}let o=parseInt(String($.getSetting("PROVIDERS_TOTAL_TIMEOUT_MS")||"1000")),s=new Set,Q=p.filter((J)=>typeof J==="string").map(async(J)=>{let Z=$.providers.find((G)=>G.name===J);if(!Z)return $.logger.warn({src:"service:message",providerName:J},"Provider not found"),s.add(J),{providerName:J,success:!1,error:`Provider not found: ${J}`};try{let G=await Z.get($,q,_);if(s.add(J),!G)return $.logger.warn({src:"service:message",providerName:J},"Provider returned no result"),{providerName:J,success:!1,error:"Provider returned no result"};let M=!!G.text;return{providerName:J,success:M,text:M?G.text:void 0,error:M?void 0:"Provider returned no result"}}catch(G){s.add(J);let M=G instanceof Error?G.message:String(G);return $.logger.error({src:"service:message",providerName:J,error:M},"Provider execution failed"),{providerName:J,success:!1,error:M}}}),m,e=new Promise((J)=>{m=setTimeout(()=>J("timeout"),o)}),j=Promise.allSettled(Q),W=await Promise.race([j,e]);if(clearTimeout(m),W==="timeout"){let Z=p.filter((G)=>typeof G==="string").filter((G)=>!s.has(G));if($.logger.error({src:"service:message",timeoutMs:o,pendingProviders:Z,completedProviders:Array.from(s)},`Providers took too long (>${o}ms) - slow providers: ${Z.join(", ")}`),K)await K({text:"Providers took too long to respond. Please optimize your providers or use caching.",actions:[],thought:"Provider timeout - pipeline aborted"});return{responseContent:null,responseMessages:[],state:_,mode:"none"}}let X=W;for(let J of X)if(J.status==="fulfilled"){let{providerName:Z,success:G,text:M,error:A}=J.value;if(O.push({data:{actionName:Z},success:G,text:M,error:A}),K)await K({text:`\uD83D\uDD0E Provider executed: ${Z}`,actions:[Z],thought:typeof D==="string"?D:""})}else $.logger.error({src:"service:message",error:J.reason||"Unknown provider failure"},"Unexpected provider promise rejection");if(g){let J={text:`\uD83D\uDD0E Executing action: ${g}`,actions:[g],thought:D||""};await $.processActions(q,[{id:q8(),entityId:$.agentId,roomId:q.roomId,createdAt:Date.now(),content:J}],_,async()=>{return[]});let Z=$.stateCache?.get(`${q.id}_action_results`),G=Array.isArray(Z?.values?.actionResults)?Z.values.actionResults:[],M=G.length>0&&typeof G[0]==="object"&&G[0]!==null?G[0]:null,A=M&&"success"in M&&typeof M.success==="boolean"?M.success:!1;O.push({data:{actionName:typeof g==="string"?g:"unknown"},success:A,text:M&&"text"in M&&typeof M.text==="string"?M.text:void 0,values:M&&"values"in M&&typeof M.values==="object"&&M.values!==null?M.values:void 0,error:A?void 0:M&&("text"in M)&&typeof M.text==="string"?M.text:void 0})}}if(T>=P.maxMultiStepIterations)$.logger.warn({src:"service:message",maxIterations:P.maxMultiStepIterations},"Reached maximum iterations, forcing completion");z=await $.composeState(q,["RECENT_MESSAGES","ACTION_STATE"]);let H=A1({state:z,template:$.character.templates?.multiStepSummaryTemplate||QN}),f=await $.useModel(k6.TEXT_LARGE,{prompt:H}),w=YK(f),k=null,S=w?.text;if(typeof S==="string"&&S)k={actions:["MULTI_STEP_SUMMARY"],text:S,thought:(typeof w.thought==="string"?w.thought:"Final user-facing message after task completion.")||"Final user-facing message after task completion.",simple:!0,responseId:Y};let N=k?[{id:Y,entityId:$.agentId,agentId:$.agentId,content:k,roomId:q.roomId,createdAt:Date.now()}]:[];return{responseContent:k,responseMessages:N,state:z,mode:k?"simple":"none"}}async emitRunEnded($,q,_,K,P){await $.emitEvent("RUN_ENDED",{runtime:$,source:"messageHandler",runId:q,messageId:_.id,roomId:_.roomId,entityId:_.entityId,startTime:K,status:P,endTime:Date.now(),duration:Date.now()-K})}async deleteMessage($,q){try{if(!q.id){$.logger.error({src:"service:message",agentId:$.agentId},"Cannot delete memory: message ID is missing");return}$.logger.info({src:"service:message",agentId:$.agentId,messageId:q.id,roomId:q.roomId},"Deleting memory"),await $.deleteMemory(q.id),$.logger.debug({src:"service:message",messageId:q.id},"Successfully deleted memory")}catch(_){throw $.logger.error({src:"service:message",agentId:$.agentId,error:_},"Error in deleteMessage"),_}}async clearChannel($,q,_){try{$.logger.info({src:"service:message",agentId:$.agentId,channelId:_,roomId:q},"Clearing message memories from channel");let K=await $.getMemoriesByRoomIds({tableName:"messages",roomIds:[q]});$.logger.debug({src:"service:message",channelId:_,count:K.length},"Found message memories to delete");let P=0;for(let Y of K)if(Y.id)try{await $.deleteMemory(Y.id),P++}catch(O){$.logger.warn({src:"service:message",error:O,memoryId:Y.id},"Failed to delete message memory")}$.logger.info({src:"service:message",agentId:$.agentId,channelId:_,deletedCount:P,totalCount:K.length},"Cleared message memories from channel")}catch(K){throw $.logger.error({src:"service:message",agentId:$.agentId,error:K},"Error in clearChannel"),K}}}var D_=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:return!0;default:return!1}},SF=($)=>{switch($){case 97:case 101:case 105:case 111:case 117:case 121:case 119:case 120:case 89:return!0;default:return!1}},MF=($)=>{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}},NF=($)=>{switch($){case 98:case 100:case 102:case 103:case 109:case 110:case 112:case 114:case 116:return!0;default:return!1}},eN=($,q)=>{return q>=2&&D_($[q-2])&&(q===2&&!D_($[q-1])||q>=3&&!D_($[q-3])&&!SF($[q-1]))},CF=($)=>{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,_=$.length-q,K=Array(_),P=!1;for(let f=0;f<_;++f){let w=$.charCodeAt(f+q);if(w===121&&(f===0||D_(K[f-1]))){P=!0,K[f]=89;continue}K[f]=w}if(K[_-1]===39)--_;if(_>=2&&K[_-2]===39&&K[_-1]===115)_-=2;let Y=0;while(Y<_&&!D_(K[Y]))++Y;if(Y<_)++Y;let O=Y;if(_>=5&&(K[0]===103&&K[1]===101&&K[2]===110&&K[3]===101&&K[4]===114||K[0]===97&&K[1]===114&&K[2]===115&&K[3]===101&&K[4]===110))O=5;else if(_>=6&&K[0]===99&&K[1]===111&&K[2]===109&&K[3]===109&&K[4]===117&&K[5]===110)O=6;else{while(O<_&&D_(K[O]))++O;if(O<_)++O}let z=O;while(z<_&&!D_(K[z]))++z;while(z<_&&D_(K[z]))++z;if(z<_)++z;if(_>=3){if(K[_-1]===115){if(_>=4&&K[_-2]===101&&K[_-3]===115&&K[_-4]===115)_-=2;else if(K[_-2]===101&&K[_-3]===105)_-=_>=5?2:1;else if(K[_-2]!==117&&K[_-2]!==115&&Y<_-1)_-=1}else if(K[_-1]===100&&K[_-2]===101&&K[_-3]===105)_-=_>=5?2:1}if(_===6&&(K[0]===105&&K[1]===110&&K[2]===110&&K[3]===105&&K[4]===110&&K[5]===103||K[0]===111&&K[1]===117&&K[2]===116&&K[3]===105&&K[4]===110&&K[5]===103||K[0]===101&&K[1]===120&&K[2]===99&&K[3]===101&&K[4]===101&&K[5]===100)||_===7&&(K[0]===99&&K[1]===97&&K[2]===110&&K[3]===110&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===104&&K[1]===101&&K[2]===114&&K[3]===114&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===101&&K[1]===97&&K[2]===114&&K[3]===114&&K[4]===105&&K[5]===110&&K[6]===103||K[0]===112&&K[1]===114&&K[2]===111&&K[3]===99&&K[4]===101&&K[5]===101&&K[6]===100||K[0]===115&&K[1]===117&&K[2]===99&&K[3]===99&&K[4]===101&&K[5]===101&&K[6]===100)){let f="";for(let w=0;w<_;++w)f+=String.fromCharCode(K[w]);return f}let T=_>=2&&K[_-1]===121&&K[_-2]===108?_-2:_;if(T>=3)if(K[T-3]===101&&K[T-2]===101&&K[T-1]===100){if(T>=O+3)_=T-1}else{if(K[T-2]===101&&K[T-1]===100)T-=2;else if(K[T-3]===105&&K[T-2]===110&&K[T-1]===103)T-=3;else T=-1;if(T>=0&&Y<=T){if(_=T,_>=2){if(K[_-1]===116&&K[_-2]===97||K[_-1]===108&&K[_-2]===98||K[_-1]===122&&K[_-2]===105)K[_]=101,++_;else if(K[_-2]===K[_-1]&&NF(K[_-1]))--_;else if(O>=_&&eN(K,_))K[_]=101,++_}}}if(_>=3&&(K[_-1]===89||K[_-1]===121)&&!D_(K[_-2]))K[_-1]=105;if(_>=O+2)switch(K[_-1]){case 108:if(_>=O+6&&K[_-2]===97&&K[_-3]===110&&K[_-4]===111&&K[_-5]===105&&K[_-6]===116)if(_>=7&&K[_-7]===97){if(_>=O+7)_-=4,K[_-1]=101}else _-=2;break;case 110:if(_>=O+5&&K[_-2]===111&&K[_-3]===105&&K[_-4]===116&&K[_-5]===97)if(_>=7&&K[_-6]===122&&K[_-7]===105){if(_>=O+7)_-=4,K[_-1]=101}else _-=2,K[_-1]=101;break;case 114:if(_>=O+4){if(K[_-2]===101){if(K[_-3]===122&&K[_-4]===105)--_}else if(K[_-2]===111){if(K[_-3]===116&&K[_-4]===97)--_,K[_-1]=101}}break;case 115:if(_>=O+7&&K[_-2]===115&&K[_-3]===101&&K[_-4]===110&&(K[_-5]===108&&K[_-6]===117&&K[_-7]===102||K[_-5]===115&&K[_-6]===117&&K[_-7]===111||K[_-5]===101&&K[_-6]===118&&K[_-7]===105))_-=4;break;case 109:if(_>=O+5&&K[_-2]===115&&K[_-3]===105&&K[_-4]===108&&K[_-5]===97)_-=3;break;case 105:if(K[_-2]===99){if(_>=O+4&&(K[_-4]===101||K[_-4]===97)&&K[_-3]===110)K[_-1]=101}else if(K[_-2]===103){if(_>=O+3&&_>=4&&K[_-2]===103&&K[_-3]===111&&K[_-4]===108)--_}else if(K[_-2]===116){if(_>=O+5&&K[_-3]===105){if(K[_-4]===108){if(_>=6&&K[_-5]===105&&K[_-6]===98){if(_>=O+6)_-=3,K[_-2]=108,K[_-1]=101}else if(K[_-4]===108&&K[_-5]===97)_-=3}else if(K[_-4]===118&&K[_-5]===105)_-=2,K[_-1]=101}}else if(K[_-2]===108&&_>=3){if(K[_-3]===98){if(_>=4&&K[_-4]===97){if(_>=O+4)K[_-1]=101}else if(_>=O+3)K[_-1]=101}else if(K[_-3]===108){if(_>=5&&K[_-4]===117&&K[_-5]===102){if(_>=O+5)_-=2}else if(_>=O+4&&K[_-4]===97)_-=2}else if(K[_-3]===115){if(_>=6&&K[_-4]===115&&K[_-5]===101&&K[_-6]===108){if(_>=O+6)_-=2}else if(_>=O+5&&K[_-4]===117&&K[_-5]===111)_-=2}else if(_>=5&&K[_-3]===116&&K[_-4]===110&&K[_-5]===101){if(_>=O+5)_-=2}else if(MF(K[_-3]))_-=2}}if(_>=O+3)switch(K[_-1]){case 108:if(K[_-3]===99){if(_>=O+4&&K[_-4]===105&&K[_-2]===97)_-=2}else if(K[_-3]===102){if(K[_-2]===117)_-=3}else if(K[_-3]===110){if(_>=O+6&&K[_-2]===97&&K[_-4]===111&&K[_-5]===105&&K[_-6]===116)if(_>=7&&K[_-7]===97){if(_>=O+7)_-=4,K[_-1]=101}else _-=2}break;case 101:if(K[_-2]===122){if(_>=O+5&&K[_-3]===105&&K[_-4]===108&&K[_-5]===97)_-=3}else if(K[_-2]===116){if(_>=O+5&&K[_-3]===97&&K[_-4]===99&&K[_-5]===105)_-=3}else if(K[_-2]===118){if(_>=z+5&&K[_-3]===105&&K[_-4]===116&&K[_-5]===97)_-=5}break;case 105:if(_>=O+5&&K[_-2]===116&&K[_-3]===105&&K[_-4]===99&&K[_-5]===105)_-=3;break;case 115:if(_>=O+4&&K[_-2]===115&&K[_-3]===101&&K[_-4]===110)_-=4}if(_>=z+2)switch(K[_-1]){case 110:if(_>=z+3&&K[_-2]===111&&K[_-3]===105&&(K[_-4]===115||K[_-4]===116))_-=3;break;case 108:if(K[_-2]===97)_-=2;break;case 114:if(K[_-2]===101)_-=2;break;case 99:if(K[_-2]===105)_-=2;break;case 109:if(_>=z+3&&K[_-2]===115&&K[_-3]===105)_-=3;break;case 105:if(_>=z+3&&K[_-2]===116&&K[_-3]===105)_-=3;break;case 115:if(_>=z+3&&K[_-2]===117&&K[_-3]===111)_-=3;break;case 116:if(_>=z+3&&K[_-2]===110){if(K[_-3]===97)_-=3;else if(K[_-3]===101)if(_>=4&&K[_-4]===109){if(_>=5&&K[_-5]===101){if(_>=z+5)_-=5}else if(_>=z+4)_-=4}else _-=3}break;case 101:if(K[_-2]===99){if(_>=z+4&&K[_-3]===110&&(K[_-4]===97||K[_-4]===101))_-=4}else if(K[_-2]===108){if(_>=z+4&&K[_-3]===98&&(K[_-4]===97||K[_-4]===105))_-=4}else if(K[_-2]===116){if(_>=z+3&&K[_-3]===97)_-=3}else if(_>=z+3&&(K[_-2]===118||K[_-2]===122)&&K[_-3]===105)_-=3}if(_>=O+1&&(_>=z+1&&K[_-1]===108&&K[_-2]===108||K[_-1]===101&&(_>=z+1||!eN(K,_-1))))--_;let H="";if(P)for(let f=0;f<_;++f)H+=String.fromCharCode(K[f]===89?121:K[f]);else for(let f=0;f<_;++f)H+=String.fromCharCode(K[f]);return H},EF={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 AT{stopWords;minLength;stemming;stemmingRules;static DEFAULT_OPTIONS={stopWords:new Set,minLength:2,stemming:!1,stemmingRules:[]};constructor($={}){let q={...AT.DEFAULT_OPTIONS,...$};this.stopWords=q.stopWords,this.minLength=q.minLength,this.stemming=q.stemming,this.stemmingRules=q.stemmingRules.map((_)=>({..._,pattern:typeof _.pattern==="string"?new RegExp(_.pattern):_.pattern}))}tokenize($,q=!1){if(!$)throw Error("Input text cannot be null or empty");let _=Date.now(),K=$.split(/\s+/).filter((z)=>z.length>0),Y=this.cleanText($).split(/\s+/).filter((z)=>this.isValidToken(z)).map((z)=>this.stemming?this.stemWord(z):z),O=q?{originalWordCount:K.length,stopWordsRemoved:K.length-Y.length,stemmedWords:this.stemming?Y.length:0,processingTimeMs:Date.now()-_}:{originalWordCount:0,stopWordsRemoved:0,stemmedWords:0,processingTimeMs:0};return{tokens:Y,stats:O}}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,_=$;for(let K of this.stemmingRules){let P=_.match(K.pattern);if(P){if(!K.minMeasure||this.measure(_.substring(0,P.index))>=K.minMeasure){if(typeof K.replacement==="string")_=_.replace(K.pattern,K.replacement);else _=_.replace(K.pattern,(...Y)=>K.replacement(...Y));q=!0}}}if(q&&_!==$)return _;return CF(_)}isConsonant($,q){let _=$[q];if("aeiou".includes(_))return!1;return _!=="y"||(q===0?!0:!this.isConsonant($,q-1))}measure($){let q=0,_=!1;for(let K=0;K<$.length;K++)if(this.isConsonant($,K)){if(_)q++,_=!1}else _=!0;return q}}class kT{termFrequencySaturation;lengthNormalizationFactor;tokenizer;documentLengths;averageDocLength;termToIndex;documentFrequency;termFrequencies;fieldBoosts;documents;constructor($,q={}){let _={...EF,...q};if(this.termFrequencySaturation=_.k1,this.lengthNormalizationFactor=_.b,this.tokenizer=new AT(_),this.fieldBoosts=_.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:K,termToIndex:P,documentFrequency:Y,averageDocLength:O,termFrequencies:z}=this.processDocuments($);this.documentLengths=K,this.termToIndex=P,this.documentFrequency=Y,this.averageDocLength=O,this.termFrequencies=z}}processDocuments($){let q=$.length,_=new Uint32Array(q),K=new Map,P=new Map,Y=new Map,O=0,z=0;$.forEach((H,f)=>{let w=0,k=new Map;Object.entries(H).forEach(([S,N])=>{if(typeof N!=="string")return;let h=this.fieldBoosts[S]||1,{tokens:C}=this.tokenizer.tokenize(N),I=C.length*h;w+=I,C.forEach((D)=>{if(!K.has(D))K.set(D,z++);let L=K.get(D);if(!P.has(D))P.set(D,new Set);P.get(D).add(f);let g=k.get(L)||0;k.set(L,g+h)})}),_[f]=w,O+=w,k.forEach((S,N)=>{if(!Y.has(N))Y.set(N,new Map);Y.get(N).set(f,S)})});let T=new Uint32Array(K.size);return P.forEach((H,f)=>{let w=K.get(f);T[w]=H.size}),{documentLengths:_,termToIndex:K,documentFrequency:T,averageDocLength:q>0?O/q:0,termFrequencies:Y}}recalculateAverageLength(){if(this.documentLengths.length===0){this.averageDocLength=0;return}let $=this.documentLengths.reduce((q,_)=>q+_,0);this.averageDocLength=$/this.documentLengths.length}search($,q=10){let{tokens:_}=this.tokenizer.tokenize($),K=new Float32Array(this.documentLengths.length).fill(0);return _.forEach((P)=>{let Y=this.termToIndex.get(P);if(Y===void 0)return;let O=this.calculateIdf(Y);if(O<=0)return;let z=this.termFrequencies.get(Y);if(!z)return;z.forEach((T,H)=>{let f=this.documentLengths[H],w=T*(this.termFrequencySaturation+1),k=T+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*f/this.averageDocLength);K[H]+=O*(w/k)})}),Array.from({length:K.length},(P,Y)=>({index:Y,score:K[Y]})).filter((P)=>P.score>0).sort((P,Y)=>Y.score-P.score).slice(0,q)}searchPhrase($,q=10){let{tokens:_}=this.tokenizer.tokenize($);if(_.length===0)return[];let K=null;for(let Y of _){let O=this.termToIndex.get(Y);if(O===void 0)return[];let z=this.termFrequencies.get(O)?.keys();if(!z)return[];let T=new Set(z);if(K===null)K=T;else K=new Set([...K].filter((H)=>T.has(H)));if(K.size===0)return[]}if(K===null||K.size===0)return[];let P=new Map;return K.forEach((Y)=>{let O=this.getDocument(Y),z=!1;Object.entries(O).forEach(([T,H])=>{if(typeof H!=="string"||z)return;let f=this.fieldBoosts[T]||1,{tokens:w}=this.tokenizer.tokenize(H);for(let k=0;k<=w.length-_.length;k++){let S=!0;for(let N=0;N<_.length;N++)if(w[k+N]!==_[N]){S=!1;break}if(S){let N=this.calculatePhraseScore(_,Y)*f;P.set(Y,(P.get(Y)||0)+N),z=!0;break}}})}),Array.from(P.entries()).map(([Y,O])=>({index:Y,score:O})).sort((Y,O)=>O.score-Y.score).slice(0,q)}calculatePhraseScore($,q){return $.reduce((_,K)=>{let P=this.termToIndex.get(K);if(P===void 0)return _;let Y=this.calculateIdf(P),O=this.termFrequencies.get(P)?.get(q)||0,z=this.documentLengths[q],T=O*(this.termFrequencySaturation+1),H=O+this.termFrequencySaturation*(1-this.lengthNormalizationFactor+this.lengthNormalizationFactor*z/this.averageDocLength);return _+Y*(T/H)},0)}async addDocument($){if(!$)throw Error("Document cannot be null");let q=this.documentLengths.length;this.documents.push($);let _=new Uint32Array(q+1);_.set(this.documentLengths,0),this.documentLengths=_;let K=0,P=new Map;Object.entries($).forEach(([Y,O])=>{if(typeof O!=="string")return;let z=this.fieldBoosts[Y]||1,{tokens:T}=this.tokenizer.tokenize(O);K+=T.length*z,T.forEach((H)=>{let f;if(!this.termToIndex.has(H)){if(f=this.termToIndex.size,this.termToIndex.set(H,f),this.documentFrequency.length<=f){let k=this.documentFrequency,S=Math.max(f+1,k.length*2||1);this.documentFrequency=new Uint32Array(S),this.documentFrequency.set(k,0)}this.documentFrequency[f]=0}else f=this.termToIndex.get(H);let w=P.get(f)||0;P.set(f,w+z)})}),this.documentLengths[q]=K,P.forEach((Y,O)=>{if(!this.termFrequencies.has(O))this.termFrequencies.set(O,new Map);if(this.termFrequencies.get(O).set(q,Y),O<this.documentFrequency.length)this.documentFrequency[O]++}),this.recalculateAverageLength()}calculateIdf($){if($<0||$>=this.documentFrequency.length)return 0;let q=this.documentFrequency[$];if(q<=0||q>this.documentLengths.length)return 0;let K=this.documentLengths.length-q+0.5,P=q+0.5;return Math.log(1+K/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 hF={};class RF{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 GT{#$=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;elizaOS;allAvailablePlugins=new Map;characterPlugins=[];logger;settings;servicePromiseHandlers=new Map;servicePromises=new Map;serviceRegistrationStatus=new Map;initPromise;initResolver;initRejecter;currentRunId;currentRoomId;currentActionContext;maxWorkingMemoryEntries=50;messageService=null;constructor($){if(this.agentId=$.character?.id??$?.agentId??i2($.character?.name??q8()),this.character=$.character,this.initPromise=new Promise((q,_)=>{this.initResolver=q,this.initRejecter=_}),this.logger=X1({namespace:this.character?.name}),this.#$=$.conversationLength??this.#$,$.adapter)this.registerDatabaseAdapter($.adapter);if(this.fetch=$.fetch??this.fetch,this.settings=$.settings??hF,this.plugins=[],this.characterPlugins=$?.plugins??[],$.allAvailablePlugins){for(let q of $.allAvailablePlugins)if(q?.name)this.allAvailablePlugins.set(q.name,q)}if(this.logger.debug({src:"agent",agentId:this.agentId,agentName:this.character?.name},"Initialized"),this.currentRunId=void 0,$.settings?.MAX_WORKING_MEMORY_ENTRIES)this.maxWorkingMemoryEntries=parseInt($.settings.MAX_WORKING_MEMORY_ENTRIES,10)||50;else this.maxWorkingMemoryEntries=xM("MAX_WORKING_MEMORY_ENTRIES",50)}createRunId(){return q8()}startRun($){return this.currentRunId=this.createRunId(),this.currentRoomId=$,this.currentRunId}endRun(){this.currentRunId=void 0,this.currentRoomId=void 0}getCurrentRunId(){if(!this.currentRunId)this.currentRunId=this.createRunId();return this.currentRunId}async registerPlugin($){if(!$?.name)throw this.logger.error({src:"agent",agentId:this.agentId,error:"Plugin or plugin name is undefined"},"Plugin registration failed"),Error("registerPlugin: Plugin or plugin name is undefined");if(this.plugins.find((_)=>_.name===$.name)){this.logger.warn({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin already registered, skipping");return}if(this.plugins.push($),this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin added"),$.init){let _={};if($.config){for(let[K,P]of Object.entries($.config))if(P!==null&&P!==void 0)_[K]=String(P)}await $.init(_,this),this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Plugin initialized")}if($.adapter)this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name},"Registering database adapter"),this.registerDatabaseAdapter($.adapter);if($.actions)for(let _ of $.actions)this.registerAction(_);if($.evaluators)for(let _ of $.evaluators)this.registerEvaluator(_);if($.providers)for(let _ of $.providers)this.registerProvider(_);if($.models)for(let[_,K]of Object.entries($.models))this.registerModel(_,K,$.name,$?.priority);if($.routes)for(let _ of $.routes){let K=_.path.startsWith("/")?_.path:`/${_.path}`;this.routes.push({..._,path:"/"+$.name+K})}if($.events)for(let[_,K]of Object.entries($.events))for(let P of K)this.registerEvent(_,P);if($.services)for(let _ of $.services){let K=_.serviceType;if(this.logger.debug({src:"agent",agentId:this.agentId,plugin:$.name,serviceType:K},"Registering service"),!this.servicePromises.has(K))this._createServiceResolver(K);this.serviceRegistrationStatus.set(K,"pending"),this.registerService(_).catch((P)=>{this.logger.error({src:"agent",agentId:this.agentId,plugin:$.name,serviceType:K,error:P instanceof Error?P.message:String(P)},"Service registration failed");let Y=this.servicePromiseHandlers.get(K);if(Y){let O=Error(`Service ${K} from plugin ${$.name} failed to register: ${P instanceof Error?P.message:String(P)}`);Y.reject(O),this.servicePromiseHandlers.delete(K),this.servicePromises.delete(K)}this.serviceRegistrationStatus.set(K,"failed")})}}getAllServices(){return this.services}async stop(){this.logger.debug({src:"agent",agentId:this.agentId},"Stopping runtime");for(let[$,q]of this.services){this.logger.debug({src:"agent",agentId:this.agentId,serviceType:$},"Stopping service");for(let _ of q)await _.stop()}this.elizaOS=void 0}async initialize($){let q=[],_=this.characterPlugins;for(let H of _)if(H)q.push(this.registerPlugin(H));if(await Promise.all(q),!this.adapter)throw this.logger.error({src:"agent",agentId:this.agentId},"Database adapter not initialized"),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();if(this.messageService=new XT,$?.skipMigrations??!1)this.logger.debug({src:"agent",agentId:this.agentId},"Skipping plugin migrations");else this.logger.debug({src:"agent",agentId:this.agentId},"Running plugin migrations"),await this.runPluginMigrations(),this.logger.debug({src:"agent",agentId:this.agentId},"Plugin migrations completed");let P=await this.ensureAgentExists({...this.character,id:this.agentId});if(!P){let H=`Agent ${this.agentId} does not exist in database after ensureAgentExists call`;throw Error(H)}if(P.settings){this.character.settings={...P.settings,...this.character.settings};let H=P.settings.secrets&&typeof P.settings.secrets==="object"?P.settings.secrets:{},f=this.character.settings.secrets&&typeof this.character.settings.secrets==="object"?this.character.settings.secrets:{},w=this.character.secrets&&typeof this.character.secrets==="object"?this.character.secrets:{},k={...H,...w,...f};if(Object.keys(k).length>0){let S={};for(let[N,h]of Object.entries(k))if(h!==null&&h!==void 0)S[N]=h;if(Object.keys(S).length>0)this.character.secrets=S,this.character.settings.secrets=S}}let Y=await this.getEntityById(this.agentId);if(!Y){if(!await this.createEntity({id:this.agentId,names:[this.character.name],metadata:{},agentId:P.id})){let f=`Failed to create entity for agent ${this.agentId}`;throw Error(f)}if(Y=await this.getEntityById(this.agentId),!Y)throw Error(`Agent entity not found for ${this.agentId}`);this.logger.debug({src:"agent",agentId:this.agentId},"Agent entity created")}if(!await this.getRoom(this.agentId))await this.createRoom({id:this.agentId,name:this.character.name,source:"elizaos",type:"SELF",channelId:this.agentId,messageServerId:this.agentId,worldId:this.agentId});if(!(await this.adapter.getParticipantsForRoom(this.agentId)).includes(this.agentId)){if(!await this.addParticipant(this.agentId,this.agentId))throw Error(`Failed to add agent ${this.agentId} as participant to its own room`);this.logger.debug({src:"agent",agentId:this.agentId},"Agent linked to room")}if(!this.getModel(k6.TEXT_EMBEDDING))this.logger.warn({src:"agent",agentId:this.agentId},"No TEXT_EMBEDDING model registered, skipping embedding setup");else await this.ensureEmbeddingDimension();if(this.initResolver)this.initResolver(),this.initResolver=void 0}async runPluginMigrations(){if(!this.adapter){this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter not found, skipping plugin migrations");return}if(typeof this.adapter.runPluginMigrations!=="function"){this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter does not support plugin migrations");return}let $=this.plugins.filter((K)=>K.schema).map((K)=>{let P=K.schema||{},Y={};for(let[O,z]of Object.entries(P))if(typeof z==="string"||typeof z==="number"||typeof z==="boolean"||z===null||typeof z==="object"&&z!==null&&!Array.isArray(z))Y[O]=z;return{name:K.name,schema:Y}});if($.length===0){this.logger.debug({src:"agent",agentId:this.agentId},"No plugins with schemas, skipping migrations");return}this.logger.debug({src:"agent",agentId:this.agentId,count:$.length},"Found plugins with schemas");let q=!1,_=process.env.ELIZA_ALLOW_DESTRUCTIVE_MIGRATIONS==="true";await this.adapter.runPluginMigrations($,{verbose:!q,force:_,dryRun:!1}),this.logger.debug({src:"agent",agentId:this.agentId},"Plugin migrations completed")}async getConnection(){if(!this.adapter)throw Error("Database adapter not registered");return this.adapter.getConnection()}setSetting($,q,_=!1){if(_){if(!this.character.secrets)this.character.secrets={};if(q!==null&&q!==void 0)this.character.secrets[$]=q}else{if(!this.character.settings)this.character.settings={};if(q!==null&&q!==void 0)this.character.settings[$]=q}}getSetting($){let q=this.character.settings,_=this.character.secrets,K=typeof q==="object"&&q!==null&&"secrets"in q&&typeof q.secrets==="object"&&q.secrets!==null?q.secrets:void 0,P=_?.[$]||q?.[$]||K?.[$]||this.settings[$];if(P===void 0||P===null)return null;if(typeof P==="number")return P;if(typeof P==="boolean")return P;if(typeof P==="string"){let Y=t2(P,L_());if(Y==="true")return!0;if(Y==="false")return!1;return Y}return null}getConversationLength(){return this.#$}registerDatabaseAdapter($){if(this.adapter)this.logger.warn({src:"agent",agentId:this.agentId},"Database adapter already registered, ignoring");else this.adapter=$,this.logger.debug({src:"agent",agentId:this.agentId},"Database adapter registered")}registerProvider($){this.providers.push($),this.logger.debug({src:"agent",agentId:this.agentId,provider:$.name},"Provider registered")}registerAction($){if(this.actions.find((q)=>q.name===$.name))this.logger.warn({src:"agent",agentId:this.agentId,action:$.name},"Action already registered, skipping");else this.actions.push($),this.logger.debug({src:"agent",agentId:this.agentId,action:$.name},"Action registered")}registerEvaluator($){this.evaluators.push($)}updateActionPlan($,q){return{...$,...q}}updateActionStep($,q,_){if(!$.steps||q<0||q>=$.steps.length)return this.logger.warn({src:"agent",agentId:this.agentId,index:q,stepsCount:$.steps?.length||0},"Invalid step index"),$;return{...$,steps:$.steps.map((K,P)=>P===q?{...K,..._}:K)}}async processActions($,q,_,K,P){let Y=[];for(let k of q)if(k.content?.actions&&k.content.actions.length>0)Y.push(...k.content.actions);let O=Y.length>1,z=this.getCurrentRunId(),T=this.createRunId(),H=void 0,f=q[0]?.content?.thought||`Executing ${Y.length} actions: ${Y.join(", ")}`;if(O)H={runId:T,totalSteps:Y.length,currentStep:0,steps:Y.map((k)=>({action:k,status:"pending"})),thought:f,startTime:Date.now()};let w=0;for(let k of q){let C=function(I){return I.toLowerCase().replace(/_/g,"")};if(!k.content?.actions||k.content.actions.length===0){this.logger.warn({src:"agent",agentId:this.agentId},"No action found in response");continue}let S=k.content.actions,N=[],h=_;this.logger.trace({src:"agent",agentId:this.agentId,actions:this.actions.map((I)=>C(I.name))},"Available actions");for(let I of S){if(H)H=this.updateActionPlan(H,{currentStep:w+1});if(h=await this.composeState($,["RECENT_MESSAGES","ACTION_STATE"]),H&&h.data)h.data.actionPlan=H,h.data.actionResults=N;this.logger.debug({src:"agent",agentId:this.agentId,action:I},"Processing action");let D=C(I),L=this.actions.find((G)=>C(G.name)===D);if(!L)L=this.actions.find((G)=>C(G.name).includes(D)||D.includes(C(G.name)));if(!L)for(let G of this.actions){if(G.similes?.find((v)=>C(v)===D)){L=G,this.logger.debug({src:"agent",agentId:this.agentId,action:L.name,match:"simile"},"Action resolved via simile");break}if(G.similes?.find((v)=>C(v).includes(D)||D.includes(C(v)))){L=G,this.logger.debug({src:"agent",agentId:this.agentId,action:L.name,match:"fuzzy"},"Action resolved via fuzzy match");break}}if(!L){let G=`Action not found: ${I}`;if(this.logger.error({src:"agent",agentId:this.agentId,action:I},"Action not found"),H&&H.steps[w])H=this.updateActionStep(H,w,{status:"failed",error:G});let M={id:q8(),entityId:$.entityId,roomId:$.roomId,worldId:$.worldId,content:{thought:G,source:"auto",type:"action_result",actionName:I,actionStatus:"failed",runId:T}};await this.createMemory(M,"messages"),w++;continue}if(!L.handler){if(this.logger.error({src:"agent",agentId:this.agentId,action:L.name},"Action has no handler"),H&&H.steps[w])H=this.updateActionStep(H,w,{status:"failed",error:"No handler"});w++;continue}this.logger.debug({src:"agent",agentId:this.agentId,action:L.name},"Executing action");let g=q8(),y=q8();this.currentActionContext={actionName:L.name,actionId:g,prompts:[]};let o={actionContext:{previousResults:N,getPreviousResult:(G)=>{return N.find((M)=>M.data?.actionName===G)}}};if(H)o.actionPlan={totalSteps:H.totalSteps,currentStep:H.currentStep,steps:H.steps,thought:H.thought};if(P?.onStreamChunk)o.onStreamChunk=P.onStreamChunk;await this.emitEvent("ACTION_STARTED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:`Executing action: ${L.name}`,actions:[L.name],actionStatus:"executing",actionId:g,runId:T,type:"agent_action",thought:f,source:$.content?.source}});let s=[],Q=async(G)=>{return G.responseId=y,s.push(G),[]},m;if(P?.onStreamChunk){let G=null;m={messageId:y,onStreamChunk:async(M,A)=>{if(!G)G=new TT;let v=G.push(M);if(v)await P.onStreamChunk(v,A)},onStreamEnd:()=>{G=null}}}let e=await C1(m,()=>L.handler(this,$,h,o,Q,q)),j=e===void 0||e===null||typeof e==="boolean",W=null;if(!j){if(typeof e==="object"&&e!==null&&(("values"in e)||("data"in e)||("text"in e)))W={...e,success:"success"in e?e.success:!0};else W={success:!0,data:{actionName:L.name,legacyResult:e}};if(N.push(W),W.values){let G=Array.isArray(h.data?.actionResults)?h.data.actionResults:[];h={...h,values:{...h.values,...W.values},data:{...h.data||{},actionResults:[...G,W],actionPlan:H}}}if(W&&h.data){if(!h.data.workingMemory)h.data.workingMemory={};let M=`action_${W.data?.actionName||L.name}_${q8()}`,A={actionName:L.name,result:W,timestamp:Date.now()},v=h.data.workingMemory;v[M]=A;let V=Object.entries(v);if(V.length>this.maxWorkingMemoryEntries){let R=V.sort((E,b)=>{let x=E[1],l=b[1],F=x?.timestamp??0;return(l?.timestamp??0)-F});h.data.workingMemory=Object.fromEntries(R.slice(0,this.maxWorkingMemoryEntries))}}if(H&&H.steps[w])H=this.updateActionStep(H,w,{status:"completed",result:W})}let J=W?.success!==!1?"completed":"failed";if(await this.emitEvent("ACTION_COMPLETED",{messageId:g,roomId:$.roomId,world:$.worldId,content:{text:W?.text||"",actions:[L.name],actionStatus:J,actionId:g,type:"agent_action",thought:f,actionResult:W,source:$.content?.source}}),K)for(let G of s)await K(G);let Z={id:g,entityId:this.agentId,roomId:$.roomId,worldId:$.worldId,content:{text:W?.text||`Executed action: ${L.name}`,source:"action",type:"action_result",actionName:L.name,actionStatus:W?.success?"completed":"failed",actionResult:j?{legacy:e}:W,runId:T,...H&&{planStep:`${H.currentStep}/${H.totalSteps}`,planThought:H.thought}},metadata:{type:"action_result",actionName:L.name,runId:T,parentRunId:z,actionId:g,...H&&{totalSteps:H.totalSteps,currentStep:H.currentStep}}};await this.createMemory(Z,"messages"),this.logger.debug({src:"agent",agentId:this.agentId,action:L.name},"Action completed"),await this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"action",body:{action:L.name,actionId:g,message:$.content.text,messageId:$.id,state:h,responses:q,result:j?{legacy:e}:W,isLegacyReturn:j,prompts:this.currentActionContext?.prompts||[],promptCount:this.currentActionContext?.prompts.length||0,runId:T,parentRunId:z,...H&&{planStep:`${H.currentStep}/${H.totalSteps}`,planThought:H.thought}}}),this.currentActionContext=void 0,w++}if($.id)this.stateCache.set(`${$.id}_action_results`,{values:{actionResults:N},data:{actionResults:N,actionPlan:H},text:JSON.stringify(N)})}}getActionResults($){return this.stateCache?.get(`${$}_action_results`)?.data?.actionResults||[]}async evaluate($,q,_,K,P){let Y=this.evaluators.map(async(z)=>{if(!z.handler)return null;if(!_&&!z.alwaysRun)return null;if(await z.validate(this,$,q))return z;return null}),O=(await Promise.all(Y)).filter(Boolean);if(O.length===0)return[];return q=await this.composeState($,["RECENT_MESSAGES","EVALUATORS"]),await Promise.all(O.map(async(z)=>{if(z.handler)await z.handler(this,$,q,{},K,P),this.adapter.log({entityId:$.entityId,roomId:$.roomId,type:"evaluator",body:{evaluator:z.name,messageId:$.id,message:$.content.text,state:q,runId:this.getCurrentRunId()}})})),O}async ensureConnections($,q,_,K){if(!$){this.logger.error({src:"agent",agentId:this.agentId},"ensureConnections called without entities");return}if(!q||q.length===0){this.logger.error({src:"agent",agentId:this.agentId},"ensureConnections called without rooms");return}await this.ensureWorldExists({...K,agentId:this.agentId});let P=q[0],Y=(g,y)=>g.reduce((p,o,s)=>{if(s%y===0)p.push([]);return p[p.length-1].push(o),p},[]),O=q.map((g)=>g.id),T=(await this.getRoomsByIds(O))?.map((g)=>g.id),H=O.filter((g)=>!T?.includes(g)),f={worldId:K.id,messageServerId:K.messageServerId,source:_,agentId:this.agentId};if(H.length){this.logger.debug({src:"agent",agentId:this.agentId,count:H.length},"Creating rooms");let g=q.filter((y)=>H.includes(y.id)).map((y)=>({...y,...f,type:y.type||"GROUP"}));await this.createRooms(g)}let w=$.map((g)=>g.id).filter((g)=>g!==void 0),S=(await this.adapter.getEntitiesByIds(w))?.map((g)=>g.id).filter((g)=>g!==void 0)||[],N=$.filter((g)=>g.id!==void 0&&!S.includes(g.id)),h={roomId:P.id,channelId:P.channelId,type:P.type},C={worldId:K.id,messageServerId:K.messageServerId};if(N.length){this.logger.debug({src:"agent",agentId:this.agentId,count:N.length},"Creating entities");let g={...h,...C,source:_,agentId:this.agentId},y=N.map((o)=>({...o,...g,metadata:o.metadata||{}})),p=Y(y,5000);for(let o of p)await this.createEntities(o)}await this.ensureParticipantInRoom(this.agentId,P.id);let D=(await this.getParticipantsForRoom(P.id)).filter((g)=>g!==void 0),L=w.filter((g)=>!D.includes(g));if(L.length){this.logger.debug({src:"agent",agentId:this.agentId,count:L.length,channelId:P.id},"Adding missing participants");let g=Y(L,5000);for(let y of g)await this.addParticipantsRoom(y,P.id)}this.logger.success({src:"agent",agentId:this.agentId,worldId:K.id},"World connected")}async ensureConnection({entityId:$,roomId:q,worldId:_,worldName:K,userName:P,name:Y,source:O,type:z,channelId:T,messageServerId:H,userId:f,metadata:w}){if(!_&&H)_=K_(this,H);let k=[Y,P].filter(Boolean),S={[O]:{id:f,name:Y,userName:P}},N=await this.getEntityById($);if(!N)if(await this.createEntity({id:$,names:k,metadata:S,agentId:this.agentId}))this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,userName:Y||P},"Entity created");else throw Error(`Failed to create entity ${$}`);else await this.adapter.updateEntity({id:$,names:[...new Set([...N.names||[],...k])].filter(Boolean),metadata:{...N.metadata,[O]:{...N.metadata?.[O]&&typeof N.metadata[O]==="object"?N.metadata[O]:{},id:f,name:Y,userName:P}},agentId:this.agentId});await this.ensureWorldExists({id:_,name:K||H?`World for server ${H}`:`World for room ${q}`,agentId:this.agentId,messageServerId:H,metadata:w}),await this.ensureRoomExists({id:q,name:Y||"default",source:O||"default",type:z||"DM",channelId:T,messageServerId:H,worldId:_}),await this.ensureParticipantInRoom($,q),await this.ensureParticipantInRoom(this.agentId,q),this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,channelId:q},"Entity connected")}async ensureParticipantInRoom($,q){let _=await this.getEntityById($);if(!_&&$!==this.agentId)this.logger.warn({src:"agent",agentId:this.agentId,entityId:$},"Entity not accessible, attempting to add as participant");else if(!_&&$===this.agentId)throw Error(`Agent entity ${$} not found, cannot add as participant.`);else if(!_)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({src:"agent",agentId:this.agentId,channelId:q},"Agent linked to room");else this.logger.debug({src:"agent",agentId:this.agentId,entityId:$,channelId:q},"User linked to room")}}async removeParticipant($,q){return await this.adapter.removeParticipant($,q)}async getParticipantsForEntity($){return await this.adapter.getParticipantsForEntity($)}async getParticipantsForRoom($){return await this.adapter.getParticipantsForRoom($)}async isRoomParticipant($,q){return await this.adapter.isRoomParticipant($,q)}async addParticipant($,q){return await this.adapter.addParticipantsRoom([$],q)}async addParticipantsRoom($,q){return await this.adapter.addParticipantsRoom($,q)}async ensureWorldExists({id:$,name:q,messageServerId:_,metadata:K}){if(!await this.getWorld($))this.logger.debug({src:"agent",agentId:this.agentId,worldId:$,name:q,messageServerId:_},"Creating world"),await this.adapter.createWorld({id:$,name:q,agentId:this.agentId,messageServerId:_,metadata:K}),this.logger.debug({src:"agent",agentId:this.agentId,worldId:$,messageServerId:_},"World created")}async ensureRoomExists({id:$,name:q,source:_,type:K,channelId:P,messageServerId:Y,worldId:O,metadata:z}){if(!O)throw Error("worldId is required");if(!await this.getRoom($))await this.createRoom({id:$,name:q,agentId:this.agentId,source:_,type:K,channelId:P,messageServerId:Y,worldId:O,metadata:z}),this.logger.debug({src:"agent",agentId:this.agentId,channelId:$},"Room created")}async composeState($,q=null,_=!1,K=!1){let P=_?q:null,Y={values:{},data:{},text:""},O=K||!$.id?Y:await this.stateCache.get($.id)||Y,z=new Set;if(P&&P.length>0)P.forEach((h)=>z.add(h));else this.providers.filter((h)=>!h.private&&!h.dynamic).forEach((h)=>z.add(h.name));if(!P&&q&&q.length>0)q.forEach((h)=>z.add(h));let T=Array.from(new Set(this.providers.filter((h)=>z.has(h.name)))).sort((h,C)=>(h.position||0)-(C.position||0)),H=await Promise.all(T.map(async(h)=>{let C=Date.now(),I=await h.get(this,$,O),D=Date.now()-C;if(D>100)this.logger.debug({src:"agent",agentId:this.agentId,provider:h.name,duration:D},"Slow provider");return{...I,providerName:h.name}})),f={...O.data?.providers||{}};for(let h of H)f[h.providerName]=h;let w=[];for(let h of T){let C=f[h.name];if(C&&C.text&&typeof C.text==="string"&&C.text.trim()!=="")w.push(C.text)}let k=w.join(`
676
+ `),S={...O.values||{}};for(let h of T){let C=f[h.name];if(C&&C.values&&typeof C.values==="object"&&C.values!==null)Object.assign(S,C.values)}for(let h in f)if(!T.some((C)=>C.name===h)){let C=f[h];if(C&&C.values&&typeof C.values==="object"&&C.values!==null)Object.assign(S,C.values)}let N={values:{...S,providers:k},data:{...O.data||{},providers:f},text:k};if($.id)this.stateCache.set($.id,N);return N}getService($){let q=this.services.get($);if(!q||q.length===0)return this.logger.debug({src:"agent",agentId:this.agentId,serviceName:$},"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({src:"agent",agentId:this.agentId,serviceName:$},"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,_]of this.services)$[q]={status:this.getServiceRegistrationStatus(q),instances:_.length,hasPromise:this.servicePromises.has(q)};for(let[q,_]of this.serviceRegistrationStatus)if(!$[q])$[q]={status:_,instances:0,hasPromise:this.servicePromises.has(q)};return $}async registerService($){let q=$.serviceType,_=$.name||"Unknown";if(!q){this.logger.warn({src:"agent",agentId:this.agentId,serviceName:_},"Service missing serviceType property");return}this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Registering service"),this.serviceRegistrationStatus.set(q,"registering"),this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service waiting for init");let K=new Promise((O,z)=>{setTimeout(()=>{z(Error(`Service ${q} registration timed out waiting for runtime initialization (30s timeout)`))},30000)});if(await Promise.race([this.initPromise,K]),typeof $.start!=="function")throw Error(`Service ${q} does not have a static start method. All services must implement static async start(runtime: IAgentRuntime): Promise<Service>.`);let P=await $.start(this);if(!P)throw Error(`Service ${q} start() method returned null or undefined. It must return a Service instance.`);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 Y=this.servicePromiseHandlers.get(q);if(Y)Y.resolve(P),this.servicePromiseHandlers.delete(q);else this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service has no promise handler");if($.registerSendHandlers)$.constructor.registerSendHandlers?.(this,P);this.serviceRegistrationStatus.set(q,"registered"),this.logger.debug({src:"agent",agentId:this.agentId,serviceType:q},"Service registered")}_createServiceResolver($){let q,_;if(this.servicePromises.set($,new Promise((K,P)=>{q=K,_=P})),!q)throw Error(`Failed to create resolver for service ${$}`);if(!_)throw Error(`Failed to create rejecter for service ${$}`);return this.servicePromiseHandlers.set($,{resolve:q,reject:_}),this.servicePromises.get($)}getServiceLoadPromise($){let q=this.servicePromises.get($);if(!q)q=this._createServiceResolver($);return q}registerModel($,q,_,K){let P=typeof $==="string"?$:k6[$];if(!this.models.has(P))this.models.set(P,[]);let Y=Date.now();this.models.get(P)?.push({handler:q,provider:_,priority:K||0,registrationOrder:Y}),this.models.get(P)?.sort((O,z)=>{if((z.priority||0)!==(O.priority||0))return(z.priority||0)-(O.priority||0);return(O.registrationOrder||0)-(z.registrationOrder||0)})}getModel($){let q=typeof $==="string"?$:k6[$],_=this.models.get(q);if(!_?.length)return;return this.logger.debug({src:"agent",agentId:this.agentId,model:q,provider:_[0].provider},"Using model"),_[0].handler}getModelSettings($){let q={},_=(k,S)=>{if($){let C=`${$}_${k}`,I=this.getSetting(C);if(I!==null&&I!==void 0){let D=Number(I);if(!isNaN(D))return D}}let N=`DEFAULT_${k}`,h=this.getSetting(N);if(h!==null&&h!==void 0){let C=Number(h);if(!isNaN(C))return C}if(S){let C=this.getSetting(S);if(C!==null&&C!==void 0){let I=Number(C);if(!isNaN(I))return I}}return null},K=_("MAX_TOKENS",vP.MODEL_MAX_TOKEN),P=_("TEMPERATURE",vP.MODEL_TEMPERATURE),Y=_("TOP_P"),O=_("TOP_K"),z=_("MIN_P"),T=_("SEED"),H=_("REPETITION_PENALTY"),f=_("FREQUENCY_PENALTY",vP.MODEL_FREQ_PENALTY),w=_("PRESENCE_PENALTY",vP.MODEL_PRESENCE_PENALTY);if(K!==null)q.maxTokens=K;if(P!==null)q.temperature=P;if(Y!==null)q.topP=Y;if(O!==null)q.topK=O;if(z!==null)q.minP=z;if(T!==null)q.seed=T;if(H!==null)q.repetitionPenalty=H;if(f!==null)q.frequencyPenalty=f;if(w!==null)q.presencePenalty=w;return Object.keys(q).length>0?q:null}logModelCall($,q,_,K,P,Y,O){if(q!==k6.TEXT_EMBEDDING&&K){if(this.currentActionContext)this.currentActionContext.prompts.push({modelType:q,prompt:K,timestamp:Date.now()})}this.adapter.log({entityId:this.agentId,roomId:this.currentRoomId??this.agentId,body:{modelType:$,modelKey:q,params:{...typeof _==="object"&&!Array.isArray(_)&&_?_:{},prompt:K},prompt:K,systemPrompt:this.character?.system||null,runId:this.getCurrentRunId(),timestamp:Date.now(),executionTime:P,provider:Y||this.models.get(q)?.[0]?.provider||"unknown",actionContext:this.currentActionContext?{actionName:this.currentActionContext.actionName,actionId:this.currentActionContext.actionId}:void 0,response:Array.isArray(O)&&O.every((z)=>typeof z==="number")?"[array]":O},type:`useModel:${q}`})}async useModel($,q,_){let K=typeof $==="string"?$:k6[$],P=q,Y=(P&&"prompt"in P&&typeof P.prompt==="string"?P.prompt:null)||(P&&"input"in P&&typeof P.input==="string"?P.input:null)||(P&&"messages"in P&&Array.isArray(P.messages)?JSON.stringify(P.messages):null),O=this.getModel(K),z=_&&this.models.get(K)?.find((y)=>y.provider===_),T=z?z.handler:O;if(!T){let y=`No handler found for delegate type: ${K}`;throw Error(y)}if(![k6.TRANSCRIPTION,k6.IMAGE,k6.AUDIO,k6.VIDEO].includes(K))this.logger.trace({src:"agent",agentId:this.agentId,model:K,params:q},"Model input");else{let y="unknown size";if(Buffer.isBuffer(q))y=`${q.length} bytes`;else if(typeof Blob<"u"&&q instanceof Blob)y=`${q.size} bytes`;else if(typeof q==="object"&&q!==null){if("audio"in q&&Buffer.isBuffer(q.audio))y=`${q.audio.length} bytes`;else if("audio"in q&&typeof Blob<"u"&&q.audio instanceof Blob)y=`${q.audio.size} bytes`}this.logger.trace({src:"agent",agentId:this.agentId,model:K,size:y},"Model input (binary)")}let f;if(q===null||q===void 0||typeof q!=="object"||Array.isArray(q)||OK.isBuffer(q))f=q;else{let y=this.getModelSettings(K);if(y)f={...y,...q};else f=q;if(G1(f)){if(f.user===void 0&&this.character?.name){if(typeof f==="object"&&f!==null&&!Array.isArray(f))f.user=this.character.name}}}let w=typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now(),k=a2(),S=G1(f)?f.onStreamChunk:void 0,N=k?.onStreamChunk,h=k?.messageId,C=k?.abortSignal,I=G1(f)?f.stream:void 0,D=I===!1?!1:!!(S||N||I);if(G1(f))f.stream=D,delete f.onStreamChunk;let L=await T(this,f);if(D&&(S||N)&&L&&typeof L==="object"&&"textStream"in L){let y="";for await(let s of L.textStream){if(C?.aborted)break;y+=s;try{if(S)await S(s,h)}catch{}try{if(N)await N(s,h)}catch{}}let p=a2()?.onStreamEnd;if(p)p();let o=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-w;return this.logger.trace({src:"agent",agentId:this.agentId,model:K,duration:Number(o.toFixed(2)),streaming:!0},"Model output (stream with callback complete)"),this.logModelCall($,K,q,Y,o,_,y),y}let g=(typeof performance<"u"&&typeof performance.now==="function"?performance.now():Date.now())-w;return this.logger.trace({src:"agent",agentId:this.agentId,model:K,duration:Number(g.toFixed(2))},"Model output"),this.logModelCall($,K,q,Y,g,_,L),L}async generateText($,q){if(!$?.trim())throw Error("Input cannot be empty");let _=q?.includeCharacter??!0,K=q?.modelType??k6.TEXT_LARGE,P=$;if(_&&this.character){let z=this.character,T=[],H=Array.isArray(z.bio)?z.bio.join(" "):z.bio;if(H)T.push(`# About ${z.name}
677
677
  ${H}`);if(z.system)T.push(z.system);let f=[...z.style?.all||[],...z.style?.chat||[]];if(f.length>0)T.push(`Style:
678
678
  ${f.map((w)=>`- ${w}`).join(`
679
679
  `)}`);if(T.length>0)P=`${T.join(`
@@ -721,5 +721,5 @@ Data: ${JSON.stringify(_.metadata)}
721
721
  `}`}).join(`
722
722
  `)}RT(DT());var i3$=!0,B3$=!1,t3$={check:async()=>({status:"not-applicable",environment:"browser"}),isHealthy:()=>!0};export{oU as validateUuid,rN as validateCharacter,lN as uuidSchema,X3$ as updateWorldSettings,PC as unsaltWorldSettings,uF as unsaltSettingValue,pN as truncateToCompleteSentence,UY$ as trimTokens,YF as toString,oN as toHex,eU as templateTypeSchema,sU as styleSchema,i2 as stringToUuid,tY$ as splitChunks,zF as slice,BN as shouldRespondTemplate,$F as settingsSchema,RT as setStreamingContextManager,X5$ as setEnv,t3$ as serverHealth,qF as secretsSchema,xF as saltWorldSettings,yF as saltSettingValue,FY$ as safeReplacer,C1 as runWithStreamingContext,LY$ as removeLogListener,yY$ as recentLogs,HF as randomBytes,QY$ as prewarmUuidCache,MO$ as postCreationTemplate,YK as parseKeyValueXml,BY$ as parseJSONObjectFromText,n2 as parseBooleanFromText,_O$ as parseAndValidateCharacter,bN as normalizeJsonString,QN as multiStepSummaryTemplate,FN as multiStepDecisionTemplate,tN as messageHandlerTemplate,FU as messageExampleSchema,tU as mediaSchema,V6 as logger,S5$ as loadEnvFile,aU as knowledgeItemSchema,KO$ as isValidCharacter,YQ as isStreamableModelType,B3$ as isNode,ZO$ as isMessageMetadata,fO$ as isFragmentMetadata,GO$ as isFragmentMemory,wO$ as isDocumentMetadata,kO$ as isDocumentMemory,XO$ as isDescriptionMetadata,AO$ as isCustomMetadata,WT as isBuffer,i3$ as isBrowser,k3$ as initializeOnboarding,G5$ as initBrowserEnvironment,UN as imageDescriptionTemplate,A5$ as hasEnv,A3$ as getWorldSettings,RO$ as getUserServerRole,_Q as getTypedService,UF as getStreamingContextManager,a2 as getStreamingContext,L_ as getSalt,xM as getNumberEnv,VO$ as getMemoryText,dN as getLocalServerUrl,t4 as getEnvironment,E_ as getEnv,d3$ as getEntityDetails,aY$ as getContentTypeFromMimeType,k5$ as getBooleanEnv,PF as fromString,KF as fromHex,jF as fromBytes,xN as formatTimestamp,nY$ as formatPosts,iY$ as formatMessages,l3$ as formatEntities,zO$ as formatActions,vO$ as formatActionNames,IO$ as findWorldsForOwner,pt as findEnvFile,m3$ as findEntityByName,WF as equals,G3$ as encryptedCharacter,KC as encryptStringValue,S1 as encryptObjectValues,gY$ as elizaLogger,QU as directoryItemSchema,B4 as detectEnvironment,N3$ as defineService,V3$ as decryptedCharacter,t2 as decryptStringValue,t2 as decryptSecret,_C as decryptObjectValues,bY$ as customLevels,V5$ as currentRuntime,K_ as createUniqueUuid,bF as createSettingFromConfig,KQ as createServiceError,pF as createService,TO$ as createMessageMemory,X1 as createLogger,UU as contentSchema,vF as concat,A1 as composePromptFromState,yN as composePrompt,jO$ as composeActionExamples,Z3$ as clearSaltCache,_F as characterSchema,JF as byteLength,NO$ as booleanFooter,e2 as asUUID,OF as alloc,DY$ as addLogListener,oY$ as addHeader,hY$ as __loggerTestHooks,jQ as VECTOR_DIMS,kC as TeeType,AC as TEEMode,qQ as ServiceType,YC as ServiceBuilder,s2 as Service,RF as Semaphore,GC as SOCKET_MESSAGE_TYPE,wC as Role,XC as PlatformPrefix,k6 as ModelType,fC as MemoryType,vP as MODEL_SETTINGS,JQ as MESSAGE_STREAM_EVENT,$Y as EventType,uM as Environment,nF as ElizaOS,XT as DefaultMessageService,wF as DatabaseAdapter,OP as ContentType,jP as ChannelType,OK as BufferUtils,kT as BM25,ZC as AgentStatus,GT as AgentRuntime};
723
723
 
724
- //# debugId=467C8BA269C1295864756E2164756E21
724
+ //# debugId=B40AB8393F056A5D64756E2164756E21
725
725
  //# sourceMappingURL=index.browser.js.map