@learncard/idx-plugin 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +140 -0
- package/dist/idx-plugin.cjs.development.js +65066 -0
- package/dist/idx-plugin.cjs.development.js.map +7 -0
- package/dist/idx-plugin.cjs.production.min.js +867 -0
- package/dist/idx-plugin.cjs.production.min.js.map +7 -0
- package/dist/idx-plugin.esm.js +65067 -0
- package/dist/idx-plugin.esm.js.map +7 -0
- package/dist/idx.d.ts +6 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +7 -0
- package/dist/types.d.ts +53 -0
- package/package.json +48 -0
|
@@ -0,0 +1,867 @@
|
|
|
1
|
+
"use strict";var PO=Object.create;var rf=Object.defineProperty;var BO=Object.getOwnPropertyDescriptor;var LO=Object.getOwnPropertyNames;var FO=Object.getPrototypeOf,UO=Object.prototype.hasOwnProperty;var i=(e,t)=>rf(e,"name",{value:t,configurable:!0});var kn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),_n=(e,t)=>{for(var r in t)rf(e,r,{get:t[r],enumerable:!0})},K4=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of LO(t))!UO.call(e,s)&&s!==r&&rf(e,s,{get:()=>t[s],enumerable:!(n=BO(t,s))||n.enumerable});return e};var Ua=(e,t,r)=>(r=e!=null?PO(FO(e)):{},K4(t||!e||!e.__esModule?rf(r,"default",{value:e,enumerable:!0}):r,e)),$O=e=>K4(rf({},"__esModule",{value:!0}),e);var a8=kn((kK,s8)=>{s8.exports=$v;var i8=128,IR=127,DR=~IR,kR=Math.pow(2,31);function $v(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw $v.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=kR;)t[r++]=e&255|i8,e/=128;for(;e&DR;)t[r++]=e&255|i8,e>>>=7;return t[r]=e|0,$v.bytes=r-n+1,t}i($v,"encode")});var u8=kn((OK,c8)=>{c8.exports=jv;var OR=128,o8=127;function jv(e,n){var r=0,n=n||0,s=0,o=n,c,l=e.length;do{if(o>=l||s>49)throw jv.bytes=0,new RangeError("Could not decode varint");c=e[o++],r+=s<28?(c&o8)<<s:(c&o8)*Math.pow(2,s),s+=7}while(c>=OR);return jv.bytes=o-n,r}i(jv,"read")});var f8=kn((RK,l8)=>{var RR=Math.pow(2,7),NR=Math.pow(2,14),PR=Math.pow(2,21),BR=Math.pow(2,28),LR=Math.pow(2,35),FR=Math.pow(2,42),UR=Math.pow(2,49),$R=Math.pow(2,56),jR=Math.pow(2,63);l8.exports=function(e){return e<RR?1:e<NR?2:e<PR?3:e<BR?4:e<LR?5:e<FR?6:e<UR?7:e<$R?8:e<jR?9:10}});var Gh=kn((NK,d8)=>{d8.exports={encode:a8(),decode:u8(),encodingLength:f8()}});var zg=kn((_f,hu)=>{var yP=200,J9="__lodash_hash_undefined__",Y9=9007199254740991,Pg="[object Arguments]",bP="[object Array]",X9="[object Boolean]",Q9="[object Date]",_P="[object Error]",Bg="[object Function]",eE="[object GeneratorFunction]",wp="[object Map]",tE="[object Number]",Lg="[object Object]",U9="[object Promise]",rE="[object RegExp]",Ep="[object Set]",nE="[object String]",iE="[object Symbol]",Ig="[object WeakMap]",sE="[object ArrayBuffer]",Ap="[object DataView]",aE="[object Float32Array]",oE="[object Float64Array]",cE="[object Int8Array]",uE="[object Int16Array]",lE="[object Int32Array]",fE="[object Uint8Array]",dE="[object Uint8ClampedArray]",hE="[object Uint16Array]",pE="[object Uint32Array]",wP=/[\\^$.*+?()[\]{}|]/g,EP=/\w*$/,AP=/^\[object .+?Constructor\]$/,SP=/^(?:0|[1-9]\d*)$/,Ar={};Ar[Pg]=Ar[bP]=Ar[sE]=Ar[Ap]=Ar[X9]=Ar[Q9]=Ar[aE]=Ar[oE]=Ar[cE]=Ar[uE]=Ar[lE]=Ar[wp]=Ar[tE]=Ar[Lg]=Ar[rE]=Ar[Ep]=Ar[nE]=Ar[iE]=Ar[fE]=Ar[dE]=Ar[hE]=Ar[pE]=!0;Ar[_P]=Ar[Bg]=Ar[Ig]=!1;var xP=typeof global=="object"&&global&&global.Object===Object&&global,TP=typeof self=="object"&&self&&self.Object===Object&&self,ca=xP||TP||Function("return this")(),mE=typeof _f=="object"&&_f&&!_f.nodeType&&_f,$9=mE&&typeof hu=="object"&&hu&&!hu.nodeType&&hu,MP=$9&&$9.exports===mE;function CP(e,t){return e.set(t[0],t[1]),e}i(CP,"addMapEntry");function IP(e,t){return e.add(t),e}i(IP,"addSetEntry");function DP(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}i(DP,"arrayEach");function kP(e,t){for(var r=-1,n=t.length,s=e.length;++r<n;)e[s+r]=t[r];return e}i(kP,"arrayPush");function vE(e,t,r,n){var s=-1,o=e?e.length:0;for(n&&o&&(r=e[++s]);++s<o;)r=t(r,e[s],s,e);return r}i(vE,"arrayReduce");function OP(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}i(OP,"baseTimes");function RP(e,t){return e?.[t]}i(RP,"getValue");function gE(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}i(gE,"isHostObject");function j9(e){var t=-1,r=Array(e.size);return e.forEach(function(n,s){r[++t]=[s,n]}),r}i(j9,"mapToArray");function Fg(e,t){return function(r){return e(t(r))}}i(Fg,"overArg");function z9(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}i(z9,"setToArray");var NP=Array.prototype,PP=Function.prototype,Sp=Object.prototype,Cg=ca["__core-js_shared__"],H9=function(){var e=/[^.]+$/.exec(Cg&&Cg.keys&&Cg.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),yE=PP.toString,Ha=Sp.hasOwnProperty,xp=Sp.toString,BP=RegExp("^"+yE.call(Ha).replace(wP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),q9=MP?ca.Buffer:void 0,K9=ca.Symbol,V9=ca.Uint8Array,LP=Fg(Object.getPrototypeOf,Object),FP=Object.create,UP=Sp.propertyIsEnumerable,$P=NP.splice,G9=Object.getOwnPropertySymbols,jP=q9?q9.isBuffer:void 0,zP=Fg(Object.keys,Object),Dg=vu(ca,"DataView"),wf=vu(ca,"Map"),kg=vu(ca,"Promise"),Og=vu(ca,"Set"),Rg=vu(ca,"WeakMap"),Ef=vu(Object,"create"),HP=Yo(Dg),qP=Yo(wf),KP=Yo(kg),VP=Yo(Og),GP=Yo(Rg),W9=K9?K9.prototype:void 0,Z9=W9?W9.valueOf:void 0;function Jo(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i(Jo,"Hash");function WP(){this.__data__=Ef?Ef(null):{}}i(WP,"hashClear");function ZP(e){return this.has(e)&&delete this.__data__[e]}i(ZP,"hashDelete");function JP(e){var t=this.__data__;if(Ef){var r=t[e];return r===J9?void 0:r}return Ha.call(t,e)?t[e]:void 0}i(JP,"hashGet");function YP(e){var t=this.__data__;return Ef?t[e]!==void 0:Ha.call(t,e)}i(YP,"hashHas");function XP(e,t){var r=this.__data__;return r[e]=Ef&&t===void 0?J9:t,this}i(XP,"hashSet");Jo.prototype.clear=WP;Jo.prototype.delete=ZP;Jo.prototype.get=JP;Jo.prototype.has=YP;Jo.prototype.set=XP;function ua(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i(ua,"ListCache");function QP(){this.__data__=[]}i(QP,"listCacheClear");function eB(e){var t=this.__data__,r=Tp(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():$P.call(t,r,1),!0}i(eB,"listCacheDelete");function tB(e){var t=this.__data__,r=Tp(t,e);return r<0?void 0:t[r][1]}i(tB,"listCacheGet");function rB(e){return Tp(this.__data__,e)>-1}i(rB,"listCacheHas");function nB(e,t){var r=this.__data__,n=Tp(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}i(nB,"listCacheSet");ua.prototype.clear=QP;ua.prototype.delete=eB;ua.prototype.get=tB;ua.prototype.has=rB;ua.prototype.set=nB;function pu(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}i(pu,"MapCache");function iB(){this.__data__={hash:new Jo,map:new(wf||ua),string:new Jo}}i(iB,"mapCacheClear");function sB(e){return Mp(this,e).delete(e)}i(sB,"mapCacheDelete");function aB(e){return Mp(this,e).get(e)}i(aB,"mapCacheGet");function oB(e){return Mp(this,e).has(e)}i(oB,"mapCacheHas");function cB(e,t){return Mp(this,e).set(e,t),this}i(cB,"mapCacheSet");pu.prototype.clear=iB;pu.prototype.delete=sB;pu.prototype.get=aB;pu.prototype.has=oB;pu.prototype.set=cB;function mu(e){this.__data__=new ua(e)}i(mu,"Stack");function uB(){this.__data__=new ua}i(uB,"stackClear");function lB(e){return this.__data__.delete(e)}i(lB,"stackDelete");function fB(e){return this.__data__.get(e)}i(fB,"stackGet");function dB(e){return this.__data__.has(e)}i(dB,"stackHas");function hB(e,t){var r=this.__data__;if(r instanceof ua){var n=r.__data__;if(!wf||n.length<yP-1)return n.push([e,t]),this;r=this.__data__=new pu(n)}return r.set(e,t),this}i(hB,"stackSet");mu.prototype.clear=uB;mu.prototype.delete=lB;mu.prototype.get=fB;mu.prototype.has=dB;mu.prototype.set=hB;function pB(e,t){var r=$g(e)||FB(e)?OP(e.length,String):[],n=r.length,s=!!n;for(var o in e)(t||Ha.call(e,o))&&!(s&&(o=="length"||NB(o,n)))&&r.push(o);return r}i(pB,"arrayLikeKeys");function bE(e,t,r){var n=e[t];(!(Ha.call(e,t)&&AE(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}i(bE,"assignValue");function Tp(e,t){for(var r=e.length;r--;)if(AE(e[r][0],t))return r;return-1}i(Tp,"assocIndexOf");function mB(e,t){return e&&_E(t,jg(t),e)}i(mB,"baseAssign");function Ng(e,t,r,n,s,o,c){var l;if(n&&(l=o?n(e,s,o,c):n(e)),l!==void 0)return l;if(!Cp(e))return e;var h=$g(e);if(h){if(l=kB(e),!t)return CB(e,l)}else{var p=Zo(e),v=p==Bg||p==eE;if($B(e))return wB(e,t);if(p==Lg||p==Pg||v&&!o){if(gE(e))return o?e:{};if(l=OB(v?{}:e),!t)return IB(e,mB(l,e))}else{if(!Ar[p])return o?e:{};l=RB(e,p,Ng,t)}}c||(c=new mu);var b=c.get(e);if(b)return b;if(c.set(e,l),!h)var y=r?DB(e):jg(e);return DP(y||e,function(A,C){y&&(C=A,A=e[C]),bE(l,C,Ng(A,t,r,n,C,e,c))}),l}i(Ng,"baseClone");function vB(e){return Cp(e)?FP(e):{}}i(vB,"baseCreate");function gB(e,t,r){var n=t(e);return $g(e)?n:kP(n,r(e))}i(gB,"baseGetAllKeys");function yB(e){return xp.call(e)}i(yB,"baseGetTag");function bB(e){if(!Cp(e)||BB(e))return!1;var t=xE(e)||gE(e)?BP:AP;return t.test(Yo(e))}i(bB,"baseIsNative");function _B(e){if(!EE(e))return zP(e);var t=[];for(var r in Object(e))Ha.call(e,r)&&r!="constructor"&&t.push(r);return t}i(_B,"baseKeys");function wB(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}i(wB,"cloneBuffer");function Ug(e){var t=new e.constructor(e.byteLength);return new V9(t).set(new V9(e)),t}i(Ug,"cloneArrayBuffer");function EB(e,t){var r=t?Ug(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}i(EB,"cloneDataView");function AB(e,t,r){var n=t?r(j9(e),!0):j9(e);return vE(n,CP,new e.constructor)}i(AB,"cloneMap");function SB(e){var t=new e.constructor(e.source,EP.exec(e));return t.lastIndex=e.lastIndex,t}i(SB,"cloneRegExp");function xB(e,t,r){var n=t?r(z9(e),!0):z9(e);return vE(n,IP,new e.constructor)}i(xB,"cloneSet");function TB(e){return Z9?Object(Z9.call(e)):{}}i(TB,"cloneSymbol");function MB(e,t){var r=t?Ug(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}i(MB,"cloneTypedArray");function CB(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}i(CB,"copyArray");function _E(e,t,r,n){r||(r={});for(var s=-1,o=t.length;++s<o;){var c=t[s],l=n?n(r[c],e[c],c,r,e):void 0;bE(r,c,l===void 0?e[c]:l)}return r}i(_E,"copyObject");function IB(e,t){return _E(e,wE(e),t)}i(IB,"copySymbols");function DB(e){return gB(e,jg,wE)}i(DB,"getAllKeys");function Mp(e,t){var r=e.__data__;return PB(t)?r[typeof t=="string"?"string":"hash"]:r.map}i(Mp,"getMapData");function vu(e,t){var r=RP(e,t);return bB(r)?r:void 0}i(vu,"getNative");var wE=G9?Fg(G9,Object):HB,Zo=yB;(Dg&&Zo(new Dg(new ArrayBuffer(1)))!=Ap||wf&&Zo(new wf)!=wp||kg&&Zo(kg.resolve())!=U9||Og&&Zo(new Og)!=Ep||Rg&&Zo(new Rg)!=Ig)&&(Zo=i(function(e){var t=xp.call(e),r=t==Lg?e.constructor:void 0,n=r?Yo(r):void 0;if(n)switch(n){case HP:return Ap;case qP:return wp;case KP:return U9;case VP:return Ep;case GP:return Ig}return t},"getTag"));function kB(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&Ha.call(e,"index")&&(r.index=e.index,r.input=e.input),r}i(kB,"initCloneArray");function OB(e){return typeof e.constructor=="function"&&!EE(e)?vB(LP(e)):{}}i(OB,"initCloneObject");function RB(e,t,r,n){var s=e.constructor;switch(t){case sE:return Ug(e);case X9:case Q9:return new s(+e);case Ap:return EB(e,n);case aE:case oE:case cE:case uE:case lE:case fE:case dE:case hE:case pE:return MB(e,n);case wp:return AB(e,n,r);case tE:case nE:return new s(e);case rE:return SB(e);case Ep:return xB(e,n,r);case iE:return TB(e)}}i(RB,"initCloneByTag");function NB(e,t){return t=t??Y9,!!t&&(typeof e=="number"||SP.test(e))&&e>-1&&e%1==0&&e<t}i(NB,"isIndex");function PB(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}i(PB,"isKeyable");function BB(e){return!!H9&&H9 in e}i(BB,"isMasked");function EE(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Sp;return e===r}i(EE,"isPrototype");function Yo(e){if(e!=null){try{return yE.call(e)}catch{}try{return e+""}catch{}}return""}i(Yo,"toSource");function LB(e){return Ng(e,!0,!0)}i(LB,"cloneDeep");function AE(e,t){return e===t||e!==e&&t!==t}i(AE,"eq");function FB(e){return UB(e)&&Ha.call(e,"callee")&&(!UP.call(e,"callee")||xp.call(e)==Pg)}i(FB,"isArguments");var $g=Array.isArray;function SE(e){return e!=null&&jB(e.length)&&!xE(e)}i(SE,"isArrayLike");function UB(e){return zB(e)&&SE(e)}i(UB,"isArrayLikeObject");var $B=jP||qB;function xE(e){var t=Cp(e)?xp.call(e):"";return t==Bg||t==eE}i(xE,"isFunction");function jB(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Y9}i(jB,"isLength");function Cp(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}i(Cp,"isObject");function zB(e){return!!e&&typeof e=="object"}i(zB,"isObjectLike");function jg(e){return SE(e)?pB(e):_B(e)}i(jg,"keys");function HB(){return[]}i(HB,"stubArray");function qB(){return!1}i(qB,"stubFalse");hu.exports=LB});var ME=kn(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.BrowserRandomSource=void 0;var TE=65536,Ip=class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let t=typeof self<"u"?self.crypto||self.msCrypto:null;t&&t.getRandomValues!==void 0&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let r=new Uint8Array(t);for(let n=0;n<r.length;n+=TE)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,TE)));return r}};i(Ip,"BrowserRandomSource");Dp.BrowserRandomSource=Ip});var qg=kn(Hg=>{"use strict";Object.defineProperty(Hg,"__esModule",{value:!0});function KB(e){for(var t=0;t<e.length;t++)e[t]=0;return e}i(KB,"wipe");Hg.wipe=KB});var CE=kn(()=>{});var IE=kn(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.NodeRandomSource=void 0;var VB=qg(),kp=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let t=CE();t&&t.randomBytes&&(this._crypto=t,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(t){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(t);if(r.length!==t)throw new Error("NodeRandomSource: got fewer bytes than requested");let n=new Uint8Array(t);for(let s=0;s<n.length;s++)n[s]=r[s];return(0,VB.wipe)(r),n}};i(kp,"NodeRandomSource");Op.NodeRandomSource=kp});var DE=kn(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.SystemRandomSource=void 0;var GB=ME(),WB=IE(),Rp=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new GB.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new WB.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(t){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(t)}};i(Rp,"SystemRandomSource");Np.SystemRandomSource=Rp});var kE=kn(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});function ZB(e,t){var r=e>>>16&65535,n=e&65535,s=t>>>16&65535,o=t&65535;return n*o+(r*o+n*s<<16>>>0)|0}i(ZB,"imulShim");li.mul=Math.imul||ZB;function JB(e,t){return e+t|0}i(JB,"add");li.add=JB;function YB(e,t){return e-t|0}i(YB,"sub");li.sub=YB;function XB(e,t){return e<<t|e>>>32-t}i(XB,"rotl");li.rotl=XB;function QB(e,t){return e<<32-t|e>>>t}i(QB,"rotr");li.rotr=QB;function eL(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}i(eL,"isIntegerShim");li.isInteger=Number.isInteger||eL;li.MAX_SAFE_INTEGER=9007199254740991;li.isSafeInteger=function(e){return li.isInteger(e)&&e>=-li.MAX_SAFE_INTEGER&&e<=li.MAX_SAFE_INTEGER}});var LE=kn(Kt=>{"use strict";Object.defineProperty(Kt,"__esModule",{value:!0});var OE=kE();function tL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}i(tL,"readInt16BE");Kt.readInt16BE=tL;function rL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}i(rL,"readUint16BE");Kt.readUint16BE=rL;function nL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}i(nL,"readInt16LE");Kt.readInt16LE=nL;function iL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}i(iL,"readUint16LE");Kt.readUint16LE=iL;function RE(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}i(RE,"writeUint16BE");Kt.writeUint16BE=RE;Kt.writeInt16BE=RE;function NE(e,t,r){return t===void 0&&(t=new Uint8Array(2)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}i(NE,"writeUint16LE");Kt.writeUint16LE=NE;Kt.writeInt16LE=NE;function Kg(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}i(Kg,"readInt32BE");Kt.readInt32BE=Kg;function Vg(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}i(Vg,"readUint32BE");Kt.readUint32BE=Vg;function Gg(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}i(Gg,"readInt32LE");Kt.readInt32LE=Gg;function Wg(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}i(Wg,"readUint32LE");Kt.readUint32LE=Wg;function Pp(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}i(Pp,"writeUint32BE");Kt.writeUint32BE=Pp;Kt.writeInt32BE=Pp;function Bp(e,t,r){return t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}i(Bp,"writeUint32LE");Kt.writeUint32LE=Bp;Kt.writeInt32LE=Bp;function sL(e,t){t===void 0&&(t=0);var r=Kg(e,t),n=Kg(e,t+4);return r*4294967296+n-(n>>31)*4294967296}i(sL,"readInt64BE");Kt.readInt64BE=sL;function aL(e,t){t===void 0&&(t=0);var r=Vg(e,t),n=Vg(e,t+4);return r*4294967296+n}i(aL,"readUint64BE");Kt.readUint64BE=aL;function oL(e,t){t===void 0&&(t=0);var r=Gg(e,t),n=Gg(e,t+4);return n*4294967296+r-(r>>31)*4294967296}i(oL,"readInt64LE");Kt.readInt64LE=oL;function cL(e,t){t===void 0&&(t=0);var r=Wg(e,t),n=Wg(e,t+4);return n*4294967296+r}i(cL,"readUint64LE");Kt.readUint64LE=cL;function PE(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Pp(e/4294967296>>>0,t,r),Pp(e>>>0,t,r+4),t}i(PE,"writeUint64BE");Kt.writeUint64BE=PE;Kt.writeInt64BE=PE;function BE(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Bp(e>>>0,t,r),Bp(e/4294967296>>>0,t,r+4),t}i(BE,"writeUint64LE");Kt.writeUint64LE=BE;Kt.writeInt64LE=BE;function uL(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,s=1,o=e/8+r-1;o>=r;o--)n+=t[o]*s,s*=256;return n}i(uL,"readUintBE");Kt.readUintBE=uL;function lL(e,t,r){if(r===void 0&&(r=0),e%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,s=1,o=r;o<r+e/8;o++)n+=t[o]*s,s*=256;return n}i(lL,"readUintLE");Kt.readUintLE=lL;function fL(e,t,r,n){if(r===void 0&&(r=new Uint8Array(e/8)),n===void 0&&(n=0),e%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!OE.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var s=1,o=e/8+n-1;o>=n;o--)r[o]=t/s&255,s*=256;return r}i(fL,"writeUintBE");Kt.writeUintBE=fL;function dL(e,t,r,n){if(r===void 0&&(r=new Uint8Array(e/8)),n===void 0&&(n=0),e%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!OE.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var s=1,o=n;o<n+e/8;o++)r[o]=t/s&255,s*=256;return r}i(dL,"writeUintLE");Kt.writeUintLE=dL;function hL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}i(hL,"readFloat32BE");Kt.readFloat32BE=hL;function pL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t,!0)}i(pL,"readFloat32LE");Kt.readFloat32LE=pL;function mL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}i(mL,"readFloat64BE");Kt.readFloat64BE=mL;function vL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}i(vL,"readFloat64LE");Kt.readFloat64LE=vL;function gL(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat32(r,e),t}i(gL,"writeFloat32BE");Kt.writeFloat32BE=gL;function yL(e,t,r){t===void 0&&(t=new Uint8Array(4)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat32(r,e,!0),t}i(yL,"writeFloat32LE");Kt.writeFloat32LE=yL;function bL(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat64(r,e),t}i(bL,"writeFloat64BE");Kt.writeFloat64BE=bL;function _L(e,t,r){t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0);var n=new DataView(t.buffer,t.byteOffset,t.byteLength);return n.setFloat64(r,e,!0),t}i(_L,"writeFloat64LE");Kt.writeFloat64LE=_L});var jE=kn(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.randomStringForEntropy=wn.randomString=wn.randomUint32=wn.randomBytes=wn.defaultRandomSource=void 0;var wL=DE(),EL=LE(),FE=qg();wn.defaultRandomSource=new wL.SystemRandomSource;function Zg(e,t=wn.defaultRandomSource){return t.randomBytes(e)}i(Zg,"randomBytes");wn.randomBytes=Zg;function AL(e=wn.defaultRandomSource){let t=Zg(4,e),r=(0,EL.readUint32LE)(t);return(0,FE.wipe)(t),r}i(AL,"randomUint32");wn.randomUint32=AL;var UE="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function $E(e,t=UE,r=wn.defaultRandomSource){if(t.length<2)throw new Error("randomString charset is too short");if(t.length>256)throw new Error("randomString charset is too long");let n="",s=t.length,o=256-256%s;for(;e>0;){let c=Zg(Math.ceil(e*256/o),r);for(let l=0;l<c.length&&e>0;l++){let h=c[l];h<o&&(n+=t.charAt(h%s),e--)}(0,FE.wipe)(c)}return n}i($E,"randomString");wn.randomString=$E;function SL(e,t=UE,r=wn.defaultRandomSource){let n=Math.ceil(e/(Math.log(t.length)/Math.LN2));return $E(n,t,r)}i(SL,"randomStringForEntropy");wn.randomStringForEntropy=SL});var h7=kn((TW,Up)=>{var zE,HE,qE,KE,VE,GE,WE,ZE,JE,YE,XE,QE,e7,Lp,Jg,t7,r7,n7,gu,i7,s7,a7,o7,c7,u7,l7,f7,d7,Fp;(function(e){var t=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){e(r(t,r(n)))}):typeof Up=="object"&&typeof Up.exports=="object"?e(r(t,r(Up.exports))):e(r(t));function r(n,s){return n!==t&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(o,c){return n[o]=s?s(o,c):c}}i(r,"createExporter")})(function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var o in s)Object.prototype.hasOwnProperty.call(s,o)&&(n[o]=s[o])};zE=i(function(n,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");t(n,s);function o(){this.constructor=n}i(o,"__"),n.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)},"__extends"),HE=Object.assign||function(n){for(var s,o=1,c=arguments.length;o<c;o++){s=arguments[o];for(var l in s)Object.prototype.hasOwnProperty.call(s,l)&&(n[l]=s[l])}return n},qE=i(function(n,s){var o={};for(var c in n)Object.prototype.hasOwnProperty.call(n,c)&&s.indexOf(c)<0&&(o[c]=n[c]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,c=Object.getOwnPropertySymbols(n);l<c.length;l++)s.indexOf(c[l])<0&&Object.prototype.propertyIsEnumerable.call(n,c[l])&&(o[c[l]]=n[c[l]]);return o},"__rest"),KE=i(function(n,s,o,c){var l=arguments.length,h=l<3?s:c===null?c=Object.getOwnPropertyDescriptor(s,o):c,p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")h=Reflect.decorate(n,s,o,c);else for(var v=n.length-1;v>=0;v--)(p=n[v])&&(h=(l<3?p(h):l>3?p(s,o,h):p(s,o))||h);return l>3&&h&&Object.defineProperty(s,o,h),h},"__decorate"),VE=i(function(n,s){return function(o,c){s(o,c,n)}},"__param"),GE=i(function(n,s,o,c,l,h){function p(j){if(j!==void 0&&typeof j!="function")throw new TypeError("Function expected");return j}i(p,"accept");for(var v=c.kind,b=v==="getter"?"get":v==="setter"?"set":"value",y=!s&&n?c.static?n:n.prototype:null,A=s||(y?Object.getOwnPropertyDescriptor(y,c.name):{}),C,O=!1,R=o.length-1;R>=0;R--){var L={};for(var K in c)L[K]=K==="access"?{}:c[K];for(var K in c.access)L.access[K]=c.access[K];L.addInitializer=function(j){if(O)throw new TypeError("Cannot add initializers after decoration has completed");h.push(p(j||null))};var $=(0,o[R])(v==="accessor"?{get:A.get,set:A.set}:A[b],L);if(v==="accessor"){if($===void 0)continue;if($===null||typeof $!="object")throw new TypeError("Object expected");(C=p($.get))&&(A.get=C),(C=p($.set))&&(A.set=C),(C=p($.init))&&l.push(C)}else(C=p($))&&(v==="field"?l.push(C):A[b]=C)}y&&Object.defineProperty(y,c.name,A),O=!0},"__esDecorate"),WE=i(function(n,s,o){for(var c=arguments.length>2,l=0;l<s.length;l++)o=c?s[l].call(n,o):s[l].call(n);return c?o:void 0},"__runInitializers"),ZE=i(function(n){return typeof n=="symbol"?n:"".concat(n)},"__propKey"),JE=i(function(n,s,o){return typeof s=="symbol"&&(s=s.description?"[".concat(s.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:o?"".concat(o," ",s):s})},"__setFunctionName"),YE=i(function(n,s){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,s)},"__metadata"),XE=i(function(n,s,o,c){function l(h){return h instanceof o?h:new o(function(p){p(h)})}return i(l,"adopt"),new(o||(o=Promise))(function(h,p){function v(A){try{y(c.next(A))}catch(C){p(C)}}i(v,"fulfilled");function b(A){try{y(c.throw(A))}catch(C){p(C)}}i(b,"rejected");function y(A){A.done?h(A.value):l(A.value).then(v,b)}i(y,"step"),y((c=c.apply(n,s||[])).next())})},"__awaiter"),QE=i(function(n,s){var o={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},c,l,h,p;return p={next:v(0),throw:v(1),return:v(2)},typeof Symbol=="function"&&(p[Symbol.iterator]=function(){return this}),p;function v(y){return function(A){return b([y,A])}}function b(y){if(c)throw new TypeError("Generator is already executing.");for(;p&&(p=0,y[0]&&(o=0)),o;)try{if(c=1,l&&(h=y[0]&2?l.return:y[0]?l.throw||((h=l.return)&&h.call(l),0):l.next)&&!(h=h.call(l,y[1])).done)return h;switch(l=0,h&&(y=[y[0]&2,h.value]),y[0]){case 0:case 1:h=y;break;case 4:return o.label++,{value:y[1],done:!1};case 5:o.label++,l=y[1],y=[0];continue;case 7:y=o.ops.pop(),o.trys.pop();continue;default:if(h=o.trys,!(h=h.length>0&&h[h.length-1])&&(y[0]===6||y[0]===2)){o=0;continue}if(y[0]===3&&(!h||y[1]>h[0]&&y[1]<h[3])){o.label=y[1];break}if(y[0]===6&&o.label<h[1]){o.label=h[1],h=y;break}if(h&&o.label<h[2]){o.label=h[2],o.ops.push(y);break}h[2]&&o.ops.pop(),o.trys.pop();continue}y=s.call(n,o)}catch(A){y=[6,A],l=0}finally{c=h=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}},"__generator"),e7=i(function(n,s){for(var o in n)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&Fp(s,n,o)},"__exportStar"),Fp=Object.create?function(n,s,o,c){c===void 0&&(c=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(n,c,l)}:function(n,s,o,c){c===void 0&&(c=o),n[c]=s[o]},Lp=i(function(n){var s=typeof Symbol=="function"&&Symbol.iterator,o=s&&n[s],c=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&c>=n.length&&(n=void 0),{value:n&&n[c++],done:!n}}};throw new TypeError(s?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),Jg=i(function(n,s){var o=typeof Symbol=="function"&&n[Symbol.iterator];if(!o)return n;var c=o.call(n),l,h=[],p;try{for(;(s===void 0||s-- >0)&&!(l=c.next()).done;)h.push(l.value)}catch(v){p={error:v}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(p)throw p.error}}return h},"__read"),t7=i(function(){for(var n=[],s=0;s<arguments.length;s++)n=n.concat(Jg(arguments[s]));return n},"__spread"),r7=i(function(){for(var n=0,s=0,o=arguments.length;s<o;s++)n+=arguments[s].length;for(var c=Array(n),l=0,s=0;s<o;s++)for(var h=arguments[s],p=0,v=h.length;p<v;p++,l++)c[l]=h[p];return c},"__spreadArrays"),n7=i(function(n,s,o){if(o||arguments.length===2)for(var c=0,l=s.length,h;c<l;c++)(h||!(c in s))&&(h||(h=Array.prototype.slice.call(s,0,c)),h[c]=s[c]);return n.concat(h||Array.prototype.slice.call(s))},"__spreadArray"),gu=i(function(n){return this instanceof gu?(this.v=n,this):new gu(n)},"__await"),i7=i(function(n,s,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c=o.apply(n,s||[]),l,h=[];return l={},p("next"),p("throw"),p("return"),l[Symbol.asyncIterator]=function(){return this},l;function p(O){c[O]&&(l[O]=function(R){return new Promise(function(L,K){h.push([O,R,L,K])>1||v(O,R)})})}function v(O,R){try{b(c[O](R))}catch(L){C(h[0][3],L)}}function b(O){O.value instanceof gu?Promise.resolve(O.value.v).then(y,A):C(h[0][2],O)}function y(O){v("next",O)}function A(O){v("throw",O)}function C(O,R){O(R),h.shift(),h.length&&v(h[0][0],h[0][1])}},"__asyncGenerator"),s7=i(function(n){var s,o;return s={},c("next"),c("throw",function(l){throw l}),c("return"),s[Symbol.iterator]=function(){return this},s;function c(l,h){s[l]=n[l]?function(p){return(o=!o)?{value:gu(n[l](p)),done:!1}:h?h(p):p}:h}},"__asyncDelegator"),a7=i(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=n[Symbol.asyncIterator],o;return s?s.call(n):(n=typeof Lp=="function"?Lp(n):n[Symbol.iterator](),o={},c("next"),c("throw"),c("return"),o[Symbol.asyncIterator]=function(){return this},o);function c(h){o[h]=n[h]&&function(p){return new Promise(function(v,b){p=n[h](p),l(v,b,p.done,p.value)})}}function l(h,p,v,b){Promise.resolve(b).then(function(y){h({value:y,done:v})},p)}},"__asyncValues"),o7=i(function(n,s){return Object.defineProperty?Object.defineProperty(n,"raw",{value:s}):n.raw=s,n},"__makeTemplateObject");var r=Object.create?function(n,s){Object.defineProperty(n,"default",{enumerable:!0,value:s})}:function(n,s){n.default=s};c7=i(function(n){if(n&&n.__esModule)return n;var s={};if(n!=null)for(var o in n)o!=="default"&&Object.prototype.hasOwnProperty.call(n,o)&&Fp(s,n,o);return r(s,n),s},"__importStar"),u7=i(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),l7=i(function(n,s,o,c){if(o==="a"&&!c)throw new TypeError("Private accessor was defined without a getter");if(typeof s=="function"?n!==s||!c:!s.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return o==="m"?c:o==="a"?c.call(n):c?c.value:s.get(n)},"__classPrivateFieldGet"),f7=i(function(n,s,o,c,l){if(c==="m")throw new TypeError("Private method is not writable");if(c==="a"&&!l)throw new TypeError("Private accessor was defined without a setter");if(typeof s=="function"?n!==s||!l:!s.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return c==="a"?l.call(n,o):l?l.value=o:s.set(n,o),o},"__classPrivateFieldSet"),d7=i(function(n,s){if(s===null||typeof s!="object"&&typeof s!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?s===n:n.has(s)},"__classPrivateFieldIn"),e("__extends",zE),e("__assign",HE),e("__rest",qE),e("__decorate",KE),e("__param",VE),e("__esDecorate",GE),e("__runInitializers",WE),e("__propKey",ZE),e("__setFunctionName",JE),e("__metadata",YE),e("__awaiter",XE),e("__generator",QE),e("__exportStar",e7),e("__createBinding",Fp),e("__values",Lp),e("__read",Jg),e("__spread",t7),e("__spreadArrays",r7),e("__spreadArray",n7),e("__await",gu),e("__asyncGenerator",i7),e("__asyncDelegator",s7),e("__asyncValues",a7),e("__makeTemplateObject",o7),e("__importStar",c7),e("__importDefault",u7),e("__classPrivateFieldGet",l7),e("__classPrivateFieldSet",f7),e("__classPrivateFieldIn",d7)})});var B7=kn((tJ,P7)=>{"use strict";var RL=function(){function e(r,n){if(typeof r!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+r+"."));this._batchLoadFn=r,this._maxBatchSize=LL(n),this._batchScheduleFn=FL(n),this._cacheKeyFn=UL(n),this._cacheMap=$L(n),this._batch=null,this.name=jL(n)}i(e,"DataLoader");var t=e.prototype;return t.load=i(function(n){if(n==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(n)+"."));var s=PL(this),o=this._cacheMap,c=this._cacheKeyFn(n);if(o){var l=o.get(c);if(l){var h=s.cacheHits||(s.cacheHits=[]);return new Promise(function(v){h.push(function(){v(l)})})}}s.keys.push(n);var p=new Promise(function(v,b){s.callbacks.push({resolve:v,reject:b})});return o&&o.set(c,p),p},"load"),t.loadMany=i(function(n){if(!N7(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var s=[],o=0;o<n.length;o++)s.push(this.load(n[o]).catch(function(c){return c}));return Promise.all(s)},"loadMany"),t.clear=i(function(n){var s=this._cacheMap;if(s){var o=this._cacheKeyFn(n);s.delete(o)}return this},"clear"),t.clearAll=i(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),t.prime=i(function(n,s){var o=this._cacheMap;if(o){var c=this._cacheKeyFn(n);if(o.get(c)===void 0){var l;s instanceof Error?(l=Promise.reject(s),l.catch(function(){})):l=Promise.resolve(s),o.set(c,l)}}return this},"prime"),e}(),NL=typeof process=="object"&&typeof process.nextTick=="function"?function(e){fy||(fy=Promise.resolve()),fy.then(function(){process.nextTick(e)})}:typeof setImmediate=="function"?function(e){setImmediate(e)}:function(e){setTimeout(e)},fy;function PL(e){var t=e._batch;if(t!==null&&!t.hasDispatched&&t.keys.length<e._maxBatchSize)return t;var r={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=r,e._batchScheduleFn(function(){BL(e,r)}),r}i(PL,"getCurrentBatch");function BL(e,t){if(t.hasDispatched=!0,t.keys.length===0){hy(t);return}var r;try{r=e._batchLoadFn(t.keys)}catch(n){return dy(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(n)+".")))}if(!r||typeof r.then!="function")return dy(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(r)+".")));r.then(function(n){if(!N7(n))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(n)+"."));if(n.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
|
|
2
|
+
|
|
3
|
+
Keys:
|
|
4
|
+
`+String(t.keys))+(`
|
|
5
|
+
|
|
6
|
+
Values:
|
|
7
|
+
`+String(n)));hy(t);for(var s=0;s<t.callbacks.length;s++){var o=n[s];o instanceof Error?t.callbacks[s].reject(o):t.callbacks[s].resolve(o)}}).catch(function(n){dy(e,t,n)})}i(BL,"dispatchBatch");function dy(e,t,r){hy(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}i(dy,"failedDispatch");function hy(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}i(hy,"resolveCacheHits");function LL(e){var t=!e||e.batch!==!1;if(!t)return 1;var r=e&&e.maxBatchSize;if(r===void 0)return 1/0;if(typeof r!="number"||r<1)throw new TypeError("maxBatchSize must be a positive number: "+r);return r}i(LL,"getValidMaxBatchSize");function FL(e){var t=e&&e.batchScheduleFn;if(t===void 0)return NL;if(typeof t!="function")throw new TypeError("batchScheduleFn must be a function: "+t);return t}i(FL,"getValidBatchScheduleFn");function UL(e){var t=e&&e.cacheKeyFn;if(t===void 0)return function(r){return r};if(typeof t!="function")throw new TypeError("cacheKeyFn must be a function: "+t);return t}i(UL,"getValidCacheKeyFn");function $L(e){var t=!e||e.cache!==!1;if(!t)return null;var r=e&&e.cacheMap;if(r===void 0)return new Map;if(r!==null){var n=["get","set","delete","clear"],s=n.filter(function(o){return r&&typeof r[o]!="function"});if(s.length!==0)throw new TypeError("Custom cacheMap missing methods: "+s.join(", "))}return r}i($L,"getValidCacheMap");function jL(e){return e&&e.name?e.name:null}i(jL,"getValidName");function N7(e){return typeof e=="object"&&e!==null&&typeof e.length=="number"&&(e.length===0||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}i(N7,"isArrayLike");P7.exports=RL});var hK={};_n(hK,{BackwardsCompatCredentialsListValidator:()=>I6,BackwardsCompatIDXCredentialValidator:()=>zD,CredentialsListValidator:()=>C6,default:()=>dK,getIDXPlugin:()=>Wm});module.exports=$O(hK);var jO=W4,V4=128,zO=127,HO=~zO,qO=Math.pow(2,31);function W4(e,t,r){t=t||[],r=r||0;for(var n=r;e>=qO;)t[r++]=e&255|V4,e/=128;for(;e&HO;)t[r++]=e&255|V4,e>>>=7;return t[r]=e|0,W4.bytes=r-n+1,t}i(W4,"encode");var KO=Pv,VO=128,G4=127;function Pv(e,n){var r=0,n=n||0,s=0,o=n,c,l=e.length;do{if(o>=l)throw Pv.bytes=0,new RangeError("Could not decode varint");c=e[o++],r+=s<28?(c&G4)<<s:(c&G4)*Math.pow(2,s),s+=7}while(c>=VO);return Pv.bytes=o-n,r}i(Pv,"read");var GO=Math.pow(2,7),WO=Math.pow(2,14),ZO=Math.pow(2,21),JO=Math.pow(2,28),YO=Math.pow(2,35),XO=Math.pow(2,42),QO=Math.pow(2,49),eR=Math.pow(2,56),tR=Math.pow(2,63),rR=i(function(e){return e<GO?1:e<WO?2:e<ZO?3:e<JO?4:e<YO?5:e<XO?6:e<QO?7:e<eR?8:e<tR?9:10},"length"),nR={encode:jO,decode:KO,encodingLength:rR},iR=nR,nf=iR;var sf=i((e,t=0)=>[nf.decode(e,t),nf.decode.bytes],"decode"),Yc=i((e,t,r=0)=>(nf.encode(e,t,r),t),"encodeTo"),Xc=i(e=>nf.encodingLength(e),"encodingLength");var gK=new Uint8Array(0);var Z4=i((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},"equals"),sa=i(e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},"coerce");var J4=i(e=>new TextEncoder().encode(e),"fromString"),Y4=i(e=>new TextDecoder().decode(e),"toString");var jo=i((e,t)=>{let r=t.byteLength,n=Xc(e),s=n+Xc(r),o=new Uint8Array(s+r);return Yc(e,o,0),Yc(r,o,n),o.set(t,s),new $o(e,r,t,o)},"create"),$h=i(e=>{let t=sa(e),[r,n]=sf(t),[s,o]=sf(t.subarray(n)),c=t.subarray(n+o);if(c.byteLength!==s)throw new Error("Incorrect length");return new $o(r,s,c,t)},"decode"),X4=i((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&Z4(e.bytes,t.bytes),"equals"),$o=class{constructor(t,r,n,s){this.code=t,this.size=r,this.digest=n,this.bytes=s}};i($o,"Digest");var Lv={};_n(Lv,{base58btc:()=>Ms,base58flickr:()=>lR});function sR(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var s=0;s<e.length;s++){var o=e.charAt(s),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=s}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function b(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var O=0,R=0,L=0,K=C.length;L!==K&&C[L]===0;)L++,O++;for(var $=(K-L)*v+1>>>0,j=new Uint8Array($);L!==K;){for(var V=C[L],G=0,k=$-1;(V!==0||G<R)&&k!==-1;k--,G++)V+=256*j[k]>>>0,j[k]=V%l>>>0,V=V/l>>>0;if(V!==0)throw new Error("Non-zero carry");R=G,L++}for(var H=$-R;H!==$&&j[H]===0;)H++;for(var se=h.repeat(O);H<$;++H)se+=e.charAt(j[H]);return se}i(b,"encode");function y(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var O=0;if(C[O]!==" "){for(var R=0,L=0;C[O]===h;)R++,O++;for(var K=(C.length-O)*p+1>>>0,$=new Uint8Array(K);C[O];){var j=r[C.charCodeAt(O)];if(j===255)return;for(var V=0,G=K-1;(j!==0||V<L)&&G!==-1;G--,V++)j+=l*$[G]>>>0,$[G]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");L=V,O++}if(C[O]!==" "){for(var k=K-L;k!==K&&$[k]===0;)k++;for(var H=new Uint8Array(R+(K-k)),se=R;k!==K;)H[se++]=$[k++];return H}}}i(y,"decodeUnsafe");function A(C){var O=y(C);if(O)return O;throw new Error(`Non-${t} character`)}return i(A,"decode"),{encode:b,decodeUnsafe:y,decode:A}}i(sR,"base");var aR=sR,oR=aR,Q4=oR;var jh=class{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}};i(jh,"Encoder");var zh=class{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return e8(this,t)}};i(zh,"Decoder");var Hh=class{constructor(t){this.decoders=t}or(t){return e8(this,t)}decode(t){let r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};i(Hh,"ComposedDecoder");var e8=i((e,t)=>new Hh({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),qh=class{constructor(t,r,n,s){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=s,this.encoder=new jh(t,r,n),this.decoder=new zh(t,r,s)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};i(qh,"Codec");var Qc=i(({name:e,prefix:t,encode:r,decode:n})=>new qh(e,t,r,n),"from"),$a=i(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:s}=Q4(r,t);return Qc({prefix:e,name:t,encode:n,decode:o=>sa(s(o))})},"baseX"),cR=i((e,t,r,n)=>{let s={};for(let v=0;v<t.length;++v)s[t[v]]=v;let o=e.length;for(;e[o-1]==="=";)--o;let c=new Uint8Array(o*r/8|0),l=0,h=0,p=0;for(let v=0;v<o;++v){let b=s[e[v]];if(b===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|b,l+=r,l>=8&&(l-=8,c[p++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},"decode"),uR=i((e,t,r)=>{let n=t[t.length-1]==="=",s=(1<<r)-1,o="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,o+=t[s&l>>c];if(c&&(o+=t[s&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},"encode"),Nr=i(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Qc({prefix:t,name:e,encode(s){return uR(s,n,r)},decode(s){return cR(s,n,r,e)}}),"rfc4648");var Ms=$a({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),lR=$a({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Fv={};_n(Fv,{base32:()=>eu,base32hex:()=>pR,base32hexpad:()=>vR,base32hexpadupper:()=>gR,base32hexupper:()=>mR,base32pad:()=>dR,base32padupper:()=>hR,base32upper:()=>fR,base32z:()=>yR});var eu=Nr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),fR=Nr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),dR=Nr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),hR=Nr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),pR=Nr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),mR=Nr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),vR=Nr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),gR=Nr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yR=Nr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var jt=class{constructor(t,r,n,s){this.code=r,this.version=t,this.multihash=n,this.bytes=s,this.byteOffset=s.byteOffset,this.byteLength=s.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Vh,byteLength:Vh,code:Kh,version:Kh,multihash:Kh,bytes:Kh,_baseCache:Vh,asCID:Vh})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:r}=this;if(t!==of)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==ER)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return jt.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=jo(t,r);return jt.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(t){return t&&this.code===t.code&&this.version===t.version&&X4(this.multihash,t.multihash)}toString(t){let{bytes:r,version:n,_baseCache:s}=this;switch(n){case 0:return _R(r,s,t||Ms.encoder);default:return wR(r,s,t||eu.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(t){return SR(/^0\.0/,xR),!!(t&&(t[r8]||t.asCID===t))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(t){if(t instanceof jt)return t;if(t!=null&&t.asCID===t){let{version:r,code:n,multihash:s,bytes:o}=t;return new jt(r,n,s,o||t8(r,n,s.bytes))}else if(t!=null&&t[r8]===!0){let{version:r,multihash:n,code:s}=t,o=$h(n);return jt.create(r,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");switch(t){case 0:{if(r!==of)throw new Error(`Version 0 CID must use dag-pb (code: ${of}) block encoding`);return new jt(t,r,n,n.bytes)}case 1:{let s=t8(t,r,n.bytes);return new jt(t,r,n,s)}default:throw new Error("Invalid version")}}static createV0(t){return jt.create(0,of,t)}static createV1(t,r){return jt.create(1,t,r)}static decode(t){let[r,n]=jt.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=jt.inspectBytes(t),n=r.size-r.multihashSize,s=sa(t.subarray(n,n+r.multihashSize));if(s.byteLength!==r.multihashSize)throw new Error("Incorrect length");let o=s.subarray(r.multihashSize-r.digestSize),c=new $o(r.multihashCode,r.digestSize,o,s);return[r.version===0?jt.createV0(c):jt.createV1(r.codec,c),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=i(()=>{let[b,y]=sf(t.subarray(r));return r+=y,b},"next"),s=n(),o=of;if(s===18?(s=0,r=0):s===1&&(o=n()),s!==0&&s!==1)throw new RangeError(`Invalid CID version ${s}`);let c=r,l=n(),h=n(),p=r+h,v=p-c;return{version:s,codec:o,multihashCode:l,digestSize:h,multihashSize:v,size:p}}static parse(t,r){let[n,s]=bR(t,r),o=jt.decode(s);return o._baseCache.set(n,t),o}};i(jt,"CID");var bR=i((e,t)=>{switch(e[0]){case"Q":{let r=t||Ms;return[Ms.prefix,r.decode(`${Ms.prefix}${e}`)]}case Ms.prefix:{let r=t||Ms;return[Ms.prefix,r.decode(e)]}case eu.prefix:{let r=t||eu;return[eu.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},"parseCIDtoBytes"),_R=i((e,t,r)=>{let{prefix:n}=r;if(n!==Ms.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=t.get(n);if(s==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return s},"toStringV0"),wR=i((e,t,r)=>{let{prefix:n}=r,s=t.get(n);if(s==null){let o=r.encode(e);return t.set(n,o),o}else return s},"toStringV1"),of=112,ER=18,t8=i((e,t,r)=>{let n=Xc(e),s=n+Xc(t),o=new Uint8Array(s+r.byteLength);return Yc(e,o,0),Yc(t,o,n),o.set(r,s),o},"encodeCID"),r8=Symbol.for("@ipld/js-cid/CID"),Kh={writable:!1,configurable:!1,enumerable:!0},Vh={writable:!1,enumerable:!1,configurable:!1},AR="0.0.0-dev",SR=i((e,t)=>{if(e.test(AR))console.warn(t);else throw new Error(t)},"deprecate"),xR=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
8
|
+
Following code pattern:
|
|
9
|
+
|
|
10
|
+
if (CID.isCID(value)) {
|
|
11
|
+
doSomethingWithCID(value)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
Is replaced with:
|
|
15
|
+
|
|
16
|
+
const cid = CID.asCID(value)
|
|
17
|
+
if (cid) {
|
|
18
|
+
// Make sure to use cid instead of value
|
|
19
|
+
doSomethingWithCID(cid)
|
|
20
|
+
}
|
|
21
|
+
`;var Uv={};_n(Uv,{base36:()=>Yi,base36upper:()=>TR});var Yi=$a({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),TR=$a({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var n8={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function MR(e){let t=n8[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(MR,"codeByName");function CR(e){let t=Object.entries(n8).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(CR,"nameByCode");var Xi=class{};i(Xi,"StreamType");Xi.nameByCode=CR;Xi.codeByName=MR;var Eg=Ua(Gh(),1);function tu(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(tu,"asUint8Array");function cf(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?tu(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(cf,"allocUnsafe");function uf(e,t){t||(t=e.reduce((s,o)=>s+o.length,0));let r=cf(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return tu(r)}i(uf,"concat");var zv={};_n(zv,{identity:()=>zR});var zR=Qc({prefix:"\0",name:"identity",encode:e=>Y4(e),decode:e=>J4(e)});var Hv={};_n(Hv,{base2:()=>HR});var HR=Nr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var qv={};_n(qv,{base8:()=>qR});var qR=Nr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Kv={};_n(Kv,{base10:()=>KR});var KR=$a({prefix:"9",name:"base10",alphabet:"0123456789"});var Vv={};_n(Vv,{base16:()=>VR,base16upper:()=>GR});var VR=Nr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),GR=Nr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Gv={};_n(Gv,{base64:()=>WR,base64pad:()=>ZR,base64url:()=>JR,base64urlpad:()=>YR});var WR=Nr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ZR=Nr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),JR=Nr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),YR=Nr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var Wv={};_n(Wv,{base256emoji:()=>rN});var h8=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),XR=h8.reduce((e,t,r)=>(e[r]=t,e),[]),QR=h8.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function eN(e){return e.reduce((t,r)=>(t+=XR[r],t),"")}i(eN,"encode");function tN(e){let t=[];for(let r of e){let n=QR[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(tN,"decode");var rN=Qc({prefix:"\u{1F680}",name:"base256emoji",encode:eN,decode:tN});var Yv={};_n(Yv,{sha256:()=>Jv,sha512:()=>nN});var Zv=i(({name:e,code:t,encode:r})=>new Wh(e,t,r),"from"),Wh=class{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){let r=this.encode(t);return r instanceof Uint8Array?jo(this.code,r):r.then(n=>jo(this.code,n))}else throw Error("Unknown type, must be binary type")}};i(Wh,"Hasher");var m8=i(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),Jv=Zv({name:"sha2-256",code:18,encode:m8("SHA-256")}),nN=Zv({name:"sha2-512",code:19,encode:m8("SHA-512")});var Xv={};_n(Xv,{identity:()=>aN});var v8=0,iN="identity",g8=sa,sN=i(e=>jo(v8,g8(e)),"digest"),aN={code:v8,name:iN,encode:g8,digest:sN};var eV=new TextEncoder,tV=new TextDecoder;var Qv={...zv,...Hv,...qv,...Kv,...Vv,...Fv,...Uv,...Lv,...Gv,...Wv},sV={...Yv,...Xv};function b8(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}i(b8,"createCodec");var y8=b8("utf8","u",e=>{let t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>new TextEncoder().encode(e.substring(1))),eg=b8("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=cf(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),uN={utf8:y8,"utf-8":y8,hex:Qv.base16,latin1:eg,ascii:eg,binary:eg,...Qv},tg=uN;function rg(e,t="utf8"){let r=tg[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}i(rg,"toString");function si(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(s,o,c)=>{if(c.value!=null)c.value=_8(c.value,t,r,n);else if(c.get!=null)c.get=_8(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(si,"Memoize");var ng=new Map;function _8(e,t,r=0,n){let s=Symbol("__memoized_map__");return function(...o){let c;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[s];if(Array.isArray(n))for(let h of n)ng.has(h)?ng.get(h).push(l):ng.set(h,[l]);if(t||o.length>0||r>0){let h;t===!0?h=o.map(b=>b.toString()).join("!"):t?h=t.apply(this,o):h=o[0];let p=`${h}__timestamp`,v=!1;if(r>0)if(!l.has(p))v=!0;else{let b=l.get(p);v=Date.now()-b>r}l.has(h)&&!v?c=l.get(h):(c=e.apply(this,o),l.set(h,c),r>0&&l.set(p,Date.now()))}else{let h=this;l.has(h)?c=l.get(h):(c=e.apply(this,o),l.set(h,c))}return c}}i(_8,"getNewFunction");var Zh=i(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),ig=i(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let s=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[o,c]of n.entries()){let l=[...s,o],h=jt.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*ig(c,l))}else{let o=jt.asCID(n);o?yield[s.join("/"),o]:yield*ig(n,s)}}},"links"),sg=i(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let s=[...t,r];if(yield s.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!jt.asCID(n))if(Array.isArray(n))for(let[o,c]of n.entries()){let l=[...s,o];yield l.join("/"),typeof c=="object"&&!jt.asCID(c)&&(yield*sg(c,l))}else yield*sg(n,s)}},"tree"),fN=i((e,t)=>{let r=e;for(let[n,s]of t.entries()){if(r=r[s],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let o=jt.asCID(r);if(o)return{value:o,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),Jh=class{constructor({cid:t,bytes:r,value:n}){if(!t||!r||typeof n>"u")throw new Error("Missing required argument");this.cid=t,this.bytes=r,this.value=n,this.asBlock=this,Object.defineProperties(this,{cid:Zh(),bytes:Zh(),value:Zh(),asBlock:Zh()})}links(){return ig(this.value,[])}tree(){return sg(this.value,[])}get(t="/"){return fN(this.value,t.split("/").filter(Boolean))}};i(Jh,"Block");var w8=i(async({value:e,codec:t,hasher:r})=>{if(typeof e>"u")throw new Error('Missing required argument "value"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");let n=t.encode(e),s=await r.digest(n),o=jt.create(1,t.code,s);return new Jh({value:e,bytes:n,cid:o})},"encode");var _g=Ua(Gh(),1);var cp={};_n(cp,{code:()=>ZN,decode:()=>JN,encode:()=>mg,name:()=>WN});var hN=["string","number","bigint","symbol"],pN=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function E8(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(hN.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(mN(e))return"Buffer";let r=vN(e);return r||"Object"}i(E8,"is");function mN(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(mN,"isBuffer");function vN(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(pN.includes(t))return t}i(vN,"getObjectType");var Oe=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};i(Oe,"Type");Oe.uint=new Oe(0,"uint",!0);Oe.negint=new Oe(1,"negint",!0);Oe.bytes=new Oe(2,"bytes",!0);Oe.string=new Oe(3,"string",!0);Oe.array=new Oe(4,"array",!1);Oe.map=new Oe(5,"map",!1);Oe.tag=new Oe(6,"tag",!1);Oe.float=new Oe(7,"float",!0);Oe.false=new Oe(7,"false",!0);Oe.true=new Oe(7,"true",!0);Oe.null=new Oe(7,"null",!0);Oe.undefined=new Oe(7,"undefined",!0);Oe.break=new Oe(7,"break",!0);var Xe=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};i(Xe,"Token");var ru=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",gN=new TextDecoder,yN=new TextEncoder;function Yh(e){return ru&&globalThis.Buffer.isBuffer(e)}i(Yh,"isBuffer");function ag(e){return e instanceof Uint8Array?Yh(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(ag,"asU8A");var T8=ru?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):S8(e,t,r):(e,t,r)=>r-t>64?gN.decode(e.subarray(t,r)):S8(e,t,r),M8=ru?e=>e.length>64?globalThis.Buffer.from(e):A8(e):e=>e.length>64?yN.encode(e):A8(e),Cs=i(e=>Uint8Array.from(e),"fromArray"),nu=ru?(e,t,r)=>Yh(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),C8=ru?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),ag(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let s of e)n+s.length>r.length&&(s=s.subarray(0,r.length-n)),r.set(s,n),n+=s.length;return r},I8=ru?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function D8(e,t){if(Yh(e)&&Yh(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}i(D8,"compare");function A8(e,t=1/0){let r,n=e.length,s=null,o=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!s){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&o.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&o.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}i(A8,"utf8ToBytes");function S8(e,t,r){let n=[];for(;t<r;){let s=e[t],o=null,c=s>239?4:s>223?3:s>191?2:1;if(t+c<=r){let l,h,p,v;switch(c){case 1:s<128&&(o=s);break;case 2:l=e[t+1],(l&192)===128&&(v=(s&31)<<6|l&63,v>127&&(o=v));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(v=(s&15)<<12|(l&63)<<6|h&63,v>2047&&(v<55296||v>57343)&&(o=v));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(v=(s&15)<<18|(l&63)<<12|(h&63)<<6|p&63,v>65535&&v<1114112&&(o=v))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=c}return bN(n)}i(S8,"utf8Slice");var x8=4096;function bN(e){let t=e.length;if(t<=x8)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=x8));return r}i(bN,"decodeCodePointsArray");var _N=256,iu=class{constructor(t=_N){this.chunkSize=t,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let s=r.length-(this.maxCursor-this.cursor)-1;r.set(t,s)}else{if(r){let s=r.length-(this.maxCursor-this.cursor)-1;s<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,s),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=I8(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=nu(n,0,this.cursor)}else r=C8(this.chunks,this.cursor);return t&&this.reset(),r}};i(iu,"Bl");var Ct="CBOR decode error:",og="CBOR encode error:",lf=[];lf[23]=1;lf[24]=2;lf[25]=3;lf[26]=5;lf[27]=9;function aa(e,t,r){if(e.length-t<r)throw new Error(`${Ct} not enough data for type`)}i(aa,"assertEnoughData");var Yr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function ai(e,t,r){aa(e,t,1);let n=e[t];if(r.strict===!0&&n<Yr[0])throw new Error(`${Ct} integer encoded in more bytes than necessary (strict decode)`);return n}i(ai,"readUint8");function oi(e,t,r){aa(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Yr[1])throw new Error(`${Ct} integer encoded in more bytes than necessary (strict decode)`);return n}i(oi,"readUint16");function ci(e,t,r){aa(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Yr[2])throw new Error(`${Ct} integer encoded in more bytes than necessary (strict decode)`);return n}i(ci,"readUint32");function ui(e,t,r){aa(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],s=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(s);if(r.strict===!0&&o<Yr[3])throw new Error(`${Ct} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${Ct} integers outside of the safe integer range are not supported`)}i(ui,"readUint64");function k8(e,t,r,n){return new Xe(Oe.uint,ai(e,t+1,n),2)}i(k8,"decodeUint8");function O8(e,t,r,n){return new Xe(Oe.uint,oi(e,t+1,n),3)}i(O8,"decodeUint16");function R8(e,t,r,n){return new Xe(Oe.uint,ci(e,t+1,n),5)}i(R8,"decodeUint32");function N8(e,t,r,n){return new Xe(Oe.uint,ui(e,t+1,n),9)}i(N8,"decodeUint64");function Oi(e,t){return an(e,0,t.value)}i(Oi,"encodeUint");function an(e,t,r){if(r<Yr[0]){let n=Number(r);e.push([t|n])}else if(r<Yr[1]){let n=Number(r);e.push([t|24,n])}else if(r<Yr[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Yr[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<Yr[4]){let s=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));s[8]=o&255,o=o>>8,s[7]=o&255,o=o>>8,s[6]=o&255,o=o>>8,s[5]=o&255,s[4]=c&255,c=c>>8,s[3]=c&255,c=c>>8,s[2]=c&255,c=c>>8,s[1]=c&255,e.push(s)}else throw new Error(`${Ct} encountered BigInt larger than allowable range`)}}i(an,"encodeUintValue");Oi.encodedSize=i(function(t){return an.encodedSize(t.value)},"encodedSize");an.encodedSize=i(function(t){return t<Yr[0]?1:t<Yr[1]?2:t<Yr[2]?3:t<Yr[3]?5:9},"encodedSize");Oi.compareTokens=i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens");function P8(e,t,r,n){return new Xe(Oe.negint,-1-ai(e,t+1,n),2)}i(P8,"decodeNegint8");function B8(e,t,r,n){return new Xe(Oe.negint,-1-oi(e,t+1,n),3)}i(B8,"decodeNegint16");function L8(e,t,r,n){return new Xe(Oe.negint,-1-ci(e,t+1,n),5)}i(L8,"decodeNegint32");var cg=BigInt(-1),F8=BigInt(1);function U8(e,t,r,n){let s=ui(e,t+1,n);if(typeof s!="bigint"){let o=-1-s;if(o>=Number.MIN_SAFE_INTEGER)return new Xe(Oe.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${Ct} integers outside of the safe integer range are not supported`);return new Xe(Oe.negint,cg-BigInt(s),9)}i(U8,"decodeNegint64");function Xh(e,t){let r=t.value,n=typeof r=="bigint"?r*cg-F8:r*-1-1;an(e,t.type.majorEncoded,n)}i(Xh,"encodeNegint");Xh.encodedSize=i(function(t){let r=t.value,n=typeof r=="bigint"?r*cg-F8:r*-1-1;return n<Yr[0]?1:n<Yr[1]?2:n<Yr[2]?3:n<Yr[3]?5:9},"encodedSize");Xh.compareTokens=i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens");function ff(e,t,r,n){aa(e,t,r+n);let s=nu(e,t+r,t+r+n);return new Xe(Oe.bytes,s,r+n)}i(ff,"toToken");function $8(e,t,r,n){return ff(e,t,1,r)}i($8,"decodeBytesCompact");function j8(e,t,r,n){return ff(e,t,2,ai(e,t+1,n))}i(j8,"decodeBytes8");function z8(e,t,r,n){return ff(e,t,3,oi(e,t+1,n))}i(z8,"decodeBytes16");function H8(e,t,r,n){return ff(e,t,5,ci(e,t+1,n))}i(H8,"decodeBytes32");function q8(e,t,r,n){let s=ui(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Ct} 64-bit integer bytes lengths not supported`);return ff(e,t,9,s)}i(q8,"decodeBytes64");function Qh(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===Oe.string?M8(e.value):e.value),e.encodedBytes}i(Qh,"tokenBytes");function su(e,t){let r=Qh(t);an(e,t.type.majorEncoded,r.length),e.push(r)}i(su,"encodeBytes");su.encodedSize=i(function(t){let r=Qh(t);return an.encodedSize(r.length)+r.length},"encodedSize");su.compareTokens=i(function(t,r){return EN(Qh(t),Qh(r))},"compareTokens");function EN(e,t){return e.length<t.length?-1:e.length>t.length?1:D8(e,t)}i(EN,"compareBytes");function df(e,t,r,n,s){let o=r+n;aa(e,t,o);let c=new Xe(Oe.string,T8(e,t+r,t+o),o);return s.retainStringBytes===!0&&(c.byteValue=nu(e,t+r,t+o)),c}i(df,"toToken");function K8(e,t,r,n){return df(e,t,1,r,n)}i(K8,"decodeStringCompact");function V8(e,t,r,n){return df(e,t,2,ai(e,t+1,n),n)}i(V8,"decodeString8");function G8(e,t,r,n){return df(e,t,3,oi(e,t+1,n),n)}i(G8,"decodeString16");function W8(e,t,r,n){return df(e,t,5,ci(e,t+1,n),n)}i(W8,"decodeString32");function Z8(e,t,r,n){let s=ui(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Ct} 64-bit integer string lengths not supported`);return df(e,t,9,s,n)}i(Z8,"decodeString64");var J8=su;function au(e,t,r,n){return new Xe(Oe.array,n,r)}i(au,"toToken");function Y8(e,t,r,n){return au(e,t,1,r)}i(Y8,"decodeArrayCompact");function X8(e,t,r,n){return au(e,t,2,ai(e,t+1,n))}i(X8,"decodeArray8");function Q8(e,t,r,n){return au(e,t,3,oi(e,t+1,n))}i(Q8,"decodeArray16");function e9(e,t,r,n){return au(e,t,5,ci(e,t+1,n))}i(e9,"decodeArray32");function t9(e,t,r,n){let s=ui(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Ct} 64-bit integer array lengths not supported`);return au(e,t,9,s)}i(t9,"decodeArray64");function r9(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Ct} indefinite length items not allowed`);return au(e,t,1,1/0)}i(r9,"decodeArrayIndefinite");function ep(e,t){an(e,Oe.array.majorEncoded,t.value)}i(ep,"encodeArray");ep.compareTokens=Oi.compareTokens;ep.encodedSize=i(function(t){return an.encodedSize(t.value)},"encodedSize");function ou(e,t,r,n){return new Xe(Oe.map,n,r)}i(ou,"toToken");function n9(e,t,r,n){return ou(e,t,1,r)}i(n9,"decodeMapCompact");function i9(e,t,r,n){return ou(e,t,2,ai(e,t+1,n))}i(i9,"decodeMap8");function s9(e,t,r,n){return ou(e,t,3,oi(e,t+1,n))}i(s9,"decodeMap16");function a9(e,t,r,n){return ou(e,t,5,ci(e,t+1,n))}i(a9,"decodeMap32");function o9(e,t,r,n){let s=ui(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Ct} 64-bit integer map lengths not supported`);return ou(e,t,9,s)}i(o9,"decodeMap64");function c9(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Ct} indefinite length items not allowed`);return ou(e,t,1,1/0)}i(c9,"decodeMapIndefinite");function tp(e,t){an(e,Oe.map.majorEncoded,t.value)}i(tp,"encodeMap");tp.compareTokens=Oi.compareTokens;tp.encodedSize=i(function(t){return an.encodedSize(t.value)},"encodedSize");function u9(e,t,r,n){return new Xe(Oe.tag,r,1)}i(u9,"decodeTagCompact");function l9(e,t,r,n){return new Xe(Oe.tag,ai(e,t+1,n),2)}i(l9,"decodeTag8");function f9(e,t,r,n){return new Xe(Oe.tag,oi(e,t+1,n),3)}i(f9,"decodeTag16");function d9(e,t,r,n){return new Xe(Oe.tag,ci(e,t+1,n),5)}i(d9,"decodeTag32");function h9(e,t,r,n){return new Xe(Oe.tag,ui(e,t+1,n),9)}i(h9,"decodeTag64");function rp(e,t){an(e,Oe.tag.majorEncoded,t.value)}i(rp,"encodeTag");rp.compareTokens=Oi.compareTokens;rp.encodedSize=i(function(t){return an.encodedSize(t.value)},"encodedSize");var CN=20,IN=21,DN=22,kN=23;function p9(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Ct} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Xe(Oe.null,null,1):new Xe(Oe.undefined,void 0,1)}i(p9,"decodeUndefined");function m9(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Ct} indefinite length items not allowed`);return new Xe(Oe.break,void 0,1)}i(m9,"decodeBreak");function ug(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Ct} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Ct} Infinity values are not supported`)}return new Xe(Oe.float,e,t)}i(ug,"createToken");function v9(e,t,r,n){return ug(lg(e,t+1),3,n)}i(v9,"decodeFloat16");function g9(e,t,r,n){return ug(fg(e,t+1),5,n)}i(g9,"decodeFloat32");function y9(e,t,r,n){return ug(E9(e,t+1),9,n)}i(y9,"decodeFloat64");function np(e,t,r){let n=t.value;if(n===!1)e.push([Oe.float.majorEncoded|CN]);else if(n===!0)e.push([Oe.float.majorEncoded|IN]);else if(n===null)e.push([Oe.float.majorEncoded|DN]);else if(n===void 0)e.push([Oe.float.majorEncoded|kN]);else{let s,o=!1;(!r||r.float64!==!0)&&(_9(n),s=lg(Qi,1),n===s||Number.isNaN(n)?(Qi[0]=249,e.push(Qi.slice(0,3)),o=!0):(w9(n),s=fg(Qi,1),n===s&&(Qi[0]=250,e.push(Qi.slice(0,5)),o=!0))),o||(ON(n),s=E9(Qi,1),Qi[0]=251,e.push(Qi.slice(0,9)))}}i(np,"encodeFloat");np.encodedSize=i(function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){_9(n);let s=lg(Qi,1);if(n===s||Number.isNaN(n))return 3;if(w9(n),s=fg(Qi,1),n===s)return 5}return 9},"encodedSize");var b9=new ArrayBuffer(9),Ri=new DataView(b9,1),Qi=new Uint8Array(b9,0);function _9(e){if(e===1/0)Ri.setUint16(0,31744,!1);else if(e===-1/0)Ri.setUint16(0,64512,!1);else if(Number.isNaN(e))Ri.setUint16(0,32256,!1);else{Ri.setFloat32(0,e);let t=Ri.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Ri.setUint16(0,31744,!1);else if(r===0)Ri.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let s=r-127;s<-24?Ri.setUint16(0,0):s<-14?Ri.setUint16(0,(t&2147483648)>>16|1<<24+s,!1):Ri.setUint16(0,(t&2147483648)>>16|s+15<<10|n>>13,!1)}}}i(_9,"encodeFloat16");function lg(e,t){if(e.length-t<2)throw new Error(`${Ct} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,s=r&1023,o;return n===0?o=s*2**-24:n!==31?o=(s+1024)*2**(n-25):o=s===0?1/0:NaN,r&32768?-o:o}i(lg,"readFloat16");function w9(e){Ri.setFloat32(0,e,!1)}i(w9,"encodeFloat32");function fg(e,t){if(e.length-t<4)throw new Error(`${Ct} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(fg,"readFloat32");function ON(e){Ri.setFloat64(0,e,!1)}i(ON,"encodeFloat64");function E9(e,t){if(e.length-t<8)throw new Error(`${Ct} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i(E9,"readFloat64");np.compareTokens=Oi.compareTokens;function or(e,t,r){throw new Error(`${Ct} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(or,"invalidMinor");function ip(e){return()=>{throw new Error(`${Ct} ${e}`)}}i(ip,"errorer");var Ge=[];for(let e=0;e<=23;e++)Ge[e]=or;Ge[24]=k8;Ge[25]=O8;Ge[26]=R8;Ge[27]=N8;Ge[28]=or;Ge[29]=or;Ge[30]=or;Ge[31]=or;for(let e=32;e<=55;e++)Ge[e]=or;Ge[56]=P8;Ge[57]=B8;Ge[58]=L8;Ge[59]=U8;Ge[60]=or;Ge[61]=or;Ge[62]=or;Ge[63]=or;for(let e=64;e<=87;e++)Ge[e]=$8;Ge[88]=j8;Ge[89]=z8;Ge[90]=H8;Ge[91]=q8;Ge[92]=or;Ge[93]=or;Ge[94]=or;Ge[95]=ip("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)Ge[e]=K8;Ge[120]=V8;Ge[121]=G8;Ge[122]=W8;Ge[123]=Z8;Ge[124]=or;Ge[125]=or;Ge[126]=or;Ge[127]=ip("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)Ge[e]=Y8;Ge[152]=X8;Ge[153]=Q8;Ge[154]=e9;Ge[155]=t9;Ge[156]=or;Ge[157]=or;Ge[158]=or;Ge[159]=r9;for(let e=160;e<=183;e++)Ge[e]=n9;Ge[184]=i9;Ge[185]=s9;Ge[186]=a9;Ge[187]=o9;Ge[188]=or;Ge[189]=or;Ge[190]=or;Ge[191]=c9;for(let e=192;e<=215;e++)Ge[e]=u9;Ge[216]=l9;Ge[217]=f9;Ge[218]=d9;Ge[219]=h9;Ge[220]=or;Ge[221]=or;Ge[222]=or;Ge[223]=or;for(let e=224;e<=243;e++)Ge[e]=ip("simple values are not supported");Ge[244]=or;Ge[245]=or;Ge[246]=or;Ge[247]=p9;Ge[248]=ip("simple values are not supported");Ge[249]=v9;Ge[250]=g9;Ge[251]=y9;Ge[252]=or;Ge[253]=or;Ge[254]=or;Ge[255]=m9;var es=[];for(let e=0;e<24;e++)es[e]=new Xe(Oe.uint,e,1);for(let e=-1;e>=-24;e--)es[31-e]=new Xe(Oe.negint,e,1);es[64]=new Xe(Oe.bytes,new Uint8Array(0),1);es[96]=new Xe(Oe.string,"",1);es[128]=new Xe(Oe.array,0,1);es[160]=new Xe(Oe.map,0,1);es[244]=new Xe(Oe.false,!1,1);es[245]=new Xe(Oe.true,!0,1);es[246]=new Xe(Oe.null,null,1);function A9(e){switch(e.type){case Oe.false:return Cs([244]);case Oe.true:return Cs([245]);case Oe.null:return Cs([246]);case Oe.bytes:return e.value.length?void 0:Cs([64]);case Oe.string:return e.value===""?Cs([96]):void 0;case Oe.array:return e.value===0?Cs([128]):void 0;case Oe.map:return e.value===0?Cs([160]):void 0;case Oe.uint:return e.value<24?Cs([Number(e.value)]):void 0;case Oe.negint:if(e.value>=-24)return Cs([31-Number(e.value)])}}i(A9,"quickEncodeToken");var NN={float64:!1,mapSorter:LN,quickEncodeToken:A9};function PN(){let e=[];return e[Oe.uint.major]=Oi,e[Oe.negint.major]=Xh,e[Oe.bytes.major]=su,e[Oe.string.major]=J8,e[Oe.array.major]=ep,e[Oe.map.major]=tp,e[Oe.tag.major]=rp,e[Oe.float.major]=np,e}i(PN,"makeCborEncoders");var S9=PN(),dg=new iu,Ho=class{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${og} object contains circular references`);return new Ho(r,t)}};i(Ho,"Ref");var ja={null:new Xe(Oe.null,null),undefined:new Xe(Oe.undefined,void 0),true:new Xe(Oe.true,!0),false:new Xe(Oe.false,!1),emptyArray:new Xe(Oe.array,0),emptyMap:new Xe(Oe.map,0)},za={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Xe(Oe.float,e):e>=0?new Xe(Oe.uint,e):new Xe(Oe.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Xe(Oe.uint,e):new Xe(Oe.negint,e)},Uint8Array(e,t,r,n){return new Xe(Oe.bytes,e)},string(e,t,r,n){return new Xe(Oe.string,e)},boolean(e,t,r,n){return e?ja.true:ja.false},null(e,t,r,n){return ja.null},undefined(e,t,r,n){return ja.undefined},ArrayBuffer(e,t,r,n){return new Xe(Oe.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Xe(Oe.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[ja.emptyArray,new Xe(Oe.break)]:ja.emptyArray;n=Ho.createCheck(n,e);let s=[],o=0;for(let c of e)s[o++]=sp(c,r,n);return r.addBreakTokens?[new Xe(Oe.array,e.length),s,new Xe(Oe.break)]:[new Xe(Oe.array,e.length),s]},Object(e,t,r,n){let s=t!=="Object",o=s?e.keys():Object.keys(e),c=s?e.size:o.length;if(!c)return r.addBreakTokens===!0?[ja.emptyMap,new Xe(Oe.break)]:ja.emptyMap;n=Ho.createCheck(n,e);let l=[],h=0;for(let p of o)l[h++]=[sp(p,r,n),sp(s?e.get(p):e[p],r,n)];return BN(l,r),r.addBreakTokens?[new Xe(Oe.map,c),l,new Xe(Oe.break)]:[new Xe(Oe.map,c),l]}};za.Map=za.Object;za.Buffer=za.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))za[`${e}Array`]=za.DataView;function sp(e,t={},r){let n=E8(e),s=t&&t.typeEncoders&&t.typeEncoders[n]||za[n];if(typeof s=="function"){let c=s(e,n,t,r);if(c!=null)return c}let o=za[n];if(!o)throw new Error(`${og} unsupported type: ${n}`);return o(e,n,t,r)}i(sp,"objectToTokens");function BN(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(BN,"sortMapEntries");function LN(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let s=r.type.major,o=S9[s].compareTokens(r,n);return o===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}i(LN,"mapSorter");function x9(e,t,r,n){if(Array.isArray(t))for(let s of t)x9(e,s,r,n);else r[t.type.major](e,t,n)}i(x9,"tokensToEncoded");function FN(e,t,r){let n=sp(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let s=r.quickEncodeToken(n);if(s)return s;let o=t[n.type.major];if(o.encodedSize){let c=o.encodedSize(n,r),l=new iu(c);if(o(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return ag(l.chunks[0])}}return dg.reset(),x9(dg,n,t,r),dg.toBytes(!0)}i(FN,"encodeCustom");function hg(e,t){return t=Object.assign({},NN,t),FN(e,S9,t)}i(hg,"encode");var UN={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},ap=class{constructor(t,r={}){this.pos=0,this.data=t,this.options=r}done(){return this.pos>=this.data.length}next(){let t=this.data[this.pos],r=es[t];if(r===void 0){let n=Ge[t];if(!n)throw new Error(`${Ct} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let s=t&31;r=n(this.data,this.pos,s,this.options)}return this.pos+=r.encodedLength,r}};i(ap,"Tokeniser");var hf=Symbol.for("DONE"),op=Symbol.for("BREAK");function $N(e,t,r){let n=[];for(let s=0;s<e.value;s++){let o=pf(t,r);if(o===op){if(e.value===1/0)break;throw new Error(`${Ct} got unexpected break to lengthed array`)}if(o===hf)throw new Error(`${Ct} found array but not enough entries (got ${s}, expected ${e.value})`);n[s]=o}return n}i($N,"tokenToArray");function jN(e,t,r){let n=r.useMaps===!0,s=n?void 0:{},o=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=pf(t,r);if(l===op){if(e.value===1/0)break;throw new Error(`${Ct} got unexpected break to lengthed map`)}if(l===hf)throw new Error(`${Ct} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${Ct} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(l)||!n&&l in s))throw new Error(`${Ct} found repeat map key "${l}"`);let h=pf(t,r);if(h===hf)throw new Error(`${Ct} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?o.set(l,h):s[l]=h}return n?o:s}i(jN,"tokenToMap");function pf(e,t){if(e.done())return hf;let r=e.next();if(r.type===Oe.break)return op;if(r.type.terminal)return r.value;if(r.type===Oe.array)return $N(r,e,t);if(r.type===Oe.map)return jN(r,e,t);if(r.type===Oe.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=pf(e,t);return t.tags[r.value](n)}throw new Error(`${Ct} tag not supported (${r.value})`)}throw new Error("unsupported")}i(pf,"tokensToObject");function pg(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Ct} data to decode must be a Uint8Array`);t=Object.assign({},UN,t);let r=t.tokenizer||new ap(e,t),n=pf(r,t);if(n===hf)throw new Error(`${Ct} did not find any content to decode`);if(n===op)throw new Error(`${Ct} got unexpected break`);if(!r.done())throw new Error(`${Ct} too many terminals, data makes no sense`);return n}i(pg,"decode");var T9=42;function HN(e){if(e.asCID!==e)return null;let t=jt.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Xe(Oe.tag,T9),new Xe(Oe.bytes,r)]}i(HN,"cidEncoder");function qN(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(qN,"undefinedEncoder");function KN(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}i(KN,"numberEncoder");var VN={float64:!0,typeEncoders:{Object:HN,undefined:qN,number:KN}};function GN(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return jt.decode(e.subarray(1))}i(GN,"cidDecoder");var M9={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};M9.tags[T9]=GN;var WN="dag-cbor",ZN=113,mg=i(e=>hg(e,VN),"encode"),JN=i(e=>pg(e,M9),"decode");function cu(e){try{return e()}catch(t){return t}}i(cu,"tryCatch");var vg=Ua(Gh(),1);function qo(e){let t=vg.default.decode(e),r=vg.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(qo,"readVarint");function YN(e){return e===0||e===1}i(YN,"isCidVersion");function gg(e){let[t,r]=qo(e);if(!YN(t))throw new Error(`Unknown CID version ${t}`);let[n,s]=qo(r),[,o,c]=qo(s),[l,,h]=qo(o),p=s.subarray(0,c+h+l),v=s.subarray(c+h+l);return[jt.create(t,n,$h(p)),v]}i(gg,"readCid");function Ko(e,t="StreamRef"){let[r,n]=qo(e);if(r!==206)throw new Error(`Invalid ${t}, does not include streamid codec`);let[s,o]=qo(n),c=gg(o),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:s,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:s,genesis:l,commit:null};{let[p]=gg(h);return{kind:"commit-id",type:s,genesis:l,commit:p}}}i(Ko,"fromBytes");var XN=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function uu(e,t="StreamRef"){let r=XN.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let s=Yi.decode(n),o=Ko(s),c=r[4];return c?{kind:"commit-id",type:o.type,genesis:o.genesis,commit:yg(o.genesis,c)}:o}i(uu,"fromString");function QN(e){try{return typeof e=="string"?jt.parse(e):jt.asCID(e)}catch{return null}}i(QN,"parseCID");function yg(e,t=null){if(!t||t==="0")return null;let r=QN(t);if(r)return e.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}i(yg,"parseCommit");var mf=function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},Ni=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},up=class extends Error{constructor(t){super(`Invalid StreamID bytes ${Yi.encode(t)}: contains commit`)}};i(up,"InvalidStreamIDBytesError");var lp=class extends Error{constructor(t){super(`Invalid StreamID string ${t}: contains commit`)}};i(lp,"InvalidStreamIDStringError");function D9(e){let t=Ko(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new up(e)}i(D9,"fromBytes");function eP(e){return cu(()=>D9(e))}i(eP,"fromBytesNoThrow");function k9(e){let t=uu(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new lp(e)}i(k9,"fromString");function tP(e){return cu(()=>k9(e))}i(tP,"fromStringNoThrow");var I9=Symbol.for("@ceramicnetwork/streamid/StreamID"),Yt=class{constructor(t,r){if(this._tag=I9,!(t||t===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof t=="string"?Xi.codeByName(t):t,this._cid=typeof r=="string"?jt.parse(r):r}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===I9}static async fromGenesis(t,r){let n=await w8({value:r,codec:cp,hasher:Jv});return new Yt(t,n.cid)}get type(){return this._type}get typeName(){return Xi.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let t=_g.default.encode(206),r=_g.default.encode(this.type);return uf([t,r,this.cid.bytes])}get baseID(){return new Yt(this._type,this._cid)}equals(t){return Yt.isInstance(t)?this.type===t.type&&this.cid.equals(t.cid):!1}toString(){return Yi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(Yt,"StreamID");Yt.fromBytes=D9;Yt.fromBytesNoThrow=eP;Yt.fromString=k9;Yt.fromStringNoThrow=tP;mf([si(),Ni("design:type",String),Ni("design:paramtypes",[])],Yt.prototype,"typeName",null);mf([si(),Ni("design:type",Uint8Array),Ni("design:paramtypes",[])],Yt.prototype,"bytes",null);mf([si(),Ni("design:type",Yt),Ni("design:paramtypes",[])],Yt.prototype,"baseID",null);mf([si(),Ni("design:type",Function),Ni("design:paramtypes",[]),Ni("design:returntype",String)],Yt.prototype,"toString",null);mf([si(),Ni("design:type",Function),Ni("design:paramtypes",[]),Ni("design:returntype",String)],Yt.prototype,"toUrl",null);var fu=function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},qn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},wg=function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},oa=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},lu,Vo,vf,fp=class extends Error{constructor(t){super(`Error while parsing CommitID from bytes ${Yi.encode(t)}: no commit information provided`)}};i(fp,"InvalidCommitIDBytesError");var dp=class extends Error{constructor(t){super(`Error while parsing CommitID from string ${t}: no commit information provided`)}};i(dp,"InvalidCommitIDStringError");function R9(e){let t=Ko(e,"CommitID");if(t.kind==="commit-id")return new fr(t.type,t.genesis,t.commit);throw new fp(e)}i(R9,"fromBytes");function rP(e){return cu(()=>R9(e))}i(rP,"fromBytesNoThrow");function N9(e){let t=uu(e,"CommitID");if(t.kind==="commit-id")return new fr(t.type,t.genesis,t.commit);throw new dp(e)}i(N9,"fromString");function nP(e){return cu(()=>N9(e))}i(nP,"fromStringNoThrow");var O9=Symbol.for("@ceramicnetwork/streamid/CommitID");function iP(e,t){return new fr(e.type,e.cid,t)}i(iP,"make");var fr=class{constructor(t,r,n=null){if(this._tag=O9,lu.set(this,void 0),Vo.set(this,void 0),vf.set(this,void 0),!t&&t!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");wg(this,lu,typeof t=="string"?Xi.codeByName(t):t,"f"),wg(this,Vo,typeof r=="string"?jt.parse(r):r,"f"),wg(this,vf,yg(oa(this,Vo,"f"),n),"f")}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===O9}get baseID(){return new Yt(oa(this,lu,"f"),oa(this,Vo,"f"))}get type(){return oa(this,lu,"f")}get typeName(){return Xi.nameByCode(oa(this,lu,"f"))}get cid(){return oa(this,Vo,"f")}get commit(){return oa(this,vf,"f")||oa(this,Vo,"f")}get bytes(){let t=Eg.default.encode(206),r=Eg.default.encode(this.type),n=oa(this,vf,"f")?.bytes||new Uint8Array([0]);return uf([t,r,this.cid.bytes,n])}equals(t){return this.type===t.type&&this.cid.equals(t.cid)&&this.commit.equals(t.commit)}toString(){return Yi.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(lu=new WeakMap,Vo=new WeakMap,vf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(fr,"CommitID");fr.fromBytes=R9;fr.fromBytesNoThrow=rP;fr.fromString=N9;fr.fromStringNoThrow=nP;fr.make=iP;fu([si(),qn("design:type",Yt),qn("design:paramtypes",[])],fr.prototype,"baseID",null);fu([si(),qn("design:type",String),qn("design:paramtypes",[])],fr.prototype,"typeName",null);fu([si(),qn("design:type",jt),qn("design:paramtypes",[])],fr.prototype,"commit",null);fu([si(),qn("design:type",Uint8Array),qn("design:paramtypes",[])],fr.prototype,"bytes",null);fu([si(),qn("design:type",Function),qn("design:paramtypes",[]),qn("design:returntype",String)],fr.prototype,"toString",null);fu([si(),qn("design:type",Function),qn("design:paramtypes",[]),qn("design:returntype",String)],fr.prototype,"toUrl",null);var Go;(function(e){function t(s){let o=Ko(s);switch(o.kind){case"commit-id":return new fr(o.type,o.genesis,o.commit);case"stream-id":return new Yt(o.type,o.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Yi.encode(s)}`)}}i(t,"fromBytes"),e.fromBytes=t;function r(s){let o=uu(s);switch(o.kind){case"commit-id":return new fr(o.type,o.genesis,o.commit);case"stream-id":return new Yt(o.type,o.genesis);default:throw new Error(`Malformed StreamRef string: ${s}`)}}i(r,"fromString"),e.fromString=r;function n(s){if(Yt.isInstance(s)||fr.isInstance(s))return s;if(s instanceof Uint8Array)return t(s);if(typeof s=="string")return r(s);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(s)}`)}i(n,"from"),e.from=n})(Go||(Go={}));var P9="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",hp="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var Ag={};_n(Ag,{JsonPatchError:()=>Pr,_areEquals:()=>bf,applyOperation:()=>Wo,applyPatch:()=>_p,applyReducer:()=>uP,deepClone:()=>oP,getValueByPointer:()=>yp,validate:()=>L9,validator:()=>bp});var sP=function(){var e=i(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var o in s)s.hasOwnProperty(o)&&(n[o]=s[o])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),aP=Object.prototype.hasOwnProperty;function mp(e,t){return aP.call(e,t)}i(mp,"hasOwnProperty");function vp(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var s in e)mp(e,s)&&n.push(s);return n}i(vp,"_objectKeys");function on(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(on,"_deepClone");function gp(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}i(gp,"isInteger");function Is(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(Is,"escapePathComponent");function gf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(gf,"unescapePathComponent");function pp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(pp(e[t]))return!0}else if(typeof e=="object"){for(var n=vp(e),s=n.length,o=0;o<s;o++)if(pp(e[n[o]]))return!0}}return!1}i(pp,"hasUndefined");function B9(e,t){var r=[e];for(var n in t){var s=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof s<"u"&&r.push(n+": "+s)}return r.join(`
|
|
22
|
+
`)}i(B9,"patchErrorMessageFormatter");var yf=function(e){sP(t,e);function t(r,n,s,o,c){var l=this.constructor,h=e.call(this,B9(r,{name:n,index:s,operation:o,tree:c}))||this;return h.name=n,h.index=s,h.operation=o,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=B9(r,{name:n,index:s,operation:o,tree:c}),h}return i(t,"PatchError"),t}(Error);var Pr=yf,oP=on,du={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=yp(r,this.path);n&&(n=on(n));var s=Wo(r,{op:"remove",path:this.from}).removed;return Wo(r,{op:"add",path:this.path,value:s}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=yp(r,this.from);return Wo(r,{op:"add",path:this.path,value:on(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:bf(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},cP={add:function(e,t,r){return gp(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:du.move,copy:du.copy,test:du.test,_get:du._get};function yp(e,t){if(t=="")return e;var r={op:"_get",path:t};return Wo(e,r),r.value}i(yp,"getValueByPointer");function Wo(e,t,r,n,s,o){if(r===void 0&&(r=!1),n===void 0&&(n=!0),s===void 0&&(s=!0),o===void 0&&(o=0),r&&(typeof r=="function"?r(t,0,e,t.path):bp(t,0)),t.path===""){var c={newDocument:e};if(t.op==="add")return c.newDocument=t.value,c;if(t.op==="replace")return c.newDocument=t.value,c.removed=e,c;if(t.op==="move"||t.op==="copy")return c.newDocument=yp(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=bf(e,t.value),c.test===!1)throw new Pr("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c.newDocument=e,c}else{if(t.op==="remove")return c.removed=e,c.newDocument=null,c;if(t.op==="_get")return t.value=e,c;if(r)throw new Pr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return c}}else{n||(e=on(e));var l=t.path||"",h=l.split("/"),p=e,v=1,b=h.length,y=void 0,A=void 0,C=void 0;for(typeof r=="function"?C=r:C=bp;;){if(A=h[v],A&&A.indexOf("~")!=-1&&(A=gf(A)),s&&(A=="__proto__"||A=="prototype"&&v>0&&h[v-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&y===void 0&&(p[A]===void 0?y=h.slice(0,v).join("/"):v==b-1&&(y=t.path),y!==void 0&&C(t,0,e,y)),v++,Array.isArray(p)){if(A==="-")A=p.length;else{if(r&&!gp(A))throw new Pr("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);gp(A)&&(A=~~A)}if(v>=b){if(r&&t.op==="add"&&A>p.length)throw new Pr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var c=cP[t.op].call(t,p,A,e);if(c.test===!1)throw new Pr("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}}else if(v>=b){var c=du[t.op].call(t,p,A,e);if(c.test===!1)throw new Pr("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}if(p=p[A],r&&v<b&&(!p||typeof p!="object"))throw new Pr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}i(Wo,"applyOperation");function _p(e,t,r,n,s){if(n===void 0&&(n=!0),s===void 0&&(s=!0),r&&!Array.isArray(t))throw new Pr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=on(e));for(var o=new Array(t.length),c=0,l=t.length;c<l;c++)o[c]=Wo(e,t[c],r,!0,s,c),e=o[c].newDocument;return o.newDocument=e,o}i(_p,"applyPatch");function uP(e,t,r){var n=Wo(e,t);if(n.test===!1)throw new Pr("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(uP,"applyReducer");function bp(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Pr("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(du[e.op]){if(typeof e.path!="string")throw new Pr("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Pr('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Pr("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Pr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&pp(e.value))throw new Pr("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var s=e.path.split("/").length,o=n.split("/").length;if(s!==o+1&&s!==o)throw new Pr("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new Pr("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var c={op:"_get",path:e.from,value:void 0},l=L9([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Pr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Pr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(bp,"validator");function L9(e,t,r){try{if(!Array.isArray(e))throw new Pr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)_p(on(t),on(e),r||!0);else{r=r||bp;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(s){if(s instanceof Pr)return s;throw s}}i(L9,"validate");function bf(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),s,o,c;if(r&&n){if(o=e.length,o!=t.length)return!1;for(s=o;s--!==0;)if(!bf(e[s],t[s]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(o=l.length,o!==Object.keys(t).length)return!1;for(s=o;s--!==0;)if(!t.hasOwnProperty(l[s]))return!1;for(s=o;s--!==0;)if(c=l[s],!bf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(bf,"_areEquals");var Mg={};_n(Mg,{compare:()=>gP,generate:()=>Sg,observe:()=>vP,unobserve:()=>mP});var xg=new WeakMap,lP=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror"),e}(),fP=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo"),e}();function dP(e){return xg.get(e)}i(dP,"getMirror");function hP(e,t){return e.observers.get(t)}i(hP,"getObserverFromMirror");function pP(e,t){e.observers.delete(t.callback)}i(pP,"removeObserverFromMirror");function mP(e,t){t.unobserve()}i(mP,"unobserve");function vP(e,t){var r=[],n,s=dP(e);if(!s)s=new lP(e),xg.set(e,s);else{var o=hP(s,t);n=o&&o.observer}if(n)return n;if(n={},s.value=on(e),t){n.callback=t,n.next=null;var c=i(function(){Sg(n)},"dirtyCheck"),l=i(function(){clearTimeout(n.next),n.next=setTimeout(c)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",l),window.addEventListener("keyup",l),window.addEventListener("mousedown",l),window.addEventListener("keydown",l),window.addEventListener("change",l))}return n.patches=r,n.object=e,n.unobserve=function(){Sg(n),clearTimeout(n.next),pP(s,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},s.observers.set(t,new fP(t,n)),n}i(vP,"observe");function Sg(e,t){t===void 0&&(t=!1);var r=xg.get(e.object);Tg(r.value,e.object,e.patches,"",t),e.patches.length&&_p(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(Sg,"generate");function Tg(e,t,r,n,s){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=vp(t),c=vp(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var v=c[p],b=e[v];if(mp(t,v)&&!(t[v]===void 0&&b!==void 0&&Array.isArray(t)===!1)){var y=t[v];typeof b=="object"&&b!=null&&typeof y=="object"&&y!=null&&Array.isArray(b)===Array.isArray(y)?Tg(b,y,r,n+"/"+Is(v),s):b!==y&&(l=!0,s&&r.push({op:"test",path:n+"/"+Is(v),value:on(b)}),r.push({op:"replace",path:n+"/"+Is(v),value:on(y)}))}else Array.isArray(e)===Array.isArray(t)?(s&&r.push({op:"test",path:n+"/"+Is(v),value:on(b)}),r.push({op:"remove",path:n+"/"+Is(v)}),h=!0):(s&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&o.length==c.length))for(var p=0;p<o.length;p++){var v=o[p];!mp(e,v)&&t[v]!==void 0&&r.push({op:"add",path:n+"/"+Is(v),value:on(t[v])})}}}i(Tg,"_generate");function gP(e,t,r){r===void 0&&(r=!1);var n=[];return Tg(e,t,n,"",r),n}i(gP,"compare");var F9=Object.assign({},Ag,Mg,{JsonPatchError:yf,deepClone:on,escapePathComponent:Is,unescapePathComponent:gf});var O7=Ua(zg(),1);var R7=Ua(jE(),1);var Xo;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(Xo||(Xo={}));var ay=Ua(zg(),1);var p7=Ua(h7(),1),{__extends:Yg,__assign:MW,__rest:CW,__decorate:IW,__param:DW,__esDecorate:kW,__runInitializers:OW,__propKey:RW,__setFunctionName:NW,__metadata:PW,__awaiter:BW,__generator:LW,__exportStar:FW,__createBinding:UW,__values:Xg,__read:yu,__spread:$W,__spreadArrays:jW,__spreadArray:bu,__await:zW,__asyncGenerator:HW,__asyncDelegator:qW,__asyncValues:KW,__makeTemplateObject:VW,__importStar:GW,__importDefault:WW,__classPrivateFieldGet:ZW,__classPrivateFieldSet:JW,__classPrivateFieldIn:YW}=p7.default;function Pi(e){return typeof e=="function"}i(Pi,"isFunction");function m7(e){var t=i(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}i(m7,"createErrorClass");var $p=m7(function(e){return i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
23
|
+
`+r.map(function(n,s){return s+1+") "+n.toString()}).join(`
|
|
24
|
+
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function Qg(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Qg,"arrRemove");var jp=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,s,o;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Xg(c),h=l.next();!h.done;h=l.next()){var p=h.value;p.remove(this)}}catch(O){t={error:O}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var v=this.initialTeardown;if(Pi(v))try{v()}catch(O){o=O instanceof $p?O.errors:[O]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var y=Xg(b),A=y.next();!A.done;A=y.next()){var C=A.value;try{v7(C)}catch(O){o=o??[],O instanceof $p?o=bu(bu([],yu(o)),yu(O.errors)):o.push(O)}}}catch(O){n={error:O}}finally{try{A&&!A.done&&(s=y.return)&&s.call(y)}finally{if(n)throw n.error}}}if(o)throw new $p(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)v7(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Qg(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Qg(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var cZ=jp.EMPTY;function zp(e){return e instanceof jp||e&&"closed"in e&&Pi(e.remove)&&Pi(e.add)&&Pi(e.unsubscribe)}i(zp,"isSubscription");function v7(e){Pi(e)?e():e.unsubscribe()}i(v7,"execFinalizer");var ts={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var _u={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var s=_u.delegate;return s?.setTimeout?s.setTimeout.apply(s,bu([e,t],yu(r))):setTimeout.apply(void 0,bu([e,t],yu(r)))},clearTimeout:function(e){var t=_u.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function g7(e){_u.setTimeout(function(){var t=ts.onUnhandledError;if(t)t(e);else throw e})}i(g7,"reportUnhandledError");function ey(){}i(ey,"noop");var y7=function(){return ty("C",void 0,void 0)}();function b7(e){return ty("E",void 0,e)}i(b7,"errorNotification");function _7(e){return ty("N",e,void 0)}i(_7,"nextNotification");function ty(e,t,r){return{kind:e,value:t,error:r}}i(ty,"createNotification");var Qo=null;function w7(e){if(ts.useDeprecatedSynchronousErrorHandling){var t=!Qo;if(t&&(Qo={errorThrown:!1,error:null}),e(),t){var r=Qo,n=r.errorThrown,s=r.error;if(Qo=null,n)throw s}}else e()}i(w7,"errorContext");function E7(e){ts.useDeprecatedSynchronousErrorHandling&&Qo&&(Qo.errorThrown=!0,Qo.error=e)}i(E7,"captureError");var iy=function(e){Yg(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,zp(r)&&r.add(n)):n.destination=CL,n}return i(t,"Subscriber"),t.create=function(r,n,s){return new qp(r,n,s)},t.prototype.next=function(r){this.isStopped?ny(_7(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?ny(b7(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?ny(y7,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(jp);var xL=Function.prototype.bind;function ry(e,t){return xL.call(e,t)}i(ry,"bind");var TL=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Hp(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Hp(n)}else Hp(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Hp(r)}},e}(),qp=function(e){Yg(t,e);function t(r,n,s){var o=e.call(this)||this,c;if(Pi(r)||!r)c={next:r??void 0,error:n??void 0,complete:s??void 0};else{var l;o&&ts.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return o.unsubscribe()},c={next:r.next&&ry(r.next,l),error:r.error&&ry(r.error,l),complete:r.complete&&ry(r.complete,l)}):c=r}return o.destination=new TL(c),o}return i(t,"SafeSubscriber"),t}(iy);function Hp(e){ts.useDeprecatedSynchronousErrorHandling?E7(e):g7(e)}i(Hp,"handleUnhandledError");function ML(e){throw e}i(ML,"defaultErrorHandler");function ny(e,t){var r=ts.onStoppedNotification;r&&_u.setTimeout(function(){return r(e,t)})}i(ny,"handleStoppedNotification");var CL={closed:!0,next:ey,error:ML,complete:ey};var A7=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function S7(e){return e}i(S7,"identity");function x7(e){return e.length===0?S7:e.length===1?e[0]:i(function(r){return e.reduce(function(n,s){return s(n)},r)},"piped")}i(x7,"pipeFromArray");var sy=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var s=this,o=DL(t)?t:new qp(t,r,n);return w7(function(){var c=s,l=c.operator,h=c.source;o.add(l?l.call(o,h):h?s._subscribe(o):s._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=T7(r),new r(function(s,o){var c=new qp({next:function(l){try{t(l)}catch(h){o(h),c.unsubscribe()}},error:o,complete:s});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[A7]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return x7(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=T7(t),new t(function(n,s){var o;r.subscribe(function(c){return o=c},function(c){return s(c)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();function T7(e){var t;return(t=e??ts.Promise)!==null&&t!==void 0?t:Promise}i(T7,"getPromiseCtor");function IL(e){return e&&Pi(e.next)&&Pi(e.error)&&Pi(e.complete)}i(IL,"isObserver");function DL(e){return e&&e instanceof iy||IL(e)&&zp(e)}i(DL,"isSubscriber");var M7;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(M7||(M7={}));var C7;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(C7||(C7={}));var oy;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(oy||(oy={}));var Af=class extends sy{constructor(t,r){super(n=>{t.subscribe(n)}),this.state$=t,this._context=r}get id(){return new Yt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:t,content:r}=this.state$.value;return(0,ay.default)(t?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return fr.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:t})=>fr.make(this.id,t))}get anchorCommitIds(){return this.state$.value.log.filter(({type:t})=>t===oy.ANCHOR).map(({cid:t})=>fr.make(this.id,t))}get state(){return(0,ay.default)(this.state$.value)}async sync(t={}){t={sync:Xo.PREFER_CACHE,...t};let r=await this.api.loadStream(this.id,t);this.state$.next(r.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}};i(Af,"Stream");function I7(){return e=>{}}i(I7,"StreamStatic");var kL=function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},fi,cy={anchor:!0,publish:!0,pin:!0,sync:Xo.PREFER_CACHE},OL={sync:Xo.PREFER_CACHE},D7={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function uy(e,t){if(typeof e?.schema=="string")try{fr.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=rg((0,R7.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(uy,"headerFromMetadata");async function k7(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i(k7,"getAuthenticatedDID");async function ly(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(ly,"throwReadOnlyError");var qa=fi=i(class extends Af{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,O7.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,s={}){s={...cy,...s},!n?.deterministic&&s.syncTimeoutSeconds==null&&(s.syncTimeoutSeconds=0);let o=s.asDID?{did:s.asDID}:t,c=await fi.makeGenesis(o,r,n);return t.createStreamFromGenesis(fi.STREAM_TYPE_ID,c,s)}static async createFromGenesis(t,r,n={}){n={...cy,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let s=r.data?await fi._signDagJWS(t,r):r;return t.createStreamFromGenesis(fi.STREAM_TYPE_ID,s,n)}static async deterministic(t,r,n={}){if(n={...cy,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let s=await fi.makeGenesis(t,null,r);return t.createStreamFromGenesis(fi.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={...OL,...n};let s=Go.from(r);if(s.type!=fi.STREAM_TYPE_ID)throw new Error(`StreamID ${s.toString()} does not refer to a '${fi.STREAM_TYPE_NAME}' stream, but to a ${s.typeName}`);return t.loadStream(s,n)}async update(t,r,n={}){n={...D7,...n};let s=n.asDID?{did:n.asDID}:this.api,o=await this.makeCommit(s,t,r),c=await this.api.applyCommit(this.id,o,n);this.state$.next(c.state)}async patch(t,r={}){r={...D7,...r};let s={header:uy(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},o=await fi._signDagJWS(this.api,s),c=await this.api.applyCommit(this.id,o,r);this.state$.next(c.state)}makeReadOnly(){this.update=ly,this.patch=ly,this.sync=ly,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let s=await this._makeRawCommit(r,n);return fi._signDagJWS(t,s)}async _makeRawCommit(t,r){r||(r={});let n=uy(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=F9.compare(this.content,t),o=this.state.log[0];return{header:n,data:s,prev:this.tip,id:o.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await k7(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let s=uy(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:s};return mg(c),c}let o={data:r,header:s};return fi._signDagJWS(t,o)}static async _signDagJWS(t,r){return(await k7(t)).createDagJWS(r)}},"TileDocument");qa.STREAM_TYPE_NAME="tile";qa.STREAM_TYPE_ID=0;qa=fi=kL([I7()],qa);var $7=Ua(B7(),1);function zL(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(zL,"_checkPrivateRedeclaration");function HL(e,t){return t.get?t.get.call(e):t.value}i(HL,"_classApplyDescriptorGet");function qL(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(qL,"_classApplyDescriptorSet");function U7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(U7,"_classExtractFieldDescriptor");function py(e,t){var r=U7(e,t,"get");return HL(e,r)}i(py,"_classPrivateFieldGet");function L7(e,t,r){zL(e,t),t.set(e,r)}i(L7,"_classPrivateFieldInit");function F7(e,t,r){var n=U7(e,t,"set");return qL(e,n,r),r}i(F7,"_classPrivateFieldSet");function KL(e){return typeof e=="string"||fr.isInstance(e)||Yt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(KL,"keyToQuery");function my(e){return typeof e=="string"?Go.from(e).toString():fr.isInstance(e)||Yt.isInstance(e)?e.toString():e.streamId.toString()}i(my,"keyToString");async function gy(e){let t=await qa.makeGenesis({},null,{...e,deterministic:!0}),r=await Yt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(gy,"getDeterministicQuery");var VL=i(()=>Promise.resolve([]),"tempBatchLoadFn"),Kp=new WeakMap,vy=new WeakMap,ec=class extends $7.default{cache(t){if(!py(this,vy))return!1;let r=t.id.toString();return this.clear(r).prime(r,t),!0}async create(t,r,n){let s=await qa.create(py(this,Kp),t,r,n);return this.cache(s),s}async deterministic(t,r){let n=await gy(t);try{return await super.load(n)}catch{let o=await qa.createFromGenesis(py(this,Kp),n.genesis,r);return this.cache(o),o}}async load(t){return await super.load(t)}async update(t,r,n,s){let o=my(t);this.clear(o);let c=await this.load({streamId:o});return await c.update(r,n,s),c}constructor(t){super(VL,{cache:!0,cacheKeyFn:my,cacheMap:t.cache!=null&&typeof t.cache!="boolean"?t.cache:void 0}),L7(this,Kp,{writable:!0,value:void 0}),L7(this,vy,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{t.cache||this.clearAll();let n=await t.ceramic.multiQuery(r.map(KL),t.multiqueryTimeout);return r.map(s=>{let o=my(s),c=n[o];return c||new Error(`Failed to load stream: ${o}`)})},F7(this,Kp,t.ceramic),F7(this,vy,!!t.cache)}};i(ec,"TileLoader");function GL(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(GL,"_checkPrivateRedeclaration");function WL(e,t){return t.get?t.get.call(e):t.value}i(WL,"_classApplyDescriptorGet");function ZL(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(ZL,"_classApplyDescriptorSet");function z7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(z7,"_classExtractFieldDescriptor");function tc(e,t){var r=z7(e,t,"get");return WL(e,r)}i(tc,"_classPrivateFieldGet");function j7(e,t,r){GL(e,t),t.set(e,r)}i(j7,"_classPrivateFieldInit");function yy(e,t,r){var n=z7(e,t,"set");return ZL(e,n,r),r}i(yy,"_classPrivateFieldSet");var wu=new WeakMap,Eu=new WeakMap,Au=class{get aliases(){return tc(this,wu)}get loader(){return tc(this,Eu)}getDefinitionID(t){return tc(this,wu).definitions[t]??null}getSchemaURL(t){return tc(this,wu).schemas[t]??null}getTileID(t){return tc(this,wu).tiles[t]??null}async loadTile(t){let r=this.getTileID(t);if(r==null)throw new Error(`Tile alias "${t}" is not defined`);return await tc(this,Eu).load(r)}async createTile(t,r,n={}){let s=this.getSchemaURL(t);if(s==null)throw new Error(`Schema alias "${t}" is not defined`);let{controller:o,...c}=n,l={schema:s};return o!=null&&(l.controllers=[o]),await tc(this,Eu).create(r,l,c)}constructor(t){if(j7(this,wu,{writable:!0,value:void 0}),j7(this,Eu,{writable:!0,value:void 0}),yy(this,wu,t.aliases),t.loader!=null)yy(this,Eu,t.loader);else{if(t.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");yy(this,Eu,new ec({ceramic:t.ceramic,cache:t.cache}))}}};i(Au,"DataModel");function JL(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(JL,"_checkPrivateRedeclaration");function YL(e,t){return t.get?t.get.call(e):t.value}i(YL,"_classApplyDescriptorGet");function XL(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(XL,"_classApplyDescriptorSet");function H7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(H7,"_classExtractFieldDescriptor");function Ds(e,t){var r=H7(e,t,"get");return YL(e,r)}i(Ds,"_classPrivateFieldGet");function Vp(e,t,r){JL(e,t),t.set(e,r)}i(Vp,"_classPrivateFieldInit");function Gp(e,t,r){var n=H7(e,t,"set");return XL(e,n,r),r}i(Gp,"_classPrivateFieldSet");var Wp=new WeakMap,rc=new WeakMap,by=new WeakMap,Zp=new WeakMap,Sf=class{_createValuePromise(){Gp(this,by,new Promise((t,r)=>{Gp(this,Zp,{resolve:t,reject:r})}))}change(t){return new Promise((r,n)=>{let s=i(async o=>{try{let c=await t(o);r(),this._next(c)}catch(c){n(c),this._next(o)}},"run");Ds(this,rc).push({reject:n,run:s}),Ds(this,rc).length===1&&this._start()})}async changeContent(t){let r=i(async n=>(await n.update(t(n.content),n.metadata),n),"mutation");return await this.change(r)}async get(){return Ds(this,rc).length===0?await Ds(this,Wp).call(this):await Ds(this,by)}async _start(){try{let t=await Ds(this,Wp).call(this);this._next(t)}catch(t){Ds(this,rc).forEach(r=>{r.reject(t)}),Gp(this,rc,[]),Ds(this,Zp).reject(t),this._createValuePromise()}}_next(t){let r=Ds(this,rc).shift();r==null?this._end(t):r.run(t)}_end(t){Ds(this,Zp).resolve(t),this._createValuePromise()}constructor(t){Vp(this,Wp,{writable:!0,value:void 0}),Vp(this,rc,{writable:!0,value:[]}),Vp(this,by,{writable:!0,value:void 0}),Vp(this,Zp,{writable:!0,value:void 0}),Gp(this,Wp,t),this._createValuePromise()}};i(Sf,"TileProxy");var QL=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function eF(e){return QL.test(e)}i(eF,"isDIDstring");function tF(e){if(!eF(e))throw new Error(`Invalid DID: ${e}`)}i(tF,"assertDIDstring");function _y(e){return tF(e),{controllers:[e],family:"IDX"}}i(_y,"getIDXMetadata");function rF(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(rF,"_checkPrivateRedeclaration");function nF(e,t){return t.get?t.get.call(e):t.value}i(nF,"_classApplyDescriptorGet");function iF(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(iF,"_classApplyDescriptorSet");function q7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(q7,"_classExtractFieldDescriptor");function Ur(e,t){var r=q7(e,t,"get");return nF(e,r)}i(Ur,"_classPrivateFieldGet");function xf(e,t,r){rF(e,t),t.set(e,r)}i(xf,"_classPrivateFieldInit");function Jp(e,t,r){var n=q7(e,t,"set");return iF(e,n,r),r}i(Jp,"_classPrivateFieldSet");var la=new WeakMap,Yp=new WeakMap,wy=new WeakMap,ks=new WeakMap,Xp=new WeakMap,Tf=class{get authenticated(){return Ur(this,la).did!=null}get ceramic(){return Ur(this,la)}get id(){if(Ur(this,Yp)!=null)return Ur(this,Yp);if(Ur(this,la).did==null)throw new Error("Ceramic instance is not authenticated");return Ur(this,la).did.hasParent?Ur(this,la).did.parent:Ur(this,la).did.id}get loader(){return Ur(this,ks)}get model(){return Ur(this,Xp)}async has(t,r){let n=this.getDefinitionID(t);return await this.getRecordID(n,r)!=null}async get(t,r){let n=this.getDefinitionID(t);return await this.getRecord(n,r)}async getMultiple(t,r){let n=this.getDefinitionID(t),s=await Promise.all(r.map(async l=>{let{genesis:h,streamId:p}=await gy(_y(l));return{genesis:h,streamId:p.toString(),paths:[n]}})),o=await Ur(this,la).multiQuery(s),c=[];for(let l of s){let h=o[l.streamId]?.content?.[n],p=h?o[Yt.fromString(h).toString()]:null;c.push(p?.content??null)}return c}async set(t,r,n={}){let s=this.getDefinitionID(t),[o,c]=await this._setRecordOnly(s,r,n);return o&&await this._setReference(n.controller??this.id,s,c),c}async merge(t,r,n={}){let s=this.getDefinitionID(t),o=await this.getRecord(s),c=o?{...o,...r}:r;return await this.setRecord(s,c,n)}async setAll(t,r={}){let n=Object.entries(t).map(async([c,l])=>{let h=this.getDefinitionID(c),[p,v]=await this._setRecordOnly(h,l,r);return[p,h,v]}),o=(await Promise.all(n)).reduce((c,[l,h,p])=>(l&&(c[h]=p.toUrl()),c),{});return await this._setReferences(r.controller??this.id,o),o}async setDefaults(t,r={}){let n=await this.getIndex()??{},s=Object.entries(t).map(([l,h])=>[this.getDefinitionID(l),h]).filter(l=>n[l[0]]==null).map(async([l,h])=>{let p=await this.getDefinition(l),v=await this._createRecord(p,h,r);return{[l]:v.toUrl()}}),c=(await Promise.all(s)).reduce((l,h)=>Object.assign(l,h),{});return await this._setReferences(r.controller??this.id,c),c}async remove(t,r=this.id){await this._getIndexProxy(r).changeContent(n=>(n!=null&&delete n[this.getDefinitionID(t)],n))}async getIndex(t=this.id){let r=this.authenticated&&t===this.id?await this._getIndexProxy(t).get():await this._getIDXDoc(t);return r?r.content:null}iterator(t){let r,n=0;return{[Symbol.asyncIterator](){return this},next:async()=>{if(r==null){let l=await this.getIndex(t);r=Object.entries(l??{})}if(n===r.length)return{done:!0,value:null};let[s,o]=r[n++],c=await Ur(this,ks).load(o);return{done:!1,value:{key:s,id:o,record:c.content}}}}}async _createIDXDoc(t){return await Ur(this,ks).deterministic(_y(t))}async _getIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)return null;if(r.metadata.schema!==hp)throw new Error("Invalid document: schema is not IdentityIndex");return r}async _getOwnIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)await r.update({},{schema:hp});else if(r.metadata.schema!==hp)throw new Error("Invalid document: schema is not IdentityIndex");return r}_getIndexProxy(t){let r=Ur(this,wy)[t];return r==null&&(r=new Sf(async()=>await this._getOwnIDXDoc(t)),Ur(this,wy)[t]=r),r}getDefinitionID(t){return Ur(this,Xp).getDefinitionID(t)??t}async getDefinition(t){let r=await Ur(this,ks).load(t);if(r.metadata.schema!==P9)throw new Error("Invalid document: schema is not Definition");return{...r.content,id:r.id}}async getRecordID(t,r){return(await this.getIndex(r??this.id))?.[t]??null}async getRecordDocument(t,r){let n=await this.getRecordID(t,r);return n?await Ur(this,ks).load(n):null}async getRecord(t,r){let n=await this.getRecordDocument(t,r);return n?n.content:null}async setRecord(t,r,n={}){let[s,o]=await this._setRecordOnly(t,r,n);return s&&await this._setReference(n.controller??this.id,t,o),o}async _setRecordOnly(t,r,n){let s=await this.getRecordID(t,n.controller??this.id);if(s==null){let o=await this.getDefinition(t),c=await this._createRecord(o,r,n);return[!0,c]}else{let o=await Ur(this,ks).update(s,r);return[!1,o.id]}}async _createRecord(t,r,{controller:n,pin:s}){let o=await Ur(this,ks).deterministic({controllers:[n??this.id],family:t.id.toString()},{pin:s});return await o.update(r,{schema:t.schema}),o.id}async _setReference(t,r,n){await this._getIndexProxy(t).changeContent(s=>({...s,[r]:n.toUrl()}))}async _setReferences(t,r){Object.keys(r).length!==0&&await this._getIndexProxy(t).changeContent(n=>({...n,...r}))}constructor(t){xf(this,la,{writable:!0,value:void 0}),xf(this,Yp,{writable:!0,value:void 0}),xf(this,wy,{writable:!0,value:{}}),xf(this,ks,{writable:!0,value:void 0}),xf(this,Xp,{writable:!0,value:void 0});let{cache:r,ceramic:n,id:s,loader:o,model:c}=t;Jp(this,la,n),Jp(this,Yp,s),Jp(this,ks,o??new ec({ceramic:n,cache:r})),Jp(this,Xp,c instanceof Au?c:new Au({loader:Ur(this,ks),aliases:c}))}};i(Tf,"DIDDataStore");var dr;(function(e){e.assertEqual=s=>s;function t(s){}i(t,"assertIs"),e.assertIs=t;function r(s){throw new Error}i(r,"assertNever"),e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let c of s)o[c]=c;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),c={};for(let l of o)c[l]=s[l];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let c in s)Object.prototype.hasOwnProperty.call(s,c)&&o.push(c);return o},e.find=(s,o)=>{for(let c of s)if(o(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}i(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(dr||(dr={}));var et=dr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ka=i(e=>{switch(typeof e){case"undefined":return et.undefined;case"string":return et.string;case"number":return isNaN(e)?et.nan:et.number;case"boolean":return et.boolean;case"function":return et.function;case"bigint":return et.bigint;case"symbol":return et.symbol;case"object":return Array.isArray(e)?et.array:e===null?et.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?et.promise:typeof Map<"u"&&e instanceof Map?et.map:typeof Set<"u"&&e instanceof Set?et.set:typeof Date<"u"&&e instanceof Date?et.date:et.object;default:return et.unknown}},"getParsedType"),Ke=dr.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"]),sF=i(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Bi=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let r=t||function(o){return o.message},n={_errors:[]},s=i(o=>{for(let c of o.issues)if(c.code==="invalid_union")c.unionErrors.map(s);else if(c.code==="invalid_return_type")s(c.returnTypeError);else if(c.code==="invalid_arguments")s(c.argumentsError);else if(c.path.length===0)n._errors.push(r(c));else{let l=n,h=0;for(;h<c.path.length;){let p=c.path[h];h===c.path.length-1?(l[p]=l[p]||{_errors:[]},l[p]._errors.push(r(c))):l[p]=l[p]||{_errors:[]},l=l[p],h++}}},"processError");return s(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,dr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let s of this.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};i(Bi,"ZodError");Bi.create=e=>new Bi(e);var Cf=i((e,t)=>{let r;switch(e.code){case Ke.invalid_type:e.received===et.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,dr.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${dr.joinValues(e.keys,", ")}`;break;case Ke.invalid_union:r="Invalid input";break;case Ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${dr.joinValues(e.options)}`;break;case Ke.invalid_enum_value:r=`Invalid enum value. Expected ${dr.joinValues(e.options)}, received '${e.received}'`;break;case Ke.invalid_arguments:r="Invalid function arguments";break;case Ke.invalid_return_type:r="Invalid function return type";break;case Ke.invalid_date:r="Invalid date";break;case Ke.invalid_string:typeof e.validation=="object"?"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:dr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ke.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:r="Invalid input";break;case Ke.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:r="Invalid input";break;case Ke.custom:r="Invalid input";break;case Ke.invalid_intersection_types:r="Intersection results could not be merged";break;case Ke.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ke.not_finite:r="Number must be finite";break;default:r=t.defaultError,dr.assertNever(e)}return{message:r}},"errorMap"),G7=Cf;function aF(e){G7=e}i(aF,"setErrorMap");function e0(){return G7}i(e0,"getErrorMap");var t0=i(e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],c={...s,path:o},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...s,path:o,message:s.message||l}},"makeIssue"),oF=[];function gt(e,t){let r=t0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,e0(),Cf].filter(n=>!!n)});e.common.issues.push(r)}i(gt,"addIssueToContext");var Xr=class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let s of r){if(s.status==="aborted")return Dt;s.status==="dirty"&&t.dirty(),n.push(s.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let s of r)n.push({key:await s.key,value:await s.value});return Xr.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let s of r){let{key:o,value:c}=s;if(o.status==="aborted"||c.status==="aborted")return Dt;o.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),(typeof c.value<"u"||s.alwaysSet)&&(n[o.value]=c.value)}return{status:t.value,value:n}}};i(Xr,"ParseStatus");var Dt=Object.freeze({status:"aborted"}),W7=i(e=>({status:"dirty",value:e}),"DIRTY"),En=i(e=>({status:"valid",value:e}),"OK"),Ey=i(e=>e.status==="aborted","isAborted"),Ay=i(e=>e.status==="dirty","isDirty"),r0=i(e=>e.status==="valid","isValid"),n0=i(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync"),Gt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Gt||(Gt={}));var di=class{constructor(t,r,n,s){this.parent=t,this.data=r,this._path=n,this._key=s}get path(){return this._path.concat(this._key)}};i(di,"ParseInputLazyPath");var K7=i((e,t)=>{if(r0(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Bi(e.common.issues);return{success:!1,error:r}}},"handleResult");function Ut(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:i((c,l)=>c.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:n??l.defaultError}:{message:r??l.defaultError},"customMap"),description:s}}i(Ut,"processCreateParams");var Pt=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Ka(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Ka(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Xr,ctx:{common:t.parent.common,data:t.data,parsedType:Ka(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(n0(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){var n;let s={common:{issues:[],async:(n=r?.async)!==null&&n!==void 0?n:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ka(t)},o=this._parseSync({data:t,path:s.path,parent:s});return K7(s,o)}async parseAsync(t,r){let n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Ka(t)},s=this._parse({data:t,path:n.path,parent:n}),o=await(n0(s)?s:Promise.resolve(s));return K7(n,o)}refine(t,r){let n=i(s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r,"getIssueProperties");return this._refinement((s,o)=>{let c=t(s),l=i(()=>o.addIssue({code:Ke.custom,...n(s)}),"setError");return typeof Promise<"u"&&c instanceof Promise?c.then(h=>h?!0:(l(),!1)):c?!0:(l(),!1)})}refinement(t,r){return this._refinement((n,s)=>t(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(t){return new Vn({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Ui.create(this,this._def)}nullable(){return Ps.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Kn.create(this,this._def)}promise(){return ha.create(this,this._def)}or(t){return Ja.create([this,t],this._def)}and(t){return Ya.create(this,t,this._def)}transform(t){return new Vn({...Ut(this._def),schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new ro({...Ut(this._def),innerType:this,defaultValue:r,typeName:xt.ZodDefault})}brand(){return new Mf({typeName:xt.ZodBranded,type:this,...Ut(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new oc({...Ut(this._def),innerType:this,catchValue:r,typeName:xt.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return no.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};i(Pt,"ZodType");var cF=/^c[^\s-]{8,}$/i,uF=/^[a-z][a-z0-9]*$/,lF=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,fF=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,dF=i(e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Li=class extends Pt{constructor(){super(...arguments),this._regex=(t,r,n)=>this.refinement(s=>t.test(s),{validation:r,code:Ke.invalid_string,...Gt.errToObj(n)}),this.nonempty=t=>this.min(1,Gt.errToObj(t)),this.trim=()=>new Li({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==et.string){let o=this._getOrReturnCtx(t);return gt(o,{code:Ke.invalid_type,expected:et.string,received:o.parsedType}),Dt}let n=new Xr,s;for(let o of this._def.checks)if(o.kind==="min")t.data.length<o.value&&(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")t.data.length>o.value&&(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let c=t.data.length>o.value,l=t.data.length<o.value;(c||l)&&(s=this._getOrReturnCtx(t,s),c?gt(s,{code:Ke.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):l&>(s,{code:Ke.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")fF.test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{validation:"email",code:Ke.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")lF.test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{validation:"uuid",code:Ke.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")cF.test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{validation:"cuid",code:Ke.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")uF.test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{validation:"cuid2",code:Ke.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),gt(s,{validation:"url",code:Ke.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{validation:"regex",code:Ke.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?t.data=t.data.trim():o.kind==="startsWith"?t.data.startsWith(o.value)||(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?t.data.endsWith(o.value)||(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?dF(o).test(t.data)||(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.invalid_string,validation:"datetime",message:o.message}),n.dirty()):dr.assertNever(o);return{status:n.value,value:t.data}}_addCheck(t){return new Li({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Gt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Gt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Gt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Gt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Gt.errToObj(t)})}datetime(t){var r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(r=t?.offset)!==null&&r!==void 0?r:!1,...Gt.errToObj(t?.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Gt.errToObj(r)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Gt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Gt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Gt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Gt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Gt.errToObj(r)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};i(Li,"ZodString");Li.create=e=>{var t;return new Li({checks:[],typeName:xt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};function hF(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),c=parseInt(t.toFixed(s).replace(".",""));return o%c/Math.pow(10,s)}i(hF,"floatSafeRemainder");var rs=class extends Pt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==et.number){let o=this._getOrReturnCtx(t);return gt(o,{code:Ke.invalid_type,expected:et.number,received:o.parsedType}),Dt}let n,s=new Xr;for(let o of this._def.checks)o.kind==="int"?dr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),gt(n,{code:Ke.invalid_type,expected:"integer",received:"float",message:o.message}),s.dirty()):o.kind==="min"?(o.inclusive?t.data<o.value:t.data<=o.value)&&(n=this._getOrReturnCtx(t,n),gt(n,{code:Ke.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="max"?(o.inclusive?t.data>o.value:t.data>=o.value)&&(n=this._getOrReturnCtx(t,n),gt(n,{code:Ke.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),s.dirty()):o.kind==="multipleOf"?hF(t.data,o.value)!==0&&(n=this._getOrReturnCtx(t,n),gt(n,{code:Ke.not_multiple_of,multipleOf:o.value,message:o.message}),s.dirty()):o.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),gt(n,{code:Ke.not_finite,message:o.message}),s.dirty()):dr.assertNever(o);return{status:s.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Gt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Gt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Gt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Gt.toString(r))}setLimit(t,r,n,s){return new rs({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Gt.toString(s)}]})}_addCheck(t){return new rs({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Gt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Gt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Gt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Gt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Gt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Gt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Gt.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&dr.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};i(rs,"ZodNumber");rs.create=e=>new rs({checks:[],typeName:xt.ZodNumber,coerce:e?.coerce||!1,...Ut(e)});var Va=class extends Pt{_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==et.bigint){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.bigint,received:n.parsedType}),Dt}return En(t.data)}};i(Va,"ZodBigInt");Va.create=e=>{var t;return new Va({typeName:xt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Ut(e)})};var Ga=class extends Pt{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==et.boolean){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.boolean,received:n.parsedType}),Dt}return En(t.data)}};i(Ga,"ZodBoolean");Ga.create=e=>new Ga({typeName:xt.ZodBoolean,coerce:e?.coerce||!1,...Ut(e)});var Os=class extends Pt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==et.date){let o=this._getOrReturnCtx(t);return gt(o,{code:Ke.invalid_type,expected:et.date,received:o.parsedType}),Dt}if(isNaN(t.data.getTime())){let o=this._getOrReturnCtx(t);return gt(o,{code:Ke.invalid_date}),Dt}let n=new Xr,s;for(let o of this._def.checks)o.kind==="min"?t.data.getTime()<o.value&&(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?t.data.getTime()>o.value&&(s=this._getOrReturnCtx(t,s),gt(s,{code:Ke.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):dr.assertNever(o);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Os({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Gt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Gt.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};i(Os,"ZodDate");Os.create=e=>new Os({checks:[],coerce:e?.coerce||!1,typeName:xt.ZodDate,...Ut(e)});var nc=class extends Pt{_parse(t){if(this._getType(t)!==et.symbol){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.symbol,received:n.parsedType}),Dt}return En(t.data)}};i(nc,"ZodSymbol");nc.create=e=>new nc({typeName:xt.ZodSymbol,...Ut(e)});var Wa=class extends Pt{_parse(t){if(this._getType(t)!==et.undefined){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.undefined,received:n.parsedType}),Dt}return En(t.data)}};i(Wa,"ZodUndefined");Wa.create=e=>new Wa({typeName:xt.ZodUndefined,...Ut(e)});var Za=class extends Pt{_parse(t){if(this._getType(t)!==et.null){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.null,received:n.parsedType}),Dt}return En(t.data)}};i(Za,"ZodNull");Za.create=e=>new Za({typeName:xt.ZodNull,...Ut(e)});var fa=class extends Pt{constructor(){super(...arguments),this._any=!0}_parse(t){return En(t.data)}};i(fa,"ZodAny");fa.create=e=>new fa({typeName:xt.ZodAny,...Ut(e)});var Rs=class extends Pt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return En(t.data)}};i(Rs,"ZodUnknown");Rs.create=e=>new Rs({typeName:xt.ZodUnknown,...Ut(e)});var Fi=class extends Pt{_parse(t){let r=this._getOrReturnCtx(t);return gt(r,{code:Ke.invalid_type,expected:et.never,received:r.parsedType}),Dt}};i(Fi,"ZodNever");Fi.create=e=>new Fi({typeName:xt.ZodNever,...Ut(e)});var ic=class extends Pt{_parse(t){if(this._getType(t)!==et.undefined){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.void,received:n.parsedType}),Dt}return En(t.data)}};i(ic,"ZodVoid");ic.create=e=>new ic({typeName:xt.ZodVoid,...Ut(e)});var Kn=class extends Pt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),s=this._def;if(r.parsedType!==et.array)return gt(r,{code:Ke.invalid_type,expected:et.array,received:r.parsedType}),Dt;if(s.exactLength!==null){let c=r.data.length>s.exactLength.value,l=r.data.length<s.exactLength.value;(c||l)&&(gt(r,{code:c?Ke.too_big:Ke.too_small,minimum:l?s.exactLength.value:void 0,maximum:c?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(gt(r,{code:Ke.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(gt(r,{code:Ke.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((c,l)=>s.type._parseAsync(new di(r,c,r.path,l)))).then(c=>Xr.mergeArray(n,c));let o=[...r.data].map((c,l)=>s.type._parseSync(new di(r,c,r.path,l)));return Xr.mergeArray(n,o)}get element(){return this._def.type}min(t,r){return new Kn({...this._def,minLength:{value:t,message:Gt.toString(r)}})}max(t,r){return new Kn({...this._def,maxLength:{value:t,message:Gt.toString(r)}})}length(t,r){return new Kn({...this._def,exactLength:{value:t,message:Gt.toString(r)}})}nonempty(t){return this.min(1,t)}};i(Kn,"ZodArray");Kn.create=(e,t)=>new Kn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...Ut(t)});var i0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(i0||(i0={}));function Su(e){if(e instanceof Sr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Ui.create(Su(n))}return new Sr({...e._def,shape:()=>t})}else return e instanceof Kn?Kn.create(Su(e.element)):e instanceof Ui?Ui.create(Su(e.unwrap())):e instanceof Ps?Ps.create(Su(e.unwrap())):e instanceof hi?hi.create(e.items.map(t=>Su(t))):e}i(Su,"deepPartialify");var Sr=class extends Pt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=dr.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==et.object){let p=this._getOrReturnCtx(t);return gt(p,{code:Ke.invalid_type,expected:et.object,received:p.parsedType}),Dt}let{status:n,ctx:s}=this._processInputParams(t),{shape:o,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof Fi&&this._def.unknownKeys==="strip"))for(let p in s.data)c.includes(p)||l.push(p);let h=[];for(let p of c){let v=o[p],b=s.data[p];h.push({key:{status:"valid",value:p},value:v._parse(new di(s,b,s.path,p)),alwaysSet:p in s.data})}if(this._def.catchall instanceof Fi){let p=this._def.unknownKeys;if(p==="passthrough")for(let v of l)h.push({key:{status:"valid",value:v},value:{status:"valid",value:s.data[v]}});else if(p==="strict")l.length>0&&(gt(s,{code:Ke.unrecognized_keys,keys:l}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let v of l){let b=s.data[v];h.push({key:{status:"valid",value:v},value:p._parse(new di(s,b,s.path,v)),alwaysSet:v in s.data})}}return s.common.async?Promise.resolve().then(async()=>{let p=[];for(let v of h){let b=await v.key;p.push({key:b,value:await v.value,alwaysSet:v.alwaysSet})}return p}).then(p=>Xr.mergeObjectSync(n,p)):Xr.mergeObjectSync(n,h)}get shape(){return this._def.shape()}strict(t){return Gt.errToObj,new Sr({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var s,o,c,l;let h=(c=(o=(s=this._def).errorMap)===null||o===void 0?void 0:o.call(s,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Gt.errToObj(t).message)!==null&&l!==void 0?l:h}:{message:h}}}:{}})}strip(){return new Sr({...this._def,unknownKeys:"strip"})}passthrough(){return new Sr({...this._def,unknownKeys:"passthrough"})}extend(t){return new Sr({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Sr({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>i0.mergeShapes(this._def.shape(),t._def.shape()),typeName:xt.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Sr({...this._def,catchall:t})}pick(t){let r={};return dr.objectKeys(t).forEach(n=>{t[n]&&this.shape[n]&&(r[n]=this.shape[n])}),new Sr({...this._def,shape:()=>r})}omit(t){let r={};return dr.objectKeys(this.shape).forEach(n=>{t[n]||(r[n]=this.shape[n])}),new Sr({...this._def,shape:()=>r})}deepPartial(){return Su(this)}partial(t){let r={};return dr.objectKeys(this.shape).forEach(n=>{let s=this.shape[n];t&&!t[n]?r[n]=s:r[n]=s.optional()}),new Sr({...this._def,shape:()=>r})}required(t){let r={};return dr.objectKeys(this.shape).forEach(n=>{if(t&&!t[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof Ui;)o=o._def.innerType;r[n]=o}}),new Sr({...this._def,shape:()=>r})}keyof(){return Z7(dr.objectKeys(this.shape))}};i(Sr,"ZodObject");Sr.create=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strip",catchall:Fi.create(),typeName:xt.ZodObject,...Ut(t)});Sr.strictCreate=(e,t)=>new Sr({shape:()=>e,unknownKeys:"strict",catchall:Fi.create(),typeName:xt.ZodObject,...Ut(t)});Sr.lazycreate=(e,t)=>new Sr({shape:e,unknownKeys:"strip",catchall:Fi.create(),typeName:xt.ZodObject,...Ut(t)});var Ja=class extends Pt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function s(o){for(let l of o)if(l.result.status==="valid")return l.result;for(let l of o)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=o.map(l=>new Bi(l.ctx.common.issues));return gt(r,{code:Ke.invalid_union,unionErrors:c}),Dt}if(i(s,"handleResults"),r.common.async)return Promise.all(n.map(async o=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(s);{let o,c=[];for(let h of n){let p={...r,common:{...r.common,issues:[]},parent:null},v=h._parseSync({data:r.data,path:r.path,parent:p});if(v.status==="valid")return v;v.status==="dirty"&&!o&&(o={result:v,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let l=c.map(h=>new Bi(h));return gt(r,{code:Ke.invalid_union,unionErrors:l}),Dt}}get options(){return this._def.options}};i(Ja,"ZodUnion");Ja.create=(e,t)=>new Ja({options:e,typeName:xt.ZodUnion,...Ut(t)});var Qp=i(e=>e instanceof Qa?Qp(e.schema):e instanceof Vn?Qp(e.innerType()):e instanceof eo?[e.value]:e instanceof ns?e.options:e instanceof to?Object.keys(e.enum):e instanceof ro?Qp(e._def.innerType):e instanceof Wa?[void 0]:e instanceof Za?[null]:null,"getDiscriminator"),sc=class extends Pt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==et.object)return gt(r,{code:Ke.invalid_type,expected:et.object,received:r.parsedType}),Dt;let n=this.discriminator,s=r.data[n],o=this.optionsMap.get(s);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(gt(r,{code:Ke.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Dt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let s=new Map;for(let o of r){let c=Qp(o.shape[t]);if(!c)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let l of c){if(s.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);s.set(l,o)}}return new sc({typeName:xt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:s,...Ut(n)})}};i(sc,"ZodDiscriminatedUnion");function Sy(e,t){let r=Ka(e),n=Ka(t);if(e===t)return{valid:!0,data:e};if(r===et.object&&n===et.object){let s=dr.objectKeys(t),o=dr.objectKeys(e).filter(l=>s.indexOf(l)!==-1),c={...e,...t};for(let l of o){let h=Sy(e[l],t[l]);if(!h.valid)return{valid:!1};c[l]=h.data}return{valid:!0,data:c}}else if(r===et.array&&n===et.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let c=e[o],l=t[o],h=Sy(c,l);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return r===et.date&&n===et.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Sy,"mergeValues");var Ya=class extends Pt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=i((o,c)=>{if(Ey(o)||Ey(c))return Dt;let l=Sy(o.value,c.value);return l.valid?((Ay(o)||Ay(c))&&r.dirty(),{status:r.value,value:l.data}):(gt(n,{code:Ke.invalid_intersection_types}),Dt)},"handleParsed");return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,c])=>s(o,c)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};i(Ya,"ZodIntersection");Ya.create=(e,t,r)=>new Ya({left:e,right:t,typeName:xt.ZodIntersection,...Ut(r)});var hi=class extends Pt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==et.array)return gt(n,{code:Ke.invalid_type,expected:et.array,received:n.parsedType}),Dt;if(n.data.length<this._def.items.length)return gt(n,{code:Ke.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Dt;!this._def.rest&&n.data.length>this._def.items.length&&(gt(n,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((c,l)=>{let h=this._def.items[l]||this._def.rest;return h?h._parse(new di(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(o).then(c=>Xr.mergeArray(r,c)):Xr.mergeArray(r,o)}get items(){return this._def.items}rest(t){return new hi({...this._def,rest:t})}};i(hi,"ZodTuple");hi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hi({items:e,typeName:xt.ZodTuple,rest:null,...Ut(t)})};var Xa=class extends Pt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==et.object)return gt(n,{code:Ke.invalid_type,expected:et.object,received:n.parsedType}),Dt;let s=[],o=this._def.keyType,c=this._def.valueType;for(let l in n.data)s.push({key:o._parse(new di(n,l,n.path,l)),value:c._parse(new di(n,n.data[l],n.path,l))});return n.common.async?Xr.mergeObjectAsync(r,s):Xr.mergeObjectSync(r,s)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Pt?new Xa({keyType:t,valueType:r,typeName:xt.ZodRecord,...Ut(n)}):new Xa({keyType:Li.create(),valueType:t,typeName:xt.ZodRecord,...Ut(r)})}};i(Xa,"ZodRecord");var ac=class extends Pt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==et.map)return gt(n,{code:Ke.invalid_type,expected:et.map,received:n.parsedType}),Dt;let s=this._def.keyType,o=this._def.valueType,c=[...n.data.entries()].map(([l,h],p)=>({key:s._parse(new di(n,l,n.path,[p,"key"])),value:o._parse(new di(n,h,n.path,[p,"value"]))}));if(n.common.async){let l=new Map;return Promise.resolve().then(async()=>{for(let h of c){let p=await h.key,v=await h.value;if(p.status==="aborted"||v.status==="aborted")return Dt;(p.status==="dirty"||v.status==="dirty")&&r.dirty(),l.set(p.value,v.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let h of c){let p=h.key,v=h.value;if(p.status==="aborted"||v.status==="aborted")return Dt;(p.status==="dirty"||v.status==="dirty")&&r.dirty(),l.set(p.value,v.value)}return{status:r.value,value:l}}}};i(ac,"ZodMap");ac.create=(e,t,r)=>new ac({valueType:t,keyType:e,typeName:xt.ZodMap,...Ut(r)});var Ns=class extends Pt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==et.set)return gt(n,{code:Ke.invalid_type,expected:et.set,received:n.parsedType}),Dt;let s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(gt(n,{code:Ke.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(gt(n,{code:Ke.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());let o=this._def.valueType;function c(h){let p=new Set;for(let v of h){if(v.status==="aborted")return Dt;v.status==="dirty"&&r.dirty(),p.add(v.value)}return{status:r.value,value:p}}i(c,"finalizeSet");let l=[...n.data.values()].map((h,p)=>o._parse(new di(n,h,n.path,p)));return n.common.async?Promise.all(l).then(h=>c(h)):c(l)}min(t,r){return new Ns({...this._def,minSize:{value:t,message:Gt.toString(r)}})}max(t,r){return new Ns({...this._def,maxSize:{value:t,message:Gt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};i(Ns,"ZodSet");Ns.create=(e,t)=>new Ns({valueType:e,minSize:null,maxSize:null,typeName:xt.ZodSet,...Ut(t)});var da=class extends Pt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==et.function)return gt(r,{code:Ke.invalid_type,expected:et.function,received:r.parsedType}),Dt;function n(l,h){return t0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e0(),Cf].filter(p=>!!p),issueData:{code:Ke.invalid_arguments,argumentsError:h}})}i(n,"makeArgsIssue");function s(l,h){return t0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,e0(),Cf].filter(p=>!!p),issueData:{code:Ke.invalid_return_type,returnTypeError:h}})}i(s,"makeReturnsIssue");let o={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof ha?En(async(...l)=>{let h=new Bi([]),p=await this._def.args.parseAsync(l,o).catch(y=>{throw h.addIssue(n(l,y)),h}),v=await c(...p);return await this._def.returns._def.type.parseAsync(v,o).catch(y=>{throw h.addIssue(s(v,y)),h})}):En((...l)=>{let h=this._def.args.safeParse(l,o);if(!h.success)throw new Bi([n(l,h.error)]);let p=c(...h.data),v=this._def.returns.safeParse(p,o);if(!v.success)throw new Bi([s(p,v.error)]);return v.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new da({...this._def,args:hi.create(t).rest(Rs.create())})}returns(t){return new da({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new da({args:t||hi.create([]).rest(Rs.create()),returns:r||Rs.create(),typeName:xt.ZodFunction,...Ut(n)})}};i(da,"ZodFunction");var Qa=class extends Pt{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};i(Qa,"ZodLazy");Qa.create=(e,t)=>new Qa({getter:e,typeName:xt.ZodLazy,...Ut(t)});var eo=class extends Pt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return gt(r,{received:r.data,code:Ke.invalid_literal,expected:this._def.value}),Dt}return{status:"valid",value:t.data}}get value(){return this._def.value}};i(eo,"ZodLiteral");eo.create=(e,t)=>new eo({value:e,typeName:xt.ZodLiteral,...Ut(t)});function Z7(e,t){return new ns({values:e,typeName:xt.ZodEnum,...Ut(t)})}i(Z7,"createZodEnum");var ns=class extends Pt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return gt(r,{expected:dr.joinValues(n),received:r.parsedType,code:Ke.invalid_type}),Dt}if(this._def.values.indexOf(t.data)===-1){let r=this._getOrReturnCtx(t),n=this._def.values;return gt(r,{received:r.data,code:Ke.invalid_enum_value,options:n}),Dt}return En(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t){return ns.create(t)}exclude(t){return ns.create(this.options.filter(r=>!t.includes(r)))}};i(ns,"ZodEnum");ns.create=Z7;var to=class extends Pt{_parse(t){let r=dr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==et.string&&n.parsedType!==et.number){let s=dr.objectValues(r);return gt(n,{expected:dr.joinValues(s),received:n.parsedType,code:Ke.invalid_type}),Dt}if(r.indexOf(t.data)===-1){let s=dr.objectValues(r);return gt(n,{received:n.data,code:Ke.invalid_enum_value,options:s}),Dt}return En(t.data)}get enum(){return this._def.values}};i(to,"ZodNativeEnum");to.create=(e,t)=>new to({values:e,typeName:xt.ZodNativeEnum,...Ut(t)});var ha=class extends Pt{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==et.promise&&r.common.async===!1)return gt(r,{code:Ke.invalid_type,expected:et.promise,received:r.parsedType}),Dt;let n=r.parsedType===et.promise?r.data:Promise.resolve(r.data);return En(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}};i(ha,"ZodPromise");ha.create=(e,t)=>new ha({type:e,typeName:xt.ZodPromise,...Ut(t)});var Vn=class extends Pt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:r,ctx:n}=this._processInputParams(t),s=this._def.effect||null;if(s.type==="preprocess"){let c=s.transform(n.data);return n.common.async?Promise.resolve(c).then(l=>this._def.schema._parseAsync({data:l,path:n.path,parent:n})):this._def.schema._parseSync({data:c,path:n.path,parent:n})}let o={addIssue:c=>{gt(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),s.type==="refinement"){let c=i(l=>{let h=s.refinement(l,o);if(n.common.async)return Promise.resolve(h);if(h instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return l},"executeRefinement");if(n.common.async===!1){let l=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return l.status==="aborted"?Dt:(l.status==="dirty"&&r.dirty(),c(l.value),{status:r.value,value:l.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(l=>l.status==="aborted"?Dt:(l.status==="dirty"&&r.dirty(),c(l.value).then(()=>({status:r.value,value:l.value}))))}if(s.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!r0(c))return c;let l=s.transform(c.value,o);if(l instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:l}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(c=>r0(c)?Promise.resolve(s.transform(c.value,o)).then(l=>({status:r.value,value:l})):c);dr.assertNever(s)}};i(Vn,"ZodEffects");Vn.create=(e,t,r)=>new Vn({schema:e,typeName:xt.ZodEffects,effect:t,...Ut(r)});Vn.createWithPreprocess=(e,t,r)=>new Vn({schema:t,effect:{type:"preprocess",transform:e},typeName:xt.ZodEffects,...Ut(r)});var Ui=class extends Pt{_parse(t){return this._getType(t)===et.undefined?En(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(Ui,"ZodOptional");Ui.create=(e,t)=>new Ui({innerType:e,typeName:xt.ZodOptional,...Ut(t)});var Ps=class extends Pt{_parse(t){return this._getType(t)===et.null?En(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(Ps,"ZodNullable");Ps.create=(e,t)=>new Ps({innerType:e,typeName:xt.ZodNullable,...Ut(t)});var ro=class extends Pt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===et.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i(ro,"ZodDefault");ro.create=(e,t)=>new ro({innerType:e,typeName:xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Ut(t)});var oc=class extends Pt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r,common:{...r.common,issues:[]}}});return n0(n)?n.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}};i(oc,"ZodCatch");oc.create=(e,t)=>new oc({innerType:e,typeName:xt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Ut(t)});var cc=class extends Pt{_parse(t){if(this._getType(t)!==et.nan){let n=this._getOrReturnCtx(t);return gt(n,{code:Ke.invalid_type,expected:et.nan,received:n.parsedType}),Dt}return{status:"valid",value:t.data}}};i(cc,"ZodNaN");cc.create=e=>new cc({typeName:xt.ZodNaN,...Ut(e)});var pF=Symbol("zod_brand"),Mf=class extends Pt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}};i(Mf,"ZodBranded");var no=class extends Pt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return i(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Dt:o.status==="dirty"?(r.dirty(),W7(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})},"handleAsync")();{let s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Dt:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(t,r){return new no({in:t,out:r,typeName:xt.ZodPipeline})}};i(no,"ZodPipeline");var J7=i((e,t={},r)=>e?fa.create().superRefine((n,s)=>{if(!e(n)){let o=typeof t=="function"?t(n):t,c=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...c,fatal:r})}}):fa.create(),"custom"),mF={object:Sr.lazycreate},xt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(xt||(xt={}));var vF=i((e,t={message:`Input not instance of ${e.name}`})=>J7(r=>r instanceof e,t,!0),"instanceOfType"),Y7=Li.create,X7=rs.create,gF=cc.create,yF=Va.create,Q7=Ga.create,bF=Os.create,_F=nc.create,wF=Wa.create,EF=Za.create,AF=fa.create,SF=Rs.create,xF=Fi.create,TF=ic.create,MF=Kn.create,CF=Sr.create,IF=Sr.strictCreate,DF=Ja.create,kF=sc.create,OF=Ya.create,RF=hi.create,NF=Xa.create,PF=ac.create,BF=Ns.create,LF=da.create,FF=Qa.create,UF=eo.create,$F=ns.create,jF=to.create,zF=ha.create,V7=Vn.create,HF=Ui.create,qF=Ps.create,KF=Vn.createWithPreprocess,VF=no.create,GF=i(()=>Y7().optional(),"ostring"),WF=i(()=>X7().optional(),"onumber"),ZF=i(()=>Q7().optional(),"oboolean"),JF={string:e=>Li.create({...e,coerce:!0}),number:e=>rs.create({...e,coerce:!0}),boolean:e=>Ga.create({...e,coerce:!0}),bigint:e=>Va.create({...e,coerce:!0}),date:e=>Os.create({...e,coerce:!0})},YF=Dt,ne=Object.freeze({__proto__:null,defaultErrorMap:Cf,setErrorMap:aF,getErrorMap:e0,makeIssue:t0,EMPTY_PATH:oF,addIssueToContext:gt,ParseStatus:Xr,INVALID:Dt,DIRTY:W7,OK:En,isAborted:Ey,isDirty:Ay,isValid:r0,isAsync:n0,get util(){return dr},ZodParsedType:et,getParsedType:Ka,ZodType:Pt,ZodString:Li,ZodNumber:rs,ZodBigInt:Va,ZodBoolean:Ga,ZodDate:Os,ZodSymbol:nc,ZodUndefined:Wa,ZodNull:Za,ZodAny:fa,ZodUnknown:Rs,ZodNever:Fi,ZodVoid:ic,ZodArray:Kn,get objectUtil(){return i0},ZodObject:Sr,ZodUnion:Ja,ZodDiscriminatedUnion:sc,ZodIntersection:Ya,ZodTuple:hi,ZodRecord:Xa,ZodMap:ac,ZodSet:Ns,ZodFunction:da,ZodLazy:Qa,ZodLiteral:eo,ZodEnum:ns,ZodNativeEnum:to,ZodPromise:ha,ZodEffects:Vn,ZodTransformer:Vn,ZodOptional:Ui,ZodNullable:Ps,ZodDefault:ro,ZodCatch:oc,ZodNaN:cc,BRAND:pF,ZodBranded:Mf,ZodPipeline:no,custom:J7,Schema:Pt,ZodSchema:Pt,late:mF,get ZodFirstPartyTypeKind(){return xt},coerce:JF,any:AF,array:MF,bigint:yF,boolean:Q7,date:bF,discriminatedUnion:kF,effect:V7,enum:$F,function:LF,instanceof:vF,intersection:OF,lazy:FF,literal:UF,map:PF,nan:gF,nativeEnum:jF,never:xF,null:EF,nullable:qF,number:X7,object:CF,oboolean:ZF,onumber:WF,optional:HF,ostring:GF,pipeline:VF,preprocess:KF,promise:zF,record:NF,set:BF,strictObject:IF,string:Y7,symbol:_F,transformer:V7,tuple:RF,undefined:wF,union:DF,unknown:SF,void:TF,NEVER:YF,ZodIssueCode:Ke,quotelessJson:sF,ZodError:Bi});var tA=ne.array(ne.string().or(ne.record(ne.any()))),yJ=ne.object({type:ne.string().optional(),narrative:ne.string().optional()}),o0=ne.string().or(ne.object({id:ne.string(),type:ne.string(),caption:ne.string().optional()})),XF=ne.object({type:ne.string().min(1).or(ne.string().array().nonempty()),latitude:ne.number(),longitude:ne.number()}),QF=ne.object({type:ne.string().min(1).or(ne.string().array().nonempty()),addressCountry:ne.string().optional(),addressCountryCode:ne.string().optional(),addressRegion:ne.string().optional(),addressLocality:ne.string().optional(),streetAddress:ne.string().optional(),postOfficeBoxNumber:ne.string().optional(),postalCode:ne.string().optional(),geo:XF.optional()}),eU=ne.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(ne.string()),rA=ne.object({type:ne.string().min(1).or(ne.string().array().nonempty()),identifier:ne.string(),identifierType:eU}),If=ne.string().or(ne.object({id:ne.string().optional(),type:ne.string().or(ne.string().array().nonempty().optional()),name:ne.string().optional(),url:ne.string().optional(),phone:ne.string().optional(),description:ne.string().optional(),endorsement:ne.any().array().optional(),image:o0.optional(),email:ne.string().email().optional(),address:QF.optional(),otherIdentifier:rA.array().optional(),official:ne.string().optional(),parentOrg:ne.any().optional(),familyName:ne.string().optional(),givenName:ne.string().optional(),additionalName:ne.string().optional(),patronymicName:ne.string().optional(),honorificPrefix:ne.string().optional(),honorificSuffix:ne.string().optional(),familyNamePrefix:ne.string().optional(),dateOfBirth:ne.string().optional()}).catchall(ne.any())),xy=ne.object({id:ne.string().optional()}).catchall(ne.any()),tU=ne.object({type:ne.string(),id:ne.string()}),rU=ne.object({id:ne.string(),type:ne.string()}),nU=ne.object({id:ne.string(),type:ne.string()}).catchall(ne.any()),s0=ne.object({"@context":tA,id:ne.string().optional(),type:ne.string().array().nonempty(),issuer:If,issuanceDate:ne.string(),expirationDate:ne.string().optional(),credentialSubject:xy.or(xy.array()),credentialStatus:tU.optional(),credentialSchema:rU.array().optional(),refreshService:nU.optional()}).catchall(ne.any()),io=ne.object({type:ne.string(),created:ne.string(),challenge:ne.string().optional(),domain:ne.string().optional(),nonce:ne.string().optional(),proofPurpose:ne.string(),verificationMethod:ne.string(),jws:ne.string().optional()}).catchall(ne.any()),a0=s0.extend({proof:io.or(io.array())}),iU=ne.object({"@context":tA,id:ne.string().optional(),type:ne.string().array().nonempty(),verifiableCredential:a0.or(a0.array()).optional(),holder:ne.string().optional()}).catchall(ne.any()),bJ=iU.extend({proof:io.or(io.array())}),sU=ne.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(ne.string()),c0=ne.object({type:ne.string().array().nonempty(),targetCode:ne.string().optional(),targetDescription:ne.string().optional(),targetName:ne.string(),targetFramework:ne.string().optional(),targetType:sU.optional(),targetUrl:ne.string()}),aU=ne.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),oU=aU.or(ne.string()),cU=ne.object({id:ne.string().optional(),narrative:ne.string().optional()}).catchall(ne.any()),uU=ne.object({id:ne.string(),type:ne.string().array().nonempty(),endorsementComment:ne.string().optional()}),lU=s0.extend({credentialSubject:uU,proof:io.or(io.array()).optional()}),fU=ne.object({id:ne.string(),"@language":ne.string().optional(),version:ne.string().optional()}),dU=ne.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(ne.string()),hU=ne.object({id:ne.string(),type:ne.string().array().nonempty(),alignment:c0.array().optional(),description:ne.string().optional(),level:ne.string().optional(),name:ne.string(),points:ne.string().optional()}).catchall(ne.any()),pU=ne.object({id:ne.string(),type:ne.string().array().nonempty(),alignment:c0.array().optional(),allowedValue:ne.string().array().optional(),name:ne.string(),requiredLevel:ne.string().optional(),requiredValue:ne.string().optional(),resultType:dU,rubricCriterionLevel:hU.array().optional(),valueMax:ne.string().optional(),valueMin:ne.string().optional()}).catchall(ne.any()),mU=ne.object({id:ne.string().optional(),type:ne.string().array().nonempty(),alignment:c0.array().optional(),achievementType:oU.optional(),creator:If.optional(),creditsAvailable:ne.number().optional(),criteria:cU,description:ne.string(),endorsement:lU.array().optional(),fieldOfStudy:ne.string().optional(),humanCode:ne.string().optional(),image:o0.optional(),"@language":ne.string().optional(),name:ne.string(),otherIdentifier:rA.array().optional(),related:fU.array().optional(),resultDescription:pU.array().optional(),specialization:ne.string().optional(),tag:ne.string().array().optional(),version:ne.string().optional()}).catchall(ne.any()),vU=ne.object({type:ne.string(),hashed:ne.boolean(),identityHash:ne.string(),identityType:ne.string(),salt:ne.string().optional()}),gU=ne.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),yU=ne.object({type:ne.string().array().nonempty(),achievedLevel:ne.string().optional(),alignment:c0.array().optional(),resultDescription:ne.string().optional(),status:gU.optional(),value:ne.string().optional()}).catchall(ne.any()),eA=ne.object({id:ne.string().optional(),type:ne.string().array().nonempty(),activityEndDate:ne.string().optional(),activityStartDate:ne.string().optional(),creditsEarned:ne.number().optional(),achievement:mU.optional(),identifier:vU.array().optional(),image:o0.optional(),licenseNumber:ne.string().optional(),narrative:ne.string().optional(),result:yU.array().optional(),role:ne.string().optional(),source:If.optional(),term:ne.string().optional()}).catchall(ne.any()),bU=ne.object({id:ne.string().optional(),type:ne.string().array().nonempty(),narrative:ne.string().optional(),name:ne.string().optional(),description:ne.string().optional(),genre:ne.string().optional(),audience:ne.string().optional()}).catchall(ne.any()),_U=s0.extend({name:ne.string().optional(),description:ne.string().optional(),image:o0.optional(),credentialSubject:eA.or(eA.array()),endorsement:s0.array().optional(),evidence:bU.array().optional()}),wJ=_U.extend({proof:io.or(io.array())}),AJ=ne.object({checks:ne.string().array(),warnings:ne.string().array(),errors:ne.string().array()}),nA=ne.enum(["Success","Failed","Error"]),SJ=nA.enum,xJ=ne.object({check:ne.string(),status:nA,message:ne.string().optional(),details:ne.string().optional()}),TJ=ne.object({title:ne.string().optional(),createdAt:ne.string().optional(),issuer:If.optional(),issuee:If.optional(),credentialSubject:xy.optional()}),uc=ne.object({id:ne.string(),uri:ne.string()}).catchall(ne.any()),IJ=ne.object({limit:ne.number(),cursor:ne.string().optional()}),wU=ne.object({cursor:ne.string().optional(),hasMore:ne.boolean()}),EU=ne.object({kty:ne.string(),crv:ne.string(),x:ne.string(),y:ne.string().optional(),n:ne.string().optional(),d:ne.string()}),AU=ne.object({alg:ne.string(),iv:ne.string(),tag:ne.string(),epk:EU.partial().optional(),kid:ne.string().optional(),apv:ne.string().optional(),apu:ne.string().optional()}),SU=ne.object({header:AU,encrypted_key:ne.string()}),xU=ne.object({protected:ne.string(),iv:ne.string(),ciphertext:ne.string(),tag:ne.string(),aad:ne.string().optional(),recipients:SU.array().optional()}),TU=ne.object({encryptedRecord:xU,fields:ne.string().array(),id:ne.string()}).catchall(ne.any()),kJ=wU.extend({records:TU.array()}),Ty=ne.object({profileId:ne.string().min(3).max(40),displayName:ne.string().default(""),did:ne.string(),email:ne.string().optional(),image:ne.string().optional(),isServiceProfile:ne.boolean().default(!1).optional(),notificationsWebhook:ne.string().url().startsWith("https://").optional()}),RJ=ne.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),NJ=ne.object({uri:ne.string(),to:ne.string(),from:ne.string(),sent:ne.string().datetime(),received:ne.string().datetime().optional()}),MU=ne.enum(["DRAFT","LIVE"]),PJ=ne.object({uri:ne.string(),name:ne.string().optional(),type:ne.string().optional(),category:ne.string().optional(),status:MU.optional()}),BJ=ne.object({to:Ty,from:ne.string(),received:ne.string()}),CU=ne.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),IU=ne.object({title:ne.string().optional(),body:ne.string().optional()}),DU=ne.object({vcUris:ne.array(ne.string()).optional(),vpUris:ne.array(ne.string()).optional()}),LJ=ne.object({type:CU,to:Ty.partial().and(ne.object({did:ne.string()})),from:Ty.partial().and(ne.object({did:ne.string()})),message:IU.optional(),data:DU.optional(),sent:ne.string().datetime().optional()}),FJ=ne.object({endpoint:ne.string(),name:ne.string(),did:ne.string().optional()}),UJ=ne.object({ttlSeconds:ne.number().optional(),totalUses:ne.number().optional()}),kU=ne.object({endpoint:ne.string()}),$J=ne.object({signingAuthority:kU,relationship:ne.object({name:ne.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:ne.string()})});var OU=Object.create,od=Object.defineProperty,RU=Object.getOwnPropertyDescriptor,Xb=Object.getOwnPropertyNames,NU=Object.getPrototypeOf,PU=Object.prototype.hasOwnProperty,a=i((e,t)=>od(e,"name",{value:t,configurable:!0}),"__name"),tb=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),pr=i((e,t)=>i(function(){return e&&(t=(0,e[Xb(e)[0]])(e=0)),t},"__init"),"__esm"),ze=i((e,t)=>i(function(){return t||(0,e[Xb(e)[0]])((t={exports:{}}).exports,t),t.exports},"__require2"),"__commonJS"),Er=i((e,t)=>{for(var r in t)od(e,r,{get:t[r],enumerable:!0})},"__export"),yS=i((e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Xb(t))!PU.call(e,s)&&s!==r&&od(e,s,{get:()=>t[s],enumerable:!(n=RU(t,s))||n.enumerable});return e},"__copyProps"),rr=i((e,t,r)=>(r=e!=null?OU(NU(e)):{},yS(t||!e||!e.__esModule?od(r,"default",{value:e,enumerable:!0}):r,e)),"__toESM"),My=i(e=>yS(od({},"__esModule",{value:!0}),e),"__toCommonJS"),BU=ze({"../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(e,t){(function(){var r,n="4.17.21",s=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="Invalid `variable` option passed into `_.template`",h="__lodash_hash_undefined__",p=500,v="__lodash_placeholder__",b=1,y=2,A=4,C=1,O=2,R=1,L=2,K=4,$=8,j=16,V=32,G=64,k=128,H=256,se=512,ue=30,me="...",q=800,E=16,T=1,m=2,d=3,g=1/0,_=9007199254740991,M=17976931348623157e292,S=0/0,w=4294967295,N=w-1,B=w>>>1,D=[["ary",k],["bind",R],["bindKey",L],["curry",$],["curryRight",j],["flip",se],["partial",V],["partialRight",G],["rearg",H]],F="[object Arguments]",le="[object Array]",P="[object AsyncFunction]",Y="[object Boolean]",J="[object Date]",I="[object DOMException]",z="[object Error]",te="[object Function]",ae="[object GeneratorFunction]",ve="[object Map]",De="[object Number]",we="[object Null]",de="[object Object]",Ce="[object Promise]",pe="[object Proxy]",_e="[object RegExp]",Q="[object Set]",ge="[object String]",Me="[object Symbol]",Ue="[object Undefined]",Re="[object WeakMap]",je="[object WeakSet]",rt="[object ArrayBuffer]",fe="[object DataView]",ce="[object Float32Array]",Z="[object Float64Array]",re="[object Int8Array]",ye="[object Int16Array]",Se="[object Int32Array]",xe="[object Uint8Array]",ke="[object Uint8ClampedArray]",Mt="[object Uint16Array]",qe="[object Uint32Array]",He=/\b__p \+= '';/g,Ot=/\b(__p \+=) '' \+/g,dt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,vt=/&(?:amp|lt|gt|quot|#39);/g,kr=/[&<>"']/g,ct=RegExp(vt.source),ut=RegExp(kr.source),cr=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,nt=/<%=([\s\S]+?)%>/g,ir=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,it=/^\w*$/,Ye=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qt=/[\\^$.*+?()[\]{}|]/g,st=RegExp(Qt.source),Qe=/^\s+/,sr=/\s/,at=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ze=/\{\n\/\* \[wrapped with (.+)\] \*/,ar=/,? & /,ot=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Et=/[()=,{}\[\]\/\s]/,Sn=/\\(\\)?/g,At=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,fn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,tn=/^0o[0-7]+$/i,rn=/^(?:0|[1-9]\d*)$/,Or=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Hr=/($^)/,nn=/['\n\r\u2028\u2029\\]/g,xn="\\ud800-\\udfff",Ei="\\u0300-\\u036f",Ai="\\ufe20-\\ufe2f",Si="\\u20d0-\\u20ff",Bn=Ei+Ai+Si,dn="\\u2700-\\u27bf",Xn="a-z\\xdf-\\xf6\\xf8-\\xff",Ln="\\xac\\xb1\\xd7\\xf7",xi="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ti="\\u2000-\\u206f",Mi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gs="A-Z\\xc0-\\xd6\\xd8-\\xde",Ws="\\ufe0e\\ufe0f",Zs=Ln+xi+Ti+Mi,Ca="['\u2019]",Sd="["+xn+"]",ll="["+Zs+"]",Mo="["+Bn+"]",fl="\\d+",xd="["+dn+"]",dl="["+Xn+"]",hl="[^"+xn+Zs+fl+dn+Xn+Gs+"]",Co="\\ud83c[\\udffb-\\udfff]",Td="(?:"+Mo+"|"+Co+")",pl="[^"+xn+"]",Js="(?:\\ud83c[\\udde6-\\uddff]){2}",Vi="[\\ud800-\\udbff][\\udc00-\\udfff]",Ys="["+Gs+"]",ms="\\u200d",ml="(?:"+dl+"|"+hl+")",Md="(?:"+Ys+"|"+hl+")",vl="(?:"+Ca+"(?:d|ll|m|re|s|t|ve))?",gl="(?:"+Ca+"(?:D|LL|M|RE|S|T|VE))?",yl=Td+"?",bl="["+Ws+"]?",_l="(?:"+ms+"(?:"+[pl,Js,Vi].join("|")+")"+bl+yl+")*",vs="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Cd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Nc=bl+yl+_l,Id="(?:"+[xd,Js,Vi].join("|")+")"+Nc,wl="(?:"+[pl+Mo+"?",Mo,Js,Vi,Sd].join("|")+")",El=RegExp(Ca,"g"),Dd=RegExp(Mo,"g"),Al=RegExp(Co+"(?="+Co+")|"+wl+Nc,"g"),Sl=RegExp([Ys+"?"+dl+"+"+vl+"(?="+[ll,Ys,"$"].join("|")+")",Md+"+"+gl+"(?="+[ll,Ys+ml,"$"].join("|")+")",Ys+"?"+ml+"+"+vl,Ys+"+"+gl,Cd,vs,fl,Id].join("|"),"g"),kd=RegExp("["+ms+xn+Bn+Ws+"]"),Io=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Od=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Pc=-1,yr={};yr[ce]=yr[Z]=yr[re]=yr[ye]=yr[Se]=yr[xe]=yr[ke]=yr[Mt]=yr[qe]=!0,yr[F]=yr[le]=yr[rt]=yr[Y]=yr[fe]=yr[J]=yr[z]=yr[te]=yr[ve]=yr[De]=yr[de]=yr[_e]=yr[Q]=yr[ge]=yr[Re]=!1;var mr={};mr[F]=mr[le]=mr[rt]=mr[fe]=mr[Y]=mr[J]=mr[ce]=mr[Z]=mr[re]=mr[ye]=mr[Se]=mr[ve]=mr[De]=mr[de]=mr[_e]=mr[Q]=mr[ge]=mr[Me]=mr[xe]=mr[ke]=mr[Mt]=mr[qe]=!0,mr[z]=mr[te]=mr[Re]=!1;var ie={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Te={"&":"&","<":"<",">":">",'"':""","'":"'"},Pe={"&":"&","<":"<",">":">",""":'"',"'":"'"},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},qr=parseFloat,sn=parseInt,Tn=typeof global=="object"&&global&&global.Object===Object&&global,hn=typeof self=="object"&&self&&self.Object===Object&&self,Lr=Tn||hn||Function("return this")(),gs=typeof e=="object"&&e&&!e.nodeType&&e,ys=gs&&typeof t=="object"&&t&&!t.nodeType&&t,xl=ys&&ys.exports===gs,Bc=xl&&Tn.process,pn=function(){try{var Ee=ys&&ys.require&&ys.require("util").types;return Ee||Bc&&Bc.binding&&Bc.binding("util")}catch{}}(),Do=pn&&pn.isArrayBuffer,D6=pn&&pn.isDate,k6=pn&&pn.isMap,O6=pn&&pn.isRegExp,R6=pn&&pn.isSet,N6=pn&&pn.isTypedArray;function Fn(Ee,Ne,Ie){switch(Ie.length){case 0:return Ee.call(Ne);case 1:return Ee.call(Ne,Ie[0]);case 2:return Ee.call(Ne,Ie[0],Ie[1]);case 3:return Ee.call(Ne,Ie[0],Ie[1],Ie[2])}return Ee.apply(Ne,Ie)}i(Fn,"apply"),a(Fn,"apply");function P6(Ee,Ne,Ie,ft){for(var It=-1,ur=Ee==null?0:Ee.length;++It<ur;){var Vr=Ee[It];Ne(ft,Vr,Ie(Vr),Ee)}return ft}i(P6,"arrayAggregator"),a(P6,"arrayAggregator");function Qn(Ee,Ne){for(var Ie=-1,ft=Ee==null?0:Ee.length;++Ie<ft&&Ne(Ee[Ie],Ie,Ee)!==!1;);return Ee}i(Qn,"arrayEach"),a(Qn,"arrayEach");function B6(Ee,Ne){for(var Ie=Ee==null?0:Ee.length;Ie--&&Ne(Ee[Ie],Ie,Ee)!==!1;);return Ee}i(B6,"arrayEachRight"),a(B6,"arrayEachRight");function Zm(Ee,Ne){for(var Ie=-1,ft=Ee==null?0:Ee.length;++Ie<ft;)if(!Ne(Ee[Ie],Ie,Ee))return!1;return!0}i(Zm,"arrayEvery"),a(Zm,"arrayEvery");function Xs(Ee,Ne){for(var Ie=-1,ft=Ee==null?0:Ee.length,It=0,ur=[];++Ie<ft;){var Vr=Ee[Ie];Ne(Vr,Ie,Ee)&&(ur[It++]=Vr)}return ur}i(Xs,"arrayFilter"),a(Xs,"arrayFilter");function Tl(Ee,Ne){var Ie=Ee==null?0:Ee.length;return!!Ie&&ko(Ee,Ne,0)>-1}i(Tl,"arrayIncludes"),a(Tl,"arrayIncludes");function Rd(Ee,Ne,Ie){for(var ft=-1,It=Ee==null?0:Ee.length;++ft<It;)if(Ie(Ne,Ee[ft]))return!0;return!1}i(Rd,"arrayIncludesWith"),a(Rd,"arrayIncludesWith");function Tr(Ee,Ne){for(var Ie=-1,ft=Ee==null?0:Ee.length,It=Array(ft);++Ie<ft;)It[Ie]=Ne(Ee[Ie],Ie,Ee);return It}i(Tr,"arrayMap"),a(Tr,"arrayMap");function Qs(Ee,Ne){for(var Ie=-1,ft=Ne.length,It=Ee.length;++Ie<ft;)Ee[It+Ie]=Ne[Ie];return Ee}i(Qs,"arrayPush"),a(Qs,"arrayPush");function Nd(Ee,Ne,Ie,ft){var It=-1,ur=Ee==null?0:Ee.length;for(ft&&ur&&(Ie=Ee[++It]);++It<ur;)Ie=Ne(Ie,Ee[It],It,Ee);return Ie}i(Nd,"arrayReduce"),a(Nd,"arrayReduce");function L6(Ee,Ne,Ie,ft){var It=Ee==null?0:Ee.length;for(ft&&It&&(Ie=Ee[--It]);It--;)Ie=Ne(Ie,Ee[It],It,Ee);return Ie}i(L6,"arrayReduceRight"),a(L6,"arrayReduceRight");function Pd(Ee,Ne){for(var Ie=-1,ft=Ee==null?0:Ee.length;++Ie<ft;)if(Ne(Ee[Ie],Ie,Ee))return!0;return!1}i(Pd,"arraySome"),a(Pd,"arraySome");var HD=Bd("length");function F6(Ee){return Ee.split("")}i(F6,"asciiToArray"),a(F6,"asciiToArray");function U6(Ee){return Ee.match(ot)||[]}i(U6,"asciiWords"),a(U6,"asciiWords");function Jm(Ee,Ne,Ie){var ft;return Ie(Ee,function(It,ur,Vr){if(Ne(It,ur,Vr))return ft=ur,!1}),ft}i(Jm,"baseFindKey"),a(Jm,"baseFindKey");function Ml(Ee,Ne,Ie,ft){for(var It=Ee.length,ur=Ie+(ft?1:-1);ft?ur--:++ur<It;)if(Ne(Ee[ur],ur,Ee))return ur;return-1}i(Ml,"baseFindIndex"),a(Ml,"baseFindIndex");function ko(Ee,Ne,Ie){return Ne===Ne?Z6(Ee,Ne,Ie):Ml(Ee,Ym,Ie)}i(ko,"baseIndexOf"),a(ko,"baseIndexOf");function $6(Ee,Ne,Ie,ft){for(var It=Ie-1,ur=Ee.length;++It<ur;)if(ft(Ee[It],Ne))return It;return-1}i($6,"baseIndexOfWith"),a($6,"baseIndexOfWith");function Ym(Ee){return Ee!==Ee}i(Ym,"baseIsNaN"),a(Ym,"baseIsNaN");function Xm(Ee,Ne){var Ie=Ee==null?0:Ee.length;return Ie?Fd(Ee,Ne)/Ie:S}i(Xm,"baseMean"),a(Xm,"baseMean");function Bd(Ee){return function(Ne){return Ne==null?r:Ne[Ee]}}i(Bd,"baseProperty"),a(Bd,"baseProperty");function Ld(Ee){return function(Ne){return Ee==null?r:Ee[Ne]}}i(Ld,"basePropertyOf"),a(Ld,"basePropertyOf");function Qm(Ee,Ne,Ie,ft,It){return It(Ee,function(ur,Vr,br){Ie=ft?(ft=!1,ur):Ne(Ie,ur,Vr,br)}),Ie}i(Qm,"baseReduce"),a(Qm,"baseReduce");function j6(Ee,Ne){var Ie=Ee.length;for(Ee.sort(Ne);Ie--;)Ee[Ie]=Ee[Ie].value;return Ee}i(j6,"baseSortBy"),a(j6,"baseSortBy");function Fd(Ee,Ne){for(var Ie,ft=-1,It=Ee.length;++ft<It;){var ur=Ne(Ee[ft]);ur!==r&&(Ie=Ie===r?ur:Ie+ur)}return Ie}i(Fd,"baseSum"),a(Fd,"baseSum");function Ud(Ee,Ne){for(var Ie=-1,ft=Array(Ee);++Ie<Ee;)ft[Ie]=Ne(Ie);return ft}i(Ud,"baseTimes"),a(Ud,"baseTimes");function z6(Ee,Ne){return Tr(Ne,function(Ie){return[Ie,Ee[Ie]]})}i(z6,"baseToPairs"),a(z6,"baseToPairs");function e1(Ee){return Ee&&Ee.slice(0,i1(Ee)+1).replace(Qe,"")}i(e1,"baseTrim"),a(e1,"baseTrim");function Un(Ee){return function(Ne){return Ee(Ne)}}i(Un,"baseUnary"),a(Un,"baseUnary");function $d(Ee,Ne){return Tr(Ne,function(Ie){return Ee[Ie]})}i($d,"baseValues"),a($d,"baseValues");function Lc(Ee,Ne){return Ee.has(Ne)}i(Lc,"cacheHas"),a(Lc,"cacheHas");function t1(Ee,Ne){for(var Ie=-1,ft=Ee.length;++Ie<ft&&ko(Ne,Ee[Ie],0)>-1;);return Ie}i(t1,"charsStartIndex"),a(t1,"charsStartIndex");function r1(Ee,Ne){for(var Ie=Ee.length;Ie--&&ko(Ne,Ee[Ie],0)>-1;);return Ie}i(r1,"charsEndIndex"),a(r1,"charsEndIndex");function H6(Ee,Ne){for(var Ie=Ee.length,ft=0;Ie--;)Ee[Ie]===Ne&&++ft;return ft}i(H6,"countHolders"),a(H6,"countHolders");var qD=Ld(ie),KD=Ld(Te);function q6(Ee){return"\\"+ht[Ee]}i(q6,"escapeStringChar"),a(q6,"escapeStringChar");function K6(Ee,Ne){return Ee==null?r:Ee[Ne]}i(K6,"getValue"),a(K6,"getValue");function Oo(Ee){return kd.test(Ee)}i(Oo,"hasUnicode"),a(Oo,"hasUnicode");function V6(Ee){return Io.test(Ee)}i(V6,"hasUnicodeWord"),a(V6,"hasUnicodeWord");function G6(Ee){for(var Ne,Ie=[];!(Ne=Ee.next()).done;)Ie.push(Ne.value);return Ie}i(G6,"iteratorToArray"),a(G6,"iteratorToArray");function jd(Ee){var Ne=-1,Ie=Array(Ee.size);return Ee.forEach(function(ft,It){Ie[++Ne]=[It,ft]}),Ie}i(jd,"mapToArray"),a(jd,"mapToArray");function n1(Ee,Ne){return function(Ie){return Ee(Ne(Ie))}}i(n1,"overArg"),a(n1,"overArg");function ea(Ee,Ne){for(var Ie=-1,ft=Ee.length,It=0,ur=[];++Ie<ft;){var Vr=Ee[Ie];(Vr===Ne||Vr===v)&&(Ee[Ie]=v,ur[It++]=Ie)}return ur}i(ea,"replaceHolders"),a(ea,"replaceHolders");function Cl(Ee){var Ne=-1,Ie=Array(Ee.size);return Ee.forEach(function(ft){Ie[++Ne]=ft}),Ie}i(Cl,"setToArray"),a(Cl,"setToArray");function W6(Ee){var Ne=-1,Ie=Array(Ee.size);return Ee.forEach(function(ft){Ie[++Ne]=[ft,ft]}),Ie}i(W6,"setToPairs"),a(W6,"setToPairs");function Z6(Ee,Ne,Ie){for(var ft=Ie-1,It=Ee.length;++ft<It;)if(Ee[ft]===Ne)return ft;return-1}i(Z6,"strictIndexOf"),a(Z6,"strictIndexOf");function J6(Ee,Ne,Ie){for(var ft=Ie+1;ft--;)if(Ee[ft]===Ne)return ft;return ft}i(J6,"strictLastIndexOf"),a(J6,"strictLastIndexOf");function Ro(Ee){return Oo(Ee)?Y6(Ee):HD(Ee)}i(Ro,"stringSize"),a(Ro,"stringSize");function Ci(Ee){return Oo(Ee)?X6(Ee):F6(Ee)}i(Ci,"stringToArray"),a(Ci,"stringToArray");function i1(Ee){for(var Ne=Ee.length;Ne--&&sr.test(Ee.charAt(Ne)););return Ne}i(i1,"trimmedEndIndex"),a(i1,"trimmedEndIndex");var VD=Ld(Pe);function Y6(Ee){for(var Ne=Al.lastIndex=0;Al.test(Ee);)++Ne;return Ne}i(Y6,"unicodeSize"),a(Y6,"unicodeSize");function X6(Ee){return Ee.match(Al)||[]}i(X6,"unicodeToArray"),a(X6,"unicodeToArray");function Q6(Ee){return Ee.match(Sl)||[]}i(Q6,"unicodeWords"),a(Q6,"unicodeWords");var GD=a(i(function Ee(Ne){Ne=Ne==null?Lr:Ia.defaults(Lr.Object(),Ne,Ia.pick(Lr,Od));var Ie=Ne.Array,ft=Ne.Date,It=Ne.Error,ur=Ne.Function,Vr=Ne.Math,br=Ne.Object,s1=Ne.RegExp,WD=Ne.String,Ii=Ne.TypeError,zd=Ie.prototype,ZD=ur.prototype,Fc=br.prototype,Hd=Ne["__core-js_shared__"],qd=ZD.toString,vr=Fc.hasOwnProperty,JD=0,e3=function(){var u=/[^.]+$/.exec(Hd&&Hd.keys&&Hd.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Kd=Fc.toString,YD=qd.call(br),XD=Lr._,QD=s1("^"+qd.call(vr).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Vd=xl?Ne.Buffer:r,Da=Ne.Symbol,Gd=Ne.Uint8Array,t3=Vd?Vd.allocUnsafe:r,Wd=n1(br.getPrototypeOf,br),r3=br.create,n3=Fc.propertyIsEnumerable,Zd=zd.splice,i3=Da?Da.isConcatSpreadable:r,Il=Da?Da.iterator:r,No=Da?Da.toStringTag:r,Jd=function(){try{var u=Ba(br,"defineProperty");return u({},"",{}),u}catch{}}(),ek=Ne.clearTimeout!==Lr.clearTimeout&&Ne.clearTimeout,tk=ft&&ft.now!==Lr.Date.now&&ft.now,rk=Ne.setTimeout!==Lr.setTimeout&&Ne.setTimeout,Yd=Vr.ceil,Xd=Vr.floor,a1=br.getOwnPropertySymbols,nk=Vd?Vd.isBuffer:r,s3=Ne.isFinite,ik=zd.join,sk=n1(br.keys,br),Gr=Vr.max,mn=Vr.min,ak=ft.now,ok=Ne.parseInt,a3=Vr.random,ck=zd.reverse,o1=Ba(Ne,"DataView"),Dl=Ba(Ne,"Map"),c1=Ba(Ne,"Promise"),Uc=Ba(Ne,"Set"),kl=Ba(Ne,"WeakMap"),Ol=Ba(br,"create"),Qd=kl&&new kl,$c={},uk=La(o1),lk=La(Dl),fk=La(c1),dk=La(Uc),hk=La(kl),eh=Da?Da.prototype:r,Rl=eh?eh.valueOf:r,o3=eh?eh.toString:r;function X(u){if(Ir(u)&&!Rt(u)&&!(u instanceof Vt)){if(u instanceof ei)return u;if(vr.call(u,"__wrapped__"))return av(u)}return new ei(u)}i(X,"lodash"),a(X,"lodash");var jc=function(){function u(){}return i(u,"object"),a(u,"object"),function(f){if(!Cr(f))return{};if(r3)return r3(f);u.prototype=f;var x=new u;return u.prototype=r,x}}();function Nl(){}i(Nl,"baseLodash"),a(Nl,"baseLodash");function ei(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=r}i(ei,"LodashWrapper"),a(ei,"LodashWrapper"),X.templateSettings={escape:cr,evaluate:lt,interpolate:nt,variable:"",imports:{_:X}},X.prototype=Nl.prototype,X.prototype.constructor=X,ei.prototype=jc(Nl.prototype),ei.prototype.constructor=ei;function Vt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=w,this.__views__=[]}i(Vt,"LazyWrapper"),a(Vt,"LazyWrapper");function c3(){var u=new Vt(this.__wrapped__);return u.__actions__=Mn(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Mn(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Mn(this.__views__),u}i(c3,"lazyClone"),a(c3,"lazyClone");function u3(){if(this.__filtered__){var u=new Vt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}i(u3,"lazyReverse"),a(u3,"lazyReverse");function l3(){var u=this.__wrapped__.value(),f=this.__dir__,x=Rt(u),U=f<0,W=x?u.length:0,ee=S5(0,W,this.__views__),he=ee.start,be=ee.end,Ae=be-he,Be=U?be:he-1,Le=this.__iteratees__,$e=Le.length,Je=0,pt=mn(Ae,this.__takeCount__);if(!x||!U&&W==Ae&&pt==Ae)return D1(u,this.__actions__);var St=[];e:for(;Ae--&&Je<pt;){Be+=f;for(var Ft=-1,wt=u[Be];++Ft<$e;){var qt=Le[Ft],Zt=qt.iteratee,zn=qt.type,bn=Zt(wt);if(zn==m)wt=bn;else if(!bn){if(zn==T)continue e;break e}}St[Je++]=wt}return St}i(l3,"lazyValue"),a(l3,"lazyValue"),Vt.prototype=jc(Nl.prototype),Vt.prototype.constructor=Vt;function ka(u){var f=-1,x=u==null?0:u.length;for(this.clear();++f<x;){var U=u[f];this.set(U[0],U[1])}}i(ka,"Hash"),a(ka,"Hash");function f3(){this.__data__=Ol?Ol(null):{},this.size=0}i(f3,"hashClear"),a(f3,"hashClear");function d3(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}i(d3,"hashDelete"),a(d3,"hashDelete");function h3(u){var f=this.__data__;if(Ol){var x=f[u];return x===h?r:x}return vr.call(f,u)?f[u]:r}i(h3,"hashGet"),a(h3,"hashGet");function p3(u){var f=this.__data__;return Ol?f[u]!==r:vr.call(f,u)}i(p3,"hashHas"),a(p3,"hashHas");function m3(u,f){var x=this.__data__;return this.size+=this.has(u)?0:1,x[u]=Ol&&f===r?h:f,this}i(m3,"hashSet"),a(m3,"hashSet"),ka.prototype.clear=f3,ka.prototype.delete=d3,ka.prototype.get=h3,ka.prototype.has=p3,ka.prototype.set=m3;function bs(u){var f=-1,x=u==null?0:u.length;for(this.clear();++f<x;){var U=u[f];this.set(U[0],U[1])}}i(bs,"ListCache"),a(bs,"ListCache");function v3(){this.__data__=[],this.size=0}i(v3,"listCacheClear"),a(v3,"listCacheClear");function g3(u){var f=this.__data__,x=Pl(f,u);if(x<0)return!1;var U=f.length-1;return x==U?f.pop():Zd.call(f,x,1),--this.size,!0}i(g3,"listCacheDelete"),a(g3,"listCacheDelete");function y3(u){var f=this.__data__,x=Pl(f,u);return x<0?r:f[x][1]}i(y3,"listCacheGet"),a(y3,"listCacheGet");function b3(u){return Pl(this.__data__,u)>-1}i(b3,"listCacheHas"),a(b3,"listCacheHas");function _3(u,f){var x=this.__data__,U=Pl(x,u);return U<0?(++this.size,x.push([u,f])):x[U][1]=f,this}i(_3,"listCacheSet"),a(_3,"listCacheSet"),bs.prototype.clear=v3,bs.prototype.delete=g3,bs.prototype.get=y3,bs.prototype.has=b3,bs.prototype.set=_3;function _s(u){var f=-1,x=u==null?0:u.length;for(this.clear();++f<x;){var U=u[f];this.set(U[0],U[1])}}i(_s,"MapCache"),a(_s,"MapCache");function w3(){this.size=0,this.__data__={hash:new ka,map:new(Dl||bs),string:new ka}}i(w3,"mapCacheClear"),a(w3,"mapCacheClear");function E3(u){var f=Gl(this,u).delete(u);return this.size-=f?1:0,f}i(E3,"mapCacheDelete"),a(E3,"mapCacheDelete");function A3(u){return Gl(this,u).get(u)}i(A3,"mapCacheGet"),a(A3,"mapCacheGet");function S3(u){return Gl(this,u).has(u)}i(S3,"mapCacheHas"),a(S3,"mapCacheHas");function x3(u,f){var x=Gl(this,u),U=x.size;return x.set(u,f),this.size+=x.size==U?0:1,this}i(x3,"mapCacheSet"),a(x3,"mapCacheSet"),_s.prototype.clear=w3,_s.prototype.delete=E3,_s.prototype.get=A3,_s.prototype.has=S3,_s.prototype.set=x3;function Oa(u){var f=-1,x=u==null?0:u.length;for(this.__data__=new _s;++f<x;)this.add(u[f])}i(Oa,"SetCache"),a(Oa,"SetCache");function T3(u){return this.__data__.set(u,h),this}i(T3,"setCacheAdd"),a(T3,"setCacheAdd");function M3(u){return this.__data__.has(u)}i(M3,"setCacheHas"),a(M3,"setCacheHas"),Oa.prototype.add=Oa.prototype.push=T3,Oa.prototype.has=M3;function Di(u){var f=this.__data__=new bs(u);this.size=f.size}i(Di,"Stack"),a(Di,"Stack");function C3(){this.__data__=new bs,this.size=0}i(C3,"stackClear"),a(C3,"stackClear");function I3(u){var f=this.__data__,x=f.delete(u);return this.size=f.size,x}i(I3,"stackDelete"),a(I3,"stackDelete");function D3(u){return this.__data__.get(u)}i(D3,"stackGet"),a(D3,"stackGet");function k3(u){return this.__data__.has(u)}i(k3,"stackHas"),a(k3,"stackHas");function O3(u,f){var x=this.__data__;if(x instanceof bs){var U=x.__data__;if(!Dl||U.length<s-1)return U.push([u,f]),this.size=++x.size,this;x=this.__data__=new _s(U)}return x.set(u,f),this.size=x.size,this}i(O3,"stackSet"),a(O3,"stackSet"),Di.prototype.clear=C3,Di.prototype.delete=I3,Di.prototype.get=D3,Di.prototype.has=k3,Di.prototype.set=O3;function u1(u,f){var x=Rt(u),U=!x&&Fo(u),W=!x&&!U&&Fa(u),ee=!x&&!U&&!W&&Jc(u),he=x||U||W||ee,be=he?Ud(u.length,WD):[],Ae=be.length;for(var Be in u)(f||vr.call(u,Be))&&!(he&&(Be=="length"||W&&(Be=="offset"||Be=="parent")||ee&&(Be=="buffer"||Be=="byteLength"||Be=="byteOffset")||Ss(Be,Ae)))&&be.push(Be);return be}i(u1,"arrayLikeKeys"),a(u1,"arrayLikeKeys");function l1(u){var f=u.length;return f?u[lh(0,f-1)]:r}i(l1,"arraySample"),a(l1,"arraySample");function R3(u,f){return Zl(Mn(u),Ra(f,0,u.length))}i(R3,"arraySampleSize"),a(R3,"arraySampleSize");function N3(u){return Zl(Mn(u))}i(N3,"arrayShuffle"),a(N3,"arrayShuffle");function th(u,f,x){(x!==r&&!ki(u[f],x)||x===r&&!(f in u))&&ws(u,f,x)}i(th,"assignMergeValue"),a(th,"assignMergeValue");function zc(u,f,x){var U=u[f];(!(vr.call(u,f)&&ki(U,x))||x===r&&!(f in u))&&ws(u,f,x)}i(zc,"assignValue"),a(zc,"assignValue");function Pl(u,f){for(var x=u.length;x--;)if(ki(u[x][0],f))return x;return-1}i(Pl,"assocIndexOf"),a(Pl,"assocIndexOf");function P3(u,f,x,U){return Na(u,function(W,ee,he){f(U,W,x(W),he)}),U}i(P3,"baseAggregator"),a(P3,"baseAggregator");function f1(u,f){return u&&Wi(f,Wr(f),u)}i(f1,"baseAssign"),a(f1,"baseAssign");function B3(u,f){return u&&Wi(f,In(f),u)}i(B3,"baseAssignIn"),a(B3,"baseAssignIn");function ws(u,f,x){f=="__proto__"&&Jd?Jd(u,f,{configurable:!0,enumerable:!0,value:x,writable:!0}):u[f]=x}i(ws,"baseAssignValue"),a(ws,"baseAssignValue");function rh(u,f){for(var x=-1,U=f.length,W=Ie(U),ee=u==null;++x<U;)W[x]=ee?r:kh(u,f[x]);return W}i(rh,"baseAt"),a(rh,"baseAt");function Ra(u,f,x){return u===u&&(x!==r&&(u=u<=x?u:x),f!==r&&(u=u>=f?u:f)),u}i(Ra,"baseClamp"),a(Ra,"baseClamp");function ti(u,f,x,U,W,ee){var he,be=f&b,Ae=f&y,Be=f&A;if(x&&(he=W?x(u,U,W,ee):x(u)),he!==r)return he;if(!Cr(u))return u;var Le=Rt(u);if(Le){if(he=T5(u),!be)return Mn(u,he)}else{var $e=gn(u),Je=$e==te||$e==ae;if(Fa(u))return O1(u,be);if($e==de||$e==F||Je&&!W){if(he=Ae||Je?{}:X1(u),!be)return Ae?m5(u,B3(he,u)):p5(u,f1(he,u))}else{if(!mr[$e])return W?u:{};he=M5(u,$e,be)}}ee||(ee=new Di);var pt=ee.get(u);if(pt)return pt;ee.set(u,he),Aw(u)?u.forEach(function(wt){he.add(ti(wt,f,x,wt,u,ee))}):mw(u)&&u.forEach(function(wt,qt){he.set(qt,ti(wt,f,x,qt,u,ee))});var St=Be?Ae?wh:_h:Ae?In:Wr,Ft=Le?r:St(u);return Qn(Ft||u,function(wt,qt){Ft&&(qt=wt,wt=u[qt]),zc(he,qt,ti(wt,f,x,qt,u,ee))}),he}i(ti,"baseClone"),a(ti,"baseClone");function L3(u){var f=Wr(u);return function(x){return d1(x,u,f)}}i(L3,"baseConforms"),a(L3,"baseConforms");function d1(u,f,x){var U=x.length;if(u==null)return!U;for(u=br(u);U--;){var W=x[U],ee=f[W],he=u[W];if(he===r&&!(W in u)||!ee(he))return!1}return!0}i(d1,"baseConformsTo"),a(d1,"baseConformsTo");function h1(u,f,x){if(typeof u!="function")throw new Ii(c);return Wl(function(){u.apply(r,x)},f)}i(h1,"baseDelay"),a(h1,"baseDelay");function Hc(u,f,x,U){var W=-1,ee=Tl,he=!0,be=u.length,Ae=[],Be=f.length;if(!be)return Ae;x&&(f=Tr(f,Un(x))),U?(ee=Rd,he=!1):f.length>=s&&(ee=Lc,he=!1,f=new Oa(f));e:for(;++W<be;){var Le=u[W],$e=x==null?Le:x(Le);if(Le=U||Le!==0?Le:0,he&&$e===$e){for(var Je=Be;Je--;)if(f[Je]===$e)continue e;Ae.push(Le)}else ee(f,$e,U)||Ae.push(Le)}return Ae}i(Hc,"baseDifference"),a(Hc,"baseDifference");var Na=L1(Gi),F3=L1(nh,!0);function U3(u,f){var x=!0;return Na(u,function(U,W,ee){return x=!!f(U,W,ee),x}),x}i(U3,"baseEvery"),a(U3,"baseEvery");function Bl(u,f,x){for(var U=-1,W=u.length;++U<W;){var ee=u[U],he=f(ee);if(he!=null&&(be===r?he===he&&!jn(he):x(he,be)))var be=he,Ae=ee}return Ae}i(Bl,"baseExtremum"),a(Bl,"baseExtremum");function $3(u,f,x,U){var W=u.length;for(x=Nt(x),x<0&&(x=-x>W?0:W+x),U=U===r||U>W?W:Nt(U),U<0&&(U+=W),U=x>U?0:Mv(U);x<U;)u[x++]=f;return u}i($3,"baseFill"),a($3,"baseFill");function p1(u,f){var x=[];return Na(u,function(U,W,ee){f(U,W,ee)&&x.push(U)}),x}i(p1,"baseFilter"),a(p1,"baseFilter");function Jr(u,f,x,U,W){var ee=-1,he=u.length;for(x||(x=I5),W||(W=[]);++ee<he;){var be=u[ee];f>0&&x(be)?f>1?Jr(be,f-1,x,U,W):Qs(W,be):U||(W[W.length]=be)}return W}i(Jr,"baseFlatten"),a(Jr,"baseFlatten");var m1=F1(),j3=F1(!0);function Gi(u,f){return u&&m1(u,f,Wr)}i(Gi,"baseForOwn"),a(Gi,"baseForOwn");function nh(u,f){return u&&j3(u,f,Wr)}i(nh,"baseForOwnRight"),a(nh,"baseForOwnRight");function Ll(u,f){return Xs(f,function(x){return xs(u[x])})}i(Ll,"baseFunctions"),a(Ll,"baseFunctions");function Pa(u,f){f=ra(f,u);for(var x=0,U=f.length;u!=null&&x<U;)u=u[Zi(f[x++])];return x&&x==U?u:r}i(Pa,"baseGet"),a(Pa,"baseGet");function v1(u,f,x){var U=f(u);return Rt(u)?U:Qs(U,x(u))}i(v1,"baseGetAllKeys"),a(v1,"baseGetAllKeys");function vn(u){return u==null?u===r?Ue:we:No&&No in br(u)?E5(u):P5(u)}i(vn,"baseGetTag"),a(vn,"baseGetTag");function ih(u,f){return u>f}i(ih,"baseGt"),a(ih,"baseGt");function z3(u,f){return u!=null&&vr.call(u,f)}i(z3,"baseHas"),a(z3,"baseHas");function H3(u,f){return u!=null&&f in br(u)}i(H3,"baseHasIn"),a(H3,"baseHasIn");function q3(u,f,x){return u>=mn(f,x)&&u<Gr(f,x)}i(q3,"baseInRange"),a(q3,"baseInRange");function sh(u,f,x){for(var U=x?Rd:Tl,W=u[0].length,ee=u.length,he=ee,be=Ie(ee),Ae=1/0,Be=[];he--;){var Le=u[he];he&&f&&(Le=Tr(Le,Un(f))),Ae=mn(Le.length,Ae),be[he]=!x&&(f||W>=120&&Le.length>=120)?new Oa(he&&Le):r}Le=u[0];var $e=-1,Je=be[0];e:for(;++$e<W&&Be.length<Ae;){var pt=Le[$e],St=f?f(pt):pt;if(pt=x||pt!==0?pt:0,!(Je?Lc(Je,St):U(Be,St,x))){for(he=ee;--he;){var Ft=be[he];if(!(Ft?Lc(Ft,St):U(u[he],St,x)))continue e}Je&&Je.push(St),Be.push(pt)}}return Be}i(sh,"baseIntersection"),a(sh,"baseIntersection");function K3(u,f,x,U){return Gi(u,function(W,ee,he){f(U,x(W),ee,he)}),U}i(K3,"baseInverter"),a(K3,"baseInverter");function qc(u,f,x){f=ra(f,u),u=rv(u,f);var U=u==null?u:u[Zi(ni(f))];return U==null?r:Fn(U,u,x)}i(qc,"baseInvoke"),a(qc,"baseInvoke");function g1(u){return Ir(u)&&vn(u)==F}i(g1,"baseIsArguments"),a(g1,"baseIsArguments");function V3(u){return Ir(u)&&vn(u)==rt}i(V3,"baseIsArrayBuffer"),a(V3,"baseIsArrayBuffer");function G3(u){return Ir(u)&&vn(u)==J}i(G3,"baseIsDate"),a(G3,"baseIsDate");function Kc(u,f,x,U,W){return u===f?!0:u==null||f==null||!Ir(u)&&!Ir(f)?u!==u&&f!==f:W3(u,f,x,U,Kc,W)}i(Kc,"baseIsEqual"),a(Kc,"baseIsEqual");function W3(u,f,x,U,W,ee){var he=Rt(u),be=Rt(f),Ae=he?le:gn(u),Be=be?le:gn(f);Ae=Ae==F?de:Ae,Be=Be==F?de:Be;var Le=Ae==de,$e=Be==de,Je=Ae==Be;if(Je&&Fa(u)){if(!Fa(f))return!1;he=!0,Le=!1}if(Je&&!Le)return ee||(ee=new Di),he||Jc(u)?W1(u,f,x,U,W,ee):_5(u,f,Ae,x,U,W,ee);if(!(x&C)){var pt=Le&&vr.call(u,"__wrapped__"),St=$e&&vr.call(f,"__wrapped__");if(pt||St){var Ft=pt?u.value():u,wt=St?f.value():f;return ee||(ee=new Di),W(Ft,wt,x,U,ee)}}return Je?(ee||(ee=new Di),w5(u,f,x,U,W,ee)):!1}i(W3,"baseIsEqualDeep"),a(W3,"baseIsEqualDeep");function Z3(u){return Ir(u)&&gn(u)==ve}i(Z3,"baseIsMap"),a(Z3,"baseIsMap");function ah(u,f,x,U){var W=x.length,ee=W,he=!U;if(u==null)return!ee;for(u=br(u);W--;){var be=x[W];if(he&&be[2]?be[1]!==u[be[0]]:!(be[0]in u))return!1}for(;++W<ee;){be=x[W];var Ae=be[0],Be=u[Ae],Le=be[1];if(he&&be[2]){if(Be===r&&!(Ae in u))return!1}else{var $e=new Di;if(U)var Je=U(Be,Le,Ae,u,f,$e);if(!(Je===r?Kc(Le,Be,C|O,U,$e):Je))return!1}}return!0}i(ah,"baseIsMatch"),a(ah,"baseIsMatch");function y1(u){if(!Cr(u)||k5(u))return!1;var f=xs(u)?QD:tr;return f.test(La(u))}i(y1,"baseIsNative"),a(y1,"baseIsNative");function J3(u){return Ir(u)&&vn(u)==_e}i(J3,"baseIsRegExp"),a(J3,"baseIsRegExp");function Y3(u){return Ir(u)&&gn(u)==Q}i(Y3,"baseIsSet"),a(Y3,"baseIsSet");function X3(u){return Ir(u)&&ef(u.length)&&!!yr[vn(u)]}i(X3,"baseIsTypedArray"),a(X3,"baseIsTypedArray");function b1(u){return typeof u=="function"?u:u==null?Dn:typeof u=="object"?Rt(u)?E1(u[0],u[1]):w1(u):Nv(u)}i(b1,"baseIteratee"),a(b1,"baseIteratee");function oh(u){if(!Wc(u))return sk(u);var f=[];for(var x in br(u))vr.call(u,x)&&x!="constructor"&&f.push(x);return f}i(oh,"baseKeys"),a(oh,"baseKeys");function Q3(u){if(!Cr(u))return N5(u);var f=Wc(u),x=[];for(var U in u)U=="constructor"&&(f||!vr.call(u,U))||x.push(U);return x}i(Q3,"baseKeysIn"),a(Q3,"baseKeysIn");function ch(u,f){return u<f}i(ch,"baseLt"),a(ch,"baseLt");function _1(u,f){var x=-1,U=Cn(u)?Ie(u.length):[];return Na(u,function(W,ee,he){U[++x]=f(W,ee,he)}),U}i(_1,"baseMap"),a(_1,"baseMap");function w1(u){var f=Eh(u);return f.length==1&&f[0][2]?ev(f[0][0],f[0][1]):function(x){return x===u||ah(x,u,f)}}i(w1,"baseMatches"),a(w1,"baseMatches");function E1(u,f){return Ah(u)&&Q1(f)?ev(Zi(u),f):function(x){var U=kh(x,u);return U===r&&U===f?Oh(x,u):Kc(f,U,C|O)}}i(E1,"baseMatchesProperty"),a(E1,"baseMatchesProperty");function Fl(u,f,x,U,W){u!==f&&m1(f,function(ee,he){if(W||(W=new Di),Cr(ee))e5(u,f,he,x,Fl,U,W);else{var be=U?U(xh(u,he),ee,he+"",u,f,W):r;be===r&&(be=ee),th(u,he,be)}},In)}i(Fl,"baseMerge"),a(Fl,"baseMerge");function e5(u,f,x,U,W,ee,he){var be=xh(u,x),Ae=xh(f,x),Be=he.get(Ae);if(Be){th(u,x,Be);return}var Le=ee?ee(be,Ae,x+"",u,f,he):r,$e=Le===r;if($e){var Je=Rt(Ae),pt=!Je&&Fa(Ae),St=!Je&&!pt&&Jc(Ae);Le=Ae,Je||pt||St?Rt(be)?Le=be:Rr(be)?Le=Mn(be):pt?($e=!1,Le=O1(Ae,!0)):St?($e=!1,Le=R1(Ae,!0)):Le=[]:Zc(Ae)||Fo(Ae)?(Le=be,Fo(be)?Le=Cv(be):(!Cr(be)||xs(be))&&(Le=X1(Ae))):$e=!1}$e&&(he.set(Ae,Le),W(Le,Ae,U,ee,he),he.delete(Ae)),th(u,x,Le)}i(e5,"baseMergeDeep"),a(e5,"baseMergeDeep");function A1(u,f){var x=u.length;if(!!x)return f+=f<0?x:0,Ss(f,x)?u[f]:r}i(A1,"baseNth"),a(A1,"baseNth");function S1(u,f,x){f.length?f=Tr(f,function(ee){return Rt(ee)?function(he){return Pa(he,ee.length===1?ee[0]:ee)}:ee}):f=[Dn];var U=-1;f=Tr(f,Un(_t()));var W=_1(u,function(ee,he,be){var Ae=Tr(f,function(Be){return Be(ee)});return{criteria:Ae,index:++U,value:ee}});return j6(W,function(ee,he){return h5(ee,he,x)})}i(S1,"baseOrderBy"),a(S1,"baseOrderBy");function t5(u,f){return x1(u,f,function(x,U){return Oh(u,U)})}i(t5,"basePick"),a(t5,"basePick");function x1(u,f,x){for(var U=-1,W=f.length,ee={};++U<W;){var he=f[U],be=Pa(u,he);x(be,he)&&Vc(ee,ra(he,u),be)}return ee}i(x1,"basePickBy"),a(x1,"basePickBy");function r5(u){return function(f){return Pa(f,u)}}i(r5,"basePropertyDeep"),a(r5,"basePropertyDeep");function uh(u,f,x,U){var W=U?$6:ko,ee=-1,he=f.length,be=u;for(u===f&&(f=Mn(f)),x&&(be=Tr(u,Un(x)));++ee<he;)for(var Ae=0,Be=f[ee],Le=x?x(Be):Be;(Ae=W(be,Le,Ae,U))>-1;)be!==u&&Zd.call(be,Ae,1),Zd.call(u,Ae,1);return u}i(uh,"basePullAll"),a(uh,"basePullAll");function T1(u,f){for(var x=u?f.length:0,U=x-1;x--;){var W=f[x];if(x==U||W!==ee){var ee=W;Ss(W)?Zd.call(u,W,1):hh(u,W)}}return u}i(T1,"basePullAt"),a(T1,"basePullAt");function lh(u,f){return u+Xd(a3()*(f-u+1))}i(lh,"baseRandom"),a(lh,"baseRandom");function n5(u,f,x,U){for(var W=-1,ee=Gr(Yd((f-u)/(x||1)),0),he=Ie(ee);ee--;)he[U?ee:++W]=u,u+=x;return he}i(n5,"baseRange"),a(n5,"baseRange");function fh(u,f){var x="";if(!u||f<1||f>_)return x;do f%2&&(x+=u),f=Xd(f/2),f&&(u+=u);while(f);return x}i(fh,"baseRepeat"),a(fh,"baseRepeat");function $t(u,f){return nv(tv(u,f,Dn),u+"")}i($t,"baseRest"),a($t,"baseRest");function i5(u){return l1(Uo(u))}i(i5,"baseSample"),a(i5,"baseSample");function s5(u,f){var x=Uo(u);return Zl(x,Ra(f,0,x.length))}i(s5,"baseSampleSize"),a(s5,"baseSampleSize");function Vc(u,f,x,U){if(!Cr(u))return u;f=ra(f,u);for(var W=-1,ee=f.length,he=ee-1,be=u;be!=null&&++W<ee;){var Ae=Zi(f[W]),Be=x;if(Ae==="__proto__"||Ae==="constructor"||Ae==="prototype")return u;if(W!=he){var Le=be[Ae];Be=U?U(Le,Ae,be):r,Be===r&&(Be=Cr(Le)?Le:Ss(f[W+1])?[]:{})}zc(be,Ae,Be),be=be[Ae]}return u}i(Vc,"baseSet"),a(Vc,"baseSet");var a5=Qd?function(u,f){return Qd.set(u,f),u}:Dn,pk=Jd?function(u,f){return Jd(u,"toString",{configurable:!0,enumerable:!1,value:Rh(f),writable:!0})}:Dn;function o5(u){return Zl(Uo(u))}i(o5,"baseShuffle"),a(o5,"baseShuffle");function ri(u,f,x){var U=-1,W=u.length;f<0&&(f=-f>W?0:W+f),x=x>W?W:x,x<0&&(x+=W),W=f>x?0:x-f>>>0,f>>>=0;for(var ee=Ie(W);++U<W;)ee[U]=u[U+f];return ee}i(ri,"baseSlice"),a(ri,"baseSlice");function c5(u,f){var x;return Na(u,function(U,W,ee){return x=f(U,W,ee),!x}),!!x}i(c5,"baseSome"),a(c5,"baseSome");function Ul(u,f,x){var U=0,W=u==null?U:u.length;if(typeof f=="number"&&f===f&&W<=B){for(;U<W;){var ee=U+W>>>1,he=u[ee];he!==null&&!jn(he)&&(x?he<=f:he<f)?U=ee+1:W=ee}return W}return dh(u,f,Dn,x)}i(Ul,"baseSortedIndex"),a(Ul,"baseSortedIndex");function dh(u,f,x,U){var W=0,ee=u==null?0:u.length;if(ee===0)return 0;f=x(f);for(var he=f!==f,be=f===null,Ae=jn(f),Be=f===r;W<ee;){var Le=Xd((W+ee)/2),$e=x(u[Le]),Je=$e!==r,pt=$e===null,St=$e===$e,Ft=jn($e);if(he)var wt=U||St;else Be?wt=St&&(U||Je):be?wt=St&&Je&&(U||!pt):Ae?wt=St&&Je&&!pt&&(U||!Ft):pt||Ft?wt=!1:wt=U?$e<=f:$e<f;wt?W=Le+1:ee=Le}return mn(ee,N)}i(dh,"baseSortedIndexBy"),a(dh,"baseSortedIndexBy");function M1(u,f){for(var x=-1,U=u.length,W=0,ee=[];++x<U;){var he=u[x],be=f?f(he):he;if(!x||!ki(be,Ae)){var Ae=be;ee[W++]=he===0?0:he}}return ee}i(M1,"baseSortedUniq"),a(M1,"baseSortedUniq");function C1(u){return typeof u=="number"?u:jn(u)?S:+u}i(C1,"baseToNumber"),a(C1,"baseToNumber");function $n(u){if(typeof u=="string")return u;if(Rt(u))return Tr(u,$n)+"";if(jn(u))return o3?o3.call(u):"";var f=u+"";return f=="0"&&1/u==-g?"-0":f}i($n,"baseToString"),a($n,"baseToString");function ta(u,f,x){var U=-1,W=Tl,ee=u.length,he=!0,be=[],Ae=be;if(x)he=!1,W=Rd;else if(ee>=s){var Be=f?null:vk(u);if(Be)return Cl(Be);he=!1,W=Lc,Ae=new Oa}else Ae=f?[]:be;e:for(;++U<ee;){var Le=u[U],$e=f?f(Le):Le;if(Le=x||Le!==0?Le:0,he&&$e===$e){for(var Je=Ae.length;Je--;)if(Ae[Je]===$e)continue e;f&&Ae.push($e),be.push(Le)}else W(Ae,$e,x)||(Ae!==be&&Ae.push($e),be.push(Le))}return be}i(ta,"baseUniq"),a(ta,"baseUniq");function hh(u,f){return f=ra(f,u),u=rv(u,f),u==null||delete u[Zi(ni(f))]}i(hh,"baseUnset"),a(hh,"baseUnset");function I1(u,f,x,U){return Vc(u,f,x(Pa(u,f)),U)}i(I1,"baseUpdate"),a(I1,"baseUpdate");function $l(u,f,x,U){for(var W=u.length,ee=U?W:-1;(U?ee--:++ee<W)&&f(u[ee],ee,u););return x?ri(u,U?0:ee,U?ee+1:W):ri(u,U?ee+1:0,U?W:ee)}i($l,"baseWhile"),a($l,"baseWhile");function D1(u,f){var x=u;return x instanceof Vt&&(x=x.value()),Nd(f,function(U,W){return W.func.apply(W.thisArg,Qs([U],W.args))},x)}i(D1,"baseWrapperValue"),a(D1,"baseWrapperValue");function ph(u,f,x){var U=u.length;if(U<2)return U?ta(u[0]):[];for(var W=-1,ee=Ie(U);++W<U;)for(var he=u[W],be=-1;++be<U;)be!=W&&(ee[W]=Hc(ee[W]||he,u[be],f,x));return ta(Jr(ee,1),f,x)}i(ph,"baseXor"),a(ph,"baseXor");function k1(u,f,x){for(var U=-1,W=u.length,ee=f.length,he={};++U<W;){var be=U<ee?f[U]:r;x(he,u[U],be)}return he}i(k1,"baseZipObject"),a(k1,"baseZipObject");function mh(u){return Rr(u)?u:[]}i(mh,"castArrayLikeObject"),a(mh,"castArrayLikeObject");function vh(u){return typeof u=="function"?u:Dn}i(vh,"castFunction"),a(vh,"castFunction");function ra(u,f){return Rt(u)?u:Ah(u,f)?[u]:F5(lr(u))}i(ra,"castPath"),a(ra,"castPath");var mk=$t;function na(u,f,x){var U=u.length;return x=x===r?U:x,!f&&x>=U?u:ri(u,f,x)}i(na,"castSlice"),a(na,"castSlice");var u5=ek||function(u){return Lr.clearTimeout(u)};function O1(u,f){if(f)return u.slice();var x=u.length,U=t3?t3(x):new u.constructor(x);return u.copy(U),U}i(O1,"cloneBuffer"),a(O1,"cloneBuffer");function gh(u){var f=new u.constructor(u.byteLength);return new Gd(f).set(new Gd(u)),f}i(gh,"cloneArrayBuffer"),a(gh,"cloneArrayBuffer");function l5(u,f){var x=f?gh(u.buffer):u.buffer;return new u.constructor(x,u.byteOffset,u.byteLength)}i(l5,"cloneDataView"),a(l5,"cloneDataView");function f5(u){var f=new u.constructor(u.source,yt.exec(u));return f.lastIndex=u.lastIndex,f}i(f5,"cloneRegExp"),a(f5,"cloneRegExp");function d5(u){return Rl?br(Rl.call(u)):{}}i(d5,"cloneSymbol"),a(d5,"cloneSymbol");function R1(u,f){var x=f?gh(u.buffer):u.buffer;return new u.constructor(x,u.byteOffset,u.length)}i(R1,"cloneTypedArray"),a(R1,"cloneTypedArray");function N1(u,f){if(u!==f){var x=u!==r,U=u===null,W=u===u,ee=jn(u),he=f!==r,be=f===null,Ae=f===f,Be=jn(f);if(!be&&!Be&&!ee&&u>f||ee&&he&&Ae&&!be&&!Be||U&&he&&Ae||!x&&Ae||!W)return 1;if(!U&&!ee&&!Be&&u<f||Be&&x&&W&&!U&&!ee||be&&x&&W||!he&&W||!Ae)return-1}return 0}i(N1,"compareAscending"),a(N1,"compareAscending");function h5(u,f,x){for(var U=-1,W=u.criteria,ee=f.criteria,he=W.length,be=x.length;++U<he;){var Ae=N1(W[U],ee[U]);if(Ae){if(U>=be)return Ae;var Be=x[U];return Ae*(Be=="desc"?-1:1)}}return u.index-f.index}i(h5,"compareMultiple"),a(h5,"compareMultiple");function P1(u,f,x,U){for(var W=-1,ee=u.length,he=x.length,be=-1,Ae=f.length,Be=Gr(ee-he,0),Le=Ie(Ae+Be),$e=!U;++be<Ae;)Le[be]=f[be];for(;++W<he;)($e||W<ee)&&(Le[x[W]]=u[W]);for(;Be--;)Le[be++]=u[W++];return Le}i(P1,"composeArgs"),a(P1,"composeArgs");function B1(u,f,x,U){for(var W=-1,ee=u.length,he=-1,be=x.length,Ae=-1,Be=f.length,Le=Gr(ee-be,0),$e=Ie(Le+Be),Je=!U;++W<Le;)$e[W]=u[W];for(var pt=W;++Ae<Be;)$e[pt+Ae]=f[Ae];for(;++he<be;)(Je||W<ee)&&($e[pt+x[he]]=u[W++]);return $e}i(B1,"composeArgsRight"),a(B1,"composeArgsRight");function Mn(u,f){var x=-1,U=u.length;for(f||(f=Ie(U));++x<U;)f[x]=u[x];return f}i(Mn,"copyArray"),a(Mn,"copyArray");function Wi(u,f,x,U){var W=!x;x||(x={});for(var ee=-1,he=f.length;++ee<he;){var be=f[ee],Ae=U?U(x[be],u[be],be,x,u):r;Ae===r&&(Ae=u[be]),W?ws(x,be,Ae):zc(x,be,Ae)}return x}i(Wi,"copyObject"),a(Wi,"copyObject");function p5(u,f){return Wi(u,J1(u),f)}i(p5,"copySymbols"),a(p5,"copySymbols");function m5(u,f){return Wi(u,A5(u),f)}i(m5,"copySymbolsIn"),a(m5,"copySymbolsIn");function jl(u,f){return function(x,U){var W=Rt(x)?P6:P3,ee=f?f():{};return W(x,u,_t(U,2),ee)}}i(jl,"createAggregator"),a(jl,"createAggregator");function Po(u){return $t(function(f,x){var U=-1,W=x.length,ee=W>1?x[W-1]:r,he=W>2?x[2]:r;for(ee=u.length>3&&typeof ee=="function"?(W--,ee):r,he&&yn(x[0],x[1],he)&&(ee=W<3?r:ee,W=1),f=br(f);++U<W;){var be=x[U];be&&u(f,be,U,ee)}return f})}i(Po,"createAssigner"),a(Po,"createAssigner");function L1(u,f){return function(x,U){if(x==null)return x;if(!Cn(x))return u(x,U);for(var W=x.length,ee=f?W:-1,he=br(x);(f?ee--:++ee<W)&&U(he[ee],ee,he)!==!1;);return x}}i(L1,"createBaseEach"),a(L1,"createBaseEach");function F1(u){return function(f,x,U){for(var W=-1,ee=br(f),he=U(f),be=he.length;be--;){var Ae=he[u?be:++W];if(x(ee[Ae],Ae,ee)===!1)break}return f}}i(F1,"createBaseFor"),a(F1,"createBaseFor");function v5(u,f,x){var U=f&R,W=Gc(u);function ee(){var he=this&&this!==Lr&&this instanceof ee?W:u;return he.apply(U?x:this,arguments)}return i(ee,"wrapper"),a(ee,"wrapper"),ee}i(v5,"createBind"),a(v5,"createBind");function U1(u){return function(f){f=lr(f);var x=Oo(f)?Ci(f):r,U=x?x[0]:f.charAt(0),W=x?na(x,1).join(""):f.slice(1);return U[u]()+W}}i(U1,"createCaseFirst"),a(U1,"createCaseFirst");function Bo(u){return function(f){return Nd(Rv(kv(f).replace(El,"")),u,"")}}i(Bo,"createCompounder"),a(Bo,"createCompounder");function Gc(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var x=jc(u.prototype),U=u.apply(x,f);return Cr(U)?U:x}}i(Gc,"createCtor"),a(Gc,"createCtor");function g5(u,f,x){var U=Gc(u);function W(){for(var ee=arguments.length,he=Ie(ee),be=ee,Ae=Lo(W);be--;)he[be]=arguments[be];var Be=ee<3&&he[0]!==Ae&&he[ee-1]!==Ae?[]:ea(he,Ae);if(ee-=Be.length,ee<x)return q1(u,f,zl,W.placeholder,r,he,Be,r,r,x-ee);var Le=this&&this!==Lr&&this instanceof W?U:u;return Fn(Le,this,he)}return i(W,"wrapper"),a(W,"wrapper"),W}i(g5,"createCurry"),a(g5,"createCurry");function $1(u){return function(f,x,U){var W=br(f);if(!Cn(f)){var ee=_t(x,3);f=Wr(f),x=a(function(be){return ee(W[be],be,W)},"predicate")}var he=u(f,x,U);return he>-1?W[ee?f[he]:he]:r}}i($1,"createFind"),a($1,"createFind");function j1(u){return As(function(f){var x=f.length,U=x,W=ei.prototype.thru;for(u&&f.reverse();U--;){var ee=f[U];if(typeof ee!="function")throw new Ii(c);if(W&&!he&&Vl(ee)=="wrapper")var he=new ei([],!0)}for(U=he?U:x;++U<x;){ee=f[U];var be=Vl(ee),Ae=be=="wrapper"?Z1(ee):r;Ae&&Sh(Ae[0])&&Ae[1]==(k|$|V|H)&&!Ae[4].length&&Ae[9]==1?he=he[Vl(Ae[0])].apply(he,Ae[3]):he=ee.length==1&&Sh(ee)?he[be]():he.thru(ee)}return function(){var Be=arguments,Le=Be[0];if(he&&Be.length==1&&Rt(Le))return he.plant(Le).value();for(var $e=0,Je=x?f[$e].apply(this,Be):Le;++$e<x;)Je=f[$e].call(this,Je);return Je}})}i(j1,"createFlow"),a(j1,"createFlow");function zl(u,f,x,U,W,ee,he,be,Ae,Be){var Le=f&k,$e=f&R,Je=f&L,pt=f&($|j),St=f&se,Ft=Je?r:Gc(u);function wt(){for(var qt=arguments.length,Zt=Ie(qt),zn=qt;zn--;)Zt[zn]=arguments[zn];if(pt)var bn=Lo(wt),Hn=H6(Zt,bn);if(U&&(Zt=P1(Zt,U,W,pt)),ee&&(Zt=B1(Zt,ee,he,pt)),qt-=Hn,pt&&qt<Be){var Fr=ea(Zt,bn);return q1(u,f,zl,wt.placeholder,x,Zt,Fr,be,Ae,Be-qt)}var Ji=$e?x:this,ia=Je?Ji[u]:u;return qt=Zt.length,be?Zt=B5(Zt,be):St&&qt>1&&Zt.reverse(),Le&&Ae<qt&&(Zt.length=Ae),this&&this!==Lr&&this instanceof wt&&(ia=Ft||Gc(ia)),ia.apply(Ji,Zt)}return i(wt,"wrapper"),a(wt,"wrapper"),wt}i(zl,"createHybrid"),a(zl,"createHybrid");function z1(u,f){return function(x,U){return K3(x,u,f(U),{})}}i(z1,"createInverter"),a(z1,"createInverter");function Hl(u,f){return function(x,U){var W;if(x===r&&U===r)return f;if(x!==r&&(W=x),U!==r){if(W===r)return U;typeof x=="string"||typeof U=="string"?(x=$n(x),U=$n(U)):(x=C1(x),U=C1(U)),W=u(x,U)}return W}}i(Hl,"createMathOperation"),a(Hl,"createMathOperation");function yh(u){return As(function(f){return f=Tr(f,Un(_t())),$t(function(x){var U=this;return u(f,function(W){return Fn(W,U,x)})})})}i(yh,"createOver"),a(yh,"createOver");function ql(u,f){f=f===r?" ":$n(f);var x=f.length;if(x<2)return x?fh(f,u):f;var U=fh(f,Yd(u/Ro(f)));return Oo(f)?na(Ci(U),0,u).join(""):U.slice(0,u)}i(ql,"createPadding"),a(ql,"createPadding");function y5(u,f,x,U){var W=f&R,ee=Gc(u);function he(){for(var be=-1,Ae=arguments.length,Be=-1,Le=U.length,$e=Ie(Le+Ae),Je=this&&this!==Lr&&this instanceof he?ee:u;++Be<Le;)$e[Be]=U[Be];for(;Ae--;)$e[Be++]=arguments[++be];return Fn(Je,W?x:this,$e)}return i(he,"wrapper"),a(he,"wrapper"),he}i(y5,"createPartial"),a(y5,"createPartial");function H1(u){return function(f,x,U){return U&&typeof U!="number"&&yn(f,x,U)&&(x=U=r),f=Ts(f),x===r?(x=f,f=0):x=Ts(x),U=U===r?f<x?1:-1:Ts(U),n5(f,x,U,u)}}i(H1,"createRange"),a(H1,"createRange");function Kl(u){return function(f,x){return typeof f=="string"&&typeof x=="string"||(f=ii(f),x=ii(x)),u(f,x)}}i(Kl,"createRelationalOperation"),a(Kl,"createRelationalOperation");function q1(u,f,x,U,W,ee,he,be,Ae,Be){var Le=f&$,$e=Le?he:r,Je=Le?r:he,pt=Le?ee:r,St=Le?r:ee;f|=Le?V:G,f&=~(Le?G:V),f&K||(f&=~(R|L));var Ft=[u,f,W,pt,$e,St,Je,be,Ae,Be],wt=x.apply(r,Ft);return Sh(u)&&L5(wt,Ft),wt.placeholder=U,iv(wt,u,f)}i(q1,"createRecurry"),a(q1,"createRecurry");function bh(u){var f=Vr[u];return function(x,U){if(x=ii(x),U=U==null?0:mn(Nt(U),292),U&&s3(x)){var W=(lr(x)+"e").split("e"),ee=f(W[0]+"e"+(+W[1]+U));return W=(lr(ee)+"e").split("e"),+(W[0]+"e"+(+W[1]-U))}return f(x)}}i(bh,"createRound"),a(bh,"createRound");var vk=Uc&&1/Cl(new Uc([,-0]))[1]==g?function(u){return new Uc(u)}:Bh;function K1(u){return function(f){var x=gn(f);return x==ve?jd(f):x==Q?W6(f):z6(f,u(f))}}i(K1,"createToPairs"),a(K1,"createToPairs");function Es(u,f,x,U,W,ee,he,be){var Ae=f&L;if(!Ae&&typeof u!="function")throw new Ii(c);var Be=U?U.length:0;if(Be||(f&=~(V|G),U=W=r),he=he===r?he:Gr(Nt(he),0),be=be===r?be:Nt(be),Be-=W?W.length:0,f&G){var Le=U,$e=W;U=W=r}var Je=Ae?r:Z1(u),pt=[u,f,x,U,W,Le,$e,ee,he,be];if(Je&&R5(pt,Je),u=pt[0],f=pt[1],x=pt[2],U=pt[3],W=pt[4],be=pt[9]=pt[9]===r?Ae?0:u.length:Gr(pt[9]-Be,0),!be&&f&($|j)&&(f&=~($|j)),!f||f==R)var St=v5(u,f,x);else f==$||f==j?St=g5(u,f,be):(f==V||f==(R|V))&&!W.length?St=y5(u,f,x,U):St=zl.apply(r,pt);var Ft=Je?a5:L5;return iv(Ft(St,pt),u,f)}i(Es,"createWrap"),a(Es,"createWrap");function V1(u,f,x,U){return u===r||ki(u,Fc[x])&&!vr.call(U,x)?f:u}i(V1,"customDefaultsAssignIn"),a(V1,"customDefaultsAssignIn");function G1(u,f,x,U,W,ee){return Cr(u)&&Cr(f)&&(ee.set(f,u),Fl(u,f,r,G1,ee),ee.delete(f)),u}i(G1,"customDefaultsMerge"),a(G1,"customDefaultsMerge");function b5(u){return Zc(u)?r:u}i(b5,"customOmitClone"),a(b5,"customOmitClone");function W1(u,f,x,U,W,ee){var he=x&C,be=u.length,Ae=f.length;if(be!=Ae&&!(he&&Ae>be))return!1;var Be=ee.get(u),Le=ee.get(f);if(Be&&Le)return Be==f&&Le==u;var $e=-1,Je=!0,pt=x&O?new Oa:r;for(ee.set(u,f),ee.set(f,u);++$e<be;){var St=u[$e],Ft=f[$e];if(U)var wt=he?U(Ft,St,$e,f,u,ee):U(St,Ft,$e,u,f,ee);if(wt!==r){if(wt)continue;Je=!1;break}if(pt){if(!Pd(f,function(qt,Zt){if(!Lc(pt,Zt)&&(St===qt||W(St,qt,x,U,ee)))return pt.push(Zt)})){Je=!1;break}}else if(!(St===Ft||W(St,Ft,x,U,ee))){Je=!1;break}}return ee.delete(u),ee.delete(f),Je}i(W1,"equalArrays"),a(W1,"equalArrays");function _5(u,f,x,U,W,ee,he){switch(x){case fe:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case rt:return!(u.byteLength!=f.byteLength||!ee(new Gd(u),new Gd(f)));case Y:case J:case De:return ki(+u,+f);case z:return u.name==f.name&&u.message==f.message;case _e:case ge:return u==f+"";case ve:var be=jd;case Q:var Ae=U&C;if(be||(be=Cl),u.size!=f.size&&!Ae)return!1;var Be=he.get(u);if(Be)return Be==f;U|=O,he.set(u,f);var Le=W1(be(u),be(f),U,W,ee,he);return he.delete(u),Le;case Me:if(Rl)return Rl.call(u)==Rl.call(f)}return!1}i(_5,"equalByTag"),a(_5,"equalByTag");function w5(u,f,x,U,W,ee){var he=x&C,be=_h(u),Ae=be.length,Be=_h(f),Le=Be.length;if(Ae!=Le&&!he)return!1;for(var $e=Ae;$e--;){var Je=be[$e];if(!(he?Je in f:vr.call(f,Je)))return!1}var pt=ee.get(u),St=ee.get(f);if(pt&&St)return pt==f&&St==u;var Ft=!0;ee.set(u,f),ee.set(f,u);for(var wt=he;++$e<Ae;){Je=be[$e];var qt=u[Je],Zt=f[Je];if(U)var zn=he?U(Zt,qt,Je,f,u,ee):U(qt,Zt,Je,u,f,ee);if(!(zn===r?qt===Zt||W(qt,Zt,x,U,ee):zn)){Ft=!1;break}wt||(wt=Je=="constructor")}if(Ft&&!wt){var bn=u.constructor,Hn=f.constructor;bn!=Hn&&"constructor"in u&&"constructor"in f&&!(typeof bn=="function"&&bn instanceof bn&&typeof Hn=="function"&&Hn instanceof Hn)&&(Ft=!1)}return ee.delete(u),ee.delete(f),Ft}i(w5,"equalObjects"),a(w5,"equalObjects");function As(u){return nv(tv(u,r,uv),u+"")}i(As,"flatRest"),a(As,"flatRest");function _h(u){return v1(u,Wr,J1)}i(_h,"getAllKeys"),a(_h,"getAllKeys");function wh(u){return v1(u,In,A5)}i(wh,"getAllKeysIn"),a(wh,"getAllKeysIn");var Z1=Qd?function(u){return Qd.get(u)}:Bh;function Vl(u){for(var f=u.name+"",x=$c[f],U=vr.call($c,f)?x.length:0;U--;){var W=x[U],ee=W.func;if(ee==null||ee==u)return W.name}return f}i(Vl,"getFuncName"),a(Vl,"getFuncName");function Lo(u){var f=vr.call(X,"placeholder")?X:u;return f.placeholder}i(Lo,"getHolder"),a(Lo,"getHolder");function _t(){var u=X.iteratee||Nh;return u=u===Nh?b1:u,arguments.length?u(arguments[0],arguments[1]):u}i(_t,"getIteratee"),a(_t,"getIteratee");function Gl(u,f){var x=u.__data__;return D5(f)?x[typeof f=="string"?"string":"hash"]:x.map}i(Gl,"getMapData"),a(Gl,"getMapData");function Eh(u){for(var f=Wr(u),x=f.length;x--;){var U=f[x],W=u[U];f[x]=[U,W,Q1(W)]}return f}i(Eh,"getMatchData"),a(Eh,"getMatchData");function Ba(u,f){var x=K6(u,f);return y1(x)?x:r}i(Ba,"getNative"),a(Ba,"getNative");function E5(u){var f=vr.call(u,No),x=u[No];try{u[No]=r;var U=!0}catch{}var W=Kd.call(u);return U&&(f?u[No]=x:delete u[No]),W}i(E5,"getRawTag"),a(E5,"getRawTag");var J1=a1?function(u){return u==null?[]:(u=br(u),Xs(a1(u),function(f){return n3.call(u,f)}))}:Lh,A5=a1?function(u){for(var f=[];u;)Qs(f,J1(u)),u=Wd(u);return f}:Lh,gn=vn;(o1&&gn(new o1(new ArrayBuffer(1)))!=fe||Dl&&gn(new Dl)!=ve||c1&&gn(c1.resolve())!=Ce||Uc&&gn(new Uc)!=Q||kl&&gn(new kl)!=Re)&&(gn=a(function(u){var f=vn(u),x=f==de?u.constructor:r,U=x?La(x):"";if(U)switch(U){case uk:return fe;case lk:return ve;case fk:return Ce;case dk:return Q;case hk:return Re}return f},"getTag"));function S5(u,f,x){for(var U=-1,W=x.length;++U<W;){var ee=x[U],he=ee.size;switch(ee.type){case"drop":u+=he;break;case"dropRight":f-=he;break;case"take":f=mn(f,u+he);break;case"takeRight":u=Gr(u,f-he);break}}return{start:u,end:f}}i(S5,"getView"),a(S5,"getView");function x5(u){var f=u.match(Ze);return f?f[1].split(ar):[]}i(x5,"getWrapDetails"),a(x5,"getWrapDetails");function Y1(u,f,x){f=ra(f,u);for(var U=-1,W=f.length,ee=!1;++U<W;){var he=Zi(f[U]);if(!(ee=u!=null&&x(u,he)))break;u=u[he]}return ee||++U!=W?ee:(W=u==null?0:u.length,!!W&&ef(W)&&Ss(he,W)&&(Rt(u)||Fo(u)))}i(Y1,"hasPath"),a(Y1,"hasPath");function T5(u){var f=u.length,x=new u.constructor(f);return f&&typeof u[0]=="string"&&vr.call(u,"index")&&(x.index=u.index,x.input=u.input),x}i(T5,"initCloneArray"),a(T5,"initCloneArray");function X1(u){return typeof u.constructor=="function"&&!Wc(u)?jc(Wd(u)):{}}i(X1,"initCloneObject"),a(X1,"initCloneObject");function M5(u,f,x){var U=u.constructor;switch(f){case rt:return gh(u);case Y:case J:return new U(+u);case fe:return l5(u,x);case ce:case Z:case re:case ye:case Se:case xe:case ke:case Mt:case qe:return R1(u,x);case ve:return new U;case De:case ge:return new U(u);case _e:return f5(u);case Q:return new U;case Me:return d5(u)}}i(M5,"initCloneByTag"),a(M5,"initCloneByTag");function C5(u,f){var x=f.length;if(!x)return u;var U=x-1;return f[U]=(x>1?"& ":"")+f[U],f=f.join(x>2?", ":" "),u.replace(at,`{
|
|
25
|
+
/* [wrapped with `+f+`] */
|
|
26
|
+
`)}i(C5,"insertWrapDetails"),a(C5,"insertWrapDetails");function I5(u){return Rt(u)||Fo(u)||!!(i3&&u&&u[i3])}i(I5,"isFlattenable"),a(I5,"isFlattenable");function Ss(u,f){var x=typeof u;return f=f??_,!!f&&(x=="number"||x!="symbol"&&rn.test(u))&&u>-1&&u%1==0&&u<f}i(Ss,"isIndex"),a(Ss,"isIndex");function yn(u,f,x){if(!Cr(x))return!1;var U=typeof f;return(U=="number"?Cn(x)&&Ss(f,x.length):U=="string"&&f in x)?ki(x[f],u):!1}i(yn,"isIterateeCall"),a(yn,"isIterateeCall");function Ah(u,f){if(Rt(u))return!1;var x=typeof u;return x=="number"||x=="symbol"||x=="boolean"||u==null||jn(u)?!0:it.test(u)||!ir.test(u)||f!=null&&u in br(f)}i(Ah,"isKey"),a(Ah,"isKey");function D5(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}i(D5,"isKeyable"),a(D5,"isKeyable");function Sh(u){var f=Vl(u),x=X[f];if(typeof x!="function"||!(f in Vt.prototype))return!1;if(u===x)return!0;var U=Z1(x);return!!U&&u===U[0]}i(Sh,"isLaziable"),a(Sh,"isLaziable");function k5(u){return!!e3&&e3 in u}i(k5,"isMasked"),a(k5,"isMasked");var gk=Hd?xs:Fh;function Wc(u){var f=u&&u.constructor,x=typeof f=="function"&&f.prototype||Fc;return u===x}i(Wc,"isPrototype"),a(Wc,"isPrototype");function Q1(u){return u===u&&!Cr(u)}i(Q1,"isStrictComparable"),a(Q1,"isStrictComparable");function ev(u,f){return function(x){return x==null?!1:x[u]===f&&(f!==r||u in br(x))}}i(ev,"matchesStrictComparable"),a(ev,"matchesStrictComparable");function O5(u){var f=Xl(u,function(U){return x.size===p&&x.clear(),U}),x=f.cache;return f}i(O5,"memoizeCapped"),a(O5,"memoizeCapped");function R5(u,f){var x=u[1],U=f[1],W=x|U,ee=W<(R|L|k),he=U==k&&x==$||U==k&&x==H&&u[7].length<=f[8]||U==(k|H)&&f[7].length<=f[8]&&x==$;if(!(ee||he))return u;U&R&&(u[2]=f[2],W|=x&R?0:K);var be=f[3];if(be){var Ae=u[3];u[3]=Ae?P1(Ae,be,f[4]):be,u[4]=Ae?ea(u[3],v):f[4]}return be=f[5],be&&(Ae=u[5],u[5]=Ae?B1(Ae,be,f[6]):be,u[6]=Ae?ea(u[5],v):f[6]),be=f[7],be&&(u[7]=be),U&k&&(u[8]=u[8]==null?f[8]:mn(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=W,u}i(R5,"mergeData"),a(R5,"mergeData");function N5(u){var f=[];if(u!=null)for(var x in br(u))f.push(x);return f}i(N5,"nativeKeysIn"),a(N5,"nativeKeysIn");function P5(u){return Kd.call(u)}i(P5,"objectToString"),a(P5,"objectToString");function tv(u,f,x){return f=Gr(f===r?u.length-1:f,0),function(){for(var U=arguments,W=-1,ee=Gr(U.length-f,0),he=Ie(ee);++W<ee;)he[W]=U[f+W];W=-1;for(var be=Ie(f+1);++W<f;)be[W]=U[W];return be[f]=x(he),Fn(u,this,be)}}i(tv,"overRest"),a(tv,"overRest");function rv(u,f){return f.length<2?u:Pa(u,ri(f,0,-1))}i(rv,"parent"),a(rv,"parent");function B5(u,f){for(var x=u.length,U=mn(f.length,x),W=Mn(u);U--;){var ee=f[U];u[U]=Ss(ee,x)?W[ee]:r}return u}i(B5,"reorder"),a(B5,"reorder");function xh(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}i(xh,"safeGet"),a(xh,"safeGet");var L5=sv(a5),Wl=rk||function(u,f){return Lr.setTimeout(u,f)},nv=sv(pk);function iv(u,f,x){var U=f+"";return nv(u,C5(U,U5(x5(U),x)))}i(iv,"setWrapToString"),a(iv,"setWrapToString");function sv(u){var f=0,x=0;return function(){var U=ak(),W=E-(U-x);if(x=U,W>0){if(++f>=q)return arguments[0]}else f=0;return u.apply(r,arguments)}}i(sv,"shortOut"),a(sv,"shortOut");function Zl(u,f){var x=-1,U=u.length,W=U-1;for(f=f===r?U:f;++x<f;){var ee=lh(x,W),he=u[ee];u[ee]=u[x],u[x]=he}return u.length=f,u}i(Zl,"shuffleSelf"),a(Zl,"shuffleSelf");var F5=O5(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(Ye,function(x,U,W,ee){f.push(W?ee.replace(Sn,"$1"):U||x)}),f});function Zi(u){if(typeof u=="string"||jn(u))return u;var f=u+"";return f=="0"&&1/u==-g?"-0":f}i(Zi,"toKey"),a(Zi,"toKey");function La(u){if(u!=null){try{return qd.call(u)}catch{}try{return u+""}catch{}}return""}i(La,"toSource"),a(La,"toSource");function U5(u,f){return Qn(D,function(x){var U="_."+x[0];f&x[1]&&!Tl(u,U)&&u.push(U)}),u.sort()}i(U5,"updateWrapDetails"),a(U5,"updateWrapDetails");function av(u){if(u instanceof Vt)return u.clone();var f=new ei(u.__wrapped__,u.__chain__);return f.__actions__=Mn(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}i(av,"wrapperClone"),a(av,"wrapperClone");function $5(u,f,x){(x?yn(u,f,x):f===r)?f=1:f=Gr(Nt(f),0);var U=u==null?0:u.length;if(!U||f<1)return[];for(var W=0,ee=0,he=Ie(Yd(U/f));W<U;)he[ee++]=ri(u,W,W+=f);return he}i($5,"chunk"),a($5,"chunk");function j5(u){for(var f=-1,x=u==null?0:u.length,U=0,W=[];++f<x;){var ee=u[f];ee&&(W[U++]=ee)}return W}i(j5,"compact"),a(j5,"compact");function z5(){var u=arguments.length;if(!u)return[];for(var f=Ie(u-1),x=arguments[0],U=u;U--;)f[U-1]=arguments[U];return Qs(Rt(x)?Mn(x):[x],Jr(f,1))}i(z5,"concat4"),a(z5,"concat");var yk=$t(function(u,f){return Rr(u)?Hc(u,Jr(f,1,Rr,!0)):[]}),bk=$t(function(u,f){var x=ni(f);return Rr(x)&&(x=r),Rr(u)?Hc(u,Jr(f,1,Rr,!0),_t(x,2)):[]}),_k=$t(function(u,f){var x=ni(f);return Rr(x)&&(x=r),Rr(u)?Hc(u,Jr(f,1,Rr,!0),r,x):[]});function H5(u,f,x){var U=u==null?0:u.length;return U?(f=x||f===r?1:Nt(f),ri(u,f<0?0:f,U)):[]}i(H5,"drop"),a(H5,"drop");function q5(u,f,x){var U=u==null?0:u.length;return U?(f=x||f===r?1:Nt(f),f=U-f,ri(u,0,f<0?0:f)):[]}i(q5,"dropRight"),a(q5,"dropRight");function K5(u,f){return u&&u.length?$l(u,_t(f,3),!0,!0):[]}i(K5,"dropRightWhile"),a(K5,"dropRightWhile");function V5(u,f){return u&&u.length?$l(u,_t(f,3),!0):[]}i(V5,"dropWhile"),a(V5,"dropWhile");function G5(u,f,x,U){var W=u==null?0:u.length;return W?(x&&typeof x!="number"&&yn(u,f,x)&&(x=0,U=W),$3(u,f,x,U)):[]}i(G5,"fill"),a(G5,"fill");function ov(u,f,x){var U=u==null?0:u.length;if(!U)return-1;var W=x==null?0:Nt(x);return W<0&&(W=Gr(U+W,0)),Ml(u,_t(f,3),W)}i(ov,"findIndex"),a(ov,"findIndex");function cv(u,f,x){var U=u==null?0:u.length;if(!U)return-1;var W=U-1;return x!==r&&(W=Nt(x),W=x<0?Gr(U+W,0):mn(W,U-1)),Ml(u,_t(f,3),W,!0)}i(cv,"findLastIndex"),a(cv,"findLastIndex");function uv(u){var f=u==null?0:u.length;return f?Jr(u,1):[]}i(uv,"flatten"),a(uv,"flatten");function W5(u){var f=u==null?0:u.length;return f?Jr(u,g):[]}i(W5,"flattenDeep"),a(W5,"flattenDeep");function Z5(u,f){var x=u==null?0:u.length;return x?(f=f===r?1:Nt(f),Jr(u,f)):[]}i(Z5,"flattenDepth"),a(Z5,"flattenDepth");function J5(u){for(var f=-1,x=u==null?0:u.length,U={};++f<x;){var W=u[f];U[W[0]]=W[1]}return U}i(J5,"fromPairs"),a(J5,"fromPairs");function lv(u){return u&&u.length?u[0]:r}i(lv,"head"),a(lv,"head");function Y5(u,f,x){var U=u==null?0:u.length;if(!U)return-1;var W=x==null?0:Nt(x);return W<0&&(W=Gr(U+W,0)),ko(u,f,W)}i(Y5,"indexOf"),a(Y5,"indexOf");function X5(u){var f=u==null?0:u.length;return f?ri(u,0,-1):[]}i(X5,"initial"),a(X5,"initial");var wk=$t(function(u){var f=Tr(u,mh);return f.length&&f[0]===u[0]?sh(f):[]}),Ek=$t(function(u){var f=ni(u),x=Tr(u,mh);return f===ni(x)?f=r:x.pop(),x.length&&x[0]===u[0]?sh(x,_t(f,2)):[]}),Ak=$t(function(u){var f=ni(u),x=Tr(u,mh);return f=typeof f=="function"?f:r,f&&x.pop(),x.length&&x[0]===u[0]?sh(x,r,f):[]});function Q5(u,f){return u==null?"":ik.call(u,f)}i(Q5,"join"),a(Q5,"join");function ni(u){var f=u==null?0:u.length;return f?u[f-1]:r}i(ni,"last2"),a(ni,"last");function e_(u,f,x){var U=u==null?0:u.length;if(!U)return-1;var W=U;return x!==r&&(W=Nt(x),W=W<0?Gr(U+W,0):mn(W,U-1)),f===f?J6(u,f,W):Ml(u,Ym,W,!0)}i(e_,"lastIndexOf"),a(e_,"lastIndexOf");function t_(u,f){return u&&u.length?A1(u,Nt(f)):r}i(t_,"nth"),a(t_,"nth");var Sk=$t(fv);function fv(u,f){return u&&u.length&&f&&f.length?uh(u,f):u}i(fv,"pullAll"),a(fv,"pullAll");function r_(u,f,x){return u&&u.length&&f&&f.length?uh(u,f,_t(x,2)):u}i(r_,"pullAllBy"),a(r_,"pullAllBy");function n_(u,f,x){return u&&u.length&&f&&f.length?uh(u,f,r,x):u}i(n_,"pullAllWith"),a(n_,"pullAllWith");var xk=As(function(u,f){var x=u==null?0:u.length,U=rh(u,f);return T1(u,Tr(f,function(W){return Ss(W,x)?+W:W}).sort(N1)),U});function i_(u,f){var x=[];if(!(u&&u.length))return x;var U=-1,W=[],ee=u.length;for(f=_t(f,3);++U<ee;){var he=u[U];f(he,U,u)&&(x.push(he),W.push(U))}return T1(u,W),x}i(i_,"remove"),a(i_,"remove");function Th(u){return u==null?u:ck.call(u)}i(Th,"reverse"),a(Th,"reverse");function s_(u,f,x){var U=u==null?0:u.length;return U?(x&&typeof x!="number"&&yn(u,f,x)?(f=0,x=U):(f=f==null?0:Nt(f),x=x===r?U:Nt(x)),ri(u,f,x)):[]}i(s_,"slice2"),a(s_,"slice");function a_(u,f){return Ul(u,f)}i(a_,"sortedIndex"),a(a_,"sortedIndex");function o_(u,f,x){return dh(u,f,_t(x,2))}i(o_,"sortedIndexBy"),a(o_,"sortedIndexBy");function c_(u,f){var x=u==null?0:u.length;if(x){var U=Ul(u,f);if(U<x&&ki(u[U],f))return U}return-1}i(c_,"sortedIndexOf"),a(c_,"sortedIndexOf");function u_(u,f){return Ul(u,f,!0)}i(u_,"sortedLastIndex"),a(u_,"sortedLastIndex");function l_(u,f,x){return dh(u,f,_t(x,2),!0)}i(l_,"sortedLastIndexBy"),a(l_,"sortedLastIndexBy");function f_(u,f){var x=u==null?0:u.length;if(x){var U=Ul(u,f,!0)-1;if(ki(u[U],f))return U}return-1}i(f_,"sortedLastIndexOf"),a(f_,"sortedLastIndexOf");function d_(u){return u&&u.length?M1(u):[]}i(d_,"sortedUniq"),a(d_,"sortedUniq");function h_(u,f){return u&&u.length?M1(u,_t(f,2)):[]}i(h_,"sortedUniqBy"),a(h_,"sortedUniqBy");function p_(u){var f=u==null?0:u.length;return f?ri(u,1,f):[]}i(p_,"tail"),a(p_,"tail");function m_(u,f,x){return u&&u.length?(f=x||f===r?1:Nt(f),ri(u,0,f<0?0:f)):[]}i(m_,"take2"),a(m_,"take");function v_(u,f,x){var U=u==null?0:u.length;return U?(f=x||f===r?1:Nt(f),f=U-f,ri(u,f<0?0:f,U)):[]}i(v_,"takeRight"),a(v_,"takeRight");function g_(u,f){return u&&u.length?$l(u,_t(f,3),!1,!0):[]}i(g_,"takeRightWhile"),a(g_,"takeRightWhile");function y_(u,f){return u&&u.length?$l(u,_t(f,3)):[]}i(y_,"takeWhile"),a(y_,"takeWhile");var Tk=$t(function(u){return ta(Jr(u,1,Rr,!0))}),Mk=$t(function(u){var f=ni(u);return Rr(f)&&(f=r),ta(Jr(u,1,Rr,!0),_t(f,2))}),Ck=$t(function(u){var f=ni(u);return f=typeof f=="function"?f:r,ta(Jr(u,1,Rr,!0),r,f)});function b_(u){return u&&u.length?ta(u):[]}i(b_,"uniq"),a(b_,"uniq");function __(u,f){return u&&u.length?ta(u,_t(f,2)):[]}i(__,"uniqBy"),a(__,"uniqBy");function w_(u,f){return f=typeof f=="function"?f:r,u&&u.length?ta(u,r,f):[]}i(w_,"uniqWith"),a(w_,"uniqWith");function Mh(u){if(!(u&&u.length))return[];var f=0;return u=Xs(u,function(x){if(Rr(x))return f=Gr(x.length,f),!0}),Ud(f,function(x){return Tr(u,Bd(x))})}i(Mh,"unzip"),a(Mh,"unzip");function dv(u,f){if(!(u&&u.length))return[];var x=Mh(u);return f==null?x:Tr(x,function(U){return Fn(f,r,U)})}i(dv,"unzipWith"),a(dv,"unzipWith");var Ik=$t(function(u,f){return Rr(u)?Hc(u,f):[]}),Dk=$t(function(u){return ph(Xs(u,Rr))}),kk=$t(function(u){var f=ni(u);return Rr(f)&&(f=r),ph(Xs(u,Rr),_t(f,2))}),Ok=$t(function(u){var f=ni(u);return f=typeof f=="function"?f:r,ph(Xs(u,Rr),r,f)}),Rk=$t(Mh);function E_(u,f){return k1(u||[],f||[],zc)}i(E_,"zipObject"),a(E_,"zipObject");function A_(u,f){return k1(u||[],f||[],Vc)}i(A_,"zipObjectDeep"),a(A_,"zipObjectDeep");var Nk=$t(function(u){var f=u.length,x=f>1?u[f-1]:r;return x=typeof x=="function"?(u.pop(),x):r,dv(u,x)});function hv(u){var f=X(u);return f.__chain__=!0,f}i(hv,"chain"),a(hv,"chain");function S_(u,f){return f(u),u}i(S_,"tap"),a(S_,"tap");function Jl(u,f){return f(u)}i(Jl,"thru"),a(Jl,"thru");var Pk=As(function(u){var f=u.length,x=f?u[0]:0,U=this.__wrapped__,W=a(function(ee){return rh(ee,u)},"interceptor");return f>1||this.__actions__.length||!(U instanceof Vt)||!Ss(x)?this.thru(W):(U=U.slice(x,+x+(f?1:0)),U.__actions__.push({func:Jl,args:[W],thisArg:r}),new ei(U,this.__chain__).thru(function(ee){return f&&!ee.length&&ee.push(r),ee}))});function x_(){return hv(this)}i(x_,"wrapperChain"),a(x_,"wrapperChain");function T_(){return new ei(this.value(),this.__chain__)}i(T_,"wrapperCommit"),a(T_,"wrapperCommit");function M_(){this.__values__===r&&(this.__values__=Tv(this.value()));var u=this.__index__>=this.__values__.length,f=u?r:this.__values__[this.__index__++];return{done:u,value:f}}i(M_,"wrapperNext"),a(M_,"wrapperNext");function C_(){return this}i(C_,"wrapperToIterator"),a(C_,"wrapperToIterator");function I_(u){for(var f,x=this;x instanceof Nl;){var U=av(x);U.__index__=0,U.__values__=r,f?W.__wrapped__=U:f=U;var W=U;x=x.__wrapped__}return W.__wrapped__=u,f}i(I_,"wrapperPlant"),a(I_,"wrapperPlant");function D_(){var u=this.__wrapped__;if(u instanceof Vt){var f=u;return this.__actions__.length&&(f=new Vt(this)),f=f.reverse(),f.__actions__.push({func:Jl,args:[Th],thisArg:r}),new ei(f,this.__chain__)}return this.thru(Th)}i(D_,"wrapperReverse"),a(D_,"wrapperReverse");function k_(){return D1(this.__wrapped__,this.__actions__)}i(k_,"wrapperValue"),a(k_,"wrapperValue");var Bk=jl(function(u,f,x){vr.call(u,x)?++u[x]:ws(u,x,1)});function O_(u,f,x){var U=Rt(u)?Zm:U3;return x&&yn(u,f,x)&&(f=r),U(u,_t(f,3))}i(O_,"every"),a(O_,"every");function R_(u,f){var x=Rt(u)?Xs:p1;return x(u,_t(f,3))}i(R_,"filter2"),a(R_,"filter");var Lk=$1(ov),Fk=$1(cv);function N_(u,f){return Jr(Yl(u,f),1)}i(N_,"flatMap"),a(N_,"flatMap");function P_(u,f){return Jr(Yl(u,f),g)}i(P_,"flatMapDeep"),a(P_,"flatMapDeep");function B_(u,f,x){return x=x===r?1:Nt(x),Jr(Yl(u,f),x)}i(B_,"flatMapDepth"),a(B_,"flatMapDepth");function pv(u,f){var x=Rt(u)?Qn:Na;return x(u,_t(f,3))}i(pv,"forEach"),a(pv,"forEach");function mv(u,f){var x=Rt(u)?B6:F3;return x(u,_t(f,3))}i(mv,"forEachRight"),a(mv,"forEachRight");var Uk=jl(function(u,f,x){vr.call(u,x)?u[x].push(f):ws(u,x,[f])});function L_(u,f,x,U){u=Cn(u)?u:Uo(u),x=x&&!U?Nt(x):0;var W=u.length;return x<0&&(x=Gr(W+x,0)),tf(u)?x<=W&&u.indexOf(f,x)>-1:!!W&&ko(u,f,x)>-1}i(L_,"includes"),a(L_,"includes");var $k=$t(function(u,f,x){var U=-1,W=typeof f=="function",ee=Cn(u)?Ie(u.length):[];return Na(u,function(he){ee[++U]=W?Fn(f,he,x):qc(he,f,x)}),ee}),jk=jl(function(u,f,x){ws(u,x,f)});function Yl(u,f){var x=Rt(u)?Tr:_1;return x(u,_t(f,3))}i(Yl,"map2"),a(Yl,"map");function F_(u,f,x,U){return u==null?[]:(Rt(f)||(f=f==null?[]:[f]),x=U?r:x,Rt(x)||(x=x==null?[]:[x]),S1(u,f,x))}i(F_,"orderBy"),a(F_,"orderBy");var zk=jl(function(u,f,x){u[x?0:1].push(f)},function(){return[[],[]]});function U_(u,f,x){var U=Rt(u)?Nd:Qm,W=arguments.length<3;return U(u,_t(f,4),x,W,Na)}i(U_,"reduce"),a(U_,"reduce");function $_(u,f,x){var U=Rt(u)?L6:Qm,W=arguments.length<3;return U(u,_t(f,4),x,W,F3)}i($_,"reduceRight"),a($_,"reduceRight");function j_(u,f){var x=Rt(u)?Xs:p1;return x(u,Ql(_t(f,3)))}i(j_,"reject"),a(j_,"reject");function z_(u){var f=Rt(u)?l1:i5;return f(u)}i(z_,"sample"),a(z_,"sample");function H_(u,f,x){(x?yn(u,f,x):f===r)?f=1:f=Nt(f);var U=Rt(u)?R3:s5;return U(u,f)}i(H_,"sampleSize"),a(H_,"sampleSize");function q_(u){var f=Rt(u)?N3:o5;return f(u)}i(q_,"shuffle"),a(q_,"shuffle");function K_(u){if(u==null)return 0;if(Cn(u))return tf(u)?Ro(u):u.length;var f=gn(u);return f==ve||f==Q?u.size:oh(u).length}i(K_,"size"),a(K_,"size");function V_(u,f,x){var U=Rt(u)?Pd:c5;return x&&yn(u,f,x)&&(f=r),U(u,_t(f,3))}i(V_,"some"),a(V_,"some");var Hk=$t(function(u,f){if(u==null)return[];var x=f.length;return x>1&&yn(u,f[0],f[1])?f=[]:x>2&&yn(f[0],f[1],f[2])&&(f=[f[0]]),S1(u,Jr(f,1),[])}),Ch=tk||function(){return Lr.Date.now()};function G_(u,f){if(typeof f!="function")throw new Ii(c);return u=Nt(u),function(){if(--u<1)return f.apply(this,arguments)}}i(G_,"after"),a(G_,"after");function vv(u,f,x){return f=x?r:f,f=u&&f==null?u.length:f,Es(u,k,r,r,r,r,f)}i(vv,"ary"),a(vv,"ary");function gv(u,f){var x;if(typeof f!="function")throw new Ii(c);return u=Nt(u),function(){return--u>0&&(x=f.apply(this,arguments)),u<=1&&(f=r),x}}i(gv,"before"),a(gv,"before");var yv=$t(function(u,f,x){var U=R;if(x.length){var W=ea(x,Lo(yv));U|=V}return Es(u,U,f,x,W)}),W_=$t(function(u,f,x){var U=R|L;if(x.length){var W=ea(x,Lo(W_));U|=V}return Es(f,U,u,x,W)});function bv(u,f,x){f=x?r:f;var U=Es(u,$,r,r,r,r,r,f);return U.placeholder=bv.placeholder,U}i(bv,"curry"),a(bv,"curry");function _v(u,f,x){f=x?r:f;var U=Es(u,j,r,r,r,r,r,f);return U.placeholder=_v.placeholder,U}i(_v,"curryRight"),a(_v,"curryRight");function wv(u,f,x){var U,W,ee,he,be,Ae,Be=0,Le=!1,$e=!1,Je=!0;if(typeof u!="function")throw new Ii(c);f=ii(f)||0,Cr(x)&&(Le=!!x.leading,$e="maxWait"in x,ee=$e?Gr(ii(x.maxWait)||0,f):ee,Je="trailing"in x?!!x.trailing:Je);function pt(Fr){var Ji=U,ia=W;return U=W=r,Be=Fr,he=u.apply(ia,Ji),he}i(pt,"invokeFunc"),a(pt,"invokeFunc");function St(Fr){return Be=Fr,be=Wl(qt,f),Le?pt(Fr):he}i(St,"leadingEdge"),a(St,"leadingEdge");function Ft(Fr){var Ji=Fr-Ae,ia=Fr-Be,q4=f-Ji;return $e?mn(q4,ee-ia):q4}i(Ft,"remainingWait"),a(Ft,"remainingWait");function wt(Fr){var Ji=Fr-Ae,ia=Fr-Be;return Ae===r||Ji>=f||Ji<0||$e&&ia>=ee}i(wt,"shouldInvoke"),a(wt,"shouldInvoke");function qt(){var Fr=Ch();if(wt(Fr))return Zt(Fr);be=Wl(qt,Ft(Fr))}i(qt,"timerExpired"),a(qt,"timerExpired");function Zt(Fr){return be=r,Je&&U?pt(Fr):(U=W=r,he)}i(Zt,"trailingEdge"),a(Zt,"trailingEdge");function zn(){be!==r&&u5(be),Be=0,U=Ae=W=be=r}i(zn,"cancel"),a(zn,"cancel");function bn(){return be===r?he:Zt(Ch())}i(bn,"flush"),a(bn,"flush");function Hn(){var Fr=Ch(),Ji=wt(Fr);if(U=arguments,W=this,Ae=Fr,Ji){if(be===r)return St(Ae);if($e)return u5(be),be=Wl(qt,f),pt(Ae)}return be===r&&(be=Wl(qt,f)),he}return i(Hn,"debounced"),a(Hn,"debounced"),Hn.cancel=zn,Hn.flush=bn,Hn}i(wv,"debounce"),a(wv,"debounce");var qk=$t(function(u,f){return h1(u,1,f)}),Kk=$t(function(u,f,x){return h1(u,ii(f)||0,x)});function Z_(u){return Es(u,se)}i(Z_,"flip"),a(Z_,"flip");function Xl(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new Ii(c);var x=a(function(){var U=arguments,W=f?f.apply(this,U):U[0],ee=x.cache;if(ee.has(W))return ee.get(W);var he=u.apply(this,U);return x.cache=ee.set(W,he)||ee,he},"memoized");return x.cache=new(Xl.Cache||_s),x}i(Xl,"memoize"),a(Xl,"memoize"),Xl.Cache=_s;function Ql(u){if(typeof u!="function")throw new Ii(c);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}i(Ql,"negate"),a(Ql,"negate");function J_(u){return gv(2,u)}i(J_,"once"),a(J_,"once");var Vk=mk(function(u,f){f=f.length==1&&Rt(f[0])?Tr(f[0],Un(_t())):Tr(Jr(f,1),Un(_t()));var x=f.length;return $t(function(U){for(var W=-1,ee=mn(U.length,x);++W<ee;)U[W]=f[W].call(this,U[W]);return Fn(u,this,U)})}),Ev=$t(function(u,f){var x=ea(f,Lo(Ev));return Es(u,V,r,f,x)}),Y_=$t(function(u,f){var x=ea(f,Lo(Y_));return Es(u,G,r,f,x)}),Gk=As(function(u,f){return Es(u,H,r,r,r,f)});function X_(u,f){if(typeof u!="function")throw new Ii(c);return f=f===r?f:Nt(f),$t(u,f)}i(X_,"rest"),a(X_,"rest");function Q_(u,f){if(typeof u!="function")throw new Ii(c);return f=f==null?0:Gr(Nt(f),0),$t(function(x){var U=x[f],W=na(x,0,f);return U&&Qs(W,U),Fn(u,this,W)})}i(Q_,"spread"),a(Q_,"spread");function ew(u,f,x){var U=!0,W=!0;if(typeof u!="function")throw new Ii(c);return Cr(x)&&(U="leading"in x?!!x.leading:U,W="trailing"in x?!!x.trailing:W),wv(u,f,{leading:U,maxWait:f,trailing:W})}i(ew,"throttle2"),a(ew,"throttle");function tw(u){return vv(u,1)}i(tw,"unary"),a(tw,"unary");function rw(u,f){return Ev(vh(f),u)}i(rw,"wrap"),a(rw,"wrap");function nw(){if(!arguments.length)return[];var u=arguments[0];return Rt(u)?u:[u]}i(nw,"castArray"),a(nw,"castArray");function iw(u){return ti(u,A)}i(iw,"clone"),a(iw,"clone");function sw(u,f){return f=typeof f=="function"?f:r,ti(u,A,f)}i(sw,"cloneWith"),a(sw,"cloneWith");function aw(u){return ti(u,b|A)}i(aw,"cloneDeep6"),a(aw,"cloneDeep");function ow(u,f){return f=typeof f=="function"?f:r,ti(u,b|A,f)}i(ow,"cloneDeepWith"),a(ow,"cloneDeepWith");function cw(u,f){return f==null||d1(u,f,Wr(f))}i(cw,"conformsTo"),a(cw,"conformsTo");function ki(u,f){return u===f||u!==u&&f!==f}i(ki,"eq4"),a(ki,"eq");var Wk=Kl(ih),Zk=Kl(function(u,f){return u>=f}),Fo=g1(function(){return arguments}())?g1:function(u){return Ir(u)&&vr.call(u,"callee")&&!n3.call(u,"callee")},Rt=Ie.isArray,Jk=Do?Un(Do):V3;function Cn(u){return u!=null&&ef(u.length)&&!xs(u)}i(Cn,"isArrayLike2"),a(Cn,"isArrayLike");function Rr(u){return Ir(u)&&Cn(u)}i(Rr,"isArrayLikeObject"),a(Rr,"isArrayLikeObject");function uw(u){return u===!0||u===!1||Ir(u)&&vn(u)==Y}i(uw,"isBoolean"),a(uw,"isBoolean");var Fa=nk||Fh,Yk=D6?Un(D6):G3;function lw(u){return Ir(u)&&u.nodeType===1&&!Zc(u)}i(lw,"isElement"),a(lw,"isElement");function fw(u){if(u==null)return!0;if(Cn(u)&&(Rt(u)||typeof u=="string"||typeof u.splice=="function"||Fa(u)||Jc(u)||Fo(u)))return!u.length;var f=gn(u);if(f==ve||f==Q)return!u.size;if(Wc(u))return!oh(u).length;for(var x in u)if(vr.call(u,x))return!1;return!0}i(fw,"isEmpty"),a(fw,"isEmpty");function dw(u,f){return Kc(u,f)}i(dw,"isEqual"),a(dw,"isEqual");function hw(u,f,x){x=typeof x=="function"?x:r;var U=x?x(u,f):r;return U===r?Kc(u,f,r,x):!!U}i(hw,"isEqualWith"),a(hw,"isEqualWith");function Ih(u){if(!Ir(u))return!1;var f=vn(u);return f==z||f==I||typeof u.message=="string"&&typeof u.name=="string"&&!Zc(u)}i(Ih,"isError"),a(Ih,"isError");function pw(u){return typeof u=="number"&&s3(u)}i(pw,"isFinite2"),a(pw,"isFinite");function xs(u){if(!Cr(u))return!1;var f=vn(u);return f==te||f==ae||f==P||f==pe}i(xs,"isFunction2"),a(xs,"isFunction");function Av(u){return typeof u=="number"&&u==Nt(u)}i(Av,"isInteger3"),a(Av,"isInteger");function ef(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=_}i(ef,"isLength"),a(ef,"isLength");function Cr(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}i(Cr,"isObject"),a(Cr,"isObject");function Ir(u){return u!=null&&typeof u=="object"}i(Ir,"isObjectLike"),a(Ir,"isObjectLike");var mw=k6?Un(k6):Z3;function vw(u,f){return u===f||ah(u,f,Eh(f))}i(vw,"isMatch"),a(vw,"isMatch");function gw(u,f,x){return x=typeof x=="function"?x:r,ah(u,f,Eh(f),x)}i(gw,"isMatchWith"),a(gw,"isMatchWith");function yw(u){return Sv(u)&&u!=+u}i(yw,"isNaN2"),a(yw,"isNaN");function bw(u){if(gk(u))throw new It(o);return y1(u)}i(bw,"isNative"),a(bw,"isNative");function _w(u){return u===null}i(_w,"isNull"),a(_w,"isNull");function ww(u){return u==null}i(ww,"isNil"),a(ww,"isNil");function Sv(u){return typeof u=="number"||Ir(u)&&vn(u)==De}i(Sv,"isNumber"),a(Sv,"isNumber");function Zc(u){if(!Ir(u)||vn(u)!=de)return!1;var f=Wd(u);if(f===null)return!0;var x=vr.call(f,"constructor")&&f.constructor;return typeof x=="function"&&x instanceof x&&qd.call(x)==YD}i(Zc,"isPlainObject"),a(Zc,"isPlainObject");var xv=O6?Un(O6):J3;function Ew(u){return Av(u)&&u>=-_&&u<=_}i(Ew,"isSafeInteger"),a(Ew,"isSafeInteger");var Aw=R6?Un(R6):Y3;function tf(u){return typeof u=="string"||!Rt(u)&&Ir(u)&&vn(u)==ge}i(tf,"isString"),a(tf,"isString");function jn(u){return typeof u=="symbol"||Ir(u)&&vn(u)==Me}i(jn,"isSymbol"),a(jn,"isSymbol");var Jc=N6?Un(N6):X3;function Sw(u){return u===r}i(Sw,"isUndefined"),a(Sw,"isUndefined");function xw(u){return Ir(u)&&gn(u)==Re}i(xw,"isWeakMap"),a(xw,"isWeakMap");function Tw(u){return Ir(u)&&vn(u)==je}i(Tw,"isWeakSet"),a(Tw,"isWeakSet");var Xk=Kl(ch),Qk=Kl(function(u,f){return u<=f});function Tv(u){if(!u)return[];if(Cn(u))return tf(u)?Ci(u):Mn(u);if(Il&&u[Il])return G6(u[Il]());var f=gn(u),x=f==ve?jd:f==Q?Cl:Uo;return x(u)}i(Tv,"toArray"),a(Tv,"toArray");function Ts(u){if(!u)return u===0?u:0;if(u=ii(u),u===g||u===-g){var f=u<0?-1:1;return f*M}return u===u?u:0}i(Ts,"toFinite"),a(Ts,"toFinite");function Nt(u){var f=Ts(u),x=f%1;return f===f?x?f-x:f:0}i(Nt,"toInteger"),a(Nt,"toInteger");function Mv(u){return u?Ra(Nt(u),0,w):0}i(Mv,"toLength"),a(Mv,"toLength");function ii(u){if(typeof u=="number")return u;if(jn(u))return S;if(Cr(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=Cr(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=e1(u);var x=er.test(u);return x||tn.test(u)?sn(u.slice(2),x?2:8):fn.test(u)?S:+u}i(ii,"toNumber"),a(ii,"toNumber");function Cv(u){return Wi(u,In(u))}i(Cv,"toPlainObject"),a(Cv,"toPlainObject");function Mw(u){return u?Ra(Nt(u),-_,_):u===0?u:0}i(Mw,"toSafeInteger"),a(Mw,"toSafeInteger");function lr(u){return u==null?"":$n(u)}i(lr,"toString4"),a(lr,"toString");var eO=Po(function(u,f){if(Wc(f)||Cn(f)){Wi(f,Wr(f),u);return}for(var x in f)vr.call(f,x)&&zc(u,x,f[x])}),Cw=Po(function(u,f){Wi(f,In(f),u)}),Dh=Po(function(u,f,x,U){Wi(f,In(f),u,U)}),tO=Po(function(u,f,x,U){Wi(f,Wr(f),u,U)}),rO=As(rh);function Iw(u,f){var x=jc(u);return f==null?x:f1(x,f)}i(Iw,"create2"),a(Iw,"create");var nO=$t(function(u,f){u=br(u);var x=-1,U=f.length,W=U>2?f[2]:r;for(W&&yn(f[0],f[1],W)&&(U=1);++x<U;)for(var ee=f[x],he=In(ee),be=-1,Ae=he.length;++be<Ae;){var Be=he[be],Le=u[Be];(Le===r||ki(Le,Fc[Be])&&!vr.call(u,Be))&&(u[Be]=ee[Be])}return u}),iO=$t(function(u){return u.push(r,G1),Fn(jw,r,u)});function Dw(u,f){return Jm(u,_t(f,3),Gi)}i(Dw,"findKey"),a(Dw,"findKey");function kw(u,f){return Jm(u,_t(f,3),nh)}i(kw,"findLastKey"),a(kw,"findLastKey");function Ow(u,f){return u==null?u:m1(u,_t(f,3),In)}i(Ow,"forIn"),a(Ow,"forIn");function Rw(u,f){return u==null?u:j3(u,_t(f,3),In)}i(Rw,"forInRight"),a(Rw,"forInRight");function Nw(u,f){return u&&Gi(u,_t(f,3))}i(Nw,"forOwn"),a(Nw,"forOwn");function Pw(u,f){return u&&nh(u,_t(f,3))}i(Pw,"forOwnRight"),a(Pw,"forOwnRight");function Bw(u){return u==null?[]:Ll(u,Wr(u))}i(Bw,"functions"),a(Bw,"functions");function Lw(u){return u==null?[]:Ll(u,In(u))}i(Lw,"functionsIn"),a(Lw,"functionsIn");function kh(u,f,x){var U=u==null?r:Pa(u,f);return U===r?x:U}i(kh,"get2"),a(kh,"get");function Fw(u,f){return u!=null&&Y1(u,f,z3)}i(Fw,"has"),a(Fw,"has");function Oh(u,f){return u!=null&&Y1(u,f,H3)}i(Oh,"hasIn"),a(Oh,"hasIn");var sO=z1(function(u,f,x){f!=null&&typeof f.toString!="function"&&(f=Kd.call(f)),u[f]=x},Rh(Dn)),aO=z1(function(u,f,x){f!=null&&typeof f.toString!="function"&&(f=Kd.call(f)),vr.call(u,f)?u[f].push(x):u[f]=[x]},_t),oO=$t(qc);function Wr(u){return Cn(u)?u1(u):oh(u)}i(Wr,"keys"),a(Wr,"keys");function In(u){return Cn(u)?u1(u,!0):Q3(u)}i(In,"keysIn"),a(In,"keysIn");function Uw(u,f){var x={};return f=_t(f,3),Gi(u,function(U,W,ee){ws(x,f(U,W,ee),U)}),x}i(Uw,"mapKeys"),a(Uw,"mapKeys");function $w(u,f){var x={};return f=_t(f,3),Gi(u,function(U,W,ee){ws(x,W,f(U,W,ee))}),x}i($w,"mapValues"),a($w,"mapValues");var cO=Po(function(u,f,x){Fl(u,f,x)}),jw=Po(function(u,f,x,U){Fl(u,f,x,U)}),uO=As(function(u,f){var x={};if(u==null)return x;var U=!1;f=Tr(f,function(ee){return ee=ra(ee,u),U||(U=ee.length>1),ee}),Wi(u,wh(u),x),U&&(x=ti(x,b|y|A,b5));for(var W=f.length;W--;)hh(x,f[W]);return x});function zw(u,f){return Iv(u,Ql(_t(f)))}i(zw,"omitBy"),a(zw,"omitBy");var lO=As(function(u,f){return u==null?{}:t5(u,f)});function Iv(u,f){if(u==null)return{};var x=Tr(wh(u),function(U){return[U]});return f=_t(f),x1(u,x,function(U,W){return f(U,W[0])})}i(Iv,"pickBy"),a(Iv,"pickBy");function Hw(u,f,x){f=ra(f,u);var U=-1,W=f.length;for(W||(W=1,u=r);++U<W;){var ee=u==null?r:u[Zi(f[U])];ee===r&&(U=W,ee=x),u=xs(ee)?ee.call(u):ee}return u}i(Hw,"result"),a(Hw,"result");function qw(u,f,x){return u==null?u:Vc(u,f,x)}i(qw,"set"),a(qw,"set");function Kw(u,f,x,U){return U=typeof U=="function"?U:r,u==null?u:Vc(u,f,x,U)}i(Kw,"setWith"),a(Kw,"setWith");var Vw=K1(Wr),Gw=K1(In);function Ww(u,f,x){var U=Rt(u),W=U||Fa(u)||Jc(u);if(f=_t(f,4),x==null){var ee=u&&u.constructor;W?x=U?new ee:[]:Cr(u)?x=xs(ee)?jc(Wd(u)):{}:x={}}return(W?Qn:Gi)(u,function(he,be,Ae){return f(x,he,be,Ae)}),x}i(Ww,"transform"),a(Ww,"transform");function Zw(u,f){return u==null?!0:hh(u,f)}i(Zw,"unset"),a(Zw,"unset");function Jw(u,f,x){return u==null?u:I1(u,f,vh(x))}i(Jw,"update2"),a(Jw,"update");function Yw(u,f,x,U){return U=typeof U=="function"?U:r,u==null?u:I1(u,f,vh(x),U)}i(Yw,"updateWith"),a(Yw,"updateWith");function Uo(u){return u==null?[]:$d(u,Wr(u))}i(Uo,"values"),a(Uo,"values");function Xw(u){return u==null?[]:$d(u,In(u))}i(Xw,"valuesIn"),a(Xw,"valuesIn");function Qw(u,f,x){return x===r&&(x=f,f=r),x!==r&&(x=ii(x),x=x===x?x:0),f!==r&&(f=ii(f),f=f===f?f:0),Ra(ii(u),f,x)}i(Qw,"clamp"),a(Qw,"clamp");function e4(u,f,x){return f=Ts(f),x===r?(x=f,f=0):x=Ts(x),u=ii(u),q3(u,f,x)}i(e4,"inRange"),a(e4,"inRange");function t4(u,f,x){if(x&&typeof x!="boolean"&&yn(u,f,x)&&(f=x=r),x===r&&(typeof f=="boolean"?(x=f,f=r):typeof u=="boolean"&&(x=u,u=r)),u===r&&f===r?(u=0,f=1):(u=Ts(u),f===r?(f=u,u=0):f=Ts(f)),u>f){var U=u;u=f,f=U}if(x||u%1||f%1){var W=a3();return mn(u+W*(f-u+qr("1e-"+((W+"").length-1))),f)}return lh(u,f)}i(t4,"random"),a(t4,"random");var fO=Bo(function(u,f,x){return f=f.toLowerCase(),u+(x?Dv(f):f)});function Dv(u){return Ov(lr(u).toLowerCase())}i(Dv,"capitalize"),a(Dv,"capitalize");function kv(u){return u=lr(u),u&&u.replace(Or,qD).replace(Dd,"")}i(kv,"deburr"),a(kv,"deburr");function r4(u,f,x){u=lr(u),f=$n(f);var U=u.length;x=x===r?U:Ra(Nt(x),0,U);var W=x;return x-=f.length,x>=0&&u.slice(x,W)==f}i(r4,"endsWith"),a(r4,"endsWith");function n4(u){return u=lr(u),u&&ut.test(u)?u.replace(kr,KD):u}i(n4,"escape"),a(n4,"escape");function i4(u){return u=lr(u),u&&st.test(u)?u.replace(Qt,"\\$&"):u}i(i4,"escapeRegExp"),a(i4,"escapeRegExp");var dO=Bo(function(u,f,x){return u+(x?"-":"")+f.toLowerCase()}),hO=Bo(function(u,f,x){return u+(x?" ":"")+f.toLowerCase()}),pO=U1("toLowerCase");function s4(u,f,x){u=lr(u),f=Nt(f);var U=f?Ro(u):0;if(!f||U>=f)return u;var W=(f-U)/2;return ql(Xd(W),x)+u+ql(Yd(W),x)}i(s4,"pad2"),a(s4,"pad");function a4(u,f,x){u=lr(u),f=Nt(f);var U=f?Ro(u):0;return f&&U<f?u+ql(f-U,x):u}i(a4,"padEnd"),a(a4,"padEnd");function o4(u,f,x){u=lr(u),f=Nt(f);var U=f?Ro(u):0;return f&&U<f?ql(f-U,x)+u:u}i(o4,"padStart"),a(o4,"padStart");function c4(u,f,x){return x||f==null?f=0:f&&(f=+f),ok(lr(u).replace(Qe,""),f||0)}i(c4,"parseInt2"),a(c4,"parseInt");function u4(u,f,x){return(x?yn(u,f,x):f===r)?f=1:f=Nt(f),fh(lr(u),f)}i(u4,"repeat"),a(u4,"repeat");function l4(){var u=arguments,f=lr(u[0]);return u.length<3?f:f.replace(u[1],u[2])}i(l4,"replace"),a(l4,"replace");var mO=Bo(function(u,f,x){return u+(x?"_":"")+f.toLowerCase()});function f4(u,f,x){return x&&typeof x!="number"&&yn(u,f,x)&&(f=x=r),x=x===r?w:x>>>0,x?(u=lr(u),u&&(typeof f=="string"||f!=null&&!xv(f))&&(f=$n(f),!f&&Oo(u))?na(Ci(u),0,x):u.split(f,x)):[]}i(f4,"split"),a(f4,"split");var vO=Bo(function(u,f,x){return u+(x?" ":"")+Ov(f)});function d4(u,f,x){return u=lr(u),x=x==null?0:Ra(Nt(x),0,u.length),f=$n(f),u.slice(x,x+f.length)==f}i(d4,"startsWith"),a(d4,"startsWith");function h4(u,f,x){var U=X.templateSettings;x&&yn(u,f,x)&&(f=r),u=lr(u),f=Dh({},f,U,V1);var W=Dh({},f.imports,U.imports,V1),ee=Wr(W),he=$d(W,ee),be,Ae,Be=0,Le=f.interpolate||Hr,$e="__p += '",Je=s1((f.escape||Hr).source+"|"+Le.source+"|"+(Le===nt?At:Hr).source+"|"+(f.evaluate||Hr).source+"|$","g"),pt="//# sourceURL="+(vr.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Pc+"]")+`
|
|
27
|
+
`;u.replace(Je,function(wt,qt,Zt,zn,bn,Hn){return Zt||(Zt=zn),$e+=u.slice(Be,Hn).replace(nn,q6),qt&&(be=!0,$e+=`' +
|
|
28
|
+
__e(`+qt+`) +
|
|
29
|
+
'`),bn&&(Ae=!0,$e+=`';
|
|
30
|
+
`+bn+`;
|
|
31
|
+
__p += '`),Zt&&($e+=`' +
|
|
32
|
+
((__t = (`+Zt+`)) == null ? '' : __t) +
|
|
33
|
+
'`),Be=Hn+wt.length,wt}),$e+=`';
|
|
34
|
+
`;var St=vr.call(f,"variable")&&f.variable;if(!St)$e=`with (obj) {
|
|
35
|
+
`+$e+`
|
|
36
|
+
}
|
|
37
|
+
`;else if(Et.test(St))throw new It(l);$e=(Ae?$e.replace(He,""):$e).replace(Ot,"$1").replace(dt,"$1;"),$e="function("+(St||"obj")+`) {
|
|
38
|
+
`+(St?"":`obj || (obj = {});
|
|
39
|
+
`)+"var __t, __p = ''"+(be?", __e = _.escape":"")+(Ae?`, __j = Array.prototype.join;
|
|
40
|
+
function print() { __p += __j.call(arguments, '') }
|
|
41
|
+
`:`;
|
|
42
|
+
`)+$e+`return __p
|
|
43
|
+
}`;var Ft=w4(function(){return ur(ee,pt+"return "+$e).apply(r,he)});if(Ft.source=$e,Ih(Ft))throw Ft;return Ft}i(h4,"template"),a(h4,"template");function p4(u){return lr(u).toLowerCase()}i(p4,"toLower"),a(p4,"toLower");function m4(u){return lr(u).toUpperCase()}i(m4,"toUpper"),a(m4,"toUpper");function v4(u,f,x){if(u=lr(u),u&&(x||f===r))return e1(u);if(!u||!(f=$n(f)))return u;var U=Ci(u),W=Ci(f),ee=t1(U,W),he=r1(U,W)+1;return na(U,ee,he).join("")}i(v4,"trim"),a(v4,"trim");function g4(u,f,x){if(u=lr(u),u&&(x||f===r))return u.slice(0,i1(u)+1);if(!u||!(f=$n(f)))return u;var U=Ci(u),W=r1(U,Ci(f))+1;return na(U,0,W).join("")}i(g4,"trimEnd"),a(g4,"trimEnd");function y4(u,f,x){if(u=lr(u),u&&(x||f===r))return u.replace(Qe,"");if(!u||!(f=$n(f)))return u;var U=Ci(u),W=t1(U,Ci(f));return na(U,W).join("")}i(y4,"trimStart"),a(y4,"trimStart");function b4(u,f){var x=ue,U=me;if(Cr(f)){var W="separator"in f?f.separator:W;x="length"in f?Nt(f.length):x,U="omission"in f?$n(f.omission):U}u=lr(u);var ee=u.length;if(Oo(u)){var he=Ci(u);ee=he.length}if(x>=ee)return u;var be=x-Ro(U);if(be<1)return U;var Ae=he?na(he,0,be).join(""):u.slice(0,be);if(W===r)return Ae+U;if(he&&(be+=Ae.length-be),xv(W)){if(u.slice(be).search(W)){var Be,Le=Ae;for(W.global||(W=s1(W.source,lr(yt.exec(W))+"g")),W.lastIndex=0;Be=W.exec(Le);)var $e=Be.index;Ae=Ae.slice(0,$e===r?be:$e)}}else if(u.indexOf($n(W),be)!=be){var Je=Ae.lastIndexOf(W);Je>-1&&(Ae=Ae.slice(0,Je))}return Ae+U}i(b4,"truncate"),a(b4,"truncate");function _4(u){return u=lr(u),u&&ct.test(u)?u.replace(vt,VD):u}i(_4,"unescape"),a(_4,"unescape");var gO=Bo(function(u,f,x){return u+(x?" ":"")+f.toUpperCase()}),Ov=U1("toUpperCase");function Rv(u,f,x){return u=lr(u),f=x?r:f,f===r?V6(u)?Q6(u):U6(u):u.match(f)||[]}i(Rv,"words"),a(Rv,"words");var w4=$t(function(u,f){try{return Fn(u,r,f)}catch(x){return Ih(x)?x:new It(x)}}),yO=As(function(u,f){return Qn(f,function(x){x=Zi(x),ws(u,x,yv(u[x],u))}),u});function E4(u){var f=u==null?0:u.length,x=_t();return u=f?Tr(u,function(U){if(typeof U[1]!="function")throw new Ii(c);return[x(U[0]),U[1]]}):[],$t(function(U){for(var W=-1;++W<f;){var ee=u[W];if(Fn(ee[0],this,U))return Fn(ee[1],this,U)}})}i(E4,"cond"),a(E4,"cond");function A4(u){return L3(ti(u,b))}i(A4,"conforms"),a(A4,"conforms");function Rh(u){return function(){return u}}i(Rh,"constant"),a(Rh,"constant");function S4(u,f){return u==null||u!==u?f:u}i(S4,"defaultTo"),a(S4,"defaultTo");var bO=j1(),_O=j1(!0);function Dn(u){return u}i(Dn,"identity4"),a(Dn,"identity");function Nh(u){return b1(typeof u=="function"?u:ti(u,b))}i(Nh,"iteratee"),a(Nh,"iteratee");function x4(u){return w1(ti(u,b))}i(x4,"matches"),a(x4,"matches");function T4(u,f){return E1(u,ti(f,b))}i(T4,"matchesProperty"),a(T4,"matchesProperty");var wO=$t(function(u,f){return function(x){return qc(x,u,f)}}),EO=$t(function(u,f){return function(x){return qc(u,x,f)}});function Ph(u,f,x){var U=Wr(f),W=Ll(f,U);x==null&&!(Cr(f)&&(W.length||!U.length))&&(x=f,f=u,u=this,W=Ll(f,Wr(f)));var ee=!(Cr(x)&&"chain"in x)||!!x.chain,he=xs(u);return Qn(W,function(be){var Ae=f[be];u[be]=Ae,he&&(u.prototype[be]=function(){var Be=this.__chain__;if(ee||Be){var Le=u(this.__wrapped__),$e=Le.__actions__=Mn(this.__actions__);return $e.push({func:Ae,args:arguments,thisArg:u}),Le.__chain__=Be,Le}return Ae.apply(u,Qs([this.value()],arguments))})}),u}i(Ph,"mixin"),a(Ph,"mixin");function M4(){return Lr._===this&&(Lr._=XD),this}i(M4,"noConflict"),a(M4,"noConflict");function Bh(){}i(Bh,"noop2"),a(Bh,"noop");function C4(u){return u=Nt(u),$t(function(f){return A1(f,u)})}i(C4,"nthArg"),a(C4,"nthArg");var AO=yh(Tr),SO=yh(Zm),xO=yh(Pd);function Nv(u){return Ah(u)?Bd(Zi(u)):r5(u)}i(Nv,"property"),a(Nv,"property");function I4(u){return function(f){return u==null?r:Pa(u,f)}}i(I4,"propertyOf"),a(I4,"propertyOf");var TO=H1(),MO=H1(!0);function Lh(){return[]}i(Lh,"stubArray"),a(Lh,"stubArray");function Fh(){return!1}i(Fh,"stubFalse"),a(Fh,"stubFalse");function D4(){return{}}i(D4,"stubObject"),a(D4,"stubObject");function k4(){return""}i(k4,"stubString"),a(k4,"stubString");function O4(){return!0}i(O4,"stubTrue"),a(O4,"stubTrue");function R4(u,f){if(u=Nt(u),u<1||u>_)return[];var x=w,U=mn(u,w);f=_t(f),u-=w;for(var W=Ud(U,f);++x<u;)f(x);return W}i(R4,"times"),a(R4,"times");function N4(u){return Rt(u)?Tr(u,Zi):jn(u)?[u]:Mn(F5(lr(u)))}i(N4,"toPath"),a(N4,"toPath");function P4(u){var f=++JD;return lr(u)+f}i(P4,"uniqueId"),a(P4,"uniqueId");var CO=Hl(function(u,f){return u+f},0),IO=bh("ceil"),DO=Hl(function(u,f){return u/f},1),kO=bh("floor");function B4(u){return u&&u.length?Bl(u,Dn,ih):r}i(B4,"max"),a(B4,"max");function L4(u,f){return u&&u.length?Bl(u,_t(f,2),ih):r}i(L4,"maxBy"),a(L4,"maxBy");function F4(u){return Xm(u,Dn)}i(F4,"mean"),a(F4,"mean");function U4(u,f){return Xm(u,_t(f,2))}i(U4,"meanBy"),a(U4,"meanBy");function $4(u){return u&&u.length?Bl(u,Dn,ch):r}i($4,"min"),a($4,"min");function j4(u,f){return u&&u.length?Bl(u,_t(f,2),ch):r}i(j4,"minBy"),a(j4,"minBy");var OO=Hl(function(u,f){return u*f},1),RO=bh("round"),NO=Hl(function(u,f){return u-f},0);function z4(u){return u&&u.length?Fd(u,Dn):0}i(z4,"sum"),a(z4,"sum");function H4(u,f){return u&&u.length?Fd(u,_t(f,2)):0}return i(H4,"sumBy"),a(H4,"sumBy"),X.after=G_,X.ary=vv,X.assign=eO,X.assignIn=Cw,X.assignInWith=Dh,X.assignWith=tO,X.at=rO,X.before=gv,X.bind=yv,X.bindAll=yO,X.bindKey=W_,X.castArray=nw,X.chain=hv,X.chunk=$5,X.compact=j5,X.concat=z5,X.cond=E4,X.conforms=A4,X.constant=Rh,X.countBy=Bk,X.create=Iw,X.curry=bv,X.curryRight=_v,X.debounce=wv,X.defaults=nO,X.defaultsDeep=iO,X.defer=qk,X.delay=Kk,X.difference=yk,X.differenceBy=bk,X.differenceWith=_k,X.drop=H5,X.dropRight=q5,X.dropRightWhile=K5,X.dropWhile=V5,X.fill=G5,X.filter=R_,X.flatMap=N_,X.flatMapDeep=P_,X.flatMapDepth=B_,X.flatten=uv,X.flattenDeep=W5,X.flattenDepth=Z5,X.flip=Z_,X.flow=bO,X.flowRight=_O,X.fromPairs=J5,X.functions=Bw,X.functionsIn=Lw,X.groupBy=Uk,X.initial=X5,X.intersection=wk,X.intersectionBy=Ek,X.intersectionWith=Ak,X.invert=sO,X.invertBy=aO,X.invokeMap=$k,X.iteratee=Nh,X.keyBy=jk,X.keys=Wr,X.keysIn=In,X.map=Yl,X.mapKeys=Uw,X.mapValues=$w,X.matches=x4,X.matchesProperty=T4,X.memoize=Xl,X.merge=cO,X.mergeWith=jw,X.method=wO,X.methodOf=EO,X.mixin=Ph,X.negate=Ql,X.nthArg=C4,X.omit=uO,X.omitBy=zw,X.once=J_,X.orderBy=F_,X.over=AO,X.overArgs=Vk,X.overEvery=SO,X.overSome=xO,X.partial=Ev,X.partialRight=Y_,X.partition=zk,X.pick=lO,X.pickBy=Iv,X.property=Nv,X.propertyOf=I4,X.pull=Sk,X.pullAll=fv,X.pullAllBy=r_,X.pullAllWith=n_,X.pullAt=xk,X.range=TO,X.rangeRight=MO,X.rearg=Gk,X.reject=j_,X.remove=i_,X.rest=X_,X.reverse=Th,X.sampleSize=H_,X.set=qw,X.setWith=Kw,X.shuffle=q_,X.slice=s_,X.sortBy=Hk,X.sortedUniq=d_,X.sortedUniqBy=h_,X.split=f4,X.spread=Q_,X.tail=p_,X.take=m_,X.takeRight=v_,X.takeRightWhile=g_,X.takeWhile=y_,X.tap=S_,X.throttle=ew,X.thru=Jl,X.toArray=Tv,X.toPairs=Vw,X.toPairsIn=Gw,X.toPath=N4,X.toPlainObject=Cv,X.transform=Ww,X.unary=tw,X.union=Tk,X.unionBy=Mk,X.unionWith=Ck,X.uniq=b_,X.uniqBy=__,X.uniqWith=w_,X.unset=Zw,X.unzip=Mh,X.unzipWith=dv,X.update=Jw,X.updateWith=Yw,X.values=Uo,X.valuesIn=Xw,X.without=Ik,X.words=Rv,X.wrap=rw,X.xor=Dk,X.xorBy=kk,X.xorWith=Ok,X.zip=Rk,X.zipObject=E_,X.zipObjectDeep=A_,X.zipWith=Nk,X.entries=Vw,X.entriesIn=Gw,X.extend=Cw,X.extendWith=Dh,Ph(X,X),X.add=CO,X.attempt=w4,X.camelCase=fO,X.capitalize=Dv,X.ceil=IO,X.clamp=Qw,X.clone=iw,X.cloneDeep=aw,X.cloneDeepWith=ow,X.cloneWith=sw,X.conformsTo=cw,X.deburr=kv,X.defaultTo=S4,X.divide=DO,X.endsWith=r4,X.eq=ki,X.escape=n4,X.escapeRegExp=i4,X.every=O_,X.find=Lk,X.findIndex=ov,X.findKey=Dw,X.findLast=Fk,X.findLastIndex=cv,X.findLastKey=kw,X.floor=kO,X.forEach=pv,X.forEachRight=mv,X.forIn=Ow,X.forInRight=Rw,X.forOwn=Nw,X.forOwnRight=Pw,X.get=kh,X.gt=Wk,X.gte=Zk,X.has=Fw,X.hasIn=Oh,X.head=lv,X.identity=Dn,X.includes=L_,X.indexOf=Y5,X.inRange=e4,X.invoke=oO,X.isArguments=Fo,X.isArray=Rt,X.isArrayBuffer=Jk,X.isArrayLike=Cn,X.isArrayLikeObject=Rr,X.isBoolean=uw,X.isBuffer=Fa,X.isDate=Yk,X.isElement=lw,X.isEmpty=fw,X.isEqual=dw,X.isEqualWith=hw,X.isError=Ih,X.isFinite=pw,X.isFunction=xs,X.isInteger=Av,X.isLength=ef,X.isMap=mw,X.isMatch=vw,X.isMatchWith=gw,X.isNaN=yw,X.isNative=bw,X.isNil=ww,X.isNull=_w,X.isNumber=Sv,X.isObject=Cr,X.isObjectLike=Ir,X.isPlainObject=Zc,X.isRegExp=xv,X.isSafeInteger=Ew,X.isSet=Aw,X.isString=tf,X.isSymbol=jn,X.isTypedArray=Jc,X.isUndefined=Sw,X.isWeakMap=xw,X.isWeakSet=Tw,X.join=Q5,X.kebabCase=dO,X.last=ni,X.lastIndexOf=e_,X.lowerCase=hO,X.lowerFirst=pO,X.lt=Xk,X.lte=Qk,X.max=B4,X.maxBy=L4,X.mean=F4,X.meanBy=U4,X.min=$4,X.minBy=j4,X.stubArray=Lh,X.stubFalse=Fh,X.stubObject=D4,X.stubString=k4,X.stubTrue=O4,X.multiply=OO,X.nth=t_,X.noConflict=M4,X.noop=Bh,X.now=Ch,X.pad=s4,X.padEnd=a4,X.padStart=o4,X.parseInt=c4,X.random=t4,X.reduce=U_,X.reduceRight=$_,X.repeat=u4,X.replace=l4,X.result=Hw,X.round=RO,X.runInContext=Ee,X.sample=z_,X.size=K_,X.snakeCase=mO,X.some=V_,X.sortedIndex=a_,X.sortedIndexBy=o_,X.sortedIndexOf=c_,X.sortedLastIndex=u_,X.sortedLastIndexBy=l_,X.sortedLastIndexOf=f_,X.startCase=vO,X.startsWith=d4,X.subtract=NO,X.sum=z4,X.sumBy=H4,X.template=h4,X.times=R4,X.toFinite=Ts,X.toInteger=Nt,X.toLength=Mv,X.toLower=p4,X.toNumber=ii,X.toSafeInteger=Mw,X.toString=lr,X.toUpper=m4,X.trim=v4,X.trimEnd=g4,X.trimStart=y4,X.truncate=b4,X.unescape=_4,X.uniqueId=P4,X.upperCase=gO,X.upperFirst=Ov,X.each=pv,X.eachRight=mv,X.first=lv,Ph(X,function(){var u={};return Gi(X,function(f,x){vr.call(X.prototype,x)||(u[x]=f)}),u}(),{chain:!1}),X.VERSION=n,Qn(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){X[u].placeholder=X}),Qn(["drop","take"],function(u,f){Vt.prototype[u]=function(x){x=x===r?1:Gr(Nt(x),0);var U=this.__filtered__&&!f?new Vt(this):this.clone();return U.__filtered__?U.__takeCount__=mn(x,U.__takeCount__):U.__views__.push({size:mn(x,w),type:u+(U.__dir__<0?"Right":"")}),U},Vt.prototype[u+"Right"]=function(x){return this.reverse()[u](x).reverse()}}),Qn(["filter","map","takeWhile"],function(u,f){var x=f+1,U=x==T||x==d;Vt.prototype[u]=function(W){var ee=this.clone();return ee.__iteratees__.push({iteratee:_t(W,3),type:x}),ee.__filtered__=ee.__filtered__||U,ee}}),Qn(["head","last"],function(u,f){var x="take"+(f?"Right":"");Vt.prototype[u]=function(){return this[x](1).value()[0]}}),Qn(["initial","tail"],function(u,f){var x="drop"+(f?"":"Right");Vt.prototype[u]=function(){return this.__filtered__?new Vt(this):this[x](1)}}),Vt.prototype.compact=function(){return this.filter(Dn)},Vt.prototype.find=function(u){return this.filter(u).head()},Vt.prototype.findLast=function(u){return this.reverse().find(u)},Vt.prototype.invokeMap=$t(function(u,f){return typeof u=="function"?new Vt(this):this.map(function(x){return qc(x,u,f)})}),Vt.prototype.reject=function(u){return this.filter(Ql(_t(u)))},Vt.prototype.slice=function(u,f){u=Nt(u);var x=this;return x.__filtered__&&(u>0||f<0)?new Vt(x):(u<0?x=x.takeRight(-u):u&&(x=x.drop(u)),f!==r&&(f=Nt(f),x=f<0?x.dropRight(-f):x.take(f-u)),x)},Vt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Vt.prototype.toArray=function(){return this.take(w)},Gi(Vt.prototype,function(u,f){var x=/^(?:filter|find|map|reject)|While$/.test(f),U=/^(?:head|last)$/.test(f),W=X[U?"take"+(f=="last"?"Right":""):f],ee=U||/^find/.test(f);!W||(X.prototype[f]=function(){var he=this.__wrapped__,be=U?[1]:arguments,Ae=he instanceof Vt,Be=be[0],Le=Ae||Rt(he),$e=a(function(qt){var Zt=W.apply(X,Qs([qt],be));return U&&Je?Zt[0]:Zt},"interceptor");Le&&x&&typeof Be=="function"&&Be.length!=1&&(Ae=Le=!1);var Je=this.__chain__,pt=!!this.__actions__.length,St=ee&&!Je,Ft=Ae&&!pt;if(!ee&&Le){he=Ft?he:new Vt(this);var wt=u.apply(he,be);return wt.__actions__.push({func:Jl,args:[$e],thisArg:r}),new ei(wt,Je)}return St&&Ft?u.apply(this,be):(wt=this.thru($e),St?U?wt.value()[0]:wt.value():wt)})}),Qn(["pop","push","shift","sort","splice","unshift"],function(u){var f=zd[u],x=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",U=/^(?:pop|shift)$/.test(u);X.prototype[u]=function(){var W=arguments;if(U&&!this.__chain__){var ee=this.value();return f.apply(Rt(ee)?ee:[],W)}return this[x](function(he){return f.apply(Rt(he)?he:[],W)})}}),Gi(Vt.prototype,function(u,f){var x=X[f];if(x){var U=x.name+"";vr.call($c,U)||($c[U]=[]),$c[U].push({name:f,func:x})}}),$c[zl(r,L).name]=[{name:"wrapper",func:r}],Vt.prototype.clone=c3,Vt.prototype.reverse=u3,Vt.prototype.value=l3,X.prototype.at=Pk,X.prototype.chain=x_,X.prototype.commit=T_,X.prototype.next=M_,X.prototype.plant=I_,X.prototype.reverse=D_,X.prototype.toJSON=X.prototype.valueOf=X.prototype.value=k_,X.prototype.first=X.prototype.head,Il&&(X.prototype[Il]=C_),X},"runInContext2"),"runInContext"),Ia=GD();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Lr._=Ia,define(function(){return Ia})):ys?((ys.exports=Ia)._=Ia,gs._=Ia):Lr._=Ia}).call(e)}});function cm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(cm,"asUint8Array");var um=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/as-uint8array.js"(){a(cm,"asUint8Array")}});function Qb(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?cm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(Qb,"allocUnsafe");var e2=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/alloc.js"(){um(),a(Qb,"allocUnsafe")}}),bS={};Er(bS,{concat:()=>lo});function lo(e,t){t||(t=e.reduce((s,o)=>s+o.length,0));let r=Qb(t),n=0;for(let s of e)r.set(s,n),n+=s.length;return cm(r)}i(lo,"concat");var _S=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/concat.js"(){e2(),um(),a(lo,"concat")}});function iA(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var s=0;s<e.length;s++){var o=e.charAt(s),c=o.charCodeAt(0);if(r[c]!==255)throw new TypeError(o+" is ambiguous");r[c]=s}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),v=Math.log(256)/Math.log(l);function b(C){if(C instanceof Uint8Array||(ArrayBuffer.isView(C)?C=new Uint8Array(C.buffer,C.byteOffset,C.byteLength):Array.isArray(C)&&(C=Uint8Array.from(C))),!(C instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(C.length===0)return"";for(var O=0,R=0,L=0,K=C.length;L!==K&&C[L]===0;)L++,O++;for(var $=(K-L)*v+1>>>0,j=new Uint8Array($);L!==K;){for(var V=C[L],G=0,k=$-1;(V!==0||G<R)&&k!==-1;k--,G++)V+=256*j[k]>>>0,j[k]=V%l>>>0,V=V/l>>>0;if(V!==0)throw new Error("Non-zero carry");R=G,L++}for(var H=$-R;H!==$&&j[H]===0;)H++;for(var se=h.repeat(O);H<$;++H)se+=e.charAt(j[H]);return se}i(b,"encode9"),a(b,"encode");function y(C){if(typeof C!="string")throw new TypeError("Expected String");if(C.length===0)return new Uint8Array;var O=0;if(C[O]!==" "){for(var R=0,L=0;C[O]===h;)R++,O++;for(var K=(C.length-O)*p+1>>>0,$=new Uint8Array(K);C[O];){var j=r[C.charCodeAt(O)];if(j===255)return;for(var V=0,G=K-1;(j!==0||V<L)&&G!==-1;G--,V++)j+=l*$[G]>>>0,$[G]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");L=V,O++}if(C[O]!==" "){for(var k=K-L;k!==K&&$[k]===0;)k++;for(var H=new Uint8Array(R+(K-k)),se=R;k!==K;)H[se++]=$[k++];return H}}}i(y,"decodeUnsafe"),a(y,"decodeUnsafe");function A(C){var O=y(C);if(O)return O;throw new Error(`Non-${t} character`)}return i(A,"decode9"),a(A,"decode"),{encode:b,decodeUnsafe:y,decode:A}}i(iA,"base");var sA,aA,wS,LU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/base-x.js"(){a(iA,"base"),sA=iA,aA=sA,wS=aA}}),FU,ES,cd,AS,SS,xc=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bytes.js"(){FU=new Uint8Array(0),ES=a((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},"equals"),cd=a(e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},"coerce"),AS=a(e=>new TextEncoder().encode(e),"fromString"),SS=a(e=>new TextDecoder().decode(e),"toString")}}),Cy,Iy,Dy,ky,Oy,Ff,Ou,oA,cA,Qr,js=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base.js"(){LU(),xc(),Cy=i(class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},"Encoder"),a(Cy,"Encoder"),Iy=i(class{constructor(e,t,r){if(this.name=e,this.prefix=t,t.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return ky(this,e)}},"Decoder"),a(Iy,"Decoder"),Dy=i(class{constructor(e){this.decoders=e}or(e){return ky(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},"ComposedDecoder"),a(Dy,"ComposedDecoder"),ky=a((e,t)=>new Dy({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),Oy=i(class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Cy(e,t,r),this.decoder=new Iy(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),a(Oy,"Codec"),Ff=a(({name:e,prefix:t,encode:r,decode:n})=>new Oy(e,t,r,n),"from"),Ou=a(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:s}=wS(r,t);return Ff({prefix:e,name:t,encode:n,decode:o=>cd(s(o))})},"baseX"),oA=a((e,t,r,n)=>{let s={};for(let v=0;v<t.length;++v)s[t[v]]=v;let o=e.length;for(;e[o-1]==="=";)--o;let c=new Uint8Array(o*r/8|0),l=0,h=0,p=0;for(let v=0;v<o;++v){let b=s[e[v]];if(b===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|b,l+=r,l>=8&&(l-=8,c[p++]=255&h>>l)}if(l>=r||255&h<<8-l)throw new SyntaxError("Unexpected end of data");return c},"decode"),cA=a((e,t,r)=>{let n=t[t.length-1]==="=",s=(1<<r)-1,o="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,o+=t[s&l>>c];if(c&&(o+=t[s&l<<r-c]),n)for(;o.length*r&7;)o+="=";return o},"encode"),Qr=a(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ff({prefix:t,name:e,encode(s){return cA(s,n,r)},decode(s){return oA(s,n,r,e)}}),"rfc4648")}}),xS={};Er(xS,{identity:()=>TS});var TS,UU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/identity.js"(){js(),xc(),TS=Ff({prefix:"\0",name:"identity",encode:e=>SS(e),decode:e=>AS(e)})}}),MS={};Er(MS,{base2:()=>CS});var CS,$U=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base2.js"(){js(),CS=Qr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),IS={};Er(IS,{base8:()=>DS});var DS,jU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base8.js"(){js(),DS=Qr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),kS={};Er(kS,{base10:()=>OS});var OS,zU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base10.js"(){js(),OS=Ou({prefix:"9",name:"base10",alphabet:"0123456789"})}}),RS={};Er(RS,{base16:()=>NS,base16upper:()=>PS});var NS,PS,HU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base16.js"(){js(),NS=Qr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),PS=Qr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),BS={};Er(BS,{base32:()=>Cu,base32hex:()=>$S,base32hexpad:()=>zS,base32hexpadupper:()=>HS,base32hexupper:()=>jS,base32pad:()=>FS,base32padupper:()=>US,base32upper:()=>LS,base32z:()=>qS});var Cu,LS,FS,US,$S,jS,zS,HS,qS,KS=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base32.js"(){js(),Cu=Qr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),LS=Qr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),FS=Qr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),US=Qr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),$S=Qr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),jS=Qr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),zS=Qr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),HS=Qr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),qS=Qr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),VS={};Er(VS,{base36:()=>wo,base36upper:()=>GS});var wo,GS,ud=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base36.js"(){js(),wo=Ou({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GS=Ou({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),WS={};Er(WS,{base58btc:()=>as,base58flickr:()=>ZS});var as,ZS,t2=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base58.js"(){js(),as=Ou({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ZS=Ou({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),JS={};Er(JS,{base64:()=>YS,base64pad:()=>XS,base64url:()=>Ru,base64urlpad:()=>QS});var YS,XS,Ru,QS,r2=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base64.js"(){js(),YS=Qr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),XS=Qr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ru=Qr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),QS=Qr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}}),ex={};Er(ex,{base256emoji:()=>nx});function uA(e){return e.reduce((t,r)=>(t+=tx[r],t),"")}i(uA,"encode2");function lA(e){let t=[];for(let r of e){let n=rx[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(lA,"decode2");var Ry,tx,rx,nx,qU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base256emoji.js"(){js(),Ry=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),tx=Ry.reduce((e,t,r)=>(e[r]=t,e),[]),rx=Ry.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),a(uA,"encode"),a(lA,"decode"),nx=Ff({prefix:"\u{1F680}",name:"base256emoji",encode:uA,decode:lA})}});function rb(e,t,r){t=t||[],r=r||0;for(var n=r;e>=sx;)t[r++]=e&255|nb,e/=128;for(;e&ix;)t[r++]=e&255|nb,e>>>=7;return t[r]=e|0,rb.bytes=r-n+1,t}i(rb,"encode3");function I0(e,n){var r=0,n=n||0,s=0,o=n,c,l=e.length;do{if(o>=l)throw I0.bytes=0,new RangeError("Could not decode varint");c=e[o++],r+=s<28?(c&ib)<<s:(c&ib)*Math.pow(2,s),s+=7}while(c>=ax);return I0.bytes=o-n,r}i(I0,"read");var fA,nb,dA,ix,sx,hA,ax,ib,pA,mA,vA,gA,yA,bA,_A,wA,EA,AA,SA,xA,Nf,KU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/varint.js"(){fA=rb,nb=128,dA=127,ix=~dA,sx=Math.pow(2,31),a(rb,"encode"),hA=I0,ax=128,ib=127,a(I0,"read"),pA=Math.pow(2,7),mA=Math.pow(2,14),vA=Math.pow(2,21),gA=Math.pow(2,28),yA=Math.pow(2,35),bA=Math.pow(2,42),_A=Math.pow(2,49),wA=Math.pow(2,56),EA=Math.pow(2,63),AA=a(function(e){return e<pA?1:e<mA?2:e<vA?3:e<gA?4:e<yA?5:e<bA?6:e<_A?7:e<wA?8:e<EA?9:10},"length"),SA={encode:fA,decode:hA,encodingLength:AA},xA=SA,Nf=xA}}),D0,jf,zf,n2=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/varint.js"(){KU(),D0=a((e,t=0)=>[Nf.decode(e,t),Nf.decode.bytes],"decode"),jf=a((e,t,r=0)=>(Nf.encode(e,t,r),t),"encodeTo"),zf=a(e=>Nf.encodingLength(e),"encodingLength")}}),Nu,i2,ox,Pf,Zu=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/digest.js"(){xc(),n2(),Nu=a((e,t)=>{let r=t.byteLength,n=zf(e),s=n+zf(r),o=new Uint8Array(s+r);return jf(e,o,0),jf(r,o,n),o.set(t,s),new Pf(e,r,t,o)},"create"),i2=a(e=>{let t=cd(e),[r,n]=D0(t),[s,o]=D0(t.subarray(n)),c=t.subarray(n+o);if(c.byteLength!==s)throw new Error("Incorrect length");return new Pf(r,s,c,t)},"decode"),ox=a((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&ES(e.bytes,t.bytes),"equals"),Pf=i(class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest"),a(Pf,"Digest")}}),sb,Ny,cx=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/hasher.js"(){Zu(),sb=a(({name:e,code:t,encode:r})=>new Ny(e,t,r),"from"),Ny=i(class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?Nu(this.code,t):t.then(r=>Nu(this.code,r))}else throw Error("Unknown type, must be binary type")}},"Hasher"),a(Ny,"Hasher")}}),ux={};Er(ux,{sha256:()=>Ju,sha512:()=>lx});var Py,Ju,lx,lm=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){cx(),Py=a(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),Ju=sb({name:"sha2-256",code:18,encode:Py("SHA-256")}),lx=sb({name:"sha2-512",code:19,encode:Py("SHA-512")})}}),fx={};Er(fx,{identity:()=>fm});var By,TA,Ly,MA,fm,dx=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/identity.js"(){xc(),Zu(),By=0,TA="identity",Ly=cd,MA=a(e=>Nu(By,Ly(e)),"digest"),fm={code:By,name:TA,encode:Ly,digest:MA}}}),VU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/raw.js"(){xc()}}),GU,WU,ZU=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/json.js"(){GU=new TextEncoder,WU=new TextDecoder}}),Ht,CA,IA,DA,xu,kA,Fy,Uy,Df,kf,OA,RA,NA,zs=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/cid.js"(){n2(),Zu(),t2(),KS(),xc(),Ht=i(class{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:kf,byteLength:kf,code:Df,version:Df,multihash:Df,bytes:Df,_baseCache:kf,asCID:kf})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==xu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==kA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ht.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=Nu(e,t);return Ht.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&ox(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return IA(t,n,e||as.encoder);default:return DA(t,n,e||Cu.encoder)}}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return RA(/^0\.0/,NA),!!(e&&(e[Uy]||e.asCID===e))}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof Ht)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:s}=e;return new Ht(t,r,n,s||Fy(t,r,n.bytes))}else if(e!=null&&e[Uy]===!0){let{version:t,multihash:r,code:n}=e,s=i2(r);return Ht.create(t,n,s)}else return null}static create(e,t,r){if(typeof t!="number")throw new Error("String codecs are no longer supported");switch(e){case 0:{if(t!==xu)throw new Error(`Version 0 CID must use dag-pb (code: ${xu}) block encoding`);return new Ht(e,t,r,r.bytes)}case 1:{let n=Fy(e,t,r.bytes);return new Ht(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return Ht.create(0,xu,e)}static createV1(e,t){return Ht.create(1,e,t)}static decode(e){let[t,r]=Ht.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=Ht.inspectBytes(e),r=t.size-t.multihashSize,n=cd(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let s=n.subarray(t.multihashSize-t.digestSize),o=new Pf(t.multihashCode,t.digestSize,s,n);return[t.version===0?Ht.createV0(o):Ht.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=a(()=>{let[v,b]=D0(e.subarray(t));return t+=b,v},"next"),n=r(),s=xu;if(n===18?(n=0,t=0):n===1&&(s=r()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let o=t,c=r(),l=r(),h=t+l,p=h-o;return{version:n,codec:s,multihashCode:c,digestSize:l,multihashSize:p,size:h}}static parse(e,t){let[r,n]=CA(e,t),s=Ht.decode(n);return s._baseCache.set(r,e),s}},"CID"),a(Ht,"CID"),CA=a((e,t)=>{switch(e[0]){case"Q":{let r=t||as;return[as.prefix,r.decode(`${as.prefix}${e}`)]}case as.prefix:{let r=t||as;return[as.prefix,r.decode(e)]}case Cu.prefix:{let r=t||Cu;return[Cu.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}},"parseCIDtoBytes"),IA=a((e,t,r)=>{let{prefix:n}=r;if(n!==as.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let s=t.get(n);if(s==null){let o=r.encode(e).slice(1);return t.set(n,o),o}else return s},"toStringV0"),DA=a((e,t,r)=>{let{prefix:n}=r,s=t.get(n);if(s==null){let o=r.encode(e);return t.set(n,o),o}else return s},"toStringV1"),xu=112,kA=18,Fy=a((e,t,r)=>{let n=zf(e),s=n+zf(t),o=new Uint8Array(s+r.byteLength);return jf(e,o,0),jf(t,o,n),o.set(r,s),o},"encodeCID"),Uy=Symbol.for("@ipld/js-cid/CID"),Df={writable:!1,configurable:!1,enumerable:!0},kf={writable:!1,enumerable:!1,configurable:!1},OA="0.0.0-dev",RA=a((e,t)=>{if(e.test(OA))console.warn(t);else throw new Error(t)},"deprecate"),NA=`CID.isCID(v) is deprecated and will be removed in the next major release.
|
|
44
|
+
Following code pattern:
|
|
45
|
+
|
|
46
|
+
if (CID.isCID(value)) {
|
|
47
|
+
doSomethingWithCID(value)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Is replaced with:
|
|
51
|
+
|
|
52
|
+
const cid = CID.asCID(value)
|
|
53
|
+
if (cid) {
|
|
54
|
+
// Make sure to use cid instead of value
|
|
55
|
+
doSomethingWithCID(cid)
|
|
56
|
+
}
|
|
57
|
+
`}}),hx=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/index.js"(){zs(),n2(),xc(),cx(),Zu()}}),k0,JU,px=pr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/basics.js"(){UU(),$U(),jU(),zU(),HU(),KS(),ud(),t2(),r2(),qU(),lm(),dx(),VU(),ZU(),hx(),k0={...xS,...MS,...IS,...kS,...RS,...BS,...VS,...WS,...JS,...ex},JU={...ux,...fx}}});function $y(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}i($y,"createCodec");var jy,u0,PA,s2,mx=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/bases.js"(){px(),e2(),a($y,"createCodec"),jy=$y("utf8","u",e=>{let t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>new TextEncoder().encode(e.substring(1))),u0=$y("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);let t=Qb(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),PA={utf8:jy,"utf-8":jy,hex:k0.base16,latin1:u0,ascii:u0,binary:u0,...k0},s2=PA}}),vx={};Er(vx,{fromString:()=>xr});function xr(e,t="utf8"){let r=s2[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?cm(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}i(xr,"fromString2");var a2=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/from-string.js"(){mx(),um(),a(xr,"fromString")}}),gx={};Er(gx,{toString:()=>Mr});function Mr(e,t="utf8"){let r=s2[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}i(Mr,"toString2");var ld=pr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/to-string.js"(){mx(),a(Mr,"toString")}}),YU=ze({"../../../node_modules/.pnpm/@stablelib+int@1.0.1/node_modules/@stablelib/int/lib/int.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(l,h){var p=l>>>16&65535,v=l&65535,b=h>>>16&65535,y=h&65535;return v*y+(p*y+v*b<<16>>>0)|0}i(t,"imulShim"),a(t,"imulShim"),e.mul=Math.imul||t;function r(l,h){return l+h|0}i(r,"add3"),a(r,"add"),e.add=r;function n(l,h){return l-h|0}i(n,"sub"),a(n,"sub"),e.sub=n;function s(l,h){return l<<h|l>>>32-h}i(s,"rotl"),a(s,"rotl"),e.rotl=s;function o(l,h){return l<<32-h|l>>>h}i(o,"rotr"),a(o,"rotr"),e.rotr=o;function c(l){return typeof l=="number"&&isFinite(l)&&Math.floor(l)===l}i(c,"isIntegerShim"),a(c,"isIntegerShim"),e.isInteger=Number.isInteger||c,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(l){return e.isInteger(l)&&l>=-e.MAX_SAFE_INTEGER&&l<=e.MAX_SAFE_INTEGER}}}),Yu=ze({"../../../node_modules/.pnpm/@stablelib+binary@1.0.1/node_modules/@stablelib/binary/lib/binary.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=YU();function r(d,g){return g===void 0&&(g=0),(d[g+0]<<8|d[g+1])<<16>>16}i(r,"readInt16BE"),a(r,"readInt16BE"),e.readInt16BE=r;function n(d,g){return g===void 0&&(g=0),(d[g+0]<<8|d[g+1])>>>0}i(n,"readUint16BE"),a(n,"readUint16BE"),e.readUint16BE=n;function s(d,g){return g===void 0&&(g=0),(d[g+1]<<8|d[g])<<16>>16}i(s,"readInt16LE"),a(s,"readInt16LE"),e.readInt16LE=s;function o(d,g){return g===void 0&&(g=0),(d[g+1]<<8|d[g])>>>0}i(o,"readUint16LE"),a(o,"readUint16LE"),e.readUint16LE=o;function c(d,g,_){return g===void 0&&(g=new Uint8Array(2)),_===void 0&&(_=0),g[_+0]=d>>>8,g[_+1]=d>>>0,g}i(c,"writeUint16BE"),a(c,"writeUint16BE"),e.writeUint16BE=c,e.writeInt16BE=c;function l(d,g,_){return g===void 0&&(g=new Uint8Array(2)),_===void 0&&(_=0),g[_+0]=d>>>0,g[_+1]=d>>>8,g}i(l,"writeUint16LE"),a(l,"writeUint16LE"),e.writeUint16LE=l,e.writeInt16LE=l;function h(d,g){return g===void 0&&(g=0),d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3]}i(h,"readInt32BE"),a(h,"readInt32BE"),e.readInt32BE=h;function p(d,g){return g===void 0&&(g=0),(d[g]<<24|d[g+1]<<16|d[g+2]<<8|d[g+3])>>>0}i(p,"readUint32BE"),a(p,"readUint32BE"),e.readUint32BE=p;function v(d,g){return g===void 0&&(g=0),d[g+3]<<24|d[g+2]<<16|d[g+1]<<8|d[g]}i(v,"readInt32LE"),a(v,"readInt32LE"),e.readInt32LE=v;function b(d,g){return g===void 0&&(g=0),(d[g+3]<<24|d[g+2]<<16|d[g+1]<<8|d[g])>>>0}i(b,"readUint32LE"),a(b,"readUint32LE"),e.readUint32LE=b;function y(d,g,_){return g===void 0&&(g=new Uint8Array(4)),_===void 0&&(_=0),g[_+0]=d>>>24,g[_+1]=d>>>16,g[_+2]=d>>>8,g[_+3]=d>>>0,g}i(y,"writeUint32BE2"),a(y,"writeUint32BE"),e.writeUint32BE=y,e.writeInt32BE=y;function A(d,g,_){return g===void 0&&(g=new Uint8Array(4)),_===void 0&&(_=0),g[_+0]=d>>>0,g[_+1]=d>>>8,g[_+2]=d>>>16,g[_+3]=d>>>24,g}i(A,"writeUint32LE"),a(A,"writeUint32LE"),e.writeUint32LE=A,e.writeInt32LE=A;function C(d,g){g===void 0&&(g=0);var _=h(d,g),M=h(d,g+4);return _*4294967296+M-(M>>31)*4294967296}i(C,"readInt64BE"),a(C,"readInt64BE"),e.readInt64BE=C;function O(d,g){g===void 0&&(g=0);var _=p(d,g),M=p(d,g+4);return _*4294967296+M}i(O,"readUint64BE"),a(O,"readUint64BE"),e.readUint64BE=O;function R(d,g){g===void 0&&(g=0);var _=v(d,g),M=v(d,g+4);return M*4294967296+_-(_>>31)*4294967296}i(R,"readInt64LE"),a(R,"readInt64LE"),e.readInt64LE=R;function L(d,g){g===void 0&&(g=0);var _=b(d,g),M=b(d,g+4);return M*4294967296+_}i(L,"readUint64LE"),a(L,"readUint64LE"),e.readUint64LE=L;function K(d,g,_){return g===void 0&&(g=new Uint8Array(8)),_===void 0&&(_=0),y(d/4294967296>>>0,g,_),y(d>>>0,g,_+4),g}i(K,"writeUint64BE"),a(K,"writeUint64BE"),e.writeUint64BE=K,e.writeInt64BE=K;function $(d,g,_){return g===void 0&&(g=new Uint8Array(8)),_===void 0&&(_=0),A(d>>>0,g,_),A(d/4294967296>>>0,g,_+4),g}i($,"writeUint64LE"),a($,"writeUint64LE"),e.writeUint64LE=$,e.writeInt64LE=$;function j(d,g,_){if(_===void 0&&(_=0),d%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(d/8>g.length-_)throw new Error("readUintBE: array is too short for the given bitLength");for(var M=0,S=1,w=d/8+_-1;w>=_;w--)M+=g[w]*S,S*=256;return M}i(j,"readUintBE"),a(j,"readUintBE"),e.readUintBE=j;function V(d,g,_){if(_===void 0&&(_=0),d%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(d/8>g.length-_)throw new Error("readUintLE: array is too short for the given bitLength");for(var M=0,S=1,w=_;w<_+d/8;w++)M+=g[w]*S,S*=256;return M}i(V,"readUintLE"),a(V,"readUintLE"),e.readUintLE=V;function G(d,g,_,M){if(_===void 0&&(_=new Uint8Array(d/8)),M===void 0&&(M=0),d%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!t.isSafeInteger(g))throw new Error("writeUintBE value must be an integer");for(var S=1,w=d/8+M-1;w>=M;w--)_[w]=g/S&255,S*=256;return _}i(G,"writeUintBE"),a(G,"writeUintBE"),e.writeUintBE=G;function k(d,g,_,M){if(_===void 0&&(_=new Uint8Array(d/8)),M===void 0&&(M=0),d%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!t.isSafeInteger(g))throw new Error("writeUintLE value must be an integer");for(var S=1,w=M;w<M+d/8;w++)_[w]=g/S&255,S*=256;return _}i(k,"writeUintLE"),a(k,"writeUintLE"),e.writeUintLE=k;function H(d,g){g===void 0&&(g=0);var _=new DataView(d.buffer,d.byteOffset,d.byteLength);return _.getFloat32(g)}i(H,"readFloat32BE"),a(H,"readFloat32BE"),e.readFloat32BE=H;function se(d,g){g===void 0&&(g=0);var _=new DataView(d.buffer,d.byteOffset,d.byteLength);return _.getFloat32(g,!0)}i(se,"readFloat32LE"),a(se,"readFloat32LE"),e.readFloat32LE=se;function ue(d,g){g===void 0&&(g=0);var _=new DataView(d.buffer,d.byteOffset,d.byteLength);return _.getFloat64(g)}i(ue,"readFloat64BE"),a(ue,"readFloat64BE"),e.readFloat64BE=ue;function me(d,g){g===void 0&&(g=0);var _=new DataView(d.buffer,d.byteOffset,d.byteLength);return _.getFloat64(g,!0)}i(me,"readFloat64LE"),a(me,"readFloat64LE"),e.readFloat64LE=me;function q(d,g,_){g===void 0&&(g=new Uint8Array(4)),_===void 0&&(_=0);var M=new DataView(g.buffer,g.byteOffset,g.byteLength);return M.setFloat32(_,d),g}i(q,"writeFloat32BE"),a(q,"writeFloat32BE"),e.writeFloat32BE=q;function E(d,g,_){g===void 0&&(g=new Uint8Array(4)),_===void 0&&(_=0);var M=new DataView(g.buffer,g.byteOffset,g.byteLength);return M.setFloat32(_,d,!0),g}i(E,"writeFloat32LE"),a(E,"writeFloat32LE"),e.writeFloat32LE=E;function T(d,g,_){g===void 0&&(g=new Uint8Array(8)),_===void 0&&(_=0);var M=new DataView(g.buffer,g.byteOffset,g.byteLength);return M.setFloat64(_,d),g}i(T,"writeFloat64BE"),a(T,"writeFloat64BE"),e.writeFloat64BE=T;function m(d,g,_){g===void 0&&(g=new Uint8Array(8)),_===void 0&&(_=0);var M=new DataView(g.buffer,g.byteOffset,g.byteLength);return M.setFloat64(_,d,!0),g}i(m,"writeFloat64LE"),a(m,"writeFloat64LE"),e.writeFloat64LE=m}}),ps=ze({"../../../node_modules/.pnpm/@stablelib+wipe@1.0.1/node_modules/@stablelib/wipe/lib/wipe.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(r){for(var n=0;n<r.length;n++)r[n]=0;return r}i(t,"wipe"),a(t,"wipe"),e.wipe=t}}),XU=ze({"../../../node_modules/.pnpm/@stablelib+sha256@1.0.1/node_modules/@stablelib/sha256/lib/sha256.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Yu(),r=ps();e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var n=function(){function l(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return i(l,"SHA2562"),a(l,"SHA256"),l.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},l.prototype.update=function(h,p){if(p===void 0&&(p=h.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var v=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&p>0;)this._buffer[this._bufferLength++]=h[v++],p--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(v=o(this._temp,this._state,h,v,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=h[v++],p--;return this},l.prototype.finish=function(h){if(!this._finished){var p=this._bytesHashed,v=this._bufferLength,b=p/536870912|0,y=p<<3,A=p%64<56?64:128;this._buffer[v]=128;for(var C=v+1;C<A-8;C++)this._buffer[C]=0;t.writeUint32BE(b,this._buffer,A-8),t.writeUint32BE(y,this._buffer,A-4),o(this._temp,this._state,this._buffer,0,A),this._finished=!0}for(var C=0;C<this.digestLength/4;C++)t.writeUint32BE(this._state[C],h,C*4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(h){return this._state.set(h.state),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.state),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();e.SHA256=n;var s=new Int32Array([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 o(l,h,p,v,b){for(;b>=64;){for(var y=h[0],A=h[1],C=h[2],O=h[3],R=h[4],L=h[5],K=h[6],$=h[7],j=0;j<16;j++){var V=v+j*4;l[j]=t.readUint32BE(p,V)}for(var j=16;j<64;j++){var G=l[j-2],k=(G>>>17|G<<32-17)^(G>>>19|G<<32-19)^G>>>10;G=l[j-15];var H=(G>>>7|G<<32-7)^(G>>>18|G<<32-18)^G>>>3;l[j]=(k+l[j-7]|0)+(H+l[j-16]|0)}for(var j=0;j<64;j++){var k=(((R>>>6|R<<26)^(R>>>11|R<<21)^(R>>>25|R<<7))+(R&L^~R&K)|0)+($+(s[j]+l[j]|0)|0)|0,H=((y>>>2|y<<32-2)^(y>>>13|y<<32-13)^(y>>>22|y<<32-22))+(y&A^y&C^A&C)|0;$=K,K=L,L=R,R=O+k|0,O=C,C=A,A=y,y=k+H|0}h[0]+=y,h[1]+=A,h[2]+=C,h[3]+=O,h[4]+=R,h[5]+=L,h[6]+=K,h[7]+=$,v+=64,b-=64}return v}i(o,"hashBlocks"),a(o,"hashBlocks");function c(l){var h=new n;h.update(l);var p=h.digest();return h.clean(),p}i(c,"hash3"),a(c,"hash"),e.hash=c}}),yx=ze({"../../../node_modules/.pnpm/js-sha3@0.8.0/node_modules/js-sha3/src/sha3.js"(e,t){(function(){"use strict";var r="input is invalid type",n="finalize already called",s=typeof window=="object",o=s?window:{};o.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&typeof self=="object",l=!o.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;l?o=global:c&&(o=self);var h=!o.JS_SHA3_NO_COMMON_JS&&typeof t=="object"&&t.exports,p=typeof define=="function"&&define.amd,v=!o.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",b="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],A=[4,1024,262144,67108864],C=[1,256,65536,16777216],O=[6,1536,393216,100663296],R=[0,8,16,24],L=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],K=[224,256,384,512],$=[128,256],j=["hex","buffer","arrayBuffer","array","digest"],V={128:168,256:136};(o.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(P){return Object.prototype.toString.call(P)==="[object Array]"}),v&&(o.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(P){return typeof P=="object"&&P.buffer&&P.buffer.constructor===ArrayBuffer});for(var G=a(function(P,Y,J){return function(I){return new D(P,Y,P).update(I)[J]()}},"createOutputMethod"),k=a(function(P,Y,J){return function(I,z){return new D(P,Y,z).update(I)[J]()}},"createShakeOutputMethod"),H=a(function(P,Y,J){return function(I,z,te,ae){return d["cshake"+P].update(I,z,te,ae)[J]()}},"createCshakeOutputMethod"),se=a(function(P,Y,J){return function(I,z,te,ae){return d["kmac"+P].update(I,z,te,ae)[J]()}},"createKmacOutputMethod"),ue=a(function(P,Y,J,I){for(var z=0;z<j.length;++z){var te=j[z];P[te]=Y(J,I,te)}return P},"createOutputMethods"),me=a(function(P,Y){var J=G(P,Y,"hex");return J.create=function(){return new D(P,Y,P)},J.update=function(I){return J.create().update(I)},ue(J,G,P,Y)},"createMethod"),q=a(function(P,Y){var J=k(P,Y,"hex");return J.create=function(I){return new D(P,Y,I)},J.update=function(I,z){return J.create(z).update(I)},ue(J,k,P,Y)},"createShakeMethod"),E=a(function(P,Y){var J=V[P],I=H(P,Y,"hex");return I.create=function(z,te,ae){return!te&&!ae?d["shake"+P].create(z):new D(P,Y,z).bytepad([te,ae],J)},I.update=function(z,te,ae,ve){return I.create(te,ae,ve).update(z)},ue(I,H,P,Y)},"createCshakeMethod"),T=a(function(P,Y){var J=V[P],I=se(P,Y,"hex");return I.create=function(z,te,ae){return new F(P,Y,te).bytepad(["KMAC",ae],J).bytepad([z],J)},I.update=function(z,te,ae,ve){return I.create(z,ae,ve).update(te)},ue(I,se,P,Y)},"createKmacMethod"),m=[{name:"keccak",padding:C,bits:K,createMethod:me},{name:"sha3",padding:O,bits:K,createMethod:me},{name:"shake",padding:y,bits:$,createMethod:q},{name:"cshake",padding:A,bits:$,createMethod:E},{name:"kmac",padding:A,bits:$,createMethod:T}],d={},g=[],_=0;_<m.length;++_)for(var M=m[_],S=M.bits,w=0;w<S.length;++w){var N=M.name+"_"+S[w];if(g.push(N),d[N]=M.createMethod(S[w],M.padding),M.name!=="sha3"){var B=M.name+S[w];g.push(B),d[B]=d[N]}}function D(P,Y,J){this.blocks=[],this.s=[],this.padding=Y,this.outputBits=J,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(P<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=J>>5,this.extraBytes=(J&31)>>3;for(var I=0;I<50;++I)this.s[I]=0}i(D,"Keccak"),a(D,"Keccak"),D.prototype.update=function(P){if(this.finalized)throw new Error(n);var Y,J=typeof P;if(J!=="string"){if(J==="object"){if(P===null)throw new Error(r);if(v&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!v||!ArrayBuffer.isView(P)))throw new Error(r)}else throw new Error(r);Y=!0}for(var I=this.blocks,z=this.byteCount,te=P.length,ae=this.blockCount,ve=0,De=this.s,we,de;ve<te;){if(this.reset)for(this.reset=!1,I[0]=this.block,we=1;we<ae+1;++we)I[we]=0;if(Y)for(we=this.start;ve<te&&we<z;++ve)I[we>>2]|=P[ve]<<R[we++&3];else for(we=this.start;ve<te&&we<z;++ve)de=P.charCodeAt(ve),de<128?I[we>>2]|=de<<R[we++&3]:de<2048?(I[we>>2]|=(192|de>>6)<<R[we++&3],I[we>>2]|=(128|de&63)<<R[we++&3]):de<55296||de>=57344?(I[we>>2]|=(224|de>>12)<<R[we++&3],I[we>>2]|=(128|de>>6&63)<<R[we++&3],I[we>>2]|=(128|de&63)<<R[we++&3]):(de=65536+((de&1023)<<10|P.charCodeAt(++ve)&1023),I[we>>2]|=(240|de>>18)<<R[we++&3],I[we>>2]|=(128|de>>12&63)<<R[we++&3],I[we>>2]|=(128|de>>6&63)<<R[we++&3],I[we>>2]|=(128|de&63)<<R[we++&3]);if(this.lastByteIndex=we,we>=z){for(this.start=we-z,this.block=I[ae],we=0;we<ae;++we)De[we]^=I[we];le(De),this.reset=!0}else this.start=we}return this},D.prototype.encode=function(P,Y){var J=P&255,I=1,z=[J];for(P=P>>8,J=P&255;J>0;)z.unshift(J),P=P>>8,J=P&255,++I;return Y?z.push(I):z.unshift(I),this.update(z),z.length},D.prototype.encodeString=function(P){var Y,J=typeof P;if(J!=="string"){if(J==="object"){if(P===null)throw new Error(r);if(v&&P.constructor===ArrayBuffer)P=new Uint8Array(P);else if(!Array.isArray(P)&&(!v||!ArrayBuffer.isView(P)))throw new Error(r)}else throw new Error(r);Y=!0}var I=0,z=P.length;if(Y)I=z;else for(var te=0;te<P.length;++te){var ae=P.charCodeAt(te);ae<128?I+=1:ae<2048?I+=2:ae<55296||ae>=57344?I+=3:(ae=65536+((ae&1023)<<10|P.charCodeAt(++te)&1023),I+=4)}return I+=this.encode(I*8),this.update(P),I},D.prototype.bytepad=function(P,Y){for(var J=this.encode(Y),I=0;I<P.length;++I)J+=this.encodeString(P[I]);var z=Y-J%Y,te=[];return te.length=z,this.update(te),this},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var P=this.blocks,Y=this.lastByteIndex,J=this.blockCount,I=this.s;if(P[Y>>2]|=this.padding[Y&3],this.lastByteIndex===this.byteCount)for(P[0]=P[J],Y=1;Y<J+1;++Y)P[Y]=0;for(P[J-1]|=2147483648,Y=0;Y<J;++Y)I[Y]^=P[Y];le(I)}},D.prototype.toString=D.prototype.hex=function(){this.finalize();for(var P=this.blockCount,Y=this.s,J=this.outputBlocks,I=this.extraBytes,z=0,te=0,ae="",ve;te<J;){for(z=0;z<P&&te<J;++z,++te)ve=Y[z],ae+=b[ve>>4&15]+b[ve&15]+b[ve>>12&15]+b[ve>>8&15]+b[ve>>20&15]+b[ve>>16&15]+b[ve>>28&15]+b[ve>>24&15];te%P===0&&(le(Y),z=0)}return I&&(ve=Y[z],ae+=b[ve>>4&15]+b[ve&15],I>1&&(ae+=b[ve>>12&15]+b[ve>>8&15]),I>2&&(ae+=b[ve>>20&15]+b[ve>>16&15])),ae},D.prototype.arrayBuffer=function(){this.finalize();var P=this.blockCount,Y=this.s,J=this.outputBlocks,I=this.extraBytes,z=0,te=0,ae=this.outputBits>>3,ve;I?ve=new ArrayBuffer(J+1<<2):ve=new ArrayBuffer(ae);for(var De=new Uint32Array(ve);te<J;){for(z=0;z<P&&te<J;++z,++te)De[te]=Y[z];te%P===0&&le(Y)}return I&&(De[z]=Y[z],ve=ve.slice(0,ae)),ve},D.prototype.buffer=D.prototype.arrayBuffer,D.prototype.digest=D.prototype.array=function(){this.finalize();for(var P=this.blockCount,Y=this.s,J=this.outputBlocks,I=this.extraBytes,z=0,te=0,ae=[],ve,De;te<J;){for(z=0;z<P&&te<J;++z,++te)ve=te<<2,De=Y[z],ae[ve]=De&255,ae[ve+1]=De>>8&255,ae[ve+2]=De>>16&255,ae[ve+3]=De>>24&255;te%P===0&&le(Y)}return I&&(ve=te<<2,De=Y[z],ae[ve]=De&255,I>1&&(ae[ve+1]=De>>8&255),I>2&&(ae[ve+2]=De>>16&255)),ae};function F(P,Y,J){D.call(this,P,Y,J)}i(F,"Kmac"),a(F,"Kmac"),F.prototype=new D,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var le=a(function(P){var Y,J,I,z,te,ae,ve,De,we,de,Ce,pe,_e,Q,ge,Me,Ue,Re,je,rt,fe,ce,Z,re,ye,Se,xe,ke,Mt,qe,He,Ot,dt,vt,kr,ct,ut,cr,lt,nt,ir,it,Ye,Qt,st,Qe,sr,at,Ze,ar,ot,Et,Sn,At,yt,fn,er,tr,tn,rn,Or,Hr,nn;for(I=0;I<48;I+=2)z=P[0]^P[10]^P[20]^P[30]^P[40],te=P[1]^P[11]^P[21]^P[31]^P[41],ae=P[2]^P[12]^P[22]^P[32]^P[42],ve=P[3]^P[13]^P[23]^P[33]^P[43],De=P[4]^P[14]^P[24]^P[34]^P[44],we=P[5]^P[15]^P[25]^P[35]^P[45],de=P[6]^P[16]^P[26]^P[36]^P[46],Ce=P[7]^P[17]^P[27]^P[37]^P[47],pe=P[8]^P[18]^P[28]^P[38]^P[48],_e=P[9]^P[19]^P[29]^P[39]^P[49],Y=pe^(ae<<1|ve>>>31),J=_e^(ve<<1|ae>>>31),P[0]^=Y,P[1]^=J,P[10]^=Y,P[11]^=J,P[20]^=Y,P[21]^=J,P[30]^=Y,P[31]^=J,P[40]^=Y,P[41]^=J,Y=z^(De<<1|we>>>31),J=te^(we<<1|De>>>31),P[2]^=Y,P[3]^=J,P[12]^=Y,P[13]^=J,P[22]^=Y,P[23]^=J,P[32]^=Y,P[33]^=J,P[42]^=Y,P[43]^=J,Y=ae^(de<<1|Ce>>>31),J=ve^(Ce<<1|de>>>31),P[4]^=Y,P[5]^=J,P[14]^=Y,P[15]^=J,P[24]^=Y,P[25]^=J,P[34]^=Y,P[35]^=J,P[44]^=Y,P[45]^=J,Y=De^(pe<<1|_e>>>31),J=we^(_e<<1|pe>>>31),P[6]^=Y,P[7]^=J,P[16]^=Y,P[17]^=J,P[26]^=Y,P[27]^=J,P[36]^=Y,P[37]^=J,P[46]^=Y,P[47]^=J,Y=de^(z<<1|te>>>31),J=Ce^(te<<1|z>>>31),P[8]^=Y,P[9]^=J,P[18]^=Y,P[19]^=J,P[28]^=Y,P[29]^=J,P[38]^=Y,P[39]^=J,P[48]^=Y,P[49]^=J,Q=P[0],ge=P[1],Qe=P[11]<<4|P[10]>>>28,sr=P[10]<<4|P[11]>>>28,ke=P[20]<<3|P[21]>>>29,Mt=P[21]<<3|P[20]>>>29,rn=P[31]<<9|P[30]>>>23,Or=P[30]<<9|P[31]>>>23,it=P[40]<<18|P[41]>>>14,Ye=P[41]<<18|P[40]>>>14,vt=P[2]<<1|P[3]>>>31,kr=P[3]<<1|P[2]>>>31,Me=P[13]<<12|P[12]>>>20,Ue=P[12]<<12|P[13]>>>20,at=P[22]<<10|P[23]>>>22,Ze=P[23]<<10|P[22]>>>22,qe=P[33]<<13|P[32]>>>19,He=P[32]<<13|P[33]>>>19,Hr=P[42]<<2|P[43]>>>30,nn=P[43]<<2|P[42]>>>30,At=P[5]<<30|P[4]>>>2,yt=P[4]<<30|P[5]>>>2,ct=P[14]<<6|P[15]>>>26,ut=P[15]<<6|P[14]>>>26,Re=P[25]<<11|P[24]>>>21,je=P[24]<<11|P[25]>>>21,ar=P[34]<<15|P[35]>>>17,ot=P[35]<<15|P[34]>>>17,Ot=P[45]<<29|P[44]>>>3,dt=P[44]<<29|P[45]>>>3,re=P[6]<<28|P[7]>>>4,ye=P[7]<<28|P[6]>>>4,fn=P[17]<<23|P[16]>>>9,er=P[16]<<23|P[17]>>>9,cr=P[26]<<25|P[27]>>>7,lt=P[27]<<25|P[26]>>>7,rt=P[36]<<21|P[37]>>>11,fe=P[37]<<21|P[36]>>>11,Et=P[47]<<24|P[46]>>>8,Sn=P[46]<<24|P[47]>>>8,Qt=P[8]<<27|P[9]>>>5,st=P[9]<<27|P[8]>>>5,Se=P[18]<<20|P[19]>>>12,xe=P[19]<<20|P[18]>>>12,tr=P[29]<<7|P[28]>>>25,tn=P[28]<<7|P[29]>>>25,nt=P[38]<<8|P[39]>>>24,ir=P[39]<<8|P[38]>>>24,ce=P[48]<<14|P[49]>>>18,Z=P[49]<<14|P[48]>>>18,P[0]=Q^~Me&Re,P[1]=ge^~Ue&je,P[10]=re^~Se&ke,P[11]=ye^~xe&Mt,P[20]=vt^~ct&cr,P[21]=kr^~ut<,P[30]=Qt^~Qe&at,P[31]=st^~sr&Ze,P[40]=At^~fn&tr,P[41]=yt^~er&tn,P[2]=Me^~Re&rt,P[3]=Ue^~je&fe,P[12]=Se^~ke&qe,P[13]=xe^~Mt&He,P[22]=ct^~cr&nt,P[23]=ut^~lt&ir,P[32]=Qe^~at&ar,P[33]=sr^~Ze&ot,P[42]=fn^~tr&rn,P[43]=er^~tn&Or,P[4]=Re^~rt&ce,P[5]=je^~fe&Z,P[14]=ke^~qe&Ot,P[15]=Mt^~He&dt,P[24]=cr^~nt&it,P[25]=lt^~ir&Ye,P[34]=at^~ar&Et,P[35]=Ze^~ot&Sn,P[44]=tr^~rn&Hr,P[45]=tn^~Or&nn,P[6]=rt^~ce&Q,P[7]=fe^~Z&ge,P[16]=qe^~Ot&re,P[17]=He^~dt&ye,P[26]=nt^~it&vt,P[27]=ir^~Ye&kr,P[36]=ar^~Et&Qt,P[37]=ot^~Sn&st,P[46]=rn^~Hr&At,P[47]=Or^~nn&yt,P[8]=ce^~Q&Me,P[9]=Z^~ge&Ue,P[18]=Ot^~re&Se,P[19]=dt^~ye&xe,P[28]=it^~vt&ct,P[29]=Ye^~kr&ut,P[38]=Et^~Qt&Qe,P[39]=Sn^~st&sr,P[48]=Hr^~At&fn,P[49]=nn^~yt&er,P[0]^=L[I],P[1]^=L[I+1]},"f");if(h)t.exports=d;else{for(_=0;_<g.length;++_)o[g[_]]=d[g[_]];p&&define(function(){return d})}})()}}),QU=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/package.json"(e,t){t.exports={name:"elliptic",version:"6.5.4",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"}}}}),bx=ze({"(disabled):../../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js"(){}}),Sa=ze({"../../../node_modules/.pnpm/bn.js@4.12.0/node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){"use strict";function s(q,E){if(!q)throw new Error(E||"Assertion failed")}i(s,"assert2"),a(s,"assert");function o(q,E){q.super_=E;var T=a(function(){},"TempCtor");T.prototype=E.prototype,q.prototype=new T,q.prototype.constructor=q}i(o,"inherits"),a(o,"inherits");function c(q,E,T){if(c.isBN(q))return q;this.negative=0,this.words=null,this.length=0,this.red=null,q!==null&&((E==="le"||E==="be")&&(T=E,E=10),this._init(q||0,E||10,T||"be"))}i(c,"BN3"),a(c,"BN"),typeof r=="object"?r.exports=c:n.BN=c,c.BN=c,c.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=bx().Buffer}catch{}c.isBN=a(i(function(E){return E instanceof c?!0:E!==null&&typeof E=="object"&&E.constructor.wordSize===c.wordSize&&Array.isArray(E.words)},"isBN"),"isBN"),c.max=a(i(function(E,T){return E.cmp(T)>0?E:T},"max"),"max"),c.min=a(i(function(E,T){return E.cmp(T)<0?E:T},"min"),"min"),c.prototype._init=a(i(function(E,T,m){if(typeof E=="number")return this._initNumber(E,T,m);if(typeof E=="object")return this._initArray(E,T,m);T==="hex"&&(T=16),s(T===(T|0)&&T>=2&&T<=36),E=E.toString().replace(/\s+/g,"");var d=0;E[0]==="-"&&(d++,this.negative=1),d<E.length&&(T===16?this._parseHex(E,d,m):(this._parseBase(E,T,d),m==="le"&&this._initArray(this.toArray(),T,m)))},"init2"),"init"),c.prototype._initNumber=a(i(function(E,T,m){E<0&&(this.negative=1,E=-E),E<67108864?(this.words=[E&67108863],this.length=1):E<4503599627370496?(this.words=[E&67108863,E/67108864&67108863],this.length=2):(s(E<9007199254740992),this.words=[E&67108863,E/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),T,m)},"_initNumber"),"_initNumber"),c.prototype._initArray=a(i(function(E,T,m){if(s(typeof E.length=="number"),E.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(E.length/3),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var g,_,M=0;if(m==="be")for(d=E.length-1,g=0;d>=0;d-=3)_=E[d]|E[d-1]<<8|E[d-2]<<16,this.words[g]|=_<<M&67108863,this.words[g+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=26,g++);else if(m==="le")for(d=0,g=0;d<E.length;d+=3)_=E[d]|E[d+1]<<8|E[d+2]<<16,this.words[g]|=_<<M&67108863,this.words[g+1]=_>>>26-M&67108863,M+=24,M>=26&&(M-=26,g++);return this.strip()},"_initArray"),"_initArray");function h(q,E){var T=q.charCodeAt(E);return T>=65&&T<=70?T-55:T>=97&&T<=102?T-87:T-48&15}i(h,"parseHex4Bits"),a(h,"parseHex4Bits");function p(q,E,T){var m=h(q,T);return T-1>=E&&(m|=h(q,T-1)<<4),m}i(p,"parseHexByte"),a(p,"parseHexByte"),c.prototype._parseHex=a(i(function(E,T,m){this.length=Math.ceil((E.length-T)/6),this.words=new Array(this.length);for(var d=0;d<this.length;d++)this.words[d]=0;var g=0,_=0,M;if(m==="be")for(d=E.length-1;d>=T;d-=2)M=p(E,T,d)<<g,this.words[_]|=M&67108863,g>=18?(g-=18,_+=1,this.words[_]|=M>>>26):g+=8;else{var S=E.length-T;for(d=S%2===0?T+1:T;d<E.length;d+=2)M=p(E,T,d)<<g,this.words[_]|=M&67108863,g>=18?(g-=18,_+=1,this.words[_]|=M>>>26):g+=8}this.strip()},"_parseHex"),"_parseHex");function v(q,E,T,m){for(var d=0,g=Math.min(q.length,T),_=E;_<g;_++){var M=q.charCodeAt(_)-48;d*=m,M>=49?d+=M-49+10:M>=17?d+=M-17+10:d+=M}return d}i(v,"parseBase"),a(v,"parseBase"),c.prototype._parseBase=a(i(function(E,T,m){this.words=[0],this.length=1;for(var d=0,g=1;g<=67108863;g*=T)d++;d--,g=g/T|0;for(var _=E.length-m,M=_%d,S=Math.min(_,_-M)+m,w=0,N=m;N<S;N+=d)w=v(E,N,N+d,T),this.imuln(g),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(M!==0){var B=1;for(w=v(E,N,E.length,T),N=0;N<M;N++)B*=T;this.imuln(B),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this.strip()},"_parseBase"),"_parseBase"),c.prototype.copy=a(i(function(E){E.words=new Array(this.length);for(var T=0;T<this.length;T++)E.words[T]=this.words[T];E.length=this.length,E.negative=this.negative,E.red=this.red},"copy"),"copy"),c.prototype.clone=a(i(function(){var E=new c(null);return this.copy(E),E},"clone"),"clone"),c.prototype._expand=a(i(function(E){for(;this.length<E;)this.words[this.length++]=0;return this},"_expand"),"_expand"),c.prototype.strip=a(i(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),"strip"),c.prototype._normSign=a(i(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),"_normSign"),c.prototype.inspect=a(i(function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"},"inspect4"),"inspect");var b=["","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"],y=[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],A=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=a(i(function(E,T){E=E||10,T=T|0||1;var m;if(E===16||E==="hex"){m="";for(var d=0,g=0,_=0;_<this.length;_++){var M=this.words[_],S=((M<<d|g)&16777215).toString(16);g=M>>>24-d&16777215,g!==0||_!==this.length-1?m=b[6-S.length]+S+m:m=S+m,d+=2,d>=26&&(d-=26,_--)}for(g!==0&&(m=g.toString(16)+m);m.length%T!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(E===(E|0)&&E>=2&&E<=36){var w=y[E],N=A[E];m="";var B=this.clone();for(B.negative=0;!B.isZero();){var D=B.modn(N).toString(E);B=B.idivn(N),B.isZero()?m=D+m:m=b[w-D.length]+D+m}for(this.isZero()&&(m="0"+m);m.length%T!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}s(!1,"Base should be between 2 and 36")},"toString4"),"toString"),c.prototype.toNumber=a(i(function(){var E=this.words[0];return this.length===2?E+=this.words[1]*67108864:this.length===3&&this.words[2]===1?E+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-E:E},"toNumber"),"toNumber"),c.prototype.toJSON=a(i(function(){return this.toString(16)},"toJSON2"),"toJSON"),c.prototype.toBuffer=a(i(function(E,T){return s(typeof l<"u"),this.toArrayLike(l,E,T)},"toBuffer"),"toBuffer"),c.prototype.toArray=a(i(function(E,T){return this.toArrayLike(Array,E,T)},"toArray"),"toArray"),c.prototype.toArrayLike=a(i(function(E,T,m){var d=this.byteLength(),g=m||Math.max(1,d);s(d<=g,"byte array longer than desired length"),s(g>0,"Requested array length <= 0"),this.strip();var _=T==="le",M=new E(g),S,w,N=this.clone();if(_){for(w=0;!N.isZero();w++)S=N.andln(255),N.iushrn(8),M[w]=S;for(;w<g;w++)M[w]=0}else{for(w=0;w<g-d;w++)M[w]=0;for(w=0;!N.isZero();w++)S=N.andln(255),N.iushrn(8),M[g-w-1]=S}return M},"toArrayLike"),"toArrayLike"),Math.clz32?c.prototype._countBits=a(i(function(E){return 32-Math.clz32(E)},"_countBits"),"_countBits"):c.prototype._countBits=a(i(function(E){var T=E,m=0;return T>=4096&&(m+=13,T>>>=13),T>=64&&(m+=7,T>>>=7),T>=8&&(m+=4,T>>>=4),T>=2&&(m+=2,T>>>=2),m+T},"_countBits"),"_countBits"),c.prototype._zeroBits=a(i(function(E){if(E===0)return 26;var T=E,m=0;return(T&8191)===0&&(m+=13,T>>>=13),(T&127)===0&&(m+=7,T>>>=7),(T&15)===0&&(m+=4,T>>>=4),(T&3)===0&&(m+=2,T>>>=2),(T&1)===0&&m++,m},"_zeroBits"),"_zeroBits"),c.prototype.bitLength=a(i(function(){var E=this.words[this.length-1],T=this._countBits(E);return(this.length-1)*26+T},"bitLength"),"bitLength");function C(q){for(var E=new Array(q.bitLength()),T=0;T<E.length;T++){var m=T/26|0,d=T%26;E[T]=(q.words[m]&1<<d)>>>d}return E}i(C,"toBitArray"),a(C,"toBitArray"),c.prototype.zeroBits=a(i(function(){if(this.isZero())return 0;for(var E=0,T=0;T<this.length;T++){var m=this._zeroBits(this.words[T]);if(E+=m,m!==26)break}return E},"zeroBits"),"zeroBits"),c.prototype.byteLength=a(i(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),"byteLength"),c.prototype.toTwos=a(i(function(E){return this.negative!==0?this.abs().inotn(E).iaddn(1):this.clone()},"toTwos"),"toTwos"),c.prototype.fromTwos=a(i(function(E){return this.testn(E-1)?this.notn(E).iaddn(1).ineg():this.clone()},"fromTwos"),"fromTwos"),c.prototype.isNeg=a(i(function(){return this.negative!==0},"isNeg"),"isNeg"),c.prototype.neg=a(i(function(){return this.clone().ineg()},"neg3"),"neg"),c.prototype.ineg=a(i(function(){return this.isZero()||(this.negative^=1),this},"ineg"),"ineg"),c.prototype.iuor=a(i(function(E){for(;this.length<E.length;)this.words[this.length++]=0;for(var T=0;T<E.length;T++)this.words[T]=this.words[T]|E.words[T];return this.strip()},"iuor"),"iuor"),c.prototype.ior=a(i(function(E){return s((this.negative|E.negative)===0),this.iuor(E)},"ior"),"ior"),c.prototype.or=a(i(function(E){return this.length>E.length?this.clone().ior(E):E.clone().ior(this)},"or2"),"or"),c.prototype.uor=a(i(function(E){return this.length>E.length?this.clone().iuor(E):E.clone().iuor(this)},"uor"),"uor"),c.prototype.iuand=a(i(function(E){var T;this.length>E.length?T=E:T=this;for(var m=0;m<T.length;m++)this.words[m]=this.words[m]&E.words[m];return this.length=T.length,this.strip()},"iuand"),"iuand"),c.prototype.iand=a(i(function(E){return s((this.negative|E.negative)===0),this.iuand(E)},"iand"),"iand"),c.prototype.and=a(i(function(E){return this.length>E.length?this.clone().iand(E):E.clone().iand(this)},"and"),"and"),c.prototype.uand=a(i(function(E){return this.length>E.length?this.clone().iuand(E):E.clone().iuand(this)},"uand"),"uand"),c.prototype.iuxor=a(i(function(E){var T,m;this.length>E.length?(T=this,m=E):(T=E,m=this);for(var d=0;d<m.length;d++)this.words[d]=T.words[d]^m.words[d];if(this!==T)for(;d<T.length;d++)this.words[d]=T.words[d];return this.length=T.length,this.strip()},"iuxor"),"iuxor"),c.prototype.ixor=a(i(function(E){return s((this.negative|E.negative)===0),this.iuxor(E)},"ixor"),"ixor"),c.prototype.xor=a(i(function(E){return this.length>E.length?this.clone().ixor(E):E.clone().ixor(this)},"xor2"),"xor"),c.prototype.uxor=a(i(function(E){return this.length>E.length?this.clone().iuxor(E):E.clone().iuxor(this)},"uxor"),"uxor"),c.prototype.inotn=a(i(function(E){s(typeof E=="number"&&E>=0);var T=Math.ceil(E/26)|0,m=E%26;this._expand(T),m>0&&T--;for(var d=0;d<T;d++)this.words[d]=~this.words[d]&67108863;return m>0&&(this.words[d]=~this.words[d]&67108863>>26-m),this.strip()},"inotn"),"inotn"),c.prototype.notn=a(i(function(E){return this.clone().inotn(E)},"notn"),"notn"),c.prototype.setn=a(i(function(E,T){s(typeof E=="number"&&E>=0);var m=E/26|0,d=E%26;return this._expand(m+1),T?this.words[m]=this.words[m]|1<<d:this.words[m]=this.words[m]&~(1<<d),this.strip()},"setn"),"setn"),c.prototype.iadd=a(i(function(E){var T;if(this.negative!==0&&E.negative===0)return this.negative=0,T=this.isub(E),this.negative^=1,this._normSign();if(this.negative===0&&E.negative!==0)return E.negative=0,T=this.isub(E),E.negative=1,T._normSign();var m,d;this.length>E.length?(m=this,d=E):(m=E,d=this);for(var g=0,_=0;_<d.length;_++)T=(m.words[_]|0)+(d.words[_]|0)+g,this.words[_]=T&67108863,g=T>>>26;for(;g!==0&&_<m.length;_++)T=(m.words[_]|0)+g,this.words[_]=T&67108863,g=T>>>26;if(this.length=m.length,g!==0)this.words[this.length]=g,this.length++;else if(m!==this)for(;_<m.length;_++)this.words[_]=m.words[_];return this},"iadd"),"iadd"),c.prototype.add=a(i(function(E){var T;return E.negative!==0&&this.negative===0?(E.negative=0,T=this.sub(E),E.negative^=1,T):E.negative===0&&this.negative!==0?(this.negative=0,T=E.sub(this),this.negative=1,T):this.length>E.length?this.clone().iadd(E):E.clone().iadd(this)},"add3"),"add"),c.prototype.isub=a(i(function(E){if(E.negative!==0){E.negative=0;var T=this.iadd(E);return E.negative=1,T._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(E),this.negative=1,this._normSign();var m=this.cmp(E);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var d,g;m>0?(d=this,g=E):(d=E,g=this);for(var _=0,M=0;M<g.length;M++)T=(d.words[M]|0)-(g.words[M]|0)+_,_=T>>26,this.words[M]=T&67108863;for(;_!==0&&M<d.length;M++)T=(d.words[M]|0)+_,_=T>>26,this.words[M]=T&67108863;if(_===0&&M<d.length&&d!==this)for(;M<d.length;M++)this.words[M]=d.words[M];return this.length=Math.max(this.length,M),d!==this&&(this.negative=1),this.strip()},"isub"),"isub"),c.prototype.sub=a(i(function(E){return this.clone().isub(E)},"sub"),"sub");function O(q,E,T){T.negative=E.negative^q.negative;var m=q.length+E.length|0;T.length=m,m=m-1|0;var d=q.words[0]|0,g=E.words[0]|0,_=d*g,M=_&67108863,S=_/67108864|0;T.words[0]=M;for(var w=1;w<m;w++){for(var N=S>>>26,B=S&67108863,D=Math.min(w,E.length-1),F=Math.max(0,w-q.length+1);F<=D;F++){var le=w-F|0;d=q.words[le]|0,g=E.words[F]|0,_=d*g+B,N+=_/67108864|0,B=_&67108863}T.words[w]=B|0,S=N|0}return S!==0?T.words[w]=S|0:T.length--,T.strip()}i(O,"smallMulTo"),a(O,"smallMulTo");var R=a(i(function(E,T,m){var d=E.words,g=T.words,_=m.words,M=0,S,w,N,B=d[0]|0,D=B&8191,F=B>>>13,le=d[1]|0,P=le&8191,Y=le>>>13,J=d[2]|0,I=J&8191,z=J>>>13,te=d[3]|0,ae=te&8191,ve=te>>>13,De=d[4]|0,we=De&8191,de=De>>>13,Ce=d[5]|0,pe=Ce&8191,_e=Ce>>>13,Q=d[6]|0,ge=Q&8191,Me=Q>>>13,Ue=d[7]|0,Re=Ue&8191,je=Ue>>>13,rt=d[8]|0,fe=rt&8191,ce=rt>>>13,Z=d[9]|0,re=Z&8191,ye=Z>>>13,Se=g[0]|0,xe=Se&8191,ke=Se>>>13,Mt=g[1]|0,qe=Mt&8191,He=Mt>>>13,Ot=g[2]|0,dt=Ot&8191,vt=Ot>>>13,kr=g[3]|0,ct=kr&8191,ut=kr>>>13,cr=g[4]|0,lt=cr&8191,nt=cr>>>13,ir=g[5]|0,it=ir&8191,Ye=ir>>>13,Qt=g[6]|0,st=Qt&8191,Qe=Qt>>>13,sr=g[7]|0,at=sr&8191,Ze=sr>>>13,ar=g[8]|0,ot=ar&8191,Et=ar>>>13,Sn=g[9]|0,At=Sn&8191,yt=Sn>>>13;m.negative=E.negative^T.negative,m.length=19,S=Math.imul(D,xe),w=Math.imul(D,ke),w=w+Math.imul(F,xe)|0,N=Math.imul(F,ke);var fn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(fn>>>26)|0,fn&=67108863,S=Math.imul(P,xe),w=Math.imul(P,ke),w=w+Math.imul(Y,xe)|0,N=Math.imul(Y,ke),S=S+Math.imul(D,qe)|0,w=w+Math.imul(D,He)|0,w=w+Math.imul(F,qe)|0,N=N+Math.imul(F,He)|0;var er=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(er>>>26)|0,er&=67108863,S=Math.imul(I,xe),w=Math.imul(I,ke),w=w+Math.imul(z,xe)|0,N=Math.imul(z,ke),S=S+Math.imul(P,qe)|0,w=w+Math.imul(P,He)|0,w=w+Math.imul(Y,qe)|0,N=N+Math.imul(Y,He)|0,S=S+Math.imul(D,dt)|0,w=w+Math.imul(D,vt)|0,w=w+Math.imul(F,dt)|0,N=N+Math.imul(F,vt)|0;var tr=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(tr>>>26)|0,tr&=67108863,S=Math.imul(ae,xe),w=Math.imul(ae,ke),w=w+Math.imul(ve,xe)|0,N=Math.imul(ve,ke),S=S+Math.imul(I,qe)|0,w=w+Math.imul(I,He)|0,w=w+Math.imul(z,qe)|0,N=N+Math.imul(z,He)|0,S=S+Math.imul(P,dt)|0,w=w+Math.imul(P,vt)|0,w=w+Math.imul(Y,dt)|0,N=N+Math.imul(Y,vt)|0,S=S+Math.imul(D,ct)|0,w=w+Math.imul(D,ut)|0,w=w+Math.imul(F,ct)|0,N=N+Math.imul(F,ut)|0;var tn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(tn>>>26)|0,tn&=67108863,S=Math.imul(we,xe),w=Math.imul(we,ke),w=w+Math.imul(de,xe)|0,N=Math.imul(de,ke),S=S+Math.imul(ae,qe)|0,w=w+Math.imul(ae,He)|0,w=w+Math.imul(ve,qe)|0,N=N+Math.imul(ve,He)|0,S=S+Math.imul(I,dt)|0,w=w+Math.imul(I,vt)|0,w=w+Math.imul(z,dt)|0,N=N+Math.imul(z,vt)|0,S=S+Math.imul(P,ct)|0,w=w+Math.imul(P,ut)|0,w=w+Math.imul(Y,ct)|0,N=N+Math.imul(Y,ut)|0,S=S+Math.imul(D,lt)|0,w=w+Math.imul(D,nt)|0,w=w+Math.imul(F,lt)|0,N=N+Math.imul(F,nt)|0;var rn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(rn>>>26)|0,rn&=67108863,S=Math.imul(pe,xe),w=Math.imul(pe,ke),w=w+Math.imul(_e,xe)|0,N=Math.imul(_e,ke),S=S+Math.imul(we,qe)|0,w=w+Math.imul(we,He)|0,w=w+Math.imul(de,qe)|0,N=N+Math.imul(de,He)|0,S=S+Math.imul(ae,dt)|0,w=w+Math.imul(ae,vt)|0,w=w+Math.imul(ve,dt)|0,N=N+Math.imul(ve,vt)|0,S=S+Math.imul(I,ct)|0,w=w+Math.imul(I,ut)|0,w=w+Math.imul(z,ct)|0,N=N+Math.imul(z,ut)|0,S=S+Math.imul(P,lt)|0,w=w+Math.imul(P,nt)|0,w=w+Math.imul(Y,lt)|0,N=N+Math.imul(Y,nt)|0,S=S+Math.imul(D,it)|0,w=w+Math.imul(D,Ye)|0,w=w+Math.imul(F,it)|0,N=N+Math.imul(F,Ye)|0;var Or=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Or>>>26)|0,Or&=67108863,S=Math.imul(ge,xe),w=Math.imul(ge,ke),w=w+Math.imul(Me,xe)|0,N=Math.imul(Me,ke),S=S+Math.imul(pe,qe)|0,w=w+Math.imul(pe,He)|0,w=w+Math.imul(_e,qe)|0,N=N+Math.imul(_e,He)|0,S=S+Math.imul(we,dt)|0,w=w+Math.imul(we,vt)|0,w=w+Math.imul(de,dt)|0,N=N+Math.imul(de,vt)|0,S=S+Math.imul(ae,ct)|0,w=w+Math.imul(ae,ut)|0,w=w+Math.imul(ve,ct)|0,N=N+Math.imul(ve,ut)|0,S=S+Math.imul(I,lt)|0,w=w+Math.imul(I,nt)|0,w=w+Math.imul(z,lt)|0,N=N+Math.imul(z,nt)|0,S=S+Math.imul(P,it)|0,w=w+Math.imul(P,Ye)|0,w=w+Math.imul(Y,it)|0,N=N+Math.imul(Y,Ye)|0,S=S+Math.imul(D,st)|0,w=w+Math.imul(D,Qe)|0,w=w+Math.imul(F,st)|0,N=N+Math.imul(F,Qe)|0;var Hr=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,S=Math.imul(Re,xe),w=Math.imul(Re,ke),w=w+Math.imul(je,xe)|0,N=Math.imul(je,ke),S=S+Math.imul(ge,qe)|0,w=w+Math.imul(ge,He)|0,w=w+Math.imul(Me,qe)|0,N=N+Math.imul(Me,He)|0,S=S+Math.imul(pe,dt)|0,w=w+Math.imul(pe,vt)|0,w=w+Math.imul(_e,dt)|0,N=N+Math.imul(_e,vt)|0,S=S+Math.imul(we,ct)|0,w=w+Math.imul(we,ut)|0,w=w+Math.imul(de,ct)|0,N=N+Math.imul(de,ut)|0,S=S+Math.imul(ae,lt)|0,w=w+Math.imul(ae,nt)|0,w=w+Math.imul(ve,lt)|0,N=N+Math.imul(ve,nt)|0,S=S+Math.imul(I,it)|0,w=w+Math.imul(I,Ye)|0,w=w+Math.imul(z,it)|0,N=N+Math.imul(z,Ye)|0,S=S+Math.imul(P,st)|0,w=w+Math.imul(P,Qe)|0,w=w+Math.imul(Y,st)|0,N=N+Math.imul(Y,Qe)|0,S=S+Math.imul(D,at)|0,w=w+Math.imul(D,Ze)|0,w=w+Math.imul(F,at)|0,N=N+Math.imul(F,Ze)|0;var nn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(nn>>>26)|0,nn&=67108863,S=Math.imul(fe,xe),w=Math.imul(fe,ke),w=w+Math.imul(ce,xe)|0,N=Math.imul(ce,ke),S=S+Math.imul(Re,qe)|0,w=w+Math.imul(Re,He)|0,w=w+Math.imul(je,qe)|0,N=N+Math.imul(je,He)|0,S=S+Math.imul(ge,dt)|0,w=w+Math.imul(ge,vt)|0,w=w+Math.imul(Me,dt)|0,N=N+Math.imul(Me,vt)|0,S=S+Math.imul(pe,ct)|0,w=w+Math.imul(pe,ut)|0,w=w+Math.imul(_e,ct)|0,N=N+Math.imul(_e,ut)|0,S=S+Math.imul(we,lt)|0,w=w+Math.imul(we,nt)|0,w=w+Math.imul(de,lt)|0,N=N+Math.imul(de,nt)|0,S=S+Math.imul(ae,it)|0,w=w+Math.imul(ae,Ye)|0,w=w+Math.imul(ve,it)|0,N=N+Math.imul(ve,Ye)|0,S=S+Math.imul(I,st)|0,w=w+Math.imul(I,Qe)|0,w=w+Math.imul(z,st)|0,N=N+Math.imul(z,Qe)|0,S=S+Math.imul(P,at)|0,w=w+Math.imul(P,Ze)|0,w=w+Math.imul(Y,at)|0,N=N+Math.imul(Y,Ze)|0,S=S+Math.imul(D,ot)|0,w=w+Math.imul(D,Et)|0,w=w+Math.imul(F,ot)|0,N=N+Math.imul(F,Et)|0;var xn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(xn>>>26)|0,xn&=67108863,S=Math.imul(re,xe),w=Math.imul(re,ke),w=w+Math.imul(ye,xe)|0,N=Math.imul(ye,ke),S=S+Math.imul(fe,qe)|0,w=w+Math.imul(fe,He)|0,w=w+Math.imul(ce,qe)|0,N=N+Math.imul(ce,He)|0,S=S+Math.imul(Re,dt)|0,w=w+Math.imul(Re,vt)|0,w=w+Math.imul(je,dt)|0,N=N+Math.imul(je,vt)|0,S=S+Math.imul(ge,ct)|0,w=w+Math.imul(ge,ut)|0,w=w+Math.imul(Me,ct)|0,N=N+Math.imul(Me,ut)|0,S=S+Math.imul(pe,lt)|0,w=w+Math.imul(pe,nt)|0,w=w+Math.imul(_e,lt)|0,N=N+Math.imul(_e,nt)|0,S=S+Math.imul(we,it)|0,w=w+Math.imul(we,Ye)|0,w=w+Math.imul(de,it)|0,N=N+Math.imul(de,Ye)|0,S=S+Math.imul(ae,st)|0,w=w+Math.imul(ae,Qe)|0,w=w+Math.imul(ve,st)|0,N=N+Math.imul(ve,Qe)|0,S=S+Math.imul(I,at)|0,w=w+Math.imul(I,Ze)|0,w=w+Math.imul(z,at)|0,N=N+Math.imul(z,Ze)|0,S=S+Math.imul(P,ot)|0,w=w+Math.imul(P,Et)|0,w=w+Math.imul(Y,ot)|0,N=N+Math.imul(Y,Et)|0,S=S+Math.imul(D,At)|0,w=w+Math.imul(D,yt)|0,w=w+Math.imul(F,At)|0,N=N+Math.imul(F,yt)|0;var Ei=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,S=Math.imul(re,qe),w=Math.imul(re,He),w=w+Math.imul(ye,qe)|0,N=Math.imul(ye,He),S=S+Math.imul(fe,dt)|0,w=w+Math.imul(fe,vt)|0,w=w+Math.imul(ce,dt)|0,N=N+Math.imul(ce,vt)|0,S=S+Math.imul(Re,ct)|0,w=w+Math.imul(Re,ut)|0,w=w+Math.imul(je,ct)|0,N=N+Math.imul(je,ut)|0,S=S+Math.imul(ge,lt)|0,w=w+Math.imul(ge,nt)|0,w=w+Math.imul(Me,lt)|0,N=N+Math.imul(Me,nt)|0,S=S+Math.imul(pe,it)|0,w=w+Math.imul(pe,Ye)|0,w=w+Math.imul(_e,it)|0,N=N+Math.imul(_e,Ye)|0,S=S+Math.imul(we,st)|0,w=w+Math.imul(we,Qe)|0,w=w+Math.imul(de,st)|0,N=N+Math.imul(de,Qe)|0,S=S+Math.imul(ae,at)|0,w=w+Math.imul(ae,Ze)|0,w=w+Math.imul(ve,at)|0,N=N+Math.imul(ve,Ze)|0,S=S+Math.imul(I,ot)|0,w=w+Math.imul(I,Et)|0,w=w+Math.imul(z,ot)|0,N=N+Math.imul(z,Et)|0,S=S+Math.imul(P,At)|0,w=w+Math.imul(P,yt)|0,w=w+Math.imul(Y,At)|0,N=N+Math.imul(Y,yt)|0;var Ai=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,S=Math.imul(re,dt),w=Math.imul(re,vt),w=w+Math.imul(ye,dt)|0,N=Math.imul(ye,vt),S=S+Math.imul(fe,ct)|0,w=w+Math.imul(fe,ut)|0,w=w+Math.imul(ce,ct)|0,N=N+Math.imul(ce,ut)|0,S=S+Math.imul(Re,lt)|0,w=w+Math.imul(Re,nt)|0,w=w+Math.imul(je,lt)|0,N=N+Math.imul(je,nt)|0,S=S+Math.imul(ge,it)|0,w=w+Math.imul(ge,Ye)|0,w=w+Math.imul(Me,it)|0,N=N+Math.imul(Me,Ye)|0,S=S+Math.imul(pe,st)|0,w=w+Math.imul(pe,Qe)|0,w=w+Math.imul(_e,st)|0,N=N+Math.imul(_e,Qe)|0,S=S+Math.imul(we,at)|0,w=w+Math.imul(we,Ze)|0,w=w+Math.imul(de,at)|0,N=N+Math.imul(de,Ze)|0,S=S+Math.imul(ae,ot)|0,w=w+Math.imul(ae,Et)|0,w=w+Math.imul(ve,ot)|0,N=N+Math.imul(ve,Et)|0,S=S+Math.imul(I,At)|0,w=w+Math.imul(I,yt)|0,w=w+Math.imul(z,At)|0,N=N+Math.imul(z,yt)|0;var Si=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Si>>>26)|0,Si&=67108863,S=Math.imul(re,ct),w=Math.imul(re,ut),w=w+Math.imul(ye,ct)|0,N=Math.imul(ye,ut),S=S+Math.imul(fe,lt)|0,w=w+Math.imul(fe,nt)|0,w=w+Math.imul(ce,lt)|0,N=N+Math.imul(ce,nt)|0,S=S+Math.imul(Re,it)|0,w=w+Math.imul(Re,Ye)|0,w=w+Math.imul(je,it)|0,N=N+Math.imul(je,Ye)|0,S=S+Math.imul(ge,st)|0,w=w+Math.imul(ge,Qe)|0,w=w+Math.imul(Me,st)|0,N=N+Math.imul(Me,Qe)|0,S=S+Math.imul(pe,at)|0,w=w+Math.imul(pe,Ze)|0,w=w+Math.imul(_e,at)|0,N=N+Math.imul(_e,Ze)|0,S=S+Math.imul(we,ot)|0,w=w+Math.imul(we,Et)|0,w=w+Math.imul(de,ot)|0,N=N+Math.imul(de,Et)|0,S=S+Math.imul(ae,At)|0,w=w+Math.imul(ae,yt)|0,w=w+Math.imul(ve,At)|0,N=N+Math.imul(ve,yt)|0;var Bn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,S=Math.imul(re,lt),w=Math.imul(re,nt),w=w+Math.imul(ye,lt)|0,N=Math.imul(ye,nt),S=S+Math.imul(fe,it)|0,w=w+Math.imul(fe,Ye)|0,w=w+Math.imul(ce,it)|0,N=N+Math.imul(ce,Ye)|0,S=S+Math.imul(Re,st)|0,w=w+Math.imul(Re,Qe)|0,w=w+Math.imul(je,st)|0,N=N+Math.imul(je,Qe)|0,S=S+Math.imul(ge,at)|0,w=w+Math.imul(ge,Ze)|0,w=w+Math.imul(Me,at)|0,N=N+Math.imul(Me,Ze)|0,S=S+Math.imul(pe,ot)|0,w=w+Math.imul(pe,Et)|0,w=w+Math.imul(_e,ot)|0,N=N+Math.imul(_e,Et)|0,S=S+Math.imul(we,At)|0,w=w+Math.imul(we,yt)|0,w=w+Math.imul(de,At)|0,N=N+Math.imul(de,yt)|0;var dn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(dn>>>26)|0,dn&=67108863,S=Math.imul(re,it),w=Math.imul(re,Ye),w=w+Math.imul(ye,it)|0,N=Math.imul(ye,Ye),S=S+Math.imul(fe,st)|0,w=w+Math.imul(fe,Qe)|0,w=w+Math.imul(ce,st)|0,N=N+Math.imul(ce,Qe)|0,S=S+Math.imul(Re,at)|0,w=w+Math.imul(Re,Ze)|0,w=w+Math.imul(je,at)|0,N=N+Math.imul(je,Ze)|0,S=S+Math.imul(ge,ot)|0,w=w+Math.imul(ge,Et)|0,w=w+Math.imul(Me,ot)|0,N=N+Math.imul(Me,Et)|0,S=S+Math.imul(pe,At)|0,w=w+Math.imul(pe,yt)|0,w=w+Math.imul(_e,At)|0,N=N+Math.imul(_e,yt)|0;var Xn=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,S=Math.imul(re,st),w=Math.imul(re,Qe),w=w+Math.imul(ye,st)|0,N=Math.imul(ye,Qe),S=S+Math.imul(fe,at)|0,w=w+Math.imul(fe,Ze)|0,w=w+Math.imul(ce,at)|0,N=N+Math.imul(ce,Ze)|0,S=S+Math.imul(Re,ot)|0,w=w+Math.imul(Re,Et)|0,w=w+Math.imul(je,ot)|0,N=N+Math.imul(je,Et)|0,S=S+Math.imul(ge,At)|0,w=w+Math.imul(ge,yt)|0,w=w+Math.imul(Me,At)|0,N=N+Math.imul(Me,yt)|0;var Ln=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,S=Math.imul(re,at),w=Math.imul(re,Ze),w=w+Math.imul(ye,at)|0,N=Math.imul(ye,Ze),S=S+Math.imul(fe,ot)|0,w=w+Math.imul(fe,Et)|0,w=w+Math.imul(ce,ot)|0,N=N+Math.imul(ce,Et)|0,S=S+Math.imul(Re,At)|0,w=w+Math.imul(Re,yt)|0,w=w+Math.imul(je,At)|0,N=N+Math.imul(je,yt)|0;var xi=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(xi>>>26)|0,xi&=67108863,S=Math.imul(re,ot),w=Math.imul(re,Et),w=w+Math.imul(ye,ot)|0,N=Math.imul(ye,Et),S=S+Math.imul(fe,At)|0,w=w+Math.imul(fe,yt)|0,w=w+Math.imul(ce,At)|0,N=N+Math.imul(ce,yt)|0;var Ti=(M+S|0)+((w&8191)<<13)|0;M=(N+(w>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,S=Math.imul(re,At),w=Math.imul(re,yt),w=w+Math.imul(ye,At)|0,N=Math.imul(ye,yt);var Mi=(M+S|0)+((w&8191)<<13)|0;return M=(N+(w>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,_[0]=fn,_[1]=er,_[2]=tr,_[3]=tn,_[4]=rn,_[5]=Or,_[6]=Hr,_[7]=nn,_[8]=xn,_[9]=Ei,_[10]=Ai,_[11]=Si,_[12]=Bn,_[13]=dn,_[14]=Xn,_[15]=Ln,_[16]=xi,_[17]=Ti,_[18]=Mi,M!==0&&(_[19]=M,m.length++),m},"comb10MulTo2"),"comb10MulTo");Math.imul||(R=O);function L(q,E,T){T.negative=E.negative^q.negative,T.length=q.length+E.length;for(var m=0,d=0,g=0;g<T.length-1;g++){var _=d;d=0;for(var M=m&67108863,S=Math.min(g,E.length-1),w=Math.max(0,g-q.length+1);w<=S;w++){var N=g-w,B=q.words[N]|0,D=E.words[w]|0,F=B*D,le=F&67108863;_=_+(F/67108864|0)|0,le=le+M|0,M=le&67108863,_=_+(le>>>26)|0,d+=_>>>26,_&=67108863}T.words[g]=M,m=_,_=d}return m!==0?T.words[g]=m:T.length--,T.strip()}i(L,"bigMulTo"),a(L,"bigMulTo");function K(q,E,T){var m=new $;return m.mulp(q,E,T)}i(K,"jumboMulTo"),a(K,"jumboMulTo"),c.prototype.mulTo=a(i(function(E,T){var m,d=this.length+E.length;return this.length===10&&E.length===10?m=R(this,E,T):d<63?m=O(this,E,T):d<1024?m=L(this,E,T):m=K(this,E,T),m},"mulTo"),"mulTo");function $(q,E){this.x=q,this.y=E}i($,"FFTM"),a($,"FFTM"),$.prototype.makeRBT=a(i(function(E){for(var T=new Array(E),m=c.prototype._countBits(E)-1,d=0;d<E;d++)T[d]=this.revBin(d,m,E);return T},"makeRBT"),"makeRBT"),$.prototype.revBin=a(i(function(E,T,m){if(E===0||E===m-1)return E;for(var d=0,g=0;g<T;g++)d|=(E&1)<<T-g-1,E>>=1;return d},"revBin"),"revBin"),$.prototype.permute=a(i(function(E,T,m,d,g,_){for(var M=0;M<_;M++)d[M]=T[E[M]],g[M]=m[E[M]]},"permute"),"permute"),$.prototype.transform=a(i(function(E,T,m,d,g,_){this.permute(_,E,T,m,d,g);for(var M=1;M<g;M<<=1)for(var S=M<<1,w=Math.cos(2*Math.PI/S),N=Math.sin(2*Math.PI/S),B=0;B<g;B+=S)for(var D=w,F=N,le=0;le<M;le++){var P=m[B+le],Y=d[B+le],J=m[B+le+M],I=d[B+le+M],z=D*J-F*I;I=D*I+F*J,J=z,m[B+le]=P+J,d[B+le]=Y+I,m[B+le+M]=P-J,d[B+le+M]=Y-I,le!==S&&(z=w*D-N*F,F=w*F+N*D,D=z)}},"transform"),"transform"),$.prototype.guessLen13b=a(i(function(E,T){var m=Math.max(T,E)|1,d=m&1,g=0;for(m=m/2|0;m;m=m>>>1)g++;return 1<<g+1+d},"guessLen13b"),"guessLen13b"),$.prototype.conjugate=a(i(function(E,T,m){if(!(m<=1))for(var d=0;d<m/2;d++){var g=E[d];E[d]=E[m-d-1],E[m-d-1]=g,g=T[d],T[d]=-T[m-d-1],T[m-d-1]=-g}},"conjugate"),"conjugate"),$.prototype.normalize13b=a(i(function(E,T){for(var m=0,d=0;d<T/2;d++){var g=Math.round(E[2*d+1]/T)*8192+Math.round(E[2*d]/T)+m;E[d]=g&67108863,g<67108864?m=0:m=g/67108864|0}return E},"normalize13b"),"normalize13b"),$.prototype.convert13b=a(i(function(E,T,m,d){for(var g=0,_=0;_<T;_++)g=g+(E[_]|0),m[2*_]=g&8191,g=g>>>13,m[2*_+1]=g&8191,g=g>>>13;for(_=2*T;_<d;++_)m[_]=0;s(g===0),s((g&-8192)===0)},"convert13b"),"convert13b"),$.prototype.stub=a(i(function(E){for(var T=new Array(E),m=0;m<E;m++)T[m]=0;return T},"stub"),"stub"),$.prototype.mulp=a(i(function(E,T,m){var d=2*this.guessLen13b(E.length,T.length),g=this.makeRBT(d),_=this.stub(d),M=new Array(d),S=new Array(d),w=new Array(d),N=new Array(d),B=new Array(d),D=new Array(d),F=m.words;F.length=d,this.convert13b(E.words,E.length,M,d),this.convert13b(T.words,T.length,N,d),this.transform(M,_,S,w,d,g),this.transform(N,_,B,D,d,g);for(var le=0;le<d;le++){var P=S[le]*B[le]-w[le]*D[le];w[le]=S[le]*D[le]+w[le]*B[le],S[le]=P}return this.conjugate(S,w,d),this.transform(S,w,F,_,d,g),this.conjugate(F,_,d),this.normalize13b(F,d),m.negative=E.negative^T.negative,m.length=E.length+T.length,m.strip()},"mulp"),"mulp"),c.prototype.mul=a(i(function(E){var T=new c(null);return T.words=new Array(this.length+E.length),this.mulTo(E,T)},"mul3"),"mul"),c.prototype.mulf=a(i(function(E){var T=new c(null);return T.words=new Array(this.length+E.length),K(this,E,T)},"mulf"),"mulf"),c.prototype.imul=a(i(function(E){return this.clone().mulTo(E,this)},"imul"),"imul"),c.prototype.imuln=a(i(function(E){s(typeof E=="number"),s(E<67108864);for(var T=0,m=0;m<this.length;m++){var d=(this.words[m]|0)*E,g=(d&67108863)+(T&67108863);T>>=26,T+=d/67108864|0,T+=g>>>26,this.words[m]=g&67108863}return T!==0&&(this.words[m]=T,this.length++),this},"imuln"),"imuln"),c.prototype.muln=a(i(function(E){return this.clone().imuln(E)},"muln"),"muln"),c.prototype.sqr=a(i(function(){return this.mul(this)},"sqr"),"sqr"),c.prototype.isqr=a(i(function(){return this.imul(this.clone())},"isqr"),"isqr"),c.prototype.pow=a(i(function(E){var T=C(E);if(T.length===0)return new c(1);for(var m=this,d=0;d<T.length&&T[d]===0;d++,m=m.sqr());if(++d<T.length)for(var g=m.sqr();d<T.length;d++,g=g.sqr())T[d]!==0&&(m=m.mul(g));return m},"pow"),"pow"),c.prototype.iushln=a(i(function(E){s(typeof E=="number"&&E>=0);var T=E%26,m=(E-T)/26,d=67108863>>>26-T<<26-T,g;if(T!==0){var _=0;for(g=0;g<this.length;g++){var M=this.words[g]&d,S=(this.words[g]|0)-M<<T;this.words[g]=S|_,_=M>>>26-T}_&&(this.words[g]=_,this.length++)}if(m!==0){for(g=this.length-1;g>=0;g--)this.words[g+m]=this.words[g];for(g=0;g<m;g++)this.words[g]=0;this.length+=m}return this.strip()},"iushln"),"iushln"),c.prototype.ishln=a(i(function(E){return s(this.negative===0),this.iushln(E)},"ishln"),"ishln"),c.prototype.iushrn=a(i(function(E,T,m){s(typeof E=="number"&&E>=0);var d;T?d=(T-T%26)/26:d=0;var g=E%26,_=Math.min((E-g)/26,this.length),M=67108863^67108863>>>g<<g,S=m;if(d-=_,d=Math.max(0,d),S){for(var w=0;w<_;w++)S.words[w]=this.words[w];S.length=_}if(_!==0)if(this.length>_)for(this.length-=_,w=0;w<this.length;w++)this.words[w]=this.words[w+_];else this.words[0]=0,this.length=1;var N=0;for(w=this.length-1;w>=0&&(N!==0||w>=d);w--){var B=this.words[w]|0;this.words[w]=N<<26-g|B>>>g,N=B&M}return S&&N!==0&&(S.words[S.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},"iushrn"),"iushrn"),c.prototype.ishrn=a(i(function(E,T,m){return s(this.negative===0),this.iushrn(E,T,m)},"ishrn"),"ishrn"),c.prototype.shln=a(i(function(E){return this.clone().ishln(E)},"shln"),"shln"),c.prototype.ushln=a(i(function(E){return this.clone().iushln(E)},"ushln"),"ushln"),c.prototype.shrn=a(i(function(E){return this.clone().ishrn(E)},"shrn"),"shrn"),c.prototype.ushrn=a(i(function(E){return this.clone().iushrn(E)},"ushrn"),"ushrn"),c.prototype.testn=a(i(function(E){s(typeof E=="number"&&E>=0);var T=E%26,m=(E-T)/26,d=1<<T;if(this.length<=m)return!1;var g=this.words[m];return!!(g&d)},"testn"),"testn"),c.prototype.imaskn=a(i(function(E){s(typeof E=="number"&&E>=0);var T=E%26,m=(E-T)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(T!==0&&m++,this.length=Math.min(m,this.length),T!==0){var d=67108863^67108863>>>T<<T;this.words[this.length-1]&=d}return this.strip()},"imaskn"),"imaskn"),c.prototype.maskn=a(i(function(E){return this.clone().imaskn(E)},"maskn"),"maskn"),c.prototype.iaddn=a(i(function(E){return s(typeof E=="number"),s(E<67108864),E<0?this.isubn(-E):this.negative!==0?this.length===1&&(this.words[0]|0)<E?(this.words[0]=E-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(E),this.negative=1,this):this._iaddn(E)},"iaddn"),"iaddn"),c.prototype._iaddn=a(i(function(E){this.words[0]+=E;for(var T=0;T<this.length&&this.words[T]>=67108864;T++)this.words[T]-=67108864,T===this.length-1?this.words[T+1]=1:this.words[T+1]++;return this.length=Math.max(this.length,T+1),this},"_iaddn"),"_iaddn"),c.prototype.isubn=a(i(function(E){if(s(typeof E=="number"),s(E<67108864),E<0)return this.iaddn(-E);if(this.negative!==0)return this.negative=0,this.iaddn(E),this.negative=1,this;if(this.words[0]-=E,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var T=0;T<this.length&&this.words[T]<0;T++)this.words[T]+=67108864,this.words[T+1]-=1;return this.strip()},"isubn"),"isubn"),c.prototype.addn=a(i(function(E){return this.clone().iaddn(E)},"addn"),"addn"),c.prototype.subn=a(i(function(E){return this.clone().isubn(E)},"subn"),"subn"),c.prototype.iabs=a(i(function(){return this.negative=0,this},"iabs"),"iabs"),c.prototype.abs=a(i(function(){return this.clone().iabs()},"abs2"),"abs"),c.prototype._ishlnsubmul=a(i(function(E,T,m){var d=E.length+m,g;this._expand(d);var _,M=0;for(g=0;g<E.length;g++){_=(this.words[g+m]|0)+M;var S=(E.words[g]|0)*T;_-=S&67108863,M=(_>>26)-(S/67108864|0),this.words[g+m]=_&67108863}for(;g<this.length-m;g++)_=(this.words[g+m]|0)+M,M=_>>26,this.words[g+m]=_&67108863;if(M===0)return this.strip();for(s(M===-1),M=0,g=0;g<this.length;g++)_=-(this.words[g]|0)+M,M=_>>26,this.words[g]=_&67108863;return this.negative=1,this.strip()},"_ishlnsubmul"),"_ishlnsubmul"),c.prototype._wordDiv=a(i(function(E,T){var m=this.length-E.length,d=this.clone(),g=E,_=g.words[g.length-1]|0,M=this._countBits(_);m=26-M,m!==0&&(g=g.ushln(m),d.iushln(m),_=g.words[g.length-1]|0);var S=d.length-g.length,w;if(T!=="mod"){w=new c(null),w.length=S+1,w.words=new Array(w.length);for(var N=0;N<w.length;N++)w.words[N]=0}var B=d.clone()._ishlnsubmul(g,1,S);B.negative===0&&(d=B,w&&(w.words[S]=1));for(var D=S-1;D>=0;D--){var F=(d.words[g.length+D]|0)*67108864+(d.words[g.length+D-1]|0);for(F=Math.min(F/_|0,67108863),d._ishlnsubmul(g,F,D);d.negative!==0;)F--,d.negative=0,d._ishlnsubmul(g,1,D),d.isZero()||(d.negative^=1);w&&(w.words[D]=F)}return w&&w.strip(),d.strip(),T!=="div"&&m!==0&&d.iushrn(m),{div:w||null,mod:d}},"_wordDiv"),"_wordDiv"),c.prototype.divmod=a(i(function(E,T,m){if(s(!E.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var d,g,_;return this.negative!==0&&E.negative===0?(_=this.neg().divmod(E,T),T!=="mod"&&(d=_.div.neg()),T!=="div"&&(g=_.mod.neg(),m&&g.negative!==0&&g.iadd(E)),{div:d,mod:g}):this.negative===0&&E.negative!==0?(_=this.divmod(E.neg(),T),T!=="mod"&&(d=_.div.neg()),{div:d,mod:_.mod}):(this.negative&E.negative)!==0?(_=this.neg().divmod(E.neg(),T),T!=="div"&&(g=_.mod.neg(),m&&g.negative!==0&&g.isub(E)),{div:_.div,mod:g}):E.length>this.length||this.cmp(E)<0?{div:new c(0),mod:this}:E.length===1?T==="div"?{div:this.divn(E.words[0]),mod:null}:T==="mod"?{div:null,mod:new c(this.modn(E.words[0]))}:{div:this.divn(E.words[0]),mod:new c(this.modn(E.words[0]))}:this._wordDiv(E,T)},"divmod"),"divmod"),c.prototype.div=a(i(function(E){return this.divmod(E,"div",!1).div},"div"),"div"),c.prototype.mod=a(i(function(E){return this.divmod(E,"mod",!1).mod},"mod2"),"mod"),c.prototype.umod=a(i(function(E){return this.divmod(E,"mod",!0).mod},"umod"),"umod"),c.prototype.divRound=a(i(function(E){var T=this.divmod(E);if(T.mod.isZero())return T.div;var m=T.div.negative!==0?T.mod.isub(E):T.mod,d=E.ushrn(1),g=E.andln(1),_=m.cmp(d);return _<0||g===1&&_===0?T.div:T.div.negative!==0?T.div.isubn(1):T.div.iaddn(1)},"divRound"),"divRound"),c.prototype.modn=a(i(function(E){s(E<=67108863);for(var T=(1<<26)%E,m=0,d=this.length-1;d>=0;d--)m=(T*m+(this.words[d]|0))%E;return m},"modn"),"modn"),c.prototype.idivn=a(i(function(E){s(E<=67108863);for(var T=0,m=this.length-1;m>=0;m--){var d=(this.words[m]|0)+T*67108864;this.words[m]=d/E|0,T=d%E}return this.strip()},"idivn"),"idivn"),c.prototype.divn=a(i(function(E){return this.clone().idivn(E)},"divn"),"divn"),c.prototype.egcd=a(i(function(E){s(E.negative===0),s(!E.isZero());var T=this,m=E.clone();T.negative!==0?T=T.umod(E):T=T.clone();for(var d=new c(1),g=new c(0),_=new c(0),M=new c(1),S=0;T.isEven()&&m.isEven();)T.iushrn(1),m.iushrn(1),++S;for(var w=m.clone(),N=T.clone();!T.isZero();){for(var B=0,D=1;(T.words[0]&D)===0&&B<26;++B,D<<=1);if(B>0)for(T.iushrn(B);B-- >0;)(d.isOdd()||g.isOdd())&&(d.iadd(w),g.isub(N)),d.iushrn(1),g.iushrn(1);for(var F=0,le=1;(m.words[0]&le)===0&&F<26;++F,le<<=1);if(F>0)for(m.iushrn(F);F-- >0;)(_.isOdd()||M.isOdd())&&(_.iadd(w),M.isub(N)),_.iushrn(1),M.iushrn(1);T.cmp(m)>=0?(T.isub(m),d.isub(_),g.isub(M)):(m.isub(T),_.isub(d),M.isub(g))}return{a:_,b:M,gcd:m.iushln(S)}},"egcd"),"egcd"),c.prototype._invmp=a(i(function(E){s(E.negative===0),s(!E.isZero());var T=this,m=E.clone();T.negative!==0?T=T.umod(E):T=T.clone();for(var d=new c(1),g=new c(0),_=m.clone();T.cmpn(1)>0&&m.cmpn(1)>0;){for(var M=0,S=1;(T.words[0]&S)===0&&M<26;++M,S<<=1);if(M>0)for(T.iushrn(M);M-- >0;)d.isOdd()&&d.iadd(_),d.iushrn(1);for(var w=0,N=1;(m.words[0]&N)===0&&w<26;++w,N<<=1);if(w>0)for(m.iushrn(w);w-- >0;)g.isOdd()&&g.iadd(_),g.iushrn(1);T.cmp(m)>=0?(T.isub(m),d.isub(g)):(m.isub(T),g.isub(d))}var B;return T.cmpn(1)===0?B=d:B=g,B.cmpn(0)<0&&B.iadd(E),B},"_invmp"),"_invmp"),c.prototype.gcd=a(i(function(E){if(this.isZero())return E.abs();if(E.isZero())return this.abs();var T=this.clone(),m=E.clone();T.negative=0,m.negative=0;for(var d=0;T.isEven()&&m.isEven();d++)T.iushrn(1),m.iushrn(1);do{for(;T.isEven();)T.iushrn(1);for(;m.isEven();)m.iushrn(1);var g=T.cmp(m);if(g<0){var _=T;T=m,m=_}else if(g===0||m.cmpn(1)===0)break;T.isub(m)}while(!0);return m.iushln(d)},"gcd"),"gcd"),c.prototype.invm=a(i(function(E){return this.egcd(E).a.umod(E)},"invm"),"invm"),c.prototype.isEven=a(i(function(){return(this.words[0]&1)===0},"isEven"),"isEven"),c.prototype.isOdd=a(i(function(){return(this.words[0]&1)===1},"isOdd"),"isOdd"),c.prototype.andln=a(i(function(E){return this.words[0]&E},"andln"),"andln"),c.prototype.bincn=a(i(function(E){s(typeof E=="number");var T=E%26,m=(E-T)/26,d=1<<T;if(this.length<=m)return this._expand(m+1),this.words[m]|=d,this;for(var g=d,_=m;g!==0&&_<this.length;_++){var M=this.words[_]|0;M+=g,g=M>>>26,M&=67108863,this.words[_]=M}return g!==0&&(this.words[_]=g,this.length++),this},"bincn"),"bincn"),c.prototype.isZero=a(i(function(){return this.length===1&&this.words[0]===0},"isZero"),"isZero"),c.prototype.cmpn=a(i(function(E){var T=E<0;if(this.negative!==0&&!T)return-1;if(this.negative===0&&T)return 1;this.strip();var m;if(this.length>1)m=1;else{T&&(E=-E),s(E<=67108863,"Number is too big");var d=this.words[0]|0;m=d===E?0:d<E?-1:1}return this.negative!==0?-m|0:m},"cmpn"),"cmpn"),c.prototype.cmp=a(i(function(E){if(this.negative!==0&&E.negative===0)return-1;if(this.negative===0&&E.negative!==0)return 1;var T=this.ucmp(E);return this.negative!==0?-T|0:T},"cmp"),"cmp"),c.prototype.ucmp=a(i(function(E){if(this.length>E.length)return 1;if(this.length<E.length)return-1;for(var T=0,m=this.length-1;m>=0;m--){var d=this.words[m]|0,g=E.words[m]|0;if(d!==g){d<g?T=-1:d>g&&(T=1);break}}return T},"ucmp"),"ucmp"),c.prototype.gtn=a(i(function(E){return this.cmpn(E)===1},"gtn"),"gtn"),c.prototype.gt=a(i(function(E){return this.cmp(E)===1},"gt"),"gt"),c.prototype.gten=a(i(function(E){return this.cmpn(E)>=0},"gten"),"gten"),c.prototype.gte=a(i(function(E){return this.cmp(E)>=0},"gte"),"gte"),c.prototype.ltn=a(i(function(E){return this.cmpn(E)===-1},"ltn"),"ltn"),c.prototype.lt=a(i(function(E){return this.cmp(E)===-1},"lt"),"lt"),c.prototype.lten=a(i(function(E){return this.cmpn(E)<=0},"lten"),"lten"),c.prototype.lte=a(i(function(E){return this.cmp(E)<=0},"lte"),"lte"),c.prototype.eqn=a(i(function(E){return this.cmpn(E)===0},"eqn"),"eqn"),c.prototype.eq=a(i(function(E){return this.cmp(E)===0},"eq4"),"eq"),c.red=a(i(function(E){return new ue(E)},"red"),"red"),c.prototype.toRed=a(i(function(E){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),E.convertTo(this)._forceRed(E)},"toRed"),"toRed"),c.prototype.fromRed=a(i(function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),"fromRed"),c.prototype._forceRed=a(i(function(E){return this.red=E,this},"_forceRed"),"_forceRed"),c.prototype.forceRed=a(i(function(E){return s(!this.red,"Already a number in reduction context"),this._forceRed(E)},"forceRed"),"forceRed"),c.prototype.redAdd=a(i(function(E){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,E)},"redAdd"),"redAdd"),c.prototype.redIAdd=a(i(function(E){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,E)},"redIAdd"),"redIAdd"),c.prototype.redSub=a(i(function(E){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,E)},"redSub"),"redSub"),c.prototype.redISub=a(i(function(E){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,E)},"redISub"),"redISub"),c.prototype.redShl=a(i(function(E){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,E)},"redShl"),"redShl"),c.prototype.redMul=a(i(function(E){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.mul(this,E)},"redMul"),"redMul"),c.prototype.redIMul=a(i(function(E){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,E),this.red.imul(this,E)},"redIMul"),"redIMul"),c.prototype.redSqr=a(i(function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),"redSqr"),c.prototype.redISqr=a(i(function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),"redISqr"),c.prototype.redSqrt=a(i(function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),"redSqrt"),c.prototype.redInvm=a(i(function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),"redInvm"),c.prototype.redNeg=a(i(function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),"redNeg"),c.prototype.redPow=a(i(function(E){return s(this.red&&!E.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,E)},"redPow"),"redPow");var j={k256:null,p224:null,p192:null,p25519:null};function V(q,E){this.name=q,this.p=new c(E,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}i(V,"MPrime"),a(V,"MPrime"),V.prototype._tmp=a(i(function(){var E=new c(null);return E.words=new Array(Math.ceil(this.n/13)),E},"_tmp"),"_tmp"),V.prototype.ireduce=a(i(function(E){var T=E,m;do this.split(T,this.tmp),T=this.imulK(T),T=T.iadd(this.tmp),m=T.bitLength();while(m>this.n);var d=m<this.n?-1:T.ucmp(this.p);return d===0?(T.words[0]=0,T.length=1):d>0?T.isub(this.p):T.strip!==void 0?T.strip():T._strip(),T},"ireduce"),"ireduce"),V.prototype.split=a(i(function(E,T){E.iushrn(this.n,0,T)},"split"),"split"),V.prototype.imulK=a(i(function(E){return E.imul(this.k)},"imulK"),"imulK");function G(){V.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,"K256"),a(G,"K256"),o(G,V),G.prototype.split=a(i(function(E,T){for(var m=4194303,d=Math.min(E.length,9),g=0;g<d;g++)T.words[g]=E.words[g];if(T.length=d,E.length<=9){E.words[0]=0,E.length=1;return}var _=E.words[9];for(T.words[T.length++]=_&m,g=10;g<E.length;g++){var M=E.words[g]|0;E.words[g-10]=(M&m)<<4|_>>>22,_=M}_>>>=22,E.words[g-10]=_,_===0&&E.length>10?E.length-=10:E.length-=9},"split"),"split"),G.prototype.imulK=a(i(function(E){E.words[E.length]=0,E.words[E.length+1]=0,E.length+=2;for(var T=0,m=0;m<E.length;m++){var d=E.words[m]|0;T+=d*977,E.words[m]=T&67108863,T=d*64+(T/67108864|0)}return E.words[E.length-1]===0&&(E.length--,E.words[E.length-1]===0&&E.length--),E},"imulK"),"imulK");function k(){V.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(k,"P224"),a(k,"P224"),o(k,V);function H(){V.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(H,"P192"),a(H,"P192"),o(H,V);function se(){V.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(se,"P25519"),a(se,"P25519"),o(se,V),se.prototype.imulK=a(i(function(E){for(var T=0,m=0;m<E.length;m++){var d=(E.words[m]|0)*19+T,g=d&67108863;d>>>=26,E.words[m]=g,T=d}return T!==0&&(E.words[E.length++]=T),E},"imulK"),"imulK"),c._prime=a(i(function(E){if(j[E])return j[E];var T;if(E==="k256")T=new G;else if(E==="p224")T=new k;else if(E==="p192")T=new H;else if(E==="p25519")T=new se;else throw new Error("Unknown prime "+E);return j[E]=T,T},"prime"),"prime");function ue(q){if(typeof q=="string"){var E=c._prime(q);this.m=E.p,this.prime=E}else s(q.gtn(1),"modulus must be greater than 1"),this.m=q,this.prime=null}i(ue,"Red"),a(ue,"Red"),ue.prototype._verify1=a(i(function(E){s(E.negative===0,"red works only with positives"),s(E.red,"red works only with red numbers")},"_verify1"),"_verify1"),ue.prototype._verify2=a(i(function(E,T){s((E.negative|T.negative)===0,"red works only with positives"),s(E.red&&E.red===T.red,"red works only with red numbers")},"_verify2"),"_verify2"),ue.prototype.imod=a(i(function(E){return this.prime?this.prime.ireduce(E)._forceRed(this):E.umod(this.m)._forceRed(this)},"imod"),"imod"),ue.prototype.neg=a(i(function(E){return E.isZero()?E.clone():this.m.sub(E)._forceRed(this)},"neg3"),"neg"),ue.prototype.add=a(i(function(E,T){this._verify2(E,T);var m=E.add(T);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},"add3"),"add"),ue.prototype.iadd=a(i(function(E,T){this._verify2(E,T);var m=E.iadd(T);return m.cmp(this.m)>=0&&m.isub(this.m),m},"iadd"),"iadd"),ue.prototype.sub=a(i(function(E,T){this._verify2(E,T);var m=E.sub(T);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},"sub"),"sub"),ue.prototype.isub=a(i(function(E,T){this._verify2(E,T);var m=E.isub(T);return m.cmpn(0)<0&&m.iadd(this.m),m},"isub"),"isub"),ue.prototype.shl=a(i(function(E,T){return this._verify1(E),this.imod(E.ushln(T))},"shl"),"shl"),ue.prototype.imul=a(i(function(E,T){return this._verify2(E,T),this.imod(E.imul(T))},"imul"),"imul"),ue.prototype.mul=a(i(function(E,T){return this._verify2(E,T),this.imod(E.mul(T))},"mul3"),"mul"),ue.prototype.isqr=a(i(function(E){return this.imul(E,E.clone())},"isqr"),"isqr"),ue.prototype.sqr=a(i(function(E){return this.mul(E,E)},"sqr"),"sqr"),ue.prototype.sqrt=a(i(function(E){if(E.isZero())return E.clone();var T=this.m.andln(3);if(s(T%2===1),T===3){var m=this.m.add(new c(1)).iushrn(2);return this.pow(E,m)}for(var d=this.m.subn(1),g=0;!d.isZero()&&d.andln(1)===0;)g++,d.iushrn(1);s(!d.isZero());var _=new c(1).toRed(this),M=_.redNeg(),S=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new c(2*w*w).toRed(this);this.pow(w,S).cmp(M)!==0;)w.redIAdd(M);for(var N=this.pow(w,d),B=this.pow(E,d.addn(1).iushrn(1)),D=this.pow(E,d),F=g;D.cmp(_)!==0;){for(var le=D,P=0;le.cmp(_)!==0;P++)le=le.redSqr();s(P<F);var Y=this.pow(N,new c(1).iushln(F-P-1));B=B.redMul(Y),N=Y.redSqr(),D=D.redMul(N),F=P}return B},"sqrt"),"sqrt"),ue.prototype.invm=a(i(function(E){var T=E._invmp(this.m);return T.negative!==0?(T.negative=0,this.imod(T).redNeg()):this.imod(T)},"invm"),"invm"),ue.prototype.pow=a(i(function(E,T){if(T.isZero())return new c(1).toRed(this);if(T.cmpn(1)===0)return E.clone();var m=4,d=new Array(1<<m);d[0]=new c(1).toRed(this),d[1]=E;for(var g=2;g<d.length;g++)d[g]=this.mul(d[g-1],E);var _=d[0],M=0,S=0,w=T.bitLength()%26;for(w===0&&(w=26),g=T.length-1;g>=0;g--){for(var N=T.words[g],B=w-1;B>=0;B--){var D=N>>B&1;if(_!==d[0]&&(_=this.sqr(_)),D===0&&M===0){S=0;continue}M<<=1,M|=D,S++,!(S!==m&&(g!==0||B!==0))&&(_=this.mul(_,d[M]),S=0,M=0)}w=26}return _},"pow"),"pow"),ue.prototype.convertTo=a(i(function(E){var T=E.umod(this.m);return T===E?T.clone():T},"convertTo"),"convertTo"),ue.prototype.convertFrom=a(i(function(E){var T=E.clone();return T.red=null,T},"convertFrom"),"convertFrom"),c.mont=a(i(function(E){return new me(E)},"mont"),"mont");function me(q){ue.call(this,q),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}i(me,"Mont"),a(me,"Mont"),o(me,ue),me.prototype.convertTo=a(i(function(E){return this.imod(E.ushln(this.shift))},"convertTo"),"convertTo"),me.prototype.convertFrom=a(i(function(E){var T=this.imod(E.mul(this.rinv));return T.red=null,T},"convertFrom"),"convertFrom"),me.prototype.imul=a(i(function(E,T){if(E.isZero()||T.isZero())return E.words[0]=0,E.length=1,E;var m=E.imul(T),d=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=m.isub(d).iushrn(this.shift),_=g;return g.cmp(this.m)>=0?_=g.isub(this.m):g.cmpn(0)<0&&(_=g.iadd(this.m)),_._forceRed(this)},"imul"),"imul"),me.prototype.mul=a(i(function(E,T){if(E.isZero()||T.isZero())return new c(0)._forceRed(this);var m=E.mul(T),d=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=m.isub(d).iushrn(this.shift),_=g;return g.cmp(this.m)>=0?_=g.isub(this.m):g.cmpn(0)<0&&(_=g.iadd(this.m)),_._forceRed(this)},"mul3"),"mul"),me.prototype.invm=a(i(function(E){var T=this.imod(E._invmp(this.m).mul(this.r2));return T._forceRed(this)},"invm"),"invm")})(typeof t>"u"||t,e)}}),Tc=ze({"../../../node_modules/.pnpm/minimalistic-assert@1.0.1/node_modules/minimalistic-assert/index.js"(e,t){t.exports=r;function r(n,s){if(!n)throw new Error(s||"Assertion failed")}i(r,"assert2"),a(r,"assert"),r.equal=a(i(function(s,o,c){if(s!=o)throw new Error(c||"Assertion failed: "+s+" != "+o)},"assertEqual2"),"assertEqual")}}),_x=ze({"../../../node_modules/.pnpm/minimalistic-crypto-utils@1.0.1/node_modules/minimalistic-crypto-utils/lib/utils.js"(e){"use strict";var t=e;function r(o,c){if(Array.isArray(o))return o.slice();if(!o)return[];var l=[];if(typeof o!="string"){for(var h=0;h<o.length;h++)l[h]=o[h]|0;return l}if(c==="hex"){o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o);for(var h=0;h<o.length;h+=2)l.push(parseInt(o[h]+o[h+1],16))}else for(var h=0;h<o.length;h++){var p=o.charCodeAt(h),v=p>>8,b=p&255;v?l.push(v,b):l.push(b)}return l}i(r,"toArray"),a(r,"toArray"),t.toArray=r;function n(o){return o.length===1?"0"+o:o}i(n,"zero2"),a(n,"zero2"),t.zero2=n;function s(o){for(var c="",l=0;l<o.length;l++)c+=n(o[l].toString(16));return c}i(s,"toHex"),a(s,"toHex"),t.toHex=s,t.encode=a(i(function(c,l){return l==="hex"?s(c):c},"encode9"),"encode")}}),qi=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/utils.js"(e){"use strict";var t=e,r=Sa(),n=Tc(),s=_x();t.assert=n,t.toArray=s.toArray,t.zero2=s.zero2,t.toHex=s.toHex,t.encode=s.encode;function o(v,b,y){var A=new Array(Math.max(v.bitLength(),y)+1);A.fill(0);for(var C=1<<b+1,O=v.clone(),R=0;R<A.length;R++){var L,K=O.andln(C-1);O.isOdd()?(K>(C>>1)-1?L=(C>>1)-K:L=K,O.isubn(L)):L=0,A[R]=L,O.iushrn(1)}return A}i(o,"getNAF2"),a(o,"getNAF"),t.getNAF=o;function c(v,b){var y=[[],[]];v=v.clone(),b=b.clone();for(var A=0,C=0,O;v.cmpn(-A)>0||b.cmpn(-C)>0;){var R=v.andln(3)+A&3,L=b.andln(3)+C&3;R===3&&(R=-1),L===3&&(L=-1);var K;(R&1)===0?K=0:(O=v.andln(7)+A&7,(O===3||O===5)&&L===2?K=-R:K=R),y[0].push(K);var $;(L&1)===0?$=0:(O=b.andln(7)+C&7,(O===3||O===5)&&R===2?$=-L:$=L),y[1].push($),2*A===K+1&&(A=1-A),2*C===$+1&&(C=1-C),v.iushrn(1),b.iushrn(1)}return y}i(c,"getJSF2"),a(c,"getJSF"),t.getJSF=c;function l(v,b,y){var A="_"+b;v.prototype[b]=a(i(function(){return this[A]!==void 0?this[A]:this[A]=y.call(this)},"cachedProperty2"),"cachedProperty")}i(l,"cachedProperty"),a(l,"cachedProperty"),t.cachedProperty=l;function h(v){return typeof v=="string"?t.toArray(v,"hex"):v}i(h,"parseBytes"),a(h,"parseBytes"),t.parseBytes=h;function p(v){return new r(v,"hex","le")}i(p,"intFromLE"),a(p,"intFromLE"),t.intFromLE=p}}),wx=ze({"../../../node_modules/.pnpm/brorand@1.1.0/node_modules/brorand/index.js"(e,t){var r;t.exports=a(i(function(c){return r||(r=new n(null)),r.generate(c)},"rand2"),"rand");function n(o){this.rand=o}if(i(n,"Rand"),a(n,"Rand"),t.exports.Rand=n,n.prototype.generate=a(i(function(c){return this._rand(c)},"generate3"),"generate"),n.prototype._rand=a(i(function(c){if(this.rand.getBytes)return this.rand.getBytes(c);for(var l=new Uint8Array(c),h=0;h<l.length;h++)l[h]=this.rand.getByte();return l},"_rand"),"_rand"),typeof self=="object")self.crypto&&self.crypto.getRandomValues?n.prototype._rand=a(i(function(c){var l=new Uint8Array(c);return self.crypto.getRandomValues(l),l},"_rand"),"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=a(i(function(c){var l=new Uint8Array(c);return self.msCrypto.getRandomValues(l),l},"_rand"),"_rand"):typeof window=="object"&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if(s=tb("crypto"),typeof s.randomBytes!="function")throw new Error("Not supported");n.prototype._rand=a(i(function(c){return s.randomBytes(c)},"_rand"),"_rand")}catch{}var s}}),dm=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/base.js"(e,t){"use strict";var r=Sa(),n=qi(),s=n.getNAF,o=n.getJSF,c=n.assert;function l(p,v){this.type=p,this.p=new r(v.p,16),this.red=v.prime?r.red(v.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=v.n&&new r(v.n,16),this.g=v.g&&this.pointFromJSON(v.g,v.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var b=this.n&&this.p.div(this.n);!b||b.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}i(l,"BaseCurve2"),a(l,"BaseCurve"),t.exports=l,l.prototype.point=a(i(function(){throw new Error("Not implemented")},"point3"),"point"),l.prototype.validate=a(i(function(){throw new Error("Not implemented")},"validate6"),"validate"),l.prototype._fixedNafMul=a(i(function(v,b){c(v.precomputed);var y=v._getDoubles(),A=s(b,1,this._bitLength),C=(1<<y.step+1)-(y.step%2===0?2:1);C/=3;var O=[],R,L;for(R=0;R<A.length;R+=y.step){L=0;for(var K=R+y.step-1;K>=R;K--)L=(L<<1)+A[K];O.push(L)}for(var $=this.jpoint(null,null,null),j=this.jpoint(null,null,null),V=C;V>0;V--){for(R=0;R<O.length;R++)L=O[R],L===V?j=j.mixedAdd(y.points[R]):L===-V&&(j=j.mixedAdd(y.points[R].neg()));$=$.add(j)}return $.toP()},"_fixedNafMul2"),"_fixedNafMul"),l.prototype._wnafMul=a(i(function(v,b){var y=4,A=v._getNAFPoints(y);y=A.wnd;for(var C=A.points,O=s(b,y,this._bitLength),R=this.jpoint(null,null,null),L=O.length-1;L>=0;L--){for(var K=0;L>=0&&O[L]===0;L--)K++;if(L>=0&&K++,R=R.dblp(K),L<0)break;var $=O[L];c($!==0),v.type==="affine"?$>0?R=R.mixedAdd(C[$-1>>1]):R=R.mixedAdd(C[-$-1>>1].neg()):$>0?R=R.add(C[$-1>>1]):R=R.add(C[-$-1>>1].neg())}return v.type==="affine"?R.toP():R},"_wnafMul2"),"_wnafMul"),l.prototype._wnafMulAdd=a(i(function(v,b,y,A,C){var O=this._wnafT1,R=this._wnafT2,L=this._wnafT3,K=0,$,j,V;for($=0;$<A;$++){V=b[$];var G=V._getNAFPoints(v);O[$]=G.wnd,R[$]=G.points}for($=A-1;$>=1;$-=2){var k=$-1,H=$;if(O[k]!==1||O[H]!==1){L[k]=s(y[k],O[k],this._bitLength),L[H]=s(y[H],O[H],this._bitLength),K=Math.max(L[k].length,K),K=Math.max(L[H].length,K);continue}var se=[b[k],null,null,b[H]];b[k].y.cmp(b[H].y)===0?(se[1]=b[k].add(b[H]),se[2]=b[k].toJ().mixedAdd(b[H].neg())):b[k].y.cmp(b[H].y.redNeg())===0?(se[1]=b[k].toJ().mixedAdd(b[H]),se[2]=b[k].add(b[H].neg())):(se[1]=b[k].toJ().mixedAdd(b[H]),se[2]=b[k].toJ().mixedAdd(b[H].neg()));var ue=[-3,-1,-5,-7,0,7,5,1,3],me=o(y[k],y[H]);for(K=Math.max(me[0].length,K),L[k]=new Array(K),L[H]=new Array(K),j=0;j<K;j++){var q=me[0][j]|0,E=me[1][j]|0;L[k][j]=ue[(q+1)*3+(E+1)],L[H][j]=0,R[k]=se}}var T=this.jpoint(null,null,null),m=this._wnafT4;for($=K;$>=0;$--){for(var d=0;$>=0;){var g=!0;for(j=0;j<A;j++)m[j]=L[j][$]|0,m[j]!==0&&(g=!1);if(!g)break;d++,$--}if($>=0&&d++,T=T.dblp(d),$<0)break;for(j=0;j<A;j++){var _=m[j];_!==0&&(_>0?V=R[j][_-1>>1]:_<0&&(V=R[j][-_-1>>1].neg()),V.type==="affine"?T=T.mixedAdd(V):T=T.add(V))}}for($=0;$<A;$++)R[$]=null;return C?T:T.toP()},"_wnafMulAdd2"),"_wnafMulAdd");function h(p,v){this.curve=p,this.type=v,this.precomputed=null}i(h,"BasePoint2"),a(h,"BasePoint"),l.BasePoint=h,h.prototype.eq=a(i(function(){throw new Error("Not implemented")},"eq4"),"eq"),h.prototype.validate=a(i(function(){return this.curve.validate(this)},"validate6"),"validate"),l.prototype.decodePoint=a(i(function(v,b){v=n.toArray(v,b);var y=this.p.byteLength();if((v[0]===4||v[0]===6||v[0]===7)&&v.length-1===2*y){v[0]===6?c(v[v.length-1]%2===0):v[0]===7&&c(v[v.length-1]%2===1);var A=this.point(v.slice(1,1+y),v.slice(1+y,1+2*y));return A}else if((v[0]===2||v[0]===3)&&v.length-1===y)return this.pointFromX(v.slice(1,1+y),v[0]===3);throw new Error("Unknown point format")},"decodePoint2"),"decodePoint"),h.prototype.encodeCompressed=a(i(function(v){return this.encode(v,!0)},"encodeCompressed2"),"encodeCompressed"),h.prototype._encode=a(i(function(v){var b=this.curve.p.byteLength(),y=this.getX().toArray("be",b);return v?[this.getY().isEven()?2:3].concat(y):[4].concat(y,this.getY().toArray("be",b))},"_encode2"),"_encode"),h.prototype.encode=a(i(function(v,b){return n.encode(this._encode(b),v)},"encode9"),"encode"),h.prototype.precompute=a(i(function(v){if(this.precomputed)return this;var b={doubles:null,naf:null,beta:null};return b.naf=this._getNAFPoints(8),b.doubles=this._getDoubles(4,v),b.beta=this._getBeta(),this.precomputed=b,this},"precompute2"),"precompute"),h.prototype._hasDoubles=a(i(function(v){if(!this.precomputed)return!1;var b=this.precomputed.doubles;return b?b.points.length>=Math.ceil((v.bitLength()+1)/b.step):!1},"_hasDoubles2"),"_hasDoubles"),h.prototype._getDoubles=a(i(function(v,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var y=[this],A=this,C=0;C<b;C+=v){for(var O=0;O<v;O++)A=A.dbl();y.push(A)}return{step:v,points:y}},"_getDoubles2"),"_getDoubles"),h.prototype._getNAFPoints=a(i(function(v){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var b=[this],y=(1<<v)-1,A=y===1?null:this.dbl(),C=1;C<y;C++)b[C]=b[C-1].add(A);return{wnd:v,points:b}},"_getNAFPoints2"),"_getNAFPoints"),h.prototype._getBeta=a(i(function(){return null},"_getBeta3"),"_getBeta"),h.prototype.dblp=a(i(function(v){for(var b=this,y=0;y<v;y++)b=b.dbl();return b},"dblp3"),"dblp")}}),hm=ze({"../../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(e,t){typeof Object.create=="function"?t.exports=a(i(function(n,s){s&&(n.super_=s,n.prototype=Object.create(s.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"),"inherits"):t.exports=a(i(function(n,s){if(s){n.super_=s;var o=a(function(){},"TempCtor");o.prototype=s.prototype,n.prototype=new o,n.prototype.constructor=n}},"inherits"),"inherits")}}),e$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/short.js"(e,t){"use strict";var r=qi(),n=Sa(),s=hm(),o=dm(),c=r.assert;function l(v){o.call(this,"short",v),this.a=new n(v.a,16).toRed(this.red),this.b=new n(v.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(v),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}i(l,"ShortCurve2"),a(l,"ShortCurve"),s(l,o),t.exports=l,l.prototype._getEndomorphism=a(i(function(b){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var y,A;if(b.beta)y=new n(b.beta,16).toRed(this.red);else{var C=this._getEndoRoots(this.p);y=C[0].cmp(C[1])<0?C[0]:C[1],y=y.toRed(this.red)}if(b.lambda)A=new n(b.lambda,16);else{var O=this._getEndoRoots(this.n);this.g.mul(O[0]).x.cmp(this.g.x.redMul(y))===0?A=O[0]:(A=O[1],c(this.g.mul(A).x.cmp(this.g.x.redMul(y))===0))}var R;return b.basis?R=b.basis.map(function(L){return{a:new n(L.a,16),b:new n(L.b,16)}}):R=this._getEndoBasis(A),{beta:y,lambda:A,basis:R}}},"_getEndomorphism2"),"_getEndomorphism"),l.prototype._getEndoRoots=a(i(function(b){var y=b===this.p?this.red:n.mont(b),A=new n(2).toRed(y).redInvm(),C=A.redNeg(),O=new n(3).toRed(y).redNeg().redSqrt().redMul(A),R=C.redAdd(O).fromRed(),L=C.redSub(O).fromRed();return[R,L]},"_getEndoRoots2"),"_getEndoRoots"),l.prototype._getEndoBasis=a(i(function(b){for(var y=this.n.ushrn(Math.floor(this.n.bitLength()/2)),A=b,C=this.n.clone(),O=new n(1),R=new n(0),L=new n(0),K=new n(1),$,j,V,G,k,H,se,ue=0,me,q;A.cmpn(0)!==0;){var E=C.div(A);me=C.sub(E.mul(A)),q=L.sub(E.mul(O));var T=K.sub(E.mul(R));if(!V&&me.cmp(y)<0)$=se.neg(),j=O,V=me.neg(),G=q;else if(V&&++ue===2)break;se=me,C=A,A=me,L=O,O=q,K=R,R=T}k=me.neg(),H=q;var m=V.sqr().add(G.sqr()),d=k.sqr().add(H.sqr());return d.cmp(m)>=0&&(k=$,H=j),V.negative&&(V=V.neg(),G=G.neg()),k.negative&&(k=k.neg(),H=H.neg()),[{a:V,b:G},{a:k,b:H}]},"_getEndoBasis2"),"_getEndoBasis"),l.prototype._endoSplit=a(i(function(b){var y=this.endo.basis,A=y[0],C=y[1],O=C.b.mul(b).divRound(this.n),R=A.b.neg().mul(b).divRound(this.n),L=O.mul(A.a),K=R.mul(C.a),$=O.mul(A.b),j=R.mul(C.b),V=b.sub(L).sub(K),G=$.add(j).neg();return{k1:V,k2:G}},"_endoSplit2"),"_endoSplit"),l.prototype.pointFromX=a(i(function(b,y){b=new n(b,16),b.red||(b=b.toRed(this.red));var A=b.redSqr().redMul(b).redIAdd(b.redMul(this.a)).redIAdd(this.b),C=A.redSqrt();if(C.redSqr().redSub(A).cmp(this.zero)!==0)throw new Error("invalid point");var O=C.fromRed().isOdd();return(y&&!O||!y&&O)&&(C=C.redNeg()),this.point(b,C)},"pointFromX2"),"pointFromX"),l.prototype.validate=a(i(function(b){if(b.inf)return!0;var y=b.x,A=b.y,C=this.a.redMul(y),O=y.redSqr().redMul(y).redIAdd(C).redIAdd(this.b);return A.redSqr().redISub(O).cmpn(0)===0},"validate6"),"validate"),l.prototype._endoWnafMulAdd=a(i(function(b,y,A){for(var C=this._endoWnafT1,O=this._endoWnafT2,R=0;R<b.length;R++){var L=this._endoSplit(y[R]),K=b[R],$=K._getBeta();L.k1.negative&&(L.k1.ineg(),K=K.neg(!0)),L.k2.negative&&(L.k2.ineg(),$=$.neg(!0)),C[R*2]=K,C[R*2+1]=$,O[R*2]=L.k1,O[R*2+1]=L.k2}for(var j=this._wnafMulAdd(1,C,O,R*2,A),V=0;V<R*2;V++)C[V]=null,O[V]=null;return j},"_endoWnafMulAdd2"),"_endoWnafMulAdd");function h(v,b,y,A){o.BasePoint.call(this,v,"affine"),b===null&&y===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(b,16),this.y=new n(y,16),A&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}i(h,"Point2"),a(h,"Point"),s(h,o.BasePoint),l.prototype.point=a(i(function(b,y,A){return new h(this,b,y,A)},"point3"),"point"),l.prototype.pointFromJSON=a(i(function(b,y){return h.fromJSON(this,b,y)},"pointFromJSON2"),"pointFromJSON"),h.prototype._getBeta=a(i(function(){if(!!this.curve.endo){var b=this.precomputed;if(b&&b.beta)return b.beta;var y=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(b){var A=this.curve,C=a(function(O){return A.point(O.x.redMul(A.endo.beta),O.y)},"endoMul");b.beta=y,y.precomputed={beta:null,naf:b.naf&&{wnd:b.naf.wnd,points:b.naf.points.map(C)},doubles:b.doubles&&{step:b.doubles.step,points:b.doubles.points.map(C)}}}return y}},"_getBeta3"),"_getBeta"),h.prototype.toJSON=a(i(function(){return this.precomputed?[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)}}]:[this.x,this.y]},"toJSON2"),"toJSON"),h.fromJSON=a(i(function(b,y,A){typeof y=="string"&&(y=JSON.parse(y));var C=b.point(y[0],y[1],A);if(!y[2])return C;function O(L){return b.point(L[0],L[1],A)}i(O,"obj2point"),a(O,"obj2point");var R=y[2];return C.precomputed={beta:null,doubles:R.doubles&&{step:R.doubles.step,points:[C].concat(R.doubles.points.map(O))},naf:R.naf&&{wnd:R.naf.wnd,points:[C].concat(R.naf.points.map(O))}},C},"fromJSON2"),"fromJSON"),h.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect4"),"inspect"),h.prototype.isInfinity=a(i(function(){return this.inf},"isInfinity3"),"isInfinity"),h.prototype.add=a(i(function(b){if(this.inf)return b;if(b.inf)return this;if(this.eq(b))return this.dbl();if(this.neg().eq(b))return this.curve.point(null,null);if(this.x.cmp(b.x)===0)return this.curve.point(null,null);var y=this.y.redSub(b.y);y.cmpn(0)!==0&&(y=y.redMul(this.x.redSub(b.x).redInvm()));var A=y.redSqr().redISub(this.x).redISub(b.x),C=y.redMul(this.x.redSub(A)).redISub(this.y);return this.curve.point(A,C)},"add3"),"add"),h.prototype.dbl=a(i(function(){if(this.inf)return this;var b=this.y.redAdd(this.y);if(b.cmpn(0)===0)return this.curve.point(null,null);var y=this.curve.a,A=this.x.redSqr(),C=b.redInvm(),O=A.redAdd(A).redIAdd(A).redIAdd(y).redMul(C),R=O.redSqr().redISub(this.x.redAdd(this.x)),L=O.redMul(this.x.redSub(R)).redISub(this.y);return this.curve.point(R,L)},"dbl3"),"dbl"),h.prototype.getX=a(i(function(){return this.x.fromRed()},"getX2"),"getX"),h.prototype.getY=a(i(function(){return this.y.fromRed()},"getY2"),"getY"),h.prototype.mul=a(i(function(b){return b=new n(b,16),this.isInfinity()?this:this._hasDoubles(b)?this.curve._fixedNafMul(this,b):this.curve.endo?this.curve._endoWnafMulAdd([this],[b]):this.curve._wnafMul(this,b)},"mul3"),"mul"),h.prototype.mulAdd=a(i(function(b,y,A){var C=[this,y],O=[b,A];return this.curve.endo?this.curve._endoWnafMulAdd(C,O):this.curve._wnafMulAdd(1,C,O,2)},"mulAdd2"),"mulAdd"),h.prototype.jmulAdd=a(i(function(b,y,A){var C=[this,y],O=[b,A];return this.curve.endo?this.curve._endoWnafMulAdd(C,O,!0):this.curve._wnafMulAdd(1,C,O,2,!0)},"jmulAdd2"),"jmulAdd"),h.prototype.eq=a(i(function(b){return this===b||this.inf===b.inf&&(this.inf||this.x.cmp(b.x)===0&&this.y.cmp(b.y)===0)},"eq4"),"eq"),h.prototype.neg=a(i(function(b){if(this.inf)return this;var y=this.curve.point(this.x,this.y.redNeg());if(b&&this.precomputed){var A=this.precomputed,C=a(function(O){return O.neg()},"negate");y.precomputed={naf:A.naf&&{wnd:A.naf.wnd,points:A.naf.points.map(C)},doubles:A.doubles&&{step:A.doubles.step,points:A.doubles.points.map(C)}}}return y},"neg3"),"neg"),h.prototype.toJ=a(i(function(){if(this.inf)return this.curve.jpoint(null,null,null);var b=this.curve.jpoint(this.x,this.y,this.curve.one);return b},"toJ2"),"toJ");function p(v,b,y,A){o.BasePoint.call(this,v,"jacobian"),b===null&&y===null&&A===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(b,16),this.y=new n(y,16),this.z=new n(A,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(p,"JPoint2"),a(p,"JPoint"),s(p,o.BasePoint),l.prototype.jpoint=a(i(function(b,y,A){return new p(this,b,y,A)},"jpoint2"),"jpoint"),p.prototype.toP=a(i(function(){if(this.isInfinity())return this.curve.point(null,null);var b=this.z.redInvm(),y=b.redSqr(),A=this.x.redMul(y),C=this.y.redMul(y).redMul(b);return this.curve.point(A,C)},"toP2"),"toP"),p.prototype.neg=a(i(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg3"),"neg"),p.prototype.add=a(i(function(b){if(this.isInfinity())return b;if(b.isInfinity())return this;var y=b.z.redSqr(),A=this.z.redSqr(),C=this.x.redMul(y),O=b.x.redMul(A),R=this.y.redMul(y.redMul(b.z)),L=b.y.redMul(A.redMul(this.z)),K=C.redSub(O),$=R.redSub(L);if(K.cmpn(0)===0)return $.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var j=K.redSqr(),V=j.redMul(K),G=C.redMul(j),k=$.redSqr().redIAdd(V).redISub(G).redISub(G),H=$.redMul(G.redISub(k)).redISub(R.redMul(V)),se=this.z.redMul(b.z).redMul(K);return this.curve.jpoint(k,H,se)},"add3"),"add"),p.prototype.mixedAdd=a(i(function(b){if(this.isInfinity())return b.toJ();if(b.isInfinity())return this;var y=this.z.redSqr(),A=this.x,C=b.x.redMul(y),O=this.y,R=b.y.redMul(y).redMul(this.z),L=A.redSub(C),K=O.redSub(R);if(L.cmpn(0)===0)return K.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var $=L.redSqr(),j=$.redMul(L),V=A.redMul($),G=K.redSqr().redIAdd(j).redISub(V).redISub(V),k=K.redMul(V.redISub(G)).redISub(O.redMul(j)),H=this.z.redMul(L);return this.curve.jpoint(G,k,H)},"mixedAdd2"),"mixedAdd"),p.prototype.dblp=a(i(function(b){if(b===0)return this;if(this.isInfinity())return this;if(!b)return this.dbl();var y;if(this.curve.zeroA||this.curve.threeA){var A=this;for(y=0;y<b;y++)A=A.dbl();return A}var C=this.curve.a,O=this.curve.tinv,R=this.x,L=this.y,K=this.z,$=K.redSqr().redSqr(),j=L.redAdd(L);for(y=0;y<b;y++){var V=R.redSqr(),G=j.redSqr(),k=G.redSqr(),H=V.redAdd(V).redIAdd(V).redIAdd(C.redMul($)),se=R.redMul(G),ue=H.redSqr().redISub(se.redAdd(se)),me=se.redISub(ue),q=H.redMul(me);q=q.redIAdd(q).redISub(k);var E=j.redMul(K);y+1<b&&($=$.redMul(k)),R=ue,K=E,j=q}return this.curve.jpoint(R,j.redMul(O),K)},"dblp3"),"dblp"),p.prototype.dbl=a(i(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl3"),"dbl"),p.prototype._zeroDbl=a(i(function(){var b,y,A;if(this.zOne){var C=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),L=this.x.redAdd(O).redSqr().redISub(C).redISub(R);L=L.redIAdd(L);var K=C.redAdd(C).redIAdd(C),$=K.redSqr().redISub(L).redISub(L),j=R.redIAdd(R);j=j.redIAdd(j),j=j.redIAdd(j),b=$,y=K.redMul(L.redISub($)).redISub(j),A=this.y.redAdd(this.y)}else{var V=this.x.redSqr(),G=this.y.redSqr(),k=G.redSqr(),H=this.x.redAdd(G).redSqr().redISub(V).redISub(k);H=H.redIAdd(H);var se=V.redAdd(V).redIAdd(V),ue=se.redSqr(),me=k.redIAdd(k);me=me.redIAdd(me),me=me.redIAdd(me),b=ue.redISub(H).redISub(H),y=se.redMul(H.redISub(b)).redISub(me),A=this.y.redMul(this.z),A=A.redIAdd(A)}return this.curve.jpoint(b,y,A)},"_zeroDbl2"),"_zeroDbl"),p.prototype._threeDbl=a(i(function(){var b,y,A;if(this.zOne){var C=this.x.redSqr(),O=this.y.redSqr(),R=O.redSqr(),L=this.x.redAdd(O).redSqr().redISub(C).redISub(R);L=L.redIAdd(L);var K=C.redAdd(C).redIAdd(C).redIAdd(this.curve.a),$=K.redSqr().redISub(L).redISub(L);b=$;var j=R.redIAdd(R);j=j.redIAdd(j),j=j.redIAdd(j),y=K.redMul(L.redISub($)).redISub(j),A=this.y.redAdd(this.y)}else{var V=this.z.redSqr(),G=this.y.redSqr(),k=this.x.redMul(G),H=this.x.redSub(V).redMul(this.x.redAdd(V));H=H.redAdd(H).redIAdd(H);var se=k.redIAdd(k);se=se.redIAdd(se);var ue=se.redAdd(se);b=H.redSqr().redISub(ue),A=this.y.redAdd(this.z).redSqr().redISub(G).redISub(V);var me=G.redSqr();me=me.redIAdd(me),me=me.redIAdd(me),me=me.redIAdd(me),y=H.redMul(se.redISub(b)).redISub(me)}return this.curve.jpoint(b,y,A)},"_threeDbl2"),"_threeDbl"),p.prototype._dbl=a(i(function(){var b=this.curve.a,y=this.x,A=this.y,C=this.z,O=C.redSqr().redSqr(),R=y.redSqr(),L=A.redSqr(),K=R.redAdd(R).redIAdd(R).redIAdd(b.redMul(O)),$=y.redAdd(y);$=$.redIAdd($);var j=$.redMul(L),V=K.redSqr().redISub(j.redAdd(j)),G=j.redISub(V),k=L.redSqr();k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var H=K.redMul(G).redISub(k),se=A.redAdd(A).redMul(C);return this.curve.jpoint(V,H,se)},"_dbl2"),"_dbl"),p.prototype.trpl=a(i(function(){if(!this.curve.zeroA)return this.dbl().add(this);var b=this.x.redSqr(),y=this.y.redSqr(),A=this.z.redSqr(),C=y.redSqr(),O=b.redAdd(b).redIAdd(b),R=O.redSqr(),L=this.x.redAdd(y).redSqr().redISub(b).redISub(C);L=L.redIAdd(L),L=L.redAdd(L).redIAdd(L),L=L.redISub(R);var K=L.redSqr(),$=C.redIAdd(C);$=$.redIAdd($),$=$.redIAdd($),$=$.redIAdd($);var j=O.redIAdd(L).redSqr().redISub(R).redISub(K).redISub($),V=y.redMul(j);V=V.redIAdd(V),V=V.redIAdd(V);var G=this.x.redMul(K).redISub(V);G=G.redIAdd(G),G=G.redIAdd(G);var k=this.y.redMul(j.redMul($.redISub(j)).redISub(L.redMul(K)));k=k.redIAdd(k),k=k.redIAdd(k),k=k.redIAdd(k);var H=this.z.redAdd(L).redSqr().redISub(A).redISub(K);return this.curve.jpoint(G,k,H)},"trpl2"),"trpl"),p.prototype.mul=a(i(function(b,y){return b=new n(b,y),this.curve._wnafMul(this,b)},"mul3"),"mul"),p.prototype.eq=a(i(function(b){if(b.type==="affine")return this.eq(b.toJ());if(this===b)return!0;var y=this.z.redSqr(),A=b.z.redSqr();if(this.x.redMul(A).redISub(b.x.redMul(y)).cmpn(0)!==0)return!1;var C=y.redMul(this.z),O=A.redMul(b.z);return this.y.redMul(O).redISub(b.y.redMul(C)).cmpn(0)===0},"eq4"),"eq"),p.prototype.eqXToP=a(i(function(b){var y=this.z.redSqr(),A=b.toRed(this.curve.red).redMul(y);if(this.x.cmp(A)===0)return!0;for(var C=b.clone(),O=this.curve.redN.redMul(y);;){if(C.iadd(this.curve.n),C.cmp(this.curve.p)>=0)return!1;if(A.redIAdd(O),this.x.cmp(A)===0)return!0}},"eqXToP2"),"eqXToP"),p.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect4"),"inspect"),p.prototype.isInfinity=a(i(function(){return this.z.cmpn(0)===0},"isInfinity3"),"isInfinity")}}),t$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/mont.js"(e,t){"use strict";var r=Sa(),n=hm(),s=dm(),o=qi();function c(h){s.call(this,"mont",h),this.a=new r(h.a,16).toRed(this.red),this.b=new r(h.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}i(c,"MontCurve"),a(c,"MontCurve"),n(c,s),t.exports=c,c.prototype.validate=a(i(function(p){var v=p.normalize().x,b=v.redSqr(),y=b.redMul(v).redAdd(b.redMul(this.a)).redAdd(v),A=y.redSqrt();return A.redSqr().cmp(y)===0},"validate6"),"validate");function l(h,p,v){s.BasePoint.call(this,h,"projective"),p===null&&v===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(p,16),this.z=new r(v,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(l,"Point2"),a(l,"Point"),n(l,s.BasePoint),c.prototype.decodePoint=a(i(function(p,v){return this.point(o.toArray(p,v),1)},"decodePoint2"),"decodePoint"),c.prototype.point=a(i(function(p,v){return new l(this,p,v)},"point3"),"point"),c.prototype.pointFromJSON=a(i(function(p){return l.fromJSON(this,p)},"pointFromJSON2"),"pointFromJSON"),l.prototype.precompute=a(i(function(){},"precompute2"),"precompute"),l.prototype._encode=a(i(function(){return this.getX().toArray("be",this.curve.p.byteLength())},"_encode2"),"_encode"),l.fromJSON=a(i(function(p,v){return new l(p,v[0],v[1]||p.one)},"fromJSON2"),"fromJSON"),l.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect4"),"inspect"),l.prototype.isInfinity=a(i(function(){return this.z.cmpn(0)===0},"isInfinity3"),"isInfinity"),l.prototype.dbl=a(i(function(){var p=this.x.redAdd(this.z),v=p.redSqr(),b=this.x.redSub(this.z),y=b.redSqr(),A=v.redSub(y),C=v.redMul(y),O=A.redMul(y.redAdd(this.curve.a24.redMul(A)));return this.curve.point(C,O)},"dbl3"),"dbl"),l.prototype.add=a(i(function(){throw new Error("Not supported on Montgomery curve")},"add3"),"add"),l.prototype.diffAdd=a(i(function(p,v){var b=this.x.redAdd(this.z),y=this.x.redSub(this.z),A=p.x.redAdd(p.z),C=p.x.redSub(p.z),O=C.redMul(b),R=A.redMul(y),L=v.z.redMul(O.redAdd(R).redSqr()),K=v.x.redMul(O.redISub(R).redSqr());return this.curve.point(L,K)},"diffAdd"),"diffAdd"),l.prototype.mul=a(i(function(p){for(var v=p.clone(),b=this,y=this.curve.point(null,null),A=this,C=[];v.cmpn(0)!==0;v.iushrn(1))C.push(v.andln(1));for(var O=C.length-1;O>=0;O--)C[O]===0?(b=b.diffAdd(y,A),y=y.dbl()):(y=b.diffAdd(y,A),b=b.dbl());return y},"mul3"),"mul"),l.prototype.mulAdd=a(i(function(){throw new Error("Not supported on Montgomery curve")},"mulAdd2"),"mulAdd"),l.prototype.jumlAdd=a(i(function(){throw new Error("Not supported on Montgomery curve")},"jumlAdd"),"jumlAdd"),l.prototype.eq=a(i(function(p){return this.getX().cmp(p.getX())===0},"eq4"),"eq"),l.prototype.normalize=a(i(function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},"normalize"),"normalize"),l.prototype.getX=a(i(function(){return this.normalize(),this.x.fromRed()},"getX2"),"getX")}}),r$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/edwards.js"(e,t){"use strict";var r=qi(),n=Sa(),s=hm(),o=dm(),c=r.assert;function l(p){this.twisted=(p.a|0)!==1,this.mOneA=this.twisted&&(p.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",p),this.a=new n(p.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(p.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(p.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(p.c|0)===1}i(l,"EdwardsCurve"),a(l,"EdwardsCurve"),s(l,o),t.exports=l,l.prototype._mulA=a(i(function(v){return this.mOneA?v.redNeg():this.a.redMul(v)},"_mulA"),"_mulA"),l.prototype._mulC=a(i(function(v){return this.oneC?v:this.c.redMul(v)},"_mulC"),"_mulC"),l.prototype.jpoint=a(i(function(v,b,y,A){return this.point(v,b,y,A)},"jpoint2"),"jpoint"),l.prototype.pointFromX=a(i(function(v,b){v=new n(v,16),v.red||(v=v.toRed(this.red));var y=v.redSqr(),A=this.c2.redSub(this.a.redMul(y)),C=this.one.redSub(this.c2.redMul(this.d).redMul(y)),O=A.redMul(C.redInvm()),R=O.redSqrt();if(R.redSqr().redSub(O).cmp(this.zero)!==0)throw new Error("invalid point");var L=R.fromRed().isOdd();return(b&&!L||!b&&L)&&(R=R.redNeg()),this.point(v,R)},"pointFromX2"),"pointFromX"),l.prototype.pointFromY=a(i(function(v,b){v=new n(v,16),v.red||(v=v.toRed(this.red));var y=v.redSqr(),A=y.redSub(this.c2),C=y.redMul(this.d).redMul(this.c2).redSub(this.a),O=A.redMul(C.redInvm());if(O.cmp(this.zero)===0){if(b)throw new Error("invalid point");return this.point(this.zero,v)}var R=O.redSqrt();if(R.redSqr().redSub(O).cmp(this.zero)!==0)throw new Error("invalid point");return R.fromRed().isOdd()!==b&&(R=R.redNeg()),this.point(R,v)},"pointFromY"),"pointFromY"),l.prototype.validate=a(i(function(v){if(v.isInfinity())return!0;v.normalize();var b=v.x.redSqr(),y=v.y.redSqr(),A=b.redMul(this.a).redAdd(y),C=this.c2.redMul(this.one.redAdd(this.d.redMul(b).redMul(y)));return A.cmp(C)===0},"validate6"),"validate");function h(p,v,b,y,A){o.BasePoint.call(this,p,"projective"),v===null&&b===null&&y===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(v,16),this.y=new n(b,16),this.z=y?new n(y,16):this.curve.one,this.t=A&&new n(A,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(h,"Point2"),a(h,"Point"),s(h,o.BasePoint),l.prototype.pointFromJSON=a(i(function(v){return h.fromJSON(this,v)},"pointFromJSON2"),"pointFromJSON"),l.prototype.point=a(i(function(v,b,y,A){return new h(this,v,b,y,A)},"point3"),"point"),h.fromJSON=a(i(function(v,b){return new h(v,b[0],b[1],b[2])},"fromJSON2"),"fromJSON"),h.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},"inspect4"),"inspect"),h.prototype.isInfinity=a(i(function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},"isInfinity3"),"isInfinity"),h.prototype._extDbl=a(i(function(){var v=this.x.redSqr(),b=this.y.redSqr(),y=this.z.redSqr();y=y.redIAdd(y);var A=this.curve._mulA(v),C=this.x.redAdd(this.y).redSqr().redISub(v).redISub(b),O=A.redAdd(b),R=O.redSub(y),L=A.redSub(b),K=C.redMul(R),$=O.redMul(L),j=C.redMul(L),V=R.redMul(O);return this.curve.point(K,$,V,j)},"_extDbl"),"_extDbl"),h.prototype._projDbl=a(i(function(){var v=this.x.redAdd(this.y).redSqr(),b=this.x.redSqr(),y=this.y.redSqr(),A,C,O,R,L,K;if(this.curve.twisted){R=this.curve._mulA(b);var $=R.redAdd(y);this.zOne?(A=v.redSub(b).redSub(y).redMul($.redSub(this.curve.two)),C=$.redMul(R.redSub(y)),O=$.redSqr().redSub($).redSub($)):(L=this.z.redSqr(),K=$.redSub(L).redISub(L),A=v.redSub(b).redISub(y).redMul(K),C=$.redMul(R.redSub(y)),O=$.redMul(K))}else R=b.redAdd(y),L=this.curve._mulC(this.z).redSqr(),K=R.redSub(L).redSub(L),A=this.curve._mulC(v.redISub(R)).redMul(K),C=this.curve._mulC(R).redMul(b.redISub(y)),O=R.redMul(K);return this.curve.point(A,C,O)},"_projDbl"),"_projDbl"),h.prototype.dbl=a(i(function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},"dbl3"),"dbl"),h.prototype._extAdd=a(i(function(v){var b=this.y.redSub(this.x).redMul(v.y.redSub(v.x)),y=this.y.redAdd(this.x).redMul(v.y.redAdd(v.x)),A=this.t.redMul(this.curve.dd).redMul(v.t),C=this.z.redMul(v.z.redAdd(v.z)),O=y.redSub(b),R=C.redSub(A),L=C.redAdd(A),K=y.redAdd(b),$=O.redMul(R),j=L.redMul(K),V=O.redMul(K),G=R.redMul(L);return this.curve.point($,j,G,V)},"_extAdd"),"_extAdd"),h.prototype._projAdd=a(i(function(v){var b=this.z.redMul(v.z),y=b.redSqr(),A=this.x.redMul(v.x),C=this.y.redMul(v.y),O=this.curve.d.redMul(A).redMul(C),R=y.redSub(O),L=y.redAdd(O),K=this.x.redAdd(this.y).redMul(v.x.redAdd(v.y)).redISub(A).redISub(C),$=b.redMul(R).redMul(K),j,V;return this.curve.twisted?(j=b.redMul(L).redMul(C.redSub(this.curve._mulA(A))),V=R.redMul(L)):(j=b.redMul(L).redMul(C.redSub(A)),V=this.curve._mulC(R).redMul(L)),this.curve.point($,j,V)},"_projAdd"),"_projAdd"),h.prototype.add=a(i(function(v){return this.isInfinity()?v:v.isInfinity()?this:this.curve.extended?this._extAdd(v):this._projAdd(v)},"add3"),"add"),h.prototype.mul=a(i(function(v){return this._hasDoubles(v)?this.curve._fixedNafMul(this,v):this.curve._wnafMul(this,v)},"mul3"),"mul"),h.prototype.mulAdd=a(i(function(v,b,y){return this.curve._wnafMulAdd(1,[this,b],[v,y],2,!1)},"mulAdd2"),"mulAdd"),h.prototype.jmulAdd=a(i(function(v,b,y){return this.curve._wnafMulAdd(1,[this,b],[v,y],2,!0)},"jmulAdd2"),"jmulAdd"),h.prototype.normalize=a(i(function(){if(this.zOne)return this;var v=this.z.redInvm();return this.x=this.x.redMul(v),this.y=this.y.redMul(v),this.t&&(this.t=this.t.redMul(v)),this.z=this.curve.one,this.zOne=!0,this},"normalize"),"normalize"),h.prototype.neg=a(i(function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},"neg3"),"neg"),h.prototype.getX=a(i(function(){return this.normalize(),this.x.fromRed()},"getX2"),"getX"),h.prototype.getY=a(i(function(){return this.normalize(),this.y.fromRed()},"getY2"),"getY"),h.prototype.eq=a(i(function(v){return this===v||this.getX().cmp(v.getX())===0&&this.getY().cmp(v.getY())===0},"eq4"),"eq"),h.prototype.eqXToP=a(i(function(v){var b=v.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(b)===0)return!0;for(var y=v.clone(),A=this.curve.redN.redMul(this.z);;){if(y.iadd(this.curve.n),y.cmp(this.curve.p)>=0)return!1;if(b.redIAdd(A),this.x.cmp(b)===0)return!0}},"eqXToP2"),"eqXToP"),h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add}}),Ex=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/index.js"(e){"use strict";var t=e;t.base=dm(),t.short=e$(),t.mont=t$(),t.edwards=r$()}}),Hs=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/utils.js"(e){"use strict";var t=Tc(),r=hm();e.inherits=r;function n(E,T){return(E.charCodeAt(T)&64512)!==55296||T<0||T+1>=E.length?!1:(E.charCodeAt(T+1)&64512)===56320}i(n,"isSurrogatePair"),a(n,"isSurrogatePair");function s(E,T){if(Array.isArray(E))return E.slice();if(!E)return[];var m=[];if(typeof E=="string")if(T){if(T==="hex")for(E=E.replace(/[^a-z0-9]+/ig,""),E.length%2!==0&&(E="0"+E),g=0;g<E.length;g+=2)m.push(parseInt(E[g]+E[g+1],16))}else for(var d=0,g=0;g<E.length;g++){var _=E.charCodeAt(g);_<128?m[d++]=_:_<2048?(m[d++]=_>>6|192,m[d++]=_&63|128):n(E,g)?(_=65536+((_&1023)<<10)+(E.charCodeAt(++g)&1023),m[d++]=_>>18|240,m[d++]=_>>12&63|128,m[d++]=_>>6&63|128,m[d++]=_&63|128):(m[d++]=_>>12|224,m[d++]=_>>6&63|128,m[d++]=_&63|128)}else for(g=0;g<E.length;g++)m[g]=E[g]|0;return m}i(s,"toArray"),a(s,"toArray"),e.toArray=s;function o(E){for(var T="",m=0;m<E.length;m++)T+=h(E[m].toString(16));return T}i(o,"toHex"),a(o,"toHex"),e.toHex=o;function c(E){var T=E>>>24|E>>>8&65280|E<<8&16711680|(E&255)<<24;return T>>>0}i(c,"htonl"),a(c,"htonl"),e.htonl=c;function l(E,T){for(var m="",d=0;d<E.length;d++){var g=E[d];T==="little"&&(g=c(g)),m+=p(g.toString(16))}return m}i(l,"toHex32"),a(l,"toHex32"),e.toHex32=l;function h(E){return E.length===1?"0"+E:E}i(h,"zero2"),a(h,"zero2"),e.zero2=h;function p(E){return E.length===7?"0"+E:E.length===6?"00"+E:E.length===5?"000"+E:E.length===4?"0000"+E:E.length===3?"00000"+E:E.length===2?"000000"+E:E.length===1?"0000000"+E:E}i(p,"zero8"),a(p,"zero8"),e.zero8=p;function v(E,T,m,d){var g=m-T;t(g%4===0);for(var _=new Array(g/4),M=0,S=T;M<_.length;M++,S+=4){var w;d==="big"?w=E[S]<<24|E[S+1]<<16|E[S+2]<<8|E[S+3]:w=E[S+3]<<24|E[S+2]<<16|E[S+1]<<8|E[S],_[M]=w>>>0}return _}i(v,"join32"),a(v,"join32"),e.join32=v;function b(E,T){for(var m=new Array(E.length*4),d=0,g=0;d<E.length;d++,g+=4){var _=E[d];T==="big"?(m[g]=_>>>24,m[g+1]=_>>>16&255,m[g+2]=_>>>8&255,m[g+3]=_&255):(m[g+3]=_>>>24,m[g+2]=_>>>16&255,m[g+1]=_>>>8&255,m[g]=_&255)}return m}i(b,"split32"),a(b,"split32"),e.split32=b;function y(E,T){return E>>>T|E<<32-T}i(y,"rotr32"),a(y,"rotr32"),e.rotr32=y;function A(E,T){return E<<T|E>>>32-T}i(A,"rotl32"),a(A,"rotl32"),e.rotl32=A;function C(E,T){return E+T>>>0}i(C,"sum32"),a(C,"sum32"),e.sum32=C;function O(E,T,m){return E+T+m>>>0}i(O,"sum32_3"),a(O,"sum32_3"),e.sum32_3=O;function R(E,T,m,d){return E+T+m+d>>>0}i(R,"sum32_4"),a(R,"sum32_4"),e.sum32_4=R;function L(E,T,m,d,g){return E+T+m+d+g>>>0}i(L,"sum32_5"),a(L,"sum32_5"),e.sum32_5=L;function K(E,T,m,d){var g=E[T],_=E[T+1],M=d+_>>>0,S=(M<d?1:0)+m+g;E[T]=S>>>0,E[T+1]=M}i(K,"sum64"),a(K,"sum64"),e.sum64=K;function $(E,T,m,d){var g=T+d>>>0,_=(g<T?1:0)+E+m;return _>>>0}i($,"sum64_hi"),a($,"sum64_hi"),e.sum64_hi=$;function j(E,T,m,d){var g=T+d;return g>>>0}i(j,"sum64_lo"),a(j,"sum64_lo"),e.sum64_lo=j;function V(E,T,m,d,g,_,M,S){var w=0,N=T;N=N+d>>>0,w+=N<T?1:0,N=N+_>>>0,w+=N<_?1:0,N=N+S>>>0,w+=N<S?1:0;var B=E+m+g+M+w;return B>>>0}i(V,"sum64_4_hi"),a(V,"sum64_4_hi"),e.sum64_4_hi=V;function G(E,T,m,d,g,_,M,S){var w=T+d+_+S;return w>>>0}i(G,"sum64_4_lo"),a(G,"sum64_4_lo"),e.sum64_4_lo=G;function k(E,T,m,d,g,_,M,S,w,N){var B=0,D=T;D=D+d>>>0,B+=D<T?1:0,D=D+_>>>0,B+=D<_?1:0,D=D+S>>>0,B+=D<S?1:0,D=D+N>>>0,B+=D<N?1:0;var F=E+m+g+M+w+B;return F>>>0}i(k,"sum64_5_hi"),a(k,"sum64_5_hi"),e.sum64_5_hi=k;function H(E,T,m,d,g,_,M,S,w,N){var B=T+d+_+S+N;return B>>>0}i(H,"sum64_5_lo"),a(H,"sum64_5_lo"),e.sum64_5_lo=H;function se(E,T,m){var d=T<<32-m|E>>>m;return d>>>0}i(se,"rotr64_hi"),a(se,"rotr64_hi"),e.rotr64_hi=se;function ue(E,T,m){var d=E<<32-m|T>>>m;return d>>>0}i(ue,"rotr64_lo"),a(ue,"rotr64_lo"),e.rotr64_lo=ue;function me(E,T,m){return E>>>m}i(me,"shr64_hi"),a(me,"shr64_hi"),e.shr64_hi=me;function q(E,T,m){var d=E<<32-m|T>>>m;return d>>>0}i(q,"shr64_lo"),a(q,"shr64_lo"),e.shr64_lo=q}}),fd=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/common.js"(e){"use strict";var t=Hs(),r=Tc();function n(){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}i(n,"BlockHash"),a(n,"BlockHash"),e.BlockHash=n,n.prototype.update=a(i(function(o,c){if(o=t.toArray(o,c),this.pending?this.pending=this.pending.concat(o):this.pending=o,this.pendingTotal+=o.length,this.pending.length>=this._delta8){o=this.pending;var l=o.length%this._delta8;this.pending=o.slice(o.length-l,o.length),this.pending.length===0&&(this.pending=null),o=t.join32(o,0,o.length-l,this.endian);for(var h=0;h<o.length;h+=this._delta32)this._update(o,h,h+this._delta32)}return this},"update2"),"update"),n.prototype.digest=a(i(function(o){return this.update(this._pad()),r(this.pending===null),this._digest(o)},"digest2"),"digest"),n.prototype._pad=a(i(function(){var o=this.pendingTotal,c=this._delta8,l=c-(o+this.padLength)%c,h=new Array(l+this.padLength);h[0]=128;for(var p=1;p<l;p++)h[p]=0;if(o<<=3,this.endian==="big"){for(var v=8;v<this.padLength;v++)h[p++]=0;h[p++]=0,h[p++]=0,h[p++]=0,h[p++]=0,h[p++]=o>>>24&255,h[p++]=o>>>16&255,h[p++]=o>>>8&255,h[p++]=o&255}else for(h[p++]=o&255,h[p++]=o>>>8&255,h[p++]=o>>>16&255,h[p++]=o>>>24&255,h[p++]=0,h[p++]=0,h[p++]=0,h[p++]=0,v=8;v<this.padLength;v++)h[p++]=0;return h},"pad2"),"pad")}}),Ax=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/common.js"(e){"use strict";var t=Hs(),r=t.rotr32;function n(b,y,A,C){if(b===0)return s(y,A,C);if(b===1||b===3)return c(y,A,C);if(b===2)return o(y,A,C)}i(n,"ft_1"),a(n,"ft_1"),e.ft_1=n;function s(b,y,A){return b&y^~b&A}i(s,"ch32"),a(s,"ch32"),e.ch32=s;function o(b,y,A){return b&y^b&A^y&A}i(o,"maj32"),a(o,"maj32"),e.maj32=o;function c(b,y,A){return b^y^A}i(c,"p32"),a(c,"p32"),e.p32=c;function l(b){return r(b,2)^r(b,13)^r(b,22)}i(l,"s0_256"),a(l,"s0_256"),e.s0_256=l;function h(b){return r(b,6)^r(b,11)^r(b,25)}i(h,"s1_256"),a(h,"s1_256"),e.s1_256=h;function p(b){return r(b,7)^r(b,18)^b>>>3}i(p,"g0_256"),a(p,"g0_256"),e.g0_256=p;function v(b){return r(b,17)^r(b,19)^b>>>10}i(v,"g1_256"),a(v,"g1_256"),e.g1_256=v}}),n$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/1.js"(e,t){"use strict";var r=Hs(),n=fd(),s=Ax(),o=r.rotl32,c=r.sum32,l=r.sum32_5,h=s.ft_1,p=n.BlockHash,v=[1518500249,1859775393,2400959708,3395469782];function b(){if(!(this instanceof b))return new b;p.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i(b,"SHA1"),a(b,"SHA1"),r.inherits(b,p),t.exports=b,b.blockSize=512,b.outSize=160,b.hmacStrength=80,b.padLength=64,b.prototype._update=a(i(function(A,C){for(var O=this.W,R=0;R<16;R++)O[R]=A[C+R];for(;R<O.length;R++)O[R]=o(O[R-3]^O[R-8]^O[R-14]^O[R-16],1);var L=this.h[0],K=this.h[1],$=this.h[2],j=this.h[3],V=this.h[4];for(R=0;R<O.length;R++){var G=~~(R/20),k=l(o(L,5),h(G,K,$,j),V,O[R],v[G]);V=j,j=$,$=o(K,30),K=L,L=k}this.h[0]=c(this.h[0],L),this.h[1]=c(this.h[1],K),this.h[2]=c(this.h[2],$),this.h[3]=c(this.h[3],j),this.h[4]=c(this.h[4],V)},"_update"),"_update"),b.prototype._digest=a(i(function(A){return A==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},"digest2"),"digest")}}),Sx=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/256.js"(e,t){"use strict";var r=Hs(),n=fd(),s=Ax(),o=Tc(),c=r.sum32,l=r.sum32_4,h=r.sum32_5,p=s.ch32,v=s.maj32,b=s.s0_256,y=s.s1_256,A=s.g0_256,C=s.g1_256,O=n.BlockHash,R=[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 L(){if(!(this instanceof L))return new L;O.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=R,this.W=new Array(64)}i(L,"SHA256"),a(L,"SHA256"),r.inherits(L,O),t.exports=L,L.blockSize=512,L.outSize=256,L.hmacStrength=192,L.padLength=64,L.prototype._update=a(i(function($,j){for(var V=this.W,G=0;G<16;G++)V[G]=$[j+G];for(;G<V.length;G++)V[G]=l(C(V[G-2]),V[G-7],A(V[G-15]),V[G-16]);var k=this.h[0],H=this.h[1],se=this.h[2],ue=this.h[3],me=this.h[4],q=this.h[5],E=this.h[6],T=this.h[7];for(o(this.k.length===V.length),G=0;G<V.length;G++){var m=h(T,y(me),p(me,q,E),this.k[G],V[G]),d=c(b(k),v(k,H,se));T=E,E=q,q=me,me=c(ue,m),ue=se,se=H,H=k,k=c(m,d)}this.h[0]=c(this.h[0],k),this.h[1]=c(this.h[1],H),this.h[2]=c(this.h[2],se),this.h[3]=c(this.h[3],ue),this.h[4]=c(this.h[4],me),this.h[5]=c(this.h[5],q),this.h[6]=c(this.h[6],E),this.h[7]=c(this.h[7],T)},"_update"),"_update"),L.prototype._digest=a(i(function($){return $==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},"digest2"),"digest")}}),i$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/224.js"(e,t){"use strict";var r=Hs(),n=Sx();function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i(s,"SHA224"),a(s,"SHA224"),r.inherits(s,n),t.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=a(i(function(c){return c==="hex"?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")},"digest2"),"digest")}}),xx=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/512.js"(e,t){"use strict";var r=Hs(),n=fd(),s=Tc(),o=r.rotr64_hi,c=r.rotr64_lo,l=r.shr64_hi,h=r.shr64_lo,p=r.sum64,v=r.sum64_hi,b=r.sum64_lo,y=r.sum64_4_hi,A=r.sum64_4_lo,C=r.sum64_5_hi,O=r.sum64_5_lo,R=n.BlockHash,L=[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 K(){if(!(this instanceof K))return new K;R.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=L,this.W=new Array(160)}i(K,"SHA512"),a(K,"SHA512"),r.inherits(K,R),t.exports=K,K.blockSize=1024,K.outSize=512,K.hmacStrength=192,K.padLength=128,K.prototype._prepareBlock=a(i(function(d,g){for(var _=this.W,M=0;M<32;M++)_[M]=d[g+M];for(;M<_.length;M+=2){var S=E(_[M-4],_[M-3]),w=T(_[M-4],_[M-3]),N=_[M-14],B=_[M-13],D=me(_[M-30],_[M-29]),F=q(_[M-30],_[M-29]),le=_[M-32],P=_[M-31];_[M]=y(S,w,N,B,D,F,le,P),_[M+1]=A(S,w,N,B,D,F,le,P)}},"_prepareBlock"),"_prepareBlock"),K.prototype._update=a(i(function(d,g){this._prepareBlock(d,g);var _=this.W,M=this.h[0],S=this.h[1],w=this.h[2],N=this.h[3],B=this.h[4],D=this.h[5],F=this.h[6],le=this.h[7],P=this.h[8],Y=this.h[9],J=this.h[10],I=this.h[11],z=this.h[12],te=this.h[13],ae=this.h[14],ve=this.h[15];s(this.k.length===_.length);for(var De=0;De<_.length;De+=2){var we=ae,de=ve,Ce=se(P,Y),pe=ue(P,Y),_e=$(P,Y,J,I,z,te),Q=j(P,Y,J,I,z,te),ge=this.k[De],Me=this.k[De+1],Ue=_[De],Re=_[De+1],je=C(we,de,Ce,pe,_e,Q,ge,Me,Ue,Re),rt=O(we,de,Ce,pe,_e,Q,ge,Me,Ue,Re);we=k(M,S),de=H(M,S),Ce=V(M,S,w,N,B,D),pe=G(M,S,w,N,B,D);var fe=v(we,de,Ce,pe),ce=b(we,de,Ce,pe);ae=z,ve=te,z=J,te=I,J=P,I=Y,P=v(F,le,je,rt),Y=b(le,le,je,rt),F=B,le=D,B=w,D=N,w=M,N=S,M=v(je,rt,fe,ce),S=b(je,rt,fe,ce)}p(this.h,0,M,S),p(this.h,2,w,N),p(this.h,4,B,D),p(this.h,6,F,le),p(this.h,8,P,Y),p(this.h,10,J,I),p(this.h,12,z,te),p(this.h,14,ae,ve)},"_update"),"_update"),K.prototype._digest=a(i(function(d){return d==="hex"?r.toHex32(this.h,"big"):r.split32(this.h,"big")},"digest2"),"digest");function $(m,d,g,_,M){var S=m&g^~m&M;return S<0&&(S+=4294967296),S}i($,"ch64_hi"),a($,"ch64_hi");function j(m,d,g,_,M,S){var w=d&_^~d&S;return w<0&&(w+=4294967296),w}i(j,"ch64_lo"),a(j,"ch64_lo");function V(m,d,g,_,M){var S=m&g^m&M^g&M;return S<0&&(S+=4294967296),S}i(V,"maj64_hi"),a(V,"maj64_hi");function G(m,d,g,_,M,S){var w=d&_^d&S^_&S;return w<0&&(w+=4294967296),w}i(G,"maj64_lo"),a(G,"maj64_lo");function k(m,d){var g=o(m,d,28),_=o(d,m,2),M=o(d,m,7),S=g^_^M;return S<0&&(S+=4294967296),S}i(k,"s0_512_hi"),a(k,"s0_512_hi");function H(m,d){var g=c(m,d,28),_=c(d,m,2),M=c(d,m,7),S=g^_^M;return S<0&&(S+=4294967296),S}i(H,"s0_512_lo"),a(H,"s0_512_lo");function se(m,d){var g=o(m,d,14),_=o(m,d,18),M=o(d,m,9),S=g^_^M;return S<0&&(S+=4294967296),S}i(se,"s1_512_hi"),a(se,"s1_512_hi");function ue(m,d){var g=c(m,d,14),_=c(m,d,18),M=c(d,m,9),S=g^_^M;return S<0&&(S+=4294967296),S}i(ue,"s1_512_lo"),a(ue,"s1_512_lo");function me(m,d){var g=o(m,d,1),_=o(m,d,8),M=l(m,d,7),S=g^_^M;return S<0&&(S+=4294967296),S}i(me,"g0_512_hi"),a(me,"g0_512_hi");function q(m,d){var g=c(m,d,1),_=c(m,d,8),M=h(m,d,7),S=g^_^M;return S<0&&(S+=4294967296),S}i(q,"g0_512_lo"),a(q,"g0_512_lo");function E(m,d){var g=o(m,d,19),_=o(d,m,29),M=l(m,d,6),S=g^_^M;return S<0&&(S+=4294967296),S}i(E,"g1_512_hi"),a(E,"g1_512_hi");function T(m,d){var g=c(m,d,19),_=c(d,m,29),M=h(m,d,6),S=g^_^M;return S<0&&(S+=4294967296),S}i(T,"g1_512_lo"),a(T,"g1_512_lo")}}),s$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/384.js"(e,t){"use strict";var r=Hs(),n=xx();function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i(s,"SHA384"),a(s,"SHA384"),r.inherits(s,n),t.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=a(i(function(c){return c==="hex"?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")},"digest2"),"digest")}}),a$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha.js"(e){"use strict";e.sha1=n$(),e.sha224=i$(),e.sha256=Sx(),e.sha384=s$(),e.sha512=xx()}}),o$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/ripemd.js"(e){"use strict";var t=Hs(),r=fd(),n=t.rotl32,s=t.sum32,o=t.sum32_3,c=t.sum32_4,l=r.BlockHash;function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}i(h,"RIPEMD160"),a(h,"RIPEMD160"),t.inherits(h,l),e.ripemd160=h,h.blockSize=512,h.outSize=160,h.hmacStrength=192,h.padLength=64,h.prototype._update=a(i(function(L,K){for(var $=this.h[0],j=this.h[1],V=this.h[2],G=this.h[3],k=this.h[4],H=$,se=j,ue=V,me=G,q=k,E=0;E<80;E++){var T=s(n(c($,p(E,j,V,G),L[y[E]+K],v(E)),C[E]),k);$=k,k=G,G=n(V,10),V=j,j=T,T=s(n(c(H,p(79-E,se,ue,me),L[A[E]+K],b(E)),O[E]),q),H=q,q=me,me=n(ue,10),ue=se,se=T}T=o(this.h[1],V,me),this.h[1]=o(this.h[2],G,q),this.h[2]=o(this.h[3],k,H),this.h[3]=o(this.h[4],$,se),this.h[4]=o(this.h[0],j,ue),this.h[0]=T},"update2"),"update"),h.prototype._digest=a(i(function(L){return L==="hex"?t.toHex32(this.h,"little"):t.split32(this.h,"little")},"digest2"),"digest");function p(R,L,K,$){return R<=15?L^K^$:R<=31?L&K|~L&$:R<=47?(L|~K)^$:R<=63?L&$|K&~$:L^(K|~$)}i(p,"f"),a(p,"f");function v(R){return R<=15?0:R<=31?1518500249:R<=47?1859775393:R<=63?2400959708:2840853838}i(v,"K"),a(v,"K");function b(R){return R<=15?1352829926:R<=31?1548603684:R<=47?1836072691:R<=63?2053994217:0}i(b,"Kh"),a(b,"Kh");var y=[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],A=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],C=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],O=[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]}}),c$=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/hmac.js"(e,t){"use strict";var r=Hs(),n=Tc();function s(o,c,l){if(!(this instanceof s))return new s(o,c,l);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(c,l))}i(s,"Hmac"),a(s,"Hmac"),t.exports=s,s.prototype._init=a(i(function(c){c.length>this.blockSize&&(c=new this.Hash().update(c).digest()),n(c.length<=this.blockSize);for(var l=c.length;l<this.blockSize;l++)c.push(0);for(l=0;l<c.length;l++)c[l]^=54;for(this.inner=new this.Hash().update(c),l=0;l<c.length;l++)c[l]^=106;this.outer=new this.Hash().update(c)},"init2"),"init"),s.prototype.update=a(i(function(c,l){return this.inner.update(c,l),this},"update2"),"update"),s.prototype.digest=a(i(function(c){return this.outer.update(this.inner.digest()),this.outer.digest(c)},"digest2"),"digest")}}),pm=ze({"../../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash.js"(e){var t=e;t.utils=Hs(),t.common=fd(),t.sha=a$(),t.ripemd=o$(),t.hmac=c$(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}}),u$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js"(e,t){t.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"]]}}}}),o2=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curves.js"(e){"use strict";var t=e,r=pm(),n=Ex(),s=qi(),o=s.assert;function c(p){p.type==="short"?this.curve=new n.short(p):p.type==="edwards"?this.curve=new n.edwards(p):this.curve=new n.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i(c,"PresetCurve"),a(c,"PresetCurve"),t.PresetCurve=c;function l(p,v){Object.defineProperty(t,p,{configurable:!0,enumerable:!0,get:function(){var b=new c(v);return Object.defineProperty(t,p,{configurable:!0,enumerable:!0,value:b}),b}})}i(l,"defineCurve"),a(l,"defineCurve"),l("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("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:r.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"]}),l("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:r.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"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),l("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var h;try{h=u$()}catch{h=void 0}l("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",h]})}}),l$=ze({"../../../node_modules/.pnpm/hmac-drbg@1.0.1/node_modules/hmac-drbg/lib/hmac-drbg.js"(e,t){"use strict";var r=pm(),n=_x(),s=Tc();function o(c){if(!(this instanceof o))return new o(c);this.hash=c.hash,this.predResist=!!c.predResist,this.outLen=this.hash.outSize,this.minEntropy=c.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var l=n.toArray(c.entropy,c.entropyEnc||"hex"),h=n.toArray(c.nonce,c.nonceEnc||"hex"),p=n.toArray(c.pers,c.persEnc||"hex");s(l.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(l,h,p)}i(o,"HmacDRBG2"),a(o,"HmacDRBG"),t.exports=o,o.prototype._init=a(i(function(l,h,p){var v=l.concat(h).concat(p);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var b=0;b<this.V.length;b++)this.K[b]=0,this.V[b]=1;this._update(v),this._reseed=1,this.reseedInterval=281474976710656},"init2"),"init"),o.prototype._hmac=a(i(function(){return new r.hmac(this.hash,this.K)},"hmac2"),"hmac"),o.prototype._update=a(i(function(l){var h=this._hmac().update(this.V).update([0]);l&&(h=h.update(l)),this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),l&&(this.K=this._hmac().update(this.V).update([1]).update(l).digest(),this.V=this._hmac().update(this.V).digest())},"update2"),"update"),o.prototype.reseed=a(i(function(l,h,p,v){typeof h!="string"&&(v=p,p=h,h=null),l=n.toArray(l,h),p=n.toArray(p,v),s(l.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(l.concat(p||[])),this._reseed=1},"reseed2"),"reseed"),o.prototype.generate=a(i(function(l,h,p,v){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof h!="string"&&(v=p,p=h,h=null),p&&(p=n.toArray(p,v||"hex"),this._update(p));for(var b=[];b.length<l;)this.V=this._hmac().update(this.V).digest(),b=b.concat(this.V);var y=b.slice(0,l);return this._update(p),this._reseed++,n.encode(y,h)},"generate3"),"generate")}}),f$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/key.js"(e,t){"use strict";var r=Sa(),n=qi(),s=n.assert;function o(c,l){this.ec=c,this.priv=null,this.pub=null,l.priv&&this._importPrivate(l.priv,l.privEnc),l.pub&&this._importPublic(l.pub,l.pubEnc)}i(o,"KeyPair2"),a(o,"KeyPair"),t.exports=o,o.fromPublic=a(i(function(l,h,p){return h instanceof o?h:new o(l,{pub:h,pubEnc:p})},"fromPublic2"),"fromPublic"),o.fromPrivate=a(i(function(l,h,p){return h instanceof o?h:new o(l,{priv:h,privEnc:p})},"fromPrivate2"),"fromPrivate"),o.prototype.validate=a(i(function(){var l=this.getPublic();return l.isInfinity()?{result:!1,reason:"Invalid public key"}:l.validate()?l.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate6"),"validate"),o.prototype.getPublic=a(i(function(l,h){return typeof l=="string"&&(h=l,l=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),h?this.pub.encode(h,l):this.pub},"getPublic2"),"getPublic"),o.prototype.getPrivate=a(i(function(l){return l==="hex"?this.priv.toString(16,2):this.priv},"getPrivate2"),"getPrivate"),o.prototype._importPrivate=a(i(function(l,h){this.priv=new r(l,h||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate2"),"_importPrivate"),o.prototype._importPublic=a(i(function(l,h){if(l.x||l.y){this.ec.curve.type==="mont"?s(l.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&s(l.x&&l.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(l.x,l.y);return}this.pub=this.ec.curve.decodePoint(l,h)},"_importPublic2"),"_importPublic"),o.prototype.derive=a(i(function(l){return l.validate()||s(l.validate(),"public point not validated"),l.mul(this.priv).getX()},"derive2"),"derive"),o.prototype.sign=a(i(function(l,h,p){return this.ec.sign(l,this,h,p)},"sign5"),"sign"),o.prototype.verify=a(i(function(l,h){return this.ec.verify(l,h,this)},"verify4"),"verify"),o.prototype.inspect=a(i(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect4"),"inspect")}}),d$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/signature.js"(e,t){"use strict";var r=Sa(),n=qi(),s=n.assert;function o(v,b){if(v instanceof o)return v;this._importDER(v,b)||(s(v.r&&v.s,"Signature without r or s"),this.r=new r(v.r,16),this.s=new r(v.s,16),v.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=v.recoveryParam)}i(o,"Signature2"),a(o,"Signature"),t.exports=o;function c(){this.place=0}i(c,"Position2"),a(c,"Position");function l(v,b){var y=v[b.place++];if(!(y&128))return y;var A=y&15;if(A===0||A>4)return!1;for(var C=0,O=0,R=b.place;O<A;O++,R++)C<<=8,C|=v[R],C>>>=0;return C<=127?!1:(b.place=R,C)}i(l,"getLength2"),a(l,"getLength");function h(v){for(var b=0,y=v.length-1;!v[b]&&!(v[b+1]&128)&&b<y;)b++;return b===0?v:v.slice(b)}i(h,"rmPadding2"),a(h,"rmPadding"),o.prototype._importDER=a(i(function(b,y){b=n.toArray(b,y);var A=new c;if(b[A.place++]!==48)return!1;var C=l(b,A);if(C===!1||C+A.place!==b.length||b[A.place++]!==2)return!1;var O=l(b,A);if(O===!1)return!1;var R=b.slice(A.place,O+A.place);if(A.place+=O,b[A.place++]!==2)return!1;var L=l(b,A);if(L===!1||b.length!==L+A.place)return!1;var K=b.slice(A.place,L+A.place);if(R[0]===0)if(R[1]&128)R=R.slice(1);else return!1;if(K[0]===0)if(K[1]&128)K=K.slice(1);else return!1;return this.r=new r(R),this.s=new r(K),this.recoveryParam=null,!0},"_importDER2"),"_importDER");function p(v,b){if(b<128){v.push(b);return}var y=1+(Math.log(b)/Math.LN2>>>3);for(v.push(y|128);--y;)v.push(b>>>(y<<3)&255);v.push(b)}i(p,"constructLength2"),a(p,"constructLength"),o.prototype.toDER=a(i(function(b){var y=this.r.toArray(),A=this.s.toArray();for(y[0]&128&&(y=[0].concat(y)),A[0]&128&&(A=[0].concat(A)),y=h(y),A=h(A);!A[0]&&!(A[1]&128);)A=A.slice(1);var C=[2];p(C,y.length),C=C.concat(y),C.push(2),p(C,A.length);var O=C.concat(A),R=[48];return p(R,O.length),R=R.concat(O),n.encode(R,b)},"toDER2"),"toDER")}}),h$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/index.js"(e,t){"use strict";var r=Sa(),n=l$(),s=qi(),o=o2(),c=wx(),l=s.assert,h=f$(),p=d$();function v(b){if(!(this instanceof v))return new v(b);typeof b=="string"&&(l(Object.prototype.hasOwnProperty.call(o,b),"Unknown curve "+b),b=o[b]),b instanceof o.PresetCurve&&(b={curve:b}),this.curve=b.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=b.curve.g,this.g.precompute(b.curve.n.bitLength()+1),this.hash=b.hash||b.curve.hash}i(v,"EC2"),a(v,"EC"),t.exports=v,v.prototype.keyPair=a(i(function(y){return new h(this,y)},"keyPair2"),"keyPair"),v.prototype.keyFromPrivate=a(i(function(y,A){return h.fromPrivate(this,y,A)},"keyFromPrivate2"),"keyFromPrivate"),v.prototype.keyFromPublic=a(i(function(y,A){return h.fromPublic(this,y,A)},"keyFromPublic2"),"keyFromPublic"),v.prototype.genKeyPair=a(i(function(y){y||(y={});for(var A=new n({hash:this.hash,pers:y.pers,persEnc:y.persEnc||"utf8",entropy:y.entropy||c(this.hash.hmacStrength),entropyEnc:y.entropy&&y.entropyEnc||"utf8",nonce:this.n.toArray()}),C=this.n.byteLength(),O=this.n.sub(new r(2));;){var R=new r(A.generate(C));if(!(R.cmp(O)>0))return R.iaddn(1),this.keyFromPrivate(R)}},"genKeyPair2"),"genKeyPair"),v.prototype._truncateToN=a(i(function(y,A){var C=y.byteLength()*8-this.n.bitLength();return C>0&&(y=y.ushrn(C)),!A&&y.cmp(this.n)>=0?y.sub(this.n):y},"_truncateToN2"),"_truncateToN"),v.prototype.sign=a(i(function(y,A,C,O){typeof C=="object"&&(O=C,C=null),O||(O={}),A=this.keyFromPrivate(A,C),y=this._truncateToN(new r(y,16));for(var R=this.n.byteLength(),L=A.getPrivate().toArray("be",R),K=y.toArray("be",R),$=new n({hash:this.hash,entropy:L,nonce:K,pers:O.pers,persEnc:O.persEnc||"utf8"}),j=this.n.sub(new r(1)),V=0;;V++){var G=O.k?O.k(V):new r($.generate(this.n.byteLength()));if(G=this._truncateToN(G,!0),!(G.cmpn(1)<=0||G.cmp(j)>=0)){var k=this.g.mul(G);if(!k.isInfinity()){var H=k.getX(),se=H.umod(this.n);if(se.cmpn(0)!==0){var ue=G.invm(this.n).mul(se.mul(A.getPrivate()).iadd(y));if(ue=ue.umod(this.n),ue.cmpn(0)!==0){var me=(k.getY().isOdd()?1:0)|(H.cmp(se)!==0?2:0);return O.canonical&&ue.cmp(this.nh)>0&&(ue=this.n.sub(ue),me^=1),new p({r:se,s:ue,recoveryParam:me})}}}}}},"sign5"),"sign"),v.prototype.verify=a(i(function(y,A,C,O){y=this._truncateToN(new r(y,16)),C=this.keyFromPublic(C,O),A=new p(A,"hex");var R=A.r,L=A.s;if(R.cmpn(1)<0||R.cmp(this.n)>=0||L.cmpn(1)<0||L.cmp(this.n)>=0)return!1;var K=L.invm(this.n),$=K.mul(y).umod(this.n),j=K.mul(R).umod(this.n),V;return this.curve._maxwellTrick?(V=this.g.jmulAdd($,C.getPublic(),j),V.isInfinity()?!1:V.eqXToP(R)):(V=this.g.mulAdd($,C.getPublic(),j),V.isInfinity()?!1:V.getX().umod(this.n).cmp(R)===0)},"verify4"),"verify"),v.prototype.recoverPubKey=function(b,y,A,C){l((3&A)===A,"The recovery param is more than two bits"),y=new p(y,C);var O=this.n,R=new r(b),L=y.r,K=y.s,$=A&1,j=A>>1;if(L.cmp(this.curve.p.umod(this.curve.n))>=0&&j)throw new Error("Unable to find sencond key candinate");j?L=this.curve.pointFromX(L.add(this.curve.n),$):L=this.curve.pointFromX(L,$);var V=y.r.invm(O),G=O.sub(R).mul(V).umod(O),k=K.mul(V).umod(O);return this.g.mulAdd(G,L,k)},v.prototype.getKeyRecoveryParam=function(b,y,A,C){if(y=new p(y,C),y.recoveryParam!==null)return y.recoveryParam;for(var O=0;O<4;O++){var R;try{R=this.recoverPubKey(b,y,O)}catch{continue}if(R.eq(A))return O}throw new Error("Unable to find valid recovery factor")}}}),p$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/key.js"(e,t){"use strict";var r=qi(),n=r.assert,s=r.parseBytes,o=r.cachedProperty;function c(l,h){this.eddsa=l,this._secret=s(h.secret),l.isPoint(h.pub)?this._pub=h.pub:this._pubBytes=s(h.pub)}i(c,"KeyPair2"),a(c,"KeyPair"),c.fromPublic=a(i(function(h,p){return p instanceof c?p:new c(h,{pub:p})},"fromPublic2"),"fromPublic"),c.fromSecret=a(i(function(h,p){return p instanceof c?p:new c(h,{secret:p})},"fromSecret"),"fromSecret"),c.prototype.secret=a(i(function(){return this._secret},"secret"),"secret"),o(c,"pubBytes",a(i(function(){return this.eddsa.encodePoint(this.pub())},"pubBytes"),"pubBytes")),o(c,"pub",a(i(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())},"pub"),"pub")),o(c,"privBytes",a(i(function(){var h=this.eddsa,p=this.hash(),v=h.encodingLength-1,b=p.slice(0,h.encodingLength);return b[0]&=248,b[v]&=127,b[v]|=64,b},"privBytes"),"privBytes")),o(c,"priv",a(i(function(){return this.eddsa.decodeInt(this.privBytes())},"priv"),"priv")),o(c,"hash",a(i(function(){return this.eddsa.hash().update(this.secret()).digest()},"hash3"),"hash")),o(c,"messagePrefix",a(i(function(){return this.hash().slice(this.eddsa.encodingLength)},"messagePrefix2"),"messagePrefix")),c.prototype.sign=a(i(function(h){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},"sign5"),"sign"),c.prototype.verify=a(i(function(h,p){return this.eddsa.verify(h,p,this)},"verify4"),"verify"),c.prototype.getSecret=a(i(function(h){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),h)},"getSecret"),"getSecret"),c.prototype.getPublic=a(i(function(h){return r.encode(this.pubBytes(),h)},"getPublic2"),"getPublic"),t.exports=c}}),m$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/signature.js"(e,t){"use strict";var r=Sa(),n=qi(),s=n.assert,o=n.cachedProperty,c=n.parseBytes;function l(h,p){this.eddsa=h,typeof p!="object"&&(p=c(p)),Array.isArray(p)&&(p={R:p.slice(0,h.encodingLength),S:p.slice(h.encodingLength)}),s(p.R&&p.S,"Signature without R or S"),h.isPoint(p.R)&&(this._R=p.R),p.S instanceof r&&(this._S=p.S),this._Rencoded=Array.isArray(p.R)?p.R:p.Rencoded,this._Sencoded=Array.isArray(p.S)?p.S:p.Sencoded}i(l,"Signature2"),a(l,"Signature"),o(l,"S",a(i(function(){return this.eddsa.decodeInt(this.Sencoded())},"S"),"S")),o(l,"R",a(i(function(){return this.eddsa.decodePoint(this.Rencoded())},"R"),"R")),o(l,"Rencoded",a(i(function(){return this.eddsa.encodePoint(this.R())},"Rencoded"),"Rencoded")),o(l,"Sencoded",a(i(function(){return this.eddsa.encodeInt(this.S())},"Sencoded"),"Sencoded")),l.prototype.toBytes=a(i(function(){return this.Rencoded().concat(this.Sencoded())},"toBytes"),"toBytes"),l.prototype.toHex=a(i(function(){return n.encode(this.toBytes(),"hex").toUpperCase()},"toHex"),"toHex"),t.exports=l}}),v$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/index.js"(e,t){"use strict";var r=pm(),n=o2(),s=qi(),o=s.assert,c=s.parseBytes,l=p$(),h=m$();function p(v){if(o(v==="ed25519","only tested with ed25519 so far"),!(this instanceof p))return new p(v);v=n[v].curve,this.curve=v,this.g=v.g,this.g.precompute(v.n.bitLength()+1),this.pointClass=v.point().constructor,this.encodingLength=Math.ceil(v.n.bitLength()/8),this.hash=r.sha512}i(p,"EDDSA"),a(p,"EDDSA"),t.exports=p,p.prototype.sign=a(i(function(b,y){b=c(b);var A=this.keyFromSecret(y),C=this.hashInt(A.messagePrefix(),b),O=this.g.mul(C),R=this.encodePoint(O),L=this.hashInt(R,A.pubBytes(),b).mul(A.priv()),K=C.add(L).umod(this.curve.n);return this.makeSignature({R:O,S:K,Rencoded:R})},"sign5"),"sign"),p.prototype.verify=a(i(function(b,y,A){b=c(b),y=this.makeSignature(y);var C=this.keyFromPublic(A),O=this.hashInt(y.Rencoded(),C.pubBytes(),b),R=this.g.mul(y.S()),L=y.R().add(C.pub().mul(O));return L.eq(R)},"verify4"),"verify"),p.prototype.hashInt=a(i(function(){for(var b=this.hash(),y=0;y<arguments.length;y++)b.update(arguments[y]);return s.intFromLE(b.digest()).umod(this.curve.n)},"hashInt"),"hashInt"),p.prototype.keyFromPublic=a(i(function(b){return l.fromPublic(this,b)},"keyFromPublic2"),"keyFromPublic"),p.prototype.keyFromSecret=a(i(function(b){return l.fromSecret(this,b)},"keyFromSecret"),"keyFromSecret"),p.prototype.makeSignature=a(i(function(b){return b instanceof h?b:new h(this,b)},"makeSignature"),"makeSignature"),p.prototype.encodePoint=a(i(function(b){var y=b.getY().toArray("le",this.encodingLength);return y[this.encodingLength-1]|=b.getX().isOdd()?128:0,y},"encodePoint"),"encodePoint"),p.prototype.decodePoint=a(i(function(b){b=s.parseBytes(b);var y=b.length-1,A=b.slice(0,y).concat(b[y]&-129),C=(b[y]&128)!==0,O=s.intFromLE(A);return this.curve.pointFromY(O,C)},"decodePoint2"),"decodePoint"),p.prototype.encodeInt=a(i(function(b){return b.toArray("le",this.encodingLength)},"encodeInt"),"encodeInt"),p.prototype.decodeInt=a(i(function(b){return s.intFromLE(b)},"decodeInt"),"decodeInt"),p.prototype.isPoint=a(i(function(b){return b instanceof this.pointClass},"isPoint"),"isPoint")}}),g$=ze({"../../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic.js"(e){"use strict";var t=e;t.version=QU().version,t.utils=qi(),t.rand=wx(),t.curve=Ex(),t.curves=o2(),t.ec=h$(),t.eddsa=v$()}}),y$=ze({"../../../node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/browser.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BrowserRandomSource=void 0;var t=65536,r=i(class{constructor(){this.isAvailable=!1,this.isInstantiated=!1;let n=typeof self<"u"?self.crypto||self.msCrypto:null;n&&n.getRandomValues!==void 0&&(this._crypto=n,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(n){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");let s=new Uint8Array(n);for(let o=0;o<s.length;o+=t)this._crypto.getRandomValues(s.subarray(o,o+Math.min(s.length-o,t)));return s}},"BrowserRandomSource");a(r,"BrowserRandomSource"),e.BrowserRandomSource=r}}),b$=ze({"../../../node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/node.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.NodeRandomSource=void 0;var t=ps(),r=i(class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof tb<"u"){let n=tb("crypto");n&&n.randomBytes&&(this._crypto=n,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(n){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let s=this._crypto.randomBytes(n);if(s.length!==n)throw new Error("NodeRandomSource: got fewer bytes than requested");let o=new Uint8Array(n);for(let c=0;c<o.length;c++)o[c]=s[c];return(0,t.wipe)(s),o}},"NodeRandomSource");a(r,"NodeRandomSource"),e.NodeRandomSource=r}}),_$=ze({"../../../node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/source/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SystemRandomSource=void 0;var t=y$(),r=b$(),n=i(class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new t.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new r.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(s){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(s)}},"SystemRandomSource");a(n,"SystemRandomSource"),e.SystemRandomSource=n}}),Xu=ze({"../../../node_modules/.pnpm/@stablelib+random@1.0.2/node_modules/@stablelib/random/lib/random.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.randomStringForEntropy=e.randomString=e.randomUint32=e.randomBytes=e.defaultRandomSource=void 0;var t=_$(),r=Yu(),n=ps();e.defaultRandomSource=new t.SystemRandomSource;function s(p,v=e.defaultRandomSource){return v.randomBytes(p)}i(s,"randomBytes5"),a(s,"randomBytes"),e.randomBytes=s;function o(p=e.defaultRandomSource){let v=s(4,p),b=(0,r.readUint32LE)(v);return(0,n.wipe)(v),b}i(o,"randomUint32"),a(o,"randomUint32"),e.randomUint32=o;var c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function l(p,v=c,b=e.defaultRandomSource){if(v.length<2)throw new Error("randomString charset is too short");if(v.length>256)throw new Error("randomString charset is too long");let y="",A=v.length,C=256-256%A;for(;p>0;){let O=s(Math.ceil(p*256/C),b);for(let R=0;R<O.length&&p>0;R++){let L=O[R];L<C&&(y+=v.charAt(L%A),p--)}(0,n.wipe)(O)}return y}i(l,"randomString2"),a(l,"randomString"),e.randomString=l;function h(p,v=c,b=e.defaultRandomSource){let y=Math.ceil(p/(Math.log(v.length)/Math.LN2));return l(y,v,b)}i(h,"randomStringForEntropy"),a(h,"randomStringForEntropy"),e.randomStringForEntropy=h}}),w$=ze({"../../../node_modules/.pnpm/@stablelib+sha512@1.0.1/node_modules/@stablelib/sha512/lib/sha512.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Yu(),r=ps();e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var n=function(){function l(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return i(l,"SHA5122"),a(l,"SHA512"),l.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},l.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},l.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},l.prototype.update=function(h,p){if(p===void 0&&(p=h.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var v=0;if(this._bytesHashed+=p,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&p>0;)this._buffer[this._bufferLength++]=h[v++],p--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(p>=this.blockSize&&(v=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,h,v,p),p%=this.blockSize);p>0;)this._buffer[this._bufferLength++]=h[v++],p--;return this},l.prototype.finish=function(h){if(!this._finished){var p=this._bytesHashed,v=this._bufferLength,b=p/536870912|0,y=p<<3,A=p%128<112?128:256;this._buffer[v]=128;for(var C=v+1;C<A-8;C++)this._buffer[C]=0;t.writeUint32BE(b,this._buffer,A-8),t.writeUint32BE(y,this._buffer,A-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,A),this._finished=!0}for(var C=0;C<this.digestLength/8;C++)t.writeUint32BE(this._stateHi[C],h,C*8),t.writeUint32BE(this._stateLo[C],h,C*8+4);return this},l.prototype.digest=function(){var h=new Uint8Array(this.digestLength);return this.finish(h),h},l.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},l.prototype.restoreState=function(h){return this._stateHi.set(h.stateHi),this._stateLo.set(h.stateLo),this._bufferLength=h.bufferLength,h.buffer&&this._buffer.set(h.buffer),this._bytesHashed=h.bytesHashed,this._finished=!1,this},l.prototype.cleanSavedState=function(h){r.wipe(h.stateHi),r.wipe(h.stateLo),h.buffer&&r.wipe(h.buffer),h.bufferLength=0,h.bytesHashed=0},l}();e.SHA512=n;var s=new Int32Array([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 o(l,h,p,v,b,y,A){for(var C=p[0],O=p[1],R=p[2],L=p[3],K=p[4],$=p[5],j=p[6],V=p[7],G=v[0],k=v[1],H=v[2],se=v[3],ue=v[4],me=v[5],q=v[6],E=v[7],T,m,d,g,_,M,S,w;A>=128;){for(var N=0;N<16;N++){var B=8*N+y;l[N]=t.readUint32BE(b,B),h[N]=t.readUint32BE(b,B+4)}for(var N=0;N<80;N++){var D=C,F=O,le=R,P=L,Y=K,J=$,I=j,z=V,te=G,ae=k,ve=H,De=se,we=ue,de=me,Ce=q,pe=E;if(T=V,m=E,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=(K>>>14|ue<<32-14)^(K>>>18|ue<<32-18)^(ue>>>41-32|K<<32-(41-32)),m=(ue>>>14|K<<32-14)^(ue>>>18|K<<32-18)^(K>>>41-32|ue<<32-(41-32)),_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,T=K&$^~K&j,m=ue&me^~ue&q,_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,T=s[N*2],m=s[N*2+1],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,T=l[N%16],m=h[N%16],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,d=S&65535|w<<16,g=_&65535|M<<16,T=d,m=g,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=(C>>>28|G<<32-28)^(G>>>34-32|C<<32-(34-32))^(G>>>39-32|C<<32-(39-32)),m=(G>>>28|C<<32-28)^(C>>>34-32|G<<32-(34-32))^(C>>>39-32|G<<32-(39-32)),_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,T=C&O^C&R^O&R,m=G&k^G&H^k&H,_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,z=S&65535|w<<16,pe=_&65535|M<<16,T=P,m=De,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=d,m=g,_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,P=S&65535|w<<16,De=_&65535|M<<16,O=D,R=F,L=le,K=P,$=Y,j=J,V=I,C=z,k=te,H=ae,se=ve,ue=De,me=we,q=de,E=Ce,G=pe,N%16===15)for(var B=0;B<16;B++)T=l[B],m=h[B],_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=l[(B+9)%16],m=h[(B+9)%16],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,d=l[(B+1)%16],g=h[(B+1)%16],T=(d>>>1|g<<32-1)^(d>>>8|g<<32-8)^d>>>7,m=(g>>>1|d<<32-1)^(g>>>8|d<<32-8)^(g>>>7|d<<32-7),_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,d=l[(B+14)%16],g=h[(B+14)%16],T=(d>>>19|g<<32-19)^(g>>>61-32|d<<32-(61-32))^d>>>6,m=(g>>>19|d<<32-19)^(d>>>61-32|g<<32-(61-32))^(g>>>6|d<<32-6),_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,l[B]=S&65535|w<<16,h[B]=_&65535|M<<16}T=C,m=G,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[0],m=v[0],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[0]=C=S&65535|w<<16,v[0]=G=_&65535|M<<16,T=O,m=k,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[1],m=v[1],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[1]=O=S&65535|w<<16,v[1]=k=_&65535|M<<16,T=R,m=H,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[2],m=v[2],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[2]=R=S&65535|w<<16,v[2]=H=_&65535|M<<16,T=L,m=se,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[3],m=v[3],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[3]=L=S&65535|w<<16,v[3]=se=_&65535|M<<16,T=K,m=ue,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[4],m=v[4],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[4]=K=S&65535|w<<16,v[4]=ue=_&65535|M<<16,T=$,m=me,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[5],m=v[5],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[5]=$=S&65535|w<<16,v[5]=me=_&65535|M<<16,T=j,m=q,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[6],m=v[6],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[6]=j=S&65535|w<<16,v[6]=q=_&65535|M<<16,T=V,m=E,_=m&65535,M=m>>>16,S=T&65535,w=T>>>16,T=p[7],m=v[7],_+=m&65535,M+=m>>>16,S+=T&65535,w+=T>>>16,M+=_>>>16,S+=M>>>16,w+=S>>>16,p[7]=V=S&65535|w<<16,v[7]=E=_&65535|M<<16,y+=128,A-=128}return y}i(o,"hashBlocks"),a(o,"hashBlocks");function c(l){var h=new n;h.update(l);var p=h.digest();return h.clean(),p}i(c,"hash3"),a(c,"hash"),e.hash=c}}),c2=ze({"../../../node_modules/.pnpm/@stablelib+ed25519@1.0.3/node_modules/@stablelib/ed25519/lib/ed25519.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.convertSecretKeyToX25519=e.convertPublicKeyToX25519=e.verify=e.sign=e.extractPublicKeyFromSecretKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.SEED_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=e.SIGNATURE_LENGTH=void 0;var t=Xu(),r=w$(),n=ps();e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32;function s(P){let Y=new Float64Array(16);if(P)for(let J=0;J<P.length;J++)Y[J]=P[J];return Y}i(s,"gf"),a(s,"gf");var o=new Uint8Array(32);o[0]=9;var c=s(),l=s([1]),h=s([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),p=s([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),v=s([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),b=s([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),y=s([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function A(P,Y){for(let J=0;J<16;J++)P[J]=Y[J]|0}i(A,"set25519"),a(A,"set25519");function C(P){let Y=1;for(let J=0;J<16;J++){let I=P[J]+Y+65535;Y=Math.floor(I/65536),P[J]=I-Y*65536}P[0]+=Y-1+37*(Y-1)}i(C,"car25519"),a(C,"car25519");function O(P,Y,J){let I=~(J-1);for(let z=0;z<16;z++){let te=I&(P[z]^Y[z]);P[z]^=te,Y[z]^=te}}i(O,"sel25519"),a(O,"sel25519");function R(P,Y){let J=s(),I=s();for(let z=0;z<16;z++)I[z]=Y[z];C(I),C(I),C(I);for(let z=0;z<2;z++){J[0]=I[0]-65517;for(let ae=1;ae<15;ae++)J[ae]=I[ae]-65535-(J[ae-1]>>16&1),J[ae-1]&=65535;J[15]=I[15]-32767-(J[14]>>16&1);let te=J[15]>>16&1;J[14]&=65535,O(I,J,1-te)}for(let z=0;z<16;z++)P[2*z]=I[z]&255,P[2*z+1]=I[z]>>8}i(R,"pack25519"),a(R,"pack25519");function L(P,Y){let J=0;for(let I=0;I<32;I++)J|=P[I]^Y[I];return(1&J-1>>>8)-1}i(L,"verify32"),a(L,"verify32");function K(P,Y){let J=new Uint8Array(32),I=new Uint8Array(32);return R(J,P),R(I,Y),L(J,I)}i(K,"neq25519"),a(K,"neq25519");function $(P){let Y=new Uint8Array(32);return R(Y,P),Y[0]&1}i($,"par25519"),a($,"par25519");function j(P,Y){for(let J=0;J<16;J++)P[J]=Y[2*J]+(Y[2*J+1]<<8);P[15]&=32767}i(j,"unpack25519"),a(j,"unpack25519");function V(P,Y,J){for(let I=0;I<16;I++)P[I]=Y[I]+J[I]}i(V,"add3"),a(V,"add");function G(P,Y,J){for(let I=0;I<16;I++)P[I]=Y[I]-J[I]}i(G,"sub"),a(G,"sub");function k(P,Y,J){let I,z,te=0,ae=0,ve=0,De=0,we=0,de=0,Ce=0,pe=0,_e=0,Q=0,ge=0,Me=0,Ue=0,Re=0,je=0,rt=0,fe=0,ce=0,Z=0,re=0,ye=0,Se=0,xe=0,ke=0,Mt=0,qe=0,He=0,Ot=0,dt=0,vt=0,kr=0,ct=J[0],ut=J[1],cr=J[2],lt=J[3],nt=J[4],ir=J[5],it=J[6],Ye=J[7],Qt=J[8],st=J[9],Qe=J[10],sr=J[11],at=J[12],Ze=J[13],ar=J[14],ot=J[15];I=Y[0],te+=I*ct,ae+=I*ut,ve+=I*cr,De+=I*lt,we+=I*nt,de+=I*ir,Ce+=I*it,pe+=I*Ye,_e+=I*Qt,Q+=I*st,ge+=I*Qe,Me+=I*sr,Ue+=I*at,Re+=I*Ze,je+=I*ar,rt+=I*ot,I=Y[1],ae+=I*ct,ve+=I*ut,De+=I*cr,we+=I*lt,de+=I*nt,Ce+=I*ir,pe+=I*it,_e+=I*Ye,Q+=I*Qt,ge+=I*st,Me+=I*Qe,Ue+=I*sr,Re+=I*at,je+=I*Ze,rt+=I*ar,fe+=I*ot,I=Y[2],ve+=I*ct,De+=I*ut,we+=I*cr,de+=I*lt,Ce+=I*nt,pe+=I*ir,_e+=I*it,Q+=I*Ye,ge+=I*Qt,Me+=I*st,Ue+=I*Qe,Re+=I*sr,je+=I*at,rt+=I*Ze,fe+=I*ar,ce+=I*ot,I=Y[3],De+=I*ct,we+=I*ut,de+=I*cr,Ce+=I*lt,pe+=I*nt,_e+=I*ir,Q+=I*it,ge+=I*Ye,Me+=I*Qt,Ue+=I*st,Re+=I*Qe,je+=I*sr,rt+=I*at,fe+=I*Ze,ce+=I*ar,Z+=I*ot,I=Y[4],we+=I*ct,de+=I*ut,Ce+=I*cr,pe+=I*lt,_e+=I*nt,Q+=I*ir,ge+=I*it,Me+=I*Ye,Ue+=I*Qt,Re+=I*st,je+=I*Qe,rt+=I*sr,fe+=I*at,ce+=I*Ze,Z+=I*ar,re+=I*ot,I=Y[5],de+=I*ct,Ce+=I*ut,pe+=I*cr,_e+=I*lt,Q+=I*nt,ge+=I*ir,Me+=I*it,Ue+=I*Ye,Re+=I*Qt,je+=I*st,rt+=I*Qe,fe+=I*sr,ce+=I*at,Z+=I*Ze,re+=I*ar,ye+=I*ot,I=Y[6],Ce+=I*ct,pe+=I*ut,_e+=I*cr,Q+=I*lt,ge+=I*nt,Me+=I*ir,Ue+=I*it,Re+=I*Ye,je+=I*Qt,rt+=I*st,fe+=I*Qe,ce+=I*sr,Z+=I*at,re+=I*Ze,ye+=I*ar,Se+=I*ot,I=Y[7],pe+=I*ct,_e+=I*ut,Q+=I*cr,ge+=I*lt,Me+=I*nt,Ue+=I*ir,Re+=I*it,je+=I*Ye,rt+=I*Qt,fe+=I*st,ce+=I*Qe,Z+=I*sr,re+=I*at,ye+=I*Ze,Se+=I*ar,xe+=I*ot,I=Y[8],_e+=I*ct,Q+=I*ut,ge+=I*cr,Me+=I*lt,Ue+=I*nt,Re+=I*ir,je+=I*it,rt+=I*Ye,fe+=I*Qt,ce+=I*st,Z+=I*Qe,re+=I*sr,ye+=I*at,Se+=I*Ze,xe+=I*ar,ke+=I*ot,I=Y[9],Q+=I*ct,ge+=I*ut,Me+=I*cr,Ue+=I*lt,Re+=I*nt,je+=I*ir,rt+=I*it,fe+=I*Ye,ce+=I*Qt,Z+=I*st,re+=I*Qe,ye+=I*sr,Se+=I*at,xe+=I*Ze,ke+=I*ar,Mt+=I*ot,I=Y[10],ge+=I*ct,Me+=I*ut,Ue+=I*cr,Re+=I*lt,je+=I*nt,rt+=I*ir,fe+=I*it,ce+=I*Ye,Z+=I*Qt,re+=I*st,ye+=I*Qe,Se+=I*sr,xe+=I*at,ke+=I*Ze,Mt+=I*ar,qe+=I*ot,I=Y[11],Me+=I*ct,Ue+=I*ut,Re+=I*cr,je+=I*lt,rt+=I*nt,fe+=I*ir,ce+=I*it,Z+=I*Ye,re+=I*Qt,ye+=I*st,Se+=I*Qe,xe+=I*sr,ke+=I*at,Mt+=I*Ze,qe+=I*ar,He+=I*ot,I=Y[12],Ue+=I*ct,Re+=I*ut,je+=I*cr,rt+=I*lt,fe+=I*nt,ce+=I*ir,Z+=I*it,re+=I*Ye,ye+=I*Qt,Se+=I*st,xe+=I*Qe,ke+=I*sr,Mt+=I*at,qe+=I*Ze,He+=I*ar,Ot+=I*ot,I=Y[13],Re+=I*ct,je+=I*ut,rt+=I*cr,fe+=I*lt,ce+=I*nt,Z+=I*ir,re+=I*it,ye+=I*Ye,Se+=I*Qt,xe+=I*st,ke+=I*Qe,Mt+=I*sr,qe+=I*at,He+=I*Ze,Ot+=I*ar,dt+=I*ot,I=Y[14],je+=I*ct,rt+=I*ut,fe+=I*cr,ce+=I*lt,Z+=I*nt,re+=I*ir,ye+=I*it,Se+=I*Ye,xe+=I*Qt,ke+=I*st,Mt+=I*Qe,qe+=I*sr,He+=I*at,Ot+=I*Ze,dt+=I*ar,vt+=I*ot,I=Y[15],rt+=I*ct,fe+=I*ut,ce+=I*cr,Z+=I*lt,re+=I*nt,ye+=I*ir,Se+=I*it,xe+=I*Ye,ke+=I*Qt,Mt+=I*st,qe+=I*Qe,He+=I*sr,Ot+=I*at,dt+=I*Ze,vt+=I*ar,kr+=I*ot,te+=38*fe,ae+=38*ce,ve+=38*Z,De+=38*re,we+=38*ye,de+=38*Se,Ce+=38*xe,pe+=38*ke,_e+=38*Mt,Q+=38*qe,ge+=38*He,Me+=38*Ot,Ue+=38*dt,Re+=38*vt,je+=38*kr,z=1,I=te+z+65535,z=Math.floor(I/65536),te=I-z*65536,I=ae+z+65535,z=Math.floor(I/65536),ae=I-z*65536,I=ve+z+65535,z=Math.floor(I/65536),ve=I-z*65536,I=De+z+65535,z=Math.floor(I/65536),De=I-z*65536,I=we+z+65535,z=Math.floor(I/65536),we=I-z*65536,I=de+z+65535,z=Math.floor(I/65536),de=I-z*65536,I=Ce+z+65535,z=Math.floor(I/65536),Ce=I-z*65536,I=pe+z+65535,z=Math.floor(I/65536),pe=I-z*65536,I=_e+z+65535,z=Math.floor(I/65536),_e=I-z*65536,I=Q+z+65535,z=Math.floor(I/65536),Q=I-z*65536,I=ge+z+65535,z=Math.floor(I/65536),ge=I-z*65536,I=Me+z+65535,z=Math.floor(I/65536),Me=I-z*65536,I=Ue+z+65535,z=Math.floor(I/65536),Ue=I-z*65536,I=Re+z+65535,z=Math.floor(I/65536),Re=I-z*65536,I=je+z+65535,z=Math.floor(I/65536),je=I-z*65536,I=rt+z+65535,z=Math.floor(I/65536),rt=I-z*65536,te+=z-1+37*(z-1),z=1,I=te+z+65535,z=Math.floor(I/65536),te=I-z*65536,I=ae+z+65535,z=Math.floor(I/65536),ae=I-z*65536,I=ve+z+65535,z=Math.floor(I/65536),ve=I-z*65536,I=De+z+65535,z=Math.floor(I/65536),De=I-z*65536,I=we+z+65535,z=Math.floor(I/65536),we=I-z*65536,I=de+z+65535,z=Math.floor(I/65536),de=I-z*65536,I=Ce+z+65535,z=Math.floor(I/65536),Ce=I-z*65536,I=pe+z+65535,z=Math.floor(I/65536),pe=I-z*65536,I=_e+z+65535,z=Math.floor(I/65536),_e=I-z*65536,I=Q+z+65535,z=Math.floor(I/65536),Q=I-z*65536,I=ge+z+65535,z=Math.floor(I/65536),ge=I-z*65536,I=Me+z+65535,z=Math.floor(I/65536),Me=I-z*65536,I=Ue+z+65535,z=Math.floor(I/65536),Ue=I-z*65536,I=Re+z+65535,z=Math.floor(I/65536),Re=I-z*65536,I=je+z+65535,z=Math.floor(I/65536),je=I-z*65536,I=rt+z+65535,z=Math.floor(I/65536),rt=I-z*65536,te+=z-1+37*(z-1),P[0]=te,P[1]=ae,P[2]=ve,P[3]=De,P[4]=we,P[5]=de,P[6]=Ce,P[7]=pe,P[8]=_e,P[9]=Q,P[10]=ge,P[11]=Me,P[12]=Ue,P[13]=Re,P[14]=je,P[15]=rt}i(k,"mul3"),a(k,"mul");function H(P,Y){k(P,Y,Y)}i(H,"square"),a(H,"square");function se(P,Y){let J=s(),I;for(I=0;I<16;I++)J[I]=Y[I];for(I=253;I>=0;I--)H(J,J),I!==2&&I!==4&&k(J,J,Y);for(I=0;I<16;I++)P[I]=J[I]}i(se,"inv25519"),a(se,"inv25519");function ue(P,Y){let J=s(),I;for(I=0;I<16;I++)J[I]=Y[I];for(I=250;I>=0;I--)H(J,J),I!==1&&k(J,J,Y);for(I=0;I<16;I++)P[I]=J[I]}i(ue,"pow2523"),a(ue,"pow2523");function me(P,Y){let J=s(),I=s(),z=s(),te=s(),ae=s(),ve=s(),De=s(),we=s(),de=s();G(J,P[1],P[0]),G(de,Y[1],Y[0]),k(J,J,de),V(I,P[0],P[1]),V(de,Y[0],Y[1]),k(I,I,de),k(z,P[3],Y[3]),k(z,z,p),k(te,P[2],Y[2]),V(te,te,te),G(ae,I,J),G(ve,te,z),V(De,te,z),V(we,I,J),k(P[0],ae,ve),k(P[1],we,De),k(P[2],De,ve),k(P[3],ae,we)}i(me,"edadd"),a(me,"edadd");function q(P,Y,J){for(let I=0;I<4;I++)O(P[I],Y[I],J)}i(q,"cswap"),a(q,"cswap");function E(P,Y){let J=s(),I=s(),z=s();se(z,Y[2]),k(J,Y[0],z),k(I,Y[1],z),R(P,I),P[31]^=$(J)<<7}i(E,"pack"),a(E,"pack");function T(P,Y,J){A(P[0],c),A(P[1],l),A(P[2],l),A(P[3],c);for(let I=255;I>=0;--I){let z=J[I/8|0]>>(I&7)&1;q(P,Y,z),me(Y,P),me(P,P),q(P,Y,z)}}i(T,"scalarmult"),a(T,"scalarmult");function m(P,Y){let J=[s(),s(),s(),s()];A(J[0],v),A(J[1],b),A(J[2],l),k(J[3],v,b),T(P,J,Y)}i(m,"scalarbase"),a(m,"scalarbase");function d(P){if(P.length!==e.SEED_LENGTH)throw new Error(`ed25519: seed must be ${e.SEED_LENGTH} bytes`);let Y=(0,r.hash)(P);Y[0]&=248,Y[31]&=127,Y[31]|=64;let J=new Uint8Array(32),I=[s(),s(),s(),s()];m(I,Y),E(J,I);let z=new Uint8Array(64);return z.set(P),z.set(J,32),{publicKey:J,secretKey:z}}i(d,"generateKeyPairFromSeed2"),a(d,"generateKeyPairFromSeed"),e.generateKeyPairFromSeed=d;function g(P){let Y=(0,t.randomBytes)(32,P),J=d(Y);return(0,n.wipe)(Y),J}i(g,"generateKeyPair2"),a(g,"generateKeyPair"),e.generateKeyPair=g;function _(P){if(P.length!==e.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${e.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(P.subarray(32))}i(_,"extractPublicKeyFromSecretKey"),a(_,"extractPublicKeyFromSecretKey"),e.extractPublicKeyFromSecretKey=_;var M=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function S(P,Y){let J,I,z,te;for(I=63;I>=32;--I){for(J=0,z=I-32,te=I-12;z<te;++z)Y[z]+=J-16*Y[I]*M[z-(I-32)],J=Math.floor((Y[z]+128)/256),Y[z]-=J*256;Y[z]+=J,Y[I]=0}for(J=0,z=0;z<32;z++)Y[z]+=J-(Y[31]>>4)*M[z],J=Y[z]>>8,Y[z]&=255;for(z=0;z<32;z++)Y[z]-=J*M[z];for(I=0;I<32;I++)Y[I+1]+=Y[I]>>8,P[I]=Y[I]&255}i(S,"modL"),a(S,"modL");function w(P){let Y=new Float64Array(64);for(let J=0;J<64;J++)Y[J]=P[J];for(let J=0;J<64;J++)P[J]=0;S(P,Y)}i(w,"reduce"),a(w,"reduce");function N(P,Y){let J=new Float64Array(64),I=[s(),s(),s(),s()],z=(0,r.hash)(P.subarray(0,32));z[0]&=248,z[31]&=127,z[31]|=64;let te=new Uint8Array(64);te.set(z.subarray(32),32);let ae=new r.SHA512;ae.update(te.subarray(32)),ae.update(Y);let ve=ae.digest();ae.clean(),w(ve),m(I,ve),E(te,I),ae.reset(),ae.update(te.subarray(0,32)),ae.update(P.subarray(32)),ae.update(Y);let De=ae.digest();w(De);for(let we=0;we<32;we++)J[we]=ve[we];for(let we=0;we<32;we++)for(let de=0;de<32;de++)J[we+de]+=De[we]*z[de];return S(te.subarray(32),J),te}i(N,"sign5"),a(N,"sign"),e.sign=N;function B(P,Y){let J=s(),I=s(),z=s(),te=s(),ae=s(),ve=s(),De=s();return A(P[2],l),j(P[1],Y),H(z,P[1]),k(te,z,h),G(z,z,P[2]),V(te,P[2],te),H(ae,te),H(ve,ae),k(De,ve,ae),k(J,De,z),k(J,J,te),ue(J,J),k(J,J,z),k(J,J,te),k(J,J,te),k(P[0],J,te),H(I,P[0]),k(I,I,te),K(I,z)&&k(P[0],P[0],y),H(I,P[0]),k(I,I,te),K(I,z)?-1:($(P[0])===Y[31]>>7&&G(P[0],c,P[0]),k(P[3],P[0],P[1]),0)}i(B,"unpackneg"),a(B,"unpackneg");function D(P,Y,J){let I=new Uint8Array(32),z=[s(),s(),s(),s()],te=[s(),s(),s(),s()];if(J.length!==e.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${e.SIGNATURE_LENGTH} bytes`);if(B(te,P))return!1;let ae=new r.SHA512;ae.update(J.subarray(0,32)),ae.update(P),ae.update(Y);let ve=ae.digest();return w(ve),T(z,te,ve),m(te,J.subarray(32)),me(z,te),E(I,z),!L(J,I)}i(D,"verify4"),a(D,"verify"),e.verify=D;function F(P){let Y=[s(),s(),s(),s()];if(B(Y,P))throw new Error("Ed25519: invalid public key");let J=s(),I=s(),z=Y[1];V(J,l,z),G(I,l,z),se(I,I),k(J,J,I);let te=new Uint8Array(32);return R(te,J),te}i(F,"convertPublicKeyToX255192"),a(F,"convertPublicKeyToX25519"),e.convertPublicKeyToX25519=F;function le(P){let Y=(0,r.hash)(P.subarray(0,32));Y[0]&=248,Y[31]&=127,Y[31]|=64;let J=new Uint8Array(Y.subarray(0,32));return(0,n.wipe)(Y),J}i(le,"convertSecretKeyToX255192"),a(le,"convertSecretKeyToX25519"),e.convertSecretKeyToX25519=le}}),E$=ze({"../../../node_modules/.pnpm/canonicalize@1.0.8/node_modules/canonicalize/lib/canonicalize.js"(e,t){"use strict";t.exports=a(i(function r(n){return n===null||typeof n!="object"||n.toJSON!=null?JSON.stringify(n):Array.isArray(n)?"["+n.reduce((s,o,c)=>{let l=c===0?"":",",h=o===void 0||typeof o=="symbol"?null:o;return s+l+r(h)},"")+"]":"{"+Object.keys(n).sort().reduce((s,o,c)=>{if(n[o]===void 0||typeof n[o]=="symbol")return s;let l=s.length===0?"":",";return s+l+r(o)+":"+r(n[o])},"")+"}"},"serialize2"),"serialize")}}),A$=ze({"../../../node_modules/.pnpm/@stablelib+x25519@1.0.3/node_modules/@stablelib/x25519/lib/x25519.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sharedKey=e.generateKeyPair=e.generateKeyPairFromSeed=e.scalarMultBase=e.scalarMult=e.SHARED_KEY_LENGTH=e.SECRET_KEY_LENGTH=e.PUBLIC_KEY_LENGTH=void 0;var t=Xu(),r=ps();e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32;function n(j){let V=new Float64Array(16);if(j)for(let G=0;G<j.length;G++)V[G]=j[G];return V}i(n,"gf"),a(n,"gf");var s=new Uint8Array(32);s[0]=9;var o=n([56129,1]);function c(j){let V=1;for(let G=0;G<16;G++){let k=j[G]+V+65535;V=Math.floor(k/65536),j[G]=k-V*65536}j[0]+=V-1+37*(V-1)}i(c,"car25519"),a(c,"car25519");function l(j,V,G){let k=~(G-1);for(let H=0;H<16;H++){let se=k&(j[H]^V[H]);j[H]^=se,V[H]^=se}}i(l,"sel25519"),a(l,"sel25519");function h(j,V){let G=n(),k=n();for(let H=0;H<16;H++)k[H]=V[H];c(k),c(k),c(k);for(let H=0;H<2;H++){G[0]=k[0]-65517;for(let ue=1;ue<15;ue++)G[ue]=k[ue]-65535-(G[ue-1]>>16&1),G[ue-1]&=65535;G[15]=k[15]-32767-(G[14]>>16&1);let se=G[15]>>16&1;G[14]&=65535,l(k,G,1-se)}for(let H=0;H<16;H++)j[2*H]=k[H]&255,j[2*H+1]=k[H]>>8}i(h,"pack25519"),a(h,"pack25519");function p(j,V){for(let G=0;G<16;G++)j[G]=V[2*G]+(V[2*G+1]<<8);j[15]&=32767}i(p,"unpack25519"),a(p,"unpack25519");function v(j,V,G){for(let k=0;k<16;k++)j[k]=V[k]+G[k]}i(v,"add3"),a(v,"add");function b(j,V,G){for(let k=0;k<16;k++)j[k]=V[k]-G[k]}i(b,"sub"),a(b,"sub");function y(j,V,G){let k,H,se=0,ue=0,me=0,q=0,E=0,T=0,m=0,d=0,g=0,_=0,M=0,S=0,w=0,N=0,B=0,D=0,F=0,le=0,P=0,Y=0,J=0,I=0,z=0,te=0,ae=0,ve=0,De=0,we=0,de=0,Ce=0,pe=0,_e=G[0],Q=G[1],ge=G[2],Me=G[3],Ue=G[4],Re=G[5],je=G[6],rt=G[7],fe=G[8],ce=G[9],Z=G[10],re=G[11],ye=G[12],Se=G[13],xe=G[14],ke=G[15];k=V[0],se+=k*_e,ue+=k*Q,me+=k*ge,q+=k*Me,E+=k*Ue,T+=k*Re,m+=k*je,d+=k*rt,g+=k*fe,_+=k*ce,M+=k*Z,S+=k*re,w+=k*ye,N+=k*Se,B+=k*xe,D+=k*ke,k=V[1],ue+=k*_e,me+=k*Q,q+=k*ge,E+=k*Me,T+=k*Ue,m+=k*Re,d+=k*je,g+=k*rt,_+=k*fe,M+=k*ce,S+=k*Z,w+=k*re,N+=k*ye,B+=k*Se,D+=k*xe,F+=k*ke,k=V[2],me+=k*_e,q+=k*Q,E+=k*ge,T+=k*Me,m+=k*Ue,d+=k*Re,g+=k*je,_+=k*rt,M+=k*fe,S+=k*ce,w+=k*Z,N+=k*re,B+=k*ye,D+=k*Se,F+=k*xe,le+=k*ke,k=V[3],q+=k*_e,E+=k*Q,T+=k*ge,m+=k*Me,d+=k*Ue,g+=k*Re,_+=k*je,M+=k*rt,S+=k*fe,w+=k*ce,N+=k*Z,B+=k*re,D+=k*ye,F+=k*Se,le+=k*xe,P+=k*ke,k=V[4],E+=k*_e,T+=k*Q,m+=k*ge,d+=k*Me,g+=k*Ue,_+=k*Re,M+=k*je,S+=k*rt,w+=k*fe,N+=k*ce,B+=k*Z,D+=k*re,F+=k*ye,le+=k*Se,P+=k*xe,Y+=k*ke,k=V[5],T+=k*_e,m+=k*Q,d+=k*ge,g+=k*Me,_+=k*Ue,M+=k*Re,S+=k*je,w+=k*rt,N+=k*fe,B+=k*ce,D+=k*Z,F+=k*re,le+=k*ye,P+=k*Se,Y+=k*xe,J+=k*ke,k=V[6],m+=k*_e,d+=k*Q,g+=k*ge,_+=k*Me,M+=k*Ue,S+=k*Re,w+=k*je,N+=k*rt,B+=k*fe,D+=k*ce,F+=k*Z,le+=k*re,P+=k*ye,Y+=k*Se,J+=k*xe,I+=k*ke,k=V[7],d+=k*_e,g+=k*Q,_+=k*ge,M+=k*Me,S+=k*Ue,w+=k*Re,N+=k*je,B+=k*rt,D+=k*fe,F+=k*ce,le+=k*Z,P+=k*re,Y+=k*ye,J+=k*Se,I+=k*xe,z+=k*ke,k=V[8],g+=k*_e,_+=k*Q,M+=k*ge,S+=k*Me,w+=k*Ue,N+=k*Re,B+=k*je,D+=k*rt,F+=k*fe,le+=k*ce,P+=k*Z,Y+=k*re,J+=k*ye,I+=k*Se,z+=k*xe,te+=k*ke,k=V[9],_+=k*_e,M+=k*Q,S+=k*ge,w+=k*Me,N+=k*Ue,B+=k*Re,D+=k*je,F+=k*rt,le+=k*fe,P+=k*ce,Y+=k*Z,J+=k*re,I+=k*ye,z+=k*Se,te+=k*xe,ae+=k*ke,k=V[10],M+=k*_e,S+=k*Q,w+=k*ge,N+=k*Me,B+=k*Ue,D+=k*Re,F+=k*je,le+=k*rt,P+=k*fe,Y+=k*ce,J+=k*Z,I+=k*re,z+=k*ye,te+=k*Se,ae+=k*xe,ve+=k*ke,k=V[11],S+=k*_e,w+=k*Q,N+=k*ge,B+=k*Me,D+=k*Ue,F+=k*Re,le+=k*je,P+=k*rt,Y+=k*fe,J+=k*ce,I+=k*Z,z+=k*re,te+=k*ye,ae+=k*Se,ve+=k*xe,De+=k*ke,k=V[12],w+=k*_e,N+=k*Q,B+=k*ge,D+=k*Me,F+=k*Ue,le+=k*Re,P+=k*je,Y+=k*rt,J+=k*fe,I+=k*ce,z+=k*Z,te+=k*re,ae+=k*ye,ve+=k*Se,De+=k*xe,we+=k*ke,k=V[13],N+=k*_e,B+=k*Q,D+=k*ge,F+=k*Me,le+=k*Ue,P+=k*Re,Y+=k*je,J+=k*rt,I+=k*fe,z+=k*ce,te+=k*Z,ae+=k*re,ve+=k*ye,De+=k*Se,we+=k*xe,de+=k*ke,k=V[14],B+=k*_e,D+=k*Q,F+=k*ge,le+=k*Me,P+=k*Ue,Y+=k*Re,J+=k*je,I+=k*rt,z+=k*fe,te+=k*ce,ae+=k*Z,ve+=k*re,De+=k*ye,we+=k*Se,de+=k*xe,Ce+=k*ke,k=V[15],D+=k*_e,F+=k*Q,le+=k*ge,P+=k*Me,Y+=k*Ue,J+=k*Re,I+=k*je,z+=k*rt,te+=k*fe,ae+=k*ce,ve+=k*Z,De+=k*re,we+=k*ye,de+=k*Se,Ce+=k*xe,pe+=k*ke,se+=38*F,ue+=38*le,me+=38*P,q+=38*Y,E+=38*J,T+=38*I,m+=38*z,d+=38*te,g+=38*ae,_+=38*ve,M+=38*De,S+=38*we,w+=38*de,N+=38*Ce,B+=38*pe,H=1,k=se+H+65535,H=Math.floor(k/65536),se=k-H*65536,k=ue+H+65535,H=Math.floor(k/65536),ue=k-H*65536,k=me+H+65535,H=Math.floor(k/65536),me=k-H*65536,k=q+H+65535,H=Math.floor(k/65536),q=k-H*65536,k=E+H+65535,H=Math.floor(k/65536),E=k-H*65536,k=T+H+65535,H=Math.floor(k/65536),T=k-H*65536,k=m+H+65535,H=Math.floor(k/65536),m=k-H*65536,k=d+H+65535,H=Math.floor(k/65536),d=k-H*65536,k=g+H+65535,H=Math.floor(k/65536),g=k-H*65536,k=_+H+65535,H=Math.floor(k/65536),_=k-H*65536,k=M+H+65535,H=Math.floor(k/65536),M=k-H*65536,k=S+H+65535,H=Math.floor(k/65536),S=k-H*65536,k=w+H+65535,H=Math.floor(k/65536),w=k-H*65536,k=N+H+65535,H=Math.floor(k/65536),N=k-H*65536,k=B+H+65535,H=Math.floor(k/65536),B=k-H*65536,k=D+H+65535,H=Math.floor(k/65536),D=k-H*65536,se+=H-1+37*(H-1),H=1,k=se+H+65535,H=Math.floor(k/65536),se=k-H*65536,k=ue+H+65535,H=Math.floor(k/65536),ue=k-H*65536,k=me+H+65535,H=Math.floor(k/65536),me=k-H*65536,k=q+H+65535,H=Math.floor(k/65536),q=k-H*65536,k=E+H+65535,H=Math.floor(k/65536),E=k-H*65536,k=T+H+65535,H=Math.floor(k/65536),T=k-H*65536,k=m+H+65535,H=Math.floor(k/65536),m=k-H*65536,k=d+H+65535,H=Math.floor(k/65536),d=k-H*65536,k=g+H+65535,H=Math.floor(k/65536),g=k-H*65536,k=_+H+65535,H=Math.floor(k/65536),_=k-H*65536,k=M+H+65535,H=Math.floor(k/65536),M=k-H*65536,k=S+H+65535,H=Math.floor(k/65536),S=k-H*65536,k=w+H+65535,H=Math.floor(k/65536),w=k-H*65536,k=N+H+65535,H=Math.floor(k/65536),N=k-H*65536,k=B+H+65535,H=Math.floor(k/65536),B=k-H*65536,k=D+H+65535,H=Math.floor(k/65536),D=k-H*65536,se+=H-1+37*(H-1),j[0]=se,j[1]=ue,j[2]=me,j[3]=q,j[4]=E,j[5]=T,j[6]=m,j[7]=d,j[8]=g,j[9]=_,j[10]=M,j[11]=S,j[12]=w,j[13]=N,j[14]=B,j[15]=D}i(y,"mul3"),a(y,"mul");function A(j,V){y(j,V,V)}i(A,"square"),a(A,"square");function C(j,V){let G=n();for(let k=0;k<16;k++)G[k]=V[k];for(let k=253;k>=0;k--)A(G,G),k!==2&&k!==4&&y(G,G,V);for(let k=0;k<16;k++)j[k]=G[k]}i(C,"inv25519"),a(C,"inv25519");function O(j,V){let G=new Uint8Array(32),k=new Float64Array(80),H=n(),se=n(),ue=n(),me=n(),q=n(),E=n();for(let g=0;g<31;g++)G[g]=j[g];G[31]=j[31]&127|64,G[0]&=248,p(k,V);for(let g=0;g<16;g++)se[g]=k[g];H[0]=me[0]=1;for(let g=254;g>=0;--g){let _=G[g>>>3]>>>(g&7)&1;l(H,se,_),l(ue,me,_),v(q,H,ue),b(H,H,ue),v(ue,se,me),b(se,se,me),A(me,q),A(E,H),y(H,ue,H),y(ue,se,q),v(q,H,ue),b(H,H,ue),A(se,H),b(ue,me,E),y(H,ue,o),v(H,H,me),y(ue,ue,H),y(H,me,E),y(me,se,k),A(se,q),l(H,se,_),l(ue,me,_)}for(let g=0;g<16;g++)k[g+16]=H[g],k[g+32]=ue[g],k[g+48]=se[g],k[g+64]=me[g];let T=k.subarray(32),m=k.subarray(16);C(T,T),y(m,m,T);let d=new Uint8Array(32);return h(d,m),d}i(O,"scalarMult"),a(O,"scalarMult"),e.scalarMult=O;function R(j){return O(j,s)}i(R,"scalarMultBase"),a(R,"scalarMultBase"),e.scalarMultBase=R;function L(j){if(j.length!==e.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${e.SECRET_KEY_LENGTH} bytes`);let V=new Uint8Array(j);return{publicKey:R(V),secretKey:V}}i(L,"generateKeyPairFromSeed2"),a(L,"generateKeyPairFromSeed"),e.generateKeyPairFromSeed=L;function K(j){let V=(0,t.randomBytes)(32,j),G=L(V);return(0,r.wipe)(V),G}i(K,"generateKeyPair2"),a(K,"generateKeyPair"),e.generateKeyPair=K;function $(j,V,G=!1){if(j.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(V.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");let k=O(j,V);if(G){let H=0;for(let se=0;se<k.length;se++)H|=k[se];if(H===0)throw new Error("X25519: invalid shared key")}return k}i($,"sharedKey2"),a($,"sharedKey"),e.sharedKey=$}}),Tx=ze({"../../../node_modules/.pnpm/@stablelib+chacha@1.0.1/node_modules/@stablelib/chacha/lib/chacha.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Yu(),r=ps(),n=20;function s(h,p,v){for(var b=1634760805,y=857760878,A=2036477234,C=1797285236,O=v[3]<<24|v[2]<<16|v[1]<<8|v[0],R=v[7]<<24|v[6]<<16|v[5]<<8|v[4],L=v[11]<<24|v[10]<<16|v[9]<<8|v[8],K=v[15]<<24|v[14]<<16|v[13]<<8|v[12],$=v[19]<<24|v[18]<<16|v[17]<<8|v[16],j=v[23]<<24|v[22]<<16|v[21]<<8|v[20],V=v[27]<<24|v[26]<<16|v[25]<<8|v[24],G=v[31]<<24|v[30]<<16|v[29]<<8|v[28],k=p[3]<<24|p[2]<<16|p[1]<<8|p[0],H=p[7]<<24|p[6]<<16|p[5]<<8|p[4],se=p[11]<<24|p[10]<<16|p[9]<<8|p[8],ue=p[15]<<24|p[14]<<16|p[13]<<8|p[12],me=b,q=y,E=A,T=C,m=O,d=R,g=L,_=K,M=$,S=j,w=V,N=G,B=k,D=H,F=se,le=ue,P=0;P<n;P+=2)me=me+m|0,B^=me,B=B>>>32-16|B<<16,M=M+B|0,m^=M,m=m>>>32-12|m<<12,q=q+d|0,D^=q,D=D>>>32-16|D<<16,S=S+D|0,d^=S,d=d>>>32-12|d<<12,E=E+g|0,F^=E,F=F>>>32-16|F<<16,w=w+F|0,g^=w,g=g>>>32-12|g<<12,T=T+_|0,le^=T,le=le>>>32-16|le<<16,N=N+le|0,_^=N,_=_>>>32-12|_<<12,E=E+g|0,F^=E,F=F>>>32-8|F<<8,w=w+F|0,g^=w,g=g>>>32-7|g<<7,T=T+_|0,le^=T,le=le>>>32-8|le<<8,N=N+le|0,_^=N,_=_>>>32-7|_<<7,q=q+d|0,D^=q,D=D>>>32-8|D<<8,S=S+D|0,d^=S,d=d>>>32-7|d<<7,me=me+m|0,B^=me,B=B>>>32-8|B<<8,M=M+B|0,m^=M,m=m>>>32-7|m<<7,me=me+d|0,le^=me,le=le>>>32-16|le<<16,w=w+le|0,d^=w,d=d>>>32-12|d<<12,q=q+g|0,B^=q,B=B>>>32-16|B<<16,N=N+B|0,g^=N,g=g>>>32-12|g<<12,E=E+_|0,D^=E,D=D>>>32-16|D<<16,M=M+D|0,_^=M,_=_>>>32-12|_<<12,T=T+m|0,F^=T,F=F>>>32-16|F<<16,S=S+F|0,m^=S,m=m>>>32-12|m<<12,E=E+_|0,D^=E,D=D>>>32-8|D<<8,M=M+D|0,_^=M,_=_>>>32-7|_<<7,T=T+m|0,F^=T,F=F>>>32-8|F<<8,S=S+F|0,m^=S,m=m>>>32-7|m<<7,q=q+g|0,B^=q,B=B>>>32-8|B<<8,N=N+B|0,g^=N,g=g>>>32-7|g<<7,me=me+d|0,le^=me,le=le>>>32-8|le<<8,w=w+le|0,d^=w,d=d>>>32-7|d<<7;t.writeUint32LE(me+b|0,h,0),t.writeUint32LE(q+y|0,h,4),t.writeUint32LE(E+A|0,h,8),t.writeUint32LE(T+C|0,h,12),t.writeUint32LE(m+O|0,h,16),t.writeUint32LE(d+R|0,h,20),t.writeUint32LE(g+L|0,h,24),t.writeUint32LE(_+K|0,h,28),t.writeUint32LE(M+$|0,h,32),t.writeUint32LE(S+j|0,h,36),t.writeUint32LE(w+V|0,h,40),t.writeUint32LE(N+G|0,h,44),t.writeUint32LE(B+k|0,h,48),t.writeUint32LE(D+H|0,h,52),t.writeUint32LE(F+se|0,h,56),t.writeUint32LE(le+ue|0,h,60)}i(s,"core"),a(s,"core");function o(h,p,v,b,y){if(y===void 0&&(y=0),h.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(b.length<v.length)throw new Error("ChaCha: destination is shorter than source");var A,C;if(y===0){if(p.length!==8&&p.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");A=new Uint8Array(16),C=A.length-p.length,A.set(p,C)}else{if(p.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");A=p,C=y}for(var O=new Uint8Array(64),R=0;R<v.length;R+=64){s(O,A,h);for(var L=R;L<R+64&&L<v.length;L++)b[L]=v[L]^O[L-R];l(A,0,C)}return r.wipe(O),y===0&&r.wipe(A),b}i(o,"streamXOR"),a(o,"streamXOR"),e.streamXOR=o;function c(h,p,v,b){return b===void 0&&(b=0),r.wipe(v),o(h,p,v,v,b)}i(c,"stream"),a(c,"stream"),e.stream=c;function l(h,p,v){for(var b=1;v--;)b=b+(h[p]&255)|0,h[p]=b&255,b>>>=8,p++;if(b>0)throw new Error("ChaCha: counter overflow")}i(l,"incrementCounter"),a(l,"incrementCounter")}}),S$=ze({"../../../node_modules/.pnpm/@stablelib+xchacha20@1.0.1/node_modules/@stablelib/xchacha20/lib/xchacha20.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Yu(),r=ps(),n=Tx(),s=20;function o(h,p,v,b){if(p.length!==24)throw new Error("XChaCha20 nonce must be 24 bytes");var y=l(h,p.subarray(0,16),new Uint8Array(32)),A=new Uint8Array(12);A.set(p.subarray(16),4);var C=n.streamXOR(y,A,v,b);return r.wipe(y),C}i(o,"streamXOR"),a(o,"streamXOR"),e.streamXOR=o;function c(h,p,v){return r.wipe(v),o(h,p,v,v)}i(c,"stream"),a(c,"stream"),e.stream=c;function l(h,p,v){for(var b=1634760805,y=857760878,A=2036477234,C=1797285236,O=h[3]<<24|h[2]<<16|h[1]<<8|h[0],R=h[7]<<24|h[6]<<16|h[5]<<8|h[4],L=h[11]<<24|h[10]<<16|h[9]<<8|h[8],K=h[15]<<24|h[14]<<16|h[13]<<8|h[12],$=h[19]<<24|h[18]<<16|h[17]<<8|h[16],j=h[23]<<24|h[22]<<16|h[21]<<8|h[20],V=h[27]<<24|h[26]<<16|h[25]<<8|h[24],G=h[31]<<24|h[30]<<16|h[29]<<8|h[28],k=p[3]<<24|p[2]<<16|p[1]<<8|p[0],H=p[7]<<24|p[6]<<16|p[5]<<8|p[4],se=p[11]<<24|p[10]<<16|p[9]<<8|p[8],ue=p[15]<<24|p[14]<<16|p[13]<<8|p[12],me=b,q=y,E=A,T=C,m=O,d=R,g=L,_=K,M=$,S=j,w=V,N=G,B=k,D=H,F=se,le=ue,P=0;P<s;P+=2)me=me+m|0,B^=me,B=B>>>32-16|B<<16,M=M+B|0,m^=M,m=m>>>32-12|m<<12,q=q+d|0,D^=q,D=D>>>32-16|D<<16,S=S+D|0,d^=S,d=d>>>32-12|d<<12,E=E+g|0,F^=E,F=F>>>32-16|F<<16,w=w+F|0,g^=w,g=g>>>32-12|g<<12,T=T+_|0,le^=T,le=le>>>32-16|le<<16,N=N+le|0,_^=N,_=_>>>32-12|_<<12,E=E+g|0,F^=E,F=F>>>32-8|F<<8,w=w+F|0,g^=w,g=g>>>32-7|g<<7,T=T+_|0,le^=T,le=le>>>32-8|le<<8,N=N+le|0,_^=N,_=_>>>32-7|_<<7,q=q+d|0,D^=q,D=D>>>32-8|D<<8,S=S+D|0,d^=S,d=d>>>32-7|d<<7,me=me+m|0,B^=me,B=B>>>32-8|B<<8,M=M+B|0,m^=M,m=m>>>32-7|m<<7,me=me+d|0,le^=me,le=le>>>32-16|le<<16,w=w+le|0,d^=w,d=d>>>32-12|d<<12,q=q+g|0,B^=q,B=B>>>32-16|B<<16,N=N+B|0,g^=N,g=g>>>32-12|g<<12,E=E+_|0,D^=E,D=D>>>32-16|D<<16,M=M+D|0,_^=M,_=_>>>32-12|_<<12,T=T+m|0,F^=T,F=F>>>32-16|F<<16,S=S+F|0,m^=S,m=m>>>32-12|m<<12,E=E+_|0,D^=E,D=D>>>32-8|D<<8,M=M+D|0,_^=M,_=_>>>32-7|_<<7,T=T+m|0,F^=T,F=F>>>32-8|F<<8,S=S+F|0,m^=S,m=m>>>32-7|m<<7,q=q+g|0,B^=q,B=B>>>32-8|B<<8,N=N+B|0,g^=N,g=g>>>32-7|g<<7,me=me+d|0,le^=me,le=le>>>32-8|le<<8,w=w+le|0,d^=w,d=d>>>32-7|d<<7;return t.writeUint32LE(me,v,0),t.writeUint32LE(q,v,4),t.writeUint32LE(E,v,8),t.writeUint32LE(T,v,12),t.writeUint32LE(B,v,16),t.writeUint32LE(D,v,20),t.writeUint32LE(F,v,24),t.writeUint32LE(le,v,28),v}i(l,"hchacha"),a(l,"hchacha"),e.hchacha=l}}),Mx=ze({"../../../node_modules/.pnpm/@stablelib+constant-time@1.0.1/node_modules/@stablelib/constant-time/lib/constant-time.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});function t(o,c,l){return~(o-1)&c|o-1&l}i(t,"select"),a(t,"select"),e.select=t;function r(o,c){return(o|0)-(c|0)-1>>>31&1}i(r,"lessOrEqual"),a(r,"lessOrEqual"),e.lessOrEqual=r;function n(o,c){if(o.length!==c.length)return 0;for(var l=0,h=0;h<o.length;h++)l|=o[h]^c[h];return 1&l-1>>>8}i(n,"compare4"),a(n,"compare"),e.compare=n;function s(o,c){return o.length===0||c.length===0?!1:n(o,c)!==0}i(s,"equal"),a(s,"equal"),e.equal=s}}),x$=ze({"../../../node_modules/.pnpm/@stablelib+poly1305@1.0.1/node_modules/@stablelib/poly1305/lib/poly1305.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Mx(),r=ps();e.DIGEST_LENGTH=16;var n=function(){function c(l){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var h=l[0]|l[1]<<8;this._r[0]=h&8191;var p=l[2]|l[3]<<8;this._r[1]=(h>>>13|p<<3)&8191;var v=l[4]|l[5]<<8;this._r[2]=(p>>>10|v<<6)&7939;var b=l[6]|l[7]<<8;this._r[3]=(v>>>7|b<<9)&8191;var y=l[8]|l[9]<<8;this._r[4]=(b>>>4|y<<12)&255,this._r[5]=y>>>1&8190;var A=l[10]|l[11]<<8;this._r[6]=(y>>>14|A<<2)&8191;var C=l[12]|l[13]<<8;this._r[7]=(A>>>11|C<<5)&8065;var O=l[14]|l[15]<<8;this._r[8]=(C>>>8|O<<8)&8191,this._r[9]=O>>>5&127,this._pad[0]=l[16]|l[17]<<8,this._pad[1]=l[18]|l[19]<<8,this._pad[2]=l[20]|l[21]<<8,this._pad[3]=l[22]|l[23]<<8,this._pad[4]=l[24]|l[25]<<8,this._pad[5]=l[26]|l[27]<<8,this._pad[6]=l[28]|l[29]<<8,this._pad[7]=l[30]|l[31]<<8}return i(c,"Poly13052"),a(c,"Poly1305"),c.prototype._blocks=function(l,h,p){for(var v=this._fin?0:2048,b=this._h[0],y=this._h[1],A=this._h[2],C=this._h[3],O=this._h[4],R=this._h[5],L=this._h[6],K=this._h[7],$=this._h[8],j=this._h[9],V=this._r[0],G=this._r[1],k=this._r[2],H=this._r[3],se=this._r[4],ue=this._r[5],me=this._r[6],q=this._r[7],E=this._r[8],T=this._r[9];p>=16;){var m=l[h+0]|l[h+1]<<8;b+=m&8191;var d=l[h+2]|l[h+3]<<8;y+=(m>>>13|d<<3)&8191;var g=l[h+4]|l[h+5]<<8;A+=(d>>>10|g<<6)&8191;var _=l[h+6]|l[h+7]<<8;C+=(g>>>7|_<<9)&8191;var M=l[h+8]|l[h+9]<<8;O+=(_>>>4|M<<12)&8191,R+=M>>>1&8191;var S=l[h+10]|l[h+11]<<8;L+=(M>>>14|S<<2)&8191;var w=l[h+12]|l[h+13]<<8;K+=(S>>>11|w<<5)&8191;var N=l[h+14]|l[h+15]<<8;$+=(w>>>8|N<<8)&8191,j+=N>>>5|v;var B=0,D=B;D+=b*V,D+=y*(5*T),D+=A*(5*E),D+=C*(5*q),D+=O*(5*me),B=D>>>13,D&=8191,D+=R*(5*ue),D+=L*(5*se),D+=K*(5*H),D+=$*(5*k),D+=j*(5*G),B+=D>>>13,D&=8191;var F=B;F+=b*G,F+=y*V,F+=A*(5*T),F+=C*(5*E),F+=O*(5*q),B=F>>>13,F&=8191,F+=R*(5*me),F+=L*(5*ue),F+=K*(5*se),F+=$*(5*H),F+=j*(5*k),B+=F>>>13,F&=8191;var le=B;le+=b*k,le+=y*G,le+=A*V,le+=C*(5*T),le+=O*(5*E),B=le>>>13,le&=8191,le+=R*(5*q),le+=L*(5*me),le+=K*(5*ue),le+=$*(5*se),le+=j*(5*H),B+=le>>>13,le&=8191;var P=B;P+=b*H,P+=y*k,P+=A*G,P+=C*V,P+=O*(5*T),B=P>>>13,P&=8191,P+=R*(5*E),P+=L*(5*q),P+=K*(5*me),P+=$*(5*ue),P+=j*(5*se),B+=P>>>13,P&=8191;var Y=B;Y+=b*se,Y+=y*H,Y+=A*k,Y+=C*G,Y+=O*V,B=Y>>>13,Y&=8191,Y+=R*(5*T),Y+=L*(5*E),Y+=K*(5*q),Y+=$*(5*me),Y+=j*(5*ue),B+=Y>>>13,Y&=8191;var J=B;J+=b*ue,J+=y*se,J+=A*H,J+=C*k,J+=O*G,B=J>>>13,J&=8191,J+=R*V,J+=L*(5*T),J+=K*(5*E),J+=$*(5*q),J+=j*(5*me),B+=J>>>13,J&=8191;var I=B;I+=b*me,I+=y*ue,I+=A*se,I+=C*H,I+=O*k,B=I>>>13,I&=8191,I+=R*G,I+=L*V,I+=K*(5*T),I+=$*(5*E),I+=j*(5*q),B+=I>>>13,I&=8191;var z=B;z+=b*q,z+=y*me,z+=A*ue,z+=C*se,z+=O*H,B=z>>>13,z&=8191,z+=R*k,z+=L*G,z+=K*V,z+=$*(5*T),z+=j*(5*E),B+=z>>>13,z&=8191;var te=B;te+=b*E,te+=y*q,te+=A*me,te+=C*ue,te+=O*se,B=te>>>13,te&=8191,te+=R*H,te+=L*k,te+=K*G,te+=$*V,te+=j*(5*T),B+=te>>>13,te&=8191;var ae=B;ae+=b*T,ae+=y*E,ae+=A*q,ae+=C*me,ae+=O*ue,B=ae>>>13,ae&=8191,ae+=R*se,ae+=L*H,ae+=K*k,ae+=$*G,ae+=j*V,B+=ae>>>13,ae&=8191,B=(B<<2)+B|0,B=B+D|0,D=B&8191,B=B>>>13,F+=B,b=D,y=F,A=le,C=P,O=Y,R=J,L=I,K=z,$=te,j=ae,h+=16,p-=16}this._h[0]=b,this._h[1]=y,this._h[2]=A,this._h[3]=C,this._h[4]=O,this._h[5]=R,this._h[6]=L,this._h[7]=K,this._h[8]=$,this._h[9]=j},c.prototype.finish=function(l,h){h===void 0&&(h=0);var p=new Uint16Array(10),v,b,y,A;if(this._leftover){for(A=this._leftover,this._buffer[A++]=1;A<16;A++)this._buffer[A]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(v=this._h[1]>>>13,this._h[1]&=8191,A=2;A<10;A++)this._h[A]+=v,v=this._h[A]>>>13,this._h[A]&=8191;for(this._h[0]+=v*5,v=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=v,v=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=v,p[0]=this._h[0]+5,v=p[0]>>>13,p[0]&=8191,A=1;A<10;A++)p[A]=this._h[A]+v,v=p[A]>>>13,p[A]&=8191;for(p[9]-=1<<13,b=(v^1)-1,A=0;A<10;A++)p[A]&=b;for(b=~b,A=0;A<10;A++)this._h[A]=this._h[A]&b|p[A];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,y=this._h[0]+this._pad[0],this._h[0]=y&65535,A=1;A<8;A++)y=(this._h[A]+this._pad[A]|0)+(y>>>16)|0,this._h[A]=y&65535;return l[h+0]=this._h[0]>>>0,l[h+1]=this._h[0]>>>8,l[h+2]=this._h[1]>>>0,l[h+3]=this._h[1]>>>8,l[h+4]=this._h[2]>>>0,l[h+5]=this._h[2]>>>8,l[h+6]=this._h[3]>>>0,l[h+7]=this._h[3]>>>8,l[h+8]=this._h[4]>>>0,l[h+9]=this._h[4]>>>8,l[h+10]=this._h[5]>>>0,l[h+11]=this._h[5]>>>8,l[h+12]=this._h[6]>>>0,l[h+13]=this._h[6]>>>8,l[h+14]=this._h[7]>>>0,l[h+15]=this._h[7]>>>8,this._finished=!0,this},c.prototype.update=function(l){var h=0,p=l.length,v;if(this._leftover){v=16-this._leftover,v>p&&(v=p);for(var b=0;b<v;b++)this._buffer[this._leftover+b]=l[h+b];if(p-=v,h+=v,this._leftover+=v,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(p>=16&&(v=p-p%16,this._blocks(l,h,v),h+=v,p-=v),p){for(var b=0;b<p;b++)this._buffer[this._leftover+b]=l[h+b];this._leftover+=p}return this},c.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var l=new Uint8Array(16);return this.finish(l),l},c.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},c}();e.Poly1305=n;function s(c,l){var h=new n(c);h.update(l);var p=h.digest();return h.clean(),p}i(s,"oneTimeAuth"),a(s,"oneTimeAuth"),e.oneTimeAuth=s;function o(c,l){return c.length!==e.DIGEST_LENGTH||l.length!==e.DIGEST_LENGTH?!1:t.equal(c,l)}i(o,"equal"),a(o,"equal"),e.equal=o}}),T$=ze({"../../../node_modules/.pnpm/@stablelib+chacha20poly1305@1.0.1/node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=Tx(),r=x$(),n=ps(),s=Yu(),o=Mx();e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var c=new Uint8Array(16),l=function(){function h(p){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,p.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(p)}return i(h,"ChaCha20Poly13052"),a(h,"ChaCha20Poly1305"),h.prototype.seal=function(p,v,b,y){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var A=new Uint8Array(16);A.set(p,A.length-p.length);var C=new Uint8Array(32);t.stream(this._key,A,C,4);var O=v.length+this.tagLength,R;if(y){if(y.length!==O)throw new Error("ChaCha20Poly1305: incorrect destination length");R=y}else R=new Uint8Array(O);return t.streamXOR(this._key,A,v,R,4),this._authenticate(R.subarray(R.length-this.tagLength,R.length),C,R.subarray(0,R.length-this.tagLength),b),n.wipe(A),R},h.prototype.open=function(p,v,b,y){if(p.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(v.length<this.tagLength)return null;var A=new Uint8Array(16);A.set(p,A.length-p.length);var C=new Uint8Array(32);t.stream(this._key,A,C,4);var O=new Uint8Array(this.tagLength);if(this._authenticate(O,C,v.subarray(0,v.length-this.tagLength),b),!o.equal(O,v.subarray(v.length-this.tagLength,v.length)))return null;var R=v.length-this.tagLength,L;if(y){if(y.length!==R)throw new Error("ChaCha20Poly1305: incorrect destination length");L=y}else L=new Uint8Array(R);return t.streamXOR(this._key,A,v.subarray(0,v.length-this.tagLength),L,4),n.wipe(A),L},h.prototype.clean=function(){return n.wipe(this._key),this},h.prototype._authenticate=function(p,v,b,y){var A=new r.Poly1305(v);y&&(A.update(y),y.length%16>0&&A.update(c.subarray(y.length%16))),A.update(b),b.length%16>0&&A.update(c.subarray(b.length%16));var C=new Uint8Array(8);y&&s.writeUint64LE(y.length,C),A.update(C),s.writeUint64LE(b.length,C),A.update(C);for(var O=A.digest(),R=0;R<O.length;R++)p[R]=O[R];A.clean(),n.wipe(O),n.wipe(C)},h}();e.ChaCha20Poly1305=l}}),M$=ze({"../../../node_modules/.pnpm/@stablelib+xchacha20poly1305@1.0.1/node_modules/@stablelib/xchacha20poly1305/lib/xchacha20poly1305.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=S$(),r=T$(),n=ps();e.KEY_LENGTH=32,e.NONCE_LENGTH=24,e.TAG_LENGTH=16;var s=function(){function o(c){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,c.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(c)}return i(o,"XChaCha20Poly13053"),a(o,"XChaCha20Poly1305"),o.prototype.seal=function(c,l,h,p){if(c.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");var v=t.hchacha(this._key,c.subarray(0,16),new Uint8Array(32)),b=new Uint8Array(12);b.set(c.subarray(16),4);var y=new r.ChaCha20Poly1305(v),A=y.seal(b,l,h,p);return n.wipe(v),n.wipe(b),y.clean(),A},o.prototype.open=function(c,l,h,p){if(c.length!==24)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(l.length<this.tagLength)return null;var v=t.hchacha(this._key,c.subarray(0,16),new Uint8Array(32)),b=new Uint8Array(12);b.set(c.subarray(16),4);var y=new r.ChaCha20Poly1305(v),A=y.open(b,l,h,p);return n.wipe(v),n.wipe(b),y.clean(),A},o.prototype.clean=function(){return n.wipe(this._key),this},o}();e.XChaCha20Poly1305=s}}),qs=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/identifiers.js"(e,t){t.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}}}),mm=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/style.js"(e,t){t.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}}}),C$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-conv-api/transformers.js"(e){var t=e,r=4294967292,n=4294967293,s=4294967294,o=4294967295,c=[0,1,3,7,15,31,63,127,255,511,1023],l=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),p=[];h.forEach(y=>{p.push(y.charCodeAt(0))}),e.utf8={encode(y){let A=[];return y.forEach(C=>{if(C>=0&&C<=127)A.push(C);else if(C<=2047)A.push(192+(C>>6&c[5])),A.push(128+(C&c[6]));else if(C<55296||C>57343&&C<=65535)A.push(224+(C>>12&c[4])),A.push(128+(C>>6&c[6])),A.push(128+(C&c[6]));else if(C>=65536&&C<=1114111){let O=C>>16&c[5];A.push(240+(O>>2)),A.push(128+((O&c[2])<<4)+(C>>12&c[4])),A.push(128+(C>>6&c[6])),A.push(128+(C&c[6]))}else throw new RangeError(`utf8.encode: character out of range: char: ${C}`)}),Buffer.from(A)},decode(y,A){function C(ue,me){if((me&192)!==128)return n;let q=((ue&c[5])<<6)+(me&c[6]);return q<128?r:q}i(C,"bytes2"),a(C,"bytes2");function O(ue,me,q){if((q&192)!==128||(me&192)!==128)return n;let E=((ue&c[4])<<12)+((me&c[6])<<6)+(q&c[6]);return E<2048?r:E>=55296&&E<=57343?s:E}i(O,"bytes3"),a(O,"bytes3");function R(ue,me,q,E){if((E&192)!==128||(q&192)!==128||(me&192)!==128)return n;let T=(((ue&c[3])<<2)+(me>>4&c[2])<<16)+((me&c[4])<<12)+((q&c[6])<<6)+(E&c[6]);return T<65536?r:T>1114111?s:T}i(R,"bytes4"),a(R,"bytes4");let L,K,$,j,V,G,k=y.length,H=A?3:0,se=[];for(;H<k;){K=y[H],L=o;let ue=!0;for(;ue;){if(K>=0&&K<=127){L=K,G=1;break}if($=H+1,$<k&&K>=194&&K<=223){L=C(K,y[$]),G=2;break}if(j=H+2,j<k&&K>=224&&K<=239){L=O(K,y[$],y[j]),G=3;break}if(V=H+3,V<k&&K>=240&&K<=244){L=R(K,y[$],y[j],y[V]),G=4;break}break}if(L>1114111){let me=`byte[${H}]`;throw L===o?new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${me}`):L===n?new RangeError(`utf8.decode: illegal trailing byte found at: ${me}`):L===s?new RangeError(`utf8.decode: code point out of range found at: ${me}`):L===r?new RangeError(`utf8.decode: non-shortest form found at: ${me}`):new RangeError(`utf8.decode: unrecognized error found at: ${me}`)}se.push(L),H+=G}return se}},e.utf16be={encode(y){let A=[],C,O,R;for(let L=0;L<y.length;L+=1)if(C=y[L],C>=0&&C<=55295||C>=57344&&C<=65535)A.push(C>>8&c[8]),A.push(C&c[8]);else if(C>=65536&&C<=1114111)R=C-65536,O=55296+(R>>10),R=56320+(R&c[10]),A.push(O>>8&c[8]),A.push(O&c[8]),A.push(R>>8&c[8]),A.push(R&c[8]);else throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${L}]: ${C}`);return Buffer.from(A)},decode(y,A){if(y.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${y.length}`);let C=[],O=y.length,R=A?2:0,L=0,K,$,j,V,G,k;for(;R<O;){for(;;){if(j=R+1,j<O){if(G=(y[R]<<8)+y[j],G<55296||G>57343){K=G,$=2;break}if(V=R+3,V<O&&(k=(y[R+2]<<8)+y[V],G<=56319&&k>=56320&&k<=57343)){K=65536+(G-55296<<10)+(k-56320),$=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${R}]`)}C[L++]=K,R+=$}return C}},e.utf16le={encode(y){let A=[],C,O,R;for(let L=0;L<y.length;L+=1)if(C=y[L],C>=0&&C<=55295||C>=57344&&C<=65535)A.push(C&c[8]),A.push(C>>8&c[8]);else if(C>=65536&&C<=1114111)R=C-65536,O=55296+(R>>10),R=56320+(R&c[10]),A.push(O&c[8]),A.push(O>>8&c[8]),A.push(R&c[8]),A.push(R>>8&c[8]);else throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${L}]: ${C}`);return Buffer.from(A)},decode(y,A){if(y.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${y.length}`);let C=[],O=y.length,R=A?2:0,L=0,K,$,j,V,G,k;for(;R<O;){for(;;){if(j=R+1,j<O){if(G=(y[j]<<8)+y[R],G<55296||G>57343){K=G,$=2;break}if(V=R+3,V<O&&(k=(y[V]<<8)+y[R+2],G<=56319&&k>=56320&&k<=57343)){K=65536+(G-55296<<10)+(k-56320),$=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${R}]`)}C[L++]=K,R+=$}return C}},e.utf32be={encode(y){let A=Buffer.alloc(y.length*4),C=0;return y.forEach(O=>{if(O>=55296&&O<=57343||O>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${C/4}]: ${O}`);A[C++]=O>>24&c[8],A[C++]=O>>16&c[8],A[C++]=O>>8&c[8],A[C++]=O&c[8]}),A},decode(y,A){if(y.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${y.length}`);let C=[],O=A?4:0;for(;O<y.length;O+=4){let R=(y[O]<<24)+(y[O+1]<<16)+(y[O+2]<<8)+y[O+3];if(R>=55296&&R<=57343||R>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${O/4}]: ${R}`);C.push(R)}return C}},e.utf32le={encode(y){let A=Buffer.alloc(y.length*4),C=0;return y.forEach(O=>{if(O>=55296&&O<=57343||O>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${C/4}]: ${O}`);A[C++]=O&c[8],A[C++]=O>>8&c[8],A[C++]=O>>16&c[8],A[C++]=O>>24&c[8]}),A},decode(y,A){if(y.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${y.length}`);let C=[],O=A?4:0;for(;O<y.length;O+=4){let R=(y[O+3]<<24)+(y[O+2]<<16)+(y[O+1]<<8)+y[O];if(R>=55296&&R<=57343||R>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${O/4}]: ${R}`);C.push(R)}return C}},e.uint7={encode(y){let A=Buffer.alloc(y.length);for(let C=0;C<y.length;C+=1){if(y[C]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${C}]: ${y[C]}`);A[C]=y[C]}return A},decode(y){let A=[];for(let C=0;C<y.length;C+=1){if(y[C]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${C}]: ${y[C]}`);A[C]=y[C]}return A}},e.uint8={encode(y){let A=Buffer.alloc(y.length);for(let C=0;C<y.length;C+=1){if(y[C]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${C}]: ${y[C]}`);A[C]=y[C]}return A},decode(y){let A=[];for(let C=0;C<y.length;C+=1)A[C]=y[C];return A}},e.uint16be={encode(y){let A=Buffer.alloc(y.length*2),C=0;return y.forEach(O=>{if(O>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${C/2}]: ${O}`);A[C++]=O>>8&c[8],A[C++]=O&c[8]}),A},decode(y){if(y.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${y.length}`);let A=[];for(let C=0;C<y.length;C+=2)A.push((y[C]<<8)+y[C+1]);return A}},e.uint16le={encode(y){let A=Buffer.alloc(y.length*2),C=0;return y.forEach(O=>{if(O>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${C/2}]: ${O}`);A[C++]=O&c[8],A[C++]=O>>8&c[8]}),A},decode(y){if(y.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${y.length}`);let A=[];for(let C=0;C<y.length;C+=2)A.push((y[C+1]<<8)+y[C]);return A}},e.uint32be={encode(y){let A=Buffer.alloc(y.length*4),C=0;return y.forEach(O=>{A[C++]=O>>24&c[8],A[C++]=O>>16&c[8],A[C++]=O>>8&c[8],A[C++]=O&c[8]}),A},decode(y){if(y.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${y.length}`);let A=[];for(let C=0;C<y.length;C+=4)A.push((y[C]<<24)+(y[C+1]<<16)+(y[C+2]<<8)+y[C+3]);return A}},e.uint32le={encode(y){let A=Buffer.alloc(y.length*4),C=0;return y.forEach(O=>{A[C++]=O&c[8],A[C++]=O>>8&c[8],A[C++]=O>>16&c[8],A[C++]=O>>24&c[8]}),A},decode(y){if(y.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${y.length}`);let A=[];for(let C=0;C<y.length;C+=4)A.push((y[C+3]<<24)+(y[C+2]<<16)+(y[C+1]<<8)+y[C]);return A}},e.string={encode(y){return t.utf16le.encode(y).toString("utf16le")},decode(y){return t.utf16le.decode(Buffer.from(y,"utf16le"),0)}},e.escaped={encode(y){let A=[];for(let C=0;C<y.length;C+=1){let O=y[C];if(O===96)A.push(O),A.push(O);else if(O===10)A.push(O);else if(O>=32&&O<=126)A.push(O);else{let R="";if(O>=0&&O<=31)R+=`\`x${l[O]}`;else if(O>=127&&O<=255)R+=`\`x${l[O]}`;else if(O>=256&&O<=65535)R+=`\`u${l[O>>8&c[8]]}${l[O&c[8]]}`;else if(O>=65536&&O<=4294967295){R+="`u{";let K=O>>24&c[8];K>0&&(R+=l[K]),R+=`${l[O>>16&c[8]]+l[O>>8&c[8]]+l[O&c[8]]}}`}else throw new Error("escape.encode(char): char > 0xffffffff not allowed");Buffer.from(R).forEach(K=>{A.push(K)})}}return Buffer.from(A)},decode(y){function A(k){return k>=48&&k<=57||k>=65&&k<=70||k>=97&&k<=102}i(A,"isHex"),a(A,"isHex");function C(k,H,se){let ue={char:null,nexti:k+2,error:!0};if(k+1<H&&A(se[k])&&A(se[k+1])){let me=String.fromCodePoint(se[k],se[k+1]);ue.char=parseInt(me,16),Number.isNaN(ue.char)||(ue.error=!1)}return ue}i(C,"getx"),a(C,"getx");function O(k,H,se){let ue={char:null,nexti:k+4,error:!0};if(k+3<H&&A(se[k])&&A(se[k+1])&&A(se[k+2])&&A(se[k+3])){let me=String.fromCodePoint(se[k],se[k+1],se[k+2],se[k+3]);ue.char=parseInt(me,16),Number.isNaN(ue.char)||(ue.error=!1)}return ue}i(O,"getu"),a(O,"getu");function R(k,H,se){let ue={char:null,nexti:k+4,error:!0},me="";for(;k<H&&A(se[k]);)me+=String.fromCodePoint(se[k]),k+=1;return ue.char=parseInt(me,16),se[k]===125&&!Number.isNaN(ue.char)&&(ue.error=!1),ue.nexti=k+1,ue}i(R,"getU"),a(R,"getU");let L=[],K=y.length,$,j,V,G=0;for(;G<K;){for(;;){if(V=!0,y[G]!==96){L.push(y[G]),G+=1,V=!1;break}if($=G+1,$>=K)break;if(y[$]===96){L.push(96),G+=2,V=!1;break}if(y[$]===120){if(j=C($+1,K,y),j.error)break;L.push(j.char),G=j.nexti,V=!1;break}if(y[$]===117){if(y[$+1]===123){if(j=R($+2,K,y),j.error)break;L.push(j.char),G=j.nexti,V=!1;break}if(j=O($+1,K,y),j.error)break;L.push(j.char),G=j.nexti,V=!1;break}break}if(V)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${G}]`)}return L}};var v=13,b=10;e.lineEnds={crlf(y){let A=[],C=0;for(;C<y.length;)switch(y[C]){case v:C+1<y.length&&y[C+1]===b?C+=2:C+=1,A.push(v),A.push(b);break;case b:A.push(v),A.push(b),C+=1;break;default:A.push(y[C]),C+=1;break}return A.length>0&&A[A.length-1]!==b&&(A.push(v),A.push(b)),A},lf(y){let A=[],C=0;for(;C<y.length;)switch(y[C]){case v:C+1<y.length&&y[C+1]===b?C+=2:C+=1,A.push(b);break;case b:A.push(b),C+=1;break;default:A.push(y[C]),C+=1;break}return A.length>0&&A[A.length-1]!==b&&A.push(b),A}},e.base64={encode(y){if(y.length===0)return Buffer.alloc(0);let A,C,O,R=y.length%3;R=R>0?3-R:0;let L=(y.length+R)/3,K=Buffer.alloc(L*4);R>0&&(L-=1),A=0,C=0;for(let $=0;$<L;$+=1)O=y[A++]<<16,O+=y[A++]<<8,O+=y[A++],K[C++]=p[O>>18&c[6]],K[C++]=p[O>>12&c[6]],K[C++]=p[O>>6&c[6]],K[C++]=p[O&c[6]];if(R===0)return K;if(R===1)return O=y[A++]<<16,O+=y[A]<<8,K[C++]=p[O>>18&c[6]],K[C++]=p[O>>12&c[6]],K[C++]=p[O>>6&c[6]],K[C]=p[64],K;if(R===2)return O=y[A]<<16,K[C++]=p[O>>18&c[6]],K[C++]=p[O>>12&c[6]],K[C++]=p[64],K[C]=p[64],K},decode(y){function A(G){let k=[],H=0;for(let se=0;se<G.length;se+=1){let ue=G[se],me=!0;for(;me&&!(ue===32||ue===9||ue===10||ue===13);){if(ue>=65&&ue<=90){k.push(ue-65);break}if(ue>=97&&ue<=122){k.push(ue-71);break}if(ue>=48&&ue<=57){k.push(ue+4);break}if(ue===43){k.push(62);break}if(ue===47){k.push(63);break}if(ue===61){k.push(64),H+=1;break}throw new RangeError(`base64.decode: invalid character buf[${se}]: ${ue}`)}}if(k.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${k.length}`);switch(H){case 0:break;case 1:if(k[k.length-1]!==64)throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(k[k.length-1]!==64||k[k.length-2]!==64)throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${H}`)}return{tail:H,buf:Buffer.from(k)}}if(i(A,"validate6"),a(A,"validate"),y.length===0)return Buffer.alloc(0);let C=A(y),{tail:O}=C,R=C.buf,L,K,$,j=R.length/4,V=Buffer.alloc(j*3-O);O>0&&(j-=1),K=0,L=0;for(let G=0;G<j;G+=1)$=R[L++]<<18,$+=R[L++]<<12,$+=R[L++]<<6,$+=R[L++],V[K++]=$>>16&c[8],V[K++]=$>>8&c[8],V[K++]=$&c[8];return O===1&&($=R[L++]<<18,$+=R[L++]<<12,$+=R[L]<<6,V[K++]=$>>16&c[8],V[K]=$>>8&c[8]),O===2&&($=R[L++]<<18,$+=R[L++]<<12,V[K]=$>>16&c[8]),V},toString(y){if(y.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${y.length}`);let A="",C=0;function O(L,K,$,j){switch(C){case 76:A+=`\r
|
|
58
|
+
${L}${K}${$}${j}`,C=4;break;case 75:A+=`${L}\r
|
|
59
|
+
${K}${$}${j}`,C=3;break;case 74:A+=`${L+K}\r
|
|
60
|
+
${$}${j}`,C=2;break;case 73:A+=`${L+K+$}\r
|
|
61
|
+
${j}`,C=1;break;default:A+=L+K+$+j,C+=4;break}}i(O,"buildLine"),a(O,"buildLine");function R(L){return L>=65&&L<=90||L>=97&&L<=122||L>=48&&L<=57||L===43||L===47||L===61}i(R,"validate6"),a(R,"validate");for(let L=0;L<y.length;L+=4){for(let K=L;K<L+4;K+=1)if(!R(y[K]))throw new RangeError(`base64.toString: buf[${K}]: ${y[K]} : not valid base64 character code`);O(String.fromCharCode(y[L]),String.fromCharCode(y[L+1]),String.fromCharCode(y[L+2]),String.fromCharCode(y[L+3]))}return A}}}}),Cx=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-conv-api/converter.js"(e){var t=e,r=C$(),n="UTF8",s="UTF16",o="UTF16BE",c="UTF16LE",l="UTF32",h="UTF32BE",p="UTF32LE",v="UINT7",b="ASCII",y="BINARY",A="UINT8",C="UINT16",O="UINT16LE",R="UINT16BE",L="UINT32",K="UINT32LE",$="UINT32BE",j="ESCAPED",V="STRING",G=a(i(function(T){T.type=n;let m=T.data;T.bom=0,m.length>=3&&m[0]===239&&m[1]===187&&m[2]===191&&(T.bom=3)},"bom82"),"bom8"),k=a(i(function(T){let m=T.data;switch(T.bom=0,T.type){case s:T.type=o,m.length>=2&&(m[0]===254&&m[1]===255?T.bom=2:m[0]===255&&m[1]===254&&(T.type=c,T.bom=2));break;case o:if(T.type=o,m.length>=2){if(m[0]===254&&m[1]===255)T.bom=2;else if(m[0]===255&&m[1]===254)throw new TypeError(`src type: "${o}" specified but BOM is for "${c}"`)}break;case c:if(T.type=c,m.length>=0){if(m[0]===254&&m[1]===255)throw new TypeError(`src type: "${c}" specified but BOM is for "${o}"`);m[0]===255&&m[1]===254&&(T.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${T.type}" unrecognized`)}},"bom162"),"bom16"),H=a(i(function(T){let m=T.data;switch(T.bom=0,T.type){case l:T.type=h,m.length>=4&&(m[0]===0&&m[1]===0&&m[2]===254&&m[3]===255&&(T.bom=4),m[0]===255&&m[1]===254&&m[2]===0&&m[3]===0&&(T.type=p,T.bom=4));break;case h:if(T.type=h,m.length>=4&&(m[0]===0&&m[1]===0&&m[2]===254&&m[3]===255&&(T.bom=4),m[0]===255&&m[1]===254&&m[2]===0&&m[3]===0))throw new TypeError(`src type: ${h} specified but BOM is for ${p}"`);break;case p:if(T.type=p,m.length>=4){if(m[0]===0&&m[1]===0&&m[2]===254&&m[3]===255)throw new TypeError(`src type: "${p}" specified but BOM is for "${h}"`);m[0]===255&&m[1]===254&&m[2]===0&&m[3]===0&&(T.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${T.type}" unrecognized`)}},"bom322"),"bom32"),se=a(i(function(T,m){function d(_){let M={type:"",base64:!1},w=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(_);return w&&(w[2]&&(M.type=w[2].toUpperCase()),w[1]&&(M.base64=!0)),M}if(i(d,"getType"),a(d,"getType"),typeof T!="string"||T==="")throw new TypeError(`type: "${T}" not recognized`);let g=d(T.toUpperCase());if(g.base64){if(g.type===V)throw new TypeError(`type: "${T} "BASE64:" prefix not allowed with type ${V}`);if(Buffer.isBuffer(m))g.data=r.base64.decode(m);else if(typeof m=="string"){let _=Buffer.from(m,"ascii");g.data=r.base64.decode(_)}else throw new TypeError(`type: "${T} unrecognized data type: typeof(data): ${typeof m}`)}else g.data=m;switch(g.type){case n:G(g);break;case s:case o:case c:k(g);break;case l:case h:case p:H(g);break;case C:g.type=R;break;case L:g.type=$;break;case b:g.type=v;break;case y:g.type=A;break;case v:case A:case O:case R:case K:case $:case V:case j:break;default:throw new TypeError(`type: "${T}" not recognized`)}if(g.type===V){if(typeof g.data!="string")throw new TypeError(`type: "${T}" but data is not a string`)}else if(!Buffer.isBuffer(g.data))throw new TypeError(`type: "${T}" but data is not a Buffer`);return g},"validateSrc2"),"validateSrc"),ue=a(i(function(T,m){function d(_){let M,S,w={crlf:!1,lf:!1,base64:!1,type:""},N=!0;for(;N;){if(S=_,M=_.slice(0,5),M==="CRLF:"){w.crlf=!0,S=_.slice(5);break}if(M=_.slice(0,3),M==="LF:"){w.lf=!0,S=_.slice(3);break}break}return M=S.split(":"),M.length===1?w.type=M[0]:M.length===2&&M[1]==="BASE64"&&(w.base64=!0,w.type=M[0]),w}if(i(d,"getType"),a(d,"getType"),!Array.isArray(m))throw new TypeError(`dst chars: not array: "${typeof m}`);if(typeof T!="string")throw new TypeError(`dst type: not string: "${typeof T}`);let g=d(T.toUpperCase());switch(g.type){case n:case o:case c:case h:case p:case v:case A:case O:case R:case K:case $:case j:break;case V:if(g.base64)throw new TypeError(`":BASE64" suffix not allowed with type ${V}`);break;case b:g.type=v;break;case y:g.type=A;break;case s:g.type=o;break;case l:g.type=h;break;case C:g.type=R;break;case L:g.type=$;break;default:throw new TypeError(`dst type unrecognized: "${T}" : must have form [crlf:|lf:]type[:base64]`)}return g},"validateDst2"),"validateDst"),me=a(i(function(T,m){switch(T){case n:return r.utf8.encode(m);case o:return r.utf16be.encode(m);case c:return r.utf16le.encode(m);case h:return r.utf32be.encode(m);case p:return r.utf32le.encode(m);case v:return r.uint7.encode(m);case A:return r.uint8.encode(m);case R:return r.uint16be.encode(m);case O:return r.uint16le.encode(m);case $:return r.uint32be.encode(m);case K:return r.uint32le.encode(m);case V:return r.string.encode(m);case j:return r.escaped.encode(m);default:throw new TypeError(`encode type "${T}" not recognized`)}},"encode10"),"encode"),q=a(i(function(T){switch(T.type){case n:return r.utf8.decode(T.data,T.bom);case c:return r.utf16le.decode(T.data,T.bom);case o:return r.utf16be.decode(T.data,T.bom);case h:return r.utf32be.decode(T.data,T.bom);case p:return r.utf32le.decode(T.data,T.bom);case v:return r.uint7.decode(T.data);case A:return r.uint8.decode(T.data);case R:return r.uint16be.decode(T.data);case O:return r.uint16le.decode(T.data);case $:return r.uint32be.decode(T.data);case K:return r.uint32le.decode(T.data);case V:return r.string.decode(T.data);case j:return r.escaped.decode(T.data);default:throw new TypeError(`decode type "${T.type}" not recognized`)}},"decode10"),"decode");e.decode=a(i(function(T,m){let d=se(T,m);return q(d)},"exportsDecode"),"exportsDecode"),e.encode=a(i(function(T,m){let d,g,_=ue(T,m);return _.crlf?(d=r.lineEnds.crlf(m),g=me(_.type,d)):_.lf?(d=r.lineEnds.lf(m),g=me(_.type,d)):g=me(_.type,m),_.base64&&(g=r.base64.encode(g)),g},"exportsEncode"),"exportsEncode"),e.convert=a(i(function(T,m,d){return t.encode(d,t.decode(T,m))},"convert"),"convert")}}),Ix=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/emitcss.js"(e,t){t.exports=a(i(function(){return`/* This file automatically generated by jsonToless() and LESS. */
|
|
62
|
+
.apg-mono {
|
|
63
|
+
font-family: monospace;
|
|
64
|
+
}
|
|
65
|
+
.apg-active {
|
|
66
|
+
font-weight: bold;
|
|
67
|
+
color: #000000;
|
|
68
|
+
}
|
|
69
|
+
.apg-match {
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
color: #264BFF;
|
|
72
|
+
}
|
|
73
|
+
.apg-empty {
|
|
74
|
+
font-weight: bold;
|
|
75
|
+
color: #0fbd0f;
|
|
76
|
+
}
|
|
77
|
+
.apg-nomatch {
|
|
78
|
+
font-weight: bold;
|
|
79
|
+
color: #FF4000;
|
|
80
|
+
}
|
|
81
|
+
.apg-lh-match {
|
|
82
|
+
font-weight: bold;
|
|
83
|
+
color: #1A97BA;
|
|
84
|
+
}
|
|
85
|
+
.apg-lb-match {
|
|
86
|
+
font-weight: bold;
|
|
87
|
+
color: #5F1687;
|
|
88
|
+
}
|
|
89
|
+
.apg-remainder {
|
|
90
|
+
font-weight: bold;
|
|
91
|
+
color: #999999;
|
|
92
|
+
}
|
|
93
|
+
.apg-ctrl-char {
|
|
94
|
+
font-weight: bolder;
|
|
95
|
+
font-style: italic;
|
|
96
|
+
font-size: 0.6em;
|
|
97
|
+
}
|
|
98
|
+
.apg-line-end {
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
color: #000000;
|
|
101
|
+
}
|
|
102
|
+
.apg-error {
|
|
103
|
+
font-weight: bold;
|
|
104
|
+
color: #FF4000;
|
|
105
|
+
}
|
|
106
|
+
.apg-phrase {
|
|
107
|
+
color: #000000;
|
|
108
|
+
background-color: #8caae6;
|
|
109
|
+
}
|
|
110
|
+
.apg-empty-phrase {
|
|
111
|
+
color: #0fbd0f;
|
|
112
|
+
}
|
|
113
|
+
table.apg-state {
|
|
114
|
+
font-family: monospace;
|
|
115
|
+
margin-top: 5px;
|
|
116
|
+
font-size: 11px;
|
|
117
|
+
line-height: 130%;
|
|
118
|
+
text-align: left;
|
|
119
|
+
border: 1px solid black;
|
|
120
|
+
border-collapse: collapse;
|
|
121
|
+
}
|
|
122
|
+
table.apg-state th,
|
|
123
|
+
table.apg-state td {
|
|
124
|
+
text-align: left;
|
|
125
|
+
border: 1px solid black;
|
|
126
|
+
border-collapse: collapse;
|
|
127
|
+
}
|
|
128
|
+
table.apg-state th:nth-last-child(2),
|
|
129
|
+
table.apg-state td:nth-last-child(2) {
|
|
130
|
+
text-align: right;
|
|
131
|
+
}
|
|
132
|
+
table.apg-state caption {
|
|
133
|
+
font-size: 125%;
|
|
134
|
+
line-height: 130%;
|
|
135
|
+
font-weight: bold;
|
|
136
|
+
text-align: left;
|
|
137
|
+
}
|
|
138
|
+
table.apg-stats {
|
|
139
|
+
font-family: monospace;
|
|
140
|
+
margin-top: 5px;
|
|
141
|
+
font-size: 11px;
|
|
142
|
+
line-height: 130%;
|
|
143
|
+
text-align: right;
|
|
144
|
+
border: 1px solid black;
|
|
145
|
+
border-collapse: collapse;
|
|
146
|
+
}
|
|
147
|
+
table.apg-stats th,
|
|
148
|
+
table.apg-stats td {
|
|
149
|
+
text-align: right;
|
|
150
|
+
border: 1px solid black;
|
|
151
|
+
border-collapse: collapse;
|
|
152
|
+
}
|
|
153
|
+
table.apg-stats caption {
|
|
154
|
+
font-size: 125%;
|
|
155
|
+
line-height: 130%;
|
|
156
|
+
font-weight: bold;
|
|
157
|
+
text-align: left;
|
|
158
|
+
}
|
|
159
|
+
table.apg-trace {
|
|
160
|
+
font-family: monospace;
|
|
161
|
+
margin-top: 5px;
|
|
162
|
+
font-size: 11px;
|
|
163
|
+
line-height: 130%;
|
|
164
|
+
text-align: right;
|
|
165
|
+
border: 1px solid black;
|
|
166
|
+
border-collapse: collapse;
|
|
167
|
+
}
|
|
168
|
+
table.apg-trace caption {
|
|
169
|
+
font-size: 125%;
|
|
170
|
+
line-height: 130%;
|
|
171
|
+
font-weight: bold;
|
|
172
|
+
text-align: left;
|
|
173
|
+
}
|
|
174
|
+
table.apg-trace th,
|
|
175
|
+
table.apg-trace td {
|
|
176
|
+
text-align: right;
|
|
177
|
+
border: 1px solid black;
|
|
178
|
+
border-collapse: collapse;
|
|
179
|
+
}
|
|
180
|
+
table.apg-trace th:last-child,
|
|
181
|
+
table.apg-trace th:nth-last-child(2),
|
|
182
|
+
table.apg-trace td:last-child,
|
|
183
|
+
table.apg-trace td:nth-last-child(2) {
|
|
184
|
+
text-align: left;
|
|
185
|
+
}
|
|
186
|
+
table.apg-grammar {
|
|
187
|
+
font-family: monospace;
|
|
188
|
+
margin-top: 5px;
|
|
189
|
+
font-size: 11px;
|
|
190
|
+
line-height: 130%;
|
|
191
|
+
text-align: right;
|
|
192
|
+
border: 1px solid black;
|
|
193
|
+
border-collapse: collapse;
|
|
194
|
+
}
|
|
195
|
+
table.apg-grammar caption {
|
|
196
|
+
font-size: 125%;
|
|
197
|
+
line-height: 130%;
|
|
198
|
+
font-weight: bold;
|
|
199
|
+
text-align: left;
|
|
200
|
+
}
|
|
201
|
+
table.apg-grammar th,
|
|
202
|
+
table.apg-grammar td {
|
|
203
|
+
text-align: right;
|
|
204
|
+
border: 1px solid black;
|
|
205
|
+
border-collapse: collapse;
|
|
206
|
+
}
|
|
207
|
+
table.apg-grammar th:last-child,
|
|
208
|
+
table.apg-grammar td:last-child {
|
|
209
|
+
text-align: left;
|
|
210
|
+
}
|
|
211
|
+
table.apg-rules {
|
|
212
|
+
font-family: monospace;
|
|
213
|
+
margin-top: 5px;
|
|
214
|
+
font-size: 11px;
|
|
215
|
+
line-height: 130%;
|
|
216
|
+
text-align: right;
|
|
217
|
+
border: 1px solid black;
|
|
218
|
+
border-collapse: collapse;
|
|
219
|
+
}
|
|
220
|
+
table.apg-rules caption {
|
|
221
|
+
font-size: 125%;
|
|
222
|
+
line-height: 130%;
|
|
223
|
+
font-weight: bold;
|
|
224
|
+
text-align: left;
|
|
225
|
+
}
|
|
226
|
+
table.apg-rules th,
|
|
227
|
+
table.apg-rules td {
|
|
228
|
+
text-align: right;
|
|
229
|
+
border: 1px solid black;
|
|
230
|
+
border-collapse: collapse;
|
|
231
|
+
}
|
|
232
|
+
table.apg-rules a {
|
|
233
|
+
color: #003399 !important;
|
|
234
|
+
}
|
|
235
|
+
table.apg-rules a:hover {
|
|
236
|
+
color: #8caae6 !important;
|
|
237
|
+
}
|
|
238
|
+
table.apg-attrs {
|
|
239
|
+
font-family: monospace;
|
|
240
|
+
margin-top: 5px;
|
|
241
|
+
font-size: 11px;
|
|
242
|
+
line-height: 130%;
|
|
243
|
+
text-align: center;
|
|
244
|
+
border: 1px solid black;
|
|
245
|
+
border-collapse: collapse;
|
|
246
|
+
}
|
|
247
|
+
table.apg-attrs caption {
|
|
248
|
+
font-size: 125%;
|
|
249
|
+
line-height: 130%;
|
|
250
|
+
font-weight: bold;
|
|
251
|
+
text-align: left;
|
|
252
|
+
}
|
|
253
|
+
table.apg-attrs th,
|
|
254
|
+
table.apg-attrs td {
|
|
255
|
+
text-align: center;
|
|
256
|
+
border: 1px solid black;
|
|
257
|
+
border-collapse: collapse;
|
|
258
|
+
}
|
|
259
|
+
table.apg-attrs th:nth-child(1),
|
|
260
|
+
table.apg-attrs th:nth-child(2),
|
|
261
|
+
table.apg-attrs th:nth-child(3) {
|
|
262
|
+
text-align: right;
|
|
263
|
+
}
|
|
264
|
+
table.apg-attrs td:nth-child(1),
|
|
265
|
+
table.apg-attrs td:nth-child(2),
|
|
266
|
+
table.apg-attrs td:nth-child(3) {
|
|
267
|
+
text-align: right;
|
|
268
|
+
}
|
|
269
|
+
table.apg-attrs a {
|
|
270
|
+
color: #003399 !important;
|
|
271
|
+
}
|
|
272
|
+
table.apg-attrs a:hover {
|
|
273
|
+
color: #8caae6 !important;
|
|
274
|
+
}
|
|
275
|
+
`},"emittcss"),"emittcss")}}),Qu=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/utilities.js"(e){var t=mm(),r=Cx(),n=Ix(),s=qs(),o="utilities.js: ",c=e,l=a(function(p,v,b){let y,A=v,C=!0;for(;C;){if(p<=0){A=0,y=0;break}if(typeof A!="number"){A=0,y=p;break}if(A>=p){A=p,y=p;break}if(typeof b!="number"){y=p;break}if(y=A+b,y>p){y=p;break}break}return{beg:A,end:y}},"getBounds");e.htmlToPage=function(p,v){let b;if(typeof p!="string")throw new Error(`${o}htmlToPage: input HTML is not a string`);typeof v!="string"?b="htmlToPage":b=v;let y="";return y+=`<!DOCTYPE html>
|
|
276
|
+
`,y+=`<html lang="en">
|
|
277
|
+
`,y+=`<head>
|
|
278
|
+
`,y+=`<meta charset="utf-8">
|
|
279
|
+
`,y+=`<title>${b}</title>
|
|
280
|
+
`,y+=`<style>
|
|
281
|
+
`,y+=n(),y+=`</style>
|
|
282
|
+
`,y+=`</head>
|
|
283
|
+
<body>
|
|
284
|
+
`,y+=`<p>${new Date}</p>
|
|
285
|
+
`,y+=p,y+=`</body>
|
|
286
|
+
</html>
|
|
287
|
+
`,y},e.parserResultToHtml=function(p,v){let b=null;typeof v=="string"&&v!==""&&(b=v);let y,A;p.success===!0?y=`<span class="${t.CLASS_MATCH}">true</span>`:y=`<span class="${t.CLASS_NOMATCH}">false</span>`,p.state===s.EMPTY?A=`<span class="${t.CLASS_EMPTY}">EMPTY</span>`:p.state===s.MATCH?A=`<span class="${t.CLASS_MATCH}">MATCH</span>`:p.state===s.NOMATCH?A=`<span class="${t.CLASS_NOMATCH}">NOMATCH</span>`:A=`<span class="${t.CLASS_NOMATCH}">unrecognized</span>`;let C="";return C+=`<table class="${t.CLASS_STATE}">
|
|
288
|
+
`,b&&(C+=`<caption>${b}</caption>
|
|
289
|
+
`),C+=`<tr><th>state item</th><th>value</th><th>description</th></tr>
|
|
290
|
+
`,C+=`<tr><td>parser success</td><td>${y}</td>
|
|
291
|
+
`,C+=`<td><span class="${t.CLASS_MATCH}">true</span> if the parse succeeded,
|
|
292
|
+
`,C+=` <span class="${t.CLASS_NOMATCH}">false</span> otherwise`,C+=`<br><i>NOTE: for success, entire string must be matched</i></td></tr>
|
|
293
|
+
`,C+=`<tr><td>parser state</td><td>${A}</td>
|
|
294
|
+
`,C+=`<td><span class="${t.CLASS_EMPTY}">EMPTY</span>, `,C+=`<span class="${t.CLASS_MATCH}">MATCH</span> or
|
|
295
|
+
`,C+=`<span class="${t.CLASS_NOMATCH}">NOMATCH</span></td></tr>
|
|
296
|
+
`,C+=`<tr><td>string length</td><td>${p.length}</td><td>length of the input (sub)string</td></tr>
|
|
297
|
+
`,C+=`<tr><td>matched length</td><td>${p.matched}</td><td>number of input string characters matched</td></tr>
|
|
298
|
+
`,C+=`<tr><td>max matched</td><td>${p.maxMatched}</td><td>maximum number of input string characters matched</td></tr>
|
|
299
|
+
`,C+=`<tr><td>max tree depth</td><td>${p.maxTreeDepth}</td><td>maximum depth of the parse tree reached</td></tr>
|
|
300
|
+
`,C+=`<tr><td>node hits</td><td>${p.nodeHits}</td><td>number of parse tree node hits (opcode function calls)</td></tr>
|
|
301
|
+
`,C+=`<tr><td>input length</td><td>${p.inputLength}</td><td>length of full input string</td></tr>
|
|
302
|
+
`,C+=`<tr><td>sub-string begin</td><td>${p.subBegin}</td><td>sub-string first character index</td></tr>
|
|
303
|
+
`,C+=`<tr><td>sub-string end</td><td>${p.subEnd}</td><td>sub-string end-of-string index</td></tr>
|
|
304
|
+
`,C+=`<tr><td>sub-string length</td><td>${p.subLength}</td><td>sub-string length</td></tr>
|
|
305
|
+
`,C+=`</table>
|
|
306
|
+
`,C},e.charsToString=function(p,v,b){let y,A;if(typeof v=="number"){if(v>=p.length)return"";y=v<0?0:v}else y=0;if(typeof b=="number"){if(b<=0)return"";A=b>p.length-y?p.length:y+b}else A=p.length;return y<A?r.encode("UTF16LE",p.slice(y,A)).toString("utf16le"):""},e.stringToChars=function(p){return r.decode("STRING",p)},e.opcodeToString=function(p){let v="unknown";switch(p){case s.ALT:v="ALT";break;case s.CAT:v="CAT";break;case s.RNM:v="RNM";break;case s.UDT:v="UDT";break;case s.AND:v="AND";break;case s.NOT:v="NOT";break;case s.REP:v="REP";break;case s.TRG:v="TRG";break;case s.TBS:v="TBS";break;case s.TLS:v="TLS";break;case s.BKR:v="BKR";break;case s.BKA:v="BKA";break;case s.BKN:v="BKN";break;case s.ABG:v="ABG";break;case s.AEN:v="AEN";break;default:throw new Error("unrecognized opcode")}return v},e.stateToString=function(p){let v="unknown";switch(p){case s.ACTIVE:v="ACTIVE";break;case s.MATCH:v="MATCH";break;case s.EMPTY:v="EMPTY";break;case s.NOMATCH:v="NOMATCH";break;default:throw new Error("unrecognized state")}return v},e.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"],e.charToHex=function(p){let v=p.toString(16).toUpperCase();switch(v.length){case 1:case 3:case 7:v=`0${v}`;break;case 2:case 6:v=`00${v}`;break;case 4:break;case 5:v=`000${v}`;break;default:throw new Error("unrecognized option")}return v},e.charsToDec=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToDec: input must be an array of integers`);let A=l(p.length,v,b);if(A.end>A.beg){y+=p[A.beg];for(let C=A.beg+1;C<A.end;C+=1)y+=`,${p[C]}`}return y},e.charsToHex=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToHex: input must be an array of integers`);let A=l(p.length,v,b);if(A.end>A.beg){y+=`\\x${c.charToHex(p[A.beg])}`;for(let C=A.beg+1;C<A.end;C+=1)y+=`,\\x${c.charToHex(p[C])}`}return y},e.charsToHtmlEntities=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToHex: input must be an array of integers`);let A=l(p.length,v,b);if(A.end>A.beg)for(let C=A.beg;C<A.end;C+=1)y+=`&#x${p[C].toString(16)};`;return y};function h(p){return!(p>=55296&&p<=57343||p>1114111)}i(h,"isUnicode"),a(h,"isUnicode"),e.charsToUnicode=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToUnicode: input must be an array of integers`);let A=l(p.length,v,b);if(A.end>A.beg)for(let C=A.beg;C<A.end;C+=1)h(p[C])?y+=`&#${p[C]};`:y+=` U+${c.charToHex(p[C])}`;return y},e.charsToJsUnicode=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToJsUnicode: input must be an array of integers`);let A=l(p.length,v,b);if(A.end>A.beg){y+=`\\u${c.charToHex(p[A.beg])}`;for(let C=A.beg+1;C<A.end;C+=1)y+=`,\\u${c.charToHex(p[C])}`}return y},e.charsToAscii=function(p,v,b){let y="";if(!Array.isArray(p))throw new Error(`${o}charsToAscii: input must be an array of integers`);let A=l(p.length,v,b);for(let C=A.beg;C<A.end;C+=1){let O=p[C];O>=32&&O<=126?y+=String.fromCharCode(O):y+=`\\x${c.charToHex(O)}`}return y},e.charsToAsciiHtml=function(p,v,b){if(!Array.isArray(p))throw new Error(`${o}charsToAsciiHtml: input must be an array of integers`);let y="",A,C=l(p.length,v,b);for(let O=C.beg;O<C.end;O+=1)A=p[O],A<32||A===127?y+=`<span class="${t.CLASS_CTRLCHAR}">${c.asciiChars[A]}</span>`:A>127?y+=`<span class="${t.CLASS_CTRLCHAR}">U+${c.charToHex(A)}</span>`:y+=c.asciiChars[A];return y},e.stringToAsciiHtml=function(p){let v=r.decode("STRING",p);return this.charsToAsciiHtml(v)}}}),I$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/ast.js"(e,t){t.exports=a(i(function(){let n=qs(),s=Qu(),o="ast.js: ",c=this,l=null,h=null,p=null,v=0,b=[],y=[],A=[],C=[];this.callbacks=[],this.astObject="astObject",this.init=a(i(function(L,K,$){A.length=0,C.length=0,b.length=0,v=0,l=L,h=K,p=$;let j,V=[];for(j=0;j<l.length;j+=1)V.push(l[j].lower);for(j=0;j<h.length;j+=1)V.push(h[j].lower);for(v=l.length+h.length,j=0;j<v;j+=1)b[j]=!1,y[j]=null;for(let G in c.callbacks){let k=G.toLowerCase();if(j=V.indexOf(k),j<0)throw new Error(`${o}init: node '${G}' not a rule or udt name`);typeof c.callbacks[G]=="function"&&(b[j]=!0,y[j]=c.callbacks[G]),c.callbacks[G]===!0&&(b[j]=!0)}},"init2"),"init"),this.ruleDefined=a(i(function(L){return b[L]!==!1},"ruleDefined"),"ruleDefined"),this.udtDefined=a(i(function(L){return b[l.length+L]!==!1},"udtDefined"),"udtDefined"),this.down=a(i(function(L,K){let $=C.length;return A.push($),C.push({name:K,thisIndex:$,thatIndex:null,state:n.SEM_PRE,callbackIndex:L,phraseIndex:null,phraseLength:null,stack:A.length}),$},"down"),"down"),this.up=a(i(function(L,K,$,j){let V=C.length,G=A.pop();return C.push({name:K,thisIndex:V,thatIndex:G,state:n.SEM_POST,callbackIndex:L,phraseIndex:$,phraseLength:j,stack:A.length}),C[G].thatIndex=V,C[G].phraseIndex=$,C[G].phraseLength=j,V},"up"),"up"),this.translate=a(i(function(L){let K,$,j;for(let V=0;V<C.length;V+=1)j=C[V],$=y[j.callbackIndex],j.state===n.SEM_PRE?$!==null&&(K=$(n.SEM_PRE,p,j.phraseIndex,j.phraseLength,L),K===n.SEM_SKIP&&(V=j.thatIndex)):$!==null&&$(n.SEM_POST,p,j.phraseIndex,j.phraseLength,L)},"translate"),"translate"),this.setLength=a(i(function(L){C.length=L,L>0?A.length=C[L-1].stack:A.length=0},"setLength"),"setLength"),this.getLength=a(i(function(){return C.length},"getLength2"),"getLength");function O(R){let L="";for(let K=0;K<R;K+=1)L+=" ";return L}i(O,"indent"),a(O,"indent"),this.toXml=a(i(function(L){let K=s.charsToDec,$="decimal integer character codes";if(typeof L=="string"&&L.length>=3){let G=L.slice(0,3).toLowerCase();G==="asc"?(K=s.charsToAscii,$="ASCII for printing characters, hex for non-printing"):G==="hex"?(K=s.charsToHex,$="hexadecimal integer character codes"):G==="uni"&&(K=s.charsToUnicode,$="Unicode UTF-32 integer character codes")}let j="",V=0;return j+=`<?xml version="1.0" encoding="utf-8"?>
|
|
307
|
+
`,j+=`<root nodes="${C.length/2}" characters="${p.length}">
|
|
308
|
+
`,j+=`<!-- input string, ${$} -->
|
|
309
|
+
`,j+=O(V+2),j+=K(p),j+=`
|
|
310
|
+
`,C.forEach(G=>{G.state===n.SEM_PRE?(V+=1,j+=O(V),j+=`<node name="${G.name}" index="${G.phraseIndex}" length="${G.phraseLength}">
|
|
311
|
+
`,j+=O(V+2),j+=K(p,G.phraseIndex,G.phraseLength),j+=`
|
|
312
|
+
`):(j+=O(V),j+=`</node><!-- name="${G.name}" -->
|
|
313
|
+
`,V-=1)}),j+=`</root>
|
|
314
|
+
`,j},"toSml"),"toSml"),this.phrases=a(i(function(){let L={},K,$;for(K=0;K<C.length;K+=1)$=C[K],$.state===n.SEM_PRE&&(Array.isArray(L[$.name])||(L[$.name]=[]),L[$.name].push({index:$.phraseIndex,length:$.phraseLength}));return L},"phrases"),"phrases")},"exportsAst"),"exportsAst")}}),Dx=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/circular-buffer.js"(e,t){t.exports=a(i(function(){let n="circular-buffer.js: ",s=-1,o=0;this.init=a(i(function(l){if(typeof l!="number"||l<=0)throw new Error(`${n}init: circular buffer size must an integer > 0`);o=Math.ceil(l),s=-1},"init2"),"init"),this.increment=a(i(function(){return s+=1,(s+o)%o},"increment"),"increment"),this.maxSize=a(i(function(){return o},"maxSize"),"maxSize"),this.items=a(i(function(){return s+1},"items"),"items"),this.getListIndex=a(i(function(l){return s===-1||l<0||l>s||s-l>=o?-1:(l+o)%o},"getListIndex"),"getListIndex"),this.forEach=a(i(function(l){if(s!==-1){if(s<o){for(let h=0;h<=s;h+=1)l(h,h);return}for(let h=s-o+1;h<=s;h+=1){let p=(h+o)%o;l(p,h)}}},"forEach"),"forEach")},"exportsCircularBuffer"),"exportsCircularBuffer")}}),D$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/parser.js"(e,t){t.exports=a(i(function(){let n=qs(),s=Qu(),o="parser.js: ",c=this,l;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let h=null,p=null,v,b,y,A,C=0,O=0,R=0,L=null,K=null,$=null,j=null,V=null,G=0,k=1/0,H=1/0,se=a(i(function(ce,Z,re){let ye=`${o}evaluateRule(): `;if(ce>=$.length)throw new Error(`${ye}rule index: ${ce} out of range`);if(Z>=y)throw new Error(`${ye}phrase index: ${Z} out of range`);let{length:Se}=h;h.push({type:n.RNM,index:ce}),l(Se,Z,re),h.pop()},"evaluateRule2"),"evaluateRule"),ue=a(function(fe,ce,Z){let re=`${o}evaluateUdt(): `;if(fe>=j.length)throw new Error(`${re}udt index: ${fe} out of range`);if(ce>=y)throw new Error(`${re}phrase index: ${ce} out of range`);let{length:ye}=h;h.push({type:n.UDT,empty:j[fe].empty,index:fe}),l(ye,ce,Z),h.pop()},"evaluateUdt"),me=a(function(){C=0,O=0,R=0,G=0,A=[{lookAround:n.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],$=null,j=null,p=null,v=0,b=0,y=0,L=null,K=null,V=null,h=null},"clear"),q=a(function(){let fe=[],ce=a(function(){let re={};$.forEach(ye=>{ye.isBkr&&(re[ye.lower]=null)}),j.length>0&&j.forEach(ye=>{ye.isBkr&&(re[ye.lower]=null)}),fe.push(re)},"init"),Z=a(function(){let re=fe[fe.length-1],ye={};for(let Se in re)ye[Se]=re[Se];return ye},"copy");this.push=a(i(function(){fe.push(Z())},"push"),"push"),this.pop=a(i(function(ye){let Se=ye;if(Se||(Se=fe.length-1),Se<1||Se>fe.length)throw new Error(`${o}backRef.pop(): bad length: ${Se}`);return fe.length=Se,fe[fe.length-1]},"pop"),"pop"),this.length=a(i(function(){return fe.length},"length2"),"length"),this.savePhrase=a(i(function(ye,Se,xe){fe[fe.length-1][ye]={phraseIndex:Se,phraseLength:xe}},"savePhrase"),"savePhrase"),this.getPhrase=function(re){return fe[fe.length-1][re]},ce()},"backRef"),E=a(i(function(){let ce=this;this.state=n.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=A[A.length-1],this.uFrame=new q,this.pFrame=new q,this.evaluateRule=se,this.evaluateUdt=ue,this.refresh=a(i(function(){ce.state=n.ACTIVE,ce.phraseLength=0,ce.lookAround=A[A.length-1]},"refresh"),"refresh")},"systemData2"),"systemData"),T=a(i(function(){return A[A.length-1]},"lookAroundValue2"),"lookAroundValue"),m=a(i(function(){return A.length>1},"inLookAround2"),"inLookAround"),d=a(function(){return A[A.length-1].lookAround===n.LOOKAROUND_BEHIND},"inLookBehind"),g=a(function(){let fe=`${o}initializeAst(): `,ce=!0;for(;ce;){if(c.ast===void 0){c.ast=null;break}if(c.ast===null)break;if(c.ast.astObject!=="astObject")throw new Error(`${fe}ast object not recognized`);break}c.ast!==null&&c.ast.init($,j,p)},"initializeAst"),_=a(function(){let fe=`${o}initializeTrace(): `,ce=!0;for(;ce;){if(c.trace===void 0){c.trace=null;break}if(c.trace===null)break;if(c.trace.traceObject!=="traceObject")throw new Error(`${fe}trace object not recognized`);break}c.trace!==null&&c.trace.init($,j,p)},"initializeTrace"),M=a(function(){let fe=`${o}initializeStats(): `,ce=!0;for(;ce;){if(c.stats===void 0){c.stats=null;break}if(c.stats===null)break;if(c.stats.statsObject!=="statsObject")throw new Error(`${fe}stats object not recognized`);break}c.stats!==null&&c.stats.init($,j)},"initializeStats"),S=a(function(fe){let ce=`${o}initializeGrammar(): `;if(!fe)throw new Error(`${ce}grammar object undefined`);if(fe.grammarObject!=="grammarObject")throw new Error(`${ce}bad grammar object`);$=fe.rules,j=fe.udts},"initializeGrammar"),w=a(function(fe){let ce=`${o}initializeStartRule(): `,Z=null;if(typeof fe=="number"){if(fe>=$.length)throw new Error(`${ce}start rule index too large: max: ${$.length}: index: ${fe}`);Z=fe}else if(typeof fe=="string"){let re=fe.toLowerCase();for(let ye=0;ye<$.length;ye+=1)if(re===$[ye].lower){Z=$[ye].index;break}if(Z===null)throw new Error(`${ce}start rule name '${fe}' not recognized`)}else throw new Error(`${ce}type of start rule '${typeof fe}' not recognized`);return Z},"initializeStartRule"),N=a(i(function(ce,Z,re){let ye=`${o}initializeInputChars(): `,Se=ce,xe=Z,ke=re;if(Se===void 0)throw new Error(`${ye}input string is undefined`);if(Se===null)throw new Error(`${ye}input string is null`);if(typeof Se=="string")Se=s.stringToChars(Se);else if(!Array.isArray(Se))throw new Error(`${ye}input string is not a string or array`);if(Se.length>0&&typeof Se[0]!="number")throw new Error(`${ye}input string not an array of integers`);if(typeof xe!="number")xe=0;else if(xe=Math.floor(xe),xe<0||xe>Se.length)throw new Error(`${ye}input beginning index out of range: ${xe}`);if(typeof ke!="number")ke=Se.length-xe;else if(ke=Math.floor(ke),ke<0||ke>Se.length-xe)throw new Error(`${ye}input length out of range: ${ke}`);p=Se,v=xe,b=ke,y=v+b},"initializeInputChars2"),"initializeInputChars"),B=a(function(){let fe=`${o}initializeCallbacks(): `,ce;for(L=[],K=[],ce=0;ce<$.length;ce+=1)L[ce]=null;for(ce=0;ce<j.length;ce+=1)K[ce]=null;let Z,re=[];for(ce=0;ce<$.length;ce+=1)re.push($[ce].lower);for(ce=0;ce<j.length;ce+=1)re.push(j[ce].lower);for(let ye in c.callbacks){if(ce=re.indexOf(ye.toLowerCase()),ce<0)throw new Error(`${fe}syntax callback '${ye}' not a rule or udt name`);if(Z=c.callbacks[ye],Z||(Z=null),typeof Z=="function"||Z===null)ce<$.length?L[ce]=Z:K[ce-$.length]=Z;else throw new Error(`${fe}syntax callback[${ye}] must be function reference or 'false' (false/null/undefined/etc.)`)}for(ce=0;ce<j.length;ce+=1)if(K[ce]===null)throw new Error(`${fe}all UDT callbacks must be defined. UDT callback[${j[ce].lower}] not a function reference`)},"initializeCallbacks");this.setMaxTreeDepth=function(fe){if(typeof fe!="number")throw new Error(`parser: max tree depth must be integer > 0: ${fe}`);if(k=Math.floor(fe),k<=0)throw new Error(`parser: max tree depth must be integer > 0: ${fe}`)},this.setMaxNodeHits=function(fe){if(typeof fe!="number")throw new Error(`parser: max node hits must be integer > 0: ${fe}`);if(H=Math.floor(fe),H<=0)throw new Error(`parser: max node hits must be integer > 0: ${fe}`)};let D=a(function(fe,ce,Z){let re,ye=`${o}parse(): `;S(fe);let Se=w(ce);B(),_(),M(),g();let xe=new E;switch(Z!=null&&(V=Z),h=[{type:n.RNM,index:Se}],l(0,v,xe),h=null,xe.state){case n.ACTIVE:throw new Error(`${ye}final state should never be 'ACTIVE'`);case n.NOMATCH:re=!1;break;case n.EMPTY:case n.MATCH:xe.phraseLength===b?re=!0:re=!1;break;default:throw new Error("unrecognized state")}return{success:re,state:xe.state,length:b,matched:xe.phraseLength,maxMatched:G,maxTreeDepth:O,nodeHits:R,inputLength:p.length,subBegin:v,subEnd:y,subLength:b}},"privateParse");this.parseSubstring=a(i(function(ce,Z,re,ye,Se,xe){return me(),N(re,ye,Se),D(ce,Z,xe)},"parseSubstring"),"parseSubstring"),this.parse=a(i(function(ce,Z,re,ye){return me(),N(re,0,re.length),D(ce,Z,ye)},"parse2"),"parse");let F=a(function(fe,ce,Z){let re=h[fe];for(let ye=0;ye<re.children.length&&(l(re.children[ye],ce,Z),Z.state===n.NOMATCH);ye+=1);},"opALT"),le=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe],Mt=Z.uFrame.length(),qe=Z.pFrame.length();c.ast&&(ye=c.ast.getLength()),re=!0,Se=ce,xe=0;for(let He=0;He<ke.children.length;He+=1)if(l(ke.children[He],Se,Z),Z.state===n.NOMATCH){re=!1;break}else Se+=Z.phraseLength,xe+=Z.phraseLength;re?(Z.state=xe===0?n.EMPTY:n.MATCH,Z.phraseLength=xe):(Z.state=n.NOMATCH,Z.phraseLength=0,Z.uFrame.pop(Mt),Z.pFrame.pop(qe),c.ast&&c.ast.setLength(ye))},"opCAT"),P=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe];ye=ce,Se=0,xe=0;let Mt=Z.uFrame.length(),qe=Z.pFrame.length();c.ast&&(re=c.ast.getLength());let He=!0;for(;He&&!(ye>=y||(l(fe+1,ye,Z),Z.state===n.NOMATCH)||Z.state===n.EMPTY||(xe+=1,Se+=Z.phraseLength,ye+=Z.phraseLength,xe===ke.max)););Z.state===n.EMPTY||xe>=ke.min?(Z.state=Se===0?n.EMPTY:n.MATCH,Z.phraseLength=Se):(Z.state=n.NOMATCH,Z.phraseLength=0,Z.uFrame.pop(Mt),Z.pFrame.pop(qe),c.ast&&c.ast.setLength(re))},"opREP"),Y=a(function(fe,ce,Z,re){if(ce.phraseLength>Z){let ye=`${o}opRNM(${fe.name}): callback function error: `;throw ye+=`sysData.phraseLength: ${ce.phraseLength}`,ye+=` must be <= remaining chars: ${Z}`,new Error(ye)}switch(ce.state){case n.ACTIVE:if(re!==!0)throw new Error(`${o}opRNM(${fe.name}): callback function return error. ACTIVE state not allowed.`);break;case n.EMPTY:ce.phraseLength=0;break;case n.MATCH:ce.phraseLength===0&&(ce.state=n.EMPTY);break;case n.NOMATCH:ce.phraseLength=0;break;default:throw new Error(`${o}opRNM(${fe.name}): callback function return error. Unrecognized return state: ${ce.state}`)}},"validateRnmCallbackResult"),J=a(function(fe,ce,Z){let re,ye,Se,xe,ke,Mt,qe=h[fe],He=$[qe.index],Ot=L[He.index],dt=!m();if(dt&&(ye=c.ast&&c.ast.ruleDefined(qe.index),ye&&(re=c.ast.getLength(),c.ast.down(qe.index,$[qe.index].name)),xe=Z.uFrame.length(),ke=Z.pFrame.length(),Z.uFrame.push(),Z.pFrame.push(),Mt=Z.pFrame,Z.pFrame=new q),Ot===null)Se=h,h=He.opcodes,l(0,ce,Z),h=Se;else{let vt=y-ce;Z.ruleIndex=He.index,Ot(Z,p,ce,V),Y(He,Z,vt,!0),Z.state===n.ACTIVE&&(Se=h,h=He.opcodes,l(0,ce,Z),h=Se,Z.ruleIndex=He.index,Ot(Z,p,ce,V),Y(He,Z,vt,!1))}dt&&(ye&&(Z.state===n.NOMATCH?c.ast.setLength(re):c.ast.up(qe.index,He.name,ce,Z.phraseLength)),Z.pFrame=Mt,Z.state===n.NOMATCH?(Z.uFrame.pop(xe),Z.pFrame.pop(ke)):He.isBkr&&(Z.pFrame.savePhrase(He.lower,ce,Z.phraseLength),Z.uFrame.savePhrase(He.lower,ce,Z.phraseLength)))},"opRNM"),I=a(function(fe,ce,Z){if(ce.phraseLength>Z){let re=`${o}opUDT(${fe.name}): callback function error: `;throw re+=`sysData.phraseLength: ${ce.phraseLength}`,re+=` must be <= remaining chars: ${Z}`,new Error(re)}switch(ce.state){case n.ACTIVE:throw new Error(`${o}opUDT(${fe.name}): callback function return error. ACTIVE state not allowed.`);case n.EMPTY:if(fe.empty===!1)throw new Error(`${o}opUDT(${fe.name}): callback function return error. May not return EMPTY.`);ce.phraseLength=0;break;case n.MATCH:if(ce.phraseLength===0){if(fe.empty===!1)throw new Error(`${o}opUDT(${fe.name}): callback function return error. May not return EMPTY.`);ce.state=n.EMPTY}break;case n.NOMATCH:ce.phraseLength=0;break;default:throw new Error(`${o}opUDT(${fe.name}): callback function return error. Unrecognized return state: ${ce.state}`)}},"validateUdtCallbackResult"),z=a(function(fe,ce,Z){let re,ye,Se,xe,ke,Mt,qe=h[fe],He=j[qe.index];Z.UdtIndex=He.index;let Ot=!m();Ot&&(Se=c.ast&&c.ast.udtDefined(qe.index),Se&&(ye=$.length+qe.index,re=c.ast.getLength(),c.ast.down(ye,He.name)),xe=Z.uFrame.length(),ke=Z.pFrame.length(),Z.uFrame.push(),Z.pFrame.push(),Mt=Z.pFrame,Z.pFrame=new q);let dt=y-ce;K[qe.index](Z,p,ce,V),I(He,Z,dt),Ot&&(Se&&(Z.state===n.NOMATCH?c.ast.setLength(re):c.ast.up(ye,He.name,ce,Z.phraseLength)),Z.pFrame=Mt,Z.state===n.NOMATCH?(Z.uFrame.pop(xe),Z.pFrame.pop(ke)):He.isBkr&&(Z.pFrame.savePhrase(He.lower,ce,Z.phraseLength),Z.uFrame.savePhrase(He.lower,ce,Z.phraseLength)))},"opUDT"),te=a(function(fe,ce,Z){A.push({lookAround:n.LOOKAROUND_AHEAD,anchor:ce,charsEnd:y,charsLength:b}),y=p.length,b=p.length-v,l(fe+1,ce,Z);let re=A.pop();switch(y=re.charsEnd,b=re.charsLength,Z.phraseLength=0,Z.state){case n.EMPTY:Z.state=n.EMPTY;break;case n.MATCH:Z.state=n.EMPTY;break;case n.NOMATCH:Z.state=n.NOMATCH;break;default:throw new Error(`opAND: invalid state ${Z.state}`)}},"opAND"),ae=a(function(fe,ce,Z){A.push({lookAround:n.LOOKAROUND_AHEAD,anchor:ce,charsEnd:y,charsLength:b}),y=p.length,b=p.length-v,l(fe+1,ce,Z);let re=A.pop();switch(y=re.charsEnd,b=re.charsLength,Z.phraseLength=0,Z.state){case n.EMPTY:case n.MATCH:Z.state=n.NOMATCH;break;case n.NOMATCH:Z.state=n.EMPTY;break;default:throw new Error(`opNOT: invalid state ${Z.state}`)}},"opNOT"),ve=a(function(fe,ce,Z){let re=h[fe];Z.state=n.NOMATCH,ce<y&&re.min<=p[ce]&&p[ce]<=re.max&&(Z.state=n.MATCH,Z.phraseLength=1)},"opTRG"),De=a(function(fe,ce,Z){let re,ye=h[fe],Se=ye.string.length;if(Z.state=n.NOMATCH,ce+Se<=y){for(re=0;re<Se;re+=1)if(p[ce+re]!==ye.string[re])return;Z.state=n.MATCH,Z.phraseLength=Se}},"opTBS"),we=a(function(fe,ce,Z){let re,ye,Se=h[fe];Z.state=n.NOMATCH;let xe=Se.string.length;if(xe===0){Z.state=n.EMPTY;return}if(ce+xe<=y){for(re=0;re<xe;re+=1)if(ye=p[ce+re],ye>=65&&ye<=90&&(ye+=32),ye!==Se.string[re])return;Z.state=n.MATCH,Z.phraseLength=xe}},"opTLS"),de=a(function(fe,ce,Z){Z.state=n.NOMATCH,Z.phraseLength=0,Z.state=ce===0?n.EMPTY:n.NOMATCH},"opABG"),Ce=a(function(fe,ce,Z){Z.state=n.NOMATCH,Z.phraseLength=0,Z.state=ce===p.length?n.EMPTY:n.NOMATCH},"opAEN"),pe=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe];Z.state=n.NOMATCH,ke.index<$.length?xe=$[ke.index].lower:xe=j[ke.index-$.length].lower;let Mt=ke.bkrMode===n.BKR_MODE_PM?Z.pFrame.getPhrase(xe):Z.uFrame.getPhrase(xe),qe=ke.bkrCase===n.BKR_MODE_CI;if(Mt===null)return;let He=Mt.phraseIndex,Ot=Mt.phraseLength;if(Ot===0){Z.state=n.EMPTY;return}if(ce+Ot<=y){if(qe){for(re=0;re<Ot;re+=1)if(ye=p[ce+re],Se=p[He+re],ye>=65&&ye<=90&&(ye+=32),Se>=65&&Se<=90&&(Se+=32),ye!==Se)return;Z.state=n.MATCH,Z.phraseLength=Ot}else for(re=0;re<Ot;re+=1)if(ye=p[ce+re],Se=p[He+re],ye!==Se)return;Z.state=n.MATCH,Z.phraseLength=Ot}},"opBKR"),_e=a(function(fe,ce,Z){switch(A.push({lookAround:n.LOOKAROUND_BEHIND,anchor:ce}),l(fe+1,ce,Z),A.pop(),Z.phraseLength=0,Z.state){case n.EMPTY:Z.state=n.EMPTY;break;case n.MATCH:Z.state=n.EMPTY;break;case n.NOMATCH:Z.state=n.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${Z.state}`)}},"opBKA"),Q=a(function(fe,ce,Z){switch(A.push({lookAround:n.LOOKAROUND_BEHIND,anchor:ce}),l(fe+1,ce,Z),A.pop(),Z.phraseLength=0,Z.state){case n.EMPTY:case n.MATCH:Z.state=n.NOMATCH;break;case n.NOMATCH:Z.state=n.EMPTY;break;default:throw new Error(`opBKN: invalid state ${Z.state}`)}},"opBKN"),ge=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe],Mt=Z.uFrame.length(),qe=Z.pFrame.length();c.ast&&(ye=c.ast.getLength()),re=!0,Se=ce,xe=0;for(let He=ke.children.length-1;He>=0;He-=1)if(l(ke.children[He],Se,Z),Se-=Z.phraseLength,xe+=Z.phraseLength,Z.state===n.NOMATCH){re=!1;break}re?(Z.state=xe===0?n.EMPTY:n.MATCH,Z.phraseLength=xe):(Z.state=n.NOMATCH,Z.phraseLength=0,Z.uFrame.pop(Mt),Z.pFrame.pop(qe),c.ast&&c.ast.setLength(ye))},"opCATBehind"),Me=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe];ye=ce,Se=0,xe=0;let Mt=Z.uFrame.length(),qe=Z.pFrame.length();c.ast&&(re=c.ast.getLength());let He=!0;for(;He&&!(ye<=0||(l(fe+1,ye,Z),Z.state===n.NOMATCH)||Z.state===n.EMPTY||(xe+=1,Se+=Z.phraseLength,ye-=Z.phraseLength,xe===ke.max)););Z.state===n.EMPTY||xe>=ke.min?(Z.state=Se===0?n.EMPTY:n.MATCH,Z.phraseLength=Se):(Z.state=n.NOMATCH,Z.phraseLength=0,Z.uFrame.pop(Mt),Z.pFrame.pop(qe),c.ast&&c.ast.setLength(re))},"opREPBehind"),Ue=a(function(fe,ce,Z){let re=h[fe];if(Z.state=n.NOMATCH,Z.phraseLength=0,ce>0){let ye=p[ce-1];re.min<=ye&&ye<=re.max&&(Z.state=n.MATCH,Z.phraseLength=1)}},"opTRGBehind"),Re=a(function(fe,ce,Z){let re,ye=h[fe];Z.state=n.NOMATCH;let Se=ye.string.length,xe=ce-Se;if(xe>=0){for(re=0;re<Se;re+=1)if(p[xe+re]!==ye.string[re])return;Z.state=n.MATCH,Z.phraseLength=Se}},"opTBSBehind"),je=a(function(fe,ce,Z){let re,ye=h[fe];Z.state=n.NOMATCH;let Se=ye.string.length;if(Se===0){Z.state=n.EMPTY;return}let xe=ce-Se;if(xe>=0){for(let ke=0;ke<Se;ke+=1)if(re=p[xe+ke],re>=65&&re<=90&&(re+=32),re!==ye.string[ke])return;Z.state=n.MATCH,Z.phraseLength=Se}},"opTLSBehind"),rt=a(function(fe,ce,Z){let re,ye,Se,xe,ke=h[fe];Z.state=n.NOMATCH,Z.phraseLength=0,ke.index<$.length?xe=$[ke.index].lower:xe=j[ke.index-$.length].lower;let Mt=ke.bkrMode===n.BKR_MODE_PM?Z.pFrame.getPhrase(xe):Z.uFrame.getPhrase(xe),qe=ke.bkrCase===n.BKR_MODE_CI;if(Mt===null)return;let He=Mt.phraseIndex,Ot=Mt.phraseLength;if(Ot===0){Z.state=n.EMPTY,Z.phraseLength=0;return}let dt=ce-Ot;if(dt>=0){if(qe){for(re=0;re<Ot;re+=1)if(ye=p[dt+re],Se=p[He+re],ye>=65&&ye<=90&&(ye+=32),Se>=65&&Se<=90&&(Se+=32),ye!==Se)return;Z.state=n.MATCH,Z.phraseLength=Ot}else for(re=0;re<Ot;re+=1)if(ye=p[dt+re],Se=p[He+re],ye!==Se)return;Z.state=n.MATCH,Z.phraseLength=Ot}},"opBKRBehind");l=a(i(function(ce,Z,re){let ye=!0,Se=h[ce];if(R+=1,R>H)throw new Error(`parser: maximum number of node hits exceeded: ${H}`);if(C+=1,C>O&&(O=C,O>k))throw new Error(`parser: maximum parse tree depth exceeded: ${k}`);if(re.refresh(),c.trace!==null){let xe=T();c.trace.down(Se,re.state,Z,re.phraseLength,xe.anchor,xe.lookAround)}if(d())switch(Se.type){case n.ALT:F(ce,Z,re);break;case n.CAT:ge(ce,Z,re);break;case n.REP:Me(ce,Z,re);break;case n.RNM:J(ce,Z,re);break;case n.UDT:z(ce,Z,re);break;case n.AND:te(ce,Z,re);break;case n.NOT:ae(ce,Z,re);break;case n.TRG:Ue(ce,Z,re);break;case n.TBS:Re(ce,Z,re);break;case n.TLS:je(ce,Z,re);break;case n.BKR:rt(ce,Z,re);break;case n.BKA:_e(ce,Z,re);break;case n.BKN:Q(ce,Z,re);break;case n.ABG:de(ce,Z,re);break;case n.AEN:Ce(ce,Z,re);break;default:ye=!1;break}else switch(Se.type){case n.ALT:F(ce,Z,re);break;case n.CAT:le(ce,Z,re);break;case n.REP:P(ce,Z,re);break;case n.RNM:J(ce,Z,re);break;case n.UDT:z(ce,Z,re);break;case n.AND:te(ce,Z,re);break;case n.NOT:ae(ce,Z,re);break;case n.TRG:ve(ce,Z,re);break;case n.TBS:De(ce,Z,re);break;case n.TLS:we(ce,Z,re);break;case n.BKR:pe(ce,Z,re);break;case n.BKA:_e(ce,Z,re);break;case n.BKN:Q(ce,Z,re);break;case n.ABG:de(ce,Z,re);break;case n.AEN:Ce(ce,Z,re);break;default:ye=!1;break}if(!m()&&Z+re.phraseLength>G&&(G=Z+re.phraseLength),c.stats!==null&&c.stats.collect(Se,re),c.trace!==null){let xe=T();c.trace.up(Se,re.state,Z,re.phraseLength,xe.anchor,xe.lookAround)}return C-=1,ye},"opExecuteFunc"),"opExecuteFunc")},"parser"),"parser")}}),k$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/stats.js"(e,t){t.exports=a(i(function(){let n=qs(),s=Qu(),o=mm(),c="stats.js: ",l=[],h=[],p=[],v,b=[],y=[];this.statsObject="statsObject";let A="stats",C=a(i(function(H,se){return H.lower<se.lower?-1:H.lower>se.lower?1:0},"sortAlpha2"),"sortAlpha"),O=a(i(function(H,se){return H.total<se.total?1:H.total>se.total?-1:C(H,se)},"sortHits2"),"sortHits"),R=a(i(function(H,se){return H.index<se.index?-1:H.index>se.index?1:0},"sortIndex2"),"sortIndex"),L=a(i(function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0},"EmptyStat2"),"EmptyStat"),K=a(i(function(){p.length=0,v=new L,p[n.ALT]=new L,p[n.CAT]=new L,p[n.REP]=new L,p[n.RNM]=new L,p[n.TRG]=new L,p[n.TBS]=new L,p[n.TLS]=new L,p[n.UDT]=new L,p[n.AND]=new L,p[n.NOT]=new L,p[n.BKR]=new L,p[n.BKA]=new L,p[n.BKN]=new L,p[n.ABG]=new L,p[n.AEN]=new L,b.length=0;for(let H=0;H<l.length;H+=1)b.push({empty:0,match:0,nomatch:0,total:0,name:l[H].name,lower:l[H].lower,index:l[H].index});if(h.length>0){y.length=0;for(let H=0;H<h.length;H+=1)y.push({empty:0,match:0,nomatch:0,total:0,name:h[H].name,lower:h[H].lower,index:h[H].index})}},"clear2"),"clear"),$=a(i(function(H,se){switch(H.total+=1,se){case n.EMPTY:H.empty+=1;break;case n.MATCH:H.match+=1;break;case n.NOMATCH:H.nomatch+=1;break;default:throw new Error(`${c}collect(): incStat(): unrecognized state: ${se}`)}},"incStat2"),"incStat"),j=a(i(function(H,se){let ue="";return ue+="<tr>",ue+=`<td class="${o.CLASS_ACTIVE}">${H}</td>`,ue+=`<td class="${o.CLASS_EMPTY}">${se.empty}</td>`,ue+=`<td class="${o.CLASS_MATCH}">${se.match}</td>`,ue+=`<td class="${o.CLASS_NOMATCH}">${se.nomatch}</td>`,ue+=`<td class="${o.CLASS_ACTIVE}">${se.total}</td>`,ue+=`</tr>
|
|
315
|
+
`,ue},"displayRow2"),"displayRow"),V=a(i(function(){let H="";return H+=j("ALT",p[n.ALT]),H+=j("CAT",p[n.CAT]),H+=j("REP",p[n.REP]),H+=j("RNM",p[n.RNM]),H+=j("TRG",p[n.TRG]),H+=j("TBS",p[n.TBS]),H+=j("TLS",p[n.TLS]),H+=j("UDT",p[n.UDT]),H+=j("AND",p[n.AND]),H+=j("NOT",p[n.NOT]),H+=j("BKR",p[n.BKR]),H+=j("BKA",p[n.BKA]),H+=j("BKN",p[n.BKN]),H+=j("ABG",p[n.ABG]),H+=j("AEN",p[n.AEN]),H+=j("totals",v),H},"displayOpsOnly2"),"displayOpsOnly"),G=a(i(function(){let H="";H+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
316
|
+
`,H+=`<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>
|
|
317
|
+
`;for(let se=0;se<l.length;se+=1)b[se].total>0&&(H+="<tr>",H+=`<td class="${o.CLASS_ACTIVE}">${b[se].name}</td>`,H+=`<td class="${o.CLASS_EMPTY}">${b[se].empty}</td>`,H+=`<td class="${o.CLASS_MATCH}">${b[se].match}</td>`,H+=`<td class="${o.CLASS_NOMATCH}">${b[se].nomatch}</td>`,H+=`<td class="${o.CLASS_ACTIVE}">${b[se].total}</td>`,H+=`</tr>
|
|
318
|
+
`);if(h.length>0){H+=`<tr><th></th><th></th><th></th><th></th><th></th></tr>
|
|
319
|
+
`,H+=`<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>
|
|
320
|
+
`;for(let se=0;se<h.length;se+=1)y[se].total>0&&(H+="<tr>",H+=`<td class="${o.CLASS_ACTIVE}">${y[se].name}</td>`,H+=`<td class="${o.CLASS_EMPTY}">${y[se].empty}</td>`,H+=`<td class="${o.CLASS_MATCH}">${y[se].match}</td>`,H+=`<td class="${o.CLASS_NOMATCH}">${y[se].nomatch}</td>`,H+=`<td class="${o.CLASS_ACTIVE}">${y[se].total}</td>`,H+=`</tr>
|
|
321
|
+
`)}return H},"displayRules2"),"displayRules");this.validate=a(i(function(H){let se=!1;return typeof H=="string"&&A===H&&(se=!0),se},"validate6"),"validate"),this.init=a(i(function(H,se){l=H,h=se,K()},"init2"),"init"),this.collect=a(i(function(H,se){$(v,se.state,se.phraseLength),$(p[H.type],se.state,se.phraseLength),H.type===n.RNM&&$(b[H.index],se.state,se.phraseLength),H.type===n.UDT&&$(y[H.index],se.state,se.phraseLength)},"collect"),"collect"),this.toHtml=a(i(function(H,se){let ue="";ue+=`<table class="${o.CLASS_STATS}">
|
|
322
|
+
`,typeof se=="string"&&(ue+=`<caption>${se}</caption>
|
|
323
|
+
`),ue+=`<tr><th class="${o.CLASS_ACTIVE}">ops</th>
|
|
324
|
+
`,ue+=`<th class="${o.CLASS_EMPTY}">EMPTY</th>
|
|
325
|
+
`,ue+=`<th class="${o.CLASS_MATCH}">MATCH</th>
|
|
326
|
+
`,ue+=`<th class="${o.CLASS_NOMATCH}">NOMATCH</th>
|
|
327
|
+
`,ue+=`<th class="${o.CLASS_ACTIVE}">totals</th></tr>
|
|
328
|
+
`;let me=!0;for(;me;){if(H===void 0){ue+=V();break}if(H===null){ue+=V();break}if(H==="ops"){ue+=V();break}if(H==="index"){b.sort(R),y.length>0&&y.sort(R),ue+=V(),ue+=G();break}if(H==="hits"){b.sort(O),y.length>0&&y.sort(R),ue+=V(),ue+=G();break}if(H==="alpha"){b.sort(C),y.length>0&&y.sort(C),ue+=V(),ue+=G();break}break}return ue+=`</table>
|
|
329
|
+
`,ue},"toHtml"),"toHtml"),this.toHtmlPage=a(i(function(H,se,ue){return s.htmlToPage(this.toHtml(H,se),ue)},"toHtmlPage"),"toHtmlPage")},"statsFunc"),"statsFunc")}}),O$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/trace.js"(e,t){t.exports=a(i(function(){let n=Qu(),s=mm(),o=new(Dx()),c=qs(),l="trace.js: ",h=this,p=16,v=10,b=8,y=32,A=80,C=5,O=[],R=5e3,L=-1,K=0,$=0,j=[],V=null,G=null,k=null,H=[],se=[],ue=`<span class="${s.CLASS_LINEEND}">•</span>`,me=`<span class="${s.CLASS_LINEEND}">…</span>`,q=`<span class="${s.CLASS_EMPTY}">𝜺</span>`,E=a(function(){let I=a(function(te){H[c.ALT]=te,H[c.CAT]=te,H[c.REP]=te,H[c.TLS]=te,H[c.TBS]=te,H[c.TRG]=te,H[c.AND]=te,H[c.NOT]=te,H[c.BKR]=te,H[c.BKA]=te,H[c.BKN]=te,H[c.ABG]=te,H[c.AEN]=te},"setOperators"),z=0;for(let te in h.filter.operators)z+=1;if(z===0){I(!1);return}for(let te in h.filter.operators){let ae=te.toUpperCase();if(ae==="<ALL>"){I(!0);return}if(ae==="<NONE>"){I(!1);return}}I(!1);for(let te in h.filter.operators){let ae=te.toUpperCase();if(ae==="ALT")H[c.ALT]=h.filter.operators[te]===!0;else if(ae==="CAT")H[c.CAT]=h.filter.operators[te]===!0;else if(ae==="REP")H[c.REP]=h.filter.operators[te]===!0;else if(ae==="AND")H[c.AND]=h.filter.operators[te]===!0;else if(ae==="NOT")H[c.NOT]=h.filter.operators[te]===!0;else if(ae==="TLS")H[c.TLS]=h.filter.operators[te]===!0;else if(ae==="TBS")H[c.TBS]=h.filter.operators[te]===!0;else if(ae==="TRG")H[c.TRG]=h.filter.operators[te]===!0;else if(ae==="BKR")H[c.BKR]=h.filter.operators[te]===!0;else if(ae==="BKA")H[c.BKA]=h.filter.operators[te]===!0;else if(ae==="BKN")H[c.BKN]=h.filter.operators[te]===!0;else if(ae==="ABG")H[c.ABG]=h.filter.operators[te]===!0;else if(ae==="AEN")H[c.AEN]=h.filter.operators[te]===!0;else throw new Error(`${l}initOpratorFilter: '${te}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`)}},"initOperatorFilter"),T=a(function(){let I=a(function(ve){H[c.RNM]=ve,H[c.UDT]=ve;let De=G.length+k.length;se.length=0;for(let we=0;we<De;we+=1)se.push(ve)},"setRules"),z,te,ae=[];for(te=0;te<G.length;te+=1)ae.push(G[te].lower);for(te=0;te<k.length;te+=1)ae.push(k[te].lower);se.length=0,z=0;for(let ve in h.filter.rules)z+=1;if(z===0){I(!0);return}for(let ve in h.filter.rules){let De=ve.toLowerCase();if(De==="<all>"){I(!0);return}if(De==="<none>"){I(!1);return}}I(!1),H[c.RNM]=!0,H[c.UDT]=!0;for(let ve in h.filter.rules){let De=ve.toLowerCase();if(te=ae.indexOf(De),te<0)throw new Error(`${l}initRuleFilter: '${ve}' not a valid rule or udt name`);se[te]=h.filter.rules[ve]===!0}},"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(I,z){if(L=-1,typeof I=="number"&&I>0)R=Math.ceil(I);else{R=0;return}typeof z=="number"&&(L=Math.floor(z),L<0&&(L=-1))},this.getMaxRecords=function(){return R},this.getLastRecord=function(){return L},this.init=function(I,z,te){O.length=0,j.length=0,K=0,$=0,V=te,G=I,k=z,E(),T(),o.init(R)};let m=a(function(I){let z=!1;return I.type===c.RNM?H[I.type]&&se[I.index]?z=!0:z=!1:I.type===c.UDT?H[I.type]&&se[G.length+I.index]?z=!0:z=!1:z=H[I.type],z},"filterOps"),d=a(function(I){return L===-1||I<=L},"filterRecords");this.down=function(I,z,te,ae,ve,De){d(K)&&m(I)&&(j.push(K),O[o.increment()]={dirUp:!1,depth:$,thisLine:K,thatLine:void 0,opcode:I,state:z,phraseIndex:te,phraseLength:ae,lookAnchor:ve,lookAround:De},K+=1,$+=1)},this.up=function(I,z,te,ae,ve,De){if(d(K)&&m(I)){let we=K,de=j.pop(),Ce=o.getListIndex(de);Ce!==-1&&(O[Ce].thatLine=we),$-=1,O[o.increment()]={dirUp:!0,depth:$,thisLine:we,thatLine:de,opcode:I,state:z,phraseIndex:te,phraseLength:ae,lookAnchor:ve,lookAround:De},K+=1}};let g=a(function(){function I(Z,re){let ye,Se,xe;if(re)switch(Z.op={id:re.type,name:n.opcodeToString(re.type)},Z.opData=void 0,re.type){case c.RNM:Z.opData=G[re.index].name;break;case c.UDT:Z.opData=k[re.index].name;break;case c.BKR:re.index<G.length?ye=G[re.index].name:ye=k[re.index-G.length].name,Se=re.bkrCase===c.BKR_MODE_CI?"%i":"%s",xe=re.bkrMode===c.BKR_MODE_UM?"%u":"%p",Z.opData=`\\\\${Se}${xe}${ye}`;break;case c.TLS:Z.opData=[];for(let ke=0;ke<re.string.length;ke+=1)Z.opData.push(re.string[ke]);break;case c.TBS:Z.opData=[];for(let ke=0;ke<re.string.length;ke+=1)Z.opData.push(re.string[ke]);break;case c.TRG:Z.opData=[re.min,re.max];break;case c.REP:Z.opData=[re.min,re.max];break;default:throw new Error("unrecognized opcode")}else Z.op={id:void 0,name:void 0},Z.opData=void 0}i(I,"nodeOpcode"),a(I,"nodeOpcode");function z(Z,re,ye){return Z===c.MATCH?{index:re,length:ye}:Z===c.NOMATCH?{index:re,length:0}:Z===c.EMPTY?{index:re,length:0}:null}i(z,"nodePhrase"),a(z,"nodePhrase");let te=-1;function ae(Z,re,ye){let Se={id:te++,branch:-1,parent:Z,up:!1,down:!1,depth:ye,children:[]};return re?(Se.down=!0,Se.state={id:re.state,name:n.stateToString(re.state)},Se.phrase=null,I(Se,re.opcode)):(Se.state={id:void 0,name:void 0},Se.phrase=z(),I(Se,void 0)),Se}i(ae,"nodeDown"),a(ae,"nodeDown");function ve(Z,re){re&&(Z.up=!0,Z.state={id:re.state,name:n.stateToString(re.state)},Z.phrase=z(re.state,re.phraseIndex,re.phraseLength),Z.down||I(Z,re.opcode))}i(ve,"nodeUp"),a(ve,"nodeUp");let De=0,we=-1,de=1;function Ce(Z){if(we+=1,Z.branch=de,we>$&&($=we),Z.children.length===0)De+=1;else for(let re=0;re<Z.children.length;re+=1)re>0&&(de+=1),Z.children[re].leftMost=!1,Z.children[re].rightMost=!1,Z.leftMost&&(Z.children[re].leftMost=re===0),Z.rightMost&&(Z.children[re].rightMost=re===Z.children.length-1),Ce(Z.children[re]);we-=1}i(Ce,"walk"),a(Ce,"walk");function pe(Z,re){let ye,Se={};if(Se.id=Z.id,Se.branch=Z.branch,Se.leftMost=Z.leftMost,Se.rightMost=Z.rightMost,ye=Z.state.name?Z.state.name:"ACTIVE",Se.state={id:Z.state.id,name:ye},ye=Z.op.name?Z.op.name:"?",Se.op={id:Z.op.id,name:ye},typeof Z.opData=="string")Se.opData=Z.opData;else if(Array.isArray(Z.opData)){Se.opData=[];for(let xe=0;xe<Z.opData.length;xe+=1)Se.opData[xe]=Z.opData[xe]}else Se.opData=void 0;Z.phrase?Se.phrase={index:Z.phrase.index,length:Z.phrase.length}:Se.phrase=null,Se.depth=Z.depth,Se.children=[];for(let xe=0;xe<Z.children.length;xe+=1){let ke=xe!==Z.children.length-1;Se.children[xe]=pe(Z.children[xe],re,ke)}return Se}i(pe,"display"),a(pe,"display");let _e=[],Q,ge,Me,Ue,Re=!0,je=ae(null,null,-1);for(_e.push(je),ge=je,o.forEach(Z=>{if(Ue=O[Z],Re&&(Re=!1,Ue.depth>0)){let re=Ue.dirUp?Ue.depth+1:Ue.depth;for(let ye=0;ye<re;ye+=1)Me=ge,ge=ae(ge,null,ye),_e.push(ge),Me.children.push(ge)}Ue.dirUp?(ge=_e.pop(),ve(ge,Ue),ge=_e[_e.length-1]):(Me=ge,ge=ae(ge,Ue,Ue.depth),_e.push(ge),Me.children.push(ge))});_e.length>1;)ge=_e.pop(),ve(ge,null);if(je.children.length===0)throw new Error("trace.toTree(): parse tree has no nodes");if(_e.length===0)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");Q=je.children[0];let rt=Q;for(;Q&&!Q.down&&!Q.up;)rt=Q,Q=Q.children[0];Q=rt,Q.leftMost=!0,Q.rightMost=!0,Ce(Q),Q.branch=0;let fe={};fe.string=[];for(let Z=0;Z<V.length;Z+=1)fe.string[Z]=V[Z];fe.rules=[];for(let Z=0;Z<G.length;Z+=1)fe.rules[Z]=G[Z].name;fe.udts=[];for(let Z=0;Z<k.length;Z+=1)fe.udts[Z]=k[Z].name;fe.id={},fe.id.ALT={id:c.ALT,name:"ALT"},fe.id.CAT={id:c.CAT,name:"CAT"},fe.id.REP={id:c.REP,name:"REP"},fe.id.RNM={id:c.RNM,name:"RNM"},fe.id.TLS={id:c.TLS,name:"TLS"},fe.id.TBS={id:c.TBS,name:"TBS"},fe.id.TRG={id:c.TRG,name:"TRG"},fe.id.UDT={id:c.UDT,name:"UDT"},fe.id.AND={id:c.AND,name:"AND"},fe.id.NOT={id:c.NOT,name:"NOT"},fe.id.BKR={id:c.BKR,name:"BKR"},fe.id.BKA={id:c.BKA,name:"BKA"},fe.id.BKN={id:c.BKN,name:"BKN"},fe.id.ABG={id:c.ABG,name:"ABG"},fe.id.AEN={id:c.AEN,name:"AEN"},fe.id.ACTIVE={id:c.ACTIVE,name:"ACTIVE"},fe.id.MATCH={id:c.MATCH,name:"MATCH"},fe.id.EMPTY={id:c.EMPTY,name:"EMPTY"},fe.id.NOMATCH={id:c.NOMATCH,name:"NOMATCH"},fe.treeDepth=$,fe.leafNodes=De;let ce;return Q.down?Q.up?ce="none":ce="right":Q.up?ce="left":ce="both",fe.branchesIncomplete=ce,fe.tree=pe(Q,Q.depth,!1),fe},"toTreeObj");this.toTree=function(I){let z=g();return I?JSON.stringify(z):z},this.toHtmlPage=function(I,z,te){return n.htmlToPage(this.toHtml(I,z),te)};let _=a(function(I,z){let te;switch(I){case p:te="hexadecimal";break;case v:te="decimal";break;case b:te="ASCII";break;case y:te="UNICODE";break;default:throw new Error(`${l}htmlHeader: unrecognized mode: ${I}`)}let ae="";return ae+=`<p>display mode: ${te}</p>
|
|
330
|
+
`,ae+=`<table class="${s.CLASS_TRACE}">
|
|
331
|
+
`,typeof z=="string"&&(ae+=`<caption>${z}</caption>`),ae},"htmlHeader"),M=a(function(){let I="";return I+=`</table>
|
|
332
|
+
`,I+=`<p class="${s.CLASS_MONOSPACE}">legend:<br>
|
|
333
|
+
`,I+=`(a) - line number<br>
|
|
334
|
+
`,I+=`(b) - matching line number<br>
|
|
335
|
+
`,I+=`(c) - phrase offset<br>
|
|
336
|
+
`,I+=`(d) - phrase length<br>
|
|
337
|
+
`,I+=`(e) - tree depth<br>
|
|
338
|
+
`,I+=`(f) - operator state<br>
|
|
339
|
+
`,I+=` - <span class="${s.CLASS_ACTIVE}">↓</span> phrase opened<br>
|
|
340
|
+
`,I+=` - <span class="${s.CLASS_MATCH}">↑M</span> phrase matched<br>
|
|
341
|
+
`,I+=` - <span class="${s.CLASS_EMPTY}">↑E</span> empty phrase matched<br>
|
|
342
|
+
`,I+=` - <span class="${s.CLASS_NOMATCH}">↑N</span> phrase not matched<br>
|
|
343
|
+
`,I+=`operator - ALT, CAT, REP, RNM, TRG, TLS, TBS<sup>†</sup>, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN<sup>‡</sup><br>
|
|
344
|
+
`,I+=`phrase - up to ${A} characters of the phrase being matched<br>
|
|
345
|
+
`,I+=` - <span class="${s.CLASS_MATCH}">matched characters</span><br>
|
|
346
|
+
`,I+=` - <span class="${s.CLASS_LOOKAHEAD}">matched characters in look ahead mode</span><br>
|
|
347
|
+
`,I+=` - <span class="${s.CLASS_LOOKBEHIND}">matched characters in look behind mode</span><br>
|
|
348
|
+
`,I+=` - <span class="${s.CLASS_REMAINDER}">remainder characters(not yet examined by parser)</span><br>
|
|
349
|
+
`,I+=` - <span class="${s.CLASS_CTRLCHAR}">control characters, TAB, LF, CR, etc. (ASCII mode only)</span><br>
|
|
350
|
+
`,I+=` - ${q} empty string<br>
|
|
351
|
+
`,I+=` - ${ue} end of input string<br>
|
|
352
|
+
`,I+=` - ${me} input string display truncated<br>
|
|
353
|
+
`,I+=`</p>
|
|
354
|
+
`,I+=`<p class="${s.CLASS_MONOSPACE}">
|
|
355
|
+
`,I+=`<sup>†</sup>original ABNF operators:<br>
|
|
356
|
+
`,I+=`ALT - alternation<br>
|
|
357
|
+
`,I+=`CAT - concatenation<br>
|
|
358
|
+
`,I+=`REP - repetition<br>
|
|
359
|
+
`,I+=`RNM - rule name<br>
|
|
360
|
+
`,I+=`TRG - terminal range<br>
|
|
361
|
+
`,I+=`TLS - terminal literal string (case insensitive)<br>
|
|
362
|
+
`,I+=`TBS - terminal binary string (case sensitive)<br>
|
|
363
|
+
`,I+=`<br>
|
|
364
|
+
`,I+=`<sup>‡</sup>super set SABNF operators:<br>
|
|
365
|
+
`,I+=`UDT - user-defined terminal<br>
|
|
366
|
+
`,I+=`AND - positive look ahead<br>
|
|
367
|
+
`,I+=`NOT - negative look ahead<br>
|
|
368
|
+
`,I+=`BKA - positive look behind<br>
|
|
369
|
+
`,I+=`BKN - negative look behind<br>
|
|
370
|
+
`,I+=`BKR - back reference<br>
|
|
371
|
+
`,I+=`ABG - anchor - begin of input string<br>
|
|
372
|
+
`,I+=`AEN - anchor - end of input string<br>
|
|
373
|
+
`,I+=`</p>
|
|
374
|
+
`,I},"htmlFooter");this.indent=function(I){let z="";for(let te=0;te<I;te+=1)z+=".";return z};let S=a(function(I,z){let te="";if(z.type===c.TRG)if(I===p||I===y){let ae=z.min.toString(16).toUpperCase();ae.length%2!==0&&(ae=`0${ae}`),te+=I===p?"%x":"U+",te+=ae,ae=z.max.toString(16).toUpperCase(),ae.length%2!==0&&(ae=`0${ae}`),te+=`–${ae}`}else te=`%d${z.min.toString(10)}–${z.max.toString(10)}`;return te},"displayTrg"),w=a(function(I,z){let te="";if(z.type===c.REP)if(I===p){let ae=z.min.toString(16).toUpperCase();ae.length%2!==0&&(ae=`0${ae}`),te=`x${ae}`,z.max<1/0?(ae=z.max.toString(16).toUpperCase(),ae.length%2!==0&&(ae=`0${ae}`)):ae="inf",te+=`–${ae}`}else z.max<1/0?te=`${z.min.toString(10)}–${z.max.toString(10)}`:te=`${z.min.toString(10)}–inf`;return te},"displayRep"),N=a(function(I,z){let te="";if(z.type===c.TBS){let ae=Math.min(z.string.length,C*2);if(I===p||I===y){te+=I===p?"%x":"U+";for(let ve=0;ve<ae;ve+=1){let De;ve>0&&(te+="."),De=z.string[ve].toString(16).toUpperCase(),De.length%2!==0&&(De=`0${De}`),te+=De}}else{te="%d";for(let ve=0;ve<ae;ve+=1)ve>0&&(te+="."),te+=z.string[ve].toString(10)}ae<z.string.length&&(te+=me)}return te},"displayTbs"),B=a(function(I,z){let te="";if(z.type===c.TLS){let ae=Math.min(z.string.length,C);if(I===p||I===v){let ve,De,we;I===p?(te="%x",we=16):(te="%d",we=10);for(let de=0;de<ae;de+=1)de>0&&(te+="."),De=z.string[de],De>=97&&De<=122?(ve=De-32,te+=`${ve.toString(we)}/${De.toString(we)}`.toUpperCase()):De>=65&&De<=90?(ve=De,De+=32,te+=`${ve.toString(we)}/${De.toString(we)}`.toUpperCase()):te+=De.toString(we).toUpperCase();ae<z.string.length&&(te+=me)}else{te='"';for(let ve=0;ve<ae;ve+=1)te+=n.asciiChars[z.string[ve]];ae<z.string.length&&(te+=me),te+='"'}}return te},"displayTls"),D=a(function(I,z,te,ae,ve){if(ae===0)return"";let De="",we=ve?",":"";switch(I){case p:De=we+n.charsToHex(z,te,ae);break;case v:if(ve)return`,${n.charsToDec(z,te,ae)}`;De=we+n.charsToDec(z,te,ae);break;case y:De=n.charsToUnicode(z,te,ae);break;case b:default:De=n.charsToAsciiHtml(z,te,ae);break}return De},"subPhrase"),F=a(function(I,z,te,ae,ve,De){let we="",de,Ce,pe,_e,Q=ue,ge=`<span class="${s.CLASS_LOOKBEHIND}">`,Me=`<span class="${s.CLASS_REMAINDER}">`,Ue="</span>",Re=!1;switch(te){case c.EMPTY:we+=q;case c.NOMATCH:case c.MATCH:case c.ACTIVE:de=ae-ve,Ce=De-de,pe=De,_e=z.length-pe;break;default:throw new Error("unrecognized state")}return Q=ue,Ce>A?(Ce=A,Q=me,_e=0):Ce+_e>A&&(Q=me,_e=A-Ce),Ce>0&&(we+=ge,we+=D(I,z,de,Ce,Re),we+=Ue,Re=!0),_e>0&&(we+=Me,we+=D(I,z,pe,_e,Re),we+=Ue),we+Q},"displayBehind"),le=a(function(I,z,te,ae,ve,De){let we="",de,Ce,pe,_e,Q=ue,ge=`<span class="${s.CLASS_REMAINDER}">`,Me="</span>",Ue=!1;switch(te){case c.EMPTY:we+=q;case c.NOMATCH:case c.ACTIVE:de=ae,Ce=0,pe=ae,_e=z.length-pe;break;case c.MATCH:de=ae,Ce=ve,pe=ae+Ce,_e=z.length-pe;break;default:throw new Error("unrecognized state")}return Q=ue,Ce>A?(Ce=A,Q=me,_e=0):Ce+_e>A&&(Q=me,_e=A-Ce),Ce>0&&(we+=De,we+=D(I,z,de,Ce,Ue),we+=Me,Ue=!0),_e>0&&(we+=ge,we+=D(I,z,pe,_e,Ue),we+=Me),we+Q},"displayForward"),P=a(function(I,z,te,ae,ve){let De=`<span class="${s.CLASS_LOOKAHEAD}">`;return le(I,z,te,ae,ve,De)},"displayAhead"),Y=a(function(I,z,te,ae,ve){let De=`<span class="${s.CLASS_MATCH}">`;return le(I,z,te,ae,ve,De)},"displayNone"),J=a(function(I){if(G===null)return"";let z="",te,ae,ve,De,we,de;return z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
|
|
375
|
+
`,o.forEach(Ce=>{let pe=O[Ce];switch(te=pe.thisLine,ae=pe.thatLine!==void 0?pe.thatLine:"--",ve=!1,De=!1,we=!1,pe.lookAround===c.LOOKAROUND_AHEAD&&(ve=!0,we=!0,de=pe.lookAnchor),(pe.opcode.type===c.AND||pe.opcode.type===c.NOT)&&(ve=!0,we=!0,de=pe.phraseIndex),pe.lookAround===c.LOOKAROUND_BEHIND&&(De=!0,we=!0,de=pe.lookAnchor),(pe.opcode.type===c.BKA||pe.opcode.type===c.BKN)&&(De=!0,we=!0,de=pe.phraseIndex),z+="<tr>",z+=`<td>${te}</td><td>${ae}</td>`,z+=`<td>${pe.phraseIndex}</td>`,z+=`<td>${pe.phraseLength}</td>`,z+=`<td>${pe.depth}</td>`,z+="<td>",pe.state){case c.ACTIVE:z+=`<span class="${s.CLASS_ACTIVE}">↓ </span>`;break;case c.MATCH:z+=`<span class="${s.CLASS_MATCH}">↑M</span>`;break;case c.NOMATCH:z+=`<span class="${s.CLASS_NOMATCH}">↑N</span>`;break;case c.EMPTY:z+=`<span class="${s.CLASS_EMPTY}">↑E</span>`;break;default:z+=`<span class="${s.CLASS_ACTIVE}">--</span>`;break}if(z+="</td>",z+="<td>",z+=h.indent(pe.depth),ve?z+=`<span class="${s.CLASS_LOOKAHEAD}">`:De&&(z+=`<span class="${s.CLASS_LOOKBEHIND}">`),z+=n.opcodeToString(pe.opcode.type),pe.opcode.type===c.RNM&&(z+=`(${G[pe.opcode.index].name}) `),pe.opcode.type===c.BKR){let _e=pe.opcode.bkrCase===c.BKR_MODE_CI?"%i":"%s",Q=pe.opcode.bkrMode===c.BKR_MODE_UM?"%u":"%p";z+=`(\\${_e}${Q}${G[pe.opcode.index].name}) `}pe.opcode.type===c.UDT&&(z+=`(${k[pe.opcode.index].name}) `),pe.opcode.type===c.TRG&&(z+=`(${S(I,pe.opcode)}) `),pe.opcode.type===c.TBS&&(z+=`(${N(I,pe.opcode)}) `),pe.opcode.type===c.TLS&&(z+=`(${B(I,pe.opcode)}) `),pe.opcode.type===c.REP&&(z+=`(${w(I,pe.opcode)}) `),we&&(z+="</span>"),z+="</td>",z+="<td>",De?z+=F(I,V,pe.state,pe.phraseIndex,pe.phraseLength,de):ve?z+=P(I,V,pe.state,pe.phraseIndex,pe.phraseLength):z+=Y(I,V,pe.state,pe.phraseIndex,pe.phraseLength),z+=`</td></tr>
|
|
376
|
+
`}),z+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",z+=`<th>operator</th><th>phrase</th></tr>
|
|
377
|
+
`,z+=`</table>
|
|
378
|
+
`,z},"htmlTable");this.toHtml=function(I,z){let te=b;if(typeof I=="string"&&I.length>=3){let ve=I.toLowerCase().slice(0,3);ve==="hex"?te=p:ve==="dec"?te=v:ve==="uni"&&(te=y)}let ae="";return ae+=_(te,z),ae+=J(te),ae+=M(),ae}},"exportTrace"),"exportTrace")}}),el=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-lib/node-exports.js"(e,t){t.exports={ast:I$(),circular:Dx(),ids:qs(),parser:D$(),stats:k$(),trace:O$(),utils:Qu(),emitcss:Ix(),style:mm()}}}),R$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/scanner-grammar.js"(e,t){t.exports=a(i(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=a(i(function(){let s="";return s+=`file = *line [last-line]
|
|
379
|
+
`,s+=`line = line-text end
|
|
380
|
+
`,s+=`line-text = *(valid/invalid)
|
|
381
|
+
`,s+=`last-line = 1*(valid/invalid)
|
|
382
|
+
`,s+=`valid = %d32-126 / %d9
|
|
383
|
+
`,s+=`invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff
|
|
384
|
+
`,s+=`end = CRLF / LF / CR
|
|
385
|
+
`,s+=`CRLF = %d13.10
|
|
386
|
+
`,s+=`LF = %d10
|
|
387
|
+
`,s+=`CR = %d13
|
|
388
|
+
`,s},"toString4"),"toString")},"grammar"),"grammar")}}),N$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/scanner-callbacks.js"(e){var t=qs(),r=Qu();function n(y,A,C,O,R){return y===t.SEM_PRE?(R.endLength=0,R.textLength=0,R.invalidCount=0):R.lines.push({lineNo:R.lines.length,beginChar:C,length:O,textLength:R.textLength,endType:R.endType,invalidChars:R.invalidCount}),t.SEM_OK}i(n,"semLine"),a(n,"semLine");function s(y,A,C,O,R){return y===t.SEM_PRE&&(R.textLength=O),t.SEM_OK}i(s,"semLineText"),a(s,"semLineText");function o(y,A,C,O,R){return y===t.SEM_PRE?(R.endLength=0,R.textLength=0,R.invalidCount=0):R.strict?(R.lines.push({lineNo:R.lines.length,beginChar:C,length:O,textLength:O,endType:"none",invalidChars:R.invalidCount}),R.errors.push({line:R.lineNo,char:C+O,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(A.push(10),R.lines.push({lineNo:R.lines.length,beginChar:C,length:O+1,textLength:O,endType:"LF",invalidChars:R.invalidCount})),t.SEM_OK}i(o,"semLastLine"),a(o,"semLastLine");function c(y,A,C,O,R){return y===t.SEM_PRE&&R.errors.push({line:R.lineNo,char:C,msg:`invalid character found '\\x${r.charToHex(A[C])}'`}),t.SEM_OK}i(c,"semInvalid"),a(c,"semInvalid");function l(y,A,C,O,R){return y===t.SEM_POST&&(R.lineNo+=1),t.SEM_OK}i(l,"semEnd"),a(l,"semEnd");function h(y,A,C,O,R){return y===t.SEM_PRE&&(R.endType="LF",R.strict&&R.errors.push({line:R.lineNo,char:C,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),t.SEM_OK}i(h,"semLF"),a(h,"semLF");function p(y,A,C,O,R){return y===t.SEM_PRE&&(R.endType="CR",R.strict&&R.errors.push({line:R.lineNo,char:C,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),t.SEM_OK}i(p,"semCR"),a(p,"semCR");function v(y,A,C,O,R){return y===t.SEM_PRE&&(R.endType="CRLF"),t.SEM_OK}i(v,"semCRLF"),a(v,"semCRLF");var b=[];b.line=n,b["line-text"]=s,b["last-line"]=o,b.invalid=c,b.end=l,b.lf=h,b.cr=p,b.crlf=v,e.callbacks=b}}),P$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/scanner.js"(e,t){t.exports=a(i(function(n,s,o,c){let l="scanner.js: ",h=el(),p=new(R$()),{callbacks:v}=N$(),b=[],y=new h.parser;if(y.ast=new h.ast,y.ast.callbacks=v,c){if(c.traceObject!=="traceObject")throw new TypeError(`${l}trace argument is not a trace object`);y.trace=c}if(y.parse(p,"file",n).success!==!0){s.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});return}let C={lines:b,lineNo:0,errors:s,strict:!!o};return y.ast.translate(C),b},"exfn"),"exfn")}}),B$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/syntax-callbacks.js"(e,t){t.exports=a(i(function(){let n="syntax-callbacks.js: ",s=el(),o=s.ids,c,l=a(i(function(B,D,F,le){switch(B.state){case o.ACTIVE:le.altStack=[],le.repCount=0;break;case o.EMPTY:le.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case o.MATCH:le.ruleCount===0&&le.errors.push({line:0,char:0,msg:"no rules defined"});break;case o.NOMATCH:throw new Error(`${n}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${n}synFile: unrecognized case.`)}},"synFile2"),"synFile"),h=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:F.altStack.length=0,c={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},F.altStack.push(c);break;case o.EMPTY:throw new Error(`${n}synRule: EMPTY: rule cannot be empty`);case o.NOMATCH:break;case o.MATCH:F.ruleCount+=1;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synRule"),p=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synRuleError"),v=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synRuleNameError"),b=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synDefinedAsError"),y=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synAndOp"),A=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synNotOp"),C=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synBkaOp"),O=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synBknOp"),R=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synAbgOp"),L=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synAenOp"),K=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:if(F.strict){let le=s.utils.charsToString(B,D,N.phraseLength);F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:`Back reference operator(${le}) found - strict ABNF specified.`})}break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synBkrOp"),$=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:if(F.strict){let le=s.utils.charsToString(B,D,N.phraseLength);F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:`UDT operator found(${le}) - strict ABNF specified.`})}break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synUdtOp"),j=a(function(N,B,D){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c.tlsOpen=D;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synTlsOpen"),V=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:F.stringTabChar=!1;break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.stringTabChar!==!1&&F.errors.push({line:F.findLine(F.lines,F.stringTabChar),char:F.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synTlsString"),G=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.stringTabChar=D;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synStringTab"),k=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.errors.push({line:F.findLine(F.lines,c.tlsOpen),char:c.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),c.basicError=!0,c.tlsOpen=null;break;case o.MATCH:c.tlsOpen=null;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synTlsClose"),H=a(function(N,B,D){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c.clsOpen=D;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synClsOpen"),se=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:F.stringTabChar=!1;break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.stringTabChar!==!1&&F.errors.push({line:F.findLine(F.lines,F.stringTabChar),char:F.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synClsString"),ue=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.errors.push({line:F.findLine(F.lines,c.clsOpen),char:c.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),c.clsOpen=null,c.basicError=!0;break;case o.MATCH:F.strict&&F.errors.push({line:F.findLine(F.lines,c.clsOpen),char:c.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),c.clsOpen=null;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synClsClose"),me=a(function(N,B,D){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c.prosValOpen=D;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synProsValOpen"),q=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:F.stringTabChar=!1;break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.stringTabChar!==!1&&F.errors.push({line:F.findLine(F.lines,F.stringTabChar),char:F.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synProsValString"),E=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.errors.push({line:F.findLine(F.lines,c.prosValOpen),char:c.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),c.basicError=!0,c.prosValOpen=null;break;case o.MATCH:F.errors.push({line:F.findLine(F.lines,c.prosValOpen),char:c.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),c.prosValOpen=null;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synProsValClose"),T=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c={groupOpen:D,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},F.altStack.push(c);break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synGroupOpen"),m=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.errors.push({line:F.findLine(F.lines,c.groupOpen),char:c.groupOpen,msg:'Group "(...)" opened but not closed.'}),c=F.altStack.pop(),c.groupError=!0;break;case o.MATCH:c=F.altStack.pop();break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synGroupClose"),d=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c={groupOpen:null,groupError:!1,optionOpen:D,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},F.altStack.push(c);break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synOptionOpen"),g=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.errors.push({line:F.findLine(F.lines,c.optionOpen),char:c.optionOpen,msg:'Option "[...]" opened but not closed.'}),c=F.altStack.pop(),c.optionError=!0;break;case o.MATCH:c=F.altStack.pop();break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synOptionClose"),_=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:c.basicError===!1&&F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synBasicElementError"),M=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:if(N.phraseLength===1&&F.strict){let le=B[D]===13?"CR":"LF";F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:`Line end '${le}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synLineEnd"),S=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:break;case o.MATCH:F.errors.push({line:F.findLine(F.lines,D,F.charsLength),char:D,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synLineEndError"),w=a(function(N,B,D,F){switch(N.state){case o.ACTIVE:break;case o.EMPTY:break;case o.NOMATCH:F.repCount+=1;break;case o.MATCH:F.repCount+=1;break;default:throw new Error(`${n}synFile: unrecognized case.`)}},"synRepetition");this.callbacks=[],this.callbacks.andop=y,this.callbacks.basicelementerr=_,this.callbacks.clsclose=ue,this.callbacks.clsopen=H,this.callbacks.clsstring=se,this.callbacks.definedaserror=b,this.callbacks.file=l,this.callbacks.groupclose=m,this.callbacks.groupopen=T,this.callbacks.lineenderror=S,this.callbacks.lineend=M,this.callbacks.notop=A,this.callbacks.optionclose=g,this.callbacks.optionopen=d,this.callbacks.prosvalclose=E,this.callbacks.prosvalopen=me,this.callbacks.prosvalstring=q,this.callbacks.repetition=w,this.callbacks.rule=h,this.callbacks.ruleerror=p,this.callbacks.rulenameerror=v,this.callbacks.stringtab=G,this.callbacks.tlsclose=k,this.callbacks.tlsopen=j,this.callbacks.tlsstring=V,this.callbacks.udtop=$,this.callbacks.bkaop=C,this.callbacks.bknop=O,this.callbacks.bkrop=K,this.callbacks.abgop=R,this.callbacks.aenop=L},"exfn"),"exfn")}}),L$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/semantic-callbacks.js"(e,t){t.exports=a(i(function(){let n=el(),s=n.ids,o=a(i(function(){this.names=[],this.add=a(i(function(pe){let _e=-1;return this.get(pe)===-1&&(_e={name:pe,lower:pe.toLowerCase(),index:this.names.length},this.names.push(_e)),_e},"add3"),"add"),this.get=a(i(function(pe){let _e=-1,Q=pe.toLowerCase();for(let ge=0;ge<this.names.length;ge+=1)if(this.names[ge].lower===Q){_e=this.names[ge];break}return _e},"get2"),"get")},"NameList2"),"NameList"),c=a(i(function(Ce,pe,_e){let Q=0;for(let ge=pe;ge<pe+_e;ge+=1)Q=10*Q+Ce[ge]-48;return Q},"decnum2"),"decnum"),l=a(i(function(Ce,pe,_e){let Q=0;for(let ge=pe;ge<pe+_e;ge+=1)Q=2*Q+Ce[ge]-48;return Q},"binnum2"),"binnum"),h=a(i(function(Ce,pe,_e){let Q=0;for(let ge=pe;ge<pe+_e;ge+=1){let Me=Ce[ge];if(Me>=48&&Me<=57)Me-=48;else if(Me>=65&&Me<=70)Me-=55;else if(Me>=97&&Me<=102)Me-=87;else throw new Error("hexnum out of range");Q=16*Q+Me}return Q},"hexnum2"),"hexnum");function p(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_PRE)Q.ruleNames=new o,Q.udtNames=new o,Q.rules=[],Q.udts=[],Q.rulesLineMap=[],Q.opcodes=[],Q.altStack=[],Q.topStack=null,Q.topRule=null;else if(de===s.SEM_POST){let Me;Q.rules.forEach(Ue=>{Ue.isBkr=!1,Ue.opcodes.forEach(Re=>{Re.type===s.RNM&&(Me=Q.ruleNames.get(Re.index.name),Me===-1?(Q.errors.push({line:Q.findLine(Q.lines,Re.index.phraseIndex,Q.charsLength),char:Re.index.phraseIndex,msg:`Rule name '${Re.index.name}' used but not defined.`}),Re.index=-1):Re.index=Me.index)})}),Q.udts.forEach(Ue=>{Ue.isBkr=!1}),Q.rules.forEach(Ue=>{Ue.opcodes.forEach(Re=>{Re.type===s.BKR&&(Ue.hasBkr=!0,Me=Q.ruleNames.get(Re.index.name),Me!==-1?(Q.rules[Me.index].isBkr=!0,Re.index=Me.index):(Me=Q.udtNames.get(Re.index.name),Me!==-1?(Q.udts[Me.index].isBkr=!0,Re.index=Q.rules.length+Me.index):(Q.errors.push({line:Q.findLine(Q.lines,Re.index.phraseIndex,Q.charsLength),char:Re.index.phraseIndex,msg:`Back reference name '${Re.index.name}' refers to undefined rule or unamed UDT.`}),Re.index=-1)))})})}return ge}i(p,"semFile"),a(p,"semFile");function v(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE&&(Q.altStack.length=0,Q.topStack=null,Q.rulesLineMap.push({line:Q.findLine(Q.lines,pe,Q.charsLength),char:pe})),ge}i(v,"semRule"),a(v,"semRule");function b(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_PRE)Q.ruleName="",Q.definedas="";else if(de===s.SEM_POST){let Me;Q.definedas==="="?(Me=Q.ruleNames.add(Q.ruleName),Me===-1?(Q.definedas=null,Q.errors.push({line:Q.findLine(Q.lines,pe,Q.charsLength),char:pe,msg:`Rule name '${Q.ruleName}' previously defined.`})):(Q.topRule={name:Me.name,lower:Me.lower,opcodes:[],index:Me.index},Q.rules.push(Q.topRule),Q.opcodes=Q.topRule.opcodes)):(Me=Q.ruleNames.get(Q.ruleName),Me===-1?(Q.definedas=null,Q.errors.push({line:Q.findLine(Q.lines,pe,Q.charsLength),char:pe,msg:`Rule name '${Q.ruleName}' for incremental alternate not previously defined.`})):(Q.topRule=Q.rules[Me.index],Q.opcodes=Q.topRule.opcodes))}return ge}i(b,"semRuleLookup"),a(b,"semRuleLookup");function y(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_PRE)for(;;){if(Q.definedas===null){ge=s.SEM_SKIP;break}if(Q.topStack===null){if(Q.definedas==="="){Q.topStack={alt:{type:s.ALT,children:[]},cat:null},Q.altStack.push(Q.topStack),Q.opcodes.push(Q.topStack.alt);break}Q.topStack={alt:Q.opcodes[0],cat:null},Q.altStack.push(Q.topStack);break}Q.topStack={alt:{type:s.ALT,children:[]},cat:null},Q.altStack.push(Q.topStack),Q.opcodes.push(Q.topStack.alt);break}else de===s.SEM_POST&&(Q.altStack.pop(),Q.altStack.length>0?Q.topStack=Q.altStack[Q.altStack.length-1]:Q.topStack=null);return ge}i(y,"semAlternation"),a(y,"semAlternation");function A(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE?(Q.topStack.alt.children.push(Q.opcodes.length),Q.topStack.cat={type:s.CAT,children:[]},Q.opcodes.push(Q.topStack.cat)):de===s.SEM_POST&&(Q.topStack.cat=null),ge}i(A,"semConcatenation"),a(A,"semConcatenation");function C(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE&&Q.topStack.cat.children.push(Q.opcodes.length),ge}i(C,"semRepetition"),a(C,"semRepetition");function O(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.REP,min:0,max:1,char:pe}),ge}i(O,"semOptionOpen"),a(O,"semOptionOpen");function R(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE&&(Q.ruleName=n.utils.charsToString(Ce,pe,_e)),ge}i(R,"semRuleName"),a(R,"semRuleName");function L(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.definedas="="),ge}i(L,"semDefined"),a(L,"semDefined");function K(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.definedas="=/"),ge}i(K,"semIncAlt"),a(K,"semIncAlt");function $(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE?(Q.min=0,Q.max=1/0,Q.topRep={type:s.REP,min:0,max:1/0},Q.opcodes.push(Q.topRep)):de===s.SEM_POST&&(Q.min>Q.max&&Q.errors.push({line:Q.findLine(Q.lines,pe,Q.charsLength),char:pe,msg:`repetition min cannot be greater than max: min: ${Q.min}: max: ${Q.max}`}),Q.topRep.min=Q.min,Q.topRep.max=Q.max),ge}i($,"semRepOp"),a($,"semRepOp");function j(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.min=c(Ce,pe,_e)),ge}i(j,"semRepMin"),a(j,"semRepMin");function V(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.max=c(Ce,pe,_e)),ge}i(V,"semRepMax"),a(V,"semRepMax");function G(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.max=c(Ce,pe,_e),Q.min=Q.max),ge}i(G,"semRepMinMax"),a(G,"semRepMinMax");function k(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.AND}),ge}i(k,"semAndOp"),a(k,"semAndOp");function H(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.NOT}),ge}i(H,"semNotOp"),a(H,"semNotOp");function se(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.RNM,index:{phraseIndex:pe,name:n.utils.charsToString(Ce,pe,_e)}}),ge}i(se,"semRnmOp"),a(se,"semRnmOp");function ue(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.ABG}),ge}i(ue,"semAbgOp"),a(ue,"semAbgOp");function me(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.AEN}),ge}i(me,"semAenOp"),a(me,"semAenOp");function q(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.BKA}),ge}i(q,"semBkaOp"),a(q,"semBkaOp");function E(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.opcodes.push({type:s.BKN}),ge}i(E,"semBknOp"),a(E,"semBknOp");function T(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE?(Q.ci=!0,Q.cs=!1,Q.um=!0,Q.pm=!1):de===s.SEM_POST&&Q.opcodes.push({type:s.BKR,bkrCase:Q.cs===!0?s.BKR_MODE_CS:s.BKR_MODE_CI,bkrMode:Q.pm===!0?s.BKR_MODE_PM:s.BKR_MODE_UM,index:{phraseIndex:Q.bkrname.phraseIndex,name:n.utils.charsToString(Ce,Q.bkrname.phraseIndex,Q.bkrname.phraseLength)}}),ge}i(T,"semBkrOp"),a(T,"semBkrOp");function m(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.ci=!0),ge}i(m,"semBkrCi"),a(m,"semBkrCi");function d(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.cs=!0),ge}i(d,"semBkrCs"),a(d,"semBkrCs");function g(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.um=!0),ge}i(g,"semBkrUm"),a(g,"semBkrUm");function _(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.pm=!0),ge}i(_,"semBkrPm"),a(_,"semBkrPm");function M(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.bkrname={phraseIndex:pe,phraseLength:_e}),ge}i(M,"semBkrName"),a(M,"semBkrName");function S(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_POST){let Me=n.utils.charsToString(Ce,pe,_e),Ue=Q.udtNames.add(Me);if(Ue===-1){if(Ue=Q.udtNames.get(Me),Ue===-1)throw new Error("semUdtEmpty: name look up error")}else Q.udts.push({name:Ue.name,lower:Ue.lower,index:Ue.index,empty:!0});Q.opcodes.push({type:s.UDT,empty:!0,index:Ue.index})}return ge}i(S,"semUdtEmpty"),a(S,"semUdtEmpty");function w(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_POST){let Me=n.utils.charsToString(Ce,pe,_e),Ue=Q.udtNames.add(Me);if(Ue===-1){if(Ue=Q.udtNames.get(Me),Ue===-1)throw new Error("semUdtNonEmpty: name look up error")}else Q.udts.push({name:Ue.name,lower:Ue.lower,index:Ue.index,empty:!1});Q.opcodes.push({type:s.UDT,empty:!1,index:Ue.index,syntax:null,semantic:null})}return ge}i(w,"semUdtNonEmpty"),a(w,"semUdtNonEmpty");function N(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE&&(Q.tlscase=!0),ge}i(N,"semTlsOp"),a(N,"semTlsOp");function B(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&_e>0&&(Ce[pe+1]===83||Ce[pe+1]===115)&&(Q.tlscase=!1),ge}i(B,"semTlsCase"),a(B,"semTlsCase");function D(de,Ce,pe,_e,Q){let ge=s.SEM_OK;if(de===s.SEM_POST)if(Q.tlscase){let Me=Ce.slice(pe,pe+_e);for(let Ue=0;Ue<Me.length;Ue+=1)Me[Ue]>=65&&Me[Ue]<=90&&(Me[Ue]+=32);Q.opcodes.push({type:s.TLS,string:Me})}else Q.opcodes.push({type:s.TBS,string:Ce.slice(pe,pe+_e)});return ge}i(D,"semTlsString"),a(D,"semTlsString");function F(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(_e<=2?Q.opcodes.push({type:s.TLS,string:[]}):Q.opcodes.push({type:s.TBS,string:Ce.slice(pe+1,pe+_e-1)})),ge}i(F,"semClsOp"),a(F,"semClsOp");function le(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE?Q.tbsstr=[]:de===s.SEM_POST&&Q.opcodes.push({type:s.TBS,string:Q.tbsstr}),ge}i(le,"semTbsOp"),a(le,"semTbsOp");function P(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_PRE?(Q.min=0,Q.max=0):de===s.SEM_POST&&(Q.min>Q.max&&Q.errors.push({line:Q.findLine(Q.lines,pe,Q.charsLength),char:pe,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${Q.min}: max: ${Q.max}`}),Q.opcodes.push({type:s.TRG,min:Q.min,max:Q.max})),ge}i(P,"semTrgOp"),a(P,"semTrgOp");function Y(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.min=c(Ce,pe,_e)),ge}i(Y,"semDmin"),a(Y,"semDmin");function J(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.max=c(Ce,pe,_e)),ge}i(J,"semDmax"),a(J,"semDmax");function I(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.min=l(Ce,pe,_e)),ge}i(I,"semBmin"),a(I,"semBmin");function z(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.max=l(Ce,pe,_e)),ge}i(z,"semBmax"),a(z,"semBmax");function te(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.min=h(Ce,pe,_e)),ge}i(te,"semXmin"),a(te,"semXmin");function ae(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&(Q.max=h(Ce,pe,_e)),ge}i(ae,"semXmax"),a(ae,"semXmax");function ve(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.tbsstr.push(c(Ce,pe,_e)),ge}i(ve,"semDstring"),a(ve,"semDstring");function De(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.tbsstr.push(l(Ce,pe,_e)),ge}i(De,"semBstring"),a(De,"semBstring");function we(de,Ce,pe,_e,Q){let ge=s.SEM_OK;return de===s.SEM_POST&&Q.tbsstr.push(h(Ce,pe,_e)),ge}i(we,"semXstring"),a(we,"semXstring"),this.callbacks=[],this.callbacks.abgop=ue,this.callbacks.aenop=me,this.callbacks.alternation=y,this.callbacks.andop=k,this.callbacks.bmax=z,this.callbacks.bmin=I,this.callbacks.bkaop=q,this.callbacks.bknop=E,this.callbacks.bkrop=T,this.callbacks["bkr-name"]=M,this.callbacks.bstring=De,this.callbacks.clsop=F,this.callbacks.ci=m,this.callbacks.cs=d,this.callbacks.um=g,this.callbacks.pm=_,this.callbacks.concatenation=A,this.callbacks.defined=L,this.callbacks.dmax=J,this.callbacks.dmin=Y,this.callbacks.dstring=ve,this.callbacks.file=p,this.callbacks.incalt=K,this.callbacks.notop=H,this.callbacks.optionopen=O,this.callbacks["rep-max"]=V,this.callbacks["rep-min"]=j,this.callbacks["rep-min-max"]=G,this.callbacks.repetition=C,this.callbacks.repop=$,this.callbacks.rnmop=se,this.callbacks.rule=v,this.callbacks.rulelookup=b,this.callbacks.rulename=R,this.callbacks.tbsop=le,this.callbacks.tlscase=B,this.callbacks.tlsstring=D,this.callbacks.tlsop=N,this.callbacks.trgop=P,this.callbacks["udt-empty"]=S,this.callbacks["udt-non-empty"]=w,this.callbacks.xmax=ae,this.callbacks.xmin=te,this.callbacks.xstring=we},"exfn"),"exfn")}}),F$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/sabnf-grammar.js"(e,t){t.exports=a(i(function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=a(i(function(){let s="";return s+=`;
|
|
389
|
+
`,s+=`; ABNF for JavaScript APG 2.0 SABNF
|
|
390
|
+
`,s+=`; RFC 5234 with some restrictions and additions.
|
|
391
|
+
`,s+=`; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation
|
|
392
|
+
`,s+=`; - accepts %s"string" as a case-sensitive string
|
|
393
|
+
`,s+=`; - accepts %i"string" as a case-insensitive string
|
|
394
|
+
`,s+=`; - accepts "string" as a case-insensitive string
|
|
395
|
+
`,s+=`;
|
|
396
|
+
`,s+=`; Some restrictions:
|
|
397
|
+
`,s+=`; 1. Rules must begin at first character of each line.
|
|
398
|
+
`,s+=`; Indentations on first rule and rules thereafter are not allowed.
|
|
399
|
+
`,s+=`; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.
|
|
400
|
+
`,s+=`; 3. Prose values, i.e. <prose value>, are accepted as valid grammar syntax.
|
|
401
|
+
`,s+=`; However, a working parser cannot be generated from them.
|
|
402
|
+
`,s+=`;
|
|
403
|
+
`,s+=`; Super set (SABNF) additions:
|
|
404
|
+
`,s+=`; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.
|
|
405
|
+
`,s+=`; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found
|
|
406
|
+
`,s+=`; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found
|
|
407
|
+
`,s+=`; e.g. &%d13 or &rule or !(A / B)
|
|
408
|
+
`,s+=`; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.
|
|
409
|
+
`,s+=`; 'name' is alpha followed by alpha/num/hyphen just like a rule name.
|
|
410
|
+
`,s+=`; u_name may be used as an element but no rule definition is given.
|
|
411
|
+
`,s+=`; e.g. rule = A / u_myUdt
|
|
412
|
+
`,s+=`; A = "a"
|
|
413
|
+
`,s+=`; would be a valid grammar.
|
|
414
|
+
`,s+=`; 3. Case-sensitive, single-quoted strings are accepted.
|
|
415
|
+
`,s+=`; e.g. 'abc' would be equivalent to %d97.98.99
|
|
416
|
+
`,s+=`; (kept for backward compatibility, but superseded by %s"abc")
|
|
417
|
+
`,s+=`; New 12/26/2015
|
|
418
|
+
`,s+=`; 4. Look-behind operators are accepted as element prefixes.
|
|
419
|
+
`,s+=`; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found
|
|
420
|
+
`,s+=`; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found
|
|
421
|
+
`,s+=`; e.g. &&%d13 or &&rule or !!(A / B)
|
|
422
|
+
`,s+=`; 5. Back reference operators, i.e. \\rulename, are accepted.
|
|
423
|
+
`,s+=`; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts
|
|
424
|
+
`,s+=`; to match is a phrase previously matched by the rule 'rulename'.
|
|
425
|
+
`,s+=`; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.
|
|
426
|
+
`,s+=`; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.
|
|
427
|
+
`,s+=`; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.
|
|
428
|
+
`,s+=`; Back reference modifiers can be used to specify case and mode.
|
|
429
|
+
`,s+=`; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA
|
|
430
|
+
`,s+=`; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.
|
|
431
|
+
`,s+=`; Modifiers %u and %p determine universal mode and parent frame mode, respectively.
|
|
432
|
+
`,s+=`; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA.
|
|
433
|
+
`,s+=`; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.
|
|
434
|
+
`,s+=`; Returns EMPTY or NOMATCH. Never consumes any characters.
|
|
435
|
+
`,s+=`; 8. String end anchor, AEN(%$) matches the end of the input string location.
|
|
436
|
+
`,s+=`; Returns EMPTY or NOMATCH. Never consumes any characters.
|
|
437
|
+
`,s+=`;
|
|
438
|
+
`,s+=`File = *(BlankLine / Rule / RuleError)
|
|
439
|
+
`,s+=`BlankLine = *(%d32/%d9) [comment] LineEnd
|
|
440
|
+
`,s+=`Rule = RuleLookup owsp Alternation ((owsp LineEnd)
|
|
441
|
+
`,s+=` / (LineEndError LineEnd))
|
|
442
|
+
`,s+=`RuleLookup = RuleNameTest owsp DefinedAsTest
|
|
443
|
+
`,s+=`RuleNameTest = RuleName/RuleNameError
|
|
444
|
+
`,s+=`RuleName = alphanum
|
|
445
|
+
`,s+=`RuleNameError = 1*(%d33-60/%d62-126)
|
|
446
|
+
`,s+=`DefinedAsTest = DefinedAs / DefinedAsError
|
|
447
|
+
`,s+=`DefinedAsError = 1*2%d33-126
|
|
448
|
+
`,s+=`DefinedAs = IncAlt / Defined
|
|
449
|
+
`,s+=`Defined = %d61
|
|
450
|
+
`,s+=`IncAlt = %d61.47
|
|
451
|
+
`,s+=`RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd
|
|
452
|
+
`,s+=`LineEndError = 1*(%d32-126 / %d9 / LineContinue)
|
|
453
|
+
`,s+=`Alternation = Concatenation *(owsp AltOp Concatenation)
|
|
454
|
+
`,s+=`Concatenation = Repetition *(CatOp Repetition)
|
|
455
|
+
`,s+=`Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)
|
|
456
|
+
`,s+=`Modifier = (Predicate [RepOp])
|
|
457
|
+
`,s+=` / RepOp
|
|
458
|
+
`,s+=`Predicate = BkaOp
|
|
459
|
+
`,s+=` / BknOp
|
|
460
|
+
`,s+=` / AndOp
|
|
461
|
+
`,s+=` / NotOp
|
|
462
|
+
`,s+=`BasicElement = UdtOp
|
|
463
|
+
`,s+=` / RnmOp
|
|
464
|
+
`,s+=` / TrgOp
|
|
465
|
+
`,s+=` / TbsOp
|
|
466
|
+
`,s+=` / TlsOp
|
|
467
|
+
`,s+=` / ClsOp
|
|
468
|
+
`,s+=` / BkrOp
|
|
469
|
+
`,s+=` / AbgOp
|
|
470
|
+
`,s+=` / AenOp
|
|
471
|
+
`,s+=` / ProsVal
|
|
472
|
+
`,s+=`BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)
|
|
473
|
+
`,s+=`Group = GroupOpen Alternation (GroupClose / GroupError)
|
|
474
|
+
`,s+=`GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr
|
|
475
|
+
`,s+=`GroupOpen = %d40 owsp
|
|
476
|
+
`,s+=`GroupClose = owsp %d41
|
|
477
|
+
`,s+=`Option = OptionOpen Alternation (OptionClose / OptionError)
|
|
478
|
+
`,s+=`OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr
|
|
479
|
+
`,s+=`OptionOpen = %d91 owsp
|
|
480
|
+
`,s+=`OptionClose = owsp %d93
|
|
481
|
+
`,s+=`RnmOp = alphanum
|
|
482
|
+
`,s+=`BkrOp = %d92 [bkrModifier] bkr-name
|
|
483
|
+
`,s+=`bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])
|
|
484
|
+
`,s+=`cs = '%s'
|
|
485
|
+
`,s+=`ci = '%i'
|
|
486
|
+
`,s+=`um = '%u'
|
|
487
|
+
`,s+=`pm = '%p'
|
|
488
|
+
`,s+=`bkr-name = uname / ename / rname
|
|
489
|
+
`,s+=`rname = alphanum
|
|
490
|
+
`,s+=`uname = %d117.95 alphanum
|
|
491
|
+
`,s+=`ename = %d101.95 alphanum
|
|
492
|
+
`,s+=`UdtOp = udt-empty
|
|
493
|
+
`,s+=` / udt-non-empty
|
|
494
|
+
`,s+=`udt-non-empty = %d117.95 alphanum
|
|
495
|
+
`,s+=`udt-empty = %d101.95 alphanum
|
|
496
|
+
`,s+=`RepOp = (rep-min StarOp rep-max)
|
|
497
|
+
`,s+=` / (rep-min StarOp)
|
|
498
|
+
`,s+=` / (StarOp rep-max)
|
|
499
|
+
`,s+=` / StarOp
|
|
500
|
+
`,s+=` / rep-min-max
|
|
501
|
+
`,s+=`AltOp = %d47 owsp
|
|
502
|
+
`,s+=`CatOp = wsp
|
|
503
|
+
`,s+=`StarOp = %d42
|
|
504
|
+
`,s+=`AndOp = %d38
|
|
505
|
+
`,s+=`NotOp = %d33
|
|
506
|
+
`,s+=`BkaOp = %d38.38
|
|
507
|
+
`,s+=`BknOp = %d33.33
|
|
508
|
+
`,s+=`AbgOp = %d37.94
|
|
509
|
+
`,s+=`AenOp = %d37.36
|
|
510
|
+
`,s+=`TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))
|
|
511
|
+
`,s+=`TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))
|
|
512
|
+
`,s+=`TlsOp = TlsCase TlsOpen TlsString TlsClose
|
|
513
|
+
`,s+=`TlsCase = ["%i" / "%s"]
|
|
514
|
+
`,s+=`TlsOpen = %d34
|
|
515
|
+
`,s+=`TlsClose = %d34
|
|
516
|
+
`,s+=`TlsString = *(%d32-33/%d35-126/StringTab)
|
|
517
|
+
`,s+=`StringTab = %d9
|
|
518
|
+
`,s+=`ClsOp = ClsOpen ClsString ClsClose
|
|
519
|
+
`,s+=`ClsOpen = %d39
|
|
520
|
+
`,s+=`ClsClose = %d39
|
|
521
|
+
`,s+=`ClsString = *(%d32-38/%d40-126/StringTab)
|
|
522
|
+
`,s+=`ProsVal = ProsValOpen ProsValString ProsValClose
|
|
523
|
+
`,s+=`ProsValOpen = %d60
|
|
524
|
+
`,s+=`ProsValString = *(%d32-61/%d63-126/StringTab)
|
|
525
|
+
`,s+=`ProsValClose = %d62
|
|
526
|
+
`,s+=`rep-min = rep-num
|
|
527
|
+
`,s+=`rep-min-max = rep-num
|
|
528
|
+
`,s+=`rep-max = rep-num
|
|
529
|
+
`,s+=`rep-num = 1*(%d48-57)
|
|
530
|
+
`,s+=`dString = dnum
|
|
531
|
+
`,s+=`xString = xnum
|
|
532
|
+
`,s+=`bString = bnum
|
|
533
|
+
`,s+=`Dec = (%d68/%d100)
|
|
534
|
+
`,s+=`Hex = (%d88/%d120)
|
|
535
|
+
`,s+=`Bin = (%d66/%d98)
|
|
536
|
+
`,s+=`dmin = dnum
|
|
537
|
+
`,s+=`dmax = dnum
|
|
538
|
+
`,s+=`bmin = bnum
|
|
539
|
+
`,s+=`bmax = bnum
|
|
540
|
+
`,s+=`xmin = xnum
|
|
541
|
+
`,s+=`xmax = xnum
|
|
542
|
+
`,s+=`dnum = 1*(%d48-57)
|
|
543
|
+
`,s+=`bnum = 1*%d48-49
|
|
544
|
+
`,s+=`xnum = 1*(%d48-57 / %d65-70 / %d97-102)
|
|
545
|
+
`,s+=`;
|
|
546
|
+
`,s+=`; Basics
|
|
547
|
+
`,s+=`alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)
|
|
548
|
+
`,s+=`owsp = *space
|
|
549
|
+
`,s+=`wsp = 1*space
|
|
550
|
+
`,s+=`space = %d32
|
|
551
|
+
`,s+=` / %d9
|
|
552
|
+
`,s+=` / comment
|
|
553
|
+
`,s+=` / LineContinue
|
|
554
|
+
`,s+=`comment = %d59 *(%d32-126 / %d9)
|
|
555
|
+
`,s+=`LineEnd = %d13.10
|
|
556
|
+
`,s+=` / %d10
|
|
557
|
+
`,s+=` / %d13
|
|
558
|
+
`,s+=`LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)
|
|
559
|
+
`,s},"toString4"),"toString")},"grammar"),"grammar")}}),U$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/parser.js"(e,t){t.exports=a(i(function(){let n="parser: ",s=el(),o=s.ids,c=new(B$()),l=new(L$()),h=new(F$()),p=new s.parser;p.ast=new s.ast,p.callbacks=c.callbacks,p.ast.callbacks=l.callbacks;let v=a(i(function(C,O,R){if(O<0||O>=R)return-1;for(let L=0;L<C.length;L+=1)if(O>=C[L].beginChar&&O<C[L].beginChar+C[L].length)return L;return-1},"findLine2"),"findLine"),b=a(i(function(C,O){let R=-1;if(O<C.length){for(let L=O;L<C.length;L+=1)if(C[L]!==null){R=C[L];break}}return R},"translateIndex2"),"translateIndex"),y=a(i(function(C){C.forEach(O=>{let R=[],L=[],K=0;O.opcodes.forEach($=>{$.type===o.ALT&&$.children.length===1||$.type===o.CAT&&$.children.length===1||$.type===o.REP&&$.min===1&&$.max===1?L.push(null):(L.push(K),R.push($),K+=1)}),L.push(K),R.forEach($=>{if($.type===o.ALT||$.type===o.CAT)for(let j=0;j<$.children.length;j+=1)$.children[j]=b(L,$.children[j])}),O.opcodes=R})},"reduceOpcodes2"),"reduceOpcodes");this.syntax=a(i(function(C,O,R,L,K){if(K){if(K.traceObject!=="traceObject")throw new TypeError(`${n}trace argument is not a trace object`);p.trace=K}let $={};$.errors=R,$.strict=!!L,$.lines=O,$.findLine=v,$.charsLength=C.length,$.ruleCount=0,p.parse(h,"file",C,$).success||R.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})},"syntax"),"syntax"),this.semantic=a(i(function(C,O,R){let L={};return L.errors=R,L.lines=O,L.findLine=v,L.charsLength=C.length,p.ast.translate(L),R.length?null:(y(L.rules),{rules:L.rules,udts:L.udts,lineMap:L.rulesLineMap})},"semantic"),"semantic"),this.generateSource=a(i(function(C,O,R,L,K){let $="",j,V,G,k=0,H=1/0,se=0,ue=[],me=[],q=0,E=0,T=0,m=0,d=0,g=0,_=0,M=0,S=0,w=0,N=0,B=0,D=0,F=0,le=0;R.forEach(J=>{ue.push(J.lower),k+=J.opcodes.length,J.opcodes.forEach(I=>{switch(I.type){case o.ALT:q+=1;break;case o.CAT:E+=1;break;case o.RNM:T+=1;break;case o.UDT:m+=1;break;case o.REP:d+=1;break;case o.AND:g+=1;break;case o.NOT:_+=1;break;case o.BKA:B+=1;break;case o.BKN:D+=1;break;case o.BKR:N+=1;break;case o.ABG:F+=1;break;case o.AEN:le+=1;break;case o.TLS:for(M+=1,j=0;j<I.string.length;j+=1)I.string[j]<H&&(H=I.string[j]),I.string[j]>se&&(se=I.string[j]);break;case o.TBS:for(S+=1,j=0;j<I.string.length;j+=1)I.string[j]<H&&(H=I.string[j]),I.string[j]>se&&(se=I.string[j]);break;case o.TRG:w+=1,I.min<H&&(H=I.min),I.max>se&&(se=I.max);break;default:throw new Error("generateSource: unrecognized opcode")}})}),ue.sort(),L.length>0&&(L.forEach(J=>{me.push(J.lower)}),me.sort());let P="module.exports";K&&typeof K=="string"&&(P=`let ${K}`),$+=`// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>
|
|
560
|
+
`,$+=`// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>
|
|
561
|
+
`,$+=`//
|
|
562
|
+
`,$+=`// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)
|
|
563
|
+
`,$+=`${P} = function grammar(){
|
|
564
|
+
`,$+=" // ```\n",$+=` // SUMMARY
|
|
565
|
+
`,$+=` // rules = ${R.length}
|
|
566
|
+
`,$+=` // udts = ${L.length}
|
|
567
|
+
`,$+=` // opcodes = ${k}
|
|
568
|
+
`,$+=` // --- ABNF original opcodes
|
|
569
|
+
`,$+=` // ALT = ${q}
|
|
570
|
+
`,$+=` // CAT = ${E}
|
|
571
|
+
`,$+=` // REP = ${d}
|
|
572
|
+
`,$+=` // RNM = ${T}
|
|
573
|
+
`,$+=` // TLS = ${M}
|
|
574
|
+
`,$+=` // TBS = ${S}
|
|
575
|
+
`,$+=` // TRG = ${w}
|
|
576
|
+
`,$+=` // --- SABNF superset opcodes
|
|
577
|
+
`,$+=` // UDT = ${m}
|
|
578
|
+
`,$+=` // AND = ${g}
|
|
579
|
+
`,$+=` // NOT = ${_}
|
|
580
|
+
`,$+=` // BKA = ${B}
|
|
581
|
+
`,$+=` // BKN = ${D}
|
|
582
|
+
`,$+=` // BKR = ${N}
|
|
583
|
+
`,$+=` // ABG = ${F}
|
|
584
|
+
`,$+=` // AEN = ${le}
|
|
585
|
+
`,$+=" // characters = [",M+S+w===0?$+=" none defined ]":$+=`${H} - ${se}]`,m>0&&($+=" + user defined"),$+=`
|
|
586
|
+
`,$+=" // ```\n",$+=` /* OBJECT IDENTIFIER (for internal parser use) */
|
|
587
|
+
`,$+=` this.grammarObject = 'grammarObject';
|
|
588
|
+
`,$+=`
|
|
589
|
+
`,$+=` /* RULES */
|
|
590
|
+
`,$+=` this.rules = [];
|
|
591
|
+
`,R.forEach((J,I)=>{let z=" this.rules[";z+=I,z+="] = {name: '",z+=J.name,z+="', lower: '",z+=J.lower,z+="', index: ",z+=J.index,z+=", isBkr: ",z+=J.isBkr,z+=`};
|
|
592
|
+
`,$+=z}),$+=`
|
|
593
|
+
`,$+=` /* UDTS */
|
|
594
|
+
`,$+=` this.udts = [];
|
|
595
|
+
`,L.length>0&&L.forEach((J,I)=>{let z=" this.udts[";z+=I,z+="] = {name: '",z+=J.name,z+="', lower: '",z+=J.lower,z+="', index: ",z+=J.index,z+=", empty: ",z+=J.empty,z+=", isBkr: ",z+=J.isBkr,z+=`};
|
|
596
|
+
`,$+=z}),$+=`
|
|
597
|
+
`,$+=` /* OPCODES */
|
|
598
|
+
`,R.forEach((J,I)=>{I>0&&($+=`
|
|
599
|
+
`),$+=` /* ${J.name} */
|
|
600
|
+
`,$+=` this.rules[${I}].opcodes = [];
|
|
601
|
+
`,J.opcodes.forEach((z,te)=>{let ae;switch(z.type){case o.ALT:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, children: [${z.children.toString()}]};// ALT
|
|
602
|
+
`;break;case o.CAT:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, children: [${z.children.toString()}]};// CAT
|
|
603
|
+
`;break;case o.RNM:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, index: ${z.index}};// RNM(${R[z.index].name})
|
|
604
|
+
`;break;case o.BKR:z.index>=R.length?(V=L[z.index-R.length].name,G=L[z.index-R.length].lower):(V=R[z.index].name,G=R[z.index].lower),ae="%i",z.bkrCase===o.BKR_MODE_CS&&(ae="%s"),z.bkrMode===o.BKR_MODE_UM?ae+="%u":ae+="%p",V=ae+V,$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, index: ${z.index}, lower: '${G}', bkrCase: ${z.bkrCase}, bkrMode: ${z.bkrMode}};// BKR(\\${V})
|
|
605
|
+
`;break;case o.UDT:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, empty: ${z.empty}, index: ${z.index}};// UDT(${L[z.index].name})
|
|
606
|
+
`;break;case o.REP:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, min: ${z.min}, max: ${z.max}};// REP
|
|
607
|
+
`;break;case o.AND:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// AND
|
|
608
|
+
`;break;case o.NOT:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// NOT
|
|
609
|
+
`;break;case o.ABG:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// ABG(%^)
|
|
610
|
+
`;break;case o.AEN:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// AEN(%$)
|
|
611
|
+
`;break;case o.BKA:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// BKA
|
|
612
|
+
`;break;case o.BKN:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}};// BKN
|
|
613
|
+
`;break;case o.TLS:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, string: [${z.string.toString()}]};// TLS
|
|
614
|
+
`;break;case o.TBS:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, string: [${z.string.toString()}]};// TBS
|
|
615
|
+
`;break;case o.TRG:$+=` this.rules[${I}].opcodes[${te}] = {type: ${z.type}, min: ${z.min}, max: ${z.max}};// TRG
|
|
616
|
+
`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}})}),$+=`
|
|
617
|
+
`,$+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",$+=` this.toString = function toString(){
|
|
618
|
+
`,$+=` let str = "";
|
|
619
|
+
`;let Y;return O.forEach(J=>{let I=J.beginChar+J.length;Y="",$+=' str += "';for(let z=J.beginChar;z<I;z+=1){switch(C[z]){case 9:Y=" ";break;case 10:Y="\\n";break;case 13:Y="\\r";break;case 34:Y='\\"';break;case 92:Y="\\\\";break;default:Y=String.fromCharCode(C[z]);break}$+=Y}$+=`";
|
|
620
|
+
`}),$+=` return str;
|
|
621
|
+
`,$+=` }
|
|
622
|
+
`,$+=`}
|
|
623
|
+
`,$},"generateSource"),"generateSource"),this.generateObject=a(i(function(C,O,R){let L={},K=[],$=[],j=C.slice(0);return L.grammarObject="grammarObject",O.forEach(V=>{K.push(V.lower)}),K.sort(),R.length>0&&(R.forEach(V=>{$.push(V.lower)}),$.sort()),L.callbacks=[],K.forEach(V=>{L.callbacks[V]=!1}),R.length>0&&$.forEach(V=>{L.callbacks[V]=!1}),L.rules=O,L.udts=R,L.toString=a(i(function(){return j},"toStringFunc"),"toStringFunc"),L},"generateObject"),"generateObject")},"exportParser"),"exportParser")}}),$$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/rule-attributes.js"(e,t){t.exports=a(i(function(){let n=qs(),s="rule-attributes.js",o=null;function c(q){return q.left||q.nested||q.right||q.cyclic?!1:q.empty}i(c,"isEmptyOnly"),a(c,"isEmptyOnly");function l(q){return!!(q.left||q.nested||q.right||q.cyclic)}i(l,"isRecursive"),a(l,"isRecursive");function h(q,E){let T=0,m=0,d=0;for(T=0;T<E;T+=1)if(q[T].nested)return!0;for(T=0;T<E;T+=1)if(q[T].right&&!q[T].leaf){for(m=T+1;m<E;m+=1)if(!c(q[m]))return!0}for(T=E-1;T>=0;T-=1)if(q[T].left&&!q[T].leaf){for(m=T-1;m>=0;m-=1)if(!c(q[m]))return!0}for(T=0;T<E;T+=1)if(!q[T].empty&&!l(q[T])){for(m=T+1;m<E;m+=1)if(l(q[m])){for(d=m+1;d<E;d+=1)if(!q[d].empty&&!l(q[d]))return!0}}return!1}i(h,"isCatNested"),a(h,"isCatNested");function p(q,E){for(let T=0;T<E;T+=1)if(!q[T].cyclic)return!1;return!0}i(p,"isCatCyclic"),a(p,"isCatCyclic");function v(q,E){for(let T=0;T<E;T+=1){if(q[T].left)return!0;if(!q[T].empty)return!1}return!1}i(v,"isCatLeft"),a(v,"isCatLeft");function b(q,E){for(let T=E-1;T>=0;T-=1){if(q[T].right)return!0;if(!q[T].empty)return!1}return!1}i(b,"isCatRight"),a(b,"isCatRight");function y(q,E){for(let T=0;T<E;T+=1)if(!q[T].empty)return!1;return!0}i(y,"isCatEmpty"),a(y,"isCatEmpty");function A(q,E){for(let T=0;T<E;T+=1)if(!q[T].finite)return!1;return!0}i(A,"isCatFinite"),a(A,"isCatFinite");function C(q,E,T,m){let d=0,g=E[T],_=g.children.length,M=[];for(d=0;d<_;d+=1)M.push(q.attrGen());for(d=0;d<_;d+=1)L(q,E,g.children[d],M[d]);m.left=v(M,_),m.right=b(M,_),m.nested=h(M,_),m.empty=y(M,_),m.finite=A(M,_),m.cyclic=p(M,_)}i(C,"cat"),a(C,"cat");function O(q,E,T,m){let d=0,g=E[T],_=g.children.length,M=[];for(d=0;d<_;d+=1)M.push(q.attrGen());for(d=0;d<_;d+=1)L(q,E,g.children[d],M[d]);for(m.left=!1,m.right=!1,m.nested=!1,m.empty=!1,m.finite=!1,m.cyclic=!1,d=0;d<_;d+=1)M[d].left&&(m.left=!0),M[d].nested&&(m.nested=!0),M[d].right&&(m.right=!0),M[d].empty&&(m.empty=!0),M[d].finite&&(m.finite=!0),M[d].cyclic&&(m.cyclic=!0)}i(O,"alt"),a(O,"alt");function R(q,E,T,m){let d=E[T];d.index>=q.ruleCount?(m.empty=q.udts[d.index-q.ruleCount].empty,m.finite=!0):(K(q,d.index,m),m.left=!1,m.nested=!1,m.right=!1,m.cyclic=!1)}i(R,"bkr"),a(R,"bkr");function L(q,E,T,m){q.attrInit(m);let d=E[T];switch(d.type){case n.ALT:O(q,E,T,m);break;case n.CAT:C(q,E,T,m);break;case n.REP:L(q,E,T+1,m),d.min===0&&(m.empty=!0,m.finite=!0);break;case n.RNM:K(q,E[T].index,m);break;case n.BKR:R(q,E,T,m);break;case n.AND:case n.NOT:case n.BKA:case n.BKN:L(q,E,T+1,m),m.empty=!0;break;case n.TLS:m.empty=!E[T].string.length,m.finite=!0,m.cyclic=!1;break;case n.TBS:case n.TRG:m.empty=!1,m.finite=!0,m.cyclic=!1;break;case n.UDT:m.empty=d.empty,m.finite=!0,m.cyclic=!1;break;case n.ABG:case n.AEN:m.empty=!0,m.finite=!0,m.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${d}`)}}i(L,"opEval"),a(L,"opEval");function K(q,E,T){let m=q.attrsWorking[E];m.isComplete?q.attrCopy(T,m):m.isOpen?E===q.startRule?E===q.startRule&&(T.left=!0,T.right=!0,T.cyclic=!0,T.leaf=!0):T.finite=!0:(m.isOpen=!0,L(q,m.rule.opcodes,0,T),m.left=T.left,m.right=T.right,m.nested=T.nested,m.empty=T.empty,m.finite=T.finite,m.cyclic=T.cyclic,m.leaf=!1,m.isOpen=!1,m.isComplete=!0)}i(K,"ruleAttrsEval"),a(K,"ruleAttrsEval");let $=a(q=>{o=q;let E=0,T=0,m=o.attrGen();for(E=0;E<o.ruleCount;E+=1){for(T=0;T<o.ruleCount;T+=1)o.attrInit(o.attrsWorking[T]);o.startRule=E,K(o,E,m),o.attrCopy(o.attrs[E],o.attrsWorking[E])}o.attributesComplete=!0;let d=null;for(E=0;E<o.ruleCount;E+=1)if(d=o.attrs[E],d.left||!d.finite||d.cyclic){let g=o.attrGen(d.rule);o.attrCopy(g,d),o.attrsErrors.push(g),o.attrsErrorCount+=1}},"ruleAttributes"),j=a(q=>q?"t":"f","truth"),V=a(q=>q?"e":"f","tError"),G=a(q=>q?"t":"e","fError"),k=a((q,E,T,m)=>{let d=`${q}:${E}:`;return d+=`${V(T.left)} `,d+=`${j(T.nested)} `,d+=`${j(T.right)} `,d+=`${V(T.cyclic)} `,d+=`${G(T.finite)} `,d+=`${j(T.empty)}:`,d+=`${o.typeToString(m.recursiveType)}:`,d+=m.recursiveType===n.ATTR_MR?m.groupNumber:"-",d+=`:${T.rule.name}
|
|
624
|
+
`,d},"showAttr"),H=a(()=>{let q=`LEGEND - t=true, f=false, e=error
|
|
625
|
+
`;return q+=`sequence:rule index:left nested right cyclic finite empty:type:group number:rule name
|
|
626
|
+
`,q},"showLegend"),se=a(()=>{let q=null,E=null,T="";if(T+=`RULE ATTRIBUTES WITH ERRORS
|
|
627
|
+
`,T+=H(),o.attrsErrorCount)for(let m=0;m<o.attrsErrorCount;m+=1)q=o.attrsErrors[m],E=o.ruleDeps[q.rule.index],T+=k(m,q.rule.index,q,E);else T+=`<none>
|
|
628
|
+
`;return T},"showAttributeErrors"),ue=a(q=>{let E=0,T=0,m=null,d=null,g="",{ruleIndexes:_}=o;for(q===97?_=o.ruleAlphaIndexes:q===116&&(_=o.ruleTypeIndexes),E=0;E<o.ruleCount;E+=1)T=_[E],m=o.attrs[T],d=o.ruleDeps[T],g+=k(E,T,m,d);return g},"show");return{ruleAttributes:$,showAttributes:a((q="index")=>{if(!o.attributesComplete)throw new Error(`${s}:showAttributes: attributes not available`);let E="",T=`RULE ATTRIBUTES
|
|
629
|
+
`;return q.charCodeAt(0)===97?(E+=`alphabetical by rule name
|
|
630
|
+
`,E+=T,E+=H(),E+=ue(97)):q.charCodeAt(0)===116?(E+=`ordered by rule type
|
|
631
|
+
`,E+=T,E+=H(),E+=ue(116)):(E+=`ordered by rule index
|
|
632
|
+
`,E+=T,E+=H(),E+=ue()),E},"showAttributes"),showAttributeErrors:se}},"exportRuleAttributes"),"exportRuleAttributes")()}}),j$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/rule-dependencies.js"(e,t){t.exports=(()=>{let r=qs(),n=null,s=a((h,p,v,b)=>{let y=0,A=0,C=p[v];b[v]=!0;let O=C.rule.opcodes;for(y=0;y<O.length;y+=1){let R=O[y];if(R.type===r.RNM)for(C.refersTo[R.index]=!0,b[R.index]||s(h,p,R.index,b),A=0;A<h;A+=1)p[R.index].refersTo[A]&&(C.refersTo[A]=!0);else R.type===r.UDT?C.refersToUdt[R.index]=!0:R.type===r.BKR&&(R.index<h?(C.refersTo[R.index]=!0,b[R.index]||s(h,p,R.index,b)):C.refersToUdt[h-R.index]=!0)}},"scan"),o=a(h=>{n=h;let p=0,v=0,b=0,y=null,A=null,C=!1;n.dependenciesComplete=!1;let O=n.falseArray(n.ruleCount);for(p=0;p<n.ruleCount;p+=1)n.falsifyArray(O),s(n.ruleCount,n.ruleDeps,p,O);for(p=0;p<n.ruleCount;p+=1)for(v=0;v<n.ruleCount;v+=1)p!==v&&n.ruleDeps[v].refersTo[p]&&(n.ruleDeps[p].referencedBy[v]=!0);for(p=0;p<n.ruleCount;p+=1)n.ruleDeps[p].recursiveType=r.ATTR_N,n.ruleDeps[p].refersTo[p]&&(n.ruleDeps[p].recursiveType=r.ATTR_R);for(b=-1,p=0;p<n.ruleCount;p+=1)if(y=n.ruleDeps[p],y.recursiveType===r.ATTR_R)for(C=!0,v=0;v<n.ruleCount;v+=1)p!==v&&(A=n.ruleDeps[v],A.recursiveType===r.ATTR_R&&y.refersTo[v]&&A.refersTo[p]&&(C&&(b+=1,y.recursiveType=r.ATTR_MR,y.groupNumber=b,C=!1),A.recursiveType=r.ATTR_MR,A.groupNumber=b));n.isMutuallyRecursive=b>-1,n.ruleAlphaIndexes.sort(n.compRulesAlpha),n.ruleTypeIndexes.sort(n.compRulesAlpha),n.ruleTypeIndexes.sort(n.compRulesType),n.isMutuallyRecursive&&n.ruleTypeIndexes.sort(n.compRulesGroup),n.udtCount&&n.udtAlphaIndexes.sort(n.compUdtsAlpha),n.dependenciesComplete=!0},"ruleDependencies"),c=a((h=null)=>{let p=0,v=0,b=0,y=0,A=n.ruleCount-1,C=n.udtCount-1,O=100,R="",L="",K="=> ",$="<= ",j=!1,V=null,{ruleIndexes:G}=n,{udtIndexes:k}=n;for(h===97?(G=n.ruleAlphaIndexes,k=n.udtAlphaIndexes):h===116&&(G=n.ruleTypeIndexes,k=n.udtAlphaIndexes),p=0;p<n.ruleCount;p+=1){for(V=n.ruleDeps[G[p]],L=`${G[p]}:${n.typeToString(V.recursiveType)}:`,n.isMutuallyRecursive&&(L+=V.groupNumber>-1?V.groupNumber:"-",L+=":"),L+=" ",R+=`${L+n.rules[G[p]].name}
|
|
633
|
+
`,j=!0,b=0,y=R.length,R+=L,v=0;v<n.ruleCount;v+=1)V.refersTo[G[v]]&&(j?(R+=K,j=!1,R+=n.ruleDeps[G[v]].rule.name):R+=`, ${n.ruleDeps[G[v]].rule.name}`,b+=1),R.length-y>O&&v!==A&&(R+=`
|
|
634
|
+
${L}${K}`,y=R.length);if(n.udtCount)for(v=0;v<n.udtCount;v+=1)V.refersToUdt[k[v]]&&(j?(R+=K,j=!1,R+=n.udts[k[v]].name):R+=`, ${n.udts[k[v]].name}`,b+=1),R.length-y>O&&v!==C&&(R+=`
|
|
635
|
+
${L}${K}`,y=R.length);for(b===0&&(R+=`=> <none>
|
|
636
|
+
`),j===!1&&(R+=`
|
|
637
|
+
`),j=!0,b=0,y=R.length,R+=L,v=0;v<n.ruleCount;v+=1)V.referencedBy[G[v]]&&(j?(R+=$,j=!1,R+=n.ruleDeps[G[v]].rule.name):R+=`, ${n.ruleDeps[G[v]].rule.name}`,b+=1),R.length-y>O&&v!==A&&(R+=`
|
|
638
|
+
${L}${K}`,y=R.length);b===0&&(R+=`<= <none>
|
|
639
|
+
`),j===!1&&(R+=`
|
|
640
|
+
`),R+=`
|
|
641
|
+
`}return R},"show");return{ruleDependencies:o,showRuleDependencies:a((h="index")=>{let p=`RULE DEPENDENCIES(index:type:[group number:])
|
|
642
|
+
`;return p+=`=> refers to rule names
|
|
643
|
+
`,p+=`<= referenced by rule names
|
|
644
|
+
`,n.dependenciesComplete&&(h.charCodeAt(0)===97?(p+=`alphabetical by rule name
|
|
645
|
+
`,p+=c(97)):h.charCodeAt(0)===116?(p+=`ordered by rule type
|
|
646
|
+
`,p+=c(116)):(p+=`ordered by rule index
|
|
647
|
+
`,p+=c(null))),p},"showRuleDependencies")}})()}}),z$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/attributes.js"(e,t){t.exports=a(i(function(){let n=qs(),{ruleAttributes:s,showAttributes:o,showAttributeErrors:c}=$$(),{ruleDependencies:l,showRuleDependencies:h}=j$();class p{constructor(y,A){this.rules=y,this.udts=A,this.ruleCount=y.length,this.udtCount=A.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let C=0;C<this.ruleCount;C+=1)this.attrs.push(this.attrGen(this.rules[C])),this.attrsWorking.push(this.attrGen(this.rules[C])),this.ruleDeps.push(this.rdGen(y[C],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(y){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:y}}attrInit(y){y.left=!1,y.nested=!1,y.right=!1,y.empty=!1,y.finite=!1,y.cyclic=!1,y.leaf=!1,y.isOpen=!1,y.isComplete=!1}attrCopy(y,A){y.left=A.left,y.nested=A.nested,y.right=A.right,y.empty=A.empty,y.finite=A.finite,y.cyclic=A.cyclic,y.leaf=A.leaf,y.isOpen=A.isOpen,y.isComplete=A.isComplete,y.rule=A.rule}rdGen(y,A,C){return{rule:y,recursiveType:n.ATTR_N,groupNumber:-1,refersTo:this.falseArray(A),refersToUdt:this.falseArray(C),referencedBy:this.falseArray(A)}}typeToString(y){switch(y){case n.ATTR_N:return" N";case n.ATTR_R:return" R";case n.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(y){let A=[];if(y>0)for(let C=0;C<y;C+=1)A.push(!1);return A}falsifyArray(y){for(let A=0;A<y.length;A+=1)y[A]=!1}indexArray(y){let A=[];if(y>0)for(let C=0;C<y;C+=1)A.push(C);return A}compRulesAlpha(y,A){return this.rules[y].lower<this.rules[A].lower?-1:this.rules[y].lower>this.rules[A].lower?1:0}compUdtsAlpha(y,A){return this.udts[y].lower<this.udts[A].lower?-1:this.udts[y].lower>this.udts[A].lower?1:0}compRulesType(y,A){return this.ruleDeps[y].recursiveType<this.ruleDeps[A].recursiveType?-1:this.ruleDeps[y].recursiveType>this.ruleDeps[A].recursiveType?1:0}compRulesGroup(y,A){if(this.ruleDeps[y].recursiveType===n.ATTR_MR&&this.ruleDeps[A].recursiveType===n.ATTR_MR){if(this.ruleDeps[y].groupNumber<this.ruleDeps[A].groupNumber)return-1;if(this.ruleDeps[y].groupNumber>this.ruleDeps[A].groupNumber)return 1}return 0}}return i(p,"State"),a(p,"State"),{attributes:a(i(function(y=[],A=[],C=[],O=[]){let R=new p(y,A);return l(R),s(R),R.attrsErrorCount&&O.push({line:0,char:0,msg:`${R.attrsErrorCount} attribute errors`}),R.attrsErrorCount},"attributes2"),"attributes"),showAttributes:o,showAttributeErrors:c,showRuleDependencies:h}},"exportAttributes"),"exportAttributes")()}}),H$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/show-rules.js"(e,t){t.exports=a(i(function(){let n="show-rules.js";return a(i(function(c=[],l=[],h="index"){let p="showRules",v=[],b=[],y=[],A=[],C=c,O=l,R=c.length,L=l.length,K="RULE/UDT NAMES",$;function j(G,k){return C[G].lower<C[k].lower?-1:C[G].lower>C[k].lower?1:0}i(j,"compRulesAlpha"),a(j,"compRulesAlpha");function V(G,k){return O[G].lower<O[k].lower?-1:O[G].lower>O[k].lower?1:0}if(i(V,"compUdtsAlpha"),a(V,"compUdtsAlpha"),!(Array.isArray(c)&&c.length))throw new Error(`${n}:${p}: rules arg must be array with length > 0`);if(!Array.isArray(l))throw new Error(`${n}:${p}: udts arg must be array`);for($=0;$<R;$+=1)y.push($);if(v=y.slice(0),v.sort(j),L){for($=0;$<L;$+=1)A.push($);b=A.slice(0),b.sort(V)}if(h.charCodeAt(0)===97){for(K+=` - alphabetical by rule/UDT name
|
|
648
|
+
`,$=0;$<R;$+=1)K+=`${$}: ${v[$]}: ${C[v[$]].name}
|
|
649
|
+
`;if(L)for($=0;$<L;$+=1)K+=`${$}: ${b[$]}: ${O[b[$]].name}
|
|
650
|
+
`}else{for(K+=` - ordered by rule/UDT index
|
|
651
|
+
`,$=0;$<R;$+=1)K+=`${$}: ${C[$].name}
|
|
652
|
+
`;if(L)for($=0;$<L;$+=1)K+=`${$}: ${O[$].name}
|
|
653
|
+
`}return K},"showRules2"),"showRules")},"exfn"),"exfn")()}}),q$=ze({"../../../node_modules/.pnpm/apg-js@4.1.3/node_modules/apg-js/src/apg-api/api.js"(e,t){t.exports=a(i(function(n){let s="api.js: ",o=this,c=el(),l=Cx(),h=P$(),p=new(U$()),{attributes:v,showAttributes:b,showAttributeErrors:y,showRuleDependencies:A}=z$(),C=H$(),O=a(i(function(q,E,T){let _=`<span class="${c.style.CLASS_CTRLCHAR}">`,M="</span>",S=`<span class="${c.style.CLASS_NOMATCH}">`,w="</span>",N,B="",D=!0;for(;D&&!(!Array.isArray(q)||q.length===0);){if(typeof E!="number")throw new Error("abnfToHtml: beg must be type number");if(E>=q.length)break;typeof T!="number"||E+T>=q.length?N=q.length:N=E+T;let F=0;for(let le=E;le<N;le+=1){let P=q[le];if(P>=32&&P<=126)switch(F===1?(B+=M,F=0):F===2&&(B+=w,F=0),P){case 32:B+=" ";break;case 60:B+="<";break;case 62:B+=">";break;case 38:B+="&";break;case 34:B+=""";break;case 39:B+="'";break;case 92:B+="\";break;default:B+=String.fromCharCode(P);break}else P===9||P===10||P===13?(F===0?(B+=_,F=1):F===2&&(B+=w+_,F=1),P===9&&(B+="TAB"),P===10&&(B+="LF"),P===13&&(B+="CR")):(F===0?(B+=S,F=2):F===1&&(B+=M+S,F=2),B+=`\\x${c.utils.charToHex(P)}`)}F===2&&(B+=w),F===1&&(B+=M);break}return B},"abnfToHtml2"),"abnfToHtml"),R=a(i(function(q,E,T){let m="";for(let d=E;d<E+T;d+=1){let g=q[d];if(g>=32&&g<=126)m+=String.fromCharCode(g);else switch(g){case 9:m+="\\t";break;case 10:m+="\\n";break;case 13:m+="\\r";break;default:m+="\\unknown";break}}return m},"abnfToAscii2"),"abnfToAscii"),L=a(i(function(q){let E="Annotated Input Grammar";return q.forEach(T=>{E+=`
|
|
654
|
+
`,E+=`line no: ${T.lineNo}`,E+=` : char index: ${T.beginChar}`,E+=` : length: ${T.length}`,E+=` : abnf: ${R(o.chars,T.beginChar,T.length)}`}),E+=`
|
|
655
|
+
`,E},"linesToAscii2"),"linesToAscii"),K=a(i(function(q){let E="";return E+=`<table class="${c.style.CLASS_GRAMMAR}">
|
|
656
|
+
`,E+=`<caption>Annotated Input Grammar</caption>
|
|
657
|
+
`,E+="<tr>",E+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",E+=`</tr>
|
|
658
|
+
`,q.forEach(m=>{E+="<tr>",E+=`<td>${m.lineNo}`,E+=`</td><td>${m.beginChar}`,E+=`</td><td>${m.length}`,E+=`</td><td>${O(o.chars,m.beginChar,m.length)}`,E+="</td>",E+=`</tr>
|
|
659
|
+
`}),E+=`</table>
|
|
660
|
+
`,E},"linesToHtml2"),"linesToHtml"),$=a(i(function(q,E,T,m){let[d]=c,g="",_=`<span class="${d.CLASS_NOMATCH}">»</span>`;return g+=`<p><table class="${d.CLASS_GRAMMAR}">
|
|
661
|
+
`,m&&typeof m=="string"&&(g+=`<caption>${m}</caption>
|
|
662
|
+
`),g+=`<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>
|
|
663
|
+
`,q.forEach(M=>{let S,w,N,B,D,F="",le="";E.length===0?(D=_,w=0):(S=E[M.line],N=S.beginChar,M.char>N&&(F=O(T,N,M.char-N)),N=M.char,B=S.beginChar+S.length,N<B&&(le=O(T,N,B-N)),D=F+_+le,w=M.char-S.beginChar,g+="<tr>",g+=`<td>${M.line}</td><td>${S.beginChar}</td><td>${w}</td><td>${D}</td>`,g+=`</tr>
|
|
664
|
+
`,g+="<tr>",g+=`<td colspan="3"></td><td>↑: ${c.utils.stringToAsciiHtml(M.msg)}</td>`,g+=`</tr>
|
|
665
|
+
`)}),g+=`</table></p>
|
|
666
|
+
`,g},"errorsToHtml2"),"errorsToHtml"),j=a(i(function(q,E,T){let m,d,g,_;return m="",q.forEach(M=>{d=E[M.line],m+=`${d.lineNo}: `,m+=`${d.beginChar}: `,m+=`${M.char-d.beginChar}: `,g=d.beginChar,_=M.char-d.beginChar,m+=R(T,g,_),m+=" >> ",g=M.char,_=d.beginChar+d.length-M.char,m+=R(T,g,_),m+=`
|
|
667
|
+
`,m+=`${d.lineNo}: `,m+=`${d.beginChar}: `,m+=`${M.char-d.beginChar}: `,m+="error: ",m+=M.msg,m+=`
|
|
668
|
+
`}),m},"errorsToAscii2"),"errorsToAscii"),V=!1,G=!1,k=!1,H=!1,se=0,ue;if(this.errors=[],Buffer.isBuffer(n))this.chars=l.decode("BINARY",n);else if(Array.isArray(n))this.chars=n.slice();else if(typeof n=="string")this.chars=l.decode("STRING",n);else throw new Error(`${s}input source is not a string, byte Buffer or character array`);this.sabnf=l.encode("STRING",this.chars),this.scan=a(i(function(q,E){this.lines=h(this.chars,this.errors,q,E),V=!0},"scan"),"scan"),this.parse=a(i(function(q,E){if(!V)throw new Error(`${s}grammar not scanned`);p.syntax(this.chars,this.lines,this.errors,q,E),G=!0},"parse2"),"parse"),this.translate=a(i(function(){if(!G)throw new Error(`${s}grammar not scanned and parsed`);let q=p.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=q.rules,this.udts=q.udts,ue=q.lineMap,k=!0)},"translate"),"translate"),this.attributes=a(i(function(){if(!k)throw new Error(`${s}grammar not scanned, parsed and translated`);return se=v(this.rules,this.udts,ue,this.errors),H=!0,se},"attrs"),"attrs"),this.generate=a(i(function(q){if(this.lines=h(this.chars,this.errors,q),this.errors.length||(p.syntax(this.chars,this.lines,this.errors,q),this.errors.length))return;let E=p.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=E.rules,this.udts=E.udts,ue=E.lineMap,se=v(this.rules,this.udts,ue,this.errors),H=!0)},"generate3"),"generate"),this.displayRules=a(i(function(q="index"){if(!k)throw new Error(`${s}grammar not scanned, parsed and translated`);return C(this.rules,this.udts,q)},"displayRules"),"displayRules"),this.displayRuleDependencies=a(i(function(q="index"){if(!H)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return A(q)},"displayRuleDependencies"),"displayRuleDependencies"),this.displayAttributes=a(i(function(q="index"){if(!H)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return se&&y(q),b(q)},"displayAttributes"),"displayAttributes"),this.displayAttributeErrors=a(i(function(){if(!H)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return y()},"displayAttributeErrors"),"displayAttributeErrors"),this.toSource=a(i(function(q){if(!H)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(se)throw new Error(`${s}can't generate parser source - attributes have ${se} errors`);return p.generateSource(this.chars,this.lines,this.rules,this.udts,q)},"toSource"),"toSource"),this.toObject=a(i(function(){if(!H)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(se)throw new Error(`${s}can't generate parser source - attributes have ${se} errors`);return p.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),"toObject"),this.errorsToAscii=a(i(function(){return j(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),"errorsToAsciiFunc"),this.errorsToHtml=a(i(function(q){return $(this.errors,this.lines,this.chars,q)},"errorsToHtmlFunc"),"errorsToHtmlFunc"),this.linesToAscii=a(i(function(){return L(this.lines)},"linesToAsciiFunc"),"linesToAsciiFunc"),this.linesToHtml=a(i(function(){return K(this.lines)},"linesToHtmlFunc"),"linesToHtmlFunc")},"api"),"api")}}),kx=ze({"../../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){"use strict";function s(m,d){if(!m)throw new Error(d||"Assertion failed")}i(s,"assert2"),a(s,"assert");function o(m,d){m.super_=d;var g=a(function(){},"TempCtor");g.prototype=d.prototype,m.prototype=new g,m.prototype.constructor=m}i(o,"inherits"),a(o,"inherits");function c(m,d,g){if(c.isBN(m))return m;this.negative=0,this.words=null,this.length=0,this.red=null,m!==null&&((d==="le"||d==="be")&&(g=d,d=10),this._init(m||0,d||10,g||"be"))}i(c,"BN3"),a(c,"BN"),typeof r=="object"?r.exports=c:n.BN=c,c.BN=c,c.wordSize=26;var l;try{typeof window<"u"&&typeof window.Buffer<"u"?l=window.Buffer:l=bx().Buffer}catch{}c.isBN=a(i(function(d){return d instanceof c?!0:d!==null&&typeof d=="object"&&d.constructor.wordSize===c.wordSize&&Array.isArray(d.words)},"isBN"),"isBN"),c.max=a(i(function(d,g){return d.cmp(g)>0?d:g},"max"),"max"),c.min=a(i(function(d,g){return d.cmp(g)<0?d:g},"min"),"min"),c.prototype._init=a(i(function(d,g,_){if(typeof d=="number")return this._initNumber(d,g,_);if(typeof d=="object")return this._initArray(d,g,_);g==="hex"&&(g=16),s(g===(g|0)&&g>=2&&g<=36),d=d.toString().replace(/\s+/g,"");var M=0;d[0]==="-"&&(M++,this.negative=1),M<d.length&&(g===16?this._parseHex(d,M,_):(this._parseBase(d,g,M),_==="le"&&this._initArray(this.toArray(),g,_)))},"init2"),"init"),c.prototype._initNumber=a(i(function(d,g,_){d<0&&(this.negative=1,d=-d),d<67108864?(this.words=[d&67108863],this.length=1):d<4503599627370496?(this.words=[d&67108863,d/67108864&67108863],this.length=2):(s(d<9007199254740992),this.words=[d&67108863,d/67108864&67108863,1],this.length=3),_==="le"&&this._initArray(this.toArray(),g,_)},"_initNumber"),"_initNumber"),c.prototype._initArray=a(i(function(d,g,_){if(s(typeof d.length=="number"),d.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(d.length/3),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var S,w,N=0;if(_==="be")for(M=d.length-1,S=0;M>=0;M-=3)w=d[M]|d[M-1]<<8|d[M-2]<<16,this.words[S]|=w<<N&67108863,this.words[S+1]=w>>>26-N&67108863,N+=24,N>=26&&(N-=26,S++);else if(_==="le")for(M=0,S=0;M<d.length;M+=3)w=d[M]|d[M+1]<<8|d[M+2]<<16,this.words[S]|=w<<N&67108863,this.words[S+1]=w>>>26-N&67108863,N+=24,N>=26&&(N-=26,S++);return this._strip()},"_initArray"),"_initArray");function h(m,d){var g=m.charCodeAt(d);if(g>=48&&g<=57)return g-48;if(g>=65&&g<=70)return g-55;if(g>=97&&g<=102)return g-87;s(!1,"Invalid character in "+m)}i(h,"parseHex4Bits"),a(h,"parseHex4Bits");function p(m,d,g){var _=h(m,g);return g-1>=d&&(_|=h(m,g-1)<<4),_}i(p,"parseHexByte"),a(p,"parseHexByte"),c.prototype._parseHex=a(i(function(d,g,_){this.length=Math.ceil((d.length-g)/6),this.words=new Array(this.length);for(var M=0;M<this.length;M++)this.words[M]=0;var S=0,w=0,N;if(_==="be")for(M=d.length-1;M>=g;M-=2)N=p(d,g,M)<<S,this.words[w]|=N&67108863,S>=18?(S-=18,w+=1,this.words[w]|=N>>>26):S+=8;else{var B=d.length-g;for(M=B%2===0?g+1:g;M<d.length;M+=2)N=p(d,g,M)<<S,this.words[w]|=N&67108863,S>=18?(S-=18,w+=1,this.words[w]|=N>>>26):S+=8}this._strip()},"_parseHex"),"_parseHex");function v(m,d,g,_){for(var M=0,S=0,w=Math.min(m.length,g),N=d;N<w;N++){var B=m.charCodeAt(N)-48;M*=_,B>=49?S=B-49+10:B>=17?S=B-17+10:S=B,s(B>=0&&S<_,"Invalid character"),M+=S}return M}i(v,"parseBase"),a(v,"parseBase"),c.prototype._parseBase=a(i(function(d,g,_){this.words=[0],this.length=1;for(var M=0,S=1;S<=67108863;S*=g)M++;M--,S=S/g|0;for(var w=d.length-_,N=w%M,B=Math.min(w,w-N)+_,D=0,F=_;F<B;F+=M)D=v(d,F,F+M,g),this.imuln(S),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D);if(N!==0){var le=1;for(D=v(d,F,d.length,g),F=0;F<N;F++)le*=g;this.imuln(le),this.words[0]+D<67108864?this.words[0]+=D:this._iaddn(D)}this._strip()},"_parseBase"),"_parseBase"),c.prototype.copy=a(i(function(d){d.words=new Array(this.length);for(var g=0;g<this.length;g++)d.words[g]=this.words[g];d.length=this.length,d.negative=this.negative,d.red=this.red},"copy"),"copy");function b(m,d){m.words=d.words,m.length=d.length,m.negative=d.negative,m.red=d.red}if(i(b,"move"),a(b,"move"),c.prototype._move=a(i(function(d){b(d,this)},"_move"),"_move"),c.prototype.clone=a(i(function(){var d=new c(null);return this.copy(d),d},"clone"),"clone"),c.prototype._expand=a(i(function(d){for(;this.length<d;)this.words[this.length++]=0;return this},"_expand"),"_expand"),c.prototype._strip=a(i(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),"strip"),c.prototype._normSign=a(i(function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},"_normSign"),"_normSign"),typeof Symbol<"u"&&typeof Symbol.for=="function")try{c.prototype[Symbol.for("nodejs.util.inspect.custom")]=y}catch{c.prototype.inspect=y}else c.prototype.inspect=y;function y(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}i(y,"inspect4"),a(y,"inspect");var A=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],C=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],O=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];c.prototype.toString=a(i(function(d,g){d=d||10,g=g|0||1;var _;if(d===16||d==="hex"){_="";for(var M=0,S=0,w=0;w<this.length;w++){var N=this.words[w],B=((N<<M|S)&16777215).toString(16);S=N>>>24-M&16777215,M+=2,M>=26&&(M-=26,w--),S!==0||w!==this.length-1?_=A[6-B.length]+B+_:_=B+_}for(S!==0&&(_=S.toString(16)+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}if(d===(d|0)&&d>=2&&d<=36){var D=C[d],F=O[d];_="";var le=this.clone();for(le.negative=0;!le.isZero();){var P=le.modrn(F).toString(d);le=le.idivn(F),le.isZero()?_=P+_:_=A[D-P.length]+P+_}for(this.isZero()&&(_="0"+_);_.length%g!==0;)_="0"+_;return this.negative!==0&&(_="-"+_),_}s(!1,"Base should be between 2 and 36")},"toString4"),"toString"),c.prototype.toNumber=a(i(function(){var d=this.words[0];return this.length===2?d+=this.words[1]*67108864:this.length===3&&this.words[2]===1?d+=4503599627370496+this.words[1]*67108864:this.length>2&&s(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-d:d},"toNumber"),"toNumber"),c.prototype.toJSON=a(i(function(){return this.toString(16,2)},"toJSON2"),"toJSON"),l&&(c.prototype.toBuffer=a(i(function(d,g){return this.toArrayLike(l,d,g)},"toBuffer"),"toBuffer")),c.prototype.toArray=a(i(function(d,g){return this.toArrayLike(Array,d,g)},"toArray"),"toArray");var R=a(i(function(d,g){return d.allocUnsafe?d.allocUnsafe(g):new d(g)},"allocate2"),"allocate");c.prototype.toArrayLike=a(i(function(d,g,_){this._strip();var M=this.byteLength(),S=_||Math.max(1,M);s(M<=S,"byte array longer than desired length"),s(S>0,"Requested array length <= 0");var w=R(d,S),N=g==="le"?"LE":"BE";return this["_toArrayLike"+N](w,M),w},"toArrayLike"),"toArrayLike"),c.prototype._toArrayLikeLE=a(i(function(d,g){for(var _=0,M=0,S=0,w=0;S<this.length;S++){var N=this.words[S]<<w|M;d[_++]=N&255,_<d.length&&(d[_++]=N>>8&255),_<d.length&&(d[_++]=N>>16&255),w===6?(_<d.length&&(d[_++]=N>>24&255),M=0,w=0):(M=N>>>24,w+=2)}if(_<d.length)for(d[_++]=M;_<d.length;)d[_++]=0},"_toArrayLikeLE"),"_toArrayLikeLE"),c.prototype._toArrayLikeBE=a(i(function(d,g){for(var _=d.length-1,M=0,S=0,w=0;S<this.length;S++){var N=this.words[S]<<w|M;d[_--]=N&255,_>=0&&(d[_--]=N>>8&255),_>=0&&(d[_--]=N>>16&255),w===6?(_>=0&&(d[_--]=N>>24&255),M=0,w=0):(M=N>>>24,w+=2)}if(_>=0)for(d[_--]=M;_>=0;)d[_--]=0},"_toArrayLikeBE"),"_toArrayLikeBE"),Math.clz32?c.prototype._countBits=a(i(function(d){return 32-Math.clz32(d)},"_countBits"),"_countBits"):c.prototype._countBits=a(i(function(d){var g=d,_=0;return g>=4096&&(_+=13,g>>>=13),g>=64&&(_+=7,g>>>=7),g>=8&&(_+=4,g>>>=4),g>=2&&(_+=2,g>>>=2),_+g},"_countBits"),"_countBits"),c.prototype._zeroBits=a(i(function(d){if(d===0)return 26;var g=d,_=0;return(g&8191)===0&&(_+=13,g>>>=13),(g&127)===0&&(_+=7,g>>>=7),(g&15)===0&&(_+=4,g>>>=4),(g&3)===0&&(_+=2,g>>>=2),(g&1)===0&&_++,_},"_zeroBits"),"_zeroBits"),c.prototype.bitLength=a(i(function(){var d=this.words[this.length-1],g=this._countBits(d);return(this.length-1)*26+g},"bitLength"),"bitLength");function L(m){for(var d=new Array(m.bitLength()),g=0;g<d.length;g++){var _=g/26|0,M=g%26;d[g]=m.words[_]>>>M&1}return d}i(L,"toBitArray"),a(L,"toBitArray"),c.prototype.zeroBits=a(i(function(){if(this.isZero())return 0;for(var d=0,g=0;g<this.length;g++){var _=this._zeroBits(this.words[g]);if(d+=_,_!==26)break}return d},"zeroBits"),"zeroBits"),c.prototype.byteLength=a(i(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),"byteLength"),c.prototype.toTwos=a(i(function(d){return this.negative!==0?this.abs().inotn(d).iaddn(1):this.clone()},"toTwos"),"toTwos"),c.prototype.fromTwos=a(i(function(d){return this.testn(d-1)?this.notn(d).iaddn(1).ineg():this.clone()},"fromTwos"),"fromTwos"),c.prototype.isNeg=a(i(function(){return this.negative!==0},"isNeg"),"isNeg"),c.prototype.neg=a(i(function(){return this.clone().ineg()},"neg3"),"neg"),c.prototype.ineg=a(i(function(){return this.isZero()||(this.negative^=1),this},"ineg"),"ineg"),c.prototype.iuor=a(i(function(d){for(;this.length<d.length;)this.words[this.length++]=0;for(var g=0;g<d.length;g++)this.words[g]=this.words[g]|d.words[g];return this._strip()},"iuor"),"iuor"),c.prototype.ior=a(i(function(d){return s((this.negative|d.negative)===0),this.iuor(d)},"ior"),"ior"),c.prototype.or=a(i(function(d){return this.length>d.length?this.clone().ior(d):d.clone().ior(this)},"or2"),"or"),c.prototype.uor=a(i(function(d){return this.length>d.length?this.clone().iuor(d):d.clone().iuor(this)},"uor"),"uor"),c.prototype.iuand=a(i(function(d){var g;this.length>d.length?g=d:g=this;for(var _=0;_<g.length;_++)this.words[_]=this.words[_]&d.words[_];return this.length=g.length,this._strip()},"iuand"),"iuand"),c.prototype.iand=a(i(function(d){return s((this.negative|d.negative)===0),this.iuand(d)},"iand"),"iand"),c.prototype.and=a(i(function(d){return this.length>d.length?this.clone().iand(d):d.clone().iand(this)},"and"),"and"),c.prototype.uand=a(i(function(d){return this.length>d.length?this.clone().iuand(d):d.clone().iuand(this)},"uand"),"uand"),c.prototype.iuxor=a(i(function(d){var g,_;this.length>d.length?(g=this,_=d):(g=d,_=this);for(var M=0;M<_.length;M++)this.words[M]=g.words[M]^_.words[M];if(this!==g)for(;M<g.length;M++)this.words[M]=g.words[M];return this.length=g.length,this._strip()},"iuxor"),"iuxor"),c.prototype.ixor=a(i(function(d){return s((this.negative|d.negative)===0),this.iuxor(d)},"ixor"),"ixor"),c.prototype.xor=a(i(function(d){return this.length>d.length?this.clone().ixor(d):d.clone().ixor(this)},"xor2"),"xor"),c.prototype.uxor=a(i(function(d){return this.length>d.length?this.clone().iuxor(d):d.clone().iuxor(this)},"uxor"),"uxor"),c.prototype.inotn=a(i(function(d){s(typeof d=="number"&&d>=0);var g=Math.ceil(d/26)|0,_=d%26;this._expand(g),_>0&&g--;for(var M=0;M<g;M++)this.words[M]=~this.words[M]&67108863;return _>0&&(this.words[M]=~this.words[M]&67108863>>26-_),this._strip()},"inotn"),"inotn"),c.prototype.notn=a(i(function(d){return this.clone().inotn(d)},"notn"),"notn"),c.prototype.setn=a(i(function(d,g){s(typeof d=="number"&&d>=0);var _=d/26|0,M=d%26;return this._expand(_+1),g?this.words[_]=this.words[_]|1<<M:this.words[_]=this.words[_]&~(1<<M),this._strip()},"setn"),"setn"),c.prototype.iadd=a(i(function(d){var g;if(this.negative!==0&&d.negative===0)return this.negative=0,g=this.isub(d),this.negative^=1,this._normSign();if(this.negative===0&&d.negative!==0)return d.negative=0,g=this.isub(d),d.negative=1,g._normSign();var _,M;this.length>d.length?(_=this,M=d):(_=d,M=this);for(var S=0,w=0;w<M.length;w++)g=(_.words[w]|0)+(M.words[w]|0)+S,this.words[w]=g&67108863,S=g>>>26;for(;S!==0&&w<_.length;w++)g=(_.words[w]|0)+S,this.words[w]=g&67108863,S=g>>>26;if(this.length=_.length,S!==0)this.words[this.length]=S,this.length++;else if(_!==this)for(;w<_.length;w++)this.words[w]=_.words[w];return this},"iadd"),"iadd"),c.prototype.add=a(i(function(d){var g;return d.negative!==0&&this.negative===0?(d.negative=0,g=this.sub(d),d.negative^=1,g):d.negative===0&&this.negative!==0?(this.negative=0,g=d.sub(this),this.negative=1,g):this.length>d.length?this.clone().iadd(d):d.clone().iadd(this)},"add3"),"add"),c.prototype.isub=a(i(function(d){if(d.negative!==0){d.negative=0;var g=this.iadd(d);return d.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(d),this.negative=1,this._normSign();var _=this.cmp(d);if(_===0)return this.negative=0,this.length=1,this.words[0]=0,this;var M,S;_>0?(M=this,S=d):(M=d,S=this);for(var w=0,N=0;N<S.length;N++)g=(M.words[N]|0)-(S.words[N]|0)+w,w=g>>26,this.words[N]=g&67108863;for(;w!==0&&N<M.length;N++)g=(M.words[N]|0)+w,w=g>>26,this.words[N]=g&67108863;if(w===0&&N<M.length&&M!==this)for(;N<M.length;N++)this.words[N]=M.words[N];return this.length=Math.max(this.length,N),M!==this&&(this.negative=1),this._strip()},"isub"),"isub"),c.prototype.sub=a(i(function(d){return this.clone().isub(d)},"sub"),"sub");function K(m,d,g){g.negative=d.negative^m.negative;var _=m.length+d.length|0;g.length=_,_=_-1|0;var M=m.words[0]|0,S=d.words[0]|0,w=M*S,N=w&67108863,B=w/67108864|0;g.words[0]=N;for(var D=1;D<_;D++){for(var F=B>>>26,le=B&67108863,P=Math.min(D,d.length-1),Y=Math.max(0,D-m.length+1);Y<=P;Y++){var J=D-Y|0;M=m.words[J]|0,S=d.words[Y]|0,w=M*S+le,F+=w/67108864|0,le=w&67108863}g.words[D]=le|0,B=F|0}return B!==0?g.words[D]=B|0:g.length--,g._strip()}i(K,"smallMulTo"),a(K,"smallMulTo");var $=a(i(function(d,g,_){var M=d.words,S=g.words,w=_.words,N=0,B,D,F,le=M[0]|0,P=le&8191,Y=le>>>13,J=M[1]|0,I=J&8191,z=J>>>13,te=M[2]|0,ae=te&8191,ve=te>>>13,De=M[3]|0,we=De&8191,de=De>>>13,Ce=M[4]|0,pe=Ce&8191,_e=Ce>>>13,Q=M[5]|0,ge=Q&8191,Me=Q>>>13,Ue=M[6]|0,Re=Ue&8191,je=Ue>>>13,rt=M[7]|0,fe=rt&8191,ce=rt>>>13,Z=M[8]|0,re=Z&8191,ye=Z>>>13,Se=M[9]|0,xe=Se&8191,ke=Se>>>13,Mt=S[0]|0,qe=Mt&8191,He=Mt>>>13,Ot=S[1]|0,dt=Ot&8191,vt=Ot>>>13,kr=S[2]|0,ct=kr&8191,ut=kr>>>13,cr=S[3]|0,lt=cr&8191,nt=cr>>>13,ir=S[4]|0,it=ir&8191,Ye=ir>>>13,Qt=S[5]|0,st=Qt&8191,Qe=Qt>>>13,sr=S[6]|0,at=sr&8191,Ze=sr>>>13,ar=S[7]|0,ot=ar&8191,Et=ar>>>13,Sn=S[8]|0,At=Sn&8191,yt=Sn>>>13,fn=S[9]|0,er=fn&8191,tr=fn>>>13;_.negative=d.negative^g.negative,_.length=19,B=Math.imul(P,qe),D=Math.imul(P,He),D=D+Math.imul(Y,qe)|0,F=Math.imul(Y,He);var tn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(tn>>>26)|0,tn&=67108863,B=Math.imul(I,qe),D=Math.imul(I,He),D=D+Math.imul(z,qe)|0,F=Math.imul(z,He),B=B+Math.imul(P,dt)|0,D=D+Math.imul(P,vt)|0,D=D+Math.imul(Y,dt)|0,F=F+Math.imul(Y,vt)|0;var rn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(rn>>>26)|0,rn&=67108863,B=Math.imul(ae,qe),D=Math.imul(ae,He),D=D+Math.imul(ve,qe)|0,F=Math.imul(ve,He),B=B+Math.imul(I,dt)|0,D=D+Math.imul(I,vt)|0,D=D+Math.imul(z,dt)|0,F=F+Math.imul(z,vt)|0,B=B+Math.imul(P,ct)|0,D=D+Math.imul(P,ut)|0,D=D+Math.imul(Y,ct)|0,F=F+Math.imul(Y,ut)|0;var Or=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Or>>>26)|0,Or&=67108863,B=Math.imul(we,qe),D=Math.imul(we,He),D=D+Math.imul(de,qe)|0,F=Math.imul(de,He),B=B+Math.imul(ae,dt)|0,D=D+Math.imul(ae,vt)|0,D=D+Math.imul(ve,dt)|0,F=F+Math.imul(ve,vt)|0,B=B+Math.imul(I,ct)|0,D=D+Math.imul(I,ut)|0,D=D+Math.imul(z,ct)|0,F=F+Math.imul(z,ut)|0,B=B+Math.imul(P,lt)|0,D=D+Math.imul(P,nt)|0,D=D+Math.imul(Y,lt)|0,F=F+Math.imul(Y,nt)|0;var Hr=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,B=Math.imul(pe,qe),D=Math.imul(pe,He),D=D+Math.imul(_e,qe)|0,F=Math.imul(_e,He),B=B+Math.imul(we,dt)|0,D=D+Math.imul(we,vt)|0,D=D+Math.imul(de,dt)|0,F=F+Math.imul(de,vt)|0,B=B+Math.imul(ae,ct)|0,D=D+Math.imul(ae,ut)|0,D=D+Math.imul(ve,ct)|0,F=F+Math.imul(ve,ut)|0,B=B+Math.imul(I,lt)|0,D=D+Math.imul(I,nt)|0,D=D+Math.imul(z,lt)|0,F=F+Math.imul(z,nt)|0,B=B+Math.imul(P,it)|0,D=D+Math.imul(P,Ye)|0,D=D+Math.imul(Y,it)|0,F=F+Math.imul(Y,Ye)|0;var nn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(nn>>>26)|0,nn&=67108863,B=Math.imul(ge,qe),D=Math.imul(ge,He),D=D+Math.imul(Me,qe)|0,F=Math.imul(Me,He),B=B+Math.imul(pe,dt)|0,D=D+Math.imul(pe,vt)|0,D=D+Math.imul(_e,dt)|0,F=F+Math.imul(_e,vt)|0,B=B+Math.imul(we,ct)|0,D=D+Math.imul(we,ut)|0,D=D+Math.imul(de,ct)|0,F=F+Math.imul(de,ut)|0,B=B+Math.imul(ae,lt)|0,D=D+Math.imul(ae,nt)|0,D=D+Math.imul(ve,lt)|0,F=F+Math.imul(ve,nt)|0,B=B+Math.imul(I,it)|0,D=D+Math.imul(I,Ye)|0,D=D+Math.imul(z,it)|0,F=F+Math.imul(z,Ye)|0,B=B+Math.imul(P,st)|0,D=D+Math.imul(P,Qe)|0,D=D+Math.imul(Y,st)|0,F=F+Math.imul(Y,Qe)|0;var xn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(xn>>>26)|0,xn&=67108863,B=Math.imul(Re,qe),D=Math.imul(Re,He),D=D+Math.imul(je,qe)|0,F=Math.imul(je,He),B=B+Math.imul(ge,dt)|0,D=D+Math.imul(ge,vt)|0,D=D+Math.imul(Me,dt)|0,F=F+Math.imul(Me,vt)|0,B=B+Math.imul(pe,ct)|0,D=D+Math.imul(pe,ut)|0,D=D+Math.imul(_e,ct)|0,F=F+Math.imul(_e,ut)|0,B=B+Math.imul(we,lt)|0,D=D+Math.imul(we,nt)|0,D=D+Math.imul(de,lt)|0,F=F+Math.imul(de,nt)|0,B=B+Math.imul(ae,it)|0,D=D+Math.imul(ae,Ye)|0,D=D+Math.imul(ve,it)|0,F=F+Math.imul(ve,Ye)|0,B=B+Math.imul(I,st)|0,D=D+Math.imul(I,Qe)|0,D=D+Math.imul(z,st)|0,F=F+Math.imul(z,Qe)|0,B=B+Math.imul(P,at)|0,D=D+Math.imul(P,Ze)|0,D=D+Math.imul(Y,at)|0,F=F+Math.imul(Y,Ze)|0;var Ei=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Ei>>>26)|0,Ei&=67108863,B=Math.imul(fe,qe),D=Math.imul(fe,He),D=D+Math.imul(ce,qe)|0,F=Math.imul(ce,He),B=B+Math.imul(Re,dt)|0,D=D+Math.imul(Re,vt)|0,D=D+Math.imul(je,dt)|0,F=F+Math.imul(je,vt)|0,B=B+Math.imul(ge,ct)|0,D=D+Math.imul(ge,ut)|0,D=D+Math.imul(Me,ct)|0,F=F+Math.imul(Me,ut)|0,B=B+Math.imul(pe,lt)|0,D=D+Math.imul(pe,nt)|0,D=D+Math.imul(_e,lt)|0,F=F+Math.imul(_e,nt)|0,B=B+Math.imul(we,it)|0,D=D+Math.imul(we,Ye)|0,D=D+Math.imul(de,it)|0,F=F+Math.imul(de,Ye)|0,B=B+Math.imul(ae,st)|0,D=D+Math.imul(ae,Qe)|0,D=D+Math.imul(ve,st)|0,F=F+Math.imul(ve,Qe)|0,B=B+Math.imul(I,at)|0,D=D+Math.imul(I,Ze)|0,D=D+Math.imul(z,at)|0,F=F+Math.imul(z,Ze)|0,B=B+Math.imul(P,ot)|0,D=D+Math.imul(P,Et)|0,D=D+Math.imul(Y,ot)|0,F=F+Math.imul(Y,Et)|0;var Ai=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Ai>>>26)|0,Ai&=67108863,B=Math.imul(re,qe),D=Math.imul(re,He),D=D+Math.imul(ye,qe)|0,F=Math.imul(ye,He),B=B+Math.imul(fe,dt)|0,D=D+Math.imul(fe,vt)|0,D=D+Math.imul(ce,dt)|0,F=F+Math.imul(ce,vt)|0,B=B+Math.imul(Re,ct)|0,D=D+Math.imul(Re,ut)|0,D=D+Math.imul(je,ct)|0,F=F+Math.imul(je,ut)|0,B=B+Math.imul(ge,lt)|0,D=D+Math.imul(ge,nt)|0,D=D+Math.imul(Me,lt)|0,F=F+Math.imul(Me,nt)|0,B=B+Math.imul(pe,it)|0,D=D+Math.imul(pe,Ye)|0,D=D+Math.imul(_e,it)|0,F=F+Math.imul(_e,Ye)|0,B=B+Math.imul(we,st)|0,D=D+Math.imul(we,Qe)|0,D=D+Math.imul(de,st)|0,F=F+Math.imul(de,Qe)|0,B=B+Math.imul(ae,at)|0,D=D+Math.imul(ae,Ze)|0,D=D+Math.imul(ve,at)|0,F=F+Math.imul(ve,Ze)|0,B=B+Math.imul(I,ot)|0,D=D+Math.imul(I,Et)|0,D=D+Math.imul(z,ot)|0,F=F+Math.imul(z,Et)|0,B=B+Math.imul(P,At)|0,D=D+Math.imul(P,yt)|0,D=D+Math.imul(Y,At)|0,F=F+Math.imul(Y,yt)|0;var Si=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Si>>>26)|0,Si&=67108863,B=Math.imul(xe,qe),D=Math.imul(xe,He),D=D+Math.imul(ke,qe)|0,F=Math.imul(ke,He),B=B+Math.imul(re,dt)|0,D=D+Math.imul(re,vt)|0,D=D+Math.imul(ye,dt)|0,F=F+Math.imul(ye,vt)|0,B=B+Math.imul(fe,ct)|0,D=D+Math.imul(fe,ut)|0,D=D+Math.imul(ce,ct)|0,F=F+Math.imul(ce,ut)|0,B=B+Math.imul(Re,lt)|0,D=D+Math.imul(Re,nt)|0,D=D+Math.imul(je,lt)|0,F=F+Math.imul(je,nt)|0,B=B+Math.imul(ge,it)|0,D=D+Math.imul(ge,Ye)|0,D=D+Math.imul(Me,it)|0,F=F+Math.imul(Me,Ye)|0,B=B+Math.imul(pe,st)|0,D=D+Math.imul(pe,Qe)|0,D=D+Math.imul(_e,st)|0,F=F+Math.imul(_e,Qe)|0,B=B+Math.imul(we,at)|0,D=D+Math.imul(we,Ze)|0,D=D+Math.imul(de,at)|0,F=F+Math.imul(de,Ze)|0,B=B+Math.imul(ae,ot)|0,D=D+Math.imul(ae,Et)|0,D=D+Math.imul(ve,ot)|0,F=F+Math.imul(ve,Et)|0,B=B+Math.imul(I,At)|0,D=D+Math.imul(I,yt)|0,D=D+Math.imul(z,At)|0,F=F+Math.imul(z,yt)|0,B=B+Math.imul(P,er)|0,D=D+Math.imul(P,tr)|0,D=D+Math.imul(Y,er)|0,F=F+Math.imul(Y,tr)|0;var Bn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Bn>>>26)|0,Bn&=67108863,B=Math.imul(xe,dt),D=Math.imul(xe,vt),D=D+Math.imul(ke,dt)|0,F=Math.imul(ke,vt),B=B+Math.imul(re,ct)|0,D=D+Math.imul(re,ut)|0,D=D+Math.imul(ye,ct)|0,F=F+Math.imul(ye,ut)|0,B=B+Math.imul(fe,lt)|0,D=D+Math.imul(fe,nt)|0,D=D+Math.imul(ce,lt)|0,F=F+Math.imul(ce,nt)|0,B=B+Math.imul(Re,it)|0,D=D+Math.imul(Re,Ye)|0,D=D+Math.imul(je,it)|0,F=F+Math.imul(je,Ye)|0,B=B+Math.imul(ge,st)|0,D=D+Math.imul(ge,Qe)|0,D=D+Math.imul(Me,st)|0,F=F+Math.imul(Me,Qe)|0,B=B+Math.imul(pe,at)|0,D=D+Math.imul(pe,Ze)|0,D=D+Math.imul(_e,at)|0,F=F+Math.imul(_e,Ze)|0,B=B+Math.imul(we,ot)|0,D=D+Math.imul(we,Et)|0,D=D+Math.imul(de,ot)|0,F=F+Math.imul(de,Et)|0,B=B+Math.imul(ae,At)|0,D=D+Math.imul(ae,yt)|0,D=D+Math.imul(ve,At)|0,F=F+Math.imul(ve,yt)|0,B=B+Math.imul(I,er)|0,D=D+Math.imul(I,tr)|0,D=D+Math.imul(z,er)|0,F=F+Math.imul(z,tr)|0;var dn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(dn>>>26)|0,dn&=67108863,B=Math.imul(xe,ct),D=Math.imul(xe,ut),D=D+Math.imul(ke,ct)|0,F=Math.imul(ke,ut),B=B+Math.imul(re,lt)|0,D=D+Math.imul(re,nt)|0,D=D+Math.imul(ye,lt)|0,F=F+Math.imul(ye,nt)|0,B=B+Math.imul(fe,it)|0,D=D+Math.imul(fe,Ye)|0,D=D+Math.imul(ce,it)|0,F=F+Math.imul(ce,Ye)|0,B=B+Math.imul(Re,st)|0,D=D+Math.imul(Re,Qe)|0,D=D+Math.imul(je,st)|0,F=F+Math.imul(je,Qe)|0,B=B+Math.imul(ge,at)|0,D=D+Math.imul(ge,Ze)|0,D=D+Math.imul(Me,at)|0,F=F+Math.imul(Me,Ze)|0,B=B+Math.imul(pe,ot)|0,D=D+Math.imul(pe,Et)|0,D=D+Math.imul(_e,ot)|0,F=F+Math.imul(_e,Et)|0,B=B+Math.imul(we,At)|0,D=D+Math.imul(we,yt)|0,D=D+Math.imul(de,At)|0,F=F+Math.imul(de,yt)|0,B=B+Math.imul(ae,er)|0,D=D+Math.imul(ae,tr)|0,D=D+Math.imul(ve,er)|0,F=F+Math.imul(ve,tr)|0;var Xn=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Xn>>>26)|0,Xn&=67108863,B=Math.imul(xe,lt),D=Math.imul(xe,nt),D=D+Math.imul(ke,lt)|0,F=Math.imul(ke,nt),B=B+Math.imul(re,it)|0,D=D+Math.imul(re,Ye)|0,D=D+Math.imul(ye,it)|0,F=F+Math.imul(ye,Ye)|0,B=B+Math.imul(fe,st)|0,D=D+Math.imul(fe,Qe)|0,D=D+Math.imul(ce,st)|0,F=F+Math.imul(ce,Qe)|0,B=B+Math.imul(Re,at)|0,D=D+Math.imul(Re,Ze)|0,D=D+Math.imul(je,at)|0,F=F+Math.imul(je,Ze)|0,B=B+Math.imul(ge,ot)|0,D=D+Math.imul(ge,Et)|0,D=D+Math.imul(Me,ot)|0,F=F+Math.imul(Me,Et)|0,B=B+Math.imul(pe,At)|0,D=D+Math.imul(pe,yt)|0,D=D+Math.imul(_e,At)|0,F=F+Math.imul(_e,yt)|0,B=B+Math.imul(we,er)|0,D=D+Math.imul(we,tr)|0,D=D+Math.imul(de,er)|0,F=F+Math.imul(de,tr)|0;var Ln=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,B=Math.imul(xe,it),D=Math.imul(xe,Ye),D=D+Math.imul(ke,it)|0,F=Math.imul(ke,Ye),B=B+Math.imul(re,st)|0,D=D+Math.imul(re,Qe)|0,D=D+Math.imul(ye,st)|0,F=F+Math.imul(ye,Qe)|0,B=B+Math.imul(fe,at)|0,D=D+Math.imul(fe,Ze)|0,D=D+Math.imul(ce,at)|0,F=F+Math.imul(ce,Ze)|0,B=B+Math.imul(Re,ot)|0,D=D+Math.imul(Re,Et)|0,D=D+Math.imul(je,ot)|0,F=F+Math.imul(je,Et)|0,B=B+Math.imul(ge,At)|0,D=D+Math.imul(ge,yt)|0,D=D+Math.imul(Me,At)|0,F=F+Math.imul(Me,yt)|0,B=B+Math.imul(pe,er)|0,D=D+Math.imul(pe,tr)|0,D=D+Math.imul(_e,er)|0,F=F+Math.imul(_e,tr)|0;var xi=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(xi>>>26)|0,xi&=67108863,B=Math.imul(xe,st),D=Math.imul(xe,Qe),D=D+Math.imul(ke,st)|0,F=Math.imul(ke,Qe),B=B+Math.imul(re,at)|0,D=D+Math.imul(re,Ze)|0,D=D+Math.imul(ye,at)|0,F=F+Math.imul(ye,Ze)|0,B=B+Math.imul(fe,ot)|0,D=D+Math.imul(fe,Et)|0,D=D+Math.imul(ce,ot)|0,F=F+Math.imul(ce,Et)|0,B=B+Math.imul(Re,At)|0,D=D+Math.imul(Re,yt)|0,D=D+Math.imul(je,At)|0,F=F+Math.imul(je,yt)|0,B=B+Math.imul(ge,er)|0,D=D+Math.imul(ge,tr)|0,D=D+Math.imul(Me,er)|0,F=F+Math.imul(Me,tr)|0;var Ti=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Ti>>>26)|0,Ti&=67108863,B=Math.imul(xe,at),D=Math.imul(xe,Ze),D=D+Math.imul(ke,at)|0,F=Math.imul(ke,Ze),B=B+Math.imul(re,ot)|0,D=D+Math.imul(re,Et)|0,D=D+Math.imul(ye,ot)|0,F=F+Math.imul(ye,Et)|0,B=B+Math.imul(fe,At)|0,D=D+Math.imul(fe,yt)|0,D=D+Math.imul(ce,At)|0,F=F+Math.imul(ce,yt)|0,B=B+Math.imul(Re,er)|0,D=D+Math.imul(Re,tr)|0,D=D+Math.imul(je,er)|0,F=F+Math.imul(je,tr)|0;var Mi=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,B=Math.imul(xe,ot),D=Math.imul(xe,Et),D=D+Math.imul(ke,ot)|0,F=Math.imul(ke,Et),B=B+Math.imul(re,At)|0,D=D+Math.imul(re,yt)|0,D=D+Math.imul(ye,At)|0,F=F+Math.imul(ye,yt)|0,B=B+Math.imul(fe,er)|0,D=D+Math.imul(fe,tr)|0,D=D+Math.imul(ce,er)|0,F=F+Math.imul(ce,tr)|0;var Gs=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Gs>>>26)|0,Gs&=67108863,B=Math.imul(xe,At),D=Math.imul(xe,yt),D=D+Math.imul(ke,At)|0,F=Math.imul(ke,yt),B=B+Math.imul(re,er)|0,D=D+Math.imul(re,tr)|0,D=D+Math.imul(ye,er)|0,F=F+Math.imul(ye,tr)|0;var Ws=(N+B|0)+((D&8191)<<13)|0;N=(F+(D>>>13)|0)+(Ws>>>26)|0,Ws&=67108863,B=Math.imul(xe,er),D=Math.imul(xe,tr),D=D+Math.imul(ke,er)|0,F=Math.imul(ke,tr);var Zs=(N+B|0)+((D&8191)<<13)|0;return N=(F+(D>>>13)|0)+(Zs>>>26)|0,Zs&=67108863,w[0]=tn,w[1]=rn,w[2]=Or,w[3]=Hr,w[4]=nn,w[5]=xn,w[6]=Ei,w[7]=Ai,w[8]=Si,w[9]=Bn,w[10]=dn,w[11]=Xn,w[12]=Ln,w[13]=xi,w[14]=Ti,w[15]=Mi,w[16]=Gs,w[17]=Ws,w[18]=Zs,N!==0&&(w[19]=N,_.length++),_},"comb10MulTo2"),"comb10MulTo");Math.imul||($=K);function j(m,d,g){g.negative=d.negative^m.negative,g.length=m.length+d.length;for(var _=0,M=0,S=0;S<g.length-1;S++){var w=M;M=0;for(var N=_&67108863,B=Math.min(S,d.length-1),D=Math.max(0,S-m.length+1);D<=B;D++){var F=S-D,le=m.words[F]|0,P=d.words[D]|0,Y=le*P,J=Y&67108863;w=w+(Y/67108864|0)|0,J=J+N|0,N=J&67108863,w=w+(J>>>26)|0,M+=w>>>26,w&=67108863}g.words[S]=N,_=w,w=M}return _!==0?g.words[S]=_:g.length--,g._strip()}i(j,"bigMulTo"),a(j,"bigMulTo");function V(m,d,g){return j(m,d,g)}i(V,"jumboMulTo"),a(V,"jumboMulTo"),c.prototype.mulTo=a(i(function(d,g){var _,M=this.length+d.length;return this.length===10&&d.length===10?_=$(this,d,g):M<63?_=K(this,d,g):M<1024?_=j(this,d,g):_=V(this,d,g),_},"mulTo"),"mulTo");function G(m,d){this.x=m,this.y=d}i(G,"FFTM"),a(G,"FFTM"),G.prototype.makeRBT=a(i(function(d){for(var g=new Array(d),_=c.prototype._countBits(d)-1,M=0;M<d;M++)g[M]=this.revBin(M,_,d);return g},"makeRBT"),"makeRBT"),G.prototype.revBin=a(i(function(d,g,_){if(d===0||d===_-1)return d;for(var M=0,S=0;S<g;S++)M|=(d&1)<<g-S-1,d>>=1;return M},"revBin"),"revBin"),G.prototype.permute=a(i(function(d,g,_,M,S,w){for(var N=0;N<w;N++)M[N]=g[d[N]],S[N]=_[d[N]]},"permute"),"permute"),G.prototype.transform=a(i(function(d,g,_,M,S,w){this.permute(w,d,g,_,M,S);for(var N=1;N<S;N<<=1)for(var B=N<<1,D=Math.cos(2*Math.PI/B),F=Math.sin(2*Math.PI/B),le=0;le<S;le+=B)for(var P=D,Y=F,J=0;J<N;J++){var I=_[le+J],z=M[le+J],te=_[le+J+N],ae=M[le+J+N],ve=P*te-Y*ae;ae=P*ae+Y*te,te=ve,_[le+J]=I+te,M[le+J]=z+ae,_[le+J+N]=I-te,M[le+J+N]=z-ae,J!==B&&(ve=D*P-F*Y,Y=D*Y+F*P,P=ve)}},"transform"),"transform"),G.prototype.guessLen13b=a(i(function(d,g){var _=Math.max(g,d)|1,M=_&1,S=0;for(_=_/2|0;_;_=_>>>1)S++;return 1<<S+1+M},"guessLen13b"),"guessLen13b"),G.prototype.conjugate=a(i(function(d,g,_){if(!(_<=1))for(var M=0;M<_/2;M++){var S=d[M];d[M]=d[_-M-1],d[_-M-1]=S,S=g[M],g[M]=-g[_-M-1],g[_-M-1]=-S}},"conjugate"),"conjugate"),G.prototype.normalize13b=a(i(function(d,g){for(var _=0,M=0;M<g/2;M++){var S=Math.round(d[2*M+1]/g)*8192+Math.round(d[2*M]/g)+_;d[M]=S&67108863,S<67108864?_=0:_=S/67108864|0}return d},"normalize13b"),"normalize13b"),G.prototype.convert13b=a(i(function(d,g,_,M){for(var S=0,w=0;w<g;w++)S=S+(d[w]|0),_[2*w]=S&8191,S=S>>>13,_[2*w+1]=S&8191,S=S>>>13;for(w=2*g;w<M;++w)_[w]=0;s(S===0),s((S&-8192)===0)},"convert13b"),"convert13b"),G.prototype.stub=a(i(function(d){for(var g=new Array(d),_=0;_<d;_++)g[_]=0;return g},"stub"),"stub"),G.prototype.mulp=a(i(function(d,g,_){var M=2*this.guessLen13b(d.length,g.length),S=this.makeRBT(M),w=this.stub(M),N=new Array(M),B=new Array(M),D=new Array(M),F=new Array(M),le=new Array(M),P=new Array(M),Y=_.words;Y.length=M,this.convert13b(d.words,d.length,N,M),this.convert13b(g.words,g.length,F,M),this.transform(N,w,B,D,M,S),this.transform(F,w,le,P,M,S);for(var J=0;J<M;J++){var I=B[J]*le[J]-D[J]*P[J];D[J]=B[J]*P[J]+D[J]*le[J],B[J]=I}return this.conjugate(B,D,M),this.transform(B,D,Y,w,M,S),this.conjugate(Y,w,M),this.normalize13b(Y,M),_.negative=d.negative^g.negative,_.length=d.length+g.length,_._strip()},"mulp"),"mulp"),c.prototype.mul=a(i(function(d){var g=new c(null);return g.words=new Array(this.length+d.length),this.mulTo(d,g)},"mul3"),"mul"),c.prototype.mulf=a(i(function(d){var g=new c(null);return g.words=new Array(this.length+d.length),V(this,d,g)},"mulf"),"mulf"),c.prototype.imul=a(i(function(d){return this.clone().mulTo(d,this)},"imul"),"imul"),c.prototype.imuln=a(i(function(d){var g=d<0;g&&(d=-d),s(typeof d=="number"),s(d<67108864);for(var _=0,M=0;M<this.length;M++){var S=(this.words[M]|0)*d,w=(S&67108863)+(_&67108863);_>>=26,_+=S/67108864|0,_+=w>>>26,this.words[M]=w&67108863}return _!==0&&(this.words[M]=_,this.length++),g?this.ineg():this},"imuln"),"imuln"),c.prototype.muln=a(i(function(d){return this.clone().imuln(d)},"muln"),"muln"),c.prototype.sqr=a(i(function(){return this.mul(this)},"sqr"),"sqr"),c.prototype.isqr=a(i(function(){return this.imul(this.clone())},"isqr"),"isqr"),c.prototype.pow=a(i(function(d){var g=L(d);if(g.length===0)return new c(1);for(var _=this,M=0;M<g.length&&g[M]===0;M++,_=_.sqr());if(++M<g.length)for(var S=_.sqr();M<g.length;M++,S=S.sqr())g[M]!==0&&(_=_.mul(S));return _},"pow"),"pow"),c.prototype.iushln=a(i(function(d){s(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,M=67108863>>>26-g<<26-g,S;if(g!==0){var w=0;for(S=0;S<this.length;S++){var N=this.words[S]&M,B=(this.words[S]|0)-N<<g;this.words[S]=B|w,w=N>>>26-g}w&&(this.words[S]=w,this.length++)}if(_!==0){for(S=this.length-1;S>=0;S--)this.words[S+_]=this.words[S];for(S=0;S<_;S++)this.words[S]=0;this.length+=_}return this._strip()},"iushln"),"iushln"),c.prototype.ishln=a(i(function(d){return s(this.negative===0),this.iushln(d)},"ishln"),"ishln"),c.prototype.iushrn=a(i(function(d,g,_){s(typeof d=="number"&&d>=0);var M;g?M=(g-g%26)/26:M=0;var S=d%26,w=Math.min((d-S)/26,this.length),N=67108863^67108863>>>S<<S,B=_;if(M-=w,M=Math.max(0,M),B){for(var D=0;D<w;D++)B.words[D]=this.words[D];B.length=w}if(w!==0)if(this.length>w)for(this.length-=w,D=0;D<this.length;D++)this.words[D]=this.words[D+w];else this.words[0]=0,this.length=1;var F=0;for(D=this.length-1;D>=0&&(F!==0||D>=M);D--){var le=this.words[D]|0;this.words[D]=F<<26-S|le>>>S,F=le&N}return B&&F!==0&&(B.words[B.length++]=F),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),"iushrn"),c.prototype.ishrn=a(i(function(d,g,_){return s(this.negative===0),this.iushrn(d,g,_)},"ishrn"),"ishrn"),c.prototype.shln=a(i(function(d){return this.clone().ishln(d)},"shln"),"shln"),c.prototype.ushln=a(i(function(d){return this.clone().iushln(d)},"ushln"),"ushln"),c.prototype.shrn=a(i(function(d){return this.clone().ishrn(d)},"shrn"),"shrn"),c.prototype.ushrn=a(i(function(d){return this.clone().iushrn(d)},"ushrn"),"ushrn"),c.prototype.testn=a(i(function(d){s(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26,M=1<<g;if(this.length<=_)return!1;var S=this.words[_];return!!(S&M)},"testn"),"testn"),c.prototype.imaskn=a(i(function(d){s(typeof d=="number"&&d>=0);var g=d%26,_=(d-g)/26;if(s(this.negative===0,"imaskn works only with positive numbers"),this.length<=_)return this;if(g!==0&&_++,this.length=Math.min(_,this.length),g!==0){var M=67108863^67108863>>>g<<g;this.words[this.length-1]&=M}return this._strip()},"imaskn"),"imaskn"),c.prototype.maskn=a(i(function(d){return this.clone().imaskn(d)},"maskn"),"maskn"),c.prototype.iaddn=a(i(function(d){return s(typeof d=="number"),s(d<67108864),d<0?this.isubn(-d):this.negative!==0?this.length===1&&(this.words[0]|0)<=d?(this.words[0]=d-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(d),this.negative=1,this):this._iaddn(d)},"iaddn"),"iaddn"),c.prototype._iaddn=a(i(function(d){this.words[0]+=d;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},"_iaddn"),"_iaddn"),c.prototype.isubn=a(i(function(d){if(s(typeof d=="number"),s(d<67108864),d<0)return this.iaddn(-d);if(this.negative!==0)return this.negative=0,this.iaddn(d),this.negative=1,this;if(this.words[0]-=d,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this._strip()},"isubn"),"isubn"),c.prototype.addn=a(i(function(d){return this.clone().iaddn(d)},"addn"),"addn"),c.prototype.subn=a(i(function(d){return this.clone().isubn(d)},"subn"),"subn"),c.prototype.iabs=a(i(function(){return this.negative=0,this},"iabs"),"iabs"),c.prototype.abs=a(i(function(){return this.clone().iabs()},"abs2"),"abs"),c.prototype._ishlnsubmul=a(i(function(d,g,_){var M=d.length+_,S;this._expand(M);var w,N=0;for(S=0;S<d.length;S++){w=(this.words[S+_]|0)+N;var B=(d.words[S]|0)*g;w-=B&67108863,N=(w>>26)-(B/67108864|0),this.words[S+_]=w&67108863}for(;S<this.length-_;S++)w=(this.words[S+_]|0)+N,N=w>>26,this.words[S+_]=w&67108863;if(N===0)return this._strip();for(s(N===-1),N=0,S=0;S<this.length;S++)w=-(this.words[S]|0)+N,N=w>>26,this.words[S]=w&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),"_ishlnsubmul"),c.prototype._wordDiv=a(i(function(d,g){var _=this.length-d.length,M=this.clone(),S=d,w=S.words[S.length-1]|0,N=this._countBits(w);_=26-N,_!==0&&(S=S.ushln(_),M.iushln(_),w=S.words[S.length-1]|0);var B=M.length-S.length,D;if(g!=="mod"){D=new c(null),D.length=B+1,D.words=new Array(D.length);for(var F=0;F<D.length;F++)D.words[F]=0}var le=M.clone()._ishlnsubmul(S,1,B);le.negative===0&&(M=le,D&&(D.words[B]=1));for(var P=B-1;P>=0;P--){var Y=(M.words[S.length+P]|0)*67108864+(M.words[S.length+P-1]|0);for(Y=Math.min(Y/w|0,67108863),M._ishlnsubmul(S,Y,P);M.negative!==0;)Y--,M.negative=0,M._ishlnsubmul(S,1,P),M.isZero()||(M.negative^=1);D&&(D.words[P]=Y)}return D&&D._strip(),M._strip(),g!=="div"&&_!==0&&M.iushrn(_),{div:D||null,mod:M}},"_wordDiv"),"_wordDiv"),c.prototype.divmod=a(i(function(d,g,_){if(s(!d.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var M,S,w;return this.negative!==0&&d.negative===0?(w=this.neg().divmod(d,g),g!=="mod"&&(M=w.div.neg()),g!=="div"&&(S=w.mod.neg(),_&&S.negative!==0&&S.iadd(d)),{div:M,mod:S}):this.negative===0&&d.negative!==0?(w=this.divmod(d.neg(),g),g!=="mod"&&(M=w.div.neg()),{div:M,mod:w.mod}):(this.negative&d.negative)!==0?(w=this.neg().divmod(d.neg(),g),g!=="div"&&(S=w.mod.neg(),_&&S.negative!==0&&S.isub(d)),{div:w.div,mod:S}):d.length>this.length||this.cmp(d)<0?{div:new c(0),mod:this}:d.length===1?g==="div"?{div:this.divn(d.words[0]),mod:null}:g==="mod"?{div:null,mod:new c(this.modrn(d.words[0]))}:{div:this.divn(d.words[0]),mod:new c(this.modrn(d.words[0]))}:this._wordDiv(d,g)},"divmod"),"divmod"),c.prototype.div=a(i(function(d){return this.divmod(d,"div",!1).div},"div"),"div"),c.prototype.mod=a(i(function(d){return this.divmod(d,"mod",!1).mod},"mod2"),"mod"),c.prototype.umod=a(i(function(d){return this.divmod(d,"mod",!0).mod},"umod"),"umod"),c.prototype.divRound=a(i(function(d){var g=this.divmod(d);if(g.mod.isZero())return g.div;var _=g.div.negative!==0?g.mod.isub(d):g.mod,M=d.ushrn(1),S=d.andln(1),w=_.cmp(M);return w<0||S===1&&w===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},"divRound"),"divRound"),c.prototype.modrn=a(i(function(d){var g=d<0;g&&(d=-d),s(d<=67108863);for(var _=(1<<26)%d,M=0,S=this.length-1;S>=0;S--)M=(_*M+(this.words[S]|0))%d;return g?-M:M},"modrn"),"modrn"),c.prototype.modn=a(i(function(d){return this.modrn(d)},"modn"),"modn"),c.prototype.idivn=a(i(function(d){var g=d<0;g&&(d=-d),s(d<=67108863);for(var _=0,M=this.length-1;M>=0;M--){var S=(this.words[M]|0)+_*67108864;this.words[M]=S/d|0,_=S%d}return this._strip(),g?this.ineg():this},"idivn"),"idivn"),c.prototype.divn=a(i(function(d){return this.clone().idivn(d)},"divn"),"divn"),c.prototype.egcd=a(i(function(d){s(d.negative===0),s(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var M=new c(1),S=new c(0),w=new c(0),N=new c(1),B=0;g.isEven()&&_.isEven();)g.iushrn(1),_.iushrn(1),++B;for(var D=_.clone(),F=g.clone();!g.isZero();){for(var le=0,P=1;(g.words[0]&P)===0&&le<26;++le,P<<=1);if(le>0)for(g.iushrn(le);le-- >0;)(M.isOdd()||S.isOdd())&&(M.iadd(D),S.isub(F)),M.iushrn(1),S.iushrn(1);for(var Y=0,J=1;(_.words[0]&J)===0&&Y<26;++Y,J<<=1);if(Y>0)for(_.iushrn(Y);Y-- >0;)(w.isOdd()||N.isOdd())&&(w.iadd(D),N.isub(F)),w.iushrn(1),N.iushrn(1);g.cmp(_)>=0?(g.isub(_),M.isub(w),S.isub(N)):(_.isub(g),w.isub(M),N.isub(S))}return{a:w,b:N,gcd:_.iushln(B)}},"egcd"),"egcd"),c.prototype._invmp=a(i(function(d){s(d.negative===0),s(!d.isZero());var g=this,_=d.clone();g.negative!==0?g=g.umod(d):g=g.clone();for(var M=new c(1),S=new c(0),w=_.clone();g.cmpn(1)>0&&_.cmpn(1)>0;){for(var N=0,B=1;(g.words[0]&B)===0&&N<26;++N,B<<=1);if(N>0)for(g.iushrn(N);N-- >0;)M.isOdd()&&M.iadd(w),M.iushrn(1);for(var D=0,F=1;(_.words[0]&F)===0&&D<26;++D,F<<=1);if(D>0)for(_.iushrn(D);D-- >0;)S.isOdd()&&S.iadd(w),S.iushrn(1);g.cmp(_)>=0?(g.isub(_),M.isub(S)):(_.isub(g),S.isub(M))}var le;return g.cmpn(1)===0?le=M:le=S,le.cmpn(0)<0&&le.iadd(d),le},"_invmp"),"_invmp"),c.prototype.gcd=a(i(function(d){if(this.isZero())return d.abs();if(d.isZero())return this.abs();var g=this.clone(),_=d.clone();g.negative=0,_.negative=0;for(var M=0;g.isEven()&&_.isEven();M++)g.iushrn(1),_.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;_.isEven();)_.iushrn(1);var S=g.cmp(_);if(S<0){var w=g;g=_,_=w}else if(S===0||_.cmpn(1)===0)break;g.isub(_)}while(!0);return _.iushln(M)},"gcd"),"gcd"),c.prototype.invm=a(i(function(d){return this.egcd(d).a.umod(d)},"invm"),"invm"),c.prototype.isEven=a(i(function(){return(this.words[0]&1)===0},"isEven"),"isEven"),c.prototype.isOdd=a(i(function(){return(this.words[0]&1)===1},"isOdd"),"isOdd"),c.prototype.andln=a(i(function(d){return this.words[0]&d},"andln"),"andln"),c.prototype.bincn=a(i(function(d){s(typeof d=="number");var g=d%26,_=(d-g)/26,M=1<<g;if(this.length<=_)return this._expand(_+1),this.words[_]|=M,this;for(var S=M,w=_;S!==0&&w<this.length;w++){var N=this.words[w]|0;N+=S,S=N>>>26,N&=67108863,this.words[w]=N}return S!==0&&(this.words[w]=S,this.length++),this},"bincn"),"bincn"),c.prototype.isZero=a(i(function(){return this.length===1&&this.words[0]===0},"isZero"),"isZero"),c.prototype.cmpn=a(i(function(d){var g=d<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this._strip();var _;if(this.length>1)_=1;else{g&&(d=-d),s(d<=67108863,"Number is too big");var M=this.words[0]|0;_=M===d?0:M<d?-1:1}return this.negative!==0?-_|0:_},"cmpn"),"cmpn"),c.prototype.cmp=a(i(function(d){if(this.negative!==0&&d.negative===0)return-1;if(this.negative===0&&d.negative!==0)return 1;var g=this.ucmp(d);return this.negative!==0?-g|0:g},"cmp"),"cmp"),c.prototype.ucmp=a(i(function(d){if(this.length>d.length)return 1;if(this.length<d.length)return-1;for(var g=0,_=this.length-1;_>=0;_--){var M=this.words[_]|0,S=d.words[_]|0;if(M!==S){M<S?g=-1:M>S&&(g=1);break}}return g},"ucmp"),"ucmp"),c.prototype.gtn=a(i(function(d){return this.cmpn(d)===1},"gtn"),"gtn"),c.prototype.gt=a(i(function(d){return this.cmp(d)===1},"gt"),"gt"),c.prototype.gten=a(i(function(d){return this.cmpn(d)>=0},"gten"),"gten"),c.prototype.gte=a(i(function(d){return this.cmp(d)>=0},"gte"),"gte"),c.prototype.ltn=a(i(function(d){return this.cmpn(d)===-1},"ltn"),"ltn"),c.prototype.lt=a(i(function(d){return this.cmp(d)===-1},"lt"),"lt"),c.prototype.lten=a(i(function(d){return this.cmpn(d)<=0},"lten"),"lten"),c.prototype.lte=a(i(function(d){return this.cmp(d)<=0},"lte"),"lte"),c.prototype.eqn=a(i(function(d){return this.cmpn(d)===0},"eqn"),"eqn"),c.prototype.eq=a(i(function(d){return this.cmp(d)===0},"eq4"),"eq"),c.red=a(i(function(d){return new E(d)},"red"),"red"),c.prototype.toRed=a(i(function(d){return s(!this.red,"Already a number in reduction context"),s(this.negative===0,"red works only with positives"),d.convertTo(this)._forceRed(d)},"toRed"),"toRed"),c.prototype.fromRed=a(i(function(){return s(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),"fromRed"),c.prototype._forceRed=a(i(function(d){return this.red=d,this},"_forceRed"),"_forceRed"),c.prototype.forceRed=a(i(function(d){return s(!this.red,"Already a number in reduction context"),this._forceRed(d)},"forceRed"),"forceRed"),c.prototype.redAdd=a(i(function(d){return s(this.red,"redAdd works only with red numbers"),this.red.add(this,d)},"redAdd"),"redAdd"),c.prototype.redIAdd=a(i(function(d){return s(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,d)},"redIAdd"),"redIAdd"),c.prototype.redSub=a(i(function(d){return s(this.red,"redSub works only with red numbers"),this.red.sub(this,d)},"redSub"),"redSub"),c.prototype.redISub=a(i(function(d){return s(this.red,"redISub works only with red numbers"),this.red.isub(this,d)},"redISub"),"redISub"),c.prototype.redShl=a(i(function(d){return s(this.red,"redShl works only with red numbers"),this.red.shl(this,d)},"redShl"),"redShl"),c.prototype.redMul=a(i(function(d){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.mul(this,d)},"redMul"),"redMul"),c.prototype.redIMul=a(i(function(d){return s(this.red,"redMul works only with red numbers"),this.red._verify2(this,d),this.red.imul(this,d)},"redIMul"),"redIMul"),c.prototype.redSqr=a(i(function(){return s(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),"redSqr"),c.prototype.redISqr=a(i(function(){return s(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),"redISqr"),c.prototype.redSqrt=a(i(function(){return s(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),"redSqrt"),c.prototype.redInvm=a(i(function(){return s(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),"redInvm"),c.prototype.redNeg=a(i(function(){return s(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),"redNeg"),c.prototype.redPow=a(i(function(d){return s(this.red&&!d.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,d)},"redPow"),"redPow");var k={k256:null,p224:null,p192:null,p25519:null};function H(m,d){this.name=m,this.p=new c(d,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}i(H,"MPrime"),a(H,"MPrime"),H.prototype._tmp=a(i(function(){var d=new c(null);return d.words=new Array(Math.ceil(this.n/13)),d},"_tmp"),"_tmp"),H.prototype.ireduce=a(i(function(d){var g=d,_;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),_=g.bitLength();while(_>this.n);var M=_<this.n?-1:g.ucmp(this.p);return M===0?(g.words[0]=0,g.length=1):M>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},"ireduce"),"ireduce"),H.prototype.split=a(i(function(d,g){d.iushrn(this.n,0,g)},"split"),"split"),H.prototype.imulK=a(i(function(d){return d.imul(this.k)},"imulK"),"imulK");function se(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(se,"K256"),a(se,"K256"),o(se,H),se.prototype.split=a(i(function(d,g){for(var _=4194303,M=Math.min(d.length,9),S=0;S<M;S++)g.words[S]=d.words[S];if(g.length=M,d.length<=9){d.words[0]=0,d.length=1;return}var w=d.words[9];for(g.words[g.length++]=w&_,S=10;S<d.length;S++){var N=d.words[S]|0;d.words[S-10]=(N&_)<<4|w>>>22,w=N}w>>>=22,d.words[S-10]=w,w===0&&d.length>10?d.length-=10:d.length-=9},"split"),"split"),se.prototype.imulK=a(i(function(d){d.words[d.length]=0,d.words[d.length+1]=0,d.length+=2;for(var g=0,_=0;_<d.length;_++){var M=d.words[_]|0;g+=M*977,d.words[_]=g&67108863,g=M*64+(g/67108864|0)}return d.words[d.length-1]===0&&(d.length--,d.words[d.length-1]===0&&d.length--),d},"imulK"),"imulK");function ue(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(ue,"P224"),a(ue,"P224"),o(ue,H);function me(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(me,"P192"),a(me,"P192"),o(me,H);function q(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(q,"P25519"),a(q,"P25519"),o(q,H),q.prototype.imulK=a(i(function(d){for(var g=0,_=0;_<d.length;_++){var M=(d.words[_]|0)*19+g,S=M&67108863;M>>>=26,d.words[_]=S,g=M}return g!==0&&(d.words[d.length++]=g),d},"imulK"),"imulK"),c._prime=a(i(function(d){if(k[d])return k[d];var g;if(d==="k256")g=new se;else if(d==="p224")g=new ue;else if(d==="p192")g=new me;else if(d==="p25519")g=new q;else throw new Error("Unknown prime "+d);return k[d]=g,g},"prime"),"prime");function E(m){if(typeof m=="string"){var d=c._prime(m);this.m=d.p,this.prime=d}else s(m.gtn(1),"modulus must be greater than 1"),this.m=m,this.prime=null}i(E,"Red"),a(E,"Red"),E.prototype._verify1=a(i(function(d){s(d.negative===0,"red works only with positives"),s(d.red,"red works only with red numbers")},"_verify1"),"_verify1"),E.prototype._verify2=a(i(function(d,g){s((d.negative|g.negative)===0,"red works only with positives"),s(d.red&&d.red===g.red,"red works only with red numbers")},"_verify2"),"_verify2"),E.prototype.imod=a(i(function(d){return this.prime?this.prime.ireduce(d)._forceRed(this):(b(d,d.umod(this.m)._forceRed(this)),d)},"imod"),"imod"),E.prototype.neg=a(i(function(d){return d.isZero()?d.clone():this.m.sub(d)._forceRed(this)},"neg3"),"neg"),E.prototype.add=a(i(function(d,g){this._verify2(d,g);var _=d.add(g);return _.cmp(this.m)>=0&&_.isub(this.m),_._forceRed(this)},"add3"),"add"),E.prototype.iadd=a(i(function(d,g){this._verify2(d,g);var _=d.iadd(g);return _.cmp(this.m)>=0&&_.isub(this.m),_},"iadd"),"iadd"),E.prototype.sub=a(i(function(d,g){this._verify2(d,g);var _=d.sub(g);return _.cmpn(0)<0&&_.iadd(this.m),_._forceRed(this)},"sub"),"sub"),E.prototype.isub=a(i(function(d,g){this._verify2(d,g);var _=d.isub(g);return _.cmpn(0)<0&&_.iadd(this.m),_},"isub"),"isub"),E.prototype.shl=a(i(function(d,g){return this._verify1(d),this.imod(d.ushln(g))},"shl"),"shl"),E.prototype.imul=a(i(function(d,g){return this._verify2(d,g),this.imod(d.imul(g))},"imul"),"imul"),E.prototype.mul=a(i(function(d,g){return this._verify2(d,g),this.imod(d.mul(g))},"mul3"),"mul"),E.prototype.isqr=a(i(function(d){return this.imul(d,d.clone())},"isqr"),"isqr"),E.prototype.sqr=a(i(function(d){return this.mul(d,d)},"sqr"),"sqr"),E.prototype.sqrt=a(i(function(d){if(d.isZero())return d.clone();var g=this.m.andln(3);if(s(g%2===1),g===3){var _=this.m.add(new c(1)).iushrn(2);return this.pow(d,_)}for(var M=this.m.subn(1),S=0;!M.isZero()&&M.andln(1)===0;)S++,M.iushrn(1);s(!M.isZero());var w=new c(1).toRed(this),N=w.redNeg(),B=this.m.subn(1).iushrn(1),D=this.m.bitLength();for(D=new c(2*D*D).toRed(this);this.pow(D,B).cmp(N)!==0;)D.redIAdd(N);for(var F=this.pow(D,M),le=this.pow(d,M.addn(1).iushrn(1)),P=this.pow(d,M),Y=S;P.cmp(w)!==0;){for(var J=P,I=0;J.cmp(w)!==0;I++)J=J.redSqr();s(I<Y);var z=this.pow(F,new c(1).iushln(Y-I-1));le=le.redMul(z),F=z.redSqr(),P=P.redMul(F),Y=I}return le},"sqrt"),"sqrt"),E.prototype.invm=a(i(function(d){var g=d._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},"invm"),"invm"),E.prototype.pow=a(i(function(d,g){if(g.isZero())return new c(1).toRed(this);if(g.cmpn(1)===0)return d.clone();var _=4,M=new Array(1<<_);M[0]=new c(1).toRed(this),M[1]=d;for(var S=2;S<M.length;S++)M[S]=this.mul(M[S-1],d);var w=M[0],N=0,B=0,D=g.bitLength()%26;for(D===0&&(D=26),S=g.length-1;S>=0;S--){for(var F=g.words[S],le=D-1;le>=0;le--){var P=F>>le&1;if(w!==M[0]&&(w=this.sqr(w)),P===0&&N===0){B=0;continue}N<<=1,N|=P,B++,!(B!==_&&(S!==0||le!==0))&&(w=this.mul(w,M[N]),B=0,N=0)}D=26}return w},"pow"),"pow"),E.prototype.convertTo=a(i(function(d){var g=d.umod(this.m);return g===d?g.clone():g},"convertTo"),"convertTo"),E.prototype.convertFrom=a(i(function(d){var g=d.clone();return g.red=null,g},"convertFrom"),"convertFrom"),c.mont=a(i(function(d){return new T(d)},"mont"),"mont");function T(m){E.call(this,m),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new c(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)}i(T,"Mont"),a(T,"Mont"),o(T,E),T.prototype.convertTo=a(i(function(d){return this.imod(d.ushln(this.shift))},"convertTo"),"convertTo"),T.prototype.convertFrom=a(i(function(d){var g=this.imod(d.mul(this.rinv));return g.red=null,g},"convertFrom"),"convertFrom"),T.prototype.imul=a(i(function(d,g){if(d.isZero()||g.isZero())return d.words[0]=0,d.length=1,d;var _=d.imul(g),M=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=_.isub(M).iushrn(this.shift),w=S;return S.cmp(this.m)>=0?w=S.isub(this.m):S.cmpn(0)<0&&(w=S.iadd(this.m)),w._forceRed(this)},"imul"),"imul"),T.prototype.mul=a(i(function(d,g){if(d.isZero()||g.isZero())return new c(0)._forceRed(this);var _=d.mul(g),M=_.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=_.isub(M).iushrn(this.shift),w=S;return S.cmp(this.m)>=0?w=S.isub(this.m):S.cmpn(0)<0&&(w=S.iadd(this.m)),w._forceRed(this)},"mul3"),"mul"),T.prototype.invm=a(i(function(d){var g=this.imod(d._invmp(this.m).mul(this.r2));return g._forceRed(this)},"invm"),"invm")})(typeof t>"u"||t,e)}}),K$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,s=~n,o=Math.pow(2,31);function c(l,h,p){if(Number.MAX_SAFE_INTEGER&&l>Number.MAX_SAFE_INTEGER)throw c.bytes=0,new RangeError("Could not encode varint");h=h||[],p=p||0;for(var v=p;l>=o;)h[p++]=l&255|r,l/=128;for(;l&s;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-v+1,h}i(c,"encode9"),a(c,"encode")}}),V$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){t.exports=s;var r=128,n=127;function s(o,h){var l=0,h=h||0,p=0,v=h,b,y=o.length;do{if(v>=y||p>49)throw s.bytes=0,new RangeError("Could not decode varint");b=o[v++],l+=p<28?(b&n)<<p:(b&n)*Math.pow(2,p),p+=7}while(b>=r);return s.bytes=v-h,l}i(s,"read2"),a(s,"read")}}),G$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),s=Math.pow(2,21),o=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),v=Math.pow(2,63);t.exports=function(b){return b<r?1:b<n?2:b<s?3:b<o?4:b<c?5:b<l?6:b<h?7:b<p?8:b<v?9:10}}}),vm=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){t.exports={encode:K$(),decode:V$(),encodingLength:G$()}}}),W$=ze({"../../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){"use strict";t.exports=function(r,n){n||(n={}),typeof n=="function"&&(n={cmp:n});var s=typeof n.cycles=="boolean"?n.cycles:!1,o=n.cmp&&function(l){return function(h){return function(p,v){var b={key:p,value:h[p]},y={key:v,value:h[v]};return l(b,y)}}}(n.cmp),c=[];return a(i(function l(h){if(h&&h.toJSON&&typeof h.toJSON=="function"&&(h=h.toJSON()),h!==void 0){if(typeof h=="number")return isFinite(h)?""+h:"null";if(typeof h!="object")return JSON.stringify(h);var p,v;if(Array.isArray(h)){for(v="[",p=0;p<h.length;p++)p&&(v+=","),v+=l(h[p])||"null";return v+"]"}if(h===null)return"null";if(c.indexOf(h)!==-1){if(s)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var b=c.push(h)-1,y=Object.keys(h).sort(o&&o(h));for(v="",p=0;p<y.length;p++){var A=y[p],C=l(h[A]);!C||(v&&(v+=","),v+=JSON.stringify(A)+":"+C)}return c.splice(b,1),"{"+v+"}"}},"stringify2"),"stringify")(r)}}}),dd=ze({"../../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js"(e,t){var r=200,n="__lodash_hash_undefined__",s=9007199254740991,o="[object Arguments]",c="[object Array]",l="[object Boolean]",h="[object Date]",p="[object Error]",v="[object Function]",b="[object GeneratorFunction]",y="[object Map]",A="[object Number]",C="[object Object]",O="[object Promise]",R="[object RegExp]",L="[object Set]",K="[object String]",$="[object Symbol]",j="[object WeakMap]",V="[object ArrayBuffer]",G="[object DataView]",k="[object Float32Array]",H="[object Float64Array]",se="[object Int8Array]",ue="[object Int16Array]",me="[object Int32Array]",q="[object Uint8Array]",E="[object Uint8ClampedArray]",T="[object Uint16Array]",m="[object Uint32Array]",d=/[\\^$.*+?()[\]{}|]/g,g=/\w*$/,_=/^\[object .+?Constructor\]$/,M=/^(?:0|[1-9]\d*)$/,S={};S[o]=S[c]=S[V]=S[G]=S[l]=S[h]=S[k]=S[H]=S[se]=S[ue]=S[me]=S[y]=S[A]=S[C]=S[R]=S[L]=S[K]=S[$]=S[q]=S[E]=S[T]=S[m]=!0,S[p]=S[v]=S[j]=!1;var w=typeof global=="object"&&global&&global.Object===Object&&global,N=typeof self=="object"&&self&&self.Object===Object&&self,B=w||N||Function("return this")(),D=typeof e=="object"&&e&&!e.nodeType&&e,F=D&&typeof t=="object"&&t&&!t.nodeType&&t,le=F&&F.exports===D;function P(ie,Te){return ie.set(Te[0],Te[1]),ie}i(P,"addMapEntry"),a(P,"addMapEntry");function Y(ie,Te){return ie.add(Te),ie}i(Y,"addSetEntry"),a(Y,"addSetEntry");function J(ie,Te){for(var Pe=-1,ht=ie?ie.length:0;++Pe<ht&&Te(ie[Pe],Pe,ie)!==!1;);return ie}i(J,"arrayEach"),a(J,"arrayEach");function I(ie,Te){for(var Pe=-1,ht=Te.length,qr=ie.length;++Pe<ht;)ie[qr+Pe]=Te[Pe];return ie}i(I,"arrayPush"),a(I,"arrayPush");function z(ie,Te,Pe,ht){var qr=-1,sn=ie?ie.length:0;for(ht&&sn&&(Pe=ie[++qr]);++qr<sn;)Pe=Te(Pe,ie[qr],qr,ie);return Pe}i(z,"arrayReduce"),a(z,"arrayReduce");function te(ie,Te){for(var Pe=-1,ht=Array(ie);++Pe<ie;)ht[Pe]=Te(Pe);return ht}i(te,"baseTimes"),a(te,"baseTimes");function ae(ie,Te){return ie?.[Te]}i(ae,"getValue"),a(ae,"getValue");function ve(ie){var Te=!1;if(ie!=null&&typeof ie.toString!="function")try{Te=!!(ie+"")}catch{}return Te}i(ve,"isHostObject"),a(ve,"isHostObject");function De(ie){var Te=-1,Pe=Array(ie.size);return ie.forEach(function(ht,qr){Pe[++Te]=[qr,ht]}),Pe}i(De,"mapToArray"),a(De,"mapToArray");function we(ie,Te){return function(Pe){return ie(Te(Pe))}}i(we,"overArg"),a(we,"overArg");function de(ie){var Te=-1,Pe=Array(ie.size);return ie.forEach(function(ht){Pe[++Te]=ht}),Pe}i(de,"setToArray"),a(de,"setToArray");var Ce=Array.prototype,pe=Function.prototype,_e=Object.prototype,Q=B["__core-js_shared__"],ge=function(){var ie=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||"");return ie?"Symbol(src)_1."+ie:""}(),Me=pe.toString,Ue=_e.hasOwnProperty,Re=_e.toString,je=RegExp("^"+Me.call(Ue).replace(d,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=le?B.Buffer:void 0,fe=B.Symbol,ce=B.Uint8Array,Z=we(Object.getPrototypeOf,Object),re=Object.create,ye=_e.propertyIsEnumerable,Se=Ce.splice,xe=Object.getOwnPropertySymbols,ke=rt?rt.isBuffer:void 0,Mt=we(Object.keys,Object),qe=Vi(B,"DataView"),He=Vi(B,"Map"),Ot=Vi(B,"Promise"),dt=Vi(B,"Set"),vt=Vi(B,"WeakMap"),kr=Vi(Object,"create"),ct=vs(qe),ut=vs(He),cr=vs(Ot),lt=vs(dt),nt=vs(vt),ir=fe?fe.prototype:void 0,it=ir?ir.valueOf:void 0;function Ye(ie){var Te=-1,Pe=ie?ie.length:0;for(this.clear();++Te<Pe;){var ht=ie[Te];this.set(ht[0],ht[1])}}i(Ye,"Hash"),a(Ye,"Hash");function Qt(){this.__data__=kr?kr(null):{}}i(Qt,"hashClear"),a(Qt,"hashClear");function st(ie){return this.has(ie)&&delete this.__data__[ie]}i(st,"hashDelete"),a(st,"hashDelete");function Qe(ie){var Te=this.__data__;if(kr){var Pe=Te[ie];return Pe===n?void 0:Pe}return Ue.call(Te,ie)?Te[ie]:void 0}i(Qe,"hashGet"),a(Qe,"hashGet");function sr(ie){var Te=this.__data__;return kr?Te[ie]!==void 0:Ue.call(Te,ie)}i(sr,"hashHas"),a(sr,"hashHas");function at(ie,Te){var Pe=this.__data__;return Pe[ie]=kr&&Te===void 0?n:Te,this}i(at,"hashSet"),a(at,"hashSet"),Ye.prototype.clear=Qt,Ye.prototype.delete=st,Ye.prototype.get=Qe,Ye.prototype.has=sr,Ye.prototype.set=at;function Ze(ie){var Te=-1,Pe=ie?ie.length:0;for(this.clear();++Te<Pe;){var ht=ie[Te];this.set(ht[0],ht[1])}}i(Ze,"ListCache"),a(Ze,"ListCache");function ar(){this.__data__=[]}i(ar,"listCacheClear"),a(ar,"listCacheClear");function ot(ie){var Te=this.__data__,Pe=dn(Te,ie);if(Pe<0)return!1;var ht=Te.length-1;return Pe==ht?Te.pop():Se.call(Te,Pe,1),!0}i(ot,"listCacheDelete"),a(ot,"listCacheDelete");function Et(ie){var Te=this.__data__,Pe=dn(Te,ie);return Pe<0?void 0:Te[Pe][1]}i(Et,"listCacheGet"),a(Et,"listCacheGet");function Sn(ie){return dn(this.__data__,ie)>-1}i(Sn,"listCacheHas"),a(Sn,"listCacheHas");function At(ie,Te){var Pe=this.__data__,ht=dn(Pe,ie);return ht<0?Pe.push([ie,Te]):Pe[ht][1]=Te,this}i(At,"listCacheSet"),a(At,"listCacheSet"),Ze.prototype.clear=ar,Ze.prototype.delete=ot,Ze.prototype.get=Et,Ze.prototype.has=Sn,Ze.prototype.set=At;function yt(ie){var Te=-1,Pe=ie?ie.length:0;for(this.clear();++Te<Pe;){var ht=ie[Te];this.set(ht[0],ht[1])}}i(yt,"MapCache"),a(yt,"MapCache");function fn(){this.__data__={hash:new Ye,map:new(He||Ze),string:new Ye}}i(fn,"mapCacheClear"),a(fn,"mapCacheClear");function er(ie){return Js(this,ie).delete(ie)}i(er,"mapCacheDelete"),a(er,"mapCacheDelete");function tr(ie){return Js(this,ie).get(ie)}i(tr,"mapCacheGet"),a(tr,"mapCacheGet");function tn(ie){return Js(this,ie).has(ie)}i(tn,"mapCacheHas"),a(tn,"mapCacheHas");function rn(ie,Te){return Js(this,ie).set(ie,Te),this}i(rn,"mapCacheSet"),a(rn,"mapCacheSet"),yt.prototype.clear=fn,yt.prototype.delete=er,yt.prototype.get=tr,yt.prototype.has=tn,yt.prototype.set=rn;function Or(ie){this.__data__=new Ze(ie)}i(Or,"Stack"),a(Or,"Stack");function Hr(){this.__data__=new Ze}i(Hr,"stackClear"),a(Hr,"stackClear");function nn(ie){return this.__data__.delete(ie)}i(nn,"stackDelete"),a(nn,"stackDelete");function xn(ie){return this.__data__.get(ie)}i(xn,"stackGet"),a(xn,"stackGet");function Ei(ie){return this.__data__.has(ie)}i(Ei,"stackHas"),a(Ei,"stackHas");function Ai(ie,Te){var Pe=this.__data__;if(Pe instanceof Ze){var ht=Pe.__data__;if(!He||ht.length<r-1)return ht.push([ie,Te]),this;Pe=this.__data__=new yt(ht)}return Pe.set(ie,Te),this}i(Ai,"stackSet"),a(Ai,"stackSet"),Or.prototype.clear=Hr,Or.prototype.delete=nn,Or.prototype.get=xn,Or.prototype.has=Ei,Or.prototype.set=Ai;function Si(ie,Te){var Pe=wl(ie)||Id(ie)?te(ie.length,String):[],ht=Pe.length,qr=!!ht;for(var sn in ie)(Te||Ue.call(ie,sn))&&!(qr&&(sn=="length"||gl(sn,ht)))&&Pe.push(sn);return Pe}i(Si,"arrayLikeKeys"),a(Si,"arrayLikeKeys");function Bn(ie,Te,Pe){var ht=ie[Te];(!(Ue.call(ie,Te)&&Nc(ht,Pe))||Pe===void 0&&!(Te in ie))&&(ie[Te]=Pe)}i(Bn,"assignValue"),a(Bn,"assignValue");function dn(ie,Te){for(var Pe=ie.length;Pe--;)if(Nc(ie[Pe][0],Te))return Pe;return-1}i(dn,"assocIndexOf"),a(dn,"assocIndexOf");function Xn(ie,Te){return ie&&Co(Te,Pc(Te),ie)}i(Xn,"baseAssign"),a(Xn,"baseAssign");function Ln(ie,Te,Pe,ht,qr,sn,Tn){var hn;if(ht&&(hn=sn?ht(ie,qr,sn,Tn):ht(ie)),hn!==void 0)return hn;if(!Io(ie))return ie;var Lr=wl(ie);if(Lr){if(hn=ml(ie),!Te)return hl(ie,hn)}else{var gs=ms(ie),ys=gs==v||gs==b;if(Al(ie))return Zs(ie,Te);if(gs==C||gs==o||ys&&!sn){if(ve(ie))return sn?ie:{};if(hn=Md(ys?{}:ie),!Te)return Td(ie,Xn(hn,ie))}else{if(!S[gs])return sn?ie:{};hn=vl(ie,gs,Ln,Te)}}Tn||(Tn=new Or);var xl=Tn.get(ie);if(xl)return xl;if(Tn.set(ie,hn),!Lr)var Bc=Pe?pl(ie):Pc(ie);return J(Bc||ie,function(pn,Do){Bc&&(Do=pn,pn=ie[Do]),Bn(hn,Do,Ln(pn,Te,Pe,ht,Do,ie,Tn))}),hn}i(Ln,"baseClone"),a(Ln,"baseClone");function xi(ie){return Io(ie)?re(ie):{}}i(xi,"baseCreate"),a(xi,"baseCreate");function Ti(ie,Te,Pe){var ht=Te(ie);return wl(ie)?ht:I(ht,Pe(ie))}i(Ti,"baseGetAllKeys"),a(Ti,"baseGetAllKeys");function Mi(ie){return Re.call(ie)}i(Mi,"baseGetTag"),a(Mi,"baseGetTag");function Gs(ie){if(!Io(ie)||bl(ie))return!1;var Te=Sl(ie)||ve(ie)?je:_;return Te.test(vs(ie))}i(Gs,"baseIsNative"),a(Gs,"baseIsNative");function Ws(ie){if(!_l(ie))return Mt(ie);var Te=[];for(var Pe in Object(ie))Ue.call(ie,Pe)&&Pe!="constructor"&&Te.push(Pe);return Te}i(Ws,"baseKeys"),a(Ws,"baseKeys");function Zs(ie,Te){if(Te)return ie.slice();var Pe=new ie.constructor(ie.length);return ie.copy(Pe),Pe}i(Zs,"cloneBuffer"),a(Zs,"cloneBuffer");function Ca(ie){var Te=new ie.constructor(ie.byteLength);return new ce(Te).set(new ce(ie)),Te}i(Ca,"cloneArrayBuffer"),a(Ca,"cloneArrayBuffer");function Sd(ie,Te){var Pe=Te?Ca(ie.buffer):ie.buffer;return new ie.constructor(Pe,ie.byteOffset,ie.byteLength)}i(Sd,"cloneDataView"),a(Sd,"cloneDataView");function ll(ie,Te,Pe){var ht=Te?Pe(De(ie),!0):De(ie);return z(ht,P,new ie.constructor)}i(ll,"cloneMap"),a(ll,"cloneMap");function Mo(ie){var Te=new ie.constructor(ie.source,g.exec(ie));return Te.lastIndex=ie.lastIndex,Te}i(Mo,"cloneRegExp"),a(Mo,"cloneRegExp");function fl(ie,Te,Pe){var ht=Te?Pe(de(ie),!0):de(ie);return z(ht,Y,new ie.constructor)}i(fl,"cloneSet"),a(fl,"cloneSet");function xd(ie){return it?Object(it.call(ie)):{}}i(xd,"cloneSymbol"),a(xd,"cloneSymbol");function dl(ie,Te){var Pe=Te?Ca(ie.buffer):ie.buffer;return new ie.constructor(Pe,ie.byteOffset,ie.length)}i(dl,"cloneTypedArray"),a(dl,"cloneTypedArray");function hl(ie,Te){var Pe=-1,ht=ie.length;for(Te||(Te=Array(ht));++Pe<ht;)Te[Pe]=ie[Pe];return Te}i(hl,"copyArray"),a(hl,"copyArray");function Co(ie,Te,Pe,ht){Pe||(Pe={});for(var qr=-1,sn=Te.length;++qr<sn;){var Tn=Te[qr],hn=ht?ht(Pe[Tn],ie[Tn],Tn,Pe,ie):void 0;Bn(Pe,Tn,hn===void 0?ie[Tn]:hn)}return Pe}i(Co,"copyObject"),a(Co,"copyObject");function Td(ie,Te){return Co(ie,Ys(ie),Te)}i(Td,"copySymbols"),a(Td,"copySymbols");function pl(ie){return Ti(ie,Pc,Ys)}i(pl,"getAllKeys"),a(pl,"getAllKeys");function Js(ie,Te){var Pe=ie.__data__;return yl(Te)?Pe[typeof Te=="string"?"string":"hash"]:Pe.map}i(Js,"getMapData"),a(Js,"getMapData");function Vi(ie,Te){var Pe=ae(ie,Te);return Gs(Pe)?Pe:void 0}i(Vi,"getNative"),a(Vi,"getNative");var Ys=xe?we(xe,Object):yr,ms=Mi;(qe&&ms(new qe(new ArrayBuffer(1)))!=G||He&&ms(new He)!=y||Ot&&ms(Ot.resolve())!=O||dt&&ms(new dt)!=L||vt&&ms(new vt)!=j)&&(ms=a(function(ie){var Te=Re.call(ie),Pe=Te==C?ie.constructor:void 0,ht=Pe?vs(Pe):void 0;if(ht)switch(ht){case ct:return G;case ut:return y;case cr:return O;case lt:return L;case nt:return j}return Te},"getTag"));function ml(ie){var Te=ie.length,Pe=ie.constructor(Te);return Te&&typeof ie[0]=="string"&&Ue.call(ie,"index")&&(Pe.index=ie.index,Pe.input=ie.input),Pe}i(ml,"initCloneArray"),a(ml,"initCloneArray");function Md(ie){return typeof ie.constructor=="function"&&!_l(ie)?xi(Z(ie)):{}}i(Md,"initCloneObject"),a(Md,"initCloneObject");function vl(ie,Te,Pe,ht){var qr=ie.constructor;switch(Te){case V:return Ca(ie);case l:case h:return new qr(+ie);case G:return Sd(ie,ht);case k:case H:case se:case ue:case me:case q:case E:case T:case m:return dl(ie,ht);case y:return ll(ie,ht,Pe);case A:case K:return new qr(ie);case R:return Mo(ie);case L:return fl(ie,ht,Pe);case $:return xd(ie)}}i(vl,"initCloneByTag"),a(vl,"initCloneByTag");function gl(ie,Te){return Te=Te??s,!!Te&&(typeof ie=="number"||M.test(ie))&&ie>-1&&ie%1==0&&ie<Te}i(gl,"isIndex"),a(gl,"isIndex");function yl(ie){var Te=typeof ie;return Te=="string"||Te=="number"||Te=="symbol"||Te=="boolean"?ie!=="__proto__":ie===null}i(yl,"isKeyable"),a(yl,"isKeyable");function bl(ie){return!!ge&&ge in ie}i(bl,"isMasked"),a(bl,"isMasked");function _l(ie){var Te=ie&&ie.constructor,Pe=typeof Te=="function"&&Te.prototype||_e;return ie===Pe}i(_l,"isPrototype"),a(_l,"isPrototype");function vs(ie){if(ie!=null){try{return Me.call(ie)}catch{}try{return ie+""}catch{}}return""}i(vs,"toSource"),a(vs,"toSource");function Cd(ie){return Ln(ie,!0,!0)}i(Cd,"cloneDeep6"),a(Cd,"cloneDeep");function Nc(ie,Te){return ie===Te||ie!==ie&&Te!==Te}i(Nc,"eq4"),a(Nc,"eq");function Id(ie){return Dd(ie)&&Ue.call(ie,"callee")&&(!ye.call(ie,"callee")||Re.call(ie)==o)}i(Id,"isArguments"),a(Id,"isArguments");var wl=Array.isArray;function El(ie){return ie!=null&&kd(ie.length)&&!Sl(ie)}i(El,"isArrayLike2"),a(El,"isArrayLike");function Dd(ie){return Od(ie)&&El(ie)}i(Dd,"isArrayLikeObject"),a(Dd,"isArrayLikeObject");var Al=ke||mr;function Sl(ie){var Te=Io(ie)?Re.call(ie):"";return Te==v||Te==b}i(Sl,"isFunction2"),a(Sl,"isFunction");function kd(ie){return typeof ie=="number"&&ie>-1&&ie%1==0&&ie<=s}i(kd,"isLength"),a(kd,"isLength");function Io(ie){var Te=typeof ie;return!!ie&&(Te=="object"||Te=="function")}i(Io,"isObject"),a(Io,"isObject");function Od(ie){return!!ie&&typeof ie=="object"}i(Od,"isObjectLike"),a(Od,"isObjectLike");function Pc(ie){return El(ie)?Si(ie):Ws(ie)}i(Pc,"keys"),a(Pc,"keys");function yr(){return[]}i(yr,"stubArray"),a(yr,"stubArray");function mr(){return!1}i(mr,"stubFalse"),a(mr,"stubFalse"),t.exports=Cd}}),Z$=ze({"../../../node_modules/.pnpm/tslib@2.5.0/node_modules/tslib/tslib.js"(e,t){var r,n,s,o,c,l,h,p,v,b,y,A,C,O,R,L,K,$,j,V,G,k,H,se,ue,me,q,E,T;(function(m){var d=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(_){m(g(d,g(_)))}):typeof t=="object"&&typeof t.exports=="object"?m(g(d,g(t.exports))):m(g(d));function g(_,M){return _!==d&&(typeof Object.create=="function"?Object.defineProperty(_,"__esModule",{value:!0}):_.__esModule=!0),function(S,w){return _[S]=M?M(S,w):w}}i(g,"createExporter"),a(g,"createExporter")})(function(m){var d=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,M){_.__proto__=M}||function(_,M){for(var S in M)Object.prototype.hasOwnProperty.call(M,S)&&(_[S]=M[S])};r=a(function(_,M){if(typeof M!="function"&&M!==null)throw new TypeError("Class extends value "+String(M)+" is not a constructor or null");d(_,M);function S(){this.constructor=_}i(S,"__"),a(S,"__"),_.prototype=M===null?Object.create(M):(S.prototype=M.prototype,new S)},"__extends"),n=Object.assign||function(_){for(var M,S=1,w=arguments.length;S<w;S++){M=arguments[S];for(var N in M)Object.prototype.hasOwnProperty.call(M,N)&&(_[N]=M[N])}return _},s=a(function(_,M){var S={};for(var w in _)Object.prototype.hasOwnProperty.call(_,w)&&M.indexOf(w)<0&&(S[w]=_[w]);if(_!=null&&typeof Object.getOwnPropertySymbols=="function")for(var N=0,w=Object.getOwnPropertySymbols(_);N<w.length;N++)M.indexOf(w[N])<0&&Object.prototype.propertyIsEnumerable.call(_,w[N])&&(S[w[N]]=_[w[N]]);return S},"__rest"),o=a(function(_,M,S,w){var N=arguments.length,B=N<3?M:w===null?w=Object.getOwnPropertyDescriptor(M,S):w,D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(_,M,S,w);else for(var F=_.length-1;F>=0;F--)(D=_[F])&&(B=(N<3?D(B):N>3?D(M,S,B):D(M,S))||B);return N>3&&B&&Object.defineProperty(M,S,B),B},"__decorate"),c=a(function(_,M){return function(S,w){M(S,w,_)}},"__param"),l=a(function(_,M,S,w,N,B){function D(De){if(De!==void 0&&typeof De!="function")throw new TypeError("Function expected");return De}i(D,"accept"),a(D,"accept");for(var F=w.kind,le=F==="getter"?"get":F==="setter"?"set":"value",P=!M&&_?w.static?_:_.prototype:null,Y=M||(P?Object.getOwnPropertyDescriptor(P,w.name):{}),J,I=!1,z=S.length-1;z>=0;z--){var te={};for(var ae in w)te[ae]=ae==="access"?{}:w[ae];for(var ae in w.access)te.access[ae]=w.access[ae];te.addInitializer=function(De){if(I)throw new TypeError("Cannot add initializers after decoration has completed");B.push(D(De||null))};var ve=(0,S[z])(F==="accessor"?{get:Y.get,set:Y.set}:Y[le],te);if(F==="accessor"){if(ve===void 0)continue;if(ve===null||typeof ve!="object")throw new TypeError("Object expected");(J=D(ve.get))&&(Y.get=J),(J=D(ve.set))&&(Y.set=J),(J=D(ve.init))&&N.push(J)}else(J=D(ve))&&(F==="field"?N.push(J):Y[le]=J)}P&&Object.defineProperty(P,w.name,Y),I=!0},"__esDecorate"),h=a(function(_,M,S){for(var w=arguments.length>2,N=0;N<M.length;N++)S=w?M[N].call(_,S):M[N].call(_);return w?S:void 0},"__runInitializers"),p=a(function(_){return typeof _=="symbol"?_:"".concat(_)},"__propKey"),v=a(function(_,M,S){return typeof M=="symbol"&&(M=M.description?"[".concat(M.description,"]"):""),Object.defineProperty(_,"name",{configurable:!0,value:S?"".concat(S," ",M):M})},"__setFunctionName"),b=a(function(_,M){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(_,M)},"__metadata"),y=a(function(_,M,S,w){function N(B){return B instanceof S?B:new S(function(D){D(B)})}return i(N,"adopt"),a(N,"adopt"),new(S||(S=Promise))(function(B,D){function F(Y){try{P(w.next(Y))}catch(J){D(J)}}i(F,"fulfilled"),a(F,"fulfilled");function le(Y){try{P(w.throw(Y))}catch(J){D(J)}}i(le,"rejected"),a(le,"rejected");function P(Y){Y.done?B(Y.value):N(Y.value).then(F,le)}i(P,"step"),a(P,"step"),P((w=w.apply(_,M||[])).next())})},"__awaiter"),A=a(function(_,M){var S={label:0,sent:function(){if(B[0]&1)throw B[1];return B[1]},trys:[],ops:[]},w,N,B,D;return D={next:F(0),throw:F(1),return:F(2)},typeof Symbol=="function"&&(D[Symbol.iterator]=function(){return this}),D;function F(P){return function(Y){return le([P,Y])}}function le(P){if(w)throw new TypeError("Generator is already executing.");for(;D&&(D=0,P[0]&&(S=0)),S;)try{if(w=1,N&&(B=P[0]&2?N.return:P[0]?N.throw||((B=N.return)&&B.call(N),0):N.next)&&!(B=B.call(N,P[1])).done)return B;switch(N=0,B&&(P=[P[0]&2,B.value]),P[0]){case 0:case 1:B=P;break;case 4:return S.label++,{value:P[1],done:!1};case 5:S.label++,N=P[1],P=[0];continue;case 7:P=S.ops.pop(),S.trys.pop();continue;default:if(B=S.trys,!(B=B.length>0&&B[B.length-1])&&(P[0]===6||P[0]===2)){S=0;continue}if(P[0]===3&&(!B||P[1]>B[0]&&P[1]<B[3])){S.label=P[1];break}if(P[0]===6&&S.label<B[1]){S.label=B[1],B=P;break}if(B&&S.label<B[2]){S.label=B[2],S.ops.push(P);break}B[2]&&S.ops.pop(),S.trys.pop();continue}P=M.call(_,S)}catch(Y){P=[6,Y],N=0}finally{w=B=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},"__generator"),C=a(function(_,M){for(var S in _)S!=="default"&&!Object.prototype.hasOwnProperty.call(M,S)&&T(M,_,S)},"__exportStar"),T=Object.create?function(_,M,S,w){w===void 0&&(w=S);var N=Object.getOwnPropertyDescriptor(M,S);(!N||("get"in N?!M.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return M[S]}}),Object.defineProperty(_,w,N)}:function(_,M,S,w){w===void 0&&(w=S),_[w]=M[S]},O=a(function(_){var M=typeof Symbol=="function"&&Symbol.iterator,S=M&&_[M],w=0;if(S)return S.call(_);if(_&&typeof _.length=="number")return{next:function(){return _&&w>=_.length&&(_=void 0),{value:_&&_[w++],done:!_}}};throw new TypeError(M?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),R=a(function(_,M){var S=typeof Symbol=="function"&&_[Symbol.iterator];if(!S)return _;var w=S.call(_),N,B=[],D;try{for(;(M===void 0||M-- >0)&&!(N=w.next()).done;)B.push(N.value)}catch(F){D={error:F}}finally{try{N&&!N.done&&(S=w.return)&&S.call(w)}finally{if(D)throw D.error}}return B},"__read"),L=a(function(){for(var _=[],M=0;M<arguments.length;M++)_=_.concat(R(arguments[M]));return _},"__spread"),K=a(function(){for(var _=0,M=0,S=arguments.length;M<S;M++)_+=arguments[M].length;for(var w=Array(_),N=0,M=0;M<S;M++)for(var B=arguments[M],D=0,F=B.length;D<F;D++,N++)w[N]=B[D];return w},"__spreadArrays"),$=a(function(_,M,S){if(S||arguments.length===2)for(var w=0,N=M.length,B;w<N;w++)(B||!(w in M))&&(B||(B=Array.prototype.slice.call(M,0,w)),B[w]=M[w]);return _.concat(B||Array.prototype.slice.call(M))},"__spreadArray"),j=a(function(_){return this instanceof j?(this.v=_,this):new j(_)},"__await"),V=a(function(_,M,S){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var w=S.apply(_,M||[]),N,B=[];return N={},D("next"),D("throw"),D("return"),N[Symbol.asyncIterator]=function(){return this},N;function D(I){w[I]&&(N[I]=function(z){return new Promise(function(te,ae){B.push([I,z,te,ae])>1||F(I,z)})})}function F(I,z){try{le(w[I](z))}catch(te){J(B[0][3],te)}}function le(I){I.value instanceof j?Promise.resolve(I.value.v).then(P,Y):J(B[0][2],I)}function P(I){F("next",I)}function Y(I){F("throw",I)}function J(I,z){I(z),B.shift(),B.length&&F(B[0][0],B[0][1])}},"__asyncGenerator"),G=a(function(_){var M,S;return M={},w("next"),w("throw",function(N){throw N}),w("return"),M[Symbol.iterator]=function(){return this},M;function w(N,B){M[N]=_[N]?function(D){return(S=!S)?{value:j(_[N](D)),done:!1}:B?B(D):D}:B}},"__asyncDelegator"),k=a(function(_){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var M=_[Symbol.asyncIterator],S;return M?M.call(_):(_=typeof O=="function"?O(_):_[Symbol.iterator](),S={},w("next"),w("throw"),w("return"),S[Symbol.asyncIterator]=function(){return this},S);function w(B){S[B]=_[B]&&function(D){return new Promise(function(F,le){D=_[B](D),N(F,le,D.done,D.value)})}}function N(B,D,F,le){Promise.resolve(le).then(function(P){B({value:P,done:F})},D)}},"__asyncValues"),H=a(function(_,M){return Object.defineProperty?Object.defineProperty(_,"raw",{value:M}):_.raw=M,_},"__makeTemplateObject");var g=Object.create?function(_,M){Object.defineProperty(_,"default",{enumerable:!0,value:M})}:function(_,M){_.default=M};se=a(function(_){if(_&&_.__esModule)return _;var M={};if(_!=null)for(var S in _)S!=="default"&&Object.prototype.hasOwnProperty.call(_,S)&&T(M,_,S);return g(M,_),M},"__importStar"),ue=a(function(_){return _&&_.__esModule?_:{default:_}},"__importDefault"),me=a(function(_,M,S,w){if(S==="a"&&!w)throw new TypeError("Private accessor was defined without a getter");if(typeof M=="function"?_!==M||!w:!M.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return S==="m"?w:S==="a"?w.call(_):w?w.value:M.get(_)},"__classPrivateFieldGet"),q=a(function(_,M,S,w,N){if(w==="m")throw new TypeError("Private method is not writable");if(w==="a"&&!N)throw new TypeError("Private accessor was defined without a setter");if(typeof M=="function"?_!==M||!N:!M.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return w==="a"?N.call(_,S):N?N.value=S:M.set(_,S),S},"__classPrivateFieldSet"),E=a(function(_,M){if(M===null||typeof M!="object"&&typeof M!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof _=="function"?M===_:_.has(M)},"__classPrivateFieldIn"),m("__extends",r),m("__assign",n),m("__rest",s),m("__decorate",o),m("__param",c),m("__esDecorate",l),m("__runInitializers",h),m("__propKey",p),m("__setFunctionName",v),m("__metadata",b),m("__awaiter",y),m("__generator",A),m("__exportStar",C),m("__createBinding",T),m("__values",O),m("__read",R),m("__spread",L),m("__spreadArrays",K),m("__spreadArray",$),m("__await",j),m("__asyncGenerator",V),m("__asyncDelegator",G),m("__asyncValues",k),m("__makeTemplateObject",H),m("__importStar",se),m("__importDefault",ue),m("__classPrivateFieldGet",me),m("__classPrivateFieldSet",q),m("__classPrivateFieldIn",E)})}}),J$=ze({"../../../node_modules/.pnpm/cross-fetch@3.1.5/node_modules/cross-fetch/dist/browser-ponyfill.js"(e,t){var r=typeof self<"u"?self:e,n=function(){function o(){this.fetch=!1,this.DOMException=r.DOMException}return i(o,"F"),a(o,"F"),o.prototype=r,new o}();(function(o){var c=function(l){var h={searchParams:"URLSearchParams"in o,iterable:"Symbol"in o&&"iterator"in Symbol,blob:"FileReader"in o&&"Blob"in o&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in o,arrayBuffer:"ArrayBuffer"in o};function p(m){return m&&DataView.prototype.isPrototypeOf(m)}if(i(p,"isDataView"),a(p,"isDataView"),h.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(m){return m&&v.indexOf(Object.prototype.toString.call(m))>-1};function y(m){if(typeof m!="string"&&(m=String(m)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(m))throw new TypeError("Invalid character in header field name");return m.toLowerCase()}i(y,"normalizeName"),a(y,"normalizeName");function A(m){return typeof m!="string"&&(m=String(m)),m}i(A,"normalizeValue"),a(A,"normalizeValue");function C(m){var d={next:function(){var g=m.shift();return{done:g===void 0,value:g}}};return h.iterable&&(d[Symbol.iterator]=function(){return d}),d}i(C,"iteratorFor"),a(C,"iteratorFor");function O(m){this.map={},m instanceof O?m.forEach(function(d,g){this.append(g,d)},this):Array.isArray(m)?m.forEach(function(d){this.append(d[0],d[1])},this):m&&Object.getOwnPropertyNames(m).forEach(function(d){this.append(d,m[d])},this)}i(O,"Headers"),a(O,"Headers"),O.prototype.append=function(m,d){m=y(m),d=A(d);var g=this.map[m];this.map[m]=g?g+", "+d:d},O.prototype.delete=function(m){delete this.map[y(m)]},O.prototype.get=function(m){return m=y(m),this.has(m)?this.map[m]:null},O.prototype.has=function(m){return this.map.hasOwnProperty(y(m))},O.prototype.set=function(m,d){this.map[y(m)]=A(d)},O.prototype.forEach=function(m,d){for(var g in this.map)this.map.hasOwnProperty(g)&&m.call(d,this.map[g],g,this)},O.prototype.keys=function(){var m=[];return this.forEach(function(d,g){m.push(g)}),C(m)},O.prototype.values=function(){var m=[];return this.forEach(function(d){m.push(d)}),C(m)},O.prototype.entries=function(){var m=[];return this.forEach(function(d,g){m.push([g,d])}),C(m)},h.iterable&&(O.prototype[Symbol.iterator]=O.prototype.entries);function R(m){if(m.bodyUsed)return Promise.reject(new TypeError("Already read"));m.bodyUsed=!0}i(R,"consumed"),a(R,"consumed");function L(m){return new Promise(function(d,g){m.onload=function(){d(m.result)},m.onerror=function(){g(m.error)}})}i(L,"fileReaderReady"),a(L,"fileReaderReady");function K(m){var d=new FileReader,g=L(d);return d.readAsArrayBuffer(m),g}i(K,"readBlobAsArrayBuffer"),a(K,"readBlobAsArrayBuffer");function $(m){var d=new FileReader,g=L(d);return d.readAsText(m),g}i($,"readBlobAsText"),a($,"readBlobAsText");function j(m){for(var d=new Uint8Array(m),g=new Array(d.length),_=0;_<d.length;_++)g[_]=String.fromCharCode(d[_]);return g.join("")}i(j,"readArrayBufferAsText"),a(j,"readArrayBufferAsText");function V(m){if(m.slice)return m.slice(0);var d=new Uint8Array(m.byteLength);return d.set(new Uint8Array(m)),d.buffer}i(V,"bufferClone"),a(V,"bufferClone");function G(){return this.bodyUsed=!1,this._initBody=function(m){this._bodyInit=m,m?typeof m=="string"?this._bodyText=m:h.blob&&Blob.prototype.isPrototypeOf(m)?this._bodyBlob=m:h.formData&&FormData.prototype.isPrototypeOf(m)?this._bodyFormData=m:h.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)?this._bodyText=m.toString():h.arrayBuffer&&h.blob&&p(m)?(this._bodyArrayBuffer=V(m.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):h.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(m)||b(m))?this._bodyArrayBuffer=V(m):this._bodyText=m=Object.prototype.toString.call(m):this._bodyText="",this.headers.get("content-type")||(typeof m=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):h.searchParams&&URLSearchParams.prototype.isPrototypeOf(m)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},h.blob&&(this.blob=function(){var m=R(this);if(m)return m;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?R(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(K)}),this.text=function(){var m=R(this);if(m)return m;if(this._bodyBlob)return $(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(j(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},h.formData&&(this.formData=function(){return this.text().then(ue)}),this.json=function(){return this.text().then(JSON.parse)},this}i(G,"Body"),a(G,"Body");var k=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function H(m){var d=m.toUpperCase();return k.indexOf(d)>-1?d:m}i(H,"normalizeMethod"),a(H,"normalizeMethod");function se(m,d){d=d||{};var g=d.body;if(m instanceof se){if(m.bodyUsed)throw new TypeError("Already read");this.url=m.url,this.credentials=m.credentials,d.headers||(this.headers=new O(m.headers)),this.method=m.method,this.mode=m.mode,this.signal=m.signal,!g&&m._bodyInit!=null&&(g=m._bodyInit,m.bodyUsed=!0)}else this.url=String(m);if(this.credentials=d.credentials||this.credentials||"same-origin",(d.headers||!this.headers)&&(this.headers=new O(d.headers)),this.method=H(d.method||this.method||"GET"),this.mode=d.mode||this.mode||null,this.signal=d.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&g)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(g)}i(se,"Request"),a(se,"Request"),se.prototype.clone=function(){return new se(this,{body:this._bodyInit})};function ue(m){var d=new FormData;return m.trim().split("&").forEach(function(g){if(g){var _=g.split("="),M=_.shift().replace(/\+/g," "),S=_.join("=").replace(/\+/g," ");d.append(decodeURIComponent(M),decodeURIComponent(S))}}),d}i(ue,"decode9"),a(ue,"decode");function me(m){var d=new O,g=m.replace(/\r?\n[\t ]+/g," ");return g.split(/\r?\n/).forEach(function(_){var M=_.split(":"),S=M.shift().trim();if(S){var w=M.join(":").trim();d.append(S,w)}}),d}i(me,"parseHeaders"),a(me,"parseHeaders"),G.call(se.prototype);function q(m,d){d||(d={}),this.type="default",this.status=d.status===void 0?200:d.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in d?d.statusText:"OK",this.headers=new O(d.headers),this.url=d.url||"",this._initBody(m)}i(q,"Response"),a(q,"Response"),G.call(q.prototype),q.prototype.clone=function(){return new q(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new O(this.headers),url:this.url})},q.error=function(){var m=new q(null,{status:0,statusText:""});return m.type="error",m};var E=[301,302,303,307,308];q.redirect=function(m,d){if(E.indexOf(d)===-1)throw new RangeError("Invalid status code");return new q(null,{status:d,headers:{location:m}})},l.DOMException=o.DOMException;try{new l.DOMException}catch{l.DOMException=function(d,g){this.message=d,this.name=g;var _=Error(d);this.stack=_.stack},l.DOMException.prototype=Object.create(Error.prototype),l.DOMException.prototype.constructor=l.DOMException}function T(m,d){return new Promise(function(g,_){var M=new se(m,d);if(M.signal&&M.signal.aborted)return _(new l.DOMException("Aborted","AbortError"));var S=new XMLHttpRequest;function w(){S.abort()}i(w,"abortXhr"),a(w,"abortXhr"),S.onload=function(){var N={status:S.status,statusText:S.statusText,headers:me(S.getAllResponseHeaders()||"")};N.url="responseURL"in S?S.responseURL:N.headers.get("X-Request-URL");var B="response"in S?S.response:S.responseText;g(new q(B,N))},S.onerror=function(){_(new TypeError("Network request failed"))},S.ontimeout=function(){_(new TypeError("Network request failed"))},S.onabort=function(){_(new l.DOMException("Aborted","AbortError"))},S.open(M.method,M.url,!0),M.credentials==="include"?S.withCredentials=!0:M.credentials==="omit"&&(S.withCredentials=!1),"responseType"in S&&h.blob&&(S.responseType="blob"),M.headers.forEach(function(N,B){S.setRequestHeader(B,N)}),M.signal&&(M.signal.addEventListener("abort",w),S.onreadystatechange=function(){S.readyState===4&&M.signal.removeEventListener("abort",w)}),S.send(typeof M._bodyInit>"u"?null:M._bodyInit)})}return i(T,"fetch2"),a(T,"fetch"),T.polyfill=!0,o.fetch||(o.fetch=T,o.Headers=O,o.Request=se,o.Response=q),l.Headers=O,l.Request=se,l.Response=q,l.fetch=T,Object.defineProperty(l,"__esModule",{value:!0}),l}({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var s=n;e=s.fetch,e.default=s.fetch,e.fetch=s.fetch,e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response,t.exports=e}}),Y$=ze({"../../../node_modules/.pnpm/dataloader@2.2.2/node_modules/dataloader/index.js"(e,t){"use strict";var r=function(){function O(L,K){if(typeof L!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+L+"."));this._batchLoadFn=L,this._maxBatchSize=p(K),this._batchScheduleFn=v(K),this._cacheKeyFn=b(K),this._cacheMap=y(K),this._batch=null,this.name=A(K)}i(O,"DataLoader3"),a(O,"DataLoader");var R=O.prototype;return R.load=a(i(function(K){if(K==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(K)+"."));var $=o(this),j=this._cacheMap,V=this._cacheKeyFn(K);if(j){var G=j.get(V);if(G){var k=$.cacheHits||($.cacheHits=[]);return new Promise(function(se){k.push(function(){se(G)})})}}$.keys.push(K);var H=new Promise(function(se,ue){$.callbacks.push({resolve:se,reject:ue})});return j&&j.set(V,H),H},"load"),"load"),R.loadMany=a(i(function(K){if(!C(K))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+K+"."));for(var $=[],j=0;j<K.length;j++)$.push(this.load(K[j]).catch(function(V){return V}));return Promise.all($)},"loadMany"),"loadMany"),R.clear=a(i(function(K){var $=this._cacheMap;if($){var j=this._cacheKeyFn(K);$.delete(j)}return this},"clear"),"clear"),R.clearAll=a(i(function(){var K=this._cacheMap;return K&&K.clear(),this},"clearAll"),"clearAll"),R.prime=a(i(function(K,$){var j=this._cacheMap;if(j){var V=this._cacheKeyFn(K);if(j.get(V)===void 0){var G;$ instanceof Error?(G=Promise.reject($),G.catch(function(){})):G=Promise.resolve($),j.set(V,G)}}return this},"prime"),"prime"),O}(),n=typeof process=="object"&&typeof process.nextTick=="function"?function(O){s||(s=Promise.resolve()),s.then(function(){process.nextTick(O)})}:typeof setImmediate=="function"?function(O){setImmediate(O)}:function(O){setTimeout(O)},s;function o(O){var R=O._batch;if(R!==null&&!R.hasDispatched&&R.keys.length<O._maxBatchSize)return R;var L={hasDispatched:!1,keys:[],callbacks:[]};return O._batch=L,O._batchScheduleFn(function(){c(O,L)}),L}i(o,"getCurrentBatch"),a(o,"getCurrentBatch");function c(O,R){if(R.hasDispatched=!0,R.keys.length===0){h(R);return}var L;try{L=O._batchLoadFn(R.keys)}catch(K){return l(O,R,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(K)+".")))}if(!L||typeof L.then!="function")return l(O,R,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise: "+String(L)+".")));L.then(function(K){if(!C(K))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did "+("not return a Promise of an Array: "+String(K)+"."));if(K.length!==R.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(`
|
|
669
|
+
|
|
670
|
+
Keys:
|
|
671
|
+
`+String(R.keys))+(`
|
|
672
|
+
|
|
673
|
+
Values:
|
|
674
|
+
`+String(K)));h(R);for(var $=0;$<R.callbacks.length;$++){var j=K[$];j instanceof Error?R.callbacks[$].reject(j):R.callbacks[$].resolve(j)}}).catch(function(K){l(O,R,K)})}i(c,"dispatchBatch"),a(c,"dispatchBatch");function l(O,R,L){h(R);for(var K=0;K<R.keys.length;K++)O.clear(R.keys[K]),R.callbacks[K].reject(L)}i(l,"failedDispatch"),a(l,"failedDispatch");function h(O){if(O.cacheHits)for(var R=0;R<O.cacheHits.length;R++)O.cacheHits[R]()}i(h,"resolveCacheHits"),a(h,"resolveCacheHits");function p(O){var R=!O||O.batch!==!1;if(!R)return 1;var L=O&&O.maxBatchSize;if(L===void 0)return 1/0;if(typeof L!="number"||L<1)throw new TypeError("maxBatchSize must be a positive number: "+L);return L}i(p,"getValidMaxBatchSize"),a(p,"getValidMaxBatchSize");function v(O){var R=O&&O.batchScheduleFn;if(R===void 0)return n;if(typeof R!="function")throw new TypeError("batchScheduleFn must be a function: "+R);return R}i(v,"getValidBatchScheduleFn"),a(v,"getValidBatchScheduleFn");function b(O){var R=O&&O.cacheKeyFn;if(R===void 0)return function(L){return L};if(typeof R!="function")throw new TypeError("cacheKeyFn must be a function: "+R);return R}i(b,"getValidCacheKeyFn"),a(b,"getValidCacheKeyFn");function y(O){var R=!O||O.cache!==!1;if(!R)return null;var L=O&&O.cacheMap;if(L===void 0)return new Map;if(L!==null){var K=["get","set","delete","clear"],$=K.filter(function(j){return L&&typeof L[j]!="function"});if($.length!==0)throw new TypeError("Custom cacheMap missing methods: "+$.join(", "))}return L}i(y,"getValidCacheMap"),a(y,"getValidCacheMap");function A(O){return O&&O.name?O.name:null}i(A,"getValidName"),a(A,"getValidName");function C(O){return typeof O=="object"&&O!==null&&typeof O.length=="number"&&(O.length===0||O.length>0&&Object.prototype.hasOwnProperty.call(O,O.length-1))}i(C,"isArrayLike2"),a(C,"isArrayLike"),t.exports=r}}),X$=ze({"../../../node_modules/.pnpm/@multiformats+base-x@4.0.1/node_modules/@multiformats/base-x/src/index.js"(e,t){"use strict";function r(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var s=new Uint8Array(256),o=0;o<s.length;o++)s[o]=255;for(var c=0;c<n.length;c++){var l=n.charAt(c),h=l.charCodeAt(0);if(s[h]!==255)throw new TypeError(l+" is ambiguous");s[h]=c}var p=n.length,v=n.charAt(0),b=Math.log(p)/Math.log(256),y=Math.log(256)/Math.log(p);function A(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var L=0,K=0,$=0,j=R.length;$!==j&&R[$]===0;)$++,L++;for(var V=(j-$)*y+1>>>0,G=new Uint8Array(V);$!==j;){for(var k=R[$],H=0,se=V-1;(k!==0||H<K)&&se!==-1;se--,H++)k+=256*G[se]>>>0,G[se]=k%p>>>0,k=k/p>>>0;if(k!==0)throw new Error("Non-zero carry");K=H,$++}for(var ue=V-K;ue!==V&&G[ue]===0;)ue++;for(var me=v.repeat(L);ue<V;++ue)me+=n.charAt(G[ue]);return me}i(A,"encode9"),a(A,"encode");function C(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var L=0;if(R[L]!==" "){for(var K=0,$=0;R[L]===v;)K++,L++;for(var j=(R.length-L)*b+1>>>0,V=new Uint8Array(j);R[L];){var G=s[R.charCodeAt(L)];if(G===255)return;for(var k=0,H=j-1;(G!==0||k<$)&&H!==-1;H--,k++)G+=p*V[H]>>>0,V[H]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");$=k,L++}if(R[L]!==" "){for(var se=j-$;se!==j&&V[se]===0;)se++;for(var ue=new Uint8Array(K+(j-se)),me=K;se!==j;)ue[me++]=V[se++];return ue}}}i(C,"decodeUnsafe"),a(C,"decodeUnsafe");function O(R){var L=C(R);if(L)return L;throw new Error("Non-base"+p+" character")}return i(O,"decode9"),a(O,"decode"),{encode:A,decodeUnsafe:C,decode:O}}i(r,"base4"),a(r,"base"),t.exports=r}}),u2=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/util.js"(e,t){"use strict";var r=new TextDecoder,n=a(l=>r.decode(l),"decodeText"),s=new TextEncoder,o=a(l=>s.encode(l),"encodeText");function c(l,h){let p=new Uint8Array(h),v=0;for(let b of l)p.set(b,v),v+=b.length;return p}i(c,"concat4"),a(c,"concat"),t.exports={decodeText:n,encodeText:o,concat:c}}}),Q$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/base.js"(e,t){"use strict";var{encodeText:r}=u2(),n=i(class{constructor(s,o,c,l){this.name=s,this.code=o,this.codeBuf=r(this.code),this.alphabet=l,this.codec=c(l)}encode(s){return this.codec.encode(s)}decode(s){for(let o of s)if(this.alphabet&&this.alphabet.indexOf(o)<0)throw new Error(`invalid character '${o}' in '${s}'`);return this.codec.decode(s)}},"Base");a(n,"Base"),t.exports=n}}),ej=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/rfc4648.js"(e,t){"use strict";var r=a((o,c,l)=>{let h={};for(let C=0;C<c.length;++C)h[c[C]]=C;let p=o.length;for(;o[p-1]==="=";)--p;let v=new Uint8Array(p*l/8|0),b=0,y=0,A=0;for(let C=0;C<p;++C){let O=h[o[C]];if(O===void 0)throw new SyntaxError("Invalid character "+o[C]);y=y<<l|O,b+=l,b>=8&&(b-=8,v[A++]=255&y>>b)}if(b>=l||255&y<<8-b)throw new SyntaxError("Unexpected end of data");return v},"decode"),n=a((o,c,l)=>{let h=c[c.length-1]==="=",p=(1<<l)-1,v="",b=0,y=0;for(let A=0;A<o.length;++A)for(y=y<<8|o[A],b+=8;b>l;)b-=l,v+=c[p&y>>b];if(b&&(v+=c[p&y<<l-b]),h)for(;v.length*l&7;)v+="=";return v},"encode"),s=a(o=>c=>({encode(l){return n(l,c,o)},decode(l){return r(l,c,o)}}),"rfc4648");t.exports={rfc4648:s}}}),tj=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/constants.js"(e,t){"use strict";var r=X$(),n=Q$(),{rfc4648:s}=ej(),{decodeText:o,encodeText:c}=u2(),l=a(()=>({encode:o,decode:c}),"identity"),h=[["identity","\0",l,""],["base2","0",s(1),"01"],["base8","7",s(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",s(4),"0123456789abcdef"],["base16upper","F",s(4),"0123456789ABCDEF"],["base32hex","v",s(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",s(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",s(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",s(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",s(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",s(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",s(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",s(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],p=h.reduce((b,y)=>(b[y[0]]=new n(y[0],y[1],y[2],y[3]),b),{}),v=h.reduce((b,y)=>(b[y[1]]=p[y[0]],b),{});t.exports={names:p,codes:v}}}),rj=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/index.js"(e,t){"use strict";var r=tj(),{encodeText:n,decodeText:s,concat:o}=u2();function c(O,R){if(!R)throw new Error("requires an encoded Uint8Array");let{name:L,codeBuf:K}=b(O);return v(L,R),o([K,R],K.length+R.length)}i(c,"multibase"),a(c,"multibase");function l(O,R){let L=b(O),K=n(L.encode(R));return o([L.codeBuf,K],L.codeBuf.length+K.length)}i(l,"encode9"),a(l,"encode");function h(O){O instanceof Uint8Array&&(O=s(O));let R=O[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(R)&&(O=O.toLowerCase()),b(O[0]).decode(O.substring(1))}i(h,"decode9"),a(h,"decode");function p(O){if(O instanceof Uint8Array&&(O=s(O)),Object.prototype.toString.call(O)!=="[object String]")return!1;try{return b(O[0]).name}catch{return!1}}i(p,"isEncoded"),a(p,"isEncoded");function v(O,R){b(O).decode(s(R))}i(v,"validEncode"),a(v,"validEncode");function b(O){if(Object.prototype.hasOwnProperty.call(r.names,O))return r.names[O];if(Object.prototype.hasOwnProperty.call(r.codes,O))return r.codes[O];throw new Error(`Unsupported encoding: ${O}`)}i(b,"encoding"),a(b,"encoding");function y(O){return O instanceof Uint8Array&&(O=s(O)),b(O[0])}i(y,"encodingFromData"),a(y,"encodingFromData"),e=t.exports=c,e.encode=l,e.decode=h,e.isEncoded=p,e.encoding=b,e.encodingFromData=y;var A=Object.freeze(r.names),C=Object.freeze(r.codes);e.names=A,e.codes=C}}),nj=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,s=~n,o=Math.pow(2,31);function c(l,h,p){h=h||[],p=p||0;for(var v=p;l>=o;)h[p++]=l&255|r,l/=128;for(;l&s;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-v+1,h}i(c,"encode9"),a(c,"encode")}}),ij=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/decode.js"(e,t){t.exports=s;var r=128,n=127;function s(o,h){var l=0,h=h||0,p=0,v=h,b,y=o.length;do{if(v>=y)throw s.bytes=0,new RangeError("Could not decode varint");b=o[v++],l+=p<28?(b&n)<<p:(b&n)*Math.pow(2,p),p+=7}while(b>=r);return s.bytes=v-h,l}i(s,"read2"),a(s,"read")}}),sj=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/length.js"(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),s=Math.pow(2,21),o=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),v=Math.pow(2,63);t.exports=function(b){return b<r?1:b<n?2:b<s?3:b<o?4:b<c?5:b<l?6:b<h?7:b<p?8:b<v?9:10}}}),aj=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/index.js"(e,t){t.exports={encode:nj(),decode:ij(),encodingLength:sj()}}}),oj=ze({"../../../node_modules/.pnpm/multihashes@4.0.3/node_modules/multihashes/src/constants.js"(e,t){"use strict";var r=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});t.exports={names:r}}}),cj=ze({"../../../node_modules/.pnpm/multihashes@4.0.3/node_modules/multihashes/src/index.js"(e,t){"use strict";var r=rj(),n=aj(),{names:s}=oj(),{toString:o}=(ld(),My(gx)),{fromString:c}=(a2(),My(vx)),{concat:l}=(_S(),My(bS)),h={};for(let j in s){let V=j;h[s[V]]=V}Object.freeze(h);function p(j){if(!(j instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(j,"base16")}i(p,"toHexString"),a(p,"toHexString");function v(j){return c(j,"base16")}i(v,"fromHexString"),a(v,"fromHexString");function b(j){if(!(j instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return o(r.encode("base58btc",j)).slice(1)}i(b,"toB58String"),a(b,"toB58String");function y(j){let V=j instanceof Uint8Array?o(j):j;return r.decode("z"+V)}i(y,"fromB58String"),a(y,"fromB58String");function A(j){if(!(j instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(j.length<2)throw new Error("multihash too short. must be > 2 bytes.");let V=n.decode(j);if(!L(V))throw new Error(`multihash unknown function code: 0x${V.toString(16)}`);j=j.slice(n.decode.bytes);let G=n.decode(j);if(G<0)throw new Error(`multihash invalid length: ${G}`);if(j=j.slice(n.decode.bytes),j.length!==G)throw new Error(`multihash length inconsistent: 0x${o(j,"base16")}`);return{code:V,name:h[V],length:G,digest:j}}i(A,"decode9"),a(A,"decode");function C(j,V,G){if(!j||V===void 0)throw new Error("multihash encode requires at least two args: digest, code");let k=O(V);if(!(j instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(G==null&&(G=j.length),G&&j.length!==G)throw new Error("digest length should be equal to specified length.");let H=n.encode(k),se=n.encode(G);return l([H,se,j],H.length+se.length+j.length)}i(C,"encode9"),a(C,"encode");function O(j){let V=j;if(typeof j=="string"){if(s[j]===void 0)throw new Error(`Unrecognized hash function named: ${j}`);V=s[j]}if(typeof V!="number")throw new Error(`Hash function code should be a number. Got: ${V}`);if(h[V]===void 0&&!R(V))throw new Error(`Unrecognized function code: ${V}`);return V}i(O,"coerceCode"),a(O,"coerceCode");function R(j){return j>0&&j<16}i(R,"isAppCode"),a(R,"isAppCode");function L(j){return!!(R(j)||h[j])}i(L,"isValidCode"),a(L,"isValidCode");function K(j){A(j)}i(K,"validate6"),a(K,"validate");function $(j){return K(j),j.subarray(0,2)}i($,"prefix"),a($,"prefix"),t.exports={names:s,codes:h,toHexString:p,fromHexString:v,toB58String:b,fromB58String:y,decode:A,encode:C,coerceCode:O,isAppCode:R,validate:K,prefix:$,isValidCode:L}}}),zJ=rr(BU());function Ox(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}i(Ox,"_catch");a(Ox,"_catch");function Rx(){let e=new Map;return function(t,r){try{let n=i(function(c){if(s)return c;let l=e.get(t.didUrl);return l!==void 0?l:Promise.resolve(r()).then(function(h){var p;return((p=h.didResolutionMetadata)==null?void 0:p.error)!=="notFound"&&e.set(t.didUrl,h),h})},"_temp2");a(n,"_temp2");let s,o=function(){if(t.params&&t.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return s=1,c})}();return Promise.resolve(o&&o.then?o.then(n):n(o))}catch(n){return Promise.reject(n)}}}i(Rx,"inMemoryCache");a(Rx,"inMemoryCache");function Nx(e,t){return t()}i(Nx,"noCache");a(Nx,"noCache");var uj="(?:%[0-9a-fA-F]{2})",BA=`(?:[a-zA-Z0-9._-]|${uj})`,lj="([a-z0-9]+)",fj=`((?:${BA}*:)*(${BA}+))`,LA="[a-zA-Z0-9_.:%-]",dj=`;${LA}+=${LA}*`,hj=`((${dj})*)`,pj="(/[^#?]*)?",mj="([?][^#]*)?",vj="(#.*)?",gj=new RegExp(`^did:${lj}:${fj}${hj}${pj}${mj}${vj}$`);function l2(e){if(e===""||!e)return null;let t=e.match(gj);if(t){let r={did:`did:${t[1]}:${t[2]}`,method:t[1],id:t[2],didUrl:e};if(t[4]){let n=t[4].slice(1).split(";");r.params={};for(let s of n){let o=s.split("=");r.params[o[0]]=o[1]}}return t[6]&&(r.path=t[6]),t[7]&&(r.query=t[7].slice(1)),t[8]&&(r.fragment=t[8].slice(1)),r}return null}i(l2,"parse");a(l2,"parse");var O0={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function Px(e){return function(t,r,n){try{return Promise.resolve(Ox(function(){return Promise.resolve(e(t,r,n)).then(function(s){return{...O0,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:s}})},function(s){return{...O0,didResolutionMetadata:{error:"notFound",message:s.toString()}}}))}catch(s){return Promise.reject(s)}}}i(Px,"wrapLegacyResolver");a(Px,"wrapLegacyResolver");var Bx=i(class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?Rx():t.cache||Nx,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(r=>{this.registry[r]||(this.registry[r]=Px(t.legacyResolvers[r]))})}resolve(e,t={}){try{let r=this,n=l2(e);if(n===null)return Promise.resolve({...O0,didResolutionMetadata:{error:"invalidDid"}});let s=r.registry[n.method];return s?Promise.resolve(r.cache(n,()=>s(n.did,n,r,t))):Promise.resolve({...O0,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(r){return Promise.reject(r)}}},"Resolver");a(Bx,"Resolver");_S();a2();ld();e2();um();px();var Lx=rr(XU()),yj=rr(yx()),Fx=rr(g$()),Ux=rr(c2()),bj=rr(E$()),ab=rr(A$()),$x=rr(M$()),jx=rr(Xu());function mi(e){return Mr(e,"base64url")}i(mi,"bytesToBase64url");a(mi,"bytesToBase64url");function Nn(e){let t=e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return xr(t,"base64url")}i(Nn,"base64ToBytes");a(Nn,"base64ToBytes");function gm(e){return xr(e,"base58btc")}i(gm,"base58ToBytes");a(gm,"base58ToBytes");function R0(e){let t=e.startsWith("0x")?e.substring(2):e;return xr(t.toLowerCase(),"base16")}i(R0,"hexToBytes");a(R0,"hexToBytes");function N0(e){return mi(xr(e))}i(N0,"encodeBase64url");a(N0,"encodeBase64url");function f2(e){return Mr(Nn(e))}i(f2,"decodeBase64url");a(f2,"decodeBase64url");function fo(e){return Mr(e,"base16")}i(fo,"bytesToHex");a(fo,"bytesToHex");function d2(e){return xr(e)}i(d2,"stringToBytes");a(d2,"stringToBytes");function zx({r:e,s:t,recoveryParam:r},n){let s=new Uint8Array(n?65:64);if(s.set(xr(e,"base16"),0),s.set(xr(t,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");s[64]=r}return mi(s)}i(zx,"toJose");a(zx,"toJose");function Hx(e){let t=Nn(e);if(t.length<64||t.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${t.length}`);let r=fo(t.slice(0,32)),n=fo(t.slice(32,64)),s=t.length===65?t[64]:void 0;return{r,s:n,recoveryParam:s}}i(Hx,"fromJose");a(Hx,"fromJose");function h2(e,t){return lo([Nn(e),Nn(t)])}i(h2,"toSealed");a(h2,"toSealed");var _j=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,wj=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,Ej=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function qx(e){if(typeof e=="string"){if(_j.test(e))return R0(e);if(wj.test(e))return gm(e);if(Ej.test(e))return Nn(e);throw TypeError("bad_key: Invalid private key format")}else{if(e instanceof Uint8Array)return e;throw TypeError("bad_key: Invalid private key format")}}i(qx,"parseKey");a(qx,"parseKey");function p2(e){let t=typeof e=="string"?xr(e):e;return(0,Lx.hash)(t)}i(p2,"sha2562");a(p2,"sha256");function Kx(e){return new Uint8Array(yj.keccak_256.arrayBuffer(e))}i(Kx,"keccak");a(Kx,"keccak");function Vx(e){let t=xr(e.slice(2),"base16");return`0x${Mr(Kx(t).slice(-20),"base16")}`}i(Vx,"toEthereumAddress");a(Vx,"toEthereumAddress");function P0(e,t=new Uint8Array(4)){let r=xr(e.toString(),"base10");return t.set(r,4-r.length),t}i(P0,"writeUint32BE");a(P0,"writeUint32BE");var zy=a(e=>lo([P0(e.length),e]),"lengthAndInput");function m2(e,t,r,n,s){if(t!==256)throw new Error(`Unsupported key length: ${t}`);let o=lo([zy(xr(r)),zy(typeof n>"u"?new Uint8Array(0):n),zy(typeof s>"u"?new Uint8Array(0):s),P0(t)]),c=1;return(0,Lx.hash)(lo([P0(c),e,o]))}i(m2,"concatKDF");a(m2,"concatKDF");var HJ=new Fx.ec("secp256k1");function Gx(e){let t=qx(e);if(t.length!==64)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${t.length}`);return function(r){try{let n=typeof r=="string"?d2(r):r,s=(0,Ux.sign)(t,n);return Promise.resolve(mi(s))}catch(n){return Promise.reject(n)}}}i(Gx,"EdDSASigner");a(Gx,"EdDSASigner");function v2(e){return typeof e=="object"&&"r"in e&&"s"in e}i(v2,"instanceOfEcdsaSignature");a(v2,"instanceOfEcdsaSignature");function ob(e){return a(i(function(r,n){try{return Promise.resolve(n(r)).then(function(s){if(v2(s))return zx(s,e);if(e&&typeof Hx(s).recoveryParam>"u")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return s})}catch(s){return Promise.reject(s)}},"sign5"),"sign")}i(ob,"ES256KSignerAlg");a(ob,"ES256KSignerAlg");function cb(){return a(i(function(t,r){try{return Promise.resolve(r(t)).then(function(n){if(v2(n))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return n})}catch(n){return Promise.reject(n)}},"sign5"),"sign")}i(cb,"Ed25519SignerAlg");a(cb,"Ed25519SignerAlg");var Aj={ES256K:ob(),"ES256K-R":ob(!0),Ed25519:cb(),EdDSA:cb()};function Wx(e){let t=Aj[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(Wx,"SignerAlg");a(Wx,"SignerAlg");var g2=new Fx.ec("secp256k1");function Hf(e,t=!1){let r=Nn(e);if(r.length!==(t?65:64))throw new Error("wrong signature length");let n=fo(r.slice(0,32)),s=fo(r.slice(32,64)),o={r:n,s};return t&&(o.recoveryParam=r[64]),o}i(Hf,"toSignatureObject");a(Hf,"toSignatureObject");function ym(e){if(e.publicKeyBase58)return gm(e.publicKeyBase58);if(e.publicKeyBase64)return Nn(e.publicKeyBase64);if(e.publicKeyHex)return R0(e.publicKeyHex);if(e.publicKeyJwk&&e.publicKeyJwk.crv==="secp256k1"&&e.publicKeyJwk.x&&e.publicKeyJwk.y)return R0(g2.keyFromPublic({x:fo(Nn(e.publicKeyJwk.x)),y:fo(Nn(e.publicKeyJwk.y))}).getPublic("hex"));if(e.publicKeyMultibase){let{base16:t,base58btc:r,base64:n,base64url:s}=k0;return t.decoder.or(r.decoder.or(n.decoder.or(s.decoder))).decode(e.publicKeyMultibase)}return new Uint8Array}i(ym,"extractPublicKeyBytes");a(ym,"extractPublicKeyBytes");function Zx(e,t,r){let n=p2(e),s=Hf(t),o=r.filter(({ethereumAddress:h,blockchainAccountId:p})=>typeof h>"u"&&typeof p>"u"),c=r.filter(({ethereumAddress:h,blockchainAccountId:p})=>typeof h<"u"||typeof p!==void 0),l=o.find(h=>{try{let p=ym(h);return g2.keyFromPublic(p).verify(n,s)}catch{return!1}});if(!l&&c.length>0&&(l=y2(e,t,c)),!l)throw new Error("invalid_signature: Signature invalid for JWT");return l}i(Zx,"verifyES256K");a(Zx,"verifyES256K");function y2(e,t,r){let n;if(t.length>86)n=[Hf(t,!0)];else{let c=Hf(t,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let s=a(c=>{let l=p2(e),h=g2.recoverPubKey(l,c,c.recoveryParam),p=h.encode("hex"),v=h.encode("hex",!0),b=Vx(p);return r.find(A=>{var C,O,R;let L=fo(ym(A));return L===p||L===v||((C=A.ethereumAddress)==null?void 0:C.toLowerCase())===b||((O=A.blockchainAccountId)==null||(R=O.split("@eip155"))==null?void 0:R[0].toLowerCase())===b})},"checkSignatureAgainstSigner"),o=n.map(s).filter(c=>typeof c<"u");if(o.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return o[0]}i(y2,"verifyRecoverableES256K");a(y2,"verifyRecoverableES256K");function ub(e,t,r){let n=d2(e),s=Nn(t),o=r.find(c=>(0,Ux.verify)(ym(c),n,s));if(!o)throw new Error("invalid_signature: Signature invalid for JWT");return o}i(ub,"verifyEd25519");a(ub,"verifyEd25519");var Sj={ES256K:Zx,"ES256K-R":y2,Ed25519:ub,EdDSA:ub};function b2(e){let t=Sj[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(b2,"VerifierAlgorithm");a(b2,"VerifierAlgorithm");b2.toSignatureObject=Hf;var xj=a(function(e,t,r={},n={}){try{r.alg||(r.alg=Tj);let s=typeof e=="string"?e:lb(e,n.canonicalize),o=[lb(r,n.canonicalize),s].join("."),c=Wx(r.alg);return Promise.resolve(c(o,t)).then(function(l){return[o,l].join(".")})}catch(s){return Promise.reject(s)}},"createJWS"),Tj="ES256K";function lb(e,t=!1){return N0(t?(0,bj.default)(e):JSON.stringify(e))}i(lb,"encodeSection");a(lb,"encodeSection");function Jx(e){let t=e.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(t)return{header:JSON.parse(f2(t[1])),payload:t[2],signature:t[3],data:`${t[1]}.${t[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}i(Jx,"decodeJWS");a(Jx,"decodeJWS");function Yx({header:e,data:t,signature:r},n){return Array.isArray(n)||(n=[n]),b2(e.alg)(t,r,n)}i(Yx,"verifyJWSDecoded");a(Yx,"verifyJWSDecoded");function Xx(e,t){let r=Jx(e);return Yx(r,t)}i(Xx,"verifyJWS");a(Xx,"verifyJWS");function Qx(e,t,r){for(var n;;){var s=e();if(ya(s)&&(s=s.v),!s)return o;if(s.then){n=0;break}var o=r();if(o&&o.then)if(ya(o))o=o.s;else{n=1;break}if(t){var c=t();if(c&&c.then&&!ya(c)){n=2;break}}}var l=new yc,h=Kr.bind(null,l,2);return(n===0?s.then(v):n===1?o.then(p):c.then(b)).then(void 0,h),l;function p(y){o=y;do{if(t&&(c=t(),c&&c.then&&!ya(c))){c.then(b).then(void 0,h);return}if(s=e(),!s||ya(s)&&!s.v){Kr(l,1,o);return}if(s.then){s.then(v).then(void 0,h);return}o=r(),ya(o)&&(o=o.v)}while(!o||!o.then);o.then(p).then(void 0,h)}i(p,"_resumeAfterBody"),a(p,"_resumeAfterBody");function v(y){y?(o=r(),o&&o.then?o.then(p).then(void 0,h):p(o)):Kr(l,1,o)}i(v,"_resumeAfterTest"),a(v,"_resumeAfterTest");function b(){(s=e())?s.then?s.then(v).then(void 0,h):v(s):Kr(l,1,o)}i(b,"_resumeAfterUpdate"),a(b,"_resumeAfterUpdate")}i(Qx,"_for");a(Qx,"_for");var Mj=a(function(e,t){try{let r=i(function(p){if(l===null)throw new Error("failure: Failed to decrypt");return l},"_temp5");a(r,"_temp5");let n;rT(e);let s=JSON.parse(f2(e.protected));if(s.enc!==t.enc)throw new Error(`not_supported: Decrypter does not supported: '${s.enc}'`);let o=h2(e.ciphertext,e.tag),c=new Uint8Array(Buffer.from(e.aad?`${e.protected}.${e.aad}`:e.protected)),l=null,h=function(){return s.alg==="dir"&&t.alg==="dir"?Promise.resolve(t.decrypt(o,Nn(e.iv),c)).then(function(p){l=p}):function(){if(!e.recipients||e.recipients.length===0)throw new Error("bad_jwe: missing recipients");{let p=0;return Qx(function(){return!l&&p<e.recipients.length},function(){return p++},function(){let v=e.recipients[p];Object.assign(v.header,s);let b=function(){if(v.header.alg===t.alg)return Promise.resolve(t.decrypt(o,Nn(e.iv),c,v)).then(function(y){l=y})}();if(b&&b.then)return b.then(function(){})})}}()}();return Promise.resolve(h&&h.then?h.then(r):r(h))}catch(r){return Promise.reject(r)}},"decryptJWE"),FA=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Kr(e,t,r){if(!e.s){if(r instanceof yc)if(r.s)t&1&&(t=r.s),r=r.v;else{r.o=Kr.bind(null,e,t);return}if(r&&r.then){r.then(Kr.bind(null,e,t),Kr.bind(null,e,2));return}e.s=t,e.v=r;let n=e.o;n&&n(e)}}i(Kr,"_settle");a(Kr,"_settle");var yc=function(){function e(){}return i(e,"_Pact2"),a(e,"_Pact"),e.prototype.then=function(t,r){let n=new e,s=this.s;if(s){let o=s&1?t:r;if(o){try{Kr(n,1,o(this.v))}catch(c){Kr(n,2,c)}return n}else return this}return this.o=function(o){try{let c=o.v;o.s&1?Kr(n,1,t?t(c):c):r?Kr(n,1,r(c)):Kr(n,2,c)}catch(c){Kr(n,2,c)}},n},e}();function ya(e){return e instanceof yc&&e.s&1}i(ya,"_isSettledPact");a(ya,"_isSettledPact");function eT(e,t,r){var n=-1,s,o;function c(l){try{for(;++n<e.length&&(!r||!r());)if(l=t(n),l&&l.then)if(ya(l))l=l.v;else{l.then(c,o||(o=Kr.bind(null,s=new yc,2)));return}s?Kr(s,1,l):s=l}catch(h){Kr(s||(s=new yc),2,h)}}return i(c,"_cycle"),a(c,"_cycle"),c(),s}i(eT,"_forTo");a(eT,"_forTo");function tT(e,t,r){if(typeof e[FA]=="function"){let v=i(function(b){try{for(;!(s=n.next()).done&&(!r||!r());)if(b=t(s.value),b&&b.then)if(ya(b))b=b.v;else{b.then(v,c||(c=Kr.bind(null,o=new yc,2)));return}o?Kr(o,1,b):o=b}catch(y){Kr(o||(o=new yc),2,y)}},"_cycle");a(v,"_cycle");var n=e[FA](),s,o,c;if(v(),n.return){var l=a(function(b){try{s.done||n.return()}catch{}return b},"_fixup");if(o&&o.then)return o.then(l,function(b){throw l(b)});l()}return o}if(!("length"in e))throw new TypeError("Object is not iterable");for(var h=[],p=0;p<e.length;p++)h.push(e[p]);return eT(h,function(v){return t(h[v])},r)}i(tT,"_forOf");a(tT,"_forOf");function rT(e){if(!(e.protected&&e.iv&&e.ciphertext&&e.tag))throw new Error("bad_jwe: missing properties");e.recipients&&e.recipients.map(t=>{if(!(t.header&&t.encrypted_key))throw new Error("bad_jwe: malformed recipients")})}i(rT,"validateJWE");a(rT,"validateJWE");function fb({ciphertext:e,tag:t,iv:r,protectedHeader:n,recipient:s},o){let c={protected:n,iv:mi(r),ciphertext:mi(e),tag:mi(t)};return o&&(c.aad=mi(o)),s&&(c.recipients=[s]),c}i(fb,"encodeJWE");a(fb,"encodeJWE");var Cj=a(function(e,t,r={},n){try{if(t[0].alg==="dir"){if(t.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(t[0].encrypt(e,r,n)).then(function(s){return fb(s,n)})}else{let s=t[0].enc;if(!t.reduce((h,p)=>h&&p.enc===s,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let o,c,l=tT(t,function(h){let p=function(){return o?Promise.resolve(h.encryptCek==null?void 0:h.encryptCek(o)).then(function(v){if(v){var b,y;(b=c)==null||(y=b.recipients)==null||y.push(v)}}):Promise.resolve(h.encrypt(e,r,n)).then(function(v){o=v.cek,c=fb(v,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(l&&l.then?l.then(function(){return c}):c)}}catch(s){return Promise.reject(s)}},"createJWE"),Ij=a(function(e,t){try{let r=a(function(s){try{return Promise.resolve(t.resolve(s)).then(function({didResolutionMetadata:o,didDocument:c}){var l;if(o!=null&&o.error||c==null)throw new Error(`resolver_error: Could not resolve ${s}: ${o.error}, ${o.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${s}`);let p=((l=c.keyAgreement)==null?void 0:l.map(v=>typeof v=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(b=>b.id===v):v).filter(v=>typeof v<"u")).filter(v=>v.type==="X25519KeyAgreementKey2019"&&Boolean(v.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${s}`);return p.map(v=>iT(gm(v.publicKeyBase58),v.id))})}catch(o){return Promise.reject(o)}},"encryptersForDID"),n=e.map(s=>r(s));return Promise.resolve(Promise.all(n)).then(function(s){return[].concat(...s)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function _2(e){let t=new $x.XChaCha20Poly1305(e);return(r,n)=>{let s=(0,jx.randomBytes)(t.nonceLength),o=t.seal(s,r,n);return{ciphertext:o.subarray(0,o.length-t.tagLength),tag:o.subarray(o.length-t.tagLength),iv:s}}}i(_2,"xc20pEncrypter");a(_2,"xc20pEncrypter");function nT(e){let t=a(function(o,c={},l){try{let h=N0(JSON.stringify(Object.assign({alg:s},c,{enc:n}))),p=new Uint8Array(Buffer.from(l?`${h}.${mi(l)}`:h));return Promise.resolve({...r(o,p),protectedHeader:h})}catch(h){return Promise.reject(h)}},"encrypt"),r=_2(e),n="XC20P",s="dir";return{alg:s,enc:n,encrypt:t}}i(nT,"xc20pDirEncrypter");a(nT,"xc20pDirEncrypter");function db(e){let t=a(function(n,s,o){try{return Promise.resolve(r.open(s,n,o))}catch(c){return Promise.reject(c)}},"decrypt"),r=new $x.XChaCha20Poly1305(e);return{alg:"dir",enc:"XC20P",decrypt:t}}i(db,"xc20pDirDecrypter");a(db,"xc20pDirDecrypter");function iT(e,t){let r=a(function(l,h={},p){try{Object.assign(h,{alg:void 0});let v=(0,jx.randomBytes)(32);return Promise.resolve(nT(v).encrypt(l,h,p)).then(function(b){return Promise.resolve(n(v)).then(function(y){return{...b,recipient:y,cek:v}})})}catch(v){return Promise.reject(v)}},"encrypt"),n=a(function(l){try{let h=(0,ab.generateKeyPair)(),p=(0,ab.sharedKey)(h.secretKey,e),v=m2(p,o,s),b=_2(v)(l),y={encrypted_key:mi(b.ciphertext),header:{alg:s,iv:mi(b.iv),tag:mi(b.tag),epk:{kty:"OKP",crv:c,x:mi(h.publicKey)}}};return t&&(y.header.kid=t),Promise.resolve(y)}catch(h){return Promise.reject(h)}},"encryptCek"),s="ECDH-ES+XC20PKW",o=256,c="X25519";return{alg:s,enc:"XC20P",encrypt:r,encryptCek:n}}i(iT,"x25519Encrypter");a(iT,"x25519Encrypter");function sT(e){if(!(e&&e.epk&&e.iv&&e.tag))throw new Error("bad_jwe: malformed header")}i(sT,"validateHeader");a(sT,"validateHeader");function aT(e){let t=a(function(o,c,l,h){try{let b=i(function(){let O=m2(A,n,r),R=h2(h.encrypted_key,h.header.tag);return Promise.resolve(db(O).decrypt(R,Nn(h.header.iv))).then(function(L){return L===null?null:db(L).decrypt(o,c,l)})},"_temp4");a(b,"_temp4");var p,v;if(sT((p=h)==null?void 0:p.header),h=h,((v=h.header.epk)==null?void 0:v.crv)!==s||typeof h.header.epk.x>"u")return Promise.resolve(null);let y=Nn(h.header.epk.x),A,C=function(){if(e instanceof Uint8Array)A=(0,ab.sharedKey)(e,y);else return Promise.resolve(e(y)).then(function(O){A=O})}();return Promise.resolve(C&&C.then?C.then(b):b(C))}catch(b){return Promise.reject(b)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,s="X25519";return{alg:r,enc:"XC20P",decrypt:t}}i(aT,"x25519Decrypter");a(aT,"x25519Decrypter");hx();var l0=a(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),hb=a(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let s=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[o,c]of n.entries()){let l=[...s,o],h=Ht.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*hb(c,l))}else{let o=Ht.asCID(n);o?yield[s.join("/"),o]:yield*hb(n,s)}}},"links"),pb=a(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let s=[...t,r];if(yield s.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Ht.asCID(n))if(Array.isArray(n))for(let[o,c]of n.entries()){let l=[...s,o];yield l.join("/"),typeof c=="object"&&!Ht.asCID(c)&&(yield*pb(c,l))}else yield*pb(n,s)}},"tree"),Dj=a((e,t)=>{let r=e;for(let[n,s]of t.entries()){if(r=r[s],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let o=Ht.asCID(r);if(o)return{value:o,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),w2=i(class{constructor({cid:e,bytes:t,value:r}){if(!e||!t||typeof r>"u")throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=r,this.asBlock=this,Object.defineProperties(this,{cid:l0(),bytes:l0(),value:l0(),asBlock:l0()})}links(){return hb(this.value,[])}tree(){return pb(this.value,[])}get(e="/"){return Dj(this.value,e.split("/").filter(Boolean))}},"Block");a(w2,"Block");var bm=a(async({value:e,codec:t,hasher:r})=>{if(typeof e>"u")throw new Error('Missing required argument "value"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");let n=t.encode(e),s=await r.digest(n),o=Ht.create(1,t.code,s);return new w2({value:e,bytes:n,cid:o})},"encode"),kj=a(async({bytes:e,codec:t,hasher:r})=>{if(!e)throw new Error('Missing required argument "bytes"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");let n=t.decode(e),s=await r.digest(e),o=Ht.create(1,t.code,s);return new w2({value:n,bytes:e,cid:o})},"decode");zs();lm();dx();r2();var tl={};Er(tl,{code:()=>L0,decode:()=>_M,encode:()=>Im,name:()=>Zj});var Oj=["string","number","bigint","symbol"],Rj=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function oT(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(Oj.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(cT(e))return"Buffer";let r=uT(e);return r||"Object"}i(oT,"is");a(oT,"is");function cT(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(cT,"isBuffer");a(cT,"isBuffer");function uT(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(Rj.includes(t))return t}i(uT,"getObjectType");a(uT,"getObjectType");var Fe=i(class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}},"Type");a(Fe,"Type");Fe.uint=new Fe(0,"uint",!0);Fe.negint=new Fe(1,"negint",!0);Fe.bytes=new Fe(2,"bytes",!0);Fe.string=new Fe(3,"string",!0);Fe.array=new Fe(4,"array",!1);Fe.map=new Fe(5,"map",!1);Fe.tag=new Fe(6,"tag",!1);Fe.float=new Fe(7,"float",!0);Fe.false=new Fe(7,"false",!0);Fe.true=new Fe(7,"true",!0);Fe.null=new Fe(7,"null",!0);Fe.undefined=new Fe(7,"undefined",!0);Fe.break=new Fe(7,"break",!0);var bt=i(class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}},"Token");a(bt,"Token");var rl=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Nj=new TextDecoder,Pj=new TextEncoder;function qf(e){return rl&&globalThis.Buffer.isBuffer(e)}i(qf,"isBuffer2");a(qf,"isBuffer");function E2(e){return e instanceof Uint8Array?qf(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(E2,"asU8A");a(E2,"asU8A");var Bj=rl?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):vb(e,t,r):(e,t,r)=>r-t>64?Nj.decode(e.subarray(t,r)):vb(e,t,r),Lj=rl?e=>e.length>64?globalThis.Buffer.from(e):mb(e):e=>e.length>64?Pj.encode(e):mb(e),pa=a(e=>Uint8Array.from(e),"fromArray"),A2=rl?(e,t,r)=>qf(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Fj=rl?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),E2(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let s of e)n+s.length>r.length&&(s=s.subarray(0,r.length-n)),r.set(s,n),n+=s.length;return r},Uj=rl?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function lT(e,t){if(qf(e)&&qf(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}i(lT,"compare2");a(lT,"compare");function mb(e,t=1/0){let r,n=e.length,s=null,o=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!s){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&o.push(239,191,189);continue}s=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),s=r;continue}r=(s-55296<<10|r-56320)+65536}else s&&(t-=3)>-1&&o.push(239,191,189);if(s=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}i(mb,"utf8ToBytes");a(mb,"utf8ToBytes");function vb(e,t,r){let n=[];for(;t<r;){let s=e[t],o=null,c=s>239?4:s>223?3:s>191?2:1;if(t+c<=r){let l,h,p,v;switch(c){case 1:s<128&&(o=s);break;case 2:l=e[t+1],(l&192)===128&&(v=(s&31)<<6|l&63,v>127&&(o=v));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(v=(s&15)<<12|(l&63)<<6|h&63,v>2047&&(v<55296||v>57343)&&(o=v));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(v=(s&15)<<18|(l&63)<<12|(h&63)<<6|p&63,v>65535&&v<1114112&&(o=v))}}o===null?(o=65533,c=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|o&1023),n.push(o),t+=c}return fT(n)}i(vb,"utf8Slice");a(vb,"utf8Slice");var UA=4096;function fT(e){let t=e.length;if(t<=UA)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=UA));return r}i(fT,"decodeCodePointsArray");a(fT,"decodeCodePointsArray");var $j=256,S2=i(class{constructor(e=$j){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let n=t.length-(this.maxCursor-this.cursor)-1;t.set(e,n)}else{if(t){let n=t.length-(this.maxCursor-this.cursor)-1;n<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,n),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Uj(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,this._initReuseChunk===null&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(this.chunks.length===1){let r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=A2(r,0,this.cursor)}else t=Fj(this.chunks,this.cursor);return e&&this.reset(),t}},"Bl");a(S2,"Bl");var Jt="CBOR decode error:",dT="CBOR encode error:",hd=[];hd[23]=1;hd[24]=2;hd[25]=3;hd[26]=5;hd[27]=9;function Mc(e,t,r){if(e.length-t<r)throw new Error(`${Jt} not enough data for type`)}i(Mc,"assertEnoughData");a(Mc,"assertEnoughData");var cn=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Eo(e,t,r){Mc(e,t,1);let n=e[t];if(r.strict===!0&&n<cn[0])throw new Error(`${Jt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Eo,"readUint8");a(Eo,"readUint8");function Ao(e,t,r){Mc(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<cn[1])throw new Error(`${Jt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Ao,"readUint16");a(Ao,"readUint16");function So(e,t,r){Mc(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<cn[2])throw new Error(`${Jt} integer encoded in more bytes than necessary (strict decode)`);return n}i(So,"readUint32");a(So,"readUint32");function xo(e,t,r){Mc(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],s=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(s);if(r.strict===!0&&o<cn[3])throw new Error(`${Jt} integer encoded in more bytes than necessary (strict decode)`);if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(r.allowBigInt===!0)return o;throw new Error(`${Jt} integers outside of the safe integer range are not supported`)}i(xo,"readUint64");a(xo,"readUint64");function hT(e,t,r,n){return new bt(Fe.uint,Eo(e,t+1,n),2)}i(hT,"decodeUint8");a(hT,"decodeUint8");function pT(e,t,r,n){return new bt(Fe.uint,Ao(e,t+1,n),3)}i(pT,"decodeUint16");a(pT,"decodeUint16");function mT(e,t,r,n){return new bt(Fe.uint,So(e,t+1,n),5)}i(mT,"decodeUint32");a(mT,"decodeUint32");function vT(e,t,r,n){return new bt(Fe.uint,xo(e,t+1,n),9)}i(vT,"decodeUint64");a(vT,"decodeUint64");function To(e,t){return yi(e,0,t.value)}i(To,"encodeUint");a(To,"encodeUint");function yi(e,t,r){if(r<cn[0]){let n=Number(r);e.push([t|n])}else if(r<cn[1]){let n=Number(r);e.push([t|24,n])}else if(r<cn[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<cn[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<cn[4]){let s=[t|27,0,0,0,0,0,0,0],o=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));s[8]=o&255,o=o>>8,s[7]=o&255,o=o>>8,s[6]=o&255,o=o>>8,s[5]=o&255,s[4]=c&255,c=c>>8,s[3]=c&255,c=c>>8,s[2]=c&255,c=c>>8,s[1]=c&255,e.push(s)}else throw new Error(`${Jt} encountered BigInt larger than allowable range`)}}i(yi,"encodeUintValue");a(yi,"encodeUintValue");To.encodedSize=a(i(function(t){return yi.encodedSize(t.value)},"encodedSize"),"encodedSize");yi.encodedSize=a(i(function(t){return t<cn[0]?1:t<cn[1]?2:t<cn[2]?3:t<cn[3]?5:9},"encodedSize2"),"encodedSize");To.compareTokens=a(i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens"),"compareTokens");function gT(e,t,r,n){return new bt(Fe.negint,-1-Eo(e,t+1,n),2)}i(gT,"decodeNegint8");a(gT,"decodeNegint8");function yT(e,t,r,n){return new bt(Fe.negint,-1-Ao(e,t+1,n),3)}i(yT,"decodeNegint16");a(yT,"decodeNegint16");function bT(e,t,r,n){return new bt(Fe.negint,-1-So(e,t+1,n),5)}i(bT,"decodeNegint32");a(bT,"decodeNegint32");var x2=BigInt(-1),_T=BigInt(1);function wT(e,t,r,n){let s=xo(e,t+1,n);if(typeof s!="bigint"){let o=-1-s;if(o>=Number.MIN_SAFE_INTEGER)return new bt(Fe.negint,o,9)}if(n.allowBigInt!==!0)throw new Error(`${Jt} integers outside of the safe integer range are not supported`);return new bt(Fe.negint,x2-BigInt(s),9)}i(wT,"decodeNegint64");a(wT,"decodeNegint64");function _m(e,t){let r=t.value,n=typeof r=="bigint"?r*x2-_T:r*-1-1;yi(e,t.type.majorEncoded,n)}i(_m,"encodeNegint");a(_m,"encodeNegint");_m.encodedSize=a(i(function(t){let r=t.value,n=typeof r=="bigint"?r*x2-_T:r*-1-1;return n<cn[0]?1:n<cn[1]?2:n<cn[2]?3:n<cn[3]?5:9},"encodedSize3"),"encodedSize");_m.compareTokens=a(i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens2"),"compareTokens");function nl(e,t,r,n){Mc(e,t,r+n);let s=A2(e,t+r,t+r+n);return new bt(Fe.bytes,s,r+n)}i(nl,"toToken");a(nl,"toToken");function ET(e,t,r,n){return nl(e,t,1,r)}i(ET,"decodeBytesCompact");a(ET,"decodeBytesCompact");function AT(e,t,r,n){return nl(e,t,2,Eo(e,t+1,n))}i(AT,"decodeBytes8");a(AT,"decodeBytes8");function ST(e,t,r,n){return nl(e,t,3,Ao(e,t+1,n))}i(ST,"decodeBytes16");a(ST,"decodeBytes16");function xT(e,t,r,n){return nl(e,t,5,So(e,t+1,n))}i(xT,"decodeBytes32");a(xT,"decodeBytes32");function TT(e,t,r,n){let s=xo(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Jt} 64-bit integer bytes lengths not supported`);return nl(e,t,9,s)}i(TT,"decodeBytes64");a(TT,"decodeBytes64");function Kf(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===Fe.string?Lj(e.value):e.value),e.encodedBytes}i(Kf,"tokenBytes");a(Kf,"tokenBytes");function pd(e,t){let r=Kf(t);yi(e,t.type.majorEncoded,r.length),e.push(r)}i(pd,"encodeBytes");a(pd,"encodeBytes");pd.encodedSize=a(i(function(t){let r=Kf(t);return yi.encodedSize(r.length)+r.length},"encodedSize4"),"encodedSize");pd.compareTokens=a(i(function(t,r){return MT(Kf(t),Kf(r))},"compareTokens3"),"compareTokens");function MT(e,t){return e.length<t.length?-1:e.length>t.length?1:lT(e,t)}i(MT,"compareBytes");a(MT,"compareBytes");function il(e,t,r,n,s){let o=r+n;Mc(e,t,o);let c=new bt(Fe.string,Bj(e,t+r,t+o),o);return s.retainStringBytes===!0&&(c.byteValue=A2(e,t+r,t+o)),c}i(il,"toToken2");a(il,"toToken");function CT(e,t,r,n){return il(e,t,1,r,n)}i(CT,"decodeStringCompact");a(CT,"decodeStringCompact");function IT(e,t,r,n){return il(e,t,2,Eo(e,t+1,n),n)}i(IT,"decodeString8");a(IT,"decodeString8");function DT(e,t,r,n){return il(e,t,3,Ao(e,t+1,n),n)}i(DT,"decodeString16");a(DT,"decodeString16");function kT(e,t,r,n){return il(e,t,5,So(e,t+1,n),n)}i(kT,"decodeString32");a(kT,"decodeString32");function OT(e,t,r,n){let s=xo(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Jt} 64-bit integer string lengths not supported`);return il(e,t,9,s,n)}i(OT,"decodeString64");a(OT,"decodeString64");var jj=pd;function Cc(e,t,r,n){return new bt(Fe.array,n,r)}i(Cc,"toToken3");a(Cc,"toToken");function RT(e,t,r,n){return Cc(e,t,1,r)}i(RT,"decodeArrayCompact");a(RT,"decodeArrayCompact");function NT(e,t,r,n){return Cc(e,t,2,Eo(e,t+1,n))}i(NT,"decodeArray8");a(NT,"decodeArray8");function PT(e,t,r,n){return Cc(e,t,3,Ao(e,t+1,n))}i(PT,"decodeArray16");a(PT,"decodeArray16");function BT(e,t,r,n){return Cc(e,t,5,So(e,t+1,n))}i(BT,"decodeArray32");a(BT,"decodeArray32");function LT(e,t,r,n){let s=xo(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Jt} 64-bit integer array lengths not supported`);return Cc(e,t,9,s)}i(LT,"decodeArray64");a(LT,"decodeArray64");function FT(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Jt} indefinite length items not allowed`);return Cc(e,t,1,1/0)}i(FT,"decodeArrayIndefinite");a(FT,"decodeArrayIndefinite");function wm(e,t){yi(e,Fe.array.majorEncoded,t.value)}i(wm,"encodeArray");a(wm,"encodeArray");wm.compareTokens=To.compareTokens;wm.encodedSize=a(i(function(t){return yi.encodedSize(t.value)},"encodedSize5"),"encodedSize");function Ic(e,t,r,n){return new bt(Fe.map,n,r)}i(Ic,"toToken4");a(Ic,"toToken");function UT(e,t,r,n){return Ic(e,t,1,r)}i(UT,"decodeMapCompact");a(UT,"decodeMapCompact");function $T(e,t,r,n){return Ic(e,t,2,Eo(e,t+1,n))}i($T,"decodeMap8");a($T,"decodeMap8");function jT(e,t,r,n){return Ic(e,t,3,Ao(e,t+1,n))}i(jT,"decodeMap16");a(jT,"decodeMap16");function zT(e,t,r,n){return Ic(e,t,5,So(e,t+1,n))}i(zT,"decodeMap32");a(zT,"decodeMap32");function HT(e,t,r,n){let s=xo(e,t+1,n);if(typeof s=="bigint")throw new Error(`${Jt} 64-bit integer map lengths not supported`);return Ic(e,t,9,s)}i(HT,"decodeMap64");a(HT,"decodeMap64");function qT(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Jt} indefinite length items not allowed`);return Ic(e,t,1,1/0)}i(qT,"decodeMapIndefinite");a(qT,"decodeMapIndefinite");function Em(e,t){yi(e,Fe.map.majorEncoded,t.value)}i(Em,"encodeMap");a(Em,"encodeMap");Em.compareTokens=To.compareTokens;Em.encodedSize=a(i(function(t){return yi.encodedSize(t.value)},"encodedSize6"),"encodedSize");function KT(e,t,r,n){return new bt(Fe.tag,r,1)}i(KT,"decodeTagCompact");a(KT,"decodeTagCompact");function VT(e,t,r,n){return new bt(Fe.tag,Eo(e,t+1,n),2)}i(VT,"decodeTag8");a(VT,"decodeTag8");function GT(e,t,r,n){return new bt(Fe.tag,Ao(e,t+1,n),3)}i(GT,"decodeTag16");a(GT,"decodeTag16");function WT(e,t,r,n){return new bt(Fe.tag,So(e,t+1,n),5)}i(WT,"decodeTag32");a(WT,"decodeTag32");function ZT(e,t,r,n){return new bt(Fe.tag,xo(e,t+1,n),9)}i(ZT,"decodeTag64");a(ZT,"decodeTag64");function Am(e,t){yi(e,Fe.tag.majorEncoded,t.value)}i(Am,"encodeTag");a(Am,"encodeTag");Am.compareTokens=To.compareTokens;Am.encodedSize=a(i(function(t){return yi.encodedSize(t.value)},"encodedSize7"),"encodedSize");var zj=20,Hj=21,qj=22,Kj=23;function JT(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Jt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new bt(Fe.null,null,1):new bt(Fe.undefined,void 0,1)}i(JT,"decodeUndefined");a(JT,"decodeUndefined");function YT(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Jt} indefinite length items not allowed`);return new bt(Fe.break,void 0,1)}i(YT,"decodeBreak");a(YT,"decodeBreak");function Sm(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Jt} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Jt} Infinity values are not supported`)}return new bt(Fe.float,e,t)}i(Sm,"createToken");a(Sm,"createToken");function XT(e,t,r,n){return Sm(Tm(e,t+1),3,n)}i(XT,"decodeFloat16");a(XT,"decodeFloat16");function QT(e,t,r,n){return Sm(Mm(e,t+1),5,n)}i(QT,"decodeFloat32");a(QT,"decodeFloat32");function eM(e,t,r,n){return Sm(C2(e,t+1),9,n)}i(eM,"decodeFloat64");a(eM,"decodeFloat64");function xm(e,t,r){let n=t.value;if(n===!1)e.push([Fe.float.majorEncoded|zj]);else if(n===!0)e.push([Fe.float.majorEncoded|Hj]);else if(n===null)e.push([Fe.float.majorEncoded|qj]);else if(n===void 0)e.push([Fe.float.majorEncoded|Kj]);else{let s,o=!1;(!r||r.float64!==!0)&&(T2(n),s=Tm(ss,1),n===s||Number.isNaN(n)?(ss[0]=249,e.push(ss.slice(0,3)),o=!0):(M2(n),s=Mm(ss,1),n===s&&(ss[0]=250,e.push(ss.slice(0,5)),o=!0))),o||(rM(n),s=C2(ss,1),ss[0]=251,e.push(ss.slice(0,9)))}}i(xm,"encodeFloat");a(xm,"encodeFloat");xm.encodedSize=a(i(function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){T2(n);let s=Tm(ss,1);if(n===s||Number.isNaN(n))return 3;if(M2(n),s=Mm(ss,1),n===s)return 5}return 9},"encodedSize8"),"encodedSize");var tM=new ArrayBuffer(9),$i=new DataView(tM,1),ss=new Uint8Array(tM,0);function T2(e){if(e===1/0)$i.setUint16(0,31744,!1);else if(e===-1/0)$i.setUint16(0,64512,!1);else if(Number.isNaN(e))$i.setUint16(0,32256,!1);else{$i.setFloat32(0,e);let t=$i.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)$i.setUint16(0,31744,!1);else if(r===0)$i.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let s=r-127;s<-24?$i.setUint16(0,0):s<-14?$i.setUint16(0,(t&2147483648)>>16|1<<24+s,!1):$i.setUint16(0,(t&2147483648)>>16|s+15<<10|n>>13,!1)}}}i(T2,"encodeFloat16");a(T2,"encodeFloat16");function Tm(e,t){if(e.length-t<2)throw new Error(`${Jt} not enough data for float16`);let r=(e[t]<<8)+e[t+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,s=r&1023,o;return n===0?o=s*2**-24:n!==31?o=(s+1024)*2**(n-25):o=s===0?1/0:NaN,r&32768?-o:o}i(Tm,"readFloat16");a(Tm,"readFloat16");function M2(e){$i.setFloat32(0,e,!1)}i(M2,"encodeFloat32");a(M2,"encodeFloat32");function Mm(e,t){if(e.length-t<4)throw new Error(`${Jt} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(Mm,"readFloat32");a(Mm,"readFloat32");function rM(e){$i.setFloat64(0,e,!1)}i(rM,"encodeFloat64");a(rM,"encodeFloat64");function C2(e,t){if(e.length-t<8)throw new Error(`${Jt} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i(C2,"readFloat64");a(C2,"readFloat64");xm.compareTokens=To.compareTokens;function nr(e,t,r){throw new Error(`${Jt} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(nr,"invalidMinor");a(nr,"invalidMinor");function md(e){return()=>{throw new Error(`${Jt} ${e}`)}}i(md,"errorer");a(md,"errorer");var We=[];for(let e=0;e<=23;e++)We[e]=nr;We[24]=hT;We[25]=pT;We[26]=mT;We[27]=vT;We[28]=nr;We[29]=nr;We[30]=nr;We[31]=nr;for(let e=32;e<=55;e++)We[e]=nr;We[56]=gT;We[57]=yT;We[58]=bT;We[59]=wT;We[60]=nr;We[61]=nr;We[62]=nr;We[63]=nr;for(let e=64;e<=87;e++)We[e]=ET;We[88]=AT;We[89]=ST;We[90]=xT;We[91]=TT;We[92]=nr;We[93]=nr;We[94]=nr;We[95]=md("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)We[e]=CT;We[120]=IT;We[121]=DT;We[122]=kT;We[123]=OT;We[124]=nr;We[125]=nr;We[126]=nr;We[127]=md("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)We[e]=RT;We[152]=NT;We[153]=PT;We[154]=BT;We[155]=LT;We[156]=nr;We[157]=nr;We[158]=nr;We[159]=FT;for(let e=160;e<=183;e++)We[e]=UT;We[184]=$T;We[185]=jT;We[186]=zT;We[187]=HT;We[188]=nr;We[189]=nr;We[190]=nr;We[191]=qT;for(let e=192;e<=215;e++)We[e]=KT;We[216]=VT;We[217]=GT;We[218]=WT;We[219]=ZT;We[220]=nr;We[221]=nr;We[222]=nr;We[223]=nr;for(let e=224;e<=243;e++)We[e]=md("simple values are not supported");We[244]=nr;We[245]=nr;We[246]=nr;We[247]=JT;We[248]=md("simple values are not supported");We[249]=XT;We[250]=QT;We[251]=eM;We[252]=nr;We[253]=nr;We[254]=nr;We[255]=YT;var Ks=[];for(let e=0;e<24;e++)Ks[e]=new bt(Fe.uint,e,1);for(let e=-1;e>=-24;e--)Ks[31-e]=new bt(Fe.negint,e,1);Ks[64]=new bt(Fe.bytes,new Uint8Array(0),1);Ks[96]=new bt(Fe.string,"",1);Ks[128]=new bt(Fe.array,0,1);Ks[160]=new bt(Fe.map,0,1);Ks[244]=new bt(Fe.false,!1,1);Ks[245]=new bt(Fe.true,!0,1);Ks[246]=new bt(Fe.null,null,1);function nM(e){switch(e.type){case Fe.false:return pa([244]);case Fe.true:return pa([245]);case Fe.null:return pa([246]);case Fe.bytes:return e.value.length?void 0:pa([64]);case Fe.string:return e.value===""?pa([96]):void 0;case Fe.array:return e.value===0?pa([128]):void 0;case Fe.map:return e.value===0?pa([160]):void 0;case Fe.uint:return e.value<24?pa([Number(e.value)]):void 0;case Fe.negint:if(e.value>=-24)return pa([31-Number(e.value)])}}i(nM,"quickEncodeToken");a(nM,"quickEncodeToken");var Vj={float64:!1,mapSorter:oM,quickEncodeToken:nM};function iM(){let e=[];return e[Fe.uint.major]=To,e[Fe.negint.major]=_m,e[Fe.bytes.major]=pd,e[Fe.string.major]=jj,e[Fe.array.major]=wm,e[Fe.map.major]=Em,e[Fe.tag.major]=Am,e[Fe.float.major]=xm,e}i(iM,"makeCborEncoders");a(iM,"makeCborEncoders");var sM=iM(),Hy=new S2,B0=i(class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do if(t.obj===e)return!0;while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error(`${dT} object contains circular references`);return new B0(t,e)}},"Ref");a(B0,"Ref");var so={null:new bt(Fe.null,null),undefined:new bt(Fe.undefined,void 0),true:new bt(Fe.true,!0),false:new bt(Fe.false,!1),emptyArray:new bt(Fe.array,0),emptyMap:new bt(Fe.map,0)},ho={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new bt(Fe.float,e):e>=0?new bt(Fe.uint,e):new bt(Fe.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new bt(Fe.uint,e):new bt(Fe.negint,e)},Uint8Array(e,t,r,n){return new bt(Fe.bytes,e)},string(e,t,r,n){return new bt(Fe.string,e)},boolean(e,t,r,n){return e?so.true:so.false},null(e,t,r,n){return so.null},undefined(e,t,r,n){return so.undefined},ArrayBuffer(e,t,r,n){return new bt(Fe.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new bt(Fe.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[so.emptyArray,new bt(Fe.break)]:so.emptyArray;n=B0.createCheck(n,e);let s=[],o=0;for(let c of e)s[o++]=Uf(c,r,n);return r.addBreakTokens?[new bt(Fe.array,e.length),s,new bt(Fe.break)]:[new bt(Fe.array,e.length),s]},Object(e,t,r,n){let s=t!=="Object",o=s?e.keys():Object.keys(e),c=s?e.size:o.length;if(!c)return r.addBreakTokens===!0?[so.emptyMap,new bt(Fe.break)]:so.emptyMap;n=B0.createCheck(n,e);let l=[],h=0;for(let p of o)l[h++]=[Uf(p,r,n),Uf(s?e.get(p):e[p],r,n)];return aM(l,r),r.addBreakTokens?[new bt(Fe.map,c),l,new bt(Fe.break)]:[new bt(Fe.map,c),l]}};ho.Map=ho.Object;ho.Buffer=ho.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ho[`${e}Array`]=ho.DataView;function Uf(e,t={},r){let n=oT(e),s=t&&t.typeEncoders&&t.typeEncoders[n]||ho[n];if(typeof s=="function"){let c=s(e,n,t,r);if(c!=null)return c}let o=ho[n];if(!o)throw new Error(`${dT} unsupported type: ${n}`);return o(e,n,t,r)}i(Uf,"objectToTokens");a(Uf,"objectToTokens");function aM(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(aM,"sortMapEntries");a(aM,"sortMapEntries");function oM(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let s=r.type.major,o=sM[s].compareTokens(r,n);return o===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}i(oM,"mapSorter");a(oM,"mapSorter");function I2(e,t,r,n){if(Array.isArray(t))for(let s of t)I2(e,s,r,n);else r[t.type.major](e,t,n)}i(I2,"tokensToEncoded");a(I2,"tokensToEncoded");function cM(e,t,r){let n=Uf(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let s=r.quickEncodeToken(n);if(s)return s;let o=t[n.type.major];if(o.encodedSize){let c=o.encodedSize(n,r),l=new S2(c);if(o(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return E2(l.chunks[0])}}return Hy.reset(),I2(Hy,n,t,r),Hy.toBytes(!0)}i(cM,"encodeCustom");a(cM,"encodeCustom");function uM(e,t){return t=Object.assign({},Vj,t),cM(e,sM,t)}i(uM,"encode6");a(uM,"encode");var Gj={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},lM=i(class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],t=Ks[e];if(t===void 0){let r=We[e];if(!r)throw new Error(`${Jt} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let n=e&31;t=r(this.data,this.pos,n,this.options)}return this.pos+=t.encodedLength,t}},"Tokeniser");a(lM,"Tokeniser");var Vf=Symbol.for("DONE"),Cm=Symbol.for("BREAK");function fM(e,t,r){let n=[];for(let s=0;s<e.value;s++){let o=Pu(t,r);if(o===Cm){if(e.value===1/0)break;throw new Error(`${Jt} got unexpected break to lengthed array`)}if(o===Vf)throw new Error(`${Jt} found array but not enough entries (got ${s}, expected ${e.value})`);n[s]=o}return n}i(fM,"tokenToArray");a(fM,"tokenToArray");function dM(e,t,r){let n=r.useMaps===!0,s=n?void 0:{},o=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=Pu(t,r);if(l===Cm){if(e.value===1/0)break;throw new Error(`${Jt} got unexpected break to lengthed map`)}if(l===Vf)throw new Error(`${Jt} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${Jt} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&o.has(l)||!n&&l in s))throw new Error(`${Jt} found repeat map key "${l}"`);let h=Pu(t,r);if(h===Vf)throw new Error(`${Jt} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?o.set(l,h):s[l]=h}return n?o:s}i(dM,"tokenToMap");a(dM,"tokenToMap");function Pu(e,t){if(e.done())return Vf;let r=e.next();if(r.type===Fe.break)return Cm;if(r.type.terminal)return r.value;if(r.type===Fe.array)return fM(r,e,t);if(r.type===Fe.map)return dM(r,e,t);if(r.type===Fe.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Pu(e,t);return t.tags[r.value](n)}throw new Error(`${Jt} tag not supported (${r.value})`)}throw new Error("unsupported")}i(Pu,"tokensToObject");a(Pu,"tokensToObject");function hM(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Jt} data to decode must be a Uint8Array`);t=Object.assign({},Gj,t);let r=t.tokenizer||new lM(e,t),n=Pu(r,t);if(n===Vf)throw new Error(`${Jt} did not find any content to decode`);if(n===Cm)throw new Error(`${Jt} got unexpected break`);if(!r.done())throw new Error(`${Jt} too many terminals, data makes no sense`);return n}i(hM,"decode7");a(hM,"decode");zs();var pM=42;function mM(e){if(e.asCID!==e)return null;let t=Ht.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new bt(Fe.tag,pM),new bt(Fe.bytes,r)]}i(mM,"cidEncoder");a(mM,"cidEncoder");function vM(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(vM,"undefinedEncoder");a(vM,"undefinedEncoder");function gM(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}i(gM,"numberEncoder");a(gM,"numberEncoder");var Wj={float64:!0,typeEncoders:{Object:mM,undefined:vM,number:gM}};function yM(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ht.decode(e.subarray(1))}i(yM,"cidDecoder");a(yM,"cidDecoder");var bM={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};bM.tags[pM]=yM;var Zj="dag-cbor",L0=113,Im=a(e=>uM(e,Wj),"encode"),_M=a(e=>hM(e,bM),"decode"),Jj=24;async function wM(e){let t=await bm({value:e,codec:tl,hasher:Ju});return{cid:t.cid,linkedBlock:t.bytes}}i(wM,"encodePayload");a(wM,"encodePayload");function EM(e,t=Jj){let r=(t-e.length%t)%t,n=new Uint8Array(e.length+r);return n.set(e,0),n}i(EM,"pad");a(EM,"pad");async function AM(e){return(await bm({value:e,codec:tl,hasher:fm})).cid}i(AM,"encodeIdentityCID");a(AM,"encodeIdentityCID");function SM(e){if(e=Ht.asCID(e),e.code!==L0)throw new Error("CID codec must be dag-cbor");if(e.multihash.code!==fm.code)throw new Error("CID must use identity multihash");return _M(e.multihash.digest)}i(SM,"decodeIdentityCID");a(SM,"decodeIdentityCID");async function xM(e,t){return EM((await AM(e)).bytes,t)}i(xM,"prepareCleartext");a(xM,"prepareCleartext");function TM(e){return SM(Ht.decodeFirst(e)[0])}i(TM,"decodeCleartext");a(TM,"decodeCleartext");var Yj=Symbol("abortable"),gb=Symbol("aborted");function MM(e,t){if(t.aborted)return Promise.reject(gb);let r,n=new Promise((s,o)=>{r=o});return t.addEventListener("abort",()=>{r(gb)}),Promise.race([e,n])}i(MM,"abortable");a(MM,"abortable");var Xj=a((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((t,r)=>(r&=63,r<36?t+=r.toString(36):r<62?t+=(r-26).toString(36).toUpperCase():r>62?t+="-":t+="_",t),""),"nanoid"),CM="utils_abort_request",Gn;(function(e){e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR"})(Gn||(Gn={}));var IM={[Gn.PARSE_ERROR]:"Parse error",[Gn.INVALID_REQUEST]:"Invalid request",[Gn.METHOD_NOT_FOUND]:"Method not found",[Gn.INVALID_PARAMS]:"Invalid params",[Gn.INTERNAL_ERROR]:"Internal error"};function DM(e){return-32e3>=e&&e>=-32099}i(DM,"isServerError");a(DM,"isServerError");function Dm(e){return IM[e.toString()]??(DM(e)?"Server error":"Application error")}i(Dm,"getErrorMessage");a(Dm,"getErrorMessage");var po=i(class extends Error{static fromObject(e){return new po(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,r){super(),Object.setPrototypeOf(this,po.prototype),this.code=e,this.data=r,this.message=t??Dm(e)}},"RPCError");a(po,"RPCError");function sl(e){let t=IM[e];return a(i(function(n){return new po(e,t,n)},"createError"),"createError")}i(sl,"createErrorFactory");a(sl,"createErrorFactory");var qJ=sl(Gn.PARSE_ERROR),KJ=sl(Gn.INVALID_REQUEST),VJ=sl(Gn.METHOD_NOT_FOUND),GJ=sl(Gn.INVALID_PARAMS),WJ=sl(Gn.INTERNAL_ERROR);function kM(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(kM,"_checkPrivateRedeclaration");a(kM,"_checkPrivateRedeclaration");function OM(e,t){return t.get?t.get.call(e):t.value}i(OM,"_classApplyDescriptorGet");a(OM,"_classApplyDescriptorGet");function RM(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(RM,"_classApplyDescriptorSet");a(RM,"_classApplyDescriptorSet");function D2(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(D2,"_classExtractFieldDescriptor");a(D2,"_classExtractFieldDescriptor");function h0(e,t){var r=D2(e,t,"get");return OM(e,r)}i(h0,"_classPrivateFieldGet");a(h0,"_classPrivateFieldGet");function NM(e,t,r){kM(e,t),t.set(e,r)}i(NM,"_classPrivateFieldInit");a(NM,"_classPrivateFieldInit");function PM(e,t,r){var n=D2(e,t,"set");return RM(e,n,r),r}i(PM,"_classPrivateFieldSet");a(PM,"_classPrivateFieldSet");var Of=new WeakMap,yb=i(class{get connection(){return h0(this,Of)}createID(){return Xj()}request(e,t=void 0,r={}){let{signal:n}=r;if(n?.aborted)return Promise.reject(gb);let s=this.createID(),o=h0(this,Of).send({jsonrpc:"2.0",id:s,method:e,params:t}).then(c=>{if(c==null)throw new Error("Missing response");if(c.error!=null)throw po.fromObject(c.error);return c.result});return n==null?o:(n.addEventListener("abort",()=>{this.notify(CM,{id:s})}),MM(o,n))}async notify(e,t=void 0){await h0(this,Of).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){NM(this,Of,{writable:!0,value:void 0}),PM(this,Of,e)}},"RPCClient");a(yb,"RPCClient");function bb(e,t){return{jsonrpc:"2.0",id:e,error:{code:t,message:Dm(t)}}}i(bb,"createErrorResponse");a(bb,"createErrorResponse");function BM(e,t,r){console.warn("Unhandled handler error",t,r)}i(BM,"fallbackOnHandlerError");a(BM,"fallbackOnHandlerError");function LM(e,t){console.warn("Unhandled invalid message",t)}i(LM,"fallbackOnInvalidMessage");a(LM,"fallbackOnInvalidMessage");function FM(e,t){console.warn("Unhandled notification",t)}i(FM,"fallbackOnNotification");a(FM,"fallbackOnNotification");function UM(e,t={}){let r=t.onHandlerError??BM,n=t.onInvalidMessage??LM,s=t.onNotification??FM,o={};function c(l,h){if(h.method===CM){let p=h.params?.id;p!=null&&o[p]?.abort()}else s(l,h)}return i(c,"handleNotification"),a(c,"handleNotification"),a(i(async function(h,p){let v=p.id;if(p.jsonrpc!=="2.0"||p.method==null)return v==null?(n(h,p),null):bb(v,Gn.INVALID_REQUEST);let b=e[p.method];if(b==null)return v==null?(c(h,p),null):bb(v,Gn.METHOD_NOT_FOUND);try{let y;if(v!=null&&b[Yj]){let C=new AbortController;o[v]=C,y=b(h,p.params,{signal:C.signal})}else y=b(h,p.params,{});let A=y==null?y:typeof y.then=="function"?await y:y;return v==null||o[v]?.signal.aborted?null:{jsonrpc:"2.0",id:v,result:A}}catch(y){if(v==null||o[v]?.signal.aborted)return r(h,p,y),null;let A;if(y instanceof po)A=y.toObject();else{r(h,p,y);let C=y.code??-32e3;A={code:C,message:y.message||Dm(C)}}return{jsonrpc:"2.0",id:v,error:A}}finally{v!=null&&delete o[v]}},"handleRequest"),"handleRequest")}i(UM,"createHandler");a(UM,"createHandler");zs();var Qj=rr(q$(),1),On=rr(el(),1),ez=`
|
|
675
|
+
sign-in-with-ethereum =
|
|
676
|
+
domain %s" wants you to sign in with your Ethereum account:" LF
|
|
677
|
+
address LF
|
|
678
|
+
LF
|
|
679
|
+
[ statement LF ]
|
|
680
|
+
LF
|
|
681
|
+
%s"URI: " URI LF
|
|
682
|
+
%s"Version: " version LF
|
|
683
|
+
%s"Chain ID: " chain-id LF
|
|
684
|
+
%s"Nonce: " nonce LF
|
|
685
|
+
%s"Issued At: " issued-at
|
|
686
|
+
[ LF %s"Expiration Time: " expiration-time ]
|
|
687
|
+
[ LF %s"Not Before: " not-before ]
|
|
688
|
+
[ LF %s"Request ID: " request-id ]
|
|
689
|
+
[ LF %s"Resources:"
|
|
690
|
+
resources ]
|
|
691
|
+
|
|
692
|
+
domain = dnsauthority
|
|
693
|
+
|
|
694
|
+
address = "0x" 40*40HEXDIG
|
|
695
|
+
; Must also conform to captilization
|
|
696
|
+
; checksum encoding specified in EIP-55
|
|
697
|
+
; where applicable (EOAs).
|
|
698
|
+
|
|
699
|
+
statement = *( reserved / unreserved / " " )
|
|
700
|
+
; The purpose is to exclude LF (line breaks).
|
|
701
|
+
|
|
702
|
+
version = "1"
|
|
703
|
+
|
|
704
|
+
nonce = 8*( ALPHA / DIGIT )
|
|
705
|
+
|
|
706
|
+
issued-at = date-time
|
|
707
|
+
expiration-time = date-time
|
|
708
|
+
not-before = date-time
|
|
709
|
+
|
|
710
|
+
request-id = *pchar
|
|
711
|
+
|
|
712
|
+
chain-id = 1*DIGIT
|
|
713
|
+
; See EIP-155 for valid CHAIN_IDs.
|
|
714
|
+
|
|
715
|
+
resources = *( LF resource )
|
|
716
|
+
|
|
717
|
+
resource = "- " URI
|
|
718
|
+
|
|
719
|
+
; ------------------------------------------------------------------------------
|
|
720
|
+
; RFC 3986
|
|
721
|
+
|
|
722
|
+
URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
|
|
723
|
+
|
|
724
|
+
hier-part = "//" authority path-abempty
|
|
725
|
+
/ path-absolute
|
|
726
|
+
/ path-rootless
|
|
727
|
+
/ path-empty
|
|
728
|
+
|
|
729
|
+
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
|
|
730
|
+
|
|
731
|
+
authority = [ userinfo "@" ] host [ ":" port ]
|
|
732
|
+
userinfo = *( unreserved / pct-encoded / sub-delims / ":" )
|
|
733
|
+
host = IP-literal / IPv4address / reg-name
|
|
734
|
+
port = *DIGIT
|
|
735
|
+
|
|
736
|
+
IP-literal = "[" ( IPv6address / IPvFuture ) "]"
|
|
737
|
+
|
|
738
|
+
IPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )
|
|
739
|
+
|
|
740
|
+
IPv6address = 6( h16 ":" ) ls32
|
|
741
|
+
/ "::" 5( h16 ":" ) ls32
|
|
742
|
+
/ [ h16 ] "::" 4( h16 ":" ) ls32
|
|
743
|
+
/ [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
|
|
744
|
+
/ [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
|
|
745
|
+
/ [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
|
|
746
|
+
/ [ *4( h16 ":" ) h16 ] "::" ls32
|
|
747
|
+
/ [ *5( h16 ":" ) h16 ] "::" h16
|
|
748
|
+
/ [ *6( h16 ":" ) h16 ] "::"
|
|
749
|
+
|
|
750
|
+
h16 = 1*4HEXDIG
|
|
751
|
+
ls32 = ( h16 ":" h16 ) / IPv4address
|
|
752
|
+
IPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet
|
|
753
|
+
dec-octet = DIGIT ; 0-9
|
|
754
|
+
/ %x31-39 DIGIT ; 10-99
|
|
755
|
+
/ "1" 2DIGIT ; 100-199
|
|
756
|
+
/ "2" %x30-34 DIGIT ; 200-249
|
|
757
|
+
/ "25" %x30-35 ; 250-255
|
|
758
|
+
|
|
759
|
+
reg-name = *( unreserved / pct-encoded / sub-delims )
|
|
760
|
+
|
|
761
|
+
path-abempty = *( "/" segment )
|
|
762
|
+
path-absolute = "/" [ segment-nz *( "/" segment ) ]
|
|
763
|
+
path-rootless = segment-nz *( "/" segment )
|
|
764
|
+
path-empty = 0pchar
|
|
765
|
+
|
|
766
|
+
segment = *pchar
|
|
767
|
+
segment-nz = 1*pchar
|
|
768
|
+
|
|
769
|
+
pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
|
|
770
|
+
|
|
771
|
+
query = *( pchar / "/" / "?" )
|
|
772
|
+
|
|
773
|
+
fragment = *( pchar / "/" / "?" )
|
|
774
|
+
|
|
775
|
+
pct-encoded = "%" HEXDIG HEXDIG
|
|
776
|
+
|
|
777
|
+
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
|
|
778
|
+
reserved = gen-delims / sub-delims
|
|
779
|
+
gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"
|
|
780
|
+
sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
781
|
+
/ "*" / "+" / "," / ";" / "="
|
|
782
|
+
|
|
783
|
+
; ------------------------------------------------------------------------------
|
|
784
|
+
; RFC 4501
|
|
785
|
+
|
|
786
|
+
dnsauthority = host [ ":" port ]
|
|
787
|
+
; See RFC 3986 for the
|
|
788
|
+
; definition of "host" and "port".
|
|
789
|
+
|
|
790
|
+
; ------------------------------------------------------------------------------
|
|
791
|
+
; RFC 3339
|
|
792
|
+
|
|
793
|
+
date-fullyear = 4DIGIT
|
|
794
|
+
date-month = 2DIGIT ; 01-12
|
|
795
|
+
date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
|
|
796
|
+
; month/year
|
|
797
|
+
time-hour = 2DIGIT ; 00-23
|
|
798
|
+
time-minute = 2DIGIT ; 00-59
|
|
799
|
+
time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
|
|
800
|
+
; rules
|
|
801
|
+
time-secfrac = "." 1*DIGIT
|
|
802
|
+
time-numoffset = ("+" / "-") time-hour ":" time-minute
|
|
803
|
+
time-offset = "Z" / time-numoffset
|
|
804
|
+
|
|
805
|
+
partial-time = time-hour ":" time-minute ":" time-second
|
|
806
|
+
[time-secfrac]
|
|
807
|
+
full-date = date-fullyear "-" date-month "-" date-mday
|
|
808
|
+
full-time = partial-time time-offset
|
|
809
|
+
|
|
810
|
+
date-time = full-date "T" full-time
|
|
811
|
+
|
|
812
|
+
; ------------------------------------------------------------------------------
|
|
813
|
+
; RFC 5234
|
|
814
|
+
|
|
815
|
+
ALPHA = %x41-5A / %x61-7A ; A-Z / a-z
|
|
816
|
+
LF = %x0A
|
|
817
|
+
; linefeed
|
|
818
|
+
DIGIT = %x30-39
|
|
819
|
+
; 0-9
|
|
820
|
+
HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
|
|
821
|
+
`,$M=i(class{constructor(e){let t=new Qj.default(ez);if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");let r=t.toObject(),n=new On.default.parser;n.ast=new On.default.ast;let s=On.default.ids,o=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.domain=On.default.utils.charsToString(j,V,G)),H},"domain");n.ast.callbacks.domain=o;let c=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.address=On.default.utils.charsToString(j,V,G)),H},"address");n.ast.callbacks.address=c;let l=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.statement=On.default.utils.charsToString(j,V,G)),H},"statement");n.ast.callbacks.statement=l;let h=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.uri||(k.uri=On.default.utils.charsToString(j,V,G))),H},"uri");n.ast.callbacks.uri=h;let p=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.version=On.default.utils.charsToString(j,V,G)),H},"version");n.ast.callbacks.version=p;let v=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.chainId=On.default.utils.charsToString(j,V,G)),H},"chainId");n.ast.callbacks["chain-id"]=v;let b=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.nonce=On.default.utils.charsToString(j,V,G)),H},"nonce");n.ast.callbacks.nonce=b;let y=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.issuedAt=On.default.utils.charsToString(j,V,G)),H},"issuedAt");n.ast.callbacks["issued-at"]=y;let A=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.expirationTime=On.default.utils.charsToString(j,V,G)),H},"expirationTime");n.ast.callbacks["expiration-time"]=A;let C=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.notBefore=On.default.utils.charsToString(j,V,G)),H},"notBefore");n.ast.callbacks["not-before"]=C;let O=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.requestId=On.default.utils.charsToString(j,V,G)),H},"requestId");n.ast.callbacks["request-id"]=O;let R=a(function($,j,V,G,k){let H=s.SEM_OK;return $===s.SEM_PRE&&(k.resources=On.default.utils.charsToString(j,V,G).slice(3).split(`
|
|
822
|
+
- `)),H},"resources");n.ast.callbacks.resources=R;let L=n.parse(r,"sign-in-with-ethereum",e);if(!L.success)throw new Error(`Invalid message: ${JSON.stringify(L)}`);let K={};n.ast.translate(K);for(let[$,j]of Object.entries(K))this[$]=j}},"ParsedMessage");a($M,"ParsedMessage");function F0(){return F0=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},F0.apply(this,arguments)}i(F0,"_extends");a(F0,"_extends");var k2={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},tz={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}},O2={name:"assetName",regex:"[-:a-zA-Z0-9]{5,73}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,64}"}}}},rz={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:k2,1:O2}}},nz={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:k2,1:O2,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},vd={2:k2,10:tz,19:{assetName:O2,assetType:rz,assetId:nz}};function R2(e,t){return e.split(t.parameters.delimiter)}i(R2,"splitParams");a(R2,"splitParams");function al(e,t){var r=R2(e,t),n={};return r.forEach(function(s,o){n[t.parameters.values[o].name]=s}),n}i(al,"getParams");a(al,"getParams");function Dc(e,t){return Object.values(t.parameters.values).map(function(r){var n=e[r.name];return typeof n=="string"?n:Dc(n,r)}).join(t.parameters.delimiter)}i(Dc,"joinParams");a(Dc,"joinParams");function ol(e,t){if(!new RegExp(t.regex).test(e))return!1;var r=R2(e,t);if(r.length!==Object.keys(t.parameters.values).length)return!1;var n=r.map(function(s,o){return new RegExp(t.parameters.values[o].regex).test(s)}).filter(function(s){return!!s});return n.length===r.length}i(ol,"isValidId");a(ol,"isValidId");var mc=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"ChainId2"),a(e,"ChainId"),e.parse=a(i(function(n){if(!ol(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(al(n,this.spec)).toJSON()},"parse2"),"parse"),e.format=a(i(function(n){return Dc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=a(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=a(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();mc.spec=vd[2];var Gf=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new mc(r.chainId),this.address=r.address}i(e,"AccountId2"),a(e,"AccountId"),e.parse=a(i(function(n){if(!ol(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var s=al(n,this.spec),o=s.namespace,c=s.reference,l=s.address,h=new mc({namespace:o,reference:c});return new e({chainId:h,address:l}).toJSON()},"parse2"),"parse"),e.format=a(i(function(n){var s=new mc(n.chainId),o=F0({},s.toJSON(),{address:n.address});return Dc(o,this.spec)},"format"),"format");var t=e.prototype;return t.toString=a(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=a(i(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON2"),"toJSON"),e}();Gf.spec=vd[10];var N2=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"AssetName2"),a(e,"AssetName"),e.parse=a(i(function(n){if(!ol(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(al(n,this.spec)).toJSON()},"parse2"),"parse"),e.format=a(i(function(n){return Dc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=a(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=a(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();N2.spec=vd[19].assetName;var iz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new mc(r.chainId),this.assetName=new N2(r.assetName)}i(e,"AssetType2"),a(e,"AssetType"),e.parse=a(i(function(n){if(!ol(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(al(n,this.spec)).toJSON()},"parse2"),"parse"),e.format=a(i(function(n){return Dc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=a(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=a(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON2"),"toJSON"),e}();iz.spec=vd[19].assetType;var sz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new mc(r.chainId),this.assetName=new N2(r.assetName),this.tokenId=r.tokenId}i(e,"AssetId2"),a(e,"AssetId"),e.parse=a(i(function(n){if(!ol(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(al(n,this.spec)).toJSON()},"parse2"),"parse"),e.format=a(i(function(n){return Dc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=a(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=a(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON2"),"toJSON"),e}();sz.spec=vd[19].assetId;var $A;(function(e){e.INVALID_SIGNATURE="Invalid signature.",e.EXPIRED_MESSAGE="Expired message.",e.MALFORMED_SESSION="Malformed session."})($A||($A={}));var U0;(function(e){e.PERSONAL_SIGNATURE="Personal signature"})(U0||(U0={}));var jM=i(class{static fromCacao(e){let t=Gf.parse(e.p.iss.replace("did:pkh:","")),r=new this({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new mc(t.chainId).reference});return e.p.statement&&(r.statement=e.p.statement),e.p.nonce&&(r.nonce=e.p.nonce),e.p.iat&&(r.issuedAt=e.p.iat),e.p.exp&&(r.expirationTime=e.p.exp),e.p.nbf&&(r.notBefore=e.p.nbf),e.p.requestId&&(r.requestId=e.p.requestId),e.p.resources&&(r.resources=e.p.resources),e.s&&(e.s.s&&(r.signature=e.s.s),e.s.t==="eip191"&&(r.type=U0.PERSONAL_SIGNATURE)),r}toMessage(e){return HM(this,e)}constructor(e){if(this.statement=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.resources=void 0,this.signature=void 0,typeof e=="string"){let t=new $M(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}},"SiwxMessage");a(jM,"SiwxMessage");function zM(e,t){let r=`${e.domain} wants you to sign in with your ${t} account:`,n=`URI: ${e.uri}`,s=[r,e.address].join(`
|
|
823
|
+
`),o=`Version: ${e.version}`;e.nonce||(e.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${e.nonce}`,l=[n,o,c];if(e.issuedAt&&Date.parse(e.issuedAt),e.issuedAt=e.issuedAt?e.issuedAt:new Date().toISOString(),l.push(`Issued At: ${e.issuedAt}`),e.expirationTime){let p=`Expiration Time: ${e.expirationTime}`;l.push(p)}e.notBefore&&l.push(`Not Before: ${e.notBefore}`),e.requestId&&l.push(`Request ID: ${e.requestId}`),e.chainId&&l.push(`Chain ID: ${e.chainId}`),e.resources&&l.push(["Resources:",...e.resources.map(p=>`- ${p}`)].join(`
|
|
824
|
+
`));let h=l.join(`
|
|
825
|
+
`);return e.statement&&(s=[s,e.statement].join(`
|
|
826
|
+
|
|
827
|
+
`)),[s,h].join(`
|
|
828
|
+
|
|
829
|
+
`)}i(zM,"asLegacyChainIdString");a(zM,"asLegacyChainIdString");function HM(e,t){let r=`${e.domain} wants you to sign in with your ${t} account:`,n=`URI: ${e.uri}`,s=[r,e.address].join(`
|
|
830
|
+
`),o=`Version: ${e.version}`;e.nonce||(e.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${e.nonce}`,l=`Chain ID: ${e.chainId}`,h=[n,o,l,c];if(e.issuedAt&&Date.parse(e.issuedAt),e.issuedAt=e.issuedAt?e.issuedAt:new Date().toISOString(),h.push(`Issued At: ${e.issuedAt}`),e.expirationTime){let v=`Expiration Time: ${e.expirationTime}`;h.push(v)}e.notBefore&&h.push(`Not Before: ${e.notBefore}`),e.requestId&&h.push(`Request ID: ${e.requestId}`),e.resources&&e.resources.length>=1&&h.push(["Resources:",...e.resources.map(v=>`- ${v}`)].join(`
|
|
831
|
+
`));let p=h.join(`
|
|
832
|
+
`);return e.statement&&(s=[s,e.statement].join(`
|
|
833
|
+
|
|
834
|
+
`)),[s,p].join(`
|
|
835
|
+
|
|
836
|
+
`)}i(HM,"asString");a(HM,"asString");var _b=i(class extends jM{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case U0.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}},"SiweMessage");a(_b,"SiweMessage");lm();var az=5*60,ZJ=new Date("2022-09-20").valueOf(),$0;(function(e){function t(l){let h={h:{t:"eip4361"},p:{domain:l.domain,iat:l.issuedAt,iss:`did:pkh:eip155:${l.chainId}:${l.address}`,aud:l.uri,version:l.version,nonce:l.nonce}};return l.signature&&(h.s={t:"eip191",s:l.signature}),l.notBefore&&(h.p.nbf=l.notBefore),l.expirationTime&&(h.p.exp=l.expirationTime),l.statement&&(h.p.statement=l.statement),l.requestId&&(h.p.requestId=l.requestId),l.resources&&(h.p.resources=l.resources),h}i(t,"fromSiweMessage"),a(t,"fromSiweMessage"),e.fromSiweMessage=t;function r(l){let h={h:{t:"caip122"},p:{domain:l.domain,iat:l.issuedAt,iss:`did:pkh:solana:${l.chainId}:${l.address}`,aud:l.uri,version:l.version,nonce:l.nonce}};return l.signature&&(h.s={t:"solana:ed25519",s:l.signature}),l.notBefore&&(h.p.nbf=l.notBefore),l.expirationTime&&(h.p.exp=l.expirationTime),l.statement&&(h.p.statement=l.statement),l.requestId&&(h.p.requestId=l.requestId),l.resources&&(h.p.resources=l.resources),h}i(r,"fromSiwsMessage"),a(r,"fromSiwsMessage"),e.fromSiwsMessage=r;function n(l){let h={h:{t:"caip122"},p:{domain:l.domain,iat:l.issuedAt,iss:`did:pkh:tezos:${l.chainId}:${l.address}`,aud:l.uri,version:l.version,nonce:l.nonce}};return l.signature&&(h.s={t:"tezos:ed25519",s:l.signature}),l.notBefore&&(h.p.nbf=l.notBefore),l.expirationTime&&(h.p.exp=l.expirationTime),l.statement&&(h.p.statement=l.statement),l.requestId&&(h.p.requestId=l.requestId),l.resources&&(h.p.resources=l.resources),h}i(n,"fromSiwTezosMessage"),a(n,"fromSiwTezosMessage"),e.fromSiwTezosMessage=n;function s(l){let h={h:{t:"caip122"},p:{domain:l.domain,iat:l.issuedAt,iss:`did:pkh:stacks:${l.chainId}:${l.address}`,aud:l.uri,version:l.version,nonce:l.nonce}};return l.signature&&(h.s={t:"stacks:secp256k1",s:l.signature}),l.notBefore&&(h.p.nbf=l.notBefore),l.expirationTime&&(h.p.exp=l.expirationTime),l.statement&&(h.p.statement=l.statement),l.requestId&&(h.p.requestId=l.requestId),l.resources&&(h.p.resources=l.resources),h}i(s,"fromSiwStacksMessage"),a(s,"fromSiwStacksMessage"),e.fromSiwStacksMessage=s;async function o(l){return(await kj({bytes:l,codec:tl,hasher:Ju})).value}i(o,"fromBlockBytes"),a(o,"fromBlockBytes"),e.fromBlockBytes=o;async function c(l,h={}){P2(l);let p=h.verifiers[l.s.t];if(!p)throw new Error("Unsupported CACAO signature type, register the needed verifier");return p(l,h)}i(c,"verify4"),a(c,"verify"),e.verify=c})($0||($0={}));var j0;(function(e){function t(r){return bm({value:r,codec:tl,hasher:Ju})}i(t,"fromCacao"),a(t,"fromCacao"),e.fromCacao=t})(j0||(j0={}));function P2(e){if(e.s===null||e.s===void 0)throw new Error("CACAO does not have a signature")}i(P2,"assertSigned");a(P2,"assertSigned");function qM(e,t){let r=t.atTime?t.atTime.getTime():Date.now(),n=(t.clockSkewSecs??az)*1e3;if(Date.parse(e.p.iat)>r+n||Date.parse(e.p.nbf)>r+n)throw new Error("CACAO is not valid yet");let s=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0;if(!t.disableExpirationCheck&&Date.parse(e.p.exp)+s+n<r)throw new Error("CACAO has expired")}i(qM,"verifyTimeChecks");a(qM,"verifyTimeChecks");var oz="logger/5.7.0",jA=!1,zA=!1,p0={debug:1,default:2,info:2,warning:3,error:4,off:5},HA=p0.default,qy=null;function KM(){try{let e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}i(KM,"_checkNormalize");a(KM,"_checkNormalize");var qA=KM(),wb;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(wb||(wb={}));var os;(function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"})(os||(os={}));var KA="0123456789abcdef",gr=i(class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();p0[r]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(HA>p0[r])&&console.log.apply(console,t)}debug(...e){this._log(gr.levels.DEBUG,e)}info(...e){this._log(gr.levels.INFO,e)}warn(...e){this._log(gr.levels.WARNING,e)}makeError(e,t,r){if(zA)return this.makeError("censored error",t,{});t||(t=gr.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(l=>{let h=r[l];try{if(h instanceof Uint8Array){let p="";for(let v=0;v<h.length;v++)p+=KA[h[v]>>4],p+=KA[h[v]&15];n.push(l+"=Uint8Array(0x"+p+")")}else n.push(l+"="+JSON.stringify(h))}catch{n.push(l+"="+JSON.stringify(r[l].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);let s=e,o="";switch(t){case os.NUMERIC_FAULT:{o="NUMERIC_FAULT";let l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":o+="-"+l;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result";break}break}case os.CALL_EXCEPTION:case os.INSUFFICIENT_FUNDS:case os.MISSING_NEW:case os.NONCE_EXPIRED:case os.REPLACEMENT_UNDERPRICED:case os.TRANSACTION_REPLACED:case os.UNPREDICTABLE_GAS_LIMIT:o=t;break}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let c=new Error(e);return c.reason=s,c.code=t,Object.keys(r).forEach(function(l){c[l]=r[l]}),c}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,gr.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),qA&&this.throwError("platform missing String.prototype.normalize",gr.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:qA})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,gr.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r?r=": "+r:r="",e<t&&this.throwError("missing argument"+r,gr.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,gr.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",gr.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",gr.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return qy||(qy=new gr(oz)),qy}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),jA){if(!e)return;this.globalLogger().throwError("error censorship permanent",gr.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}zA=!!e,jA=!!t}static setLogLevel(e){let t=p0[e.toLowerCase()];if(t==null){gr.globalLogger().warn("invalid log level - "+e);return}HA=t}static from(e){return new gr(e)}},"Logger");a(gr,"Logger");gr.errors=os;gr.levels=wb;var cz="bytes/5.7.0",$r=new gr(cz);function B2(e){return!!e.toHexString}i(B2,"isHexable");a(B2,"isHexable");function vc(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return vc(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}i(vc,"addSlice");a(vc,"addSlice");function VM(e){return ls(e)&&!(e.length%2)||km(e)}i(VM,"isBytesLike");a(VM,"isBytesLike");function Eb(e){return typeof e=="number"&&e==e&&e%1===0}i(Eb,"isInteger");a(Eb,"isInteger");function km(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!Eb(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let r=e[t];if(!Eb(r)||r<0||r>=256)return!1}return!0}i(km,"isBytes");a(km,"isBytes");function zr(e,t){if(t||(t={}),typeof e=="number"){$r.checkSafeUint53(e,"invalid arrayify value");let r=[];for(;e;)r.unshift(e&255),e=parseInt(String(e/256));return r.length===0&&r.push(0),vc(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),B2(e)&&(e=e.toHexString()),ls(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":$r.throwArgumentError("hex data is odd-length","value",e));let n=[];for(let s=0;s<r.length;s+=2)n.push(parseInt(r.substring(s,s+2),16));return vc(new Uint8Array(n))}return km(e)?vc(new Uint8Array(e)):$r.throwArgumentError("invalid arrayify value","value",e)}i(zr,"arrayify");a(zr,"arrayify");function GM(e){let t=e.map(s=>zr(s)),r=t.reduce((s,o)=>s+o.length,0),n=new Uint8Array(r);return t.reduce((s,o)=>(n.set(o,s),s+o.length),0),vc(n)}i(GM,"concat3");a(GM,"concat");function WM(e,t){e=zr(e),e.length>t&&$r.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),vc(r)}i(WM,"zeroPad");a(WM,"zeroPad");function ls(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}i(ls,"isHexString");a(ls,"isHexString");var Ky="0123456789abcdef";function Rn(e,t){if(t||(t={}),typeof e=="number"){$r.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=Ky[e&15]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof e=="bigint")return e=e.toString(16),e.length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),B2(e))return e.toHexString();if(ls(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":$r.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(km(e)){let r="0x";for(let n=0;n<e.length;n++){let s=e[n];r+=Ky[(s&240)>>4]+Ky[s&15]}return r}return $r.throwArgumentError("invalid hexlify value","value",e)}i(Rn,"hexlify");a(Rn,"hexlify");function ZM(e){if(typeof e!="string")e=Rn(e);else if(!ls(e)||e.length%2)return null;return(e.length-2)/2}i(ZM,"hexDataLength");a(ZM,"hexDataLength");function Ab(e,t,r){return typeof e!="string"?e=Rn(e):(!ls(e)||e.length%2)&&$r.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}i(Ab,"hexDataSlice");a(Ab,"hexDataSlice");function gc(e,t){for(typeof e!="string"?e=Rn(e):ls(e)||$r.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&$r.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}i(gc,"hexZeroPad");a(gc,"hexZeroPad");function L2(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(VM(e)){let r=zr(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Rn(r.slice(0,32)),t.s=Rn(r.slice(32,64))):r.length===65?(t.r=Rn(r.slice(0,32)),t.s=Rn(r.slice(32,64)),t.v=r[64]):$r.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:$r.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Rn(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,t._vs!=null){let s=WM(zr(t._vs),32);t._vs=Rn(s);let o=s[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=o:t.recoveryParam!==o&&$r.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),s[0]&=127;let c=Rn(s);t.s==null?t.s=c:t.s!==c&&$r.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?$r.throwArgumentError("signature missing v and recoveryParam","signature",e):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{let s=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==s&&$r.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!ls(t.r)?$r.throwArgumentError("signature missing or invalid r","signature",e):t.r=gc(t.r,32),t.s==null||!ls(t.s)?$r.throwArgumentError("signature missing or invalid s","signature",e):t.s=gc(t.s,32);let r=zr(t.s);r[0]>=128&&$r.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let n=Rn(r);t._vs&&(ls(t._vs)||$r.throwArgumentError("signature invalid _vs","signature",e),t._vs=gc(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&$r.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}i(L2,"splitSignature");a(L2,"splitSignature");var uz=rr(kx()),lz="bignumber/5.7.0",fz=uz.default.BN,JJ=new gr(lz);function JM(e){return new fz(e,36).toString(16)}i(JM,"_base36To16");a(JM,"_base36To16");var dz=rr(yx());function Om(e){return"0x"+dz.default.keccak_256(zr(e))}i(Om,"keccak256");a(Om,"keccak256");var hz="address/5.7.0",Bf=new gr(hz);function Sb(e){ls(e,20)||Bf.throwArgumentError("invalid address","address",e),e=e.toLowerCase();let t=e.substring(2).split(""),r=new Uint8Array(40);for(let s=0;s<40;s++)r[s]=t[s].charCodeAt(0);let n=zr(Om(r));for(let s=0;s<40;s+=2)n[s>>1]>>4>=8&&(t[s]=t[s].toUpperCase()),(n[s>>1]&15)>=8&&(t[s+1]=t[s+1].toUpperCase());return"0x"+t.join("")}i(Sb,"getChecksumAddress");a(Sb,"getChecksumAddress");var pz=9007199254740991;function YM(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}i(YM,"log10");a(YM,"log10");var F2={};for(let e=0;e<10;e++)F2[String(e)]=String(e);for(let e=0;e<26;e++)F2[String.fromCharCode(65+e)]=String(10+e);var VA=Math.floor(YM(pz));function XM(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>F2[n]).join("");for(;t.length>=VA;){let n=t.substring(0,VA);t=parseInt(n,10)%97+t.substring(n.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}i(XM,"ibanChecksum");a(XM,"ibanChecksum");function QM(e){let t=null;if(typeof e!="string"&&Bf.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=Sb(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Bf.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==XM(e)&&Bf.throwArgumentError("bad icap checksum","address",e),t=JM(e.substring(4));t.length<40;)t="0"+t;t=Sb("0x"+t)}else Bf.throwArgumentError("invalid address","address",e);return t}i(QM,"getAddress");a(QM,"getAddress");var mz="properties/5.7.0",YJ=new gr(mz);function Mu(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}i(Mu,"defineReadOnly");a(Mu,"defineReadOnly");var vz="strings/5.7.0",eC=new gr(vz),z0;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(z0||(z0={}));var Du;(function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"})(Du||(Du={}));function tC(e,t,r,n,s){return eC.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}i(tC,"errorFunc");a(tC,"errorFunc");function U2(e,t,r,n,s){if(e===Du.BAD_PREFIX||e===Du.UNEXPECTED_CONTINUE){let o=0;for(let c=t+1;c<r.length&&r[c]>>6===2;c++)o++;return o}return e===Du.OVERRUN?r.length-t-1:0}i(U2,"ignoreFunc");a(U2,"ignoreFunc");function rC(e,t,r,n,s){return e===Du.OVERLONG?(n.push(s),0):(n.push(65533),U2(e,t,r,n,s))}i(rC,"replaceFunc");a(rC,"replaceFunc");var XJ=Object.freeze({error:tC,ignore:U2,replace:rC});function m0(e,t=z0.current){t!=z0.current&&(eC.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){let s=e.charCodeAt(n);if(s<128)r.push(s);else if(s<2048)r.push(s>>6|192),r.push(s&63|128);else if((s&64512)==55296){n++;let o=e.charCodeAt(n);if(n>=e.length||(o&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((s&1023)<<10)+(o&1023);r.push(c>>18|240),r.push(c>>12&63|128),r.push(c>>6&63|128),r.push(c&63|128)}else r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128)}return zr(r)}i(m0,"toUtf8Bytes");a(m0,"toUtf8Bytes");var gz=`Ethereum Signed Message:
|
|
837
|
+
`;function nC(e){return typeof e=="string"&&(e=m0(e)),Om(GM([m0(gz),m0(String(e.length)),e]))}i(nC,"hashMessage");a(nC,"hashMessage");var Bt=rr(kx()),va=rr(pm());function kc(e,t,r){return r={path:t,exports:{},require:function(n,s){return iC(n,s??r.path)}},e(r,r.exports),r.exports}i(kc,"createCommonjsModule");a(kc,"createCommonjsModule");function iC(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}i(iC,"commonjsRequire");a(iC,"commonjsRequire");var $2=j2;function j2(e,t){if(!e)throw new Error(t||"Assertion failed")}i(j2,"assert");a(j2,"assert");j2.equal=a(i(function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)},"assertEqual"),"assertEqual");var us=kc(function(e,t){"use strict";var r=t;function n(c,l){if(Array.isArray(c))return c.slice();if(!c)return[];var h=[];if(typeof c!="string"){for(var p=0;p<c.length;p++)h[p]=c[p]|0;return h}if(l==="hex"){c=c.replace(/[^a-z0-9]+/ig,""),c.length%2!==0&&(c="0"+c);for(var p=0;p<c.length;p+=2)h.push(parseInt(c[p]+c[p+1],16))}else for(var p=0;p<c.length;p++){var v=c.charCodeAt(p),b=v>>8,y=v&255;b?h.push(b,y):h.push(y)}return h}i(n,"toArray"),a(n,"toArray"),r.toArray=n;function s(c){return c.length===1?"0"+c:c}i(s,"zero2"),a(s,"zero2"),r.zero2=s;function o(c){for(var l="",h=0;h<c.length;h++)l+=s(c[h].toString(16));return l}i(o,"toHex"),a(o,"toHex"),r.toHex=o,r.encode=a(i(function(l,h){return h==="hex"?o(l):l},"encode9"),"encode")}),bi=kc(function(e,t){"use strict";var r=t;r.assert=$2,r.toArray=us.toArray,r.zero2=us.zero2,r.toHex=us.toHex,r.encode=us.encode;function n(h,p,v){var b=new Array(Math.max(h.bitLength(),v)+1);b.fill(0);for(var y=1<<p+1,A=h.clone(),C=0;C<b.length;C++){var O,R=A.andln(y-1);A.isOdd()?(R>(y>>1)-1?O=(y>>1)-R:O=R,A.isubn(O)):O=0,b[C]=O,A.iushrn(1)}return b}i(n,"getNAF2"),a(n,"getNAF"),r.getNAF=n;function s(h,p){var v=[[],[]];h=h.clone(),p=p.clone();for(var b=0,y=0,A;h.cmpn(-b)>0||p.cmpn(-y)>0;){var C=h.andln(3)+b&3,O=p.andln(3)+y&3;C===3&&(C=-1),O===3&&(O=-1);var R;(C&1)===0?R=0:(A=h.andln(7)+b&7,(A===3||A===5)&&O===2?R=-C:R=C),v[0].push(R);var L;(O&1)===0?L=0:(A=p.andln(7)+y&7,(A===3||A===5)&&C===2?L=-O:L=O),v[1].push(L),2*b===R+1&&(b=1-b),2*y===L+1&&(y=1-y),h.iushrn(1),p.iushrn(1)}return v}i(s,"getJSF2"),a(s,"getJSF"),r.getJSF=s;function o(h,p,v){var b="_"+p;h.prototype[p]=a(i(function(){return this[b]!==void 0?this[b]:this[b]=v.call(this)},"cachedProperty2"),"cachedProperty")}i(o,"cachedProperty"),a(o,"cachedProperty"),r.cachedProperty=o;function c(h){return typeof h=="string"?r.toArray(h,"hex"):h}i(c,"parseBytes"),a(c,"parseBytes"),r.parseBytes=c;function l(h){return new Bt.default(h,"hex","le")}i(l,"intFromLE"),a(l,"intFromLE"),r.intFromLE=l}),H0=bi.getNAF,yz=bi.getJSF,q0=bi.assert;function xa(e,t){this.type=e,this.p=new Bt.default(t.p,16),this.red=t.prime?Bt.default.red(t.prime):Bt.default.mont(this.p),this.zero=new Bt.default(0).toRed(this.red),this.one=new Bt.default(1).toRed(this.red),this.two=new Bt.default(2).toRed(this.red),this.n=t.n&&new Bt.default(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}i(xa,"BaseCurve");a(xa,"BaseCurve");var Oc=xa;xa.prototype.point=a(i(function(){throw new Error("Not implemented")},"point"),"point");xa.prototype.validate=a(i(function(){throw new Error("Not implemented")},"validate"),"validate");xa.prototype._fixedNafMul=a(i(function(t,r){q0(t.precomputed);var n=t._getDoubles(),s=H0(r,1,this._bitLength),o=(1<<n.step+1)-(n.step%2===0?2:1);o/=3;var c=[],l,h;for(l=0;l<s.length;l+=n.step){h=0;for(var p=l+n.step-1;p>=l;p--)h=(h<<1)+s[p];c.push(h)}for(var v=this.jpoint(null,null,null),b=this.jpoint(null,null,null),y=o;y>0;y--){for(l=0;l<c.length;l++)h=c[l],h===y?b=b.mixedAdd(n.points[l]):h===-y&&(b=b.mixedAdd(n.points[l].neg()));v=v.add(b)}return v.toP()},"_fixedNafMul"),"_fixedNafMul");xa.prototype._wnafMul=a(i(function(t,r){var n=4,s=t._getNAFPoints(n);n=s.wnd;for(var o=s.points,c=H0(r,n,this._bitLength),l=this.jpoint(null,null,null),h=c.length-1;h>=0;h--){for(var p=0;h>=0&&c[h]===0;h--)p++;if(h>=0&&p++,l=l.dblp(p),h<0)break;var v=c[h];q0(v!==0),t.type==="affine"?v>0?l=l.mixedAdd(o[v-1>>1]):l=l.mixedAdd(o[-v-1>>1].neg()):v>0?l=l.add(o[v-1>>1]):l=l.add(o[-v-1>>1].neg())}return t.type==="affine"?l.toP():l},"_wnafMul"),"_wnafMul");xa.prototype._wnafMulAdd=a(i(function(t,r,n,s,o){var c=this._wnafT1,l=this._wnafT2,h=this._wnafT3,p=0,v,b,y;for(v=0;v<s;v++){y=r[v];var A=y._getNAFPoints(t);c[v]=A.wnd,l[v]=A.points}for(v=s-1;v>=1;v-=2){var C=v-1,O=v;if(c[C]!==1||c[O]!==1){h[C]=H0(n[C],c[C],this._bitLength),h[O]=H0(n[O],c[O],this._bitLength),p=Math.max(h[C].length,p),p=Math.max(h[O].length,p);continue}var R=[r[C],null,null,r[O]];r[C].y.cmp(r[O].y)===0?(R[1]=r[C].add(r[O]),R[2]=r[C].toJ().mixedAdd(r[O].neg())):r[C].y.cmp(r[O].y.redNeg())===0?(R[1]=r[C].toJ().mixedAdd(r[O]),R[2]=r[C].add(r[O].neg())):(R[1]=r[C].toJ().mixedAdd(r[O]),R[2]=r[C].toJ().mixedAdd(r[O].neg()));var L=[-3,-1,-5,-7,0,7,5,1,3],K=yz(n[C],n[O]);for(p=Math.max(K[0].length,p),h[C]=new Array(p),h[O]=new Array(p),b=0;b<p;b++){var $=K[0][b]|0,j=K[1][b]|0;h[C][b]=L[($+1)*3+(j+1)],h[O][b]=0,l[C]=R}}var V=this.jpoint(null,null,null),G=this._wnafT4;for(v=p;v>=0;v--){for(var k=0;v>=0;){var H=!0;for(b=0;b<s;b++)G[b]=h[b][v]|0,G[b]!==0&&(H=!1);if(!H)break;k++,v--}if(v>=0&&k++,V=V.dblp(k),v<0)break;for(b=0;b<s;b++){var se=G[b];se!==0&&(se>0?y=l[b][se-1>>1]:se<0&&(y=l[b][-se-1>>1].neg()),y.type==="affine"?V=V.mixedAdd(y):V=V.add(y))}}for(v=0;v<s;v++)l[v]=null;return o?V:V.toP()},"_wnafMulAdd"),"_wnafMulAdd");function _i(e,t){this.curve=e,this.type=t,this.precomputed=null}i(_i,"BasePoint");a(_i,"BasePoint");xa.BasePoint=_i;_i.prototype.eq=a(i(function(){throw new Error("Not implemented")},"eq"),"eq");_i.prototype.validate=a(i(function(){return this.curve.validate(this)},"validate2"),"validate");xa.prototype.decodePoint=a(i(function(t,r){t=bi.toArray(t,r);var n=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*n){t[0]===6?q0(t[t.length-1]%2===0):t[0]===7&&q0(t[t.length-1]%2===1);var s=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return s}else if((t[0]===2||t[0]===3)&&t.length-1===n)return this.pointFromX(t.slice(1,1+n),t[0]===3);throw new Error("Unknown point format")},"decodePoint"),"decodePoint");_i.prototype.encodeCompressed=a(i(function(t){return this.encode(t,!0)},"encodeCompressed"),"encodeCompressed");_i.prototype._encode=a(i(function(t){var r=this.curve.p.byteLength(),n=this.getX().toArray("be",r);return t?[this.getY().isEven()?2:3].concat(n):[4].concat(n,this.getY().toArray("be",r))},"_encode"),"_encode");_i.prototype.encode=a(i(function(t,r){return bi.encode(this._encode(r),t)},"encode8"),"encode");_i.prototype.precompute=a(i(function(t){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,t),r.beta=this._getBeta(),this.precomputed=r,this},"precompute"),"precompute");_i.prototype._hasDoubles=a(i(function(t){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((t.bitLength()+1)/r.step):!1},"_hasDoubles"),"_hasDoubles");_i.prototype._getDoubles=a(i(function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],s=this,o=0;o<r;o+=t){for(var c=0;c<t;c++)s=s.dbl();n.push(s)}return{step:t,points:n}},"_getDoubles"),"_getDoubles");_i.prototype._getNAFPoints=a(i(function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,s=n===1?null:this.dbl(),o=1;o<n;o++)r[o]=r[o-1].add(s);return{wnd:t,points:r}},"_getNAFPoints"),"_getNAFPoints");_i.prototype._getBeta=a(i(function(){return null},"_getBeta"),"_getBeta");_i.prototype.dblp=a(i(function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r},"dblp"),"dblp");var z2=kc(function(e){typeof Object.create=="function"?e.exports=a(i(function(r,n){n&&(r.super_=n,r.prototype=Object.create(n.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"),"inherits"):e.exports=a(i(function(r,n){if(n){r.super_=n;var s=a(function(){},"TempCtor");s.prototype=n.prototype,r.prototype=new s,r.prototype.constructor=r}},"inherits"),"inherits")}),bz=bi.assert;function wi(e){Oc.call(this,"short",e),this.a=new Bt.default(e.a,16).toRed(this.red),this.b=new Bt.default(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}i(wi,"ShortCurve");a(wi,"ShortCurve");z2(wi,Oc);var _z=wi;wi.prototype._getEndomorphism=a(i(function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Bt.default(t.beta,16).toRed(this.red);else{var s=this._getEndoRoots(this.p);r=s[0].cmp(s[1])<0?s[0]:s[1],r=r.toRed(this.red)}if(t.lambda)n=new Bt.default(t.lambda,16);else{var o=this._getEndoRoots(this.n);this.g.mul(o[0]).x.cmp(this.g.x.redMul(r))===0?n=o[0]:(n=o[1],bz(this.g.mul(n).x.cmp(this.g.x.redMul(r))===0))}var c;return t.basis?c=t.basis.map(function(l){return{a:new Bt.default(l.a,16),b:new Bt.default(l.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism"),"_getEndomorphism");wi.prototype._getEndoRoots=a(i(function(t){var r=t===this.p?this.red:Bt.default.mont(t),n=new Bt.default(2).toRed(r).redInvm(),s=n.redNeg(),o=new Bt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=s.redAdd(o).fromRed(),l=s.redSub(o).fromRed();return[c,l]},"_getEndoRoots"),"_getEndoRoots");wi.prototype._getEndoBasis=a(i(function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,s=this.n.clone(),o=new Bt.default(1),c=new Bt.default(0),l=new Bt.default(0),h=new Bt.default(1),p,v,b,y,A,C,O,R=0,L,K;n.cmpn(0)!==0;){var $=s.div(n);L=s.sub($.mul(n)),K=l.sub($.mul(o));var j=h.sub($.mul(c));if(!b&&L.cmp(r)<0)p=O.neg(),v=o,b=L.neg(),y=K;else if(b&&++R===2)break;O=L,s=n,n=L,l=o,o=K,h=c,c=j}A=L.neg(),C=K;var V=b.sqr().add(y.sqr()),G=A.sqr().add(C.sqr());return G.cmp(V)>=0&&(A=p,C=v),b.negative&&(b=b.neg(),y=y.neg()),A.negative&&(A=A.neg(),C=C.neg()),[{a:b,b:y},{a:A,b:C}]},"_getEndoBasis"),"_getEndoBasis");wi.prototype._endoSplit=a(i(function(t){var r=this.endo.basis,n=r[0],s=r[1],o=s.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),l=o.mul(n.a),h=c.mul(s.a),p=o.mul(n.b),v=c.mul(s.b),b=t.sub(l).sub(h),y=p.add(v).neg();return{k1:b,k2:y}},"_endoSplit"),"_endoSplit");wi.prototype.pointFromX=a(i(function(t,r){t=new Bt.default(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),s=n.redSqrt();if(s.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var o=s.fromRed().isOdd();return(r&&!o||!r&&o)&&(s=s.redNeg()),this.point(t,s)},"pointFromX"),"pointFromX");wi.prototype.validate=a(i(function(t){if(t.inf)return!0;var r=t.x,n=t.y,s=this.a.redMul(r),o=r.redSqr().redMul(r).redIAdd(s).redIAdd(this.b);return n.redSqr().redISub(o).cmpn(0)===0},"validate3"),"validate");wi.prototype._endoWnafMulAdd=a(i(function(t,r,n){for(var s=this._endoWnafT1,o=this._endoWnafT2,c=0;c<t.length;c++){var l=this._endoSplit(r[c]),h=t[c],p=h._getBeta();l.k1.negative&&(l.k1.ineg(),h=h.neg(!0)),l.k2.negative&&(l.k2.ineg(),p=p.neg(!0)),s[c*2]=h,s[c*2+1]=p,o[c*2]=l.k1,o[c*2+1]=l.k2}for(var v=this._wnafMulAdd(1,s,o,c*2,n),b=0;b<c*2;b++)s[b]=null,o[b]=null;return v},"_endoWnafMulAdd"),"_endoWnafMulAdd");function Zr(e,t,r,n){Oc.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Bt.default(t,16),this.y=new Bt.default(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}i(Zr,"Point");a(Zr,"Point");z2(Zr,Oc.BasePoint);wi.prototype.point=a(i(function(t,r,n){return new Zr(this,t,r,n)},"point2"),"point");wi.prototype.pointFromJSON=a(i(function(t,r){return Zr.fromJSON(this,t,r)},"pointFromJSON"),"pointFromJSON");Zr.prototype._getBeta=a(i(function(){if(!!this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var n=this.curve,s=a(function(o){return n.point(o.x.redMul(n.endo.beta),o.y)},"endoMul");t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(s)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(s)}}}return r}},"_getBeta2"),"_getBeta");Zr.prototype.toJSON=a(i(function(){return this.precomputed?[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)}}]:[this.x,this.y]},"toJSON"),"toJSON");Zr.fromJSON=a(i(function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var s=t.point(r[0],r[1],n);if(!r[2])return s;function o(l){return t.point(l[0],l[1],n)}i(o,"obj2point"),a(o,"obj2point");var c=r[2];return s.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[s].concat(c.doubles.points.map(o))},naf:c.naf&&{wnd:c.naf.wnd,points:[s].concat(c.naf.points.map(o))}},s},"fromJSON"),"fromJSON");Zr.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},"inspect"),"inspect");Zr.prototype.isInfinity=a(i(function(){return this.inf},"isInfinity"),"isInfinity");Zr.prototype.add=a(i(function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var r=this.y.redSub(t.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(t.x).redInvm()));var n=r.redSqr().redISub(this.x).redISub(t.x),s=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,s)},"add"),"add");Zr.prototype.dbl=a(i(function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,n=this.x.redSqr(),s=t.redInvm(),o=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(s),c=o.redSqr().redISub(this.x.redAdd(this.x)),l=o.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,l)},"dbl"),"dbl");Zr.prototype.getX=a(i(function(){return this.x.fromRed()},"getX"),"getX");Zr.prototype.getY=a(i(function(){return this.y.fromRed()},"getY"),"getY");Zr.prototype.mul=a(i(function(t){return t=new Bt.default(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},"mul"),"mul");Zr.prototype.mulAdd=a(i(function(t,r,n){var s=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(s,o):this.curve._wnafMulAdd(1,s,o,2)},"mulAdd"),"mulAdd");Zr.prototype.jmulAdd=a(i(function(t,r,n){var s=[this,r],o=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(s,o,!0):this.curve._wnafMulAdd(1,s,o,2,!0)},"jmulAdd"),"jmulAdd");Zr.prototype.eq=a(i(function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},"eq2"),"eq");Zr.prototype.neg=a(i(function(t){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var n=this.precomputed,s=a(function(o){return o.neg()},"negate");r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(s)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(s)}}}return r},"neg"),"neg");Zr.prototype.toJ=a(i(function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t},"toJ"),"toJ");function en(e,t,r,n){Oc.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Bt.default(0)):(this.x=new Bt.default(t,16),this.y=new Bt.default(r,16),this.z=new Bt.default(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(en,"JPoint");a(en,"JPoint");z2(en,Oc.BasePoint);wi.prototype.jpoint=a(i(function(t,r,n){return new en(this,t,r,n)},"jpoint"),"jpoint");en.prototype.toP=a(i(function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),s=this.y.redMul(r).redMul(t);return this.curve.point(n,s)},"toP"),"toP");en.prototype.neg=a(i(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg2"),"neg");en.prototype.add=a(i(function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),s=this.x.redMul(r),o=t.x.redMul(n),c=this.y.redMul(r.redMul(t.z)),l=t.y.redMul(n.redMul(this.z)),h=s.redSub(o),p=c.redSub(l);if(h.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var v=h.redSqr(),b=v.redMul(h),y=s.redMul(v),A=p.redSqr().redIAdd(b).redISub(y).redISub(y),C=p.redMul(y.redISub(A)).redISub(c.redMul(b)),O=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(A,C,O)},"add2"),"add");en.prototype.mixedAdd=a(i(function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,s=t.x.redMul(r),o=this.y,c=t.y.redMul(r).redMul(this.z),l=n.redSub(s),h=o.redSub(c);if(l.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=l.redSqr(),v=p.redMul(l),b=n.redMul(p),y=h.redSqr().redIAdd(v).redISub(b).redISub(b),A=h.redMul(b.redISub(y)).redISub(o.redMul(v)),C=this.z.redMul(l);return this.curve.jpoint(y,A,C)},"mixedAdd"),"mixedAdd");en.prototype.dblp=a(i(function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var n=this;for(r=0;r<t;r++)n=n.dbl();return n}var s=this.curve.a,o=this.curve.tinv,c=this.x,l=this.y,h=this.z,p=h.redSqr().redSqr(),v=l.redAdd(l);for(r=0;r<t;r++){var b=c.redSqr(),y=v.redSqr(),A=y.redSqr(),C=b.redAdd(b).redIAdd(b).redIAdd(s.redMul(p)),O=c.redMul(y),R=C.redSqr().redISub(O.redAdd(O)),L=O.redISub(R),K=C.redMul(L);K=K.redIAdd(K).redISub(A);var $=v.redMul(h);r+1<t&&(p=p.redMul(A)),c=R,h=$,v=K}return this.curve.jpoint(c,v.redMul(o),h)},"dblp2"),"dblp");en.prototype.dbl=a(i(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl2"),"dbl");en.prototype._zeroDbl=a(i(function(){var t,r,n;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),c=o.redSqr(),l=this.x.redAdd(o).redSqr().redISub(s).redISub(c);l=l.redIAdd(l);var h=s.redAdd(s).redIAdd(s),p=h.redSqr().redISub(l).redISub(l),v=c.redIAdd(c);v=v.redIAdd(v),v=v.redIAdd(v),t=p,r=h.redMul(l.redISub(p)).redISub(v),n=this.y.redAdd(this.y)}else{var b=this.x.redSqr(),y=this.y.redSqr(),A=y.redSqr(),C=this.x.redAdd(y).redSqr().redISub(b).redISub(A);C=C.redIAdd(C);var O=b.redAdd(b).redIAdd(b),R=O.redSqr(),L=A.redIAdd(A);L=L.redIAdd(L),L=L.redIAdd(L),t=R.redISub(C).redISub(C),r=O.redMul(C.redISub(t)).redISub(L),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)},"_zeroDbl"),"_zeroDbl");en.prototype._threeDbl=a(i(function(){var t,r,n;if(this.zOne){var s=this.x.redSqr(),o=this.y.redSqr(),c=o.redSqr(),l=this.x.redAdd(o).redSqr().redISub(s).redISub(c);l=l.redIAdd(l);var h=s.redAdd(s).redIAdd(s).redIAdd(this.curve.a),p=h.redSqr().redISub(l).redISub(l);t=p;var v=c.redIAdd(c);v=v.redIAdd(v),v=v.redIAdd(v),r=h.redMul(l.redISub(p)).redISub(v),n=this.y.redAdd(this.y)}else{var b=this.z.redSqr(),y=this.y.redSqr(),A=this.x.redMul(y),C=this.x.redSub(b).redMul(this.x.redAdd(b));C=C.redAdd(C).redIAdd(C);var O=A.redIAdd(A);O=O.redIAdd(O);var R=O.redAdd(O);t=C.redSqr().redISub(R),n=this.y.redAdd(this.z).redSqr().redISub(y).redISub(b);var L=y.redSqr();L=L.redIAdd(L),L=L.redIAdd(L),L=L.redIAdd(L),r=C.redMul(O.redISub(t)).redISub(L)}return this.curve.jpoint(t,r,n)},"_threeDbl"),"_threeDbl");en.prototype._dbl=a(i(function(){var t=this.curve.a,r=this.x,n=this.y,s=this.z,o=s.redSqr().redSqr(),c=r.redSqr(),l=n.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(o)),p=r.redAdd(r);p=p.redIAdd(p);var v=p.redMul(l),b=h.redSqr().redISub(v.redAdd(v)),y=v.redISub(b),A=l.redSqr();A=A.redIAdd(A),A=A.redIAdd(A),A=A.redIAdd(A);var C=h.redMul(y).redISub(A),O=n.redAdd(n).redMul(s);return this.curve.jpoint(b,C,O)},"_dbl"),"_dbl");en.prototype.trpl=a(i(function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),s=r.redSqr(),o=t.redAdd(t).redIAdd(t),c=o.redSqr(),l=this.x.redAdd(r).redSqr().redISub(t).redISub(s);l=l.redIAdd(l),l=l.redAdd(l).redIAdd(l),l=l.redISub(c);var h=l.redSqr(),p=s.redIAdd(s);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var v=o.redIAdd(l).redSqr().redISub(c).redISub(h).redISub(p),b=r.redMul(v);b=b.redIAdd(b),b=b.redIAdd(b);var y=this.x.redMul(h).redISub(b);y=y.redIAdd(y),y=y.redIAdd(y);var A=this.y.redMul(v.redMul(p.redISub(v)).redISub(l.redMul(h)));A=A.redIAdd(A),A=A.redIAdd(A),A=A.redIAdd(A);var C=this.z.redAdd(l).redSqr().redISub(n).redISub(h);return this.curve.jpoint(y,A,C)},"trpl"),"trpl");en.prototype.mul=a(i(function(t,r){return t=new Bt.default(t,r),this.curve._wnafMul(this,t)},"mul2"),"mul");en.prototype.eq=a(i(function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var r=this.z.redSqr(),n=t.z.redSqr();if(this.x.redMul(n).redISub(t.x.redMul(r)).cmpn(0)!==0)return!1;var s=r.redMul(this.z),o=n.redMul(t.z);return this.y.redMul(o).redISub(t.y.redMul(s)).cmpn(0)===0},"eq3"),"eq");en.prototype.eqXToP=a(i(function(t){var r=this.z.redSqr(),n=t.toRed(this.curve.red).redMul(r);if(this.x.cmp(n)===0)return!0;for(var s=t.clone(),o=this.curve.redN.redMul(r);;){if(s.iadd(this.curve.n),s.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(o),this.x.cmp(n)===0)return!0}},"eqXToP"),"eqXToP");en.prototype.inspect=a(i(function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},"inspect2"),"inspect");en.prototype.isInfinity=a(i(function(){return this.z.cmpn(0)===0},"isInfinity2"),"isInfinity");var v0=kc(function(e,t){"use strict";var r=t;r.base=Oc,r.short=_z,r.mont=null,r.edwards=null}),g0=kc(function(e,t){"use strict";var r=t,n=bi.assert;function s(l){l.type==="short"?this.curve=new v0.short(l):l.type==="edwards"?this.curve=new v0.edwards(l):this.curve=new v0.mont(l),this.g=this.curve.g,this.n=this.curve.n,this.hash=l.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}i(s,"PresetCurve"),a(s,"PresetCurve"),r.PresetCurve=s;function o(l,h){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var p=new s(h);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:p}),p}})}i(o,"defineCurve"),a(o,"defineCurve"),o("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:va.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("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:va.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("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:va.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("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:va.default.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"]}),o("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:va.default.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"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:va.default.sha256,gRed:!1,g:["9"]}),o("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:va.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}o("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:va.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function _a(e){if(!(this instanceof _a))return new _a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=us.toArray(e.entropy,e.entropyEnc||"hex"),r=us.toArray(e.nonce,e.nonceEnc||"hex"),n=us.toArray(e.pers,e.persEnc||"hex");$2(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}i(_a,"HmacDRBG");a(_a,"HmacDRBG");var sC=_a;_a.prototype._init=a(i(function(t,r,n){var s=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var o=0;o<this.V.length;o++)this.K[o]=0,this.V[o]=1;this._update(s),this._reseed=1,this.reseedInterval=281474976710656},"init"),"init");_a.prototype._hmac=a(i(function(){return new va.default.hmac(this.hash,this.K)},"hmac"),"hmac");_a.prototype._update=a(i(function(t){var r=this._hmac().update(this.V).update([0]);t&&(r=r.update(t)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},"update"),"update");_a.prototype.reseed=a(i(function(t,r,n,s){typeof r!="string"&&(s=n,n=r,r=null),t=us.toArray(t,r),n=us.toArray(n,s),$2(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},"reseed"),"reseed");_a.prototype.generate=a(i(function(t,r,n,s){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(s=n,n=r,r=null),n&&(n=us.toArray(n,s||"hex"),this._update(n));for(var o=[];o.length<t;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var c=o.slice(0,t);return this._update(n),this._reseed++,us.encode(c,r)},"generate"),"generate");var xb=bi.assert;function un(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}i(un,"KeyPair");a(un,"KeyPair");var H2=un;un.fromPublic=a(i(function(t,r,n){return r instanceof un?r:new un(t,{pub:r,pubEnc:n})},"fromPublic"),"fromPublic");un.fromPrivate=a(i(function(t,r,n){return r instanceof un?r:new un(t,{priv:r,privEnc:n})},"fromPrivate"),"fromPrivate");un.prototype.validate=a(i(function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},"validate4"),"validate");un.prototype.getPublic=a(i(function(t,r){return typeof t=="string"&&(r=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,t):this.pub},"getPublic"),"getPublic");un.prototype.getPrivate=a(i(function(t){return t==="hex"?this.priv.toString(16,2):this.priv},"getPrivate"),"getPrivate");un.prototype._importPrivate=a(i(function(t,r){this.priv=new Bt.default(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate"),"_importPrivate");un.prototype._importPublic=a(i(function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?xb(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&xb(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,r)},"_importPublic"),"_importPublic");un.prototype.derive=a(i(function(t){return t.validate()||xb(t.validate(),"public point not validated"),t.mul(this.priv).getX()},"derive"),"derive");un.prototype.sign=a(i(function(t,r,n){return this.ec.sign(t,this,r,n)},"sign2"),"sign");un.prototype.verify=a(i(function(t,r){return this.ec.verify(t,r,this)},"verify2"),"verify");un.prototype.inspect=a(i(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect3"),"inspect");var wz=bi.assert;function gd(e,t){if(e instanceof gd)return e;this._importDER(e,t)||(wz(e.r&&e.s,"Signature without r or s"),this.r=new Bt.default(e.r,16),this.s=new Bt.default(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}i(gd,"Signature");a(gd,"Signature");var Rm=gd;function aC(){this.place=0}i(aC,"Position");a(aC,"Position");function y0(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4)return!1;for(var s=0,o=0,c=t.place;o<n;o++,c++)s<<=8,s|=e[c],s>>>=0;return s<=127?!1:(t.place=c,s)}i(y0,"getLength");a(y0,"getLength");function Tb(e){for(var t=0,r=e.length-1;!e[t]&&!(e[t+1]&128)&&t<r;)t++;return t===0?e:e.slice(t)}i(Tb,"rmPadding");a(Tb,"rmPadding");gd.prototype._importDER=a(i(function(t,r){t=bi.toArray(t,r);var n=new aC;if(t[n.place++]!==48)return!1;var s=y0(t,n);if(s===!1||s+n.place!==t.length||t[n.place++]!==2)return!1;var o=y0(t,n);if(o===!1)return!1;var c=t.slice(n.place,o+n.place);if(n.place+=o,t[n.place++]!==2)return!1;var l=y0(t,n);if(l===!1||t.length!==l+n.place)return!1;var h=t.slice(n.place,l+n.place);if(c[0]===0)if(c[1]&128)c=c.slice(1);else return!1;if(h[0]===0)if(h[1]&128)h=h.slice(1);else return!1;return this.r=new Bt.default(c),this.s=new Bt.default(h),this.recoveryParam=null,!0},"_importDER"),"_importDER");function b0(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(r|128);--r;)e.push(t>>>(r<<3)&255);e.push(t)}i(b0,"constructLength");a(b0,"constructLength");gd.prototype.toDER=a(i(function(t){var r=this.r.toArray(),n=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),n[0]&128&&(n=[0].concat(n)),r=Tb(r),n=Tb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var s=[2];b0(s,r.length),s=s.concat(r),s.push(2),b0(s,n.length);var o=s.concat(n),c=[48];return b0(c,o.length),c=c.concat(o),bi.encode(c,t)},"toDER"),"toDER");var Ez=a(function(){throw new Error("unsupported")},"rand"),oC=bi.assert;function gi(e){if(!(this instanceof gi))return new gi(e);typeof e=="string"&&(oC(Object.prototype.hasOwnProperty.call(g0,e),"Unknown curve "+e),e=g0[e]),e instanceof g0.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}i(gi,"EC");a(gi,"EC");var Az=gi;gi.prototype.keyPair=a(i(function(t){return new H2(this,t)},"keyPair"),"keyPair");gi.prototype.keyFromPrivate=a(i(function(t,r){return H2.fromPrivate(this,t,r)},"keyFromPrivate"),"keyFromPrivate");gi.prototype.keyFromPublic=a(i(function(t,r){return H2.fromPublic(this,t,r)},"keyFromPublic"),"keyFromPublic");gi.prototype.genKeyPair=a(i(function(t){t||(t={});for(var r=new sC({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||Ez(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),s=this.n.sub(new Bt.default(2));;){var o=new Bt.default(r.generate(n));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},"genKeyPair"),"genKeyPair");gi.prototype._truncateToN=a(i(function(t,r){var n=t.byteLength()*8-this.n.bitLength();return n>0&&(t=t.ushrn(n)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},"_truncateToN"),"_truncateToN");gi.prototype.sign=a(i(function(t,r,n,s){typeof n=="object"&&(s=n,n=null),s||(s={}),r=this.keyFromPrivate(r,n),t=this._truncateToN(new Bt.default(t,16));for(var o=this.n.byteLength(),c=r.getPrivate().toArray("be",o),l=t.toArray("be",o),h=new sC({hash:this.hash,entropy:c,nonce:l,pers:s.pers,persEnc:s.persEnc||"utf8"}),p=this.n.sub(new Bt.default(1)),v=0;;v++){var b=s.k?s.k(v):new Bt.default(h.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),!(b.cmpn(1)<=0||b.cmp(p)>=0)){var y=this.g.mul(b);if(!y.isInfinity()){var A=y.getX(),C=A.umod(this.n);if(C.cmpn(0)!==0){var O=b.invm(this.n).mul(C.mul(r.getPrivate()).iadd(t));if(O=O.umod(this.n),O.cmpn(0)!==0){var R=(y.getY().isOdd()?1:0)|(A.cmp(C)!==0?2:0);return s.canonical&&O.cmp(this.nh)>0&&(O=this.n.sub(O),R^=1),new Rm({r:C,s:O,recoveryParam:R})}}}}}},"sign3"),"sign");gi.prototype.verify=a(i(function(t,r,n,s){t=this._truncateToN(new Bt.default(t,16)),n=this.keyFromPublic(n,s),r=new Rm(r,"hex");var o=r.r,c=r.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0||c.cmpn(1)<0||c.cmp(this.n)>=0)return!1;var l=c.invm(this.n),h=l.mul(t).umod(this.n),p=l.mul(o).umod(this.n),v;return this.curve._maxwellTrick?(v=this.g.jmulAdd(h,n.getPublic(),p),v.isInfinity()?!1:v.eqXToP(o)):(v=this.g.mulAdd(h,n.getPublic(),p),v.isInfinity()?!1:v.getX().umod(this.n).cmp(o)===0)},"verify3"),"verify");gi.prototype.recoverPubKey=function(e,t,r,n){oC((3&r)===r,"The recovery param is more than two bits"),t=new Rm(t,n);var s=this.n,o=new Bt.default(e),c=t.r,l=t.s,h=r&1,p=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");p?c=this.curve.pointFromX(c.add(this.curve.n),h):c=this.curve.pointFromX(c,h);var v=t.r.invm(s),b=s.sub(o).mul(v).umod(s),y=l.mul(v).umod(s);return this.g.mulAdd(b,c,y)};gi.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new Rm(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var s=0;s<4;s++){var o;try{o=this.recoverPubKey(e,t,s)}catch{continue}if(o.eq(r))return s}throw new Error("Unable to find valid recovery factor")};var Sz=kc(function(e,t){"use strict";var r=t;r.version="6.5.4",r.utils=bi,r.rand=function(){throw new Error("unsupported")},r.curve=v0,r.curves=g0,r.ec=Az,r.eddsa=null}),xz=Sz.ec,Tz="signing-key/5.7.0",Mb=new gr(Tz),Vy=null;function cs(){return Vy||(Vy=new xz("secp256k1")),Vy}i(cs,"getCurve");a(cs,"getCurve");var cC=i(class{constructor(e){Mu(this,"curve","secp256k1"),Mu(this,"privateKey",Rn(e)),ZM(this.privateKey)!==32&&Mb.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=cs().keyFromPrivate(zr(this.privateKey));Mu(this,"publicKey","0x"+t.getPublic(!1,"hex")),Mu(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Mu(this,"_isSigningKey",!0)}_addPoint(e){let t=cs().keyFromPublic(zr(this.publicKey)),r=cs().keyFromPublic(zr(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=cs().keyFromPrivate(zr(this.privateKey)),r=zr(e);r.length!==32&&Mb.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return L2({recoveryParam:n.recoveryParam,r:gc("0x"+n.r.toString(16),32),s:gc("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=cs().keyFromPrivate(zr(this.privateKey)),r=cs().keyFromPublic(zr(q2(e)));return gc("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}},"SigningKey");a(cC,"SigningKey");function uC(e,t){let r=L2(t),n={r:zr(r.r),s:zr(r.s)};return"0x"+cs().recoverPubKey(zr(e),n,r.recoveryParam).encode("hex",!1)}i(uC,"recoverPublicKey");a(uC,"recoverPublicKey");function q2(e,t){let r=zr(e);if(r.length===32){let n=new cC(r);return t?"0x"+cs().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?Rn(r):"0x"+cs().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+cs().keyFromPublic(r).getPublic(!0,"hex"):Rn(r)}return Mb.throwArgumentError("invalid public or private key","key","[REDACTED]")}i(q2,"computePublicKey");a(q2,"computePublicKey");var Mz="transactions/5.7.0",QJ=new gr(Mz),GA;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(GA||(GA={}));function lC(e){let t=q2(e);return QM(Ab(Om(Ab(t,1)),12))}i(lC,"computeAddress");a(lC,"computeAddress");function fC(e,t){return lC(uC(zr(e),t))}i(fC,"recoverAddress");a(fC,"recoverAddress");var Cz="wallet/5.7.0",eY=new gr(Cz);function Cb(e,t){return fC(nC(e),t)}i(Cb,"verifyMessage");a(Cb,"verifyMessage");function dC(){return{eip191:async(e,t)=>{hC(e,t)}}}i(dC,"getEIP191Verifier");a(dC,"getEIP191Verifier");var Iz=new Date("2022-09-20").valueOf();function hC(e,t){P2(e),qM(e,t);let n=[Cb(_b.fromCacao(e).toMessage(),e.s.s).toLowerCase()];if(Date.parse(e.p.iat)<=Iz){let o=Cb(zM(_b.fromCacao(e),"Ethereum"),e.s.s).toLowerCase();n.push(o)}let s=Gf.parse(e.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(s))throw new Error("Signature does not belong to issuer")}i(hC,"verifyEIP191Signature");a(hC,"verifyEIP191Signature");ld();a2();var Dz=rr(Xu(),1);ld();function pC(){return Mr((0,Dz.randomBytes)(16),"base64")}i(pC,"randomString");a(pC,"randomString");var mC="base64pad",vC="base64url";function gC(e){return Mr(e,mC)}i(gC,"encodeBase64");a(gC,"encodeBase64");function yC(e){return Mr(e,vC)}i(yC,"encodeBase64Url");a(yC,"encodeBase64Url");function bC(e){return xr(e,mC)}i(bC,"decodeBase64");a(bC,"decodeBase64");function _0(e){return JSON.parse(Mr(xr(e,vC)))}i(_0,"base64urlToJSON");a(_0,"base64urlToJSON");function _C(e){if(e.signatures.length>1)throw new Error("Cant convert to compact jws");return`${e.signatures[0].protected}.${e.payload}.${e.signatures[0].signature}`}i(_C,"fromDagJWS");a(_C,"fromDagJWS");function wC(e,t){if(t){let r=t.toISOString().split(".")[0]+"Z";return`${e}?versionTime=${r}`}else return e}i(wC,"didWithTime");a(wC,"didWithTime");function EC(e){return e?Array.isArray(e)?e:[e]:[]}i(EC,"extractControllers");a(EC,"extractControllers");var kz={...dC()};function AC(e){return"registry"in e&&"cache"in e}i(AC,"isResolver");a(AC,"isResolver");var SC=i(class{get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return this._capability!=null}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return this._parentId!=null}get id(){if(this._id==null)throw new Error("DID is not authenticated");return this._id}get authenticated(){return this._id!=null}withCapability(e){return new SC({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new yb(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=AC(e)?e:new Bx(e,t)}async authenticate({provider:e,paths:t=[],aud:r}={}){if(e!=null&&this.setProvider(e),this._client==null)throw new Error("No provider available");let n=pC(),s=await this._client.request("did_authenticate",{nonce:n,aud:r,paths:t}),{kid:o}=await this.verifyJWS(s),c=_0(s.payload);if(!o.includes(c.did))throw new Error("Invalid authencation response, kid mismatch");if(c.nonce!==n)throw new Error("Invalid authencation response, wrong nonce");if(c.aud!==r)throw new Error("Invalid authencation response, wrong aud");if(c.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=c.did,this._id}async createJWS(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");if(this._capability){let n=this._capability.p.exp;if(n&&Date.parse(n)<Date.now())throw new Error("Capability is expired, cannot create a valid signature");let s=await j0.fromCacao(this._capability),o=Ht.asCID(s.cid);if(!o)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${o?.toString()}`}let{jws:r}=await this._client.request("did_createJWS",{did:this._id,...t,payload:e});return r}async createDagJWS(e,t={}){let{cid:r,linkedBlock:n}=await wM(e),s=yC(r.bytes);Object.assign(t,{linkedBlock:gC(n)});let o=await this.createJWS(s,t),c=Ht.asCID(r);if(!c)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(o.link=c,this._capability){let l=await j0.fromCacao(this._capability);return{jws:o,linkedBlock:n,cacaoBlock:l.bytes}}return{jws:o,linkedBlock:n}}async verifyJWS(e,t={}){t=Object.assign({verifiers:kz},t),typeof e!="string"&&(e=_C(e));let r=_0(e.split(".")[0]).kid;if(!r)throw new Error('No "kid" found in jws');let n=await this.resolve(r);if(!t.disableTimecheck){let h=n.didDocumentMetadata?.nextUpdate;if(h){let v=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,b=new Date(h).valueOf()+v;if(!(t.atTime&&t.atTime.getTime()<b))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${r}`)}let p=n.didDocumentMetadata?.updated;if(p&&t.atTime&&t.atTime.getTime()<new Date(p).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${r}`)}let o=n.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&o===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await $0.verify(t.capability,{disableExpirationCheck:t.disableTimecheck,atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}})}else if(t.issuer&&t.issuer!==o){let h=wC(t.issuer,t.atTime),v=(await this.resolve(h)).didDocument?.controller,b=EC(v);if(t.capability?.s&&t.capability.p.aud===o&&b.includes(t.capability.p.iss))await $0.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(o?b.includes(o):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${r}`)}let c=n.didDocument?.verificationMethod||[];Xx(e,c);let l;try{l=_0(e.split(".")[1])}catch{}return{kid:r,payload:l,didResolutionResult:n}}async createJWE(e,t,r={}){let n=await Ij(t,this._resolver);return Cj(e,n,r.protectedHeader,r.aad)}async createDagJWE(e,t,r={}){let n=await xM(e);return this.createJWE(n,t,r)}async decryptJWE(e,t={}){if(this._client==null)throw new Error("No provider available");if(this._id==null)throw new Error("DID is not authenticated");let{cleartext:r}=await this._client.request("did_decryptJWE",{did:this._id,...t,jwe:e});return bC(r)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return TM(t)}async resolve(e){let t=await this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:r,message:n}=t.didResolutionMetadata,s=n?`, ${n}`:"";throw new Error(`Failed to resolve ${e}: ${r}${s}`)}return t}constructor({provider:e,resolver:t={},resolverOptions:r,capability:n,parent:s}={}){if(e!=null&&(this._client=new yb(e)),n){if(this._capability=n,this._parentId=this._capability.p.iss,s&&this._parentId!==s)throw new Error("Capability issuer and parent not equal")}else s&&(this._parentId=s);this.setResolver(t,r)}},"DID");a(SC,"DID");function Oz(e){var t=0,r=e.length,n=[];if(r%2)throw new Error("invalid hex:"+e);for(;t<r;t+=2)n.push(parseInt(e.substr(t,2),16));return new Uint8Array(n)}i(Oz,"toUint8Array");a(Oz,"toUint8Array");var WA=rr(vm(),1);t2();var xC={};Er(xC,{keyToDidDoc:()=>TC});function TC(e,t){let r=`did:key:${t}`,n=`${r}#${t}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:Mr(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(TC,"keyToDidDoc");a(TC,"keyToDidDoc");var MC={};Er(MC,{keyToDidDoc:()=>IC});ld();var Rz=rr(c2(),1);function CC(e){let t=new Uint8Array(e.length+2);return t[0]=236,t[1]=1,t.set(e,2),`z${Mr(t,"base58btc")}`}i(CC,"encodeKey");a(CC,"encodeKey");function IC(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,s=(0,Rz.convertPublicKeyToX25519)(e),o=`${r}#${CC(s)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:Mr(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:o,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:Mr(s,"base58btc")}]}}i(IC,"keyToDidDoc2");a(IC,"keyToDidDoc");var DC={};Er(DC,{keyToDidDoc:()=>HC,pubKeyBytesToXY:()=>G2});var kC={};Er(kC,{ECPointDecompress:()=>FC});function OC(e){return e>=0?e:-e}i(OC,"abs");a(OC,"abs");function RC(e,t){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),e<=0n||t<=0n)throw new RangeError("a and b MUST be > 0");let r=0n,n=1n,s=1n,o=0n;for(;e!==0n;){let c=t/e,l=t%e,h=r-s*c,p=n-o*c;t=e,e=l,r=s,n=o,s=h,o=p}return{g:t,x:r,y:n}}i(RC,"eGcd");a(RC,"eGcd");function K0(e,t){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),t<=0n)throw new RangeError("n must be > 0");let r=e%t;return r<0n?r+t:r}i(K0,"toZn");a(K0,"toZn");function NC(e,t){let r=RC(K0(e,t),t);if(r.g!==1n)throw new RangeError(`${e.toString()} does not have inverse modulo ${t.toString()}`);return K0(r.x,t)}i(NC,"modInv");a(NC,"modInv");function yd(e,t,r){if(typeof e=="number"&&(e=BigInt(e)),typeof t=="number"&&(t=BigInt(t)),typeof r=="number"&&(r=BigInt(r)),r<=0n)throw new RangeError("n must be > 0");if(r===1n)return 0n;if(e=K0(e,r),t<0n)return NC(yd(e,OC(t),r),r);let n=1n;for(;t>0;)t%2n===1n&&(n=n*e%r),t=t/2n,e=e**2n%r;return n}i(yd,"modPow");a(yd,"modPow");var Wn={};Er(Wn,{pubKeyBytesToHex:()=>PC,publicKeyHexToUint8ArrayPointPair:()=>K2,publicKeyIntToUint8ArrayPointPair:()=>V2,publicKeyIntToXY:()=>LC,publicKeyToXY:()=>BC,testHexString:()=>Nm,testUint8Array:()=>cl});r2();function PC(e){if(!cl(e))throw new TypeError("input must be a Uint8Array");return Mr(e,"base16")}i(PC,"pubKeyBytesToHex");a(PC,"pubKeyBytesToHex");function BC(e){if(!Nm(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=K2(e),r=Ru.encode(t.xOctet).slice(1),n=Ru.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(BC,"publicKeyToXY");a(BC,"publicKeyToXY");function K2(e){if(!Nm(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=e.slice(0,e.length/2),r=e.slice(e.length/2,e.length),n=xr(t,"base16"),s=xr(r,"base16");return{xOctet:n,yOctet:s}}i(K2,"publicKeyHexToUint8ArrayPointPair");a(K2,"publicKeyHexToUint8ArrayPointPair");function Nm(e){let t=/^[A-Fa-f0-9]+$/i;return!!(t.exec(e)!==null&&t.test(e)&&typeof e=="string")}i(Nm,"testHexString");a(Nm,"testHexString");function cl(e){return e==null?!1:e.constructor===Uint8Array}i(cl,"testUint8Array");a(cl,"testUint8Array");function LC(e){if(e==null)throw new TypeError("input cannot be null or undefined.");if(typeof e!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(e,"x")||!Object.prototype.hasOwnProperty.call(e,"y"))throw new Error("Input must have properties x and y");if(typeof e.x!="bigint"&&typeof e.y!="bigint")throw new Error("Input coordinates must be BigInt");let t=V2(e),r=Ru.encode(t.xOctet).slice(1),n=Ru.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(LC,"publicKeyIntToXY");a(LC,"publicKeyIntToXY");function V2(e){if(e==null)throw new TypeError("input cannot be null or undefined.");if(typeof e!="object")throw new TypeError("Input must be an object with properties x and y");if(!Object.prototype.hasOwnProperty.call(e,"x")||!Object.prototype.hasOwnProperty.call(e,"y"))throw new Error("Input must have properties x and y");if(typeof e.x!="bigint"&&typeof e.y!="bigint")throw new Error("Input coordinates must be BigInt");let t=e.x.toString(),r=e.y.toString(),n=xr(t,"base10"),s=xr(r,"base10");return{xOctet:n,yOctet:s}}i(V2,"publicKeyIntToUint8ArrayPointPair");a(V2,"publicKeyIntToUint8ArrayPointPair");function FC(e){if(!cl(e))throw new TypeError("input must be a Uint8Array");let t=BigInt(2),r=t**256n-t**224n+t**192n+t**96n-1n,n=41058363725152142129326129780047268409114441015993725554835256314039467401291n,s=(r+1n)/4n,o=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Mr(c,"base10")),h=l**3n-l*3n+n,p=yd(h,s,r);return p%2n!==o&&(p=r-p),{x:l,y:p}}i(FC,"ECPointDecompress");a(FC,"ECPointDecompress");var UC={};Er(UC,{ECPointDecompress:()=>$C});function $C(e){if(!cl(e))throw new TypeError("input must be a Uint8Array");let t=BigInt(2),r=t**384n-t**128n-t**96n+t**32n-1n,n=27580193559959705877849011840389048093056905856361568521428707301988689241309860865136260764883745107765439761230575n,s=(r+1n)/4n,o=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Mr(c,"base10")),h=l**3n-l*3n+n,p=yd(h,s,r);return p%2n!==o&&(p=r-p),{x:l,y:p}}i($C,"ECPointDecompress2");a($C,"ECPointDecompress");var jC={};Er(jC,{ECPointDecompress:()=>zC});function zC(e){if(!cl(e))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,s=(r+1n)/4n,o=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Mr(c,"base10")),h=l**3n-l*3n+n,p=yd(h,s,r);return p%2n!==o&&(p=r-p),{x:l,y:p}}i(zC,"ECPointDecompress3");a(zC,"ECPointDecompress");function HC(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,s=G2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:s.xm,y:s.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(HC,"keyToDidDoc3");a(HC,"keyToDidDoc");function G2(e){if(!Wn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Wn.pubKeyBytesToHex(e),r=t.length/2;if(r==64)return Wn.publicKeyToXY(t);if(r==65&&t.slice(0,2)=="04"){let n=t.slice(2);return Wn.publicKeyToXY(n)}if(r==33&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=xr(t,"base16"),s=kC.ECPointDecompress(n);return Wn.publicKeyIntToXY(s)}throw new Error("Unexpected pubKeyBytes")}i(G2,"pubKeyBytesToXY");a(G2,"pubKeyBytesToXY");var qC={};Er(qC,{keyToDidDoc:()=>KC,pubKeyBytesToXY:()=>W2});function KC(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,s=W2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:s.xm,y:s.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(KC,"keyToDidDoc4");a(KC,"keyToDidDoc");function W2(e){if(!Wn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Wn.pubKeyBytesToHex(e),r=t.length/2;if(r==96)return Wn.publicKeyToXY(t);if(r==97&&t.slice(0,2)=="04"){let n=t.slice(2);return Wn.publicKeyToXY(n)}if(r==49&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=xr(t,"base16"),s=UC.ECPointDecompress(n);return Wn.publicKeyIntToXY(s)}throw new Error("Unexpected pubKeyBytes")}i(W2,"pubKeyBytesToXY2");a(W2,"pubKeyBytesToXY");var VC={};Er(VC,{keyToDidDoc:()=>GC,pubKeyBytesToXY:()=>Z2});function GC(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,s=Z2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:s.xm,y:s.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(GC,"keyToDidDoc5");a(GC,"keyToDidDoc");function Z2(e){if(!Wn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Wn.pubKeyBytesToHex(e);if(132<=t.length&&t.length<=134&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let r=xr(t,"base16"),n=jC.ECPointDecompress(r);return Wn.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}i(Z2,"pubKeyBytesToXY3");a(Z2,"pubKeyBytesToXY");var Nz="application/did+ld+json",ZA="application/did+json",Pz={231:xC,237:MC,4608:DC,4609:qC,4610:VC};function Bz(){return{key:async(e,t,r,n)=>{let s=n.accept||ZA,o={didResolutionMetadata:{contentType:s},didDocument:null,didDocumentMetadata:{}};try{let c=as.decode(t.id),l=WA.default.decode(c),h=c.slice(WA.default.decode.bytes),p=await Pz[l].keyToDidDoc(h,t.id);s===Nz?(p["@context"]="https://w3id.org/did/v1",o.didDocument=p):s===ZA?o.didDocument=p:(delete o.didResolutionMetadata.contentType,o.didResolutionMetadata.error="representationNotSupported")}catch(c){o.didResolutionMetadata.error="invalidDid",o.didResolutionMetadata.message=c.toString()}return o}}}i(Bz,"getResolver");a(Bz,"getResolver");var WC=rr(c2(),1),Lz=rr(W$(),1),Fz="base64pad";function Ib(e){return JSON.parse((0,Lz.default)(e))}i(Ib,"toStableObject");a(Ib,"toStableObject");function ZC(e){let t=new Uint8Array(e.length+2);return t[0]=237,t[1]=1,t.set(e,2),`did:key:z${Mr(t,"base58btc")}`}i(ZC,"encodeDID");a(ZC,"encodeDID");function Db(e){let[t,r,n]=e.split(".");return{payload:r,signatures:[{protected:t,signature:n}]}}i(Db,"toGeneralJWS");a(Db,"toGeneralJWS");var JA=a(async(e,t,r,n={})=>{let s=`${t}#${t.split(":")[2]}`,o=Gx(r),c=Ib(Object.assign(n,{kid:s,alg:"EdDSA"}));return xj(typeof e=="string"?e:Ib(e),o,c)},"sign"),Uz={did_authenticate:async({did:e,secretKey:t},r)=>{let n=await JA({did:e,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},e,t);return Db(n)},did_createJWS:async({did:e,secretKey:t},r)=>{if(r.did.split("#")[0]!==e)throw new po(4100,`Unknown DID: ${e}`);let s=await JA(r.payload,e,t,r.protected);return{jws:Db(s)}},did_decryptJWE:async({secretKey:e},t)=>{let r=aT((0,WC.convertSecretKeyToX25519)(e));try{let n=await Mj(t.jwe,r);return{cleartext:Mr(n,Fz)}}catch(n){throw new po(-32e3,n.message)}}},$z=i(class{constructor(e){let{secretKey:t,publicKey:r}=(0,WC.generateKeyPairFromSeed)(e),n=ZC(r),s=UM(Uz);this._handle=async o=>await s({did:n,secretKey:t},o)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}},"Ed25519Provider");a($z,"Ed25519Provider");var JC={};Er(JC,{JsonPatchError:()=>Br,_areEquals:()=>Bu,applyOperation:()=>co,applyPatch:()=>Pm,applyReducer:()=>XC,deepClone:()=>Hz,getValueByPointer:()=>Wf,validate:()=>Y2,validator:()=>Zf});var jz=function(){var e=a(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var o in s)s.hasOwnProperty(o)&&(n[o]=s[o])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),a(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),zz=Object.prototype.hasOwnProperty;function V0(e,t){return zz.call(e,t)}i(V0,"hasOwnProperty");a(V0,"hasOwnProperty");function G0(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var s in e)V0(e,s)&&n.push(s);return n}i(G0,"_objectKeys");a(G0,"_objectKeys");function Zn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(Zn,"_deepClone");a(Zn,"_deepClone");function W0(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}i(W0,"isInteger2");a(W0,"isInteger");function ao(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(ao,"escapePathComponent");a(ao,"escapePathComponent");function J2(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(J2,"unescapePathComponent");a(J2,"unescapePathComponent");function Z0(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Z0(e[t]))return!0}else if(typeof e=="object"){for(var n=G0(e),s=n.length,o=0;o<s;o++)if(Z0(e[n[o]]))return!0}}return!1}i(Z0,"hasUndefined");a(Z0,"hasUndefined");function kb(e,t){var r=[e];for(var n in t){var s=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof s<"u"&&r.push(n+": "+s)}return r.join(`
|
|
838
|
+
`)}i(kb,"patchErrorMessageFormatter");a(kb,"patchErrorMessageFormatter");var YC=function(e){jz(t,e);function t(r,n,s,o,c){var l=this.constructor,h=e.call(this,kb(r,{name:n,index:s,operation:o,tree:c}))||this;return h.name=n,h.index=s,h.operation=o,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=kb(r,{name:n,index:s,operation:o,tree:c}),h}return i(t,"PatchError2"),a(t,"PatchError"),t}(Error),Br=YC,Hz=Zn,Iu={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Wf(r,this.path);n&&(n=Zn(n));var s=co(r,{op:"remove",path:this.from}).removed;return co(r,{op:"add",path:this.path,value:s}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Wf(r,this.from);return co(r,{op:"add",path:this.path,value:Zn(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Bu(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},qz={add:function(e,t,r){return W0(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:Iu.move,copy:Iu.copy,test:Iu.test,_get:Iu._get};function Wf(e,t){if(t=="")return e;var r={op:"_get",path:t};return co(e,r),r.value}i(Wf,"getValueByPointer");a(Wf,"getValueByPointer");function co(e,t,r,n,s,o){if(r===void 0&&(r=!1),n===void 0&&(n=!0),s===void 0&&(s=!0),o===void 0&&(o=0),r&&(typeof r=="function"?r(t,0,e,t.path):Zf(t,0)),t.path===""){var c={newDocument:e};if(t.op==="add")return c.newDocument=t.value,c;if(t.op==="replace")return c.newDocument=t.value,c.removed=e,c;if(t.op==="move"||t.op==="copy")return c.newDocument=Wf(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=Bu(e,t.value),c.test===!1)throw new Br("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c.newDocument=e,c}else{if(t.op==="remove")return c.removed=e,c.newDocument=null,c;if(t.op==="_get")return t.value=e,c;if(r)throw new Br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return c}}else{n||(e=Zn(e));var l=t.path||"",h=l.split("/"),p=e,v=1,b=h.length,y=void 0,A=void 0,C=void 0;for(typeof r=="function"?C=r:C=Zf;;){if(A=h[v],A&&A.indexOf("~")!=-1&&(A=J2(A)),s&&(A=="__proto__"||A=="prototype"&&v>0&&h[v-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&y===void 0&&(p[A]===void 0?y=h.slice(0,v).join("/"):v==b-1&&(y=t.path),y!==void 0&&C(t,0,e,y)),v++,Array.isArray(p)){if(A==="-")A=p.length;else{if(r&&!W0(A))throw new Br("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);W0(A)&&(A=~~A)}if(v>=b){if(r&&t.op==="add"&&A>p.length)throw new Br("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);var c=qz[t.op].call(t,p,A,e);if(c.test===!1)throw new Br("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}}else if(v>=b){var c=Iu[t.op].call(t,p,A,e);if(c.test===!1)throw new Br("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return c}if(p=p[A],r&&v<b&&(!p||typeof p!="object"))throw new Br("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}}i(co,"applyOperation");a(co,"applyOperation");function Pm(e,t,r,n,s){if(n===void 0&&(n=!0),s===void 0&&(s=!0),r&&!Array.isArray(t))throw new Br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Zn(e));for(var o=new Array(t.length),c=0,l=t.length;c<l;c++)o[c]=co(e,t[c],r,!0,s,c),e=o[c].newDocument;return o.newDocument=e,o}i(Pm,"applyPatch");a(Pm,"applyPatch");function XC(e,t,r){var n=co(e,t);if(n.test===!1)throw new Br("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(XC,"applyReducer");a(XC,"applyReducer");function Zf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Br("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Iu[e.op]){if(typeof e.path!="string")throw new Br("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Br('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new Br("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new Br("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Z0(e.value))throw new Br("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var s=e.path.split("/").length,o=n.split("/").length;if(s!==o+1&&s!==o)throw new Br("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new Br("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var c={op:"_get",path:e.from,value:void 0},l=Y2([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Br("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Br("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(Zf,"validator");a(Zf,"validator");function Y2(e,t,r){try{if(!Array.isArray(e))throw new Br("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Pm(Zn(t),Zn(e),r||!0);else{r=r||Zf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(s){if(s instanceof Br)return s;throw s}}i(Y2,"validate5");a(Y2,"validate");function Bu(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),s,o,c;if(r&&n){if(o=e.length,o!=t.length)return!1;for(s=o;s--!==0;)if(!Bu(e[s],t[s]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(o=l.length,o!==Object.keys(t).length)return!1;for(s=o;s--!==0;)if(!t.hasOwnProperty(l[s]))return!1;for(s=o;s--!==0;)if(c=l[s],!Bu(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(Bu,"_areEquals");a(Bu,"_areEquals");var QC={};Er(QC,{compare:()=>sI,generate:()=>J0,observe:()=>iI,unobserve:()=>nI});var X2=new WeakMap,Kz=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror2"),a(e,"Mirror"),e}(),Vz=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo2"),a(e,"ObserverInfo"),e}();function eI(e){return X2.get(e)}i(eI,"getMirror");a(eI,"getMirror");function tI(e,t){return e.observers.get(t)}i(tI,"getObserverFromMirror");a(tI,"getObserverFromMirror");function rI(e,t){e.observers.delete(t.callback)}i(rI,"removeObserverFromMirror");a(rI,"removeObserverFromMirror");function nI(e,t){t.unobserve()}i(nI,"unobserve");a(nI,"unobserve");function iI(e,t){var r=[],n,s=eI(e);if(!s)s=new Kz(e),X2.set(e,s);else{var o=tI(s,t);n=o&&o.observer}if(n)return n;if(n={},s.value=Zn(e),t){n.callback=t,n.next=null;var c=a(function(){J0(n)},"dirtyCheck"),l=a(function(){clearTimeout(n.next),n.next=setTimeout(c)},"fastCheck");typeof window<"u"&&(window.addEventListener("mouseup",l),window.addEventListener("keyup",l),window.addEventListener("mousedown",l),window.addEventListener("keydown",l),window.addEventListener("change",l))}return n.patches=r,n.object=e,n.unobserve=function(){J0(n),clearTimeout(n.next),rI(s,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},s.observers.set(t,new Vz(t,n)),n}i(iI,"observe");a(iI,"observe");function J0(e,t){t===void 0&&(t=!1);var r=X2.get(e.object);Bm(r.value,e.object,e.patches,"",t),e.patches.length&&Pm(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(J0,"generate2");a(J0,"generate");function Bm(e,t,r,n,s){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var o=G0(t),c=G0(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var v=c[p],b=e[v];if(V0(t,v)&&!(t[v]===void 0&&b!==void 0&&Array.isArray(t)===!1)){var y=t[v];typeof b=="object"&&b!=null&&typeof y=="object"&&y!=null&&Array.isArray(b)===Array.isArray(y)?Bm(b,y,r,n+"/"+ao(v),s):b!==y&&(l=!0,s&&r.push({op:"test",path:n+"/"+ao(v),value:Zn(b)}),r.push({op:"replace",path:n+"/"+ao(v),value:Zn(y)}))}else Array.isArray(e)===Array.isArray(t)?(s&&r.push({op:"test",path:n+"/"+ao(v),value:Zn(b)}),r.push({op:"remove",path:n+"/"+ao(v)}),h=!0):(s&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&o.length==c.length))for(var p=0;p<o.length;p++){var v=o[p];!V0(e,v)&&t[v]!==void 0&&r.push({op:"add",path:n+"/"+ao(v),value:Zn(t[v])})}}}i(Bm,"_generate");a(Bm,"_generate");function sI(e,t,r){r===void 0&&(r=!1);var n=[];return Bm(e,t,n,"",r),n}i(sI,"compare3");a(sI,"compare");var aI=Object.assign({},JC,QC,{JsonPatchError:YC,deepClone:Zn,escapePathComponent:ao,unescapePathComponent:J2}),Gz=rr(dd(),1),Wz=rr(Xu(),1),Yn;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(Yn||(Yn={}));var YA=rr(dd(),1);zs();ud();var oI={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function cI(e){let t=oI[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(cI,"codeByName");a(cI,"codeByName");function uI(e){let t=Object.entries(oI).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(uI,"nameByCode");a(uI,"nameByCode");var wa=i(class{},"StreamType");a(wa,"StreamType");wa.nameByCode=uI;wa.codeByName=cI;var XA=rr(vm(),1);function Ki(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(s,o,c)=>{if(c.value!=null)c.value=Ob(c.value,t,r,n);else if(c.get!=null)c.get=Ob(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(Ki,"Memoize");a(Ki,"Memoize");var Gy=new Map;function Ob(e,t,r=0,n){let s=Symbol("__memoized_map__");return function(...o){let c;this.hasOwnProperty(s)||Object.defineProperty(this,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[s];if(Array.isArray(n))for(let h of n)Gy.has(h)?Gy.get(h).push(l):Gy.set(h,[l]);if(t||o.length>0||r>0){let h;t===!0?h=o.map(b=>b.toString()).join("!"):t?h=t.apply(this,o):h=o[0];let p=`${h}__timestamp`,v=!1;if(r>0)if(!l.has(p))v=!0;else{let b=l.get(p);v=Date.now()-b>r}l.has(h)&&!v?c=l.get(h):(c=e.apply(this,o),l.set(h,c),r>0&&l.set(p,Date.now()))}else{let h=this;l.has(h)?c=l.get(h):(c=e.apply(this,o),l.set(h,c))}return c}}i(Ob,"getNewFunction");a(Ob,"getNewFunction");var Q2=206;zs();ud();lm();var QA=rr(vm(),1);function bd(e){try{return e()}catch(t){return t}}i(bd,"tryCatch");a(bd,"tryCatch");zs();var eS=rr(vm(),1);Zu();function hc(e){let t=eS.default.decode(e),r=eS.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(hc,"readVarint");a(hc,"readVarint");function lI(e){return e===0||e===1}i(lI,"isCidVersion");a(lI,"isCidVersion");function Rb(e){let[t,r]=hc(e);if(!lI(t))throw new Error(`Unknown CID version ${t}`);let[n,s]=hc(r),[,o,c]=hc(s),[l,,h]=hc(o),p=s.subarray(0,c+h+l),v=s.subarray(c+h+l);return[Ht.create(t,n,i2(p)),v]}i(Rb,"readCid");a(Rb,"readCid");zs();ud();function _d(e,t="StreamRef"){let[r,n]=hc(e);if(r!==Q2)throw new Error(`Invalid ${t}, does not include streamid codec`);let[s,o]=hc(n),c=Rb(o),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:s,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:s,genesis:l,commit:null};{let[p]=Rb(h);return{kind:"commit-id",type:s,genesis:l,commit:p}}}i(_d,"fromBytes");a(_d,"fromBytes");var Zz=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Lm(e,t="StreamRef"){let r=Zz.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let s=wo.decode(n),o=_d(s),c=r[4];return c?{kind:"commit-id",type:o.type,genesis:o.genesis,commit:e6(o.genesis,c)}:o}i(Lm,"fromString4");a(Lm,"fromString");function fI(e){try{return typeof e=="string"?Ht.parse(e):Ht.asCID(e)}catch{return null}}i(fI,"parseCID");a(fI,"parseCID");function e6(e,t=null){if(!t||t==="0")return null;let r=fI(t);if(r)return e.equals(r)?null:r;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}i(e6,"parseCommit");a(e6,"parseCommit");var wd=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate"),zi=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata"),dI=i(class extends Error{constructor(e){super(`Invalid StreamID bytes ${wo.encode(e)}: contains commit`)}},"InvalidStreamIDBytesError");a(dI,"InvalidStreamIDBytesError");var hI=i(class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}},"InvalidStreamIDStringError");a(hI,"InvalidStreamIDStringError");function t6(e){let t=_d(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new dI(e)}i(t6,"fromBytes2");a(t6,"fromBytes");function pI(e){return bd(()=>t6(e))}i(pI,"fromBytesNoThrow");a(pI,"fromBytesNoThrow");function r6(e){let t=Lm(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new hI(e)}i(r6,"fromString5");a(r6,"fromString");function mI(e){return bd(()=>r6(e))}i(mI,"fromStringNoThrow");a(mI,"fromStringNoThrow");var tS=Symbol.for("@ceramicnetwork/streamid/StreamID"),Xt=i(class{constructor(e,t){if(this._tag=tS,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?wa.codeByName(e):e,this._cid=typeof t=="string"?Ht.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===tS}static async fromGenesis(e,t){let r=await bm({value:t,codec:tl,hasher:Ju});return new Xt(e,r.cid)}get type(){return this._type}get typeName(){return wa.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=QA.default.encode(Q2),t=QA.default.encode(this.type);return lo([e,t,this.cid.bytes])}get baseID(){return new Xt(this._type,this._cid)}equals(e){return Xt.isInstance(e)?this.type===e.type&&this.cid.equals(e.cid):!1}toString(){return wo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"StreamID");a(Xt,"StreamID");Xt.fromBytes=t6;Xt.fromBytesNoThrow=pI;Xt.fromString=r6;Xt.fromStringNoThrow=mI;wd([Ki(),zi("design:type",String),zi("design:paramtypes",[])],Xt.prototype,"typeName",null);wd([Ki(),zi("design:type",Uint8Array),zi("design:paramtypes",[])],Xt.prototype,"bytes",null);wd([Ki(),zi("design:type",Xt),zi("design:paramtypes",[])],Xt.prototype,"baseID",null);wd([Ki(),zi("design:type",Function),zi("design:paramtypes",[]),zi("design:returntype",String)],Xt.prototype,"toString",null);wd([Ki(),zi("design:type",Function),zi("design:paramtypes",[]),zi("design:returntype",String)],Xt.prototype,"toUrl",null);var ul=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate2"),Jn=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata2"),Wy=i(function(e,t,r,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(e,r):s?s.value=r:t.set(e,r),r},"__classPrivateFieldSet"),ma=i(function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},"__classPrivateFieldGet"),Tu,lc,Rf,vI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${wo.encode(e)}: no commit information provided`)}},"InvalidCommitIDBytesError");a(vI,"InvalidCommitIDBytesError");var gI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}},"InvalidCommitIDStringError");a(gI,"InvalidCommitIDStringError");function n6(e){let t=_d(e,"CommitID");if(t.kind==="commit-id")return new _r(t.type,t.genesis,t.commit);throw new vI(e)}i(n6,"fromBytes3");a(n6,"fromBytes");function yI(e){return bd(()=>n6(e))}i(yI,"fromBytesNoThrow2");a(yI,"fromBytesNoThrow");function i6(e){let t=Lm(e,"CommitID");if(t.kind==="commit-id")return new _r(t.type,t.genesis,t.commit);throw new gI(e)}i(i6,"fromString6");a(i6,"fromString");function bI(e){return bd(()=>i6(e))}i(bI,"fromStringNoThrow2");a(bI,"fromStringNoThrow");var rS=Symbol.for("@ceramicnetwork/streamid/CommitID");function _I(e,t){return new _r(e.type,e.cid,t)}i(_I,"make");a(_I,"make");var _r=i(class{constructor(e,t,r=null){if(this._tag=rS,Tu.set(this,void 0),lc.set(this,void 0),Rf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");Wy(this,Tu,typeof e=="string"?wa.codeByName(e):e,"f"),Wy(this,lc,typeof t=="string"?Ht.parse(t):t,"f"),Wy(this,Rf,e6(ma(this,lc,"f"),r),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===rS}get baseID(){return new Xt(ma(this,Tu,"f"),ma(this,lc,"f"))}get type(){return ma(this,Tu,"f")}get typeName(){return wa.nameByCode(ma(this,Tu,"f"))}get cid(){return ma(this,lc,"f")}get commit(){return ma(this,Rf,"f")||ma(this,lc,"f")}get bytes(){let e=XA.default.encode(Q2),t=XA.default.encode(this.type),r=ma(this,Rf,"f")?.bytes||new Uint8Array([0]);return lo([e,t,this.cid.bytes,r])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return wo.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Tu=new WeakMap,lc=new WeakMap,Rf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"CommitID");a(_r,"CommitID");_r.fromBytes=n6;_r.fromBytesNoThrow=yI;_r.fromString=i6;_r.fromStringNoThrow=bI;_r.make=_I;ul([Ki(),Jn("design:type",Xt),Jn("design:paramtypes",[])],_r.prototype,"baseID",null);ul([Ki(),Jn("design:type",String),Jn("design:paramtypes",[])],_r.prototype,"typeName",null);ul([Ki(),Jn("design:type",Ht),Jn("design:paramtypes",[])],_r.prototype,"commit",null);ul([Ki(),Jn("design:type",Uint8Array),Jn("design:paramtypes",[])],_r.prototype,"bytes",null);ul([Ki(),Jn("design:type",Function),Jn("design:paramtypes",[]),Jn("design:returntype",String)],_r.prototype,"toString",null);ul([Ki(),Jn("design:type",Function),Jn("design:paramtypes",[]),Jn("design:returntype",String)],_r.prototype,"toUrl",null);ud();var mo;(function(e){function t(s){let o=_d(s);switch(o.kind){case"commit-id":return new _r(o.type,o.genesis,o.commit);case"stream-id":return new Xt(o.type,o.genesis);default:throw new Error(`Malformed StreamRef bytes: ${wo.encode(s)}`)}}i(t,"fromBytes4"),a(t,"fromBytes"),e.fromBytes=t;function r(s){let o=Lm(s);switch(o.kind){case"commit-id":return new _r(o.type,o.genesis,o.commit);case"stream-id":return new Xt(o.type,o.genesis);default:throw new Error(`Malformed StreamRef string: ${s}`)}}i(r,"fromString7"),a(r,"fromString"),e.fromString=r;function n(s){if(Xt.isInstance(s)||_r.isInstance(s))return s;if(s instanceof Uint8Array)return t(s);if(typeof s=="string")return r(s);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(s)}`)}i(n,"from4"),a(n,"from"),e.from=n})(mo||(mo={}));var Jz=rr(Z$(),1),{__extends:Ta,__assign:tY,__rest:rY,__decorate:nY,__param:iY,__esDecorate:sY,__runInitializers:aY,__propKey:oY,__setFunctionName:cY,__metadata:uY,__awaiter:Yz,__generator:wI,__exportStar:lY,__createBinding:fY,__values:Y0,__read:vo,__spread:dY,__spreadArrays:hY,__spreadArray:bc,__await:Zy,__asyncGenerator:Xz,__asyncDelegator:pY,__asyncValues:Qz,__makeTemplateObject:mY,__importStar:vY,__importDefault:gY,__classPrivateFieldGet:yY,__classPrivateFieldSet:bY,__classPrivateFieldIn:_Y}=Jz.default;function wr(e){return typeof e=="function"}i(wr,"isFunction");a(wr,"isFunction");function Fm(e){var t=a(function(n){Error.call(n),n.stack=new Error().stack},"_super"),r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}i(Fm,"createErrorClass");a(Fm,"createErrorClass");var Jy=Fm(function(e){return a(i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
|
|
839
|
+
`+r.map(function(n,s){return s+1+") "+n.toString()}).join(`
|
|
840
|
+
`):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl"),"UnsubscriptionErrorImpl")});function Jf(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(Jf,"arrRemove");a(Jf,"arrRemove");var Ed=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription2"),a(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,s,o;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Y0(c),h=l.next();!h.done;h=l.next()){var p=h.value;p.remove(this)}}catch(O){t={error:O}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(t)throw t.error}}else c.remove(this);var v=this.initialTeardown;if(wr(v))try{v()}catch(O){o=O instanceof Jy?O.errors:[O]}var b=this._finalizers;if(b){this._finalizers=null;try{for(var y=Y0(b),A=y.next();!A.done;A=y.next()){var C=A.value;try{Nb(C)}catch(O){o=o??[],O instanceof Jy?o=bc(bc([],vo(o)),vo(O.errors)):o.push(O)}}}catch(O){n={error:O}}finally{try{A&&!A.done&&(s=y.return)&&s.call(y)}finally{if(n)throw n.error}}}if(o)throw new Jy(o)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Nb(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Jf(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Jf(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),EI=Ed.EMPTY;function s6(e){return e instanceof Ed||e&&"closed"in e&&wr(e.remove)&&wr(e.add)&&wr(e.unsubscribe)}i(s6,"isSubscription");a(s6,"isSubscription");function Nb(e){wr(e)?e():e.unsubscribe()}i(Nb,"execFinalizer");a(Nb,"execFinalizer");var Rc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},X0={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var s=X0.delegate;return s?.setTimeout?s.setTimeout.apply(s,bc([e,t],vo(r))):setTimeout.apply(void 0,bc([e,t],vo(r)))},clearTimeout:function(e){var t=X0.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function a6(e){X0.setTimeout(function(){var t=Rc.onUnhandledError;if(t)t(e);else throw e})}i(a6,"reportUnhandledError");a(a6,"reportUnhandledError");function Pb(){}i(Pb,"noop");a(Pb,"noop");var eH=function(){return Um("C",void 0,void 0)}();function AI(e){return Um("E",void 0,e)}i(AI,"errorNotification");a(AI,"errorNotification");function SI(e){return Um("N",e,void 0)}i(SI,"nextNotification");a(SI,"nextNotification");function Um(e,t,r){return{kind:e,value:t,error:r}}i(Um,"createNotification");a(Um,"createNotification");var pc=null;function $f(e){if(Rc.useDeprecatedSynchronousErrorHandling){var t=!pc;if(t&&(pc={errorThrown:!1,error:null}),e(),t){var r=pc,n=r.errorThrown,s=r.error;if(pc=null,n)throw s}}else e()}i($f,"errorContext");a($f,"errorContext");function xI(e){Rc.useDeprecatedSynchronousErrorHandling&&pc&&(pc.errorThrown=!0,pc.error=e)}i(xI,"captureError");a(xI,"captureError");var o6=function(e){Ta(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,s6(r)&&r.add(n)):n.destination=nH,n}return i(t,"Subscriber2"),a(t,"Subscriber"),t.create=function(r,n,s){return new Bb(r,n,s)},t.prototype.next=function(r){this.isStopped?E0(SI(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?E0(AI(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?E0(eH,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Ed),tH=Function.prototype.bind;function w0(e,t){return tH.call(e,t)}i(w0,"bind");a(w0,"bind");var rH=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver2"),a(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Lf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Lf(n)}else Lf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Lf(r)}},e}(),Bb=function(e){Ta(t,e);function t(r,n,s){var o=e.call(this)||this,c;if(wr(r)||!r)c={next:r??void 0,error:n??void 0,complete:s??void 0};else{var l;o&&Rc.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return o.unsubscribe()},c={next:r.next&&w0(r.next,l),error:r.error&&w0(r.error,l),complete:r.complete&&w0(r.complete,l)}):c=r}return o.destination=new rH(c),o}return i(t,"SafeSubscriber2"),a(t,"SafeSubscriber"),t}(o6);function Lf(e){Rc.useDeprecatedSynchronousErrorHandling?xI(e):a6(e)}i(Lf,"handleUnhandledError");a(Lf,"handleUnhandledError");function TI(e){throw e}i(TI,"defaultErrorHandler");a(TI,"defaultErrorHandler");function E0(e,t){var r=Rc.onStoppedNotification;r&&X0.setTimeout(function(){return r(e,t)})}i(E0,"handleStoppedNotification");a(E0,"handleStoppedNotification");var nH={closed:!0,next:Pb,error:TI,complete:Pb},c6=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function $m(e){return e}i($m,"identity3");a($m,"identity");function MI(e){return e.length===0?$m:e.length===1?e[0]:a(i(function(r){return e.reduce(function(n,s){return s(n)},r)},"piped"),"piped")}i(MI,"pipeFromArray");a(MI,"pipeFromArray");var ln=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable2"),a(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var s=this,o=II(t)?t:new Bb(t,r,n);return $f(function(){var c=s,l=c.operator,h=c.source;o.add(l?l.call(o,h):h?s._subscribe(o):s._trySubscribe(o))}),o},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=Lb(r),new r(function(s,o){var c=new Bb({next:function(l){try{t(l)}catch(h){o(h),c.unsubscribe()}},error:o,complete:s});n.subscribe(c)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[c6]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return MI(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Lb(t),new t(function(n,s){var o;r.subscribe(function(c){return o=c},function(c){return s(c)},function(){return n(o)})})},e.create=function(t){return new e(t)},e}();function Lb(e){var t;return(t=e??Rc.Promise)!==null&&t!==void 0?t:Promise}i(Lb,"getPromiseCtor");a(Lb,"getPromiseCtor");function CI(e){return e&&wr(e.next)&&wr(e.error)&&wr(e.complete)}i(CI,"isObserver");a(CI,"isObserver");function II(e){return e&&e instanceof o6||CI(e)&&s6(e)}i(II,"isSubscriber");a(II,"isSubscriber");function DI(e){return wr(e?.lift)}i(DI,"hasLift");a(DI,"hasLift");function Vs(e){return function(t){if(DI(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}i(Vs,"operate");a(Vs,"operate");function ds(e,t,r,n,s){return new iH(e,t,r,n,s)}i(ds,"createOperatorSubscriber");a(ds,"createOperatorSubscriber");var iH=function(e){Ta(t,e);function t(r,n,s,o,c,l){var h=e.call(this,r)||this;return h.onFinalize=c,h.shouldUnsubscribe=l,h._next=n?function(p){try{n(p)}catch(v){r.error(v)}}:e.prototype._next,h._error=o?function(p){try{o(p)}catch(v){r.error(v)}finally{this.unsubscribe()}}:e.prototype._error,h._complete=s?function(){try{s()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,h}return i(t,"OperatorSubscriber2"),a(t,"OperatorSubscriber"),t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(o6),sH=Fm(function(e){return a(i(function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl"),"ObjectUnsubscribedErrorImpl")}),kI=function(e){Ta(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return i(t,"Subject2"),a(t,"Subject"),t.prototype.lift=function(r){var n=new nS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new sH},t.prototype.next=function(r){var n=this;$f(function(){var s,o;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=Y0(n.currentObservers),l=c.next();!l.done;l=c.next()){var h=l.value;h.next(r)}}catch(p){s={error:p}}finally{try{l&&!l.done&&(o=c.return)&&o.call(c)}finally{if(s)throw s.error}}}})},t.prototype.error=function(r){var n=this;$f(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var s=n.observers;s.length;)s.shift().error(r)}})},t.prototype.complete=function(){var r=this;$f(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,s=this,o=s.hasError,c=s.isStopped,l=s.observers;return o||c?EI:(this.currentObservers=null,l.push(r),new Ed(function(){n.currentObservers=null,Jf(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,s=n.hasError,o=n.thrownError,c=n.isStopped;s?r.error(o):c&&r.complete()},t.prototype.asObservable=function(){var r=new ln;return r.source=this,r},t.create=function(r,n){return new nS(r,n)},t}(ln),nS=function(e){Ta(t,e);function t(r,n){var s=e.call(this)||this;return s.destination=r,s.source=n,s}return i(t,"AnonymousSubject2"),a(t,"AnonymousSubject"),t.prototype.next=function(r){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.next)===null||s===void 0||s.call(n,r)},t.prototype.error=function(r){var n,s;(s=(n=this.destination)===null||n===void 0?void 0:n.error)===null||s===void 0||s.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,s;return(s=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&s!==void 0?s:EI},t}(kI),aH=function(e){Ta(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return i(t,"BehaviorSubject2"),a(t,"BehaviorSubject"),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(r){var n=e.prototype._subscribe.call(this,r);return!n.closed&&r.next(this._value),n},t.prototype.getValue=function(){var r=this,n=r.hasError,s=r.thrownError,o=r._value;if(n)throw s;return this._throwIfClosed(),o},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(kI),OI={now:function(){return(OI.delegate||Date).now()},delegate:void 0},oH=function(e){Ta(t,e);function t(r,n){return e.call(this)||this}return i(t,"Action2"),a(t,"Action"),t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(Ed),Q0={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var s=Q0.delegate;return s?.setInterval?s.setInterval.apply(s,bc([e,t],vo(r))):setInterval.apply(void 0,bc([e,t],vo(r)))},clearInterval:function(e){var t=Q0.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},cH=function(e){Ta(t,e);function t(r,n){var s=e.call(this,r,n)||this;return s.scheduler=r,s.work=n,s.pending=!1,s}return i(t,"AsyncAction2"),a(t,"AsyncAction"),t.prototype.schedule=function(r,n){var s;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var o=this.id,c=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(c,o,n)),this.pending=!0,this.delay=n,this.id=(s=this.id)!==null&&s!==void 0?s:this.requestAsyncId(c,this.id,n),this},t.prototype.requestAsyncId=function(r,n,s){return s===void 0&&(s=0),Q0.setInterval(r.flush.bind(r,this),s)},t.prototype.recycleAsyncId=function(r,n,s){if(s===void 0&&(s=0),s!=null&&this.delay===s&&this.pending===!1)return n;n!=null&&Q0.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var s=this._execute(r,n);if(s)return s;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var s=!1,o;try{this.work(r)}catch(c){s=!0,o=c||new Error("Scheduled action threw falsy error")}if(s)return this.unsubscribe(),o},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,s=r.scheduler,o=s.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Jf(o,this),n!=null&&(this.id=this.recycleAsyncId(s,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(oH),iS=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return i(e,"Scheduler2"),a(e,"Scheduler"),e.prototype.schedule=function(t,r,n){return r===void 0&&(r=0),new this.schedulerActionCtor(this,t).schedule(n,r)},e.now=OI.now,e}(),uH=function(e){Ta(t,e);function t(r,n){n===void 0&&(n=iS.now);var s=e.call(this,r,n)||this;return s.actions=[],s._active=!1,s}return i(t,"AsyncScheduler2"),a(t,"AsyncScheduler"),t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var s;this._active=!0;do if(s=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,s){for(;r=n.shift();)r.unsubscribe();throw s}},t}(iS),lH=new uH(cH),fH=lH,RI=new ln(function(e){return e.complete()});function u6(e){return e&&wr(e.schedule)}i(u6,"isScheduler");a(u6,"isScheduler");function l6(e){return e[e.length-1]}i(l6,"last");a(l6,"last");function NI(e){return u6(l6(e))?e.pop():void 0}i(NI,"popScheduler");a(NI,"popScheduler");function PI(e,t){return typeof l6(e)=="number"?e.pop():t}i(PI,"popNumber");a(PI,"popNumber");var f6=a(function(e){return e&&typeof e.length=="number"&&typeof e!="function"},"isArrayLike");function d6(e){return wr(e?.then)}i(d6,"isPromise");a(d6,"isPromise");function h6(e){return wr(e[c6])}i(h6,"isInteropObservable");a(h6,"isInteropObservable");function p6(e){return Symbol.asyncIterator&&wr(e?.[Symbol.asyncIterator])}i(p6,"isAsyncIterable");a(p6,"isAsyncIterable");function m6(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}i(m6,"createInvalidObservableTypeError");a(m6,"createInvalidObservableTypeError");function BI(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}i(BI,"getSymbolIterator");a(BI,"getSymbolIterator");var LI=BI();function v6(e){return wr(e?.[LI])}i(v6,"isIterable");a(v6,"isIterable");function g6(e){return Xz(this,arguments,a(i(function(){var r,n,s,o;return wI(this,function(c){switch(c.label){case 0:r=e.getReader(),c.label=1;case 1:c.trys.push([1,,9,10]),c.label=2;case 2:return[4,Zy(r.read())];case 3:return n=c.sent(),s=n.value,o=n.done,o?[4,Zy(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Zy(s)];case 6:return[4,c.sent()];case 7:return c.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})},"readableStreamLikeToAsyncGenerator_1"),"readableStreamLikeToAsyncGenerator_1"))}i(g6,"readableStreamLikeToAsyncGenerator");a(g6,"readableStreamLikeToAsyncGenerator");function y6(e){return wr(e?.getReader)}i(y6,"isReadableStreamLike");a(y6,"isReadableStreamLike");function Ma(e){if(e instanceof ln)return e;if(e!=null){if(h6(e))return FI(e);if(f6(e))return UI(e);if(d6(e))return $I(e);if(p6(e))return b6(e);if(v6(e))return jI(e);if(y6(e))return zI(e)}throw m6(e)}i(Ma,"innerFrom");a(Ma,"innerFrom");function FI(e){return new ln(function(t){var r=e[c6]();if(wr(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}i(FI,"fromInteropObservable");a(FI,"fromInteropObservable");function UI(e){return new ln(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}i(UI,"fromArrayLike");a(UI,"fromArrayLike");function $I(e){return new ln(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,a6)})}i($I,"fromPromise");a($I,"fromPromise");function jI(e){return new ln(function(t){var r,n;try{for(var s=Y0(e),o=s.next();!o.done;o=s.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(l){r={error:l}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}t.complete()})}i(jI,"fromIterable");a(jI,"fromIterable");function b6(e){return new ln(function(t){HI(e,t).catch(function(r){return t.error(r)})})}i(b6,"fromAsyncIterable");a(b6,"fromAsyncIterable");function zI(e){return b6(g6(e))}i(zI,"fromReadableStreamLike");a(zI,"fromReadableStreamLike");function HI(e,t){var r,n,s,o;return Yz(this,void 0,void 0,function(){var c,l;return wI(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),r=Qz(e),h.label=1;case 1:return[4,r.next()];case 2:if(n=h.sent(),!!n.done)return[3,4];if(c=n.value,t.next(c),t.closed)return[2];h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=h.sent(),s={error:l},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(s)throw s.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}i(HI,"process2");a(HI,"process");function ba(e,t,r,n,s){n===void 0&&(n=0),s===void 0&&(s=!1);var o=t.schedule(function(){r(),s?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!s)return o}i(ba,"executeSchedule");a(ba,"executeSchedule");function _6(e,t){return t===void 0&&(t=0),Vs(function(r,n){r.subscribe(ds(n,function(s){return ba(n,e,function(){return n.next(s)},t)},function(){return ba(n,e,function(){return n.complete()},t)},function(s){return ba(n,e,function(){return n.error(s)},t)}))})}i(_6,"observeOn");a(_6,"observeOn");function w6(e,t){return t===void 0&&(t=0),Vs(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}i(w6,"subscribeOn");a(w6,"subscribeOn");function qI(e,t){return Ma(e).pipe(w6(t),_6(t))}i(qI,"scheduleObservable");a(qI,"scheduleObservable");function KI(e,t){return Ma(e).pipe(w6(t),_6(t))}i(KI,"schedulePromise");a(KI,"schedulePromise");function VI(e,t){return new ln(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}i(VI,"scheduleArray");a(VI,"scheduleArray");function GI(e,t){return new ln(function(r){var n;return ba(r,t,function(){n=e[LI](),ba(r,t,function(){var s,o,c;try{s=n.next(),o=s.value,c=s.done}catch(l){r.error(l);return}c?r.complete():r.next(o)},0,!0)}),function(){return wr(n?.return)&&n.return()}})}i(GI,"scheduleIterable");a(GI,"scheduleIterable");function E6(e,t){if(!e)throw new Error("Iterable cannot be null");return new ln(function(r){ba(r,t,function(){var n=e[Symbol.asyncIterator]();ba(r,t,function(){n.next().then(function(s){s.done?r.complete():r.next(s.value)})},0,!0)})})}i(E6,"scheduleAsyncIterable");a(E6,"scheduleAsyncIterable");function WI(e,t){return E6(g6(e),t)}i(WI,"scheduleReadableStreamLike");a(WI,"scheduleReadableStreamLike");function ZI(e,t){if(e!=null){if(h6(e))return qI(e,t);if(f6(e))return VI(e,t);if(d6(e))return KI(e,t);if(p6(e))return E6(e,t);if(v6(e))return GI(e,t);if(y6(e))return WI(e,t)}throw m6(e)}i(ZI,"scheduled");a(ZI,"scheduled");function JI(e,t){return t?ZI(e,t):Ma(e)}i(JI,"from3");a(JI,"from");var YI=Fm(function(e){return a(i(function(){e(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl"),"EmptyErrorImpl")});function XI(e){return e instanceof Date&&!isNaN(e)}i(XI,"isValidDate");a(XI,"isValidDate");function A6(e,t){return Vs(function(r,n){var s=0;r.subscribe(ds(n,function(o){n.next(e.call(t,o,s++))}))})}i(A6,"map");a(A6,"map");var dH=Array.isArray;function QI(e,t){return dH(t)?e.apply(void 0,bc([],vo(t))):e(t)}i(QI,"callOrApply");a(QI,"callOrApply");function eD(e){return A6(function(t){return QI(e,t)})}i(eD,"mapOneOrManyArgs");a(eD,"mapOneOrManyArgs");function tD(e,t,r,n,s,o,c,l){var h=[],p=0,v=0,b=!1,y=a(function(){b&&!h.length&&!p&&t.complete()},"checkComplete"),A=a(function(O){return p<n?C(O):h.push(O)},"outerNext"),C=a(function(O){o&&t.next(O),p++;var R=!1;Ma(r(O,v++)).subscribe(ds(t,function(L){s?.(L),o?A(L):t.next(L)},function(){R=!0},void 0,function(){if(R)try{p--;for(var L=a(function(){var K=h.shift();c?ba(t,c,function(){return C(K)}):C(K)},"_loop_1");h.length&&p<n;)L();y()}catch(K){t.error(K)}}))},"doInnerSub");return e.subscribe(ds(t,A,function(){b=!0,y()})),function(){l?.()}}i(tD,"mergeInternals");a(tD,"mergeInternals");function jm(e,t,r){return r===void 0&&(r=1/0),wr(t)?jm(function(n,s){return A6(function(o,c){return t(n,o,s,c)})(Ma(e(n,s)))},r):(typeof t=="number"&&(r=t),Vs(function(n,s){return tD(n,s,e,r)}))}i(jm,"mergeMap");a(jm,"mergeMap");function rD(e){return e===void 0&&(e=1/0),jm($m,e)}i(rD,"mergeAll");a(rD,"mergeAll");var hH=["addListener","removeListener"],pH=["addEventListener","removeEventListener"],mH=["on","off"];function em(e,t,r,n){if(wr(r)&&(n=r,r=void 0),n)return em(e,t,r).pipe(eD(n));var s=vo(sD(e)?pH.map(function(l){return function(h){return e[l](t,h,r)}}):nD(e)?hH.map(Fb(e,t)):iD(e)?mH.map(Fb(e,t)):[],2),o=s[0],c=s[1];if(!o&&f6(e))return jm(function(l){return em(l,t,r)})(Ma(e));if(!o)throw new TypeError("Invalid event target");return new ln(function(l){var h=a(function(){for(var p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];return l.next(1<p.length?p:p[0])},"handler");return o(h),function(){return c(h)}})}i(em,"fromEvent");a(em,"fromEvent");function Fb(e,t){return function(r){return function(n){return e[r](t,n)}}}i(Fb,"toCommonHandlerRegistry");a(Fb,"toCommonHandlerRegistry");function nD(e){return wr(e.addListener)&&wr(e.removeListener)}i(nD,"isNodeStyleEventEmitter");a(nD,"isNodeStyleEventEmitter");function iD(e){return wr(e.on)&&wr(e.off)}i(iD,"isJQueryStyleEventEmitter");a(iD,"isJQueryStyleEventEmitter");function sD(e){return wr(e.addEventListener)&&wr(e.removeEventListener)}i(sD,"isEventTarget");a(sD,"isEventTarget");function S6(e,t,r){e===void 0&&(e=0),r===void 0&&(r=fH);var n=-1;return t!=null&&(u6(t)?r=t:n=t),new ln(function(s){var o=XI(e)?+e-r.now():e;o<0&&(o=0);var c=0;return r.schedule(function(){s.closed||(s.next(c++),0<=n?this.schedule(void 0,n):s.complete())},o)})}i(S6,"timer");a(S6,"timer");function aD(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=NI(e),n=PI(e,1/0),s=e;return s.length?s.length===1?Ma(s[0]):rD(n)(JI(s,r)):RI}i(aD,"merge");a(aD,"merge");function oD(e,t){return Vs(function(r,n){var s=0;r.subscribe(ds(n,function(o){return e.call(t,o,s++)&&n.next(o)}))})}i(oD,"filter");a(oD,"filter");function cD(e){return Vs(function(t,r){var n=!1;t.subscribe(ds(r,function(s){n=!0,r.next(s)},function(){n||r.next(e),r.complete()}))})}i(cD,"defaultIfEmpty");a(cD,"defaultIfEmpty");function uD(e){return e<=0?function(){return RI}:Vs(function(t,r){var n=0;t.subscribe(ds(r,function(s){++n<=e&&(r.next(s),e<=n&&r.complete())}))})}i(uD,"take");a(uD,"take");function lD(e){return e===void 0&&(e=fD),Vs(function(t,r){var n=!1;t.subscribe(ds(r,function(s){n=!0,r.next(s)},function(){return n?r.complete():r.error(e())}))})}i(lD,"throwIfEmpty");a(lD,"throwIfEmpty");function fD(){return new YI}i(fD,"defaultErrorFactory");a(fD,"defaultErrorFactory");function dD(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?oD(function(s,o){return e(s,o,n)}):$m,uD(1),r?cD(t):lD(function(){return new YI}))}}i(dD,"first");a(dD,"first");var vH={leading:!0,trailing:!1};function hD(e,t){return t===void 0&&(t=vH),Vs(function(r,n){var s=t.leading,o=t.trailing,c=!1,l=null,h=null,p=!1,v=a(function(){h?.unsubscribe(),h=null,o&&(A(),p&&n.complete())},"endThrottling"),b=a(function(){h=null,p&&n.complete()},"cleanupThrottling"),y=a(function(C){return h=Ma(e(C)).subscribe(ds(n,v,b))},"startThrottle"),A=a(function(){if(c){c=!1;var C=l;l=null,n.next(C),!p&&y(C)}},"send");r.subscribe(ds(n,function(C){c=!0,l=C,!(h&&!h.closed)&&(s?A():y(C))},function(){p=!0,!(o&&c&&h&&!h.closed)&&n.complete()}))})}i(hD,"throttle");a(hD,"throttle");var sS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(sS||(sS={}));var tm;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(tm||(tm={}));var Ub;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Ub||(Ub={}));var zm=i(class extends ln{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,YA.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return _r.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>_r.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Ub.ANCHOR).map(({cid:e})=>_r.make(this.id,e))}get state(){return(0,YA.default)(this.state$.value)}async sync(e={}){e={sync:Yn.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream");a(zm,"Stream");function Hm(){return e=>{}}i(Hm,"StreamStatic");a(Hm,"StreamStatic");var gH=rr(J$(),1);function pD(e){let t=new AbortController;if(e.length===0)throw Error("Need abort signals to create a merged abort signal");return e.some(r=>r.aborted)?(t.abort(),t.signal):(aD(...e.map(r=>em(r,"abort"))).pipe(dD()).subscribe(()=>{t.abort()}),t.signal)}i(pD,"mergeAbortSignals");a(pD,"mergeAbortSignals");var mD=i(class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=S6(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}},"TimedAbortSignal");a(mD,"TimedAbortSignal");async function vD(e,t){let r=new AbortController,n=a(()=>{r.abort()},"onAbort");return e.addEventListener("abort",n),e.aborted&&r.abort(),t(r.signal).finally(()=>{e.removeEventListener("abort",n)})}i(vD,"abortable2");a(vD,"abortable");var yH=60*1e3*3;async function vi(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{...t.headers,"Content-Type":"application/json"}});let r=t.timeout||yH,n=new mD(r),s=t.signal?pD([t.signal,n.signal]):n.signal,o=await vD(s,c=>(0,gH.default)(String(e),{...t,signal:c})).finally(()=>n.clear());if(!o.ok){let c=await o.text();throw new Error(`HTTP request to '${e}' failed with status '${o.statusText}': ${c}`)}return o.json()}i(vi,"fetchJson");a(vi,"fetchJson");var f0=rr(dd(),1);zs();function ga(e){let t=Ht.asCID(e);if(t)return t;if(typeof e=="string")return Ht.parse(e);if(e instanceof Uint8Array)return Ht.decode(e);throw new Error(`${e} cannot be converted to a CID`)}i(ga,"toCID");a(ga,"toCID");var aS=0,jr=i(class{static streamIdFromState(e){return new Xt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,f0.default)(e);return jr.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Mr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Mr(t.cacaoBlock,"base64")),t):(jr.isSignedCommit(e)&&(t.link=t.link.toString()),jr.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),e.header?.model&&(t.header.model=Mr(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,f0.default)(e);return jr.isSignedCommitContainer(t)?(t.jws.link=ga(t.jws.link),t.linkedBlock=xr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=xr(t.cacaoBlock,"base64")),t):(jr.isSignedCommit(t)&&(t.link=ga(t.link)),jr.isAnchorCommit(t)&&(t.proof=ga(t.proof)),t.id&&(t.id=ga(t.id)),t.prev&&(t.prev=ga(t.prev)),t.header?.model&&(t.header.model=xr(t.header.model,"base64")),t)}static serializeState(e){let t=(0,f0.default)(e);return t.log=t.log.map(r=>({...r,cid:r.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=tm[t.anchorStatus]),t.anchorProof!=null&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),e.metadata?.model&&(t.metadata.model=e.metadata.model.toString()),e.next?.metadata?.model&&(t.next.metadata.model=e.next.metadata.model.toString()),e.metadata?.unique&&e.type!=aS&&(t.metadata.unique=Mr(t.metadata.unique,"base64")),t.doctype=wa.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,f0.default)(e);return t.doctype&&(t.type=wa.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(r=>({...r,cid:ga(r.cid)})),t.anchorProof&&(t.anchorProof.txHash=ga(t.anchorProof.txHash),t.anchorProof.root=ga(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=tm[t.anchorStatus]),e.metadata?.model&&(t.metadata.model=Xt.fromString(e.metadata.model)),e.next?.metadata?.model&&(t.next.metadata.model=Xt.fromString(e.next.metadata.model)),e.metadata?.unique&&e.type!=aS&&(t.metadata.unique=xr(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(jr.serializeState(e))===JSON.stringify(jr.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(let r in t.log)if(!e.log[r].cid.equals(t.log[r].cid))return!1;return!(e.log.length===t.log.length&&e.anchorStatus!=t.anchorStatus)}static assertCommitLinksToState(e,t){let r=this.streamIdFromState(e);if(t.id&&!t.id.equals(e.log[0].cid))throw new Error(`Invalid genesis CID in commit for StreamID ${r.toString()}. Found: ${t.id}, expected ${e.log[0].cid}`);let n=e.log[e.log.length-1].cid;if(!t.prev.equals(n))throw new Error(`Commit doesn't properly point to previous commit in log. Expected ${n}, found 'prev' ${t.prev}`)}static async convertCommitToSignedCommitContainer(e,t){if(jr.isSignedCommit(e)){let r=await t.block.get(e.link);return{jws:e,linkedBlock:r}}return e}static isSignedCommitContainer(e){return e&&e.jws!==void 0}static isSignedCommit(e){return e&&e.link!==void 0}static isAnchorCommit(e){return e&&e.proof!==void 0}static isSignedCommitData(e){return e&&e.envelope!==void 0}static isAnchorCommitData(e){return e&&e.proof!==void 0}},"StreamUtils");a(jr,"StreamUtils");var gD=i(class extends aH{next(e){let t=this.value;jr.statesEqual(t,e)||super.next(e)}},"StreamStateSubject");a(gD,"StreamStateSubject");var bH=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate4"),pi,Yy={anchor:!0,publish:!0,pin:!0,sync:Yn.PREFER_CACHE},_H={sync:Yn.PREFER_CACHE},oS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function A0(e,t){if(typeof e?.schema=="string")try{_r.fromString(e.schema)}catch{throw new Error("Schema must be a CommitID")}let r={controllers:e?.controllers,family:e?.family,schema:e?.schema?.toString(),tags:e?.tags};if(t)e?.deterministic||(r.unique=Mr((0,Wz.randomBytes)(12),"base64")),e?.forbidControllerChange&&(r.forbidControllerChange=!0);else{if(e?.deterministic!==void 0||e?.unique!==void 0)throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(e?.forbidControllerChange!==void 0)throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(r).forEach(n=>r[n]===void 0&&delete r[n]),r}i(A0,"headerFromMetadata");a(A0,"headerFromMetadata");async function $b(e){if(!e.did)throw new Error("No DID provided");return e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`)),e.did}i($b,"getAuthenticatedDID");a($b,"getAuthenticatedDID");async function S0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(S0,"throwReadOnlyError");a(S0,"throwReadOnlyError");var Ea=pi=a(i(class extends zm{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,Gz.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,s={}){s={...Yy,...s},!n?.deterministic&&s.syncTimeoutSeconds==null&&(s.syncTimeoutSeconds=0);let o=s.asDID?{did:s.asDID}:t,c=await pi.makeGenesis(o,r,n);return t.createStreamFromGenesis(pi.STREAM_TYPE_ID,c,s)}static async createFromGenesis(t,r,n={}){n={...Yy,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let s=r.data?await pi._signDagJWS(t,r):r;return t.createStreamFromGenesis(pi.STREAM_TYPE_ID,s,n)}static async deterministic(t,r,n={}){if(n={...Yy,...n},r={...r,deterministic:!0},r.family==null&&r.tags==null)throw new Error("Family and/or tags are required when creating a deterministic tile document");let s=await pi.makeGenesis(t,null,r);return t.createStreamFromGenesis(pi.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={..._H,...n};let s=mo.from(r);if(s.type!=pi.STREAM_TYPE_ID)throw new Error(`StreamID ${s.toString()} does not refer to a '${pi.STREAM_TYPE_NAME}' stream, but to a ${s.typeName}`);return t.loadStream(s,n)}async update(t,r,n={}){n={...oS,...n};let s=n.asDID?{did:n.asDID}:this.api,o=await this.makeCommit(s,t,r),c=await this.api.applyCommit(this.id,o,n);this.state$.next(c.state)}async patch(t,r={}){r={...oS,...r};let s={header:A0(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},o=await pi._signDagJWS(this.api,s),c=await this.api.applyCommit(this.id,o,r);this.state$.next(c.state)}makeReadOnly(){this.update=S0,this.patch=S0,this.sync=S0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let s=await this._makeRawCommit(r,n);return pi._signDagJWS(t,s)}async _makeRawCommit(t,r){r||(r={});let n=A0(r,!1);if(t==null&&(t=this.content),n.controllers){if(n.controllers.length!==1)throw new Error("Exactly one controller must be specified");if(!n.controllers[0])throw new Error("Controller cannot be updated to an undefined value.")}let s=aI.compare(this.content,t),o=this.state.log[0];return{header:n,data:s,prev:this.tip,id:o.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await $b(t);n.controllers=[c.hasParent?c.parent:c.id]}else throw new Error("No controllers specified");if(n.controllers?.length!==1)throw new Error("Exactly one controller must be specified");let s=A0(n,!0);if(n?.deterministic&&r)throw new Error("Initial content must be null when creating a deterministic Tile document");if(r==null){let c={header:s};return Im(c),c}let o={data:r,header:s};return pi._signDagJWS(t,o)}static async _signDagJWS(t,r){return(await $b(t)).createDagJWS(r)}},"TileDocument2"),"TileDocument");Ea.STREAM_TYPE_NAME="tile";Ea.STREAM_TYPE_ID=0;Ea=pi=bH([Hm()],Ea);var wH=rr(Y$(),1);function yD(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(yD,"_checkPrivateRedeclaration2");a(yD,"_checkPrivateRedeclaration");function bD(e,t){return t.get?t.get.call(e):t.value}i(bD,"_classApplyDescriptorGet2");a(bD,"_classApplyDescriptorGet");function _D(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}i(_D,"_classApplyDescriptorSet2");a(_D,"_classApplyDescriptorSet");function x6(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(x6,"_classExtractFieldDescriptor2");a(x6,"_classExtractFieldDescriptor");function x0(e,t){var r=x6(e,t,"get");return bD(e,r)}i(x0,"_classPrivateFieldGet2");a(x0,"_classPrivateFieldGet");function jb(e,t,r){yD(e,t),t.set(e,r)}i(jb,"_classPrivateFieldInit2");a(jb,"_classPrivateFieldInit");function zb(e,t,r){var n=x6(e,t,"set");return _D(e,n,r),r}i(zb,"_classPrivateFieldSet2");a(zb,"_classPrivateFieldSet");function wD(e){return typeof e=="string"||_r.isInstance(e)||Xt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(wD,"keyToQuery");a(wD,"keyToQuery");function T0(e){return typeof e=="string"?mo.from(e).toString():_r.isInstance(e)||Xt.isInstance(e)?e.toString():e.streamId.toString()}i(T0,"keyToString");a(T0,"keyToString");async function ED(e){let t=await Ea.makeGenesis({},null,{...e,deterministic:!0}),r=await Xt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(ED,"getDeterministicQuery");a(ED,"getDeterministicQuery");var EH=a(()=>Promise.resolve([]),"tempBatchLoadFn"),d0=new WeakMap,Xy=new WeakMap,AH=i(class extends wH.default{cache(e){if(!x0(this,Xy))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,r){let n=await Ea.create(x0(this,d0),e,t,r);return this.cache(n),n}async deterministic(e,t){let r=await ED(e);try{return await super.load(r)}catch{let s=await Ea.createFromGenesis(x0(this,d0),r.genesis,t);return this.cache(s),s}}async load(e){return await super.load(e)}async update(e,t,r,n){let s=T0(e);this.clear(s);let o=await this.load({streamId:s});return await o.update(t,r,n),o}constructor(e){super(EH,{cache:!0,cacheKeyFn:T0,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),jb(this,d0,{writable:!0,value:void 0}),jb(this,Xy,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let r=await e.ceramic.multiQuery(t.map(wD),e.multiqueryTimeout);return t.map(n=>{let s=T0(n),o=r[s];return o||new Error(`Failed to load stream: ${s}`)})},zb(this,d0,e.ceramic),zb(this,Xy,!!e.cache)}},"TileLoader");a(AH,"TileLoader");function Hb(e){return typeof e=="string"?Xt.fromString(e):e}i(Hb,"typeStreamID");a(Hb,"typeStreamID");function AD(e,t){let r=new URL(e);for(let[n,s]of Object.entries(t))Xt.isInstance(s)?r.searchParams.set(n,s.toString()):typeof s=="object"?r.searchParams.set(n,JSON.stringify(s)):r.searchParams.set(n,s);return r}i(AD,"serializeObjectToSearchParams");a(AD,"serializeObjectToSearchParams");function qb(e){let t={};for(let[r,n]of Object.entries(e))Xt.isInstance(n)?t[r]=n.toString():t[r]=n;return t}i(qb,"serializeObjectForHttpPost");a(qb,"serializeObjectForHttpPost");var ji=i(class extends ln{constructor(e,t,r){super(n=>{this.state$.observers.length===0&&(this.periodicSubscription=S6(0,r).pipe(hD(()=>this._syncState(this.id,{sync:Yn.PREFER_CACHE}))).subscribe()),this.state$.subscribe(n).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new gD(e),this._apiUrl=new URL(t)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}async _syncState(e,t){let r=await ji._load(e,this._apiUrl,t);this.state$.next(jr.deserializeState(r))}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,r,n,s){let o=new URL("./streams",e),{state:c}=await vi(o,{method:"post",body:{type:t,genesis:jr.serializeCommit(r),opts:n}});return new ji(jr.deserializeState(c),e,s)}static async applyCommit(e,t,r,n,s){let o=new URL("./commits",e),{state:c}=await vi(o,{method:"post",body:{streamId:t.toString(),commit:jr.serializeCommit(r),opts:n}});return new ji(jr.deserializeState(c),e,s)}static async _load(e,t,r){let n=AD(new URL(`./streams/${e}`,t),r),{state:s}=await vi(n);return s}static async load(e,t,r,n){let s=await ji._load(e,t,n);return new ji(jr.deserializeState(s),t,r)}static async loadStreamCommits(e,t){let r=new URL(`./commits/${e}`,t),{commits:n}=await vi(r);return n.map(s=>({cid:s.cid,value:jr.deserializeCommit(s.value)}))}complete(){this.state$.complete()}},"Document");a(ji,"Document");var Yf;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC",e[e.SYNC_ON_ERROR=3]="SYNC_ON_ERROR"})(Yf||(Yf={}));var cS=rr(dd(),1),uS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(uS||(uS={}));var lS;(function(e){e[e.NOT_REQUESTED=0]="NOT_REQUESTED",e[e.PENDING=1]="PENDING",e[e.PROCESSING=2]="PROCESSING",e[e.ANCHORED=3]="ANCHORED",e[e.FAILED=4]="FAILED"})(lS||(lS={}));var Kb;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Kb||(Kb={}));var SD=i(class extends ln{constructor(e,t){super(r=>{e.subscribe(r)}),this.state$=e,this._context=t}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get content(){let{next:e,content:t}=this.state$.value;return(0,cS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return _r.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>_r.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Kb.ANCHOR).map(({cid:e})=>_r.make(this.id,e))}get state(){return(0,cS.default)(this.state$.value)}async sync(e={}){e={sync:Yf.PREFER_CACHE,...e};let t=await this.api.loadStream(this.id,e);this.state$.next(t.state)}async requestAnchor(){return this.api.requestAnchor(this.id)}},"Stream2");a(SD,"Stream");function xD(){return e=>{}}i(xD,"StreamStatic2");a(xD,"StreamStatic");function TD(e){if(typeof e=="string"&&e.includes("@")){let[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new Gf({address:t,chainId:r})}return new Gf(e)}i(TD,"normalizeAccountId");a(TD,"normalizeAccountId");var SH=rr(dd(),1),xH=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate5"),fc,Qy=a(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),fS={anchor:!1,publish:!0,pin:!0,sync:Yf.PREFER_CACHE},eb={anchor:!0,publish:!0},TH={sync:Yf.PREFER_CACHE},Lu=fc=a(i(class extends SD{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,SH.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(t,r,n={}){n={...fS,...n};let s=TD(r),o=fc.makeGenesis(s);return fc.fromGenesis(t,o,n)}static async fromGenesis(t,r,n={}){return n={...fS,...n},t.createStreamFromGenesis(fc.STREAM_TYPE_ID,r,n)}async setDid(t,r,n={}){n={...eb,...n};let s=typeof t=="string"?t.trim():t.id;if(l2(s)?.did!==s)throw new Error(`DID is not valid: '${s}'`);let c=await r.createLink(s);return this.setDidProof(c,n)}async setDidProof(t,r={}){r={...eb,...r};let n=this.makeCommit(t),s=await this.api.applyCommit(this.id,n,r);this.state$.next(s.state)}async clearDid(t,r={}){r={...eb,...r};let n=await t.createLink("");return this.setDidProof(n,r)}static async load(t,r,n={}){n={...TH,...n};let s=mo.from(r);if(s.type!=fc.STREAM_TYPE_ID)throw new Error(`StreamID ${s.toString()} does not refer to a '${fc.STREAM_TYPE_NAME}' stream, but to a ${s.typeName}`);return t.loadStream(s,n)}static makeGenesis(t){return t.chainId.namespace==="eip155"&&(t.address=t.address.toLowerCase()),{header:{controllers:[`${t.address}@${t.chainId.toString()}`],family:`caip10-${t.chainId.toString()}`}}}makeCommit(t){return{data:t,prev:this.tip,id:this.id.cid}}makeReadOnly(){this.setDidProof=Qy,this.setDid=Qy,this.sync=Qy,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link2"),"Caip10Link");Lu.STREAM_TYPE_NAME="caip10-link";Lu.STREAM_TYPE_ID=1;Lu=fc=xH([xD()],Lu);zs();Zu();var MH=rr(cj(),1),CH=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate6"),Bs,IH={sync:Yn.PREFER_CACHE};async function Vb(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(Vb,"_ensureAuthenticated");a(Vb,"_ensureAuthenticated");async function MD(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(MD,"throwReadOnlyError3");a(MD,"throwReadOnlyError");var _c=Bs=a(i(class extends zm{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:Bs.MODEL}}static async create(t,r,n){Bs.assertComplete(r);let s={publish:!0,anchor:!0,pin:!0,sync:Yn.NEVER_SYNC,throwOnInvalidCommit:!0},o=await Bs._makeGenesis(t,r,n);return await t.createStreamFromGenesis(Bs.STREAM_TYPE_ID,o,s)}static assertComplete(t,r){if(!t.name)throw r?new Error(`Model with StreamID ${r.toString()} is missing a 'name' field`):new Error("Model is missing a 'name' field");if(!t.schema)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'schema' field`):new Error(`Model ${t.name} is missing a 'schema' field`);if(!t.accountRelation)throw r?new Error(`Model ${t.name} (${r.toString()}) is missing a 'accountRelation' field`):new Error(`Model ${t.name} is missing a 'accountRelation' field`)}static async load(t,r,n={}){n={...IH,...n};let s=mo.from(r);if(s.type!=Bs.STREAM_TYPE_ID)throw new Error(`StreamID ${s.toString()} does not refer to a '${Bs.STREAM_TYPE_NAME}' stream, but to a ${s.typeName}`);return await t.loadStream(s,n)}static async _makeGenesis(t,r,n){let s=await this._makeRawGenesis(t,r,n);return Bs._signDagJWS(t,s)}static async _makeRawGenesis(t,r,n){if(r==null)throw new Error("Genesis content cannot be null");if(!n||!n.controller)if(t.did)await Vb(t),n={controller:t.did.hasParent?t.did.parent:t.did.id};else throw new Error("No controller specified");let s={controllers:[n.controller],model:Bs.MODEL.bytes};return{data:r,header:s}}makeReadOnly(){this.sync=MD,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(t,r){return await Vb(t),t.did.createDagJWS(r)}},"Model2"),"Model");_c.STREAM_TYPE_NAME="model";_c.STREAM_TYPE_ID=2;_c.MODEL=function(){let e=Im("model-v1"),t=MH.default.encode(e,"identity"),r=Nu(L0,t),n=Ht.createV1(L0,r);return new Xt("UNLOADABLE",n)}();_c=Bs=CH([Hm()],_c);var DH=rr(Xu(),1),kH=i(function(e,t,r,n){var s=arguments.length,o=s<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(o=(s<3?c(o):s>3?c(t,r,o):c(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o},"__decorate7"),is,OH={anchor:!0,publish:!0,pin:!0,sync:Yn.NEVER_SYNC,syncTimeoutSeconds:0},RH={anchor:!1,publish:!1,pin:!0,sync:Yn.PREFER_CACHE},NH={sync:Yn.PREFER_CACHE},dS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function Gb(e){if(e.did==null)throw new Error("No DID provided");e.did.authenticated||(await e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}i(Gb,"_ensureAuthenticated2");a(Gb,"_ensureAuthenticated");async function M0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(M0,"throwReadOnlyError4");a(M0,"throwReadOnlyError");var Fu=is=a(i(class extends zm{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let t=this.state$.value.metadata;return{controller:t.controllers[0],model:t.model}}static async create(t,r,n,s={}){s={...OH,...s};let o=s.asDID?{did:s.asDID}:t,c=await is._makeGenesis(o,r,n);return t.createStreamFromGenesis(is.STREAM_TYPE_ID,c,s)}static async single(t,r,n={}){n={...RH,...n};let s=n.asDID?{did:n.asDID}:t;r={...r,deterministic:!0};let o=await is._makeGenesis(s,null,r);return t.createStreamFromGenesis(is.STREAM_TYPE_ID,o,n)}static async load(t,r,n={}){n={...NH,...n};let s=mo.from(r);if(s.type!=is.STREAM_TYPE_ID)throw new Error(`StreamID ${s.toString()} does not refer to a '${is.STREAM_TYPE_NAME}' stream, but to a ${s.typeName}`);return t.loadStream(s,n)}async replace(t,r={}){r={...dS,...r};let n=r.asDID?{did:r.asDID}:this.api,s=await this._makeCommit(n,t),o=await this.api.applyCommit(this.id,s,r);this.state$.next(o.state)}async patch(t,r={}){r={...dS,...r};let n={data:t,prev:this.tip,id:this.id.cid},s=await is._signDagJWS(this.api,n),o=await this.api.applyCommit(this.id,s,r);this.state$.next(o.state)}makeReadOnly(){this.replace=M0,this.patch=M0,this.sync=M0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(t,r){let n=this._makeRawCommit(r);return is._signDagJWS(t,n)}_makeRawCommit(t){return{data:aI.compare(this.content,t||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(t,r,n){let s=await this._makeRawGenesis(t,r,n);return n.deterministic?(Im(s),s):is._signDagJWS(t,s)}static async _makeRawGenesis(t,r,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let s=n.controller;if(!s)if(t.did)await Gb(t),s=t.did.hasParent?t.did.parent:t.did.id;else throw new Error("No controller specified");let o={controllers:[s],model:n.model.bytes};return n.deterministic||(o.unique=(0,DH.randomBytes)(12)),{data:r,header:o}}static async _signDagJWS(t,r){return await Gb(t),t.did.createDagJWS(r)}},"ModelInstanceDocument2"),"ModelInstanceDocument");Fu.STREAM_TYPE_NAME="MID";Fu.STREAM_TYPE_ID=3;Fu=is=kH([Hm()],Fu);var CD=i(class{constructor(e){this._apiUrl=e}async add(e,t){let r={};t&&(r.force=!0);let n=new URL(`./pins/${e}`,this._apiUrl);await vi(n,{method:"post",body:r})}async rm(e,t){let r=new URL(`./pins/${e}`,this._apiUrl);await vi(r,{method:"delete",body:{opts:t}})}async ls(e){let t=new URL("./pins",this._apiUrl);e&&(t=new URL(`./pins/${e.toString()}`,this._apiUrl));let r=await vi(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let s=0;return{next(){return s===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[s++],done:!1})}}}}}},"RemotePinApi");a(CD,"RemotePinApi");var ID=i(class{constructor(e){this._fetchJson=vi,this._collectionURL=new URL("./collection",e),this._countURL=new URL("./collection/count",e)}async count(e){return(await this._fetchJson(this._countURL,{method:"POST",body:qb(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:qb(e)});return{edges:t.edges.map(n=>({cursor:n.cursor,node:jr.deserializeState(n.node)})),pageInfo:t.pageInfo}}},"RemoteIndexApi");a(ID,"RemoteIndexApi");var DD=i(class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=vi,this.modelsPath="./admin/models",this.getCodePath="./admin/getCode"}getCodeUrl(){return new URL(this.getCodePath,this._apiUrl)}getModelsUrl(){return new URL(this.modelsPath,this._apiUrl)}async buildJWS(e,t,r){let n=r?{models:r.map(o=>o.toString())}:void 0,s=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:n});return`${s.signatures[0].protected}.${s.payload}.${s.signatures[0].signature}`}async generateCode(){return(await this._fetchJson(this.getCodeUrl())).code}async startIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"post",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}async getIndexedModels(){let e=await this.generateCode();return(await this._fetchJson(this.getModelsUrl(),{headers:{Authorization:`Basic ${await this.buildJWS(this._getDidFn(),e)}`}})).models.map(r=>Xt.fromString(r))}async stopIndexingModels(e){let t=await this.generateCode();await this._fetchJson(this.getModelsUrl(),{method:"delete",body:{jws:await this.buildJWS(this._getDidFn(),t,e)}})}},"RemoteAdminApi");a(DD,"RemoteAdminApi");var PH="/api/v0/",BH="http://localhost:7007",LH={syncInterval:5e3},FH={anchor:!0,publish:!0,sync:Yn.PREFER_CACHE},UH={anchor:!0,publish:!0,sync:Yn.PREFER_CACHE},hS={sync:Yn.PREFER_CACHE},$H=i(class{constructor(e=BH,t={}){this._config={...LH,...t},this._apiUrl=new URL(PH,e),this._streamCache=new Map,this.context={api:this},this.pin=new CD(this._apiUrl),this.index=new ID(this._apiUrl);let r=(()=>this.did).bind(this);this.admin=new DD(this._apiUrl,r),this._streamConstructors={[Lu.STREAM_TYPE_ID]:Lu,[_c.STREAM_TYPE_ID]:_c,[Fu.STREAM_TYPE_ID]:Fu,[Ea.STREAM_TYPE_ID]:Ea}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,r={}){r={...UH,...r};let n=await ji.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),s=this._streamCache.get(n.id.toString());return s?(jr.statesEqual(n.state,s.state)||s.next(n.state),this.buildStreamFromDocument(s)):(this._streamCache.set(n.id.toString(),n),this.buildStreamFromDocument(n))}async loadStream(e,t={}){t={...hS,...t};let r=mo.from(e),n=this._streamCache.get(r.baseID.toString());return n?await n._syncState(r,t):(n=await ji.load(r,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(n.id.toString(),n)),this.buildStreamFromDocument(n)}async multiQuery(e,t){let r=e.map(o=>({...o,streamId:typeof o.streamId=="string"?o.streamId:o.streamId.toString()})),n=new URL("./multiqueries",this._apiUrl),s=await vi(n,{method:"post",body:{queries:r,timeout:t}});return Object.entries(s).reduce((o,c)=>{let[l,h]=c,p=jr.deserializeState(h),v=new ji(p,this._apiUrl,this._config.syncInterval);return o[l]=this.buildStreamFromDocument(v),o},{})}loadStreamCommits(e){let t=Hb(e);return ji.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,r={}){r={...FH,...r};let n=Hb(e),s=await ji.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),o=this._streamCache.get(n.toString());return o?(o.next(s.state),this.buildStreamFromDocument(s)):(this._streamCache.set(n.toString(),s),this.buildStreamFromDocument(s))}async requestAnchor(e,t={}){t={...hS,...t};let{anchorStatus:r}=await vi(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return r}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}buildStreamFromState(e){let t=new ji(e,this._apiUrl,this._config.syncInterval);return this.buildStreamFromDocument(t)}buildStreamFromDocument(e){let t=e.state.type,r=this._streamConstructors[t];if(!r)throw new Error(`Failed to find constructor for stream ${t}`);return new r(e,this.context)}async setDID(e){this.context.did=e}async getSupportedChains(){if(this._supportedChains)return this._supportedChains;let{supportedChains:e}=await vi(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}},"CeramicClient");a($H,"CeramicClient");var hr;(function(e){e.assertEqual=s=>s;function t(s){}i(t,"assertIs"),a(t,"assertIs"),e.assertIs=t;function r(s){throw new Error}i(r,"assertNever"),a(r,"assertNever"),e.assertNever=r,e.arrayToEnum=s=>{let o={};for(let c of s)o[c]=c;return o},e.getValidEnumValues=s=>{let o=e.objectKeys(s).filter(l=>typeof s[s[l]]!="number"),c={};for(let l of o)c[l]=s[l];return e.objectValues(c)},e.objectValues=s=>e.objectKeys(s).map(function(o){return s[o]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{let o=[];for(let c in s)Object.prototype.hasOwnProperty.call(s,c)&&o.push(c);return o},e.find=(s,o)=>{for(let c of s)if(o(c))return c},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function n(s,o=" | "){return s.map(c=>typeof c=="string"?`'${c}'`:c).join(o)}i(n,"joinValues"),a(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(s,o)=>typeof o=="bigint"?o.toString():o})(hr||(hr={}));var tt=hr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),oo=a(e=>{switch(typeof e){case"undefined":return tt.undefined;case"string":return tt.string;case"number":return isNaN(e)?tt.nan:tt.number;case"boolean":return tt.boolean;case"function":return tt.function;case"bigint":return tt.bigint;case"symbol":return tt.symbol;case"object":return Array.isArray(e)?tt.array:e===null?tt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?tt.promise:typeof Map<"u"&&e instanceof Map?tt.map:typeof Set<"u"&&e instanceof Set?tt.set:typeof Date<"u"&&e instanceof Date?tt.date:tt.object;default:return tt.unknown}},"getParsedType"),Ve=hr.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"]),jH=a(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),Ls=i(class extends Error{constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let t=e||function(s){return s.message},r={_errors:[]},n=a(s=>{for(let o of s.issues)if(o.code==="invalid_union")o.unionErrors.map(n);else if(o.code==="invalid_return_type")n(o.returnTypeError);else if(o.code==="invalid_arguments")n(o.argumentsError);else if(o.path.length===0)r._errors.push(t(o));else{let c=r,l=0;for(;l<o.path.length;){let h=o.path[l];l===o.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(t(o))):c[h]=c[h]||{_errors:[]},c=c[h],l++}}},"processError");return n(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,hr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},r=[];for(let n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}},"ZodError");a(Ls,"ZodError");Ls.create=e=>new Ls(e);var Xf=a((e,t)=>{let r;switch(e.code){case Ve.invalid_type:e.received===tt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ve.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,hr.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:r=`Unrecognized key(s) in object: ${hr.joinValues(e.keys,", ")}`;break;case Ve.invalid_union:r="Invalid input";break;case Ve.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${hr.joinValues(e.options)}`;break;case Ve.invalid_enum_value:r=`Invalid enum value. Expected ${hr.joinValues(e.options)}, received '${e.received}'`;break;case Ve.invalid_arguments:r="Invalid function arguments";break;case Ve.invalid_return_type:r="Invalid function return type";break;case Ve.invalid_date:r="Invalid date";break;case Ve.invalid_string:typeof e.validation=="object"?"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:hr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ve.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(e.minimum)}`:r="Invalid input";break;case Ve.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(e.maximum)}`:r="Invalid input";break;case Ve.custom:r="Invalid input";break;case Ve.invalid_intersection_types:r="Intersection results could not be merged";break;case Ve.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ve.not_finite:r="Number must be finite";break;default:r=t.defaultError,hr.assertNever(e)}return{message:r}},"errorMap"),kD=Xf;function OD(e){kD=e}i(OD,"setErrorMap");a(OD,"setErrorMap");function Qf(){return kD}i(Qf,"getErrorMap");a(Qf,"getErrorMap");var rm=a(e=>{let{data:t,path:r,errorMaps:n,issueData:s}=e,o=[...r,...s.path||[]],c={...s,path:o},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...s,path:o,message:s.message||l}},"makeIssue"),zH=[];function mt(e,t){let r=rm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Qf(),Xf].filter(n=>!!n)});e.common.issues.push(r)}i(mt,"addIssueToContext");a(mt,"addIssueToContext");var Pn=i(class{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let n of t){if(n.status==="aborted")return kt;n.status==="dirty"&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let n of t)r.push({key:await n.key,value:await n.value});return Pn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:s,value:o}=n;if(s.status==="aborted"||o.status==="aborted")return kt;s.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),(typeof o.value<"u"||n.alwaysSet)&&(r[s.value]=o.value)}return{status:e.value,value:r}}},"ParseStatus");a(Pn,"ParseStatus");var kt=Object.freeze({status:"aborted"}),RD=a(e=>({status:"dirty",value:e}),"DIRTY"),An=a(e=>({status:"valid",value:e}),"OK"),Wb=a(e=>e.status==="aborted","isAborted"),Zb=a(e=>e.status==="dirty","isDirty"),nm=a(e=>e.status==="valid","isValid"),im=a(e=>typeof Promise<"u"&&e instanceof Promise,"isAsync"),Wt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Wt||(Wt={}));var hs=i(class{constructor(e,t,r,n){this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._path.concat(this._key)}},"ParseInputLazyPath");a(hs,"ParseInputLazyPath");var pS=a((e,t)=>{if(nm(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new Ls(e.common.issues);return{success:!1,error:r}}},"handleResult");function Lt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:s}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:a((c,l)=>c.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:n??l.defaultError}:{message:r??l.defaultError},"customMap"),description:s}}i(Lt,"processCreateParams");a(Lt,"processCreateParams");var zt=i(class{constructor(e){this.spa=this.safeParseAsync,this._def=e,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.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return oo(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:oo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Pn,ctx:{common:e.parent.common,data:e.data,parsedType:oo(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(im(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;let n={common:{issues:[],async:(r=t?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oo(e)},s=this._parseSync({data:e,path:n.path,parent:n});return pS(n,s)}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:oo(e)},n=this._parse({data:e,path:r.path,parent:r}),s=await(im(n)?n:Promise.resolve(n));return pS(r,s)}refine(e,t){let r=a(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,s)=>{let o=e(n),c=a(()=>s.addIssue({code:Ve.custom,...r(n)}),"setError");return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(c(),!1)):o?!0:(c(),!1)})}refinement(e,t){return this._refinement((r,n)=>e(r)?!0:(n.addIssue(typeof t=="function"?t(r,n):t),!1))}_refinement(e){return new Hi({schema:this,typeName:Tt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Fs.create(this,this._def)}nullable(){return bo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fs.create(this,this._def)}promise(){return Sc.create(this,this._def)}or(e){return Hu.create([this,e],this._def)}and(e){return qu.create(this,e,this._def)}transform(e){return new Hi({...Lt(this._def),schema:this,typeName:Tt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new Wu({...Lt(this._def),innerType:this,defaultValue:t,typeName:Tt.ZodDefault})}brand(){return new M6({typeName:Tt.ZodBranded,type:this,...Lt(this._def)})}catch(e){let t=typeof e=="function"?e:()=>e;return new id({...Lt(this._def),innerType:this,catchValue:t,typeName:Tt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ad.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");a(zt,"ZodType");var HH=/^c[^\s-]{8,}$/i,qH=/^[a-z][a-z0-9]*$/,KH=/^([a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[a-f0-9]{4}-[a-f0-9]{12}|00000000-0000-0000-0000-000000000000)$/i,VH=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|([^-]([a-zA-Z0-9-]*\.)+[a-zA-Z]{2,}))$/,GH=a(e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$"),"datetimeRegex"),Aa=i(class extends zt{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(n=>e.test(n),{validation:t,code:Ve.invalid_string,...Wt.errToObj(r)}),this.nonempty=e=>this.min(1,Wt.errToObj(e)),this.trim=()=>new Aa({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==tt.string){let s=this._getOrReturnCtx(e);return mt(s,{code:Ve.invalid_type,expected:tt.string,received:s.parsedType}),kt}let r=new Pn,n;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let o=e.data.length>s.value,c=e.data.length<s.value;(o||c)&&(n=this._getOrReturnCtx(e,n),o?mt(n,{code:Ve.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):c&&mt(n,{code:Ve.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")VH.test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{validation:"email",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")KH.test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{validation:"uuid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")HH.test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{validation:"cuid",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")qH.test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{validation:"cuid2",code:Ve.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),mt(n,{validation:"url",code:Ve.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{validation:"regex",code:Ve.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="startsWith"?e.data.startsWith(s.value)||(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?GH(s).test(e.data)||(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.invalid_string,validation:"datetime",message:s.message}),r.dirty()):hr.assertNever(s);return{status:r.value,value:e.data}}_addCheck(e){return new Aa({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Wt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Wt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Wt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Wt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Wt.errToObj(e)})}datetime(e){var t;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(t=e?.offset)!==null&&t!==void 0?t:!1,...Wt.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Wt.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Wt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Wt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Wt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Wt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Wt.errToObj(t)})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}},"ZodString");a(Aa,"ZodString");Aa.create=e=>{var t;return new Aa({checks:[],typeName:Tt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Lt(e)})};function ND(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,s=r>n?r:n,o=parseInt(e.toFixed(s).replace(".","")),c=parseInt(t.toFixed(s).replace(".",""));return o%c/Math.pow(10,s)}i(ND,"floatSafeRemainder");a(ND,"floatSafeRemainder");var go=i(class extends zt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==tt.number){let s=this._getOrReturnCtx(e);return mt(s,{code:Ve.invalid_type,expected:tt.number,received:s.parsedType}),kt}let r,n=new Pn;for(let s of this._def.checks)s.kind==="int"?hr.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),mt(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),mt(r,{code:Ve.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),mt(r,{code:Ve.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):s.kind==="multipleOf"?ND(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),mt(r,{code:Ve.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),mt(r,{code:Ve.not_finite,message:s.message}),n.dirty()):hr.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Wt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Wt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Wt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Wt.toString(t))}setLimit(e,t,r,n){return new go({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Wt.toString(n)}]})}_addCheck(e){return new go({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Wt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Wt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Wt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Wt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Wt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Wt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Wt.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&hr.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}},"ZodNumber");a(go,"ZodNumber");go.create=e=>new go({checks:[],typeName:Tt.ZodNumber,coerce:e?.coerce||!1,...Lt(e)});var Uu=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==tt.bigint){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.bigint,received:r.parsedType}),kt}return An(e.data)}},"ZodBigInt");a(Uu,"ZodBigInt");Uu.create=e=>{var t;return new Uu({typeName:Tt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Lt(e)})};var $u=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==tt.boolean){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.boolean,received:r.parsedType}),kt}return An(e.data)}},"ZodBoolean");a($u,"ZodBoolean");$u.create=e=>new $u({typeName:Tt.ZodBoolean,coerce:e?.coerce||!1,...Lt(e)});var wc=i(class extends zt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==tt.date){let s=this._getOrReturnCtx(e);return mt(s,{code:Ve.invalid_type,expected:tt.date,received:s.parsedType}),kt}if(isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return mt(s,{code:Ve.invalid_date}),kt}let r=new Pn,n;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),mt(n,{code:Ve.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):hr.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new wc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Wt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Wt.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}},"ZodDate");a(wc,"ZodDate");wc.create=e=>new wc({checks:[],coerce:e?.coerce||!1,typeName:Tt.ZodDate,...Lt(e)});var ed=i(class extends zt{_parse(e){if(this._getType(e)!==tt.symbol){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.symbol,received:r.parsedType}),kt}return An(e.data)}},"ZodSymbol");a(ed,"ZodSymbol");ed.create=e=>new ed({typeName:Tt.ZodSymbol,...Lt(e)});var ju=i(class extends zt{_parse(e){if(this._getType(e)!==tt.undefined){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.undefined,received:r.parsedType}),kt}return An(e.data)}},"ZodUndefined");a(ju,"ZodUndefined");ju.create=e=>new ju({typeName:Tt.ZodUndefined,...Lt(e)});var zu=i(class extends zt{_parse(e){if(this._getType(e)!==tt.null){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.null,received:r.parsedType}),kt}return An(e.data)}},"ZodNull");a(zu,"ZodNull");zu.create=e=>new zu({typeName:Tt.ZodNull,...Lt(e)});var Ec=i(class extends zt{constructor(){super(...arguments),this._any=!0}_parse(e){return An(e.data)}},"ZodAny");a(Ec,"ZodAny");Ec.create=e=>new Ec({typeName:Tt.ZodAny,...Lt(e)});var uo=i(class extends zt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return An(e.data)}},"ZodUnknown");a(uo,"ZodUnknown");uo.create=e=>new uo({typeName:Tt.ZodUnknown,...Lt(e)});var Us=i(class extends zt{_parse(e){let t=this._getOrReturnCtx(e);return mt(t,{code:Ve.invalid_type,expected:tt.never,received:t.parsedType}),kt}},"ZodNever");a(Us,"ZodNever");Us.create=e=>new Us({typeName:Tt.ZodNever,...Lt(e)});var td=i(class extends zt{_parse(e){if(this._getType(e)!==tt.undefined){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.void,received:r.parsedType}),kt}return An(e.data)}},"ZodVoid");a(td,"ZodVoid");td.create=e=>new td({typeName:Tt.ZodVoid,...Lt(e)});var fs=i(class extends zt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==tt.array)return mt(t,{code:Ve.invalid_type,expected:tt.array,received:t.parsedType}),kt;if(n.exactLength!==null){let o=t.data.length>n.exactLength.value,c=t.data.length<n.exactLength.value;(o||c)&&(mt(t,{code:o?Ve.too_big:Ve.too_small,minimum:c?n.exactLength.value:void 0,maximum:o?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(n.minLength!==null&&t.data.length<n.minLength.value&&(mt(t,{code:Ve.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),n.maxLength!==null&&t.data.length>n.maxLength.value&&(mt(t,{code:Ve.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((o,c)=>n.type._parseAsync(new hs(t,o,t.path,c)))).then(o=>Pn.mergeArray(r,o));let s=[...t.data].map((o,c)=>n.type._parseSync(new hs(t,o,t.path,c)));return Pn.mergeArray(r,s)}get element(){return this._def.type}min(e,t){return new fs({...this._def,minLength:{value:e,message:Wt.toString(t)}})}max(e,t){return new fs({...this._def,maxLength:{value:e,message:Wt.toString(t)}})}length(e,t){return new fs({...this._def,exactLength:{value:e,message:Wt.toString(t)}})}nonempty(e){return this.min(1,e)}},"ZodArray");a(fs,"ZodArray");fs.create=(e,t)=>new fs({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Tt.ZodArray,...Lt(t)});var sm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(sm||(sm={}));function dc(e){if(e instanceof Dr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Fs.create(dc(n))}return new Dr({...e._def,shape:()=>t})}else return e instanceof fs?fs.create(dc(e.element)):e instanceof Fs?Fs.create(dc(e.unwrap())):e instanceof bo?bo.create(dc(e.unwrap())):e instanceof $s?$s.create(e.items.map(t=>dc(t))):e}i(dc,"deepPartialify");a(dc,"deepPartialify");var Dr=i(class extends zt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=hr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==tt.object){let h=this._getOrReturnCtx(e);return mt(h,{code:Ve.invalid_type,expected:tt.object,received:h.parsedType}),kt}let{status:r,ctx:n}=this._processInputParams(e),{shape:s,keys:o}=this._getCached(),c=[];if(!(this._def.catchall instanceof Us&&this._def.unknownKeys==="strip"))for(let h in n.data)o.includes(h)||c.push(h);let l=[];for(let h of o){let p=s[h],v=n.data[h];l.push({key:{status:"valid",value:h},value:p._parse(new hs(n,v,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Us){let h=this._def.unknownKeys;if(h==="passthrough")for(let p of c)l.push({key:{status:"valid",value:p},value:{status:"valid",value:n.data[p]}});else if(h==="strict")c.length>0&&(mt(n,{code:Ve.unrecognized_keys,keys:c}),r.dirty());else if(h!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let h=this._def.catchall;for(let p of c){let v=n.data[p];l.push({key:{status:"valid",value:p},value:h._parse(new hs(n,v,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let p of l){let v=await p.key;h.push({key:v,value:await p.value,alwaysSet:p.alwaysSet})}return h}).then(h=>Pn.mergeObjectSync(r,h)):Pn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Wt.errToObj,new Dr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,s,o,c;let l=(o=(s=(n=this._def).errorMap)===null||s===void 0?void 0:s.call(n,t,r).message)!==null&&o!==void 0?o:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=Wt.errToObj(e).message)!==null&&c!==void 0?c:l}:{message:l}}}:{}})}strip(){return new Dr({...this._def,unknownKeys:"strip"})}passthrough(){return new Dr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Dr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>sm.mergeShapes(this._def.shape(),e._def.shape()),typeName:Tt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){let t={};return hr.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}omit(e){let t={};return hr.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}deepPartial(){return dc(this)}partial(e){let t={};return hr.objectKeys(this.shape).forEach(r=>{let n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}),new Dr({...this._def,shape:()=>t})}required(e){let t={};return hr.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Fs;)s=s._def.innerType;t[r]=s}}),new Dr({...this._def,shape:()=>t})}keyof(){return T6(hr.objectKeys(this.shape))}},"ZodObject");a(Dr,"ZodObject");Dr.create=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strip",catchall:Us.create(),typeName:Tt.ZodObject,...Lt(t)});Dr.strictCreate=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strict",catchall:Us.create(),typeName:Tt.ZodObject,...Lt(t)});Dr.lazycreate=(e,t)=>new Dr({shape:e,unknownKeys:"strip",catchall:Us.create(),typeName:Tt.ZodObject,...Lt(t)});var Hu=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(s){for(let c of s)if(c.result.status==="valid")return c.result;for(let c of s)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let o=s.map(c=>new Ls(c.ctx.common.issues));return mt(t,{code:Ve.invalid_union,unionErrors:o}),kt}if(i(n,"handleResults"),a(n,"handleResults"),t.common.async)return Promise.all(r.map(async s=>{let o={...t,common:{...t.common,issues:[]},parent:null};return{result:await s._parseAsync({data:t.data,path:t.path,parent:o}),ctx:o}})).then(n);{let s,o=[];for(let l of r){let h={...t,common:{...t.common,issues:[]},parent:null},p=l._parseSync({data:t.data,path:t.path,parent:h});if(p.status==="valid")return p;p.status==="dirty"&&!s&&(s={result:p,ctx:h}),h.common.issues.length&&o.push(h.common.issues)}if(s)return t.common.issues.push(...s.ctx.common.issues),s.result;let c=o.map(l=>new Ls(l));return mt(t,{code:Ve.invalid_union,unionErrors:c}),kt}}get options(){return this._def.options}},"ZodUnion");a(Hu,"ZodUnion");Hu.create=(e,t)=>new Hu({options:e,typeName:Tt.ZodUnion,...Lt(t)});var C0=a(e=>e instanceof Ku?C0(e.schema):e instanceof Hi?C0(e.innerType()):e instanceof Vu?[e.value]:e instanceof yo?e.options:e instanceof Gu?Object.keys(e.enum):e instanceof Wu?C0(e._def.innerType):e instanceof ju?[void 0]:e instanceof zu?[null]:null,"getDiscriminator"),qm=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==tt.object)return mt(t,{code:Ve.invalid_type,expected:tt.object,received:t.parsedType}),kt;let r=this.discriminator,n=t.data[r],s=this.optionsMap.get(n);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(mt(t,{code:Ve.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),kt)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let n=new Map;for(let s of t){let o=C0(s.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of o){if(n.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);n.set(c,s)}}return new qm({typeName:Tt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...Lt(r)})}},"ZodDiscriminatedUnion");a(qm,"ZodDiscriminatedUnion");function am(e,t){let r=oo(e),n=oo(t);if(e===t)return{valid:!0,data:e};if(r===tt.object&&n===tt.object){let s=hr.objectKeys(t),o=hr.objectKeys(e).filter(l=>s.indexOf(l)!==-1),c={...e,...t};for(let l of o){let h=am(e[l],t[l]);if(!h.valid)return{valid:!1};c[l]=h.data}return{valid:!0,data:c}}else if(r===tt.array&&n===tt.array){if(e.length!==t.length)return{valid:!1};let s=[];for(let o=0;o<e.length;o++){let c=e[o],l=t[o],h=am(c,l);if(!h.valid)return{valid:!1};s.push(h.data)}return{valid:!0,data:s}}else return r===tt.date&&n===tt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(am,"mergeValues");a(am,"mergeValues");var qu=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=a((s,o)=>{if(Wb(s)||Wb(o))return kt;let c=am(s.value,o.value);return c.valid?((Zb(s)||Zb(o))&&t.dirty(),{status:t.value,value:c.data}):(mt(r,{code:Ve.invalid_intersection_types}),kt)},"handleParsed");return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,o])=>n(s,o)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}},"ZodIntersection");a(qu,"ZodIntersection");qu.create=(e,t,r)=>new qu({left:e,right:t,typeName:Tt.ZodIntersection,...Lt(r)});var $s=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==tt.array)return mt(r,{code:Ve.invalid_type,expected:tt.array,received:r.parsedType}),kt;if(r.data.length<this._def.items.length)return mt(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),kt;!this._def.rest&&r.data.length>this._def.items.length&&(mt(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let s=[...r.data].map((o,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new hs(r,o,r.path,c)):null}).filter(o=>!!o);return r.common.async?Promise.all(s).then(o=>Pn.mergeArray(t,o)):Pn.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new $s({...this._def,rest:e})}},"ZodTuple");a($s,"ZodTuple");$s.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new $s({items:e,typeName:Tt.ZodTuple,rest:null,...Lt(t)})};var rd=i(class extends zt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==tt.object)return mt(r,{code:Ve.invalid_type,expected:tt.object,received:r.parsedType}),kt;let n=[],s=this._def.keyType,o=this._def.valueType;for(let c in r.data)n.push({key:s._parse(new hs(r,c,r.path,c)),value:o._parse(new hs(r,r.data[c],r.path,c))});return r.common.async?Pn.mergeObjectAsync(t,n):Pn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof zt?new rd({keyType:e,valueType:t,typeName:Tt.ZodRecord,...Lt(r)}):new rd({keyType:Aa.create(),valueType:e,typeName:Tt.ZodRecord,...Lt(t)})}},"ZodRecord");a(rd,"ZodRecord");var nd=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==tt.map)return mt(r,{code:Ve.invalid_type,expected:tt.map,received:r.parsedType}),kt;let n=this._def.keyType,s=this._def.valueType,o=[...r.data.entries()].map(([c,l],h)=>({key:n._parse(new hs(r,c,r.path,[h,"key"])),value:s._parse(new hs(r,l,r.path,[h,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of o){let h=await l.key,p=await l.value;if(h.status==="aborted"||p.status==="aborted")return kt;(h.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(h.value,p.value)}return{status:t.value,value:c}})}else{let c=new Map;for(let l of o){let h=l.key,p=l.value;if(h.status==="aborted"||p.status==="aborted")return kt;(h.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(h.value,p.value)}return{status:t.value,value:c}}}},"ZodMap");a(nd,"ZodMap");nd.create=(e,t,r)=>new nd({valueType:t,keyType:e,typeName:Tt.ZodMap,...Lt(r)});var Ac=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==tt.set)return mt(r,{code:Ve.invalid_type,expected:tt.set,received:r.parsedType}),kt;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(mt(r,{code:Ve.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),n.maxSize!==null&&r.data.size>n.maxSize.value&&(mt(r,{code:Ve.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let s=this._def.valueType;function o(l){let h=new Set;for(let p of l){if(p.status==="aborted")return kt;p.status==="dirty"&&t.dirty(),h.add(p.value)}return{status:t.value,value:h}}i(o,"finalizeSet"),a(o,"finalizeSet");let c=[...r.data.values()].map((l,h)=>s._parse(new hs(r,l,r.path,h)));return r.common.async?Promise.all(c).then(l=>o(l)):o(c)}min(e,t){return new Ac({...this._def,minSize:{value:e,message:Wt.toString(t)}})}max(e,t){return new Ac({...this._def,maxSize:{value:e,message:Wt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}},"ZodSet");a(Ac,"ZodSet");Ac.create=(e,t)=>new Ac({valueType:e,minSize:null,maxSize:null,typeName:Tt.ZodSet,...Lt(t)});var ku=i(class extends zt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==tt.function)return mt(t,{code:Ve.invalid_type,expected:tt.function,received:t.parsedType}),kt;function r(c,l){return rm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qf(),Xf].filter(h=>!!h),issueData:{code:Ve.invalid_arguments,argumentsError:l}})}i(r,"makeArgsIssue"),a(r,"makeArgsIssue");function n(c,l){return rm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Qf(),Xf].filter(h=>!!h),issueData:{code:Ve.invalid_return_type,returnTypeError:l}})}i(n,"makeReturnsIssue"),a(n,"makeReturnsIssue");let s={errorMap:t.common.contextualErrorMap},o=t.data;return this._def.returns instanceof Sc?An(async(...c)=>{let l=new Ls([]),h=await this._def.args.parseAsync(c,s).catch(b=>{throw l.addIssue(r(c,b)),l}),p=await o(...h);return await this._def.returns._def.type.parseAsync(p,s).catch(b=>{throw l.addIssue(n(p,b)),l})}):An((...c)=>{let l=this._def.args.safeParse(c,s);if(!l.success)throw new Ls([r(c,l.error)]);let h=o(...l.data),p=this._def.returns.safeParse(h,s);if(!p.success)throw new Ls([n(h,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ku({...this._def,args:$s.create(e).rest(uo.create())})}returns(e){return new ku({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ku({args:e||$s.create([]).rest(uo.create()),returns:t||uo.create(),typeName:Tt.ZodFunction,...Lt(r)})}},"ZodFunction");a(ku,"ZodFunction");var Ku=i(class extends zt{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}},"ZodLazy");a(Ku,"ZodLazy");Ku.create=(e,t)=>new Ku({getter:e,typeName:Tt.ZodLazy,...Lt(t)});var Vu=i(class extends zt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return mt(t,{received:t.data,code:Ve.invalid_literal,expected:this._def.value}),kt}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ZodLiteral");a(Vu,"ZodLiteral");Vu.create=(e,t)=>new Vu({value:e,typeName:Tt.ZodLiteral,...Lt(t)});function T6(e,t){return new yo({values:e,typeName:Tt.ZodEnum,...Lt(t)})}i(T6,"createZodEnum");a(T6,"createZodEnum");var yo=i(class extends zt{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return mt(t,{expected:hr.joinValues(r),received:t.parsedType,code:Ve.invalid_type}),kt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),r=this._def.values;return mt(t,{received:t.data,code:Ve.invalid_enum_value,options:r}),kt}return An(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e){return yo.create(e)}exclude(e){return yo.create(this.options.filter(t=>!e.includes(t)))}},"ZodEnum");a(yo,"ZodEnum");yo.create=T6;var Gu=i(class extends zt{_parse(e){let t=hr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==tt.string&&r.parsedType!==tt.number){let n=hr.objectValues(t);return mt(r,{expected:hr.joinValues(n),received:r.parsedType,code:Ve.invalid_type}),kt}if(t.indexOf(e.data)===-1){let n=hr.objectValues(t);return mt(r,{received:r.data,code:Ve.invalid_enum_value,options:n}),kt}return An(e.data)}get enum(){return this._def.values}},"ZodNativeEnum");a(Gu,"ZodNativeEnum");Gu.create=(e,t)=>new Gu({values:e,typeName:Tt.ZodNativeEnum,...Lt(t)});var Sc=i(class extends zt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==tt.promise&&t.common.async===!1)return mt(t,{code:Ve.invalid_type,expected:tt.promise,received:t.parsedType}),kt;let r=t.parsedType===tt.promise?t.data:Promise.resolve(t.data);return An(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}},"ZodPromise");a(Sc,"ZodPromise");Sc.create=(e,t)=>new Sc({type:e,typeName:Tt.ZodPromise,...Lt(t)});var Hi=i(class extends zt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Tt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null;if(n.type==="preprocess"){let o=n.transform(r.data);return r.common.async?Promise.resolve(o).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:o,path:r.path,parent:r})}let s={addIssue:o=>{mt(r,o),o.fatal?t.abort():t.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),n.type==="refinement"){let o=a(c=>{let l=n.refinement(c,s);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c},"executeRefinement");if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),o(c.value),{status:t.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?kt:(c.status==="dirty"&&t.dirty(),o(c.value).then(()=>({status:t.value,value:c.value}))))}if(n.type==="transform")if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!nm(o))return o;let c=n.transform(o.value,s);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>nm(o)?Promise.resolve(n.transform(o.value,s)).then(c=>({status:t.value,value:c})):o);hr.assertNever(n)}},"ZodEffects");a(Hi,"ZodEffects");Hi.create=(e,t,r)=>new Hi({schema:e,typeName:Tt.ZodEffects,effect:t,...Lt(r)});Hi.createWithPreprocess=(e,t,r)=>new Hi({schema:t,effect:{type:"preprocess",transform:e},typeName:Tt.ZodEffects,...Lt(r)});var Fs=i(class extends zt{_parse(e){return this._getType(e)===tt.undefined?An(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodOptional");a(Fs,"ZodOptional");Fs.create=(e,t)=>new Fs({innerType:e,typeName:Tt.ZodOptional,...Lt(t)});var bo=i(class extends zt{_parse(e){return this._getType(e)===tt.null?An(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodNullable");a(bo,"ZodNullable");bo.create=(e,t)=>new bo({innerType:e,typeName:Tt.ZodNullable,...Lt(t)});var Wu=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===tt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}},"ZodDefault");a(Wu,"ZodDefault");Wu.create=(e,t)=>new Wu({innerType:e,typeName:Tt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Lt(t)});var id=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.innerType._parse({data:t.data,path:t.path,parent:{...t,common:{...t.common,issues:[]}}});return im(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue()})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue()}}removeCatch(){return this._def.innerType}},"ZodCatch");a(id,"ZodCatch");id.create=(e,t)=>new id({innerType:e,typeName:Tt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Lt(t)});var sd=i(class extends zt{_parse(e){if(this._getType(e)!==tt.nan){let r=this._getOrReturnCtx(e);return mt(r,{code:Ve.invalid_type,expected:tt.nan,received:r.parsedType}),kt}return{status:"valid",value:e.data}}},"ZodNaN");a(sd,"ZodNaN");sd.create=e=>new sd({typeName:Tt.ZodNaN,...Lt(e)});var WH=Symbol("zod_brand"),M6=i(class extends zt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}},"ZodBranded");a(M6,"ZodBranded");var Ad=i(class extends zt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return a(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?kt:s.status==="dirty"?(t.dirty(),RD(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})},"handleAsync")();{let n=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return n.status==="aborted"?kt:n.status==="dirty"?(t.dirty(),{status:"dirty",value:n.value}):this._def.out._parseSync({data:n.value,path:r.path,parent:r})}}static create(e,t){return new Ad({in:e,out:t,typeName:Tt.ZodPipeline})}},"ZodPipeline");a(Ad,"ZodPipeline");var PD=a((e,t={},r)=>e?Ec.create().superRefine((n,s)=>{if(!e(n)){let o=typeof t=="function"?t(n):t,c=typeof o=="string"?{message:o}:o;s.addIssue({code:"custom",...c,fatal:r})}}):Ec.create(),"custom"),ZH={object:Dr.lazycreate},Tt;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline"})(Tt||(Tt={}));var JH=a((e,t={message:`Input not instance of ${e.name}`})=>PD(r=>r instanceof e,t,!0),"instanceOfType"),BD=Aa.create,LD=go.create,YH=sd.create,XH=Uu.create,FD=$u.create,QH=wc.create,eq=ed.create,tq=ju.create,rq=zu.create,nq=Ec.create,iq=uo.create,sq=Us.create,aq=td.create,oq=fs.create,cq=Dr.create,uq=Dr.strictCreate,lq=Hu.create,fq=qm.create,dq=qu.create,hq=$s.create,pq=rd.create,mq=nd.create,vq=Ac.create,gq=ku.create,yq=Ku.create,bq=Vu.create,_q=yo.create,wq=Gu.create,Eq=Sc.create,mS=Hi.create,Aq=Fs.create,Sq=bo.create,xq=Hi.createWithPreprocess,Tq=Ad.create,Mq=a(()=>BD().optional(),"ostring"),Cq=a(()=>LD().optional(),"onumber"),Iq=a(()=>FD().optional(),"oboolean"),Dq={string:e=>Aa.create({...e,coerce:!0}),number:e=>go.create({...e,coerce:!0}),boolean:e=>$u.create({...e,coerce:!0}),bigint:e=>Uu.create({...e,coerce:!0}),date:e=>wc.create({...e,coerce:!0})},kq=kt,oe=Object.freeze({__proto__:null,defaultErrorMap:Xf,setErrorMap:OD,getErrorMap:Qf,makeIssue:rm,EMPTY_PATH:zH,addIssueToContext:mt,ParseStatus:Pn,INVALID:kt,DIRTY:RD,OK:An,isAborted:Wb,isDirty:Zb,isValid:nm,isAsync:im,get util(){return hr},ZodParsedType:tt,getParsedType:oo,ZodType:zt,ZodString:Aa,ZodNumber:go,ZodBigInt:Uu,ZodBoolean:$u,ZodDate:wc,ZodSymbol:ed,ZodUndefined:ju,ZodNull:zu,ZodAny:Ec,ZodUnknown:uo,ZodNever:Us,ZodVoid:td,ZodArray:fs,get objectUtil(){return sm},ZodObject:Dr,ZodUnion:Hu,ZodDiscriminatedUnion:qm,ZodIntersection:qu,ZodTuple:$s,ZodRecord:rd,ZodMap:nd,ZodSet:Ac,ZodFunction:ku,ZodLazy:Ku,ZodLiteral:Vu,ZodEnum:yo,ZodNativeEnum:Gu,ZodPromise:Sc,ZodEffects:Hi,ZodTransformer:Hi,ZodOptional:Fs,ZodNullable:bo,ZodDefault:Wu,ZodCatch:id,ZodNaN:sd,BRAND:WH,ZodBranded:M6,ZodPipeline:Ad,custom:PD,Schema:zt,ZodSchema:zt,late:ZH,get ZodFirstPartyTypeKind(){return Tt},coerce:Dq,any:nq,array:oq,bigint:XH,boolean:FD,date:QH,discriminatedUnion:fq,effect:mS,enum:_q,function:gq,instanceof:JH,intersection:dq,lazy:yq,literal:bq,map:mq,nan:YH,nativeEnum:wq,never:sq,null:rq,nullable:Sq,number:LD,object:cq,oboolean:Iq,onumber:Cq,optional:Aq,ostring:Mq,pipeline:Tq,preprocess:xq,promise:Eq,record:pq,set:vq,strictObject:uq,string:BD,symbol:eq,transformer:mS,tuple:hq,undefined:tq,union:lq,unknown:iq,void:aq,NEVER:kq,ZodIssueCode:Ve,quotelessJson:jH,ZodError:Ls}),UD=oe.array(oe.string().or(oe.record(oe.any()))),xY=oe.object({type:oe.string().optional(),narrative:oe.string().optional()}),Km=oe.string().or(oe.object({id:oe.string(),type:oe.string(),caption:oe.string().optional()})),Oq=oe.object({type:oe.string().min(1).or(oe.string().array().nonempty()),latitude:oe.number(),longitude:oe.number()}),Rq=oe.object({type:oe.string().min(1).or(oe.string().array().nonempty()),addressCountry:oe.string().optional(),addressCountryCode:oe.string().optional(),addressRegion:oe.string().optional(),addressLocality:oe.string().optional(),streetAddress:oe.string().optional(),postOfficeBoxNumber:oe.string().optional(),postalCode:oe.string().optional(),geo:Oq.optional()}),Nq=oe.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(oe.string()),$D=oe.object({type:oe.string().min(1).or(oe.string().array().nonempty()),identifier:oe.string(),identifierType:Nq}),ad=oe.string().or(oe.object({id:oe.string().optional(),type:oe.string().or(oe.string().array().nonempty().optional()),name:oe.string().optional(),url:oe.string().optional(),phone:oe.string().optional(),description:oe.string().optional(),endorsement:oe.any().array().optional(),image:Km.optional(),email:oe.string().email().optional(),address:Rq.optional(),otherIdentifier:$D.array().optional(),official:oe.string().optional(),parentOrg:oe.any().optional(),familyName:oe.string().optional(),givenName:oe.string().optional(),additionalName:oe.string().optional(),patronymicName:oe.string().optional(),honorificPrefix:oe.string().optional(),honorificSuffix:oe.string().optional(),familyNamePrefix:oe.string().optional(),dateOfBirth:oe.string().optional()}).catchall(oe.any())),Jb=oe.object({id:oe.string().optional()}).catchall(oe.any()),Pq=oe.object({type:oe.string(),id:oe.string()}),Bq=oe.object({id:oe.string(),type:oe.string()}),Lq=oe.object({id:oe.string(),type:oe.string()}).catchall(oe.any()),om=oe.object({"@context":UD,id:oe.string().optional(),type:oe.string().array().nonempty(),issuer:ad,issuanceDate:oe.string(),expirationDate:oe.string().optional(),credentialSubject:Jb.or(Jb.array()),credentialStatus:Pq.optional(),credentialSchema:Bq.array().optional(),refreshService:Lq.optional()}).catchall(oe.any()),_o=oe.object({type:oe.string(),created:oe.string(),challenge:oe.string().optional(),domain:oe.string().optional(),nonce:oe.string().optional(),proofPurpose:oe.string(),verificationMethod:oe.string(),jws:oe.string().optional()}).catchall(oe.any()),vS=om.extend({proof:_o.or(_o.array())}),Fq=oe.object({"@context":UD,id:oe.string().optional(),type:oe.string().array().nonempty(),verifiableCredential:vS.or(vS.array()).optional(),holder:oe.string().optional()}).catchall(oe.any()),TY=Fq.extend({proof:_o.or(_o.array())}),Uq=oe.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(oe.string()),Vm=oe.object({type:oe.string().array().nonempty(),targetCode:oe.string().optional(),targetDescription:oe.string().optional(),targetName:oe.string(),targetFramework:oe.string().optional(),targetType:Uq.optional(),targetUrl:oe.string()}),$q=oe.enum(["Achievement","ApprenticeshipCertificate","Assessment","Assignment","AssociateDegree","Award","Badge","BachelorDegree","Certificate","CertificateOfCompletion","Certification","CommunityService","Competency","Course","CoCurricular","Degree","Diploma","DoctoralDegree","Fieldwork","GeneralEducationDevelopment","JourneymanCertificate","LearningProgram","License","Membership","ProfessionalDoctorate","QualityAssuranceCredential","MasterCertificate","MasterDegree","MicroCredential","ResearchDoctorate","SecondarySchoolDiploma"]),jq=$q.or(oe.string()),zq=oe.object({id:oe.string().optional(),narrative:oe.string().optional()}).catchall(oe.any()),Hq=oe.object({id:oe.string(),type:oe.string().array().nonempty(),endorsementComment:oe.string().optional()}),qq=om.extend({credentialSubject:Hq,proof:_o.or(_o.array()).optional()}),Kq=oe.object({id:oe.string(),"@language":oe.string().optional(),version:oe.string().optional()}),Vq=oe.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(oe.string()),Gq=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:Vm.array().optional(),description:oe.string().optional(),level:oe.string().optional(),name:oe.string(),points:oe.string().optional()}).catchall(oe.any()),Wq=oe.object({id:oe.string(),type:oe.string().array().nonempty(),alignment:Vm.array().optional(),allowedValue:oe.string().array().optional(),name:oe.string(),requiredLevel:oe.string().optional(),requiredValue:oe.string().optional(),resultType:Vq,rubricCriterionLevel:Gq.array().optional(),valueMax:oe.string().optional(),valueMin:oe.string().optional()}).catchall(oe.any()),Zq=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),alignment:Vm.array().optional(),achievementType:jq.optional(),creator:ad.optional(),creditsAvailable:oe.number().optional(),criteria:zq,description:oe.string(),endorsement:qq.array().optional(),fieldOfStudy:oe.string().optional(),humanCode:oe.string().optional(),image:Km.optional(),"@language":oe.string().optional(),name:oe.string(),otherIdentifier:$D.array().optional(),related:Kq.array().optional(),resultDescription:Wq.array().optional(),specialization:oe.string().optional(),tag:oe.string().array().optional(),version:oe.string().optional()}).catchall(oe.any()),Jq=oe.object({type:oe.string(),hashed:oe.boolean(),identityHash:oe.string(),identityType:oe.string(),salt:oe.string().optional()}),Yq=oe.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),Xq=oe.object({type:oe.string().array().nonempty(),achievedLevel:oe.string().optional(),alignment:Vm.array().optional(),resultDescription:oe.string().optional(),status:Yq.optional(),value:oe.string().optional()}).catchall(oe.any()),gS=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),activityEndDate:oe.string().optional(),activityStartDate:oe.string().optional(),creditsEarned:oe.number().optional(),achievement:Zq.optional(),identifier:Jq.array().optional(),image:Km.optional(),licenseNumber:oe.string().optional(),narrative:oe.string().optional(),result:Xq.array().optional(),role:oe.string().optional(),source:ad.optional(),term:oe.string().optional()}).catchall(oe.any()),Qq=oe.object({id:oe.string().optional(),type:oe.string().array().nonempty(),narrative:oe.string().optional(),name:oe.string().optional(),description:oe.string().optional(),genre:oe.string().optional(),audience:oe.string().optional()}).catchall(oe.any()),eK=om.extend({name:oe.string().optional(),description:oe.string().optional(),image:Km.optional(),credentialSubject:gS.or(gS.array()),endorsement:om.array().optional(),evidence:Qq.array().optional()}),MY=eK.extend({proof:_o.or(_o.array())}),CY=oe.object({checks:oe.string().array(),warnings:oe.string().array(),errors:oe.string().array()}),jD=oe.enum(["Success","Failed","Error"]),IY=jD.enum,DY=oe.object({check:oe.string(),status:jD,message:oe.string().optional(),details:oe.string().optional()}),kY=oe.object({title:oe.string().optional(),createdAt:oe.string().optional(),issuer:ad.optional(),issuee:ad.optional(),credentialSubject:Jb.optional()}),OY=oe.object({id:oe.string(),uri:oe.string()}).catchall(oe.any()),RY=oe.object({limit:oe.number(),cursor:oe.string().optional()}),tK=oe.object({cursor:oe.string().optional(),hasMore:oe.boolean()}),rK=oe.object({kty:oe.string(),crv:oe.string(),x:oe.string(),y:oe.string().optional(),n:oe.string().optional(),d:oe.string()}),nK=oe.object({alg:oe.string(),iv:oe.string(),tag:oe.string(),epk:rK.partial().optional(),kid:oe.string().optional(),apv:oe.string().optional(),apu:oe.string().optional()}),iK=oe.object({header:nK,encrypted_key:oe.string()}),sK=oe.object({protected:oe.string(),iv:oe.string(),ciphertext:oe.string(),tag:oe.string(),aad:oe.string().optional(),recipients:iK.array().optional()}),aK=oe.object({encryptedRecord:sK,fields:oe.string().array(),id:oe.string()}).catchall(oe.any()),NY=tK.extend({records:aK.array()}),Yb=oe.object({profileId:oe.string().min(3).max(40),displayName:oe.string().default(""),did:oe.string(),email:oe.string().optional(),image:oe.string().optional(),isServiceProfile:oe.boolean().default(!1).optional(),notificationsWebhook:oe.string().url().startsWith("https://").optional()}),PY=oe.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),BY=oe.object({uri:oe.string(),to:oe.string(),from:oe.string(),sent:oe.string().datetime(),received:oe.string().datetime().optional()}),oK=oe.enum(["DRAFT","LIVE"]),LY=oe.object({uri:oe.string(),name:oe.string().optional(),type:oe.string().optional(),category:oe.string().optional(),status:oK.optional()}),FY=oe.object({to:Yb,from:oe.string(),received:oe.string()}),cK=oe.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED"]),uK=oe.object({title:oe.string().optional(),body:oe.string().optional()}),lK=oe.object({vcUris:oe.array(oe.string()).optional(),vpUris:oe.array(oe.string()).optional()}),UY=oe.object({type:cK,to:Yb.partial().and(oe.object({did:oe.string()})),from:Yb.partial().and(oe.object({did:oe.string()})),message:uK.optional(),data:lK.optional(),sent:oe.string().datetime().optional()}),$Y=oe.object({endpoint:oe.string(),name:oe.string(),did:oe.string().optional()}),jY=oe.object({ttlSeconds:oe.number().optional(),totalUses:oe.number().optional()}),fK=oe.object({endpoint:oe.string()}),zY=oe.object({signingAuthority:fK,relationship:oe.object({name:oe.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:oe.string()})}),Gm=a(e=>`lc:ceramic:${e}`,"streamIdToCeramicURI"),HY=oe.string().refine(e=>e.split(":").length===3&&e.split(":")[0]==="lc","URI must be of the form lc:${storage}:${url}").refine(e=>e.split(":")[1]==="ceramic","URI must use storage type ceramic (i.e. must be lc:ceramic:${streamID})");var C6=ne.object({credentials:uc.array()}).catchall(ne.any()),zD=ne.object({id:ne.string(),title:ne.string(),storageType:ne.literal("ceramic").optional()}).catchall(ne.any()),I6=ne.object({credentials:uc.or(zD).array()}).strict();var Wm=i(async(e,{modelData:t,credentialAlias:r})=>{let n=e.invoke.getCeramicClient(),s=new Tf({ceramic:n,model:t}),o=i(async(v=r)=>{let b=await s.get(v);if(!b)return{credentials:[]};let y=await C6.spa(b);if(y.success)return y.data;let A=await I6.spa(b);if(A.success){let R={credentials:A.data.credentials.map(L=>{if("uri"in L)return L;let{title:K,id:$,storageType:j,...V}=L;return{...V,id:K,uri:`lc:ceramic:${$.replace("ceramic://","")}`}})};return await s.set(r,R),R}throw console.error(y.error),new Error("Invalid credentials list stored in IDX")},"getCredentialsListFromIdx"),c=i(async(v,b)=>{if(!v)throw new Error("Must provide id to remove");b||(b=r);let y=await o(b);return y.credentials=y.credentials.filter(A=>A.id!==v),s.set(b,y)},"removeCredentialFromIdx"),l=i(async v=>(v||(v=r),s.set(v,{credentials:[]})),"removeAllCredentialsFromIdx"),h=i(async v=>{let b=await uc.parseAsync(v);if(!b)throw new Error("record is required");if(!b.uri)throw Error("No URI provided");await e.read.get(b.uri);let y=await o(r),A=y.credentials.findIndex(C=>C.id===b.id);return A>-1?y.credentials[A]=b:y.credentials.push(b),Gm(await s.set(r,y))},"addCredentialInIdx"),p=i(async v=>{let b=uc.array().parse(v),y=await o(r);return await Promise.all(b.map(async A=>{await e.read.get(A.uri);let C=y.credentials.findIndex(O=>O.id===A.id);C>-1?y.credentials[C]=A:y.credentials.push(A)})),Gm(await s.set(r,y))},"addCredentialsInIdx");return{name:"IDX",displayName:"IDX",description:"Stores a bespoke index of credentials for an individual based on their did",index:{get:async v=>(v.debug?.("learnCard.index.IDX.get"),(await o()).credentials),add:async(v,b)=>{v.debug?.("learnCard.index.IDX.add");try{return await h(b),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},addMany:async(v,b)=>{v.debug?.("learnCard.index.IDX.add");try{return await p(b),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},update:async v=>(v.debug?.("learnCard.index.IDX.update"),!1),remove:async(v,b)=>{v.debug?.("learnCard.index.IDX.remove");try{return await c(b),!0}catch(y){return console.error("Error removing credential from IDX:",y),!1}},removeAll:async v=>{v.debug?.("learnCard.index.IDX.removeAll");try{return await l(),!0}catch(b){return console.error("Error removing credentials from IDX:",b),!1}}},methods:{getCredentialsListFromIdx:async(v,b=r)=>(await o(b)).credentials,getVerifiableCredentialFromIdx:async(v,b)=>{let A=(await o())?.credentials?.find(R=>R?.id===b),C=v.read.get(A?.uri),O=await a0.safeParseAsync(C);return O.success?O.data:void 0},getVerifiableCredentialsFromIdx:async v=>{let y=(await o())?.credentials?.map(A=>A?.uri)??[];return(await Promise.all(y.map(async A=>v.read.get(A)))).filter(A=>!!A)},addVerifiableCredentialInIdx:async(v,b)=>{let y=uc.parse(b);if(!y)throw new Error("record is required");if(!y.uri)throw Error("No URI provided");await v.read.get(y.uri);let A=await o(r),C=A.credentials.findIndex(O=>O.id===y.id);return C>-1?A.credentials[C]=y:A.credentials.push(y),Gm(await s.set(r,A))},removeVerifiableCredentialInIdx:async(v,b)=>c(b),removeAllVerifiableCredentialsInIdx:async()=>l(),getIDXIndex:async()=>s.get(r),setIDXIndex:async(v,b)=>s.set(r,b)}}},"getIDXPlugin");var dK=Wm;
|
|
841
|
+
/*!
|
|
842
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
843
|
+
* (c) 2017-2021 Joachim Wester
|
|
844
|
+
* MIT license
|
|
845
|
+
*/
|
|
846
|
+
/*!
|
|
847
|
+
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
848
|
+
* (c) 2017-2022 Joachim Wester
|
|
849
|
+
* MIT licensed
|
|
850
|
+
*/
|
|
851
|
+
/**
|
|
852
|
+
* @license
|
|
853
|
+
* Lodash <https://lodash.com/>
|
|
854
|
+
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
855
|
+
* Released under MIT license <https://lodash.com/license>
|
|
856
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
857
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
858
|
+
*/
|
|
859
|
+
/**
|
|
860
|
+
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
861
|
+
*
|
|
862
|
+
* @version 0.8.0
|
|
863
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
864
|
+
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
865
|
+
* @license MIT
|
|
866
|
+
*/
|
|
867
|
+
//# sourceMappingURL=idx-plugin.cjs.production.min.js.map
|