@learncard/idx-plugin 1.0.35 → 1.0.37

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.
@@ -1,10 +1,10 @@
1
- "use strict";var rO=Object.create;var pf=Object.defineProperty;var nO=Object.getOwnPropertyDescriptor;var iO=Object.getOwnPropertyNames;var aO=Object.getPrototypeOf,oO=Object.prototype.hasOwnProperty;var i=(e,t)=>pf(e,"name",{value:t,configurable:!0});var Vn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),En=(e,t)=>{for(var r in t)pf(e,r,{get:t[r],enumerable:!0})},s8=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of iO(t))!oO.call(e,a)&&a!==r&&pf(e,a,{get:()=>t[a],enumerable:!(n=nO(t,a))||n.enumerable});return e};var Hs=(e,t,r)=>(r=e!=null?rO(aO(e)):{},s8(t||!e||!e.__esModule?pf(r,"default",{value:e,enumerable:!0}):r,e)),sO=e=>s8(pf({},"__esModule",{value:!0}),e);var E8=Vn((xK,_8)=>{_8.exports=Zg;var w8=128,ZO=127,YO=~ZO,XO=Math.pow(2,31);function Zg(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw Zg.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=XO;)t[r++]=e&255|w8,e/=128;for(;e&YO;)t[r++]=e&255|w8,e>>>=7;return t[r]=e|0,Zg.bytes=r-n+1,t}i(Zg,"encode")});var x8=Vn((TK,S8)=>{S8.exports=Yg;var QO=128,A8=127;function Yg(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l||a>49)throw Yg.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&A8)<<a:(c&A8)*Math.pow(2,a),a+=7}while(c>=QO);return Yg.bytes=s-n,r}i(Yg,"read")});var C8=Vn((CK,T8)=>{var eN=Math.pow(2,7),tN=Math.pow(2,14),rN=Math.pow(2,21),nN=Math.pow(2,28),iN=Math.pow(2,35),aN=Math.pow(2,42),oN=Math.pow(2,49),sN=Math.pow(2,56),cN=Math.pow(2,63);T8.exports=function(e){return e<eN?1:e<tN?2:e<rN?3:e<nN?4:e<iN?5:e<aN?6:e<oN?7:e<sN?8:e<cN?9:10}});var ip=Vn((MK,M8)=>{M8.exports={encode:E8(),decode:x8(),encodingLength:C8()}});var Xv=Vn((Df,Au)=>{var FP=200,d9="__lodash_hash_undefined__",h9=9007199254740991,Vv="[object Arguments]",jP="[object Array]",p9="[object Boolean]",m9="[object Date]",$P="[object Error]",Kv="[object Function]",g9="[object GeneratorFunction]",Rp="[object Map]",v9="[object Number]",Gv="[object Object]",t9="[object Promise]",y9="[object RegExp]",Op="[object Set]",b9="[object String]",w9="[object Symbol]",Fv="[object WeakMap]",_9="[object ArrayBuffer]",Np="[object DataView]",E9="[object Float32Array]",A9="[object Float64Array]",S9="[object Int8Array]",x9="[object Int16Array]",T9="[object Int32Array]",C9="[object Uint8Array]",M9="[object Uint8ClampedArray]",I9="[object Uint16Array]",k9="[object Uint32Array]",zP=/[\\^$.*+?()[\]{}|]/g,HP=/\w*$/,qP=/^\[object .+?Constructor\]$/,VP=/^(?:0|[1-9]\d*)$/,Tr={};Tr[Vv]=Tr[jP]=Tr[_9]=Tr[Np]=Tr[p9]=Tr[m9]=Tr[E9]=Tr[A9]=Tr[S9]=Tr[x9]=Tr[T9]=Tr[Rp]=Tr[v9]=Tr[Gv]=Tr[y9]=Tr[Op]=Tr[b9]=Tr[w9]=Tr[C9]=Tr[M9]=Tr[I9]=Tr[k9]=!0;Tr[$P]=Tr[Kv]=Tr[Fv]=!1;var KP=typeof global=="object"&&global&&global.Object===Object&&global,GP=typeof self=="object"&&self&&self.Object===Object&&self,mo=KP||GP||Function("return this")(),D9=typeof Df=="object"&&Df&&!Df.nodeType&&Df,r9=D9&&typeof Au=="object"&&Au&&!Au.nodeType&&Au,WP=r9&&r9.exports===D9;function JP(e,t){return e.set(t[0],t[1]),e}i(JP,"addMapEntry");function ZP(e,t){return e.add(t),e}i(ZP,"addSetEntry");function YP(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}i(YP,"arrayEach");function XP(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}i(XP,"arrayPush");function R9(e,t,r,n){var a=-1,s=e?e.length:0;for(n&&s&&(r=e[++a]);++a<s;)r=t(r,e[a],a,e);return r}i(R9,"arrayReduce");function QP(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}i(QP,"baseTimes");function eB(e,t){return e?.[t]}i(eB,"getValue");function O9(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}i(O9,"isHostObject");function n9(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}i(n9,"mapToArray");function Wv(e,t){return function(r){return e(t(r))}}i(Wv,"overArg");function i9(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}i(i9,"setToArray");var tB=Array.prototype,rB=Function.prototype,Pp=Object.prototype,Uv=mo["__core-js_shared__"],a9=function(){var e=/[^.]+$/.exec(Uv&&Uv.keys&&Uv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),N9=rB.toString,Jo=Pp.hasOwnProperty,Bp=Pp.toString,nB=RegExp("^"+N9.call(Jo).replace(zP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),o9=WP?mo.Buffer:void 0,s9=mo.Symbol,c9=mo.Uint8Array,iB=Wv(Object.getPrototypeOf,Object),aB=Object.create,oB=Pp.propertyIsEnumerable,sB=tB.splice,u9=Object.getOwnPropertySymbols,cB=o9?o9.isBuffer:void 0,uB=Wv(Object.keys,Object),jv=Tu(mo,"DataView"),Rf=Tu(mo,"Map"),$v=Tu(mo,"Promise"),zv=Tu(mo,"Set"),Hv=Tu(mo,"WeakMap"),Of=Tu(Object,"create"),lB=tc(jv),fB=tc(Rf),dB=tc($v),hB=tc(zv),pB=tc(Hv),l9=s9?s9.prototype:void 0,f9=l9?l9.valueOf:void 0;function ec(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(ec,"Hash");function mB(){this.__data__=Of?Of(null):{}}i(mB,"hashClear");function gB(e){return this.has(e)&&delete this.__data__[e]}i(gB,"hashDelete");function vB(e){var t=this.__data__;if(Of){var r=t[e];return r===d9?void 0:r}return Jo.call(t,e)?t[e]:void 0}i(vB,"hashGet");function yB(e){var t=this.__data__;return Of?t[e]!==void 0:Jo.call(t,e)}i(yB,"hashHas");function bB(e,t){var r=this.__data__;return r[e]=Of&&t===void 0?d9:t,this}i(bB,"hashSet");ec.prototype.clear=mB;ec.prototype.delete=gB;ec.prototype.get=vB;ec.prototype.has=yB;ec.prototype.set=bB;function go(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(go,"ListCache");function wB(){this.__data__=[]}i(wB,"listCacheClear");function _B(e){var t=this.__data__,r=Lp(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():sB.call(t,r,1),!0}i(_B,"listCacheDelete");function EB(e){var t=this.__data__,r=Lp(t,e);return r<0?void 0:t[r][1]}i(EB,"listCacheGet");function AB(e){return Lp(this.__data__,e)>-1}i(AB,"listCacheHas");function SB(e,t){var r=this.__data__,n=Lp(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}i(SB,"listCacheSet");go.prototype.clear=wB;go.prototype.delete=_B;go.prototype.get=EB;go.prototype.has=AB;go.prototype.set=SB;function Su(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(Su,"MapCache");function xB(){this.__data__={hash:new ec,map:new(Rf||go),string:new ec}}i(xB,"mapCacheClear");function TB(e){return Up(this,e).delete(e)}i(TB,"mapCacheDelete");function CB(e){return Up(this,e).get(e)}i(CB,"mapCacheGet");function MB(e){return Up(this,e).has(e)}i(MB,"mapCacheHas");function IB(e,t){return Up(this,e).set(e,t),this}i(IB,"mapCacheSet");Su.prototype.clear=xB;Su.prototype.delete=TB;Su.prototype.get=CB;Su.prototype.has=MB;Su.prototype.set=IB;function xu(e){this.__data__=new go(e)}i(xu,"Stack");function kB(){this.__data__=new go}i(kB,"stackClear");function DB(e){return this.__data__.delete(e)}i(DB,"stackDelete");function RB(e){return this.__data__.get(e)}i(RB,"stackGet");function OB(e){return this.__data__.has(e)}i(OB,"stackHas");function NB(e,t){var r=this.__data__;if(r instanceof go){var n=r.__data__;if(!Rf||n.length<FP-1)return n.push([e,t]),this;r=this.__data__=new Su(n)}return r.set(e,t),this}i(NB,"stackSet");xu.prototype.clear=kB;xu.prototype.delete=DB;xu.prototype.get=RB;xu.prototype.has=OB;xu.prototype.set=NB;function PB(e,t){var r=Zv(e)||aL(e)?QP(e.length,String):[],n=r.length,a=!!n;for(var s in e)(t||Jo.call(e,s))&&!(a&&(s=="length"||tL(s,n)))&&r.push(s);return r}i(PB,"arrayLikeKeys");function P9(e,t,r){var n=e[t];(!(Jo.call(e,t)&&F9(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}i(P9,"assignValue");function Lp(e,t){for(var r=e.length;r--;)if(F9(e[r][0],t))return r;return-1}i(Lp,"assocIndexOf");function BB(e,t){return e&&B9(t,Yv(t),e)}i(BB,"baseAssign");function qv(e,t,r,n,a,s,c){var l;if(n&&(l=s?n(e,a,s,c):n(e)),l!==void 0)return l;if(!Fp(e))return e;var h=Zv(e);if(h){if(l=XB(e),!t)return JB(e,l)}else{var p=Qs(e),g=p==Kv||p==g9;if(sL(e))return zB(e,t);if(p==Gv||p==Vv||g&&!s){if(O9(e))return s?e:{};if(l=QB(g?{}:e),!t)return ZB(e,BB(l,e))}else{if(!Tr[p])return s?e:{};l=eL(e,p,qv,t)}}c||(c=new xu);var v=c.get(e);if(v)return v;if(c.set(e,l),!h)var y=r?YB(e):Yv(e);return YP(y||e,function(_,x){y&&(x=_,_=e[x]),P9(l,x,qv(_,t,r,n,x,e,c))}),l}i(qv,"baseClone");function LB(e){return Fp(e)?aB(e):{}}i(LB,"baseCreate");function UB(e,t,r){var n=t(e);return Zv(e)?n:XP(n,r(e))}i(UB,"baseGetAllKeys");function FB(e){return Bp.call(e)}i(FB,"baseGetTag");function jB(e){if(!Fp(e)||nL(e))return!1;var t=$9(e)||O9(e)?nB:qP;return t.test(tc(e))}i(jB,"baseIsNative");function $B(e){if(!U9(e))return uB(e);var t=[];for(var r in Object(e))Jo.call(e,r)&&r!="constructor"&&t.push(r);return t}i($B,"baseKeys");function zB(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}i(zB,"cloneBuffer");function Jv(e){var t=new e.constructor(e.byteLength);return new c9(t).set(new c9(e)),t}i(Jv,"cloneArrayBuffer");function HB(e,t){var r=t?Jv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}i(HB,"cloneDataView");function qB(e,t,r){var n=t?r(n9(e),!0):n9(e);return R9(n,JP,new e.constructor)}i(qB,"cloneMap");function VB(e){var t=new e.constructor(e.source,HP.exec(e));return t.lastIndex=e.lastIndex,t}i(VB,"cloneRegExp");function KB(e,t,r){var n=t?r(i9(e),!0):i9(e);return R9(n,ZP,new e.constructor)}i(KB,"cloneSet");function GB(e){return f9?Object(f9.call(e)):{}}i(GB,"cloneSymbol");function WB(e,t){var r=t?Jv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}i(WB,"cloneTypedArray");function JB(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}i(JB,"copyArray");function B9(e,t,r,n){r||(r={});for(var a=-1,s=t.length;++a<s;){var c=t[a],l=n?n(r[c],e[c],c,r,e):void 0;P9(r,c,l===void 0?e[c]:l)}return r}i(B9,"copyObject");function ZB(e,t){return B9(e,L9(e),t)}i(ZB,"copySymbols");function YB(e){return UB(e,Yv,L9)}i(YB,"getAllKeys");function Up(e,t){var r=e.__data__;return rL(t)?r[typeof t=="string"?"string":"hash"]:r.map}i(Up,"getMapData");function Tu(e,t){var r=eB(e,t);return jB(r)?r:void 0}i(Tu,"getNative");var L9=u9?Wv(u9,Object):lL,Qs=FB;(jv&&Qs(new jv(new ArrayBuffer(1)))!=Np||Rf&&Qs(new Rf)!=Rp||$v&&Qs($v.resolve())!=t9||zv&&Qs(new zv)!=Op||Hv&&Qs(new Hv)!=Fv)&&(Qs=i(function(e){var t=Bp.call(e),r=t==Gv?e.constructor:void 0,n=r?tc(r):void 0;if(n)switch(n){case lB:return Np;case fB:return Rp;case dB:return t9;case hB:return Op;case pB:return Fv}return t},"getTag"));function XB(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&Jo.call(e,"index")&&(r.index=e.index,r.input=e.input),r}i(XB,"initCloneArray");function QB(e){return typeof e.constructor=="function"&&!U9(e)?LB(iB(e)):{}}i(QB,"initCloneObject");function eL(e,t,r,n){var a=e.constructor;switch(t){case _9:return Jv(e);case p9:case m9:return new a(+e);case Np:return HB(e,n);case E9:case A9:case S9:case x9:case T9:case C9:case M9:case I9:case k9:return WB(e,n);case Rp:return qB(e,n,r);case v9:case b9:return new a(e);case y9:return VB(e);case Op:return KB(e,n,r);case w9:return GB(e)}}i(eL,"initCloneByTag");function tL(e,t){return t=t??h9,!!t&&(typeof e=="number"||VP.test(e))&&e>-1&&e%1==0&&e<t}i(tL,"isIndex");function rL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}i(rL,"isKeyable");function nL(e){return!!a9&&a9 in e}i(nL,"isMasked");function U9(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Pp;return e===r}i(U9,"isPrototype");function tc(e){if(e!=null){try{return N9.call(e)}catch{}try{return e+""}catch{}}return""}i(tc,"toSource");function iL(e){return qv(e,!0,!0)}i(iL,"cloneDeep");function F9(e,t){return e===t||e!==e&&t!==t}i(F9,"eq");function aL(e){return oL(e)&&Jo.call(e,"callee")&&(!oB.call(e,"callee")||Bp.call(e)==Vv)}i(aL,"isArguments");var Zv=Array.isArray;function j9(e){return e!=null&&cL(e.length)&&!$9(e)}i(j9,"isArrayLike");function oL(e){return uL(e)&&j9(e)}i(oL,"isArrayLikeObject");var sL=cB||fL;function $9(e){var t=Fp(e)?Bp.call(e):"";return t==Kv||t==g9}i($9,"isFunction");function cL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=h9}i(cL,"isLength");function Fp(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}i(Fp,"isObject");function uL(e){return!!e&&typeof e=="object"}i(uL,"isObjectLike");function Yv(e){return j9(e)?PB(e):$B(e)}i(Yv,"keys");function lL(){return[]}i(lL,"stubArray");function fL(){return!1}i(fL,"stubFalse");Au.exports=iL});var H9=Vn($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.BrowserRandomSource=void 0;var z9=65536,jp=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+=z9)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,z9)));return r}};i(jp,"BrowserRandomSource");$p.BrowserRandomSource=jp});var ey=Vn(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});function dL(e){for(var t=0;t<e.length;t++)e[t]=0;return e}i(dL,"wipe");Qv.wipe=dL});var q9=Vn(()=>{});var V9=Vn(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.NodeRandomSource=void 0;var hL=ey(),zp=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let t=q9();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 a=0;a<n.length;a++)n[a]=r[a];return(0,hL.wipe)(r),n}};i(zp,"NodeRandomSource");Hp.NodeRandomSource=zp});var K9=Vn(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.SystemRandomSource=void 0;var pL=H9(),mL=V9(),qp=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new pL.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new mL.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(qp,"SystemRandomSource");Vp.SystemRandomSource=qp});var G9=Vn(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});function gL(e,t){var r=e>>>16&65535,n=e&65535,a=t>>>16&65535,s=t&65535;return n*s+(r*s+n*a<<16>>>0)|0}i(gL,"imulShim");pi.mul=Math.imul||gL;function vL(e,t){return e+t|0}i(vL,"add");pi.add=vL;function yL(e,t){return e-t|0}i(yL,"sub");pi.sub=yL;function bL(e,t){return e<<t|e>>>32-t}i(bL,"rotl");pi.rotl=bL;function wL(e,t){return e<<32-t|e>>>t}i(wL,"rotr");pi.rotr=wL;function _L(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}i(_L,"isIntegerShim");pi.isInteger=Number.isInteger||_L;pi.MAX_SAFE_INTEGER=9007199254740991;pi.isSafeInteger=function(e){return pi.isInteger(e)&&e>=-pi.MAX_SAFE_INTEGER&&e<=pi.MAX_SAFE_INTEGER}});var Q9=Vn(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});var W9=G9();function EL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}i(EL,"readInt16BE");qt.readInt16BE=EL;function AL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}i(AL,"readUint16BE");qt.readUint16BE=AL;function SL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}i(SL,"readInt16LE");qt.readInt16LE=SL;function xL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}i(xL,"readUint16LE");qt.readUint16LE=xL;function J9(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(J9,"writeUint16BE");qt.writeUint16BE=J9;qt.writeInt16BE=J9;function Z9(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(Z9,"writeUint16LE");qt.writeUint16LE=Z9;qt.writeInt16LE=Z9;function ty(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}i(ty,"readInt32BE");qt.readInt32BE=ty;function ry(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}i(ry,"readUint32BE");qt.readUint32BE=ry;function ny(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}i(ny,"readInt32LE");qt.readInt32LE=ny;function iy(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}i(iy,"readUint32LE");qt.readUint32LE=iy;function Kp(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(Kp,"writeUint32BE");qt.writeUint32BE=Kp;qt.writeInt32BE=Kp;function Gp(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(Gp,"writeUint32LE");qt.writeUint32LE=Gp;qt.writeInt32LE=Gp;function TL(e,t){t===void 0&&(t=0);var r=ty(e,t),n=ty(e,t+4);return r*4294967296+n-(n>>31)*4294967296}i(TL,"readInt64BE");qt.readInt64BE=TL;function CL(e,t){t===void 0&&(t=0);var r=ry(e,t),n=ry(e,t+4);return r*4294967296+n}i(CL,"readUint64BE");qt.readUint64BE=CL;function ML(e,t){t===void 0&&(t=0);var r=ny(e,t),n=ny(e,t+4);return n*4294967296+r-(r>>31)*4294967296}i(ML,"readInt64LE");qt.readInt64LE=ML;function IL(e,t){t===void 0&&(t=0);var r=iy(e,t),n=iy(e,t+4);return n*4294967296+r}i(IL,"readUint64LE");qt.readUint64LE=IL;function Y9(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Kp(e/4294967296>>>0,t,r),Kp(e>>>0,t,r+4),t}i(Y9,"writeUint64BE");qt.writeUint64BE=Y9;qt.writeInt64BE=Y9;function X9(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Gp(e>>>0,t,r),Gp(e/4294967296>>>0,t,r+4),t}i(X9,"writeUint64LE");qt.writeUint64LE=X9;qt.writeInt64LE=X9;function kL(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,a=1,s=e/8+r-1;s>=r;s--)n+=t[s]*a,a*=256;return n}i(kL,"readUintBE");qt.readUintBE=kL;function DL(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,a=1,s=r;s<r+e/8;s++)n+=t[s]*a,a*=256;return n}i(DL,"readUintLE");qt.readUintLE=DL;function RL(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(!W9.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var a=1,s=e/8+n-1;s>=n;s--)r[s]=t/a&255,a*=256;return r}i(RL,"writeUintBE");qt.writeUintBE=RL;function OL(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(!W9.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var a=1,s=n;s<n+e/8;s++)r[s]=t/a&255,a*=256;return r}i(OL,"writeUintLE");qt.writeUintLE=OL;function NL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}i(NL,"readFloat32BE");qt.readFloat32BE=NL;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");qt.readFloat32LE=PL;function BL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}i(BL,"readFloat64BE");qt.readFloat64BE=BL;function LL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}i(LL,"readFloat64LE");qt.readFloat64LE=LL;function UL(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(UL,"writeFloat32BE");qt.writeFloat32BE=UL;function FL(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(FL,"writeFloat32LE");qt.writeFloat32LE=FL;function jL(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(jL,"writeFloat64BE");qt.writeFloat64BE=jL;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");qt.writeFloat64LE=$L});var n7=Vn(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.randomStringForEntropy=An.randomString=An.randomUint32=An.randomBytes=An.defaultRandomSource=void 0;var zL=K9(),HL=Q9(),e7=ey();An.defaultRandomSource=new zL.SystemRandomSource;function ay(e,t=An.defaultRandomSource){return t.randomBytes(e)}i(ay,"randomBytes");An.randomBytes=ay;function qL(e=An.defaultRandomSource){let t=ay(4,e),r=(0,HL.readUint32LE)(t);return(0,e7.wipe)(t),r}i(qL,"randomUint32");An.randomUint32=qL;var t7="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function r7(e,t=t7,r=An.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="",a=t.length,s=256-256%a;for(;e>0;){let c=ay(Math.ceil(e*256/s),r);for(let l=0;l<c.length&&e>0;l++){let h=c[l];h<s&&(n+=t.charAt(h%a),e--)}(0,e7.wipe)(c)}return n}i(r7,"randomString");An.randomString=r7;function VL(e,t=t7,r=An.defaultRandomSource){let n=Math.ceil(e/(Math.log(t.length)/Math.LN2));return r7(n,t,r)}i(VL,"randomStringForEntropy");An.randomStringForEntropy=VL});var x7=Vn((AZ,S7)=>{"use strict";var eU=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=iU(n),this._batchScheduleFn=aU(n),this._cacheKeyFn=oU(n),this._cacheMap=sU(n),this._batch=null,this.name=cU(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 a=rU(this),s=this._cacheMap,c;if(s){c=this._cacheKeyFn(n);var l=s.get(c);if(l){var h=a.cacheHits||(a.cacheHits=[]);return new Promise(function(g){h.push(function(){g(l)})})}}a.keys.push(n);var p=new Promise(function(g,v){a.callbacks.push({resolve:g,reject:v})});return s&&s.set(c,p),p},"load"),t.loadMany=i(function(n){if(!A7(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var a=[],s=0;s<n.length;s++)a.push(this.load(n[s]).catch(function(c){return c}));return Promise.all(a)},"loadMany"),t.clear=i(function(n){var a=this._cacheMap;if(a){var s=this._cacheKeyFn(n);a.delete(s)}return this},"clear"),t.clearAll=i(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),t.prime=i(function(n,a){var s=this._cacheMap;if(s){var c=this._cacheKeyFn(n);if(s.get(c)===void 0){var l;a instanceof Error?(l=Promise.reject(a),l.catch(function(){})):l=Promise.resolve(a),s.set(c,l)}}return this},"prime"),e}(),tU=typeof process=="object"&&typeof process.nextTick=="function"?function(e){_y||(_y=Promise.resolve()),_y.then(function(){process.nextTick(e)})}:typeof setImmediate=="function"?function(e){setImmediate(e)}:function(e){setTimeout(e)},_y;function rU(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(){nU(e,r)}),r}i(rU,"getCurrentBatch");function nU(e,t){if(t.hasDispatched=!0,t.keys.length===0){Ay(t);return}var r;try{r=e._batchLoadFn(t.keys)}catch(n){return Ey(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 Ey(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(!A7(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."+(`
1
+ "use strict";var rO=Object.create;var pf=Object.defineProperty;var nO=Object.getOwnPropertyDescriptor;var iO=Object.getOwnPropertyNames;var aO=Object.getPrototypeOf,oO=Object.prototype.hasOwnProperty;var i=(e,t)=>pf(e,"name",{value:t,configurable:!0});var Vn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),En=(e,t)=>{for(var r in t)pf(e,r,{get:t[r],enumerable:!0})},s8=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of iO(t))!oO.call(e,a)&&a!==r&&pf(e,a,{get:()=>t[a],enumerable:!(n=nO(t,a))||n.enumerable});return e};var Vs=(e,t,r)=>(r=e!=null?rO(aO(e)):{},s8(t||!e||!e.__esModule?pf(r,"default",{value:e,enumerable:!0}):r,e)),sO=e=>s8(pf({},"__esModule",{value:!0}),e);var E8=Vn((xK,_8)=>{_8.exports=Zg;var w8=128,ZO=127,YO=~ZO,XO=Math.pow(2,31);function Zg(e,t,r){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw Zg.bytes=0,new RangeError("Could not encode varint");t=t||[],r=r||0;for(var n=r;e>=XO;)t[r++]=e&255|w8,e/=128;for(;e&YO;)t[r++]=e&255|w8,e>>>=7;return t[r]=e|0,Zg.bytes=r-n+1,t}i(Zg,"encode")});var x8=Vn((TK,S8)=>{S8.exports=Yg;var QO=128,A8=127;function Yg(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l||a>49)throw Yg.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&A8)<<a:(c&A8)*Math.pow(2,a),a+=7}while(c>=QO);return Yg.bytes=s-n,r}i(Yg,"read")});var C8=Vn((CK,T8)=>{var eN=Math.pow(2,7),tN=Math.pow(2,14),rN=Math.pow(2,21),nN=Math.pow(2,28),iN=Math.pow(2,35),aN=Math.pow(2,42),oN=Math.pow(2,49),sN=Math.pow(2,56),cN=Math.pow(2,63);T8.exports=function(e){return e<eN?1:e<tN?2:e<rN?3:e<nN?4:e<iN?5:e<aN?6:e<oN?7:e<sN?8:e<cN?9:10}});var ip=Vn((MK,M8)=>{M8.exports={encode:E8(),decode:x8(),encodingLength:C8()}});var Xv=Vn((Df,Au)=>{var FP=200,d9="__lodash_hash_undefined__",h9=9007199254740991,Vv="[object Arguments]",jP="[object Array]",p9="[object Boolean]",m9="[object Date]",$P="[object Error]",Kv="[object Function]",g9="[object GeneratorFunction]",Rp="[object Map]",v9="[object Number]",Gv="[object Object]",t9="[object Promise]",y9="[object RegExp]",Op="[object Set]",b9="[object String]",w9="[object Symbol]",Fv="[object WeakMap]",_9="[object ArrayBuffer]",Np="[object DataView]",E9="[object Float32Array]",A9="[object Float64Array]",S9="[object Int8Array]",x9="[object Int16Array]",T9="[object Int32Array]",C9="[object Uint8Array]",M9="[object Uint8ClampedArray]",I9="[object Uint16Array]",k9="[object Uint32Array]",zP=/[\\^$.*+?()[\]{}|]/g,HP=/\w*$/,qP=/^\[object .+?Constructor\]$/,VP=/^(?:0|[1-9]\d*)$/,Tr={};Tr[Vv]=Tr[jP]=Tr[_9]=Tr[Np]=Tr[p9]=Tr[m9]=Tr[E9]=Tr[A9]=Tr[S9]=Tr[x9]=Tr[T9]=Tr[Rp]=Tr[v9]=Tr[Gv]=Tr[y9]=Tr[Op]=Tr[b9]=Tr[w9]=Tr[C9]=Tr[M9]=Tr[I9]=Tr[k9]=!0;Tr[$P]=Tr[Kv]=Tr[Fv]=!1;var KP=typeof global=="object"&&global&&global.Object===Object&&global,GP=typeof self=="object"&&self&&self.Object===Object&&self,mo=KP||GP||Function("return this")(),D9=typeof Df=="object"&&Df&&!Df.nodeType&&Df,r9=D9&&typeof Au=="object"&&Au&&!Au.nodeType&&Au,WP=r9&&r9.exports===D9;function JP(e,t){return e.set(t[0],t[1]),e}i(JP,"addMapEntry");function ZP(e,t){return e.add(t),e}i(ZP,"addSetEntry");function YP(e,t){for(var r=-1,n=e?e.length:0;++r<n&&t(e[r],r,e)!==!1;);return e}i(YP,"arrayEach");function XP(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}i(XP,"arrayPush");function R9(e,t,r,n){var a=-1,s=e?e.length:0;for(n&&s&&(r=e[++a]);++a<s;)r=t(r,e[a],a,e);return r}i(R9,"arrayReduce");function QP(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}i(QP,"baseTimes");function eB(e,t){return e?.[t]}i(eB,"getValue");function O9(e){var t=!1;if(e!=null&&typeof e.toString!="function")try{t=!!(e+"")}catch{}return t}i(O9,"isHostObject");function n9(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}i(n9,"mapToArray");function Wv(e,t){return function(r){return e(t(r))}}i(Wv,"overArg");function i9(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}i(i9,"setToArray");var tB=Array.prototype,rB=Function.prototype,Pp=Object.prototype,Uv=mo["__core-js_shared__"],a9=function(){var e=/[^.]+$/.exec(Uv&&Uv.keys&&Uv.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),N9=rB.toString,Jo=Pp.hasOwnProperty,Bp=Pp.toString,nB=RegExp("^"+N9.call(Jo).replace(zP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),o9=WP?mo.Buffer:void 0,s9=mo.Symbol,c9=mo.Uint8Array,iB=Wv(Object.getPrototypeOf,Object),aB=Object.create,oB=Pp.propertyIsEnumerable,sB=tB.splice,u9=Object.getOwnPropertySymbols,cB=o9?o9.isBuffer:void 0,uB=Wv(Object.keys,Object),jv=Tu(mo,"DataView"),Rf=Tu(mo,"Map"),$v=Tu(mo,"Promise"),zv=Tu(mo,"Set"),Hv=Tu(mo,"WeakMap"),Of=Tu(Object,"create"),lB=nc(jv),fB=nc(Rf),dB=nc($v),hB=nc(zv),pB=nc(Hv),l9=s9?s9.prototype:void 0,f9=l9?l9.valueOf:void 0;function rc(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(rc,"Hash");function mB(){this.__data__=Of?Of(null):{}}i(mB,"hashClear");function gB(e){return this.has(e)&&delete this.__data__[e]}i(gB,"hashDelete");function vB(e){var t=this.__data__;if(Of){var r=t[e];return r===d9?void 0:r}return Jo.call(t,e)?t[e]:void 0}i(vB,"hashGet");function yB(e){var t=this.__data__;return Of?t[e]!==void 0:Jo.call(t,e)}i(yB,"hashHas");function bB(e,t){var r=this.__data__;return r[e]=Of&&t===void 0?d9:t,this}i(bB,"hashSet");rc.prototype.clear=mB;rc.prototype.delete=gB;rc.prototype.get=vB;rc.prototype.has=yB;rc.prototype.set=bB;function go(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(go,"ListCache");function wB(){this.__data__=[]}i(wB,"listCacheClear");function _B(e){var t=this.__data__,r=Lp(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():sB.call(t,r,1),!0}i(_B,"listCacheDelete");function EB(e){var t=this.__data__,r=Lp(t,e);return r<0?void 0:t[r][1]}i(EB,"listCacheGet");function AB(e){return Lp(this.__data__,e)>-1}i(AB,"listCacheHas");function SB(e,t){var r=this.__data__,n=Lp(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}i(SB,"listCacheSet");go.prototype.clear=wB;go.prototype.delete=_B;go.prototype.get=EB;go.prototype.has=AB;go.prototype.set=SB;function Su(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(Su,"MapCache");function xB(){this.__data__={hash:new rc,map:new(Rf||go),string:new rc}}i(xB,"mapCacheClear");function TB(e){return Up(this,e).delete(e)}i(TB,"mapCacheDelete");function CB(e){return Up(this,e).get(e)}i(CB,"mapCacheGet");function MB(e){return Up(this,e).has(e)}i(MB,"mapCacheHas");function IB(e,t){return Up(this,e).set(e,t),this}i(IB,"mapCacheSet");Su.prototype.clear=xB;Su.prototype.delete=TB;Su.prototype.get=CB;Su.prototype.has=MB;Su.prototype.set=IB;function xu(e){this.__data__=new go(e)}i(xu,"Stack");function kB(){this.__data__=new go}i(kB,"stackClear");function DB(e){return this.__data__.delete(e)}i(DB,"stackDelete");function RB(e){return this.__data__.get(e)}i(RB,"stackGet");function OB(e){return this.__data__.has(e)}i(OB,"stackHas");function NB(e,t){var r=this.__data__;if(r instanceof go){var n=r.__data__;if(!Rf||n.length<FP-1)return n.push([e,t]),this;r=this.__data__=new Su(n)}return r.set(e,t),this}i(NB,"stackSet");xu.prototype.clear=kB;xu.prototype.delete=DB;xu.prototype.get=RB;xu.prototype.has=OB;xu.prototype.set=NB;function PB(e,t){var r=Zv(e)||aL(e)?QP(e.length,String):[],n=r.length,a=!!n;for(var s in e)(t||Jo.call(e,s))&&!(a&&(s=="length"||tL(s,n)))&&r.push(s);return r}i(PB,"arrayLikeKeys");function P9(e,t,r){var n=e[t];(!(Jo.call(e,t)&&F9(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}i(P9,"assignValue");function Lp(e,t){for(var r=e.length;r--;)if(F9(e[r][0],t))return r;return-1}i(Lp,"assocIndexOf");function BB(e,t){return e&&B9(t,Yv(t),e)}i(BB,"baseAssign");function qv(e,t,r,n,a,s,c){var l;if(n&&(l=s?n(e,a,s,c):n(e)),l!==void 0)return l;if(!Fp(e))return e;var h=Zv(e);if(h){if(l=XB(e),!t)return JB(e,l)}else{var p=tc(e),g=p==Kv||p==g9;if(sL(e))return zB(e,t);if(p==Gv||p==Vv||g&&!s){if(O9(e))return s?e:{};if(l=QB(g?{}:e),!t)return ZB(e,BB(l,e))}else{if(!Tr[p])return s?e:{};l=eL(e,p,qv,t)}}c||(c=new xu);var v=c.get(e);if(v)return v;if(c.set(e,l),!h)var y=r?YB(e):Yv(e);return YP(y||e,function(_,x){y&&(x=_,_=e[x]),P9(l,x,qv(_,t,r,n,x,e,c))}),l}i(qv,"baseClone");function LB(e){return Fp(e)?aB(e):{}}i(LB,"baseCreate");function UB(e,t,r){var n=t(e);return Zv(e)?n:XP(n,r(e))}i(UB,"baseGetAllKeys");function FB(e){return Bp.call(e)}i(FB,"baseGetTag");function jB(e){if(!Fp(e)||nL(e))return!1;var t=$9(e)||O9(e)?nB:qP;return t.test(nc(e))}i(jB,"baseIsNative");function $B(e){if(!U9(e))return uB(e);var t=[];for(var r in Object(e))Jo.call(e,r)&&r!="constructor"&&t.push(r);return t}i($B,"baseKeys");function zB(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}i(zB,"cloneBuffer");function Jv(e){var t=new e.constructor(e.byteLength);return new c9(t).set(new c9(e)),t}i(Jv,"cloneArrayBuffer");function HB(e,t){var r=t?Jv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}i(HB,"cloneDataView");function qB(e,t,r){var n=t?r(n9(e),!0):n9(e);return R9(n,JP,new e.constructor)}i(qB,"cloneMap");function VB(e){var t=new e.constructor(e.source,HP.exec(e));return t.lastIndex=e.lastIndex,t}i(VB,"cloneRegExp");function KB(e,t,r){var n=t?r(i9(e),!0):i9(e);return R9(n,ZP,new e.constructor)}i(KB,"cloneSet");function GB(e){return f9?Object(f9.call(e)):{}}i(GB,"cloneSymbol");function WB(e,t){var r=t?Jv(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}i(WB,"cloneTypedArray");function JB(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}i(JB,"copyArray");function B9(e,t,r,n){r||(r={});for(var a=-1,s=t.length;++a<s;){var c=t[a],l=n?n(r[c],e[c],c,r,e):void 0;P9(r,c,l===void 0?e[c]:l)}return r}i(B9,"copyObject");function ZB(e,t){return B9(e,L9(e),t)}i(ZB,"copySymbols");function YB(e){return UB(e,Yv,L9)}i(YB,"getAllKeys");function Up(e,t){var r=e.__data__;return rL(t)?r[typeof t=="string"?"string":"hash"]:r.map}i(Up,"getMapData");function Tu(e,t){var r=eB(e,t);return jB(r)?r:void 0}i(Tu,"getNative");var L9=u9?Wv(u9,Object):lL,tc=FB;(jv&&tc(new jv(new ArrayBuffer(1)))!=Np||Rf&&tc(new Rf)!=Rp||$v&&tc($v.resolve())!=t9||zv&&tc(new zv)!=Op||Hv&&tc(new Hv)!=Fv)&&(tc=i(function(e){var t=Bp.call(e),r=t==Gv?e.constructor:void 0,n=r?nc(r):void 0;if(n)switch(n){case lB:return Np;case fB:return Rp;case dB:return t9;case hB:return Op;case pB:return Fv}return t},"getTag"));function XB(e){var t=e.length,r=e.constructor(t);return t&&typeof e[0]=="string"&&Jo.call(e,"index")&&(r.index=e.index,r.input=e.input),r}i(XB,"initCloneArray");function QB(e){return typeof e.constructor=="function"&&!U9(e)?LB(iB(e)):{}}i(QB,"initCloneObject");function eL(e,t,r,n){var a=e.constructor;switch(t){case _9:return Jv(e);case p9:case m9:return new a(+e);case Np:return HB(e,n);case E9:case A9:case S9:case x9:case T9:case C9:case M9:case I9:case k9:return WB(e,n);case Rp:return qB(e,n,r);case v9:case b9:return new a(e);case y9:return VB(e);case Op:return KB(e,n,r);case w9:return GB(e)}}i(eL,"initCloneByTag");function tL(e,t){return t=t??h9,!!t&&(typeof e=="number"||VP.test(e))&&e>-1&&e%1==0&&e<t}i(tL,"isIndex");function rL(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}i(rL,"isKeyable");function nL(e){return!!a9&&a9 in e}i(nL,"isMasked");function U9(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Pp;return e===r}i(U9,"isPrototype");function nc(e){if(e!=null){try{return N9.call(e)}catch{}try{return e+""}catch{}}return""}i(nc,"toSource");function iL(e){return qv(e,!0,!0)}i(iL,"cloneDeep");function F9(e,t){return e===t||e!==e&&t!==t}i(F9,"eq");function aL(e){return oL(e)&&Jo.call(e,"callee")&&(!oB.call(e,"callee")||Bp.call(e)==Vv)}i(aL,"isArguments");var Zv=Array.isArray;function j9(e){return e!=null&&cL(e.length)&&!$9(e)}i(j9,"isArrayLike");function oL(e){return uL(e)&&j9(e)}i(oL,"isArrayLikeObject");var sL=cB||fL;function $9(e){var t=Fp(e)?Bp.call(e):"";return t==Kv||t==g9}i($9,"isFunction");function cL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=h9}i(cL,"isLength");function Fp(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}i(Fp,"isObject");function uL(e){return!!e&&typeof e=="object"}i(uL,"isObjectLike");function Yv(e){return j9(e)?PB(e):$B(e)}i(Yv,"keys");function lL(){return[]}i(lL,"stubArray");function fL(){return!1}i(fL,"stubFalse");Au.exports=iL});var H9=Vn($p=>{"use strict";Object.defineProperty($p,"__esModule",{value:!0});$p.BrowserRandomSource=void 0;var z9=65536,jp=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+=z9)this._crypto.getRandomValues(r.subarray(n,n+Math.min(r.length-n,z9)));return r}};i(jp,"BrowserRandomSource");$p.BrowserRandomSource=jp});var ey=Vn(Qv=>{"use strict";Object.defineProperty(Qv,"__esModule",{value:!0});function dL(e){for(var t=0;t<e.length;t++)e[t]=0;return e}i(dL,"wipe");Qv.wipe=dL});var q9=Vn(()=>{});var V9=Vn(Hp=>{"use strict";Object.defineProperty(Hp,"__esModule",{value:!0});Hp.NodeRandomSource=void 0;var hL=ey(),zp=class{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof require<"u"){let t=q9();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 a=0;a<n.length;a++)n[a]=r[a];return(0,hL.wipe)(r),n}};i(zp,"NodeRandomSource");Hp.NodeRandomSource=zp});var K9=Vn(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.SystemRandomSource=void 0;var pL=H9(),mL=V9(),qp=class{constructor(){if(this.isAvailable=!1,this.name="",this._source=new pL.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new mL.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(qp,"SystemRandomSource");Vp.SystemRandomSource=qp});var G9=Vn(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});function gL(e,t){var r=e>>>16&65535,n=e&65535,a=t>>>16&65535,s=t&65535;return n*s+(r*s+n*a<<16>>>0)|0}i(gL,"imulShim");pi.mul=Math.imul||gL;function vL(e,t){return e+t|0}i(vL,"add");pi.add=vL;function yL(e,t){return e-t|0}i(yL,"sub");pi.sub=yL;function bL(e,t){return e<<t|e>>>32-t}i(bL,"rotl");pi.rotl=bL;function wL(e,t){return e<<32-t|e>>>t}i(wL,"rotr");pi.rotr=wL;function _L(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}i(_L,"isIntegerShim");pi.isInteger=Number.isInteger||_L;pi.MAX_SAFE_INTEGER=9007199254740991;pi.isSafeInteger=function(e){return pi.isInteger(e)&&e>=-pi.MAX_SAFE_INTEGER&&e<=pi.MAX_SAFE_INTEGER}});var Q9=Vn(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});var W9=G9();function EL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}i(EL,"readInt16BE");qt.readInt16BE=EL;function AL(e,t){return t===void 0&&(t=0),(e[t+0]<<8|e[t+1])>>>0}i(AL,"readUint16BE");qt.readUint16BE=AL;function SL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])<<16>>16}i(SL,"readInt16LE");qt.readInt16LE=SL;function xL(e,t){return t===void 0&&(t=0),(e[t+1]<<8|e[t])>>>0}i(xL,"readUint16LE");qt.readUint16LE=xL;function J9(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(J9,"writeUint16BE");qt.writeUint16BE=J9;qt.writeInt16BE=J9;function Z9(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(Z9,"writeUint16LE");qt.writeUint16LE=Z9;qt.writeInt16LE=Z9;function ty(e,t){return t===void 0&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}i(ty,"readInt32BE");qt.readInt32BE=ty;function ry(e,t){return t===void 0&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}i(ry,"readUint32BE");qt.readUint32BE=ry;function ny(e,t){return t===void 0&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}i(ny,"readInt32LE");qt.readInt32LE=ny;function iy(e,t){return t===void 0&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}i(iy,"readUint32LE");qt.readUint32LE=iy;function Kp(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(Kp,"writeUint32BE");qt.writeUint32BE=Kp;qt.writeInt32BE=Kp;function Gp(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(Gp,"writeUint32LE");qt.writeUint32LE=Gp;qt.writeInt32LE=Gp;function TL(e,t){t===void 0&&(t=0);var r=ty(e,t),n=ty(e,t+4);return r*4294967296+n-(n>>31)*4294967296}i(TL,"readInt64BE");qt.readInt64BE=TL;function CL(e,t){t===void 0&&(t=0);var r=ry(e,t),n=ry(e,t+4);return r*4294967296+n}i(CL,"readUint64BE");qt.readUint64BE=CL;function ML(e,t){t===void 0&&(t=0);var r=ny(e,t),n=ny(e,t+4);return n*4294967296+r-(r>>31)*4294967296}i(ML,"readInt64LE");qt.readInt64LE=ML;function IL(e,t){t===void 0&&(t=0);var r=iy(e,t),n=iy(e,t+4);return n*4294967296+r}i(IL,"readUint64LE");qt.readUint64LE=IL;function Y9(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Kp(e/4294967296>>>0,t,r),Kp(e>>>0,t,r+4),t}i(Y9,"writeUint64BE");qt.writeUint64BE=Y9;qt.writeInt64BE=Y9;function X9(e,t,r){return t===void 0&&(t=new Uint8Array(8)),r===void 0&&(r=0),Gp(e>>>0,t,r),Gp(e/4294967296>>>0,t,r+4),t}i(X9,"writeUint64LE");qt.writeUint64LE=X9;qt.writeInt64LE=X9;function kL(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,a=1,s=e/8+r-1;s>=r;s--)n+=t[s]*a,a*=256;return n}i(kL,"readUintBE");qt.readUintBE=kL;function DL(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,a=1,s=r;s<r+e/8;s++)n+=t[s]*a,a*=256;return n}i(DL,"readUintLE");qt.readUintLE=DL;function RL(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(!W9.isSafeInteger(t))throw new Error("writeUintBE value must be an integer");for(var a=1,s=e/8+n-1;s>=n;s--)r[s]=t/a&255,a*=256;return r}i(RL,"writeUintBE");qt.writeUintBE=RL;function OL(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(!W9.isSafeInteger(t))throw new Error("writeUintLE value must be an integer");for(var a=1,s=n;s<n+e/8;s++)r[s]=t/a&255,a*=256;return r}i(OL,"writeUintLE");qt.writeUintLE=OL;function NL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat32(t)}i(NL,"readFloat32BE");qt.readFloat32BE=NL;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");qt.readFloat32LE=PL;function BL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t)}i(BL,"readFloat64BE");qt.readFloat64BE=BL;function LL(e,t){t===void 0&&(t=0);var r=new DataView(e.buffer,e.byteOffset,e.byteLength);return r.getFloat64(t,!0)}i(LL,"readFloat64LE");qt.readFloat64LE=LL;function UL(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(UL,"writeFloat32BE");qt.writeFloat32BE=UL;function FL(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(FL,"writeFloat32LE");qt.writeFloat32LE=FL;function jL(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(jL,"writeFloat64BE");qt.writeFloat64BE=jL;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");qt.writeFloat64LE=$L});var n7=Vn(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.randomStringForEntropy=An.randomString=An.randomUint32=An.randomBytes=An.defaultRandomSource=void 0;var zL=K9(),HL=Q9(),e7=ey();An.defaultRandomSource=new zL.SystemRandomSource;function ay(e,t=An.defaultRandomSource){return t.randomBytes(e)}i(ay,"randomBytes");An.randomBytes=ay;function qL(e=An.defaultRandomSource){let t=ay(4,e),r=(0,HL.readUint32LE)(t);return(0,e7.wipe)(t),r}i(qL,"randomUint32");An.randomUint32=qL;var t7="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function r7(e,t=t7,r=An.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="",a=t.length,s=256-256%a;for(;e>0;){let c=ay(Math.ceil(e*256/s),r);for(let l=0;l<c.length&&e>0;l++){let h=c[l];h<s&&(n+=t.charAt(h%a),e--)}(0,e7.wipe)(c)}return n}i(r7,"randomString");An.randomString=r7;function VL(e,t=t7,r=An.defaultRandomSource){let n=Math.ceil(e/(Math.log(t.length)/Math.LN2));return r7(n,t,r)}i(VL,"randomStringForEntropy");An.randomStringForEntropy=VL});var x7=Vn((AZ,S7)=>{"use strict";var eU=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=iU(n),this._batchScheduleFn=aU(n),this._cacheKeyFn=oU(n),this._cacheMap=sU(n),this._batch=null,this.name=cU(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 a=rU(this),s=this._cacheMap,c;if(s){c=this._cacheKeyFn(n);var l=s.get(c);if(l){var h=a.cacheHits||(a.cacheHits=[]);return new Promise(function(g){h.push(function(){g(l)})})}}a.keys.push(n);var p=new Promise(function(g,v){a.callbacks.push({resolve:g,reject:v})});return s&&s.set(c,p),p},"load"),t.loadMany=i(function(n){if(!A7(n))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+n+"."));for(var a=[],s=0;s<n.length;s++)a.push(this.load(n[s]).catch(function(c){return c}));return Promise.all(a)},"loadMany"),t.clear=i(function(n){var a=this._cacheMap;if(a){var s=this._cacheKeyFn(n);a.delete(s)}return this},"clear"),t.clearAll=i(function(){var n=this._cacheMap;return n&&n.clear(),this},"clearAll"),t.prime=i(function(n,a){var s=this._cacheMap;if(s){var c=this._cacheKeyFn(n);if(s.get(c)===void 0){var l;a instanceof Error?(l=Promise.reject(a),l.catch(function(){})):l=Promise.resolve(a),s.set(c,l)}}return this},"prime"),e}(),tU=typeof process=="object"&&typeof process.nextTick=="function"?function(e){_y||(_y=Promise.resolve()),_y.then(function(){process.nextTick(e)})}:typeof setImmediate=="function"?function(e){setImmediate(e)}:function(e){setTimeout(e)},_y;function rU(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(){nU(e,r)}),r}i(rU,"getCurrentBatch");function nU(e,t){if(t.hasDispatched=!0,t.keys.length===0){Ay(t);return}var r;try{r=e._batchLoadFn(t.keys)}catch(n){return Ey(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 Ey(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(!A7(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
2
 
3
3
  Keys:
4
4
  `+String(t.keys))+(`
5
5
 
6
6
  Values:
7
- `+String(n)));Ay(t);for(var a=0;a<t.callbacks.length;a++){var s=n[a];s instanceof Error?t.callbacks[a].reject(s):t.callbacks[a].resolve(s)}}).catch(function(n){Ey(e,t,n)})}i(nU,"dispatchBatch");function Ey(e,t,r){Ay(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}i(Ey,"failedDispatch");function Ay(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}i(Ay,"resolveCacheHits");function iU(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(iU,"getValidMaxBatchSize");function aU(e){var t=e&&e.batchScheduleFn;if(t===void 0)return tU;if(typeof t!="function")throw new TypeError("batchScheduleFn must be a function: "+t);return t}i(aU,"getValidBatchScheduleFn");function oU(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(oU,"getValidCacheKeyFn");function sU(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"],a=n.filter(function(s){return r&&typeof r[s]!="function"});if(a.length!==0)throw new TypeError("Custom cacheMap missing methods: "+a.join(", "))}return r}i(sU,"getValidCacheMap");function cU(e){return e&&e.name?e.name:null}i(cU,"getValidName");function A7(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(A7,"isArrayLike");S7.exports=eU});var sK={};En(sK,{BackwardsCompatCredentialsListValidator:()=>V2,BackwardsCompatIDXCredentialValidator:()=>cD,CredentialsListValidator:()=>q2,default:()=>oK,getIDXPlugin:()=>i1});module.exports=sO(sK);var cO=l8,c8=128,uO=127,lO=~uO,fO=Math.pow(2,31);function l8(e,t,r){t=t||[],r=r||0;for(var n=r;e>=fO;)t[r++]=e&255|c8,e/=128;for(;e&lO;)t[r++]=e&255|c8,e>>>=7;return t[r]=e|0,l8.bytes=r-n+1,t}i(l8,"encode");var dO=Vg,hO=128,u8=127;function Vg(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw Vg.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&u8)<<a:(c&u8)*Math.pow(2,a),a+=7}while(c>=hO);return Vg.bytes=s-n,r}i(Vg,"read");var pO=Math.pow(2,7),mO=Math.pow(2,14),gO=Math.pow(2,21),vO=Math.pow(2,28),yO=Math.pow(2,35),bO=Math.pow(2,42),wO=Math.pow(2,49),_O=Math.pow(2,56),EO=Math.pow(2,63),AO=i(function(e){return e<pO?1:e<mO?2:e<gO?3:e<vO?4:e<yO?5:e<bO?6:e<wO?7:e<_O?8:e<EO?9:10},"length"),SO={encode:cO,decode:dO,encodingLength:AO},xO=SO,mf=xO;var gf=i((e,t=0)=>[mf.decode(e,t),mf.decode.bytes],"decode"),su=i((e,t,r=0)=>(mf.encode(e,t,r),t),"encodeTo"),cu=i(e=>mf.encodingLength(e),"encodingLength");var fK=new Uint8Array(0);var f8=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"),fo=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 d8=i(e=>new TextEncoder().encode(e),"fromString"),h8=i(e=>new TextDecoder().decode(e),"toString");var Vs=i((e,t)=>{let r=t.byteLength,n=cu(e),a=n+cu(r),s=new Uint8Array(a+r);return su(e,s,0),su(r,s,n),s.set(t,a),new qs(e,r,t,s)},"create"),Yh=i(e=>{let t=fo(e),[r,n]=gf(t),[a,s]=gf(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new qs(r,a,c,t)},"decode"),p8=i((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&f8(e.bytes,t.bytes),"equals"),qs=class{constructor(t,r,n,a){this.code=t,this.size=r,this.digest=n,this.bytes=a}};i(qs,"Digest");var Gg={};En(Gg,{base58btc:()=>Da,base58flickr:()=>DO});function TO(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 a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var O=0,D=0,P=0,J=x.length;P!==J&&x[P]===0;)P++,O++;for(var j=(J-P)*g+1>>>0,q=new Uint8Array(j);P!==J;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=h.repeat(O);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var O=0;if(x[O]!==" "){for(var D=0,P=0;x[O]===h;)D++,O++;for(var J=(x.length-O)*p+1>>>0,j=new Uint8Array(J);x[O];){var q=r[x.charCodeAt(O)];if(q===255)return;for(var Q=0,Y=J-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,O++}if(x[O]!==" "){for(var k=J-P;k!==J&&j[k]===0;)k++;for(var K=new Uint8Array(D+(J-k)),he=D;k!==J;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe");function _(x){var O=y(x);if(O)return O;throw new Error(`Non-${t} character`)}return i(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(TO,"base");var CO=TO,MO=CO,m8=MO;var Xh=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(Xh,"Encoder");var Qh=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 g8(this,t)}};i(Qh,"Decoder");var ep=class{constructor(t){this.decoders=t}or(t){return g8(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(ep,"ComposedDecoder");var g8=i((e,t)=>new ep({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),tp=class{constructor(t,r,n,a){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=a,this.encoder=new Xh(t,r,n),this.decoder=new Qh(t,r,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};i(tp,"Codec");var uu=i(({name:e,prefix:t,encode:r,decode:n})=>new tp(e,t,r,n),"from"),Ko=i(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=m8(r,t);return uu({prefix:e,name:t,encode:n,decode:s=>fo(a(s))})},"baseX"),IO=i((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,h=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|v,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"),kO=i((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),Br=i(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>uu({prefix:t,name:e,encode(a){return kO(a,n,r)},decode(a){return IO(a,n,r,e)}}),"rfc4648");var Da=Ko({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),DO=Ko({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wg={};En(Wg,{base32:()=>lu,base32hex:()=>PO,base32hexpad:()=>LO,base32hexpadupper:()=>UO,base32hexupper:()=>BO,base32pad:()=>OO,base32padupper:()=>NO,base32upper:()=>RO,base32z:()=>FO});var lu=Br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),RO=Br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),OO=Br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NO=Br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),PO=Br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),BO=Br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),LO=Br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),UO=Br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),FO=Br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ft=class{constructor(t,r,n,a){this.code=r,this.version=t,this.multihash=n,this.bytes=a,this.byteOffset=a.byteOffset,this.byteLength=a.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:np,byteLength:np,code:rp,version:rp,multihash:rp,bytes:rp,_baseCache:np,asCID:np})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:r}=this;if(t!==yf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==HO)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ft.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Vs(t,r);return Ft.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&&p8(this.multihash,t.multihash)}toString(t){let{bytes:r,version:n,_baseCache:a}=this;switch(n){case 0:return $O(r,a,t||Da.encoder);default:return zO(r,a,t||lu.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 VO(/^0\.0/,KO),!!(t&&(t[y8]||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 Ft)return t;if(t!=null&&t.asCID===t){let{version:r,code:n,multihash:a,bytes:s}=t;return new Ft(r,n,a,s||v8(r,n,a.bytes))}else if(t!=null&&t[y8]===!0){let{version:r,multihash:n,code:a}=t,s=Yh(n);return Ft.create(r,a,s)}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!==yf)throw new Error(`Version 0 CID must use dag-pb (code: ${yf}) block encoding`);return new Ft(t,r,n,n.bytes)}case 1:{let a=v8(t,r,n.bytes);return new Ft(t,r,n,a)}default:throw new Error("Invalid version")}}static createV0(t){return Ft.create(0,yf,t)}static createV1(t,r){return Ft.create(1,t,r)}static decode(t){let[r,n]=Ft.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Ft.inspectBytes(t),n=r.size-r.multihashSize,a=fo(t.subarray(n,n+r.multihashSize));if(a.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=a.subarray(r.multihashSize-r.digestSize),c=new qs(r.multihashCode,r.digestSize,s,a);return[r.version===0?Ft.createV0(c):Ft.createV1(r.codec,c),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=i(()=>{let[v,y]=gf(t.subarray(r));return r+=y,v},"next"),a=n(),s=yf;if(a===18?(a=0,r=0):a===1&&(s=n()),a!==0&&a!==1)throw new RangeError(`Invalid CID version ${a}`);let c=r,l=n(),h=n(),p=r+h,g=p-c;return{version:a,codec:s,multihashCode:l,digestSize:h,multihashSize:g,size:p}}static parse(t,r){let[n,a]=jO(t,r),s=Ft.decode(a);return s._baseCache.set(n,t),s}};i(Ft,"CID");var jO=i((e,t)=>{switch(e[0]){case"Q":{let r=t||Da;return[Da.prefix,r.decode(`${Da.prefix}${e}`)]}case Da.prefix:{let r=t||Da;return[Da.prefix,r.decode(e)]}case lu.prefix:{let r=t||lu;return[lu.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"),$O=i((e,t,r)=>{let{prefix:n}=r;if(n!==Da.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),zO=i((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),yf=112,HO=18,v8=i((e,t,r)=>{let n=cu(e),a=n+cu(t),s=new Uint8Array(a+r.byteLength);return su(e,s,0),su(t,s,n),s.set(r,a),s},"encodeCID"),y8=Symbol.for("@ipld/js-cid/CID"),rp={writable:!1,configurable:!1,enumerable:!0},np={writable:!1,enumerable:!1,configurable:!1},qO="0.0.0-dev",VO=i((e,t)=>{if(e.test(qO))console.warn(t);else throw new Error(t)},"deprecate"),KO=`CID.isCID(v) is deprecated and will be removed in the next major release.
7
+ `+String(n)));Ay(t);for(var a=0;a<t.callbacks.length;a++){var s=n[a];s instanceof Error?t.callbacks[a].reject(s):t.callbacks[a].resolve(s)}}).catch(function(n){Ey(e,t,n)})}i(nU,"dispatchBatch");function Ey(e,t,r){Ay(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}i(Ey,"failedDispatch");function Ay(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}i(Ay,"resolveCacheHits");function iU(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(iU,"getValidMaxBatchSize");function aU(e){var t=e&&e.batchScheduleFn;if(t===void 0)return tU;if(typeof t!="function")throw new TypeError("batchScheduleFn must be a function: "+t);return t}i(aU,"getValidBatchScheduleFn");function oU(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(oU,"getValidCacheKeyFn");function sU(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"],a=n.filter(function(s){return r&&typeof r[s]!="function"});if(a.length!==0)throw new TypeError("Custom cacheMap missing methods: "+a.join(", "))}return r}i(sU,"getValidCacheMap");function cU(e){return e&&e.name?e.name:null}i(cU,"getValidName");function A7(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(A7,"isArrayLike");S7.exports=eU});var sK={};En(sK,{BackwardsCompatCredentialsListValidator:()=>V2,BackwardsCompatIDXCredentialValidator:()=>cD,CredentialsListValidator:()=>q2,default:()=>oK,getIDXPlugin:()=>i1});module.exports=sO(sK);var cO=l8,c8=128,uO=127,lO=~uO,fO=Math.pow(2,31);function l8(e,t,r){t=t||[],r=r||0;for(var n=r;e>=fO;)t[r++]=e&255|c8,e/=128;for(;e&lO;)t[r++]=e&255|c8,e>>>=7;return t[r]=e|0,l8.bytes=r-n+1,t}i(l8,"encode");var dO=Vg,hO=128,u8=127;function Vg(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw Vg.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&u8)<<a:(c&u8)*Math.pow(2,a),a+=7}while(c>=hO);return Vg.bytes=s-n,r}i(Vg,"read");var pO=Math.pow(2,7),mO=Math.pow(2,14),gO=Math.pow(2,21),vO=Math.pow(2,28),yO=Math.pow(2,35),bO=Math.pow(2,42),wO=Math.pow(2,49),_O=Math.pow(2,56),EO=Math.pow(2,63),AO=i(function(e){return e<pO?1:e<mO?2:e<gO?3:e<vO?4:e<yO?5:e<bO?6:e<wO?7:e<_O?8:e<EO?9:10},"length"),SO={encode:cO,decode:dO,encodingLength:AO},xO=SO,mf=xO;var gf=i((e,t=0)=>[mf.decode(e,t),mf.decode.bytes],"decode"),su=i((e,t,r=0)=>(mf.encode(e,t,r),t),"encodeTo"),cu=i(e=>mf.encodingLength(e),"encodingLength");var fK=new Uint8Array(0);var f8=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"),fo=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 d8=i(e=>new TextEncoder().encode(e),"fromString"),h8=i(e=>new TextDecoder().decode(e),"toString");var Gs=i((e,t)=>{let r=t.byteLength,n=cu(e),a=n+cu(r),s=new Uint8Array(a+r);return su(e,s,0),su(r,s,n),s.set(t,a),new Ks(e,r,t,s)},"create"),Yh=i(e=>{let t=fo(e),[r,n]=gf(t),[a,s]=gf(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new Ks(r,a,c,t)},"decode"),p8=i((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&f8(e.bytes,t.bytes),"equals"),Ks=class{constructor(t,r,n,a){this.code=t,this.size=r,this.digest=n,this.bytes=a}};i(Ks,"Digest");var Gg={};En(Gg,{base58btc:()=>Da,base58flickr:()=>DO});function TO(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 a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var O=0,D=0,P=0,J=x.length;P!==J&&x[P]===0;)P++,O++;for(var j=(J-P)*g+1>>>0,q=new Uint8Array(j);P!==J;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=h.repeat(O);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var O=0;if(x[O]!==" "){for(var D=0,P=0;x[O]===h;)D++,O++;for(var J=(x.length-O)*p+1>>>0,j=new Uint8Array(J);x[O];){var q=r[x.charCodeAt(O)];if(q===255)return;for(var Q=0,Y=J-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,O++}if(x[O]!==" "){for(var k=J-P;k!==J&&j[k]===0;)k++;for(var K=new Uint8Array(D+(J-k)),he=D;k!==J;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe");function _(x){var O=y(x);if(O)return O;throw new Error(`Non-${t} character`)}return i(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(TO,"base");var CO=TO,MO=CO,m8=MO;var Xh=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(Xh,"Encoder");var Qh=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 g8(this,t)}};i(Qh,"Decoder");var ep=class{constructor(t){this.decoders=t}or(t){return g8(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(ep,"ComposedDecoder");var g8=i((e,t)=>new ep({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),tp=class{constructor(t,r,n,a){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=a,this.encoder=new Xh(t,r,n),this.decoder=new Qh(t,r,a)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}};i(tp,"Codec");var uu=i(({name:e,prefix:t,encode:r,decode:n})=>new tp(e,t,r,n),"from"),Ko=i(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=m8(r,t);return uu({prefix:e,name:t,encode:n,decode:s=>fo(a(s))})},"baseX"),IO=i((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,h=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|v,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"),kO=i((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),Br=i(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>uu({prefix:t,name:e,encode(a){return kO(a,n,r)},decode(a){return IO(a,n,r,e)}}),"rfc4648");var Da=Ko({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),DO=Ko({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var Wg={};En(Wg,{base32:()=>lu,base32hex:()=>PO,base32hexpad:()=>LO,base32hexpadupper:()=>UO,base32hexupper:()=>BO,base32pad:()=>OO,base32padupper:()=>NO,base32upper:()=>RO,base32z:()=>FO});var lu=Br({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),RO=Br({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),OO=Br({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),NO=Br({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),PO=Br({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),BO=Br({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),LO=Br({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),UO=Br({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),FO=Br({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var Ft=class{constructor(t,r,n,a){this.code=r,this.version=t,this.multihash=n,this.bytes=a,this.byteOffset=a.byteOffset,this.byteLength=a.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:np,byteLength:np,code:rp,version:rp,multihash:rp,bytes:rp,_baseCache:np,asCID:np})}toV0(){switch(this.version){case 0:return this;default:{let{code:t,multihash:r}=this;if(t!==yf)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==HO)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Ft.createV0(r)}}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=Gs(t,r);return Ft.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&&p8(this.multihash,t.multihash)}toString(t){let{bytes:r,version:n,_baseCache:a}=this;switch(n){case 0:return $O(r,a,t||Da.encoder);default:return zO(r,a,t||lu.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 VO(/^0\.0/,KO),!!(t&&(t[y8]||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 Ft)return t;if(t!=null&&t.asCID===t){let{version:r,code:n,multihash:a,bytes:s}=t;return new Ft(r,n,a,s||v8(r,n,a.bytes))}else if(t!=null&&t[y8]===!0){let{version:r,multihash:n,code:a}=t,s=Yh(n);return Ft.create(r,a,s)}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!==yf)throw new Error(`Version 0 CID must use dag-pb (code: ${yf}) block encoding`);return new Ft(t,r,n,n.bytes)}case 1:{let a=v8(t,r,n.bytes);return new Ft(t,r,n,a)}default:throw new Error("Invalid version")}}static createV0(t){return Ft.create(0,yf,t)}static createV1(t,r){return Ft.create(1,t,r)}static decode(t){let[r,n]=Ft.decodeFirst(t);if(n.length)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Ft.inspectBytes(t),n=r.size-r.multihashSize,a=fo(t.subarray(n,n+r.multihashSize));if(a.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=a.subarray(r.multihashSize-r.digestSize),c=new Ks(r.multihashCode,r.digestSize,s,a);return[r.version===0?Ft.createV0(c):Ft.createV1(r.codec,c),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=i(()=>{let[v,y]=gf(t.subarray(r));return r+=y,v},"next"),a=n(),s=yf;if(a===18?(a=0,r=0):a===1&&(s=n()),a!==0&&a!==1)throw new RangeError(`Invalid CID version ${a}`);let c=r,l=n(),h=n(),p=r+h,g=p-c;return{version:a,codec:s,multihashCode:l,digestSize:h,multihashSize:g,size:p}}static parse(t,r){let[n,a]=jO(t,r),s=Ft.decode(a);return s._baseCache.set(n,t),s}};i(Ft,"CID");var jO=i((e,t)=>{switch(e[0]){case"Q":{let r=t||Da;return[Da.prefix,r.decode(`${Da.prefix}${e}`)]}case Da.prefix:{let r=t||Da;return[Da.prefix,r.decode(e)]}case lu.prefix:{let r=t||lu;return[lu.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"),$O=i((e,t,r)=>{let{prefix:n}=r;if(n!==Da.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),zO=i((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),yf=112,HO=18,v8=i((e,t,r)=>{let n=cu(e),a=n+cu(t),s=new Uint8Array(a+r.byteLength);return su(e,s,0),su(t,s,n),s.set(r,a),s},"encodeCID"),y8=Symbol.for("@ipld/js-cid/CID"),rp={writable:!1,configurable:!1,enumerable:!0},np={writable:!1,enumerable:!1,configurable:!1},qO="0.0.0-dev",VO=i((e,t)=>{if(e.test(qO))console.warn(t);else throw new Error(t)},"deprecate"),KO=`CID.isCID(v) is deprecated and will be removed in the next major release.
8
8
  Following code pattern:
9
9
 
10
10
  if (CID.isCID(value)) {
@@ -18,12 +18,12 @@ if (cid) {
18
18
  // Make sure to use cid instead of value
19
19
  doSomethingWithCID(cid)
20
20
  }
21
- `;var Jg={};En(Jg,{base36:()=>ta,base36upper:()=>GO});var ta=Ko({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GO=Ko({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var b8={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function WO(e){let t=b8[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(WO,"codeByName");function JO(e){let t=Object.entries(b8).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(JO,"nameByCode");var ra=class{};i(ra,"StreamType");ra.nameByCode=JO;ra.codeByName=WO;var Rv=Hs(ip(),1);function fu(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(fu,"asUint8Array");function bf(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?fu(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(bf,"allocUnsafe");function wf(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=bf(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return fu(r)}i(wf,"concat");var Xg={};En(Xg,{identity:()=>uN});var uN=uu({prefix:"\0",name:"identity",encode:e=>h8(e),decode:e=>d8(e)});var Qg={};En(Qg,{base2:()=>lN});var lN=Br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ev={};En(ev,{base8:()=>fN});var fN=Br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var tv={};En(tv,{base10:()=>dN});var dN=Ko({prefix:"9",name:"base10",alphabet:"0123456789"});var rv={};En(rv,{base16:()=>hN,base16upper:()=>pN});var hN=Br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),pN=Br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var nv={};En(nv,{base64:()=>mN,base64pad:()=>gN,base64url:()=>vN,base64urlpad:()=>yN});var mN=Br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),gN=Br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vN=Br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),yN=Br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iv={};En(iv,{base256emoji:()=>AN});var I8=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}"),bN=I8.reduce((e,t,r)=>(e[r]=t,e),[]),wN=I8.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function _N(e){return e.reduce((t,r)=>(t+=bN[r],t),"")}i(_N,"encode");function EN(e){let t=[];for(let r of e){let n=wN[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(EN,"decode");var AN=uu({prefix:"\u{1F680}",name:"base256emoji",encode:_N,decode:EN});var sv={};En(sv,{sha256:()=>ov,sha512:()=>SN});var av=i(({name:e,code:t,encode:r})=>new ap(e,t,r),"from"),ap=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?Vs(this.code,r):r.then(n=>Vs(this.code,n))}else throw Error("Unknown type, must be binary type")}};i(ap,"Hasher");var D8=i(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),ov=av({name:"sha2-256",code:18,encode:D8("SHA-256")}),SN=av({name:"sha2-512",code:19,encode:D8("SHA-512")});var cv={};En(cv,{identity:()=>CN});var R8=0,xN="identity",O8=fo,TN=i(e=>Vs(R8,O8(e)),"digest"),CN={code:R8,name:xN,encode:O8,digest:TN};var WK=new TextEncoder,JK=new TextDecoder;var uv={...Xg,...Qg,...ev,...tv,...rv,...Wg,...Jg,...Gg,...nv,...iv},QK={...sv,...cv};function P8(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}i(P8,"createCodec");var N8=P8("utf8","u",e=>{let t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>new TextEncoder().encode(e.substring(1))),lv=P8("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=bf(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),kN={utf8:N8,"utf-8":N8,hex:uv.base16,latin1:lv,ascii:lv,binary:lv,...uv},fv=kN;function dv(e,t="utf8"){let r=fv[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(dv,"toString");function ui(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=B8(c.value,t,r,n);else if(c.get!=null)c.get=B8(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(ui,"Memoize");var hv=new Map;function B8(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let h of n)hv.has(h)?hv.get(h).push(l):hv.set(h,[l]);if(t||s.length>0||r>0){let h;t===!0?h=s.map(v=>v.toString()).join("!"):t?h=t.apply(this,s):h=s[0];let p=`${h}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(h)&&!g?c=l.get(h):(c=e.apply(this,s),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,s),l.set(h,c))}return c}}i(B8,"getNewFunction");var op=i(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),pv=i(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let a=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s],h=Ft.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*pv(c,l))}else{let s=Ft.asCID(n);s?yield[a.join("/"),s]:yield*pv(n,a)}}},"links"),mv=i(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let a=[...t,r];if(yield a.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Ft.asCID(n))if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s];yield l.join("/"),typeof c=="object"&&!Ft.asCID(c)&&(yield*mv(c,l))}else yield*mv(n,a)}},"tree"),RN=i((e,t)=>{let r=e;for(let[n,a]of t.entries()){if(r=r[a],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let s=Ft.asCID(r);if(s)return{value:s,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),sp=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:op(),bytes:op(),value:op(),asBlock:op()})}links(){return pv(this.value,[])}tree(){return mv(this.value,[])}get(t="/"){return RN(this.value,t.split("/").filter(Boolean))}};i(sp,"Block");var L8=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),a=await r.digest(n),s=Ft.create(1,t.code,a);return new sp({value:e,bytes:n,cid:s})},"encode");var kv=Hs(ip(),1);var bp={};En(bp,{code:()=>gP,decode:()=>vP,encode:()=>xv,name:()=>mP});var NN=["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 U8(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(NN.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(BN(e))return"Buffer";let r=LN(e);return r||"Object"}i(U8,"is");function BN(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(BN,"isBuffer");function LN(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(PN.includes(t))return t}i(LN,"getObjectType");var Ne=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(Ne,"Type");Ne.uint=new Ne(0,"uint",!0);Ne.negint=new Ne(1,"negint",!0);Ne.bytes=new Ne(2,"bytes",!0);Ne.string=new Ne(3,"string",!0);Ne.array=new Ne(4,"array",!1);Ne.map=new Ne(5,"map",!1);Ne.tag=new Ne(6,"tag",!1);Ne.float=new Ne(7,"float",!0);Ne.false=new Ne(7,"false",!0);Ne.true=new Ne(7,"true",!0);Ne.null=new Ne(7,"null",!0);Ne.undefined=new Ne(7,"undefined",!0);Ne.break=new Ne(7,"break",!0);var Qe=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(Qe,"Token");var du=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",UN=new TextDecoder,FN=new TextEncoder;function cp(e){return du&&globalThis.Buffer.isBuffer(e)}i(cp,"isBuffer");function gv(e){return e instanceof Uint8Array?cp(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(gv,"asU8A");var z8=du?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):j8(e,t,r):(e,t,r)=>r-t>64?UN.decode(e.subarray(t,r)):j8(e,t,r),H8=du?e=>e.length>64?globalThis.Buffer.from(e):F8(e):e=>e.length>64?FN.encode(e):F8(e),Ra=i(e=>Uint8Array.from(e),"fromArray"),hu=du?(e,t,r)=>cp(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),q8=du?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),gv(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let a of e)n+a.length>r.length&&(a=a.subarray(0,r.length-n)),r.set(a,n),n+=a.length;return r},V8=du?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function K8(e,t){if(cp(e)&&cp(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(K8,"compare");function F8(e,t=1/0){let r,n=e.length,a=null,s=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}i(F8,"utf8ToBytes");function j8(e,t,r){let n=[];for(;t<r;){let a=e[t],s=null,c=a>239?4:a>223?3:a>191?2:1;if(t+c<=r){let l,h,p,g;switch(c){case 1:a<128&&(s=a);break;case 2:l=e[t+1],(l&192)===128&&(g=(a&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(g=(a&15)<<12|(l&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(g=(a&15)<<18|(l&63)<<12|(h&63)<<6|p&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=c}return jN(n)}i(j8,"utf8Slice");var $8=4096;function jN(e){let t=e.length;if(t<=$8)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$8));return r}i(jN,"decodeCodePointsArray");var $N=256,pu=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 a=r.length-(this.maxCursor-this.cursor)-1;r.set(t,a)}else{if(r){let a=r.length-(this.maxCursor-this.cursor)-1;a<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,a),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=V8(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=hu(n,0,this.cursor)}else r=q8(this.chunks,this.cursor);return t&&this.reset(),r}};i(pu,"Bl");var It="CBOR decode error:",vv="CBOR encode error:",_f=[];_f[23]=1;_f[24]=2;_f[25]=3;_f[26]=5;_f[27]=9;function ho(e,t,r){if(e.length-t<r)throw new Error(`${It} not enough data for type`)}i(ho,"assertEnoughData");var Qr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function li(e,t,r){ho(e,t,1);let n=e[t];if(r.strict===!0&&n<Qr[0])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(li,"readUint8");function fi(e,t,r){ho(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Qr[1])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(fi,"readUint16");function di(e,t,r){ho(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Qr[2])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(di,"readUint32");function hi(e,t,r){ho(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],a=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(a);if(r.strict===!0&&s<Qr[3])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${It} integers outside of the safe integer range are not supported`)}i(hi,"readUint64");function G8(e,t,r,n){return new Qe(Ne.uint,li(e,t+1,n),2)}i(G8,"decodeUint8");function W8(e,t,r,n){return new Qe(Ne.uint,fi(e,t+1,n),3)}i(W8,"decodeUint16");function J8(e,t,r,n){return new Qe(Ne.uint,di(e,t+1,n),5)}i(J8,"decodeUint32");function Z8(e,t,r,n){return new Qe(Ne.uint,hi(e,t+1,n),9)}i(Z8,"decodeUint64");function Li(e,t){return cn(e,0,t.value)}i(Li,"encodeUint");function cn(e,t,r){if(r<Qr[0]){let n=Number(r);e.push([t|n])}else if(r<Qr[1]){let n=Number(r);e.push([t|24,n])}else if(r<Qr[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Qr[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<Qr[4]){let a=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));a[8]=s&255,s=s>>8,a[7]=s&255,s=s>>8,a[6]=s&255,s=s>>8,a[5]=s&255,a[4]=c&255,c=c>>8,a[3]=c&255,c=c>>8,a[2]=c&255,c=c>>8,a[1]=c&255,e.push(a)}else throw new Error(`${It} encountered BigInt larger than allowable range`)}}i(cn,"encodeUintValue");Li.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");cn.encodedSize=i(function(t){return t<Qr[0]?1:t<Qr[1]?2:t<Qr[2]?3:t<Qr[3]?5:9},"encodedSize");Li.compareTokens=i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens");function Y8(e,t,r,n){return new Qe(Ne.negint,-1-li(e,t+1,n),2)}i(Y8,"decodeNegint8");function X8(e,t,r,n){return new Qe(Ne.negint,-1-fi(e,t+1,n),3)}i(X8,"decodeNegint16");function Q8(e,t,r,n){return new Qe(Ne.negint,-1-di(e,t+1,n),5)}i(Q8,"decodeNegint32");var yv=BigInt(-1),eE=BigInt(1);function tE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a!="bigint"){let s=-1-a;if(s>=Number.MIN_SAFE_INTEGER)return new Qe(Ne.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${It} integers outside of the safe integer range are not supported`);return new Qe(Ne.negint,yv-BigInt(a),9)}i(tE,"decodeNegint64");function up(e,t){let r=t.value,n=typeof r=="bigint"?r*yv-eE:r*-1-1;cn(e,t.type.majorEncoded,n)}i(up,"encodeNegint");up.encodedSize=i(function(t){let r=t.value,n=typeof r=="bigint"?r*yv-eE:r*-1-1;return n<Qr[0]?1:n<Qr[1]?2:n<Qr[2]?3:n<Qr[3]?5:9},"encodedSize");up.compareTokens=i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens");function Ef(e,t,r,n){ho(e,t,r+n);let a=hu(e,t+r,t+r+n);return new Qe(Ne.bytes,a,r+n)}i(Ef,"toToken");function rE(e,t,r,n){return Ef(e,t,1,r)}i(rE,"decodeBytesCompact");function nE(e,t,r,n){return Ef(e,t,2,li(e,t+1,n))}i(nE,"decodeBytes8");function iE(e,t,r,n){return Ef(e,t,3,fi(e,t+1,n))}i(iE,"decodeBytes16");function aE(e,t,r,n){return Ef(e,t,5,di(e,t+1,n))}i(aE,"decodeBytes32");function oE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer bytes lengths not supported`);return Ef(e,t,9,a)}i(oE,"decodeBytes64");function lp(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===Ne.string?H8(e.value):e.value),e.encodedBytes}i(lp,"tokenBytes");function mu(e,t){let r=lp(t);cn(e,t.type.majorEncoded,r.length),e.push(r)}i(mu,"encodeBytes");mu.encodedSize=i(function(t){let r=lp(t);return cn.encodedSize(r.length)+r.length},"encodedSize");mu.compareTokens=i(function(t,r){return HN(lp(t),lp(r))},"compareTokens");function HN(e,t){return e.length<t.length?-1:e.length>t.length?1:K8(e,t)}i(HN,"compareBytes");function Af(e,t,r,n,a){let s=r+n;ho(e,t,s);let c=new Qe(Ne.string,z8(e,t+r,t+s),s);return a.retainStringBytes===!0&&(c.byteValue=hu(e,t+r,t+s)),c}i(Af,"toToken");function sE(e,t,r,n){return Af(e,t,1,r,n)}i(sE,"decodeStringCompact");function cE(e,t,r,n){return Af(e,t,2,li(e,t+1,n),n)}i(cE,"decodeString8");function uE(e,t,r,n){return Af(e,t,3,fi(e,t+1,n),n)}i(uE,"decodeString16");function lE(e,t,r,n){return Af(e,t,5,di(e,t+1,n),n)}i(lE,"decodeString32");function fE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer string lengths not supported`);return Af(e,t,9,a,n)}i(fE,"decodeString64");var dE=mu;function gu(e,t,r,n){return new Qe(Ne.array,n,r)}i(gu,"toToken");function hE(e,t,r,n){return gu(e,t,1,r)}i(hE,"decodeArrayCompact");function pE(e,t,r,n){return gu(e,t,2,li(e,t+1,n))}i(pE,"decodeArray8");function mE(e,t,r,n){return gu(e,t,3,fi(e,t+1,n))}i(mE,"decodeArray16");function gE(e,t,r,n){return gu(e,t,5,di(e,t+1,n))}i(gE,"decodeArray32");function vE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer array lengths not supported`);return gu(e,t,9,a)}i(vE,"decodeArray64");function yE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return gu(e,t,1,1/0)}i(yE,"decodeArrayIndefinite");function fp(e,t){cn(e,Ne.array.majorEncoded,t.value)}i(fp,"encodeArray");fp.compareTokens=Li.compareTokens;fp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function vu(e,t,r,n){return new Qe(Ne.map,n,r)}i(vu,"toToken");function bE(e,t,r,n){return vu(e,t,1,r)}i(bE,"decodeMapCompact");function wE(e,t,r,n){return vu(e,t,2,li(e,t+1,n))}i(wE,"decodeMap8");function _E(e,t,r,n){return vu(e,t,3,fi(e,t+1,n))}i(_E,"decodeMap16");function EE(e,t,r,n){return vu(e,t,5,di(e,t+1,n))}i(EE,"decodeMap32");function AE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer map lengths not supported`);return vu(e,t,9,a)}i(AE,"decodeMap64");function SE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return vu(e,t,1,1/0)}i(SE,"decodeMapIndefinite");function dp(e,t){cn(e,Ne.map.majorEncoded,t.value)}i(dp,"encodeMap");dp.compareTokens=Li.compareTokens;dp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function xE(e,t,r,n){return new Qe(Ne.tag,r,1)}i(xE,"decodeTagCompact");function TE(e,t,r,n){return new Qe(Ne.tag,li(e,t+1,n),2)}i(TE,"decodeTag8");function CE(e,t,r,n){return new Qe(Ne.tag,fi(e,t+1,n),3)}i(CE,"decodeTag16");function ME(e,t,r,n){return new Qe(Ne.tag,di(e,t+1,n),5)}i(ME,"decodeTag32");function IE(e,t,r,n){return new Qe(Ne.tag,hi(e,t+1,n),9)}i(IE,"decodeTag64");function hp(e,t){cn(e,Ne.tag.majorEncoded,t.value)}i(hp,"encodeTag");hp.compareTokens=Li.compareTokens;hp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");var JN=20,ZN=21,YN=22,XN=23;function kE(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${It} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Qe(Ne.null,null,1):new Qe(Ne.undefined,void 0,1)}i(kE,"decodeUndefined");function DE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return new Qe(Ne.break,void 0,1)}i(DE,"decodeBreak");function bv(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${It} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${It} Infinity values are not supported`)}return new Qe(Ne.float,e,t)}i(bv,"createToken");function RE(e,t,r,n){return bv(wv(e,t+1),3,n)}i(RE,"decodeFloat16");function OE(e,t,r,n){return bv(_v(e,t+1),5,n)}i(OE,"decodeFloat32");function NE(e,t,r,n){return bv(UE(e,t+1),9,n)}i(NE,"decodeFloat64");function pp(e,t,r){let n=t.value;if(n===!1)e.push([Ne.float.majorEncoded|JN]);else if(n===!0)e.push([Ne.float.majorEncoded|ZN]);else if(n===null)e.push([Ne.float.majorEncoded|YN]);else if(n===void 0)e.push([Ne.float.majorEncoded|XN]);else{let a,s=!1;(!r||r.float64!==!0)&&(BE(n),a=wv(na,1),n===a||Number.isNaN(n)?(na[0]=249,e.push(na.slice(0,3)),s=!0):(LE(n),a=_v(na,1),n===a&&(na[0]=250,e.push(na.slice(0,5)),s=!0))),s||(QN(n),a=UE(na,1),na[0]=251,e.push(na.slice(0,9)))}}i(pp,"encodeFloat");pp.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){BE(n);let a=wv(na,1);if(n===a||Number.isNaN(n))return 3;if(LE(n),a=_v(na,1),n===a)return 5}return 9},"encodedSize");var PE=new ArrayBuffer(9),Ui=new DataView(PE,1),na=new Uint8Array(PE,0);function BE(e){if(e===1/0)Ui.setUint16(0,31744,!1);else if(e===-1/0)Ui.setUint16(0,64512,!1);else if(Number.isNaN(e))Ui.setUint16(0,32256,!1);else{Ui.setFloat32(0,e);let t=Ui.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Ui.setUint16(0,31744,!1);else if(r===0)Ui.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let a=r-127;a<-24?Ui.setUint16(0,0):a<-14?Ui.setUint16(0,(t&2147483648)>>16|1<<24+a,!1):Ui.setUint16(0,(t&2147483648)>>16|a+15<<10|n>>13,!1)}}}i(BE,"encodeFloat16");function wv(e,t){if(e.length-t<2)throw new Error(`${It} 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,a=r&1023,s;return n===0?s=a*2**-24:n!==31?s=(a+1024)*2**(n-25):s=a===0?1/0:NaN,r&32768?-s:s}i(wv,"readFloat16");function LE(e){Ui.setFloat32(0,e,!1)}i(LE,"encodeFloat32");function _v(e,t){if(e.length-t<4)throw new Error(`${It} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(_v,"readFloat32");function QN(e){Ui.setFloat64(0,e,!1)}i(QN,"encodeFloat64");function UE(e,t){if(e.length-t<8)throw new Error(`${It} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i(UE,"readFloat64");pp.compareTokens=Li.compareTokens;function ur(e,t,r){throw new Error(`${It} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(ur,"invalidMinor");function mp(e){return()=>{throw new Error(`${It} ${e}`)}}i(mp,"errorer");var We=[];for(let e=0;e<=23;e++)We[e]=ur;We[24]=G8;We[25]=W8;We[26]=J8;We[27]=Z8;We[28]=ur;We[29]=ur;We[30]=ur;We[31]=ur;for(let e=32;e<=55;e++)We[e]=ur;We[56]=Y8;We[57]=X8;We[58]=Q8;We[59]=tE;We[60]=ur;We[61]=ur;We[62]=ur;We[63]=ur;for(let e=64;e<=87;e++)We[e]=rE;We[88]=nE;We[89]=iE;We[90]=aE;We[91]=oE;We[92]=ur;We[93]=ur;We[94]=ur;We[95]=mp("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)We[e]=sE;We[120]=cE;We[121]=uE;We[122]=lE;We[123]=fE;We[124]=ur;We[125]=ur;We[126]=ur;We[127]=mp("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)We[e]=hE;We[152]=pE;We[153]=mE;We[154]=gE;We[155]=vE;We[156]=ur;We[157]=ur;We[158]=ur;We[159]=yE;for(let e=160;e<=183;e++)We[e]=bE;We[184]=wE;We[185]=_E;We[186]=EE;We[187]=AE;We[188]=ur;We[189]=ur;We[190]=ur;We[191]=SE;for(let e=192;e<=215;e++)We[e]=xE;We[216]=TE;We[217]=CE;We[218]=ME;We[219]=IE;We[220]=ur;We[221]=ur;We[222]=ur;We[223]=ur;for(let e=224;e<=243;e++)We[e]=mp("simple values are not supported");We[244]=ur;We[245]=ur;We[246]=ur;We[247]=kE;We[248]=mp("simple values are not supported");We[249]=RE;We[250]=OE;We[251]=NE;We[252]=ur;We[253]=ur;We[254]=ur;We[255]=DE;var ia=[];for(let e=0;e<24;e++)ia[e]=new Qe(Ne.uint,e,1);for(let e=-1;e>=-24;e--)ia[31-e]=new Qe(Ne.negint,e,1);ia[64]=new Qe(Ne.bytes,new Uint8Array(0),1);ia[96]=new Qe(Ne.string,"",1);ia[128]=new Qe(Ne.array,0,1);ia[160]=new Qe(Ne.map,0,1);ia[244]=new Qe(Ne.false,!1,1);ia[245]=new Qe(Ne.true,!0,1);ia[246]=new Qe(Ne.null,null,1);function FE(e){switch(e.type){case Ne.false:return Ra([244]);case Ne.true:return Ra([245]);case Ne.null:return Ra([246]);case Ne.bytes:return e.value.length?void 0:Ra([64]);case Ne.string:return e.value===""?Ra([96]):void 0;case Ne.array:return e.value===0?Ra([128]):void 0;case Ne.map:return e.value===0?Ra([160]):void 0;case Ne.uint:return e.value<24?Ra([Number(e.value)]):void 0;case Ne.negint:if(e.value>=-24)return Ra([31-Number(e.value)])}}i(FE,"quickEncodeToken");var tP={float64:!1,mapSorter:iP,quickEncodeToken:FE};function rP(){let e=[];return e[Ne.uint.major]=Li,e[Ne.negint.major]=up,e[Ne.bytes.major]=mu,e[Ne.string.major]=dE,e[Ne.array.major]=fp,e[Ne.map.major]=dp,e[Ne.tag.major]=hp,e[Ne.float.major]=pp,e}i(rP,"makeCborEncoders");var jE=rP(),Ev=new pu,Gs=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(`${vv} object contains circular references`);return new Gs(r,t)}};i(Gs,"Ref");var Go={null:new Qe(Ne.null,null),undefined:new Qe(Ne.undefined,void 0),true:new Qe(Ne.true,!0),false:new Qe(Ne.false,!1),emptyArray:new Qe(Ne.array,0),emptyMap:new Qe(Ne.map,0)},Wo={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Qe(Ne.float,e):e>=0?new Qe(Ne.uint,e):new Qe(Ne.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Qe(Ne.uint,e):new Qe(Ne.negint,e)},Uint8Array(e,t,r,n){return new Qe(Ne.bytes,e)},string(e,t,r,n){return new Qe(Ne.string,e)},boolean(e,t,r,n){return e?Go.true:Go.false},null(e,t,r,n){return Go.null},undefined(e,t,r,n){return Go.undefined},ArrayBuffer(e,t,r,n){return new Qe(Ne.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Qe(Ne.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[Go.emptyArray,new Qe(Ne.break)]:Go.emptyArray;n=Gs.createCheck(n,e);let a=[],s=0;for(let c of e)a[s++]=gp(c,r,n);return r.addBreakTokens?[new Qe(Ne.array,e.length),a,new Qe(Ne.break)]:[new Qe(Ne.array,e.length),a]},Object(e,t,r,n){let a=t!=="Object",s=a?e.keys():Object.keys(e),c=a?e.size:s.length;if(!c)return r.addBreakTokens===!0?[Go.emptyMap,new Qe(Ne.break)]:Go.emptyMap;n=Gs.createCheck(n,e);let l=[],h=0;for(let p of s)l[h++]=[gp(p,r,n),gp(a?e.get(p):e[p],r,n)];return nP(l,r),r.addBreakTokens?[new Qe(Ne.map,c),l,new Qe(Ne.break)]:[new Qe(Ne.map,c),l]}};Wo.Map=Wo.Object;Wo.Buffer=Wo.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Wo[`${e}Array`]=Wo.DataView;function gp(e,t={},r){let n=U8(e),a=t&&t.typeEncoders&&t.typeEncoders[n]||Wo[n];if(typeof a=="function"){let c=a(e,n,t,r);if(c!=null)return c}let s=Wo[n];if(!s)throw new Error(`${vv} unsupported type: ${n}`);return s(e,n,t,r)}i(gp,"objectToTokens");function nP(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(nP,"sortMapEntries");function iP(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 a=r.type.major,s=jE[a].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}i(iP,"mapSorter");function $E(e,t,r,n){if(Array.isArray(t))for(let a of t)$E(e,a,r,n);else r[t.type.major](e,t,n)}i($E,"tokensToEncoded");function aP(e,t,r){let n=gp(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let a=r.quickEncodeToken(n);if(a)return a;let s=t[n.type.major];if(s.encodedSize){let c=s.encodedSize(n,r),l=new pu(c);if(s(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return gv(l.chunks[0])}}return Ev.reset(),$E(Ev,n,t,r),Ev.toBytes(!0)}i(aP,"encodeCustom");function Av(e,t){return t=Object.assign({},tP,t),aP(e,jE,t)}i(Av,"encode");var oP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},vp=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=ia[t];if(r===void 0){let n=We[t];if(!n)throw new Error(`${It} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let a=t&31;r=n(this.data,this.pos,a,this.options)}return this.pos+=r.encodedLength,r}};i(vp,"Tokeniser");var Sf=Symbol.for("DONE"),yp=Symbol.for("BREAK");function sP(e,t,r){let n=[];for(let a=0;a<e.value;a++){let s=xf(t,r);if(s===yp){if(e.value===1/0)break;throw new Error(`${It} got unexpected break to lengthed array`)}if(s===Sf)throw new Error(`${It} found array but not enough entries (got ${a}, expected ${e.value})`);n[a]=s}return n}i(sP,"tokenToArray");function cP(e,t,r){let n=r.useMaps===!0,a=n?void 0:{},s=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=xf(t,r);if(l===yp){if(e.value===1/0)break;throw new Error(`${It} got unexpected break to lengthed map`)}if(l===Sf)throw new Error(`${It} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${It} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(l)||!n&&l in a))throw new Error(`${It} found repeat map key "${l}"`);let h=xf(t,r);if(h===Sf)throw new Error(`${It} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?s.set(l,h):a[l]=h}return n?s:a}i(cP,"tokenToMap");function xf(e,t){if(e.done())return Sf;let r=e.next();if(r.type===Ne.break)return yp;if(r.type.terminal)return r.value;if(r.type===Ne.array)return sP(r,e,t);if(r.type===Ne.map)return cP(r,e,t);if(r.type===Ne.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=xf(e,t);return t.tags[r.value](n)}throw new Error(`${It} tag not supported (${r.value})`)}throw new Error("unsupported")}i(xf,"tokensToObject");function Sv(e,t){if(!(e instanceof Uint8Array))throw new Error(`${It} data to decode must be a Uint8Array`);t=Object.assign({},oP,t);let r=t.tokenizer||new vp(e,t),n=xf(r,t);if(n===Sf)throw new Error(`${It} did not find any content to decode`);if(n===yp)throw new Error(`${It} got unexpected break`);if(!r.done())throw new Error(`${It} too many terminals, data makes no sense`);return n}i(Sv,"decode");var zE=42;function lP(e){if(e.asCID!==e)return null;let t=Ft.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Qe(Ne.tag,zE),new Qe(Ne.bytes,r)]}i(lP,"cidEncoder");function fP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(fP,"undefinedEncoder");function dP(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(dP,"numberEncoder");var hP={float64:!0,typeEncoders:{Object:lP,undefined:fP,number:dP}};function pP(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ft.decode(e.subarray(1))}i(pP,"cidDecoder");var HE={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};HE.tags[zE]=pP;var mP="dag-cbor",gP=113,xv=i(e=>Av(e,hP),"encode"),vP=i(e=>Sv(e,HE),"decode");function yu(e){try{return e()}catch(t){return t}}i(yu,"tryCatch");var Tv=Hs(ip(),1);function Ws(e){let t=Tv.default.decode(e),r=Tv.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(Ws,"readVarint");function yP(e){return e===0||e===1}i(yP,"isCidVersion");function Cv(e){let[t,r]=Ws(e);if(!yP(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=Ws(r),[,s,c]=Ws(a),[l,,h]=Ws(s),p=a.subarray(0,c+h+l),g=a.subarray(c+h+l);return[Ft.create(t,n,Yh(p)),g]}i(Cv,"readCid");function Js(e,t="StreamRef"){let[r,n]=Ws(e);if(r!==206)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=Ws(n),c=Cv(s),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:a,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=Cv(h);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(Js,"fromBytes");var bP=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function bu(e,t="StreamRef"){let r=bP.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=ta.decode(n),s=Js(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Mv(s.genesis,c)}:s}i(bu,"fromString");function wP(e){try{return typeof e=="string"?Ft.parse(e):Ft.asCID(e)}catch{return null}}i(wP,"parseCID");function Mv(e,t=null){if(!t||t==="0")return null;let r=wP(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(Mv,"parseCommit");var Tf=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},Fi=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},wp=class extends Error{constructor(t){super(`Invalid StreamID bytes ${ta.encode(t)}: contains commit`)}};i(wp,"InvalidStreamIDBytesError");var _p=class extends Error{constructor(t){super(`Invalid StreamID string ${t}: contains commit`)}};i(_p,"InvalidStreamIDStringError");function KE(e){let t=Js(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new wp(e)}i(KE,"fromBytes");function _P(e){return yu(()=>KE(e))}i(_P,"fromBytesNoThrow");function GE(e){let t=bu(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new _p(e)}i(GE,"fromString");function EP(e){return yu(()=>GE(e))}i(EP,"fromStringNoThrow");var VE=Symbol.for("@ceramicnetwork/streamid/StreamID"),Yt=class{constructor(t,r){if(this._tag=VE,!(t||t===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof t=="string"?ra.codeByName(t):t,this._cid=typeof r=="string"?Ft.parse(r):r}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===VE}static async fromGenesis(t,r){let n=await L8({value:r,codec:bp,hasher:ov});return new Yt(t,n.cid)}get type(){return this._type}get typeName(){return ra.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let t=kv.default.encode(206),r=kv.default.encode(this.type);return wf([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 ta.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=KE;Yt.fromBytesNoThrow=_P;Yt.fromString=GE;Yt.fromStringNoThrow=EP;Tf([ui(),Fi("design:type",String),Fi("design:paramtypes",[])],Yt.prototype,"typeName",null);Tf([ui(),Fi("design:type",Uint8Array),Fi("design:paramtypes",[])],Yt.prototype,"bytes",null);Tf([ui(),Fi("design:type",Yt),Fi("design:paramtypes",[])],Yt.prototype,"baseID",null);Tf([ui(),Fi("design:type",Function),Fi("design:paramtypes",[]),Fi("design:returntype",String)],Yt.prototype,"toString",null);Tf([ui(),Fi("design:type",Function),Fi("design:paramtypes",[]),Fi("design:returntype",String)],Yt.prototype,"toUrl",null);var _u=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},Kn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Dv=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},po=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)},wu,Zs,Cf,Ep=class extends Error{constructor(t){super(`Error while parsing CommitID from bytes ${ta.encode(t)}: no commit information provided`)}};i(Ep,"InvalidCommitIDBytesError");var Ap=class extends Error{constructor(t){super(`Error while parsing CommitID from string ${t}: no commit information provided`)}};i(Ap,"InvalidCommitIDStringError");function JE(e){let t=Js(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new Ep(e)}i(JE,"fromBytes");function AP(e){return yu(()=>JE(e))}i(AP,"fromBytesNoThrow");function ZE(e){let t=bu(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new Ap(e)}i(ZE,"fromString");function SP(e){return yu(()=>ZE(e))}i(SP,"fromStringNoThrow");var WE=Symbol.for("@ceramicnetwork/streamid/CommitID");function xP(e,t){return new hr(e.type,e.cid,t)}i(xP,"make");var hr=class{constructor(t,r,n=null){if(this._tag=WE,wu.set(this,void 0),Zs.set(this,void 0),Cf.set(this,void 0),!t&&t!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");Dv(this,wu,typeof t=="string"?ra.codeByName(t):t,"f"),Dv(this,Zs,typeof r=="string"?Ft.parse(r):r,"f"),Dv(this,Cf,Mv(po(this,Zs,"f"),n),"f")}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===WE}get baseID(){return new Yt(po(this,wu,"f"),po(this,Zs,"f"))}get type(){return po(this,wu,"f")}get typeName(){return ra.nameByCode(po(this,wu,"f"))}get cid(){return po(this,Zs,"f")}get commit(){return po(this,Cf,"f")||po(this,Zs,"f")}get bytes(){let t=Rv.default.encode(206),r=Rv.default.encode(this.type),n=po(this,Cf,"f")?.bytes||new Uint8Array([0]);return wf([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 ta.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(wu=new WeakMap,Zs=new WeakMap,Cf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(hr,"CommitID");hr.fromBytes=JE;hr.fromBytesNoThrow=AP;hr.fromString=ZE;hr.fromStringNoThrow=SP;hr.make=xP;_u([ui(),Kn("design:type",Yt),Kn("design:paramtypes",[])],hr.prototype,"baseID",null);_u([ui(),Kn("design:type",String),Kn("design:paramtypes",[])],hr.prototype,"typeName",null);_u([ui(),Kn("design:type",Ft),Kn("design:paramtypes",[])],hr.prototype,"commit",null);_u([ui(),Kn("design:type",Uint8Array),Kn("design:paramtypes",[])],hr.prototype,"bytes",null);_u([ui(),Kn("design:type",Function),Kn("design:paramtypes",[]),Kn("design:returntype",String)],hr.prototype,"toString",null);_u([ui(),Kn("design:type",Function),Kn("design:paramtypes",[]),Kn("design:returntype",String)],hr.prototype,"toUrl",null);var Ys;(function(e){function t(a){let s=Js(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${ta.encode(a)}`)}}i(t,"fromBytes"),e.fromBytes=t;function r(a){let s=bu(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString"),e.fromString=r;function n(a){if(Yt.isInstance(a)||hr.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from"),e.from=n})(Ys||(Ys={}));var YE="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",Sp="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var Ov={};En(Ov,{JsonPatchError:()=>Lr,_areEquals:()=>kf,applyOperation:()=>Xs,applyPatch:()=>Dp,applyReducer:()=>kP,deepClone:()=>MP,getValueByPointer:()=>Ip,validate:()=>QE,validator:()=>kp});var TP=function(){var e=i(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},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)}}(),CP=Object.prototype.hasOwnProperty;function Tp(e,t){return CP.call(e,t)}i(Tp,"hasOwnProperty");function Cp(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 a in e)Tp(e,a)&&n.push(a);return n}i(Cp,"_objectKeys");function un(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(un,"_deepClone");function Mp(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(Mp,"isInteger");function Oa(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(Oa,"escapePathComponent");function Mf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(Mf,"unescapePathComponent");function xp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(xp(e[t]))return!0}else if(typeof e=="object"){for(var n=Cp(e),a=n.length,s=0;s<a;s++)if(xp(e[n[s]]))return!0}}return!1}i(xp,"hasUndefined");function XE(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
22
- `)}i(XE,"patchErrorMessageFormatter");var If=function(e){TP(t,e);function t(r,n,a,s,c){var l=this.constructor,h=e.call(this,XE(r,{name:n,index:a,operation:s,tree:c}))||this;return h.name=n,h.index=a,h.operation=s,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=XE(r,{name:n,index:a,operation:s,tree:c}),h}return i(t,"PatchError"),t}(Error);var Lr=If,MP=un,Eu={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=Ip(r,this.path);n&&(n=un(n));var a=Xs(r,{op:"remove",path:this.from}).removed;return Xs(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Ip(r,this.from);return Xs(r,{op:"add",path:this.path,value:un(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:kf(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},IP={add:function(e,t,r){return Mp(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:Eu.move,copy:Eu.copy,test:Eu.test,_get:Eu._get};function Ip(e,t){if(t=="")return e;var r={op:"_get",path:t};return Xs(e,r),r.value}i(Ip,"getValueByPointer");function Xs(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):kp(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=Ip(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=kf(e,t.value),c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,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 Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=un(e));var l=t.path||"",h=l.split("/"),p=e,g=1,v=h.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=kp;;){if(_=h[g],_&&_.indexOf("~")!=-1&&(_=Mf(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&h[g-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[_]===void 0?y=h.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!Mp(_))throw new Lr("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",s,t,e);Mp(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Lr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=IP[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Eu[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Lr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(Xs,"applyOperation");function Dp(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=un(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=Xs(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(Dp,"applyPatch");function kP(e,t,r){var n=Xs(e,t);if(n.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(kP,"applyReducer");function kp(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Lr("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Eu[e.op]){if(typeof e.path!="string")throw new Lr("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Lr('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 Lr("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 Lr("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")&&xp(e.value))throw new Lr("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 a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Lr("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 Lr("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=QE([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Lr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(kp,"validator");function QE(e,t,r){try{if(!Array.isArray(e))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Dp(un(t),un(e),r||!0);else{r=r||kp;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Lr)return a;throw a}}i(QE,"validate");function kf(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),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!kf(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!kf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(kf,"_areEquals");var Lv={};En(Lv,{compare:()=>UP,generate:()=>Nv,observe:()=>LP,unobserve:()=>BP});var Pv=new WeakMap,DP=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror"),e}(),RP=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo"),e}();function OP(e){return Pv.get(e)}i(OP,"getMirror");function NP(e,t){return e.observers.get(t)}i(NP,"getObserverFromMirror");function PP(e,t){e.observers.delete(t.callback)}i(PP,"removeObserverFromMirror");function BP(e,t){t.unobserve()}i(BP,"unobserve");function LP(e,t){var r=[],n,a=OP(e);if(!a)a=new DP(e),Pv.set(e,a);else{var s=NP(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=un(e),t){n.callback=t,n.next=null;var c=i(function(){Nv(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(){Nv(n),clearTimeout(n.next),PP(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new RP(t,n)),n}i(LP,"observe");function Nv(e,t){t===void 0&&(t=!1);var r=Pv.get(e.object);Bv(r.value,e.object,e.patches,"",t),e.patches.length&&Dp(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(Nv,"generate");function Bv(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Cp(t),c=Cp(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(Tp(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?Bv(v,y,r,n+"/"+Oa(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+Oa(g),value:un(v)}),r.push({op:"replace",path:n+"/"+Oa(g),value:un(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+Oa(g),value:un(v)}),r.push({op:"remove",path:n+"/"+Oa(g)}),h=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!Tp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+Oa(g),value:un(t[g])})}}}i(Bv,"_generate");function UP(e,t,r){r===void 0&&(r=!1);var n=[];return Bv(e,t,n,"",r),n}i(UP,"compare");var e9=Object.assign({},Ov,Lv,{JsonPatchError:If,deepClone:un,escapePathComponent:Oa,unescapePathComponent:Mf});var _7=Hs(Xv(),1);var E7=Hs(n7(),1);var rc;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(rc||(rc={}));var gy=Hs(Xv(),1);var oy=i(function(e,t){return oy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},oy(e,t)},"extendStatics");function sy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");oy(e,t);function r(){this.constructor=e}i(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(sy,"__extends");function cy(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(cy,"__values");function Cu(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(Cu,"__read");function Mu(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(Mu,"__spreadArray");function ji(e){return typeof e=="function"}i(ji,"isFunction");function i7(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(i7,"createErrorClass");var Wp=i7(function(e){return i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
21
+ `;var Jg={};En(Jg,{base36:()=>ta,base36upper:()=>GO});var ta=Ko({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),GO=Ko({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var b8={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function WO(e){let t=b8[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(WO,"codeByName");function JO(e){let t=Object.entries(b8).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(JO,"nameByCode");var ra=class{};i(ra,"StreamType");ra.nameByCode=JO;ra.codeByName=WO;var Rv=Vs(ip(),1);function fu(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(fu,"asUint8Array");function bf(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?fu(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(bf,"allocUnsafe");function wf(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=bf(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return fu(r)}i(wf,"concat");var Xg={};En(Xg,{identity:()=>uN});var uN=uu({prefix:"\0",name:"identity",encode:e=>h8(e),decode:e=>d8(e)});var Qg={};En(Qg,{base2:()=>lN});var lN=Br({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ev={};En(ev,{base8:()=>fN});var fN=Br({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var tv={};En(tv,{base10:()=>dN});var dN=Ko({prefix:"9",name:"base10",alphabet:"0123456789"});var rv={};En(rv,{base16:()=>hN,base16upper:()=>pN});var hN=Br({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),pN=Br({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var nv={};En(nv,{base64:()=>mN,base64pad:()=>gN,base64url:()=>vN,base64urlpad:()=>yN});var mN=Br({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),gN=Br({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),vN=Br({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),yN=Br({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var iv={};En(iv,{base256emoji:()=>AN});var I8=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}"),bN=I8.reduce((e,t,r)=>(e[r]=t,e),[]),wN=I8.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function _N(e){return e.reduce((t,r)=>(t+=bN[r],t),"")}i(_N,"encode");function EN(e){let t=[];for(let r of e){let n=wN[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(EN,"decode");var AN=uu({prefix:"\u{1F680}",name:"base256emoji",encode:_N,decode:EN});var sv={};En(sv,{sha256:()=>ov,sha512:()=>SN});var av=i(({name:e,code:t,encode:r})=>new ap(e,t,r),"from"),ap=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?Gs(this.code,r):r.then(n=>Gs(this.code,n))}else throw Error("Unknown type, must be binary type")}};i(ap,"Hasher");var D8=i(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),ov=av({name:"sha2-256",code:18,encode:D8("SHA-256")}),SN=av({name:"sha2-512",code:19,encode:D8("SHA-512")});var cv={};En(cv,{identity:()=>CN});var R8=0,xN="identity",O8=fo,TN=i(e=>Gs(R8,O8(e)),"digest"),CN={code:R8,name:xN,encode:O8,digest:TN};var WK=new TextEncoder,JK=new TextDecoder;var uv={...Xg,...Qg,...ev,...tv,...rv,...Wg,...Jg,...Gg,...nv,...iv},QK={...sv,...cv};function P8(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}i(P8,"createCodec");var N8=P8("utf8","u",e=>{let t=new TextDecoder("utf8");return"u"+t.decode(e)},e=>new TextEncoder().encode(e.substring(1))),lv=P8("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=bf(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),kN={utf8:N8,"utf-8":N8,hex:uv.base16,latin1:lv,ascii:lv,binary:lv,...uv},fv=kN;function dv(e,t="utf8"){let r=fv[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(dv,"toString");function ui(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=B8(c.value,t,r,n);else if(c.get!=null)c.get=B8(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(ui,"Memoize");var hv=new Map;function B8(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let h of n)hv.has(h)?hv.get(h).push(l):hv.set(h,[l]);if(t||s.length>0||r>0){let h;t===!0?h=s.map(v=>v.toString()).join("!"):t?h=t.apply(this,s):h=s[0];let p=`${h}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(h)&&!g?c=l.get(h):(c=e.apply(this,s),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,s),l.set(h,c))}return c}}i(B8,"getNewFunction");var op=i(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),pv=i(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let a=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s],h=Ft.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*pv(c,l))}else{let s=Ft.asCID(n);s?yield[a.join("/"),s]:yield*pv(n,a)}}},"links"),mv=i(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let a=[...t,r];if(yield a.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!Ft.asCID(n))if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s];yield l.join("/"),typeof c=="object"&&!Ft.asCID(c)&&(yield*mv(c,l))}else yield*mv(n,a)}},"tree"),RN=i((e,t)=>{let r=e;for(let[n,a]of t.entries()){if(r=r[a],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let s=Ft.asCID(r);if(s)return{value:s,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),sp=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:op(),bytes:op(),value:op(),asBlock:op()})}links(){return pv(this.value,[])}tree(){return mv(this.value,[])}get(t="/"){return RN(this.value,t.split("/").filter(Boolean))}};i(sp,"Block");var L8=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),a=await r.digest(n),s=Ft.create(1,t.code,a);return new sp({value:e,bytes:n,cid:s})},"encode");var kv=Vs(ip(),1);var bp={};En(bp,{code:()=>gP,decode:()=>vP,encode:()=>xv,name:()=>mP});var NN=["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 U8(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(NN.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(BN(e))return"Buffer";let r=LN(e);return r||"Object"}i(U8,"is");function BN(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(BN,"isBuffer");function LN(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(PN.includes(t))return t}i(LN,"getObjectType");var Ne=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(Ne,"Type");Ne.uint=new Ne(0,"uint",!0);Ne.negint=new Ne(1,"negint",!0);Ne.bytes=new Ne(2,"bytes",!0);Ne.string=new Ne(3,"string",!0);Ne.array=new Ne(4,"array",!1);Ne.map=new Ne(5,"map",!1);Ne.tag=new Ne(6,"tag",!1);Ne.float=new Ne(7,"float",!0);Ne.false=new Ne(7,"false",!0);Ne.true=new Ne(7,"true",!0);Ne.null=new Ne(7,"null",!0);Ne.undefined=new Ne(7,"undefined",!0);Ne.break=new Ne(7,"break",!0);var Qe=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(Qe,"Token");var du=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",UN=new TextDecoder,FN=new TextEncoder;function cp(e){return du&&globalThis.Buffer.isBuffer(e)}i(cp,"isBuffer");function gv(e){return e instanceof Uint8Array?cp(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(gv,"asU8A");var z8=du?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):j8(e,t,r):(e,t,r)=>r-t>64?UN.decode(e.subarray(t,r)):j8(e,t,r),H8=du?e=>e.length>64?globalThis.Buffer.from(e):F8(e):e=>e.length>64?FN.encode(e):F8(e),Ra=i(e=>Uint8Array.from(e),"fromArray"),hu=du?(e,t,r)=>cp(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),q8=du?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),gv(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let a of e)n+a.length>r.length&&(a=a.subarray(0,r.length-n)),r.set(a,n),n+=a.length;return r},V8=du?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function K8(e,t){if(cp(e)&&cp(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(K8,"compare");function F8(e,t=1/0){let r,n=e.length,a=null,s=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}i(F8,"utf8ToBytes");function j8(e,t,r){let n=[];for(;t<r;){let a=e[t],s=null,c=a>239?4:a>223?3:a>191?2:1;if(t+c<=r){let l,h,p,g;switch(c){case 1:a<128&&(s=a);break;case 2:l=e[t+1],(l&192)===128&&(g=(a&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(g=(a&15)<<12|(l&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(g=(a&15)<<18|(l&63)<<12|(h&63)<<6|p&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=c}return jN(n)}i(j8,"utf8Slice");var $8=4096;function jN(e){let t=e.length;if(t<=$8)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$8));return r}i(jN,"decodeCodePointsArray");var $N=256,pu=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 a=r.length-(this.maxCursor-this.cursor)-1;r.set(t,a)}else{if(r){let a=r.length-(this.maxCursor-this.cursor)-1;a<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,a),this.maxCursor=this.cursor-1)}t.length<64&&t.length<this.chunkSize?(r=V8(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=hu(n,0,this.cursor)}else r=q8(this.chunks,this.cursor);return t&&this.reset(),r}};i(pu,"Bl");var It="CBOR decode error:",vv="CBOR encode error:",_f=[];_f[23]=1;_f[24]=2;_f[25]=3;_f[26]=5;_f[27]=9;function ho(e,t,r){if(e.length-t<r)throw new Error(`${It} not enough data for type`)}i(ho,"assertEnoughData");var Qr=[24,256,65536,4294967296,BigInt("18446744073709551616")];function li(e,t,r){ho(e,t,1);let n=e[t];if(r.strict===!0&&n<Qr[0])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(li,"readUint8");function fi(e,t,r){ho(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Qr[1])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(fi,"readUint16");function di(e,t,r){ho(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Qr[2])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);return n}i(di,"readUint32");function hi(e,t,r){ho(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],a=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(a);if(r.strict===!0&&s<Qr[3])throw new Error(`${It} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${It} integers outside of the safe integer range are not supported`)}i(hi,"readUint64");function G8(e,t,r,n){return new Qe(Ne.uint,li(e,t+1,n),2)}i(G8,"decodeUint8");function W8(e,t,r,n){return new Qe(Ne.uint,fi(e,t+1,n),3)}i(W8,"decodeUint16");function J8(e,t,r,n){return new Qe(Ne.uint,di(e,t+1,n),5)}i(J8,"decodeUint32");function Z8(e,t,r,n){return new Qe(Ne.uint,hi(e,t+1,n),9)}i(Z8,"decodeUint64");function Li(e,t){return cn(e,0,t.value)}i(Li,"encodeUint");function cn(e,t,r){if(r<Qr[0]){let n=Number(r);e.push([t|n])}else if(r<Qr[1]){let n=Number(r);e.push([t|24,n])}else if(r<Qr[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Qr[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<Qr[4]){let a=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));a[8]=s&255,s=s>>8,a[7]=s&255,s=s>>8,a[6]=s&255,s=s>>8,a[5]=s&255,a[4]=c&255,c=c>>8,a[3]=c&255,c=c>>8,a[2]=c&255,c=c>>8,a[1]=c&255,e.push(a)}else throw new Error(`${It} encountered BigInt larger than allowable range`)}}i(cn,"encodeUintValue");Li.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");cn.encodedSize=i(function(t){return t<Qr[0]?1:t<Qr[1]?2:t<Qr[2]?3:t<Qr[3]?5:9},"encodedSize");Li.compareTokens=i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens");function Y8(e,t,r,n){return new Qe(Ne.negint,-1-li(e,t+1,n),2)}i(Y8,"decodeNegint8");function X8(e,t,r,n){return new Qe(Ne.negint,-1-fi(e,t+1,n),3)}i(X8,"decodeNegint16");function Q8(e,t,r,n){return new Qe(Ne.negint,-1-di(e,t+1,n),5)}i(Q8,"decodeNegint32");var yv=BigInt(-1),eE=BigInt(1);function tE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a!="bigint"){let s=-1-a;if(s>=Number.MIN_SAFE_INTEGER)return new Qe(Ne.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${It} integers outside of the safe integer range are not supported`);return new Qe(Ne.negint,yv-BigInt(a),9)}i(tE,"decodeNegint64");function up(e,t){let r=t.value,n=typeof r=="bigint"?r*yv-eE:r*-1-1;cn(e,t.type.majorEncoded,n)}i(up,"encodeNegint");up.encodedSize=i(function(t){let r=t.value,n=typeof r=="bigint"?r*yv-eE:r*-1-1;return n<Qr[0]?1:n<Qr[1]?2:n<Qr[2]?3:n<Qr[3]?5:9},"encodedSize");up.compareTokens=i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens");function Ef(e,t,r,n){ho(e,t,r+n);let a=hu(e,t+r,t+r+n);return new Qe(Ne.bytes,a,r+n)}i(Ef,"toToken");function rE(e,t,r,n){return Ef(e,t,1,r)}i(rE,"decodeBytesCompact");function nE(e,t,r,n){return Ef(e,t,2,li(e,t+1,n))}i(nE,"decodeBytes8");function iE(e,t,r,n){return Ef(e,t,3,fi(e,t+1,n))}i(iE,"decodeBytes16");function aE(e,t,r,n){return Ef(e,t,5,di(e,t+1,n))}i(aE,"decodeBytes32");function oE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer bytes lengths not supported`);return Ef(e,t,9,a)}i(oE,"decodeBytes64");function lp(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===Ne.string?H8(e.value):e.value),e.encodedBytes}i(lp,"tokenBytes");function mu(e,t){let r=lp(t);cn(e,t.type.majorEncoded,r.length),e.push(r)}i(mu,"encodeBytes");mu.encodedSize=i(function(t){let r=lp(t);return cn.encodedSize(r.length)+r.length},"encodedSize");mu.compareTokens=i(function(t,r){return HN(lp(t),lp(r))},"compareTokens");function HN(e,t){return e.length<t.length?-1:e.length>t.length?1:K8(e,t)}i(HN,"compareBytes");function Af(e,t,r,n,a){let s=r+n;ho(e,t,s);let c=new Qe(Ne.string,z8(e,t+r,t+s),s);return a.retainStringBytes===!0&&(c.byteValue=hu(e,t+r,t+s)),c}i(Af,"toToken");function sE(e,t,r,n){return Af(e,t,1,r,n)}i(sE,"decodeStringCompact");function cE(e,t,r,n){return Af(e,t,2,li(e,t+1,n),n)}i(cE,"decodeString8");function uE(e,t,r,n){return Af(e,t,3,fi(e,t+1,n),n)}i(uE,"decodeString16");function lE(e,t,r,n){return Af(e,t,5,di(e,t+1,n),n)}i(lE,"decodeString32");function fE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer string lengths not supported`);return Af(e,t,9,a,n)}i(fE,"decodeString64");var dE=mu;function gu(e,t,r,n){return new Qe(Ne.array,n,r)}i(gu,"toToken");function hE(e,t,r,n){return gu(e,t,1,r)}i(hE,"decodeArrayCompact");function pE(e,t,r,n){return gu(e,t,2,li(e,t+1,n))}i(pE,"decodeArray8");function mE(e,t,r,n){return gu(e,t,3,fi(e,t+1,n))}i(mE,"decodeArray16");function gE(e,t,r,n){return gu(e,t,5,di(e,t+1,n))}i(gE,"decodeArray32");function vE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer array lengths not supported`);return gu(e,t,9,a)}i(vE,"decodeArray64");function yE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return gu(e,t,1,1/0)}i(yE,"decodeArrayIndefinite");function fp(e,t){cn(e,Ne.array.majorEncoded,t.value)}i(fp,"encodeArray");fp.compareTokens=Li.compareTokens;fp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function vu(e,t,r,n){return new Qe(Ne.map,n,r)}i(vu,"toToken");function bE(e,t,r,n){return vu(e,t,1,r)}i(bE,"decodeMapCompact");function wE(e,t,r,n){return vu(e,t,2,li(e,t+1,n))}i(wE,"decodeMap8");function _E(e,t,r,n){return vu(e,t,3,fi(e,t+1,n))}i(_E,"decodeMap16");function EE(e,t,r,n){return vu(e,t,5,di(e,t+1,n))}i(EE,"decodeMap32");function AE(e,t,r,n){let a=hi(e,t+1,n);if(typeof a=="bigint")throw new Error(`${It} 64-bit integer map lengths not supported`);return vu(e,t,9,a)}i(AE,"decodeMap64");function SE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return vu(e,t,1,1/0)}i(SE,"decodeMapIndefinite");function dp(e,t){cn(e,Ne.map.majorEncoded,t.value)}i(dp,"encodeMap");dp.compareTokens=Li.compareTokens;dp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");function xE(e,t,r,n){return new Qe(Ne.tag,r,1)}i(xE,"decodeTagCompact");function TE(e,t,r,n){return new Qe(Ne.tag,li(e,t+1,n),2)}i(TE,"decodeTag8");function CE(e,t,r,n){return new Qe(Ne.tag,fi(e,t+1,n),3)}i(CE,"decodeTag16");function ME(e,t,r,n){return new Qe(Ne.tag,di(e,t+1,n),5)}i(ME,"decodeTag32");function IE(e,t,r,n){return new Qe(Ne.tag,hi(e,t+1,n),9)}i(IE,"decodeTag64");function hp(e,t){cn(e,Ne.tag.majorEncoded,t.value)}i(hp,"encodeTag");hp.compareTokens=Li.compareTokens;hp.encodedSize=i(function(t){return cn.encodedSize(t.value)},"encodedSize");var JN=20,ZN=21,YN=22,XN=23;function kE(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${It} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Qe(Ne.null,null,1):new Qe(Ne.undefined,void 0,1)}i(kE,"decodeUndefined");function DE(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${It} indefinite length items not allowed`);return new Qe(Ne.break,void 0,1)}i(DE,"decodeBreak");function bv(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${It} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${It} Infinity values are not supported`)}return new Qe(Ne.float,e,t)}i(bv,"createToken");function RE(e,t,r,n){return bv(wv(e,t+1),3,n)}i(RE,"decodeFloat16");function OE(e,t,r,n){return bv(_v(e,t+1),5,n)}i(OE,"decodeFloat32");function NE(e,t,r,n){return bv(UE(e,t+1),9,n)}i(NE,"decodeFloat64");function pp(e,t,r){let n=t.value;if(n===!1)e.push([Ne.float.majorEncoded|JN]);else if(n===!0)e.push([Ne.float.majorEncoded|ZN]);else if(n===null)e.push([Ne.float.majorEncoded|YN]);else if(n===void 0)e.push([Ne.float.majorEncoded|XN]);else{let a,s=!1;(!r||r.float64!==!0)&&(BE(n),a=wv(na,1),n===a||Number.isNaN(n)?(na[0]=249,e.push(na.slice(0,3)),s=!0):(LE(n),a=_v(na,1),n===a&&(na[0]=250,e.push(na.slice(0,5)),s=!0))),s||(QN(n),a=UE(na,1),na[0]=251,e.push(na.slice(0,9)))}}i(pp,"encodeFloat");pp.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){BE(n);let a=wv(na,1);if(n===a||Number.isNaN(n))return 3;if(LE(n),a=_v(na,1),n===a)return 5}return 9},"encodedSize");var PE=new ArrayBuffer(9),Ui=new DataView(PE,1),na=new Uint8Array(PE,0);function BE(e){if(e===1/0)Ui.setUint16(0,31744,!1);else if(e===-1/0)Ui.setUint16(0,64512,!1);else if(Number.isNaN(e))Ui.setUint16(0,32256,!1);else{Ui.setFloat32(0,e);let t=Ui.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Ui.setUint16(0,31744,!1);else if(r===0)Ui.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let a=r-127;a<-24?Ui.setUint16(0,0):a<-14?Ui.setUint16(0,(t&2147483648)>>16|1<<24+a,!1):Ui.setUint16(0,(t&2147483648)>>16|a+15<<10|n>>13,!1)}}}i(BE,"encodeFloat16");function wv(e,t){if(e.length-t<2)throw new Error(`${It} 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,a=r&1023,s;return n===0?s=a*2**-24:n!==31?s=(a+1024)*2**(n-25):s=a===0?1/0:NaN,r&32768?-s:s}i(wv,"readFloat16");function LE(e){Ui.setFloat32(0,e,!1)}i(LE,"encodeFloat32");function _v(e,t){if(e.length-t<4)throw new Error(`${It} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(_v,"readFloat32");function QN(e){Ui.setFloat64(0,e,!1)}i(QN,"encodeFloat64");function UE(e,t){if(e.length-t<8)throw new Error(`${It} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i(UE,"readFloat64");pp.compareTokens=Li.compareTokens;function ur(e,t,r){throw new Error(`${It} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(ur,"invalidMinor");function mp(e){return()=>{throw new Error(`${It} ${e}`)}}i(mp,"errorer");var We=[];for(let e=0;e<=23;e++)We[e]=ur;We[24]=G8;We[25]=W8;We[26]=J8;We[27]=Z8;We[28]=ur;We[29]=ur;We[30]=ur;We[31]=ur;for(let e=32;e<=55;e++)We[e]=ur;We[56]=Y8;We[57]=X8;We[58]=Q8;We[59]=tE;We[60]=ur;We[61]=ur;We[62]=ur;We[63]=ur;for(let e=64;e<=87;e++)We[e]=rE;We[88]=nE;We[89]=iE;We[90]=aE;We[91]=oE;We[92]=ur;We[93]=ur;We[94]=ur;We[95]=mp("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)We[e]=sE;We[120]=cE;We[121]=uE;We[122]=lE;We[123]=fE;We[124]=ur;We[125]=ur;We[126]=ur;We[127]=mp("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)We[e]=hE;We[152]=pE;We[153]=mE;We[154]=gE;We[155]=vE;We[156]=ur;We[157]=ur;We[158]=ur;We[159]=yE;for(let e=160;e<=183;e++)We[e]=bE;We[184]=wE;We[185]=_E;We[186]=EE;We[187]=AE;We[188]=ur;We[189]=ur;We[190]=ur;We[191]=SE;for(let e=192;e<=215;e++)We[e]=xE;We[216]=TE;We[217]=CE;We[218]=ME;We[219]=IE;We[220]=ur;We[221]=ur;We[222]=ur;We[223]=ur;for(let e=224;e<=243;e++)We[e]=mp("simple values are not supported");We[244]=ur;We[245]=ur;We[246]=ur;We[247]=kE;We[248]=mp("simple values are not supported");We[249]=RE;We[250]=OE;We[251]=NE;We[252]=ur;We[253]=ur;We[254]=ur;We[255]=DE;var ia=[];for(let e=0;e<24;e++)ia[e]=new Qe(Ne.uint,e,1);for(let e=-1;e>=-24;e--)ia[31-e]=new Qe(Ne.negint,e,1);ia[64]=new Qe(Ne.bytes,new Uint8Array(0),1);ia[96]=new Qe(Ne.string,"",1);ia[128]=new Qe(Ne.array,0,1);ia[160]=new Qe(Ne.map,0,1);ia[244]=new Qe(Ne.false,!1,1);ia[245]=new Qe(Ne.true,!0,1);ia[246]=new Qe(Ne.null,null,1);function FE(e){switch(e.type){case Ne.false:return Ra([244]);case Ne.true:return Ra([245]);case Ne.null:return Ra([246]);case Ne.bytes:return e.value.length?void 0:Ra([64]);case Ne.string:return e.value===""?Ra([96]):void 0;case Ne.array:return e.value===0?Ra([128]):void 0;case Ne.map:return e.value===0?Ra([160]):void 0;case Ne.uint:return e.value<24?Ra([Number(e.value)]):void 0;case Ne.negint:if(e.value>=-24)return Ra([31-Number(e.value)])}}i(FE,"quickEncodeToken");var tP={float64:!1,mapSorter:iP,quickEncodeToken:FE};function rP(){let e=[];return e[Ne.uint.major]=Li,e[Ne.negint.major]=up,e[Ne.bytes.major]=mu,e[Ne.string.major]=dE,e[Ne.array.major]=fp,e[Ne.map.major]=dp,e[Ne.tag.major]=hp,e[Ne.float.major]=pp,e}i(rP,"makeCborEncoders");var jE=rP(),Ev=new pu,Js=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(`${vv} object contains circular references`);return new Js(r,t)}};i(Js,"Ref");var Go={null:new Qe(Ne.null,null),undefined:new Qe(Ne.undefined,void 0),true:new Qe(Ne.true,!0),false:new Qe(Ne.false,!1),emptyArray:new Qe(Ne.array,0),emptyMap:new Qe(Ne.map,0)},Wo={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Qe(Ne.float,e):e>=0?new Qe(Ne.uint,e):new Qe(Ne.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Qe(Ne.uint,e):new Qe(Ne.negint,e)},Uint8Array(e,t,r,n){return new Qe(Ne.bytes,e)},string(e,t,r,n){return new Qe(Ne.string,e)},boolean(e,t,r,n){return e?Go.true:Go.false},null(e,t,r,n){return Go.null},undefined(e,t,r,n){return Go.undefined},ArrayBuffer(e,t,r,n){return new Qe(Ne.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Qe(Ne.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[Go.emptyArray,new Qe(Ne.break)]:Go.emptyArray;n=Js.createCheck(n,e);let a=[],s=0;for(let c of e)a[s++]=gp(c,r,n);return r.addBreakTokens?[new Qe(Ne.array,e.length),a,new Qe(Ne.break)]:[new Qe(Ne.array,e.length),a]},Object(e,t,r,n){let a=t!=="Object",s=a?e.keys():Object.keys(e),c=a?e.size:s.length;if(!c)return r.addBreakTokens===!0?[Go.emptyMap,new Qe(Ne.break)]:Go.emptyMap;n=Js.createCheck(n,e);let l=[],h=0;for(let p of s)l[h++]=[gp(p,r,n),gp(a?e.get(p):e[p],r,n)];return nP(l,r),r.addBreakTokens?[new Qe(Ne.map,c),l,new Qe(Ne.break)]:[new Qe(Ne.map,c),l]}};Wo.Map=Wo.Object;Wo.Buffer=Wo.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Wo[`${e}Array`]=Wo.DataView;function gp(e,t={},r){let n=U8(e),a=t&&t.typeEncoders&&t.typeEncoders[n]||Wo[n];if(typeof a=="function"){let c=a(e,n,t,r);if(c!=null)return c}let s=Wo[n];if(!s)throw new Error(`${vv} unsupported type: ${n}`);return s(e,n,t,r)}i(gp,"objectToTokens");function nP(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(nP,"sortMapEntries");function iP(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 a=r.type.major,s=jE[a].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}i(iP,"mapSorter");function $E(e,t,r,n){if(Array.isArray(t))for(let a of t)$E(e,a,r,n);else r[t.type.major](e,t,n)}i($E,"tokensToEncoded");function aP(e,t,r){let n=gp(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let a=r.quickEncodeToken(n);if(a)return a;let s=t[n.type.major];if(s.encodedSize){let c=s.encodedSize(n,r),l=new pu(c);if(s(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return gv(l.chunks[0])}}return Ev.reset(),$E(Ev,n,t,r),Ev.toBytes(!0)}i(aP,"encodeCustom");function Av(e,t){return t=Object.assign({},tP,t),aP(e,jE,t)}i(Av,"encode");var oP={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},vp=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=ia[t];if(r===void 0){let n=We[t];if(!n)throw new Error(`${It} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let a=t&31;r=n(this.data,this.pos,a,this.options)}return this.pos+=r.encodedLength,r}};i(vp,"Tokeniser");var Sf=Symbol.for("DONE"),yp=Symbol.for("BREAK");function sP(e,t,r){let n=[];for(let a=0;a<e.value;a++){let s=xf(t,r);if(s===yp){if(e.value===1/0)break;throw new Error(`${It} got unexpected break to lengthed array`)}if(s===Sf)throw new Error(`${It} found array but not enough entries (got ${a}, expected ${e.value})`);n[a]=s}return n}i(sP,"tokenToArray");function cP(e,t,r){let n=r.useMaps===!0,a=n?void 0:{},s=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=xf(t,r);if(l===yp){if(e.value===1/0)break;throw new Error(`${It} got unexpected break to lengthed map`)}if(l===Sf)throw new Error(`${It} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${It} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(l)||!n&&l in a))throw new Error(`${It} found repeat map key "${l}"`);let h=xf(t,r);if(h===Sf)throw new Error(`${It} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?s.set(l,h):a[l]=h}return n?s:a}i(cP,"tokenToMap");function xf(e,t){if(e.done())return Sf;let r=e.next();if(r.type===Ne.break)return yp;if(r.type.terminal)return r.value;if(r.type===Ne.array)return sP(r,e,t);if(r.type===Ne.map)return cP(r,e,t);if(r.type===Ne.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=xf(e,t);return t.tags[r.value](n)}throw new Error(`${It} tag not supported (${r.value})`)}throw new Error("unsupported")}i(xf,"tokensToObject");function Sv(e,t){if(!(e instanceof Uint8Array))throw new Error(`${It} data to decode must be a Uint8Array`);t=Object.assign({},oP,t);let r=t.tokenizer||new vp(e,t),n=xf(r,t);if(n===Sf)throw new Error(`${It} did not find any content to decode`);if(n===yp)throw new Error(`${It} got unexpected break`);if(!r.done())throw new Error(`${It} too many terminals, data makes no sense`);return n}i(Sv,"decode");var zE=42;function lP(e){if(e.asCID!==e)return null;let t=Ft.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Qe(Ne.tag,zE),new Qe(Ne.bytes,r)]}i(lP,"cidEncoder");function fP(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(fP,"undefinedEncoder");function dP(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(dP,"numberEncoder");var hP={float64:!0,typeEncoders:{Object:lP,undefined:fP,number:dP}};function pP(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Ft.decode(e.subarray(1))}i(pP,"cidDecoder");var HE={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};HE.tags[zE]=pP;var mP="dag-cbor",gP=113,xv=i(e=>Av(e,hP),"encode"),vP=i(e=>Sv(e,HE),"decode");function yu(e){try{return e()}catch(t){return t}}i(yu,"tryCatch");var Tv=Vs(ip(),1);function Zs(e){let t=Tv.default.decode(e),r=Tv.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(Zs,"readVarint");function yP(e){return e===0||e===1}i(yP,"isCidVersion");function Cv(e){let[t,r]=Zs(e);if(!yP(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=Zs(r),[,s,c]=Zs(a),[l,,h]=Zs(s),p=a.subarray(0,c+h+l),g=a.subarray(c+h+l);return[Ft.create(t,n,Yh(p)),g]}i(Cv,"readCid");function Ys(e,t="StreamRef"){let[r,n]=Zs(e);if(r!==206)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=Zs(n),c=Cv(s),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:a,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=Cv(h);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(Ys,"fromBytes");var bP=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function bu(e,t="StreamRef"){let r=bP.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=ta.decode(n),s=Ys(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:Mv(s.genesis,c)}:s}i(bu,"fromString");function wP(e){try{return typeof e=="string"?Ft.parse(e):Ft.asCID(e)}catch{return null}}i(wP,"parseCID");function Mv(e,t=null){if(!t||t==="0")return null;let r=wP(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(Mv,"parseCommit");var Tf=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},Fi=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},wp=class extends Error{constructor(t){super(`Invalid StreamID bytes ${ta.encode(t)}: contains commit`)}};i(wp,"InvalidStreamIDBytesError");var _p=class extends Error{constructor(t){super(`Invalid StreamID string ${t}: contains commit`)}};i(_p,"InvalidStreamIDStringError");function KE(e){let t=Ys(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new wp(e)}i(KE,"fromBytes");function _P(e){return yu(()=>KE(e))}i(_P,"fromBytesNoThrow");function GE(e){let t=bu(e,"StreamID");if(t.kind==="stream-id")return new Yt(t.type,t.genesis);throw new _p(e)}i(GE,"fromString");function EP(e){return yu(()=>GE(e))}i(EP,"fromStringNoThrow");var VE=Symbol.for("@ceramicnetwork/streamid/StreamID"),Yt=class{constructor(t,r){if(this._tag=VE,!(t||t===0))throw new Error("StreamID constructor: type required");if(!r)throw new Error("StreamID constructor: cid required");this._type=typeof t=="string"?ra.codeByName(t):t,this._cid=typeof r=="string"?Ft.parse(r):r}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===VE}static async fromGenesis(t,r){let n=await L8({value:r,codec:bp,hasher:ov});return new Yt(t,n.cid)}get type(){return this._type}get typeName(){return ra.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let t=kv.default.encode(206),r=kv.default.encode(this.type);return wf([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 ta.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=KE;Yt.fromBytesNoThrow=_P;Yt.fromString=GE;Yt.fromStringNoThrow=EP;Tf([ui(),Fi("design:type",String),Fi("design:paramtypes",[])],Yt.prototype,"typeName",null);Tf([ui(),Fi("design:type",Uint8Array),Fi("design:paramtypes",[])],Yt.prototype,"bytes",null);Tf([ui(),Fi("design:type",Yt),Fi("design:paramtypes",[])],Yt.prototype,"baseID",null);Tf([ui(),Fi("design:type",Function),Fi("design:paramtypes",[]),Fi("design:returntype",String)],Yt.prototype,"toString",null);Tf([ui(),Fi("design:type",Function),Fi("design:paramtypes",[]),Fi("design:returntype",String)],Yt.prototype,"toUrl",null);var _u=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},Kn=function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},Dv=function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},po=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)},wu,Xs,Cf,Ep=class extends Error{constructor(t){super(`Error while parsing CommitID from bytes ${ta.encode(t)}: no commit information provided`)}};i(Ep,"InvalidCommitIDBytesError");var Ap=class extends Error{constructor(t){super(`Error while parsing CommitID from string ${t}: no commit information provided`)}};i(Ap,"InvalidCommitIDStringError");function JE(e){let t=Ys(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new Ep(e)}i(JE,"fromBytes");function AP(e){return yu(()=>JE(e))}i(AP,"fromBytesNoThrow");function ZE(e){let t=bu(e,"CommitID");if(t.kind==="commit-id")return new hr(t.type,t.genesis,t.commit);throw new Ap(e)}i(ZE,"fromString");function SP(e){return yu(()=>ZE(e))}i(SP,"fromStringNoThrow");var WE=Symbol.for("@ceramicnetwork/streamid/CommitID");function xP(e,t){return new hr(e.type,e.cid,t)}i(xP,"make");var hr=class{constructor(t,r,n=null){if(this._tag=WE,wu.set(this,void 0),Xs.set(this,void 0),Cf.set(this,void 0),!t&&t!==0)throw new Error("constructor: type required");if(!r)throw new Error("constructor: cid required");Dv(this,wu,typeof t=="string"?ra.codeByName(t):t,"f"),Dv(this,Xs,typeof r=="string"?Ft.parse(r):r,"f"),Dv(this,Cf,Mv(po(this,Xs,"f"),n),"f")}static isInstance(t){return typeof t=="object"&&"_tag"in t&&t._tag===WE}get baseID(){return new Yt(po(this,wu,"f"),po(this,Xs,"f"))}get type(){return po(this,wu,"f")}get typeName(){return ra.nameByCode(po(this,wu,"f"))}get cid(){return po(this,Xs,"f")}get commit(){return po(this,Cf,"f")||po(this,Xs,"f")}get bytes(){let t=Rv.default.encode(206),r=Rv.default.encode(this.type),n=po(this,Cf,"f")?.bytes||new Uint8Array([0]);return wf([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 ta.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(wu=new WeakMap,Xs=new WeakMap,Cf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};i(hr,"CommitID");hr.fromBytes=JE;hr.fromBytesNoThrow=AP;hr.fromString=ZE;hr.fromStringNoThrow=SP;hr.make=xP;_u([ui(),Kn("design:type",Yt),Kn("design:paramtypes",[])],hr.prototype,"baseID",null);_u([ui(),Kn("design:type",String),Kn("design:paramtypes",[])],hr.prototype,"typeName",null);_u([ui(),Kn("design:type",Ft),Kn("design:paramtypes",[])],hr.prototype,"commit",null);_u([ui(),Kn("design:type",Uint8Array),Kn("design:paramtypes",[])],hr.prototype,"bytes",null);_u([ui(),Kn("design:type",Function),Kn("design:paramtypes",[]),Kn("design:returntype",String)],hr.prototype,"toString",null);_u([ui(),Kn("design:type",Function),Kn("design:paramtypes",[]),Kn("design:returntype",String)],hr.prototype,"toUrl",null);var Qs;(function(e){function t(a){let s=Ys(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${ta.encode(a)}`)}}i(t,"fromBytes"),e.fromBytes=t;function r(a){let s=bu(a);switch(s.kind){case"commit-id":return new hr(s.type,s.genesis,s.commit);case"stream-id":return new Yt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString"),e.fromString=r;function n(a){if(Yt.isInstance(a)||hr.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from"),e.from=n})(Qs||(Qs={}));var YE="ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw",Sp="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow";var Ov={};En(Ov,{JsonPatchError:()=>Lr,_areEquals:()=>kf,applyOperation:()=>ec,applyPatch:()=>Dp,applyReducer:()=>kP,deepClone:()=>MP,getValueByPointer:()=>Ip,validate:()=>QE,validator:()=>kp});var TP=function(){var e=i(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},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)}}(),CP=Object.prototype.hasOwnProperty;function Tp(e,t){return CP.call(e,t)}i(Tp,"hasOwnProperty");function Cp(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 a in e)Tp(e,a)&&n.push(a);return n}i(Cp,"_objectKeys");function un(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(un,"_deepClone");function Mp(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(Mp,"isInteger");function Oa(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(Oa,"escapePathComponent");function Mf(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(Mf,"unescapePathComponent");function xp(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(xp(e[t]))return!0}else if(typeof e=="object"){for(var n=Cp(e),a=n.length,s=0;s<a;s++)if(xp(e[n[s]]))return!0}}return!1}i(xp,"hasUndefined");function XE(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
22
+ `)}i(XE,"patchErrorMessageFormatter");var If=function(e){TP(t,e);function t(r,n,a,s,c){var l=this.constructor,h=e.call(this,XE(r,{name:n,index:a,operation:s,tree:c}))||this;return h.name=n,h.index=a,h.operation=s,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=XE(r,{name:n,index:a,operation:s,tree:c}),h}return i(t,"PatchError"),t}(Error);var Lr=If,MP=un,Eu={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=Ip(r,this.path);n&&(n=un(n));var a=ec(r,{op:"remove",path:this.from}).removed;return ec(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Ip(r,this.from);return ec(r,{op:"add",path:this.path,value:un(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:kf(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},IP={add:function(e,t,r){return Mp(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:Eu.move,copy:Eu.copy,test:Eu.test,_get:Eu._get};function Ip(e,t){if(t=="")return e;var r={op:"_get",path:t};return ec(e,r),r.value}i(Ip,"getValueByPointer");function ec(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):kp(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=Ip(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=kf(e,t.value),c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,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 Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=un(e));var l=t.path||"",h=l.split("/"),p=e,g=1,v=h.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=kp;;){if(_=h[g],_&&_.indexOf("~")!=-1&&(_=Mf(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&h[g-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[_]===void 0?y=h.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!Mp(_))throw new Lr("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",s,t,e);Mp(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Lr("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=IP[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Eu[t.op].call(t,p,_,e);if(c.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Lr("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(ec,"applyOperation");function Dp(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=un(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=ec(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(Dp,"applyPatch");function kP(e,t,r){var n=ec(e,t);if(n.test===!1)throw new Lr("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(kP,"applyReducer");function kp(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Lr("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Eu[e.op]){if(typeof e.path!="string")throw new Lr("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Lr('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 Lr("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 Lr("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")&&xp(e.value))throw new Lr("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 a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Lr("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 Lr("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=QE([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Lr("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Lr("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(kp,"validator");function QE(e,t,r){try{if(!Array.isArray(e))throw new Lr("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Dp(un(t),un(e),r||!0);else{r=r||kp;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Lr)return a;throw a}}i(QE,"validate");function kf(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),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!kf(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!kf(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(kf,"_areEquals");var Lv={};En(Lv,{compare:()=>UP,generate:()=>Nv,observe:()=>LP,unobserve:()=>BP});var Pv=new WeakMap,DP=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror"),e}(),RP=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo"),e}();function OP(e){return Pv.get(e)}i(OP,"getMirror");function NP(e,t){return e.observers.get(t)}i(NP,"getObserverFromMirror");function PP(e,t){e.observers.delete(t.callback)}i(PP,"removeObserverFromMirror");function BP(e,t){t.unobserve()}i(BP,"unobserve");function LP(e,t){var r=[],n,a=OP(e);if(!a)a=new DP(e),Pv.set(e,a);else{var s=NP(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=un(e),t){n.callback=t,n.next=null;var c=i(function(){Nv(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(){Nv(n),clearTimeout(n.next),PP(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new RP(t,n)),n}i(LP,"observe");function Nv(e,t){t===void 0&&(t=!1);var r=Pv.get(e.object);Bv(r.value,e.object,e.patches,"",t),e.patches.length&&Dp(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(Nv,"generate");function Bv(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=Cp(t),c=Cp(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(Tp(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?Bv(v,y,r,n+"/"+Oa(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+Oa(g),value:un(v)}),r.push({op:"replace",path:n+"/"+Oa(g),value:un(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+Oa(g),value:un(v)}),r.push({op:"remove",path:n+"/"+Oa(g)}),h=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!Tp(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+Oa(g),value:un(t[g])})}}}i(Bv,"_generate");function UP(e,t,r){r===void 0&&(r=!1);var n=[];return Bv(e,t,n,"",r),n}i(UP,"compare");var e9=Object.assign({},Ov,Lv,{JsonPatchError:If,deepClone:un,escapePathComponent:Oa,unescapePathComponent:Mf});var _7=Vs(Xv(),1);var E7=Vs(n7(),1);var ic;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(ic||(ic={}));var gy=Vs(Xv(),1);var oy=i(function(e,t){return oy=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},oy(e,t)},"extendStatics");function sy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");oy(e,t);function r(){this.constructor=e}i(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(sy,"__extends");function cy(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(cy,"__values");function Cu(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(Cu,"__read");function Mu(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(Mu,"__spreadArray");function ji(e){return typeof e=="function"}i(ji,"isFunction");function i7(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(i7,"createErrorClass");var Wp=i7(function(e){return i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
23
23
  `+r.map(function(n,a){return a+1+") "+n.toString()}).join(`
24
- `):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function uy(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(uy,"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,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=cy(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 g=this.initialTeardown;if(ji(g))try{g()}catch(O){s=O instanceof Wp?O.errors:[O]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=cy(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{a7(x)}catch(O){s=s??[],O instanceof Wp?s=Mu(Mu([],Cu(s)),Cu(O.errors)):s.push(O)}}}catch(O){n={error:O}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new Wp(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)a7(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)&&uy(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&uy(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var kJ=Jp.EMPTY;function Zp(e){return e instanceof Jp||e&&"closed"in e&&ji(e.remove)&&ji(e.add)&&ji(e.unsubscribe)}i(Zp,"isSubscription");function a7(e){ji(e)?e():e.unsubscribe()}i(a7,"execFinalizer");var aa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Iu={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Iu.delegate;return a?.setTimeout?a.setTimeout.apply(a,Mu([e,t],Cu(r))):setTimeout.apply(void 0,Mu([e,t],Cu(r)))},clearTimeout:function(e){var t=Iu.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function o7(e){Iu.setTimeout(function(){var t=aa.onUnhandledError;if(t)t(e);else throw e})}i(o7,"reportUnhandledError");function ly(){}i(ly,"noop");var s7=function(){return fy("C",void 0,void 0)}();function c7(e){return fy("E",void 0,e)}i(c7,"errorNotification");function u7(e){return fy("N",e,void 0)}i(u7,"nextNotification");function fy(e,t,r){return{kind:e,value:t,error:r}}i(fy,"createNotification");var nc=null;function l7(e){if(aa.useDeprecatedSynchronousErrorHandling){var t=!nc;if(t&&(nc={errorThrown:!1,error:null}),e(),t){var r=nc,n=r.errorThrown,a=r.error;if(nc=null,n)throw a}}else e()}i(l7,"errorContext");function f7(e){aa.useDeprecatedSynchronousErrorHandling&&nc&&(nc.errorThrown=!0,nc.error=e)}i(f7,"captureError");var py=function(e){sy(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=JL,n}return i(t,"Subscriber"),t.create=function(r,n,a){return new Xp(r,n,a)},t.prototype.next=function(r){this.isStopped?hy(u7(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?hy(c7(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?hy(s7,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 KL=Function.prototype.bind;function dy(e,t){return KL.call(e,t)}i(dy,"bind");var GL=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){Yp(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Yp(n)}else Yp(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Yp(r)}},e}(),Xp=function(e){sy(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(ji(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&aa.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&dy(r.next,l),error:r.error&&dy(r.error,l),complete:r.complete&&dy(r.complete,l)}):c=r}return s.destination=new GL(c),s}return i(t,"SafeSubscriber"),t}(py);function Yp(e){aa.useDeprecatedSynchronousErrorHandling?f7(e):o7(e)}i(Yp,"handleUnhandledError");function WL(e){throw e}i(WL,"defaultErrorHandler");function hy(e,t){var r=aa.onStoppedNotification;r&&Iu.setTimeout(function(){return r(e,t)})}i(hy,"handleStoppedNotification");var JL={closed:!0,next:ly,error:WL,complete:ly};var d7=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function h7(e){return e}i(h7,"identity");function p7(e){return e.length===0?h7:e.length===1?e[0]:i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped")}i(p7,"pipeFromArray");var my=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 a=this,s=YL(t)?t:new Xp(t,r,n);return l7(function(){var c=a,l=c.operator,h=c.source;s.add(l?l.call(s,h):h?a._subscribe(s):a._trySubscribe(s))}),s},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=m7(r),new r(function(a,s){var c=new Xp({next:function(l){try{t(l)}catch(h){s(h),c.unsubscribe()}},error:s,complete:a});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[d7]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return p7(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=m7(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function m7(e){var t;return(t=e??aa.Promise)!==null&&t!==void 0?t:Promise}i(m7,"getPromiseCtor");function ZL(e){return e&&ji(e.next)&&ji(e.error)&&ji(e.complete)}i(ZL,"isObserver");function YL(e){return e&&e instanceof py||ZL(e)&&Zp(e)}i(YL,"isSubscriber");var g7;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(g7||(g7={}));var v7;(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"})(v7||(v7={}));var vy;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(vy||(vy={}));var Nf=class extends my{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,gy.default)(t?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return hr.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:t})=>hr.make(this.id,t))}get anchorCommitIds(){return this.state$.value.log.filter(({type:t})=>t===vy.ANCHOR).map(({cid:t})=>hr.make(this.id,t))}get state(){return(0,gy.default)(this.state$.value)}async sync(t={}){t={sync:rc.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(Nf,"Stream");function y7(){return e=>{}}i(y7,"StreamStatic");var XL=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},mi,yy={anchor:!0,publish:!0,pin:!0,sync:rc.PREFER_CACHE},QL={sync:rc.PREFER_CACHE},b7={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function by(e,t){if(typeof e?.schema=="string")try{hr.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=dv((0,E7.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(by,"headerFromMetadata");async function w7(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(w7,"getAuthenticatedDID");async function wy(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(wy,"throwReadOnlyError");var Zo=mi=i(class extends Nf{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,_7.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...yy,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await mi.makeGenesis(s,r,n);return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...yy,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await mi._signDagJWS(t,r):r;return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,a,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 a=await mi.makeGenesis(t,null,r);return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...QL,...n};let a=Ys.from(r);if(a.type!=mi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${mi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...b7,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...b7,...r};let a={header:by(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await mi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=wy,this.patch=wy,this.sync=wy,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return mi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=by(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 a=e9.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await w7(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 a=by(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:a};return xv(c),c}let s={data:r,header:a};return mi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await w7(t)).createDagJWS(r)}},"TileDocument");Zo.STREAM_TYPE_NAME="tile";Zo.STREAM_TYPE_ID=0;Zo=mi=XL([y7()],Zo);var I7=Hs(x7(),1);function uU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(uU,"_checkPrivateRedeclaration");function lU(e,t){return t.get?t.get.call(e):t.value}i(lU,"_classApplyDescriptorGet");function fU(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(fU,"_classApplyDescriptorSet");function M7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(M7,"_classExtractFieldDescriptor");function Sy(e,t){var r=M7(e,t,"get");return lU(e,r)}i(Sy,"_classPrivateFieldGet");function T7(e,t,r){uU(e,t),t.set(e,r)}i(T7,"_classPrivateFieldInit");function C7(e,t,r){var n=M7(e,t,"set");return fU(e,n,r),r}i(C7,"_classPrivateFieldSet");function dU(e){return typeof e=="string"||hr.isInstance(e)||Yt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(dU,"keyToQuery");function xy(e){return typeof e=="string"?Ys.from(e).toString():hr.isInstance(e)||Yt.isInstance(e)?e.toString():e.streamId.toString()}i(xy,"keyToString");async function Cy(e){let t=await Zo.makeGenesis({},null,{...e,deterministic:!0}),r=await Yt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(Cy,"getDeterministicQuery");var hU=i(()=>Promise.resolve([]),"tempBatchLoadFn"),Qp=new WeakMap,Ty=new WeakMap,ic=class extends I7.default{cache(t){if(!Sy(this,Ty))return!1;let r=t.id.toString();return this.clear(r).prime(r,t),!0}async create(t,r,n){let a=await Zo.create(Sy(this,Qp),t,r,n);return this.cache(a),a}async deterministic(t,r){let n=await Cy(t);try{return await super.load(n)}catch{let s=await Zo.createFromGenesis(Sy(this,Qp),n.genesis,r);return this.cache(s),s}}async load(t){return await super.load(t)}async update(t,r,n,a){let s=xy(t);this.clear(s);let c=await this.load({streamId:s});return await c.update(r,n,a),c}constructor(t){super(hU,{cache:!0,cacheKeyFn:xy,cacheMap:t.cache!=null&&typeof t.cache!="boolean"?t.cache:void 0}),T7(this,Qp,{writable:!0,value:void 0}),T7(this,Ty,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{t.cache||this.clearAll();let n=await t.ceramic.multiQuery(r.map(dU),t.multiqueryTimeout);return r.map(a=>{let s=xy(a),c=n[s];return c||new Error(`Failed to load stream: ${s}`)})},C7(this,Qp,t.ceramic),C7(this,Ty,!!t.cache)}};i(ic,"TileLoader");function pU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(pU,"_checkPrivateRedeclaration");function mU(e,t){return t.get?t.get.call(e):t.value}i(mU,"_classApplyDescriptorGet");function gU(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(gU,"_classApplyDescriptorSet");function D7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(D7,"_classExtractFieldDescriptor");function ac(e,t){var r=D7(e,t,"get");return mU(e,r)}i(ac,"_classPrivateFieldGet");function k7(e,t,r){pU(e,t),t.set(e,r)}i(k7,"_classPrivateFieldInit");function My(e,t,r){var n=D7(e,t,"set");return gU(e,n,r),r}i(My,"_classPrivateFieldSet");var ku=new WeakMap,Du=new WeakMap,Ru=class{get aliases(){return ac(this,ku)}get loader(){return ac(this,Du)}getDefinitionID(t){return ac(this,ku).definitions[t]??null}getSchemaURL(t){return ac(this,ku).schemas[t]??null}getTileID(t){return ac(this,ku).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 ac(this,Du).load(r)}async createTile(t,r,n={}){let a=this.getSchemaURL(t);if(a==null)throw new Error(`Schema alias "${t}" is not defined`);let{controller:s,...c}=n,l={schema:a};return s!=null&&(l.controllers=[s]),await ac(this,Du).create(r,l,c)}constructor(t){if(k7(this,ku,{writable:!0,value:void 0}),k7(this,Du,{writable:!0,value:void 0}),My(this,ku,t.aliases),t.loader!=null)My(this,Du,t.loader);else{if(t.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");My(this,Du,new ic({ceramic:t.ceramic,cache:t.cache}))}}};i(Ru,"DataModel");function vU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(vU,"_checkPrivateRedeclaration");function yU(e,t){return t.get?t.get.call(e):t.value}i(yU,"_classApplyDescriptorGet");function bU(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(bU,"_classApplyDescriptorSet");function R7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(R7,"_classExtractFieldDescriptor");function Na(e,t){var r=R7(e,t,"get");return yU(e,r)}i(Na,"_classPrivateFieldGet");function e0(e,t,r){vU(e,t),t.set(e,r)}i(e0,"_classPrivateFieldInit");function t0(e,t,r){var n=R7(e,t,"set");return bU(e,n,r),r}i(t0,"_classPrivateFieldSet");var r0=new WeakMap,oc=new WeakMap,Iy=new WeakMap,n0=new WeakMap,Pf=class{_createValuePromise(){t0(this,Iy,new Promise((t,r)=>{t0(this,n0,{resolve:t,reject:r})}))}change(t){return new Promise((r,n)=>{let a=i(async s=>{try{let c=await t(s);r(),this._next(c)}catch(c){n(c),this._next(s)}},"run");Na(this,oc).push({reject:n,run:a}),Na(this,oc).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 Na(this,oc).length===0?await Na(this,r0).call(this):await Na(this,Iy)}async _start(){try{let t=await Na(this,r0).call(this);this._next(t)}catch(t){Na(this,oc).forEach(r=>{r.reject(t)}),t0(this,oc,[]),Na(this,n0).reject(t),this._createValuePromise()}}_next(t){let r=Na(this,oc).shift();r==null?this._end(t):r.run(t)}_end(t){Na(this,n0).resolve(t),this._createValuePromise()}constructor(t){e0(this,r0,{writable:!0,value:void 0}),e0(this,oc,{writable:!0,value:[]}),e0(this,Iy,{writable:!0,value:void 0}),e0(this,n0,{writable:!0,value:void 0}),t0(this,r0,t),this._createValuePromise()}};i(Pf,"TileProxy");var wU=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function _U(e){return wU.test(e)}i(_U,"isDIDstring");function EU(e){if(!_U(e))throw new Error(`Invalid DID: ${e}`)}i(EU,"assertDIDstring");function ky(e){return EU(e),{controllers:[e],family:"IDX"}}i(ky,"getIDXMetadata");function AU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(AU,"_checkPrivateRedeclaration");function SU(e,t){return t.get?t.get.call(e):t.value}i(SU,"_classApplyDescriptorGet");function xU(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(xU,"_classApplyDescriptorSet");function O7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(O7,"_classExtractFieldDescriptor");function $r(e,t){var r=O7(e,t,"get");return SU(e,r)}i($r,"_classPrivateFieldGet");function Bf(e,t,r){AU(e,t),t.set(e,r)}i(Bf,"_classPrivateFieldInit");function i0(e,t,r){var n=O7(e,t,"set");return xU(e,n,r),r}i(i0,"_classPrivateFieldSet");var vo=new WeakMap,a0=new WeakMap,Dy=new WeakMap,Pa=new WeakMap,o0=new WeakMap,Lf=class{get authenticated(){return $r(this,vo).did!=null}get ceramic(){return $r(this,vo)}get id(){if($r(this,a0)!=null)return $r(this,a0);if($r(this,vo).did==null)throw new Error("Ceramic instance is not authenticated");return $r(this,vo).did.hasParent?$r(this,vo).did.parent:$r(this,vo).did.id}get loader(){return $r(this,Pa)}get model(){return $r(this,o0)}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),a=await Promise.all(r.map(async l=>{let{genesis:h,streamId:p}=await Cy(ky(l));return{genesis:h,streamId:p.toString(),paths:[n]}})),s=await $r(this,vo).multiQuery(a),c=[];for(let l of a){let h=s[l.streamId]?.content?.[n],p=h?s[Yt.fromString(h).toString()]:null;c.push(p?.content??null)}return c}async set(t,r,n={}){let a=this.getDefinitionID(t),[s,c]=await this._setRecordOnly(a,r,n);return s&&await this._setReference(n.controller??this.id,a,c),c}async merge(t,r,n={}){let a=this.getDefinitionID(t),s=await this.getRecord(a),c=s?{...s,...r}:r;return await this.setRecord(a,c,n)}async setAll(t,r={}){let n=Object.entries(t).map(async([c,l])=>{let h=this.getDefinitionID(c),[p,g]=await this._setRecordOnly(h,l,r);return[p,h,g]}),s=(await Promise.all(n)).reduce((c,[l,h,p])=>(l&&(c[h]=p.toUrl()),c),{});return await this._setReferences(r.controller??this.id,s),s}async setDefaults(t,r={}){let n=await this.getIndex()??{},a=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),g=await this._createRecord(p,h,r);return{[l]:g.toUrl()}}),c=(await Promise.all(a)).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[a,s]=r[n++],c=await $r(this,Pa).load(s);return{done:!1,value:{key:a,id:s,record:c.content}}}}}async _createIDXDoc(t){return await $r(this,Pa).deterministic(ky(t))}async _getIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)return null;if(r.metadata.schema!==Sp)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:Sp});else if(r.metadata.schema!==Sp)throw new Error("Invalid document: schema is not IdentityIndex");return r}_getIndexProxy(t){let r=$r(this,Dy)[t];return r==null&&(r=new Pf(async()=>await this._getOwnIDXDoc(t)),$r(this,Dy)[t]=r),r}getDefinitionID(t){return $r(this,o0).getDefinitionID(t)??t}async getDefinition(t){let r=await $r(this,Pa).load(t);if(r.metadata.schema!==YE)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 $r(this,Pa).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[a,s]=await this._setRecordOnly(t,r,n);return a&&await this._setReference(n.controller??this.id,t,s),s}async _setRecordOnly(t,r,n){let a=await this.getRecordID(t,n.controller??this.id);if(a==null){let s=await this.getDefinition(t),c=await this._createRecord(s,r,n);return[!0,c]}else{let s=await $r(this,Pa).update(a,r);return[!1,s.id]}}async _createRecord(t,r,{controller:n,pin:a}){let s=await $r(this,Pa).deterministic({controllers:[n??this.id],family:t.id.toString()},{pin:a});return await s.update(r,{schema:t.schema}),s.id}async _setReference(t,r,n){await this._getIndexProxy(t).changeContent(a=>({...a,[r]:n.toUrl()}))}async _setReferences(t,r){Object.keys(r).length!==0&&await this._getIndexProxy(t).changeContent(n=>({...n,...r}))}constructor(t){Bf(this,vo,{writable:!0,value:void 0}),Bf(this,a0,{writable:!0,value:void 0}),Bf(this,Dy,{writable:!0,value:{}}),Bf(this,Pa,{writable:!0,value:void 0}),Bf(this,o0,{writable:!0,value:void 0});let{cache:r,ceramic:n,id:a,loader:s,model:c}=t;i0(this,vo,n),i0(this,a0,a),i0(this,Pa,s??new ic({ceramic:n,cache:r})),i0(this,o0,c instanceof Ru?c:new Ru({loader:$r(this,Pa),aliases:c}))}};i(Lf,"DIDDataStore");var rr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(rr||(rr={}));var tt=rr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yo=i(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"),Ke=rr.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"]),TU=i(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),$i=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(s){return s.message},n={_errors:[]},a=i(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(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 a(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,rr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};i($i,"ZodError");$i.create=e=>new $i(e);var Ff=i((e,t)=>{let r;switch(e.code){case Ke.invalid_type:e.received===tt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rr.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${rr.joinValues(e.keys,", ")}`;break;case Ke.invalid_union:r="Invalid input";break;case Ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rr.joinValues(e.options)}`;break;case Ke.invalid_enum_value:r=`Invalid enum value. Expected ${rr.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}"`:rr.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,rr.assertNever(e)}return{message:r}},"errorMap"),L7=Ff;function CU(e){L7=e}i(CU,"setErrorMap");function c0(){return L7}i(c0,"getErrorMap");var u0=i(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:a.message||l}},"makeIssue"),MU=[];function vt(e,t){let r=u0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,c0(),Ff].filter(n=>!!n)});e.common.issues.push(r)}i(vt,"addIssueToContext");var en=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 a of r){if(a.status==="aborted")return Dt;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return en.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return Dt;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}};i(en,"ParseStatus");var Dt=Object.freeze({status:"aborted"}),U7=i(e=>({status:"dirty",value:e}),"DIRTY"),Sn=i(e=>({status:"valid",value:e}),"OK"),Ry=i(e=>e.status==="aborted","isAborted"),Oy=i(e=>e.status==="dirty","isDirty"),l0=i(e=>e.status==="valid","isValid"),f0=i(e=>typeof Promise!==void 0&&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 gi=class{constructor(t,r,n,a){this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._path.concat(this._key)}};i(gi,"ParseInputLazyPath");var N7=i((e,t)=>{if(l0(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new $i(e.common.issues);return{success:!1,error:r}}},"handleResult");function Vt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=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:a}:{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:a}}i(Vt,"processCreateParams");var Bt=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 Yo(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Yo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new en,ctx:{common:t.parent.common,data:t.data,parsedType:Yo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(f0(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 a={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:Yo(t)},s=this._parseSync({data:t,path:a.path,parent:a});return N7(a,s)}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:Yo(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(f0(a)?a:Promise.resolve(a));return N7(n,s)}refine(t,r){let n=i(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let c=t(a),l=i(()=>s.addIssue({code:Ke.custom,...n(a)}),"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,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Wn({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return yi.create(this)}nullable(){return Fa.create(this)}nullish(){return this.optional().nullable()}array(){return Gn.create(this)}promise(){return wo.create(this)}or(t){return rs.create([this,t])}and(t){return ns.create(this,t)}transform(t){return new Wn({schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new us({innerType:this,defaultValue:r,typeName:xt.ZodDefault})}brand(){return new Uf({typeName:xt.ZodBranded,type:this,...Vt(void 0)})}catch(t){let r=typeof t=="function"?t:()=>t;return new fc({innerType:this,defaultValue:r,typeName:xt.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ls.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};i(Bt,"ZodType");var IU=/^c[^\s-]{8,}$/i,kU=/^([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,DU=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,RU=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"),zi=class extends Bt{constructor(){super(...arguments),this._regex=(t,r,n)=>this.refinement(a=>t.test(a),{validation:r,code:Ke.invalid_string,...Wt.errToObj(n)}),this.nonempty=t=>this.min(1,Wt.errToObj(t)),this.trim=()=>new zi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==tt.string){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.string,received:s.parsedType}),Dt}let n=new en,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?vt(a,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&vt(a,{code:Ke.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")DU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"email",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")kU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"uuid",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")IU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"cuid",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),vt(a,{validation:"url",code:Ke.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"regex",code:Ke.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?RU(s).test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:"datetime",message:s.message}),n.dirty()):rr.assertNever(s);return{status:n.value,value:t.data}}_addCheck(t){return new zi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Wt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Wt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Wt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Wt.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,...Wt.errToObj(t?.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Wt.errToObj(r)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Wt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Wt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Wt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Wt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Wt.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 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(zi,"ZodString");zi.create=e=>{var t;return new zi({checks:[],typeName:xt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Vt(e)})};function OU(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(OU,"floatSafeRemainder");var oa=class extends Bt{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)!==tt.number){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.number,received:s.parsedType}),Dt}let n,a=new en;for(let s of this._def.checks)s.kind==="int"?rr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?OU(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.not_finite,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Wt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Wt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Wt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Wt.toString(r))}setLimit(t,r,n,a){return new oa({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Wt.toString(a)}]})}_addCheck(t){return new oa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Wt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Wt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Wt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Wt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Wt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Wt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Wt.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")}};i(oa,"ZodNumber");oa.create=e=>new oa({checks:[],typeName:xt.ZodNumber,coerce:e?.coerce||!1,...Vt(e)});var Xo=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==tt.bigint){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.bigint,received:n.parsedType}),Dt}return Sn(t.data)}};i(Xo,"ZodBigInt");Xo.create=e=>{var t;return new Xo({typeName:xt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Vt(e)})};var Qo=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==tt.boolean){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.boolean,received:n.parsedType}),Dt}return Sn(t.data)}};i(Qo,"ZodBoolean");Qo.create=e=>new Qo({typeName:xt.ZodBoolean,coerce:e?.coerce||!1,...Vt(e)});var Ba=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==tt.date){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.date,received:s.parsedType}),Dt}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_date}),Dt}let n=new en,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):rr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ba({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Wt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Wt.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(Ba,"ZodDate");Ba.create=e=>new Ba({checks:[],coerce:e?.coerce||!1,typeName:xt.ZodDate,...Vt(e)});var sc=class extends Bt{_parse(t){if(this._getType(t)!==tt.symbol){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.symbol,received:n.parsedType}),Dt}return Sn(t.data)}};i(sc,"ZodSymbol");sc.create=e=>new sc({typeName:xt.ZodSymbol,...Vt(e)});var es=class extends Bt{_parse(t){if(this._getType(t)!==tt.undefined){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.undefined,received:n.parsedType}),Dt}return Sn(t.data)}};i(es,"ZodUndefined");es.create=e=>new es({typeName:xt.ZodUndefined,...Vt(e)});var ts=class extends Bt{_parse(t){if(this._getType(t)!==tt.null){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.null,received:n.parsedType}),Dt}return Sn(t.data)}};i(ts,"ZodNull");ts.create=e=>new ts({typeName:xt.ZodNull,...Vt(e)});var yo=class extends Bt{constructor(){super(...arguments),this._any=!0}_parse(t){return Sn(t.data)}};i(yo,"ZodAny");yo.create=e=>new yo({typeName:xt.ZodAny,...Vt(e)});var La=class extends Bt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Sn(t.data)}};i(La,"ZodUnknown");La.create=e=>new La({typeName:xt.ZodUnknown,...Vt(e)});var Hi=class extends Bt{_parse(t){let r=this._getOrReturnCtx(t);return vt(r,{code:Ke.invalid_type,expected:tt.never,received:r.parsedType}),Dt}};i(Hi,"ZodNever");Hi.create=e=>new Hi({typeName:xt.ZodNever,...Vt(e)});var cc=class extends Bt{_parse(t){if(this._getType(t)!==tt.undefined){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.void,received:n.parsedType}),Dt}return Sn(t.data)}};i(cc,"ZodVoid");cc.create=e=>new cc({typeName:xt.ZodVoid,...Vt(e)});var Gn=class extends Bt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==tt.array)return vt(r,{code:Ke.invalid_type,expected:tt.array,received:r.parsedType}),Dt;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(vt(r,{code:c?Ke.too_big:Ke.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(vt(r,{code:Ke.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(vt(r,{code:Ke.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all(r.data.map((c,l)=>a.type._parseAsync(new gi(r,c,r.path,l)))).then(c=>en.mergeArray(n,c));let s=r.data.map((c,l)=>a.type._parseSync(new gi(r,c,r.path,l)));return en.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Gn({...this._def,minLength:{value:t,message:Wt.toString(r)}})}max(t,r){return new Gn({...this._def,maxLength:{value:t,message:Wt.toString(r)}})}length(t,r){return new Gn({...this._def,exactLength:{value:t,message:Wt.toString(r)}})}nonempty(t){return this.min(1,t)}};i(Gn,"ZodArray");Gn.create=(e,t)=>new Gn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...Vt(t)});var d0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(d0||(d0={}));var P7=i(e=>t=>new Er({...e,shape:()=>({...e.shape(),...t})}),"AugmentFactory");function Ou(e){if(e instanceof Er){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=yi.create(Ou(n))}return new Er({...e._def,shape:()=>t})}else return e instanceof Gn?Gn.create(Ou(e.element)):e instanceof yi?yi.create(Ou(e.unwrap())):e instanceof Fa?Fa.create(Ou(e.unwrap())):e instanceof vi?vi.create(e.items.map(t=>Ou(t))):e}i(Ou,"deepPartialify");var Er=class extends Bt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=P7(this._def),this.extend=P7(this._def)}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=rr.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==tt.object){let p=this._getOrReturnCtx(t);return vt(p,{code:Ke.invalid_type,expected:tt.object,received:p.parsedType}),Dt}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof Hi&&this._def.unknownKeys==="strip"))for(let p in a.data)c.includes(p)||l.push(p);let h=[];for(let p of c){let g=s[p],v=a.data[p];h.push({key:{status:"valid",value:p},value:g._parse(new gi(a,v,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof Hi){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of l)h.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(p==="strict")l.length>0&&(vt(a,{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 g of l){let v=a.data[g];h.push({key:{status:"valid",value:g},value:p._parse(new gi(a,v,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of h){let v=await g.key;p.push({key:v,value:await g.value,alwaysSet:g.alwaysSet})}return p}).then(p=>en.mergeObjectSync(n,p)):en.mergeObjectSync(n,h)}get shape(){return this._def.shape()}strict(t){return Wt.errToObj,new Er({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let h=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Wt.errToObj(t).message)!==null&&l!==void 0?l:h}:{message:h}}}:{}})}strip(){return new Er({...this._def,unknownKeys:"strip"})}passthrough(){return new Er({...this._def,unknownKeys:"passthrough"})}setKey(t,r){return this.augment({[t]:r})}merge(t){return new Er({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>d0.mergeShapes(this._def.shape(),t._def.shape()),typeName:xt.ZodObject})}catchall(t){return new Er({...this._def,catchall:t})}pick(t){let r={};return rr.objectKeys(t).map(n=>{this.shape[n]&&(r[n]=this.shape[n])}),new Er({...this._def,shape:()=>r})}omit(t){let r={};return rr.objectKeys(this.shape).map(n=>{rr.objectKeys(t).indexOf(n)===-1&&(r[n]=this.shape[n])}),new Er({...this._def,shape:()=>r})}deepPartial(){return Ou(this)}partial(t){let r={};if(t)return rr.objectKeys(this.shape).map(n=>{rr.objectKeys(t).indexOf(n)===-1?r[n]=this.shape[n]:r[n]=this.shape[n].optional()}),new Er({...this._def,shape:()=>r});for(let n in this.shape){let a=this.shape[n];r[n]=a.optional()}return new Er({...this._def,shape:()=>r})}required(t){let r={};if(t)rr.objectKeys(this.shape).map(n=>{if(rr.objectKeys(t).indexOf(n)===-1)r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yi;)s=s._def.innerType;r[n]=s}});else for(let n in this.shape){let s=this.shape[n];for(;s instanceof yi;)s=s._def.innerType;r[n]=s}return new Er({...this._def,shape:()=>r})}keyof(){return F7(rr.objectKeys(this.shape))}};i(Er,"ZodObject");Er.create=(e,t)=>new Er({shape:()=>e,unknownKeys:"strip",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});Er.strictCreate=(e,t)=>new Er({shape:()=>e,unknownKeys:"strict",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});Er.lazycreate=(e,t)=>new Er({shape:e,unknownKeys:"strip",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});var rs=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new $i(l.ctx.common.issues));return vt(r,{code:Ke.invalid_union,unionErrors:c}),Dt}if(i(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let h of n){let p={...r,common:{...r.common,issues:[]},parent:null},g=h._parseSync({data:r.data,path:r.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(h=>new $i(h));return vt(r,{code:Ke.invalid_union,unionErrors:l}),Dt}}get options(){return this._def.options}};i(rs,"ZodUnion");rs.create=(e,t)=>new rs({options:e,typeName:xt.ZodUnion,...Vt(t)});var s0=i(e=>e instanceof as?s0(e.schema):e instanceof Wn?s0(e.innerType()):e instanceof os?[e.value]:e instanceof ss?e.options:e instanceof cs?Object.keys(e.enum):e instanceof us?s0(e._def.innerType):e instanceof es?[void 0]:e instanceof ts?[null]:null,"getDiscriminator"),uc=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.object)return vt(r,{code:Ke.invalid_type,expected:tt.object,received:r.parsedType}),Dt;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(vt(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 a=new Map;for(let s of r){let c=s0(s.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(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new uc({typeName:xt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...Vt(n)})}};i(uc,"ZodDiscriminatedUnion");function Ny(e,t){let r=Yo(e),n=Yo(t);if(e===t)return{valid:!0,data:e};if(r===tt.object&&n===tt.object){let a=rr.objectKeys(t),s=rr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let h=Ny(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 a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],h=Ny(c,l);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return r===tt.date&&n===tt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Ny,"mergeValues");var ns=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=i((s,c)=>{if(Ry(s)||Ry(c))return Dt;let l=Ny(s.value,c.value);return l.valid?((Oy(s)||Oy(c))&&r.dirty(),{status:r.value,value:l.data}):(vt(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(([s,c])=>a(s,c)):a(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(ns,"ZodIntersection");ns.create=(e,t,r)=>new ns({left:e,right:t,typeName:xt.ZodIntersection,...Vt(r)});var vi=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.array)return vt(n,{code:Ke.invalid_type,expected:tt.array,received:n.parsedType}),Dt;if(n.data.length<this._def.items.length)return vt(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&&(vt(n,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=n.data.map((c,l)=>{let h=this._def.items[l]||this._def.rest;return h?h._parse(new gi(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>en.mergeArray(r,c)):en.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new vi({...this._def,rest:t})}};i(vi,"ZodTuple");vi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vi({items:e,typeName:xt.ZodTuple,rest:null,...Vt(t)})};var is=class extends Bt{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!==tt.object)return vt(n,{code:Ke.invalid_type,expected:tt.object,received:n.parsedType}),Dt;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new gi(n,l,n.path,l)),value:c._parse(new gi(n,n.data[l],n.path,l))});return n.common.async?en.mergeObjectAsync(r,a):en.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Bt?new is({keyType:t,valueType:r,typeName:xt.ZodRecord,...Vt(n)}):new is({keyType:zi.create(),valueType:t,typeName:xt.ZodRecord,...Vt(r)})}};i(is,"ZodRecord");var lc=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.map)return vt(n,{code:Ke.invalid_type,expected:tt.map,received:n.parsedType}),Dt;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,h],p)=>({key:a._parse(new gi(n,l,n.path,[p,"key"])),value:s._parse(new gi(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,g=await h.value;if(p.status==="aborted"||g.status==="aborted")return Dt;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let h of c){let p=h.key,g=h.value;if(p.status==="aborted"||g.status==="aborted")return Dt;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}}}};i(lc,"ZodMap");lc.create=(e,t,r)=>new lc({valueType:t,keyType:e,typeName:xt.ZodMap,...Vt(r)});var Ua=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.set)return vt(n,{code:Ke.invalid_type,expected:tt.set,received:n.parsedType}),Dt;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(vt(n,{code:Ke.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(vt(n,{code:Ke.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(h){let p=new Set;for(let g of h){if(g.status==="aborted")return Dt;g.status==="dirty"&&r.dirty(),p.add(g.value)}return{status:r.value,value:p}}i(c,"finalizeSet");let l=[...n.data.values()].map((h,p)=>s._parse(new gi(n,h,n.path,p)));return n.common.async?Promise.all(l).then(h=>c(h)):c(l)}min(t,r){return new Ua({...this._def,minSize:{value:t,message:Wt.toString(r)}})}max(t,r){return new Ua({...this._def,maxSize:{value:t,message:Wt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};i(Ua,"ZodSet");Ua.create=(e,t)=>new Ua({valueType:e,minSize:null,maxSize:null,typeName:xt.ZodSet,...Vt(t)});var bo=class extends Bt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.function)return vt(r,{code:Ke.invalid_type,expected:tt.function,received:r.parsedType}),Dt;function n(l,h){return u0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c0(),Ff].filter(p=>!!p),issueData:{code:Ke.invalid_arguments,argumentsError:h}})}i(n,"makeArgsIssue");function a(l,h){return u0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c0(),Ff].filter(p=>!!p),issueData:{code:Ke.invalid_return_type,returnTypeError:h}})}i(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof wo?Sn(async(...l)=>{let h=new $i([]),p=await this._def.args.parseAsync(l,s).catch(y=>{throw h.addIssue(n(l,y)),h}),g=await c(...p);return await this._def.returns._def.type.parseAsync(g,s).catch(y=>{throw h.addIssue(a(g,y)),h})}):Sn((...l)=>{let h=this._def.args.safeParse(l,s);if(!h.success)throw new $i([n(l,h.error)]);let p=c(...h.data),g=this._def.returns.safeParse(p,s);if(!g.success)throw new $i([a(p,g.error)]);return g.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new bo({...this._def,args:vi.create(t).rest(La.create())})}returns(t){return new bo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new bo({args:t||vi.create([]).rest(La.create()),returns:r||La.create(),typeName:xt.ZodFunction,...Vt(n)})}};i(bo,"ZodFunction");var as=class extends Bt{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(as,"ZodLazy");as.create=(e,t)=>new as({getter:e,typeName:xt.ZodLazy,...Vt(t)});var os=class extends Bt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return vt(r,{code:Ke.invalid_literal,expected:this._def.value}),Dt}return{status:"valid",value:t.data}}get value(){return this._def.value}};i(os,"ZodLiteral");os.create=(e,t)=>new os({value:e,typeName:xt.ZodLiteral,...Vt(t)});function F7(e,t){return new ss({values:e,typeName:xt.ZodEnum,...Vt(t)})}i(F7,"createZodEnum");var ss=class extends Bt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return vt(r,{expected:rr.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 vt(r,{received:r.data,code:Ke.invalid_enum_value,options:n}),Dt}return Sn(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}};i(ss,"ZodEnum");ss.create=F7;var cs=class extends Bt{_parse(t){let r=rr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==tt.string&&n.parsedType!==tt.number){let a=rr.objectValues(r);return vt(n,{expected:rr.joinValues(a),received:n.parsedType,code:Ke.invalid_type}),Dt}if(r.indexOf(t.data)===-1){let a=rr.objectValues(r);return vt(n,{received:n.data,code:Ke.invalid_enum_value,options:a}),Dt}return Sn(t.data)}get enum(){return this._def.values}};i(cs,"ZodNativeEnum");cs.create=(e,t)=>new cs({values:e,typeName:xt.ZodNativeEnum,...Vt(t)});var wo=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.promise&&r.common.async===!1)return vt(r,{code:Ke.invalid_type,expected:tt.promise,received:r.parsedType}),Dt;let n=r.parsedType===tt.promise?r.data:Promise.resolve(r.data);return Sn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};i(wo,"ZodPromise");wo.create=(e,t)=>new wo({type:e,typeName:xt.ZodPromise,...Vt(t)});var Wn=class extends Bt{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),a=this._def.effect||null;if(a.type==="preprocess"){let c=a.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 s={addIssue:c=>{vt(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="refinement"){let c=i(l=>{let h=a.refinement(l,s);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(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!l0(c))return c;let l=a.transform(c.value,s);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=>l0(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);rr.assertNever(a)}};i(Wn,"ZodEffects");Wn.create=(e,t,r)=>new Wn({schema:e,typeName:xt.ZodEffects,effect:t,...Vt(r)});Wn.createWithPreprocess=(e,t,r)=>new Wn({schema:t,effect:{type:"preprocess",transform:e},typeName:xt.ZodEffects,...Vt(r)});var yi=class extends Bt{_parse(t){return this._getType(t)===tt.undefined?Sn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(yi,"ZodOptional");yi.create=(e,t)=>new yi({innerType:e,typeName:xt.ZodOptional,...Vt(t)});var Fa=class extends Bt{_parse(t){return this._getType(t)===tt.null?Sn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(Fa,"ZodNullable");Fa.create=(e,t)=>new Fa({innerType:e,typeName:xt.ZodNullable,...Vt(t)});var us=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===tt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i(us,"ZodDefault");us.create=(e,t)=>new us({innerType:e,typeName:xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vt(t)});var fc=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.innerType._parse({data:r.data,path:r.path,parent:r});return f0(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};i(fc,"ZodCatch");fc.create=(e,t)=>new fc({innerType:e,typeName:xt.ZodCatch,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vt(t)});var dc=class extends Bt{_parse(t){if(this._getType(t)!==tt.nan){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.nan,received:n.parsedType}),Dt}return{status:"valid",value:t.data}}};i(dc,"ZodNaN");dc.create=e=>new dc({typeName:xt.ZodNaN,...Vt(e)});var NU=Symbol("zod_brand"),Uf=class extends Bt{_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(Uf,"ZodBranded");var ls=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return i(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Dt:s.status==="dirty"?(r.dirty(),U7(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Dt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ls({in:t,out:r,typeName:xt.ZodPipeline})}};i(ls,"ZodPipeline");var j7=i((e,t={},r)=>e?yo.create().superRefine((n,a)=>{if(!e(n)){let s=typeof t=="function"?t(n):t,c=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...c,fatal:r})}}):yo.create(),"custom"),PU={object:Er.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 BU=i((e,t={message:`Input not instance of ${e.name}`})=>j7(r=>r instanceof e,t,!0),"instanceOfType"),$7=zi.create,z7=oa.create,LU=dc.create,UU=Xo.create,H7=Qo.create,FU=Ba.create,jU=sc.create,$U=es.create,zU=ts.create,HU=yo.create,qU=La.create,VU=Hi.create,KU=cc.create,GU=Gn.create,WU=Er.create,JU=Er.strictCreate,ZU=rs.create,YU=uc.create,XU=ns.create,QU=vi.create,eF=is.create,tF=lc.create,rF=Ua.create,nF=bo.create,iF=as.create,aF=os.create,oF=ss.create,sF=cs.create,cF=wo.create,B7=Wn.create,uF=yi.create,lF=Fa.create,fF=Wn.createWithPreprocess,dF=ls.create,hF=i(()=>$7().optional(),"ostring"),pF=i(()=>z7().optional(),"onumber"),mF=i(()=>H7().optional(),"oboolean"),gF={string:e=>zi.create({...e,coerce:!0}),number:e=>oa.create({...e,coerce:!0}),boolean:e=>Qo.create({...e,coerce:!0}),bigint:e=>Xo.create({...e,coerce:!0}),date:e=>Ba.create({...e,coerce:!0})},vF=Dt,z=Object.freeze({__proto__:null,defaultErrorMap:Ff,setErrorMap:CU,getErrorMap:c0,makeIssue:u0,EMPTY_PATH:MU,addIssueToContext:vt,ParseStatus:en,INVALID:Dt,DIRTY:U7,OK:Sn,isAborted:Ry,isDirty:Oy,isValid:l0,isAsync:f0,get util(){return rr},ZodParsedType:tt,getParsedType:Yo,ZodType:Bt,ZodString:zi,ZodNumber:oa,ZodBigInt:Xo,ZodBoolean:Qo,ZodDate:Ba,ZodSymbol:sc,ZodUndefined:es,ZodNull:ts,ZodAny:yo,ZodUnknown:La,ZodNever:Hi,ZodVoid:cc,ZodArray:Gn,get objectUtil(){return d0},ZodObject:Er,ZodUnion:rs,ZodDiscriminatedUnion:uc,ZodIntersection:ns,ZodTuple:vi,ZodRecord:is,ZodMap:lc,ZodSet:Ua,ZodFunction:bo,ZodLazy:as,ZodLiteral:os,ZodEnum:ss,ZodNativeEnum:cs,ZodPromise:wo,ZodEffects:Wn,ZodTransformer:Wn,ZodOptional:yi,ZodNullable:Fa,ZodDefault:us,ZodCatch:fc,ZodNaN:dc,BRAND:NU,ZodBranded:Uf,ZodPipeline:ls,custom:j7,Schema:Bt,ZodSchema:Bt,late:PU,get ZodFirstPartyTypeKind(){return xt},coerce:gF,any:HU,array:GU,bigint:UU,boolean:H7,date:FU,discriminatedUnion:YU,effect:B7,enum:oF,function:nF,instanceof:BU,intersection:XU,lazy:iF,literal:aF,map:tF,nan:LU,nativeEnum:sF,never:VU,null:zU,nullable:lF,number:z7,object:WU,oboolean:mF,onumber:pF,optional:uF,ostring:hF,pipeline:dF,preprocess:fF,promise:cF,record:eF,set:rF,strictObject:JU,string:$7,symbol:jU,transformer:B7,tuple:QU,undefined:$U,union:ZU,unknown:qU,void:KU,NEVER:vF,ZodIssueCode:Ke,quotelessJson:TU,ZodError:$i});var yF=Object.defineProperty,bF=i((e,t)=>yF(e,"name",{value:t,configurable:!0}),"__name"),g0=z.array(z.string().or(z.record(z.any()))),jZ=z.object({type:z.string().optional(),narrative:z.string().optional()}),v0=z.string().or(z.object({id:z.string(),type:z.string(),caption:z.string().optional()})),wF=z.object({type:z.string().min(1).or(z.string().array().nonempty()),latitude:z.number(),longitude:z.number()}),_F=z.object({type:z.string().min(1).or(z.string().array().nonempty()),addressCountry:z.string().optional(),addressCountryCode:z.string().optional(),addressRegion:z.string().optional(),addressLocality:z.string().optional(),streetAddress:z.string().optional(),postOfficeBoxNumber:z.string().optional(),postalCode:z.string().optional(),geo:wF.optional()}),EF=z.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(z.string()),Y7=z.object({type:z.string().min(1).or(z.string().array().nonempty()),identifier:z.string(),identifierType:EF}),jf=z.string().or(z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty().optional()),name:z.string().optional(),url:z.string().optional(),phone:z.string().optional(),description:z.string().optional(),endorsement:z.any().array().optional(),image:v0.optional(),email:z.string().email().optional(),address:_F.optional(),otherIdentifier:Y7.array().optional(),official:z.string().optional(),parentOrg:z.any().optional(),familyName:z.string().optional(),givenName:z.string().optional(),additionalName:z.string().optional(),patronymicName:z.string().optional(),honorificPrefix:z.string().optional(),honorificSuffix:z.string().optional(),familyNamePrefix:z.string().optional(),dateOfBirth:z.string().optional()}).catchall(z.any())),Py=z.object({id:z.string().optional()}).catchall(z.any()),h0=z.object({type:z.string(),id:z.string()}).catchall(z.any()),q7=z.object({id:z.string(),type:z.string()}).catchall(z.any()),V7=z.object({id:z.string().optional(),type:z.string()}).catchall(z.any()),K7=z.object({type:z.string(),id:z.string().optional()}).catchall(z.any()),G7=z.object({type:z.string().or(z.string().array().nonempty()),id:z.string().optional()}).catchall(z.any()),p0=z.object({"@context":g0,id:z.string().optional(),type:z.string().array().nonempty(),issuer:jf,credentialSubject:Py.or(Py.array()),refreshService:V7.or(V7.array()).optional(),credentialSchema:q7.or(q7.array()).optional(),issuanceDate:z.string().optional(),expirationDate:z.string().optional(),credentialStatus:h0.or(h0.array()).optional(),name:z.string().optional(),description:z.string().optional(),validFrom:z.string().optional(),validUntil:z.string().optional(),status:h0.or(h0.array()).optional(),termsOfUse:K7.or(K7.array()).optional(),evidence:G7.or(G7.array()).optional()}).catchall(z.any()),ja=z.object({type:z.string(),created:z.string(),challenge:z.string().optional(),domain:z.string().optional(),nonce:z.string().optional(),proofPurpose:z.string(),verificationMethod:z.string(),jws:z.string().optional()}).catchall(z.any()),m0=p0.extend({proof:ja.or(ja.array())}),AF=z.object({"@context":g0,id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),verifiableCredential:m0.or(m0.array()).optional(),holder:z.string().optional()}).catchall(z.any()),$Z=AF.extend({proof:ja.or(ja.array())}),Uy=z.object({kty:z.string(),crv:z.string(),x:z.string(),y:z.string().optional(),n:z.string().optional(),d:z.string().optional()}),qZ=Uy.omit({d:!0}).extend({d:z.string()}),SF=z.object({alg:z.string(),iv:z.string(),tag:z.string(),epk:Uy.partial().optional(),kid:z.string().optional(),apv:z.string().optional(),apu:z.string().optional()}),xF=z.object({header:SF,encrypted_key:z.string()}),TF=z.object({protected:z.string(),iv:z.string(),ciphertext:z.string(),tag:z.string(),aad:z.string().optional(),recipients:xF.array().optional()}),hc=z.string().or(z.object({"@context":g0.optional(),id:z.string(),type:z.string(),controller:z.string(),publicKeyJwk:Uy.optional(),publicKeyBase58:z.string().optional(),blockChainAccountId:z.string().optional()}).catchall(z.any())),CF=z.object({id:z.string(),type:z.string().or(z.string().array().nonempty()),serviceEndpoint:z.any().or(z.any().array().nonempty())}).catchall(z.any()),VZ=z.object({"@context":g0,id:z.string(),alsoKnownAs:z.string().optional(),controller:z.string().or(z.string().array().nonempty()).optional(),verificationMethod:hc.array().optional(),authentication:hc.array().optional(),assertionMethod:hc.array().optional(),keyAgreement:hc.array().optional(),capabilityInvocation:hc.array().optional(),capabilityDelegation:hc.array().optional(),publicKey:hc.array().optional(),service:CF.array().optional(),proof:ja.or(ja.array()).optional()}).catchall(z.any()),MF=z.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(z.string()),y0=z.object({type:z.string().array().nonempty(),targetCode:z.string().optional(),targetDescription:z.string().optional(),targetName:z.string(),targetFramework:z.string().optional(),targetType:MF.optional(),targetUrl:z.string()}),IF=z.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"]),kF=IF.or(z.string()),DF=z.object({id:z.string().optional(),narrative:z.string().optional()}).catchall(z.any()),RF=z.object({id:z.string(),type:z.string().array().nonempty(),endorsementComment:z.string().optional()}),OF=p0.extend({credentialSubject:RF,proof:ja.or(ja.array()).optional()}),NF=z.object({id:z.string(),"@language":z.string().optional(),version:z.string().optional()}),PF=z.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(z.string()),BF=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:y0.array().optional(),description:z.string().optional(),level:z.string().optional(),name:z.string(),points:z.string().optional()}).catchall(z.any()),LF=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:y0.array().optional(),allowedValue:z.string().array().optional(),name:z.string(),requiredLevel:z.string().optional(),requiredValue:z.string().optional(),resultType:PF,rubricCriterionLevel:BF.array().optional(),valueMax:z.string().optional(),valueMin:z.string().optional()}).catchall(z.any()),UF=z.object({id:z.string().optional(),type:z.string().array().nonempty(),alignment:y0.array().optional(),achievementType:kF.optional(),creator:jf.optional(),creditsAvailable:z.number().optional(),criteria:DF,description:z.string(),endorsement:OF.array().optional(),fieldOfStudy:z.string().optional(),humanCode:z.string().optional(),image:v0.optional(),"@language":z.string().optional(),name:z.string(),otherIdentifier:Y7.array().optional(),related:NF.array().optional(),resultDescription:LF.array().optional(),specialization:z.string().optional(),tag:z.string().array().optional(),version:z.string().optional()}).catchall(z.any()),FF=z.object({type:z.string(),hashed:z.boolean(),identityHash:z.string(),identityType:z.string(),salt:z.string().optional()}),jF=z.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),$F=z.object({type:z.string().array().nonempty(),achievedLevel:z.string().optional(),alignment:y0.array().optional(),resultDescription:z.string().optional(),status:jF.optional(),value:z.string().optional()}).catchall(z.any()),W7=z.object({id:z.string().optional(),type:z.string().array().nonempty(),activityEndDate:z.string().optional(),activityStartDate:z.string().optional(),creditsEarned:z.number().optional(),achievement:UF.optional(),identifier:FF.array().optional(),image:v0.optional(),licenseNumber:z.string().optional(),narrative:z.string().optional(),result:$F.array().optional(),role:z.string().optional(),source:jf.optional(),term:z.string().optional()}).catchall(z.any()),zF=z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),narrative:z.string().optional(),name:z.string().optional(),description:z.string().optional(),genre:z.string().optional(),audience:z.string().optional()}).catchall(z.any()),HF=p0.extend({name:z.string().optional(),description:z.string().optional(),image:v0.optional(),credentialSubject:W7.or(W7.array()),endorsement:p0.array().optional(),evidence:zF.array().optional()}),GZ=HF.extend({proof:ja.or(ja.array())}),JZ=z.object({checks:z.string().array(),warnings:z.string().array(),errors:z.string().array()}),X7=z.enum(["Success","Failed","Error"]),ZZ=X7.enum,YZ=z.object({check:z.string(),status:X7,message:z.string().optional(),details:z.string().optional()}),XZ=z.object({title:z.string().optional(),createdAt:z.string().optional(),issuer:jf.optional(),issuee:jf.optional(),credentialSubject:Py.optional()}),mc=z.object({id:z.string(),uri:z.string()}).catchall(z.any()),tY=z.object({limit:z.number(),cursor:z.string().optional(),sort:z.string().optional()}),Jn=z.object({cursor:z.string().optional(),hasMore:z.boolean()}),Q7=z.object({encryptedRecord:TF,fields:z.string().array()}).catchall(z.any()),rY=Jn.extend({records:Q7.array()}),qF=Q7.extend({id:z.string()}),nY=Jn.extend({records:qF.array()}),J7=bF(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),VF=z.instanceof(RegExp).or(z.string().refine(e=>{try{return J7(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=J7(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),pr=z.string().or(z.object({$in:z.string().array()})).or(z.object({$regex:VF})),KF=z.object({backgroundColor:z.string().optional(),backgroundImage:z.string().optional(),fadeBackgroundImage:z.boolean().optional(),repeatBackgroundImage:z.boolean().optional(),fontColor:z.string().optional(),accentColor:z.string().optional(),accentFontColor:z.string().optional(),idBackgroundImage:z.string().optional(),fadeIdBackgroundImage:z.boolean().optional(),idBackgroundColor:z.string().optional(),repeatIdBackgroundImage:z.boolean().optional()}),pc=z.object({profileId:z.string().min(3).max(40),displayName:z.string().default(""),shortBio:z.string().default(""),bio:z.string().default(""),did:z.string(),isPrivate:z.boolean().optional(),email:z.string().optional(),image:z.string().optional(),heroImage:z.string().optional(),websiteLink:z.string().optional(),isServiceProfile:z.boolean().default(!1).optional(),type:z.string().optional(),notificationsWebhook:z.string().url().startsWith("http").optional(),display:KF.optional()}),oY=z.object({profileId:pr,displayName:pr,shortBio:pr,bio:pr,email:pr,websiteLink:pr,isServiceProfile:z.boolean(),type:pr}).partial(),sY=Jn.extend({records:pc.array()}),cY=z.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),eA=z.object({id:z.string(),created:z.string(),displayName:z.string().default("").optional(),shortBio:z.string().default("").optional(),bio:z.string().default("").optional(),email:z.string().optional(),image:z.string().optional(),heroImage:z.string().optional()}),uY=Jn.extend({records:eA.extend({did:z.string()}).array()}),lY=z.object({id:pr,displayName:pr,shortBio:pr,bio:pr,email:pr}).partial(),fY=Jn.extend({records:z.object({profile:pc,manager:eA.extend({did:z.string()}).optional()}).array()}),dY=z.object({uri:z.string(),to:z.string(),from:z.string(),sent:z.string().datetime(),received:z.string().datetime().optional()}),tA=z.object({role:z.string(),canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:z.string(),canCreateChildren:z.string(),canEditChildren:z.string(),canRevokeChildren:z.string(),canManageChildrenPermissions:z.string(),canManageChildrenProfiles:z.boolean().default(!1).optional(),canViewAnalytics:z.boolean()}),GF=z.object({role:pr,canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:pr,canCreateChildren:pr,canEditChildren:pr,canRevokeChildren:pr,canManageChildrenPermissions:pr,canManageChildrenProfiles:z.boolean(),canViewAnalytics:z.boolean()}).partial(),Z7=z.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),WF=z.discriminatedUnion("type",[z.object({type:z.literal(Z7.Values.GRANT_PERMISSIONS),data:z.object({claimUri:z.string(),targetUri:z.string(),permissions:tA.partial()})}),z.object({type:z.literal(Z7.Values.ADD_ADMIN),data:z.object({claimUri:z.string(),targetUri:z.string()})})]),hY=z.object({type:pr,data:z.object({claimUri:pr,targetUri:pr,permissions:GF})}).deepPartial(),JF=z.object({id:z.string(),createdAt:z.string(),updatedAt:z.string()}).and(WF),pY=Jn.extend({records:JF.array()}),By=z.enum(["DRAFT","LIVE"]),ZF=z.object({uri:z.string(),name:z.string().optional(),type:z.string().optional(),category:z.string().optional(),status:By.optional(),autoConnectRecipients:z.boolean().optional(),meta:z.record(z.any()).optional(),claimPermissions:tA.optional()}),mY=z.object({uri:pr,name:pr,type:pr,category:pr,meta:z.record(pr),status:By.or(z.object({$in:By.array()})),autoConnectRecipients:z.boolean()}).partial(),gY=Jn.extend({records:ZF.array()}),YF=z.object({to:pc,from:z.string(),received:z.string().optional(),uri:z.string().optional()}),vY=Jn.extend({records:YF.array()}),yY=z.object({endpoint:z.string(),name:z.string(),did:z.string().optional()}),bY=z.object({ttlSeconds:z.number().optional(),totalUses:z.number().optional()}),XF=z.object({endpoint:z.string()}),wY=z.object({signingAuthority:XF,relationship:z.object({name:z.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:z.string()})}),_Y=z.object({boostUri:z.string(),signingAuthority:z.object({endpoint:z.string(),name:z.string()})}),QF=z.enum(["live","stale","withdrawn"]),ej=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({})}),rA=z.object({contract:ej,owner:pc,name:z.string(),subtitle:z.string().optional(),description:z.string().optional(),reasonForAccessing:z.string().optional(),image:z.string().optional(),uri:z.string(),needsGuardianConsent:z.boolean().optional(),redirectUrl:z.string().optional(),frontDoorBoostUri:z.string().optional(),createdAt:z.string(),updatedAt:z.string(),expiresAt:z.string().optional(),autoBoosts:z.string().array().optional()}),EY=Jn.extend({records:rA.omit({owner:!0}).array()}),tj=z.object({credentials:z.object({categories:z.record(z.string().array()).default({})}),personal:z.record(z.string()).default({}),date:z.string()}),AY=Jn.extend({records:tj.array()}),rj=z.object({credentials:z.object({category:z.string(),uri:z.string()}).array(),personal:z.record(z.string()).default({}),date:z.string(),contractUri:z.string()}),SY=Jn.extend({records:rj.array()}),nA=z.object({sharing:z.boolean().optional(),shared:z.string().array().optional(),shareAll:z.boolean().optional(),shareUntil:z.string().optional()}),iA=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(nA).default({})}).default({}),personal:z.record(z.string()).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.boolean()).default({})}).default({}),personal:z.record(z.boolean()).default({})}).default({})}),xY=Jn.extend({records:z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:iA,contract:rA,uri:z.string(),consenter:pc,status:QF}).array()}),TY=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional()}),CY=z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}),MY=z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional(),id:pr.optional()}),nj=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(nA.optional()).optional()}).optional(),personal:z.record(z.string()).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}).optional()}),Ly=z.enum(["consent","update","sync","withdraw","write"]),IY=z.object({terms:nj.optional(),action:Ly.or(Ly.array()).optional(),date:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),expiresAt:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),oneTime:z.boolean().optional()}),aA=z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:iA.optional(),id:z.string(),action:Ly,date:z.string(),uris:z.string().array().optional()}),kY=Jn.extend({records:aA.array()}),ij=z.object({credentialUri:z.string(),termsUri:z.string(),contractUri:z.string(),boostUri:z.string(),category:z.string().optional(),date:z.string()}),DY=Jn.extend({records:ij.array()}),aj=z.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),oj=z.object({title:z.string().optional(),body:z.string().optional()}),sj=z.object({vcUris:z.array(z.string()).optional(),vpUris:z.array(z.string()).optional(),transaction:aA.optional()}),RY=z.object({type:aj,to:pc.partial().and(z.object({did:z.string()})),from:pc.partial().and(z.object({did:z.string()})),message:oj.optional(),data:sj.optional(),sent:z.string().datetime().optional()}),cj="auth-grant:",OY=z.object({id:z.string(),name:z.string(),description:z.string().optional(),challenge:z.string().startsWith(cj).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:z.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:z.string(),createdAt:z.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:z.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),NY=z.object({id:z.string()}).catchall(z.any()),uj=z.enum(["active","revoked"]),PY=z.object({id:pr,name:pr,description:pr,status:uj}).partial();var lj=Object.create,bd=Object.defineProperty,fj=Object.getOwnPropertyDescriptor,f6=Object.getOwnPropertyNames,dj=Object.getPrototypeOf,hj=Object.prototype.hasOwnProperty,o=i((e,t)=>bd(e,"name",{value:t,configurable:!0}),"__name"),db=(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')}),gr=i((e,t)=>i(function(){return e&&(t=(0,e[f6(e)[0]])(e=0)),t},"__init"),"__esm"),ze=i((e,t)=>i(function(){return t||(0,e[f6(e)[0]])((t={exports:{}}).exports,t),t.exports},"__require2"),"__commonJS"),xr=i((e,t)=>{for(var r in t)bd(e,r,{get:t[r],enumerable:!0})},"__export"),MS=i((e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f6(t))!hj.call(e,a)&&a!==r&&bd(e,a,{get:()=>t[a],enumerable:!(n=fj(t,a))||n.enumerable});return e},"__copyProps"),ir=i((e,t,r)=>(r=e!=null?lj(dj(e)):{},MS(t||!e||!e.__esModule?bd(r,"default",{value:e,enumerable:!0}):r,e)),"__toESM"),Fy=i(e=>MS(bd({},"__esModule",{value:!0}),e),"__toCommonJS"),pj=ze({"../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(e,t){(function(){var r,n="4.17.21",a=200,s="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,g="__lodash_placeholder__",v=1,y=2,_=4,x=1,O=2,D=1,P=2,J=4,j=8,q=16,Q=32,Y=64,k=128,K=256,he=512,me=30,we="...",Z=800,w=16,T=1,b=2,f=3,m=1/0,E=9007199254740991,R=17976931348623157e292,C=0/0,A=4294967295,B=A-1,V=A>>>1,I=[["ary",k],["bind",D],["bindKey",P],["curry",j],["curryRight",q],["flip",he],["partial",Q],["partialRight",Y],["rearg",K]],U="[object Arguments]",ge="[object Array]",L="[object AsyncFunction]",ne="[object Boolean]",oe="[object Date]",M="[object DOMException]",G="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",be="[object Map]",Re="[object Number]",X="[object Null]",N="[object Object]",F="[object Promise]",W="[object Proxy]",ie="[object RegExp]",ee="[object Set]",ue="[object String]",Ae="[object Symbol]",De="[object Undefined]",Ie="[object WeakMap]",Be="[object WeakSet]",qe="[object ArrayBuffer]",ve="[object DataView]",pe="[object Float32Array]",re="[object Float64Array]",le="[object Int8Array]",_e="[object Int16Array]",Te="[object Int32Array]",Ce="[object Uint8Array]",Oe="[object Uint8ClampedArray]",Ct="[object Uint16Array]",Ve="[object Uint32Array]",He=/\b__p \+= '';/g,Ot=/\b(__p \+=) '' \+/g,dt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,Or=/[&<>"']/g,ct=RegExp(mt.source),ut=RegExp(Or.source),lr=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,nt=/<%=([\s\S]+?)%>/g,or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,it=/^\w*$/,Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qt=/[\\^$.*+?()[\]{}|]/g,at=RegExp(Qt.source),et=/^\s+/,sr=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ze=/\{\n\/\* \[wrapped with (.+)\] \*/,cr=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Et=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,At=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,an=/^(?:0|[1-9]\d*)$/,Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vr=/($^)/,on=/['\n\r\u2028\u2029\\]/g,Cn="\\ud800-\\udfff",Ci="\\u0300-\\u036f",Mi="\\ufe20-\\ufe2f",Ii="\\u20d0-\\u20ff",Ln=Ci+Mi+Ii,pn="\\u2700-\\u27bf",ri="a-z\\xdf-\\xf6\\xf8-\\xff",Un="\\xac\\xb1\\xd7\\xf7",ki="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Di="\\u2000-\\u206f",Ri=" \\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",Qa="A-Z\\xc0-\\xd6\\xd8-\\xde",eo="\\ufe0e\\ufe0f",to=Un+ki+Di+Ri,Po="['\u2019]",Pd="["+Cn+"]",_l="["+to+"]",ks="["+Ln+"]",El="\\d+",Bd="["+pn+"]",Al="["+ri+"]",Sl="[^"+Cn+to+El+pn+ri+Qa+"]",Ds="\\ud83c[\\udffb-\\udfff]",Ld="(?:"+ks+"|"+Ds+")",xl="[^"+Cn+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",no="["+Qa+"]",ba="\\u200d",Tl="(?:"+Al+"|"+Sl+")",Ud="(?:"+no+"|"+Sl+")",Cl="(?:"+Po+"(?:d|ll|m|re|s|t|ve))?",Ml="(?:"+Po+"(?:D|LL|M|RE|S|T|VE))?",Il=Ld+"?",kl="["+eo+"]?",Dl="(?:"+ba+"(?:"+[xl,ro,Zi].join("|")+")"+kl+Il+")*",wa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qc=kl+Il+Dl,jd="(?:"+[Bd,ro,Zi].join("|")+")"+qc,Rl="(?:"+[xl+ks+"?",ks,ro,Zi,Pd].join("|")+")",Ol=RegExp(Po,"g"),$d=RegExp(ks,"g"),Nl=RegExp(Ds+"(?="+Ds+")|"+Rl+qc,"g"),Pl=RegExp([no+"?"+Al+"+"+Cl+"(?="+[_l,no,"$"].join("|")+")",Ud+"+"+Ml+"(?="+[_l,no+Tl,"$"].join("|")+")",no+"?"+Tl+"+"+Cl,no+"+"+Ml,Fd,wa,El,jd].join("|"),"g"),zd=RegExp("["+ba+Cn+Ln+eo+"]"),Rs=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hd=["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"],Vc=-1,wr={};wr[pe]=wr[re]=wr[le]=wr[_e]=wr[Te]=wr[Ce]=wr[Oe]=wr[Ct]=wr[Ve]=!0,wr[U]=wr[ge]=wr[qe]=wr[ne]=wr[ve]=wr[oe]=wr[G]=wr[ae]=wr[be]=wr[Re]=wr[N]=wr[ie]=wr[ee]=wr[ue]=wr[Ie]=!1;var vr={};vr[U]=vr[ge]=vr[qe]=vr[ve]=vr[ne]=vr[oe]=vr[pe]=vr[re]=vr[le]=vr[_e]=vr[Te]=vr[be]=vr[Re]=vr[N]=vr[ie]=vr[ee]=vr[ue]=vr[Ae]=vr[Ce]=vr[Oe]=vr[Ct]=vr[Ve]=!0,vr[G]=vr[ae]=vr[Ie]=!1;var de={\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"},Me={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Le={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kr=parseFloat,sn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,mn=typeof self=="object"&&self&&self.Object===Object&&self,Fr=Mn||mn||Function("return this")(),_a=typeof e=="object"&&e&&!e.nodeType&&e,Ea=_a&&typeof t=="object"&&t&&!t.nodeType&&t,Bl=Ea&&Ea.exports===_a,Kc=Bl&&Mn.process,gn=function(){try{var Se=Ea&&Ea.require&&Ea.require("util").types;return Se||Kc&&Kc.binding&&Kc.binding("util")}catch{}}(),Os=gn&&gn.isArrayBuffer,K2=gn&&gn.isDate,G2=gn&&gn.isMap,W2=gn&&gn.isRegExp,J2=gn&&gn.isSet,Z2=gn&&gn.isTypedArray;function Fn(Se,Pe,ke){switch(ke.length){case 0:return Se.call(Pe);case 1:return Se.call(Pe,ke[0]);case 2:return Se.call(Pe,ke[0],ke[1]);case 3:return Se.call(Pe,ke[0],ke[1],ke[2])}return Se.apply(Pe,ke)}i(Fn,"apply"),o(Fn,"apply");function Y2(Se,Pe,ke,ft){for(var kt=-1,fr=Se==null?0:Se.length;++kt<fr;){var Wr=Se[kt];Pe(ft,Wr,ke(Wr),Se)}return ft}i(Y2,"arrayAggregator"),o(Y2,"arrayAggregator");function ni(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(ni,"arrayEach"),o(ni,"arrayEach");function X2(Se,Pe){for(var ke=Se==null?0:Se.length;ke--&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(X2,"arrayEachRight"),o(X2,"arrayEachRight");function a1(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft;)if(!Pe(Se[ke],ke,Se))return!1;return!0}i(a1,"arrayEvery"),o(a1,"arrayEvery");function io(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length,kt=0,fr=[];++ke<ft;){var Wr=Se[ke];Pe(Wr,ke,Se)&&(fr[kt++]=Wr)}return fr}i(io,"arrayFilter"),o(io,"arrayFilter");function Ll(Se,Pe){var ke=Se==null?0:Se.length;return!!ke&&Ns(Se,Pe,0)>-1}i(Ll,"arrayIncludes"),o(Ll,"arrayIncludes");function qd(Se,Pe,ke){for(var ft=-1,kt=Se==null?0:Se.length;++ft<kt;)if(ke(Pe,Se[ft]))return!0;return!1}i(qd,"arrayIncludesWith"),o(qd,"arrayIncludesWith");function Mr(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length,kt=Array(ft);++ke<ft;)kt[ke]=Pe(Se[ke],ke,Se);return kt}i(Mr,"arrayMap"),o(Mr,"arrayMap");function ao(Se,Pe){for(var ke=-1,ft=Pe.length,kt=Se.length;++ke<ft;)Se[kt+ke]=Pe[ke];return Se}i(ao,"arrayPush"),o(ao,"arrayPush");function Vd(Se,Pe,ke,ft){var kt=-1,fr=Se==null?0:Se.length;for(ft&&fr&&(ke=Se[++kt]);++kt<fr;)ke=Pe(ke,Se[kt],kt,Se);return ke}i(Vd,"arrayReduce"),o(Vd,"arrayReduce");function Q2(Se,Pe,ke,ft){var kt=Se==null?0:Se.length;for(ft&&kt&&(ke=Se[--kt]);kt--;)ke=Pe(ke,Se[kt],kt,Se);return ke}i(Q2,"arrayReduceRight"),o(Q2,"arrayReduceRight");function Kd(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft;)if(Pe(Se[ke],ke,Se))return!0;return!1}i(Kd,"arraySome"),o(Kd,"arraySome");var lD=Gd("length");function e3(Se){return Se.split("")}i(e3,"asciiToArray"),o(e3,"asciiToArray");function t3(Se){return Se.match(st)||[]}i(t3,"asciiWords"),o(t3,"asciiWords");function o1(Se,Pe,ke){var ft;return ke(Se,function(kt,fr,Wr){if(Pe(kt,fr,Wr))return ft=fr,!1}),ft}i(o1,"baseFindKey"),o(o1,"baseFindKey");function Ul(Se,Pe,ke,ft){for(var kt=Se.length,fr=ke+(ft?1:-1);ft?fr--:++fr<kt;)if(Pe(Se[fr],fr,Se))return fr;return-1}i(Ul,"baseFindIndex"),o(Ul,"baseFindIndex");function Ns(Se,Pe,ke){return Pe===Pe?f3(Se,Pe,ke):Ul(Se,s1,ke)}i(Ns,"baseIndexOf"),o(Ns,"baseIndexOf");function r3(Se,Pe,ke,ft){for(var kt=ke-1,fr=Se.length;++kt<fr;)if(ft(Se[kt],Pe))return kt;return-1}i(r3,"baseIndexOfWith"),o(r3,"baseIndexOfWith");function s1(Se){return Se!==Se}i(s1,"baseIsNaN"),o(s1,"baseIsNaN");function c1(Se,Pe){var ke=Se==null?0:Se.length;return ke?Jd(Se,Pe)/ke:C}i(c1,"baseMean"),o(c1,"baseMean");function Gd(Se){return function(Pe){return Pe==null?r:Pe[Se]}}i(Gd,"baseProperty"),o(Gd,"baseProperty");function Wd(Se){return function(Pe){return Se==null?r:Se[Pe]}}i(Wd,"basePropertyOf"),o(Wd,"basePropertyOf");function u1(Se,Pe,ke,ft,kt){return kt(Se,function(fr,Wr,_r){ke=ft?(ft=!1,fr):Pe(ke,fr,Wr,_r)}),ke}i(u1,"baseReduce"),o(u1,"baseReduce");function n3(Se,Pe){var ke=Se.length;for(Se.sort(Pe);ke--;)Se[ke]=Se[ke].value;return Se}i(n3,"baseSortBy"),o(n3,"baseSortBy");function Jd(Se,Pe){for(var ke,ft=-1,kt=Se.length;++ft<kt;){var fr=Pe(Se[ft]);fr!==r&&(ke=ke===r?fr:ke+fr)}return ke}i(Jd,"baseSum"),o(Jd,"baseSum");function Zd(Se,Pe){for(var ke=-1,ft=Array(Se);++ke<Se;)ft[ke]=Pe(ke);return ft}i(Zd,"baseTimes"),o(Zd,"baseTimes");function i3(Se,Pe){return Mr(Pe,function(ke){return[ke,Se[ke]]})}i(i3,"baseToPairs"),o(i3,"baseToPairs");function l1(Se){return Se&&Se.slice(0,p1(Se)+1).replace(et,"")}i(l1,"baseTrim"),o(l1,"baseTrim");function jn(Se){return function(Pe){return Se(Pe)}}i(jn,"baseUnary"),o(jn,"baseUnary");function Yd(Se,Pe){return Mr(Pe,function(ke){return Se[ke]})}i(Yd,"baseValues"),o(Yd,"baseValues");function Gc(Se,Pe){return Se.has(Pe)}i(Gc,"cacheHas"),o(Gc,"cacheHas");function f1(Se,Pe){for(var ke=-1,ft=Se.length;++ke<ft&&Ns(Pe,Se[ke],0)>-1;);return ke}i(f1,"charsStartIndex"),o(f1,"charsStartIndex");function d1(Se,Pe){for(var ke=Se.length;ke--&&Ns(Pe,Se[ke],0)>-1;);return ke}i(d1,"charsEndIndex"),o(d1,"charsEndIndex");function a3(Se,Pe){for(var ke=Se.length,ft=0;ke--;)Se[ke]===Pe&&++ft;return ft}i(a3,"countHolders"),o(a3,"countHolders");var fD=Wd(de),dD=Wd(Me);function o3(Se){return"\\"+ht[Se]}i(o3,"escapeStringChar"),o(o3,"escapeStringChar");function s3(Se,Pe){return Se==null?r:Se[Pe]}i(s3,"getValue"),o(s3,"getValue");function Ps(Se){return zd.test(Se)}i(Ps,"hasUnicode"),o(Ps,"hasUnicode");function c3(Se){return Rs.test(Se)}i(c3,"hasUnicodeWord"),o(c3,"hasUnicodeWord");function u3(Se){for(var Pe,ke=[];!(Pe=Se.next()).done;)ke.push(Pe.value);return ke}i(u3,"iteratorToArray"),o(u3,"iteratorToArray");function Xd(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft,kt){ke[++Pe]=[kt,ft]}),ke}i(Xd,"mapToArray"),o(Xd,"mapToArray");function h1(Se,Pe){return function(ke){return Se(Pe(ke))}}i(h1,"overArg"),o(h1,"overArg");function oo(Se,Pe){for(var ke=-1,ft=Se.length,kt=0,fr=[];++ke<ft;){var Wr=Se[ke];(Wr===Pe||Wr===g)&&(Se[ke]=g,fr[kt++]=ke)}return fr}i(oo,"replaceHolders"),o(oo,"replaceHolders");function Fl(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft){ke[++Pe]=ft}),ke}i(Fl,"setToArray"),o(Fl,"setToArray");function l3(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft){ke[++Pe]=[ft,ft]}),ke}i(l3,"setToPairs"),o(l3,"setToPairs");function f3(Se,Pe,ke){for(var ft=ke-1,kt=Se.length;++ft<kt;)if(Se[ft]===Pe)return ft;return-1}i(f3,"strictIndexOf"),o(f3,"strictIndexOf");function d3(Se,Pe,ke){for(var ft=ke+1;ft--;)if(Se[ft]===Pe)return ft;return ft}i(d3,"strictLastIndexOf"),o(d3,"strictLastIndexOf");function Bs(Se){return Ps(Se)?h3(Se):lD(Se)}i(Bs,"stringSize"),o(Bs,"stringSize");function Oi(Se){return Ps(Se)?p3(Se):e3(Se)}i(Oi,"stringToArray"),o(Oi,"stringToArray");function p1(Se){for(var Pe=Se.length;Pe--&&sr.test(Se.charAt(Pe)););return Pe}i(p1,"trimmedEndIndex"),o(p1,"trimmedEndIndex");var hD=Wd(Le);function h3(Se){for(var Pe=Nl.lastIndex=0;Nl.test(Se);)++Pe;return Pe}i(h3,"unicodeSize"),o(h3,"unicodeSize");function p3(Se){return Se.match(Nl)||[]}i(p3,"unicodeToArray"),o(p3,"unicodeToArray");function m3(Se){return Se.match(Pl)||[]}i(m3,"unicodeWords"),o(m3,"unicodeWords");var pD=o(i(function Se(Pe){Pe=Pe==null?Fr:Bo.defaults(Fr.Object(),Pe,Bo.pick(Fr,Hd));var ke=Pe.Array,ft=Pe.Date,kt=Pe.Error,fr=Pe.Function,Wr=Pe.Math,_r=Pe.Object,m1=Pe.RegExp,mD=Pe.String,Ni=Pe.TypeError,Qd=ke.prototype,gD=fr.prototype,Wc=_r.prototype,eh=Pe["__core-js_shared__"],th=gD.toString,yr=Wc.hasOwnProperty,vD=0,g3=function(){var u=/[^.]+$/.exec(eh&&eh.keys&&eh.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),rh=Wc.toString,yD=th.call(_r),bD=Fr._,wD=m1("^"+th.call(yr).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=Bl?Pe.Buffer:r,Lo=Pe.Symbol,ih=Pe.Uint8Array,v3=nh?nh.allocUnsafe:r,ah=h1(_r.getPrototypeOf,_r),y3=_r.create,b3=Wc.propertyIsEnumerable,oh=Qd.splice,w3=Lo?Lo.isConcatSpreadable:r,jl=Lo?Lo.iterator:r,Ls=Lo?Lo.toStringTag:r,sh=function(){try{var u=Ho(_r,"defineProperty");return u({},"",{}),u}catch{}}(),_D=Pe.clearTimeout!==Fr.clearTimeout&&Pe.clearTimeout,ED=ft&&ft.now!==Fr.Date.now&&ft.now,AD=Pe.setTimeout!==Fr.setTimeout&&Pe.setTimeout,ch=Wr.ceil,uh=Wr.floor,g1=_r.getOwnPropertySymbols,SD=nh?nh.isBuffer:r,_3=Pe.isFinite,xD=Qd.join,TD=h1(_r.keys,_r),Jr=Wr.max,vn=Wr.min,CD=ft.now,MD=Pe.parseInt,E3=Wr.random,ID=Qd.reverse,v1=Ho(Pe,"DataView"),$l=Ho(Pe,"Map"),y1=Ho(Pe,"Promise"),Jc=Ho(Pe,"Set"),zl=Ho(Pe,"WeakMap"),Hl=Ho(_r,"create"),lh=zl&&new zl,Zc={},kD=qo(v1),DD=qo($l),RD=qo(y1),OD=qo(Jc),ND=qo(zl),fh=Lo?Lo.prototype:r,ql=fh?fh.valueOf:r,A3=fh?fh.toString:r;function se(u){if(Rr(u)&&!Nt(u)&&!(u instanceof Kt)){if(u instanceof ii)return u;if(yr.call(u,"__wrapped__"))return gg(u)}return new ii(u)}i(se,"lodash"),o(se,"lodash");var Yc=function(){function u(){}return i(u,"object"),o(u,"object"),function(d){if(!kr(d))return{};if(y3)return y3(d);u.prototype=d;var S=new u;return u.prototype=r,S}}();function Vl(){}i(Vl,"baseLodash"),o(Vl,"baseLodash");function ii(u,d){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=r}i(ii,"LodashWrapper"),o(ii,"LodashWrapper"),se.templateSettings={escape:lr,evaluate:lt,interpolate:nt,variable:"",imports:{_:se}},se.prototype=Vl.prototype,se.prototype.constructor=se,ii.prototype=Yc(Vl.prototype),ii.prototype.constructor=ii;function Kt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=A,this.__views__=[]}i(Kt,"LazyWrapper"),o(Kt,"LazyWrapper");function S3(){var u=new Kt(this.__wrapped__);return u.__actions__=In(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=In(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=In(this.__views__),u}i(S3,"lazyClone"),o(S3,"lazyClone");function x3(){if(this.__filtered__){var u=new Kt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}i(x3,"lazyReverse"),o(x3,"lazyReverse");function T3(){var u=this.__wrapped__.value(),d=this.__dir__,S=Nt(u),$=d<0,te=S?u.length:0,ce=j5(0,te,this.__views__),ye=ce.start,Ee=ce.end,xe=Ee-ye,Ue=$?Ee:ye-1,Fe=this.__iteratees__,$e=Fe.length,Ye=0,pt=vn(xe,this.__takeCount__);if(!S||!$&&te==xe&&pt==xe)return j1(u,this.__actions__);var St=[];e:for(;xe--&&Ye<pt;){Ue+=d;for(var Lt=-1,_t=u[Ue];++Lt<$e;){var Ht=Fe[Lt],Gt=Ht.iteratee,Hn=Ht.type,_n=Gt(_t);if(Hn==b)_t=_n;else if(!_n){if(Hn==T)continue e;break e}}St[Ye++]=_t}return St}i(T3,"lazyValue"),o(T3,"lazyValue"),Kt.prototype=Yc(Vl.prototype),Kt.prototype.constructor=Kt;function Uo(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Uo,"Hash"),o(Uo,"Hash");function C3(){this.__data__=Hl?Hl(null):{},this.size=0}i(C3,"hashClear"),o(C3,"hashClear");function M3(u){var d=this.has(u)&&delete this.__data__[u];return this.size-=d?1:0,d}i(M3,"hashDelete"),o(M3,"hashDelete");function I3(u){var d=this.__data__;if(Hl){var S=d[u];return S===h?r:S}return yr.call(d,u)?d[u]:r}i(I3,"hashGet"),o(I3,"hashGet");function k3(u){var d=this.__data__;return Hl?d[u]!==r:yr.call(d,u)}i(k3,"hashHas"),o(k3,"hashHas");function D3(u,d){var S=this.__data__;return this.size+=this.has(u)?0:1,S[u]=Hl&&d===r?h:d,this}i(D3,"hashSet"),o(D3,"hashSet"),Uo.prototype.clear=C3,Uo.prototype.delete=M3,Uo.prototype.get=I3,Uo.prototype.has=k3,Uo.prototype.set=D3;function Aa(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Aa,"ListCache"),o(Aa,"ListCache");function R3(){this.__data__=[],this.size=0}i(R3,"listCacheClear"),o(R3,"listCacheClear");function O3(u){var d=this.__data__,S=Kl(d,u);if(S<0)return!1;var $=d.length-1;return S==$?d.pop():oh.call(d,S,1),--this.size,!0}i(O3,"listCacheDelete"),o(O3,"listCacheDelete");function N3(u){var d=this.__data__,S=Kl(d,u);return S<0?r:d[S][1]}i(N3,"listCacheGet"),o(N3,"listCacheGet");function P3(u){return Kl(this.__data__,u)>-1}i(P3,"listCacheHas"),o(P3,"listCacheHas");function B3(u,d){var S=this.__data__,$=Kl(S,u);return $<0?(++this.size,S.push([u,d])):S[$][1]=d,this}i(B3,"listCacheSet"),o(B3,"listCacheSet"),Aa.prototype.clear=R3,Aa.prototype.delete=O3,Aa.prototype.get=N3,Aa.prototype.has=P3,Aa.prototype.set=B3;function Sa(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Sa,"MapCache"),o(Sa,"MapCache");function L3(){this.size=0,this.__data__={hash:new Uo,map:new($l||Aa),string:new Uo}}i(L3,"mapCacheClear"),o(L3,"mapCacheClear");function U3(u){var d=af(this,u).delete(u);return this.size-=d?1:0,d}i(U3,"mapCacheDelete"),o(U3,"mapCacheDelete");function F3(u){return af(this,u).get(u)}i(F3,"mapCacheGet"),o(F3,"mapCacheGet");function j3(u){return af(this,u).has(u)}i(j3,"mapCacheHas"),o(j3,"mapCacheHas");function $3(u,d){var S=af(this,u),$=S.size;return S.set(u,d),this.size+=S.size==$?0:1,this}i($3,"mapCacheSet"),o($3,"mapCacheSet"),Sa.prototype.clear=L3,Sa.prototype.delete=U3,Sa.prototype.get=F3,Sa.prototype.has=j3,Sa.prototype.set=$3;function Fo(u){var d=-1,S=u==null?0:u.length;for(this.__data__=new Sa;++d<S;)this.add(u[d])}i(Fo,"SetCache"),o(Fo,"SetCache");function z3(u){return this.__data__.set(u,h),this}i(z3,"setCacheAdd"),o(z3,"setCacheAdd");function H3(u){return this.__data__.has(u)}i(H3,"setCacheHas"),o(H3,"setCacheHas"),Fo.prototype.add=Fo.prototype.push=z3,Fo.prototype.has=H3;function Pi(u){var d=this.__data__=new Aa(u);this.size=d.size}i(Pi,"Stack"),o(Pi,"Stack");function q3(){this.__data__=new Aa,this.size=0}i(q3,"stackClear"),o(q3,"stackClear");function V3(u){var d=this.__data__,S=d.delete(u);return this.size=d.size,S}i(V3,"stackDelete"),o(V3,"stackDelete");function K3(u){return this.__data__.get(u)}i(K3,"stackGet"),o(K3,"stackGet");function G3(u){return this.__data__.has(u)}i(G3,"stackHas"),o(G3,"stackHas");function W3(u,d){var S=this.__data__;if(S instanceof Aa){var $=S.__data__;if(!$l||$.length<a-1)return $.push([u,d]),this.size=++S.size,this;S=this.__data__=new Sa($)}return S.set(u,d),this.size=S.size,this}i(W3,"stackSet"),o(W3,"stackSet"),Pi.prototype.clear=q3,Pi.prototype.delete=V3,Pi.prototype.get=K3,Pi.prototype.has=G3,Pi.prototype.set=W3;function b1(u,d){var S=Nt(u),$=!S&&$s(u),te=!S&&!$&&Vo(u),ce=!S&&!$&&!te&&ou(u),ye=S||$||te||ce,Ee=ye?Zd(u.length,mD):[],xe=Ee.length;for(var Ue in u)(d||yr.call(u,Ue))&&!(ye&&(Ue=="length"||te&&(Ue=="offset"||Ue=="parent")||ce&&(Ue=="buffer"||Ue=="byteLength"||Ue=="byteOffset")||Ma(Ue,xe)))&&Ee.push(Ue);return Ee}i(b1,"arrayLikeKeys"),o(b1,"arrayLikeKeys");function w1(u){var d=u.length;return d?u[_h(0,d-1)]:r}i(w1,"arraySample"),o(w1,"arraySample");function J3(u,d){return sf(In(u),jo(d,0,u.length))}i(J3,"arraySampleSize"),o(J3,"arraySampleSize");function Z3(u){return sf(In(u))}i(Z3,"arrayShuffle"),o(Z3,"arrayShuffle");function dh(u,d,S){(S!==r&&!Bi(u[d],S)||S===r&&!(d in u))&&xa(u,d,S)}i(dh,"assignMergeValue"),o(dh,"assignMergeValue");function Xc(u,d,S){var $=u[d];(!(yr.call(u,d)&&Bi($,S))||S===r&&!(d in u))&&xa(u,d,S)}i(Xc,"assignValue"),o(Xc,"assignValue");function Kl(u,d){for(var S=u.length;S--;)if(Bi(u[S][0],d))return S;return-1}i(Kl,"assocIndexOf"),o(Kl,"assocIndexOf");function Y3(u,d,S,$){return $o(u,function(te,ce,ye){d($,te,S(te),ye)}),$}i(Y3,"baseAggregator"),o(Y3,"baseAggregator");function _1(u,d){return u&&Xi(d,Zr(d),u)}i(_1,"baseAssign"),o(_1,"baseAssign");function X3(u,d){return u&&Xi(d,Dn(d),u)}i(X3,"baseAssignIn"),o(X3,"baseAssignIn");function xa(u,d,S){d=="__proto__"&&sh?sh(u,d,{configurable:!0,enumerable:!0,value:S,writable:!0}):u[d]=S}i(xa,"baseAssignValue"),o(xa,"baseAssignValue");function hh(u,d){for(var S=-1,$=d.length,te=ke($),ce=u==null;++S<$;)te[S]=ce?r:zh(u,d[S]);return te}i(hh,"baseAt"),o(hh,"baseAt");function jo(u,d,S){return u===u&&(S!==r&&(u=u<=S?u:S),d!==r&&(u=u>=d?u:d)),u}i(jo,"baseClamp"),o(jo,"baseClamp");function ai(u,d,S,$,te,ce){var ye,Ee=d&v,xe=d&y,Ue=d&_;if(S&&(ye=te?S(u,$,te,ce):S(u)),ye!==r)return ye;if(!kr(u))return u;var Fe=Nt(u);if(Fe){if(ye=z5(u),!Ee)return In(u,ye)}else{var $e=bn(u),Ye=$e==ae||$e==fe;if(Vo(u))return z1(u,Ee);if($e==N||$e==U||Ye&&!te){if(ye=xe||Ye?{}:cg(u),!Ee)return xe?D5(u,X3(ye,u)):k5(u,_1(ye,u))}else{if(!vr[$e])return te?u:{};ye=H5(u,$e,Ee)}}ce||(ce=new Pi);var pt=ce.get(u);if(pt)return pt;ce.set(u,ye),F4(u)?u.forEach(function(_t){ye.add(ai(_t,d,S,_t,u,ce))}):D4(u)&&u.forEach(function(_t,Ht){ye.set(Ht,ai(_t,d,S,Ht,u,ce))});var St=Ue?xe?Rh:Dh:xe?Dn:Zr,Lt=Fe?r:St(u);return ni(Lt||u,function(_t,Ht){Lt&&(Ht=_t,_t=u[Ht]),Xc(ye,Ht,ai(_t,d,S,Ht,u,ce))}),ye}i(ai,"baseClone"),o(ai,"baseClone");function Q3(u){var d=Zr(u);return function(S){return E1(S,u,d)}}i(Q3,"baseConforms"),o(Q3,"baseConforms");function E1(u,d,S){var $=S.length;if(u==null)return!$;for(u=_r(u);$--;){var te=S[$],ce=d[te],ye=u[te];if(ye===r&&!(te in u)||!ce(ye))return!1}return!0}i(E1,"baseConformsTo"),o(E1,"baseConformsTo");function A1(u,d,S){if(typeof u!="function")throw new Ni(c);return of(function(){u.apply(r,S)},d)}i(A1,"baseDelay"),o(A1,"baseDelay");function Qc(u,d,S,$){var te=-1,ce=Ll,ye=!0,Ee=u.length,xe=[],Ue=d.length;if(!Ee)return xe;S&&(d=Mr(d,jn(S))),$?(ce=qd,ye=!1):d.length>=a&&(ce=Gc,ye=!1,d=new Fo(d));e:for(;++te<Ee;){var Fe=u[te],$e=S==null?Fe:S(Fe);if(Fe=$||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=Ue;Ye--;)if(d[Ye]===$e)continue e;xe.push(Fe)}else ce(d,$e,$)||xe.push(Fe)}return xe}i(Qc,"baseDifference"),o(Qc,"baseDifference");var $o=G1(Yi),e5=G1(ph,!0);function t5(u,d){var S=!0;return $o(u,function($,te,ce){return S=!!d($,te,ce),S}),S}i(t5,"baseEvery"),o(t5,"baseEvery");function Gl(u,d,S){for(var $=-1,te=u.length;++$<te;){var ce=u[$],ye=d(ce);if(ye!=null&&(Ee===r?ye===ye&&!zn(ye):S(ye,Ee)))var Ee=ye,xe=ce}return xe}i(Gl,"baseExtremum"),o(Gl,"baseExtremum");function r5(u,d,S,$){var te=u.length;for(S=Pt(S),S<0&&(S=-S>te?0:te+S),$=$===r||$>te?te:Pt($),$<0&&($+=te),$=S>$?0:Lg($);S<$;)u[S++]=d;return u}i(r5,"baseFill"),o(r5,"baseFill");function S1(u,d){var S=[];return $o(u,function($,te,ce){d($,te,ce)&&S.push($)}),S}i(S1,"baseFilter"),o(S1,"baseFilter");function Xr(u,d,S,$,te){var ce=-1,ye=u.length;for(S||(S=V5),te||(te=[]);++ce<ye;){var Ee=u[ce];d>0&&S(Ee)?d>1?Xr(Ee,d-1,S,$,te):ao(te,Ee):$||(te[te.length]=Ee)}return te}i(Xr,"baseFlatten"),o(Xr,"baseFlatten");var x1=W1(),n5=W1(!0);function Yi(u,d){return u&&x1(u,d,Zr)}i(Yi,"baseForOwn"),o(Yi,"baseForOwn");function ph(u,d){return u&&n5(u,d,Zr)}i(ph,"baseForOwnRight"),o(ph,"baseForOwnRight");function Wl(u,d){return io(d,function(S){return Ia(u[S])})}i(Wl,"baseFunctions"),o(Wl,"baseFunctions");function zo(u,d){d=co(d,u);for(var S=0,$=d.length;u!=null&&S<$;)u=u[Qi(d[S++])];return S&&S==$?u:r}i(zo,"baseGet"),o(zo,"baseGet");function T1(u,d,S){var $=d(u);return Nt(u)?$:ao($,S(u))}i(T1,"baseGetAllKeys"),o(T1,"baseGetAllKeys");function yn(u){return u==null?u===r?De:X:Ls&&Ls in _r(u)?U5(u):Y5(u)}i(yn,"baseGetTag"),o(yn,"baseGetTag");function mh(u,d){return u>d}i(mh,"baseGt"),o(mh,"baseGt");function i5(u,d){return u!=null&&yr.call(u,d)}i(i5,"baseHas"),o(i5,"baseHas");function a5(u,d){return u!=null&&d in _r(u)}i(a5,"baseHasIn"),o(a5,"baseHasIn");function o5(u,d,S){return u>=vn(d,S)&&u<Jr(d,S)}i(o5,"baseInRange"),o(o5,"baseInRange");function gh(u,d,S){for(var $=S?qd:Ll,te=u[0].length,ce=u.length,ye=ce,Ee=ke(ce),xe=1/0,Ue=[];ye--;){var Fe=u[ye];ye&&d&&(Fe=Mr(Fe,jn(d))),xe=vn(Fe.length,xe),Ee[ye]=!S&&(d||te>=120&&Fe.length>=120)?new Fo(ye&&Fe):r}Fe=u[0];var $e=-1,Ye=Ee[0];e:for(;++$e<te&&Ue.length<xe;){var pt=Fe[$e],St=d?d(pt):pt;if(pt=S||pt!==0?pt:0,!(Ye?Gc(Ye,St):$(Ue,St,S))){for(ye=ce;--ye;){var Lt=Ee[ye];if(!(Lt?Gc(Lt,St):$(u[ye],St,S)))continue e}Ye&&Ye.push(St),Ue.push(pt)}}return Ue}i(gh,"baseIntersection"),o(gh,"baseIntersection");function s5(u,d,S,$){return Yi(u,function(te,ce,ye){d($,S(te),ce,ye)}),$}i(s5,"baseInverter"),o(s5,"baseInverter");function eu(u,d,S){d=co(d,u),u=dg(u,d);var $=u==null?u:u[Qi(si(d))];return $==null?r:Fn($,u,S)}i(eu,"baseInvoke"),o(eu,"baseInvoke");function C1(u){return Rr(u)&&yn(u)==U}i(C1,"baseIsArguments"),o(C1,"baseIsArguments");function c5(u){return Rr(u)&&yn(u)==qe}i(c5,"baseIsArrayBuffer"),o(c5,"baseIsArrayBuffer");function u5(u){return Rr(u)&&yn(u)==oe}i(u5,"baseIsDate"),o(u5,"baseIsDate");function tu(u,d,S,$,te){return u===d?!0:u==null||d==null||!Rr(u)&&!Rr(d)?u!==u&&d!==d:l5(u,d,S,$,tu,te)}i(tu,"baseIsEqual"),o(tu,"baseIsEqual");function l5(u,d,S,$,te,ce){var ye=Nt(u),Ee=Nt(d),xe=ye?ge:bn(u),Ue=Ee?ge:bn(d);xe=xe==U?N:xe,Ue=Ue==U?N:Ue;var Fe=xe==N,$e=Ue==N,Ye=xe==Ue;if(Ye&&Vo(u)){if(!Vo(d))return!1;ye=!0,Fe=!1}if(Ye&&!Fe)return ce||(ce=new Pi),ye||ou(u)?ig(u,d,S,$,te,ce):B5(u,d,xe,S,$,te,ce);if(!(S&x)){var pt=Fe&&yr.call(u,"__wrapped__"),St=$e&&yr.call(d,"__wrapped__");if(pt||St){var Lt=pt?u.value():u,_t=St?d.value():d;return ce||(ce=new Pi),te(Lt,_t,S,$,ce)}}return Ye?(ce||(ce=new Pi),L5(u,d,S,$,te,ce)):!1}i(l5,"baseIsEqualDeep"),o(l5,"baseIsEqualDeep");function f5(u){return Rr(u)&&bn(u)==be}i(f5,"baseIsMap"),o(f5,"baseIsMap");function vh(u,d,S,$){var te=S.length,ce=te,ye=!$;if(u==null)return!ce;for(u=_r(u);te--;){var Ee=S[te];if(ye&&Ee[2]?Ee[1]!==u[Ee[0]]:!(Ee[0]in u))return!1}for(;++te<ce;){Ee=S[te];var xe=Ee[0],Ue=u[xe],Fe=Ee[1];if(ye&&Ee[2]){if(Ue===r&&!(xe in u))return!1}else{var $e=new Pi;if($)var Ye=$(Ue,Fe,xe,u,d,$e);if(!(Ye===r?tu(Fe,Ue,x|O,$,$e):Ye))return!1}}return!0}i(vh,"baseIsMatch"),o(vh,"baseIsMatch");function M1(u){if(!kr(u)||G5(u))return!1;var d=Ia(u)?wD:tr;return d.test(qo(u))}i(M1,"baseIsNative"),o(M1,"baseIsNative");function d5(u){return Rr(u)&&yn(u)==ie}i(d5,"baseIsRegExp"),o(d5,"baseIsRegExp");function h5(u){return Rr(u)&&bn(u)==ee}i(h5,"baseIsSet"),o(h5,"baseIsSet");function p5(u){return Rr(u)&&df(u.length)&&!!wr[yn(u)]}i(p5,"baseIsTypedArray"),o(p5,"baseIsTypedArray");function I1(u){return typeof u=="function"?u:u==null?Rn:typeof u=="object"?Nt(u)?R1(u[0],u[1]):D1(u):qg(u)}i(I1,"baseIteratee"),o(I1,"baseIteratee");function yh(u){if(!iu(u))return TD(u);var d=[];for(var S in _r(u))yr.call(u,S)&&S!="constructor"&&d.push(S);return d}i(yh,"baseKeys"),o(yh,"baseKeys");function m5(u){if(!kr(u))return Z5(u);var d=iu(u),S=[];for(var $ in u)$=="constructor"&&(d||!yr.call(u,$))||S.push($);return S}i(m5,"baseKeysIn"),o(m5,"baseKeysIn");function bh(u,d){return u<d}i(bh,"baseLt"),o(bh,"baseLt");function k1(u,d){var S=-1,$=kn(u)?ke(u.length):[];return $o(u,function(te,ce,ye){$[++S]=d(te,ce,ye)}),$}i(k1,"baseMap"),o(k1,"baseMap");function D1(u){var d=Oh(u);return d.length==1&&d[0][2]?lg(d[0][0],d[0][1]):function(S){return S===u||vh(S,u,d)}}i(D1,"baseMatches"),o(D1,"baseMatches");function R1(u,d){return Nh(u)&&ug(d)?lg(Qi(u),d):function(S){var $=zh(S,u);return $===r&&$===d?Hh(S,u):tu(d,$,x|O)}}i(R1,"baseMatchesProperty"),o(R1,"baseMatchesProperty");function Jl(u,d,S,$,te){u!==d&&x1(d,function(ce,ye){if(te||(te=new Pi),kr(ce))g5(u,d,ye,S,Jl,$,te);else{var Ee=$?$(Bh(u,ye),ce,ye+"",u,d,te):r;Ee===r&&(Ee=ce),dh(u,ye,Ee)}},Dn)}i(Jl,"baseMerge"),o(Jl,"baseMerge");function g5(u,d,S,$,te,ce,ye){var Ee=Bh(u,S),xe=Bh(d,S),Ue=ye.get(xe);if(Ue){dh(u,S,Ue);return}var Fe=ce?ce(Ee,xe,S+"",u,d,ye):r,$e=Fe===r;if($e){var Ye=Nt(xe),pt=!Ye&&Vo(xe),St=!Ye&&!pt&&ou(xe);Fe=xe,Ye||pt||St?Nt(Ee)?Fe=Ee:Pr(Ee)?Fe=In(Ee):pt?($e=!1,Fe=z1(xe,!0)):St?($e=!1,Fe=H1(xe,!0)):Fe=[]:au(xe)||$s(xe)?(Fe=Ee,$s(Ee)?Fe=Ug(Ee):(!kr(Ee)||Ia(Ee))&&(Fe=cg(xe))):$e=!1}$e&&(ye.set(xe,Fe),te(Fe,xe,$,ce,ye),ye.delete(xe)),dh(u,S,Fe)}i(g5,"baseMergeDeep"),o(g5,"baseMergeDeep");function O1(u,d){var S=u.length;if(!!S)return d+=d<0?S:0,Ma(d,S)?u[d]:r}i(O1,"baseNth"),o(O1,"baseNth");function N1(u,d,S){d.length?d=Mr(d,function(ce){return Nt(ce)?function(ye){return zo(ye,ce.length===1?ce[0]:ce)}:ce}):d=[Rn];var $=-1;d=Mr(d,jn(wt()));var te=k1(u,function(ce,ye,Ee){var xe=Mr(d,function(Ue){return Ue(ce)});return{criteria:xe,index:++$,value:ce}});return n3(te,function(ce,ye){return I5(ce,ye,S)})}i(N1,"baseOrderBy"),o(N1,"baseOrderBy");function v5(u,d){return P1(u,d,function(S,$){return Hh(u,$)})}i(v5,"basePick"),o(v5,"basePick");function P1(u,d,S){for(var $=-1,te=d.length,ce={};++$<te;){var ye=d[$],Ee=zo(u,ye);S(Ee,ye)&&ru(ce,co(ye,u),Ee)}return ce}i(P1,"basePickBy"),o(P1,"basePickBy");function y5(u){return function(d){return zo(d,u)}}i(y5,"basePropertyDeep"),o(y5,"basePropertyDeep");function wh(u,d,S,$){var te=$?r3:Ns,ce=-1,ye=d.length,Ee=u;for(u===d&&(d=In(d)),S&&(Ee=Mr(u,jn(S)));++ce<ye;)for(var xe=0,Ue=d[ce],Fe=S?S(Ue):Ue;(xe=te(Ee,Fe,xe,$))>-1;)Ee!==u&&oh.call(Ee,xe,1),oh.call(u,xe,1);return u}i(wh,"basePullAll"),o(wh,"basePullAll");function B1(u,d){for(var S=u?d.length:0,$=S-1;S--;){var te=d[S];if(S==$||te!==ce){var ce=te;Ma(te)?oh.call(u,te,1):Sh(u,te)}}return u}i(B1,"basePullAt"),o(B1,"basePullAt");function _h(u,d){return u+uh(E3()*(d-u+1))}i(_h,"baseRandom"),o(_h,"baseRandom");function b5(u,d,S,$){for(var te=-1,ce=Jr(ch((d-u)/(S||1)),0),ye=ke(ce);ce--;)ye[$?ce:++te]=u,u+=S;return ye}i(b5,"baseRange"),o(b5,"baseRange");function Eh(u,d){var S="";if(!u||d<1||d>E)return S;do d%2&&(S+=u),d=uh(d/2),d&&(u+=u);while(d);return S}i(Eh,"baseRepeat"),o(Eh,"baseRepeat");function Ut(u,d){return hg(fg(u,d,Rn),u+"")}i(Ut,"baseRest"),o(Ut,"baseRest");function w5(u){return w1(zs(u))}i(w5,"baseSample"),o(w5,"baseSample");function _5(u,d){var S=zs(u);return sf(S,jo(d,0,S.length))}i(_5,"baseSampleSize"),o(_5,"baseSampleSize");function ru(u,d,S,$){if(!kr(u))return u;d=co(d,u);for(var te=-1,ce=d.length,ye=ce-1,Ee=u;Ee!=null&&++te<ce;){var xe=Qi(d[te]),Ue=S;if(xe==="__proto__"||xe==="constructor"||xe==="prototype")return u;if(te!=ye){var Fe=Ee[xe];Ue=$?$(Fe,xe,Ee):r,Ue===r&&(Ue=kr(Fe)?Fe:Ma(d[te+1])?[]:{})}Xc(Ee,xe,Ue),Ee=Ee[xe]}return u}i(ru,"baseSet"),o(ru,"baseSet");var E5=lh?function(u,d){return lh.set(u,d),u}:Rn,PD=sh?function(u,d){return sh(u,"toString",{configurable:!0,enumerable:!1,value:qh(d),writable:!0})}:Rn;function A5(u){return sf(zs(u))}i(A5,"baseShuffle"),o(A5,"baseShuffle");function oi(u,d,S){var $=-1,te=u.length;d<0&&(d=-d>te?0:te+d),S=S>te?te:S,S<0&&(S+=te),te=d>S?0:S-d>>>0,d>>>=0;for(var ce=ke(te);++$<te;)ce[$]=u[$+d];return ce}i(oi,"baseSlice"),o(oi,"baseSlice");function S5(u,d){var S;return $o(u,function($,te,ce){return S=d($,te,ce),!S}),!!S}i(S5,"baseSome"),o(S5,"baseSome");function Zl(u,d,S){var $=0,te=u==null?$:u.length;if(typeof d=="number"&&d===d&&te<=V){for(;$<te;){var ce=$+te>>>1,ye=u[ce];ye!==null&&!zn(ye)&&(S?ye<=d:ye<d)?$=ce+1:te=ce}return te}return Ah(u,d,Rn,S)}i(Zl,"baseSortedIndex"),o(Zl,"baseSortedIndex");function Ah(u,d,S,$){var te=0,ce=u==null?0:u.length;if(ce===0)return 0;d=S(d);for(var ye=d!==d,Ee=d===null,xe=zn(d),Ue=d===r;te<ce;){var Fe=uh((te+ce)/2),$e=S(u[Fe]),Ye=$e!==r,pt=$e===null,St=$e===$e,Lt=zn($e);if(ye)var _t=$||St;else Ue?_t=St&&($||Ye):Ee?_t=St&&Ye&&($||!pt):xe?_t=St&&Ye&&!pt&&($||!Lt):pt||Lt?_t=!1:_t=$?$e<=d:$e<d;_t?te=Fe+1:ce=Fe}return vn(ce,B)}i(Ah,"baseSortedIndexBy"),o(Ah,"baseSortedIndexBy");function L1(u,d){for(var S=-1,$=u.length,te=0,ce=[];++S<$;){var ye=u[S],Ee=d?d(ye):ye;if(!S||!Bi(Ee,xe)){var xe=Ee;ce[te++]=ye===0?0:ye}}return ce}i(L1,"baseSortedUniq"),o(L1,"baseSortedUniq");function U1(u){return typeof u=="number"?u:zn(u)?C:+u}i(U1,"baseToNumber"),o(U1,"baseToNumber");function $n(u){if(typeof u=="string")return u;if(Nt(u))return Mr(u,$n)+"";if(zn(u))return A3?A3.call(u):"";var d=u+"";return d=="0"&&1/u==-m?"-0":d}i($n,"baseToString"),o($n,"baseToString");function so(u,d,S){var $=-1,te=Ll,ce=u.length,ye=!0,Ee=[],xe=Ee;if(S)ye=!1,te=qd;else if(ce>=a){var Ue=d?null:LD(u);if(Ue)return Fl(Ue);ye=!1,te=Gc,xe=new Fo}else xe=d?[]:Ee;e:for(;++$<ce;){var Fe=u[$],$e=d?d(Fe):Fe;if(Fe=S||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=xe.length;Ye--;)if(xe[Ye]===$e)continue e;d&&xe.push($e),Ee.push(Fe)}else te(xe,$e,S)||(xe!==Ee&&xe.push($e),Ee.push(Fe))}return Ee}i(so,"baseUniq"),o(so,"baseUniq");function Sh(u,d){return d=co(d,u),u=dg(u,d),u==null||delete u[Qi(si(d))]}i(Sh,"baseUnset"),o(Sh,"baseUnset");function F1(u,d,S,$){return ru(u,d,S(zo(u,d)),$)}i(F1,"baseUpdate"),o(F1,"baseUpdate");function Yl(u,d,S,$){for(var te=u.length,ce=$?te:-1;($?ce--:++ce<te)&&d(u[ce],ce,u););return S?oi(u,$?0:ce,$?ce+1:te):oi(u,$?ce+1:0,$?te:ce)}i(Yl,"baseWhile"),o(Yl,"baseWhile");function j1(u,d){var S=u;return S instanceof Kt&&(S=S.value()),Vd(d,function($,te){return te.func.apply(te.thisArg,ao([$],te.args))},S)}i(j1,"baseWrapperValue"),o(j1,"baseWrapperValue");function xh(u,d,S){var $=u.length;if($<2)return $?so(u[0]):[];for(var te=-1,ce=ke($);++te<$;)for(var ye=u[te],Ee=-1;++Ee<$;)Ee!=te&&(ce[te]=Qc(ce[te]||ye,u[Ee],d,S));return so(Xr(ce,1),d,S)}i(xh,"baseXor"),o(xh,"baseXor");function $1(u,d,S){for(var $=-1,te=u.length,ce=d.length,ye={};++$<te;){var Ee=$<ce?d[$]:r;S(ye,u[$],Ee)}return ye}i($1,"baseZipObject"),o($1,"baseZipObject");function Th(u){return Pr(u)?u:[]}i(Th,"castArrayLikeObject"),o(Th,"castArrayLikeObject");function Ch(u){return typeof u=="function"?u:Rn}i(Ch,"castFunction"),o(Ch,"castFunction");function co(u,d){return Nt(u)?u:Nh(u,d)?[u]:ew(dr(u))}i(co,"castPath"),o(co,"castPath");var BD=Ut;function uo(u,d,S){var $=u.length;return S=S===r?$:S,!d&&S>=$?u:oi(u,d,S)}i(uo,"castSlice"),o(uo,"castSlice");var x5=_D||function(u){return Fr.clearTimeout(u)};function z1(u,d){if(d)return u.slice();var S=u.length,$=v3?v3(S):new u.constructor(S);return u.copy($),$}i(z1,"cloneBuffer"),o(z1,"cloneBuffer");function Mh(u){var d=new u.constructor(u.byteLength);return new ih(d).set(new ih(u)),d}i(Mh,"cloneArrayBuffer"),o(Mh,"cloneArrayBuffer");function T5(u,d){var S=d?Mh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.byteLength)}i(T5,"cloneDataView"),o(T5,"cloneDataView");function C5(u){var d=new u.constructor(u.source,yt.exec(u));return d.lastIndex=u.lastIndex,d}i(C5,"cloneRegExp"),o(C5,"cloneRegExp");function M5(u){return ql?_r(ql.call(u)):{}}i(M5,"cloneSymbol"),o(M5,"cloneSymbol");function H1(u,d){var S=d?Mh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.length)}i(H1,"cloneTypedArray"),o(H1,"cloneTypedArray");function q1(u,d){if(u!==d){var S=u!==r,$=u===null,te=u===u,ce=zn(u),ye=d!==r,Ee=d===null,xe=d===d,Ue=zn(d);if(!Ee&&!Ue&&!ce&&u>d||ce&&ye&&xe&&!Ee&&!Ue||$&&ye&&xe||!S&&xe||!te)return 1;if(!$&&!ce&&!Ue&&u<d||Ue&&S&&te&&!$&&!ce||Ee&&S&&te||!ye&&te||!xe)return-1}return 0}i(q1,"compareAscending"),o(q1,"compareAscending");function I5(u,d,S){for(var $=-1,te=u.criteria,ce=d.criteria,ye=te.length,Ee=S.length;++$<ye;){var xe=q1(te[$],ce[$]);if(xe){if($>=Ee)return xe;var Ue=S[$];return xe*(Ue=="desc"?-1:1)}}return u.index-d.index}i(I5,"compareMultiple"),o(I5,"compareMultiple");function V1(u,d,S,$){for(var te=-1,ce=u.length,ye=S.length,Ee=-1,xe=d.length,Ue=Jr(ce-ye,0),Fe=ke(xe+Ue),$e=!$;++Ee<xe;)Fe[Ee]=d[Ee];for(;++te<ye;)($e||te<ce)&&(Fe[S[te]]=u[te]);for(;Ue--;)Fe[Ee++]=u[te++];return Fe}i(V1,"composeArgs"),o(V1,"composeArgs");function K1(u,d,S,$){for(var te=-1,ce=u.length,ye=-1,Ee=S.length,xe=-1,Ue=d.length,Fe=Jr(ce-Ee,0),$e=ke(Fe+Ue),Ye=!$;++te<Fe;)$e[te]=u[te];for(var pt=te;++xe<Ue;)$e[pt+xe]=d[xe];for(;++ye<Ee;)(Ye||te<ce)&&($e[pt+S[ye]]=u[te++]);return $e}i(K1,"composeArgsRight"),o(K1,"composeArgsRight");function In(u,d){var S=-1,$=u.length;for(d||(d=ke($));++S<$;)d[S]=u[S];return d}i(In,"copyArray"),o(In,"copyArray");function Xi(u,d,S,$){var te=!S;S||(S={});for(var ce=-1,ye=d.length;++ce<ye;){var Ee=d[ce],xe=$?$(S[Ee],u[Ee],Ee,S,u):r;xe===r&&(xe=u[Ee]),te?xa(S,Ee,xe):Xc(S,Ee,xe)}return S}i(Xi,"copyObject"),o(Xi,"copyObject");function k5(u,d){return Xi(u,og(u),d)}i(k5,"copySymbols"),o(k5,"copySymbols");function D5(u,d){return Xi(u,F5(u),d)}i(D5,"copySymbolsIn"),o(D5,"copySymbolsIn");function Xl(u,d){return function(S,$){var te=Nt(S)?Y2:Y3,ce=d?d():{};return te(S,u,wt($,2),ce)}}i(Xl,"createAggregator"),o(Xl,"createAggregator");function Us(u){return Ut(function(d,S){var $=-1,te=S.length,ce=te>1?S[te-1]:r,ye=te>2?S[2]:r;for(ce=u.length>3&&typeof ce=="function"?(te--,ce):r,ye&&wn(S[0],S[1],ye)&&(ce=te<3?r:ce,te=1),d=_r(d);++$<te;){var Ee=S[$];Ee&&u(d,Ee,$,ce)}return d})}i(Us,"createAssigner"),o(Us,"createAssigner");function G1(u,d){return function(S,$){if(S==null)return S;if(!kn(S))return u(S,$);for(var te=S.length,ce=d?te:-1,ye=_r(S);(d?ce--:++ce<te)&&$(ye[ce],ce,ye)!==!1;);return S}}i(G1,"createBaseEach"),o(G1,"createBaseEach");function W1(u){return function(d,S,$){for(var te=-1,ce=_r(d),ye=$(d),Ee=ye.length;Ee--;){var xe=ye[u?Ee:++te];if(S(ce[xe],xe,ce)===!1)break}return d}}i(W1,"createBaseFor"),o(W1,"createBaseFor");function R5(u,d,S){var $=d&D,te=nu(u);function ce(){var ye=this&&this!==Fr&&this instanceof ce?te:u;return ye.apply($?S:this,arguments)}return i(ce,"wrapper"),o(ce,"wrapper"),ce}i(R5,"createBind"),o(R5,"createBind");function J1(u){return function(d){d=dr(d);var S=Ps(d)?Oi(d):r,$=S?S[0]:d.charAt(0),te=S?uo(S,1).join(""):d.slice(1);return $[u]()+te}}i(J1,"createCaseFirst"),o(J1,"createCaseFirst");function Fs(u){return function(d){return Vd(Hg($g(d).replace(Ol,"")),u,"")}}i(Fs,"createCompounder"),o(Fs,"createCompounder");function nu(u){return function(){var d=arguments;switch(d.length){case 0:return new u;case 1:return new u(d[0]);case 2:return new u(d[0],d[1]);case 3:return new u(d[0],d[1],d[2]);case 4:return new u(d[0],d[1],d[2],d[3]);case 5:return new u(d[0],d[1],d[2],d[3],d[4]);case 6:return new u(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new u(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var S=Yc(u.prototype),$=u.apply(S,d);return kr($)?$:S}}i(nu,"createCtor"),o(nu,"createCtor");function O5(u,d,S){var $=nu(u);function te(){for(var ce=arguments.length,ye=ke(ce),Ee=ce,xe=js(te);Ee--;)ye[Ee]=arguments[Ee];var Ue=ce<3&&ye[0]!==xe&&ye[ce-1]!==xe?[]:oo(ye,xe);if(ce-=Ue.length,ce<S)return eg(u,d,Ql,te.placeholder,r,ye,Ue,r,r,S-ce);var Fe=this&&this!==Fr&&this instanceof te?$:u;return Fn(Fe,this,ye)}return i(te,"wrapper"),o(te,"wrapper"),te}i(O5,"createCurry"),o(O5,"createCurry");function Z1(u){return function(d,S,$){var te=_r(d);if(!kn(d)){var ce=wt(S,3);d=Zr(d),S=o(function(Ee){return ce(te[Ee],Ee,te)},"predicate")}var ye=u(d,S,$);return ye>-1?te[ce?d[ye]:ye]:r}}i(Z1,"createFind"),o(Z1,"createFind");function Y1(u){return Ca(function(d){var S=d.length,$=S,te=ii.prototype.thru;for(u&&d.reverse();$--;){var ce=d[$];if(typeof ce!="function")throw new Ni(c);if(te&&!ye&&nf(ce)=="wrapper")var ye=new ii([],!0)}for($=ye?$:S;++$<S;){ce=d[$];var Ee=nf(ce),xe=Ee=="wrapper"?ag(ce):r;xe&&Ph(xe[0])&&xe[1]==(k|j|Q|K)&&!xe[4].length&&xe[9]==1?ye=ye[nf(xe[0])].apply(ye,xe[3]):ye=ce.length==1&&Ph(ce)?ye[Ee]():ye.thru(ce)}return function(){var Ue=arguments,Fe=Ue[0];if(ye&&Ue.length==1&&Nt(Fe))return ye.plant(Fe).value();for(var $e=0,Ye=S?d[$e].apply(this,Ue):Fe;++$e<S;)Ye=d[$e].call(this,Ye);return Ye}})}i(Y1,"createFlow"),o(Y1,"createFlow");function Ql(u,d,S,$,te,ce,ye,Ee,xe,Ue){var Fe=d&k,$e=d&D,Ye=d&P,pt=d&(j|q),St=d&he,Lt=Ye?r:nu(u);function _t(){for(var Ht=arguments.length,Gt=ke(Ht),Hn=Ht;Hn--;)Gt[Hn]=arguments[Hn];if(pt)var _n=js(_t),qn=a3(Gt,_n);if($&&(Gt=V1(Gt,$,te,pt)),ce&&(Gt=K1(Gt,ce,ye,pt)),Ht-=qn,pt&&Ht<Ue){var jr=oo(Gt,_n);return eg(u,d,Ql,_t.placeholder,S,Gt,jr,Ee,xe,Ue-Ht)}var ea=$e?S:this,lo=Ye?ea[u]:u;return Ht=Gt.length,Ee?Gt=X5(Gt,Ee):St&&Ht>1&&Gt.reverse(),Fe&&xe<Ht&&(Gt.length=xe),this&&this!==Fr&&this instanceof _t&&(lo=Lt||nu(lo)),lo.apply(ea,Gt)}return i(_t,"wrapper"),o(_t,"wrapper"),_t}i(Ql,"createHybrid"),o(Ql,"createHybrid");function X1(u,d){return function(S,$){return s5(S,u,d($),{})}}i(X1,"createInverter"),o(X1,"createInverter");function ef(u,d){return function(S,$){var te;if(S===r&&$===r)return d;if(S!==r&&(te=S),$!==r){if(te===r)return $;typeof S=="string"||typeof $=="string"?(S=$n(S),$=$n($)):(S=U1(S),$=U1($)),te=u(S,$)}return te}}i(ef,"createMathOperation"),o(ef,"createMathOperation");function Ih(u){return Ca(function(d){return d=Mr(d,jn(wt())),Ut(function(S){var $=this;return u(d,function(te){return Fn(te,$,S)})})})}i(Ih,"createOver"),o(Ih,"createOver");function tf(u,d){d=d===r?" ":$n(d);var S=d.length;if(S<2)return S?Eh(d,u):d;var $=Eh(d,ch(u/Bs(d)));return Ps(d)?uo(Oi($),0,u).join(""):$.slice(0,u)}i(tf,"createPadding"),o(tf,"createPadding");function N5(u,d,S,$){var te=d&D,ce=nu(u);function ye(){for(var Ee=-1,xe=arguments.length,Ue=-1,Fe=$.length,$e=ke(Fe+xe),Ye=this&&this!==Fr&&this instanceof ye?ce:u;++Ue<Fe;)$e[Ue]=$[Ue];for(;xe--;)$e[Ue++]=arguments[++Ee];return Fn(Ye,te?S:this,$e)}return i(ye,"wrapper"),o(ye,"wrapper"),ye}i(N5,"createPartial"),o(N5,"createPartial");function Q1(u){return function(d,S,$){return $&&typeof $!="number"&&wn(d,S,$)&&(S=$=r),d=ka(d),S===r?(S=d,d=0):S=ka(S),$=$===r?d<S?1:-1:ka($),b5(d,S,$,u)}}i(Q1,"createRange"),o(Q1,"createRange");function rf(u){return function(d,S){return typeof d=="string"&&typeof S=="string"||(d=ci(d),S=ci(S)),u(d,S)}}i(rf,"createRelationalOperation"),o(rf,"createRelationalOperation");function eg(u,d,S,$,te,ce,ye,Ee,xe,Ue){var Fe=d&j,$e=Fe?ye:r,Ye=Fe?r:ye,pt=Fe?ce:r,St=Fe?r:ce;d|=Fe?Q:Y,d&=~(Fe?Y:Q),d&J||(d&=~(D|P));var Lt=[u,d,te,pt,$e,St,Ye,Ee,xe,Ue],_t=S.apply(r,Lt);return Ph(u)&&Q5(_t,Lt),_t.placeholder=$,pg(_t,u,d)}i(eg,"createRecurry"),o(eg,"createRecurry");function kh(u){var d=Wr[u];return function(S,$){if(S=ci(S),$=$==null?0:vn(Pt($),292),$&&_3(S)){var te=(dr(S)+"e").split("e"),ce=d(te[0]+"e"+(+te[1]+$));return te=(dr(ce)+"e").split("e"),+(te[0]+"e"+(+te[1]-$))}return d(S)}}i(kh,"createRound"),o(kh,"createRound");var LD=Jc&&1/Fl(new Jc([,-0]))[1]==m?function(u){return new Jc(u)}:Gh;function tg(u){return function(d){var S=bn(d);return S==be?Xd(d):S==ee?l3(d):i3(d,u(d))}}i(tg,"createToPairs"),o(tg,"createToPairs");function Ta(u,d,S,$,te,ce,ye,Ee){var xe=d&P;if(!xe&&typeof u!="function")throw new Ni(c);var Ue=$?$.length:0;if(Ue||(d&=~(Q|Y),$=te=r),ye=ye===r?ye:Jr(Pt(ye),0),Ee=Ee===r?Ee:Pt(Ee),Ue-=te?te.length:0,d&Y){var Fe=$,$e=te;$=te=r}var Ye=xe?r:ag(u),pt=[u,d,S,$,te,Fe,$e,ce,ye,Ee];if(Ye&&J5(pt,Ye),u=pt[0],d=pt[1],S=pt[2],$=pt[3],te=pt[4],Ee=pt[9]=pt[9]===r?xe?0:u.length:Jr(pt[9]-Ue,0),!Ee&&d&(j|q)&&(d&=~(j|q)),!d||d==D)var St=R5(u,d,S);else d==j||d==q?St=O5(u,d,Ee):(d==Q||d==(D|Q))&&!te.length?St=N5(u,d,S,$):St=Ql.apply(r,pt);var Lt=Ye?E5:Q5;return pg(Lt(St,pt),u,d)}i(Ta,"createWrap"),o(Ta,"createWrap");function rg(u,d,S,$){return u===r||Bi(u,Wc[S])&&!yr.call($,S)?d:u}i(rg,"customDefaultsAssignIn"),o(rg,"customDefaultsAssignIn");function ng(u,d,S,$,te,ce){return kr(u)&&kr(d)&&(ce.set(d,u),Jl(u,d,r,ng,ce),ce.delete(d)),u}i(ng,"customDefaultsMerge"),o(ng,"customDefaultsMerge");function P5(u){return au(u)?r:u}i(P5,"customOmitClone"),o(P5,"customOmitClone");function ig(u,d,S,$,te,ce){var ye=S&x,Ee=u.length,xe=d.length;if(Ee!=xe&&!(ye&&xe>Ee))return!1;var Ue=ce.get(u),Fe=ce.get(d);if(Ue&&Fe)return Ue==d&&Fe==u;var $e=-1,Ye=!0,pt=S&O?new Fo:r;for(ce.set(u,d),ce.set(d,u);++$e<Ee;){var St=u[$e],Lt=d[$e];if($)var _t=ye?$(Lt,St,$e,d,u,ce):$(St,Lt,$e,u,d,ce);if(_t!==r){if(_t)continue;Ye=!1;break}if(pt){if(!Kd(d,function(Ht,Gt){if(!Gc(pt,Gt)&&(St===Ht||te(St,Ht,S,$,ce)))return pt.push(Gt)})){Ye=!1;break}}else if(!(St===Lt||te(St,Lt,S,$,ce))){Ye=!1;break}}return ce.delete(u),ce.delete(d),Ye}i(ig,"equalArrays"),o(ig,"equalArrays");function B5(u,d,S,$,te,ce,ye){switch(S){case ve:if(u.byteLength!=d.byteLength||u.byteOffset!=d.byteOffset)return!1;u=u.buffer,d=d.buffer;case qe:return!(u.byteLength!=d.byteLength||!ce(new ih(u),new ih(d)));case ne:case oe:case Re:return Bi(+u,+d);case G:return u.name==d.name&&u.message==d.message;case ie:case ue:return u==d+"";case be:var Ee=Xd;case ee:var xe=$&x;if(Ee||(Ee=Fl),u.size!=d.size&&!xe)return!1;var Ue=ye.get(u);if(Ue)return Ue==d;$|=O,ye.set(u,d);var Fe=ig(Ee(u),Ee(d),$,te,ce,ye);return ye.delete(u),Fe;case Ae:if(ql)return ql.call(u)==ql.call(d)}return!1}i(B5,"equalByTag"),o(B5,"equalByTag");function L5(u,d,S,$,te,ce){var ye=S&x,Ee=Dh(u),xe=Ee.length,Ue=Dh(d),Fe=Ue.length;if(xe!=Fe&&!ye)return!1;for(var $e=xe;$e--;){var Ye=Ee[$e];if(!(ye?Ye in d:yr.call(d,Ye)))return!1}var pt=ce.get(u),St=ce.get(d);if(pt&&St)return pt==d&&St==u;var Lt=!0;ce.set(u,d),ce.set(d,u);for(var _t=ye;++$e<xe;){Ye=Ee[$e];var Ht=u[Ye],Gt=d[Ye];if($)var Hn=ye?$(Gt,Ht,Ye,d,u,ce):$(Ht,Gt,Ye,u,d,ce);if(!(Hn===r?Ht===Gt||te(Ht,Gt,S,$,ce):Hn)){Lt=!1;break}_t||(_t=Ye=="constructor")}if(Lt&&!_t){var _n=u.constructor,qn=d.constructor;_n!=qn&&"constructor"in u&&"constructor"in d&&!(typeof _n=="function"&&_n instanceof _n&&typeof qn=="function"&&qn instanceof qn)&&(Lt=!1)}return ce.delete(u),ce.delete(d),Lt}i(L5,"equalObjects"),o(L5,"equalObjects");function Ca(u){return hg(fg(u,r,bg),u+"")}i(Ca,"flatRest"),o(Ca,"flatRest");function Dh(u){return T1(u,Zr,og)}i(Dh,"getAllKeys"),o(Dh,"getAllKeys");function Rh(u){return T1(u,Dn,F5)}i(Rh,"getAllKeysIn"),o(Rh,"getAllKeysIn");var ag=lh?function(u){return lh.get(u)}:Gh;function nf(u){for(var d=u.name+"",S=Zc[d],$=yr.call(Zc,d)?S.length:0;$--;){var te=S[$],ce=te.func;if(ce==null||ce==u)return te.name}return d}i(nf,"getFuncName"),o(nf,"getFuncName");function js(u){var d=yr.call(se,"placeholder")?se:u;return d.placeholder}i(js,"getHolder"),o(js,"getHolder");function wt(){var u=se.iteratee||Vh;return u=u===Vh?I1:u,arguments.length?u(arguments[0],arguments[1]):u}i(wt,"getIteratee"),o(wt,"getIteratee");function af(u,d){var S=u.__data__;return K5(d)?S[typeof d=="string"?"string":"hash"]:S.map}i(af,"getMapData"),o(af,"getMapData");function Oh(u){for(var d=Zr(u),S=d.length;S--;){var $=d[S],te=u[$];d[S]=[$,te,ug(te)]}return d}i(Oh,"getMatchData"),o(Oh,"getMatchData");function Ho(u,d){var S=s3(u,d);return M1(S)?S:r}i(Ho,"getNative"),o(Ho,"getNative");function U5(u){var d=yr.call(u,Ls),S=u[Ls];try{u[Ls]=r;var $=!0}catch{}var te=rh.call(u);return $&&(d?u[Ls]=S:delete u[Ls]),te}i(U5,"getRawTag"),o(U5,"getRawTag");var og=g1?function(u){return u==null?[]:(u=_r(u),io(g1(u),function(d){return b3.call(u,d)}))}:Wh,F5=g1?function(u){for(var d=[];u;)ao(d,og(u)),u=ah(u);return d}:Wh,bn=yn;(v1&&bn(new v1(new ArrayBuffer(1)))!=ve||$l&&bn(new $l)!=be||y1&&bn(y1.resolve())!=F||Jc&&bn(new Jc)!=ee||zl&&bn(new zl)!=Ie)&&(bn=o(function(u){var d=yn(u),S=d==N?u.constructor:r,$=S?qo(S):"";if($)switch($){case kD:return ve;case DD:return be;case RD:return F;case OD:return ee;case ND:return Ie}return d},"getTag"));function j5(u,d,S){for(var $=-1,te=S.length;++$<te;){var ce=S[$],ye=ce.size;switch(ce.type){case"drop":u+=ye;break;case"dropRight":d-=ye;break;case"take":d=vn(d,u+ye);break;case"takeRight":u=Jr(u,d-ye);break}}return{start:u,end:d}}i(j5,"getView"),o(j5,"getView");function $5(u){var d=u.match(Ze);return d?d[1].split(cr):[]}i($5,"getWrapDetails"),o($5,"getWrapDetails");function sg(u,d,S){d=co(d,u);for(var $=-1,te=d.length,ce=!1;++$<te;){var ye=Qi(d[$]);if(!(ce=u!=null&&S(u,ye)))break;u=u[ye]}return ce||++$!=te?ce:(te=u==null?0:u.length,!!te&&df(te)&&Ma(ye,te)&&(Nt(u)||$s(u)))}i(sg,"hasPath"),o(sg,"hasPath");function z5(u){var d=u.length,S=new u.constructor(d);return d&&typeof u[0]=="string"&&yr.call(u,"index")&&(S.index=u.index,S.input=u.input),S}i(z5,"initCloneArray"),o(z5,"initCloneArray");function cg(u){return typeof u.constructor=="function"&&!iu(u)?Yc(ah(u)):{}}i(cg,"initCloneObject"),o(cg,"initCloneObject");function H5(u,d,S){var $=u.constructor;switch(d){case qe:return Mh(u);case ne:case oe:return new $(+u);case ve:return T5(u,S);case pe:case re:case le:case _e:case Te:case Ce:case Oe:case Ct:case Ve:return H1(u,S);case be:return new $;case Re:case ue:return new $(u);case ie:return C5(u);case ee:return new $;case Ae:return M5(u)}}i(H5,"initCloneByTag"),o(H5,"initCloneByTag");function q5(u,d){var S=d.length;if(!S)return u;var $=S-1;return d[$]=(S>1?"& ":"")+d[$],d=d.join(S>2?", ":" "),u.replace(ot,`{
24
+ `):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl")});function uy(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(uy,"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,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=cy(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 g=this.initialTeardown;if(ji(g))try{g()}catch(O){s=O instanceof Wp?O.errors:[O]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=cy(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{a7(x)}catch(O){s=s??[],O instanceof Wp?s=Mu(Mu([],Cu(s)),Cu(O.errors)):s.push(O)}}}catch(O){n={error:O}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new Wp(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)a7(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)&&uy(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&uy(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var kJ=Jp.EMPTY;function Zp(e){return e instanceof Jp||e&&"closed"in e&&ji(e.remove)&&ji(e.add)&&ji(e.unsubscribe)}i(Zp,"isSubscription");function a7(e){ji(e)?e():e.unsubscribe()}i(a7,"execFinalizer");var aa={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var Iu={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=Iu.delegate;return a?.setTimeout?a.setTimeout.apply(a,Mu([e,t],Cu(r))):setTimeout.apply(void 0,Mu([e,t],Cu(r)))},clearTimeout:function(e){var t=Iu.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function o7(e){Iu.setTimeout(function(){var t=aa.onUnhandledError;if(t)t(e);else throw e})}i(o7,"reportUnhandledError");function ly(){}i(ly,"noop");var s7=function(){return fy("C",void 0,void 0)}();function c7(e){return fy("E",void 0,e)}i(c7,"errorNotification");function u7(e){return fy("N",e,void 0)}i(u7,"nextNotification");function fy(e,t,r){return{kind:e,value:t,error:r}}i(fy,"createNotification");var ac=null;function l7(e){if(aa.useDeprecatedSynchronousErrorHandling){var t=!ac;if(t&&(ac={errorThrown:!1,error:null}),e(),t){var r=ac,n=r.errorThrown,a=r.error;if(ac=null,n)throw a}}else e()}i(l7,"errorContext");function f7(e){aa.useDeprecatedSynchronousErrorHandling&&ac&&(ac.errorThrown=!0,ac.error=e)}i(f7,"captureError");var py=function(e){sy(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=JL,n}return i(t,"Subscriber"),t.create=function(r,n,a){return new Xp(r,n,a)},t.prototype.next=function(r){this.isStopped?hy(u7(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?hy(c7(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?hy(s7,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 KL=Function.prototype.bind;function dy(e,t){return KL.call(e,t)}i(dy,"bind");var GL=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){Yp(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Yp(n)}else Yp(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Yp(r)}},e}(),Xp=function(e){sy(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(ji(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&aa.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&dy(r.next,l),error:r.error&&dy(r.error,l),complete:r.complete&&dy(r.complete,l)}):c=r}return s.destination=new GL(c),s}return i(t,"SafeSubscriber"),t}(py);function Yp(e){aa.useDeprecatedSynchronousErrorHandling?f7(e):o7(e)}i(Yp,"handleUnhandledError");function WL(e){throw e}i(WL,"defaultErrorHandler");function hy(e,t){var r=aa.onStoppedNotification;r&&Iu.setTimeout(function(){return r(e,t)})}i(hy,"handleStoppedNotification");var JL={closed:!0,next:ly,error:WL,complete:ly};var d7=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function h7(e){return e}i(h7,"identity");function p7(e){return e.length===0?h7:e.length===1?e[0]:i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped")}i(p7,"pipeFromArray");var my=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 a=this,s=YL(t)?t:new Xp(t,r,n);return l7(function(){var c=a,l=c.operator,h=c.source;s.add(l?l.call(s,h):h?a._subscribe(s):a._trySubscribe(s))}),s},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=m7(r),new r(function(a,s){var c=new Xp({next:function(l){try{t(l)}catch(h){s(h),c.unsubscribe()}},error:s,complete:a});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[d7]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return p7(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=m7(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function m7(e){var t;return(t=e??aa.Promise)!==null&&t!==void 0?t:Promise}i(m7,"getPromiseCtor");function ZL(e){return e&&ji(e.next)&&ji(e.error)&&ji(e.complete)}i(ZL,"isObserver");function YL(e){return e&&e instanceof py||ZL(e)&&Zp(e)}i(YL,"isSubscriber");var g7;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(g7||(g7={}));var v7;(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"})(v7||(v7={}));var vy;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(vy||(vy={}));var Nf=class extends my{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,gy.default)(t?.content??r)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return hr.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:t})=>hr.make(this.id,t))}get anchorCommitIds(){return this.state$.value.log.filter(({type:t})=>t===vy.ANCHOR).map(({cid:t})=>hr.make(this.id,t))}get state(){return(0,gy.default)(this.state$.value)}async sync(t={}){t={sync:ic.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(Nf,"Stream");function y7(){return e=>{}}i(y7,"StreamStatic");var XL=function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},mi,yy={anchor:!0,publish:!0,pin:!0,sync:ic.PREFER_CACHE},QL={sync:ic.PREFER_CACHE},b7={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function by(e,t){if(typeof e?.schema=="string")try{hr.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=dv((0,E7.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(by,"headerFromMetadata");async function w7(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(w7,"getAuthenticatedDID");async function wy(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(wy,"throwReadOnlyError");var Zo=mi=i(class extends Nf{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,_7.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...yy,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await mi.makeGenesis(s,r,n);return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...yy,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await mi._signDagJWS(t,r):r;return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,a,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 a=await mi.makeGenesis(t,null,r);return t.createStreamFromGenesis(mi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...QL,...n};let a=Qs.from(r);if(a.type!=mi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${mi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...b7,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...b7,...r};let a={header:by(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await mi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=wy,this.patch=wy,this.sync=wy,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return mi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=by(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 a=e9.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await w7(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 a=by(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:a};return xv(c),c}let s={data:r,header:a};return mi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await w7(t)).createDagJWS(r)}},"TileDocument");Zo.STREAM_TYPE_NAME="tile";Zo.STREAM_TYPE_ID=0;Zo=mi=XL([y7()],Zo);var I7=Vs(x7(),1);function uU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(uU,"_checkPrivateRedeclaration");function lU(e,t){return t.get?t.get.call(e):t.value}i(lU,"_classApplyDescriptorGet");function fU(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(fU,"_classApplyDescriptorSet");function M7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(M7,"_classExtractFieldDescriptor");function Sy(e,t){var r=M7(e,t,"get");return lU(e,r)}i(Sy,"_classPrivateFieldGet");function T7(e,t,r){uU(e,t),t.set(e,r)}i(T7,"_classPrivateFieldInit");function C7(e,t,r){var n=M7(e,t,"set");return fU(e,n,r),r}i(C7,"_classPrivateFieldSet");function dU(e){return typeof e=="string"||hr.isInstance(e)||Yt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(dU,"keyToQuery");function xy(e){return typeof e=="string"?Qs.from(e).toString():hr.isInstance(e)||Yt.isInstance(e)?e.toString():e.streamId.toString()}i(xy,"keyToString");async function Cy(e){let t=await Zo.makeGenesis({},null,{...e,deterministic:!0}),r=await Yt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(Cy,"getDeterministicQuery");var hU=i(()=>Promise.resolve([]),"tempBatchLoadFn"),Qp=new WeakMap,Ty=new WeakMap,oc=class extends I7.default{cache(t){if(!Sy(this,Ty))return!1;let r=t.id.toString();return this.clear(r).prime(r,t),!0}async create(t,r,n){let a=await Zo.create(Sy(this,Qp),t,r,n);return this.cache(a),a}async deterministic(t,r){let n=await Cy(t);try{return await super.load(n)}catch{let s=await Zo.createFromGenesis(Sy(this,Qp),n.genesis,r);return this.cache(s),s}}async load(t){return await super.load(t)}async update(t,r,n,a){let s=xy(t);this.clear(s);let c=await this.load({streamId:s});return await c.update(r,n,a),c}constructor(t){super(hU,{cache:!0,cacheKeyFn:xy,cacheMap:t.cache!=null&&typeof t.cache!="boolean"?t.cache:void 0}),T7(this,Qp,{writable:!0,value:void 0}),T7(this,Ty,{writable:!0,value:void 0}),this._batchLoadFn=async r=>{t.cache||this.clearAll();let n=await t.ceramic.multiQuery(r.map(dU),t.multiqueryTimeout);return r.map(a=>{let s=xy(a),c=n[s];return c||new Error(`Failed to load stream: ${s}`)})},C7(this,Qp,t.ceramic),C7(this,Ty,!!t.cache)}};i(oc,"TileLoader");function pU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(pU,"_checkPrivateRedeclaration");function mU(e,t){return t.get?t.get.call(e):t.value}i(mU,"_classApplyDescriptorGet");function gU(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(gU,"_classApplyDescriptorSet");function D7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(D7,"_classExtractFieldDescriptor");function sc(e,t){var r=D7(e,t,"get");return mU(e,r)}i(sc,"_classPrivateFieldGet");function k7(e,t,r){pU(e,t),t.set(e,r)}i(k7,"_classPrivateFieldInit");function My(e,t,r){var n=D7(e,t,"set");return gU(e,n,r),r}i(My,"_classPrivateFieldSet");var ku=new WeakMap,Du=new WeakMap,Ru=class{get aliases(){return sc(this,ku)}get loader(){return sc(this,Du)}getDefinitionID(t){return sc(this,ku).definitions[t]??null}getSchemaURL(t){return sc(this,ku).schemas[t]??null}getTileID(t){return sc(this,ku).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 sc(this,Du).load(r)}async createTile(t,r,n={}){let a=this.getSchemaURL(t);if(a==null)throw new Error(`Schema alias "${t}" is not defined`);let{controller:s,...c}=n,l={schema:a};return s!=null&&(l.controllers=[s]),await sc(this,Du).create(r,l,c)}constructor(t){if(k7(this,ku,{writable:!0,value:void 0}),k7(this,Du,{writable:!0,value:void 0}),My(this,ku,t.aliases),t.loader!=null)My(this,Du,t.loader);else{if(t.ceramic==null)throw new Error("Invalid DataModel parameters: missing ceramic or loader");My(this,Du,new oc({ceramic:t.ceramic,cache:t.cache}))}}};i(Ru,"DataModel");function vU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(vU,"_checkPrivateRedeclaration");function yU(e,t){return t.get?t.get.call(e):t.value}i(yU,"_classApplyDescriptorGet");function bU(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(bU,"_classApplyDescriptorSet");function R7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(R7,"_classExtractFieldDescriptor");function Na(e,t){var r=R7(e,t,"get");return yU(e,r)}i(Na,"_classPrivateFieldGet");function e0(e,t,r){vU(e,t),t.set(e,r)}i(e0,"_classPrivateFieldInit");function t0(e,t,r){var n=R7(e,t,"set");return bU(e,n,r),r}i(t0,"_classPrivateFieldSet");var r0=new WeakMap,cc=new WeakMap,Iy=new WeakMap,n0=new WeakMap,Pf=class{_createValuePromise(){t0(this,Iy,new Promise((t,r)=>{t0(this,n0,{resolve:t,reject:r})}))}change(t){return new Promise((r,n)=>{let a=i(async s=>{try{let c=await t(s);r(),this._next(c)}catch(c){n(c),this._next(s)}},"run");Na(this,cc).push({reject:n,run:a}),Na(this,cc).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 Na(this,cc).length===0?await Na(this,r0).call(this):await Na(this,Iy)}async _start(){try{let t=await Na(this,r0).call(this);this._next(t)}catch(t){Na(this,cc).forEach(r=>{r.reject(t)}),t0(this,cc,[]),Na(this,n0).reject(t),this._createValuePromise()}}_next(t){let r=Na(this,cc).shift();r==null?this._end(t):r.run(t)}_end(t){Na(this,n0).resolve(t),this._createValuePromise()}constructor(t){e0(this,r0,{writable:!0,value:void 0}),e0(this,cc,{writable:!0,value:[]}),e0(this,Iy,{writable:!0,value:void 0}),e0(this,n0,{writable:!0,value:void 0}),t0(this,r0,t),this._createValuePromise()}};i(Pf,"TileProxy");var wU=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function _U(e){return wU.test(e)}i(_U,"isDIDstring");function EU(e){if(!_U(e))throw new Error(`Invalid DID: ${e}`)}i(EU,"assertDIDstring");function ky(e){return EU(e),{controllers:[e],family:"IDX"}}i(ky,"getIDXMetadata");function AU(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(AU,"_checkPrivateRedeclaration");function SU(e,t){return t.get?t.get.call(e):t.value}i(SU,"_classApplyDescriptorGet");function xU(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(xU,"_classApplyDescriptorSet");function O7(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(O7,"_classExtractFieldDescriptor");function $r(e,t){var r=O7(e,t,"get");return SU(e,r)}i($r,"_classPrivateFieldGet");function Bf(e,t,r){AU(e,t),t.set(e,r)}i(Bf,"_classPrivateFieldInit");function i0(e,t,r){var n=O7(e,t,"set");return xU(e,n,r),r}i(i0,"_classPrivateFieldSet");var vo=new WeakMap,a0=new WeakMap,Dy=new WeakMap,Pa=new WeakMap,o0=new WeakMap,Lf=class{get authenticated(){return $r(this,vo).did!=null}get ceramic(){return $r(this,vo)}get id(){if($r(this,a0)!=null)return $r(this,a0);if($r(this,vo).did==null)throw new Error("Ceramic instance is not authenticated");return $r(this,vo).did.hasParent?$r(this,vo).did.parent:$r(this,vo).did.id}get loader(){return $r(this,Pa)}get model(){return $r(this,o0)}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),a=await Promise.all(r.map(async l=>{let{genesis:h,streamId:p}=await Cy(ky(l));return{genesis:h,streamId:p.toString(),paths:[n]}})),s=await $r(this,vo).multiQuery(a),c=[];for(let l of a){let h=s[l.streamId]?.content?.[n],p=h?s[Yt.fromString(h).toString()]:null;c.push(p?.content??null)}return c}async set(t,r,n={}){let a=this.getDefinitionID(t),[s,c]=await this._setRecordOnly(a,r,n);return s&&await this._setReference(n.controller??this.id,a,c),c}async merge(t,r,n={}){let a=this.getDefinitionID(t),s=await this.getRecord(a),c=s?{...s,...r}:r;return await this.setRecord(a,c,n)}async setAll(t,r={}){let n=Object.entries(t).map(async([c,l])=>{let h=this.getDefinitionID(c),[p,g]=await this._setRecordOnly(h,l,r);return[p,h,g]}),s=(await Promise.all(n)).reduce((c,[l,h,p])=>(l&&(c[h]=p.toUrl()),c),{});return await this._setReferences(r.controller??this.id,s),s}async setDefaults(t,r={}){let n=await this.getIndex()??{},a=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),g=await this._createRecord(p,h,r);return{[l]:g.toUrl()}}),c=(await Promise.all(a)).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[a,s]=r[n++],c=await $r(this,Pa).load(s);return{done:!1,value:{key:a,id:s,record:c.content}}}}}async _createIDXDoc(t){return await $r(this,Pa).deterministic(ky(t))}async _getIDXDoc(t){let r=await this._createIDXDoc(t);if(r.content==null||r.metadata.schema==null)return null;if(r.metadata.schema!==Sp)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:Sp});else if(r.metadata.schema!==Sp)throw new Error("Invalid document: schema is not IdentityIndex");return r}_getIndexProxy(t){let r=$r(this,Dy)[t];return r==null&&(r=new Pf(async()=>await this._getOwnIDXDoc(t)),$r(this,Dy)[t]=r),r}getDefinitionID(t){return $r(this,o0).getDefinitionID(t)??t}async getDefinition(t){let r=await $r(this,Pa).load(t);if(r.metadata.schema!==YE)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 $r(this,Pa).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[a,s]=await this._setRecordOnly(t,r,n);return a&&await this._setReference(n.controller??this.id,t,s),s}async _setRecordOnly(t,r,n){let a=await this.getRecordID(t,n.controller??this.id);if(a==null){let s=await this.getDefinition(t),c=await this._createRecord(s,r,n);return[!0,c]}else{let s=await $r(this,Pa).update(a,r);return[!1,s.id]}}async _createRecord(t,r,{controller:n,pin:a}){let s=await $r(this,Pa).deterministic({controllers:[n??this.id],family:t.id.toString()},{pin:a});return await s.update(r,{schema:t.schema}),s.id}async _setReference(t,r,n){await this._getIndexProxy(t).changeContent(a=>({...a,[r]:n.toUrl()}))}async _setReferences(t,r){Object.keys(r).length!==0&&await this._getIndexProxy(t).changeContent(n=>({...n,...r}))}constructor(t){Bf(this,vo,{writable:!0,value:void 0}),Bf(this,a0,{writable:!0,value:void 0}),Bf(this,Dy,{writable:!0,value:{}}),Bf(this,Pa,{writable:!0,value:void 0}),Bf(this,o0,{writable:!0,value:void 0});let{cache:r,ceramic:n,id:a,loader:s,model:c}=t;i0(this,vo,n),i0(this,a0,a),i0(this,Pa,s??new oc({ceramic:n,cache:r})),i0(this,o0,c instanceof Ru?c:new Ru({loader:$r(this,Pa),aliases:c}))}};i(Lf,"DIDDataStore");var rr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(rr||(rr={}));var tt=rr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Yo=i(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"),Ke=rr.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"]),TU=i(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),$i=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(s){return s.message},n={_errors:[]},a=i(s=>{for(let c of s.issues)if(c.code==="invalid_union")c.unionErrors.map(a);else if(c.code==="invalid_return_type")a(c.returnTypeError);else if(c.code==="invalid_arguments")a(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 a(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,rr.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let a of this.issues)a.path.length>0?(r[a.path[0]]=r[a.path[0]]||[],r[a.path[0]].push(t(a))):n.push(t(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};i($i,"ZodError");$i.create=e=>new $i(e);var Ff=i((e,t)=>{let r;switch(e.code){case Ke.invalid_type:e.received===tt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ke.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,rr.jsonStringifyReplacer)}`;break;case Ke.unrecognized_keys:r=`Unrecognized key(s) in object: ${rr.joinValues(e.keys,", ")}`;break;case Ke.invalid_union:r="Invalid input";break;case Ke.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${rr.joinValues(e.options)}`;break;case Ke.invalid_enum_value:r=`Invalid enum value. Expected ${rr.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}"`:rr.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,rr.assertNever(e)}return{message:r}},"errorMap"),L7=Ff;function CU(e){L7=e}i(CU,"setErrorMap");function c0(){return L7}i(c0,"getErrorMap");var u0=i(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:a.message||l}},"makeIssue"),MU=[];function vt(e,t){let r=u0({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,c0(),Ff].filter(n=>!!n)});e.common.issues.push(r)}i(vt,"addIssueToContext");var en=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 a of r){if(a.status==="aborted")return Dt;a.status==="dirty"&&t.dirty(),n.push(a.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){let n=[];for(let a of r)n.push({key:await a.key,value:await a.value});return en.mergeObjectSync(t,n)}static mergeObjectSync(t,r){let n={};for(let a of r){let{key:s,value:c}=a;if(s.status==="aborted"||c.status==="aborted")return Dt;s.status==="dirty"&&t.dirty(),c.status==="dirty"&&t.dirty(),(typeof c.value<"u"||a.alwaysSet)&&(n[s.value]=c.value)}return{status:t.value,value:n}}};i(en,"ParseStatus");var Dt=Object.freeze({status:"aborted"}),U7=i(e=>({status:"dirty",value:e}),"DIRTY"),Sn=i(e=>({status:"valid",value:e}),"OK"),Ry=i(e=>e.status==="aborted","isAborted"),Oy=i(e=>e.status==="dirty","isDirty"),l0=i(e=>e.status==="valid","isValid"),f0=i(e=>typeof Promise!==void 0&&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 gi=class{constructor(t,r,n,a){this.parent=t,this.data=r,this._path=n,this._key=a}get path(){return this._path.concat(this._key)}};i(gi,"ParseInputLazyPath");var N7=i((e,t)=>{if(l0(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new $i(e.common.issues);return{success:!1,error:r}}},"handleResult");function Vt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=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:a}:{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:a}}i(Vt,"processCreateParams");var Bt=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 Yo(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:Yo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new en,ctx:{common:t.parent.common,data:t.data,parsedType:Yo(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(f0(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 a={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:Yo(t)},s=this._parseSync({data:t,path:a.path,parent:a});return N7(a,s)}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:Yo(t)},a=this._parse({data:t,path:n.path,parent:n}),s=await(f0(a)?a:Promise.resolve(a));return N7(n,s)}refine(t,r){let n=i(a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r,"getIssueProperties");return this._refinement((a,s)=>{let c=t(a),l=i(()=>s.addIssue({code:Ke.custom,...n(a)}),"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,a)=>t(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(t){return new Wn({schema:this,typeName:xt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return yi.create(this)}nullable(){return Fa.create(this)}nullish(){return this.optional().nullable()}array(){return Gn.create(this)}promise(){return wo.create(this)}or(t){return rs.create([this,t])}and(t){return ns.create(this,t)}transform(t){return new Wn({schema:this,typeName:xt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new us({innerType:this,defaultValue:r,typeName:xt.ZodDefault})}brand(){return new Uf({typeName:xt.ZodBranded,type:this,...Vt(void 0)})}catch(t){let r=typeof t=="function"?t:()=>t;return new hc({innerType:this,defaultValue:r,typeName:xt.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return ls.create(this,t)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};i(Bt,"ZodType");var IU=/^c[^\s-]{8,}$/i,kU=/^([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,DU=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,RU=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"),zi=class extends Bt{constructor(){super(...arguments),this._regex=(t,r,n)=>this.refinement(a=>t.test(a),{validation:r,code:Ke.invalid_string,...Wt.errToObj(n)}),this.nonempty=t=>this.min(1,Wt.errToObj(t)),this.trim=()=>new zi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==tt.string){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.string,received:s.parsedType}),Dt}let n=new en,a;for(let s of this._def.checks)if(s.kind==="min")t.data.length<s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")t.data.length>s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){let c=t.data.length>s.value,l=t.data.length<s.value;(c||l)&&(a=this._getOrReturnCtx(t,a),c?vt(a,{code:Ke.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):l&&vt(a,{code:Ke.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")DU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"email",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")kU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"uuid",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")IU.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"cuid",code:Ke.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(t.data)}catch{a=this._getOrReturnCtx(t,a),vt(a,{validation:"url",code:Ke.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{validation:"regex",code:Ke.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?t.data=t.data.trim():s.kind==="startsWith"?t.data.startsWith(s.value)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?t.data.endsWith(s.value)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?RU(s).test(t.data)||(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.invalid_string,validation:"datetime",message:s.message}),n.dirty()):rr.assertNever(s);return{status:n.value,value:t.data}}_addCheck(t){return new zi({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Wt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Wt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Wt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Wt.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,...Wt.errToObj(t?.message)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Wt.errToObj(r)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Wt.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Wt.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Wt.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Wt.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Wt.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 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(zi,"ZodString");zi.create=e=>{var t;return new zi({checks:[],typeName:xt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Vt(e)})};function OU(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(OU,"floatSafeRemainder");var oa=class extends Bt{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)!==tt.number){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.number,received:s.parsedType}),Dt}let n,a=new en;for(let s of this._def.checks)s.kind==="int"?rr.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?t.data<s.value:t.data<=s.value)&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?t.data>s.value:t.data>=s.value)&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?OU(t.data,s.value)!==0&&(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),vt(n,{code:Ke.not_finite,message:s.message}),a.dirty()):rr.assertNever(s);return{status:a.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Wt.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Wt.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Wt.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Wt.toString(r))}setLimit(t,r,n,a){return new oa({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Wt.toString(a)}]})}_addCheck(t){return new oa({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Wt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Wt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Wt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Wt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Wt.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Wt.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Wt.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")}};i(oa,"ZodNumber");oa.create=e=>new oa({checks:[],typeName:xt.ZodNumber,coerce:e?.coerce||!1,...Vt(e)});var Xo=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==tt.bigint){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.bigint,received:n.parsedType}),Dt}return Sn(t.data)}};i(Xo,"ZodBigInt");Xo.create=e=>{var t;return new Xo({typeName:xt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...Vt(e)})};var Qo=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==tt.boolean){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.boolean,received:n.parsedType}),Dt}return Sn(t.data)}};i(Qo,"ZodBoolean");Qo.create=e=>new Qo({typeName:xt.ZodBoolean,coerce:e?.coerce||!1,...Vt(e)});var Ba=class extends Bt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==tt.date){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_type,expected:tt.date,received:s.parsedType}),Dt}if(isNaN(t.data.getTime())){let s=this._getOrReturnCtx(t);return vt(s,{code:Ke.invalid_date}),Dt}let n=new en,a;for(let s of this._def.checks)s.kind==="min"?t.data.getTime()<s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?t.data.getTime()>s.value&&(a=this._getOrReturnCtx(t,a),vt(a,{code:Ke.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):rr.assertNever(s);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ba({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Wt.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Wt.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(Ba,"ZodDate");Ba.create=e=>new Ba({checks:[],coerce:e?.coerce||!1,typeName:xt.ZodDate,...Vt(e)});var uc=class extends Bt{_parse(t){if(this._getType(t)!==tt.symbol){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.symbol,received:n.parsedType}),Dt}return Sn(t.data)}};i(uc,"ZodSymbol");uc.create=e=>new uc({typeName:xt.ZodSymbol,...Vt(e)});var es=class extends Bt{_parse(t){if(this._getType(t)!==tt.undefined){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.undefined,received:n.parsedType}),Dt}return Sn(t.data)}};i(es,"ZodUndefined");es.create=e=>new es({typeName:xt.ZodUndefined,...Vt(e)});var ts=class extends Bt{_parse(t){if(this._getType(t)!==tt.null){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.null,received:n.parsedType}),Dt}return Sn(t.data)}};i(ts,"ZodNull");ts.create=e=>new ts({typeName:xt.ZodNull,...Vt(e)});var yo=class extends Bt{constructor(){super(...arguments),this._any=!0}_parse(t){return Sn(t.data)}};i(yo,"ZodAny");yo.create=e=>new yo({typeName:xt.ZodAny,...Vt(e)});var La=class extends Bt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Sn(t.data)}};i(La,"ZodUnknown");La.create=e=>new La({typeName:xt.ZodUnknown,...Vt(e)});var Hi=class extends Bt{_parse(t){let r=this._getOrReturnCtx(t);return vt(r,{code:Ke.invalid_type,expected:tt.never,received:r.parsedType}),Dt}};i(Hi,"ZodNever");Hi.create=e=>new Hi({typeName:xt.ZodNever,...Vt(e)});var lc=class extends Bt{_parse(t){if(this._getType(t)!==tt.undefined){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.void,received:n.parsedType}),Dt}return Sn(t.data)}};i(lc,"ZodVoid");lc.create=e=>new lc({typeName:xt.ZodVoid,...Vt(e)});var Gn=class extends Bt{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),a=this._def;if(r.parsedType!==tt.array)return vt(r,{code:Ke.invalid_type,expected:tt.array,received:r.parsedType}),Dt;if(a.exactLength!==null){let c=r.data.length>a.exactLength.value,l=r.data.length<a.exactLength.value;(c||l)&&(vt(r,{code:c?Ke.too_big:Ke.too_small,minimum:l?a.exactLength.value:void 0,maximum:c?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(vt(r,{code:Ke.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(vt(r,{code:Ke.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all(r.data.map((c,l)=>a.type._parseAsync(new gi(r,c,r.path,l)))).then(c=>en.mergeArray(n,c));let s=r.data.map((c,l)=>a.type._parseSync(new gi(r,c,r.path,l)));return en.mergeArray(n,s)}get element(){return this._def.type}min(t,r){return new Gn({...this._def,minLength:{value:t,message:Wt.toString(r)}})}max(t,r){return new Gn({...this._def,maxLength:{value:t,message:Wt.toString(r)}})}length(t,r){return new Gn({...this._def,exactLength:{value:t,message:Wt.toString(r)}})}nonempty(t){return this.min(1,t)}};i(Gn,"ZodArray");Gn.create=(e,t)=>new Gn({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xt.ZodArray,...Vt(t)});var d0;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(d0||(d0={}));var P7=i(e=>t=>new Er({...e,shape:()=>({...e.shape(),...t})}),"AugmentFactory");function Ou(e){if(e instanceof Er){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=yi.create(Ou(n))}return new Er({...e._def,shape:()=>t})}else return e instanceof Gn?Gn.create(Ou(e.element)):e instanceof yi?yi.create(Ou(e.unwrap())):e instanceof Fa?Fa.create(Ou(e.unwrap())):e instanceof vi?vi.create(e.items.map(t=>Ou(t))):e}i(Ou,"deepPartialify");var Er=class extends Bt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=P7(this._def),this.extend=P7(this._def)}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=rr.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(t){if(this._getType(t)!==tt.object){let p=this._getOrReturnCtx(t);return vt(p,{code:Ke.invalid_type,expected:tt.object,received:p.parsedType}),Dt}let{status:n,ctx:a}=this._processInputParams(t),{shape:s,keys:c}=this._getCached(),l=[];if(!(this._def.catchall instanceof Hi&&this._def.unknownKeys==="strip"))for(let p in a.data)c.includes(p)||l.push(p);let h=[];for(let p of c){let g=s[p],v=a.data[p];h.push({key:{status:"valid",value:p},value:g._parse(new gi(a,v,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof Hi){let p=this._def.unknownKeys;if(p==="passthrough")for(let g of l)h.push({key:{status:"valid",value:g},value:{status:"valid",value:a.data[g]}});else if(p==="strict")l.length>0&&(vt(a,{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 g of l){let v=a.data[g];h.push({key:{status:"valid",value:g},value:p._parse(new gi(a,v,a.path,g)),alwaysSet:g in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let g of h){let v=await g.key;p.push({key:v,value:await g.value,alwaysSet:g.alwaysSet})}return p}).then(p=>en.mergeObjectSync(n,p)):en.mergeObjectSync(n,h)}get shape(){return this._def.shape()}strict(t){return Wt.errToObj,new Er({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var a,s,c,l;let h=(c=(s=(a=this._def).errorMap)===null||s===void 0?void 0:s.call(a,r,n).message)!==null&&c!==void 0?c:n.defaultError;return r.code==="unrecognized_keys"?{message:(l=Wt.errToObj(t).message)!==null&&l!==void 0?l:h}:{message:h}}}:{}})}strip(){return new Er({...this._def,unknownKeys:"strip"})}passthrough(){return new Er({...this._def,unknownKeys:"passthrough"})}setKey(t,r){return this.augment({[t]:r})}merge(t){return new Er({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>d0.mergeShapes(this._def.shape(),t._def.shape()),typeName:xt.ZodObject})}catchall(t){return new Er({...this._def,catchall:t})}pick(t){let r={};return rr.objectKeys(t).map(n=>{this.shape[n]&&(r[n]=this.shape[n])}),new Er({...this._def,shape:()=>r})}omit(t){let r={};return rr.objectKeys(this.shape).map(n=>{rr.objectKeys(t).indexOf(n)===-1&&(r[n]=this.shape[n])}),new Er({...this._def,shape:()=>r})}deepPartial(){return Ou(this)}partial(t){let r={};if(t)return rr.objectKeys(this.shape).map(n=>{rr.objectKeys(t).indexOf(n)===-1?r[n]=this.shape[n]:r[n]=this.shape[n].optional()}),new Er({...this._def,shape:()=>r});for(let n in this.shape){let a=this.shape[n];r[n]=a.optional()}return new Er({...this._def,shape:()=>r})}required(t){let r={};if(t)rr.objectKeys(this.shape).map(n=>{if(rr.objectKeys(t).indexOf(n)===-1)r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof yi;)s=s._def.innerType;r[n]=s}});else for(let n in this.shape){let s=this.shape[n];for(;s instanceof yi;)s=s._def.innerType;r[n]=s}return new Er({...this._def,shape:()=>r})}keyof(){return F7(rr.objectKeys(this.shape))}};i(Er,"ZodObject");Er.create=(e,t)=>new Er({shape:()=>e,unknownKeys:"strip",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});Er.strictCreate=(e,t)=>new Er({shape:()=>e,unknownKeys:"strict",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});Er.lazycreate=(e,t)=>new Er({shape:e,unknownKeys:"strip",catchall:Hi.create(),typeName:xt.ZodObject,...Vt(t)});var rs=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function a(s){for(let l of s)if(l.result.status==="valid")return l.result;for(let l of s)if(l.result.status==="dirty")return r.common.issues.push(...l.ctx.common.issues),l.result;let c=s.map(l=>new $i(l.ctx.common.issues));return vt(r,{code:Ke.invalid_union,unionErrors:c}),Dt}if(i(a,"handleResults"),r.common.async)return Promise.all(n.map(async s=>{let c={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:c}),ctx:c}})).then(a);{let s,c=[];for(let h of n){let p={...r,common:{...r.common,issues:[]},parent:null},g=h._parseSync({data:r.data,path:r.path,parent:p});if(g.status==="valid")return g;g.status==="dirty"&&!s&&(s={result:g,ctx:p}),p.common.issues.length&&c.push(p.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;let l=c.map(h=>new $i(h));return vt(r,{code:Ke.invalid_union,unionErrors:l}),Dt}}get options(){return this._def.options}};i(rs,"ZodUnion");rs.create=(e,t)=>new rs({options:e,typeName:xt.ZodUnion,...Vt(t)});var s0=i(e=>e instanceof as?s0(e.schema):e instanceof Wn?s0(e.innerType()):e instanceof os?[e.value]:e instanceof ss?e.options:e instanceof cs?Object.keys(e.enum):e instanceof us?s0(e._def.innerType):e instanceof es?[void 0]:e instanceof ts?[null]:null,"getDiscriminator"),fc=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.object)return vt(r,{code:Ke.invalid_type,expected:tt.object,received:r.parsedType}),Dt;let n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(vt(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 a=new Map;for(let s of r){let c=s0(s.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(a.has(l))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(l)}`);a.set(l,s)}}return new fc({typeName:xt.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:a,...Vt(n)})}};i(fc,"ZodDiscriminatedUnion");function Ny(e,t){let r=Yo(e),n=Yo(t);if(e===t)return{valid:!0,data:e};if(r===tt.object&&n===tt.object){let a=rr.objectKeys(t),s=rr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let h=Ny(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 a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],h=Ny(c,l);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return r===tt.date&&n===tt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(Ny,"mergeValues");var ns=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),a=i((s,c)=>{if(Ry(s)||Ry(c))return Dt;let l=Ny(s.value,c.value);return l.valid?((Oy(s)||Oy(c))&&r.dirty(),{status:r.value,value:l.data}):(vt(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(([s,c])=>a(s,c)):a(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(ns,"ZodIntersection");ns.create=(e,t,r)=>new ns({left:e,right:t,typeName:xt.ZodIntersection,...Vt(r)});var vi=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.array)return vt(n,{code:Ke.invalid_type,expected:tt.array,received:n.parsedType}),Dt;if(n.data.length<this._def.items.length)return vt(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&&(vt(n,{code:Ke.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let s=n.data.map((c,l)=>{let h=this._def.items[l]||this._def.rest;return h?h._parse(new gi(n,c,n.path,l)):null}).filter(c=>!!c);return n.common.async?Promise.all(s).then(c=>en.mergeArray(r,c)):en.mergeArray(r,s)}get items(){return this._def.items}rest(t){return new vi({...this._def,rest:t})}};i(vi,"ZodTuple");vi.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new vi({items:e,typeName:xt.ZodTuple,rest:null,...Vt(t)})};var is=class extends Bt{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!==tt.object)return vt(n,{code:Ke.invalid_type,expected:tt.object,received:n.parsedType}),Dt;let a=[],s=this._def.keyType,c=this._def.valueType;for(let l in n.data)a.push({key:s._parse(new gi(n,l,n.path,l)),value:c._parse(new gi(n,n.data[l],n.path,l))});return n.common.async?en.mergeObjectAsync(r,a):en.mergeObjectSync(r,a)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Bt?new is({keyType:t,valueType:r,typeName:xt.ZodRecord,...Vt(n)}):new is({keyType:zi.create(),valueType:t,typeName:xt.ZodRecord,...Vt(r)})}};i(is,"ZodRecord");var dc=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.map)return vt(n,{code:Ke.invalid_type,expected:tt.map,received:n.parsedType}),Dt;let a=this._def.keyType,s=this._def.valueType,c=[...n.data.entries()].map(([l,h],p)=>({key:a._parse(new gi(n,l,n.path,[p,"key"])),value:s._parse(new gi(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,g=await h.value;if(p.status==="aborted"||g.status==="aborted")return Dt;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}})}else{let l=new Map;for(let h of c){let p=h.key,g=h.value;if(p.status==="aborted"||g.status==="aborted")return Dt;(p.status==="dirty"||g.status==="dirty")&&r.dirty(),l.set(p.value,g.value)}return{status:r.value,value:l}}}};i(dc,"ZodMap");dc.create=(e,t,r)=>new dc({valueType:t,keyType:e,typeName:xt.ZodMap,...Vt(r)});var Ua=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==tt.set)return vt(n,{code:Ke.invalid_type,expected:tt.set,received:n.parsedType}),Dt;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(vt(n,{code:Ke.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(vt(n,{code:Ke.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());let s=this._def.valueType;function c(h){let p=new Set;for(let g of h){if(g.status==="aborted")return Dt;g.status==="dirty"&&r.dirty(),p.add(g.value)}return{status:r.value,value:p}}i(c,"finalizeSet");let l=[...n.data.values()].map((h,p)=>s._parse(new gi(n,h,n.path,p)));return n.common.async?Promise.all(l).then(h=>c(h)):c(l)}min(t,r){return new Ua({...this._def,minSize:{value:t,message:Wt.toString(r)}})}max(t,r){return new Ua({...this._def,maxSize:{value:t,message:Wt.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};i(Ua,"ZodSet");Ua.create=(e,t)=>new Ua({valueType:e,minSize:null,maxSize:null,typeName:xt.ZodSet,...Vt(t)});var bo=class extends Bt{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.function)return vt(r,{code:Ke.invalid_type,expected:tt.function,received:r.parsedType}),Dt;function n(l,h){return u0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c0(),Ff].filter(p=>!!p),issueData:{code:Ke.invalid_arguments,argumentsError:h}})}i(n,"makeArgsIssue");function a(l,h){return u0({data:l,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,c0(),Ff].filter(p=>!!p),issueData:{code:Ke.invalid_return_type,returnTypeError:h}})}i(a,"makeReturnsIssue");let s={errorMap:r.common.contextualErrorMap},c=r.data;return this._def.returns instanceof wo?Sn(async(...l)=>{let h=new $i([]),p=await this._def.args.parseAsync(l,s).catch(y=>{throw h.addIssue(n(l,y)),h}),g=await c(...p);return await this._def.returns._def.type.parseAsync(g,s).catch(y=>{throw h.addIssue(a(g,y)),h})}):Sn((...l)=>{let h=this._def.args.safeParse(l,s);if(!h.success)throw new $i([n(l,h.error)]);let p=c(...h.data),g=this._def.returns.safeParse(p,s);if(!g.success)throw new $i([a(p,g.error)]);return g.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new bo({...this._def,args:vi.create(t).rest(La.create())})}returns(t){return new bo({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new bo({args:t||vi.create([]).rest(La.create()),returns:r||La.create(),typeName:xt.ZodFunction,...Vt(n)})}};i(bo,"ZodFunction");var as=class extends Bt{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(as,"ZodLazy");as.create=(e,t)=>new as({getter:e,typeName:xt.ZodLazy,...Vt(t)});var os=class extends Bt{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return vt(r,{code:Ke.invalid_literal,expected:this._def.value}),Dt}return{status:"valid",value:t.data}}get value(){return this._def.value}};i(os,"ZodLiteral");os.create=(e,t)=>new os({value:e,typeName:xt.ZodLiteral,...Vt(t)});function F7(e,t){return new ss({values:e,typeName:xt.ZodEnum,...Vt(t)})}i(F7,"createZodEnum");var ss=class extends Bt{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return vt(r,{expected:rr.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 vt(r,{received:r.data,code:Ke.invalid_enum_value,options:n}),Dt}return Sn(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}};i(ss,"ZodEnum");ss.create=F7;var cs=class extends Bt{_parse(t){let r=rr.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==tt.string&&n.parsedType!==tt.number){let a=rr.objectValues(r);return vt(n,{expected:rr.joinValues(a),received:n.parsedType,code:Ke.invalid_type}),Dt}if(r.indexOf(t.data)===-1){let a=rr.objectValues(r);return vt(n,{received:n.data,code:Ke.invalid_enum_value,options:a}),Dt}return Sn(t.data)}get enum(){return this._def.values}};i(cs,"ZodNativeEnum");cs.create=(e,t)=>new cs({values:e,typeName:xt.ZodNativeEnum,...Vt(t)});var wo=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==tt.promise&&r.common.async===!1)return vt(r,{code:Ke.invalid_type,expected:tt.promise,received:r.parsedType}),Dt;let n=r.parsedType===tt.promise?r.data:Promise.resolve(r.data);return Sn(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};i(wo,"ZodPromise");wo.create=(e,t)=>new wo({type:e,typeName:xt.ZodPromise,...Vt(t)});var Wn=class extends Bt{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),a=this._def.effect||null;if(a.type==="preprocess"){let c=a.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 s={addIssue:c=>{vt(n,c),c.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="refinement"){let c=i(l=>{let h=a.refinement(l,s);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(a.type==="transform")if(n.common.async===!1){let c=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!l0(c))return c;let l=a.transform(c.value,s);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=>l0(c)?Promise.resolve(a.transform(c.value,s)).then(l=>({status:r.value,value:l})):c);rr.assertNever(a)}};i(Wn,"ZodEffects");Wn.create=(e,t,r)=>new Wn({schema:e,typeName:xt.ZodEffects,effect:t,...Vt(r)});Wn.createWithPreprocess=(e,t,r)=>new Wn({schema:t,effect:{type:"preprocess",transform:e},typeName:xt.ZodEffects,...Vt(r)});var yi=class extends Bt{_parse(t){return this._getType(t)===tt.undefined?Sn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(yi,"ZodOptional");yi.create=(e,t)=>new yi({innerType:e,typeName:xt.ZodOptional,...Vt(t)});var Fa=class extends Bt{_parse(t){return this._getType(t)===tt.null?Sn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};i(Fa,"ZodNullable");Fa.create=(e,t)=>new Fa({innerType:e,typeName:xt.ZodNullable,...Vt(t)});var us=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===tt.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};i(us,"ZodDefault");us.create=(e,t)=>new us({innerType:e,typeName:xt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vt(t)});var hc=class extends Bt{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.innerType._parse({data:r.data,path:r.path,parent:r});return f0(n)?n.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.defaultValue()})):{status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}};i(hc,"ZodCatch");hc.create=(e,t)=>new hc({innerType:e,typeName:xt.ZodCatch,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Vt(t)});var pc=class extends Bt{_parse(t){if(this._getType(t)!==tt.nan){let n=this._getOrReturnCtx(t);return vt(n,{code:Ke.invalid_type,expected:tt.nan,received:n.parsedType}),Dt}return{status:"valid",value:t.data}}};i(pc,"ZodNaN");pc.create=e=>new pc({typeName:xt.ZodNaN,...Vt(e)});var NU=Symbol("zod_brand"),Uf=class extends Bt{_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(Uf,"ZodBranded");var ls=class extends Bt{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return i(async()=>{let s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?Dt:s.status==="dirty"?(r.dirty(),U7(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})},"handleAsync")();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Dt:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(t,r){return new ls({in:t,out:r,typeName:xt.ZodPipeline})}};i(ls,"ZodPipeline");var j7=i((e,t={},r)=>e?yo.create().superRefine((n,a)=>{if(!e(n)){let s=typeof t=="function"?t(n):t,c=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...c,fatal:r})}}):yo.create(),"custom"),PU={object:Er.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 BU=i((e,t={message:`Input not instance of ${e.name}`})=>j7(r=>r instanceof e,t,!0),"instanceOfType"),$7=zi.create,z7=oa.create,LU=pc.create,UU=Xo.create,H7=Qo.create,FU=Ba.create,jU=uc.create,$U=es.create,zU=ts.create,HU=yo.create,qU=La.create,VU=Hi.create,KU=lc.create,GU=Gn.create,WU=Er.create,JU=Er.strictCreate,ZU=rs.create,YU=fc.create,XU=ns.create,QU=vi.create,eF=is.create,tF=dc.create,rF=Ua.create,nF=bo.create,iF=as.create,aF=os.create,oF=ss.create,sF=cs.create,cF=wo.create,B7=Wn.create,uF=yi.create,lF=Fa.create,fF=Wn.createWithPreprocess,dF=ls.create,hF=i(()=>$7().optional(),"ostring"),pF=i(()=>z7().optional(),"onumber"),mF=i(()=>H7().optional(),"oboolean"),gF={string:e=>zi.create({...e,coerce:!0}),number:e=>oa.create({...e,coerce:!0}),boolean:e=>Qo.create({...e,coerce:!0}),bigint:e=>Xo.create({...e,coerce:!0}),date:e=>Ba.create({...e,coerce:!0})},vF=Dt,z=Object.freeze({__proto__:null,defaultErrorMap:Ff,setErrorMap:CU,getErrorMap:c0,makeIssue:u0,EMPTY_PATH:MU,addIssueToContext:vt,ParseStatus:en,INVALID:Dt,DIRTY:U7,OK:Sn,isAborted:Ry,isDirty:Oy,isValid:l0,isAsync:f0,get util(){return rr},ZodParsedType:tt,getParsedType:Yo,ZodType:Bt,ZodString:zi,ZodNumber:oa,ZodBigInt:Xo,ZodBoolean:Qo,ZodDate:Ba,ZodSymbol:uc,ZodUndefined:es,ZodNull:ts,ZodAny:yo,ZodUnknown:La,ZodNever:Hi,ZodVoid:lc,ZodArray:Gn,get objectUtil(){return d0},ZodObject:Er,ZodUnion:rs,ZodDiscriminatedUnion:fc,ZodIntersection:ns,ZodTuple:vi,ZodRecord:is,ZodMap:dc,ZodSet:Ua,ZodFunction:bo,ZodLazy:as,ZodLiteral:os,ZodEnum:ss,ZodNativeEnum:cs,ZodPromise:wo,ZodEffects:Wn,ZodTransformer:Wn,ZodOptional:yi,ZodNullable:Fa,ZodDefault:us,ZodCatch:hc,ZodNaN:pc,BRAND:NU,ZodBranded:Uf,ZodPipeline:ls,custom:j7,Schema:Bt,ZodSchema:Bt,late:PU,get ZodFirstPartyTypeKind(){return xt},coerce:gF,any:HU,array:GU,bigint:UU,boolean:H7,date:FU,discriminatedUnion:YU,effect:B7,enum:oF,function:nF,instanceof:BU,intersection:XU,lazy:iF,literal:aF,map:tF,nan:LU,nativeEnum:sF,never:VU,null:zU,nullable:lF,number:z7,object:WU,oboolean:mF,onumber:pF,optional:uF,ostring:hF,pipeline:dF,preprocess:fF,promise:cF,record:eF,set:rF,strictObject:JU,string:$7,symbol:jU,transformer:B7,tuple:QU,undefined:$U,union:ZU,unknown:qU,void:KU,NEVER:vF,ZodIssueCode:Ke,quotelessJson:TU,ZodError:$i});var yF=Object.defineProperty,bF=i((e,t)=>yF(e,"name",{value:t,configurable:!0}),"__name"),g0=z.array(z.string().or(z.record(z.any()))),jZ=z.object({type:z.string().optional(),narrative:z.string().optional()}),v0=z.string().or(z.object({id:z.string(),type:z.string(),caption:z.string().optional()})),wF=z.object({type:z.string().min(1).or(z.string().array().nonempty()),latitude:z.number(),longitude:z.number()}),_F=z.object({type:z.string().min(1).or(z.string().array().nonempty()),addressCountry:z.string().optional(),addressCountryCode:z.string().optional(),addressRegion:z.string().optional(),addressLocality:z.string().optional(),streetAddress:z.string().optional(),postOfficeBoxNumber:z.string().optional(),postalCode:z.string().optional(),geo:wF.optional()}),EF=z.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(z.string()),Y7=z.object({type:z.string().min(1).or(z.string().array().nonempty()),identifier:z.string(),identifierType:EF}),jf=z.string().or(z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty().optional()),name:z.string().optional(),url:z.string().optional(),phone:z.string().optional(),description:z.string().optional(),endorsement:z.any().array().optional(),image:v0.optional(),email:z.string().email().optional(),address:_F.optional(),otherIdentifier:Y7.array().optional(),official:z.string().optional(),parentOrg:z.any().optional(),familyName:z.string().optional(),givenName:z.string().optional(),additionalName:z.string().optional(),patronymicName:z.string().optional(),honorificPrefix:z.string().optional(),honorificSuffix:z.string().optional(),familyNamePrefix:z.string().optional(),dateOfBirth:z.string().optional()}).catchall(z.any())),Py=z.object({id:z.string().optional()}).catchall(z.any()),h0=z.object({type:z.string(),id:z.string()}).catchall(z.any()),q7=z.object({id:z.string(),type:z.string()}).catchall(z.any()),V7=z.object({id:z.string().optional(),type:z.string()}).catchall(z.any()),K7=z.object({type:z.string(),id:z.string().optional()}).catchall(z.any()),G7=z.object({type:z.string().or(z.string().array().nonempty()),id:z.string().optional()}).catchall(z.any()),p0=z.object({"@context":g0,id:z.string().optional(),type:z.string().array().nonempty(),issuer:jf,credentialSubject:Py.or(Py.array()),refreshService:V7.or(V7.array()).optional(),credentialSchema:q7.or(q7.array()).optional(),issuanceDate:z.string().optional(),expirationDate:z.string().optional(),credentialStatus:h0.or(h0.array()).optional(),name:z.string().optional(),description:z.string().optional(),validFrom:z.string().optional(),validUntil:z.string().optional(),status:h0.or(h0.array()).optional(),termsOfUse:K7.or(K7.array()).optional(),evidence:G7.or(G7.array()).optional()}).catchall(z.any()),ja=z.object({type:z.string(),created:z.string(),challenge:z.string().optional(),domain:z.string().optional(),nonce:z.string().optional(),proofPurpose:z.string(),verificationMethod:z.string(),jws:z.string().optional()}).catchall(z.any()),m0=p0.extend({proof:ja.or(ja.array())}),AF=z.object({"@context":g0,id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),verifiableCredential:m0.or(m0.array()).optional(),holder:z.string().optional()}).catchall(z.any()),$Z=AF.extend({proof:ja.or(ja.array())}),Uy=z.object({kty:z.string(),crv:z.string(),x:z.string(),y:z.string().optional(),n:z.string().optional(),d:z.string().optional()}),qZ=Uy.omit({d:!0}).extend({d:z.string()}),SF=z.object({alg:z.string(),iv:z.string(),tag:z.string(),epk:Uy.partial().optional(),kid:z.string().optional(),apv:z.string().optional(),apu:z.string().optional()}),xF=z.object({header:SF,encrypted_key:z.string()}),TF=z.object({protected:z.string(),iv:z.string(),ciphertext:z.string(),tag:z.string(),aad:z.string().optional(),recipients:xF.array().optional()}),mc=z.string().or(z.object({"@context":g0.optional(),id:z.string(),type:z.string(),controller:z.string(),publicKeyJwk:Uy.optional(),publicKeyBase58:z.string().optional(),blockChainAccountId:z.string().optional()}).catchall(z.any())),CF=z.object({id:z.string(),type:z.string().or(z.string().array().nonempty()),serviceEndpoint:z.any().or(z.any().array().nonempty())}).catchall(z.any()),VZ=z.object({"@context":g0,id:z.string(),alsoKnownAs:z.string().optional(),controller:z.string().or(z.string().array().nonempty()).optional(),verificationMethod:mc.array().optional(),authentication:mc.array().optional(),assertionMethod:mc.array().optional(),keyAgreement:mc.array().optional(),capabilityInvocation:mc.array().optional(),capabilityDelegation:mc.array().optional(),publicKey:mc.array().optional(),service:CF.array().optional(),proof:ja.or(ja.array()).optional()}).catchall(z.any()),MF=z.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(z.string()),y0=z.object({type:z.string().array().nonempty(),targetCode:z.string().optional(),targetDescription:z.string().optional(),targetName:z.string(),targetFramework:z.string().optional(),targetType:MF.optional(),targetUrl:z.string()}),IF=z.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"]),kF=IF.or(z.string()),DF=z.object({id:z.string().optional(),narrative:z.string().optional()}).catchall(z.any()),RF=z.object({id:z.string(),type:z.string().array().nonempty(),endorsementComment:z.string().optional()}),OF=p0.extend({credentialSubject:RF,proof:ja.or(ja.array()).optional()}),NF=z.object({id:z.string(),"@language":z.string().optional(),version:z.string().optional()}),PF=z.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(z.string()),BF=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:y0.array().optional(),description:z.string().optional(),level:z.string().optional(),name:z.string(),points:z.string().optional()}).catchall(z.any()),LF=z.object({id:z.string(),type:z.string().array().nonempty(),alignment:y0.array().optional(),allowedValue:z.string().array().optional(),name:z.string(),requiredLevel:z.string().optional(),requiredValue:z.string().optional(),resultType:PF,rubricCriterionLevel:BF.array().optional(),valueMax:z.string().optional(),valueMin:z.string().optional()}).catchall(z.any()),UF=z.object({id:z.string().optional(),type:z.string().array().nonempty(),alignment:y0.array().optional(),achievementType:kF.optional(),creator:jf.optional(),creditsAvailable:z.number().optional(),criteria:DF,description:z.string(),endorsement:OF.array().optional(),fieldOfStudy:z.string().optional(),humanCode:z.string().optional(),image:v0.optional(),"@language":z.string().optional(),name:z.string(),otherIdentifier:Y7.array().optional(),related:NF.array().optional(),resultDescription:LF.array().optional(),specialization:z.string().optional(),tag:z.string().array().optional(),version:z.string().optional()}).catchall(z.any()),FF=z.object({type:z.string(),hashed:z.boolean(),identityHash:z.string(),identityType:z.string(),salt:z.string().optional()}),jF=z.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),$F=z.object({type:z.string().array().nonempty(),achievedLevel:z.string().optional(),alignment:y0.array().optional(),resultDescription:z.string().optional(),status:jF.optional(),value:z.string().optional()}).catchall(z.any()),W7=z.object({id:z.string().optional(),type:z.string().array().nonempty(),activityEndDate:z.string().optional(),activityStartDate:z.string().optional(),creditsEarned:z.number().optional(),achievement:UF.optional(),identifier:FF.array().optional(),image:v0.optional(),licenseNumber:z.string().optional(),narrative:z.string().optional(),result:$F.array().optional(),role:z.string().optional(),source:jf.optional(),term:z.string().optional()}).catchall(z.any()),zF=z.object({id:z.string().optional(),type:z.string().or(z.string().array().nonempty()),narrative:z.string().optional(),name:z.string().optional(),description:z.string().optional(),genre:z.string().optional(),audience:z.string().optional()}).catchall(z.any()),HF=p0.extend({name:z.string().optional(),description:z.string().optional(),image:v0.optional(),credentialSubject:W7.or(W7.array()),endorsement:p0.array().optional(),evidence:zF.array().optional()}),GZ=HF.extend({proof:ja.or(ja.array())}),JZ=z.object({checks:z.string().array(),warnings:z.string().array(),errors:z.string().array()}),X7=z.enum(["Success","Failed","Error"]),ZZ=X7.enum,YZ=z.object({check:z.string(),status:X7,message:z.string().optional(),details:z.string().optional()}),XZ=z.object({title:z.string().optional(),createdAt:z.string().optional(),issuer:jf.optional(),issuee:jf.optional(),credentialSubject:Py.optional()}),gc=z.object({id:z.string(),uri:z.string()}).catchall(z.any()),tY=z.object({limit:z.number(),cursor:z.string().optional(),sort:z.string().optional()}),Jn=z.object({cursor:z.string().optional(),hasMore:z.boolean()}),Q7=z.object({encryptedRecord:TF,fields:z.string().array()}).catchall(z.any()),rY=Jn.extend({records:Q7.array()}),qF=Q7.extend({id:z.string()}),nY=Jn.extend({records:qF.array()}),J7=bF(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),VF=z.instanceof(RegExp).or(z.string().refine(e=>{try{return J7(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=J7(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),pr=z.string().or(z.object({$in:z.string().array()})).or(z.object({$regex:VF})),KF=z.object({backgroundColor:z.string().optional(),backgroundImage:z.string().optional(),fadeBackgroundImage:z.boolean().optional(),repeatBackgroundImage:z.boolean().optional(),fontColor:z.string().optional(),accentColor:z.string().optional(),accentFontColor:z.string().optional(),idBackgroundImage:z.string().optional(),fadeIdBackgroundImage:z.boolean().optional(),idBackgroundColor:z.string().optional(),repeatIdBackgroundImage:z.boolean().optional()}),fs=z.object({profileId:z.string().min(3).max(40),displayName:z.string().default(""),shortBio:z.string().default(""),bio:z.string().default(""),did:z.string(),isPrivate:z.boolean().optional(),email:z.string().optional(),image:z.string().optional(),heroImage:z.string().optional(),websiteLink:z.string().optional(),isServiceProfile:z.boolean().default(!1).optional(),type:z.string().optional(),notificationsWebhook:z.string().url().startsWith("http").optional(),display:KF.optional(),role:z.string().default("").optional(),dob:z.string().default("").optional()}),oY=z.object({profileId:pr,displayName:pr,shortBio:pr,bio:pr,email:pr,websiteLink:pr,isServiceProfile:z.boolean(),type:pr}).partial(),sY=Jn.extend({records:fs.array()}),cY=z.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),eA=z.object({id:z.string(),created:z.string(),displayName:z.string().default("").optional(),shortBio:z.string().default("").optional(),bio:z.string().default("").optional(),email:z.string().optional(),image:z.string().optional(),heroImage:z.string().optional()}),uY=Jn.extend({records:eA.extend({did:z.string()}).array()}),lY=z.object({id:pr,displayName:pr,shortBio:pr,bio:pr,email:pr}).partial(),fY=Jn.extend({records:z.object({profile:fs,manager:eA.extend({did:z.string()}).optional()}).array()}),dY=z.object({uri:z.string(),to:z.string(),from:z.string(),sent:z.string().datetime(),received:z.string().datetime().optional()}),tA=z.object({role:z.string(),canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:z.string(),canCreateChildren:z.string(),canEditChildren:z.string(),canRevokeChildren:z.string(),canManageChildrenPermissions:z.string(),canManageChildrenProfiles:z.boolean().default(!1).optional(),canViewAnalytics:z.boolean()}),GF=z.object({role:pr,canEdit:z.boolean(),canIssue:z.boolean(),canRevoke:z.boolean(),canManagePermissions:z.boolean(),canIssueChildren:pr,canCreateChildren:pr,canEditChildren:pr,canRevokeChildren:pr,canManageChildrenPermissions:pr,canManageChildrenProfiles:z.boolean(),canViewAnalytics:z.boolean()}).partial(),Z7=z.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),WF=z.discriminatedUnion("type",[z.object({type:z.literal(Z7.Values.GRANT_PERMISSIONS),data:z.object({claimUri:z.string(),targetUri:z.string(),permissions:tA.partial()})}),z.object({type:z.literal(Z7.Values.ADD_ADMIN),data:z.object({claimUri:z.string(),targetUri:z.string()})})]),hY=z.object({type:pr,data:z.object({claimUri:pr,targetUri:pr,permissions:GF})}).deepPartial(),JF=z.object({id:z.string(),createdAt:z.string(),updatedAt:z.string()}).and(WF),pY=Jn.extend({records:JF.array()}),By=z.enum(["DRAFT","LIVE"]),ZF=z.object({uri:z.string(),name:z.string().optional(),type:z.string().optional(),category:z.string().optional(),status:By.optional(),autoConnectRecipients:z.boolean().optional(),meta:z.record(z.any()).optional(),claimPermissions:tA.optional()}),mY=z.object({uri:pr,name:pr,type:pr,category:pr,meta:z.record(pr),status:By.or(z.object({$in:By.array()})),autoConnectRecipients:z.boolean()}).partial(),gY=Jn.extend({records:ZF.array()}),YF=z.object({to:fs,from:z.string(),received:z.string().optional(),uri:z.string().optional()}),vY=Jn.extend({records:YF.array()}),yY=z.object({endpoint:z.string(),name:z.string(),did:z.string().optional()}),bY=z.object({ttlSeconds:z.number().optional(),totalUses:z.number().optional()}),XF=z.object({endpoint:z.string()}),wY=z.object({signingAuthority:XF,relationship:z.object({name:z.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:z.string()})}),_Y=z.object({boostUri:z.string(),signingAuthority:z.object({endpoint:z.string(),name:z.string()})}),QF=z.enum(["live","stale","withdrawn"]),ej=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean()})).default({})}).default({}),personal:z.record(z.object({required:z.boolean()})).default({})}).default({})}),rA=z.object({contract:ej,owner:fs,name:z.string(),subtitle:z.string().optional(),description:z.string().optional(),reasonForAccessing:z.string().optional(),image:z.string().optional(),uri:z.string(),needsGuardianConsent:z.boolean().optional(),redirectUrl:z.string().optional(),frontDoorBoostUri:z.string().optional(),createdAt:z.string(),updatedAt:z.string(),expiresAt:z.string().optional(),autoBoosts:z.string().array().optional(),writers:z.array(fs).optional()}),EY=Jn.extend({records:rA.omit({owner:!0}).array()}),tj=z.object({credentials:z.object({categories:z.record(z.string().array()).default({})}),personal:z.record(z.string()).default({}),date:z.string()}),AY=Jn.extend({records:tj.array()}),rj=z.object({credentials:z.object({category:z.string(),uri:z.string()}).array(),personal:z.record(z.string()).default({}),date:z.string(),contractUri:z.string()}),SY=Jn.extend({records:rj.array()}),nA=z.object({sharing:z.boolean().optional(),shared:z.string().array().optional(),shareAll:z.boolean().optional(),shareUntil:z.string().optional()}),iA=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(nA).default({})}).default({}),personal:z.record(z.string()).default({})}).default({}),write:z.object({credentials:z.object({categories:z.record(z.boolean()).default({})}).default({}),personal:z.record(z.boolean()).default({})}).default({}),deniedWriters:z.array(z.string()).optional()}),xY=Jn.extend({records:z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:iA,contract:rA,uri:z.string(),consenter:fs,status:QF}).array()}),TY=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.object({required:z.boolean().optional()})).optional()}).optional(),personal:z.record(z.object({required:z.boolean().optional()})).optional()}).optional()}),CY=z.object({anonymize:z.boolean().optional(),credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}),MY=z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional(),id:pr.optional()}),nj=z.object({read:z.object({anonymize:z.boolean().optional(),credentials:z.object({shareAll:z.boolean().optional(),sharing:z.boolean().optional(),categories:z.record(nA.optional()).optional()}).optional(),personal:z.record(z.string()).optional()}).optional(),write:z.object({credentials:z.object({categories:z.record(z.boolean()).optional()}).optional(),personal:z.record(z.boolean()).optional()}).optional()}),Ly=z.enum(["consent","update","sync","withdraw","write"]),IY=z.object({terms:nj.optional(),action:Ly.or(Ly.array()).optional(),date:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),expiresAt:z.object({$gt:z.string()}).or(z.object({$lt:z.string()})).or(z.object({$eq:z.string()})).optional(),oneTime:z.boolean().optional()}),aA=z.object({expiresAt:z.string().optional(),oneTime:z.boolean().optional(),terms:iA.optional(),id:z.string(),action:Ly,date:z.string(),uris:z.string().array().optional()}),kY=Jn.extend({records:aA.array()}),ij=z.object({credentialUri:z.string(),termsUri:z.string(),contractUri:z.string(),boostUri:z.string(),category:z.string().optional(),date:z.string()}),DY=Jn.extend({records:ij.array()}),aj=z.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),oj=z.object({title:z.string().optional(),body:z.string().optional()}),sj=z.object({vcUris:z.array(z.string()).optional(),vpUris:z.array(z.string()).optional(),transaction:aA.optional()}),RY=z.object({type:aj,to:fs.partial().and(z.object({did:z.string()})),from:fs.partial().and(z.object({did:z.string()})),message:oj.optional(),data:sj.optional(),sent:z.string().datetime().optional()}),cj="auth-grant:",OY=z.object({id:z.string(),name:z.string(),description:z.string().optional(),challenge:z.string().startsWith(cj).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:z.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:z.string(),createdAt:z.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:z.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),NY=z.object({id:z.string()}).catchall(z.any()),uj=z.enum(["active","revoked"]),PY=z.object({id:pr,name:pr,description:pr,status:uj}).partial();var lj=Object.create,bd=Object.defineProperty,fj=Object.getOwnPropertyDescriptor,f6=Object.getOwnPropertyNames,dj=Object.getPrototypeOf,hj=Object.prototype.hasOwnProperty,o=i((e,t)=>bd(e,"name",{value:t,configurable:!0}),"__name"),db=(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')}),gr=i((e,t)=>i(function(){return e&&(t=(0,e[f6(e)[0]])(e=0)),t},"__init"),"__esm"),ze=i((e,t)=>i(function(){return t||(0,e[f6(e)[0]])((t={exports:{}}).exports,t),t.exports},"__require2"),"__commonJS"),xr=i((e,t)=>{for(var r in t)bd(e,r,{get:t[r],enumerable:!0})},"__export"),MS=i((e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of f6(t))!hj.call(e,a)&&a!==r&&bd(e,a,{get:()=>t[a],enumerable:!(n=fj(t,a))||n.enumerable});return e},"__copyProps"),ir=i((e,t,r)=>(r=e!=null?lj(dj(e)):{},MS(t||!e||!e.__esModule?bd(r,"default",{value:e,enumerable:!0}):r,e)),"__toESM"),Fy=i(e=>MS(bd({},"__esModule",{value:!0}),e),"__toCommonJS"),pj=ze({"../../../node_modules/.pnpm/lodash@4.17.21/node_modules/lodash/lodash.js"(e,t){(function(){var r,n="4.17.21",a=200,s="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,g="__lodash_placeholder__",v=1,y=2,_=4,x=1,O=2,D=1,P=2,J=4,j=8,q=16,Q=32,Y=64,k=128,K=256,he=512,me=30,we="...",Z=800,w=16,T=1,b=2,f=3,m=1/0,E=9007199254740991,R=17976931348623157e292,C=0/0,A=4294967295,B=A-1,V=A>>>1,I=[["ary",k],["bind",D],["bindKey",P],["curry",j],["curryRight",q],["flip",he],["partial",Q],["partialRight",Y],["rearg",K]],U="[object Arguments]",ge="[object Array]",L="[object AsyncFunction]",ne="[object Boolean]",oe="[object Date]",M="[object DOMException]",G="[object Error]",ae="[object Function]",fe="[object GeneratorFunction]",be="[object Map]",Re="[object Number]",X="[object Null]",N="[object Object]",F="[object Promise]",W="[object Proxy]",ie="[object RegExp]",ee="[object Set]",ue="[object String]",Ae="[object Symbol]",De="[object Undefined]",Ie="[object WeakMap]",Be="[object WeakSet]",qe="[object ArrayBuffer]",ve="[object DataView]",pe="[object Float32Array]",re="[object Float64Array]",le="[object Int8Array]",_e="[object Int16Array]",Te="[object Int32Array]",Ce="[object Uint8Array]",Oe="[object Uint8ClampedArray]",Ct="[object Uint16Array]",Ve="[object Uint32Array]",He=/\b__p \+= '';/g,Ot=/\b(__p \+=) '' \+/g,dt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mt=/&(?:amp|lt|gt|quot|#39);/g,Or=/[&<>"']/g,ct=RegExp(mt.source),ut=RegExp(Or.source),lr=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,nt=/<%=([\s\S]+?)%>/g,or=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,it=/^\w*$/,Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qt=/[\\^$.*+?()[\]{}|]/g,at=RegExp(Qt.source),et=/^\s+/,sr=/\s/,ot=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ze=/\{\n\/\* \[wrapped with (.+)\] \*/,cr=/,? & /,st=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Et=/[()=,{}\[\]\/\s]/,Tn=/\\(\\)?/g,At=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,yt=/\w*$/,hn=/^[-+]0x[0-9a-f]+$/i,er=/^0b[01]+$/i,tr=/^\[object .+?Constructor\]$/,nn=/^0o[0-7]+$/i,an=/^(?:0|[1-9]\d*)$/,Nr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vr=/($^)/,on=/['\n\r\u2028\u2029\\]/g,Cn="\\ud800-\\udfff",Ci="\\u0300-\\u036f",Mi="\\ufe20-\\ufe2f",Ii="\\u20d0-\\u20ff",Ln=Ci+Mi+Ii,pn="\\u2700-\\u27bf",ri="a-z\\xdf-\\xf6\\xf8-\\xff",Un="\\xac\\xb1\\xd7\\xf7",ki="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Di="\\u2000-\\u206f",Ri=" \\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",Qa="A-Z\\xc0-\\xd6\\xd8-\\xde",eo="\\ufe0e\\ufe0f",to=Un+ki+Di+Ri,Po="['\u2019]",Pd="["+Cn+"]",_l="["+to+"]",Rs="["+Ln+"]",El="\\d+",Bd="["+pn+"]",Al="["+ri+"]",Sl="[^"+Cn+to+El+pn+ri+Qa+"]",Os="\\ud83c[\\udffb-\\udfff]",Ld="(?:"+Rs+"|"+Os+")",xl="[^"+Cn+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",Zi="[\\ud800-\\udbff][\\udc00-\\udfff]",no="["+Qa+"]",ba="\\u200d",Tl="(?:"+Al+"|"+Sl+")",Ud="(?:"+no+"|"+Sl+")",Cl="(?:"+Po+"(?:d|ll|m|re|s|t|ve))?",Ml="(?:"+Po+"(?:D|LL|M|RE|S|T|VE))?",Il=Ld+"?",kl="["+eo+"]?",Dl="(?:"+ba+"(?:"+[xl,ro,Zi].join("|")+")"+kl+Il+")*",wa="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fd="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",qc=kl+Il+Dl,jd="(?:"+[Bd,ro,Zi].join("|")+")"+qc,Rl="(?:"+[xl+Rs+"?",Rs,ro,Zi,Pd].join("|")+")",Ol=RegExp(Po,"g"),$d=RegExp(Rs,"g"),Nl=RegExp(Os+"(?="+Os+")|"+Rl+qc,"g"),Pl=RegExp([no+"?"+Al+"+"+Cl+"(?="+[_l,no,"$"].join("|")+")",Ud+"+"+Ml+"(?="+[_l,no+Tl,"$"].join("|")+")",no+"?"+Tl+"+"+Cl,no+"+"+Ml,Fd,wa,El,jd].join("|"),"g"),zd=RegExp("["+ba+Cn+Ln+eo+"]"),Ns=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hd=["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"],Vc=-1,wr={};wr[pe]=wr[re]=wr[le]=wr[_e]=wr[Te]=wr[Ce]=wr[Oe]=wr[Ct]=wr[Ve]=!0,wr[U]=wr[ge]=wr[qe]=wr[ne]=wr[ve]=wr[oe]=wr[G]=wr[ae]=wr[be]=wr[Re]=wr[N]=wr[ie]=wr[ee]=wr[ue]=wr[Ie]=!1;var vr={};vr[U]=vr[ge]=vr[qe]=vr[ve]=vr[ne]=vr[oe]=vr[pe]=vr[re]=vr[le]=vr[_e]=vr[Te]=vr[be]=vr[Re]=vr[N]=vr[ie]=vr[ee]=vr[ue]=vr[Ae]=vr[Ce]=vr[Oe]=vr[Ct]=vr[Ve]=!0,vr[G]=vr[ae]=vr[Ie]=!1;var de={\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"},Me={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Le={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ht={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Kr=parseFloat,sn=parseInt,Mn=typeof global=="object"&&global&&global.Object===Object&&global,mn=typeof self=="object"&&self&&self.Object===Object&&self,Fr=Mn||mn||Function("return this")(),_a=typeof e=="object"&&e&&!e.nodeType&&e,Ea=_a&&typeof t=="object"&&t&&!t.nodeType&&t,Bl=Ea&&Ea.exports===_a,Kc=Bl&&Mn.process,gn=function(){try{var Se=Ea&&Ea.require&&Ea.require("util").types;return Se||Kc&&Kc.binding&&Kc.binding("util")}catch{}}(),Ps=gn&&gn.isArrayBuffer,K2=gn&&gn.isDate,G2=gn&&gn.isMap,W2=gn&&gn.isRegExp,J2=gn&&gn.isSet,Z2=gn&&gn.isTypedArray;function Fn(Se,Pe,ke){switch(ke.length){case 0:return Se.call(Pe);case 1:return Se.call(Pe,ke[0]);case 2:return Se.call(Pe,ke[0],ke[1]);case 3:return Se.call(Pe,ke[0],ke[1],ke[2])}return Se.apply(Pe,ke)}i(Fn,"apply"),o(Fn,"apply");function Y2(Se,Pe,ke,ft){for(var kt=-1,fr=Se==null?0:Se.length;++kt<fr;){var Wr=Se[kt];Pe(ft,Wr,ke(Wr),Se)}return ft}i(Y2,"arrayAggregator"),o(Y2,"arrayAggregator");function ni(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(ni,"arrayEach"),o(ni,"arrayEach");function X2(Se,Pe){for(var ke=Se==null?0:Se.length;ke--&&Pe(Se[ke],ke,Se)!==!1;);return Se}i(X2,"arrayEachRight"),o(X2,"arrayEachRight");function a1(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft;)if(!Pe(Se[ke],ke,Se))return!1;return!0}i(a1,"arrayEvery"),o(a1,"arrayEvery");function io(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length,kt=0,fr=[];++ke<ft;){var Wr=Se[ke];Pe(Wr,ke,Se)&&(fr[kt++]=Wr)}return fr}i(io,"arrayFilter"),o(io,"arrayFilter");function Ll(Se,Pe){var ke=Se==null?0:Se.length;return!!ke&&Bs(Se,Pe,0)>-1}i(Ll,"arrayIncludes"),o(Ll,"arrayIncludes");function qd(Se,Pe,ke){for(var ft=-1,kt=Se==null?0:Se.length;++ft<kt;)if(ke(Pe,Se[ft]))return!0;return!1}i(qd,"arrayIncludesWith"),o(qd,"arrayIncludesWith");function Mr(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length,kt=Array(ft);++ke<ft;)kt[ke]=Pe(Se[ke],ke,Se);return kt}i(Mr,"arrayMap"),o(Mr,"arrayMap");function ao(Se,Pe){for(var ke=-1,ft=Pe.length,kt=Se.length;++ke<ft;)Se[kt+ke]=Pe[ke];return Se}i(ao,"arrayPush"),o(ao,"arrayPush");function Vd(Se,Pe,ke,ft){var kt=-1,fr=Se==null?0:Se.length;for(ft&&fr&&(ke=Se[++kt]);++kt<fr;)ke=Pe(ke,Se[kt],kt,Se);return ke}i(Vd,"arrayReduce"),o(Vd,"arrayReduce");function Q2(Se,Pe,ke,ft){var kt=Se==null?0:Se.length;for(ft&&kt&&(ke=Se[--kt]);kt--;)ke=Pe(ke,Se[kt],kt,Se);return ke}i(Q2,"arrayReduceRight"),o(Q2,"arrayReduceRight");function Kd(Se,Pe){for(var ke=-1,ft=Se==null?0:Se.length;++ke<ft;)if(Pe(Se[ke],ke,Se))return!0;return!1}i(Kd,"arraySome"),o(Kd,"arraySome");var lD=Gd("length");function e3(Se){return Se.split("")}i(e3,"asciiToArray"),o(e3,"asciiToArray");function t3(Se){return Se.match(st)||[]}i(t3,"asciiWords"),o(t3,"asciiWords");function o1(Se,Pe,ke){var ft;return ke(Se,function(kt,fr,Wr){if(Pe(kt,fr,Wr))return ft=fr,!1}),ft}i(o1,"baseFindKey"),o(o1,"baseFindKey");function Ul(Se,Pe,ke,ft){for(var kt=Se.length,fr=ke+(ft?1:-1);ft?fr--:++fr<kt;)if(Pe(Se[fr],fr,Se))return fr;return-1}i(Ul,"baseFindIndex"),o(Ul,"baseFindIndex");function Bs(Se,Pe,ke){return Pe===Pe?f3(Se,Pe,ke):Ul(Se,s1,ke)}i(Bs,"baseIndexOf"),o(Bs,"baseIndexOf");function r3(Se,Pe,ke,ft){for(var kt=ke-1,fr=Se.length;++kt<fr;)if(ft(Se[kt],Pe))return kt;return-1}i(r3,"baseIndexOfWith"),o(r3,"baseIndexOfWith");function s1(Se){return Se!==Se}i(s1,"baseIsNaN"),o(s1,"baseIsNaN");function c1(Se,Pe){var ke=Se==null?0:Se.length;return ke?Jd(Se,Pe)/ke:C}i(c1,"baseMean"),o(c1,"baseMean");function Gd(Se){return function(Pe){return Pe==null?r:Pe[Se]}}i(Gd,"baseProperty"),o(Gd,"baseProperty");function Wd(Se){return function(Pe){return Se==null?r:Se[Pe]}}i(Wd,"basePropertyOf"),o(Wd,"basePropertyOf");function u1(Se,Pe,ke,ft,kt){return kt(Se,function(fr,Wr,_r){ke=ft?(ft=!1,fr):Pe(ke,fr,Wr,_r)}),ke}i(u1,"baseReduce"),o(u1,"baseReduce");function n3(Se,Pe){var ke=Se.length;for(Se.sort(Pe);ke--;)Se[ke]=Se[ke].value;return Se}i(n3,"baseSortBy"),o(n3,"baseSortBy");function Jd(Se,Pe){for(var ke,ft=-1,kt=Se.length;++ft<kt;){var fr=Pe(Se[ft]);fr!==r&&(ke=ke===r?fr:ke+fr)}return ke}i(Jd,"baseSum"),o(Jd,"baseSum");function Zd(Se,Pe){for(var ke=-1,ft=Array(Se);++ke<Se;)ft[ke]=Pe(ke);return ft}i(Zd,"baseTimes"),o(Zd,"baseTimes");function i3(Se,Pe){return Mr(Pe,function(ke){return[ke,Se[ke]]})}i(i3,"baseToPairs"),o(i3,"baseToPairs");function l1(Se){return Se&&Se.slice(0,p1(Se)+1).replace(et,"")}i(l1,"baseTrim"),o(l1,"baseTrim");function jn(Se){return function(Pe){return Se(Pe)}}i(jn,"baseUnary"),o(jn,"baseUnary");function Yd(Se,Pe){return Mr(Pe,function(ke){return Se[ke]})}i(Yd,"baseValues"),o(Yd,"baseValues");function Gc(Se,Pe){return Se.has(Pe)}i(Gc,"cacheHas"),o(Gc,"cacheHas");function f1(Se,Pe){for(var ke=-1,ft=Se.length;++ke<ft&&Bs(Pe,Se[ke],0)>-1;);return ke}i(f1,"charsStartIndex"),o(f1,"charsStartIndex");function d1(Se,Pe){for(var ke=Se.length;ke--&&Bs(Pe,Se[ke],0)>-1;);return ke}i(d1,"charsEndIndex"),o(d1,"charsEndIndex");function a3(Se,Pe){for(var ke=Se.length,ft=0;ke--;)Se[ke]===Pe&&++ft;return ft}i(a3,"countHolders"),o(a3,"countHolders");var fD=Wd(de),dD=Wd(Me);function o3(Se){return"\\"+ht[Se]}i(o3,"escapeStringChar"),o(o3,"escapeStringChar");function s3(Se,Pe){return Se==null?r:Se[Pe]}i(s3,"getValue"),o(s3,"getValue");function Ls(Se){return zd.test(Se)}i(Ls,"hasUnicode"),o(Ls,"hasUnicode");function c3(Se){return Ns.test(Se)}i(c3,"hasUnicodeWord"),o(c3,"hasUnicodeWord");function u3(Se){for(var Pe,ke=[];!(Pe=Se.next()).done;)ke.push(Pe.value);return ke}i(u3,"iteratorToArray"),o(u3,"iteratorToArray");function Xd(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft,kt){ke[++Pe]=[kt,ft]}),ke}i(Xd,"mapToArray"),o(Xd,"mapToArray");function h1(Se,Pe){return function(ke){return Se(Pe(ke))}}i(h1,"overArg"),o(h1,"overArg");function oo(Se,Pe){for(var ke=-1,ft=Se.length,kt=0,fr=[];++ke<ft;){var Wr=Se[ke];(Wr===Pe||Wr===g)&&(Se[ke]=g,fr[kt++]=ke)}return fr}i(oo,"replaceHolders"),o(oo,"replaceHolders");function Fl(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft){ke[++Pe]=ft}),ke}i(Fl,"setToArray"),o(Fl,"setToArray");function l3(Se){var Pe=-1,ke=Array(Se.size);return Se.forEach(function(ft){ke[++Pe]=[ft,ft]}),ke}i(l3,"setToPairs"),o(l3,"setToPairs");function f3(Se,Pe,ke){for(var ft=ke-1,kt=Se.length;++ft<kt;)if(Se[ft]===Pe)return ft;return-1}i(f3,"strictIndexOf"),o(f3,"strictIndexOf");function d3(Se,Pe,ke){for(var ft=ke+1;ft--;)if(Se[ft]===Pe)return ft;return ft}i(d3,"strictLastIndexOf"),o(d3,"strictLastIndexOf");function Us(Se){return Ls(Se)?h3(Se):lD(Se)}i(Us,"stringSize"),o(Us,"stringSize");function Oi(Se){return Ls(Se)?p3(Se):e3(Se)}i(Oi,"stringToArray"),o(Oi,"stringToArray");function p1(Se){for(var Pe=Se.length;Pe--&&sr.test(Se.charAt(Pe)););return Pe}i(p1,"trimmedEndIndex"),o(p1,"trimmedEndIndex");var hD=Wd(Le);function h3(Se){for(var Pe=Nl.lastIndex=0;Nl.test(Se);)++Pe;return Pe}i(h3,"unicodeSize"),o(h3,"unicodeSize");function p3(Se){return Se.match(Nl)||[]}i(p3,"unicodeToArray"),o(p3,"unicodeToArray");function m3(Se){return Se.match(Pl)||[]}i(m3,"unicodeWords"),o(m3,"unicodeWords");var pD=o(i(function Se(Pe){Pe=Pe==null?Fr:Bo.defaults(Fr.Object(),Pe,Bo.pick(Fr,Hd));var ke=Pe.Array,ft=Pe.Date,kt=Pe.Error,fr=Pe.Function,Wr=Pe.Math,_r=Pe.Object,m1=Pe.RegExp,mD=Pe.String,Ni=Pe.TypeError,Qd=ke.prototype,gD=fr.prototype,Wc=_r.prototype,eh=Pe["__core-js_shared__"],th=gD.toString,yr=Wc.hasOwnProperty,vD=0,g3=function(){var u=/[^.]+$/.exec(eh&&eh.keys&&eh.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),rh=Wc.toString,yD=th.call(_r),bD=Fr._,wD=m1("^"+th.call(yr).replace(Qt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),nh=Bl?Pe.Buffer:r,Lo=Pe.Symbol,ih=Pe.Uint8Array,v3=nh?nh.allocUnsafe:r,ah=h1(_r.getPrototypeOf,_r),y3=_r.create,b3=Wc.propertyIsEnumerable,oh=Qd.splice,w3=Lo?Lo.isConcatSpreadable:r,jl=Lo?Lo.iterator:r,Fs=Lo?Lo.toStringTag:r,sh=function(){try{var u=Ho(_r,"defineProperty");return u({},"",{}),u}catch{}}(),_D=Pe.clearTimeout!==Fr.clearTimeout&&Pe.clearTimeout,ED=ft&&ft.now!==Fr.Date.now&&ft.now,AD=Pe.setTimeout!==Fr.setTimeout&&Pe.setTimeout,ch=Wr.ceil,uh=Wr.floor,g1=_r.getOwnPropertySymbols,SD=nh?nh.isBuffer:r,_3=Pe.isFinite,xD=Qd.join,TD=h1(_r.keys,_r),Jr=Wr.max,vn=Wr.min,CD=ft.now,MD=Pe.parseInt,E3=Wr.random,ID=Qd.reverse,v1=Ho(Pe,"DataView"),$l=Ho(Pe,"Map"),y1=Ho(Pe,"Promise"),Jc=Ho(Pe,"Set"),zl=Ho(Pe,"WeakMap"),Hl=Ho(_r,"create"),lh=zl&&new zl,Zc={},kD=qo(v1),DD=qo($l),RD=qo(y1),OD=qo(Jc),ND=qo(zl),fh=Lo?Lo.prototype:r,ql=fh?fh.valueOf:r,A3=fh?fh.toString:r;function se(u){if(Rr(u)&&!Nt(u)&&!(u instanceof Kt)){if(u instanceof ii)return u;if(yr.call(u,"__wrapped__"))return gg(u)}return new ii(u)}i(se,"lodash"),o(se,"lodash");var Yc=function(){function u(){}return i(u,"object"),o(u,"object"),function(d){if(!kr(d))return{};if(y3)return y3(d);u.prototype=d;var S=new u;return u.prototype=r,S}}();function Vl(){}i(Vl,"baseLodash"),o(Vl,"baseLodash");function ii(u,d){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!d,this.__index__=0,this.__values__=r}i(ii,"LodashWrapper"),o(ii,"LodashWrapper"),se.templateSettings={escape:lr,evaluate:lt,interpolate:nt,variable:"",imports:{_:se}},se.prototype=Vl.prototype,se.prototype.constructor=se,ii.prototype=Yc(Vl.prototype),ii.prototype.constructor=ii;function Kt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=A,this.__views__=[]}i(Kt,"LazyWrapper"),o(Kt,"LazyWrapper");function S3(){var u=new Kt(this.__wrapped__);return u.__actions__=In(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=In(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=In(this.__views__),u}i(S3,"lazyClone"),o(S3,"lazyClone");function x3(){if(this.__filtered__){var u=new Kt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}i(x3,"lazyReverse"),o(x3,"lazyReverse");function T3(){var u=this.__wrapped__.value(),d=this.__dir__,S=Nt(u),$=d<0,te=S?u.length:0,ce=j5(0,te,this.__views__),ye=ce.start,Ee=ce.end,xe=Ee-ye,Ue=$?Ee:ye-1,Fe=this.__iteratees__,$e=Fe.length,Ye=0,pt=vn(xe,this.__takeCount__);if(!S||!$&&te==xe&&pt==xe)return j1(u,this.__actions__);var St=[];e:for(;xe--&&Ye<pt;){Ue+=d;for(var Lt=-1,_t=u[Ue];++Lt<$e;){var Ht=Fe[Lt],Gt=Ht.iteratee,Hn=Ht.type,_n=Gt(_t);if(Hn==b)_t=_n;else if(!_n){if(Hn==T)continue e;break e}}St[Ye++]=_t}return St}i(T3,"lazyValue"),o(T3,"lazyValue"),Kt.prototype=Yc(Vl.prototype),Kt.prototype.constructor=Kt;function Uo(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Uo,"Hash"),o(Uo,"Hash");function C3(){this.__data__=Hl?Hl(null):{},this.size=0}i(C3,"hashClear"),o(C3,"hashClear");function M3(u){var d=this.has(u)&&delete this.__data__[u];return this.size-=d?1:0,d}i(M3,"hashDelete"),o(M3,"hashDelete");function I3(u){var d=this.__data__;if(Hl){var S=d[u];return S===h?r:S}return yr.call(d,u)?d[u]:r}i(I3,"hashGet"),o(I3,"hashGet");function k3(u){var d=this.__data__;return Hl?d[u]!==r:yr.call(d,u)}i(k3,"hashHas"),o(k3,"hashHas");function D3(u,d){var S=this.__data__;return this.size+=this.has(u)?0:1,S[u]=Hl&&d===r?h:d,this}i(D3,"hashSet"),o(D3,"hashSet"),Uo.prototype.clear=C3,Uo.prototype.delete=M3,Uo.prototype.get=I3,Uo.prototype.has=k3,Uo.prototype.set=D3;function Aa(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Aa,"ListCache"),o(Aa,"ListCache");function R3(){this.__data__=[],this.size=0}i(R3,"listCacheClear"),o(R3,"listCacheClear");function O3(u){var d=this.__data__,S=Kl(d,u);if(S<0)return!1;var $=d.length-1;return S==$?d.pop():oh.call(d,S,1),--this.size,!0}i(O3,"listCacheDelete"),o(O3,"listCacheDelete");function N3(u){var d=this.__data__,S=Kl(d,u);return S<0?r:d[S][1]}i(N3,"listCacheGet"),o(N3,"listCacheGet");function P3(u){return Kl(this.__data__,u)>-1}i(P3,"listCacheHas"),o(P3,"listCacheHas");function B3(u,d){var S=this.__data__,$=Kl(S,u);return $<0?(++this.size,S.push([u,d])):S[$][1]=d,this}i(B3,"listCacheSet"),o(B3,"listCacheSet"),Aa.prototype.clear=R3,Aa.prototype.delete=O3,Aa.prototype.get=N3,Aa.prototype.has=P3,Aa.prototype.set=B3;function Sa(u){var d=-1,S=u==null?0:u.length;for(this.clear();++d<S;){var $=u[d];this.set($[0],$[1])}}i(Sa,"MapCache"),o(Sa,"MapCache");function L3(){this.size=0,this.__data__={hash:new Uo,map:new($l||Aa),string:new Uo}}i(L3,"mapCacheClear"),o(L3,"mapCacheClear");function U3(u){var d=af(this,u).delete(u);return this.size-=d?1:0,d}i(U3,"mapCacheDelete"),o(U3,"mapCacheDelete");function F3(u){return af(this,u).get(u)}i(F3,"mapCacheGet"),o(F3,"mapCacheGet");function j3(u){return af(this,u).has(u)}i(j3,"mapCacheHas"),o(j3,"mapCacheHas");function $3(u,d){var S=af(this,u),$=S.size;return S.set(u,d),this.size+=S.size==$?0:1,this}i($3,"mapCacheSet"),o($3,"mapCacheSet"),Sa.prototype.clear=L3,Sa.prototype.delete=U3,Sa.prototype.get=F3,Sa.prototype.has=j3,Sa.prototype.set=$3;function Fo(u){var d=-1,S=u==null?0:u.length;for(this.__data__=new Sa;++d<S;)this.add(u[d])}i(Fo,"SetCache"),o(Fo,"SetCache");function z3(u){return this.__data__.set(u,h),this}i(z3,"setCacheAdd"),o(z3,"setCacheAdd");function H3(u){return this.__data__.has(u)}i(H3,"setCacheHas"),o(H3,"setCacheHas"),Fo.prototype.add=Fo.prototype.push=z3,Fo.prototype.has=H3;function Pi(u){var d=this.__data__=new Aa(u);this.size=d.size}i(Pi,"Stack"),o(Pi,"Stack");function q3(){this.__data__=new Aa,this.size=0}i(q3,"stackClear"),o(q3,"stackClear");function V3(u){var d=this.__data__,S=d.delete(u);return this.size=d.size,S}i(V3,"stackDelete"),o(V3,"stackDelete");function K3(u){return this.__data__.get(u)}i(K3,"stackGet"),o(K3,"stackGet");function G3(u){return this.__data__.has(u)}i(G3,"stackHas"),o(G3,"stackHas");function W3(u,d){var S=this.__data__;if(S instanceof Aa){var $=S.__data__;if(!$l||$.length<a-1)return $.push([u,d]),this.size=++S.size,this;S=this.__data__=new Sa($)}return S.set(u,d),this.size=S.size,this}i(W3,"stackSet"),o(W3,"stackSet"),Pi.prototype.clear=q3,Pi.prototype.delete=V3,Pi.prototype.get=K3,Pi.prototype.has=G3,Pi.prototype.set=W3;function b1(u,d){var S=Nt(u),$=!S&&Hs(u),te=!S&&!$&&Vo(u),ce=!S&&!$&&!te&&ou(u),ye=S||$||te||ce,Ee=ye?Zd(u.length,mD):[],xe=Ee.length;for(var Ue in u)(d||yr.call(u,Ue))&&!(ye&&(Ue=="length"||te&&(Ue=="offset"||Ue=="parent")||ce&&(Ue=="buffer"||Ue=="byteLength"||Ue=="byteOffset")||Ma(Ue,xe)))&&Ee.push(Ue);return Ee}i(b1,"arrayLikeKeys"),o(b1,"arrayLikeKeys");function w1(u){var d=u.length;return d?u[_h(0,d-1)]:r}i(w1,"arraySample"),o(w1,"arraySample");function J3(u,d){return sf(In(u),jo(d,0,u.length))}i(J3,"arraySampleSize"),o(J3,"arraySampleSize");function Z3(u){return sf(In(u))}i(Z3,"arrayShuffle"),o(Z3,"arrayShuffle");function dh(u,d,S){(S!==r&&!Bi(u[d],S)||S===r&&!(d in u))&&xa(u,d,S)}i(dh,"assignMergeValue"),o(dh,"assignMergeValue");function Xc(u,d,S){var $=u[d];(!(yr.call(u,d)&&Bi($,S))||S===r&&!(d in u))&&xa(u,d,S)}i(Xc,"assignValue"),o(Xc,"assignValue");function Kl(u,d){for(var S=u.length;S--;)if(Bi(u[S][0],d))return S;return-1}i(Kl,"assocIndexOf"),o(Kl,"assocIndexOf");function Y3(u,d,S,$){return $o(u,function(te,ce,ye){d($,te,S(te),ye)}),$}i(Y3,"baseAggregator"),o(Y3,"baseAggregator");function _1(u,d){return u&&Xi(d,Zr(d),u)}i(_1,"baseAssign"),o(_1,"baseAssign");function X3(u,d){return u&&Xi(d,Dn(d),u)}i(X3,"baseAssignIn"),o(X3,"baseAssignIn");function xa(u,d,S){d=="__proto__"&&sh?sh(u,d,{configurable:!0,enumerable:!0,value:S,writable:!0}):u[d]=S}i(xa,"baseAssignValue"),o(xa,"baseAssignValue");function hh(u,d){for(var S=-1,$=d.length,te=ke($),ce=u==null;++S<$;)te[S]=ce?r:zh(u,d[S]);return te}i(hh,"baseAt"),o(hh,"baseAt");function jo(u,d,S){return u===u&&(S!==r&&(u=u<=S?u:S),d!==r&&(u=u>=d?u:d)),u}i(jo,"baseClamp"),o(jo,"baseClamp");function ai(u,d,S,$,te,ce){var ye,Ee=d&v,xe=d&y,Ue=d&_;if(S&&(ye=te?S(u,$,te,ce):S(u)),ye!==r)return ye;if(!kr(u))return u;var Fe=Nt(u);if(Fe){if(ye=z5(u),!Ee)return In(u,ye)}else{var $e=bn(u),Ye=$e==ae||$e==fe;if(Vo(u))return z1(u,Ee);if($e==N||$e==U||Ye&&!te){if(ye=xe||Ye?{}:cg(u),!Ee)return xe?D5(u,X3(ye,u)):k5(u,_1(ye,u))}else{if(!vr[$e])return te?u:{};ye=H5(u,$e,Ee)}}ce||(ce=new Pi);var pt=ce.get(u);if(pt)return pt;ce.set(u,ye),F4(u)?u.forEach(function(_t){ye.add(ai(_t,d,S,_t,u,ce))}):D4(u)&&u.forEach(function(_t,Ht){ye.set(Ht,ai(_t,d,S,Ht,u,ce))});var St=Ue?xe?Rh:Dh:xe?Dn:Zr,Lt=Fe?r:St(u);return ni(Lt||u,function(_t,Ht){Lt&&(Ht=_t,_t=u[Ht]),Xc(ye,Ht,ai(_t,d,S,Ht,u,ce))}),ye}i(ai,"baseClone"),o(ai,"baseClone");function Q3(u){var d=Zr(u);return function(S){return E1(S,u,d)}}i(Q3,"baseConforms"),o(Q3,"baseConforms");function E1(u,d,S){var $=S.length;if(u==null)return!$;for(u=_r(u);$--;){var te=S[$],ce=d[te],ye=u[te];if(ye===r&&!(te in u)||!ce(ye))return!1}return!0}i(E1,"baseConformsTo"),o(E1,"baseConformsTo");function A1(u,d,S){if(typeof u!="function")throw new Ni(c);return of(function(){u.apply(r,S)},d)}i(A1,"baseDelay"),o(A1,"baseDelay");function Qc(u,d,S,$){var te=-1,ce=Ll,ye=!0,Ee=u.length,xe=[],Ue=d.length;if(!Ee)return xe;S&&(d=Mr(d,jn(S))),$?(ce=qd,ye=!1):d.length>=a&&(ce=Gc,ye=!1,d=new Fo(d));e:for(;++te<Ee;){var Fe=u[te],$e=S==null?Fe:S(Fe);if(Fe=$||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=Ue;Ye--;)if(d[Ye]===$e)continue e;xe.push(Fe)}else ce(d,$e,$)||xe.push(Fe)}return xe}i(Qc,"baseDifference"),o(Qc,"baseDifference");var $o=G1(Yi),e5=G1(ph,!0);function t5(u,d){var S=!0;return $o(u,function($,te,ce){return S=!!d($,te,ce),S}),S}i(t5,"baseEvery"),o(t5,"baseEvery");function Gl(u,d,S){for(var $=-1,te=u.length;++$<te;){var ce=u[$],ye=d(ce);if(ye!=null&&(Ee===r?ye===ye&&!zn(ye):S(ye,Ee)))var Ee=ye,xe=ce}return xe}i(Gl,"baseExtremum"),o(Gl,"baseExtremum");function r5(u,d,S,$){var te=u.length;for(S=Pt(S),S<0&&(S=-S>te?0:te+S),$=$===r||$>te?te:Pt($),$<0&&($+=te),$=S>$?0:Lg($);S<$;)u[S++]=d;return u}i(r5,"baseFill"),o(r5,"baseFill");function S1(u,d){var S=[];return $o(u,function($,te,ce){d($,te,ce)&&S.push($)}),S}i(S1,"baseFilter"),o(S1,"baseFilter");function Xr(u,d,S,$,te){var ce=-1,ye=u.length;for(S||(S=V5),te||(te=[]);++ce<ye;){var Ee=u[ce];d>0&&S(Ee)?d>1?Xr(Ee,d-1,S,$,te):ao(te,Ee):$||(te[te.length]=Ee)}return te}i(Xr,"baseFlatten"),o(Xr,"baseFlatten");var x1=W1(),n5=W1(!0);function Yi(u,d){return u&&x1(u,d,Zr)}i(Yi,"baseForOwn"),o(Yi,"baseForOwn");function ph(u,d){return u&&n5(u,d,Zr)}i(ph,"baseForOwnRight"),o(ph,"baseForOwnRight");function Wl(u,d){return io(d,function(S){return Ia(u[S])})}i(Wl,"baseFunctions"),o(Wl,"baseFunctions");function zo(u,d){d=co(d,u);for(var S=0,$=d.length;u!=null&&S<$;)u=u[Qi(d[S++])];return S&&S==$?u:r}i(zo,"baseGet"),o(zo,"baseGet");function T1(u,d,S){var $=d(u);return Nt(u)?$:ao($,S(u))}i(T1,"baseGetAllKeys"),o(T1,"baseGetAllKeys");function yn(u){return u==null?u===r?De:X:Fs&&Fs in _r(u)?U5(u):Y5(u)}i(yn,"baseGetTag"),o(yn,"baseGetTag");function mh(u,d){return u>d}i(mh,"baseGt"),o(mh,"baseGt");function i5(u,d){return u!=null&&yr.call(u,d)}i(i5,"baseHas"),o(i5,"baseHas");function a5(u,d){return u!=null&&d in _r(u)}i(a5,"baseHasIn"),o(a5,"baseHasIn");function o5(u,d,S){return u>=vn(d,S)&&u<Jr(d,S)}i(o5,"baseInRange"),o(o5,"baseInRange");function gh(u,d,S){for(var $=S?qd:Ll,te=u[0].length,ce=u.length,ye=ce,Ee=ke(ce),xe=1/0,Ue=[];ye--;){var Fe=u[ye];ye&&d&&(Fe=Mr(Fe,jn(d))),xe=vn(Fe.length,xe),Ee[ye]=!S&&(d||te>=120&&Fe.length>=120)?new Fo(ye&&Fe):r}Fe=u[0];var $e=-1,Ye=Ee[0];e:for(;++$e<te&&Ue.length<xe;){var pt=Fe[$e],St=d?d(pt):pt;if(pt=S||pt!==0?pt:0,!(Ye?Gc(Ye,St):$(Ue,St,S))){for(ye=ce;--ye;){var Lt=Ee[ye];if(!(Lt?Gc(Lt,St):$(u[ye],St,S)))continue e}Ye&&Ye.push(St),Ue.push(pt)}}return Ue}i(gh,"baseIntersection"),o(gh,"baseIntersection");function s5(u,d,S,$){return Yi(u,function(te,ce,ye){d($,S(te),ce,ye)}),$}i(s5,"baseInverter"),o(s5,"baseInverter");function eu(u,d,S){d=co(d,u),u=dg(u,d);var $=u==null?u:u[Qi(si(d))];return $==null?r:Fn($,u,S)}i(eu,"baseInvoke"),o(eu,"baseInvoke");function C1(u){return Rr(u)&&yn(u)==U}i(C1,"baseIsArguments"),o(C1,"baseIsArguments");function c5(u){return Rr(u)&&yn(u)==qe}i(c5,"baseIsArrayBuffer"),o(c5,"baseIsArrayBuffer");function u5(u){return Rr(u)&&yn(u)==oe}i(u5,"baseIsDate"),o(u5,"baseIsDate");function tu(u,d,S,$,te){return u===d?!0:u==null||d==null||!Rr(u)&&!Rr(d)?u!==u&&d!==d:l5(u,d,S,$,tu,te)}i(tu,"baseIsEqual"),o(tu,"baseIsEqual");function l5(u,d,S,$,te,ce){var ye=Nt(u),Ee=Nt(d),xe=ye?ge:bn(u),Ue=Ee?ge:bn(d);xe=xe==U?N:xe,Ue=Ue==U?N:Ue;var Fe=xe==N,$e=Ue==N,Ye=xe==Ue;if(Ye&&Vo(u)){if(!Vo(d))return!1;ye=!0,Fe=!1}if(Ye&&!Fe)return ce||(ce=new Pi),ye||ou(u)?ig(u,d,S,$,te,ce):B5(u,d,xe,S,$,te,ce);if(!(S&x)){var pt=Fe&&yr.call(u,"__wrapped__"),St=$e&&yr.call(d,"__wrapped__");if(pt||St){var Lt=pt?u.value():u,_t=St?d.value():d;return ce||(ce=new Pi),te(Lt,_t,S,$,ce)}}return Ye?(ce||(ce=new Pi),L5(u,d,S,$,te,ce)):!1}i(l5,"baseIsEqualDeep"),o(l5,"baseIsEqualDeep");function f5(u){return Rr(u)&&bn(u)==be}i(f5,"baseIsMap"),o(f5,"baseIsMap");function vh(u,d,S,$){var te=S.length,ce=te,ye=!$;if(u==null)return!ce;for(u=_r(u);te--;){var Ee=S[te];if(ye&&Ee[2]?Ee[1]!==u[Ee[0]]:!(Ee[0]in u))return!1}for(;++te<ce;){Ee=S[te];var xe=Ee[0],Ue=u[xe],Fe=Ee[1];if(ye&&Ee[2]){if(Ue===r&&!(xe in u))return!1}else{var $e=new Pi;if($)var Ye=$(Ue,Fe,xe,u,d,$e);if(!(Ye===r?tu(Fe,Ue,x|O,$,$e):Ye))return!1}}return!0}i(vh,"baseIsMatch"),o(vh,"baseIsMatch");function M1(u){if(!kr(u)||G5(u))return!1;var d=Ia(u)?wD:tr;return d.test(qo(u))}i(M1,"baseIsNative"),o(M1,"baseIsNative");function d5(u){return Rr(u)&&yn(u)==ie}i(d5,"baseIsRegExp"),o(d5,"baseIsRegExp");function h5(u){return Rr(u)&&bn(u)==ee}i(h5,"baseIsSet"),o(h5,"baseIsSet");function p5(u){return Rr(u)&&df(u.length)&&!!wr[yn(u)]}i(p5,"baseIsTypedArray"),o(p5,"baseIsTypedArray");function I1(u){return typeof u=="function"?u:u==null?Rn:typeof u=="object"?Nt(u)?R1(u[0],u[1]):D1(u):qg(u)}i(I1,"baseIteratee"),o(I1,"baseIteratee");function yh(u){if(!iu(u))return TD(u);var d=[];for(var S in _r(u))yr.call(u,S)&&S!="constructor"&&d.push(S);return d}i(yh,"baseKeys"),o(yh,"baseKeys");function m5(u){if(!kr(u))return Z5(u);var d=iu(u),S=[];for(var $ in u)$=="constructor"&&(d||!yr.call(u,$))||S.push($);return S}i(m5,"baseKeysIn"),o(m5,"baseKeysIn");function bh(u,d){return u<d}i(bh,"baseLt"),o(bh,"baseLt");function k1(u,d){var S=-1,$=kn(u)?ke(u.length):[];return $o(u,function(te,ce,ye){$[++S]=d(te,ce,ye)}),$}i(k1,"baseMap"),o(k1,"baseMap");function D1(u){var d=Oh(u);return d.length==1&&d[0][2]?lg(d[0][0],d[0][1]):function(S){return S===u||vh(S,u,d)}}i(D1,"baseMatches"),o(D1,"baseMatches");function R1(u,d){return Nh(u)&&ug(d)?lg(Qi(u),d):function(S){var $=zh(S,u);return $===r&&$===d?Hh(S,u):tu(d,$,x|O)}}i(R1,"baseMatchesProperty"),o(R1,"baseMatchesProperty");function Jl(u,d,S,$,te){u!==d&&x1(d,function(ce,ye){if(te||(te=new Pi),kr(ce))g5(u,d,ye,S,Jl,$,te);else{var Ee=$?$(Bh(u,ye),ce,ye+"",u,d,te):r;Ee===r&&(Ee=ce),dh(u,ye,Ee)}},Dn)}i(Jl,"baseMerge"),o(Jl,"baseMerge");function g5(u,d,S,$,te,ce,ye){var Ee=Bh(u,S),xe=Bh(d,S),Ue=ye.get(xe);if(Ue){dh(u,S,Ue);return}var Fe=ce?ce(Ee,xe,S+"",u,d,ye):r,$e=Fe===r;if($e){var Ye=Nt(xe),pt=!Ye&&Vo(xe),St=!Ye&&!pt&&ou(xe);Fe=xe,Ye||pt||St?Nt(Ee)?Fe=Ee:Pr(Ee)?Fe=In(Ee):pt?($e=!1,Fe=z1(xe,!0)):St?($e=!1,Fe=H1(xe,!0)):Fe=[]:au(xe)||Hs(xe)?(Fe=Ee,Hs(Ee)?Fe=Ug(Ee):(!kr(Ee)||Ia(Ee))&&(Fe=cg(xe))):$e=!1}$e&&(ye.set(xe,Fe),te(Fe,xe,$,ce,ye),ye.delete(xe)),dh(u,S,Fe)}i(g5,"baseMergeDeep"),o(g5,"baseMergeDeep");function O1(u,d){var S=u.length;if(!!S)return d+=d<0?S:0,Ma(d,S)?u[d]:r}i(O1,"baseNth"),o(O1,"baseNth");function N1(u,d,S){d.length?d=Mr(d,function(ce){return Nt(ce)?function(ye){return zo(ye,ce.length===1?ce[0]:ce)}:ce}):d=[Rn];var $=-1;d=Mr(d,jn(wt()));var te=k1(u,function(ce,ye,Ee){var xe=Mr(d,function(Ue){return Ue(ce)});return{criteria:xe,index:++$,value:ce}});return n3(te,function(ce,ye){return I5(ce,ye,S)})}i(N1,"baseOrderBy"),o(N1,"baseOrderBy");function v5(u,d){return P1(u,d,function(S,$){return Hh(u,$)})}i(v5,"basePick"),o(v5,"basePick");function P1(u,d,S){for(var $=-1,te=d.length,ce={};++$<te;){var ye=d[$],Ee=zo(u,ye);S(Ee,ye)&&ru(ce,co(ye,u),Ee)}return ce}i(P1,"basePickBy"),o(P1,"basePickBy");function y5(u){return function(d){return zo(d,u)}}i(y5,"basePropertyDeep"),o(y5,"basePropertyDeep");function wh(u,d,S,$){var te=$?r3:Bs,ce=-1,ye=d.length,Ee=u;for(u===d&&(d=In(d)),S&&(Ee=Mr(u,jn(S)));++ce<ye;)for(var xe=0,Ue=d[ce],Fe=S?S(Ue):Ue;(xe=te(Ee,Fe,xe,$))>-1;)Ee!==u&&oh.call(Ee,xe,1),oh.call(u,xe,1);return u}i(wh,"basePullAll"),o(wh,"basePullAll");function B1(u,d){for(var S=u?d.length:0,$=S-1;S--;){var te=d[S];if(S==$||te!==ce){var ce=te;Ma(te)?oh.call(u,te,1):Sh(u,te)}}return u}i(B1,"basePullAt"),o(B1,"basePullAt");function _h(u,d){return u+uh(E3()*(d-u+1))}i(_h,"baseRandom"),o(_h,"baseRandom");function b5(u,d,S,$){for(var te=-1,ce=Jr(ch((d-u)/(S||1)),0),ye=ke(ce);ce--;)ye[$?ce:++te]=u,u+=S;return ye}i(b5,"baseRange"),o(b5,"baseRange");function Eh(u,d){var S="";if(!u||d<1||d>E)return S;do d%2&&(S+=u),d=uh(d/2),d&&(u+=u);while(d);return S}i(Eh,"baseRepeat"),o(Eh,"baseRepeat");function Ut(u,d){return hg(fg(u,d,Rn),u+"")}i(Ut,"baseRest"),o(Ut,"baseRest");function w5(u){return w1(qs(u))}i(w5,"baseSample"),o(w5,"baseSample");function _5(u,d){var S=qs(u);return sf(S,jo(d,0,S.length))}i(_5,"baseSampleSize"),o(_5,"baseSampleSize");function ru(u,d,S,$){if(!kr(u))return u;d=co(d,u);for(var te=-1,ce=d.length,ye=ce-1,Ee=u;Ee!=null&&++te<ce;){var xe=Qi(d[te]),Ue=S;if(xe==="__proto__"||xe==="constructor"||xe==="prototype")return u;if(te!=ye){var Fe=Ee[xe];Ue=$?$(Fe,xe,Ee):r,Ue===r&&(Ue=kr(Fe)?Fe:Ma(d[te+1])?[]:{})}Xc(Ee,xe,Ue),Ee=Ee[xe]}return u}i(ru,"baseSet"),o(ru,"baseSet");var E5=lh?function(u,d){return lh.set(u,d),u}:Rn,PD=sh?function(u,d){return sh(u,"toString",{configurable:!0,enumerable:!1,value:qh(d),writable:!0})}:Rn;function A5(u){return sf(qs(u))}i(A5,"baseShuffle"),o(A5,"baseShuffle");function oi(u,d,S){var $=-1,te=u.length;d<0&&(d=-d>te?0:te+d),S=S>te?te:S,S<0&&(S+=te),te=d>S?0:S-d>>>0,d>>>=0;for(var ce=ke(te);++$<te;)ce[$]=u[$+d];return ce}i(oi,"baseSlice"),o(oi,"baseSlice");function S5(u,d){var S;return $o(u,function($,te,ce){return S=d($,te,ce),!S}),!!S}i(S5,"baseSome"),o(S5,"baseSome");function Zl(u,d,S){var $=0,te=u==null?$:u.length;if(typeof d=="number"&&d===d&&te<=V){for(;$<te;){var ce=$+te>>>1,ye=u[ce];ye!==null&&!zn(ye)&&(S?ye<=d:ye<d)?$=ce+1:te=ce}return te}return Ah(u,d,Rn,S)}i(Zl,"baseSortedIndex"),o(Zl,"baseSortedIndex");function Ah(u,d,S,$){var te=0,ce=u==null?0:u.length;if(ce===0)return 0;d=S(d);for(var ye=d!==d,Ee=d===null,xe=zn(d),Ue=d===r;te<ce;){var Fe=uh((te+ce)/2),$e=S(u[Fe]),Ye=$e!==r,pt=$e===null,St=$e===$e,Lt=zn($e);if(ye)var _t=$||St;else Ue?_t=St&&($||Ye):Ee?_t=St&&Ye&&($||!pt):xe?_t=St&&Ye&&!pt&&($||!Lt):pt||Lt?_t=!1:_t=$?$e<=d:$e<d;_t?te=Fe+1:ce=Fe}return vn(ce,B)}i(Ah,"baseSortedIndexBy"),o(Ah,"baseSortedIndexBy");function L1(u,d){for(var S=-1,$=u.length,te=0,ce=[];++S<$;){var ye=u[S],Ee=d?d(ye):ye;if(!S||!Bi(Ee,xe)){var xe=Ee;ce[te++]=ye===0?0:ye}}return ce}i(L1,"baseSortedUniq"),o(L1,"baseSortedUniq");function U1(u){return typeof u=="number"?u:zn(u)?C:+u}i(U1,"baseToNumber"),o(U1,"baseToNumber");function $n(u){if(typeof u=="string")return u;if(Nt(u))return Mr(u,$n)+"";if(zn(u))return A3?A3.call(u):"";var d=u+"";return d=="0"&&1/u==-m?"-0":d}i($n,"baseToString"),o($n,"baseToString");function so(u,d,S){var $=-1,te=Ll,ce=u.length,ye=!0,Ee=[],xe=Ee;if(S)ye=!1,te=qd;else if(ce>=a){var Ue=d?null:LD(u);if(Ue)return Fl(Ue);ye=!1,te=Gc,xe=new Fo}else xe=d?[]:Ee;e:for(;++$<ce;){var Fe=u[$],$e=d?d(Fe):Fe;if(Fe=S||Fe!==0?Fe:0,ye&&$e===$e){for(var Ye=xe.length;Ye--;)if(xe[Ye]===$e)continue e;d&&xe.push($e),Ee.push(Fe)}else te(xe,$e,S)||(xe!==Ee&&xe.push($e),Ee.push(Fe))}return Ee}i(so,"baseUniq"),o(so,"baseUniq");function Sh(u,d){return d=co(d,u),u=dg(u,d),u==null||delete u[Qi(si(d))]}i(Sh,"baseUnset"),o(Sh,"baseUnset");function F1(u,d,S,$){return ru(u,d,S(zo(u,d)),$)}i(F1,"baseUpdate"),o(F1,"baseUpdate");function Yl(u,d,S,$){for(var te=u.length,ce=$?te:-1;($?ce--:++ce<te)&&d(u[ce],ce,u););return S?oi(u,$?0:ce,$?ce+1:te):oi(u,$?ce+1:0,$?te:ce)}i(Yl,"baseWhile"),o(Yl,"baseWhile");function j1(u,d){var S=u;return S instanceof Kt&&(S=S.value()),Vd(d,function($,te){return te.func.apply(te.thisArg,ao([$],te.args))},S)}i(j1,"baseWrapperValue"),o(j1,"baseWrapperValue");function xh(u,d,S){var $=u.length;if($<2)return $?so(u[0]):[];for(var te=-1,ce=ke($);++te<$;)for(var ye=u[te],Ee=-1;++Ee<$;)Ee!=te&&(ce[te]=Qc(ce[te]||ye,u[Ee],d,S));return so(Xr(ce,1),d,S)}i(xh,"baseXor"),o(xh,"baseXor");function $1(u,d,S){for(var $=-1,te=u.length,ce=d.length,ye={};++$<te;){var Ee=$<ce?d[$]:r;S(ye,u[$],Ee)}return ye}i($1,"baseZipObject"),o($1,"baseZipObject");function Th(u){return Pr(u)?u:[]}i(Th,"castArrayLikeObject"),o(Th,"castArrayLikeObject");function Ch(u){return typeof u=="function"?u:Rn}i(Ch,"castFunction"),o(Ch,"castFunction");function co(u,d){return Nt(u)?u:Nh(u,d)?[u]:ew(dr(u))}i(co,"castPath"),o(co,"castPath");var BD=Ut;function uo(u,d,S){var $=u.length;return S=S===r?$:S,!d&&S>=$?u:oi(u,d,S)}i(uo,"castSlice"),o(uo,"castSlice");var x5=_D||function(u){return Fr.clearTimeout(u)};function z1(u,d){if(d)return u.slice();var S=u.length,$=v3?v3(S):new u.constructor(S);return u.copy($),$}i(z1,"cloneBuffer"),o(z1,"cloneBuffer");function Mh(u){var d=new u.constructor(u.byteLength);return new ih(d).set(new ih(u)),d}i(Mh,"cloneArrayBuffer"),o(Mh,"cloneArrayBuffer");function T5(u,d){var S=d?Mh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.byteLength)}i(T5,"cloneDataView"),o(T5,"cloneDataView");function C5(u){var d=new u.constructor(u.source,yt.exec(u));return d.lastIndex=u.lastIndex,d}i(C5,"cloneRegExp"),o(C5,"cloneRegExp");function M5(u){return ql?_r(ql.call(u)):{}}i(M5,"cloneSymbol"),o(M5,"cloneSymbol");function H1(u,d){var S=d?Mh(u.buffer):u.buffer;return new u.constructor(S,u.byteOffset,u.length)}i(H1,"cloneTypedArray"),o(H1,"cloneTypedArray");function q1(u,d){if(u!==d){var S=u!==r,$=u===null,te=u===u,ce=zn(u),ye=d!==r,Ee=d===null,xe=d===d,Ue=zn(d);if(!Ee&&!Ue&&!ce&&u>d||ce&&ye&&xe&&!Ee&&!Ue||$&&ye&&xe||!S&&xe||!te)return 1;if(!$&&!ce&&!Ue&&u<d||Ue&&S&&te&&!$&&!ce||Ee&&S&&te||!ye&&te||!xe)return-1}return 0}i(q1,"compareAscending"),o(q1,"compareAscending");function I5(u,d,S){for(var $=-1,te=u.criteria,ce=d.criteria,ye=te.length,Ee=S.length;++$<ye;){var xe=q1(te[$],ce[$]);if(xe){if($>=Ee)return xe;var Ue=S[$];return xe*(Ue=="desc"?-1:1)}}return u.index-d.index}i(I5,"compareMultiple"),o(I5,"compareMultiple");function V1(u,d,S,$){for(var te=-1,ce=u.length,ye=S.length,Ee=-1,xe=d.length,Ue=Jr(ce-ye,0),Fe=ke(xe+Ue),$e=!$;++Ee<xe;)Fe[Ee]=d[Ee];for(;++te<ye;)($e||te<ce)&&(Fe[S[te]]=u[te]);for(;Ue--;)Fe[Ee++]=u[te++];return Fe}i(V1,"composeArgs"),o(V1,"composeArgs");function K1(u,d,S,$){for(var te=-1,ce=u.length,ye=-1,Ee=S.length,xe=-1,Ue=d.length,Fe=Jr(ce-Ee,0),$e=ke(Fe+Ue),Ye=!$;++te<Fe;)$e[te]=u[te];for(var pt=te;++xe<Ue;)$e[pt+xe]=d[xe];for(;++ye<Ee;)(Ye||te<ce)&&($e[pt+S[ye]]=u[te++]);return $e}i(K1,"composeArgsRight"),o(K1,"composeArgsRight");function In(u,d){var S=-1,$=u.length;for(d||(d=ke($));++S<$;)d[S]=u[S];return d}i(In,"copyArray"),o(In,"copyArray");function Xi(u,d,S,$){var te=!S;S||(S={});for(var ce=-1,ye=d.length;++ce<ye;){var Ee=d[ce],xe=$?$(S[Ee],u[Ee],Ee,S,u):r;xe===r&&(xe=u[Ee]),te?xa(S,Ee,xe):Xc(S,Ee,xe)}return S}i(Xi,"copyObject"),o(Xi,"copyObject");function k5(u,d){return Xi(u,og(u),d)}i(k5,"copySymbols"),o(k5,"copySymbols");function D5(u,d){return Xi(u,F5(u),d)}i(D5,"copySymbolsIn"),o(D5,"copySymbolsIn");function Xl(u,d){return function(S,$){var te=Nt(S)?Y2:Y3,ce=d?d():{};return te(S,u,wt($,2),ce)}}i(Xl,"createAggregator"),o(Xl,"createAggregator");function js(u){return Ut(function(d,S){var $=-1,te=S.length,ce=te>1?S[te-1]:r,ye=te>2?S[2]:r;for(ce=u.length>3&&typeof ce=="function"?(te--,ce):r,ye&&wn(S[0],S[1],ye)&&(ce=te<3?r:ce,te=1),d=_r(d);++$<te;){var Ee=S[$];Ee&&u(d,Ee,$,ce)}return d})}i(js,"createAssigner"),o(js,"createAssigner");function G1(u,d){return function(S,$){if(S==null)return S;if(!kn(S))return u(S,$);for(var te=S.length,ce=d?te:-1,ye=_r(S);(d?ce--:++ce<te)&&$(ye[ce],ce,ye)!==!1;);return S}}i(G1,"createBaseEach"),o(G1,"createBaseEach");function W1(u){return function(d,S,$){for(var te=-1,ce=_r(d),ye=$(d),Ee=ye.length;Ee--;){var xe=ye[u?Ee:++te];if(S(ce[xe],xe,ce)===!1)break}return d}}i(W1,"createBaseFor"),o(W1,"createBaseFor");function R5(u,d,S){var $=d&D,te=nu(u);function ce(){var ye=this&&this!==Fr&&this instanceof ce?te:u;return ye.apply($?S:this,arguments)}return i(ce,"wrapper"),o(ce,"wrapper"),ce}i(R5,"createBind"),o(R5,"createBind");function J1(u){return function(d){d=dr(d);var S=Ls(d)?Oi(d):r,$=S?S[0]:d.charAt(0),te=S?uo(S,1).join(""):d.slice(1);return $[u]()+te}}i(J1,"createCaseFirst"),o(J1,"createCaseFirst");function $s(u){return function(d){return Vd(Hg($g(d).replace(Ol,"")),u,"")}}i($s,"createCompounder"),o($s,"createCompounder");function nu(u){return function(){var d=arguments;switch(d.length){case 0:return new u;case 1:return new u(d[0]);case 2:return new u(d[0],d[1]);case 3:return new u(d[0],d[1],d[2]);case 4:return new u(d[0],d[1],d[2],d[3]);case 5:return new u(d[0],d[1],d[2],d[3],d[4]);case 6:return new u(d[0],d[1],d[2],d[3],d[4],d[5]);case 7:return new u(d[0],d[1],d[2],d[3],d[4],d[5],d[6])}var S=Yc(u.prototype),$=u.apply(S,d);return kr($)?$:S}}i(nu,"createCtor"),o(nu,"createCtor");function O5(u,d,S){var $=nu(u);function te(){for(var ce=arguments.length,ye=ke(ce),Ee=ce,xe=zs(te);Ee--;)ye[Ee]=arguments[Ee];var Ue=ce<3&&ye[0]!==xe&&ye[ce-1]!==xe?[]:oo(ye,xe);if(ce-=Ue.length,ce<S)return eg(u,d,Ql,te.placeholder,r,ye,Ue,r,r,S-ce);var Fe=this&&this!==Fr&&this instanceof te?$:u;return Fn(Fe,this,ye)}return i(te,"wrapper"),o(te,"wrapper"),te}i(O5,"createCurry"),o(O5,"createCurry");function Z1(u){return function(d,S,$){var te=_r(d);if(!kn(d)){var ce=wt(S,3);d=Zr(d),S=o(function(Ee){return ce(te[Ee],Ee,te)},"predicate")}var ye=u(d,S,$);return ye>-1?te[ce?d[ye]:ye]:r}}i(Z1,"createFind"),o(Z1,"createFind");function Y1(u){return Ca(function(d){var S=d.length,$=S,te=ii.prototype.thru;for(u&&d.reverse();$--;){var ce=d[$];if(typeof ce!="function")throw new Ni(c);if(te&&!ye&&nf(ce)=="wrapper")var ye=new ii([],!0)}for($=ye?$:S;++$<S;){ce=d[$];var Ee=nf(ce),xe=Ee=="wrapper"?ag(ce):r;xe&&Ph(xe[0])&&xe[1]==(k|j|Q|K)&&!xe[4].length&&xe[9]==1?ye=ye[nf(xe[0])].apply(ye,xe[3]):ye=ce.length==1&&Ph(ce)?ye[Ee]():ye.thru(ce)}return function(){var Ue=arguments,Fe=Ue[0];if(ye&&Ue.length==1&&Nt(Fe))return ye.plant(Fe).value();for(var $e=0,Ye=S?d[$e].apply(this,Ue):Fe;++$e<S;)Ye=d[$e].call(this,Ye);return Ye}})}i(Y1,"createFlow"),o(Y1,"createFlow");function Ql(u,d,S,$,te,ce,ye,Ee,xe,Ue){var Fe=d&k,$e=d&D,Ye=d&P,pt=d&(j|q),St=d&he,Lt=Ye?r:nu(u);function _t(){for(var Ht=arguments.length,Gt=ke(Ht),Hn=Ht;Hn--;)Gt[Hn]=arguments[Hn];if(pt)var _n=zs(_t),qn=a3(Gt,_n);if($&&(Gt=V1(Gt,$,te,pt)),ce&&(Gt=K1(Gt,ce,ye,pt)),Ht-=qn,pt&&Ht<Ue){var jr=oo(Gt,_n);return eg(u,d,Ql,_t.placeholder,S,Gt,jr,Ee,xe,Ue-Ht)}var ea=$e?S:this,lo=Ye?ea[u]:u;return Ht=Gt.length,Ee?Gt=X5(Gt,Ee):St&&Ht>1&&Gt.reverse(),Fe&&xe<Ht&&(Gt.length=xe),this&&this!==Fr&&this instanceof _t&&(lo=Lt||nu(lo)),lo.apply(ea,Gt)}return i(_t,"wrapper"),o(_t,"wrapper"),_t}i(Ql,"createHybrid"),o(Ql,"createHybrid");function X1(u,d){return function(S,$){return s5(S,u,d($),{})}}i(X1,"createInverter"),o(X1,"createInverter");function ef(u,d){return function(S,$){var te;if(S===r&&$===r)return d;if(S!==r&&(te=S),$!==r){if(te===r)return $;typeof S=="string"||typeof $=="string"?(S=$n(S),$=$n($)):(S=U1(S),$=U1($)),te=u(S,$)}return te}}i(ef,"createMathOperation"),o(ef,"createMathOperation");function Ih(u){return Ca(function(d){return d=Mr(d,jn(wt())),Ut(function(S){var $=this;return u(d,function(te){return Fn(te,$,S)})})})}i(Ih,"createOver"),o(Ih,"createOver");function tf(u,d){d=d===r?" ":$n(d);var S=d.length;if(S<2)return S?Eh(d,u):d;var $=Eh(d,ch(u/Us(d)));return Ls(d)?uo(Oi($),0,u).join(""):$.slice(0,u)}i(tf,"createPadding"),o(tf,"createPadding");function N5(u,d,S,$){var te=d&D,ce=nu(u);function ye(){for(var Ee=-1,xe=arguments.length,Ue=-1,Fe=$.length,$e=ke(Fe+xe),Ye=this&&this!==Fr&&this instanceof ye?ce:u;++Ue<Fe;)$e[Ue]=$[Ue];for(;xe--;)$e[Ue++]=arguments[++Ee];return Fn(Ye,te?S:this,$e)}return i(ye,"wrapper"),o(ye,"wrapper"),ye}i(N5,"createPartial"),o(N5,"createPartial");function Q1(u){return function(d,S,$){return $&&typeof $!="number"&&wn(d,S,$)&&(S=$=r),d=ka(d),S===r?(S=d,d=0):S=ka(S),$=$===r?d<S?1:-1:ka($),b5(d,S,$,u)}}i(Q1,"createRange"),o(Q1,"createRange");function rf(u){return function(d,S){return typeof d=="string"&&typeof S=="string"||(d=ci(d),S=ci(S)),u(d,S)}}i(rf,"createRelationalOperation"),o(rf,"createRelationalOperation");function eg(u,d,S,$,te,ce,ye,Ee,xe,Ue){var Fe=d&j,$e=Fe?ye:r,Ye=Fe?r:ye,pt=Fe?ce:r,St=Fe?r:ce;d|=Fe?Q:Y,d&=~(Fe?Y:Q),d&J||(d&=~(D|P));var Lt=[u,d,te,pt,$e,St,Ye,Ee,xe,Ue],_t=S.apply(r,Lt);return Ph(u)&&Q5(_t,Lt),_t.placeholder=$,pg(_t,u,d)}i(eg,"createRecurry"),o(eg,"createRecurry");function kh(u){var d=Wr[u];return function(S,$){if(S=ci(S),$=$==null?0:vn(Pt($),292),$&&_3(S)){var te=(dr(S)+"e").split("e"),ce=d(te[0]+"e"+(+te[1]+$));return te=(dr(ce)+"e").split("e"),+(te[0]+"e"+(+te[1]-$))}return d(S)}}i(kh,"createRound"),o(kh,"createRound");var LD=Jc&&1/Fl(new Jc([,-0]))[1]==m?function(u){return new Jc(u)}:Gh;function tg(u){return function(d){var S=bn(d);return S==be?Xd(d):S==ee?l3(d):i3(d,u(d))}}i(tg,"createToPairs"),o(tg,"createToPairs");function Ta(u,d,S,$,te,ce,ye,Ee){var xe=d&P;if(!xe&&typeof u!="function")throw new Ni(c);var Ue=$?$.length:0;if(Ue||(d&=~(Q|Y),$=te=r),ye=ye===r?ye:Jr(Pt(ye),0),Ee=Ee===r?Ee:Pt(Ee),Ue-=te?te.length:0,d&Y){var Fe=$,$e=te;$=te=r}var Ye=xe?r:ag(u),pt=[u,d,S,$,te,Fe,$e,ce,ye,Ee];if(Ye&&J5(pt,Ye),u=pt[0],d=pt[1],S=pt[2],$=pt[3],te=pt[4],Ee=pt[9]=pt[9]===r?xe?0:u.length:Jr(pt[9]-Ue,0),!Ee&&d&(j|q)&&(d&=~(j|q)),!d||d==D)var St=R5(u,d,S);else d==j||d==q?St=O5(u,d,Ee):(d==Q||d==(D|Q))&&!te.length?St=N5(u,d,S,$):St=Ql.apply(r,pt);var Lt=Ye?E5:Q5;return pg(Lt(St,pt),u,d)}i(Ta,"createWrap"),o(Ta,"createWrap");function rg(u,d,S,$){return u===r||Bi(u,Wc[S])&&!yr.call($,S)?d:u}i(rg,"customDefaultsAssignIn"),o(rg,"customDefaultsAssignIn");function ng(u,d,S,$,te,ce){return kr(u)&&kr(d)&&(ce.set(d,u),Jl(u,d,r,ng,ce),ce.delete(d)),u}i(ng,"customDefaultsMerge"),o(ng,"customDefaultsMerge");function P5(u){return au(u)?r:u}i(P5,"customOmitClone"),o(P5,"customOmitClone");function ig(u,d,S,$,te,ce){var ye=S&x,Ee=u.length,xe=d.length;if(Ee!=xe&&!(ye&&xe>Ee))return!1;var Ue=ce.get(u),Fe=ce.get(d);if(Ue&&Fe)return Ue==d&&Fe==u;var $e=-1,Ye=!0,pt=S&O?new Fo:r;for(ce.set(u,d),ce.set(d,u);++$e<Ee;){var St=u[$e],Lt=d[$e];if($)var _t=ye?$(Lt,St,$e,d,u,ce):$(St,Lt,$e,u,d,ce);if(_t!==r){if(_t)continue;Ye=!1;break}if(pt){if(!Kd(d,function(Ht,Gt){if(!Gc(pt,Gt)&&(St===Ht||te(St,Ht,S,$,ce)))return pt.push(Gt)})){Ye=!1;break}}else if(!(St===Lt||te(St,Lt,S,$,ce))){Ye=!1;break}}return ce.delete(u),ce.delete(d),Ye}i(ig,"equalArrays"),o(ig,"equalArrays");function B5(u,d,S,$,te,ce,ye){switch(S){case ve:if(u.byteLength!=d.byteLength||u.byteOffset!=d.byteOffset)return!1;u=u.buffer,d=d.buffer;case qe:return!(u.byteLength!=d.byteLength||!ce(new ih(u),new ih(d)));case ne:case oe:case Re:return Bi(+u,+d);case G:return u.name==d.name&&u.message==d.message;case ie:case ue:return u==d+"";case be:var Ee=Xd;case ee:var xe=$&x;if(Ee||(Ee=Fl),u.size!=d.size&&!xe)return!1;var Ue=ye.get(u);if(Ue)return Ue==d;$|=O,ye.set(u,d);var Fe=ig(Ee(u),Ee(d),$,te,ce,ye);return ye.delete(u),Fe;case Ae:if(ql)return ql.call(u)==ql.call(d)}return!1}i(B5,"equalByTag"),o(B5,"equalByTag");function L5(u,d,S,$,te,ce){var ye=S&x,Ee=Dh(u),xe=Ee.length,Ue=Dh(d),Fe=Ue.length;if(xe!=Fe&&!ye)return!1;for(var $e=xe;$e--;){var Ye=Ee[$e];if(!(ye?Ye in d:yr.call(d,Ye)))return!1}var pt=ce.get(u),St=ce.get(d);if(pt&&St)return pt==d&&St==u;var Lt=!0;ce.set(u,d),ce.set(d,u);for(var _t=ye;++$e<xe;){Ye=Ee[$e];var Ht=u[Ye],Gt=d[Ye];if($)var Hn=ye?$(Gt,Ht,Ye,d,u,ce):$(Ht,Gt,Ye,u,d,ce);if(!(Hn===r?Ht===Gt||te(Ht,Gt,S,$,ce):Hn)){Lt=!1;break}_t||(_t=Ye=="constructor")}if(Lt&&!_t){var _n=u.constructor,qn=d.constructor;_n!=qn&&"constructor"in u&&"constructor"in d&&!(typeof _n=="function"&&_n instanceof _n&&typeof qn=="function"&&qn instanceof qn)&&(Lt=!1)}return ce.delete(u),ce.delete(d),Lt}i(L5,"equalObjects"),o(L5,"equalObjects");function Ca(u){return hg(fg(u,r,bg),u+"")}i(Ca,"flatRest"),o(Ca,"flatRest");function Dh(u){return T1(u,Zr,og)}i(Dh,"getAllKeys"),o(Dh,"getAllKeys");function Rh(u){return T1(u,Dn,F5)}i(Rh,"getAllKeysIn"),o(Rh,"getAllKeysIn");var ag=lh?function(u){return lh.get(u)}:Gh;function nf(u){for(var d=u.name+"",S=Zc[d],$=yr.call(Zc,d)?S.length:0;$--;){var te=S[$],ce=te.func;if(ce==null||ce==u)return te.name}return d}i(nf,"getFuncName"),o(nf,"getFuncName");function zs(u){var d=yr.call(se,"placeholder")?se:u;return d.placeholder}i(zs,"getHolder"),o(zs,"getHolder");function wt(){var u=se.iteratee||Vh;return u=u===Vh?I1:u,arguments.length?u(arguments[0],arguments[1]):u}i(wt,"getIteratee"),o(wt,"getIteratee");function af(u,d){var S=u.__data__;return K5(d)?S[typeof d=="string"?"string":"hash"]:S.map}i(af,"getMapData"),o(af,"getMapData");function Oh(u){for(var d=Zr(u),S=d.length;S--;){var $=d[S],te=u[$];d[S]=[$,te,ug(te)]}return d}i(Oh,"getMatchData"),o(Oh,"getMatchData");function Ho(u,d){var S=s3(u,d);return M1(S)?S:r}i(Ho,"getNative"),o(Ho,"getNative");function U5(u){var d=yr.call(u,Fs),S=u[Fs];try{u[Fs]=r;var $=!0}catch{}var te=rh.call(u);return $&&(d?u[Fs]=S:delete u[Fs]),te}i(U5,"getRawTag"),o(U5,"getRawTag");var og=g1?function(u){return u==null?[]:(u=_r(u),io(g1(u),function(d){return b3.call(u,d)}))}:Wh,F5=g1?function(u){for(var d=[];u;)ao(d,og(u)),u=ah(u);return d}:Wh,bn=yn;(v1&&bn(new v1(new ArrayBuffer(1)))!=ve||$l&&bn(new $l)!=be||y1&&bn(y1.resolve())!=F||Jc&&bn(new Jc)!=ee||zl&&bn(new zl)!=Ie)&&(bn=o(function(u){var d=yn(u),S=d==N?u.constructor:r,$=S?qo(S):"";if($)switch($){case kD:return ve;case DD:return be;case RD:return F;case OD:return ee;case ND:return Ie}return d},"getTag"));function j5(u,d,S){for(var $=-1,te=S.length;++$<te;){var ce=S[$],ye=ce.size;switch(ce.type){case"drop":u+=ye;break;case"dropRight":d-=ye;break;case"take":d=vn(d,u+ye);break;case"takeRight":u=Jr(u,d-ye);break}}return{start:u,end:d}}i(j5,"getView"),o(j5,"getView");function $5(u){var d=u.match(Ze);return d?d[1].split(cr):[]}i($5,"getWrapDetails"),o($5,"getWrapDetails");function sg(u,d,S){d=co(d,u);for(var $=-1,te=d.length,ce=!1;++$<te;){var ye=Qi(d[$]);if(!(ce=u!=null&&S(u,ye)))break;u=u[ye]}return ce||++$!=te?ce:(te=u==null?0:u.length,!!te&&df(te)&&Ma(ye,te)&&(Nt(u)||Hs(u)))}i(sg,"hasPath"),o(sg,"hasPath");function z5(u){var d=u.length,S=new u.constructor(d);return d&&typeof u[0]=="string"&&yr.call(u,"index")&&(S.index=u.index,S.input=u.input),S}i(z5,"initCloneArray"),o(z5,"initCloneArray");function cg(u){return typeof u.constructor=="function"&&!iu(u)?Yc(ah(u)):{}}i(cg,"initCloneObject"),o(cg,"initCloneObject");function H5(u,d,S){var $=u.constructor;switch(d){case qe:return Mh(u);case ne:case oe:return new $(+u);case ve:return T5(u,S);case pe:case re:case le:case _e:case Te:case Ce:case Oe:case Ct:case Ve:return H1(u,S);case be:return new $;case Re:case ue:return new $(u);case ie:return C5(u);case ee:return new $;case Ae:return M5(u)}}i(H5,"initCloneByTag"),o(H5,"initCloneByTag");function q5(u,d){var S=d.length;if(!S)return u;var $=S-1;return d[$]=(S>1?"& ":"")+d[$],d=d.join(S>2?", ":" "),u.replace(ot,`{
25
25
  /* [wrapped with `+d+`] */
26
- `)}i(q5,"insertWrapDetails"),o(q5,"insertWrapDetails");function V5(u){return Nt(u)||$s(u)||!!(w3&&u&&u[w3])}i(V5,"isFlattenable"),o(V5,"isFlattenable");function Ma(u,d){var S=typeof u;return d=d??E,!!d&&(S=="number"||S!="symbol"&&an.test(u))&&u>-1&&u%1==0&&u<d}i(Ma,"isIndex"),o(Ma,"isIndex");function wn(u,d,S){if(!kr(S))return!1;var $=typeof d;return($=="number"?kn(S)&&Ma(d,S.length):$=="string"&&d in S)?Bi(S[d],u):!1}i(wn,"isIterateeCall"),o(wn,"isIterateeCall");function Nh(u,d){if(Nt(u))return!1;var S=typeof u;return S=="number"||S=="symbol"||S=="boolean"||u==null||zn(u)?!0:it.test(u)||!or.test(u)||d!=null&&u in _r(d)}i(Nh,"isKey"),o(Nh,"isKey");function K5(u){var d=typeof u;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?u!=="__proto__":u===null}i(K5,"isKeyable"),o(K5,"isKeyable");function Ph(u){var d=nf(u),S=se[d];if(typeof S!="function"||!(d in Kt.prototype))return!1;if(u===S)return!0;var $=ag(S);return!!$&&u===$[0]}i(Ph,"isLaziable"),o(Ph,"isLaziable");function G5(u){return!!g3&&g3 in u}i(G5,"isMasked"),o(G5,"isMasked");var UD=eh?Ia:Jh;function iu(u){var d=u&&u.constructor,S=typeof d=="function"&&d.prototype||Wc;return u===S}i(iu,"isPrototype"),o(iu,"isPrototype");function ug(u){return u===u&&!kr(u)}i(ug,"isStrictComparable"),o(ug,"isStrictComparable");function lg(u,d){return function(S){return S==null?!1:S[u]===d&&(d!==r||u in _r(S))}}i(lg,"matchesStrictComparable"),o(lg,"matchesStrictComparable");function W5(u){var d=lf(u,function($){return S.size===p&&S.clear(),$}),S=d.cache;return d}i(W5,"memoizeCapped"),o(W5,"memoizeCapped");function J5(u,d){var S=u[1],$=d[1],te=S|$,ce=te<(D|P|k),ye=$==k&&S==j||$==k&&S==K&&u[7].length<=d[8]||$==(k|K)&&d[7].length<=d[8]&&S==j;if(!(ce||ye))return u;$&D&&(u[2]=d[2],te|=S&D?0:J);var Ee=d[3];if(Ee){var xe=u[3];u[3]=xe?V1(xe,Ee,d[4]):Ee,u[4]=xe?oo(u[3],g):d[4]}return Ee=d[5],Ee&&(xe=u[5],u[5]=xe?K1(xe,Ee,d[6]):Ee,u[6]=xe?oo(u[5],g):d[6]),Ee=d[7],Ee&&(u[7]=Ee),$&k&&(u[8]=u[8]==null?d[8]:vn(u[8],d[8])),u[9]==null&&(u[9]=d[9]),u[0]=d[0],u[1]=te,u}i(J5,"mergeData"),o(J5,"mergeData");function Z5(u){var d=[];if(u!=null)for(var S in _r(u))d.push(S);return d}i(Z5,"nativeKeysIn"),o(Z5,"nativeKeysIn");function Y5(u){return rh.call(u)}i(Y5,"objectToString"),o(Y5,"objectToString");function fg(u,d,S){return d=Jr(d===r?u.length-1:d,0),function(){for(var $=arguments,te=-1,ce=Jr($.length-d,0),ye=ke(ce);++te<ce;)ye[te]=$[d+te];te=-1;for(var Ee=ke(d+1);++te<d;)Ee[te]=$[te];return Ee[d]=S(ye),Fn(u,this,Ee)}}i(fg,"overRest"),o(fg,"overRest");function dg(u,d){return d.length<2?u:zo(u,oi(d,0,-1))}i(dg,"parent"),o(dg,"parent");function X5(u,d){for(var S=u.length,$=vn(d.length,S),te=In(u);$--;){var ce=d[$];u[$]=Ma(ce,S)?te[ce]:r}return u}i(X5,"reorder"),o(X5,"reorder");function Bh(u,d){if(!(d==="constructor"&&typeof u[d]=="function")&&d!="__proto__")return u[d]}i(Bh,"safeGet"),o(Bh,"safeGet");var Q5=mg(E5),of=AD||function(u,d){return Fr.setTimeout(u,d)},hg=mg(PD);function pg(u,d,S){var $=d+"";return hg(u,q5($,tw($5($),S)))}i(pg,"setWrapToString"),o(pg,"setWrapToString");function mg(u){var d=0,S=0;return function(){var $=CD(),te=w-($-S);if(S=$,te>0){if(++d>=Z)return arguments[0]}else d=0;return u.apply(r,arguments)}}i(mg,"shortOut"),o(mg,"shortOut");function sf(u,d){var S=-1,$=u.length,te=$-1;for(d=d===r?$:d;++S<d;){var ce=_h(S,te),ye=u[ce];u[ce]=u[S],u[S]=ye}return u.length=d,u}i(sf,"shuffleSelf"),o(sf,"shuffleSelf");var ew=W5(function(u){var d=[];return u.charCodeAt(0)===46&&d.push(""),u.replace(Xe,function(S,$,te,ce){d.push(te?ce.replace(Tn,"$1"):$||S)}),d});function Qi(u){if(typeof u=="string"||zn(u))return u;var d=u+"";return d=="0"&&1/u==-m?"-0":d}i(Qi,"toKey"),o(Qi,"toKey");function qo(u){if(u!=null){try{return th.call(u)}catch{}try{return u+""}catch{}}return""}i(qo,"toSource"),o(qo,"toSource");function tw(u,d){return ni(I,function(S){var $="_."+S[0];d&S[1]&&!Ll(u,$)&&u.push($)}),u.sort()}i(tw,"updateWrapDetails"),o(tw,"updateWrapDetails");function gg(u){if(u instanceof Kt)return u.clone();var d=new ii(u.__wrapped__,u.__chain__);return d.__actions__=In(u.__actions__),d.__index__=u.__index__,d.__values__=u.__values__,d}i(gg,"wrapperClone"),o(gg,"wrapperClone");function rw(u,d,S){(S?wn(u,d,S):d===r)?d=1:d=Jr(Pt(d),0);var $=u==null?0:u.length;if(!$||d<1)return[];for(var te=0,ce=0,ye=ke(ch($/d));te<$;)ye[ce++]=oi(u,te,te+=d);return ye}i(rw,"chunk"),o(rw,"chunk");function nw(u){for(var d=-1,S=u==null?0:u.length,$=0,te=[];++d<S;){var ce=u[d];ce&&(te[$++]=ce)}return te}i(nw,"compact"),o(nw,"compact");function iw(){var u=arguments.length;if(!u)return[];for(var d=ke(u-1),S=arguments[0],$=u;$--;)d[$-1]=arguments[$];return ao(Nt(S)?In(S):[S],Xr(d,1))}i(iw,"concat4"),o(iw,"concat");var FD=Ut(function(u,d){return Pr(u)?Qc(u,Xr(d,1,Pr,!0)):[]}),jD=Ut(function(u,d){var S=si(d);return Pr(S)&&(S=r),Pr(u)?Qc(u,Xr(d,1,Pr,!0),wt(S,2)):[]}),$D=Ut(function(u,d){var S=si(d);return Pr(S)&&(S=r),Pr(u)?Qc(u,Xr(d,1,Pr,!0),r,S):[]});function aw(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),oi(u,d<0?0:d,$)):[]}i(aw,"drop"),o(aw,"drop");function ow(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),d=$-d,oi(u,0,d<0?0:d)):[]}i(ow,"dropRight"),o(ow,"dropRight");function sw(u,d){return u&&u.length?Yl(u,wt(d,3),!0,!0):[]}i(sw,"dropRightWhile"),o(sw,"dropRightWhile");function cw(u,d){return u&&u.length?Yl(u,wt(d,3),!0):[]}i(cw,"dropWhile"),o(cw,"dropWhile");function uw(u,d,S,$){var te=u==null?0:u.length;return te?(S&&typeof S!="number"&&wn(u,d,S)&&(S=0,$=te),r5(u,d,S,$)):[]}i(uw,"fill"),o(uw,"fill");function vg(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Pt(S);return te<0&&(te=Jr($+te,0)),Ul(u,wt(d,3),te)}i(vg,"findIndex"),o(vg,"findIndex");function yg(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=$-1;return S!==r&&(te=Pt(S),te=S<0?Jr($+te,0):vn(te,$-1)),Ul(u,wt(d,3),te,!0)}i(yg,"findLastIndex"),o(yg,"findLastIndex");function bg(u){var d=u==null?0:u.length;return d?Xr(u,1):[]}i(bg,"flatten"),o(bg,"flatten");function lw(u){var d=u==null?0:u.length;return d?Xr(u,m):[]}i(lw,"flattenDeep"),o(lw,"flattenDeep");function fw(u,d){var S=u==null?0:u.length;return S?(d=d===r?1:Pt(d),Xr(u,d)):[]}i(fw,"flattenDepth"),o(fw,"flattenDepth");function dw(u){for(var d=-1,S=u==null?0:u.length,$={};++d<S;){var te=u[d];$[te[0]]=te[1]}return $}i(dw,"fromPairs"),o(dw,"fromPairs");function wg(u){return u&&u.length?u[0]:r}i(wg,"head"),o(wg,"head");function hw(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Pt(S);return te<0&&(te=Jr($+te,0)),Ns(u,d,te)}i(hw,"indexOf"),o(hw,"indexOf");function pw(u){var d=u==null?0:u.length;return d?oi(u,0,-1):[]}i(pw,"initial"),o(pw,"initial");var zD=Ut(function(u){var d=Mr(u,Th);return d.length&&d[0]===u[0]?gh(d):[]}),HD=Ut(function(u){var d=si(u),S=Mr(u,Th);return d===si(S)?d=r:S.pop(),S.length&&S[0]===u[0]?gh(S,wt(d,2)):[]}),qD=Ut(function(u){var d=si(u),S=Mr(u,Th);return d=typeof d=="function"?d:r,d&&S.pop(),S.length&&S[0]===u[0]?gh(S,r,d):[]});function mw(u,d){return u==null?"":xD.call(u,d)}i(mw,"join"),o(mw,"join");function si(u){var d=u==null?0:u.length;return d?u[d-1]:r}i(si,"last2"),o(si,"last");function gw(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=$;return S!==r&&(te=Pt(S),te=te<0?Jr($+te,0):vn(te,$-1)),d===d?d3(u,d,te):Ul(u,s1,te,!0)}i(gw,"lastIndexOf"),o(gw,"lastIndexOf");function vw(u,d){return u&&u.length?O1(u,Pt(d)):r}i(vw,"nth"),o(vw,"nth");var VD=Ut(_g);function _g(u,d){return u&&u.length&&d&&d.length?wh(u,d):u}i(_g,"pullAll"),o(_g,"pullAll");function yw(u,d,S){return u&&u.length&&d&&d.length?wh(u,d,wt(S,2)):u}i(yw,"pullAllBy"),o(yw,"pullAllBy");function bw(u,d,S){return u&&u.length&&d&&d.length?wh(u,d,r,S):u}i(bw,"pullAllWith"),o(bw,"pullAllWith");var KD=Ca(function(u,d){var S=u==null?0:u.length,$=hh(u,d);return B1(u,Mr(d,function(te){return Ma(te,S)?+te:te}).sort(q1)),$});function ww(u,d){var S=[];if(!(u&&u.length))return S;var $=-1,te=[],ce=u.length;for(d=wt(d,3);++$<ce;){var ye=u[$];d(ye,$,u)&&(S.push(ye),te.push($))}return B1(u,te),S}i(ww,"remove"),o(ww,"remove");function Lh(u){return u==null?u:ID.call(u)}i(Lh,"reverse"),o(Lh,"reverse");function _w(u,d,S){var $=u==null?0:u.length;return $?(S&&typeof S!="number"&&wn(u,d,S)?(d=0,S=$):(d=d==null?0:Pt(d),S=S===r?$:Pt(S)),oi(u,d,S)):[]}i(_w,"slice2"),o(_w,"slice");function Ew(u,d){return Zl(u,d)}i(Ew,"sortedIndex"),o(Ew,"sortedIndex");function Aw(u,d,S){return Ah(u,d,wt(S,2))}i(Aw,"sortedIndexBy"),o(Aw,"sortedIndexBy");function Sw(u,d){var S=u==null?0:u.length;if(S){var $=Zl(u,d);if($<S&&Bi(u[$],d))return $}return-1}i(Sw,"sortedIndexOf"),o(Sw,"sortedIndexOf");function xw(u,d){return Zl(u,d,!0)}i(xw,"sortedLastIndex"),o(xw,"sortedLastIndex");function Tw(u,d,S){return Ah(u,d,wt(S,2),!0)}i(Tw,"sortedLastIndexBy"),o(Tw,"sortedLastIndexBy");function Cw(u,d){var S=u==null?0:u.length;if(S){var $=Zl(u,d,!0)-1;if(Bi(u[$],d))return $}return-1}i(Cw,"sortedLastIndexOf"),o(Cw,"sortedLastIndexOf");function Mw(u){return u&&u.length?L1(u):[]}i(Mw,"sortedUniq"),o(Mw,"sortedUniq");function Iw(u,d){return u&&u.length?L1(u,wt(d,2)):[]}i(Iw,"sortedUniqBy"),o(Iw,"sortedUniqBy");function kw(u){var d=u==null?0:u.length;return d?oi(u,1,d):[]}i(kw,"tail"),o(kw,"tail");function Dw(u,d,S){return u&&u.length?(d=S||d===r?1:Pt(d),oi(u,0,d<0?0:d)):[]}i(Dw,"take2"),o(Dw,"take");function Rw(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),d=$-d,oi(u,d<0?0:d,$)):[]}i(Rw,"takeRight"),o(Rw,"takeRight");function Ow(u,d){return u&&u.length?Yl(u,wt(d,3),!1,!0):[]}i(Ow,"takeRightWhile"),o(Ow,"takeRightWhile");function Nw(u,d){return u&&u.length?Yl(u,wt(d,3)):[]}i(Nw,"takeWhile"),o(Nw,"takeWhile");var GD=Ut(function(u){return so(Xr(u,1,Pr,!0))}),WD=Ut(function(u){var d=si(u);return Pr(d)&&(d=r),so(Xr(u,1,Pr,!0),wt(d,2))}),JD=Ut(function(u){var d=si(u);return d=typeof d=="function"?d:r,so(Xr(u,1,Pr,!0),r,d)});function Pw(u){return u&&u.length?so(u):[]}i(Pw,"uniq"),o(Pw,"uniq");function Bw(u,d){return u&&u.length?so(u,wt(d,2)):[]}i(Bw,"uniqBy"),o(Bw,"uniqBy");function Lw(u,d){return d=typeof d=="function"?d:r,u&&u.length?so(u,r,d):[]}i(Lw,"uniqWith"),o(Lw,"uniqWith");function Uh(u){if(!(u&&u.length))return[];var d=0;return u=io(u,function(S){if(Pr(S))return d=Jr(S.length,d),!0}),Zd(d,function(S){return Mr(u,Gd(S))})}i(Uh,"unzip"),o(Uh,"unzip");function Eg(u,d){if(!(u&&u.length))return[];var S=Uh(u);return d==null?S:Mr(S,function($){return Fn(d,r,$)})}i(Eg,"unzipWith"),o(Eg,"unzipWith");var ZD=Ut(function(u,d){return Pr(u)?Qc(u,d):[]}),YD=Ut(function(u){return xh(io(u,Pr))}),XD=Ut(function(u){var d=si(u);return Pr(d)&&(d=r),xh(io(u,Pr),wt(d,2))}),QD=Ut(function(u){var d=si(u);return d=typeof d=="function"?d:r,xh(io(u,Pr),r,d)}),eR=Ut(Uh);function Uw(u,d){return $1(u||[],d||[],Xc)}i(Uw,"zipObject"),o(Uw,"zipObject");function Fw(u,d){return $1(u||[],d||[],ru)}i(Fw,"zipObjectDeep"),o(Fw,"zipObjectDeep");var tR=Ut(function(u){var d=u.length,S=d>1?u[d-1]:r;return S=typeof S=="function"?(u.pop(),S):r,Eg(u,S)});function Ag(u){var d=se(u);return d.__chain__=!0,d}i(Ag,"chain"),o(Ag,"chain");function jw(u,d){return d(u),u}i(jw,"tap"),o(jw,"tap");function cf(u,d){return d(u)}i(cf,"thru"),o(cf,"thru");var rR=Ca(function(u){var d=u.length,S=d?u[0]:0,$=this.__wrapped__,te=o(function(ce){return hh(ce,u)},"interceptor");return d>1||this.__actions__.length||!($ instanceof Kt)||!Ma(S)?this.thru(te):($=$.slice(S,+S+(d?1:0)),$.__actions__.push({func:cf,args:[te],thisArg:r}),new ii($,this.__chain__).thru(function(ce){return d&&!ce.length&&ce.push(r),ce}))});function $w(){return Ag(this)}i($w,"wrapperChain"),o($w,"wrapperChain");function zw(){return new ii(this.value(),this.__chain__)}i(zw,"wrapperCommit"),o(zw,"wrapperCommit");function Hw(){this.__values__===r&&(this.__values__=Bg(this.value()));var u=this.__index__>=this.__values__.length,d=u?r:this.__values__[this.__index__++];return{done:u,value:d}}i(Hw,"wrapperNext"),o(Hw,"wrapperNext");function qw(){return this}i(qw,"wrapperToIterator"),o(qw,"wrapperToIterator");function Vw(u){for(var d,S=this;S instanceof Vl;){var $=gg(S);$.__index__=0,$.__values__=r,d?te.__wrapped__=$:d=$;var te=$;S=S.__wrapped__}return te.__wrapped__=u,d}i(Vw,"wrapperPlant"),o(Vw,"wrapperPlant");function Kw(){var u=this.__wrapped__;if(u instanceof Kt){var d=u;return this.__actions__.length&&(d=new Kt(this)),d=d.reverse(),d.__actions__.push({func:cf,args:[Lh],thisArg:r}),new ii(d,this.__chain__)}return this.thru(Lh)}i(Kw,"wrapperReverse"),o(Kw,"wrapperReverse");function Gw(){return j1(this.__wrapped__,this.__actions__)}i(Gw,"wrapperValue"),o(Gw,"wrapperValue");var nR=Xl(function(u,d,S){yr.call(u,S)?++u[S]:xa(u,S,1)});function Ww(u,d,S){var $=Nt(u)?a1:t5;return S&&wn(u,d,S)&&(d=r),$(u,wt(d,3))}i(Ww,"every"),o(Ww,"every");function Jw(u,d){var S=Nt(u)?io:S1;return S(u,wt(d,3))}i(Jw,"filter2"),o(Jw,"filter");var iR=Z1(vg),aR=Z1(yg);function Zw(u,d){return Xr(uf(u,d),1)}i(Zw,"flatMap"),o(Zw,"flatMap");function Yw(u,d){return Xr(uf(u,d),m)}i(Yw,"flatMapDeep"),o(Yw,"flatMapDeep");function Xw(u,d,S){return S=S===r?1:Pt(S),Xr(uf(u,d),S)}i(Xw,"flatMapDepth"),o(Xw,"flatMapDepth");function Sg(u,d){var S=Nt(u)?ni:$o;return S(u,wt(d,3))}i(Sg,"forEach"),o(Sg,"forEach");function xg(u,d){var S=Nt(u)?X2:e5;return S(u,wt(d,3))}i(xg,"forEachRight"),o(xg,"forEachRight");var oR=Xl(function(u,d,S){yr.call(u,S)?u[S].push(d):xa(u,S,[d])});function Qw(u,d,S,$){u=kn(u)?u:zs(u),S=S&&!$?Pt(S):0;var te=u.length;return S<0&&(S=Jr(te+S,0)),hf(u)?S<=te&&u.indexOf(d,S)>-1:!!te&&Ns(u,d,S)>-1}i(Qw,"includes"),o(Qw,"includes");var sR=Ut(function(u,d,S){var $=-1,te=typeof d=="function",ce=kn(u)?ke(u.length):[];return $o(u,function(ye){ce[++$]=te?Fn(d,ye,S):eu(ye,d,S)}),ce}),cR=Xl(function(u,d,S){xa(u,S,d)});function uf(u,d){var S=Nt(u)?Mr:k1;return S(u,wt(d,3))}i(uf,"map2"),o(uf,"map");function e4(u,d,S,$){return u==null?[]:(Nt(d)||(d=d==null?[]:[d]),S=$?r:S,Nt(S)||(S=S==null?[]:[S]),N1(u,d,S))}i(e4,"orderBy"),o(e4,"orderBy");var uR=Xl(function(u,d,S){u[S?0:1].push(d)},function(){return[[],[]]});function t4(u,d,S){var $=Nt(u)?Vd:u1,te=arguments.length<3;return $(u,wt(d,4),S,te,$o)}i(t4,"reduce"),o(t4,"reduce");function r4(u,d,S){var $=Nt(u)?Q2:u1,te=arguments.length<3;return $(u,wt(d,4),S,te,e5)}i(r4,"reduceRight"),o(r4,"reduceRight");function n4(u,d){var S=Nt(u)?io:S1;return S(u,ff(wt(d,3)))}i(n4,"reject"),o(n4,"reject");function i4(u){var d=Nt(u)?w1:w5;return d(u)}i(i4,"sample"),o(i4,"sample");function a4(u,d,S){(S?wn(u,d,S):d===r)?d=1:d=Pt(d);var $=Nt(u)?J3:_5;return $(u,d)}i(a4,"sampleSize"),o(a4,"sampleSize");function o4(u){var d=Nt(u)?Z3:A5;return d(u)}i(o4,"shuffle"),o(o4,"shuffle");function s4(u){if(u==null)return 0;if(kn(u))return hf(u)?Bs(u):u.length;var d=bn(u);return d==be||d==ee?u.size:yh(u).length}i(s4,"size"),o(s4,"size");function c4(u,d,S){var $=Nt(u)?Kd:S5;return S&&wn(u,d,S)&&(d=r),$(u,wt(d,3))}i(c4,"some"),o(c4,"some");var lR=Ut(function(u,d){if(u==null)return[];var S=d.length;return S>1&&wn(u,d[0],d[1])?d=[]:S>2&&wn(d[0],d[1],d[2])&&(d=[d[0]]),N1(u,Xr(d,1),[])}),Fh=ED||function(){return Fr.Date.now()};function u4(u,d){if(typeof d!="function")throw new Ni(c);return u=Pt(u),function(){if(--u<1)return d.apply(this,arguments)}}i(u4,"after"),o(u4,"after");function Tg(u,d,S){return d=S?r:d,d=u&&d==null?u.length:d,Ta(u,k,r,r,r,r,d)}i(Tg,"ary"),o(Tg,"ary");function Cg(u,d){var S;if(typeof d!="function")throw new Ni(c);return u=Pt(u),function(){return--u>0&&(S=d.apply(this,arguments)),u<=1&&(d=r),S}}i(Cg,"before"),o(Cg,"before");var Mg=Ut(function(u,d,S){var $=D;if(S.length){var te=oo(S,js(Mg));$|=Q}return Ta(u,$,d,S,te)}),l4=Ut(function(u,d,S){var $=D|P;if(S.length){var te=oo(S,js(l4));$|=Q}return Ta(d,$,u,S,te)});function Ig(u,d,S){d=S?r:d;var $=Ta(u,j,r,r,r,r,r,d);return $.placeholder=Ig.placeholder,$}i(Ig,"curry"),o(Ig,"curry");function kg(u,d,S){d=S?r:d;var $=Ta(u,q,r,r,r,r,r,d);return $.placeholder=kg.placeholder,$}i(kg,"curryRight"),o(kg,"curryRight");function Dg(u,d,S){var $,te,ce,ye,Ee,xe,Ue=0,Fe=!1,$e=!1,Ye=!0;if(typeof u!="function")throw new Ni(c);d=ci(d)||0,kr(S)&&(Fe=!!S.leading,$e="maxWait"in S,ce=$e?Jr(ci(S.maxWait)||0,d):ce,Ye="trailing"in S?!!S.trailing:Ye);function pt(jr){var ea=$,lo=te;return $=te=r,Ue=jr,ye=u.apply(lo,ea),ye}i(pt,"invokeFunc"),o(pt,"invokeFunc");function St(jr){return Ue=jr,Ee=of(Ht,d),Fe?pt(jr):ye}i(St,"leadingEdge"),o(St,"leadingEdge");function Lt(jr){var ea=jr-xe,lo=jr-Ue,o8=d-ea;return $e?vn(o8,ce-lo):o8}i(Lt,"remainingWait"),o(Lt,"remainingWait");function _t(jr){var ea=jr-xe,lo=jr-Ue;return xe===r||ea>=d||ea<0||$e&&lo>=ce}i(_t,"shouldInvoke"),o(_t,"shouldInvoke");function Ht(){var jr=Fh();if(_t(jr))return Gt(jr);Ee=of(Ht,Lt(jr))}i(Ht,"timerExpired"),o(Ht,"timerExpired");function Gt(jr){return Ee=r,Ye&&$?pt(jr):($=te=r,ye)}i(Gt,"trailingEdge"),o(Gt,"trailingEdge");function Hn(){Ee!==r&&x5(Ee),Ue=0,$=xe=te=Ee=r}i(Hn,"cancel"),o(Hn,"cancel");function _n(){return Ee===r?ye:Gt(Fh())}i(_n,"flush"),o(_n,"flush");function qn(){var jr=Fh(),ea=_t(jr);if($=arguments,te=this,xe=jr,ea){if(Ee===r)return St(xe);if($e)return x5(Ee),Ee=of(Ht,d),pt(xe)}return Ee===r&&(Ee=of(Ht,d)),ye}return i(qn,"debounced"),o(qn,"debounced"),qn.cancel=Hn,qn.flush=_n,qn}i(Dg,"debounce"),o(Dg,"debounce");var fR=Ut(function(u,d){return A1(u,1,d)}),dR=Ut(function(u,d,S){return A1(u,ci(d)||0,S)});function f4(u){return Ta(u,he)}i(f4,"flip"),o(f4,"flip");function lf(u,d){if(typeof u!="function"||d!=null&&typeof d!="function")throw new Ni(c);var S=o(function(){var $=arguments,te=d?d.apply(this,$):$[0],ce=S.cache;if(ce.has(te))return ce.get(te);var ye=u.apply(this,$);return S.cache=ce.set(te,ye)||ce,ye},"memoized");return S.cache=new(lf.Cache||Sa),S}i(lf,"memoize"),o(lf,"memoize"),lf.Cache=Sa;function ff(u){if(typeof u!="function")throw new Ni(c);return function(){var d=arguments;switch(d.length){case 0:return!u.call(this);case 1:return!u.call(this,d[0]);case 2:return!u.call(this,d[0],d[1]);case 3:return!u.call(this,d[0],d[1],d[2])}return!u.apply(this,d)}}i(ff,"negate"),o(ff,"negate");function d4(u){return Cg(2,u)}i(d4,"once"),o(d4,"once");var hR=BD(function(u,d){d=d.length==1&&Nt(d[0])?Mr(d[0],jn(wt())):Mr(Xr(d,1),jn(wt()));var S=d.length;return Ut(function($){for(var te=-1,ce=vn($.length,S);++te<ce;)$[te]=d[te].call(this,$[te]);return Fn(u,this,$)})}),Rg=Ut(function(u,d){var S=oo(d,js(Rg));return Ta(u,Q,r,d,S)}),h4=Ut(function(u,d){var S=oo(d,js(h4));return Ta(u,Y,r,d,S)}),pR=Ca(function(u,d){return Ta(u,K,r,r,r,d)});function p4(u,d){if(typeof u!="function")throw new Ni(c);return d=d===r?d:Pt(d),Ut(u,d)}i(p4,"rest"),o(p4,"rest");function m4(u,d){if(typeof u!="function")throw new Ni(c);return d=d==null?0:Jr(Pt(d),0),Ut(function(S){var $=S[d],te=uo(S,0,d);return $&&ao(te,$),Fn(u,this,te)})}i(m4,"spread"),o(m4,"spread");function g4(u,d,S){var $=!0,te=!0;if(typeof u!="function")throw new Ni(c);return kr(S)&&($="leading"in S?!!S.leading:$,te="trailing"in S?!!S.trailing:te),Dg(u,d,{leading:$,maxWait:d,trailing:te})}i(g4,"throttle2"),o(g4,"throttle");function v4(u){return Tg(u,1)}i(v4,"unary"),o(v4,"unary");function y4(u,d){return Rg(Ch(d),u)}i(y4,"wrap"),o(y4,"wrap");function b4(){if(!arguments.length)return[];var u=arguments[0];return Nt(u)?u:[u]}i(b4,"castArray"),o(b4,"castArray");function w4(u){return ai(u,_)}i(w4,"clone"),o(w4,"clone");function _4(u,d){return d=typeof d=="function"?d:r,ai(u,_,d)}i(_4,"cloneWith"),o(_4,"cloneWith");function E4(u){return ai(u,v|_)}i(E4,"cloneDeep6"),o(E4,"cloneDeep");function A4(u,d){return d=typeof d=="function"?d:r,ai(u,v|_,d)}i(A4,"cloneDeepWith"),o(A4,"cloneDeepWith");function S4(u,d){return d==null||E1(u,d,Zr(d))}i(S4,"conformsTo"),o(S4,"conformsTo");function Bi(u,d){return u===d||u!==u&&d!==d}i(Bi,"eq4"),o(Bi,"eq");var mR=rf(mh),gR=rf(function(u,d){return u>=d}),$s=C1(function(){return arguments}())?C1:function(u){return Rr(u)&&yr.call(u,"callee")&&!b3.call(u,"callee")},Nt=ke.isArray,vR=Os?jn(Os):c5;function kn(u){return u!=null&&df(u.length)&&!Ia(u)}i(kn,"isArrayLike2"),o(kn,"isArrayLike");function Pr(u){return Rr(u)&&kn(u)}i(Pr,"isArrayLikeObject"),o(Pr,"isArrayLikeObject");function x4(u){return u===!0||u===!1||Rr(u)&&yn(u)==ne}i(x4,"isBoolean"),o(x4,"isBoolean");var Vo=SD||Jh,yR=K2?jn(K2):u5;function T4(u){return Rr(u)&&u.nodeType===1&&!au(u)}i(T4,"isElement"),o(T4,"isElement");function C4(u){if(u==null)return!0;if(kn(u)&&(Nt(u)||typeof u=="string"||typeof u.splice=="function"||Vo(u)||ou(u)||$s(u)))return!u.length;var d=bn(u);if(d==be||d==ee)return!u.size;if(iu(u))return!yh(u).length;for(var S in u)if(yr.call(u,S))return!1;return!0}i(C4,"isEmpty"),o(C4,"isEmpty");function M4(u,d){return tu(u,d)}i(M4,"isEqual"),o(M4,"isEqual");function I4(u,d,S){S=typeof S=="function"?S:r;var $=S?S(u,d):r;return $===r?tu(u,d,r,S):!!$}i(I4,"isEqualWith"),o(I4,"isEqualWith");function jh(u){if(!Rr(u))return!1;var d=yn(u);return d==G||d==M||typeof u.message=="string"&&typeof u.name=="string"&&!au(u)}i(jh,"isError"),o(jh,"isError");function k4(u){return typeof u=="number"&&_3(u)}i(k4,"isFinite2"),o(k4,"isFinite");function Ia(u){if(!kr(u))return!1;var d=yn(u);return d==ae||d==fe||d==L||d==W}i(Ia,"isFunction2"),o(Ia,"isFunction");function Og(u){return typeof u=="number"&&u==Pt(u)}i(Og,"isInteger3"),o(Og,"isInteger");function df(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=E}i(df,"isLength"),o(df,"isLength");function kr(u){var d=typeof u;return u!=null&&(d=="object"||d=="function")}i(kr,"isObject"),o(kr,"isObject");function Rr(u){return u!=null&&typeof u=="object"}i(Rr,"isObjectLike"),o(Rr,"isObjectLike");var D4=G2?jn(G2):f5;function R4(u,d){return u===d||vh(u,d,Oh(d))}i(R4,"isMatch"),o(R4,"isMatch");function O4(u,d,S){return S=typeof S=="function"?S:r,vh(u,d,Oh(d),S)}i(O4,"isMatchWith"),o(O4,"isMatchWith");function N4(u){return Ng(u)&&u!=+u}i(N4,"isNaN2"),o(N4,"isNaN");function P4(u){if(UD(u))throw new kt(s);return M1(u)}i(P4,"isNative"),o(P4,"isNative");function B4(u){return u===null}i(B4,"isNull"),o(B4,"isNull");function L4(u){return u==null}i(L4,"isNil"),o(L4,"isNil");function Ng(u){return typeof u=="number"||Rr(u)&&yn(u)==Re}i(Ng,"isNumber"),o(Ng,"isNumber");function au(u){if(!Rr(u)||yn(u)!=N)return!1;var d=ah(u);if(d===null)return!0;var S=yr.call(d,"constructor")&&d.constructor;return typeof S=="function"&&S instanceof S&&th.call(S)==yD}i(au,"isPlainObject"),o(au,"isPlainObject");var Pg=W2?jn(W2):d5;function U4(u){return Og(u)&&u>=-E&&u<=E}i(U4,"isSafeInteger"),o(U4,"isSafeInteger");var F4=J2?jn(J2):h5;function hf(u){return typeof u=="string"||!Nt(u)&&Rr(u)&&yn(u)==ue}i(hf,"isString"),o(hf,"isString");function zn(u){return typeof u=="symbol"||Rr(u)&&yn(u)==Ae}i(zn,"isSymbol"),o(zn,"isSymbol");var ou=Z2?jn(Z2):p5;function j4(u){return u===r}i(j4,"isUndefined"),o(j4,"isUndefined");function $4(u){return Rr(u)&&bn(u)==Ie}i($4,"isWeakMap"),o($4,"isWeakMap");function z4(u){return Rr(u)&&yn(u)==Be}i(z4,"isWeakSet"),o(z4,"isWeakSet");var bR=rf(bh),wR=rf(function(u,d){return u<=d});function Bg(u){if(!u)return[];if(kn(u))return hf(u)?Oi(u):In(u);if(jl&&u[jl])return u3(u[jl]());var d=bn(u),S=d==be?Xd:d==ee?Fl:zs;return S(u)}i(Bg,"toArray"),o(Bg,"toArray");function ka(u){if(!u)return u===0?u:0;if(u=ci(u),u===m||u===-m){var d=u<0?-1:1;return d*R}return u===u?u:0}i(ka,"toFinite"),o(ka,"toFinite");function Pt(u){var d=ka(u),S=d%1;return d===d?S?d-S:d:0}i(Pt,"toInteger"),o(Pt,"toInteger");function Lg(u){return u?jo(Pt(u),0,A):0}i(Lg,"toLength"),o(Lg,"toLength");function ci(u){if(typeof u=="number")return u;if(zn(u))return C;if(kr(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=kr(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=l1(u);var S=er.test(u);return S||nn.test(u)?sn(u.slice(2),S?2:8):hn.test(u)?C:+u}i(ci,"toNumber"),o(ci,"toNumber");function Ug(u){return Xi(u,Dn(u))}i(Ug,"toPlainObject"),o(Ug,"toPlainObject");function H4(u){return u?jo(Pt(u),-E,E):u===0?u:0}i(H4,"toSafeInteger"),o(H4,"toSafeInteger");function dr(u){return u==null?"":$n(u)}i(dr,"toString4"),o(dr,"toString");var _R=Us(function(u,d){if(iu(d)||kn(d)){Xi(d,Zr(d),u);return}for(var S in d)yr.call(d,S)&&Xc(u,S,d[S])}),q4=Us(function(u,d){Xi(d,Dn(d),u)}),$h=Us(function(u,d,S,$){Xi(d,Dn(d),u,$)}),ER=Us(function(u,d,S,$){Xi(d,Zr(d),u,$)}),AR=Ca(hh);function V4(u,d){var S=Yc(u);return d==null?S:_1(S,d)}i(V4,"create2"),o(V4,"create");var SR=Ut(function(u,d){u=_r(u);var S=-1,$=d.length,te=$>2?d[2]:r;for(te&&wn(d[0],d[1],te)&&($=1);++S<$;)for(var ce=d[S],ye=Dn(ce),Ee=-1,xe=ye.length;++Ee<xe;){var Ue=ye[Ee],Fe=u[Ue];(Fe===r||Bi(Fe,Wc[Ue])&&!yr.call(u,Ue))&&(u[Ue]=ce[Ue])}return u}),xR=Ut(function(u){return u.push(r,ng),Fn(n_,r,u)});function K4(u,d){return o1(u,wt(d,3),Yi)}i(K4,"findKey"),o(K4,"findKey");function G4(u,d){return o1(u,wt(d,3),ph)}i(G4,"findLastKey"),o(G4,"findLastKey");function W4(u,d){return u==null?u:x1(u,wt(d,3),Dn)}i(W4,"forIn"),o(W4,"forIn");function J4(u,d){return u==null?u:n5(u,wt(d,3),Dn)}i(J4,"forInRight"),o(J4,"forInRight");function Z4(u,d){return u&&Yi(u,wt(d,3))}i(Z4,"forOwn"),o(Z4,"forOwn");function Y4(u,d){return u&&ph(u,wt(d,3))}i(Y4,"forOwnRight"),o(Y4,"forOwnRight");function X4(u){return u==null?[]:Wl(u,Zr(u))}i(X4,"functions"),o(X4,"functions");function Q4(u){return u==null?[]:Wl(u,Dn(u))}i(Q4,"functionsIn"),o(Q4,"functionsIn");function zh(u,d,S){var $=u==null?r:zo(u,d);return $===r?S:$}i(zh,"get2"),o(zh,"get");function e_(u,d){return u!=null&&sg(u,d,i5)}i(e_,"has"),o(e_,"has");function Hh(u,d){return u!=null&&sg(u,d,a5)}i(Hh,"hasIn"),o(Hh,"hasIn");var TR=X1(function(u,d,S){d!=null&&typeof d.toString!="function"&&(d=rh.call(d)),u[d]=S},qh(Rn)),CR=X1(function(u,d,S){d!=null&&typeof d.toString!="function"&&(d=rh.call(d)),yr.call(u,d)?u[d].push(S):u[d]=[S]},wt),MR=Ut(eu);function Zr(u){return kn(u)?b1(u):yh(u)}i(Zr,"keys"),o(Zr,"keys");function Dn(u){return kn(u)?b1(u,!0):m5(u)}i(Dn,"keysIn"),o(Dn,"keysIn");function t_(u,d){var S={};return d=wt(d,3),Yi(u,function($,te,ce){xa(S,d($,te,ce),$)}),S}i(t_,"mapKeys"),o(t_,"mapKeys");function r_(u,d){var S={};return d=wt(d,3),Yi(u,function($,te,ce){xa(S,te,d($,te,ce))}),S}i(r_,"mapValues"),o(r_,"mapValues");var IR=Us(function(u,d,S){Jl(u,d,S)}),n_=Us(function(u,d,S,$){Jl(u,d,S,$)}),kR=Ca(function(u,d){var S={};if(u==null)return S;var $=!1;d=Mr(d,function(ce){return ce=co(ce,u),$||($=ce.length>1),ce}),Xi(u,Rh(u),S),$&&(S=ai(S,v|y|_,P5));for(var te=d.length;te--;)Sh(S,d[te]);return S});function i_(u,d){return Fg(u,ff(wt(d)))}i(i_,"omitBy"),o(i_,"omitBy");var DR=Ca(function(u,d){return u==null?{}:v5(u,d)});function Fg(u,d){if(u==null)return{};var S=Mr(Rh(u),function($){return[$]});return d=wt(d),P1(u,S,function($,te){return d($,te[0])})}i(Fg,"pickBy"),o(Fg,"pickBy");function a_(u,d,S){d=co(d,u);var $=-1,te=d.length;for(te||(te=1,u=r);++$<te;){var ce=u==null?r:u[Qi(d[$])];ce===r&&($=te,ce=S),u=Ia(ce)?ce.call(u):ce}return u}i(a_,"result"),o(a_,"result");function o_(u,d,S){return u==null?u:ru(u,d,S)}i(o_,"set"),o(o_,"set");function s_(u,d,S,$){return $=typeof $=="function"?$:r,u==null?u:ru(u,d,S,$)}i(s_,"setWith"),o(s_,"setWith");var c_=tg(Zr),u_=tg(Dn);function l_(u,d,S){var $=Nt(u),te=$||Vo(u)||ou(u);if(d=wt(d,4),S==null){var ce=u&&u.constructor;te?S=$?new ce:[]:kr(u)?S=Ia(ce)?Yc(ah(u)):{}:S={}}return(te?ni:Yi)(u,function(ye,Ee,xe){return d(S,ye,Ee,xe)}),S}i(l_,"transform"),o(l_,"transform");function f_(u,d){return u==null?!0:Sh(u,d)}i(f_,"unset"),o(f_,"unset");function d_(u,d,S){return u==null?u:F1(u,d,Ch(S))}i(d_,"update2"),o(d_,"update");function h_(u,d,S,$){return $=typeof $=="function"?$:r,u==null?u:F1(u,d,Ch(S),$)}i(h_,"updateWith"),o(h_,"updateWith");function zs(u){return u==null?[]:Yd(u,Zr(u))}i(zs,"values"),o(zs,"values");function p_(u){return u==null?[]:Yd(u,Dn(u))}i(p_,"valuesIn"),o(p_,"valuesIn");function m_(u,d,S){return S===r&&(S=d,d=r),S!==r&&(S=ci(S),S=S===S?S:0),d!==r&&(d=ci(d),d=d===d?d:0),jo(ci(u),d,S)}i(m_,"clamp"),o(m_,"clamp");function g_(u,d,S){return d=ka(d),S===r?(S=d,d=0):S=ka(S),u=ci(u),o5(u,d,S)}i(g_,"inRange"),o(g_,"inRange");function v_(u,d,S){if(S&&typeof S!="boolean"&&wn(u,d,S)&&(d=S=r),S===r&&(typeof d=="boolean"?(S=d,d=r):typeof u=="boolean"&&(S=u,u=r)),u===r&&d===r?(u=0,d=1):(u=ka(u),d===r?(d=u,u=0):d=ka(d)),u>d){var $=u;u=d,d=$}if(S||u%1||d%1){var te=E3();return vn(u+te*(d-u+Kr("1e-"+((te+"").length-1))),d)}return _h(u,d)}i(v_,"random"),o(v_,"random");var RR=Fs(function(u,d,S){return d=d.toLowerCase(),u+(S?jg(d):d)});function jg(u){return zg(dr(u).toLowerCase())}i(jg,"capitalize"),o(jg,"capitalize");function $g(u){return u=dr(u),u&&u.replace(Nr,fD).replace($d,"")}i($g,"deburr"),o($g,"deburr");function y_(u,d,S){u=dr(u),d=$n(d);var $=u.length;S=S===r?$:jo(Pt(S),0,$);var te=S;return S-=d.length,S>=0&&u.slice(S,te)==d}i(y_,"endsWith"),o(y_,"endsWith");function b_(u){return u=dr(u),u&&ut.test(u)?u.replace(Or,dD):u}i(b_,"escape"),o(b_,"escape");function w_(u){return u=dr(u),u&&at.test(u)?u.replace(Qt,"\\$&"):u}i(w_,"escapeRegExp"),o(w_,"escapeRegExp");var OR=Fs(function(u,d,S){return u+(S?"-":"")+d.toLowerCase()}),NR=Fs(function(u,d,S){return u+(S?" ":"")+d.toLowerCase()}),PR=J1("toLowerCase");function __(u,d,S){u=dr(u),d=Pt(d);var $=d?Bs(u):0;if(!d||$>=d)return u;var te=(d-$)/2;return tf(uh(te),S)+u+tf(ch(te),S)}i(__,"pad2"),o(__,"pad");function E_(u,d,S){u=dr(u),d=Pt(d);var $=d?Bs(u):0;return d&&$<d?u+tf(d-$,S):u}i(E_,"padEnd"),o(E_,"padEnd");function A_(u,d,S){u=dr(u),d=Pt(d);var $=d?Bs(u):0;return d&&$<d?tf(d-$,S)+u:u}i(A_,"padStart"),o(A_,"padStart");function S_(u,d,S){return S||d==null?d=0:d&&(d=+d),MD(dr(u).replace(et,""),d||0)}i(S_,"parseInt2"),o(S_,"parseInt");function x_(u,d,S){return(S?wn(u,d,S):d===r)?d=1:d=Pt(d),Eh(dr(u),d)}i(x_,"repeat"),o(x_,"repeat");function T_(){var u=arguments,d=dr(u[0]);return u.length<3?d:d.replace(u[1],u[2])}i(T_,"replace"),o(T_,"replace");var BR=Fs(function(u,d,S){return u+(S?"_":"")+d.toLowerCase()});function C_(u,d,S){return S&&typeof S!="number"&&wn(u,d,S)&&(d=S=r),S=S===r?A:S>>>0,S?(u=dr(u),u&&(typeof d=="string"||d!=null&&!Pg(d))&&(d=$n(d),!d&&Ps(u))?uo(Oi(u),0,S):u.split(d,S)):[]}i(C_,"split"),o(C_,"split");var LR=Fs(function(u,d,S){return u+(S?" ":"")+zg(d)});function M_(u,d,S){return u=dr(u),S=S==null?0:jo(Pt(S),0,u.length),d=$n(d),u.slice(S,S+d.length)==d}i(M_,"startsWith"),o(M_,"startsWith");function I_(u,d,S){var $=se.templateSettings;S&&wn(u,d,S)&&(d=r),u=dr(u),d=$h({},d,$,rg);var te=$h({},d.imports,$.imports,rg),ce=Zr(te),ye=Yd(te,ce),Ee,xe,Ue=0,Fe=d.interpolate||Vr,$e="__p += '",Ye=m1((d.escape||Vr).source+"|"+Fe.source+"|"+(Fe===nt?At:Vr).source+"|"+(d.evaluate||Vr).source+"|$","g"),pt="//# sourceURL="+(yr.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vc+"]")+`
26
+ `)}i(q5,"insertWrapDetails"),o(q5,"insertWrapDetails");function V5(u){return Nt(u)||Hs(u)||!!(w3&&u&&u[w3])}i(V5,"isFlattenable"),o(V5,"isFlattenable");function Ma(u,d){var S=typeof u;return d=d??E,!!d&&(S=="number"||S!="symbol"&&an.test(u))&&u>-1&&u%1==0&&u<d}i(Ma,"isIndex"),o(Ma,"isIndex");function wn(u,d,S){if(!kr(S))return!1;var $=typeof d;return($=="number"?kn(S)&&Ma(d,S.length):$=="string"&&d in S)?Bi(S[d],u):!1}i(wn,"isIterateeCall"),o(wn,"isIterateeCall");function Nh(u,d){if(Nt(u))return!1;var S=typeof u;return S=="number"||S=="symbol"||S=="boolean"||u==null||zn(u)?!0:it.test(u)||!or.test(u)||d!=null&&u in _r(d)}i(Nh,"isKey"),o(Nh,"isKey");function K5(u){var d=typeof u;return d=="string"||d=="number"||d=="symbol"||d=="boolean"?u!=="__proto__":u===null}i(K5,"isKeyable"),o(K5,"isKeyable");function Ph(u){var d=nf(u),S=se[d];if(typeof S!="function"||!(d in Kt.prototype))return!1;if(u===S)return!0;var $=ag(S);return!!$&&u===$[0]}i(Ph,"isLaziable"),o(Ph,"isLaziable");function G5(u){return!!g3&&g3 in u}i(G5,"isMasked"),o(G5,"isMasked");var UD=eh?Ia:Jh;function iu(u){var d=u&&u.constructor,S=typeof d=="function"&&d.prototype||Wc;return u===S}i(iu,"isPrototype"),o(iu,"isPrototype");function ug(u){return u===u&&!kr(u)}i(ug,"isStrictComparable"),o(ug,"isStrictComparable");function lg(u,d){return function(S){return S==null?!1:S[u]===d&&(d!==r||u in _r(S))}}i(lg,"matchesStrictComparable"),o(lg,"matchesStrictComparable");function W5(u){var d=lf(u,function($){return S.size===p&&S.clear(),$}),S=d.cache;return d}i(W5,"memoizeCapped"),o(W5,"memoizeCapped");function J5(u,d){var S=u[1],$=d[1],te=S|$,ce=te<(D|P|k),ye=$==k&&S==j||$==k&&S==K&&u[7].length<=d[8]||$==(k|K)&&d[7].length<=d[8]&&S==j;if(!(ce||ye))return u;$&D&&(u[2]=d[2],te|=S&D?0:J);var Ee=d[3];if(Ee){var xe=u[3];u[3]=xe?V1(xe,Ee,d[4]):Ee,u[4]=xe?oo(u[3],g):d[4]}return Ee=d[5],Ee&&(xe=u[5],u[5]=xe?K1(xe,Ee,d[6]):Ee,u[6]=xe?oo(u[5],g):d[6]),Ee=d[7],Ee&&(u[7]=Ee),$&k&&(u[8]=u[8]==null?d[8]:vn(u[8],d[8])),u[9]==null&&(u[9]=d[9]),u[0]=d[0],u[1]=te,u}i(J5,"mergeData"),o(J5,"mergeData");function Z5(u){var d=[];if(u!=null)for(var S in _r(u))d.push(S);return d}i(Z5,"nativeKeysIn"),o(Z5,"nativeKeysIn");function Y5(u){return rh.call(u)}i(Y5,"objectToString"),o(Y5,"objectToString");function fg(u,d,S){return d=Jr(d===r?u.length-1:d,0),function(){for(var $=arguments,te=-1,ce=Jr($.length-d,0),ye=ke(ce);++te<ce;)ye[te]=$[d+te];te=-1;for(var Ee=ke(d+1);++te<d;)Ee[te]=$[te];return Ee[d]=S(ye),Fn(u,this,Ee)}}i(fg,"overRest"),o(fg,"overRest");function dg(u,d){return d.length<2?u:zo(u,oi(d,0,-1))}i(dg,"parent"),o(dg,"parent");function X5(u,d){for(var S=u.length,$=vn(d.length,S),te=In(u);$--;){var ce=d[$];u[$]=Ma(ce,S)?te[ce]:r}return u}i(X5,"reorder"),o(X5,"reorder");function Bh(u,d){if(!(d==="constructor"&&typeof u[d]=="function")&&d!="__proto__")return u[d]}i(Bh,"safeGet"),o(Bh,"safeGet");var Q5=mg(E5),of=AD||function(u,d){return Fr.setTimeout(u,d)},hg=mg(PD);function pg(u,d,S){var $=d+"";return hg(u,q5($,tw($5($),S)))}i(pg,"setWrapToString"),o(pg,"setWrapToString");function mg(u){var d=0,S=0;return function(){var $=CD(),te=w-($-S);if(S=$,te>0){if(++d>=Z)return arguments[0]}else d=0;return u.apply(r,arguments)}}i(mg,"shortOut"),o(mg,"shortOut");function sf(u,d){var S=-1,$=u.length,te=$-1;for(d=d===r?$:d;++S<d;){var ce=_h(S,te),ye=u[ce];u[ce]=u[S],u[S]=ye}return u.length=d,u}i(sf,"shuffleSelf"),o(sf,"shuffleSelf");var ew=W5(function(u){var d=[];return u.charCodeAt(0)===46&&d.push(""),u.replace(Xe,function(S,$,te,ce){d.push(te?ce.replace(Tn,"$1"):$||S)}),d});function Qi(u){if(typeof u=="string"||zn(u))return u;var d=u+"";return d=="0"&&1/u==-m?"-0":d}i(Qi,"toKey"),o(Qi,"toKey");function qo(u){if(u!=null){try{return th.call(u)}catch{}try{return u+""}catch{}}return""}i(qo,"toSource"),o(qo,"toSource");function tw(u,d){return ni(I,function(S){var $="_."+S[0];d&S[1]&&!Ll(u,$)&&u.push($)}),u.sort()}i(tw,"updateWrapDetails"),o(tw,"updateWrapDetails");function gg(u){if(u instanceof Kt)return u.clone();var d=new ii(u.__wrapped__,u.__chain__);return d.__actions__=In(u.__actions__),d.__index__=u.__index__,d.__values__=u.__values__,d}i(gg,"wrapperClone"),o(gg,"wrapperClone");function rw(u,d,S){(S?wn(u,d,S):d===r)?d=1:d=Jr(Pt(d),0);var $=u==null?0:u.length;if(!$||d<1)return[];for(var te=0,ce=0,ye=ke(ch($/d));te<$;)ye[ce++]=oi(u,te,te+=d);return ye}i(rw,"chunk"),o(rw,"chunk");function nw(u){for(var d=-1,S=u==null?0:u.length,$=0,te=[];++d<S;){var ce=u[d];ce&&(te[$++]=ce)}return te}i(nw,"compact"),o(nw,"compact");function iw(){var u=arguments.length;if(!u)return[];for(var d=ke(u-1),S=arguments[0],$=u;$--;)d[$-1]=arguments[$];return ao(Nt(S)?In(S):[S],Xr(d,1))}i(iw,"concat4"),o(iw,"concat");var FD=Ut(function(u,d){return Pr(u)?Qc(u,Xr(d,1,Pr,!0)):[]}),jD=Ut(function(u,d){var S=si(d);return Pr(S)&&(S=r),Pr(u)?Qc(u,Xr(d,1,Pr,!0),wt(S,2)):[]}),$D=Ut(function(u,d){var S=si(d);return Pr(S)&&(S=r),Pr(u)?Qc(u,Xr(d,1,Pr,!0),r,S):[]});function aw(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),oi(u,d<0?0:d,$)):[]}i(aw,"drop"),o(aw,"drop");function ow(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),d=$-d,oi(u,0,d<0?0:d)):[]}i(ow,"dropRight"),o(ow,"dropRight");function sw(u,d){return u&&u.length?Yl(u,wt(d,3),!0,!0):[]}i(sw,"dropRightWhile"),o(sw,"dropRightWhile");function cw(u,d){return u&&u.length?Yl(u,wt(d,3),!0):[]}i(cw,"dropWhile"),o(cw,"dropWhile");function uw(u,d,S,$){var te=u==null?0:u.length;return te?(S&&typeof S!="number"&&wn(u,d,S)&&(S=0,$=te),r5(u,d,S,$)):[]}i(uw,"fill"),o(uw,"fill");function vg(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Pt(S);return te<0&&(te=Jr($+te,0)),Ul(u,wt(d,3),te)}i(vg,"findIndex"),o(vg,"findIndex");function yg(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=$-1;return S!==r&&(te=Pt(S),te=S<0?Jr($+te,0):vn(te,$-1)),Ul(u,wt(d,3),te,!0)}i(yg,"findLastIndex"),o(yg,"findLastIndex");function bg(u){var d=u==null?0:u.length;return d?Xr(u,1):[]}i(bg,"flatten"),o(bg,"flatten");function lw(u){var d=u==null?0:u.length;return d?Xr(u,m):[]}i(lw,"flattenDeep"),o(lw,"flattenDeep");function fw(u,d){var S=u==null?0:u.length;return S?(d=d===r?1:Pt(d),Xr(u,d)):[]}i(fw,"flattenDepth"),o(fw,"flattenDepth");function dw(u){for(var d=-1,S=u==null?0:u.length,$={};++d<S;){var te=u[d];$[te[0]]=te[1]}return $}i(dw,"fromPairs"),o(dw,"fromPairs");function wg(u){return u&&u.length?u[0]:r}i(wg,"head"),o(wg,"head");function hw(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=S==null?0:Pt(S);return te<0&&(te=Jr($+te,0)),Bs(u,d,te)}i(hw,"indexOf"),o(hw,"indexOf");function pw(u){var d=u==null?0:u.length;return d?oi(u,0,-1):[]}i(pw,"initial"),o(pw,"initial");var zD=Ut(function(u){var d=Mr(u,Th);return d.length&&d[0]===u[0]?gh(d):[]}),HD=Ut(function(u){var d=si(u),S=Mr(u,Th);return d===si(S)?d=r:S.pop(),S.length&&S[0]===u[0]?gh(S,wt(d,2)):[]}),qD=Ut(function(u){var d=si(u),S=Mr(u,Th);return d=typeof d=="function"?d:r,d&&S.pop(),S.length&&S[0]===u[0]?gh(S,r,d):[]});function mw(u,d){return u==null?"":xD.call(u,d)}i(mw,"join"),o(mw,"join");function si(u){var d=u==null?0:u.length;return d?u[d-1]:r}i(si,"last2"),o(si,"last");function gw(u,d,S){var $=u==null?0:u.length;if(!$)return-1;var te=$;return S!==r&&(te=Pt(S),te=te<0?Jr($+te,0):vn(te,$-1)),d===d?d3(u,d,te):Ul(u,s1,te,!0)}i(gw,"lastIndexOf"),o(gw,"lastIndexOf");function vw(u,d){return u&&u.length?O1(u,Pt(d)):r}i(vw,"nth"),o(vw,"nth");var VD=Ut(_g);function _g(u,d){return u&&u.length&&d&&d.length?wh(u,d):u}i(_g,"pullAll"),o(_g,"pullAll");function yw(u,d,S){return u&&u.length&&d&&d.length?wh(u,d,wt(S,2)):u}i(yw,"pullAllBy"),o(yw,"pullAllBy");function bw(u,d,S){return u&&u.length&&d&&d.length?wh(u,d,r,S):u}i(bw,"pullAllWith"),o(bw,"pullAllWith");var KD=Ca(function(u,d){var S=u==null?0:u.length,$=hh(u,d);return B1(u,Mr(d,function(te){return Ma(te,S)?+te:te}).sort(q1)),$});function ww(u,d){var S=[];if(!(u&&u.length))return S;var $=-1,te=[],ce=u.length;for(d=wt(d,3);++$<ce;){var ye=u[$];d(ye,$,u)&&(S.push(ye),te.push($))}return B1(u,te),S}i(ww,"remove"),o(ww,"remove");function Lh(u){return u==null?u:ID.call(u)}i(Lh,"reverse"),o(Lh,"reverse");function _w(u,d,S){var $=u==null?0:u.length;return $?(S&&typeof S!="number"&&wn(u,d,S)?(d=0,S=$):(d=d==null?0:Pt(d),S=S===r?$:Pt(S)),oi(u,d,S)):[]}i(_w,"slice2"),o(_w,"slice");function Ew(u,d){return Zl(u,d)}i(Ew,"sortedIndex"),o(Ew,"sortedIndex");function Aw(u,d,S){return Ah(u,d,wt(S,2))}i(Aw,"sortedIndexBy"),o(Aw,"sortedIndexBy");function Sw(u,d){var S=u==null?0:u.length;if(S){var $=Zl(u,d);if($<S&&Bi(u[$],d))return $}return-1}i(Sw,"sortedIndexOf"),o(Sw,"sortedIndexOf");function xw(u,d){return Zl(u,d,!0)}i(xw,"sortedLastIndex"),o(xw,"sortedLastIndex");function Tw(u,d,S){return Ah(u,d,wt(S,2),!0)}i(Tw,"sortedLastIndexBy"),o(Tw,"sortedLastIndexBy");function Cw(u,d){var S=u==null?0:u.length;if(S){var $=Zl(u,d,!0)-1;if(Bi(u[$],d))return $}return-1}i(Cw,"sortedLastIndexOf"),o(Cw,"sortedLastIndexOf");function Mw(u){return u&&u.length?L1(u):[]}i(Mw,"sortedUniq"),o(Mw,"sortedUniq");function Iw(u,d){return u&&u.length?L1(u,wt(d,2)):[]}i(Iw,"sortedUniqBy"),o(Iw,"sortedUniqBy");function kw(u){var d=u==null?0:u.length;return d?oi(u,1,d):[]}i(kw,"tail"),o(kw,"tail");function Dw(u,d,S){return u&&u.length?(d=S||d===r?1:Pt(d),oi(u,0,d<0?0:d)):[]}i(Dw,"take2"),o(Dw,"take");function Rw(u,d,S){var $=u==null?0:u.length;return $?(d=S||d===r?1:Pt(d),d=$-d,oi(u,d<0?0:d,$)):[]}i(Rw,"takeRight"),o(Rw,"takeRight");function Ow(u,d){return u&&u.length?Yl(u,wt(d,3),!1,!0):[]}i(Ow,"takeRightWhile"),o(Ow,"takeRightWhile");function Nw(u,d){return u&&u.length?Yl(u,wt(d,3)):[]}i(Nw,"takeWhile"),o(Nw,"takeWhile");var GD=Ut(function(u){return so(Xr(u,1,Pr,!0))}),WD=Ut(function(u){var d=si(u);return Pr(d)&&(d=r),so(Xr(u,1,Pr,!0),wt(d,2))}),JD=Ut(function(u){var d=si(u);return d=typeof d=="function"?d:r,so(Xr(u,1,Pr,!0),r,d)});function Pw(u){return u&&u.length?so(u):[]}i(Pw,"uniq"),o(Pw,"uniq");function Bw(u,d){return u&&u.length?so(u,wt(d,2)):[]}i(Bw,"uniqBy"),o(Bw,"uniqBy");function Lw(u,d){return d=typeof d=="function"?d:r,u&&u.length?so(u,r,d):[]}i(Lw,"uniqWith"),o(Lw,"uniqWith");function Uh(u){if(!(u&&u.length))return[];var d=0;return u=io(u,function(S){if(Pr(S))return d=Jr(S.length,d),!0}),Zd(d,function(S){return Mr(u,Gd(S))})}i(Uh,"unzip"),o(Uh,"unzip");function Eg(u,d){if(!(u&&u.length))return[];var S=Uh(u);return d==null?S:Mr(S,function($){return Fn(d,r,$)})}i(Eg,"unzipWith"),o(Eg,"unzipWith");var ZD=Ut(function(u,d){return Pr(u)?Qc(u,d):[]}),YD=Ut(function(u){return xh(io(u,Pr))}),XD=Ut(function(u){var d=si(u);return Pr(d)&&(d=r),xh(io(u,Pr),wt(d,2))}),QD=Ut(function(u){var d=si(u);return d=typeof d=="function"?d:r,xh(io(u,Pr),r,d)}),eR=Ut(Uh);function Uw(u,d){return $1(u||[],d||[],Xc)}i(Uw,"zipObject"),o(Uw,"zipObject");function Fw(u,d){return $1(u||[],d||[],ru)}i(Fw,"zipObjectDeep"),o(Fw,"zipObjectDeep");var tR=Ut(function(u){var d=u.length,S=d>1?u[d-1]:r;return S=typeof S=="function"?(u.pop(),S):r,Eg(u,S)});function Ag(u){var d=se(u);return d.__chain__=!0,d}i(Ag,"chain"),o(Ag,"chain");function jw(u,d){return d(u),u}i(jw,"tap"),o(jw,"tap");function cf(u,d){return d(u)}i(cf,"thru"),o(cf,"thru");var rR=Ca(function(u){var d=u.length,S=d?u[0]:0,$=this.__wrapped__,te=o(function(ce){return hh(ce,u)},"interceptor");return d>1||this.__actions__.length||!($ instanceof Kt)||!Ma(S)?this.thru(te):($=$.slice(S,+S+(d?1:0)),$.__actions__.push({func:cf,args:[te],thisArg:r}),new ii($,this.__chain__).thru(function(ce){return d&&!ce.length&&ce.push(r),ce}))});function $w(){return Ag(this)}i($w,"wrapperChain"),o($w,"wrapperChain");function zw(){return new ii(this.value(),this.__chain__)}i(zw,"wrapperCommit"),o(zw,"wrapperCommit");function Hw(){this.__values__===r&&(this.__values__=Bg(this.value()));var u=this.__index__>=this.__values__.length,d=u?r:this.__values__[this.__index__++];return{done:u,value:d}}i(Hw,"wrapperNext"),o(Hw,"wrapperNext");function qw(){return this}i(qw,"wrapperToIterator"),o(qw,"wrapperToIterator");function Vw(u){for(var d,S=this;S instanceof Vl;){var $=gg(S);$.__index__=0,$.__values__=r,d?te.__wrapped__=$:d=$;var te=$;S=S.__wrapped__}return te.__wrapped__=u,d}i(Vw,"wrapperPlant"),o(Vw,"wrapperPlant");function Kw(){var u=this.__wrapped__;if(u instanceof Kt){var d=u;return this.__actions__.length&&(d=new Kt(this)),d=d.reverse(),d.__actions__.push({func:cf,args:[Lh],thisArg:r}),new ii(d,this.__chain__)}return this.thru(Lh)}i(Kw,"wrapperReverse"),o(Kw,"wrapperReverse");function Gw(){return j1(this.__wrapped__,this.__actions__)}i(Gw,"wrapperValue"),o(Gw,"wrapperValue");var nR=Xl(function(u,d,S){yr.call(u,S)?++u[S]:xa(u,S,1)});function Ww(u,d,S){var $=Nt(u)?a1:t5;return S&&wn(u,d,S)&&(d=r),$(u,wt(d,3))}i(Ww,"every"),o(Ww,"every");function Jw(u,d){var S=Nt(u)?io:S1;return S(u,wt(d,3))}i(Jw,"filter2"),o(Jw,"filter");var iR=Z1(vg),aR=Z1(yg);function Zw(u,d){return Xr(uf(u,d),1)}i(Zw,"flatMap"),o(Zw,"flatMap");function Yw(u,d){return Xr(uf(u,d),m)}i(Yw,"flatMapDeep"),o(Yw,"flatMapDeep");function Xw(u,d,S){return S=S===r?1:Pt(S),Xr(uf(u,d),S)}i(Xw,"flatMapDepth"),o(Xw,"flatMapDepth");function Sg(u,d){var S=Nt(u)?ni:$o;return S(u,wt(d,3))}i(Sg,"forEach"),o(Sg,"forEach");function xg(u,d){var S=Nt(u)?X2:e5;return S(u,wt(d,3))}i(xg,"forEachRight"),o(xg,"forEachRight");var oR=Xl(function(u,d,S){yr.call(u,S)?u[S].push(d):xa(u,S,[d])});function Qw(u,d,S,$){u=kn(u)?u:qs(u),S=S&&!$?Pt(S):0;var te=u.length;return S<0&&(S=Jr(te+S,0)),hf(u)?S<=te&&u.indexOf(d,S)>-1:!!te&&Bs(u,d,S)>-1}i(Qw,"includes"),o(Qw,"includes");var sR=Ut(function(u,d,S){var $=-1,te=typeof d=="function",ce=kn(u)?ke(u.length):[];return $o(u,function(ye){ce[++$]=te?Fn(d,ye,S):eu(ye,d,S)}),ce}),cR=Xl(function(u,d,S){xa(u,S,d)});function uf(u,d){var S=Nt(u)?Mr:k1;return S(u,wt(d,3))}i(uf,"map2"),o(uf,"map");function e4(u,d,S,$){return u==null?[]:(Nt(d)||(d=d==null?[]:[d]),S=$?r:S,Nt(S)||(S=S==null?[]:[S]),N1(u,d,S))}i(e4,"orderBy"),o(e4,"orderBy");var uR=Xl(function(u,d,S){u[S?0:1].push(d)},function(){return[[],[]]});function t4(u,d,S){var $=Nt(u)?Vd:u1,te=arguments.length<3;return $(u,wt(d,4),S,te,$o)}i(t4,"reduce"),o(t4,"reduce");function r4(u,d,S){var $=Nt(u)?Q2:u1,te=arguments.length<3;return $(u,wt(d,4),S,te,e5)}i(r4,"reduceRight"),o(r4,"reduceRight");function n4(u,d){var S=Nt(u)?io:S1;return S(u,ff(wt(d,3)))}i(n4,"reject"),o(n4,"reject");function i4(u){var d=Nt(u)?w1:w5;return d(u)}i(i4,"sample"),o(i4,"sample");function a4(u,d,S){(S?wn(u,d,S):d===r)?d=1:d=Pt(d);var $=Nt(u)?J3:_5;return $(u,d)}i(a4,"sampleSize"),o(a4,"sampleSize");function o4(u){var d=Nt(u)?Z3:A5;return d(u)}i(o4,"shuffle"),o(o4,"shuffle");function s4(u){if(u==null)return 0;if(kn(u))return hf(u)?Us(u):u.length;var d=bn(u);return d==be||d==ee?u.size:yh(u).length}i(s4,"size"),o(s4,"size");function c4(u,d,S){var $=Nt(u)?Kd:S5;return S&&wn(u,d,S)&&(d=r),$(u,wt(d,3))}i(c4,"some"),o(c4,"some");var lR=Ut(function(u,d){if(u==null)return[];var S=d.length;return S>1&&wn(u,d[0],d[1])?d=[]:S>2&&wn(d[0],d[1],d[2])&&(d=[d[0]]),N1(u,Xr(d,1),[])}),Fh=ED||function(){return Fr.Date.now()};function u4(u,d){if(typeof d!="function")throw new Ni(c);return u=Pt(u),function(){if(--u<1)return d.apply(this,arguments)}}i(u4,"after"),o(u4,"after");function Tg(u,d,S){return d=S?r:d,d=u&&d==null?u.length:d,Ta(u,k,r,r,r,r,d)}i(Tg,"ary"),o(Tg,"ary");function Cg(u,d){var S;if(typeof d!="function")throw new Ni(c);return u=Pt(u),function(){return--u>0&&(S=d.apply(this,arguments)),u<=1&&(d=r),S}}i(Cg,"before"),o(Cg,"before");var Mg=Ut(function(u,d,S){var $=D;if(S.length){var te=oo(S,zs(Mg));$|=Q}return Ta(u,$,d,S,te)}),l4=Ut(function(u,d,S){var $=D|P;if(S.length){var te=oo(S,zs(l4));$|=Q}return Ta(d,$,u,S,te)});function Ig(u,d,S){d=S?r:d;var $=Ta(u,j,r,r,r,r,r,d);return $.placeholder=Ig.placeholder,$}i(Ig,"curry"),o(Ig,"curry");function kg(u,d,S){d=S?r:d;var $=Ta(u,q,r,r,r,r,r,d);return $.placeholder=kg.placeholder,$}i(kg,"curryRight"),o(kg,"curryRight");function Dg(u,d,S){var $,te,ce,ye,Ee,xe,Ue=0,Fe=!1,$e=!1,Ye=!0;if(typeof u!="function")throw new Ni(c);d=ci(d)||0,kr(S)&&(Fe=!!S.leading,$e="maxWait"in S,ce=$e?Jr(ci(S.maxWait)||0,d):ce,Ye="trailing"in S?!!S.trailing:Ye);function pt(jr){var ea=$,lo=te;return $=te=r,Ue=jr,ye=u.apply(lo,ea),ye}i(pt,"invokeFunc"),o(pt,"invokeFunc");function St(jr){return Ue=jr,Ee=of(Ht,d),Fe?pt(jr):ye}i(St,"leadingEdge"),o(St,"leadingEdge");function Lt(jr){var ea=jr-xe,lo=jr-Ue,o8=d-ea;return $e?vn(o8,ce-lo):o8}i(Lt,"remainingWait"),o(Lt,"remainingWait");function _t(jr){var ea=jr-xe,lo=jr-Ue;return xe===r||ea>=d||ea<0||$e&&lo>=ce}i(_t,"shouldInvoke"),o(_t,"shouldInvoke");function Ht(){var jr=Fh();if(_t(jr))return Gt(jr);Ee=of(Ht,Lt(jr))}i(Ht,"timerExpired"),o(Ht,"timerExpired");function Gt(jr){return Ee=r,Ye&&$?pt(jr):($=te=r,ye)}i(Gt,"trailingEdge"),o(Gt,"trailingEdge");function Hn(){Ee!==r&&x5(Ee),Ue=0,$=xe=te=Ee=r}i(Hn,"cancel"),o(Hn,"cancel");function _n(){return Ee===r?ye:Gt(Fh())}i(_n,"flush"),o(_n,"flush");function qn(){var jr=Fh(),ea=_t(jr);if($=arguments,te=this,xe=jr,ea){if(Ee===r)return St(xe);if($e)return x5(Ee),Ee=of(Ht,d),pt(xe)}return Ee===r&&(Ee=of(Ht,d)),ye}return i(qn,"debounced"),o(qn,"debounced"),qn.cancel=Hn,qn.flush=_n,qn}i(Dg,"debounce"),o(Dg,"debounce");var fR=Ut(function(u,d){return A1(u,1,d)}),dR=Ut(function(u,d,S){return A1(u,ci(d)||0,S)});function f4(u){return Ta(u,he)}i(f4,"flip"),o(f4,"flip");function lf(u,d){if(typeof u!="function"||d!=null&&typeof d!="function")throw new Ni(c);var S=o(function(){var $=arguments,te=d?d.apply(this,$):$[0],ce=S.cache;if(ce.has(te))return ce.get(te);var ye=u.apply(this,$);return S.cache=ce.set(te,ye)||ce,ye},"memoized");return S.cache=new(lf.Cache||Sa),S}i(lf,"memoize"),o(lf,"memoize"),lf.Cache=Sa;function ff(u){if(typeof u!="function")throw new Ni(c);return function(){var d=arguments;switch(d.length){case 0:return!u.call(this);case 1:return!u.call(this,d[0]);case 2:return!u.call(this,d[0],d[1]);case 3:return!u.call(this,d[0],d[1],d[2])}return!u.apply(this,d)}}i(ff,"negate"),o(ff,"negate");function d4(u){return Cg(2,u)}i(d4,"once"),o(d4,"once");var hR=BD(function(u,d){d=d.length==1&&Nt(d[0])?Mr(d[0],jn(wt())):Mr(Xr(d,1),jn(wt()));var S=d.length;return Ut(function($){for(var te=-1,ce=vn($.length,S);++te<ce;)$[te]=d[te].call(this,$[te]);return Fn(u,this,$)})}),Rg=Ut(function(u,d){var S=oo(d,zs(Rg));return Ta(u,Q,r,d,S)}),h4=Ut(function(u,d){var S=oo(d,zs(h4));return Ta(u,Y,r,d,S)}),pR=Ca(function(u,d){return Ta(u,K,r,r,r,d)});function p4(u,d){if(typeof u!="function")throw new Ni(c);return d=d===r?d:Pt(d),Ut(u,d)}i(p4,"rest"),o(p4,"rest");function m4(u,d){if(typeof u!="function")throw new Ni(c);return d=d==null?0:Jr(Pt(d),0),Ut(function(S){var $=S[d],te=uo(S,0,d);return $&&ao(te,$),Fn(u,this,te)})}i(m4,"spread"),o(m4,"spread");function g4(u,d,S){var $=!0,te=!0;if(typeof u!="function")throw new Ni(c);return kr(S)&&($="leading"in S?!!S.leading:$,te="trailing"in S?!!S.trailing:te),Dg(u,d,{leading:$,maxWait:d,trailing:te})}i(g4,"throttle2"),o(g4,"throttle");function v4(u){return Tg(u,1)}i(v4,"unary"),o(v4,"unary");function y4(u,d){return Rg(Ch(d),u)}i(y4,"wrap"),o(y4,"wrap");function b4(){if(!arguments.length)return[];var u=arguments[0];return Nt(u)?u:[u]}i(b4,"castArray"),o(b4,"castArray");function w4(u){return ai(u,_)}i(w4,"clone"),o(w4,"clone");function _4(u,d){return d=typeof d=="function"?d:r,ai(u,_,d)}i(_4,"cloneWith"),o(_4,"cloneWith");function E4(u){return ai(u,v|_)}i(E4,"cloneDeep6"),o(E4,"cloneDeep");function A4(u,d){return d=typeof d=="function"?d:r,ai(u,v|_,d)}i(A4,"cloneDeepWith"),o(A4,"cloneDeepWith");function S4(u,d){return d==null||E1(u,d,Zr(d))}i(S4,"conformsTo"),o(S4,"conformsTo");function Bi(u,d){return u===d||u!==u&&d!==d}i(Bi,"eq4"),o(Bi,"eq");var mR=rf(mh),gR=rf(function(u,d){return u>=d}),Hs=C1(function(){return arguments}())?C1:function(u){return Rr(u)&&yr.call(u,"callee")&&!b3.call(u,"callee")},Nt=ke.isArray,vR=Ps?jn(Ps):c5;function kn(u){return u!=null&&df(u.length)&&!Ia(u)}i(kn,"isArrayLike2"),o(kn,"isArrayLike");function Pr(u){return Rr(u)&&kn(u)}i(Pr,"isArrayLikeObject"),o(Pr,"isArrayLikeObject");function x4(u){return u===!0||u===!1||Rr(u)&&yn(u)==ne}i(x4,"isBoolean"),o(x4,"isBoolean");var Vo=SD||Jh,yR=K2?jn(K2):u5;function T4(u){return Rr(u)&&u.nodeType===1&&!au(u)}i(T4,"isElement"),o(T4,"isElement");function C4(u){if(u==null)return!0;if(kn(u)&&(Nt(u)||typeof u=="string"||typeof u.splice=="function"||Vo(u)||ou(u)||Hs(u)))return!u.length;var d=bn(u);if(d==be||d==ee)return!u.size;if(iu(u))return!yh(u).length;for(var S in u)if(yr.call(u,S))return!1;return!0}i(C4,"isEmpty"),o(C4,"isEmpty");function M4(u,d){return tu(u,d)}i(M4,"isEqual"),o(M4,"isEqual");function I4(u,d,S){S=typeof S=="function"?S:r;var $=S?S(u,d):r;return $===r?tu(u,d,r,S):!!$}i(I4,"isEqualWith"),o(I4,"isEqualWith");function jh(u){if(!Rr(u))return!1;var d=yn(u);return d==G||d==M||typeof u.message=="string"&&typeof u.name=="string"&&!au(u)}i(jh,"isError"),o(jh,"isError");function k4(u){return typeof u=="number"&&_3(u)}i(k4,"isFinite2"),o(k4,"isFinite");function Ia(u){if(!kr(u))return!1;var d=yn(u);return d==ae||d==fe||d==L||d==W}i(Ia,"isFunction2"),o(Ia,"isFunction");function Og(u){return typeof u=="number"&&u==Pt(u)}i(Og,"isInteger3"),o(Og,"isInteger");function df(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=E}i(df,"isLength"),o(df,"isLength");function kr(u){var d=typeof u;return u!=null&&(d=="object"||d=="function")}i(kr,"isObject"),o(kr,"isObject");function Rr(u){return u!=null&&typeof u=="object"}i(Rr,"isObjectLike"),o(Rr,"isObjectLike");var D4=G2?jn(G2):f5;function R4(u,d){return u===d||vh(u,d,Oh(d))}i(R4,"isMatch"),o(R4,"isMatch");function O4(u,d,S){return S=typeof S=="function"?S:r,vh(u,d,Oh(d),S)}i(O4,"isMatchWith"),o(O4,"isMatchWith");function N4(u){return Ng(u)&&u!=+u}i(N4,"isNaN2"),o(N4,"isNaN");function P4(u){if(UD(u))throw new kt(s);return M1(u)}i(P4,"isNative"),o(P4,"isNative");function B4(u){return u===null}i(B4,"isNull"),o(B4,"isNull");function L4(u){return u==null}i(L4,"isNil"),o(L4,"isNil");function Ng(u){return typeof u=="number"||Rr(u)&&yn(u)==Re}i(Ng,"isNumber"),o(Ng,"isNumber");function au(u){if(!Rr(u)||yn(u)!=N)return!1;var d=ah(u);if(d===null)return!0;var S=yr.call(d,"constructor")&&d.constructor;return typeof S=="function"&&S instanceof S&&th.call(S)==yD}i(au,"isPlainObject"),o(au,"isPlainObject");var Pg=W2?jn(W2):d5;function U4(u){return Og(u)&&u>=-E&&u<=E}i(U4,"isSafeInteger"),o(U4,"isSafeInteger");var F4=J2?jn(J2):h5;function hf(u){return typeof u=="string"||!Nt(u)&&Rr(u)&&yn(u)==ue}i(hf,"isString"),o(hf,"isString");function zn(u){return typeof u=="symbol"||Rr(u)&&yn(u)==Ae}i(zn,"isSymbol"),o(zn,"isSymbol");var ou=Z2?jn(Z2):p5;function j4(u){return u===r}i(j4,"isUndefined"),o(j4,"isUndefined");function $4(u){return Rr(u)&&bn(u)==Ie}i($4,"isWeakMap"),o($4,"isWeakMap");function z4(u){return Rr(u)&&yn(u)==Be}i(z4,"isWeakSet"),o(z4,"isWeakSet");var bR=rf(bh),wR=rf(function(u,d){return u<=d});function Bg(u){if(!u)return[];if(kn(u))return hf(u)?Oi(u):In(u);if(jl&&u[jl])return u3(u[jl]());var d=bn(u),S=d==be?Xd:d==ee?Fl:qs;return S(u)}i(Bg,"toArray"),o(Bg,"toArray");function ka(u){if(!u)return u===0?u:0;if(u=ci(u),u===m||u===-m){var d=u<0?-1:1;return d*R}return u===u?u:0}i(ka,"toFinite"),o(ka,"toFinite");function Pt(u){var d=ka(u),S=d%1;return d===d?S?d-S:d:0}i(Pt,"toInteger"),o(Pt,"toInteger");function Lg(u){return u?jo(Pt(u),0,A):0}i(Lg,"toLength"),o(Lg,"toLength");function ci(u){if(typeof u=="number")return u;if(zn(u))return C;if(kr(u)){var d=typeof u.valueOf=="function"?u.valueOf():u;u=kr(d)?d+"":d}if(typeof u!="string")return u===0?u:+u;u=l1(u);var S=er.test(u);return S||nn.test(u)?sn(u.slice(2),S?2:8):hn.test(u)?C:+u}i(ci,"toNumber"),o(ci,"toNumber");function Ug(u){return Xi(u,Dn(u))}i(Ug,"toPlainObject"),o(Ug,"toPlainObject");function H4(u){return u?jo(Pt(u),-E,E):u===0?u:0}i(H4,"toSafeInteger"),o(H4,"toSafeInteger");function dr(u){return u==null?"":$n(u)}i(dr,"toString4"),o(dr,"toString");var _R=js(function(u,d){if(iu(d)||kn(d)){Xi(d,Zr(d),u);return}for(var S in d)yr.call(d,S)&&Xc(u,S,d[S])}),q4=js(function(u,d){Xi(d,Dn(d),u)}),$h=js(function(u,d,S,$){Xi(d,Dn(d),u,$)}),ER=js(function(u,d,S,$){Xi(d,Zr(d),u,$)}),AR=Ca(hh);function V4(u,d){var S=Yc(u);return d==null?S:_1(S,d)}i(V4,"create2"),o(V4,"create");var SR=Ut(function(u,d){u=_r(u);var S=-1,$=d.length,te=$>2?d[2]:r;for(te&&wn(d[0],d[1],te)&&($=1);++S<$;)for(var ce=d[S],ye=Dn(ce),Ee=-1,xe=ye.length;++Ee<xe;){var Ue=ye[Ee],Fe=u[Ue];(Fe===r||Bi(Fe,Wc[Ue])&&!yr.call(u,Ue))&&(u[Ue]=ce[Ue])}return u}),xR=Ut(function(u){return u.push(r,ng),Fn(n_,r,u)});function K4(u,d){return o1(u,wt(d,3),Yi)}i(K4,"findKey"),o(K4,"findKey");function G4(u,d){return o1(u,wt(d,3),ph)}i(G4,"findLastKey"),o(G4,"findLastKey");function W4(u,d){return u==null?u:x1(u,wt(d,3),Dn)}i(W4,"forIn"),o(W4,"forIn");function J4(u,d){return u==null?u:n5(u,wt(d,3),Dn)}i(J4,"forInRight"),o(J4,"forInRight");function Z4(u,d){return u&&Yi(u,wt(d,3))}i(Z4,"forOwn"),o(Z4,"forOwn");function Y4(u,d){return u&&ph(u,wt(d,3))}i(Y4,"forOwnRight"),o(Y4,"forOwnRight");function X4(u){return u==null?[]:Wl(u,Zr(u))}i(X4,"functions"),o(X4,"functions");function Q4(u){return u==null?[]:Wl(u,Dn(u))}i(Q4,"functionsIn"),o(Q4,"functionsIn");function zh(u,d,S){var $=u==null?r:zo(u,d);return $===r?S:$}i(zh,"get2"),o(zh,"get");function e_(u,d){return u!=null&&sg(u,d,i5)}i(e_,"has"),o(e_,"has");function Hh(u,d){return u!=null&&sg(u,d,a5)}i(Hh,"hasIn"),o(Hh,"hasIn");var TR=X1(function(u,d,S){d!=null&&typeof d.toString!="function"&&(d=rh.call(d)),u[d]=S},qh(Rn)),CR=X1(function(u,d,S){d!=null&&typeof d.toString!="function"&&(d=rh.call(d)),yr.call(u,d)?u[d].push(S):u[d]=[S]},wt),MR=Ut(eu);function Zr(u){return kn(u)?b1(u):yh(u)}i(Zr,"keys"),o(Zr,"keys");function Dn(u){return kn(u)?b1(u,!0):m5(u)}i(Dn,"keysIn"),o(Dn,"keysIn");function t_(u,d){var S={};return d=wt(d,3),Yi(u,function($,te,ce){xa(S,d($,te,ce),$)}),S}i(t_,"mapKeys"),o(t_,"mapKeys");function r_(u,d){var S={};return d=wt(d,3),Yi(u,function($,te,ce){xa(S,te,d($,te,ce))}),S}i(r_,"mapValues"),o(r_,"mapValues");var IR=js(function(u,d,S){Jl(u,d,S)}),n_=js(function(u,d,S,$){Jl(u,d,S,$)}),kR=Ca(function(u,d){var S={};if(u==null)return S;var $=!1;d=Mr(d,function(ce){return ce=co(ce,u),$||($=ce.length>1),ce}),Xi(u,Rh(u),S),$&&(S=ai(S,v|y|_,P5));for(var te=d.length;te--;)Sh(S,d[te]);return S});function i_(u,d){return Fg(u,ff(wt(d)))}i(i_,"omitBy"),o(i_,"omitBy");var DR=Ca(function(u,d){return u==null?{}:v5(u,d)});function Fg(u,d){if(u==null)return{};var S=Mr(Rh(u),function($){return[$]});return d=wt(d),P1(u,S,function($,te){return d($,te[0])})}i(Fg,"pickBy"),o(Fg,"pickBy");function a_(u,d,S){d=co(d,u);var $=-1,te=d.length;for(te||(te=1,u=r);++$<te;){var ce=u==null?r:u[Qi(d[$])];ce===r&&($=te,ce=S),u=Ia(ce)?ce.call(u):ce}return u}i(a_,"result"),o(a_,"result");function o_(u,d,S){return u==null?u:ru(u,d,S)}i(o_,"set"),o(o_,"set");function s_(u,d,S,$){return $=typeof $=="function"?$:r,u==null?u:ru(u,d,S,$)}i(s_,"setWith"),o(s_,"setWith");var c_=tg(Zr),u_=tg(Dn);function l_(u,d,S){var $=Nt(u),te=$||Vo(u)||ou(u);if(d=wt(d,4),S==null){var ce=u&&u.constructor;te?S=$?new ce:[]:kr(u)?S=Ia(ce)?Yc(ah(u)):{}:S={}}return(te?ni:Yi)(u,function(ye,Ee,xe){return d(S,ye,Ee,xe)}),S}i(l_,"transform"),o(l_,"transform");function f_(u,d){return u==null?!0:Sh(u,d)}i(f_,"unset"),o(f_,"unset");function d_(u,d,S){return u==null?u:F1(u,d,Ch(S))}i(d_,"update2"),o(d_,"update");function h_(u,d,S,$){return $=typeof $=="function"?$:r,u==null?u:F1(u,d,Ch(S),$)}i(h_,"updateWith"),o(h_,"updateWith");function qs(u){return u==null?[]:Yd(u,Zr(u))}i(qs,"values"),o(qs,"values");function p_(u){return u==null?[]:Yd(u,Dn(u))}i(p_,"valuesIn"),o(p_,"valuesIn");function m_(u,d,S){return S===r&&(S=d,d=r),S!==r&&(S=ci(S),S=S===S?S:0),d!==r&&(d=ci(d),d=d===d?d:0),jo(ci(u),d,S)}i(m_,"clamp"),o(m_,"clamp");function g_(u,d,S){return d=ka(d),S===r?(S=d,d=0):S=ka(S),u=ci(u),o5(u,d,S)}i(g_,"inRange"),o(g_,"inRange");function v_(u,d,S){if(S&&typeof S!="boolean"&&wn(u,d,S)&&(d=S=r),S===r&&(typeof d=="boolean"?(S=d,d=r):typeof u=="boolean"&&(S=u,u=r)),u===r&&d===r?(u=0,d=1):(u=ka(u),d===r?(d=u,u=0):d=ka(d)),u>d){var $=u;u=d,d=$}if(S||u%1||d%1){var te=E3();return vn(u+te*(d-u+Kr("1e-"+((te+"").length-1))),d)}return _h(u,d)}i(v_,"random"),o(v_,"random");var RR=$s(function(u,d,S){return d=d.toLowerCase(),u+(S?jg(d):d)});function jg(u){return zg(dr(u).toLowerCase())}i(jg,"capitalize"),o(jg,"capitalize");function $g(u){return u=dr(u),u&&u.replace(Nr,fD).replace($d,"")}i($g,"deburr"),o($g,"deburr");function y_(u,d,S){u=dr(u),d=$n(d);var $=u.length;S=S===r?$:jo(Pt(S),0,$);var te=S;return S-=d.length,S>=0&&u.slice(S,te)==d}i(y_,"endsWith"),o(y_,"endsWith");function b_(u){return u=dr(u),u&&ut.test(u)?u.replace(Or,dD):u}i(b_,"escape"),o(b_,"escape");function w_(u){return u=dr(u),u&&at.test(u)?u.replace(Qt,"\\$&"):u}i(w_,"escapeRegExp"),o(w_,"escapeRegExp");var OR=$s(function(u,d,S){return u+(S?"-":"")+d.toLowerCase()}),NR=$s(function(u,d,S){return u+(S?" ":"")+d.toLowerCase()}),PR=J1("toLowerCase");function __(u,d,S){u=dr(u),d=Pt(d);var $=d?Us(u):0;if(!d||$>=d)return u;var te=(d-$)/2;return tf(uh(te),S)+u+tf(ch(te),S)}i(__,"pad2"),o(__,"pad");function E_(u,d,S){u=dr(u),d=Pt(d);var $=d?Us(u):0;return d&&$<d?u+tf(d-$,S):u}i(E_,"padEnd"),o(E_,"padEnd");function A_(u,d,S){u=dr(u),d=Pt(d);var $=d?Us(u):0;return d&&$<d?tf(d-$,S)+u:u}i(A_,"padStart"),o(A_,"padStart");function S_(u,d,S){return S||d==null?d=0:d&&(d=+d),MD(dr(u).replace(et,""),d||0)}i(S_,"parseInt2"),o(S_,"parseInt");function x_(u,d,S){return(S?wn(u,d,S):d===r)?d=1:d=Pt(d),Eh(dr(u),d)}i(x_,"repeat"),o(x_,"repeat");function T_(){var u=arguments,d=dr(u[0]);return u.length<3?d:d.replace(u[1],u[2])}i(T_,"replace"),o(T_,"replace");var BR=$s(function(u,d,S){return u+(S?"_":"")+d.toLowerCase()});function C_(u,d,S){return S&&typeof S!="number"&&wn(u,d,S)&&(d=S=r),S=S===r?A:S>>>0,S?(u=dr(u),u&&(typeof d=="string"||d!=null&&!Pg(d))&&(d=$n(d),!d&&Ls(u))?uo(Oi(u),0,S):u.split(d,S)):[]}i(C_,"split"),o(C_,"split");var LR=$s(function(u,d,S){return u+(S?" ":"")+zg(d)});function M_(u,d,S){return u=dr(u),S=S==null?0:jo(Pt(S),0,u.length),d=$n(d),u.slice(S,S+d.length)==d}i(M_,"startsWith"),o(M_,"startsWith");function I_(u,d,S){var $=se.templateSettings;S&&wn(u,d,S)&&(d=r),u=dr(u),d=$h({},d,$,rg);var te=$h({},d.imports,$.imports,rg),ce=Zr(te),ye=Yd(te,ce),Ee,xe,Ue=0,Fe=d.interpolate||Vr,$e="__p += '",Ye=m1((d.escape||Vr).source+"|"+Fe.source+"|"+(Fe===nt?At:Vr).source+"|"+(d.evaluate||Vr).source+"|$","g"),pt="//# sourceURL="+(yr.call(d,"sourceURL")?(d.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Vc+"]")+`
27
27
  `;u.replace(Ye,function(_t,Ht,Gt,Hn,_n,qn){return Gt||(Gt=Hn),$e+=u.slice(Ue,qn).replace(on,o3),Ht&&(Ee=!0,$e+=`' +
28
28
  __e(`+Ht+`) +
29
29
  '`),_n&&(xe=!0,$e+=`';
@@ -40,7 +40,7 @@ __p += '`),Gt&&($e+=`' +
40
40
  function print() { __p += __j.call(arguments, '') }
41
41
  `:`;
42
42
  `)+$e+`return __p
43
- }`;var Lt=L_(function(){return fr(ce,pt+"return "+$e).apply(r,ye)});if(Lt.source=$e,jh(Lt))throw Lt;return Lt}i(I_,"template"),o(I_,"template");function k_(u){return dr(u).toLowerCase()}i(k_,"toLower"),o(k_,"toLower");function D_(u){return dr(u).toUpperCase()}i(D_,"toUpper"),o(D_,"toUpper");function R_(u,d,S){if(u=dr(u),u&&(S||d===r))return l1(u);if(!u||!(d=$n(d)))return u;var $=Oi(u),te=Oi(d),ce=f1($,te),ye=d1($,te)+1;return uo($,ce,ye).join("")}i(R_,"trim"),o(R_,"trim");function O_(u,d,S){if(u=dr(u),u&&(S||d===r))return u.slice(0,p1(u)+1);if(!u||!(d=$n(d)))return u;var $=Oi(u),te=d1($,Oi(d))+1;return uo($,0,te).join("")}i(O_,"trimEnd"),o(O_,"trimEnd");function N_(u,d,S){if(u=dr(u),u&&(S||d===r))return u.replace(et,"");if(!u||!(d=$n(d)))return u;var $=Oi(u),te=f1($,Oi(d));return uo($,te).join("")}i(N_,"trimStart"),o(N_,"trimStart");function P_(u,d){var S=me,$=we;if(kr(d)){var te="separator"in d?d.separator:te;S="length"in d?Pt(d.length):S,$="omission"in d?$n(d.omission):$}u=dr(u);var ce=u.length;if(Ps(u)){var ye=Oi(u);ce=ye.length}if(S>=ce)return u;var Ee=S-Bs($);if(Ee<1)return $;var xe=ye?uo(ye,0,Ee).join(""):u.slice(0,Ee);if(te===r)return xe+$;if(ye&&(Ee+=xe.length-Ee),Pg(te)){if(u.slice(Ee).search(te)){var Ue,Fe=xe;for(te.global||(te=m1(te.source,dr(yt.exec(te))+"g")),te.lastIndex=0;Ue=te.exec(Fe);)var $e=Ue.index;xe=xe.slice(0,$e===r?Ee:$e)}}else if(u.indexOf($n(te),Ee)!=Ee){var Ye=xe.lastIndexOf(te);Ye>-1&&(xe=xe.slice(0,Ye))}return xe+$}i(P_,"truncate"),o(P_,"truncate");function B_(u){return u=dr(u),u&&ct.test(u)?u.replace(mt,hD):u}i(B_,"unescape"),o(B_,"unescape");var UR=Fs(function(u,d,S){return u+(S?" ":"")+d.toUpperCase()}),zg=J1("toUpperCase");function Hg(u,d,S){return u=dr(u),d=S?r:d,d===r?c3(u)?m3(u):t3(u):u.match(d)||[]}i(Hg,"words"),o(Hg,"words");var L_=Ut(function(u,d){try{return Fn(u,r,d)}catch(S){return jh(S)?S:new kt(S)}}),FR=Ca(function(u,d){return ni(d,function(S){S=Qi(S),xa(u,S,Mg(u[S],u))}),u});function U_(u){var d=u==null?0:u.length,S=wt();return u=d?Mr(u,function($){if(typeof $[1]!="function")throw new Ni(c);return[S($[0]),$[1]]}):[],Ut(function($){for(var te=-1;++te<d;){var ce=u[te];if(Fn(ce[0],this,$))return Fn(ce[1],this,$)}})}i(U_,"cond"),o(U_,"cond");function F_(u){return Q3(ai(u,v))}i(F_,"conforms"),o(F_,"conforms");function qh(u){return function(){return u}}i(qh,"constant"),o(qh,"constant");function j_(u,d){return u==null||u!==u?d:u}i(j_,"defaultTo"),o(j_,"defaultTo");var jR=Y1(),$R=Y1(!0);function Rn(u){return u}i(Rn,"identity4"),o(Rn,"identity");function Vh(u){return I1(typeof u=="function"?u:ai(u,v))}i(Vh,"iteratee"),o(Vh,"iteratee");function $_(u){return D1(ai(u,v))}i($_,"matches"),o($_,"matches");function z_(u,d){return R1(u,ai(d,v))}i(z_,"matchesProperty"),o(z_,"matchesProperty");var zR=Ut(function(u,d){return function(S){return eu(S,u,d)}}),HR=Ut(function(u,d){return function(S){return eu(u,S,d)}});function Kh(u,d,S){var $=Zr(d),te=Wl(d,$);S==null&&!(kr(d)&&(te.length||!$.length))&&(S=d,d=u,u=this,te=Wl(d,Zr(d)));var ce=!(kr(S)&&"chain"in S)||!!S.chain,ye=Ia(u);return ni(te,function(Ee){var xe=d[Ee];u[Ee]=xe,ye&&(u.prototype[Ee]=function(){var Ue=this.__chain__;if(ce||Ue){var Fe=u(this.__wrapped__),$e=Fe.__actions__=In(this.__actions__);return $e.push({func:xe,args:arguments,thisArg:u}),Fe.__chain__=Ue,Fe}return xe.apply(u,ao([this.value()],arguments))})}),u}i(Kh,"mixin"),o(Kh,"mixin");function H_(){return Fr._===this&&(Fr._=bD),this}i(H_,"noConflict"),o(H_,"noConflict");function Gh(){}i(Gh,"noop2"),o(Gh,"noop");function q_(u){return u=Pt(u),Ut(function(d){return O1(d,u)})}i(q_,"nthArg"),o(q_,"nthArg");var qR=Ih(Mr),VR=Ih(a1),KR=Ih(Kd);function qg(u){return Nh(u)?Gd(Qi(u)):y5(u)}i(qg,"property"),o(qg,"property");function V_(u){return function(d){return u==null?r:zo(u,d)}}i(V_,"propertyOf"),o(V_,"propertyOf");var GR=Q1(),WR=Q1(!0);function Wh(){return[]}i(Wh,"stubArray"),o(Wh,"stubArray");function Jh(){return!1}i(Jh,"stubFalse"),o(Jh,"stubFalse");function K_(){return{}}i(K_,"stubObject"),o(K_,"stubObject");function G_(){return""}i(G_,"stubString"),o(G_,"stubString");function W_(){return!0}i(W_,"stubTrue"),o(W_,"stubTrue");function J_(u,d){if(u=Pt(u),u<1||u>E)return[];var S=A,$=vn(u,A);d=wt(d),u-=A;for(var te=Zd($,d);++S<u;)d(S);return te}i(J_,"times"),o(J_,"times");function Z_(u){return Nt(u)?Mr(u,Qi):zn(u)?[u]:In(ew(dr(u)))}i(Z_,"toPath"),o(Z_,"toPath");function Y_(u){var d=++vD;return dr(u)+d}i(Y_,"uniqueId"),o(Y_,"uniqueId");var JR=ef(function(u,d){return u+d},0),ZR=kh("ceil"),YR=ef(function(u,d){return u/d},1),XR=kh("floor");function X_(u){return u&&u.length?Gl(u,Rn,mh):r}i(X_,"max"),o(X_,"max");function Q_(u,d){return u&&u.length?Gl(u,wt(d,2),mh):r}i(Q_,"maxBy"),o(Q_,"maxBy");function e8(u){return c1(u,Rn)}i(e8,"mean"),o(e8,"mean");function t8(u,d){return c1(u,wt(d,2))}i(t8,"meanBy"),o(t8,"meanBy");function r8(u){return u&&u.length?Gl(u,Rn,bh):r}i(r8,"min"),o(r8,"min");function n8(u,d){return u&&u.length?Gl(u,wt(d,2),bh):r}i(n8,"minBy"),o(n8,"minBy");var QR=ef(function(u,d){return u*d},1),eO=kh("round"),tO=ef(function(u,d){return u-d},0);function i8(u){return u&&u.length?Jd(u,Rn):0}i(i8,"sum"),o(i8,"sum");function a8(u,d){return u&&u.length?Jd(u,wt(d,2)):0}return i(a8,"sumBy"),o(a8,"sumBy"),se.after=u4,se.ary=Tg,se.assign=_R,se.assignIn=q4,se.assignInWith=$h,se.assignWith=ER,se.at=AR,se.before=Cg,se.bind=Mg,se.bindAll=FR,se.bindKey=l4,se.castArray=b4,se.chain=Ag,se.chunk=rw,se.compact=nw,se.concat=iw,se.cond=U_,se.conforms=F_,se.constant=qh,se.countBy=nR,se.create=V4,se.curry=Ig,se.curryRight=kg,se.debounce=Dg,se.defaults=SR,se.defaultsDeep=xR,se.defer=fR,se.delay=dR,se.difference=FD,se.differenceBy=jD,se.differenceWith=$D,se.drop=aw,se.dropRight=ow,se.dropRightWhile=sw,se.dropWhile=cw,se.fill=uw,se.filter=Jw,se.flatMap=Zw,se.flatMapDeep=Yw,se.flatMapDepth=Xw,se.flatten=bg,se.flattenDeep=lw,se.flattenDepth=fw,se.flip=f4,se.flow=jR,se.flowRight=$R,se.fromPairs=dw,se.functions=X4,se.functionsIn=Q4,se.groupBy=oR,se.initial=pw,se.intersection=zD,se.intersectionBy=HD,se.intersectionWith=qD,se.invert=TR,se.invertBy=CR,se.invokeMap=sR,se.iteratee=Vh,se.keyBy=cR,se.keys=Zr,se.keysIn=Dn,se.map=uf,se.mapKeys=t_,se.mapValues=r_,se.matches=$_,se.matchesProperty=z_,se.memoize=lf,se.merge=IR,se.mergeWith=n_,se.method=zR,se.methodOf=HR,se.mixin=Kh,se.negate=ff,se.nthArg=q_,se.omit=kR,se.omitBy=i_,se.once=d4,se.orderBy=e4,se.over=qR,se.overArgs=hR,se.overEvery=VR,se.overSome=KR,se.partial=Rg,se.partialRight=h4,se.partition=uR,se.pick=DR,se.pickBy=Fg,se.property=qg,se.propertyOf=V_,se.pull=VD,se.pullAll=_g,se.pullAllBy=yw,se.pullAllWith=bw,se.pullAt=KD,se.range=GR,se.rangeRight=WR,se.rearg=pR,se.reject=n4,se.remove=ww,se.rest=p4,se.reverse=Lh,se.sampleSize=a4,se.set=o_,se.setWith=s_,se.shuffle=o4,se.slice=_w,se.sortBy=lR,se.sortedUniq=Mw,se.sortedUniqBy=Iw,se.split=C_,se.spread=m4,se.tail=kw,se.take=Dw,se.takeRight=Rw,se.takeRightWhile=Ow,se.takeWhile=Nw,se.tap=jw,se.throttle=g4,se.thru=cf,se.toArray=Bg,se.toPairs=c_,se.toPairsIn=u_,se.toPath=Z_,se.toPlainObject=Ug,se.transform=l_,se.unary=v4,se.union=GD,se.unionBy=WD,se.unionWith=JD,se.uniq=Pw,se.uniqBy=Bw,se.uniqWith=Lw,se.unset=f_,se.unzip=Uh,se.unzipWith=Eg,se.update=d_,se.updateWith=h_,se.values=zs,se.valuesIn=p_,se.without=ZD,se.words=Hg,se.wrap=y4,se.xor=YD,se.xorBy=XD,se.xorWith=QD,se.zip=eR,se.zipObject=Uw,se.zipObjectDeep=Fw,se.zipWith=tR,se.entries=c_,se.entriesIn=u_,se.extend=q4,se.extendWith=$h,Kh(se,se),se.add=JR,se.attempt=L_,se.camelCase=RR,se.capitalize=jg,se.ceil=ZR,se.clamp=m_,se.clone=w4,se.cloneDeep=E4,se.cloneDeepWith=A4,se.cloneWith=_4,se.conformsTo=S4,se.deburr=$g,se.defaultTo=j_,se.divide=YR,se.endsWith=y_,se.eq=Bi,se.escape=b_,se.escapeRegExp=w_,se.every=Ww,se.find=iR,se.findIndex=vg,se.findKey=K4,se.findLast=aR,se.findLastIndex=yg,se.findLastKey=G4,se.floor=XR,se.forEach=Sg,se.forEachRight=xg,se.forIn=W4,se.forInRight=J4,se.forOwn=Z4,se.forOwnRight=Y4,se.get=zh,se.gt=mR,se.gte=gR,se.has=e_,se.hasIn=Hh,se.head=wg,se.identity=Rn,se.includes=Qw,se.indexOf=hw,se.inRange=g_,se.invoke=MR,se.isArguments=$s,se.isArray=Nt,se.isArrayBuffer=vR,se.isArrayLike=kn,se.isArrayLikeObject=Pr,se.isBoolean=x4,se.isBuffer=Vo,se.isDate=yR,se.isElement=T4,se.isEmpty=C4,se.isEqual=M4,se.isEqualWith=I4,se.isError=jh,se.isFinite=k4,se.isFunction=Ia,se.isInteger=Og,se.isLength=df,se.isMap=D4,se.isMatch=R4,se.isMatchWith=O4,se.isNaN=N4,se.isNative=P4,se.isNil=L4,se.isNull=B4,se.isNumber=Ng,se.isObject=kr,se.isObjectLike=Rr,se.isPlainObject=au,se.isRegExp=Pg,se.isSafeInteger=U4,se.isSet=F4,se.isString=hf,se.isSymbol=zn,se.isTypedArray=ou,se.isUndefined=j4,se.isWeakMap=$4,se.isWeakSet=z4,se.join=mw,se.kebabCase=OR,se.last=si,se.lastIndexOf=gw,se.lowerCase=NR,se.lowerFirst=PR,se.lt=bR,se.lte=wR,se.max=X_,se.maxBy=Q_,se.mean=e8,se.meanBy=t8,se.min=r8,se.minBy=n8,se.stubArray=Wh,se.stubFalse=Jh,se.stubObject=K_,se.stubString=G_,se.stubTrue=W_,se.multiply=QR,se.nth=vw,se.noConflict=H_,se.noop=Gh,se.now=Fh,se.pad=__,se.padEnd=E_,se.padStart=A_,se.parseInt=S_,se.random=v_,se.reduce=t4,se.reduceRight=r4,se.repeat=x_,se.replace=T_,se.result=a_,se.round=eO,se.runInContext=Se,se.sample=i4,se.size=s4,se.snakeCase=BR,se.some=c4,se.sortedIndex=Ew,se.sortedIndexBy=Aw,se.sortedIndexOf=Sw,se.sortedLastIndex=xw,se.sortedLastIndexBy=Tw,se.sortedLastIndexOf=Cw,se.startCase=LR,se.startsWith=M_,se.subtract=tO,se.sum=i8,se.sumBy=a8,se.template=I_,se.times=J_,se.toFinite=ka,se.toInteger=Pt,se.toLength=Lg,se.toLower=k_,se.toNumber=ci,se.toSafeInteger=H4,se.toString=dr,se.toUpper=D_,se.trim=R_,se.trimEnd=O_,se.trimStart=N_,se.truncate=P_,se.unescape=B_,se.uniqueId=Y_,se.upperCase=UR,se.upperFirst=zg,se.each=Sg,se.eachRight=xg,se.first=wg,Kh(se,function(){var u={};return Yi(se,function(d,S){yr.call(se.prototype,S)||(u[S]=d)}),u}(),{chain:!1}),se.VERSION=n,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){se[u].placeholder=se}),ni(["drop","take"],function(u,d){Kt.prototype[u]=function(S){S=S===r?1:Jr(Pt(S),0);var $=this.__filtered__&&!d?new Kt(this):this.clone();return $.__filtered__?$.__takeCount__=vn(S,$.__takeCount__):$.__views__.push({size:vn(S,A),type:u+($.__dir__<0?"Right":"")}),$},Kt.prototype[u+"Right"]=function(S){return this.reverse()[u](S).reverse()}}),ni(["filter","map","takeWhile"],function(u,d){var S=d+1,$=S==T||S==f;Kt.prototype[u]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:wt(te,3),type:S}),ce.__filtered__=ce.__filtered__||$,ce}}),ni(["head","last"],function(u,d){var S="take"+(d?"Right":"");Kt.prototype[u]=function(){return this[S](1).value()[0]}}),ni(["initial","tail"],function(u,d){var S="drop"+(d?"":"Right");Kt.prototype[u]=function(){return this.__filtered__?new Kt(this):this[S](1)}}),Kt.prototype.compact=function(){return this.filter(Rn)},Kt.prototype.find=function(u){return this.filter(u).head()},Kt.prototype.findLast=function(u){return this.reverse().find(u)},Kt.prototype.invokeMap=Ut(function(u,d){return typeof u=="function"?new Kt(this):this.map(function(S){return eu(S,u,d)})}),Kt.prototype.reject=function(u){return this.filter(ff(wt(u)))},Kt.prototype.slice=function(u,d){u=Pt(u);var S=this;return S.__filtered__&&(u>0||d<0)?new Kt(S):(u<0?S=S.takeRight(-u):u&&(S=S.drop(u)),d!==r&&(d=Pt(d),S=d<0?S.dropRight(-d):S.take(d-u)),S)},Kt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Kt.prototype.toArray=function(){return this.take(A)},Yi(Kt.prototype,function(u,d){var S=/^(?:filter|find|map|reject)|While$/.test(d),$=/^(?:head|last)$/.test(d),te=se[$?"take"+(d=="last"?"Right":""):d],ce=$||/^find/.test(d);!te||(se.prototype[d]=function(){var ye=this.__wrapped__,Ee=$?[1]:arguments,xe=ye instanceof Kt,Ue=Ee[0],Fe=xe||Nt(ye),$e=o(function(Ht){var Gt=te.apply(se,ao([Ht],Ee));return $&&Ye?Gt[0]:Gt},"interceptor");Fe&&S&&typeof Ue=="function"&&Ue.length!=1&&(xe=Fe=!1);var Ye=this.__chain__,pt=!!this.__actions__.length,St=ce&&!Ye,Lt=xe&&!pt;if(!ce&&Fe){ye=Lt?ye:new Kt(this);var _t=u.apply(ye,Ee);return _t.__actions__.push({func:cf,args:[$e],thisArg:r}),new ii(_t,Ye)}return St&&Lt?u.apply(this,Ee):(_t=this.thru($e),St?$?_t.value()[0]:_t.value():_t)})}),ni(["pop","push","shift","sort","splice","unshift"],function(u){var d=Qd[u],S=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",$=/^(?:pop|shift)$/.test(u);se.prototype[u]=function(){var te=arguments;if($&&!this.__chain__){var ce=this.value();return d.apply(Nt(ce)?ce:[],te)}return this[S](function(ye){return d.apply(Nt(ye)?ye:[],te)})}}),Yi(Kt.prototype,function(u,d){var S=se[d];if(S){var $=S.name+"";yr.call(Zc,$)||(Zc[$]=[]),Zc[$].push({name:d,func:S})}}),Zc[Ql(r,P).name]=[{name:"wrapper",func:r}],Kt.prototype.clone=S3,Kt.prototype.reverse=x3,Kt.prototype.value=T3,se.prototype.at=rR,se.prototype.chain=$w,se.prototype.commit=zw,se.prototype.next=Hw,se.prototype.plant=Vw,se.prototype.reverse=Kw,se.prototype.toJSON=se.prototype.valueOf=se.prototype.value=Gw,se.prototype.first=se.prototype.head,jl&&(se.prototype[jl]=qw),se},"runInContext2"),"runInContext"),Bo=pD();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fr._=Bo,define(function(){return Bo})):Ea?((Ea.exports=Bo)._=Bo,_a._=Bo):Fr._=Bo}).call(e)}});function vm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(vm,"asUint8Array");var ym=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/as-uint8array.js"(){o(vm,"asUint8Array")}});function d6(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(d6,"allocUnsafe");var h6=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/alloc.js"(){ym(),o(d6,"allocUnsafe")}}),IS={};xr(IS,{concat:()=>gs});function gs(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=d6(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return vm(r)}i(gs,"concat");var kS=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/concat.js"(){h6(),ym(),o(gs,"concat")}});function oA(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 a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var O=0,D=0,P=0,J=x.length;P!==J&&x[P]===0;)P++,O++;for(var j=(J-P)*g+1>>>0,q=new Uint8Array(j);P!==J;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=h.repeat(O);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode9"),o(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var O=0;if(x[O]!==" "){for(var D=0,P=0;x[O]===h;)D++,O++;for(var J=(x.length-O)*p+1>>>0,j=new Uint8Array(J);x[O];){var q=r[x.charCodeAt(O)];if(q===255)return;for(var Q=0,Y=J-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,O++}if(x[O]!==" "){for(var k=J-P;k!==J&&j[k]===0;)k++;for(var K=new Uint8Array(D+(J-k)),he=D;k!==J;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe"),o(y,"decodeUnsafe");function _(x){var O=y(x);if(O)return O;throw new Error(`Non-${t} character`)}return i(_,"decode9"),o(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(oA,"base");var sA,cA,DS,mj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/base-x.js"(){o(oA,"base"),sA=oA,cA=sA,DS=cA}}),gj,RS,wd,OS,NS,Pc=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bytes.js"(){gj=new Uint8Array(0),RS=o((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"),wd=o(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"),OS=o(e=>new TextEncoder().encode(e),"fromString"),NS=o(e=>new TextDecoder().decode(e),"toString")}}),jy,$y,zy,Hy,qy,Jf,$u,uA,lA,tn,Ka=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base.js"(){mj(),Pc(),jy=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"),o(jy,"Encoder"),$y=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 Hy(this,e)}},"Decoder"),o($y,"Decoder"),zy=i(class{constructor(e){this.decoders=e}or(e){return Hy(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"),o(zy,"ComposedDecoder"),Hy=o((e,t)=>new zy({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),qy=i(class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new jy(e,t,r),this.decoder=new $y(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),o(qy,"Codec"),Jf=o(({name:e,prefix:t,encode:r,decode:n})=>new qy(e,t,r,n),"from"),$u=o(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=DS(r,t);return Jf({prefix:e,name:t,encode:n,decode:s=>wd(a(s))})},"baseX"),uA=o((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,h=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|v,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"),lA=o((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),tn=o(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Jf({prefix:t,name:e,encode(a){return lA(a,n,r)},decode(a){return uA(a,n,r,e)}}),"rfc4648")}}),PS={};xr(PS,{identity:()=>BS});var BS,vj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/identity.js"(){Ka(),Pc(),BS=Jf({prefix:"\0",name:"identity",encode:e=>NS(e),decode:e=>OS(e)})}}),LS={};xr(LS,{base2:()=>US});var US,yj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base2.js"(){Ka(),US=tn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),FS={};xr(FS,{base8:()=>jS});var jS,bj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base8.js"(){Ka(),jS=tn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),$S={};xr($S,{base10:()=>zS});var zS,wj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base10.js"(){Ka(),zS=$u({prefix:"9",name:"base10",alphabet:"0123456789"})}}),HS={};xr(HS,{base16:()=>qS,base16upper:()=>VS});var qS,VS,_j=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base16.js"(){Ka(),qS=tn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),VS=tn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),KS={};xr(KS,{base32:()=>Lu,base32hex:()=>ZS,base32hexpad:()=>XS,base32hexpadupper:()=>QS,base32hexupper:()=>YS,base32pad:()=>WS,base32padupper:()=>JS,base32upper:()=>GS,base32z:()=>ex});var Lu,GS,WS,JS,ZS,YS,XS,QS,ex,tx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base32.js"(){Ka(),Lu=tn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),GS=tn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),WS=tn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),JS=tn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ZS=tn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),YS=tn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),XS=tn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QS=tn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ex=tn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),rx={};xr(rx,{base36:()=>Ss,base36upper:()=>nx});var Ss,nx,_d=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base36.js"(){Ka(),Ss=$u({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nx=$u({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),ix={};xr(ix,{base58btc:()=>ua,base58flickr:()=>ax});var ua,ax,p6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base58.js"(){Ka(),ua=$u({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ax=$u({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),ox={};xr(ox,{base64:()=>sx,base64pad:()=>cx,base64url:()=>zu,base64urlpad:()=>ux});var sx,cx,zu,ux,m6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base64.js"(){Ka(),sx=tn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cx=tn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),zu=tn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ux=tn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}}),lx={};xr(lx,{base256emoji:()=>hx});function fA(e){return e.reduce((t,r)=>(t+=fx[r],t),"")}i(fA,"encode2");function dA(e){let t=[];for(let r of e){let n=dx[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(dA,"decode2");var Vy,fx,dx,hx,Ej=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base256emoji.js"(){Ka(),Vy=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}"),fx=Vy.reduce((e,t,r)=>(e[r]=t,e),[]),dx=Vy.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),o(fA,"encode"),o(dA,"decode"),hx=Jf({prefix:"\u{1F680}",name:"base256emoji",encode:fA,decode:dA})}});function hb(e,t,r){t=t||[],r=r||0;for(var n=r;e>=mx;)t[r++]=e&255|pb,e/=128;for(;e&px;)t[r++]=e&255|pb,e>>>=7;return t[r]=e|0,hb.bytes=r-n+1,t}i(hb,"encode3");function j0(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw j0.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&mb)<<a:(c&mb)*Math.pow(2,a),a+=7}while(c>=gx);return j0.bytes=s-n,r}i(j0,"read");var hA,pb,pA,px,mx,mA,gx,mb,gA,vA,yA,bA,wA,_A,EA,AA,SA,xA,TA,CA,Vf,Aj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/varint.js"(){hA=hb,pb=128,pA=127,px=~pA,mx=Math.pow(2,31),o(hb,"encode"),mA=j0,gx=128,mb=127,o(j0,"read"),gA=Math.pow(2,7),vA=Math.pow(2,14),yA=Math.pow(2,21),bA=Math.pow(2,28),wA=Math.pow(2,35),_A=Math.pow(2,42),EA=Math.pow(2,49),AA=Math.pow(2,56),SA=Math.pow(2,63),xA=o(function(e){return e<gA?1:e<vA?2:e<yA?3:e<bA?4:e<wA?5:e<_A?6:e<EA?7:e<AA?8:e<SA?9:10},"length"),TA={encode:hA,decode:mA,encodingLength:xA},CA=TA,Vf=CA}}),$0,Xf,Qf,g6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/varint.js"(){Aj(),$0=o((e,t=0)=>[Vf.decode(e,t),Vf.decode.bytes],"decode"),Xf=o((e,t,r=0)=>(Vf.encode(e,t,r),t),"encodeTo"),Qf=o(e=>Vf.encodingLength(e),"encodingLength")}}),Hu,v6,vx,Kf,al=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/digest.js"(){Pc(),g6(),Hu=o((e,t)=>{let r=t.byteLength,n=Qf(e),a=n+Qf(r),s=new Uint8Array(a+r);return Xf(e,s,0),Xf(r,s,n),s.set(t,a),new Kf(e,r,t,s)},"create"),v6=o(e=>{let t=wd(e),[r,n]=$0(t),[a,s]=$0(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new Kf(r,a,c,t)},"decode"),vx=o((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&RS(e.bytes,t.bytes),"equals"),Kf=i(class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest"),o(Kf,"Digest")}}),gb,Ky,yx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/hasher.js"(){al(),gb=o(({name:e,code:t,encode:r})=>new Ky(e,t,r),"from"),Ky=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?Hu(this.code,t):t.then(r=>Hu(this.code,r))}else throw Error("Unknown type, must be binary type")}},"Hasher"),o(Ky,"Hasher")}}),bx={};xr(bx,{sha256:()=>ol,sha512:()=>wx});var Gy,ol,wx,bm=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){yx(),Gy=o(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),ol=gb({name:"sha2-256",code:18,encode:Gy("SHA-256")}),wx=gb({name:"sha2-512",code:19,encode:Gy("SHA-512")})}}),_x={};xr(_x,{identity:()=>wm});var Wy,MA,Jy,IA,wm,Ex=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/identity.js"(){Pc(),al(),Wy=0,MA="identity",Jy=wd,IA=o(e=>Hu(Wy,Jy(e)),"digest"),wm={code:Wy,name:MA,encode:Jy,digest:IA}}}),Sj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/raw.js"(){Pc()}}),xj,Tj,Cj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/json.js"(){xj=new TextEncoder,Tj=new TextDecoder}}),$t,kA,DA,RA,Nu,OA,Zy,Yy,$f,zf,NA,PA,BA,Ga=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/cid.js"(){g6(),al(),p6(),tx(),Pc(),$t=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:zf,byteLength:zf,code:$f,version:$f,multihash:$f,bytes:$f,_baseCache:zf,asCID:zf})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Nu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==OA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return $t.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=Hu(e,t);return $t.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&&vx(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return DA(t,n,e||ua.encoder);default:return RA(t,n,e||Lu.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 PA(/^0\.0/,BA),!!(e&&(e[Yy]||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 $t)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:a}=e;return new $t(t,r,n,a||Zy(t,r,n.bytes))}else if(e!=null&&e[Yy]===!0){let{version:t,multihash:r,code:n}=e,a=v6(r);return $t.create(t,n,a)}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!==Nu)throw new Error(`Version 0 CID must use dag-pb (code: ${Nu}) block encoding`);return new $t(e,t,r,r.bytes)}case 1:{let n=Zy(e,t,r.bytes);return new $t(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return $t.create(0,Nu,e)}static createV1(e,t){return $t.create(1,e,t)}static decode(e){let[t,r]=$t.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=$t.inspectBytes(e),r=t.size-t.multihashSize,n=wd(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let a=n.subarray(t.multihashSize-t.digestSize),s=new Kf(t.multihashCode,t.digestSize,a,n);return[t.version===0?$t.createV0(s):$t.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=o(()=>{let[g,v]=$0(e.subarray(t));return t+=v,g},"next"),n=r(),a=Nu;if(n===18?(n=0,t=0):n===1&&(a=r()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,c=r(),l=r(),h=t+l,p=h-s;return{version:n,codec:a,multihashCode:c,digestSize:l,multihashSize:p,size:h}}static parse(e,t){let[r,n]=kA(e,t),a=$t.decode(n);return a._baseCache.set(r,e),a}},"CID"),o($t,"CID"),kA=o((e,t)=>{switch(e[0]){case"Q":{let r=t||ua;return[ua.prefix,r.decode(`${ua.prefix}${e}`)]}case ua.prefix:{let r=t||ua;return[ua.prefix,r.decode(e)]}case Lu.prefix:{let r=t||Lu;return[Lu.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"),DA=o((e,t,r)=>{let{prefix:n}=r;if(n!==ua.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),RA=o((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),Nu=112,OA=18,Zy=o((e,t,r)=>{let n=Qf(e),a=n+Qf(t),s=new Uint8Array(a+r.byteLength);return Xf(e,s,0),Xf(t,s,n),s.set(r,a),s},"encodeCID"),Yy=Symbol.for("@ipld/js-cid/CID"),$f={writable:!1,configurable:!1,enumerable:!0},zf={writable:!1,enumerable:!1,configurable:!1},NA="0.0.0-dev",PA=o((e,t)=>{if(e.test(NA))console.warn(t);else throw new Error(t)},"deprecate"),BA=`CID.isCID(v) is deprecated and will be removed in the next major release.
43
+ }`;var Lt=L_(function(){return fr(ce,pt+"return "+$e).apply(r,ye)});if(Lt.source=$e,jh(Lt))throw Lt;return Lt}i(I_,"template"),o(I_,"template");function k_(u){return dr(u).toLowerCase()}i(k_,"toLower"),o(k_,"toLower");function D_(u){return dr(u).toUpperCase()}i(D_,"toUpper"),o(D_,"toUpper");function R_(u,d,S){if(u=dr(u),u&&(S||d===r))return l1(u);if(!u||!(d=$n(d)))return u;var $=Oi(u),te=Oi(d),ce=f1($,te),ye=d1($,te)+1;return uo($,ce,ye).join("")}i(R_,"trim"),o(R_,"trim");function O_(u,d,S){if(u=dr(u),u&&(S||d===r))return u.slice(0,p1(u)+1);if(!u||!(d=$n(d)))return u;var $=Oi(u),te=d1($,Oi(d))+1;return uo($,0,te).join("")}i(O_,"trimEnd"),o(O_,"trimEnd");function N_(u,d,S){if(u=dr(u),u&&(S||d===r))return u.replace(et,"");if(!u||!(d=$n(d)))return u;var $=Oi(u),te=f1($,Oi(d));return uo($,te).join("")}i(N_,"trimStart"),o(N_,"trimStart");function P_(u,d){var S=me,$=we;if(kr(d)){var te="separator"in d?d.separator:te;S="length"in d?Pt(d.length):S,$="omission"in d?$n(d.omission):$}u=dr(u);var ce=u.length;if(Ls(u)){var ye=Oi(u);ce=ye.length}if(S>=ce)return u;var Ee=S-Us($);if(Ee<1)return $;var xe=ye?uo(ye,0,Ee).join(""):u.slice(0,Ee);if(te===r)return xe+$;if(ye&&(Ee+=xe.length-Ee),Pg(te)){if(u.slice(Ee).search(te)){var Ue,Fe=xe;for(te.global||(te=m1(te.source,dr(yt.exec(te))+"g")),te.lastIndex=0;Ue=te.exec(Fe);)var $e=Ue.index;xe=xe.slice(0,$e===r?Ee:$e)}}else if(u.indexOf($n(te),Ee)!=Ee){var Ye=xe.lastIndexOf(te);Ye>-1&&(xe=xe.slice(0,Ye))}return xe+$}i(P_,"truncate"),o(P_,"truncate");function B_(u){return u=dr(u),u&&ct.test(u)?u.replace(mt,hD):u}i(B_,"unescape"),o(B_,"unescape");var UR=$s(function(u,d,S){return u+(S?" ":"")+d.toUpperCase()}),zg=J1("toUpperCase");function Hg(u,d,S){return u=dr(u),d=S?r:d,d===r?c3(u)?m3(u):t3(u):u.match(d)||[]}i(Hg,"words"),o(Hg,"words");var L_=Ut(function(u,d){try{return Fn(u,r,d)}catch(S){return jh(S)?S:new kt(S)}}),FR=Ca(function(u,d){return ni(d,function(S){S=Qi(S),xa(u,S,Mg(u[S],u))}),u});function U_(u){var d=u==null?0:u.length,S=wt();return u=d?Mr(u,function($){if(typeof $[1]!="function")throw new Ni(c);return[S($[0]),$[1]]}):[],Ut(function($){for(var te=-1;++te<d;){var ce=u[te];if(Fn(ce[0],this,$))return Fn(ce[1],this,$)}})}i(U_,"cond"),o(U_,"cond");function F_(u){return Q3(ai(u,v))}i(F_,"conforms"),o(F_,"conforms");function qh(u){return function(){return u}}i(qh,"constant"),o(qh,"constant");function j_(u,d){return u==null||u!==u?d:u}i(j_,"defaultTo"),o(j_,"defaultTo");var jR=Y1(),$R=Y1(!0);function Rn(u){return u}i(Rn,"identity4"),o(Rn,"identity");function Vh(u){return I1(typeof u=="function"?u:ai(u,v))}i(Vh,"iteratee"),o(Vh,"iteratee");function $_(u){return D1(ai(u,v))}i($_,"matches"),o($_,"matches");function z_(u,d){return R1(u,ai(d,v))}i(z_,"matchesProperty"),o(z_,"matchesProperty");var zR=Ut(function(u,d){return function(S){return eu(S,u,d)}}),HR=Ut(function(u,d){return function(S){return eu(u,S,d)}});function Kh(u,d,S){var $=Zr(d),te=Wl(d,$);S==null&&!(kr(d)&&(te.length||!$.length))&&(S=d,d=u,u=this,te=Wl(d,Zr(d)));var ce=!(kr(S)&&"chain"in S)||!!S.chain,ye=Ia(u);return ni(te,function(Ee){var xe=d[Ee];u[Ee]=xe,ye&&(u.prototype[Ee]=function(){var Ue=this.__chain__;if(ce||Ue){var Fe=u(this.__wrapped__),$e=Fe.__actions__=In(this.__actions__);return $e.push({func:xe,args:arguments,thisArg:u}),Fe.__chain__=Ue,Fe}return xe.apply(u,ao([this.value()],arguments))})}),u}i(Kh,"mixin"),o(Kh,"mixin");function H_(){return Fr._===this&&(Fr._=bD),this}i(H_,"noConflict"),o(H_,"noConflict");function Gh(){}i(Gh,"noop2"),o(Gh,"noop");function q_(u){return u=Pt(u),Ut(function(d){return O1(d,u)})}i(q_,"nthArg"),o(q_,"nthArg");var qR=Ih(Mr),VR=Ih(a1),KR=Ih(Kd);function qg(u){return Nh(u)?Gd(Qi(u)):y5(u)}i(qg,"property"),o(qg,"property");function V_(u){return function(d){return u==null?r:zo(u,d)}}i(V_,"propertyOf"),o(V_,"propertyOf");var GR=Q1(),WR=Q1(!0);function Wh(){return[]}i(Wh,"stubArray"),o(Wh,"stubArray");function Jh(){return!1}i(Jh,"stubFalse"),o(Jh,"stubFalse");function K_(){return{}}i(K_,"stubObject"),o(K_,"stubObject");function G_(){return""}i(G_,"stubString"),o(G_,"stubString");function W_(){return!0}i(W_,"stubTrue"),o(W_,"stubTrue");function J_(u,d){if(u=Pt(u),u<1||u>E)return[];var S=A,$=vn(u,A);d=wt(d),u-=A;for(var te=Zd($,d);++S<u;)d(S);return te}i(J_,"times"),o(J_,"times");function Z_(u){return Nt(u)?Mr(u,Qi):zn(u)?[u]:In(ew(dr(u)))}i(Z_,"toPath"),o(Z_,"toPath");function Y_(u){var d=++vD;return dr(u)+d}i(Y_,"uniqueId"),o(Y_,"uniqueId");var JR=ef(function(u,d){return u+d},0),ZR=kh("ceil"),YR=ef(function(u,d){return u/d},1),XR=kh("floor");function X_(u){return u&&u.length?Gl(u,Rn,mh):r}i(X_,"max"),o(X_,"max");function Q_(u,d){return u&&u.length?Gl(u,wt(d,2),mh):r}i(Q_,"maxBy"),o(Q_,"maxBy");function e8(u){return c1(u,Rn)}i(e8,"mean"),o(e8,"mean");function t8(u,d){return c1(u,wt(d,2))}i(t8,"meanBy"),o(t8,"meanBy");function r8(u){return u&&u.length?Gl(u,Rn,bh):r}i(r8,"min"),o(r8,"min");function n8(u,d){return u&&u.length?Gl(u,wt(d,2),bh):r}i(n8,"minBy"),o(n8,"minBy");var QR=ef(function(u,d){return u*d},1),eO=kh("round"),tO=ef(function(u,d){return u-d},0);function i8(u){return u&&u.length?Jd(u,Rn):0}i(i8,"sum"),o(i8,"sum");function a8(u,d){return u&&u.length?Jd(u,wt(d,2)):0}return i(a8,"sumBy"),o(a8,"sumBy"),se.after=u4,se.ary=Tg,se.assign=_R,se.assignIn=q4,se.assignInWith=$h,se.assignWith=ER,se.at=AR,se.before=Cg,se.bind=Mg,se.bindAll=FR,se.bindKey=l4,se.castArray=b4,se.chain=Ag,se.chunk=rw,se.compact=nw,se.concat=iw,se.cond=U_,se.conforms=F_,se.constant=qh,se.countBy=nR,se.create=V4,se.curry=Ig,se.curryRight=kg,se.debounce=Dg,se.defaults=SR,se.defaultsDeep=xR,se.defer=fR,se.delay=dR,se.difference=FD,se.differenceBy=jD,se.differenceWith=$D,se.drop=aw,se.dropRight=ow,se.dropRightWhile=sw,se.dropWhile=cw,se.fill=uw,se.filter=Jw,se.flatMap=Zw,se.flatMapDeep=Yw,se.flatMapDepth=Xw,se.flatten=bg,se.flattenDeep=lw,se.flattenDepth=fw,se.flip=f4,se.flow=jR,se.flowRight=$R,se.fromPairs=dw,se.functions=X4,se.functionsIn=Q4,se.groupBy=oR,se.initial=pw,se.intersection=zD,se.intersectionBy=HD,se.intersectionWith=qD,se.invert=TR,se.invertBy=CR,se.invokeMap=sR,se.iteratee=Vh,se.keyBy=cR,se.keys=Zr,se.keysIn=Dn,se.map=uf,se.mapKeys=t_,se.mapValues=r_,se.matches=$_,se.matchesProperty=z_,se.memoize=lf,se.merge=IR,se.mergeWith=n_,se.method=zR,se.methodOf=HR,se.mixin=Kh,se.negate=ff,se.nthArg=q_,se.omit=kR,se.omitBy=i_,se.once=d4,se.orderBy=e4,se.over=qR,se.overArgs=hR,se.overEvery=VR,se.overSome=KR,se.partial=Rg,se.partialRight=h4,se.partition=uR,se.pick=DR,se.pickBy=Fg,se.property=qg,se.propertyOf=V_,se.pull=VD,se.pullAll=_g,se.pullAllBy=yw,se.pullAllWith=bw,se.pullAt=KD,se.range=GR,se.rangeRight=WR,se.rearg=pR,se.reject=n4,se.remove=ww,se.rest=p4,se.reverse=Lh,se.sampleSize=a4,se.set=o_,se.setWith=s_,se.shuffle=o4,se.slice=_w,se.sortBy=lR,se.sortedUniq=Mw,se.sortedUniqBy=Iw,se.split=C_,se.spread=m4,se.tail=kw,se.take=Dw,se.takeRight=Rw,se.takeRightWhile=Ow,se.takeWhile=Nw,se.tap=jw,se.throttle=g4,se.thru=cf,se.toArray=Bg,se.toPairs=c_,se.toPairsIn=u_,se.toPath=Z_,se.toPlainObject=Ug,se.transform=l_,se.unary=v4,se.union=GD,se.unionBy=WD,se.unionWith=JD,se.uniq=Pw,se.uniqBy=Bw,se.uniqWith=Lw,se.unset=f_,se.unzip=Uh,se.unzipWith=Eg,se.update=d_,se.updateWith=h_,se.values=qs,se.valuesIn=p_,se.without=ZD,se.words=Hg,se.wrap=y4,se.xor=YD,se.xorBy=XD,se.xorWith=QD,se.zip=eR,se.zipObject=Uw,se.zipObjectDeep=Fw,se.zipWith=tR,se.entries=c_,se.entriesIn=u_,se.extend=q4,se.extendWith=$h,Kh(se,se),se.add=JR,se.attempt=L_,se.camelCase=RR,se.capitalize=jg,se.ceil=ZR,se.clamp=m_,se.clone=w4,se.cloneDeep=E4,se.cloneDeepWith=A4,se.cloneWith=_4,se.conformsTo=S4,se.deburr=$g,se.defaultTo=j_,se.divide=YR,se.endsWith=y_,se.eq=Bi,se.escape=b_,se.escapeRegExp=w_,se.every=Ww,se.find=iR,se.findIndex=vg,se.findKey=K4,se.findLast=aR,se.findLastIndex=yg,se.findLastKey=G4,se.floor=XR,se.forEach=Sg,se.forEachRight=xg,se.forIn=W4,se.forInRight=J4,se.forOwn=Z4,se.forOwnRight=Y4,se.get=zh,se.gt=mR,se.gte=gR,se.has=e_,se.hasIn=Hh,se.head=wg,se.identity=Rn,se.includes=Qw,se.indexOf=hw,se.inRange=g_,se.invoke=MR,se.isArguments=Hs,se.isArray=Nt,se.isArrayBuffer=vR,se.isArrayLike=kn,se.isArrayLikeObject=Pr,se.isBoolean=x4,se.isBuffer=Vo,se.isDate=yR,se.isElement=T4,se.isEmpty=C4,se.isEqual=M4,se.isEqualWith=I4,se.isError=jh,se.isFinite=k4,se.isFunction=Ia,se.isInteger=Og,se.isLength=df,se.isMap=D4,se.isMatch=R4,se.isMatchWith=O4,se.isNaN=N4,se.isNative=P4,se.isNil=L4,se.isNull=B4,se.isNumber=Ng,se.isObject=kr,se.isObjectLike=Rr,se.isPlainObject=au,se.isRegExp=Pg,se.isSafeInteger=U4,se.isSet=F4,se.isString=hf,se.isSymbol=zn,se.isTypedArray=ou,se.isUndefined=j4,se.isWeakMap=$4,se.isWeakSet=z4,se.join=mw,se.kebabCase=OR,se.last=si,se.lastIndexOf=gw,se.lowerCase=NR,se.lowerFirst=PR,se.lt=bR,se.lte=wR,se.max=X_,se.maxBy=Q_,se.mean=e8,se.meanBy=t8,se.min=r8,se.minBy=n8,se.stubArray=Wh,se.stubFalse=Jh,se.stubObject=K_,se.stubString=G_,se.stubTrue=W_,se.multiply=QR,se.nth=vw,se.noConflict=H_,se.noop=Gh,se.now=Fh,se.pad=__,se.padEnd=E_,se.padStart=A_,se.parseInt=S_,se.random=v_,se.reduce=t4,se.reduceRight=r4,se.repeat=x_,se.replace=T_,se.result=a_,se.round=eO,se.runInContext=Se,se.sample=i4,se.size=s4,se.snakeCase=BR,se.some=c4,se.sortedIndex=Ew,se.sortedIndexBy=Aw,se.sortedIndexOf=Sw,se.sortedLastIndex=xw,se.sortedLastIndexBy=Tw,se.sortedLastIndexOf=Cw,se.startCase=LR,se.startsWith=M_,se.subtract=tO,se.sum=i8,se.sumBy=a8,se.template=I_,se.times=J_,se.toFinite=ka,se.toInteger=Pt,se.toLength=Lg,se.toLower=k_,se.toNumber=ci,se.toSafeInteger=H4,se.toString=dr,se.toUpper=D_,se.trim=R_,se.trimEnd=O_,se.trimStart=N_,se.truncate=P_,se.unescape=B_,se.uniqueId=Y_,se.upperCase=UR,se.upperFirst=zg,se.each=Sg,se.eachRight=xg,se.first=wg,Kh(se,function(){var u={};return Yi(se,function(d,S){yr.call(se.prototype,S)||(u[S]=d)}),u}(),{chain:!1}),se.VERSION=n,ni(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){se[u].placeholder=se}),ni(["drop","take"],function(u,d){Kt.prototype[u]=function(S){S=S===r?1:Jr(Pt(S),0);var $=this.__filtered__&&!d?new Kt(this):this.clone();return $.__filtered__?$.__takeCount__=vn(S,$.__takeCount__):$.__views__.push({size:vn(S,A),type:u+($.__dir__<0?"Right":"")}),$},Kt.prototype[u+"Right"]=function(S){return this.reverse()[u](S).reverse()}}),ni(["filter","map","takeWhile"],function(u,d){var S=d+1,$=S==T||S==f;Kt.prototype[u]=function(te){var ce=this.clone();return ce.__iteratees__.push({iteratee:wt(te,3),type:S}),ce.__filtered__=ce.__filtered__||$,ce}}),ni(["head","last"],function(u,d){var S="take"+(d?"Right":"");Kt.prototype[u]=function(){return this[S](1).value()[0]}}),ni(["initial","tail"],function(u,d){var S="drop"+(d?"":"Right");Kt.prototype[u]=function(){return this.__filtered__?new Kt(this):this[S](1)}}),Kt.prototype.compact=function(){return this.filter(Rn)},Kt.prototype.find=function(u){return this.filter(u).head()},Kt.prototype.findLast=function(u){return this.reverse().find(u)},Kt.prototype.invokeMap=Ut(function(u,d){return typeof u=="function"?new Kt(this):this.map(function(S){return eu(S,u,d)})}),Kt.prototype.reject=function(u){return this.filter(ff(wt(u)))},Kt.prototype.slice=function(u,d){u=Pt(u);var S=this;return S.__filtered__&&(u>0||d<0)?new Kt(S):(u<0?S=S.takeRight(-u):u&&(S=S.drop(u)),d!==r&&(d=Pt(d),S=d<0?S.dropRight(-d):S.take(d-u)),S)},Kt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Kt.prototype.toArray=function(){return this.take(A)},Yi(Kt.prototype,function(u,d){var S=/^(?:filter|find|map|reject)|While$/.test(d),$=/^(?:head|last)$/.test(d),te=se[$?"take"+(d=="last"?"Right":""):d],ce=$||/^find/.test(d);!te||(se.prototype[d]=function(){var ye=this.__wrapped__,Ee=$?[1]:arguments,xe=ye instanceof Kt,Ue=Ee[0],Fe=xe||Nt(ye),$e=o(function(Ht){var Gt=te.apply(se,ao([Ht],Ee));return $&&Ye?Gt[0]:Gt},"interceptor");Fe&&S&&typeof Ue=="function"&&Ue.length!=1&&(xe=Fe=!1);var Ye=this.__chain__,pt=!!this.__actions__.length,St=ce&&!Ye,Lt=xe&&!pt;if(!ce&&Fe){ye=Lt?ye:new Kt(this);var _t=u.apply(ye,Ee);return _t.__actions__.push({func:cf,args:[$e],thisArg:r}),new ii(_t,Ye)}return St&&Lt?u.apply(this,Ee):(_t=this.thru($e),St?$?_t.value()[0]:_t.value():_t)})}),ni(["pop","push","shift","sort","splice","unshift"],function(u){var d=Qd[u],S=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",$=/^(?:pop|shift)$/.test(u);se.prototype[u]=function(){var te=arguments;if($&&!this.__chain__){var ce=this.value();return d.apply(Nt(ce)?ce:[],te)}return this[S](function(ye){return d.apply(Nt(ye)?ye:[],te)})}}),Yi(Kt.prototype,function(u,d){var S=se[d];if(S){var $=S.name+"";yr.call(Zc,$)||(Zc[$]=[]),Zc[$].push({name:d,func:S})}}),Zc[Ql(r,P).name]=[{name:"wrapper",func:r}],Kt.prototype.clone=S3,Kt.prototype.reverse=x3,Kt.prototype.value=T3,se.prototype.at=rR,se.prototype.chain=$w,se.prototype.commit=zw,se.prototype.next=Hw,se.prototype.plant=Vw,se.prototype.reverse=Kw,se.prototype.toJSON=se.prototype.valueOf=se.prototype.value=Gw,se.prototype.first=se.prototype.head,jl&&(se.prototype[jl]=qw),se},"runInContext2"),"runInContext"),Bo=pD();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fr._=Bo,define(function(){return Bo})):Ea?((Ea.exports=Bo)._=Bo,_a._=Bo):Fr._=Bo}).call(e)}});function vm(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}i(vm,"asUint8Array");var ym=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/util/as-uint8array.js"(){o(vm,"asUint8Array")}});function d6(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?vm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}i(d6,"allocUnsafe");var h6=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/alloc.js"(){ym(),o(d6,"allocUnsafe")}}),IS={};xr(IS,{concat:()=>vs});function vs(e,t){t||(t=e.reduce((a,s)=>a+s.length,0));let r=d6(t),n=0;for(let a of e)r.set(a,n),n+=a.length;return vm(r)}i(vs,"concat");var kS=gr({"../../../node_modules/.pnpm/uint8arrays@3.1.1/node_modules/uint8arrays/esm/src/concat.js"(){h6(),ym(),o(vs,"concat")}});function oA(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 a=0;a<e.length;a++){var s=e.charAt(a),c=s.charCodeAt(0);if(r[c]!==255)throw new TypeError(s+" is ambiguous");r[c]=a}var l=e.length,h=e.charAt(0),p=Math.log(l)/Math.log(256),g=Math.log(256)/Math.log(l);function v(x){if(x instanceof Uint8Array||(ArrayBuffer.isView(x)?x=new Uint8Array(x.buffer,x.byteOffset,x.byteLength):Array.isArray(x)&&(x=Uint8Array.from(x))),!(x instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(x.length===0)return"";for(var O=0,D=0,P=0,J=x.length;P!==J&&x[P]===0;)P++,O++;for(var j=(J-P)*g+1>>>0,q=new Uint8Array(j);P!==J;){for(var Q=x[P],Y=0,k=j-1;(Q!==0||Y<D)&&k!==-1;k--,Y++)Q+=256*q[k]>>>0,q[k]=Q%l>>>0,Q=Q/l>>>0;if(Q!==0)throw new Error("Non-zero carry");D=Y,P++}for(var K=j-D;K!==j&&q[K]===0;)K++;for(var he=h.repeat(O);K<j;++K)he+=e.charAt(q[K]);return he}i(v,"encode9"),o(v,"encode");function y(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var O=0;if(x[O]!==" "){for(var D=0,P=0;x[O]===h;)D++,O++;for(var J=(x.length-O)*p+1>>>0,j=new Uint8Array(J);x[O];){var q=r[x.charCodeAt(O)];if(q===255)return;for(var Q=0,Y=J-1;(q!==0||Q<P)&&Y!==-1;Y--,Q++)q+=l*j[Y]>>>0,j[Y]=q%256>>>0,q=q/256>>>0;if(q!==0)throw new Error("Non-zero carry");P=Q,O++}if(x[O]!==" "){for(var k=J-P;k!==J&&j[k]===0;)k++;for(var K=new Uint8Array(D+(J-k)),he=D;k!==J;)K[he++]=j[k++];return K}}}i(y,"decodeUnsafe"),o(y,"decodeUnsafe");function _(x){var O=y(x);if(O)return O;throw new Error(`Non-${t} character`)}return i(_,"decode9"),o(_,"decode"),{encode:v,decodeUnsafe:y,decode:_}}i(oA,"base");var sA,cA,DS,mj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/base-x.js"(){o(oA,"base"),sA=oA,cA=sA,DS=cA}}),gj,RS,wd,OS,NS,Pc=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bytes.js"(){gj=new Uint8Array(0),RS=o((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"),wd=o(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"),OS=o(e=>new TextEncoder().encode(e),"fromString"),NS=o(e=>new TextDecoder().decode(e),"toString")}}),jy,$y,zy,Hy,qy,Jf,$u,uA,lA,tn,Ka=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base.js"(){mj(),Pc(),jy=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"),o(jy,"Encoder"),$y=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 Hy(this,e)}},"Decoder"),o($y,"Decoder"),zy=i(class{constructor(e){this.decoders=e}or(e){return Hy(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"),o(zy,"ComposedDecoder"),Hy=o((e,t)=>new zy({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}}),"or"),qy=i(class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new jy(e,t,r),this.decoder=new $y(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),o(qy,"Codec"),Jf=o(({name:e,prefix:t,encode:r,decode:n})=>new qy(e,t,r,n),"from"),$u=o(({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:a}=DS(r,t);return Jf({prefix:e,name:t,encode:n,decode:s=>wd(a(s))})},"baseX"),uA=o((e,t,r,n)=>{let a={};for(let g=0;g<t.length;++g)a[t[g]]=g;let s=e.length;for(;e[s-1]==="=";)--s;let c=new Uint8Array(s*r/8|0),l=0,h=0,p=0;for(let g=0;g<s;++g){let v=a[e[g]];if(v===void 0)throw new SyntaxError(`Non-${n} character`);h=h<<r|v,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"),lA=o((e,t,r)=>{let n=t[t.length-1]==="=",a=(1<<r)-1,s="",c=0,l=0;for(let h=0;h<e.length;++h)for(l=l<<8|e[h],c+=8;c>r;)c-=r,s+=t[a&l>>c];if(c&&(s+=t[a&l<<r-c]),n)for(;s.length*r&7;)s+="=";return s},"encode"),tn=o(({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Jf({prefix:t,name:e,encode(a){return lA(a,n,r)},decode(a){return uA(a,n,r,e)}}),"rfc4648")}}),PS={};xr(PS,{identity:()=>BS});var BS,vj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/identity.js"(){Ka(),Pc(),BS=Jf({prefix:"\0",name:"identity",encode:e=>NS(e),decode:e=>OS(e)})}}),LS={};xr(LS,{base2:()=>US});var US,yj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base2.js"(){Ka(),US=tn({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),FS={};xr(FS,{base8:()=>jS});var jS,bj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base8.js"(){Ka(),jS=tn({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),$S={};xr($S,{base10:()=>zS});var zS,wj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base10.js"(){Ka(),zS=$u({prefix:"9",name:"base10",alphabet:"0123456789"})}}),HS={};xr(HS,{base16:()=>qS,base16upper:()=>VS});var qS,VS,_j=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base16.js"(){Ka(),qS=tn({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),VS=tn({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),KS={};xr(KS,{base32:()=>Lu,base32hex:()=>ZS,base32hexpad:()=>XS,base32hexpadupper:()=>QS,base32hexupper:()=>YS,base32pad:()=>WS,base32padupper:()=>JS,base32upper:()=>GS,base32z:()=>ex});var Lu,GS,WS,JS,ZS,YS,XS,QS,ex,tx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base32.js"(){Ka(),Lu=tn({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),GS=tn({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),WS=tn({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),JS=tn({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ZS=tn({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),YS=tn({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),XS=tn({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),QS=tn({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),ex=tn({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),rx={};xr(rx,{base36:()=>Ts,base36upper:()=>nx});var Ts,nx,_d=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base36.js"(){Ka(),Ts=$u({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),nx=$u({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),ix={};xr(ix,{base58btc:()=>ua,base58flickr:()=>ax});var ua,ax,p6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base58.js"(){Ka(),ua=$u({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ax=$u({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),ox={};xr(ox,{base64:()=>sx,base64pad:()=>cx,base64url:()=>zu,base64urlpad:()=>ux});var sx,cx,zu,ux,m6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base64.js"(){Ka(),sx=tn({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),cx=tn({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),zu=tn({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ux=tn({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}}),lx={};xr(lx,{base256emoji:()=>hx});function fA(e){return e.reduce((t,r)=>(t+=fx[r],t),"")}i(fA,"encode2");function dA(e){let t=[];for(let r of e){let n=dx[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}i(dA,"decode2");var Vy,fx,dx,hx,Ej=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/bases/base256emoji.js"(){Ka(),Vy=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}"),fx=Vy.reduce((e,t,r)=>(e[r]=t,e),[]),dx=Vy.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),o(fA,"encode"),o(dA,"decode"),hx=Jf({prefix:"\u{1F680}",name:"base256emoji",encode:fA,decode:dA})}});function hb(e,t,r){t=t||[],r=r||0;for(var n=r;e>=mx;)t[r++]=e&255|pb,e/=128;for(;e&px;)t[r++]=e&255|pb,e>>>=7;return t[r]=e|0,hb.bytes=r-n+1,t}i(hb,"encode3");function j0(e,n){var r=0,n=n||0,a=0,s=n,c,l=e.length;do{if(s>=l)throw j0.bytes=0,new RangeError("Could not decode varint");c=e[s++],r+=a<28?(c&mb)<<a:(c&mb)*Math.pow(2,a),a+=7}while(c>=gx);return j0.bytes=s-n,r}i(j0,"read");var hA,pb,pA,px,mx,mA,gx,mb,gA,vA,yA,bA,wA,_A,EA,AA,SA,xA,TA,CA,Vf,Aj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/vendor/varint.js"(){hA=hb,pb=128,pA=127,px=~pA,mx=Math.pow(2,31),o(hb,"encode"),mA=j0,gx=128,mb=127,o(j0,"read"),gA=Math.pow(2,7),vA=Math.pow(2,14),yA=Math.pow(2,21),bA=Math.pow(2,28),wA=Math.pow(2,35),_A=Math.pow(2,42),EA=Math.pow(2,49),AA=Math.pow(2,56),SA=Math.pow(2,63),xA=o(function(e){return e<gA?1:e<vA?2:e<yA?3:e<bA?4:e<wA?5:e<_A?6:e<EA?7:e<AA?8:e<SA?9:10},"length"),TA={encode:hA,decode:mA,encodingLength:xA},CA=TA,Vf=CA}}),$0,Xf,Qf,g6=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/varint.js"(){Aj(),$0=o((e,t=0)=>[Vf.decode(e,t),Vf.decode.bytes],"decode"),Xf=o((e,t,r=0)=>(Vf.encode(e,t,r),t),"encodeTo"),Qf=o(e=>Vf.encodingLength(e),"encodingLength")}}),Hu,v6,vx,Kf,al=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/digest.js"(){Pc(),g6(),Hu=o((e,t)=>{let r=t.byteLength,n=Qf(e),a=n+Qf(r),s=new Uint8Array(a+r);return Xf(e,s,0),Xf(r,s,n),s.set(t,a),new Kf(e,r,t,s)},"create"),v6=o(e=>{let t=wd(e),[r,n]=$0(t),[a,s]=$0(t.subarray(n)),c=t.subarray(n+s);if(c.byteLength!==a)throw new Error("Incorrect length");return new Kf(r,a,c,t)},"decode"),vx=o((e,t)=>e===t?!0:e.code===t.code&&e.size===t.size&&RS(e.bytes,t.bytes),"equals"),Kf=i(class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest"),o(Kf,"Digest")}}),gb,Ky,yx=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/hasher.js"(){al(),gb=o(({name:e,code:t,encode:r})=>new Ky(e,t,r),"from"),Ky=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?Hu(this.code,t):t.then(r=>Hu(this.code,r))}else throw Error("Unknown type, must be binary type")}},"Hasher"),o(Ky,"Hasher")}}),bx={};xr(bx,{sha256:()=>ol,sha512:()=>wx});var Gy,ol,wx,bm=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){yx(),Gy=o(e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),"sha"),ol=gb({name:"sha2-256",code:18,encode:Gy("SHA-256")}),wx=gb({name:"sha2-512",code:19,encode:Gy("SHA-512")})}}),_x={};xr(_x,{identity:()=>wm});var Wy,MA,Jy,IA,wm,Ex=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/hashes/identity.js"(){Pc(),al(),Wy=0,MA="identity",Jy=wd,IA=o(e=>Hu(Wy,Jy(e)),"digest"),wm={code:Wy,name:MA,encode:Jy,digest:IA}}}),Sj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/raw.js"(){Pc()}}),xj,Tj,Cj=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/codecs/json.js"(){xj=new TextEncoder,Tj=new TextDecoder}}),$t,kA,DA,RA,Nu,OA,Zy,Yy,$f,zf,NA,PA,BA,Ga=gr({"../../../node_modules/.pnpm/multiformats@9.9.0/node_modules/multiformats/esm/src/cid.js"(){g6(),al(),p6(),tx(),Pc(),$t=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:zf,byteLength:zf,code:$f,version:$f,multihash:$f,bytes:$f,_baseCache:zf,asCID:zf})}toV0(){switch(this.version){case 0:return this;default:{let{code:e,multihash:t}=this;if(e!==Nu)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==OA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return $t.createV0(t)}}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=Hu(e,t);return $t.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&&vx(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;switch(r){case 0:return DA(t,n,e||ua.encoder);default:return RA(t,n,e||Lu.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 PA(/^0\.0/,BA),!!(e&&(e[Yy]||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 $t)return e;if(e!=null&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:a}=e;return new $t(t,r,n,a||Zy(t,r,n.bytes))}else if(e!=null&&e[Yy]===!0){let{version:t,multihash:r,code:n}=e,a=v6(r);return $t.create(t,n,a)}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!==Nu)throw new Error(`Version 0 CID must use dag-pb (code: ${Nu}) block encoding`);return new $t(e,t,r,r.bytes)}case 1:{let n=Zy(e,t,r.bytes);return new $t(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return $t.create(0,Nu,e)}static createV1(e,t){return $t.create(1,e,t)}static decode(e){let[t,r]=$t.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){let t=$t.inspectBytes(e),r=t.size-t.multihashSize,n=wd(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");let a=n.subarray(t.multihashSize-t.digestSize),s=new Kf(t.multihashCode,t.digestSize,a,n);return[t.version===0?$t.createV0(s):$t.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=o(()=>{let[g,v]=$0(e.subarray(t));return t+=v,g},"next"),n=r(),a=Nu;if(n===18?(n=0,t=0):n===1&&(a=r()),n!==0&&n!==1)throw new RangeError(`Invalid CID version ${n}`);let s=t,c=r(),l=r(),h=t+l,p=h-s;return{version:n,codec:a,multihashCode:c,digestSize:l,multihashSize:p,size:h}}static parse(e,t){let[r,n]=kA(e,t),a=$t.decode(n);return a._baseCache.set(r,e),a}},"CID"),o($t,"CID"),kA=o((e,t)=>{switch(e[0]){case"Q":{let r=t||ua;return[ua.prefix,r.decode(`${ua.prefix}${e}`)]}case ua.prefix:{let r=t||ua;return[ua.prefix,r.decode(e)]}case Lu.prefix:{let r=t||Lu;return[Lu.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"),DA=o((e,t,r)=>{let{prefix:n}=r;if(n!==ua.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let a=t.get(n);if(a==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return a},"toStringV0"),RA=o((e,t,r)=>{let{prefix:n}=r,a=t.get(n);if(a==null){let s=r.encode(e);return t.set(n,s),s}else return a},"toStringV1"),Nu=112,OA=18,Zy=o((e,t,r)=>{let n=Qf(e),a=n+Qf(t),s=new Uint8Array(a+r.byteLength);return Xf(e,s,0),Xf(t,s,n),s.set(r,a),s},"encodeCID"),Yy=Symbol.for("@ipld/js-cid/CID"),$f={writable:!1,configurable:!1,enumerable:!0},zf={writable:!1,enumerable:!1,configurable:!1},NA="0.0.0-dev",PA=o((e,t)=>{if(e.test(NA))console.warn(t);else throw new Error(t)},"deprecate"),BA=`CID.isCID(v) is deprecated and will be removed in the next major release.
44
44
  Following code pattern:
45
45
 
46
46
  if (CID.isCID(value)) {
@@ -669,14 +669,14 @@ ${P}${J}`,y=D.length);v===0&&(D+=`<= <none>
669
669
  `)}),E+=`</table></p>
670
670
  `,E},"errorsToHtml2"),"errorsToHtml"),Q=o(i(function(w,T,b){let f,m,E,R;return f="",w.forEach(C=>{m=T[C.line],f+=`${m.lineNo}: `,f+=`${m.beginChar}: `,f+=`${C.char-m.beginChar}: `,E=m.beginChar,R=C.char-m.beginChar,f+=P(b,E,R),f+=" >> ",E=C.char,R=m.beginChar+m.length-C.char,f+=P(b,E,R),f+=`
671
671
  `,f+=`${m.lineNo}: `,f+=`${m.beginChar}: `,f+=`${C.char-m.beginChar}: `,f+="error: ",f+=C.msg,f+=`
672
- `}),f},"errorsToAscii2"),"errorsToAscii"),Y=!1,k=!1,K=!1,he=!1,me=0,we;if(this.errors=[],a.isBuffer(n))this.chars=h.decode("BINARY",n);else if(Array.isArray(n))this.chars=n.slice();else if(typeof n=="string")this.chars=h.decode("STRING",n);else throw new Error(`${s}input source is not a string, byte Buffer or character array`);this.sabnf=h.encode("STRING",this.chars),this.scan=o(i(function(w,T){this.lines=p(this.chars,this.errors,w,T),Y=!0},"scan"),"scan"),this.parse=o(i(function(w,T,b){if(!Y)throw new Error(`${s}grammar not scanned`);g.syntax(this.chars,this.lines,this.errors,w,T,b),k=!0},"parse3"),"parse"),this.translate=o(i(function(){if(!k)throw new Error(`${s}grammar not scanned and parsed`);let w=g.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=w.rules,this.udts=w.udts,we=w.lineMap,K=!0)},"translate"),"translate"),this.attributes=o(i(function(){if(!K)throw new Error(`${s}grammar not scanned, parsed and translated`);return me=v(this.rules,this.udts,we,this.errors),he=!0,me},"attrs"),"attrs"),this.generate=o(i(function(w){if(this.lines=p(this.chars,this.errors,w),this.errors.length||(g.syntax(this.chars,this.lines,this.errors,w),this.errors.length))return;let T=g.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=T.rules,this.udts=T.udts,we=T.lineMap,me=v(this.rules,this.udts,we,this.errors),he=!0)},"generate3"),"generate"),this.displayRules=o(i(function(w="index"){if(!K)throw new Error(`${s}grammar not scanned, parsed and translated`);return O(this.rules,this.udts,w)},"displayRules"),"displayRules"),this.displayRuleDependencies=o(i(function(w="index"){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return x(w)},"displayRuleDependencies"),"displayRuleDependencies"),this.displayAttributes=o(i(function(w="index"){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return me&&_(w),y(w)},"displayAttributes"),"displayAttributes"),this.displayAttributeErrors=o(i(function(){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return _()},"displayAttributeErrors"),"displayAttributeErrors"),this.toSource=o(i(function(w=void 0){if(!he)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(me)throw new Error(`${s}can't generate parser source - attributes have ${me} errors`);return g.generateSource(this.chars,this.lines,this.rules,this.udts,w)},"toSource"),"toSource"),this.toObject=o(i(function(){if(!he)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(me)throw new Error(`${s}can't generate parser source - attributes have ${me} errors`);return g.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),"toObject"),this.errorsToAscii=o(i(function(){return Q(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),"errorsToAsciiFunc"),this.errorsToHtml=o(i(function(w){return q(this.errors,this.lines,this.chars,w)},"errorsToHtmlFunc"),"errorsToHtmlFunc"),this.linesToAscii=o(i(function(){return J(this.lines)},"linesToAsciiFunc"),"linesToAsciiFunc"),this.linesToHtml=o(i(function(){return j(this.lines)},"linesToHtmlFunc"),"linesToHtmlFunc")},"api"),"api")}}),$x=ze({"../../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){"use strict";function a(b,f){if(!b)throw new Error(f||"Assertion failed")}i(a,"assert2"),o(a,"assert");function s(b,f){b.super_=f;var m=o(function(){},"TempCtor");m.prototype=f.prototype,b.prototype=new m,b.prototype.constructor=b}i(s,"inherits"),o(s,"inherits");function c(b,f,m){if(c.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(b||0,f||10,m||"be"))}i(c,"BN3"),o(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=Ix().Buffer}catch{}c.isBN=o(i(function(f){return f instanceof c?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===c.wordSize&&Array.isArray(f.words)},"isBN"),"isBN"),c.max=o(i(function(f,m){return f.cmp(m)>0?f:m},"max"),"max"),c.min=o(i(function(f,m){return f.cmp(m)<0?f:m},"min"),"min"),c.prototype._init=o(i(function(f,m,E){if(typeof f=="number")return this._initNumber(f,m,E);if(typeof f=="object")return this._initArray(f,m,E);m==="hex"&&(m=16),a(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var R=0;f[0]==="-"&&(R++,this.negative=1),R<f.length&&(m===16?this._parseHex(f,R,E):(this._parseBase(f,m,R),E==="le"&&this._initArray(this.toArray(),m,E)))},"init2"),"init"),c.prototype._initNumber=o(i(function(f,m,E){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(a(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),E==="le"&&this._initArray(this.toArray(),m,E)},"_initNumber"),"_initNumber"),c.prototype._initArray=o(i(function(f,m,E){if(a(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var C,A,B=0;if(E==="be")for(R=f.length-1,C=0;R>=0;R-=3)A=f[R]|f[R-1]<<8|f[R-2]<<16,this.words[C]|=A<<B&67108863,this.words[C+1]=A>>>26-B&67108863,B+=24,B>=26&&(B-=26,C++);else if(E==="le")for(R=0,C=0;R<f.length;R+=3)A=f[R]|f[R+1]<<8|f[R+2]<<16,this.words[C]|=A<<B&67108863,this.words[C+1]=A>>>26-B&67108863,B+=24,B>=26&&(B-=26,C++);return this._strip()},"_initArray"),"_initArray");function h(b,f){var m=b.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;a(!1,"Invalid character in "+b)}i(h,"parseHex4Bits"),o(h,"parseHex4Bits");function p(b,f,m){var E=h(b,m);return m-1>=f&&(E|=h(b,m-1)<<4),E}i(p,"parseHexByte"),o(p,"parseHexByte"),c.prototype._parseHex=o(i(function(f,m,E){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var C=0,A=0,B;if(E==="be")for(R=f.length-1;R>=m;R-=2)B=p(f,m,R)<<C,this.words[A]|=B&67108863,C>=18?(C-=18,A+=1,this.words[A]|=B>>>26):C+=8;else{var V=f.length-m;for(R=V%2===0?m+1:m;R<f.length;R+=2)B=p(f,m,R)<<C,this.words[A]|=B&67108863,C>=18?(C-=18,A+=1,this.words[A]|=B>>>26):C+=8}this._strip()},"_parseHex"),"_parseHex");function g(b,f,m,E){for(var R=0,C=0,A=Math.min(b.length,m),B=f;B<A;B++){var V=b.charCodeAt(B)-48;R*=E,V>=49?C=V-49+10:V>=17?C=V-17+10:C=V,a(V>=0&&C<E,"Invalid character"),R+=C}return R}i(g,"parseBase"),o(g,"parseBase"),c.prototype._parseBase=o(i(function(f,m,E){this.words=[0],this.length=1;for(var R=0,C=1;C<=67108863;C*=m)R++;R--,C=C/m|0;for(var A=f.length-E,B=A%R,V=Math.min(A,A-B)+E,I=0,U=E;U<V;U+=R)I=g(f,U,U+R,m),this.imuln(C),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I);if(B!==0){var ge=1;for(I=g(f,U,f.length,m),U=0;U<B;U++)ge*=m;this.imuln(ge),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I)}this._strip()},"_parseBase"),"_parseBase"),c.prototype.copy=o(i(function(f){f.words=new Array(this.length);for(var m=0;m<this.length;m++)f.words[m]=this.words[m];f.length=this.length,f.negative=this.negative,f.red=this.red},"copy"),"copy");function v(b,f){b.words=f.words,b.length=f.length,b.negative=f.negative,b.red=f.red}if(i(v,"move"),o(v,"move"),c.prototype._move=o(i(function(f){v(f,this)},"_move"),"_move"),c.prototype.clone=o(i(function(){var f=new c(null);return this.copy(f),f},"clone"),"clone"),c.prototype._expand=o(i(function(f){for(;this.length<f;)this.words[this.length++]=0;return this},"_expand"),"_expand"),c.prototype._strip=o(i(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),"strip"),c.prototype._normSign=o(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"),o(y,"inspect");var _=["","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"],x=[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=o(i(function(f,m){f=f||10,m=m|0||1;var E;if(f===16||f==="hex"){E="";for(var R=0,C=0,A=0;A<this.length;A++){var B=this.words[A],V=((B<<R|C)&16777215).toString(16);C=B>>>24-R&16777215,R+=2,R>=26&&(R-=26,A--),C!==0||A!==this.length-1?E=_[6-V.length]+V+E:E=V+E}for(C!==0&&(E=C.toString(16)+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(f===(f|0)&&f>=2&&f<=36){var I=x[f],U=O[f];E="";var ge=this.clone();for(ge.negative=0;!ge.isZero();){var L=ge.modrn(U).toString(f);ge=ge.idivn(U),ge.isZero()?E=L+E:E=_[I-L.length]+L+E}for(this.isZero()&&(E="0"+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}a(!1,"Base should be between 2 and 36")},"toString4"),"toString"),c.prototype.toNumber=o(i(function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},"toNumber"),"toNumber"),c.prototype.toJSON=o(i(function(){return this.toString(16,2)},"toJSON2"),"toJSON"),l&&(c.prototype.toBuffer=o(i(function(f,m){return this.toArrayLike(l,f,m)},"toBuffer"),"toBuffer")),c.prototype.toArray=o(i(function(f,m){return this.toArrayLike(Array,f,m)},"toArray"),"toArray");var D=o(i(function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)},"allocate2"),"allocate");c.prototype.toArrayLike=o(i(function(f,m,E){this._strip();var R=this.byteLength(),C=E||Math.max(1,R);a(R<=C,"byte array longer than desired length"),a(C>0,"Requested array length <= 0");var A=D(f,C),B=m==="le"?"LE":"BE";return this["_toArrayLike"+B](A,R),A},"toArrayLike"),"toArrayLike"),c.prototype._toArrayLikeLE=o(i(function(f,m){for(var E=0,R=0,C=0,A=0;C<this.length;C++){var B=this.words[C]<<A|R;f[E++]=B&255,E<f.length&&(f[E++]=B>>8&255),E<f.length&&(f[E++]=B>>16&255),A===6?(E<f.length&&(f[E++]=B>>24&255),R=0,A=0):(R=B>>>24,A+=2)}if(E<f.length)for(f[E++]=R;E<f.length;)f[E++]=0},"_toArrayLikeLE"),"_toArrayLikeLE"),c.prototype._toArrayLikeBE=o(i(function(f,m){for(var E=f.length-1,R=0,C=0,A=0;C<this.length;C++){var B=this.words[C]<<A|R;f[E--]=B&255,E>=0&&(f[E--]=B>>8&255),E>=0&&(f[E--]=B>>16&255),A===6?(E>=0&&(f[E--]=B>>24&255),R=0,A=0):(R=B>>>24,A+=2)}if(E>=0)for(f[E--]=R;E>=0;)f[E--]=0},"_toArrayLikeBE"),"_toArrayLikeBE"),Math.clz32?c.prototype._countBits=o(i(function(f){return 32-Math.clz32(f)},"_countBits"),"_countBits"):c.prototype._countBits=o(i(function(f){var m=f,E=0;return m>=4096&&(E+=13,m>>>=13),m>=64&&(E+=7,m>>>=7),m>=8&&(E+=4,m>>>=4),m>=2&&(E+=2,m>>>=2),E+m},"_countBits"),"_countBits"),c.prototype._zeroBits=o(i(function(f){if(f===0)return 26;var m=f,E=0;return(m&8191)===0&&(E+=13,m>>>=13),(m&127)===0&&(E+=7,m>>>=7),(m&15)===0&&(E+=4,m>>>=4),(m&3)===0&&(E+=2,m>>>=2),(m&1)===0&&E++,E},"_zeroBits"),"_zeroBits"),c.prototype.bitLength=o(i(function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m},"bitLength"),"bitLength");function P(b){for(var f=new Array(b.bitLength()),m=0;m<f.length;m++){var E=m/26|0,R=m%26;f[m]=b.words[E]>>>R&1}return f}i(P,"toBitArray"),o(P,"toBitArray"),c.prototype.zeroBits=o(i(function(){if(this.isZero())return 0;for(var f=0,m=0;m<this.length;m++){var E=this._zeroBits(this.words[m]);if(f+=E,E!==26)break}return f},"zeroBits"),"zeroBits"),c.prototype.byteLength=o(i(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),"byteLength"),c.prototype.toTwos=o(i(function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},"toTwos"),"toTwos"),c.prototype.fromTwos=o(i(function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},"fromTwos"),"fromTwos"),c.prototype.isNeg=o(i(function(){return this.negative!==0},"isNeg"),"isNeg"),c.prototype.neg=o(i(function(){return this.clone().ineg()},"neg3"),"neg"),c.prototype.ineg=o(i(function(){return this.isZero()||(this.negative^=1),this},"ineg"),"ineg"),c.prototype.iuor=o(i(function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]|f.words[m];return this._strip()},"iuor"),"iuor"),c.prototype.ior=o(i(function(f){return a((this.negative|f.negative)===0),this.iuor(f)},"ior"),"ior"),c.prototype.or=o(i(function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},"or2"),"or"),c.prototype.uor=o(i(function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},"uor"),"uor"),c.prototype.iuand=o(i(function(f){var m;this.length>f.length?m=f:m=this;for(var E=0;E<m.length;E++)this.words[E]=this.words[E]&f.words[E];return this.length=m.length,this._strip()},"iuand"),"iuand"),c.prototype.iand=o(i(function(f){return a((this.negative|f.negative)===0),this.iuand(f)},"iand"),"iand"),c.prototype.and=o(i(function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},"and"),"and"),c.prototype.uand=o(i(function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},"uand"),"uand"),c.prototype.iuxor=o(i(function(f){var m,E;this.length>f.length?(m=this,E=f):(m=f,E=this);for(var R=0;R<E.length;R++)this.words[R]=m.words[R]^E.words[R];if(this!==m)for(;R<m.length;R++)this.words[R]=m.words[R];return this.length=m.length,this._strip()},"iuxor"),"iuxor"),c.prototype.ixor=o(i(function(f){return a((this.negative|f.negative)===0),this.iuxor(f)},"ixor"),"ixor"),c.prototype.xor=o(i(function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},"xor2"),"xor"),c.prototype.uxor=o(i(function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},"uxor"),"uxor"),c.prototype.inotn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,E=f%26;this._expand(m),E>0&&m--;for(var R=0;R<m;R++)this.words[R]=~this.words[R]&67108863;return E>0&&(this.words[R]=~this.words[R]&67108863>>26-E),this._strip()},"inotn"),"inotn"),c.prototype.notn=o(i(function(f){return this.clone().inotn(f)},"notn"),"notn"),c.prototype.setn=o(i(function(f,m){a(typeof f=="number"&&f>=0);var E=f/26|0,R=f%26;return this._expand(E+1),m?this.words[E]=this.words[E]|1<<R:this.words[E]=this.words[E]&~(1<<R),this._strip()},"setn"),"setn"),c.prototype.iadd=o(i(function(f){var m;if(this.negative!==0&&f.negative===0)return this.negative=0,m=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,m=this.isub(f),f.negative=1,m._normSign();var E,R;this.length>f.length?(E=this,R=f):(E=f,R=this);for(var C=0,A=0;A<R.length;A++)m=(E.words[A]|0)+(R.words[A]|0)+C,this.words[A]=m&67108863,C=m>>>26;for(;C!==0&&A<E.length;A++)m=(E.words[A]|0)+C,this.words[A]=m&67108863,C=m>>>26;if(this.length=E.length,C!==0)this.words[this.length]=C,this.length++;else if(E!==this)for(;A<E.length;A++)this.words[A]=E.words[A];return this},"iadd"),"iadd"),c.prototype.add=o(i(function(f){var m;return f.negative!==0&&this.negative===0?(f.negative=0,m=this.sub(f),f.negative^=1,m):f.negative===0&&this.negative!==0?(this.negative=0,m=f.sub(this),this.negative=1,m):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},"add3"),"add"),c.prototype.isub=o(i(function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var E=this.cmp(f);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var R,C;E>0?(R=this,C=f):(R=f,C=this);for(var A=0,B=0;B<C.length;B++)m=(R.words[B]|0)-(C.words[B]|0)+A,A=m>>26,this.words[B]=m&67108863;for(;A!==0&&B<R.length;B++)m=(R.words[B]|0)+A,A=m>>26,this.words[B]=m&67108863;if(A===0&&B<R.length&&R!==this)for(;B<R.length;B++)this.words[B]=R.words[B];return this.length=Math.max(this.length,B),R!==this&&(this.negative=1),this._strip()},"isub"),"isub"),c.prototype.sub=o(i(function(f){return this.clone().isub(f)},"sub"),"sub");function J(b,f,m){m.negative=f.negative^b.negative;var E=b.length+f.length|0;m.length=E,E=E-1|0;var R=b.words[0]|0,C=f.words[0]|0,A=R*C,B=A&67108863,V=A/67108864|0;m.words[0]=B;for(var I=1;I<E;I++){for(var U=V>>>26,ge=V&67108863,L=Math.min(I,f.length-1),ne=Math.max(0,I-b.length+1);ne<=L;ne++){var oe=I-ne|0;R=b.words[oe]|0,C=f.words[ne]|0,A=R*C+ge,U+=A/67108864|0,ge=A&67108863}m.words[I]=ge|0,V=U|0}return V!==0?m.words[I]=V|0:m.length--,m._strip()}i(J,"smallMulTo"),o(J,"smallMulTo");var j=o(i(function(f,m,E){var R=f.words,C=m.words,A=E.words,B=0,V,I,U,ge=R[0]|0,L=ge&8191,ne=ge>>>13,oe=R[1]|0,M=oe&8191,G=oe>>>13,ae=R[2]|0,fe=ae&8191,be=ae>>>13,Re=R[3]|0,X=Re&8191,N=Re>>>13,F=R[4]|0,W=F&8191,ie=F>>>13,ee=R[5]|0,ue=ee&8191,Ae=ee>>>13,De=R[6]|0,Ie=De&8191,Be=De>>>13,qe=R[7]|0,ve=qe&8191,pe=qe>>>13,re=R[8]|0,le=re&8191,_e=re>>>13,Te=R[9]|0,Ce=Te&8191,Oe=Te>>>13,Ct=C[0]|0,Ve=Ct&8191,He=Ct>>>13,Ot=C[1]|0,dt=Ot&8191,mt=Ot>>>13,Or=C[2]|0,ct=Or&8191,ut=Or>>>13,lr=C[3]|0,lt=lr&8191,nt=lr>>>13,or=C[4]|0,it=or&8191,Xe=or>>>13,Qt=C[5]|0,at=Qt&8191,et=Qt>>>13,sr=C[6]|0,ot=sr&8191,Ze=sr>>>13,cr=C[7]|0,st=cr&8191,Et=cr>>>13,Tn=C[8]|0,At=Tn&8191,yt=Tn>>>13,hn=C[9]|0,er=hn&8191,tr=hn>>>13;E.negative=f.negative^m.negative,E.length=19,V=Math.imul(L,Ve),I=Math.imul(L,He),I=I+Math.imul(ne,Ve)|0,U=Math.imul(ne,He);var nn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(nn>>>26)|0,nn&=67108863,V=Math.imul(M,Ve),I=Math.imul(M,He),I=I+Math.imul(G,Ve)|0,U=Math.imul(G,He),V=V+Math.imul(L,dt)|0,I=I+Math.imul(L,mt)|0,I=I+Math.imul(ne,dt)|0,U=U+Math.imul(ne,mt)|0;var an=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(an>>>26)|0,an&=67108863,V=Math.imul(fe,Ve),I=Math.imul(fe,He),I=I+Math.imul(be,Ve)|0,U=Math.imul(be,He),V=V+Math.imul(M,dt)|0,I=I+Math.imul(M,mt)|0,I=I+Math.imul(G,dt)|0,U=U+Math.imul(G,mt)|0,V=V+Math.imul(L,ct)|0,I=I+Math.imul(L,ut)|0,I=I+Math.imul(ne,ct)|0,U=U+Math.imul(ne,ut)|0;var Nr=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,V=Math.imul(X,Ve),I=Math.imul(X,He),I=I+Math.imul(N,Ve)|0,U=Math.imul(N,He),V=V+Math.imul(fe,dt)|0,I=I+Math.imul(fe,mt)|0,I=I+Math.imul(be,dt)|0,U=U+Math.imul(be,mt)|0,V=V+Math.imul(M,ct)|0,I=I+Math.imul(M,ut)|0,I=I+Math.imul(G,ct)|0,U=U+Math.imul(G,ut)|0,V=V+Math.imul(L,lt)|0,I=I+Math.imul(L,nt)|0,I=I+Math.imul(ne,lt)|0,U=U+Math.imul(ne,nt)|0;var Vr=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,V=Math.imul(W,Ve),I=Math.imul(W,He),I=I+Math.imul(ie,Ve)|0,U=Math.imul(ie,He),V=V+Math.imul(X,dt)|0,I=I+Math.imul(X,mt)|0,I=I+Math.imul(N,dt)|0,U=U+Math.imul(N,mt)|0,V=V+Math.imul(fe,ct)|0,I=I+Math.imul(fe,ut)|0,I=I+Math.imul(be,ct)|0,U=U+Math.imul(be,ut)|0,V=V+Math.imul(M,lt)|0,I=I+Math.imul(M,nt)|0,I=I+Math.imul(G,lt)|0,U=U+Math.imul(G,nt)|0,V=V+Math.imul(L,it)|0,I=I+Math.imul(L,Xe)|0,I=I+Math.imul(ne,it)|0,U=U+Math.imul(ne,Xe)|0;var on=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(on>>>26)|0,on&=67108863,V=Math.imul(ue,Ve),I=Math.imul(ue,He),I=I+Math.imul(Ae,Ve)|0,U=Math.imul(Ae,He),V=V+Math.imul(W,dt)|0,I=I+Math.imul(W,mt)|0,I=I+Math.imul(ie,dt)|0,U=U+Math.imul(ie,mt)|0,V=V+Math.imul(X,ct)|0,I=I+Math.imul(X,ut)|0,I=I+Math.imul(N,ct)|0,U=U+Math.imul(N,ut)|0,V=V+Math.imul(fe,lt)|0,I=I+Math.imul(fe,nt)|0,I=I+Math.imul(be,lt)|0,U=U+Math.imul(be,nt)|0,V=V+Math.imul(M,it)|0,I=I+Math.imul(M,Xe)|0,I=I+Math.imul(G,it)|0,U=U+Math.imul(G,Xe)|0,V=V+Math.imul(L,at)|0,I=I+Math.imul(L,et)|0,I=I+Math.imul(ne,at)|0,U=U+Math.imul(ne,et)|0;var Cn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,V=Math.imul(Ie,Ve),I=Math.imul(Ie,He),I=I+Math.imul(Be,Ve)|0,U=Math.imul(Be,He),V=V+Math.imul(ue,dt)|0,I=I+Math.imul(ue,mt)|0,I=I+Math.imul(Ae,dt)|0,U=U+Math.imul(Ae,mt)|0,V=V+Math.imul(W,ct)|0,I=I+Math.imul(W,ut)|0,I=I+Math.imul(ie,ct)|0,U=U+Math.imul(ie,ut)|0,V=V+Math.imul(X,lt)|0,I=I+Math.imul(X,nt)|0,I=I+Math.imul(N,lt)|0,U=U+Math.imul(N,nt)|0,V=V+Math.imul(fe,it)|0,I=I+Math.imul(fe,Xe)|0,I=I+Math.imul(be,it)|0,U=U+Math.imul(be,Xe)|0,V=V+Math.imul(M,at)|0,I=I+Math.imul(M,et)|0,I=I+Math.imul(G,at)|0,U=U+Math.imul(G,et)|0,V=V+Math.imul(L,ot)|0,I=I+Math.imul(L,Ze)|0,I=I+Math.imul(ne,ot)|0,U=U+Math.imul(ne,Ze)|0;var Ci=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,V=Math.imul(ve,Ve),I=Math.imul(ve,He),I=I+Math.imul(pe,Ve)|0,U=Math.imul(pe,He),V=V+Math.imul(Ie,dt)|0,I=I+Math.imul(Ie,mt)|0,I=I+Math.imul(Be,dt)|0,U=U+Math.imul(Be,mt)|0,V=V+Math.imul(ue,ct)|0,I=I+Math.imul(ue,ut)|0,I=I+Math.imul(Ae,ct)|0,U=U+Math.imul(Ae,ut)|0,V=V+Math.imul(W,lt)|0,I=I+Math.imul(W,nt)|0,I=I+Math.imul(ie,lt)|0,U=U+Math.imul(ie,nt)|0,V=V+Math.imul(X,it)|0,I=I+Math.imul(X,Xe)|0,I=I+Math.imul(N,it)|0,U=U+Math.imul(N,Xe)|0,V=V+Math.imul(fe,at)|0,I=I+Math.imul(fe,et)|0,I=I+Math.imul(be,at)|0,U=U+Math.imul(be,et)|0,V=V+Math.imul(M,ot)|0,I=I+Math.imul(M,Ze)|0,I=I+Math.imul(G,ot)|0,U=U+Math.imul(G,Ze)|0,V=V+Math.imul(L,st)|0,I=I+Math.imul(L,Et)|0,I=I+Math.imul(ne,st)|0,U=U+Math.imul(ne,Et)|0;var Mi=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,V=Math.imul(le,Ve),I=Math.imul(le,He),I=I+Math.imul(_e,Ve)|0,U=Math.imul(_e,He),V=V+Math.imul(ve,dt)|0,I=I+Math.imul(ve,mt)|0,I=I+Math.imul(pe,dt)|0,U=U+Math.imul(pe,mt)|0,V=V+Math.imul(Ie,ct)|0,I=I+Math.imul(Ie,ut)|0,I=I+Math.imul(Be,ct)|0,U=U+Math.imul(Be,ut)|0,V=V+Math.imul(ue,lt)|0,I=I+Math.imul(ue,nt)|0,I=I+Math.imul(Ae,lt)|0,U=U+Math.imul(Ae,nt)|0,V=V+Math.imul(W,it)|0,I=I+Math.imul(W,Xe)|0,I=I+Math.imul(ie,it)|0,U=U+Math.imul(ie,Xe)|0,V=V+Math.imul(X,at)|0,I=I+Math.imul(X,et)|0,I=I+Math.imul(N,at)|0,U=U+Math.imul(N,et)|0,V=V+Math.imul(fe,ot)|0,I=I+Math.imul(fe,Ze)|0,I=I+Math.imul(be,ot)|0,U=U+Math.imul(be,Ze)|0,V=V+Math.imul(M,st)|0,I=I+Math.imul(M,Et)|0,I=I+Math.imul(G,st)|0,U=U+Math.imul(G,Et)|0,V=V+Math.imul(L,At)|0,I=I+Math.imul(L,yt)|0,I=I+Math.imul(ne,At)|0,U=U+Math.imul(ne,yt)|0;var Ii=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,V=Math.imul(Ce,Ve),I=Math.imul(Ce,He),I=I+Math.imul(Oe,Ve)|0,U=Math.imul(Oe,He),V=V+Math.imul(le,dt)|0,I=I+Math.imul(le,mt)|0,I=I+Math.imul(_e,dt)|0,U=U+Math.imul(_e,mt)|0,V=V+Math.imul(ve,ct)|0,I=I+Math.imul(ve,ut)|0,I=I+Math.imul(pe,ct)|0,U=U+Math.imul(pe,ut)|0,V=V+Math.imul(Ie,lt)|0,I=I+Math.imul(Ie,nt)|0,I=I+Math.imul(Be,lt)|0,U=U+Math.imul(Be,nt)|0,V=V+Math.imul(ue,it)|0,I=I+Math.imul(ue,Xe)|0,I=I+Math.imul(Ae,it)|0,U=U+Math.imul(Ae,Xe)|0,V=V+Math.imul(W,at)|0,I=I+Math.imul(W,et)|0,I=I+Math.imul(ie,at)|0,U=U+Math.imul(ie,et)|0,V=V+Math.imul(X,ot)|0,I=I+Math.imul(X,Ze)|0,I=I+Math.imul(N,ot)|0,U=U+Math.imul(N,Ze)|0,V=V+Math.imul(fe,st)|0,I=I+Math.imul(fe,Et)|0,I=I+Math.imul(be,st)|0,U=U+Math.imul(be,Et)|0,V=V+Math.imul(M,At)|0,I=I+Math.imul(M,yt)|0,I=I+Math.imul(G,At)|0,U=U+Math.imul(G,yt)|0,V=V+Math.imul(L,er)|0,I=I+Math.imul(L,tr)|0,I=I+Math.imul(ne,er)|0,U=U+Math.imul(ne,tr)|0;var Ln=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,V=Math.imul(Ce,dt),I=Math.imul(Ce,mt),I=I+Math.imul(Oe,dt)|0,U=Math.imul(Oe,mt),V=V+Math.imul(le,ct)|0,I=I+Math.imul(le,ut)|0,I=I+Math.imul(_e,ct)|0,U=U+Math.imul(_e,ut)|0,V=V+Math.imul(ve,lt)|0,I=I+Math.imul(ve,nt)|0,I=I+Math.imul(pe,lt)|0,U=U+Math.imul(pe,nt)|0,V=V+Math.imul(Ie,it)|0,I=I+Math.imul(Ie,Xe)|0,I=I+Math.imul(Be,it)|0,U=U+Math.imul(Be,Xe)|0,V=V+Math.imul(ue,at)|0,I=I+Math.imul(ue,et)|0,I=I+Math.imul(Ae,at)|0,U=U+Math.imul(Ae,et)|0,V=V+Math.imul(W,ot)|0,I=I+Math.imul(W,Ze)|0,I=I+Math.imul(ie,ot)|0,U=U+Math.imul(ie,Ze)|0,V=V+Math.imul(X,st)|0,I=I+Math.imul(X,Et)|0,I=I+Math.imul(N,st)|0,U=U+Math.imul(N,Et)|0,V=V+Math.imul(fe,At)|0,I=I+Math.imul(fe,yt)|0,I=I+Math.imul(be,At)|0,U=U+Math.imul(be,yt)|0,V=V+Math.imul(M,er)|0,I=I+Math.imul(M,tr)|0,I=I+Math.imul(G,er)|0,U=U+Math.imul(G,tr)|0;var pn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(pn>>>26)|0,pn&=67108863,V=Math.imul(Ce,ct),I=Math.imul(Ce,ut),I=I+Math.imul(Oe,ct)|0,U=Math.imul(Oe,ut),V=V+Math.imul(le,lt)|0,I=I+Math.imul(le,nt)|0,I=I+Math.imul(_e,lt)|0,U=U+Math.imul(_e,nt)|0,V=V+Math.imul(ve,it)|0,I=I+Math.imul(ve,Xe)|0,I=I+Math.imul(pe,it)|0,U=U+Math.imul(pe,Xe)|0,V=V+Math.imul(Ie,at)|0,I=I+Math.imul(Ie,et)|0,I=I+Math.imul(Be,at)|0,U=U+Math.imul(Be,et)|0,V=V+Math.imul(ue,ot)|0,I=I+Math.imul(ue,Ze)|0,I=I+Math.imul(Ae,ot)|0,U=U+Math.imul(Ae,Ze)|0,V=V+Math.imul(W,st)|0,I=I+Math.imul(W,Et)|0,I=I+Math.imul(ie,st)|0,U=U+Math.imul(ie,Et)|0,V=V+Math.imul(X,At)|0,I=I+Math.imul(X,yt)|0,I=I+Math.imul(N,At)|0,U=U+Math.imul(N,yt)|0,V=V+Math.imul(fe,er)|0,I=I+Math.imul(fe,tr)|0,I=I+Math.imul(be,er)|0,U=U+Math.imul(be,tr)|0;var ri=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(ri>>>26)|0,ri&=67108863,V=Math.imul(Ce,lt),I=Math.imul(Ce,nt),I=I+Math.imul(Oe,lt)|0,U=Math.imul(Oe,nt),V=V+Math.imul(le,it)|0,I=I+Math.imul(le,Xe)|0,I=I+Math.imul(_e,it)|0,U=U+Math.imul(_e,Xe)|0,V=V+Math.imul(ve,at)|0,I=I+Math.imul(ve,et)|0,I=I+Math.imul(pe,at)|0,U=U+Math.imul(pe,et)|0,V=V+Math.imul(Ie,ot)|0,I=I+Math.imul(Ie,Ze)|0,I=I+Math.imul(Be,ot)|0,U=U+Math.imul(Be,Ze)|0,V=V+Math.imul(ue,st)|0,I=I+Math.imul(ue,Et)|0,I=I+Math.imul(Ae,st)|0,U=U+Math.imul(Ae,Et)|0,V=V+Math.imul(W,At)|0,I=I+Math.imul(W,yt)|0,I=I+Math.imul(ie,At)|0,U=U+Math.imul(ie,yt)|0,V=V+Math.imul(X,er)|0,I=I+Math.imul(X,tr)|0,I=I+Math.imul(N,er)|0,U=U+Math.imul(N,tr)|0;var Un=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Un>>>26)|0,Un&=67108863,V=Math.imul(Ce,it),I=Math.imul(Ce,Xe),I=I+Math.imul(Oe,it)|0,U=Math.imul(Oe,Xe),V=V+Math.imul(le,at)|0,I=I+Math.imul(le,et)|0,I=I+Math.imul(_e,at)|0,U=U+Math.imul(_e,et)|0,V=V+Math.imul(ve,ot)|0,I=I+Math.imul(ve,Ze)|0,I=I+Math.imul(pe,ot)|0,U=U+Math.imul(pe,Ze)|0,V=V+Math.imul(Ie,st)|0,I=I+Math.imul(Ie,Et)|0,I=I+Math.imul(Be,st)|0,U=U+Math.imul(Be,Et)|0,V=V+Math.imul(ue,At)|0,I=I+Math.imul(ue,yt)|0,I=I+Math.imul(Ae,At)|0,U=U+Math.imul(Ae,yt)|0,V=V+Math.imul(W,er)|0,I=I+Math.imul(W,tr)|0,I=I+Math.imul(ie,er)|0,U=U+Math.imul(ie,tr)|0;var ki=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(ki>>>26)|0,ki&=67108863,V=Math.imul(Ce,at),I=Math.imul(Ce,et),I=I+Math.imul(Oe,at)|0,U=Math.imul(Oe,et),V=V+Math.imul(le,ot)|0,I=I+Math.imul(le,Ze)|0,I=I+Math.imul(_e,ot)|0,U=U+Math.imul(_e,Ze)|0,V=V+Math.imul(ve,st)|0,I=I+Math.imul(ve,Et)|0,I=I+Math.imul(pe,st)|0,U=U+Math.imul(pe,Et)|0,V=V+Math.imul(Ie,At)|0,I=I+Math.imul(Ie,yt)|0,I=I+Math.imul(Be,At)|0,U=U+Math.imul(Be,yt)|0,V=V+Math.imul(ue,er)|0,I=I+Math.imul(ue,tr)|0,I=I+Math.imul(Ae,er)|0,U=U+Math.imul(Ae,tr)|0;var Di=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Di>>>26)|0,Di&=67108863,V=Math.imul(Ce,ot),I=Math.imul(Ce,Ze),I=I+Math.imul(Oe,ot)|0,U=Math.imul(Oe,Ze),V=V+Math.imul(le,st)|0,I=I+Math.imul(le,Et)|0,I=I+Math.imul(_e,st)|0,U=U+Math.imul(_e,Et)|0,V=V+Math.imul(ve,At)|0,I=I+Math.imul(ve,yt)|0,I=I+Math.imul(pe,At)|0,U=U+Math.imul(pe,yt)|0,V=V+Math.imul(Ie,er)|0,I=I+Math.imul(Ie,tr)|0,I=I+Math.imul(Be,er)|0,U=U+Math.imul(Be,tr)|0;var Ri=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ri>>>26)|0,Ri&=67108863,V=Math.imul(Ce,st),I=Math.imul(Ce,Et),I=I+Math.imul(Oe,st)|0,U=Math.imul(Oe,Et),V=V+Math.imul(le,At)|0,I=I+Math.imul(le,yt)|0,I=I+Math.imul(_e,At)|0,U=U+Math.imul(_e,yt)|0,V=V+Math.imul(ve,er)|0,I=I+Math.imul(ve,tr)|0,I=I+Math.imul(pe,er)|0,U=U+Math.imul(pe,tr)|0;var Qa=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Qa>>>26)|0,Qa&=67108863,V=Math.imul(Ce,At),I=Math.imul(Ce,yt),I=I+Math.imul(Oe,At)|0,U=Math.imul(Oe,yt),V=V+Math.imul(le,er)|0,I=I+Math.imul(le,tr)|0,I=I+Math.imul(_e,er)|0,U=U+Math.imul(_e,tr)|0;var eo=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(eo>>>26)|0,eo&=67108863,V=Math.imul(Ce,er),I=Math.imul(Ce,tr),I=I+Math.imul(Oe,er)|0,U=Math.imul(Oe,tr);var to=(B+V|0)+((I&8191)<<13)|0;return B=(U+(I>>>13)|0)+(to>>>26)|0,to&=67108863,A[0]=nn,A[1]=an,A[2]=Nr,A[3]=Vr,A[4]=on,A[5]=Cn,A[6]=Ci,A[7]=Mi,A[8]=Ii,A[9]=Ln,A[10]=pn,A[11]=ri,A[12]=Un,A[13]=ki,A[14]=Di,A[15]=Ri,A[16]=Qa,A[17]=eo,A[18]=to,B!==0&&(A[19]=B,E.length++),E},"comb10MulTo2"),"comb10MulTo");Math.imul||(j=J);function q(b,f,m){m.negative=f.negative^b.negative,m.length=b.length+f.length;for(var E=0,R=0,C=0;C<m.length-1;C++){var A=R;R=0;for(var B=E&67108863,V=Math.min(C,f.length-1),I=Math.max(0,C-b.length+1);I<=V;I++){var U=C-I,ge=b.words[U]|0,L=f.words[I]|0,ne=ge*L,oe=ne&67108863;A=A+(ne/67108864|0)|0,oe=oe+B|0,B=oe&67108863,A=A+(oe>>>26)|0,R+=A>>>26,A&=67108863}m.words[C]=B,E=A,A=R}return E!==0?m.words[C]=E:m.length--,m._strip()}i(q,"bigMulTo"),o(q,"bigMulTo");function Q(b,f,m){return q(b,f,m)}i(Q,"jumboMulTo"),o(Q,"jumboMulTo"),c.prototype.mulTo=o(i(function(f,m){var E,R=this.length+f.length;return this.length===10&&f.length===10?E=j(this,f,m):R<63?E=J(this,f,m):R<1024?E=q(this,f,m):E=Q(this,f,m),E},"mulTo"),"mulTo");function Y(b,f){this.x=b,this.y=f}i(Y,"FFTM"),o(Y,"FFTM"),Y.prototype.makeRBT=o(i(function(f){for(var m=new Array(f),E=c.prototype._countBits(f)-1,R=0;R<f;R++)m[R]=this.revBin(R,E,f);return m},"makeRBT"),"makeRBT"),Y.prototype.revBin=o(i(function(f,m,E){if(f===0||f===E-1)return f;for(var R=0,C=0;C<m;C++)R|=(f&1)<<m-C-1,f>>=1;return R},"revBin"),"revBin"),Y.prototype.permute=o(i(function(f,m,E,R,C,A){for(var B=0;B<A;B++)R[B]=m[f[B]],C[B]=E[f[B]]},"permute"),"permute"),Y.prototype.transform=o(i(function(f,m,E,R,C,A){this.permute(A,f,m,E,R,C);for(var B=1;B<C;B<<=1)for(var V=B<<1,I=Math.cos(2*Math.PI/V),U=Math.sin(2*Math.PI/V),ge=0;ge<C;ge+=V)for(var L=I,ne=U,oe=0;oe<B;oe++){var M=E[ge+oe],G=R[ge+oe],ae=E[ge+oe+B],fe=R[ge+oe+B],be=L*ae-ne*fe;fe=L*fe+ne*ae,ae=be,E[ge+oe]=M+ae,R[ge+oe]=G+fe,E[ge+oe+B]=M-ae,R[ge+oe+B]=G-fe,oe!==V&&(be=I*L-U*ne,ne=I*ne+U*L,L=be)}},"transform"),"transform"),Y.prototype.guessLen13b=o(i(function(f,m){var E=Math.max(m,f)|1,R=E&1,C=0;for(E=E/2|0;E;E=E>>>1)C++;return 1<<C+1+R},"guessLen13b"),"guessLen13b"),Y.prototype.conjugate=o(i(function(f,m,E){if(!(E<=1))for(var R=0;R<E/2;R++){var C=f[R];f[R]=f[E-R-1],f[E-R-1]=C,C=m[R],m[R]=-m[E-R-1],m[E-R-1]=-C}},"conjugate"),"conjugate"),Y.prototype.normalize13b=o(i(function(f,m){for(var E=0,R=0;R<m/2;R++){var C=Math.round(f[2*R+1]/m)*8192+Math.round(f[2*R]/m)+E;f[R]=C&67108863,C<67108864?E=0:E=C/67108864|0}return f},"normalize13b"),"normalize13b"),Y.prototype.convert13b=o(i(function(f,m,E,R){for(var C=0,A=0;A<m;A++)C=C+(f[A]|0),E[2*A]=C&8191,C=C>>>13,E[2*A+1]=C&8191,C=C>>>13;for(A=2*m;A<R;++A)E[A]=0;a(C===0),a((C&-8192)===0)},"convert13b"),"convert13b"),Y.prototype.stub=o(i(function(f){for(var m=new Array(f),E=0;E<f;E++)m[E]=0;return m},"stub"),"stub"),Y.prototype.mulp=o(i(function(f,m,E){var R=2*this.guessLen13b(f.length,m.length),C=this.makeRBT(R),A=this.stub(R),B=new Array(R),V=new Array(R),I=new Array(R),U=new Array(R),ge=new Array(R),L=new Array(R),ne=E.words;ne.length=R,this.convert13b(f.words,f.length,B,R),this.convert13b(m.words,m.length,U,R),this.transform(B,A,V,I,R,C),this.transform(U,A,ge,L,R,C);for(var oe=0;oe<R;oe++){var M=V[oe]*ge[oe]-I[oe]*L[oe];I[oe]=V[oe]*L[oe]+I[oe]*ge[oe],V[oe]=M}return this.conjugate(V,I,R),this.transform(V,I,ne,A,R,C),this.conjugate(ne,A,R),this.normalize13b(ne,R),E.negative=f.negative^m.negative,E.length=f.length+m.length,E._strip()},"mulp"),"mulp"),c.prototype.mul=o(i(function(f){var m=new c(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},"mul3"),"mul"),c.prototype.mulf=o(i(function(f){var m=new c(null);return m.words=new Array(this.length+f.length),Q(this,f,m)},"mulf"),"mulf"),c.prototype.imul=o(i(function(f){return this.clone().mulTo(f,this)},"imul"),"imul"),c.prototype.imuln=o(i(function(f){var m=f<0;m&&(f=-f),a(typeof f=="number"),a(f<67108864);for(var E=0,R=0;R<this.length;R++){var C=(this.words[R]|0)*f,A=(C&67108863)+(E&67108863);E>>=26,E+=C/67108864|0,E+=A>>>26,this.words[R]=A&67108863}return E!==0&&(this.words[R]=E,this.length++),m?this.ineg():this},"imuln"),"imuln"),c.prototype.muln=o(i(function(f){return this.clone().imuln(f)},"muln"),"muln"),c.prototype.sqr=o(i(function(){return this.mul(this)},"sqr"),"sqr"),c.prototype.isqr=o(i(function(){return this.imul(this.clone())},"isqr"),"isqr"),c.prototype.pow=o(i(function(f){var m=P(f);if(m.length===0)return new c(1);for(var E=this,R=0;R<m.length&&m[R]===0;R++,E=E.sqr());if(++R<m.length)for(var C=E.sqr();R<m.length;R++,C=C.sqr())m[R]!==0&&(E=E.mul(C));return E},"pow"),"pow"),c.prototype.iushln=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26,R=67108863>>>26-m<<26-m,C;if(m!==0){var A=0;for(C=0;C<this.length;C++){var B=this.words[C]&R,V=(this.words[C]|0)-B<<m;this.words[C]=V|A,A=B>>>26-m}A&&(this.words[C]=A,this.length++)}if(E!==0){for(C=this.length-1;C>=0;C--)this.words[C+E]=this.words[C];for(C=0;C<E;C++)this.words[C]=0;this.length+=E}return this._strip()},"iushln"),"iushln"),c.prototype.ishln=o(i(function(f){return a(this.negative===0),this.iushln(f)},"ishln"),"ishln"),c.prototype.iushrn=o(i(function(f,m,E){a(typeof f=="number"&&f>=0);var R;m?R=(m-m%26)/26:R=0;var C=f%26,A=Math.min((f-C)/26,this.length),B=67108863^67108863>>>C<<C,V=E;if(R-=A,R=Math.max(0,R),V){for(var I=0;I<A;I++)V.words[I]=this.words[I];V.length=A}if(A!==0)if(this.length>A)for(this.length-=A,I=0;I<this.length;I++)this.words[I]=this.words[I+A];else this.words[0]=0,this.length=1;var U=0;for(I=this.length-1;I>=0&&(U!==0||I>=R);I--){var ge=this.words[I]|0;this.words[I]=U<<26-C|ge>>>C,U=ge&B}return V&&U!==0&&(V.words[V.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),"iushrn"),c.prototype.ishrn=o(i(function(f,m,E){return a(this.negative===0),this.iushrn(f,m,E)},"ishrn"),"ishrn"),c.prototype.shln=o(i(function(f){return this.clone().ishln(f)},"shln"),"shln"),c.prototype.ushln=o(i(function(f){return this.clone().iushln(f)},"ushln"),"ushln"),c.prototype.shrn=o(i(function(f){return this.clone().ishrn(f)},"shrn"),"shrn"),c.prototype.ushrn=o(i(function(f){return this.clone().iushrn(f)},"ushrn"),"ushrn"),c.prototype.testn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26,R=1<<m;if(this.length<=E)return!1;var C=this.words[E];return!!(C&R)},"testn"),"testn"),c.prototype.imaskn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(m!==0&&E++,this.length=Math.min(E,this.length),m!==0){var R=67108863^67108863>>>m<<m;this.words[this.length-1]&=R}return this._strip()},"imaskn"),"imaskn"),c.prototype.maskn=o(i(function(f){return this.clone().imaskn(f)},"maskn"),"maskn"),c.prototype.iaddn=o(i(function(f){return a(typeof f=="number"),a(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},"iaddn"),"iaddn"),c.prototype._iaddn=o(i(function(f){this.words[0]+=f;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},"_iaddn"),"_iaddn"),c.prototype.isubn=o(i(function(f){if(a(typeof f=="number"),a(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},"isubn"),"isubn"),c.prototype.addn=o(i(function(f){return this.clone().iaddn(f)},"addn"),"addn"),c.prototype.subn=o(i(function(f){return this.clone().isubn(f)},"subn"),"subn"),c.prototype.iabs=o(i(function(){return this.negative=0,this},"iabs"),"iabs"),c.prototype.abs=o(i(function(){return this.clone().iabs()},"abs"),"abs"),c.prototype._ishlnsubmul=o(i(function(f,m,E){var R=f.length+E,C;this._expand(R);var A,B=0;for(C=0;C<f.length;C++){A=(this.words[C+E]|0)+B;var V=(f.words[C]|0)*m;A-=V&67108863,B=(A>>26)-(V/67108864|0),this.words[C+E]=A&67108863}for(;C<this.length-E;C++)A=(this.words[C+E]|0)+B,B=A>>26,this.words[C+E]=A&67108863;if(B===0)return this._strip();for(a(B===-1),B=0,C=0;C<this.length;C++)A=-(this.words[C]|0)+B,B=A>>26,this.words[C]=A&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),"_ishlnsubmul"),c.prototype._wordDiv=o(i(function(f,m){var E=this.length-f.length,R=this.clone(),C=f,A=C.words[C.length-1]|0,B=this._countBits(A);E=26-B,E!==0&&(C=C.ushln(E),R.iushln(E),A=C.words[C.length-1]|0);var V=R.length-C.length,I;if(m!=="mod"){I=new c(null),I.length=V+1,I.words=new Array(I.length);for(var U=0;U<I.length;U++)I.words[U]=0}var ge=R.clone()._ishlnsubmul(C,1,V);ge.negative===0&&(R=ge,I&&(I.words[V]=1));for(var L=V-1;L>=0;L--){var ne=(R.words[C.length+L]|0)*67108864+(R.words[C.length+L-1]|0);for(ne=Math.min(ne/A|0,67108863),R._ishlnsubmul(C,ne,L);R.negative!==0;)ne--,R.negative=0,R._ishlnsubmul(C,1,L),R.isZero()||(R.negative^=1);I&&(I.words[L]=ne)}return I&&I._strip(),R._strip(),m!=="div"&&E!==0&&R.iushrn(E),{div:I||null,mod:R}},"_wordDiv"),"_wordDiv"),c.prototype.divmod=o(i(function(f,m,E){if(a(!f.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var R,C,A;return this.negative!==0&&f.negative===0?(A=this.neg().divmod(f,m),m!=="mod"&&(R=A.div.neg()),m!=="div"&&(C=A.mod.neg(),E&&C.negative!==0&&C.iadd(f)),{div:R,mod:C}):this.negative===0&&f.negative!==0?(A=this.divmod(f.neg(),m),m!=="mod"&&(R=A.div.neg()),{div:R,mod:A.mod}):(this.negative&f.negative)!==0?(A=this.neg().divmod(f.neg(),m),m!=="div"&&(C=A.mod.neg(),E&&C.negative!==0&&C.isub(f)),{div:A.div,mod:C}):f.length>this.length||this.cmp(f)<0?{div:new c(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new c(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new c(this.modrn(f.words[0]))}:this._wordDiv(f,m)},"divmod"),"divmod"),c.prototype.div=o(i(function(f){return this.divmod(f,"div",!1).div},"div"),"div"),c.prototype.mod=o(i(function(f){return this.divmod(f,"mod",!1).mod},"mod2"),"mod"),c.prototype.umod=o(i(function(f){return this.divmod(f,"mod",!0).mod},"umod"),"umod"),c.prototype.divRound=o(i(function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var E=m.div.negative!==0?m.mod.isub(f):m.mod,R=f.ushrn(1),C=f.andln(1),A=E.cmp(R);return A<0||C===1&&A===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},"divRound"),"divRound"),c.prototype.modrn=o(i(function(f){var m=f<0;m&&(f=-f),a(f<=67108863);for(var E=(1<<26)%f,R=0,C=this.length-1;C>=0;C--)R=(E*R+(this.words[C]|0))%f;return m?-R:R},"modrn"),"modrn"),c.prototype.modn=o(i(function(f){return this.modrn(f)},"modn"),"modn"),c.prototype.idivn=o(i(function(f){var m=f<0;m&&(f=-f),a(f<=67108863);for(var E=0,R=this.length-1;R>=0;R--){var C=(this.words[R]|0)+E*67108864;this.words[R]=C/f|0,E=C%f}return this._strip(),m?this.ineg():this},"idivn"),"idivn"),c.prototype.divn=o(i(function(f){return this.clone().idivn(f)},"divn"),"divn"),c.prototype.egcd=o(i(function(f){a(f.negative===0),a(!f.isZero());var m=this,E=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var R=new c(1),C=new c(0),A=new c(0),B=new c(1),V=0;m.isEven()&&E.isEven();)m.iushrn(1),E.iushrn(1),++V;for(var I=E.clone(),U=m.clone();!m.isZero();){for(var ge=0,L=1;(m.words[0]&L)===0&&ge<26;++ge,L<<=1);if(ge>0)for(m.iushrn(ge);ge-- >0;)(R.isOdd()||C.isOdd())&&(R.iadd(I),C.isub(U)),R.iushrn(1),C.iushrn(1);for(var ne=0,oe=1;(E.words[0]&oe)===0&&ne<26;++ne,oe<<=1);if(ne>0)for(E.iushrn(ne);ne-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(I),B.isub(U)),A.iushrn(1),B.iushrn(1);m.cmp(E)>=0?(m.isub(E),R.isub(A),C.isub(B)):(E.isub(m),A.isub(R),B.isub(C))}return{a:A,b:B,gcd:E.iushln(V)}},"egcd"),"egcd"),c.prototype._invmp=o(i(function(f){a(f.negative===0),a(!f.isZero());var m=this,E=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var R=new c(1),C=new c(0),A=E.clone();m.cmpn(1)>0&&E.cmpn(1)>0;){for(var B=0,V=1;(m.words[0]&V)===0&&B<26;++B,V<<=1);if(B>0)for(m.iushrn(B);B-- >0;)R.isOdd()&&R.iadd(A),R.iushrn(1);for(var I=0,U=1;(E.words[0]&U)===0&&I<26;++I,U<<=1);if(I>0)for(E.iushrn(I);I-- >0;)C.isOdd()&&C.iadd(A),C.iushrn(1);m.cmp(E)>=0?(m.isub(E),R.isub(C)):(E.isub(m),C.isub(R))}var ge;return m.cmpn(1)===0?ge=R:ge=C,ge.cmpn(0)<0&&ge.iadd(f),ge},"_invmp"),"_invmp"),c.prototype.gcd=o(i(function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),E=f.clone();m.negative=0,E.negative=0;for(var R=0;m.isEven()&&E.isEven();R++)m.iushrn(1),E.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;E.isEven();)E.iushrn(1);var C=m.cmp(E);if(C<0){var A=m;m=E,E=A}else if(C===0||E.cmpn(1)===0)break;m.isub(E)}while(!0);return E.iushln(R)},"gcd"),"gcd"),c.prototype.invm=o(i(function(f){return this.egcd(f).a.umod(f)},"invm"),"invm"),c.prototype.isEven=o(i(function(){return(this.words[0]&1)===0},"isEven"),"isEven"),c.prototype.isOdd=o(i(function(){return(this.words[0]&1)===1},"isOdd"),"isOdd"),c.prototype.andln=o(i(function(f){return this.words[0]&f},"andln"),"andln"),c.prototype.bincn=o(i(function(f){a(typeof f=="number");var m=f%26,E=(f-m)/26,R=1<<m;if(this.length<=E)return this._expand(E+1),this.words[E]|=R,this;for(var C=R,A=E;C!==0&&A<this.length;A++){var B=this.words[A]|0;B+=C,C=B>>>26,B&=67108863,this.words[A]=B}return C!==0&&(this.words[A]=C,this.length++),this},"bincn"),"bincn"),c.prototype.isZero=o(i(function(){return this.length===1&&this.words[0]===0},"isZero"),"isZero"),c.prototype.cmpn=o(i(function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var E;if(this.length>1)E=1;else{m&&(f=-f),a(f<=67108863,"Number is too big");var R=this.words[0]|0;E=R===f?0:R<f?-1:1}return this.negative!==0?-E|0:E},"cmpn"),"cmpn"),c.prototype.cmp=o(i(function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var m=this.ucmp(f);return this.negative!==0?-m|0:m},"cmp"),"cmp"),c.prototype.ucmp=o(i(function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var m=0,E=this.length-1;E>=0;E--){var R=this.words[E]|0,C=f.words[E]|0;if(R!==C){R<C?m=-1:R>C&&(m=1);break}}return m},"ucmp"),"ucmp"),c.prototype.gtn=o(i(function(f){return this.cmpn(f)===1},"gtn"),"gtn"),c.prototype.gt=o(i(function(f){return this.cmp(f)===1},"gt"),"gt"),c.prototype.gten=o(i(function(f){return this.cmpn(f)>=0},"gten"),"gten"),c.prototype.gte=o(i(function(f){return this.cmp(f)>=0},"gte"),"gte"),c.prototype.ltn=o(i(function(f){return this.cmpn(f)===-1},"ltn"),"ltn"),c.prototype.lt=o(i(function(f){return this.cmp(f)===-1},"lt"),"lt"),c.prototype.lten=o(i(function(f){return this.cmpn(f)<=0},"lten"),"lten"),c.prototype.lte=o(i(function(f){return this.cmp(f)<=0},"lte"),"lte"),c.prototype.eqn=o(i(function(f){return this.cmpn(f)===0},"eqn"),"eqn"),c.prototype.eq=o(i(function(f){return this.cmp(f)===0},"eq4"),"eq"),c.red=o(i(function(f){return new w(f)},"red"),"red"),c.prototype.toRed=o(i(function(f){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},"toRed"),"toRed"),c.prototype.fromRed=o(i(function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),"fromRed"),c.prototype._forceRed=o(i(function(f){return this.red=f,this},"_forceRed"),"_forceRed"),c.prototype.forceRed=o(i(function(f){return a(!this.red,"Already a number in reduction context"),this._forceRed(f)},"forceRed"),"forceRed"),c.prototype.redAdd=o(i(function(f){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},"redAdd"),"redAdd"),c.prototype.redIAdd=o(i(function(f){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},"redIAdd"),"redIAdd"),c.prototype.redSub=o(i(function(f){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},"redSub"),"redSub"),c.prototype.redISub=o(i(function(f){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},"redISub"),"redISub"),c.prototype.redShl=o(i(function(f){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},"redShl"),"redShl"),c.prototype.redMul=o(i(function(f){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},"redMul"),"redMul"),c.prototype.redIMul=o(i(function(f){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},"redIMul"),"redIMul"),c.prototype.redSqr=o(i(function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),"redSqr"),c.prototype.redISqr=o(i(function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),"redISqr"),c.prototype.redSqrt=o(i(function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),"redSqrt"),c.prototype.redInvm=o(i(function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),"redInvm"),c.prototype.redNeg=o(i(function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),"redNeg"),c.prototype.redPow=o(i(function(f){return a(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)},"redPow"),"redPow");var k={k256:null,p224:null,p192:null,p25519:null};function K(b,f){this.name=b,this.p=new c(f,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}i(K,"MPrime"),o(K,"MPrime"),K.prototype._tmp=o(i(function(){var f=new c(null);return f.words=new Array(Math.ceil(this.n/13)),f},"_tmp"),"_tmp"),K.prototype.ireduce=o(i(function(f){var m=f,E;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),E=m.bitLength();while(E>this.n);var R=E<this.n?-1:m.ucmp(this.p);return R===0?(m.words[0]=0,m.length=1):R>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),"ireduce"),K.prototype.split=o(i(function(f,m){f.iushrn(this.n,0,m)},"split"),"split"),K.prototype.imulK=o(i(function(f){return f.imul(this.k)},"imulK"),"imulK");function he(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(he,"K256"),o(he,"K256"),s(he,K),he.prototype.split=o(i(function(f,m){for(var E=4194303,R=Math.min(f.length,9),C=0;C<R;C++)m.words[C]=f.words[C];if(m.length=R,f.length<=9){f.words[0]=0,f.length=1;return}var A=f.words[9];for(m.words[m.length++]=A&E,C=10;C<f.length;C++){var B=f.words[C]|0;f.words[C-10]=(B&E)<<4|A>>>22,A=B}A>>>=22,f.words[C-10]=A,A===0&&f.length>10?f.length-=10:f.length-=9},"split"),"split"),he.prototype.imulK=o(i(function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,E=0;E<f.length;E++){var R=f.words[E]|0;m+=R*977,f.words[E]=m&67108863,m=R*64+(m/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f},"imulK"),"imulK");function me(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(me,"P224"),o(me,"P224"),s(me,K);function we(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(we,"P192"),o(we,"P192"),s(we,K);function Z(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Z,"P25519"),o(Z,"P25519"),s(Z,K),Z.prototype.imulK=o(i(function(f){for(var m=0,E=0;E<f.length;E++){var R=(f.words[E]|0)*19+m,C=R&67108863;R>>>=26,f.words[E]=C,m=R}return m!==0&&(f.words[f.length++]=m),f},"imulK"),"imulK"),c._prime=o(i(function(f){if(k[f])return k[f];var m;if(f==="k256")m=new he;else if(f==="p224")m=new me;else if(f==="p192")m=new we;else if(f==="p25519")m=new Z;else throw new Error("Unknown prime "+f);return k[f]=m,m},"prime"),"prime");function w(b){if(typeof b=="string"){var f=c._prime(b);this.m=f.p,this.prime=f}else a(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}i(w,"Red"),o(w,"Red"),w.prototype._verify1=o(i(function(f){a(f.negative===0,"red works only with positives"),a(f.red,"red works only with red numbers")},"_verify1"),"_verify1"),w.prototype._verify2=o(i(function(f,m){a((f.negative|m.negative)===0,"red works only with positives"),a(f.red&&f.red===m.red,"red works only with red numbers")},"_verify2"),"_verify2"),w.prototype.imod=o(i(function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(v(f,f.umod(this.m)._forceRed(this)),f)},"imod"),"imod"),w.prototype.neg=o(i(function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},"neg3"),"neg"),w.prototype.add=o(i(function(f,m){this._verify2(f,m);var E=f.add(m);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},"add3"),"add"),w.prototype.iadd=o(i(function(f,m){this._verify2(f,m);var E=f.iadd(m);return E.cmp(this.m)>=0&&E.isub(this.m),E},"iadd"),"iadd"),w.prototype.sub=o(i(function(f,m){this._verify2(f,m);var E=f.sub(m);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},"sub"),"sub"),w.prototype.isub=o(i(function(f,m){this._verify2(f,m);var E=f.isub(m);return E.cmpn(0)<0&&E.iadd(this.m),E},"isub"),"isub"),w.prototype.shl=o(i(function(f,m){return this._verify1(f),this.imod(f.ushln(m))},"shl"),"shl"),w.prototype.imul=o(i(function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},"imul"),"imul"),w.prototype.mul=o(i(function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},"mul3"),"mul"),w.prototype.isqr=o(i(function(f){return this.imul(f,f.clone())},"isqr"),"isqr"),w.prototype.sqr=o(i(function(f){return this.mul(f,f)},"sqr"),"sqr"),w.prototype.sqrt=o(i(function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(a(m%2===1),m===3){var E=this.m.add(new c(1)).iushrn(2);return this.pow(f,E)}for(var R=this.m.subn(1),C=0;!R.isZero()&&R.andln(1)===0;)C++,R.iushrn(1);a(!R.isZero());var A=new c(1).toRed(this),B=A.redNeg(),V=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new c(2*I*I).toRed(this);this.pow(I,V).cmp(B)!==0;)I.redIAdd(B);for(var U=this.pow(I,R),ge=this.pow(f,R.addn(1).iushrn(1)),L=this.pow(f,R),ne=C;L.cmp(A)!==0;){for(var oe=L,M=0;oe.cmp(A)!==0;M++)oe=oe.redSqr();a(M<ne);var G=this.pow(U,new c(1).iushln(ne-M-1));ge=ge.redMul(G),U=G.redSqr(),L=L.redMul(U),ne=M}return ge},"sqrt"),"sqrt"),w.prototype.invm=o(i(function(f){var m=f._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},"invm"),"invm"),w.prototype.pow=o(i(function(f,m){if(m.isZero())return new c(1).toRed(this);if(m.cmpn(1)===0)return f.clone();var E=4,R=new Array(1<<E);R[0]=new c(1).toRed(this),R[1]=f;for(var C=2;C<R.length;C++)R[C]=this.mul(R[C-1],f);var A=R[0],B=0,V=0,I=m.bitLength()%26;for(I===0&&(I=26),C=m.length-1;C>=0;C--){for(var U=m.words[C],ge=I-1;ge>=0;ge--){var L=U>>ge&1;if(A!==R[0]&&(A=this.sqr(A)),L===0&&B===0){V=0;continue}B<<=1,B|=L,V++,!(V!==E&&(C!==0||ge!==0))&&(A=this.mul(A,R[B]),V=0,B=0)}I=26}return A},"pow"),"pow"),w.prototype.convertTo=o(i(function(f){var m=f.umod(this.m);return m===f?m.clone():m},"convertTo"),"convertTo"),w.prototype.convertFrom=o(i(function(f){var m=f.clone();return m.red=null,m},"convertFrom"),"convertFrom"),c.mont=o(i(function(f){return new T(f)},"mont"),"mont");function T(b){w.call(this,b),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"),o(T,"Mont"),s(T,w),T.prototype.convertTo=o(i(function(f){return this.imod(f.ushln(this.shift))},"convertTo"),"convertTo"),T.prototype.convertFrom=o(i(function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},"convertFrom"),"convertFrom"),T.prototype.imul=o(i(function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var E=f.imul(m),R=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(R).iushrn(this.shift),A=C;return C.cmp(this.m)>=0?A=C.isub(this.m):C.cmpn(0)<0&&(A=C.iadd(this.m)),A._forceRed(this)},"imul"),"imul"),T.prototype.mul=o(i(function(f,m){if(f.isZero()||m.isZero())return new c(0)._forceRed(this);var E=f.mul(m),R=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(R).iushrn(this.shift),A=C;return C.cmp(this.m)>=0?A=C.isub(this.m):C.cmpn(0)<0&&(A=C.iadd(this.m)),A._forceRed(this)},"mul3"),"mul"),T.prototype.invm=o(i(function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm"),"invm")})(typeof t>"u"||t,e)}}),x$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,a=~n,s=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 g=p;l>=s;)h[p++]=l&255|r,l/=128;for(;l&a;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-g+1,h}i(c,"encode9"),o(c,"encode")}}),T$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){t.exports=a;var r=128,n=127;function a(s,h){var l=0,h=h||0,p=0,g=h,v,y=s.length;do{if(g>=y||p>49)throw a.bytes=0,new RangeError("Could not decode varint");v=s[g++],l+=p<28?(v&n)<<p:(v&n)*Math.pow(2,p),p+=7}while(v>=r);return a.bytes=g-h,l}i(a,"read2"),o(a,"read")}}),C$=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),a=Math.pow(2,21),s=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),g=Math.pow(2,63);t.exports=function(v){return v<r?1:v<n?2:v<a?3:v<s?4:v<c?5:v<l?6:v<h?7:v<p?8:v<g?9:10}}}),xm=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){t.exports={encode:x$(),decode:T$(),encodingLength:C$()}}}),M$=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 a=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(l){return function(h){return function(p,g){var v={key:p,value:h[p]},y={key:g,value:h[g]};return l(v,y)}}}(n.cmp),c=[];return o(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,g;if(Array.isArray(h)){for(g="[",p=0;p<h.length;p++)p&&(g+=","),g+=l(h[p])||"null";return g+"]"}if(h===null)return"null";if(c.indexOf(h)!==-1){if(a)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var v=c.push(h)-1,y=Object.keys(h).sort(s&&s(h));for(g="",p=0;p<y.length;p++){var _=y[p],x=l(h[_]);!x||(g&&(g+=","),g+=JSON.stringify(_)+":"+x)}return c.splice(v,1),"{"+g+"}"}},"stringify2"),"stringify")(r)}}}),Sd=ze({"../../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js"(e,t){var r=200,n="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object Boolean]",h="[object Date]",p="[object Error]",g="[object Function]",v="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",O="[object Promise]",D="[object RegExp]",P="[object Set]",J="[object String]",j="[object Symbol]",q="[object WeakMap]",Q="[object ArrayBuffer]",Y="[object DataView]",k="[object Float32Array]",K="[object Float64Array]",he="[object Int8Array]",me="[object Int16Array]",we="[object Int32Array]",Z="[object Uint8Array]",w="[object Uint8ClampedArray]",T="[object Uint16Array]",b="[object Uint32Array]",f=/[\\^$.*+?()[\]{}|]/g,m=/\w*$/,E=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,C={};C[s]=C[c]=C[Q]=C[Y]=C[l]=C[h]=C[k]=C[K]=C[he]=C[me]=C[we]=C[y]=C[_]=C[x]=C[D]=C[P]=C[J]=C[j]=C[Z]=C[w]=C[T]=C[b]=!0,C[p]=C[g]=C[q]=!1;var A=typeof global=="object"&&global&&global.Object===Object&&global,B=typeof self=="object"&&self&&self.Object===Object&&self,V=A||B||Function("return this")(),I=typeof e=="object"&&e&&!e.nodeType&&e,U=I&&typeof t=="object"&&t&&!t.nodeType&&t,ge=U&&U.exports===I;function L(de,Me){return de.set(Me[0],Me[1]),de}i(L,"addMapEntry"),o(L,"addMapEntry");function ne(de,Me){return de.add(Me),de}i(ne,"addSetEntry"),o(ne,"addSetEntry");function oe(de,Me){for(var Le=-1,ht=de?de.length:0;++Le<ht&&Me(de[Le],Le,de)!==!1;);return de}i(oe,"arrayEach"),o(oe,"arrayEach");function M(de,Me){for(var Le=-1,ht=Me.length,Kr=de.length;++Le<ht;)de[Kr+Le]=Me[Le];return de}i(M,"arrayPush"),o(M,"arrayPush");function G(de,Me,Le,ht){var Kr=-1,sn=de?de.length:0;for(ht&&sn&&(Le=de[++Kr]);++Kr<sn;)Le=Me(Le,de[Kr],Kr,de);return Le}i(G,"arrayReduce"),o(G,"arrayReduce");function ae(de,Me){for(var Le=-1,ht=Array(de);++Le<de;)ht[Le]=Me(Le);return ht}i(ae,"baseTimes"),o(ae,"baseTimes");function fe(de,Me){return de?.[Me]}i(fe,"getValue"),o(fe,"getValue");function be(de){var Me=!1;if(de!=null&&typeof de.toString!="function")try{Me=!!(de+"")}catch{}return Me}i(be,"isHostObject"),o(be,"isHostObject");function Re(de){var Me=-1,Le=Array(de.size);return de.forEach(function(ht,Kr){Le[++Me]=[Kr,ht]}),Le}i(Re,"mapToArray"),o(Re,"mapToArray");function X(de,Me){return function(Le){return de(Me(Le))}}i(X,"overArg"),o(X,"overArg");function N(de){var Me=-1,Le=Array(de.size);return de.forEach(function(ht){Le[++Me]=ht}),Le}i(N,"setToArray"),o(N,"setToArray");var F=Array.prototype,W=Function.prototype,ie=Object.prototype,ee=V["__core-js_shared__"],ue=function(){var de=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||"");return de?"Symbol(src)_1."+de:""}(),Ae=W.toString,De=ie.hasOwnProperty,Ie=ie.toString,Be=RegExp("^"+Ae.call(De).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=ge?V.Buffer:void 0,ve=V.Symbol,pe=V.Uint8Array,re=X(Object.getPrototypeOf,Object),le=Object.create,_e=ie.propertyIsEnumerable,Te=F.splice,Ce=Object.getOwnPropertySymbols,Oe=qe?qe.isBuffer:void 0,Ct=X(Object.keys,Object),Ve=Zi(V,"DataView"),He=Zi(V,"Map"),Ot=Zi(V,"Promise"),dt=Zi(V,"Set"),mt=Zi(V,"WeakMap"),Or=Zi(Object,"create"),ct=wa(Ve),ut=wa(He),lr=wa(Ot),lt=wa(dt),nt=wa(mt),or=ve?ve.prototype:void 0,it=or?or.valueOf:void 0;function Xe(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(Xe,"Hash"),o(Xe,"Hash");function Qt(){this.__data__=Or?Or(null):{}}i(Qt,"hashClear"),o(Qt,"hashClear");function at(de){return this.has(de)&&delete this.__data__[de]}i(at,"hashDelete"),o(at,"hashDelete");function et(de){var Me=this.__data__;if(Or){var Le=Me[de];return Le===n?void 0:Le}return De.call(Me,de)?Me[de]:void 0}i(et,"hashGet"),o(et,"hashGet");function sr(de){var Me=this.__data__;return Or?Me[de]!==void 0:De.call(Me,de)}i(sr,"hashHas"),o(sr,"hashHas");function ot(de,Me){var Le=this.__data__;return Le[de]=Or&&Me===void 0?n:Me,this}i(ot,"hashSet"),o(ot,"hashSet"),Xe.prototype.clear=Qt,Xe.prototype.delete=at,Xe.prototype.get=et,Xe.prototype.has=sr,Xe.prototype.set=ot;function Ze(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(Ze,"ListCache"),o(Ze,"ListCache");function cr(){this.__data__=[]}i(cr,"listCacheClear"),o(cr,"listCacheClear");function st(de){var Me=this.__data__,Le=pn(Me,de);if(Le<0)return!1;var ht=Me.length-1;return Le==ht?Me.pop():Te.call(Me,Le,1),!0}i(st,"listCacheDelete"),o(st,"listCacheDelete");function Et(de){var Me=this.__data__,Le=pn(Me,de);return Le<0?void 0:Me[Le][1]}i(Et,"listCacheGet"),o(Et,"listCacheGet");function Tn(de){return pn(this.__data__,de)>-1}i(Tn,"listCacheHas"),o(Tn,"listCacheHas");function At(de,Me){var Le=this.__data__,ht=pn(Le,de);return ht<0?Le.push([de,Me]):Le[ht][1]=Me,this}i(At,"listCacheSet"),o(At,"listCacheSet"),Ze.prototype.clear=cr,Ze.prototype.delete=st,Ze.prototype.get=Et,Ze.prototype.has=Tn,Ze.prototype.set=At;function yt(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(yt,"MapCache"),o(yt,"MapCache");function hn(){this.__data__={hash:new Xe,map:new(He||Ze),string:new Xe}}i(hn,"mapCacheClear"),o(hn,"mapCacheClear");function er(de){return ro(this,de).delete(de)}i(er,"mapCacheDelete"),o(er,"mapCacheDelete");function tr(de){return ro(this,de).get(de)}i(tr,"mapCacheGet"),o(tr,"mapCacheGet");function nn(de){return ro(this,de).has(de)}i(nn,"mapCacheHas"),o(nn,"mapCacheHas");function an(de,Me){return ro(this,de).set(de,Me),this}i(an,"mapCacheSet"),o(an,"mapCacheSet"),yt.prototype.clear=hn,yt.prototype.delete=er,yt.prototype.get=tr,yt.prototype.has=nn,yt.prototype.set=an;function Nr(de){this.__data__=new Ze(de)}i(Nr,"Stack"),o(Nr,"Stack");function Vr(){this.__data__=new Ze}i(Vr,"stackClear"),o(Vr,"stackClear");function on(de){return this.__data__.delete(de)}i(on,"stackDelete"),o(on,"stackDelete");function Cn(de){return this.__data__.get(de)}i(Cn,"stackGet"),o(Cn,"stackGet");function Ci(de){return this.__data__.has(de)}i(Ci,"stackHas"),o(Ci,"stackHas");function Mi(de,Me){var Le=this.__data__;if(Le instanceof Ze){var ht=Le.__data__;if(!He||ht.length<r-1)return ht.push([de,Me]),this;Le=this.__data__=new yt(ht)}return Le.set(de,Me),this}i(Mi,"stackSet"),o(Mi,"stackSet"),Nr.prototype.clear=Vr,Nr.prototype.delete=on,Nr.prototype.get=Cn,Nr.prototype.has=Ci,Nr.prototype.set=Mi;function Ii(de,Me){var Le=Rl(de)||jd(de)?ae(de.length,String):[],ht=Le.length,Kr=!!ht;for(var sn in de)(Me||De.call(de,sn))&&!(Kr&&(sn=="length"||Ml(sn,ht)))&&Le.push(sn);return Le}i(Ii,"arrayLikeKeys"),o(Ii,"arrayLikeKeys");function Ln(de,Me,Le){var ht=de[Me];(!(De.call(de,Me)&&qc(ht,Le))||Le===void 0&&!(Me in de))&&(de[Me]=Le)}i(Ln,"assignValue"),o(Ln,"assignValue");function pn(de,Me){for(var Le=de.length;Le--;)if(qc(de[Le][0],Me))return Le;return-1}i(pn,"assocIndexOf"),o(pn,"assocIndexOf");function ri(de,Me){return de&&Ds(Me,Vc(Me),de)}i(ri,"baseAssign"),o(ri,"baseAssign");function Un(de,Me,Le,ht,Kr,sn,Mn){var mn;if(ht&&(mn=sn?ht(de,Kr,sn,Mn):ht(de)),mn!==void 0)return mn;if(!Rs(de))return de;var Fr=Rl(de);if(Fr){if(mn=Tl(de),!Me)return Sl(de,mn)}else{var _a=ba(de),Ea=_a==g||_a==v;if(Nl(de))return to(de,Me);if(_a==x||_a==s||Ea&&!sn){if(be(de))return sn?de:{};if(mn=Ud(Ea?{}:de),!Me)return Ld(de,ri(mn,de))}else{if(!C[_a])return sn?de:{};mn=Cl(de,_a,Un,Me)}}Mn||(Mn=new Nr);var Bl=Mn.get(de);if(Bl)return Bl;if(Mn.set(de,mn),!Fr)var Kc=Le?xl(de):Vc(de);return oe(Kc||de,function(gn,Os){Kc&&(Os=gn,gn=de[Os]),Ln(mn,Os,Un(gn,Me,Le,ht,Os,de,Mn))}),mn}i(Un,"baseClone"),o(Un,"baseClone");function ki(de){return Rs(de)?le(de):{}}i(ki,"baseCreate"),o(ki,"baseCreate");function Di(de,Me,Le){var ht=Me(de);return Rl(de)?ht:M(ht,Le(de))}i(Di,"baseGetAllKeys"),o(Di,"baseGetAllKeys");function Ri(de){return Ie.call(de)}i(Ri,"baseGetTag"),o(Ri,"baseGetTag");function Qa(de){if(!Rs(de)||kl(de))return!1;var Me=Pl(de)||be(de)?Be:E;return Me.test(wa(de))}i(Qa,"baseIsNative"),o(Qa,"baseIsNative");function eo(de){if(!Dl(de))return Ct(de);var Me=[];for(var Le in Object(de))De.call(de,Le)&&Le!="constructor"&&Me.push(Le);return Me}i(eo,"baseKeys"),o(eo,"baseKeys");function to(de,Me){if(Me)return de.slice();var Le=new de.constructor(de.length);return de.copy(Le),Le}i(to,"cloneBuffer"),o(to,"cloneBuffer");function Po(de){var Me=new de.constructor(de.byteLength);return new pe(Me).set(new pe(de)),Me}i(Po,"cloneArrayBuffer"),o(Po,"cloneArrayBuffer");function Pd(de,Me){var Le=Me?Po(de.buffer):de.buffer;return new de.constructor(Le,de.byteOffset,de.byteLength)}i(Pd,"cloneDataView"),o(Pd,"cloneDataView");function _l(de,Me,Le){var ht=Me?Le(Re(de),!0):Re(de);return G(ht,L,new de.constructor)}i(_l,"cloneMap"),o(_l,"cloneMap");function ks(de){var Me=new de.constructor(de.source,m.exec(de));return Me.lastIndex=de.lastIndex,Me}i(ks,"cloneRegExp"),o(ks,"cloneRegExp");function El(de,Me,Le){var ht=Me?Le(N(de),!0):N(de);return G(ht,ne,new de.constructor)}i(El,"cloneSet"),o(El,"cloneSet");function Bd(de){return it?Object(it.call(de)):{}}i(Bd,"cloneSymbol"),o(Bd,"cloneSymbol");function Al(de,Me){var Le=Me?Po(de.buffer):de.buffer;return new de.constructor(Le,de.byteOffset,de.length)}i(Al,"cloneTypedArray"),o(Al,"cloneTypedArray");function Sl(de,Me){var Le=-1,ht=de.length;for(Me||(Me=Array(ht));++Le<ht;)Me[Le]=de[Le];return Me}i(Sl,"copyArray"),o(Sl,"copyArray");function Ds(de,Me,Le,ht){Le||(Le={});for(var Kr=-1,sn=Me.length;++Kr<sn;){var Mn=Me[Kr],mn=ht?ht(Le[Mn],de[Mn],Mn,Le,de):void 0;Ln(Le,Mn,mn===void 0?de[Mn]:mn)}return Le}i(Ds,"copyObject"),o(Ds,"copyObject");function Ld(de,Me){return Ds(de,no(de),Me)}i(Ld,"copySymbols"),o(Ld,"copySymbols");function xl(de){return Di(de,Vc,no)}i(xl,"getAllKeys"),o(xl,"getAllKeys");function ro(de,Me){var Le=de.__data__;return Il(Me)?Le[typeof Me=="string"?"string":"hash"]:Le.map}i(ro,"getMapData"),o(ro,"getMapData");function Zi(de,Me){var Le=fe(de,Me);return Qa(Le)?Le:void 0}i(Zi,"getNative"),o(Zi,"getNative");var no=Ce?X(Ce,Object):wr,ba=Ri;(Ve&&ba(new Ve(new ArrayBuffer(1)))!=Y||He&&ba(new He)!=y||Ot&&ba(Ot.resolve())!=O||dt&&ba(new dt)!=P||mt&&ba(new mt)!=q)&&(ba=o(function(de){var Me=Ie.call(de),Le=Me==x?de.constructor:void 0,ht=Le?wa(Le):void 0;if(ht)switch(ht){case ct:return Y;case ut:return y;case lr:return O;case lt:return P;case nt:return q}return Me},"getTag"));function Tl(de){var Me=de.length,Le=de.constructor(Me);return Me&&typeof de[0]=="string"&&De.call(de,"index")&&(Le.index=de.index,Le.input=de.input),Le}i(Tl,"initCloneArray"),o(Tl,"initCloneArray");function Ud(de){return typeof de.constructor=="function"&&!Dl(de)?ki(re(de)):{}}i(Ud,"initCloneObject"),o(Ud,"initCloneObject");function Cl(de,Me,Le,ht){var Kr=de.constructor;switch(Me){case Q:return Po(de);case l:case h:return new Kr(+de);case Y:return Pd(de,ht);case k:case K:case he:case me:case we:case Z:case w:case T:case b:return Al(de,ht);case y:return _l(de,ht,Le);case _:case J:return new Kr(de);case D:return ks(de);case P:return El(de,ht,Le);case j:return Bd(de)}}i(Cl,"initCloneByTag"),o(Cl,"initCloneByTag");function Ml(de,Me){return Me=Me??a,!!Me&&(typeof de=="number"||R.test(de))&&de>-1&&de%1==0&&de<Me}i(Ml,"isIndex"),o(Ml,"isIndex");function Il(de){var Me=typeof de;return Me=="string"||Me=="number"||Me=="symbol"||Me=="boolean"?de!=="__proto__":de===null}i(Il,"isKeyable"),o(Il,"isKeyable");function kl(de){return!!ue&&ue in de}i(kl,"isMasked"),o(kl,"isMasked");function Dl(de){var Me=de&&de.constructor,Le=typeof Me=="function"&&Me.prototype||ie;return de===Le}i(Dl,"isPrototype"),o(Dl,"isPrototype");function wa(de){if(de!=null){try{return Ae.call(de)}catch{}try{return de+""}catch{}}return""}i(wa,"toSource"),o(wa,"toSource");function Fd(de){return Un(de,!0,!0)}i(Fd,"cloneDeep6"),o(Fd,"cloneDeep");function qc(de,Me){return de===Me||de!==de&&Me!==Me}i(qc,"eq4"),o(qc,"eq");function jd(de){return $d(de)&&De.call(de,"callee")&&(!_e.call(de,"callee")||Ie.call(de)==s)}i(jd,"isArguments"),o(jd,"isArguments");var Rl=Array.isArray;function Ol(de){return de!=null&&zd(de.length)&&!Pl(de)}i(Ol,"isArrayLike2"),o(Ol,"isArrayLike");function $d(de){return Hd(de)&&Ol(de)}i($d,"isArrayLikeObject"),o($d,"isArrayLikeObject");var Nl=Oe||vr;function Pl(de){var Me=Rs(de)?Ie.call(de):"";return Me==g||Me==v}i(Pl,"isFunction2"),o(Pl,"isFunction");function zd(de){return typeof de=="number"&&de>-1&&de%1==0&&de<=a}i(zd,"isLength"),o(zd,"isLength");function Rs(de){var Me=typeof de;return!!de&&(Me=="object"||Me=="function")}i(Rs,"isObject"),o(Rs,"isObject");function Hd(de){return!!de&&typeof de=="object"}i(Hd,"isObjectLike"),o(Hd,"isObjectLike");function Vc(de){return Ol(de)?Ii(de):eo(de)}i(Vc,"keys"),o(Vc,"keys");function wr(){return[]}i(wr,"stubArray"),o(wr,"stubArray");function vr(){return!1}i(vr,"stubFalse"),o(vr,"stubFalse"),t.exports=Fd}}),I$=ze({"../../../node_modules/.pnpm/cross-fetch@3.2.0/node_modules/cross-fetch/dist/browser-ponyfill.js"(e,t){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return i(s,"F"),o(s,"F"),s.prototype=r,new s}();(function(s){var c=function(l){var h=typeof s<"u"&&s||typeof self<"u"&&self||typeof global<"u"&&global||{},p={searchParams:"URLSearchParams"in h,iterable:"Symbol"in h&&"iterator"in Symbol,blob:"FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in h,arrayBuffer:"ArrayBuffer"in h};function g(f){return f&&DataView.prototype.isPrototypeOf(f)}if(i(g,"isDataView"),o(g,"isDataView"),p.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(f){return f&&v.indexOf(Object.prototype.toString.call(f))>-1};function _(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(f)||f==="")throw new TypeError('Invalid character in header field name: "'+f+'"');return f.toLowerCase()}i(_,"normalizeName"),o(_,"normalizeName");function x(f){return typeof f!="string"&&(f=String(f)),f}i(x,"normalizeValue"),o(x,"normalizeValue");function O(f){var m={next:function(){var E=f.shift();return{done:E===void 0,value:E}}};return p.iterable&&(m[Symbol.iterator]=function(){return m}),m}i(O,"iteratorFor"),o(O,"iteratorFor");function D(f){this.map={},f instanceof D?f.forEach(function(m,E){this.append(E,m)},this):Array.isArray(f)?f.forEach(function(m){if(m.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+m.length);this.append(m[0],m[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(m){this.append(m,f[m])},this)}i(D,"Headers"),o(D,"Headers"),D.prototype.append=function(f,m){f=_(f),m=x(m);var E=this.map[f];this.map[f]=E?E+", "+m:m},D.prototype.delete=function(f){delete this.map[_(f)]},D.prototype.get=function(f){return f=_(f),this.has(f)?this.map[f]:null},D.prototype.has=function(f){return this.map.hasOwnProperty(_(f))},D.prototype.set=function(f,m){this.map[_(f)]=x(m)},D.prototype.forEach=function(f,m){for(var E in this.map)this.map.hasOwnProperty(E)&&f.call(m,this.map[E],E,this)},D.prototype.keys=function(){var f=[];return this.forEach(function(m,E){f.push(E)}),O(f)},D.prototype.values=function(){var f=[];return this.forEach(function(m){f.push(m)}),O(f)},D.prototype.entries=function(){var f=[];return this.forEach(function(m,E){f.push([E,m])}),O(f)},p.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function P(f){if(!f._noBody){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}}i(P,"consumed"),o(P,"consumed");function J(f){return new Promise(function(m,E){f.onload=function(){m(f.result)},f.onerror=function(){E(f.error)}})}i(J,"fileReaderReady"),o(J,"fileReaderReady");function j(f){var m=new FileReader,E=J(m);return m.readAsArrayBuffer(f),E}i(j,"readBlobAsArrayBuffer"),o(j,"readBlobAsArrayBuffer");function q(f){var m=new FileReader,E=J(m),R=/charset=([A-Za-z0-9_-]+)/.exec(f.type),C=R?R[1]:"utf-8";return m.readAsText(f,C),E}i(q,"readBlobAsText"),o(q,"readBlobAsText");function Q(f){for(var m=new Uint8Array(f),E=new Array(m.length),R=0;R<m.length;R++)E[R]=String.fromCharCode(m[R]);return E.join("")}i(Q,"readArrayBufferAsText"),o(Q,"readArrayBufferAsText");function Y(f){if(f.slice)return f.slice(0);var m=new Uint8Array(f.byteLength);return m.set(new Uint8Array(f)),m.buffer}i(Y,"bufferClone"),o(Y,"bufferClone");function k(){return this.bodyUsed=!1,this._initBody=function(f){this.bodyUsed=this.bodyUsed,this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:p.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:p.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:p.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():p.arrayBuffer&&p.blob&&g(f)?(this._bodyArrayBuffer=Y(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):p.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||y(f))?this._bodyArrayBuffer=Y(f):this._bodyText=f=Object.prototype.toString.call(f):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):p.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},p.blob&&(this.blob=function(){var f=P(this);if(f)return f;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(){if(this._bodyArrayBuffer){var f=P(this);return f||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(p.blob)return this.blob().then(j);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var f=P(this);if(f)return f;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Q(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(we)}),this.json=function(){return this.text().then(JSON.parse)},this}i(k,"Body"),o(k,"Body");var K=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function he(f){var m=f.toUpperCase();return K.indexOf(m)>-1?m:f}i(he,"normalizeMethod"),o(he,"normalizeMethod");function me(f,m){if(!(this instanceof me))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');m=m||{};var E=m.body;if(f instanceof me){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,m.headers||(this.headers=new D(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,!E&&f._bodyInit!=null&&(E=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new D(m.headers)),this.method=he(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal||function(){if("AbortController"in h){var A=new AbortController;return A.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(E),(this.method==="GET"||this.method==="HEAD")&&(m.cache==="no-store"||m.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var C=/\?/;this.url+=(C.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}i(me,"Request"),o(me,"Request"),me.prototype.clone=function(){return new me(this,{body:this._bodyInit})};function we(f){var m=new FormData;return f.trim().split("&").forEach(function(E){if(E){var R=E.split("="),C=R.shift().replace(/\+/g," "),A=R.join("=").replace(/\+/g," ");m.append(decodeURIComponent(C),decodeURIComponent(A))}}),m}i(we,"decode9"),o(we,"decode");function Z(f){var m=new D,E=f.replace(/\r?\n[\t ]+/g," ");return E.split("\r").map(function(R){return R.indexOf(`
672
+ `}),f},"errorsToAscii2"),"errorsToAscii"),Y=!1,k=!1,K=!1,he=!1,me=0,we;if(this.errors=[],a.isBuffer(n))this.chars=h.decode("BINARY",n);else if(Array.isArray(n))this.chars=n.slice();else if(typeof n=="string")this.chars=h.decode("STRING",n);else throw new Error(`${s}input source is not a string, byte Buffer or character array`);this.sabnf=h.encode("STRING",this.chars),this.scan=o(i(function(w,T){this.lines=p(this.chars,this.errors,w,T),Y=!0},"scan"),"scan"),this.parse=o(i(function(w,T,b){if(!Y)throw new Error(`${s}grammar not scanned`);g.syntax(this.chars,this.lines,this.errors,w,T,b),k=!0},"parse3"),"parse"),this.translate=o(i(function(){if(!k)throw new Error(`${s}grammar not scanned and parsed`);let w=g.semantic(this.chars,this.lines,this.errors);this.errors.length===0&&(this.rules=w.rules,this.udts=w.udts,we=w.lineMap,K=!0)},"translate"),"translate"),this.attributes=o(i(function(){if(!K)throw new Error(`${s}grammar not scanned, parsed and translated`);return me=v(this.rules,this.udts,we,this.errors),he=!0,me},"attrs"),"attrs"),this.generate=o(i(function(w){if(this.lines=p(this.chars,this.errors,w),this.errors.length||(g.syntax(this.chars,this.lines,this.errors,w),this.errors.length))return;let T=g.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=T.rules,this.udts=T.udts,we=T.lineMap,me=v(this.rules,this.udts,we,this.errors),he=!0)},"generate3"),"generate"),this.displayRules=o(i(function(w="index"){if(!K)throw new Error(`${s}grammar not scanned, parsed and translated`);return O(this.rules,this.udts,w)},"displayRules"),"displayRules"),this.displayRuleDependencies=o(i(function(w="index"){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return x(w)},"displayRuleDependencies"),"displayRuleDependencies"),this.displayAttributes=o(i(function(w="index"){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return me&&_(w),y(w)},"displayAttributes"),"displayAttributes"),this.displayAttributeErrors=o(i(function(){if(!he)throw new Error(`${s}no attributes - must be preceeded by call to attributes()`);return _()},"displayAttributeErrors"),"displayAttributeErrors"),this.toSource=o(i(function(w=void 0){if(!he)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(me)throw new Error(`${s}can't generate parser source - attributes have ${me} errors`);return g.generateSource(this.chars,this.lines,this.rules,this.udts,w)},"toSource"),"toSource"),this.toObject=o(i(function(){if(!he)throw new Error(`${s}can't generate parser source - must be preceeded by call to attributes()`);if(me)throw new Error(`${s}can't generate parser source - attributes have ${me} errors`);return g.generateObject(this.sabnf,this.rules,this.udts)},"toObject"),"toObject"),this.errorsToAscii=o(i(function(){return Q(this.errors,this.lines,this.chars)},"errorsToAsciiFunc"),"errorsToAsciiFunc"),this.errorsToHtml=o(i(function(w){return q(this.errors,this.lines,this.chars,w)},"errorsToHtmlFunc"),"errorsToHtmlFunc"),this.linesToAscii=o(i(function(){return J(this.lines)},"linesToAsciiFunc"),"linesToAsciiFunc"),this.linesToHtml=o(i(function(){return j(this.lines)},"linesToHtmlFunc"),"linesToHtmlFunc")},"api"),"api")}}),$x=ze({"../../../node_modules/.pnpm/bn.js@5.2.1/node_modules/bn.js/lib/bn.js"(e,t){(function(r,n){"use strict";function a(b,f){if(!b)throw new Error(f||"Assertion failed")}i(a,"assert2"),o(a,"assert");function s(b,f){b.super_=f;var m=o(function(){},"TempCtor");m.prototype=f.prototype,b.prototype=new m,b.prototype.constructor=b}i(s,"inherits"),o(s,"inherits");function c(b,f,m){if(c.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((f==="le"||f==="be")&&(m=f,f=10),this._init(b||0,f||10,m||"be"))}i(c,"BN3"),o(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=Ix().Buffer}catch{}c.isBN=o(i(function(f){return f instanceof c?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===c.wordSize&&Array.isArray(f.words)},"isBN"),"isBN"),c.max=o(i(function(f,m){return f.cmp(m)>0?f:m},"max"),"max"),c.min=o(i(function(f,m){return f.cmp(m)<0?f:m},"min"),"min"),c.prototype._init=o(i(function(f,m,E){if(typeof f=="number")return this._initNumber(f,m,E);if(typeof f=="object")return this._initArray(f,m,E);m==="hex"&&(m=16),a(m===(m|0)&&m>=2&&m<=36),f=f.toString().replace(/\s+/g,"");var R=0;f[0]==="-"&&(R++,this.negative=1),R<f.length&&(m===16?this._parseHex(f,R,E):(this._parseBase(f,m,R),E==="le"&&this._initArray(this.toArray(),m,E)))},"init2"),"init"),c.prototype._initNumber=o(i(function(f,m,E){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(a(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),E==="le"&&this._initArray(this.toArray(),m,E)},"_initNumber"),"_initNumber"),c.prototype._initArray=o(i(function(f,m,E){if(a(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var C,A,B=0;if(E==="be")for(R=f.length-1,C=0;R>=0;R-=3)A=f[R]|f[R-1]<<8|f[R-2]<<16,this.words[C]|=A<<B&67108863,this.words[C+1]=A>>>26-B&67108863,B+=24,B>=26&&(B-=26,C++);else if(E==="le")for(R=0,C=0;R<f.length;R+=3)A=f[R]|f[R+1]<<8|f[R+2]<<16,this.words[C]|=A<<B&67108863,this.words[C+1]=A>>>26-B&67108863,B+=24,B>=26&&(B-=26,C++);return this._strip()},"_initArray"),"_initArray");function h(b,f){var m=b.charCodeAt(f);if(m>=48&&m<=57)return m-48;if(m>=65&&m<=70)return m-55;if(m>=97&&m<=102)return m-87;a(!1,"Invalid character in "+b)}i(h,"parseHex4Bits"),o(h,"parseHex4Bits");function p(b,f,m){var E=h(b,m);return m-1>=f&&(E|=h(b,m-1)<<4),E}i(p,"parseHexByte"),o(p,"parseHexByte"),c.prototype._parseHex=o(i(function(f,m,E){this.length=Math.ceil((f.length-m)/6),this.words=new Array(this.length);for(var R=0;R<this.length;R++)this.words[R]=0;var C=0,A=0,B;if(E==="be")for(R=f.length-1;R>=m;R-=2)B=p(f,m,R)<<C,this.words[A]|=B&67108863,C>=18?(C-=18,A+=1,this.words[A]|=B>>>26):C+=8;else{var V=f.length-m;for(R=V%2===0?m+1:m;R<f.length;R+=2)B=p(f,m,R)<<C,this.words[A]|=B&67108863,C>=18?(C-=18,A+=1,this.words[A]|=B>>>26):C+=8}this._strip()},"_parseHex"),"_parseHex");function g(b,f,m,E){for(var R=0,C=0,A=Math.min(b.length,m),B=f;B<A;B++){var V=b.charCodeAt(B)-48;R*=E,V>=49?C=V-49+10:V>=17?C=V-17+10:C=V,a(V>=0&&C<E,"Invalid character"),R+=C}return R}i(g,"parseBase"),o(g,"parseBase"),c.prototype._parseBase=o(i(function(f,m,E){this.words=[0],this.length=1;for(var R=0,C=1;C<=67108863;C*=m)R++;R--,C=C/m|0;for(var A=f.length-E,B=A%R,V=Math.min(A,A-B)+E,I=0,U=E;U<V;U+=R)I=g(f,U,U+R,m),this.imuln(C),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I);if(B!==0){var ge=1;for(I=g(f,U,f.length,m),U=0;U<B;U++)ge*=m;this.imuln(ge),this.words[0]+I<67108864?this.words[0]+=I:this._iaddn(I)}this._strip()},"_parseBase"),"_parseBase"),c.prototype.copy=o(i(function(f){f.words=new Array(this.length);for(var m=0;m<this.length;m++)f.words[m]=this.words[m];f.length=this.length,f.negative=this.negative,f.red=this.red},"copy"),"copy");function v(b,f){b.words=f.words,b.length=f.length,b.negative=f.negative,b.red=f.red}if(i(v,"move"),o(v,"move"),c.prototype._move=o(i(function(f){v(f,this)},"_move"),"_move"),c.prototype.clone=o(i(function(){var f=new c(null);return this.copy(f),f},"clone"),"clone"),c.prototype._expand=o(i(function(f){for(;this.length<f;)this.words[this.length++]=0;return this},"_expand"),"_expand"),c.prototype._strip=o(i(function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},"strip"),"strip"),c.prototype._normSign=o(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"),o(y,"inspect");var _=["","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"],x=[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=o(i(function(f,m){f=f||10,m=m|0||1;var E;if(f===16||f==="hex"){E="";for(var R=0,C=0,A=0;A<this.length;A++){var B=this.words[A],V=((B<<R|C)&16777215).toString(16);C=B>>>24-R&16777215,R+=2,R>=26&&(R-=26,A--),C!==0||A!==this.length-1?E=_[6-V.length]+V+E:E=V+E}for(C!==0&&(E=C.toString(16)+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(f===(f|0)&&f>=2&&f<=36){var I=x[f],U=O[f];E="";var ge=this.clone();for(ge.negative=0;!ge.isZero();){var L=ge.modrn(U).toString(f);ge=ge.idivn(U),ge.isZero()?E=L+E:E=_[I-L.length]+L+E}for(this.isZero()&&(E="0"+E);E.length%m!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}a(!1,"Base should be between 2 and 36")},"toString4"),"toString"),c.prototype.toNumber=o(i(function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},"toNumber"),"toNumber"),c.prototype.toJSON=o(i(function(){return this.toString(16,2)},"toJSON2"),"toJSON"),l&&(c.prototype.toBuffer=o(i(function(f,m){return this.toArrayLike(l,f,m)},"toBuffer"),"toBuffer")),c.prototype.toArray=o(i(function(f,m){return this.toArrayLike(Array,f,m)},"toArray"),"toArray");var D=o(i(function(f,m){return f.allocUnsafe?f.allocUnsafe(m):new f(m)},"allocate2"),"allocate");c.prototype.toArrayLike=o(i(function(f,m,E){this._strip();var R=this.byteLength(),C=E||Math.max(1,R);a(R<=C,"byte array longer than desired length"),a(C>0,"Requested array length <= 0");var A=D(f,C),B=m==="le"?"LE":"BE";return this["_toArrayLike"+B](A,R),A},"toArrayLike"),"toArrayLike"),c.prototype._toArrayLikeLE=o(i(function(f,m){for(var E=0,R=0,C=0,A=0;C<this.length;C++){var B=this.words[C]<<A|R;f[E++]=B&255,E<f.length&&(f[E++]=B>>8&255),E<f.length&&(f[E++]=B>>16&255),A===6?(E<f.length&&(f[E++]=B>>24&255),R=0,A=0):(R=B>>>24,A+=2)}if(E<f.length)for(f[E++]=R;E<f.length;)f[E++]=0},"_toArrayLikeLE"),"_toArrayLikeLE"),c.prototype._toArrayLikeBE=o(i(function(f,m){for(var E=f.length-1,R=0,C=0,A=0;C<this.length;C++){var B=this.words[C]<<A|R;f[E--]=B&255,E>=0&&(f[E--]=B>>8&255),E>=0&&(f[E--]=B>>16&255),A===6?(E>=0&&(f[E--]=B>>24&255),R=0,A=0):(R=B>>>24,A+=2)}if(E>=0)for(f[E--]=R;E>=0;)f[E--]=0},"_toArrayLikeBE"),"_toArrayLikeBE"),Math.clz32?c.prototype._countBits=o(i(function(f){return 32-Math.clz32(f)},"_countBits"),"_countBits"):c.prototype._countBits=o(i(function(f){var m=f,E=0;return m>=4096&&(E+=13,m>>>=13),m>=64&&(E+=7,m>>>=7),m>=8&&(E+=4,m>>>=4),m>=2&&(E+=2,m>>>=2),E+m},"_countBits"),"_countBits"),c.prototype._zeroBits=o(i(function(f){if(f===0)return 26;var m=f,E=0;return(m&8191)===0&&(E+=13,m>>>=13),(m&127)===0&&(E+=7,m>>>=7),(m&15)===0&&(E+=4,m>>>=4),(m&3)===0&&(E+=2,m>>>=2),(m&1)===0&&E++,E},"_zeroBits"),"_zeroBits"),c.prototype.bitLength=o(i(function(){var f=this.words[this.length-1],m=this._countBits(f);return(this.length-1)*26+m},"bitLength"),"bitLength");function P(b){for(var f=new Array(b.bitLength()),m=0;m<f.length;m++){var E=m/26|0,R=m%26;f[m]=b.words[E]>>>R&1}return f}i(P,"toBitArray"),o(P,"toBitArray"),c.prototype.zeroBits=o(i(function(){if(this.isZero())return 0;for(var f=0,m=0;m<this.length;m++){var E=this._zeroBits(this.words[m]);if(f+=E,E!==26)break}return f},"zeroBits"),"zeroBits"),c.prototype.byteLength=o(i(function(){return Math.ceil(this.bitLength()/8)},"byteLength"),"byteLength"),c.prototype.toTwos=o(i(function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},"toTwos"),"toTwos"),c.prototype.fromTwos=o(i(function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},"fromTwos"),"fromTwos"),c.prototype.isNeg=o(i(function(){return this.negative!==0},"isNeg"),"isNeg"),c.prototype.neg=o(i(function(){return this.clone().ineg()},"neg3"),"neg"),c.prototype.ineg=o(i(function(){return this.isZero()||(this.negative^=1),this},"ineg"),"ineg"),c.prototype.iuor=o(i(function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var m=0;m<f.length;m++)this.words[m]=this.words[m]|f.words[m];return this._strip()},"iuor"),"iuor"),c.prototype.ior=o(i(function(f){return a((this.negative|f.negative)===0),this.iuor(f)},"ior"),"ior"),c.prototype.or=o(i(function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},"or2"),"or"),c.prototype.uor=o(i(function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},"uor"),"uor"),c.prototype.iuand=o(i(function(f){var m;this.length>f.length?m=f:m=this;for(var E=0;E<m.length;E++)this.words[E]=this.words[E]&f.words[E];return this.length=m.length,this._strip()},"iuand"),"iuand"),c.prototype.iand=o(i(function(f){return a((this.negative|f.negative)===0),this.iuand(f)},"iand"),"iand"),c.prototype.and=o(i(function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},"and"),"and"),c.prototype.uand=o(i(function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},"uand"),"uand"),c.prototype.iuxor=o(i(function(f){var m,E;this.length>f.length?(m=this,E=f):(m=f,E=this);for(var R=0;R<E.length;R++)this.words[R]=m.words[R]^E.words[R];if(this!==m)for(;R<m.length;R++)this.words[R]=m.words[R];return this.length=m.length,this._strip()},"iuxor"),"iuxor"),c.prototype.ixor=o(i(function(f){return a((this.negative|f.negative)===0),this.iuxor(f)},"ixor"),"ixor"),c.prototype.xor=o(i(function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},"xor2"),"xor"),c.prototype.uxor=o(i(function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},"uxor"),"uxor"),c.prototype.inotn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=Math.ceil(f/26)|0,E=f%26;this._expand(m),E>0&&m--;for(var R=0;R<m;R++)this.words[R]=~this.words[R]&67108863;return E>0&&(this.words[R]=~this.words[R]&67108863>>26-E),this._strip()},"inotn"),"inotn"),c.prototype.notn=o(i(function(f){return this.clone().inotn(f)},"notn"),"notn"),c.prototype.setn=o(i(function(f,m){a(typeof f=="number"&&f>=0);var E=f/26|0,R=f%26;return this._expand(E+1),m?this.words[E]=this.words[E]|1<<R:this.words[E]=this.words[E]&~(1<<R),this._strip()},"setn"),"setn"),c.prototype.iadd=o(i(function(f){var m;if(this.negative!==0&&f.negative===0)return this.negative=0,m=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,m=this.isub(f),f.negative=1,m._normSign();var E,R;this.length>f.length?(E=this,R=f):(E=f,R=this);for(var C=0,A=0;A<R.length;A++)m=(E.words[A]|0)+(R.words[A]|0)+C,this.words[A]=m&67108863,C=m>>>26;for(;C!==0&&A<E.length;A++)m=(E.words[A]|0)+C,this.words[A]=m&67108863,C=m>>>26;if(this.length=E.length,C!==0)this.words[this.length]=C,this.length++;else if(E!==this)for(;A<E.length;A++)this.words[A]=E.words[A];return this},"iadd"),"iadd"),c.prototype.add=o(i(function(f){var m;return f.negative!==0&&this.negative===0?(f.negative=0,m=this.sub(f),f.negative^=1,m):f.negative===0&&this.negative!==0?(this.negative=0,m=f.sub(this),this.negative=1,m):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},"add3"),"add"),c.prototype.isub=o(i(function(f){if(f.negative!==0){f.negative=0;var m=this.iadd(f);return f.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var E=this.cmp(f);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var R,C;E>0?(R=this,C=f):(R=f,C=this);for(var A=0,B=0;B<C.length;B++)m=(R.words[B]|0)-(C.words[B]|0)+A,A=m>>26,this.words[B]=m&67108863;for(;A!==0&&B<R.length;B++)m=(R.words[B]|0)+A,A=m>>26,this.words[B]=m&67108863;if(A===0&&B<R.length&&R!==this)for(;B<R.length;B++)this.words[B]=R.words[B];return this.length=Math.max(this.length,B),R!==this&&(this.negative=1),this._strip()},"isub"),"isub"),c.prototype.sub=o(i(function(f){return this.clone().isub(f)},"sub"),"sub");function J(b,f,m){m.negative=f.negative^b.negative;var E=b.length+f.length|0;m.length=E,E=E-1|0;var R=b.words[0]|0,C=f.words[0]|0,A=R*C,B=A&67108863,V=A/67108864|0;m.words[0]=B;for(var I=1;I<E;I++){for(var U=V>>>26,ge=V&67108863,L=Math.min(I,f.length-1),ne=Math.max(0,I-b.length+1);ne<=L;ne++){var oe=I-ne|0;R=b.words[oe]|0,C=f.words[ne]|0,A=R*C+ge,U+=A/67108864|0,ge=A&67108863}m.words[I]=ge|0,V=U|0}return V!==0?m.words[I]=V|0:m.length--,m._strip()}i(J,"smallMulTo"),o(J,"smallMulTo");var j=o(i(function(f,m,E){var R=f.words,C=m.words,A=E.words,B=0,V,I,U,ge=R[0]|0,L=ge&8191,ne=ge>>>13,oe=R[1]|0,M=oe&8191,G=oe>>>13,ae=R[2]|0,fe=ae&8191,be=ae>>>13,Re=R[3]|0,X=Re&8191,N=Re>>>13,F=R[4]|0,W=F&8191,ie=F>>>13,ee=R[5]|0,ue=ee&8191,Ae=ee>>>13,De=R[6]|0,Ie=De&8191,Be=De>>>13,qe=R[7]|0,ve=qe&8191,pe=qe>>>13,re=R[8]|0,le=re&8191,_e=re>>>13,Te=R[9]|0,Ce=Te&8191,Oe=Te>>>13,Ct=C[0]|0,Ve=Ct&8191,He=Ct>>>13,Ot=C[1]|0,dt=Ot&8191,mt=Ot>>>13,Or=C[2]|0,ct=Or&8191,ut=Or>>>13,lr=C[3]|0,lt=lr&8191,nt=lr>>>13,or=C[4]|0,it=or&8191,Xe=or>>>13,Qt=C[5]|0,at=Qt&8191,et=Qt>>>13,sr=C[6]|0,ot=sr&8191,Ze=sr>>>13,cr=C[7]|0,st=cr&8191,Et=cr>>>13,Tn=C[8]|0,At=Tn&8191,yt=Tn>>>13,hn=C[9]|0,er=hn&8191,tr=hn>>>13;E.negative=f.negative^m.negative,E.length=19,V=Math.imul(L,Ve),I=Math.imul(L,He),I=I+Math.imul(ne,Ve)|0,U=Math.imul(ne,He);var nn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(nn>>>26)|0,nn&=67108863,V=Math.imul(M,Ve),I=Math.imul(M,He),I=I+Math.imul(G,Ve)|0,U=Math.imul(G,He),V=V+Math.imul(L,dt)|0,I=I+Math.imul(L,mt)|0,I=I+Math.imul(ne,dt)|0,U=U+Math.imul(ne,mt)|0;var an=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(an>>>26)|0,an&=67108863,V=Math.imul(fe,Ve),I=Math.imul(fe,He),I=I+Math.imul(be,Ve)|0,U=Math.imul(be,He),V=V+Math.imul(M,dt)|0,I=I+Math.imul(M,mt)|0,I=I+Math.imul(G,dt)|0,U=U+Math.imul(G,mt)|0,V=V+Math.imul(L,ct)|0,I=I+Math.imul(L,ut)|0,I=I+Math.imul(ne,ct)|0,U=U+Math.imul(ne,ut)|0;var Nr=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Nr>>>26)|0,Nr&=67108863,V=Math.imul(X,Ve),I=Math.imul(X,He),I=I+Math.imul(N,Ve)|0,U=Math.imul(N,He),V=V+Math.imul(fe,dt)|0,I=I+Math.imul(fe,mt)|0,I=I+Math.imul(be,dt)|0,U=U+Math.imul(be,mt)|0,V=V+Math.imul(M,ct)|0,I=I+Math.imul(M,ut)|0,I=I+Math.imul(G,ct)|0,U=U+Math.imul(G,ut)|0,V=V+Math.imul(L,lt)|0,I=I+Math.imul(L,nt)|0,I=I+Math.imul(ne,lt)|0,U=U+Math.imul(ne,nt)|0;var Vr=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,V=Math.imul(W,Ve),I=Math.imul(W,He),I=I+Math.imul(ie,Ve)|0,U=Math.imul(ie,He),V=V+Math.imul(X,dt)|0,I=I+Math.imul(X,mt)|0,I=I+Math.imul(N,dt)|0,U=U+Math.imul(N,mt)|0,V=V+Math.imul(fe,ct)|0,I=I+Math.imul(fe,ut)|0,I=I+Math.imul(be,ct)|0,U=U+Math.imul(be,ut)|0,V=V+Math.imul(M,lt)|0,I=I+Math.imul(M,nt)|0,I=I+Math.imul(G,lt)|0,U=U+Math.imul(G,nt)|0,V=V+Math.imul(L,it)|0,I=I+Math.imul(L,Xe)|0,I=I+Math.imul(ne,it)|0,U=U+Math.imul(ne,Xe)|0;var on=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(on>>>26)|0,on&=67108863,V=Math.imul(ue,Ve),I=Math.imul(ue,He),I=I+Math.imul(Ae,Ve)|0,U=Math.imul(Ae,He),V=V+Math.imul(W,dt)|0,I=I+Math.imul(W,mt)|0,I=I+Math.imul(ie,dt)|0,U=U+Math.imul(ie,mt)|0,V=V+Math.imul(X,ct)|0,I=I+Math.imul(X,ut)|0,I=I+Math.imul(N,ct)|0,U=U+Math.imul(N,ut)|0,V=V+Math.imul(fe,lt)|0,I=I+Math.imul(fe,nt)|0,I=I+Math.imul(be,lt)|0,U=U+Math.imul(be,nt)|0,V=V+Math.imul(M,it)|0,I=I+Math.imul(M,Xe)|0,I=I+Math.imul(G,it)|0,U=U+Math.imul(G,Xe)|0,V=V+Math.imul(L,at)|0,I=I+Math.imul(L,et)|0,I=I+Math.imul(ne,at)|0,U=U+Math.imul(ne,et)|0;var Cn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,V=Math.imul(Ie,Ve),I=Math.imul(Ie,He),I=I+Math.imul(Be,Ve)|0,U=Math.imul(Be,He),V=V+Math.imul(ue,dt)|0,I=I+Math.imul(ue,mt)|0,I=I+Math.imul(Ae,dt)|0,U=U+Math.imul(Ae,mt)|0,V=V+Math.imul(W,ct)|0,I=I+Math.imul(W,ut)|0,I=I+Math.imul(ie,ct)|0,U=U+Math.imul(ie,ut)|0,V=V+Math.imul(X,lt)|0,I=I+Math.imul(X,nt)|0,I=I+Math.imul(N,lt)|0,U=U+Math.imul(N,nt)|0,V=V+Math.imul(fe,it)|0,I=I+Math.imul(fe,Xe)|0,I=I+Math.imul(be,it)|0,U=U+Math.imul(be,Xe)|0,V=V+Math.imul(M,at)|0,I=I+Math.imul(M,et)|0,I=I+Math.imul(G,at)|0,U=U+Math.imul(G,et)|0,V=V+Math.imul(L,ot)|0,I=I+Math.imul(L,Ze)|0,I=I+Math.imul(ne,ot)|0,U=U+Math.imul(ne,Ze)|0;var Ci=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ci>>>26)|0,Ci&=67108863,V=Math.imul(ve,Ve),I=Math.imul(ve,He),I=I+Math.imul(pe,Ve)|0,U=Math.imul(pe,He),V=V+Math.imul(Ie,dt)|0,I=I+Math.imul(Ie,mt)|0,I=I+Math.imul(Be,dt)|0,U=U+Math.imul(Be,mt)|0,V=V+Math.imul(ue,ct)|0,I=I+Math.imul(ue,ut)|0,I=I+Math.imul(Ae,ct)|0,U=U+Math.imul(Ae,ut)|0,V=V+Math.imul(W,lt)|0,I=I+Math.imul(W,nt)|0,I=I+Math.imul(ie,lt)|0,U=U+Math.imul(ie,nt)|0,V=V+Math.imul(X,it)|0,I=I+Math.imul(X,Xe)|0,I=I+Math.imul(N,it)|0,U=U+Math.imul(N,Xe)|0,V=V+Math.imul(fe,at)|0,I=I+Math.imul(fe,et)|0,I=I+Math.imul(be,at)|0,U=U+Math.imul(be,et)|0,V=V+Math.imul(M,ot)|0,I=I+Math.imul(M,Ze)|0,I=I+Math.imul(G,ot)|0,U=U+Math.imul(G,Ze)|0,V=V+Math.imul(L,st)|0,I=I+Math.imul(L,Et)|0,I=I+Math.imul(ne,st)|0,U=U+Math.imul(ne,Et)|0;var Mi=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,V=Math.imul(le,Ve),I=Math.imul(le,He),I=I+Math.imul(_e,Ve)|0,U=Math.imul(_e,He),V=V+Math.imul(ve,dt)|0,I=I+Math.imul(ve,mt)|0,I=I+Math.imul(pe,dt)|0,U=U+Math.imul(pe,mt)|0,V=V+Math.imul(Ie,ct)|0,I=I+Math.imul(Ie,ut)|0,I=I+Math.imul(Be,ct)|0,U=U+Math.imul(Be,ut)|0,V=V+Math.imul(ue,lt)|0,I=I+Math.imul(ue,nt)|0,I=I+Math.imul(Ae,lt)|0,U=U+Math.imul(Ae,nt)|0,V=V+Math.imul(W,it)|0,I=I+Math.imul(W,Xe)|0,I=I+Math.imul(ie,it)|0,U=U+Math.imul(ie,Xe)|0,V=V+Math.imul(X,at)|0,I=I+Math.imul(X,et)|0,I=I+Math.imul(N,at)|0,U=U+Math.imul(N,et)|0,V=V+Math.imul(fe,ot)|0,I=I+Math.imul(fe,Ze)|0,I=I+Math.imul(be,ot)|0,U=U+Math.imul(be,Ze)|0,V=V+Math.imul(M,st)|0,I=I+Math.imul(M,Et)|0,I=I+Math.imul(G,st)|0,U=U+Math.imul(G,Et)|0,V=V+Math.imul(L,At)|0,I=I+Math.imul(L,yt)|0,I=I+Math.imul(ne,At)|0,U=U+Math.imul(ne,yt)|0;var Ii=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,V=Math.imul(Ce,Ve),I=Math.imul(Ce,He),I=I+Math.imul(Oe,Ve)|0,U=Math.imul(Oe,He),V=V+Math.imul(le,dt)|0,I=I+Math.imul(le,mt)|0,I=I+Math.imul(_e,dt)|0,U=U+Math.imul(_e,mt)|0,V=V+Math.imul(ve,ct)|0,I=I+Math.imul(ve,ut)|0,I=I+Math.imul(pe,ct)|0,U=U+Math.imul(pe,ut)|0,V=V+Math.imul(Ie,lt)|0,I=I+Math.imul(Ie,nt)|0,I=I+Math.imul(Be,lt)|0,U=U+Math.imul(Be,nt)|0,V=V+Math.imul(ue,it)|0,I=I+Math.imul(ue,Xe)|0,I=I+Math.imul(Ae,it)|0,U=U+Math.imul(Ae,Xe)|0,V=V+Math.imul(W,at)|0,I=I+Math.imul(W,et)|0,I=I+Math.imul(ie,at)|0,U=U+Math.imul(ie,et)|0,V=V+Math.imul(X,ot)|0,I=I+Math.imul(X,Ze)|0,I=I+Math.imul(N,ot)|0,U=U+Math.imul(N,Ze)|0,V=V+Math.imul(fe,st)|0,I=I+Math.imul(fe,Et)|0,I=I+Math.imul(be,st)|0,U=U+Math.imul(be,Et)|0,V=V+Math.imul(M,At)|0,I=I+Math.imul(M,yt)|0,I=I+Math.imul(G,At)|0,U=U+Math.imul(G,yt)|0,V=V+Math.imul(L,er)|0,I=I+Math.imul(L,tr)|0,I=I+Math.imul(ne,er)|0,U=U+Math.imul(ne,tr)|0;var Ln=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ln>>>26)|0,Ln&=67108863,V=Math.imul(Ce,dt),I=Math.imul(Ce,mt),I=I+Math.imul(Oe,dt)|0,U=Math.imul(Oe,mt),V=V+Math.imul(le,ct)|0,I=I+Math.imul(le,ut)|0,I=I+Math.imul(_e,ct)|0,U=U+Math.imul(_e,ut)|0,V=V+Math.imul(ve,lt)|0,I=I+Math.imul(ve,nt)|0,I=I+Math.imul(pe,lt)|0,U=U+Math.imul(pe,nt)|0,V=V+Math.imul(Ie,it)|0,I=I+Math.imul(Ie,Xe)|0,I=I+Math.imul(Be,it)|0,U=U+Math.imul(Be,Xe)|0,V=V+Math.imul(ue,at)|0,I=I+Math.imul(ue,et)|0,I=I+Math.imul(Ae,at)|0,U=U+Math.imul(Ae,et)|0,V=V+Math.imul(W,ot)|0,I=I+Math.imul(W,Ze)|0,I=I+Math.imul(ie,ot)|0,U=U+Math.imul(ie,Ze)|0,V=V+Math.imul(X,st)|0,I=I+Math.imul(X,Et)|0,I=I+Math.imul(N,st)|0,U=U+Math.imul(N,Et)|0,V=V+Math.imul(fe,At)|0,I=I+Math.imul(fe,yt)|0,I=I+Math.imul(be,At)|0,U=U+Math.imul(be,yt)|0,V=V+Math.imul(M,er)|0,I=I+Math.imul(M,tr)|0,I=I+Math.imul(G,er)|0,U=U+Math.imul(G,tr)|0;var pn=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(pn>>>26)|0,pn&=67108863,V=Math.imul(Ce,ct),I=Math.imul(Ce,ut),I=I+Math.imul(Oe,ct)|0,U=Math.imul(Oe,ut),V=V+Math.imul(le,lt)|0,I=I+Math.imul(le,nt)|0,I=I+Math.imul(_e,lt)|0,U=U+Math.imul(_e,nt)|0,V=V+Math.imul(ve,it)|0,I=I+Math.imul(ve,Xe)|0,I=I+Math.imul(pe,it)|0,U=U+Math.imul(pe,Xe)|0,V=V+Math.imul(Ie,at)|0,I=I+Math.imul(Ie,et)|0,I=I+Math.imul(Be,at)|0,U=U+Math.imul(Be,et)|0,V=V+Math.imul(ue,ot)|0,I=I+Math.imul(ue,Ze)|0,I=I+Math.imul(Ae,ot)|0,U=U+Math.imul(Ae,Ze)|0,V=V+Math.imul(W,st)|0,I=I+Math.imul(W,Et)|0,I=I+Math.imul(ie,st)|0,U=U+Math.imul(ie,Et)|0,V=V+Math.imul(X,At)|0,I=I+Math.imul(X,yt)|0,I=I+Math.imul(N,At)|0,U=U+Math.imul(N,yt)|0,V=V+Math.imul(fe,er)|0,I=I+Math.imul(fe,tr)|0,I=I+Math.imul(be,er)|0,U=U+Math.imul(be,tr)|0;var ri=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(ri>>>26)|0,ri&=67108863,V=Math.imul(Ce,lt),I=Math.imul(Ce,nt),I=I+Math.imul(Oe,lt)|0,U=Math.imul(Oe,nt),V=V+Math.imul(le,it)|0,I=I+Math.imul(le,Xe)|0,I=I+Math.imul(_e,it)|0,U=U+Math.imul(_e,Xe)|0,V=V+Math.imul(ve,at)|0,I=I+Math.imul(ve,et)|0,I=I+Math.imul(pe,at)|0,U=U+Math.imul(pe,et)|0,V=V+Math.imul(Ie,ot)|0,I=I+Math.imul(Ie,Ze)|0,I=I+Math.imul(Be,ot)|0,U=U+Math.imul(Be,Ze)|0,V=V+Math.imul(ue,st)|0,I=I+Math.imul(ue,Et)|0,I=I+Math.imul(Ae,st)|0,U=U+Math.imul(Ae,Et)|0,V=V+Math.imul(W,At)|0,I=I+Math.imul(W,yt)|0,I=I+Math.imul(ie,At)|0,U=U+Math.imul(ie,yt)|0,V=V+Math.imul(X,er)|0,I=I+Math.imul(X,tr)|0,I=I+Math.imul(N,er)|0,U=U+Math.imul(N,tr)|0;var Un=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Un>>>26)|0,Un&=67108863,V=Math.imul(Ce,it),I=Math.imul(Ce,Xe),I=I+Math.imul(Oe,it)|0,U=Math.imul(Oe,Xe),V=V+Math.imul(le,at)|0,I=I+Math.imul(le,et)|0,I=I+Math.imul(_e,at)|0,U=U+Math.imul(_e,et)|0,V=V+Math.imul(ve,ot)|0,I=I+Math.imul(ve,Ze)|0,I=I+Math.imul(pe,ot)|0,U=U+Math.imul(pe,Ze)|0,V=V+Math.imul(Ie,st)|0,I=I+Math.imul(Ie,Et)|0,I=I+Math.imul(Be,st)|0,U=U+Math.imul(Be,Et)|0,V=V+Math.imul(ue,At)|0,I=I+Math.imul(ue,yt)|0,I=I+Math.imul(Ae,At)|0,U=U+Math.imul(Ae,yt)|0,V=V+Math.imul(W,er)|0,I=I+Math.imul(W,tr)|0,I=I+Math.imul(ie,er)|0,U=U+Math.imul(ie,tr)|0;var ki=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(ki>>>26)|0,ki&=67108863,V=Math.imul(Ce,at),I=Math.imul(Ce,et),I=I+Math.imul(Oe,at)|0,U=Math.imul(Oe,et),V=V+Math.imul(le,ot)|0,I=I+Math.imul(le,Ze)|0,I=I+Math.imul(_e,ot)|0,U=U+Math.imul(_e,Ze)|0,V=V+Math.imul(ve,st)|0,I=I+Math.imul(ve,Et)|0,I=I+Math.imul(pe,st)|0,U=U+Math.imul(pe,Et)|0,V=V+Math.imul(Ie,At)|0,I=I+Math.imul(Ie,yt)|0,I=I+Math.imul(Be,At)|0,U=U+Math.imul(Be,yt)|0,V=V+Math.imul(ue,er)|0,I=I+Math.imul(ue,tr)|0,I=I+Math.imul(Ae,er)|0,U=U+Math.imul(Ae,tr)|0;var Di=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Di>>>26)|0,Di&=67108863,V=Math.imul(Ce,ot),I=Math.imul(Ce,Ze),I=I+Math.imul(Oe,ot)|0,U=Math.imul(Oe,Ze),V=V+Math.imul(le,st)|0,I=I+Math.imul(le,Et)|0,I=I+Math.imul(_e,st)|0,U=U+Math.imul(_e,Et)|0,V=V+Math.imul(ve,At)|0,I=I+Math.imul(ve,yt)|0,I=I+Math.imul(pe,At)|0,U=U+Math.imul(pe,yt)|0,V=V+Math.imul(Ie,er)|0,I=I+Math.imul(Ie,tr)|0,I=I+Math.imul(Be,er)|0,U=U+Math.imul(Be,tr)|0;var Ri=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Ri>>>26)|0,Ri&=67108863,V=Math.imul(Ce,st),I=Math.imul(Ce,Et),I=I+Math.imul(Oe,st)|0,U=Math.imul(Oe,Et),V=V+Math.imul(le,At)|0,I=I+Math.imul(le,yt)|0,I=I+Math.imul(_e,At)|0,U=U+Math.imul(_e,yt)|0,V=V+Math.imul(ve,er)|0,I=I+Math.imul(ve,tr)|0,I=I+Math.imul(pe,er)|0,U=U+Math.imul(pe,tr)|0;var Qa=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(Qa>>>26)|0,Qa&=67108863,V=Math.imul(Ce,At),I=Math.imul(Ce,yt),I=I+Math.imul(Oe,At)|0,U=Math.imul(Oe,yt),V=V+Math.imul(le,er)|0,I=I+Math.imul(le,tr)|0,I=I+Math.imul(_e,er)|0,U=U+Math.imul(_e,tr)|0;var eo=(B+V|0)+((I&8191)<<13)|0;B=(U+(I>>>13)|0)+(eo>>>26)|0,eo&=67108863,V=Math.imul(Ce,er),I=Math.imul(Ce,tr),I=I+Math.imul(Oe,er)|0,U=Math.imul(Oe,tr);var to=(B+V|0)+((I&8191)<<13)|0;return B=(U+(I>>>13)|0)+(to>>>26)|0,to&=67108863,A[0]=nn,A[1]=an,A[2]=Nr,A[3]=Vr,A[4]=on,A[5]=Cn,A[6]=Ci,A[7]=Mi,A[8]=Ii,A[9]=Ln,A[10]=pn,A[11]=ri,A[12]=Un,A[13]=ki,A[14]=Di,A[15]=Ri,A[16]=Qa,A[17]=eo,A[18]=to,B!==0&&(A[19]=B,E.length++),E},"comb10MulTo2"),"comb10MulTo");Math.imul||(j=J);function q(b,f,m){m.negative=f.negative^b.negative,m.length=b.length+f.length;for(var E=0,R=0,C=0;C<m.length-1;C++){var A=R;R=0;for(var B=E&67108863,V=Math.min(C,f.length-1),I=Math.max(0,C-b.length+1);I<=V;I++){var U=C-I,ge=b.words[U]|0,L=f.words[I]|0,ne=ge*L,oe=ne&67108863;A=A+(ne/67108864|0)|0,oe=oe+B|0,B=oe&67108863,A=A+(oe>>>26)|0,R+=A>>>26,A&=67108863}m.words[C]=B,E=A,A=R}return E!==0?m.words[C]=E:m.length--,m._strip()}i(q,"bigMulTo"),o(q,"bigMulTo");function Q(b,f,m){return q(b,f,m)}i(Q,"jumboMulTo"),o(Q,"jumboMulTo"),c.prototype.mulTo=o(i(function(f,m){var E,R=this.length+f.length;return this.length===10&&f.length===10?E=j(this,f,m):R<63?E=J(this,f,m):R<1024?E=q(this,f,m):E=Q(this,f,m),E},"mulTo"),"mulTo");function Y(b,f){this.x=b,this.y=f}i(Y,"FFTM"),o(Y,"FFTM"),Y.prototype.makeRBT=o(i(function(f){for(var m=new Array(f),E=c.prototype._countBits(f)-1,R=0;R<f;R++)m[R]=this.revBin(R,E,f);return m},"makeRBT"),"makeRBT"),Y.prototype.revBin=o(i(function(f,m,E){if(f===0||f===E-1)return f;for(var R=0,C=0;C<m;C++)R|=(f&1)<<m-C-1,f>>=1;return R},"revBin"),"revBin"),Y.prototype.permute=o(i(function(f,m,E,R,C,A){for(var B=0;B<A;B++)R[B]=m[f[B]],C[B]=E[f[B]]},"permute"),"permute"),Y.prototype.transform=o(i(function(f,m,E,R,C,A){this.permute(A,f,m,E,R,C);for(var B=1;B<C;B<<=1)for(var V=B<<1,I=Math.cos(2*Math.PI/V),U=Math.sin(2*Math.PI/V),ge=0;ge<C;ge+=V)for(var L=I,ne=U,oe=0;oe<B;oe++){var M=E[ge+oe],G=R[ge+oe],ae=E[ge+oe+B],fe=R[ge+oe+B],be=L*ae-ne*fe;fe=L*fe+ne*ae,ae=be,E[ge+oe]=M+ae,R[ge+oe]=G+fe,E[ge+oe+B]=M-ae,R[ge+oe+B]=G-fe,oe!==V&&(be=I*L-U*ne,ne=I*ne+U*L,L=be)}},"transform"),"transform"),Y.prototype.guessLen13b=o(i(function(f,m){var E=Math.max(m,f)|1,R=E&1,C=0;for(E=E/2|0;E;E=E>>>1)C++;return 1<<C+1+R},"guessLen13b"),"guessLen13b"),Y.prototype.conjugate=o(i(function(f,m,E){if(!(E<=1))for(var R=0;R<E/2;R++){var C=f[R];f[R]=f[E-R-1],f[E-R-1]=C,C=m[R],m[R]=-m[E-R-1],m[E-R-1]=-C}},"conjugate"),"conjugate"),Y.prototype.normalize13b=o(i(function(f,m){for(var E=0,R=0;R<m/2;R++){var C=Math.round(f[2*R+1]/m)*8192+Math.round(f[2*R]/m)+E;f[R]=C&67108863,C<67108864?E=0:E=C/67108864|0}return f},"normalize13b"),"normalize13b"),Y.prototype.convert13b=o(i(function(f,m,E,R){for(var C=0,A=0;A<m;A++)C=C+(f[A]|0),E[2*A]=C&8191,C=C>>>13,E[2*A+1]=C&8191,C=C>>>13;for(A=2*m;A<R;++A)E[A]=0;a(C===0),a((C&-8192)===0)},"convert13b"),"convert13b"),Y.prototype.stub=o(i(function(f){for(var m=new Array(f),E=0;E<f;E++)m[E]=0;return m},"stub"),"stub"),Y.prototype.mulp=o(i(function(f,m,E){var R=2*this.guessLen13b(f.length,m.length),C=this.makeRBT(R),A=this.stub(R),B=new Array(R),V=new Array(R),I=new Array(R),U=new Array(R),ge=new Array(R),L=new Array(R),ne=E.words;ne.length=R,this.convert13b(f.words,f.length,B,R),this.convert13b(m.words,m.length,U,R),this.transform(B,A,V,I,R,C),this.transform(U,A,ge,L,R,C);for(var oe=0;oe<R;oe++){var M=V[oe]*ge[oe]-I[oe]*L[oe];I[oe]=V[oe]*L[oe]+I[oe]*ge[oe],V[oe]=M}return this.conjugate(V,I,R),this.transform(V,I,ne,A,R,C),this.conjugate(ne,A,R),this.normalize13b(ne,R),E.negative=f.negative^m.negative,E.length=f.length+m.length,E._strip()},"mulp"),"mulp"),c.prototype.mul=o(i(function(f){var m=new c(null);return m.words=new Array(this.length+f.length),this.mulTo(f,m)},"mul3"),"mul"),c.prototype.mulf=o(i(function(f){var m=new c(null);return m.words=new Array(this.length+f.length),Q(this,f,m)},"mulf"),"mulf"),c.prototype.imul=o(i(function(f){return this.clone().mulTo(f,this)},"imul"),"imul"),c.prototype.imuln=o(i(function(f){var m=f<0;m&&(f=-f),a(typeof f=="number"),a(f<67108864);for(var E=0,R=0;R<this.length;R++){var C=(this.words[R]|0)*f,A=(C&67108863)+(E&67108863);E>>=26,E+=C/67108864|0,E+=A>>>26,this.words[R]=A&67108863}return E!==0&&(this.words[R]=E,this.length++),m?this.ineg():this},"imuln"),"imuln"),c.prototype.muln=o(i(function(f){return this.clone().imuln(f)},"muln"),"muln"),c.prototype.sqr=o(i(function(){return this.mul(this)},"sqr"),"sqr"),c.prototype.isqr=o(i(function(){return this.imul(this.clone())},"isqr"),"isqr"),c.prototype.pow=o(i(function(f){var m=P(f);if(m.length===0)return new c(1);for(var E=this,R=0;R<m.length&&m[R]===0;R++,E=E.sqr());if(++R<m.length)for(var C=E.sqr();R<m.length;R++,C=C.sqr())m[R]!==0&&(E=E.mul(C));return E},"pow"),"pow"),c.prototype.iushln=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26,R=67108863>>>26-m<<26-m,C;if(m!==0){var A=0;for(C=0;C<this.length;C++){var B=this.words[C]&R,V=(this.words[C]|0)-B<<m;this.words[C]=V|A,A=B>>>26-m}A&&(this.words[C]=A,this.length++)}if(E!==0){for(C=this.length-1;C>=0;C--)this.words[C+E]=this.words[C];for(C=0;C<E;C++)this.words[C]=0;this.length+=E}return this._strip()},"iushln"),"iushln"),c.prototype.ishln=o(i(function(f){return a(this.negative===0),this.iushln(f)},"ishln"),"ishln"),c.prototype.iushrn=o(i(function(f,m,E){a(typeof f=="number"&&f>=0);var R;m?R=(m-m%26)/26:R=0;var C=f%26,A=Math.min((f-C)/26,this.length),B=67108863^67108863>>>C<<C,V=E;if(R-=A,R=Math.max(0,R),V){for(var I=0;I<A;I++)V.words[I]=this.words[I];V.length=A}if(A!==0)if(this.length>A)for(this.length-=A,I=0;I<this.length;I++)this.words[I]=this.words[I+A];else this.words[0]=0,this.length=1;var U=0;for(I=this.length-1;I>=0&&(U!==0||I>=R);I--){var ge=this.words[I]|0;this.words[I]=U<<26-C|ge>>>C,U=ge&B}return V&&U!==0&&(V.words[V.length++]=U),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},"iushrn"),"iushrn"),c.prototype.ishrn=o(i(function(f,m,E){return a(this.negative===0),this.iushrn(f,m,E)},"ishrn"),"ishrn"),c.prototype.shln=o(i(function(f){return this.clone().ishln(f)},"shln"),"shln"),c.prototype.ushln=o(i(function(f){return this.clone().iushln(f)},"ushln"),"ushln"),c.prototype.shrn=o(i(function(f){return this.clone().ishrn(f)},"shrn"),"shrn"),c.prototype.ushrn=o(i(function(f){return this.clone().iushrn(f)},"ushrn"),"ushrn"),c.prototype.testn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26,R=1<<m;if(this.length<=E)return!1;var C=this.words[E];return!!(C&R)},"testn"),"testn"),c.prototype.imaskn=o(i(function(f){a(typeof f=="number"&&f>=0);var m=f%26,E=(f-m)/26;if(a(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(m!==0&&E++,this.length=Math.min(E,this.length),m!==0){var R=67108863^67108863>>>m<<m;this.words[this.length-1]&=R}return this._strip()},"imaskn"),"imaskn"),c.prototype.maskn=o(i(function(f){return this.clone().imaskn(f)},"maskn"),"maskn"),c.prototype.iaddn=o(i(function(f){return a(typeof f=="number"),a(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},"iaddn"),"iaddn"),c.prototype._iaddn=o(i(function(f){this.words[0]+=f;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},"_iaddn"),"_iaddn"),c.prototype.isubn=o(i(function(f){if(a(typeof f=="number"),a(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this._strip()},"isubn"),"isubn"),c.prototype.addn=o(i(function(f){return this.clone().iaddn(f)},"addn"),"addn"),c.prototype.subn=o(i(function(f){return this.clone().isubn(f)},"subn"),"subn"),c.prototype.iabs=o(i(function(){return this.negative=0,this},"iabs"),"iabs"),c.prototype.abs=o(i(function(){return this.clone().iabs()},"abs"),"abs"),c.prototype._ishlnsubmul=o(i(function(f,m,E){var R=f.length+E,C;this._expand(R);var A,B=0;for(C=0;C<f.length;C++){A=(this.words[C+E]|0)+B;var V=(f.words[C]|0)*m;A-=V&67108863,B=(A>>26)-(V/67108864|0),this.words[C+E]=A&67108863}for(;C<this.length-E;C++)A=(this.words[C+E]|0)+B,B=A>>26,this.words[C+E]=A&67108863;if(B===0)return this._strip();for(a(B===-1),B=0,C=0;C<this.length;C++)A=-(this.words[C]|0)+B,B=A>>26,this.words[C]=A&67108863;return this.negative=1,this._strip()},"_ishlnsubmul"),"_ishlnsubmul"),c.prototype._wordDiv=o(i(function(f,m){var E=this.length-f.length,R=this.clone(),C=f,A=C.words[C.length-1]|0,B=this._countBits(A);E=26-B,E!==0&&(C=C.ushln(E),R.iushln(E),A=C.words[C.length-1]|0);var V=R.length-C.length,I;if(m!=="mod"){I=new c(null),I.length=V+1,I.words=new Array(I.length);for(var U=0;U<I.length;U++)I.words[U]=0}var ge=R.clone()._ishlnsubmul(C,1,V);ge.negative===0&&(R=ge,I&&(I.words[V]=1));for(var L=V-1;L>=0;L--){var ne=(R.words[C.length+L]|0)*67108864+(R.words[C.length+L-1]|0);for(ne=Math.min(ne/A|0,67108863),R._ishlnsubmul(C,ne,L);R.negative!==0;)ne--,R.negative=0,R._ishlnsubmul(C,1,L),R.isZero()||(R.negative^=1);I&&(I.words[L]=ne)}return I&&I._strip(),R._strip(),m!=="div"&&E!==0&&R.iushrn(E),{div:I||null,mod:R}},"_wordDiv"),"_wordDiv"),c.prototype.divmod=o(i(function(f,m,E){if(a(!f.isZero()),this.isZero())return{div:new c(0),mod:new c(0)};var R,C,A;return this.negative!==0&&f.negative===0?(A=this.neg().divmod(f,m),m!=="mod"&&(R=A.div.neg()),m!=="div"&&(C=A.mod.neg(),E&&C.negative!==0&&C.iadd(f)),{div:R,mod:C}):this.negative===0&&f.negative!==0?(A=this.divmod(f.neg(),m),m!=="mod"&&(R=A.div.neg()),{div:R,mod:A.mod}):(this.negative&f.negative)!==0?(A=this.neg().divmod(f.neg(),m),m!=="div"&&(C=A.mod.neg(),E&&C.negative!==0&&C.isub(f)),{div:A.div,mod:C}):f.length>this.length||this.cmp(f)<0?{div:new c(0),mod:this}:f.length===1?m==="div"?{div:this.divn(f.words[0]),mod:null}:m==="mod"?{div:null,mod:new c(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new c(this.modrn(f.words[0]))}:this._wordDiv(f,m)},"divmod"),"divmod"),c.prototype.div=o(i(function(f){return this.divmod(f,"div",!1).div},"div"),"div"),c.prototype.mod=o(i(function(f){return this.divmod(f,"mod",!1).mod},"mod2"),"mod"),c.prototype.umod=o(i(function(f){return this.divmod(f,"mod",!0).mod},"umod"),"umod"),c.prototype.divRound=o(i(function(f){var m=this.divmod(f);if(m.mod.isZero())return m.div;var E=m.div.negative!==0?m.mod.isub(f):m.mod,R=f.ushrn(1),C=f.andln(1),A=E.cmp(R);return A<0||C===1&&A===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},"divRound"),"divRound"),c.prototype.modrn=o(i(function(f){var m=f<0;m&&(f=-f),a(f<=67108863);for(var E=(1<<26)%f,R=0,C=this.length-1;C>=0;C--)R=(E*R+(this.words[C]|0))%f;return m?-R:R},"modrn"),"modrn"),c.prototype.modn=o(i(function(f){return this.modrn(f)},"modn"),"modn"),c.prototype.idivn=o(i(function(f){var m=f<0;m&&(f=-f),a(f<=67108863);for(var E=0,R=this.length-1;R>=0;R--){var C=(this.words[R]|0)+E*67108864;this.words[R]=C/f|0,E=C%f}return this._strip(),m?this.ineg():this},"idivn"),"idivn"),c.prototype.divn=o(i(function(f){return this.clone().idivn(f)},"divn"),"divn"),c.prototype.egcd=o(i(function(f){a(f.negative===0),a(!f.isZero());var m=this,E=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var R=new c(1),C=new c(0),A=new c(0),B=new c(1),V=0;m.isEven()&&E.isEven();)m.iushrn(1),E.iushrn(1),++V;for(var I=E.clone(),U=m.clone();!m.isZero();){for(var ge=0,L=1;(m.words[0]&L)===0&&ge<26;++ge,L<<=1);if(ge>0)for(m.iushrn(ge);ge-- >0;)(R.isOdd()||C.isOdd())&&(R.iadd(I),C.isub(U)),R.iushrn(1),C.iushrn(1);for(var ne=0,oe=1;(E.words[0]&oe)===0&&ne<26;++ne,oe<<=1);if(ne>0)for(E.iushrn(ne);ne-- >0;)(A.isOdd()||B.isOdd())&&(A.iadd(I),B.isub(U)),A.iushrn(1),B.iushrn(1);m.cmp(E)>=0?(m.isub(E),R.isub(A),C.isub(B)):(E.isub(m),A.isub(R),B.isub(C))}return{a:A,b:B,gcd:E.iushln(V)}},"egcd"),"egcd"),c.prototype._invmp=o(i(function(f){a(f.negative===0),a(!f.isZero());var m=this,E=f.clone();m.negative!==0?m=m.umod(f):m=m.clone();for(var R=new c(1),C=new c(0),A=E.clone();m.cmpn(1)>0&&E.cmpn(1)>0;){for(var B=0,V=1;(m.words[0]&V)===0&&B<26;++B,V<<=1);if(B>0)for(m.iushrn(B);B-- >0;)R.isOdd()&&R.iadd(A),R.iushrn(1);for(var I=0,U=1;(E.words[0]&U)===0&&I<26;++I,U<<=1);if(I>0)for(E.iushrn(I);I-- >0;)C.isOdd()&&C.iadd(A),C.iushrn(1);m.cmp(E)>=0?(m.isub(E),R.isub(C)):(E.isub(m),C.isub(R))}var ge;return m.cmpn(1)===0?ge=R:ge=C,ge.cmpn(0)<0&&ge.iadd(f),ge},"_invmp"),"_invmp"),c.prototype.gcd=o(i(function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var m=this.clone(),E=f.clone();m.negative=0,E.negative=0;for(var R=0;m.isEven()&&E.isEven();R++)m.iushrn(1),E.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;E.isEven();)E.iushrn(1);var C=m.cmp(E);if(C<0){var A=m;m=E,E=A}else if(C===0||E.cmpn(1)===0)break;m.isub(E)}while(!0);return E.iushln(R)},"gcd"),"gcd"),c.prototype.invm=o(i(function(f){return this.egcd(f).a.umod(f)},"invm"),"invm"),c.prototype.isEven=o(i(function(){return(this.words[0]&1)===0},"isEven"),"isEven"),c.prototype.isOdd=o(i(function(){return(this.words[0]&1)===1},"isOdd"),"isOdd"),c.prototype.andln=o(i(function(f){return this.words[0]&f},"andln"),"andln"),c.prototype.bincn=o(i(function(f){a(typeof f=="number");var m=f%26,E=(f-m)/26,R=1<<m;if(this.length<=E)return this._expand(E+1),this.words[E]|=R,this;for(var C=R,A=E;C!==0&&A<this.length;A++){var B=this.words[A]|0;B+=C,C=B>>>26,B&=67108863,this.words[A]=B}return C!==0&&(this.words[A]=C,this.length++),this},"bincn"),"bincn"),c.prototype.isZero=o(i(function(){return this.length===1&&this.words[0]===0},"isZero"),"isZero"),c.prototype.cmpn=o(i(function(f){var m=f<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this._strip();var E;if(this.length>1)E=1;else{m&&(f=-f),a(f<=67108863,"Number is too big");var R=this.words[0]|0;E=R===f?0:R<f?-1:1}return this.negative!==0?-E|0:E},"cmpn"),"cmpn"),c.prototype.cmp=o(i(function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var m=this.ucmp(f);return this.negative!==0?-m|0:m},"cmp"),"cmp"),c.prototype.ucmp=o(i(function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var m=0,E=this.length-1;E>=0;E--){var R=this.words[E]|0,C=f.words[E]|0;if(R!==C){R<C?m=-1:R>C&&(m=1);break}}return m},"ucmp"),"ucmp"),c.prototype.gtn=o(i(function(f){return this.cmpn(f)===1},"gtn"),"gtn"),c.prototype.gt=o(i(function(f){return this.cmp(f)===1},"gt"),"gt"),c.prototype.gten=o(i(function(f){return this.cmpn(f)>=0},"gten"),"gten"),c.prototype.gte=o(i(function(f){return this.cmp(f)>=0},"gte"),"gte"),c.prototype.ltn=o(i(function(f){return this.cmpn(f)===-1},"ltn"),"ltn"),c.prototype.lt=o(i(function(f){return this.cmp(f)===-1},"lt"),"lt"),c.prototype.lten=o(i(function(f){return this.cmpn(f)<=0},"lten"),"lten"),c.prototype.lte=o(i(function(f){return this.cmp(f)<=0},"lte"),"lte"),c.prototype.eqn=o(i(function(f){return this.cmpn(f)===0},"eqn"),"eqn"),c.prototype.eq=o(i(function(f){return this.cmp(f)===0},"eq4"),"eq"),c.red=o(i(function(f){return new w(f)},"red"),"red"),c.prototype.toRed=o(i(function(f){return a(!this.red,"Already a number in reduction context"),a(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},"toRed"),"toRed"),c.prototype.fromRed=o(i(function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},"fromRed"),"fromRed"),c.prototype._forceRed=o(i(function(f){return this.red=f,this},"_forceRed"),"_forceRed"),c.prototype.forceRed=o(i(function(f){return a(!this.red,"Already a number in reduction context"),this._forceRed(f)},"forceRed"),"forceRed"),c.prototype.redAdd=o(i(function(f){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},"redAdd"),"redAdd"),c.prototype.redIAdd=o(i(function(f){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},"redIAdd"),"redIAdd"),c.prototype.redSub=o(i(function(f){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},"redSub"),"redSub"),c.prototype.redISub=o(i(function(f){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},"redISub"),"redISub"),c.prototype.redShl=o(i(function(f){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},"redShl"),"redShl"),c.prototype.redMul=o(i(function(f){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},"redMul"),"redMul"),c.prototype.redIMul=o(i(function(f){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},"redIMul"),"redIMul"),c.prototype.redSqr=o(i(function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},"redSqr"),"redSqr"),c.prototype.redISqr=o(i(function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},"redISqr"),"redISqr"),c.prototype.redSqrt=o(i(function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},"redSqrt"),"redSqrt"),c.prototype.redInvm=o(i(function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},"redInvm"),"redInvm"),c.prototype.redNeg=o(i(function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},"redNeg"),"redNeg"),c.prototype.redPow=o(i(function(f){return a(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)},"redPow"),"redPow");var k={k256:null,p224:null,p192:null,p25519:null};function K(b,f){this.name=b,this.p=new c(f,16),this.n=this.p.bitLength(),this.k=new c(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}i(K,"MPrime"),o(K,"MPrime"),K.prototype._tmp=o(i(function(){var f=new c(null);return f.words=new Array(Math.ceil(this.n/13)),f},"_tmp"),"_tmp"),K.prototype.ireduce=o(i(function(f){var m=f,E;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),E=m.bitLength();while(E>this.n);var R=E<this.n?-1:m.ucmp(this.p);return R===0?(m.words[0]=0,m.length=1):R>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},"ireduce"),"ireduce"),K.prototype.split=o(i(function(f,m){f.iushrn(this.n,0,m)},"split"),"split"),K.prototype.imulK=o(i(function(f){return f.imul(this.k)},"imulK"),"imulK");function he(){K.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(he,"K256"),o(he,"K256"),s(he,K),he.prototype.split=o(i(function(f,m){for(var E=4194303,R=Math.min(f.length,9),C=0;C<R;C++)m.words[C]=f.words[C];if(m.length=R,f.length<=9){f.words[0]=0,f.length=1;return}var A=f.words[9];for(m.words[m.length++]=A&E,C=10;C<f.length;C++){var B=f.words[C]|0;f.words[C-10]=(B&E)<<4|A>>>22,A=B}A>>>=22,f.words[C-10]=A,A===0&&f.length>10?f.length-=10:f.length-=9},"split"),"split"),he.prototype.imulK=o(i(function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var m=0,E=0;E<f.length;E++){var R=f.words[E]|0;m+=R*977,f.words[E]=m&67108863,m=R*64+(m/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f},"imulK"),"imulK");function me(){K.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(me,"P224"),o(me,"P224"),s(me,K);function we(){K.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(we,"P192"),o(we,"P192"),s(we,K);function Z(){K.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(Z,"P25519"),o(Z,"P25519"),s(Z,K),Z.prototype.imulK=o(i(function(f){for(var m=0,E=0;E<f.length;E++){var R=(f.words[E]|0)*19+m,C=R&67108863;R>>>=26,f.words[E]=C,m=R}return m!==0&&(f.words[f.length++]=m),f},"imulK"),"imulK"),c._prime=o(i(function(f){if(k[f])return k[f];var m;if(f==="k256")m=new he;else if(f==="p224")m=new me;else if(f==="p192")m=new we;else if(f==="p25519")m=new Z;else throw new Error("Unknown prime "+f);return k[f]=m,m},"prime"),"prime");function w(b){if(typeof b=="string"){var f=c._prime(b);this.m=f.p,this.prime=f}else a(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}i(w,"Red"),o(w,"Red"),w.prototype._verify1=o(i(function(f){a(f.negative===0,"red works only with positives"),a(f.red,"red works only with red numbers")},"_verify1"),"_verify1"),w.prototype._verify2=o(i(function(f,m){a((f.negative|m.negative)===0,"red works only with positives"),a(f.red&&f.red===m.red,"red works only with red numbers")},"_verify2"),"_verify2"),w.prototype.imod=o(i(function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(v(f,f.umod(this.m)._forceRed(this)),f)},"imod"),"imod"),w.prototype.neg=o(i(function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},"neg3"),"neg"),w.prototype.add=o(i(function(f,m){this._verify2(f,m);var E=f.add(m);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},"add3"),"add"),w.prototype.iadd=o(i(function(f,m){this._verify2(f,m);var E=f.iadd(m);return E.cmp(this.m)>=0&&E.isub(this.m),E},"iadd"),"iadd"),w.prototype.sub=o(i(function(f,m){this._verify2(f,m);var E=f.sub(m);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},"sub"),"sub"),w.prototype.isub=o(i(function(f,m){this._verify2(f,m);var E=f.isub(m);return E.cmpn(0)<0&&E.iadd(this.m),E},"isub"),"isub"),w.prototype.shl=o(i(function(f,m){return this._verify1(f),this.imod(f.ushln(m))},"shl"),"shl"),w.prototype.imul=o(i(function(f,m){return this._verify2(f,m),this.imod(f.imul(m))},"imul"),"imul"),w.prototype.mul=o(i(function(f,m){return this._verify2(f,m),this.imod(f.mul(m))},"mul3"),"mul"),w.prototype.isqr=o(i(function(f){return this.imul(f,f.clone())},"isqr"),"isqr"),w.prototype.sqr=o(i(function(f){return this.mul(f,f)},"sqr"),"sqr"),w.prototype.sqrt=o(i(function(f){if(f.isZero())return f.clone();var m=this.m.andln(3);if(a(m%2===1),m===3){var E=this.m.add(new c(1)).iushrn(2);return this.pow(f,E)}for(var R=this.m.subn(1),C=0;!R.isZero()&&R.andln(1)===0;)C++,R.iushrn(1);a(!R.isZero());var A=new c(1).toRed(this),B=A.redNeg(),V=this.m.subn(1).iushrn(1),I=this.m.bitLength();for(I=new c(2*I*I).toRed(this);this.pow(I,V).cmp(B)!==0;)I.redIAdd(B);for(var U=this.pow(I,R),ge=this.pow(f,R.addn(1).iushrn(1)),L=this.pow(f,R),ne=C;L.cmp(A)!==0;){for(var oe=L,M=0;oe.cmp(A)!==0;M++)oe=oe.redSqr();a(M<ne);var G=this.pow(U,new c(1).iushln(ne-M-1));ge=ge.redMul(G),U=G.redSqr(),L=L.redMul(U),ne=M}return ge},"sqrt"),"sqrt"),w.prototype.invm=o(i(function(f){var m=f._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},"invm"),"invm"),w.prototype.pow=o(i(function(f,m){if(m.isZero())return new c(1).toRed(this);if(m.cmpn(1)===0)return f.clone();var E=4,R=new Array(1<<E);R[0]=new c(1).toRed(this),R[1]=f;for(var C=2;C<R.length;C++)R[C]=this.mul(R[C-1],f);var A=R[0],B=0,V=0,I=m.bitLength()%26;for(I===0&&(I=26),C=m.length-1;C>=0;C--){for(var U=m.words[C],ge=I-1;ge>=0;ge--){var L=U>>ge&1;if(A!==R[0]&&(A=this.sqr(A)),L===0&&B===0){V=0;continue}B<<=1,B|=L,V++,!(V!==E&&(C!==0||ge!==0))&&(A=this.mul(A,R[B]),V=0,B=0)}I=26}return A},"pow"),"pow"),w.prototype.convertTo=o(i(function(f){var m=f.umod(this.m);return m===f?m.clone():m},"convertTo"),"convertTo"),w.prototype.convertFrom=o(i(function(f){var m=f.clone();return m.red=null,m},"convertFrom"),"convertFrom"),c.mont=o(i(function(f){return new T(f)},"mont"),"mont");function T(b){w.call(this,b),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"),o(T,"Mont"),s(T,w),T.prototype.convertTo=o(i(function(f){return this.imod(f.ushln(this.shift))},"convertTo"),"convertTo"),T.prototype.convertFrom=o(i(function(f){var m=this.imod(f.mul(this.rinv));return m.red=null,m},"convertFrom"),"convertFrom"),T.prototype.imul=o(i(function(f,m){if(f.isZero()||m.isZero())return f.words[0]=0,f.length=1,f;var E=f.imul(m),R=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(R).iushrn(this.shift),A=C;return C.cmp(this.m)>=0?A=C.isub(this.m):C.cmpn(0)<0&&(A=C.iadd(this.m)),A._forceRed(this)},"imul"),"imul"),T.prototype.mul=o(i(function(f,m){if(f.isZero()||m.isZero())return new c(0)._forceRed(this);var E=f.mul(m),R=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=E.isub(R).iushrn(this.shift),A=C;return C.cmp(this.m)>=0?A=C.isub(this.m):C.cmpn(0)<0&&(A=C.iadd(this.m)),A._forceRed(this)},"mul3"),"mul"),T.prototype.invm=o(i(function(f){var m=this.imod(f._invmp(this.m).mul(this.r2));return m._forceRed(this)},"invm"),"invm")})(typeof t>"u"||t,e)}}),x$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,a=~n,s=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 g=p;l>=s;)h[p++]=l&255|r,l/=128;for(;l&a;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-g+1,h}i(c,"encode9"),o(c,"encode")}}),T$=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){t.exports=a;var r=128,n=127;function a(s,h){var l=0,h=h||0,p=0,g=h,v,y=s.length;do{if(g>=y||p>49)throw a.bytes=0,new RangeError("Could not decode varint");v=s[g++],l+=p<28?(v&n)<<p:(v&n)*Math.pow(2,p),p+=7}while(v>=r);return a.bytes=g-h,l}i(a,"read2"),o(a,"read")}}),C$=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),a=Math.pow(2,21),s=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),g=Math.pow(2,63);t.exports=function(v){return v<r?1:v<n?2:v<a?3:v<s?4:v<c?5:v<l?6:v<h?7:v<p?8:v<g?9:10}}}),xm=ze({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){t.exports={encode:x$(),decode:T$(),encodingLength:C$()}}}),M$=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 a=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(l){return function(h){return function(p,g){var v={key:p,value:h[p]},y={key:g,value:h[g]};return l(v,y)}}}(n.cmp),c=[];return o(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,g;if(Array.isArray(h)){for(g="[",p=0;p<h.length;p++)p&&(g+=","),g+=l(h[p])||"null";return g+"]"}if(h===null)return"null";if(c.indexOf(h)!==-1){if(a)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var v=c.push(h)-1,y=Object.keys(h).sort(s&&s(h));for(g="",p=0;p<y.length;p++){var _=y[p],x=l(h[_]);!x||(g&&(g+=","),g+=JSON.stringify(_)+":"+x)}return c.splice(v,1),"{"+g+"}"}},"stringify2"),"stringify")(r)}}}),Sd=ze({"../../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js"(e,t){var r=200,n="__lodash_hash_undefined__",a=9007199254740991,s="[object Arguments]",c="[object Array]",l="[object Boolean]",h="[object Date]",p="[object Error]",g="[object Function]",v="[object GeneratorFunction]",y="[object Map]",_="[object Number]",x="[object Object]",O="[object Promise]",D="[object RegExp]",P="[object Set]",J="[object String]",j="[object Symbol]",q="[object WeakMap]",Q="[object ArrayBuffer]",Y="[object DataView]",k="[object Float32Array]",K="[object Float64Array]",he="[object Int8Array]",me="[object Int16Array]",we="[object Int32Array]",Z="[object Uint8Array]",w="[object Uint8ClampedArray]",T="[object Uint16Array]",b="[object Uint32Array]",f=/[\\^$.*+?()[\]{}|]/g,m=/\w*$/,E=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,C={};C[s]=C[c]=C[Q]=C[Y]=C[l]=C[h]=C[k]=C[K]=C[he]=C[me]=C[we]=C[y]=C[_]=C[x]=C[D]=C[P]=C[J]=C[j]=C[Z]=C[w]=C[T]=C[b]=!0,C[p]=C[g]=C[q]=!1;var A=typeof global=="object"&&global&&global.Object===Object&&global,B=typeof self=="object"&&self&&self.Object===Object&&self,V=A||B||Function("return this")(),I=typeof e=="object"&&e&&!e.nodeType&&e,U=I&&typeof t=="object"&&t&&!t.nodeType&&t,ge=U&&U.exports===I;function L(de,Me){return de.set(Me[0],Me[1]),de}i(L,"addMapEntry"),o(L,"addMapEntry");function ne(de,Me){return de.add(Me),de}i(ne,"addSetEntry"),o(ne,"addSetEntry");function oe(de,Me){for(var Le=-1,ht=de?de.length:0;++Le<ht&&Me(de[Le],Le,de)!==!1;);return de}i(oe,"arrayEach"),o(oe,"arrayEach");function M(de,Me){for(var Le=-1,ht=Me.length,Kr=de.length;++Le<ht;)de[Kr+Le]=Me[Le];return de}i(M,"arrayPush"),o(M,"arrayPush");function G(de,Me,Le,ht){var Kr=-1,sn=de?de.length:0;for(ht&&sn&&(Le=de[++Kr]);++Kr<sn;)Le=Me(Le,de[Kr],Kr,de);return Le}i(G,"arrayReduce"),o(G,"arrayReduce");function ae(de,Me){for(var Le=-1,ht=Array(de);++Le<de;)ht[Le]=Me(Le);return ht}i(ae,"baseTimes"),o(ae,"baseTimes");function fe(de,Me){return de?.[Me]}i(fe,"getValue"),o(fe,"getValue");function be(de){var Me=!1;if(de!=null&&typeof de.toString!="function")try{Me=!!(de+"")}catch{}return Me}i(be,"isHostObject"),o(be,"isHostObject");function Re(de){var Me=-1,Le=Array(de.size);return de.forEach(function(ht,Kr){Le[++Me]=[Kr,ht]}),Le}i(Re,"mapToArray"),o(Re,"mapToArray");function X(de,Me){return function(Le){return de(Me(Le))}}i(X,"overArg"),o(X,"overArg");function N(de){var Me=-1,Le=Array(de.size);return de.forEach(function(ht){Le[++Me]=ht}),Le}i(N,"setToArray"),o(N,"setToArray");var F=Array.prototype,W=Function.prototype,ie=Object.prototype,ee=V["__core-js_shared__"],ue=function(){var de=/[^.]+$/.exec(ee&&ee.keys&&ee.keys.IE_PROTO||"");return de?"Symbol(src)_1."+de:""}(),Ae=W.toString,De=ie.hasOwnProperty,Ie=ie.toString,Be=RegExp("^"+Ae.call(De).replace(f,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),qe=ge?V.Buffer:void 0,ve=V.Symbol,pe=V.Uint8Array,re=X(Object.getPrototypeOf,Object),le=Object.create,_e=ie.propertyIsEnumerable,Te=F.splice,Ce=Object.getOwnPropertySymbols,Oe=qe?qe.isBuffer:void 0,Ct=X(Object.keys,Object),Ve=Zi(V,"DataView"),He=Zi(V,"Map"),Ot=Zi(V,"Promise"),dt=Zi(V,"Set"),mt=Zi(V,"WeakMap"),Or=Zi(Object,"create"),ct=wa(Ve),ut=wa(He),lr=wa(Ot),lt=wa(dt),nt=wa(mt),or=ve?ve.prototype:void 0,it=or?or.valueOf:void 0;function Xe(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(Xe,"Hash"),o(Xe,"Hash");function Qt(){this.__data__=Or?Or(null):{}}i(Qt,"hashClear"),o(Qt,"hashClear");function at(de){return this.has(de)&&delete this.__data__[de]}i(at,"hashDelete"),o(at,"hashDelete");function et(de){var Me=this.__data__;if(Or){var Le=Me[de];return Le===n?void 0:Le}return De.call(Me,de)?Me[de]:void 0}i(et,"hashGet"),o(et,"hashGet");function sr(de){var Me=this.__data__;return Or?Me[de]!==void 0:De.call(Me,de)}i(sr,"hashHas"),o(sr,"hashHas");function ot(de,Me){var Le=this.__data__;return Le[de]=Or&&Me===void 0?n:Me,this}i(ot,"hashSet"),o(ot,"hashSet"),Xe.prototype.clear=Qt,Xe.prototype.delete=at,Xe.prototype.get=et,Xe.prototype.has=sr,Xe.prototype.set=ot;function Ze(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(Ze,"ListCache"),o(Ze,"ListCache");function cr(){this.__data__=[]}i(cr,"listCacheClear"),o(cr,"listCacheClear");function st(de){var Me=this.__data__,Le=pn(Me,de);if(Le<0)return!1;var ht=Me.length-1;return Le==ht?Me.pop():Te.call(Me,Le,1),!0}i(st,"listCacheDelete"),o(st,"listCacheDelete");function Et(de){var Me=this.__data__,Le=pn(Me,de);return Le<0?void 0:Me[Le][1]}i(Et,"listCacheGet"),o(Et,"listCacheGet");function Tn(de){return pn(this.__data__,de)>-1}i(Tn,"listCacheHas"),o(Tn,"listCacheHas");function At(de,Me){var Le=this.__data__,ht=pn(Le,de);return ht<0?Le.push([de,Me]):Le[ht][1]=Me,this}i(At,"listCacheSet"),o(At,"listCacheSet"),Ze.prototype.clear=cr,Ze.prototype.delete=st,Ze.prototype.get=Et,Ze.prototype.has=Tn,Ze.prototype.set=At;function yt(de){var Me=-1,Le=de?de.length:0;for(this.clear();++Me<Le;){var ht=de[Me];this.set(ht[0],ht[1])}}i(yt,"MapCache"),o(yt,"MapCache");function hn(){this.__data__={hash:new Xe,map:new(He||Ze),string:new Xe}}i(hn,"mapCacheClear"),o(hn,"mapCacheClear");function er(de){return ro(this,de).delete(de)}i(er,"mapCacheDelete"),o(er,"mapCacheDelete");function tr(de){return ro(this,de).get(de)}i(tr,"mapCacheGet"),o(tr,"mapCacheGet");function nn(de){return ro(this,de).has(de)}i(nn,"mapCacheHas"),o(nn,"mapCacheHas");function an(de,Me){return ro(this,de).set(de,Me),this}i(an,"mapCacheSet"),o(an,"mapCacheSet"),yt.prototype.clear=hn,yt.prototype.delete=er,yt.prototype.get=tr,yt.prototype.has=nn,yt.prototype.set=an;function Nr(de){this.__data__=new Ze(de)}i(Nr,"Stack"),o(Nr,"Stack");function Vr(){this.__data__=new Ze}i(Vr,"stackClear"),o(Vr,"stackClear");function on(de){return this.__data__.delete(de)}i(on,"stackDelete"),o(on,"stackDelete");function Cn(de){return this.__data__.get(de)}i(Cn,"stackGet"),o(Cn,"stackGet");function Ci(de){return this.__data__.has(de)}i(Ci,"stackHas"),o(Ci,"stackHas");function Mi(de,Me){var Le=this.__data__;if(Le instanceof Ze){var ht=Le.__data__;if(!He||ht.length<r-1)return ht.push([de,Me]),this;Le=this.__data__=new yt(ht)}return Le.set(de,Me),this}i(Mi,"stackSet"),o(Mi,"stackSet"),Nr.prototype.clear=Vr,Nr.prototype.delete=on,Nr.prototype.get=Cn,Nr.prototype.has=Ci,Nr.prototype.set=Mi;function Ii(de,Me){var Le=Rl(de)||jd(de)?ae(de.length,String):[],ht=Le.length,Kr=!!ht;for(var sn in de)(Me||De.call(de,sn))&&!(Kr&&(sn=="length"||Ml(sn,ht)))&&Le.push(sn);return Le}i(Ii,"arrayLikeKeys"),o(Ii,"arrayLikeKeys");function Ln(de,Me,Le){var ht=de[Me];(!(De.call(de,Me)&&qc(ht,Le))||Le===void 0&&!(Me in de))&&(de[Me]=Le)}i(Ln,"assignValue"),o(Ln,"assignValue");function pn(de,Me){for(var Le=de.length;Le--;)if(qc(de[Le][0],Me))return Le;return-1}i(pn,"assocIndexOf"),o(pn,"assocIndexOf");function ri(de,Me){return de&&Os(Me,Vc(Me),de)}i(ri,"baseAssign"),o(ri,"baseAssign");function Un(de,Me,Le,ht,Kr,sn,Mn){var mn;if(ht&&(mn=sn?ht(de,Kr,sn,Mn):ht(de)),mn!==void 0)return mn;if(!Ns(de))return de;var Fr=Rl(de);if(Fr){if(mn=Tl(de),!Me)return Sl(de,mn)}else{var _a=ba(de),Ea=_a==g||_a==v;if(Nl(de))return to(de,Me);if(_a==x||_a==s||Ea&&!sn){if(be(de))return sn?de:{};if(mn=Ud(Ea?{}:de),!Me)return Ld(de,ri(mn,de))}else{if(!C[_a])return sn?de:{};mn=Cl(de,_a,Un,Me)}}Mn||(Mn=new Nr);var Bl=Mn.get(de);if(Bl)return Bl;if(Mn.set(de,mn),!Fr)var Kc=Le?xl(de):Vc(de);return oe(Kc||de,function(gn,Ps){Kc&&(Ps=gn,gn=de[Ps]),Ln(mn,Ps,Un(gn,Me,Le,ht,Ps,de,Mn))}),mn}i(Un,"baseClone"),o(Un,"baseClone");function ki(de){return Ns(de)?le(de):{}}i(ki,"baseCreate"),o(ki,"baseCreate");function Di(de,Me,Le){var ht=Me(de);return Rl(de)?ht:M(ht,Le(de))}i(Di,"baseGetAllKeys"),o(Di,"baseGetAllKeys");function Ri(de){return Ie.call(de)}i(Ri,"baseGetTag"),o(Ri,"baseGetTag");function Qa(de){if(!Ns(de)||kl(de))return!1;var Me=Pl(de)||be(de)?Be:E;return Me.test(wa(de))}i(Qa,"baseIsNative"),o(Qa,"baseIsNative");function eo(de){if(!Dl(de))return Ct(de);var Me=[];for(var Le in Object(de))De.call(de,Le)&&Le!="constructor"&&Me.push(Le);return Me}i(eo,"baseKeys"),o(eo,"baseKeys");function to(de,Me){if(Me)return de.slice();var Le=new de.constructor(de.length);return de.copy(Le),Le}i(to,"cloneBuffer"),o(to,"cloneBuffer");function Po(de){var Me=new de.constructor(de.byteLength);return new pe(Me).set(new pe(de)),Me}i(Po,"cloneArrayBuffer"),o(Po,"cloneArrayBuffer");function Pd(de,Me){var Le=Me?Po(de.buffer):de.buffer;return new de.constructor(Le,de.byteOffset,de.byteLength)}i(Pd,"cloneDataView"),o(Pd,"cloneDataView");function _l(de,Me,Le){var ht=Me?Le(Re(de),!0):Re(de);return G(ht,L,new de.constructor)}i(_l,"cloneMap"),o(_l,"cloneMap");function Rs(de){var Me=new de.constructor(de.source,m.exec(de));return Me.lastIndex=de.lastIndex,Me}i(Rs,"cloneRegExp"),o(Rs,"cloneRegExp");function El(de,Me,Le){var ht=Me?Le(N(de),!0):N(de);return G(ht,ne,new de.constructor)}i(El,"cloneSet"),o(El,"cloneSet");function Bd(de){return it?Object(it.call(de)):{}}i(Bd,"cloneSymbol"),o(Bd,"cloneSymbol");function Al(de,Me){var Le=Me?Po(de.buffer):de.buffer;return new de.constructor(Le,de.byteOffset,de.length)}i(Al,"cloneTypedArray"),o(Al,"cloneTypedArray");function Sl(de,Me){var Le=-1,ht=de.length;for(Me||(Me=Array(ht));++Le<ht;)Me[Le]=de[Le];return Me}i(Sl,"copyArray"),o(Sl,"copyArray");function Os(de,Me,Le,ht){Le||(Le={});for(var Kr=-1,sn=Me.length;++Kr<sn;){var Mn=Me[Kr],mn=ht?ht(Le[Mn],de[Mn],Mn,Le,de):void 0;Ln(Le,Mn,mn===void 0?de[Mn]:mn)}return Le}i(Os,"copyObject"),o(Os,"copyObject");function Ld(de,Me){return Os(de,no(de),Me)}i(Ld,"copySymbols"),o(Ld,"copySymbols");function xl(de){return Di(de,Vc,no)}i(xl,"getAllKeys"),o(xl,"getAllKeys");function ro(de,Me){var Le=de.__data__;return Il(Me)?Le[typeof Me=="string"?"string":"hash"]:Le.map}i(ro,"getMapData"),o(ro,"getMapData");function Zi(de,Me){var Le=fe(de,Me);return Qa(Le)?Le:void 0}i(Zi,"getNative"),o(Zi,"getNative");var no=Ce?X(Ce,Object):wr,ba=Ri;(Ve&&ba(new Ve(new ArrayBuffer(1)))!=Y||He&&ba(new He)!=y||Ot&&ba(Ot.resolve())!=O||dt&&ba(new dt)!=P||mt&&ba(new mt)!=q)&&(ba=o(function(de){var Me=Ie.call(de),Le=Me==x?de.constructor:void 0,ht=Le?wa(Le):void 0;if(ht)switch(ht){case ct:return Y;case ut:return y;case lr:return O;case lt:return P;case nt:return q}return Me},"getTag"));function Tl(de){var Me=de.length,Le=de.constructor(Me);return Me&&typeof de[0]=="string"&&De.call(de,"index")&&(Le.index=de.index,Le.input=de.input),Le}i(Tl,"initCloneArray"),o(Tl,"initCloneArray");function Ud(de){return typeof de.constructor=="function"&&!Dl(de)?ki(re(de)):{}}i(Ud,"initCloneObject"),o(Ud,"initCloneObject");function Cl(de,Me,Le,ht){var Kr=de.constructor;switch(Me){case Q:return Po(de);case l:case h:return new Kr(+de);case Y:return Pd(de,ht);case k:case K:case he:case me:case we:case Z:case w:case T:case b:return Al(de,ht);case y:return _l(de,ht,Le);case _:case J:return new Kr(de);case D:return Rs(de);case P:return El(de,ht,Le);case j:return Bd(de)}}i(Cl,"initCloneByTag"),o(Cl,"initCloneByTag");function Ml(de,Me){return Me=Me??a,!!Me&&(typeof de=="number"||R.test(de))&&de>-1&&de%1==0&&de<Me}i(Ml,"isIndex"),o(Ml,"isIndex");function Il(de){var Me=typeof de;return Me=="string"||Me=="number"||Me=="symbol"||Me=="boolean"?de!=="__proto__":de===null}i(Il,"isKeyable"),o(Il,"isKeyable");function kl(de){return!!ue&&ue in de}i(kl,"isMasked"),o(kl,"isMasked");function Dl(de){var Me=de&&de.constructor,Le=typeof Me=="function"&&Me.prototype||ie;return de===Le}i(Dl,"isPrototype"),o(Dl,"isPrototype");function wa(de){if(de!=null){try{return Ae.call(de)}catch{}try{return de+""}catch{}}return""}i(wa,"toSource"),o(wa,"toSource");function Fd(de){return Un(de,!0,!0)}i(Fd,"cloneDeep6"),o(Fd,"cloneDeep");function qc(de,Me){return de===Me||de!==de&&Me!==Me}i(qc,"eq4"),o(qc,"eq");function jd(de){return $d(de)&&De.call(de,"callee")&&(!_e.call(de,"callee")||Ie.call(de)==s)}i(jd,"isArguments"),o(jd,"isArguments");var Rl=Array.isArray;function Ol(de){return de!=null&&zd(de.length)&&!Pl(de)}i(Ol,"isArrayLike2"),o(Ol,"isArrayLike");function $d(de){return Hd(de)&&Ol(de)}i($d,"isArrayLikeObject"),o($d,"isArrayLikeObject");var Nl=Oe||vr;function Pl(de){var Me=Ns(de)?Ie.call(de):"";return Me==g||Me==v}i(Pl,"isFunction2"),o(Pl,"isFunction");function zd(de){return typeof de=="number"&&de>-1&&de%1==0&&de<=a}i(zd,"isLength"),o(zd,"isLength");function Ns(de){var Me=typeof de;return!!de&&(Me=="object"||Me=="function")}i(Ns,"isObject"),o(Ns,"isObject");function Hd(de){return!!de&&typeof de=="object"}i(Hd,"isObjectLike"),o(Hd,"isObjectLike");function Vc(de){return Ol(de)?Ii(de):eo(de)}i(Vc,"keys"),o(Vc,"keys");function wr(){return[]}i(wr,"stubArray"),o(wr,"stubArray");function vr(){return!1}i(vr,"stubFalse"),o(vr,"stubFalse"),t.exports=Fd}}),I$=ze({"../../../node_modules/.pnpm/cross-fetch@3.2.0/node_modules/cross-fetch/dist/browser-ponyfill.js"(e,t){var r=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global,n=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return i(s,"F"),o(s,"F"),s.prototype=r,new s}();(function(s){var c=function(l){var h=typeof s<"u"&&s||typeof self<"u"&&self||typeof global<"u"&&global||{},p={searchParams:"URLSearchParams"in h,iterable:"Symbol"in h&&"iterator"in Symbol,blob:"FileReader"in h&&"Blob"in h&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in h,arrayBuffer:"ArrayBuffer"in h};function g(f){return f&&DataView.prototype.isPrototypeOf(f)}if(i(g,"isDataView"),o(g,"isDataView"),p.arrayBuffer)var v=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],y=ArrayBuffer.isView||function(f){return f&&v.indexOf(Object.prototype.toString.call(f))>-1};function _(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(f)||f==="")throw new TypeError('Invalid character in header field name: "'+f+'"');return f.toLowerCase()}i(_,"normalizeName"),o(_,"normalizeName");function x(f){return typeof f!="string"&&(f=String(f)),f}i(x,"normalizeValue"),o(x,"normalizeValue");function O(f){var m={next:function(){var E=f.shift();return{done:E===void 0,value:E}}};return p.iterable&&(m[Symbol.iterator]=function(){return m}),m}i(O,"iteratorFor"),o(O,"iteratorFor");function D(f){this.map={},f instanceof D?f.forEach(function(m,E){this.append(E,m)},this):Array.isArray(f)?f.forEach(function(m){if(m.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+m.length);this.append(m[0],m[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(m){this.append(m,f[m])},this)}i(D,"Headers"),o(D,"Headers"),D.prototype.append=function(f,m){f=_(f),m=x(m);var E=this.map[f];this.map[f]=E?E+", "+m:m},D.prototype.delete=function(f){delete this.map[_(f)]},D.prototype.get=function(f){return f=_(f),this.has(f)?this.map[f]:null},D.prototype.has=function(f){return this.map.hasOwnProperty(_(f))},D.prototype.set=function(f,m){this.map[_(f)]=x(m)},D.prototype.forEach=function(f,m){for(var E in this.map)this.map.hasOwnProperty(E)&&f.call(m,this.map[E],E,this)},D.prototype.keys=function(){var f=[];return this.forEach(function(m,E){f.push(E)}),O(f)},D.prototype.values=function(){var f=[];return this.forEach(function(m){f.push(m)}),O(f)},D.prototype.entries=function(){var f=[];return this.forEach(function(m,E){f.push([E,m])}),O(f)},p.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function P(f){if(!f._noBody){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}}i(P,"consumed"),o(P,"consumed");function J(f){return new Promise(function(m,E){f.onload=function(){m(f.result)},f.onerror=function(){E(f.error)}})}i(J,"fileReaderReady"),o(J,"fileReaderReady");function j(f){var m=new FileReader,E=J(m);return m.readAsArrayBuffer(f),E}i(j,"readBlobAsArrayBuffer"),o(j,"readBlobAsArrayBuffer");function q(f){var m=new FileReader,E=J(m),R=/charset=([A-Za-z0-9_-]+)/.exec(f.type),C=R?R[1]:"utf-8";return m.readAsText(f,C),E}i(q,"readBlobAsText"),o(q,"readBlobAsText");function Q(f){for(var m=new Uint8Array(f),E=new Array(m.length),R=0;R<m.length;R++)E[R]=String.fromCharCode(m[R]);return E.join("")}i(Q,"readArrayBufferAsText"),o(Q,"readArrayBufferAsText");function Y(f){if(f.slice)return f.slice(0);var m=new Uint8Array(f.byteLength);return m.set(new Uint8Array(f)),m.buffer}i(Y,"bufferClone"),o(Y,"bufferClone");function k(){return this.bodyUsed=!1,this._initBody=function(f){this.bodyUsed=this.bodyUsed,this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:p.blob&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:p.formData&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:p.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():p.arrayBuffer&&p.blob&&g(f)?(this._bodyArrayBuffer=Y(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):p.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(f)||y(f))?this._bodyArrayBuffer=Y(f):this._bodyText=f=Object.prototype.toString.call(f):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):p.searchParams&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},p.blob&&(this.blob=function(){var f=P(this);if(f)return f;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(){if(this._bodyArrayBuffer){var f=P(this);return f||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(p.blob)return this.blob().then(j);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var f=P(this);if(f)return f;if(this._bodyBlob)return q(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(Q(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},p.formData&&(this.formData=function(){return this.text().then(we)}),this.json=function(){return this.text().then(JSON.parse)},this}i(k,"Body"),o(k,"Body");var K=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function he(f){var m=f.toUpperCase();return K.indexOf(m)>-1?m:f}i(he,"normalizeMethod"),o(he,"normalizeMethod");function me(f,m){if(!(this instanceof me))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');m=m||{};var E=m.body;if(f instanceof me){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,m.headers||(this.headers=new D(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,!E&&f._bodyInit!=null&&(E=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=m.credentials||this.credentials||"same-origin",(m.headers||!this.headers)&&(this.headers=new D(m.headers)),this.method=he(m.method||this.method||"GET"),this.mode=m.mode||this.mode||null,this.signal=m.signal||this.signal||function(){if("AbortController"in h){var A=new AbortController;return A.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(E),(this.method==="GET"||this.method==="HEAD")&&(m.cache==="no-store"||m.cache==="no-cache")){var R=/([?&])_=[^&]*/;if(R.test(this.url))this.url=this.url.replace(R,"$1_="+new Date().getTime());else{var C=/\?/;this.url+=(C.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}i(me,"Request"),o(me,"Request"),me.prototype.clone=function(){return new me(this,{body:this._bodyInit})};function we(f){var m=new FormData;return f.trim().split("&").forEach(function(E){if(E){var R=E.split("="),C=R.shift().replace(/\+/g," "),A=R.join("=").replace(/\+/g," ");m.append(decodeURIComponent(C),decodeURIComponent(A))}}),m}i(we,"decode9"),o(we,"decode");function Z(f){var m=new D,E=f.replace(/\r?\n[\t ]+/g," ");return E.split("\r").map(function(R){return R.indexOf(`
673
673
  `)===0?R.substr(1,R.length):R}).forEach(function(R){var C=R.split(":"),A=C.shift().trim();if(A){var B=C.join(":").trim();try{m.append(A,B)}catch(V){console.warn("Response "+V.message)}}}),m}i(Z,"parseHeaders"),o(Z,"parseHeaders"),k.call(me.prototype);function w(f,m){if(!(this instanceof w))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(m||(m={}),this.type="default",this.status=m.status===void 0?200:m.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=m.statusText===void 0?"":""+m.statusText,this.headers=new D(m.headers),this.url=m.url||"",this._initBody(f)}i(w,"Response"),o(w,"Response"),k.call(w.prototype),w.prototype.clone=function(){return new w(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},w.error=function(){var f=new w(null,{status:200,statusText:""});return f.ok=!1,f.status=0,f.type="error",f};var T=[301,302,303,307,308];w.redirect=function(f,m){if(T.indexOf(m)===-1)throw new RangeError("Invalid status code");return new w(null,{status:m,headers:{location:f}})},l.DOMException=h.DOMException;try{new l.DOMException}catch{l.DOMException=function(m,E){this.message=m,this.name=E;var R=Error(m);this.stack=R.stack},l.DOMException.prototype=Object.create(Error.prototype),l.DOMException.prototype.constructor=l.DOMException}function b(f,m){return new Promise(function(E,R){var C=new me(f,m);if(C.signal&&C.signal.aborted)return R(new l.DOMException("Aborted","AbortError"));var A=new XMLHttpRequest;function B(){A.abort()}i(B,"abortXhr"),o(B,"abortXhr"),A.onload=function(){var U={statusText:A.statusText,headers:Z(A.getAllResponseHeaders()||"")};C.url.indexOf("file://")===0&&(A.status<200||A.status>599)?U.status=200:U.status=A.status,U.url="responseURL"in A?A.responseURL:U.headers.get("X-Request-URL");var ge="response"in A?A.response:A.responseText;setTimeout(function(){E(new w(ge,U))},0)},A.onerror=function(){setTimeout(function(){R(new TypeError("Network request failed"))},0)},A.ontimeout=function(){setTimeout(function(){R(new TypeError("Network request timed out"))},0)},A.onabort=function(){setTimeout(function(){R(new l.DOMException("Aborted","AbortError"))},0)};function V(U){try{return U===""&&h.location.href?h.location.href:U}catch{return U}}if(i(V,"fixUrl"),o(V,"fixUrl"),A.open(C.method,V(C.url),!0),C.credentials==="include"?A.withCredentials=!0:C.credentials==="omit"&&(A.withCredentials=!1),"responseType"in A&&(p.blob?A.responseType="blob":p.arrayBuffer&&(A.responseType="arraybuffer")),m&&typeof m.headers=="object"&&!(m.headers instanceof D||h.Headers&&m.headers instanceof h.Headers)){var I=[];Object.getOwnPropertyNames(m.headers).forEach(function(U){I.push(_(U)),A.setRequestHeader(U,x(m.headers[U]))}),C.headers.forEach(function(U,ge){I.indexOf(ge)===-1&&A.setRequestHeader(ge,U)})}else C.headers.forEach(function(U,ge){A.setRequestHeader(ge,U)});C.signal&&(C.signal.addEventListener("abort",B),A.onreadystatechange=function(){A.readyState===4&&C.signal.removeEventListener("abort",B)}),A.send(typeof C._bodyInit>"u"?null:C._bodyInit)})}return i(b,"fetch2"),o(b,"fetch"),b.polyfill=!0,h.fetch||(h.fetch=b,h.Headers=D,h.Request=me,h.Response=w),l.Headers=D,l.Request=me,l.Response=w,l.fetch=b,Object.defineProperty(l,"__esModule",{value:!0}),l}({})})(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var a=r.fetch?r:n;e=a.fetch,e.default=a.fetch,e.fetch=a.fetch,e.Headers=a.Headers,e.Request=a.Request,e.Response=a.Response,t.exports=e}}),k$=ze({"../../../node_modules/.pnpm/dataloader@2.2.3/node_modules/dataloader/index.js"(e,t){"use strict";var r=function(){function O(P,J){if(typeof P!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array<key> and returns Promise<Array<value>>, but got: "+P+"."));this._batchLoadFn=P,this._maxBatchSize=p(J),this._batchScheduleFn=g(J),this._cacheKeyFn=v(J),this._cacheMap=y(J),this._batch=null,this.name=_(J)}i(O,"DataLoader3"),o(O,"DataLoader");var D=O.prototype;return D.load=o(i(function(J){if(J==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(J)+"."));var j=s(this),q=this._cacheMap,Q;if(q){Q=this._cacheKeyFn(J);var Y=q.get(Q);if(Y){var k=j.cacheHits||(j.cacheHits=[]);return new Promise(function(he){k.push(function(){he(Y)})})}}j.keys.push(J);var K=new Promise(function(he,me){j.callbacks.push({resolve:he,reject:me})});return q&&q.set(Q,K),K},"load"),"load"),D.loadMany=o(i(function(J){if(!x(J))throw new TypeError("The loader.loadMany() function must be called with Array<key> "+("but got: "+J+"."));for(var j=[],q=0;q<J.length;q++)j.push(this.load(J[q]).catch(function(Q){return Q}));return Promise.all(j)},"loadMany"),"loadMany"),D.clear=o(i(function(J){var j=this._cacheMap;if(j){var q=this._cacheKeyFn(J);j.delete(q)}return this},"clear"),"clear"),D.clearAll=o(i(function(){var J=this._cacheMap;return J&&J.clear(),this},"clearAll"),"clearAll"),D.prime=o(i(function(J,j){var q=this._cacheMap;if(q){var Q=this._cacheKeyFn(J);if(q.get(Q)===void 0){var Y;j instanceof Error?(Y=Promise.reject(j),Y.catch(function(){})):Y=Promise.resolve(j),q.set(Q,Y)}}return this},"prime"),"prime"),O}(),n=typeof process=="object"&&typeof process.nextTick=="function"?function(O){a||(a=Promise.resolve()),a.then(function(){process.nextTick(O)})}:typeof setImmediate=="function"?function(O){setImmediate(O)}:function(O){setTimeout(O)},a;function s(O){var D=O._batch;if(D!==null&&!D.hasDispatched&&D.keys.length<O._maxBatchSize)return D;var P={hasDispatched:!1,keys:[],callbacks:[]};return O._batch=P,O._batchScheduleFn(function(){c(O,P)}),P}i(s,"getCurrentBatch"),o(s,"getCurrentBatch");function c(O,D){if(D.hasDispatched=!0,D.keys.length===0){h(D);return}var P;try{P=O._batchLoadFn(D.keys)}catch(J){return l(O,D,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function "+("errored synchronously: "+String(J)+".")))}if(!P||typeof P.then!="function")return l(O,D,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(P)+".")));P.then(function(J){if(!x(J))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(J)+"."));if(J.length!==D.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."+(`
674
674
 
675
675
  Keys:
676
676
  `+String(D.keys))+(`
677
677
 
678
678
  Values:
679
- `+String(J)));h(D);for(var j=0;j<D.callbacks.length;j++){var q=J[j];q instanceof Error?D.callbacks[j].reject(q):D.callbacks[j].resolve(q)}}).catch(function(J){l(O,D,J)})}i(c,"dispatchBatch"),o(c,"dispatchBatch");function l(O,D,P){h(D);for(var J=0;J<D.keys.length;J++)O.clear(D.keys[J]),D.callbacks[J].reject(P)}i(l,"failedDispatch"),o(l,"failedDispatch");function h(O){if(O.cacheHits)for(var D=0;D<O.cacheHits.length;D++)O.cacheHits[D]()}i(h,"resolveCacheHits"),o(h,"resolveCacheHits");function p(O){var D=!O||O.batch!==!1;if(!D)return 1;var P=O&&O.maxBatchSize;if(P===void 0)return 1/0;if(typeof P!="number"||P<1)throw new TypeError("maxBatchSize must be a positive number: "+P);return P}i(p,"getValidMaxBatchSize"),o(p,"getValidMaxBatchSize");function g(O){var D=O&&O.batchScheduleFn;if(D===void 0)return n;if(typeof D!="function")throw new TypeError("batchScheduleFn must be a function: "+D);return D}i(g,"getValidBatchScheduleFn"),o(g,"getValidBatchScheduleFn");function v(O){var D=O&&O.cacheKeyFn;if(D===void 0)return function(P){return P};if(typeof D!="function")throw new TypeError("cacheKeyFn must be a function: "+D);return D}i(v,"getValidCacheKeyFn"),o(v,"getValidCacheKeyFn");function y(O){var D=!O||O.cache!==!1;if(!D)return null;var P=O&&O.cacheMap;if(P===void 0)return new Map;if(P!==null){var J=["get","set","delete","clear"],j=J.filter(function(q){return P&&typeof P[q]!="function"});if(j.length!==0)throw new TypeError("Custom cacheMap missing methods: "+j.join(", "))}return P}i(y,"getValidCacheMap"),o(y,"getValidCacheMap");function _(O){return O&&O.name?O.name:null}i(_,"getValidName"),o(_,"getValidName");function x(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(x,"isArrayLike2"),o(x,"isArrayLike"),t.exports=r}}),D$=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 a=new Uint8Array(256),s=0;s<a.length;s++)a[s]=255;for(var c=0;c<n.length;c++){var l=n.charAt(c),h=l.charCodeAt(0);if(a[h]!==255)throw new TypeError(l+" is ambiguous");a[h]=c}var p=n.length,g=n.charAt(0),v=Math.log(p)/Math.log(256),y=Math.log(256)/Math.log(p);function _(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var P=0,J=0,j=0,q=D.length;j!==q&&D[j]===0;)j++,P++;for(var Q=(q-j)*y+1>>>0,Y=new Uint8Array(Q);j!==q;){for(var k=D[j],K=0,he=Q-1;(k!==0||K<J)&&he!==-1;he--,K++)k+=256*Y[he]>>>0,Y[he]=k%p>>>0,k=k/p>>>0;if(k!==0)throw new Error("Non-zero carry");J=K,j++}for(var me=Q-J;me!==Q&&Y[me]===0;)me++;for(var we=g.repeat(P);me<Q;++me)we+=n.charAt(Y[me]);return we}i(_,"encode9"),o(_,"encode");function x(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var P=0;if(D[P]!==" "){for(var J=0,j=0;D[P]===g;)J++,P++;for(var q=(D.length-P)*v+1>>>0,Q=new Uint8Array(q);D[P];){var Y=a[D.charCodeAt(P)];if(Y===255)return;for(var k=0,K=q-1;(Y!==0||k<j)&&K!==-1;K--,k++)Y+=p*Q[K]>>>0,Q[K]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");j=k,P++}if(D[P]!==" "){for(var he=q-j;he!==q&&Q[he]===0;)he++;for(var me=new Uint8Array(J+(q-he)),we=J;he!==q;)me[we++]=Q[he++];return me}}}i(x,"decodeUnsafe"),o(x,"decodeUnsafe");function O(D){var P=x(D);if(P)return P;throw new Error("Non-base"+p+" character")}return i(O,"decode9"),o(O,"decode"),{encode:_,decodeUnsafe:x,decode:O}}i(r,"base4"),o(r,"base"),t.exports=r}}),A6=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/util.js"(e,t){"use strict";var r=new TextDecoder,n=o(l=>r.decode(l),"decodeText"),a=new TextEncoder,s=o(l=>a.encode(l),"encodeText");function c(l,h){let p=new Uint8Array(h),g=0;for(let v of l)p.set(v,g),g+=v.length;return p}i(c,"concat4"),o(c,"concat"),t.exports={decodeText:n,encodeText:s,concat:c}}}),R$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/base.js"(e,t){"use strict";var{encodeText:r}=A6(),n=i(class{constructor(a,s,c,l){this.name=a,this.code=s,this.codeBuf=r(this.code),this.alphabet=l,this.codec=c(l)}encode(a){return this.codec.encode(a)}decode(a){for(let s of a)if(this.alphabet&&this.alphabet.indexOf(s)<0)throw new Error(`invalid character '${s}' in '${a}'`);return this.codec.decode(a)}},"Base");o(n,"Base"),t.exports=n}}),O$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/rfc4648.js"(e,t){"use strict";var r=o((s,c,l)=>{let h={};for(let x=0;x<c.length;++x)h[c[x]]=x;let p=s.length;for(;s[p-1]==="=";)--p;let g=new Uint8Array(p*l/8|0),v=0,y=0,_=0;for(let x=0;x<p;++x){let O=h[s[x]];if(O===void 0)throw new SyntaxError("Invalid character "+s[x]);y=y<<l|O,v+=l,v>=8&&(v-=8,g[_++]=255&y>>v)}if(v>=l||255&y<<8-v)throw new SyntaxError("Unexpected end of data");return g},"decode"),n=o((s,c,l)=>{let h=c[c.length-1]==="=",p=(1<<l)-1,g="",v=0,y=0;for(let _=0;_<s.length;++_)for(y=y<<8|s[_],v+=8;v>l;)v-=l,g+=c[p&y>>v];if(v&&(g+=c[p&y<<l-v]),h)for(;g.length*l&7;)g+="=";return g},"encode"),a=o(s=>c=>({encode(l){return n(l,c,s)},decode(l){return r(l,c,s)}}),"rfc4648");t.exports={rfc4648:a}}}),N$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/constants.js"(e,t){"use strict";var r=D$(),n=R$(),{rfc4648:a}=O$(),{decodeText:s,encodeText:c}=A6(),l=o(()=>({encode:s,decode:c}),"identity"),h=[["identity","\0",l,""],["base2","0",a(1),"01"],["base8","7",a(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",a(4),"0123456789abcdef"],["base16upper","F",a(4),"0123456789ABCDEF"],["base32hex","v",a(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",a(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",a(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",a(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",a(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],p=h.reduce((v,y)=>(v[y[0]]=new n(y[0],y[1],y[2],y[3]),v),{}),g=h.reduce((v,y)=>(v[y[1]]=p[y[0]],v),{});t.exports={names:p,codes:g}}}),P$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/index.js"(e,t){"use strict";var r=N$(),{encodeText:n,decodeText:a,concat:s}=A6();function c(O,D){if(!D)throw new Error("requires an encoded Uint8Array");let{name:P,codeBuf:J}=v(O);return g(P,D),s([J,D],J.length+D.length)}i(c,"multibase"),o(c,"multibase");function l(O,D){let P=v(O),J=n(P.encode(D));return s([P.codeBuf,J],P.codeBuf.length+J.length)}i(l,"encode9"),o(l,"encode");function h(O){O instanceof Uint8Array&&(O=a(O));let D=O[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(D)&&(O=O.toLowerCase()),v(O[0]).decode(O.substring(1))}i(h,"decode9"),o(h,"decode");function p(O){if(O instanceof Uint8Array&&(O=a(O)),Object.prototype.toString.call(O)!=="[object String]")return!1;try{return v(O[0]).name}catch{return!1}}i(p,"isEncoded"),o(p,"isEncoded");function g(O,D){v(O).decode(a(D))}i(g,"validEncode"),o(g,"validEncode");function v(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(v,"encoding"),o(v,"encoding");function y(O){return O instanceof Uint8Array&&(O=a(O)),v(O[0])}i(y,"encodingFromData"),o(y,"encodingFromData"),e=t.exports=c,e.encode=l,e.decode=h,e.isEncoded=p,e.encoding=v,e.encodingFromData=y;var _=Object.freeze(r.names),x=Object.freeze(r.codes);e.names=_,e.codes=x}}),B$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,a=~n,s=Math.pow(2,31);function c(l,h,p){h=h||[],p=p||0;for(var g=p;l>=s;)h[p++]=l&255|r,l/=128;for(;l&a;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-g+1,h}i(c,"encode9"),o(c,"encode")}}),L$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/decode.js"(e,t){t.exports=a;var r=128,n=127;function a(s,h){var l=0,h=h||0,p=0,g=h,v,y=s.length;do{if(g>=y)throw a.bytes=0,new RangeError("Could not decode varint");v=s[g++],l+=p<28?(v&n)<<p:(v&n)*Math.pow(2,p),p+=7}while(v>=r);return a.bytes=g-h,l}i(a,"read2"),o(a,"read")}}),U$=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),a=Math.pow(2,21),s=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),g=Math.pow(2,63);t.exports=function(v){return v<r?1:v<n?2:v<a?3:v<s?4:v<c?5:v<l?6:v<h?7:v<p?8:v<g?9:10}}}),F$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/index.js"(e,t){t.exports={encode:B$(),decode:L$(),encodingLength:U$()}}}),j$=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}}}),$$=ze({"../../../node_modules/.pnpm/multihashes@4.0.3/node_modules/multihashes/src/index.js"(e,t){"use strict";var r=P$(),n=F$(),{names:a}=j$(),{toString:s}=(Ed(),Fy(Cx)),{fromString:c}=(b6(),Fy(Tx)),{concat:l}=(kS(),Fy(IS)),h={};for(let q in a){let Q=q;h[a[Q]]=Q}Object.freeze(h);function p(q){if(!(q instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(q,"base16")}i(p,"toHexString"),o(p,"toHexString");function g(q){return c(q,"base16")}i(g,"fromHexString"),o(g,"fromHexString");function v(q){if(!(q instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(r.encode("base58btc",q)).slice(1)}i(v,"toB58String"),o(v,"toB58String");function y(q){let Q=q instanceof Uint8Array?s(q):q;return r.decode("z"+Q)}i(y,"fromB58String"),o(y,"fromB58String");function _(q){if(!(q instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(q.length<2)throw new Error("multihash too short. must be > 2 bytes.");let Q=n.decode(q);if(!P(Q))throw new Error(`multihash unknown function code: 0x${Q.toString(16)}`);q=q.slice(n.decode.bytes);let Y=n.decode(q);if(Y<0)throw new Error(`multihash invalid length: ${Y}`);if(q=q.slice(n.decode.bytes),q.length!==Y)throw new Error(`multihash length inconsistent: 0x${s(q,"base16")}`);return{code:Q,name:h[Q],length:Y,digest:q}}i(_,"decode9"),o(_,"decode");function x(q,Q,Y){if(!q||Q===void 0)throw new Error("multihash encode requires at least two args: digest, code");let k=O(Q);if(!(q instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(Y==null&&(Y=q.length),Y&&q.length!==Y)throw new Error("digest length should be equal to specified length.");let K=n.encode(k),he=n.encode(Y);return l([K,he,q],K.length+he.length+q.length)}i(x,"encode9"),o(x,"encode");function O(q){let Q=q;if(typeof q=="string"){if(a[q]===void 0)throw new Error(`Unrecognized hash function named: ${q}`);Q=a[q]}if(typeof Q!="number")throw new Error(`Hash function code should be a number. Got: ${Q}`);if(h[Q]===void 0&&!D(Q))throw new Error(`Unrecognized function code: ${Q}`);return Q}i(O,"coerceCode"),o(O,"coerceCode");function D(q){return q>0&&q<16}i(D,"isAppCode"),o(D,"isAppCode");function P(q){return!!(D(q)||h[q])}i(P,"isValidCode"),o(P,"isValidCode");function J(q){_(q)}i(J,"validate6"),o(J,"validate");function j(q){return J(q),q.subarray(0,2)}i(j,"prefix"),o(j,"prefix"),t.exports={names:a,codes:h,toHexString:p,fromHexString:g,toB58String:v,fromB58String:y,decode:_,encode:x,coerceCode:O,isAppCode:D,validate:J,prefix:j,isValidCode:P}}}),LY=ir(pj());function zx(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}i(zx,"_catch");o(zx,"_catch");function Hx(){let e=new Map;return function(t,r){try{let n=i(function(c){if(a)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");o(n,"_temp2");let a,s=function(){if(t.params&&t.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return a=1,c})}();return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(n){return Promise.reject(n)}}}i(Hx,"inMemoryCache");o(Hx,"inMemoryCache");function qx(e,t){return t()}i(qx,"noCache");o(qx,"noCache");var z$="(?:%[0-9a-fA-F]{2})",UA=`(?:[a-zA-Z0-9._-]|${z$})`,H$="([a-z0-9]+)",q$=`((?:${UA}*:)*(${UA}+))`,FA="[a-zA-Z0-9_.:%-]",V$=`;${FA}+=${FA}*`,K$=`((${V$})*)`,G$="(/[^#?]*)?",W$="([?][^#]*)?",J$="(#.*)?",Z$=new RegExp(`^did:${H$}:${q$}${K$}${G$}${W$}${J$}$`);function Vx(e){if(e===""||!e)return null;let t=e.match(Z$);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 a of n){let s=a.split("=");r.params[s[0]]=s[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(Vx,"parse");o(Vx,"parse");var H0={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function Kx(e){return function(t,r,n){try{return Promise.resolve(zx(function(){return Promise.resolve(e(t,r,n)).then(function(a){return{...H0,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:a}})},function(a){return{...H0,didResolutionMetadata:{error:"notFound",message:a.toString()}}}))}catch(a){return Promise.reject(a)}}}i(Kx,"wrapLegacyResolver");o(Kx,"wrapLegacyResolver");var Gx=i(class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?Hx():t.cache||qx,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(r=>{this.registry[r]||(this.registry[r]=Kx(t.legacyResolvers[r]))})}resolve(e,t={}){try{let r=this,n=Vx(e);if(n===null)return Promise.resolve({...H0,didResolutionMetadata:{error:"invalidDid"}});let a=r.registry[n.method];return a?Promise.resolve(r.cache(n,()=>a(n.did,n,r,t))):Promise.resolve({...H0,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(r){return Promise.reject(r)}}},"Resolver");o(Gx,"Resolver");kS();b6();Ed();h6();ym();Sx();var Wx=ir(kj()),Y$=ir(Mx()),Jx=ir(Jj()),Zx=ir(_6()),X$=ir(e$()),vb=ir(t$()),Yx=ir(a$()),Xx=ir(cl());function wi(e){return Ir(e,"base64url")}i(wi,"bytesToBase64url");o(wi,"bytesToBase64url");function Pn(e){let t=e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Cr(t,"base64url")}i(Pn,"base64ToBytes");o(Pn,"base64ToBytes");function Tm(e){return Cr(e,"base58btc")}i(Tm,"base58ToBytes");o(Tm,"base58ToBytes");function q0(e){let t=e.startsWith("0x")?e.substring(2):e;return Cr(t.toLowerCase(),"base16")}i(q0,"hexToBytes");o(q0,"hexToBytes");function V0(e){return wi(Cr(e))}i(V0,"encodeBase64url");o(V0,"encodeBase64url");function S6(e){return Ir(Pn(e))}i(S6,"decodeBase64url");o(S6,"decodeBase64url");function vs(e){return Ir(e,"base16")}i(vs,"bytesToHex");o(vs,"bytesToHex");function x6(e){return Cr(e)}i(x6,"stringToBytes");o(x6,"stringToBytes");function Qx({r:e,s:t,recoveryParam:r},n){let a=new Uint8Array(n?65:64);if(a.set(Cr(e,"base16"),0),a.set(Cr(t,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");a[64]=r}return wi(a)}i(Qx,"toJose");o(Qx,"toJose");function eT(e){let t=Pn(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=vs(t.slice(0,32)),n=vs(t.slice(32,64)),a=t.length===65?t[64]:void 0;return{r,s:n,recoveryParam:a}}i(eT,"fromJose");o(eT,"fromJose");function T6(e,t){return gs([Pn(e),Pn(t)])}i(T6,"toSealed");o(T6,"toSealed");var Q$=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,ez=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,tz=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function tT(e){if(typeof e=="string"){if(Q$.test(e))return q0(e);if(ez.test(e))return Tm(e);if(tz.test(e))return Pn(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(tT,"parseKey");o(tT,"parseKey");function C6(e){let t=typeof e=="string"?Cr(e):e;return(0,Wx.hash)(t)}i(C6,"sha2562");o(C6,"sha256");function rT(e){return new Uint8Array(Y$.keccak_256.arrayBuffer(e))}i(rT,"keccak");o(rT,"keccak");function nT(e){let t=Cr(e.slice(2),"base16");return`0x${Ir(rT(t).slice(-20),"base16")}`}i(nT,"toEthereumAddress");o(nT,"toEthereumAddress");function K0(e,t=new Uint8Array(4)){let r=Cr(e.toString(),"base10");return t.set(r,4-r.length),t}i(K0,"writeUint32BE");o(K0,"writeUint32BE");var eb=o(e=>gs([K0(e.length),e]),"lengthAndInput");function M6(e,t,r,n,a){if(t!==256)throw new Error(`Unsupported key length: ${t}`);let s=gs([eb(Cr(r)),eb(typeof n>"u"?new Uint8Array(0):n),eb(typeof a>"u"?new Uint8Array(0):a),K0(t)]),c=1;return(0,Wx.hash)(gs([K0(c),e,s]))}i(M6,"concatKDF");o(M6,"concatKDF");var UY=new Jx.ec("secp256k1");function iT(e){let t=tT(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"?x6(r):r,a=(0,Zx.sign)(t,n);return Promise.resolve(wi(a))}catch(n){return Promise.reject(n)}}}i(iT,"EdDSASigner");o(iT,"EdDSASigner");function I6(e){return typeof e=="object"&&"r"in e&&"s"in e}i(I6,"instanceOfEcdsaSignature");o(I6,"instanceOfEcdsaSignature");function yb(e){return o(i(function(r,n){try{return Promise.resolve(n(r)).then(function(a){if(I6(a))return Qx(a,e);if(e&&typeof eT(a).recoveryParam>"u")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return a})}catch(a){return Promise.reject(a)}},"sign5"),"sign")}i(yb,"ES256KSignerAlg");o(yb,"ES256KSignerAlg");function bb(){return o(i(function(t,r){try{return Promise.resolve(r(t)).then(function(n){if(I6(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(bb,"Ed25519SignerAlg");o(bb,"Ed25519SignerAlg");var rz={ES256K:yb(),"ES256K-R":yb(!0),Ed25519:bb(),EdDSA:bb()};function aT(e){let t=rz[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(aT,"SignerAlg");o(aT,"SignerAlg");var k6=new Jx.ec("secp256k1");function ed(e,t=!1){let r=Pn(e);if(r.length!==(t?65:64))throw new Error("wrong signature length");let n=vs(r.slice(0,32)),a=vs(r.slice(32,64)),s={r:n,s:a};return t&&(s.recoveryParam=r[64]),s}i(ed,"toSignatureObject");o(ed,"toSignatureObject");function Cm(e){if(e.publicKeyBase58)return Tm(e.publicKeyBase58);if(e.publicKeyBase64)return Pn(e.publicKeyBase64);if(e.publicKeyHex)return q0(e.publicKeyHex);if(e.publicKeyJwk&&e.publicKeyJwk.crv==="secp256k1"&&e.publicKeyJwk.x&&e.publicKeyJwk.y)return q0(k6.keyFromPublic({x:vs(Pn(e.publicKeyJwk.x)),y:vs(Pn(e.publicKeyJwk.y))}).getPublic("hex"));if(e.publicKeyMultibase){let{base16:t,base58btc:r,base64:n,base64url:a}=z0;return t.decoder.or(r.decoder.or(n.decoder.or(a.decoder))).decode(e.publicKeyMultibase)}return new Uint8Array}i(Cm,"extractPublicKeyBytes");o(Cm,"extractPublicKeyBytes");function oT(e,t,r){let n=C6(e),a=ed(t),s=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=s.find(h=>{try{let p=Cm(h);return k6.keyFromPublic(p).verify(n,a)}catch{return!1}});if(!l&&c.length>0&&(l=D6(e,t,c)),!l)throw new Error("invalid_signature: Signature invalid for JWT");return l}i(oT,"verifyES256K");o(oT,"verifyES256K");function D6(e,t,r){let n;if(t.length>86)n=[ed(t,!0)];else{let c=ed(t,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let a=o(c=>{let l=C6(e),h=k6.recoverPubKey(l,c,c.recoveryParam),p=h.encode("hex"),g=h.encode("hex",!0),v=nT(p);return r.find(_=>{var x,O,D;let P=vs(Cm(_));return P===p||P===g||((x=_.ethereumAddress)==null?void 0:x.toLowerCase())===v||((O=_.blockchainAccountId)==null||(D=O.split("@eip155"))==null?void 0:D[0].toLowerCase())===v})},"checkSignatureAgainstSigner"),s=n.map(a).filter(c=>typeof c<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}i(D6,"verifyRecoverableES256K");o(D6,"verifyRecoverableES256K");function wb(e,t,r){let n=x6(e),a=Pn(t),s=r.find(c=>(0,Zx.verify)(Cm(c),n,a));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}i(wb,"verifyEd25519");o(wb,"verifyEd25519");var nz={ES256K:oT,"ES256K-R":D6,Ed25519:wb,EdDSA:wb};function R6(e){let t=nz[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(R6,"VerifierAlgorithm");o(R6,"VerifierAlgorithm");R6.toSignatureObject=ed;var iz=o(function(e,t,r={},n={}){try{r.alg||(r.alg=az);let a=typeof e=="string"?e:_b(e,n.canonicalize),s=[_b(r,n.canonicalize),a].join("."),c=aT(r.alg);return Promise.resolve(c(s,t)).then(function(l){return[s,l].join(".")})}catch(a){return Promise.reject(a)}},"createJWS"),az="ES256K";function _b(e,t=!1){return V0(t?(0,X$.default)(e):JSON.stringify(e))}i(_b,"encodeSection");o(_b,"encodeSection");function sT(e){let t=e.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(t)return{header:JSON.parse(S6(t[1])),payload:t[2],signature:t[3],data:`${t[1]}.${t[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}i(sT,"decodeJWS");o(sT,"decodeJWS");function cT({header:e,data:t,signature:r},n){return Array.isArray(n)||(n=[n]),R6(e.alg)(t,r,n)}i(cT,"verifyJWSDecoded");o(cT,"verifyJWSDecoded");function uT(e,t){let r=sT(e);return cT(r,t)}i(uT,"verifyJWS");o(uT,"verifyJWS");function lT(e,t,r){for(var n;;){var a=e();if(xo(a)&&(a=a.v),!a)return s;if(a.then){n=0;break}var s=r();if(s&&s.then)if(xo(s))s=s.s;else{n=1;break}if(t){var c=t();if(c&&c.then&&!xo(c)){n=2;break}}}var l=new Cc,h=Gr.bind(null,l,2);return(n===0?a.then(g):n===1?s.then(p):c.then(v)).then(void 0,h),l;function p(y){s=y;do{if(t&&(c=t(),c&&c.then&&!xo(c))){c.then(v).then(void 0,h);return}if(a=e(),!a||xo(a)&&!a.v){Gr(l,1,s);return}if(a.then){a.then(g).then(void 0,h);return}s=r(),xo(s)&&(s=s.v)}while(!s||!s.then);s.then(p).then(void 0,h)}i(p,"_resumeAfterBody"),o(p,"_resumeAfterBody");function g(y){y?(s=r(),s&&s.then?s.then(p).then(void 0,h):p(s)):Gr(l,1,s)}i(g,"_resumeAfterTest"),o(g,"_resumeAfterTest");function v(){(a=e())?a.then?a.then(g).then(void 0,h):g(a):Gr(l,1,s)}i(v,"_resumeAfterUpdate"),o(v,"_resumeAfterUpdate")}i(lT,"_for");o(lT,"_for");var oz=o(function(e,t){try{let r=i(function(p){if(l===null)throw new Error("failure: Failed to decrypt");return l},"_temp5");o(r,"_temp5");let n;hT(e);let a=JSON.parse(S6(e.protected));if(a.enc!==t.enc)throw new Error(`not_supported: Decrypter does not supported: '${a.enc}'`);let s=T6(e.ciphertext,e.tag),c=new Uint8Array(Buffer.from(e.aad?`${e.protected}.${e.aad}`:e.protected)),l=null,h=function(){return a.alg==="dir"&&t.alg==="dir"?Promise.resolve(t.decrypt(s,Pn(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 lT(function(){return!l&&p<e.recipients.length},function(){return p++},function(){let g=e.recipients[p];Object.assign(g.header,a);let v=function(){if(g.header.alg===t.alg)return Promise.resolve(t.decrypt(s,Pn(e.iv),c,g)).then(function(y){l=y})}();if(v&&v.then)return v.then(function(){})})}}()}();return Promise.resolve(h&&h.then?h.then(r):r(h))}catch(r){return Promise.reject(r)}},"decryptJWE"),jA=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Gr(e,t,r){if(!e.s){if(r instanceof Cc)if(r.s)t&1&&(t=r.s),r=r.v;else{r.o=Gr.bind(null,e,t);return}if(r&&r.then){r.then(Gr.bind(null,e,t),Gr.bind(null,e,2));return}e.s=t,e.v=r;let n=e.o;n&&n(e)}}i(Gr,"_settle");o(Gr,"_settle");var Cc=function(){function e(){}return i(e,"_Pact2"),o(e,"_Pact"),e.prototype.then=function(t,r){let n=new e,a=this.s;if(a){let s=a&1?t:r;if(s){try{Gr(n,1,s(this.v))}catch(c){Gr(n,2,c)}return n}else return this}return this.o=function(s){try{let c=s.v;s.s&1?Gr(n,1,t?t(c):c):r?Gr(n,1,r(c)):Gr(n,2,c)}catch(c){Gr(n,2,c)}},n},e}();function xo(e){return e instanceof Cc&&e.s&1}i(xo,"_isSettledPact");o(xo,"_isSettledPact");function fT(e,t,r){var n=-1,a,s;function c(l){try{for(;++n<e.length&&(!r||!r());)if(l=t(n),l&&l.then)if(xo(l))l=l.v;else{l.then(c,s||(s=Gr.bind(null,a=new Cc,2)));return}a?Gr(a,1,l):a=l}catch(h){Gr(a||(a=new Cc),2,h)}}return i(c,"_cycle"),o(c,"_cycle"),c(),a}i(fT,"_forTo");o(fT,"_forTo");function dT(e,t,r){if(typeof e[jA]=="function"){let g=i(function(v){try{for(;!(a=n.next()).done&&(!r||!r());)if(v=t(a.value),v&&v.then)if(xo(v))v=v.v;else{v.then(g,c||(c=Gr.bind(null,s=new Cc,2)));return}s?Gr(s,1,v):s=v}catch(y){Gr(s||(s=new Cc),2,y)}},"_cycle");o(g,"_cycle");var n=e[jA](),a,s,c;if(g(),n.return){var l=o(function(v){try{a.done||n.return()}catch{}return v},"_fixup");if(s&&s.then)return s.then(l,function(v){throw l(v)});l()}return s}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 fT(h,function(g){return t(h[g])},r)}i(dT,"_forOf");o(dT,"_forOf");function hT(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(hT,"validateJWE");o(hT,"validateJWE");function Eb({ciphertext:e,tag:t,iv:r,protectedHeader:n,recipient:a},s){let c={protected:n,iv:wi(r),ciphertext:wi(e),tag:wi(t)};return s&&(c.aad=wi(s)),a&&(c.recipients=[a]),c}i(Eb,"encodeJWE");o(Eb,"encodeJWE");var sz=o(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(a){return Eb(a,n)})}else{let a=t[0].enc;if(!t.reduce((h,p)=>h&&p.enc===a,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,c,l=dT(t,function(h){let p=function(){return s?Promise.resolve(h.encryptCek==null?void 0:h.encryptCek(s)).then(function(g){if(g){var v,y;(v=c)==null||(y=v.recipients)==null||y.push(g)}}):Promise.resolve(h.encrypt(e,r,n)).then(function(g){s=g.cek,c=Eb(g,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(l&&l.then?l.then(function(){return c}):c)}}catch(a){return Promise.reject(a)}},"createJWE"),cz=o(function(e,t){try{let r=o(function(a){try{return Promise.resolve(t.resolve(a)).then(function({didResolutionMetadata:s,didDocument:c}){var l;if(s!=null&&s.error||c==null)throw new Error(`resolver_error: Could not resolve ${a}: ${s.error}, ${s.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${a}`);let p=((l=c.keyAgreement)==null?void 0:l.map(g=>typeof g=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(v=>v.id===g):g).filter(g=>typeof g<"u")).filter(g=>g.type==="X25519KeyAgreementKey2019"&&Boolean(g.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${a}`);return p.map(g=>mT(Tm(g.publicKeyBase58),g.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=e.map(a=>r(a));return Promise.resolve(Promise.all(n)).then(function(a){return[].concat(...a)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function O6(e){let t=new Yx.XChaCha20Poly1305(e);return(r,n)=>{let a=(0,Xx.randomBytes)(t.nonceLength),s=t.seal(a,r,n);return{ciphertext:s.subarray(0,s.length-t.tagLength),tag:s.subarray(s.length-t.tagLength),iv:a}}}i(O6,"xc20pEncrypter");o(O6,"xc20pEncrypter");function pT(e){let t=o(function(s,c={},l){try{let h=V0(JSON.stringify(Object.assign({alg:a},c,{enc:n}))),p=new Uint8Array(Buffer.from(l?`${h}.${wi(l)}`:h));return Promise.resolve({...r(s,p),protectedHeader:h})}catch(h){return Promise.reject(h)}},"encrypt"),r=O6(e),n="XC20P",a="dir";return{alg:a,enc:n,encrypt:t}}i(pT,"xc20pDirEncrypter");o(pT,"xc20pDirEncrypter");function Ab(e){let t=o(function(n,a,s){try{return Promise.resolve(r.open(a,n,s))}catch(c){return Promise.reject(c)}},"decrypt"),r=new Yx.XChaCha20Poly1305(e);return{alg:"dir",enc:"XC20P",decrypt:t}}i(Ab,"xc20pDirDecrypter");o(Ab,"xc20pDirDecrypter");function mT(e,t){let r=o(function(l,h={},p){try{Object.assign(h,{alg:void 0});let g=(0,Xx.randomBytes)(32);return Promise.resolve(pT(g).encrypt(l,h,p)).then(function(v){return Promise.resolve(n(g)).then(function(y){return{...v,recipient:y,cek:g}})})}catch(g){return Promise.reject(g)}},"encrypt"),n=o(function(l){try{let h=(0,vb.generateKeyPair)(),p=(0,vb.sharedKey)(h.secretKey,e),g=M6(p,s,a),v=O6(g)(l),y={encrypted_key:wi(v.ciphertext),header:{alg:a,iv:wi(v.iv),tag:wi(v.tag),epk:{kty:"OKP",crv:c,x:wi(h.publicKey)}}};return t&&(y.header.kid=t),Promise.resolve(y)}catch(h){return Promise.reject(h)}},"encryptCek"),a="ECDH-ES+XC20PKW",s=256,c="X25519";return{alg:a,enc:"XC20P",encrypt:r,encryptCek:n}}i(mT,"x25519Encrypter");o(mT,"x25519Encrypter");function gT(e){if(!(e&&e.epk&&e.iv&&e.tag))throw new Error("bad_jwe: malformed header")}i(gT,"validateHeader");o(gT,"validateHeader");function vT(e){let t=o(function(s,c,l,h){try{let v=i(function(){let O=M6(_,n,r),D=T6(h.encrypted_key,h.header.tag);return Promise.resolve(Ab(O).decrypt(D,Pn(h.header.iv))).then(function(P){return P===null?null:Ab(P).decrypt(s,c,l)})},"_temp4");o(v,"_temp4");var p,g;if(gT((p=h)==null?void 0:p.header),h=h,((g=h.header.epk)==null?void 0:g.crv)!==a||typeof h.header.epk.x>"u")return Promise.resolve(null);let y=Pn(h.header.epk.x),_,x=function(){if(e instanceof Uint8Array)_=(0,vb.sharedKey)(e,y);else return Promise.resolve(e(y)).then(function(O){_=O})}();return Promise.resolve(x&&x.then?x.then(v):v(x))}catch(v){return Promise.reject(v)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,a="X25519";return{alg:r,enc:"XC20P",decrypt:t}}i(vT,"x25519Decrypter");o(vT,"x25519Decrypter");Ax();var w0=o(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),Sb=o(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let a=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s],h=$t.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*Sb(c,l))}else{let s=$t.asCID(n);s?yield[a.join("/"),s]:yield*Sb(n,a)}}},"links"),xb=o(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let a=[...t,r];if(yield a.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!$t.asCID(n))if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s];yield l.join("/"),typeof c=="object"&&!$t.asCID(c)&&(yield*xb(c,l))}else yield*xb(n,a)}},"tree"),uz=o((e,t)=>{let r=e;for(let[n,a]of t.entries()){if(r=r[a],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let s=$t.asCID(r);if(s)return{value:s,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),N6=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:w0(),bytes:w0(),value:w0(),asBlock:w0()})}links(){return Sb(this.value,[])}tree(){return xb(this.value,[])}get(e="/"){return uz(this.value,e.split("/").filter(Boolean))}},"Block");o(N6,"Block");var Mm=o(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),a=await r.digest(n),s=$t.create(1,t.code,a);return new N6({value:e,bytes:n,cid:s})},"encode"),lz=o(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),a=await r.digest(e),s=$t.create(1,t.code,a);return new N6({value:n,bytes:e,cid:s})},"decode");Ga();bm();Ex();m6();var fl={};xr(fl,{code:()=>W0,decode:()=>DC,encode:()=>Um,name:()=>Mz});var fz=["string","number","bigint","symbol"],dz=["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 yT(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(fz.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(bT(e))return"Buffer";let r=wT(e);return r||"Object"}i(yT,"is");o(yT,"is");function bT(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(bT,"isBuffer");o(bT,"isBuffer");function wT(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(dz.includes(t))return t}i(wT,"getObjectType");o(wT,"getObjectType");var je=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");o(je,"Type");je.uint=new je(0,"uint",!0);je.negint=new je(1,"negint",!0);je.bytes=new je(2,"bytes",!0);je.string=new je(3,"string",!0);je.array=new je(4,"array",!1);je.map=new je(5,"map",!1);je.tag=new je(6,"tag",!1);je.float=new je(7,"float",!0);je.false=new je(7,"false",!0);je.true=new je(7,"true",!0);je.null=new je(7,"null",!0);je.undefined=new je(7,"undefined",!0);je.break=new je(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");o(bt,"Token");var dl=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",hz=new TextDecoder,pz=new TextEncoder;function td(e){return dl&&globalThis.Buffer.isBuffer(e)}i(td,"isBuffer2");o(td,"isBuffer");function P6(e){return e instanceof Uint8Array?td(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(P6,"asU8A");o(P6,"asU8A");var mz=dl?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Cb(e,t,r):(e,t,r)=>r-t>64?hz.decode(e.subarray(t,r)):Cb(e,t,r),gz=dl?e=>e.length>64?globalThis.Buffer.from(e):Tb(e):e=>e.length>64?pz.encode(e):Tb(e),_o=o(e=>Uint8Array.from(e),"fromArray"),B6=dl?(e,t,r)=>td(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),vz=dl?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),P6(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let a of e)n+a.length>r.length&&(a=a.subarray(0,r.length-n)),r.set(a,n),n+=a.length;return r},yz=dl?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function _T(e,t){if(td(e)&&td(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(_T,"compare2");o(_T,"compare");function Tb(e,t=1/0){let r,n=e.length,a=null,s=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}i(Tb,"utf8ToBytes");o(Tb,"utf8ToBytes");function Cb(e,t,r){let n=[];for(;t<r;){let a=e[t],s=null,c=a>239?4:a>223?3:a>191?2:1;if(t+c<=r){let l,h,p,g;switch(c){case 1:a<128&&(s=a);break;case 2:l=e[t+1],(l&192)===128&&(g=(a&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(g=(a&15)<<12|(l&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(g=(a&15)<<18|(l&63)<<12|(h&63)<<6|p&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=c}return ET(n)}i(Cb,"utf8Slice");o(Cb,"utf8Slice");var $A=4096;function ET(e){let t=e.length;if(t<=$A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$A));return r}i(ET,"decodeCodePointsArray");o(ET,"decodeCodePointsArray");var bz=256,L6=i(class{constructor(e=bz){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=yz(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=B6(r,0,this.cursor)}else t=vz(this.chunks,this.cursor);return e&&this.reset(),t}},"Bl");o(L6,"Bl");var Zt="CBOR decode error:",AT="CBOR encode error:",xd=[];xd[23]=1;xd[24]=2;xd[25]=3;xd[26]=5;xd[27]=9;function Lc(e,t,r){if(e.length-t<r)throw new Error(`${Zt} not enough data for type`)}i(Lc,"assertEnoughData");o(Lc,"assertEnoughData");var ln=[24,256,65536,4294967296,BigInt("18446744073709551616")];function xs(e,t,r){Lc(e,t,1);let n=e[t];if(r.strict===!0&&n<ln[0])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(xs,"readUint8");o(xs,"readUint8");function Ts(e,t,r){Lc(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<ln[1])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Ts,"readUint16");o(Ts,"readUint16");function Cs(e,t,r){Lc(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<ln[2])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Cs,"readUint32");o(Cs,"readUint32");function Ms(e,t,r){Lc(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],a=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(a);if(r.strict===!0&&s<ln[3])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${Zt} integers outside of the safe integer range are not supported`)}i(Ms,"readUint64");o(Ms,"readUint64");function ST(e,t,r,n){return new bt(je.uint,xs(e,t+1,n),2)}i(ST,"decodeUint8");o(ST,"decodeUint8");function xT(e,t,r,n){return new bt(je.uint,Ts(e,t+1,n),3)}i(xT,"decodeUint16");o(xT,"decodeUint16");function TT(e,t,r,n){return new bt(je.uint,Cs(e,t+1,n),5)}i(TT,"decodeUint32");o(TT,"decodeUint32");function CT(e,t,r,n){return new bt(je.uint,Ms(e,t+1,n),9)}i(CT,"decodeUint64");o(CT,"decodeUint64");function Is(e,t){return Ai(e,0,t.value)}i(Is,"encodeUint");o(Is,"encodeUint");function Ai(e,t,r){if(r<ln[0]){let n=Number(r);e.push([t|n])}else if(r<ln[1]){let n=Number(r);e.push([t|24,n])}else if(r<ln[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<ln[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<ln[4]){let a=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));a[8]=s&255,s=s>>8,a[7]=s&255,s=s>>8,a[6]=s&255,s=s>>8,a[5]=s&255,a[4]=c&255,c=c>>8,a[3]=c&255,c=c>>8,a[2]=c&255,c=c>>8,a[1]=c&255,e.push(a)}else throw new Error(`${Zt} encountered BigInt larger than allowable range`)}}i(Ai,"encodeUintValue");o(Ai,"encodeUintValue");Is.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize"),"encodedSize");Ai.encodedSize=o(i(function(t){return t<ln[0]?1:t<ln[1]?2:t<ln[2]?3:t<ln[3]?5:9},"encodedSize2"),"encodedSize");Is.compareTokens=o(i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens"),"compareTokens");function MT(e,t,r,n){return new bt(je.negint,-1-xs(e,t+1,n),2)}i(MT,"decodeNegint8");o(MT,"decodeNegint8");function IT(e,t,r,n){return new bt(je.negint,-1-Ts(e,t+1,n),3)}i(IT,"decodeNegint16");o(IT,"decodeNegint16");function kT(e,t,r,n){return new bt(je.negint,-1-Cs(e,t+1,n),5)}i(kT,"decodeNegint32");o(kT,"decodeNegint32");var U6=BigInt(-1),DT=BigInt(1);function RT(e,t,r,n){let a=Ms(e,t+1,n);if(typeof a!="bigint"){let s=-1-a;if(s>=Number.MIN_SAFE_INTEGER)return new bt(je.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Zt} integers outside of the safe integer range are not supported`);return new bt(je.negint,U6-BigInt(a),9)}i(RT,"decodeNegint64");o(RT,"decodeNegint64");function Im(e,t){let r=t.value,n=typeof r=="bigint"?r*U6-DT:r*-1-1;Ai(e,t.type.majorEncoded,n)}i(Im,"encodeNegint");o(Im,"encodeNegint");Im.encodedSize=o(i(function(t){let r=t.value,n=typeof r=="bigint"?r*U6-DT:r*-1-1;return n<ln[0]?1:n<ln[1]?2:n<ln[2]?3:n<ln[3]?5:9},"encodedSize3"),"encodedSize");Im.compareTokens=o(i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens2"),"compareTokens");function hl(e,t,r,n){Lc(e,t,r+n);let a=B6(e,t+r,t+r+n);return new bt(je.bytes,a,r+n)}i(hl,"toToken");o(hl,"toToken");function OT(e,t,r,n){return hl(e,t,1,r)}i(OT,"decodeBytesCompact");o(OT,"decodeBytesCompact");function NT(e,t,r,n){return hl(e,t,2,xs(e,t+1,n))}i(NT,"decodeBytes8");o(NT,"decodeBytes8");function PT(e,t,r,n){return hl(e,t,3,Ts(e,t+1,n))}i(PT,"decodeBytes16");o(PT,"decodeBytes16");function BT(e,t,r,n){return hl(e,t,5,Cs(e,t+1,n))}i(BT,"decodeBytes32");o(BT,"decodeBytes32");function LT(e,t,r,n){let a=Ms(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer bytes lengths not supported`);return hl(e,t,9,a)}i(LT,"decodeBytes64");o(LT,"decodeBytes64");function rd(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===je.string?gz(e.value):e.value),e.encodedBytes}i(rd,"tokenBytes");o(rd,"tokenBytes");function Td(e,t){let r=rd(t);Ai(e,t.type.majorEncoded,r.length),e.push(r)}i(Td,"encodeBytes");o(Td,"encodeBytes");Td.encodedSize=o(i(function(t){let r=rd(t);return Ai.encodedSize(r.length)+r.length},"encodedSize4"),"encodedSize");Td.compareTokens=o(i(function(t,r){return UT(rd(t),rd(r))},"compareTokens3"),"compareTokens");function UT(e,t){return e.length<t.length?-1:e.length>t.length?1:_T(e,t)}i(UT,"compareBytes");o(UT,"compareBytes");function pl(e,t,r,n,a){let s=r+n;Lc(e,t,s);let c=new bt(je.string,mz(e,t+r,t+s),s);return a.retainStringBytes===!0&&(c.byteValue=B6(e,t+r,t+s)),c}i(pl,"toToken2");o(pl,"toToken");function FT(e,t,r,n){return pl(e,t,1,r,n)}i(FT,"decodeStringCompact");o(FT,"decodeStringCompact");function jT(e,t,r,n){return pl(e,t,2,xs(e,t+1,n),n)}i(jT,"decodeString8");o(jT,"decodeString8");function $T(e,t,r,n){return pl(e,t,3,Ts(e,t+1,n),n)}i($T,"decodeString16");o($T,"decodeString16");function zT(e,t,r,n){return pl(e,t,5,Cs(e,t+1,n),n)}i(zT,"decodeString32");o(zT,"decodeString32");function HT(e,t,r,n){let a=Ms(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer string lengths not supported`);return pl(e,t,9,a,n)}i(HT,"decodeString64");o(HT,"decodeString64");var wz=Td;function Uc(e,t,r,n){return new bt(je.array,n,r)}i(Uc,"toToken3");o(Uc,"toToken");function qT(e,t,r,n){return Uc(e,t,1,r)}i(qT,"decodeArrayCompact");o(qT,"decodeArrayCompact");function VT(e,t,r,n){return Uc(e,t,2,xs(e,t+1,n))}i(VT,"decodeArray8");o(VT,"decodeArray8");function KT(e,t,r,n){return Uc(e,t,3,Ts(e,t+1,n))}i(KT,"decodeArray16");o(KT,"decodeArray16");function GT(e,t,r,n){return Uc(e,t,5,Cs(e,t+1,n))}i(GT,"decodeArray32");o(GT,"decodeArray32");function WT(e,t,r,n){let a=Ms(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer array lengths not supported`);return Uc(e,t,9,a)}i(WT,"decodeArray64");o(WT,"decodeArray64");function JT(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return Uc(e,t,1,1/0)}i(JT,"decodeArrayIndefinite");o(JT,"decodeArrayIndefinite");function km(e,t){Ai(e,je.array.majorEncoded,t.value)}i(km,"encodeArray");o(km,"encodeArray");km.compareTokens=Is.compareTokens;km.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize5"),"encodedSize");function Fc(e,t,r,n){return new bt(je.map,n,r)}i(Fc,"toToken4");o(Fc,"toToken");function ZT(e,t,r,n){return Fc(e,t,1,r)}i(ZT,"decodeMapCompact");o(ZT,"decodeMapCompact");function YT(e,t,r,n){return Fc(e,t,2,xs(e,t+1,n))}i(YT,"decodeMap8");o(YT,"decodeMap8");function XT(e,t,r,n){return Fc(e,t,3,Ts(e,t+1,n))}i(XT,"decodeMap16");o(XT,"decodeMap16");function QT(e,t,r,n){return Fc(e,t,5,Cs(e,t+1,n))}i(QT,"decodeMap32");o(QT,"decodeMap32");function eC(e,t,r,n){let a=Ms(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer map lengths not supported`);return Fc(e,t,9,a)}i(eC,"decodeMap64");o(eC,"decodeMap64");function tC(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return Fc(e,t,1,1/0)}i(tC,"decodeMapIndefinite");o(tC,"decodeMapIndefinite");function Dm(e,t){Ai(e,je.map.majorEncoded,t.value)}i(Dm,"encodeMap");o(Dm,"encodeMap");Dm.compareTokens=Is.compareTokens;Dm.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize6"),"encodedSize");function rC(e,t,r,n){return new bt(je.tag,r,1)}i(rC,"decodeTagCompact");o(rC,"decodeTagCompact");function nC(e,t,r,n){return new bt(je.tag,xs(e,t+1,n),2)}i(nC,"decodeTag8");o(nC,"decodeTag8");function iC(e,t,r,n){return new bt(je.tag,Ts(e,t+1,n),3)}i(iC,"decodeTag16");o(iC,"decodeTag16");function aC(e,t,r,n){return new bt(je.tag,Cs(e,t+1,n),5)}i(aC,"decodeTag32");o(aC,"decodeTag32");function oC(e,t,r,n){return new bt(je.tag,Ms(e,t+1,n),9)}i(oC,"decodeTag64");o(oC,"decodeTag64");function Rm(e,t){Ai(e,je.tag.majorEncoded,t.value)}i(Rm,"encodeTag");o(Rm,"encodeTag");Rm.compareTokens=Is.compareTokens;Rm.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize7"),"encodedSize");var _z=20,Ez=21,Az=22,Sz=23;function sC(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Zt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new bt(je.null,null,1):new bt(je.undefined,void 0,1)}i(sC,"decodeUndefined");o(sC,"decodeUndefined");function cC(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return new bt(je.break,void 0,1)}i(cC,"decodeBreak");o(cC,"decodeBreak");function Om(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Zt} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Zt} Infinity values are not supported`)}return new bt(je.float,e,t)}i(Om,"createToken");o(Om,"createToken");function uC(e,t,r,n){return Om(Pm(e,t+1),3,n)}i(uC,"decodeFloat16");o(uC,"decodeFloat16");function lC(e,t,r,n){return Om(Bm(e,t+1),5,n)}i(lC,"decodeFloat32");o(lC,"decodeFloat32");function fC(e,t,r,n){return Om($6(e,t+1),9,n)}i(fC,"decodeFloat64");o(fC,"decodeFloat64");function Nm(e,t,r){let n=t.value;if(n===!1)e.push([je.float.majorEncoded|_z]);else if(n===!0)e.push([je.float.majorEncoded|Ez]);else if(n===null)e.push([je.float.majorEncoded|Az]);else if(n===void 0)e.push([je.float.majorEncoded|Sz]);else{let a,s=!1;(!r||r.float64!==!0)&&(F6(n),a=Pm(ca,1),n===a||Number.isNaN(n)?(ca[0]=249,e.push(ca.slice(0,3)),s=!0):(j6(n),a=Bm(ca,1),n===a&&(ca[0]=250,e.push(ca.slice(0,5)),s=!0))),s||(hC(n),a=$6(ca,1),ca[0]=251,e.push(ca.slice(0,9)))}}i(Nm,"encodeFloat");o(Nm,"encodeFloat");Nm.encodedSize=o(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){F6(n);let a=Pm(ca,1);if(n===a||Number.isNaN(n))return 3;if(j6(n),a=Bm(ca,1),n===a)return 5}return 9},"encodedSize8"),"encodedSize");var dC=new ArrayBuffer(9),qi=new DataView(dC,1),ca=new Uint8Array(dC,0);function F6(e){if(e===1/0)qi.setUint16(0,31744,!1);else if(e===-1/0)qi.setUint16(0,64512,!1);else if(Number.isNaN(e))qi.setUint16(0,32256,!1);else{qi.setFloat32(0,e);let t=qi.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)qi.setUint16(0,31744,!1);else if(r===0)qi.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let a=r-127;a<-24?qi.setUint16(0,0):a<-14?qi.setUint16(0,(t&2147483648)>>16|1<<24+a,!1):qi.setUint16(0,(t&2147483648)>>16|a+15<<10|n>>13,!1)}}}i(F6,"encodeFloat16");o(F6,"encodeFloat16");function Pm(e,t){if(e.length-t<2)throw new Error(`${Zt} 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,a=r&1023,s;return n===0?s=a*2**-24:n!==31?s=(a+1024)*2**(n-25):s=a===0?1/0:NaN,r&32768?-s:s}i(Pm,"readFloat16");o(Pm,"readFloat16");function j6(e){qi.setFloat32(0,e,!1)}i(j6,"encodeFloat32");o(j6,"encodeFloat32");function Bm(e,t){if(e.length-t<4)throw new Error(`${Zt} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(Bm,"readFloat32");o(Bm,"readFloat32");function hC(e){qi.setFloat64(0,e,!1)}i(hC,"encodeFloat64");o(hC,"encodeFloat64");function $6(e,t){if(e.length-t<8)throw new Error(`${Zt} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i($6,"readFloat64");o($6,"readFloat64");Nm.compareTokens=Is.compareTokens;function ar(e,t,r){throw new Error(`${Zt} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(ar,"invalidMinor");o(ar,"invalidMinor");function Cd(e){return()=>{throw new Error(`${Zt} ${e}`)}}i(Cd,"errorer");o(Cd,"errorer");var Je=[];for(let e=0;e<=23;e++)Je[e]=ar;Je[24]=ST;Je[25]=xT;Je[26]=TT;Je[27]=CT;Je[28]=ar;Je[29]=ar;Je[30]=ar;Je[31]=ar;for(let e=32;e<=55;e++)Je[e]=ar;Je[56]=MT;Je[57]=IT;Je[58]=kT;Je[59]=RT;Je[60]=ar;Je[61]=ar;Je[62]=ar;Je[63]=ar;for(let e=64;e<=87;e++)Je[e]=OT;Je[88]=NT;Je[89]=PT;Je[90]=BT;Je[91]=LT;Je[92]=ar;Je[93]=ar;Je[94]=ar;Je[95]=Cd("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)Je[e]=FT;Je[120]=jT;Je[121]=$T;Je[122]=zT;Je[123]=HT;Je[124]=ar;Je[125]=ar;Je[126]=ar;Je[127]=Cd("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)Je[e]=qT;Je[152]=VT;Je[153]=KT;Je[154]=GT;Je[155]=WT;Je[156]=ar;Je[157]=ar;Je[158]=ar;Je[159]=JT;for(let e=160;e<=183;e++)Je[e]=ZT;Je[184]=YT;Je[185]=XT;Je[186]=QT;Je[187]=eC;Je[188]=ar;Je[189]=ar;Je[190]=ar;Je[191]=tC;for(let e=192;e<=215;e++)Je[e]=rC;Je[216]=nC;Je[217]=iC;Je[218]=aC;Je[219]=oC;Je[220]=ar;Je[221]=ar;Je[222]=ar;Je[223]=ar;for(let e=224;e<=243;e++)Je[e]=Cd("simple values are not supported");Je[244]=ar;Je[245]=ar;Je[246]=ar;Je[247]=sC;Je[248]=Cd("simple values are not supported");Je[249]=uC;Je[250]=lC;Je[251]=fC;Je[252]=ar;Je[253]=ar;Je[254]=ar;Je[255]=cC;var Za=[];for(let e=0;e<24;e++)Za[e]=new bt(je.uint,e,1);for(let e=-1;e>=-24;e--)Za[31-e]=new bt(je.negint,e,1);Za[64]=new bt(je.bytes,new Uint8Array(0),1);Za[96]=new bt(je.string,"",1);Za[128]=new bt(je.array,0,1);Za[160]=new bt(je.map,0,1);Za[244]=new bt(je.false,!1,1);Za[245]=new bt(je.true,!0,1);Za[246]=new bt(je.null,null,1);function pC(e){switch(e.type){case je.false:return _o([244]);case je.true:return _o([245]);case je.null:return _o([246]);case je.bytes:return e.value.length?void 0:_o([64]);case je.string:return e.value===""?_o([96]):void 0;case je.array:return e.value===0?_o([128]):void 0;case je.map:return e.value===0?_o([160]):void 0;case je.uint:return e.value<24?_o([Number(e.value)]):void 0;case je.negint:if(e.value>=-24)return _o([31-Number(e.value)])}}i(pC,"quickEncodeToken");o(pC,"quickEncodeToken");var xz={float64:!1,mapSorter:yC,quickEncodeToken:pC};function mC(){let e=[];return e[je.uint.major]=Is,e[je.negint.major]=Im,e[je.bytes.major]=Td,e[je.string.major]=wz,e[je.array.major]=km,e[je.map.major]=Dm,e[je.tag.major]=Rm,e[je.float.major]=Nm,e}i(mC,"makeCborEncoders");o(mC,"makeCborEncoders");var gC=mC(),tb=new L6,G0=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(`${AT} object contains circular references`);return new G0(t,e)}},"Ref");o(G0,"Ref");var fs={null:new bt(je.null,null),undefined:new bt(je.undefined,void 0),true:new bt(je.true,!0),false:new bt(je.false,!1),emptyArray:new bt(je.array,0),emptyMap:new bt(je.map,0)},ys={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new bt(je.float,e):e>=0?new bt(je.uint,e):new bt(je.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new bt(je.uint,e):new bt(je.negint,e)},Uint8Array(e,t,r,n){return new bt(je.bytes,e)},string(e,t,r,n){return new bt(je.string,e)},boolean(e,t,r,n){return e?fs.true:fs.false},null(e,t,r,n){return fs.null},undefined(e,t,r,n){return fs.undefined},ArrayBuffer(e,t,r,n){return new bt(je.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new bt(je.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[fs.emptyArray,new bt(je.break)]:fs.emptyArray;n=G0.createCheck(n,e);let a=[],s=0;for(let c of e)a[s++]=Zf(c,r,n);return r.addBreakTokens?[new bt(je.array,e.length),a,new bt(je.break)]:[new bt(je.array,e.length),a]},Object(e,t,r,n){let a=t!=="Object",s=a?e.keys():Object.keys(e),c=a?e.size:s.length;if(!c)return r.addBreakTokens===!0?[fs.emptyMap,new bt(je.break)]:fs.emptyMap;n=G0.createCheck(n,e);let l=[],h=0;for(let p of s)l[h++]=[Zf(p,r,n),Zf(a?e.get(p):e[p],r,n)];return vC(l,r),r.addBreakTokens?[new bt(je.map,c),l,new bt(je.break)]:[new bt(je.map,c),l]}};ys.Map=ys.Object;ys.Buffer=ys.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ys[`${e}Array`]=ys.DataView;function Zf(e,t={},r){let n=yT(e),a=t&&t.typeEncoders&&t.typeEncoders[n]||ys[n];if(typeof a=="function"){let c=a(e,n,t,r);if(c!=null)return c}let s=ys[n];if(!s)throw new Error(`${AT} unsupported type: ${n}`);return s(e,n,t,r)}i(Zf,"objectToTokens");o(Zf,"objectToTokens");function vC(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(vC,"sortMapEntries");o(vC,"sortMapEntries");function yC(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 a=r.type.major,s=gC[a].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}i(yC,"mapSorter");o(yC,"mapSorter");function z6(e,t,r,n){if(Array.isArray(t))for(let a of t)z6(e,a,r,n);else r[t.type.major](e,t,n)}i(z6,"tokensToEncoded");o(z6,"tokensToEncoded");function bC(e,t,r){let n=Zf(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let a=r.quickEncodeToken(n);if(a)return a;let s=t[n.type.major];if(s.encodedSize){let c=s.encodedSize(n,r),l=new L6(c);if(s(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return P6(l.chunks[0])}}return tb.reset(),z6(tb,n,t,r),tb.toBytes(!0)}i(bC,"encodeCustom");o(bC,"encodeCustom");function wC(e,t){return t=Object.assign({},xz,t),bC(e,gC,t)}i(wC,"encode6");o(wC,"encode");var Tz={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},_C=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=Za[e];if(t===void 0){let r=Je[e];if(!r)throw new Error(`${Zt} 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");o(_C,"Tokeniser");var nd=Symbol.for("DONE"),Lm=Symbol.for("BREAK");function EC(e,t,r){let n=[];for(let a=0;a<e.value;a++){let s=qu(t,r);if(s===Lm){if(e.value===1/0)break;throw new Error(`${Zt} got unexpected break to lengthed array`)}if(s===nd)throw new Error(`${Zt} found array but not enough entries (got ${a}, expected ${e.value})`);n[a]=s}return n}i(EC,"tokenToArray");o(EC,"tokenToArray");function AC(e,t,r){let n=r.useMaps===!0,a=n?void 0:{},s=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=qu(t,r);if(l===Lm){if(e.value===1/0)break;throw new Error(`${Zt} got unexpected break to lengthed map`)}if(l===nd)throw new Error(`${Zt} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${Zt} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(l)||!n&&l in a))throw new Error(`${Zt} found repeat map key "${l}"`);let h=qu(t,r);if(h===nd)throw new Error(`${Zt} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?s.set(l,h):a[l]=h}return n?s:a}i(AC,"tokenToMap");o(AC,"tokenToMap");function qu(e,t){if(e.done())return nd;let r=e.next();if(r.type===je.break)return Lm;if(r.type.terminal)return r.value;if(r.type===je.array)return EC(r,e,t);if(r.type===je.map)return AC(r,e,t);if(r.type===je.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=qu(e,t);return t.tags[r.value](n)}throw new Error(`${Zt} tag not supported (${r.value})`)}throw new Error("unsupported")}i(qu,"tokensToObject");o(qu,"tokensToObject");function SC(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Zt} data to decode must be a Uint8Array`);t=Object.assign({},Tz,t);let r=t.tokenizer||new _C(e,t),n=qu(r,t);if(n===nd)throw new Error(`${Zt} did not find any content to decode`);if(n===Lm)throw new Error(`${Zt} got unexpected break`);if(!r.done())throw new Error(`${Zt} too many terminals, data makes no sense`);return n}i(SC,"decode7");o(SC,"decode");Ga();var xC=42;function TC(e){if(e.asCID!==e)return null;let t=$t.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new bt(je.tag,xC),new bt(je.bytes,r)]}i(TC,"cidEncoder");o(TC,"cidEncoder");function CC(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(CC,"undefinedEncoder");o(CC,"undefinedEncoder");function MC(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(MC,"numberEncoder");o(MC,"numberEncoder");var Cz={float64:!0,typeEncoders:{Object:TC,undefined:CC,number:MC}};function IC(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return $t.decode(e.subarray(1))}i(IC,"cidDecoder");o(IC,"cidDecoder");var kC={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};kC.tags[xC]=IC;var Mz="dag-cbor",W0=113,Um=o(e=>wC(e,Cz),"encode"),DC=o(e=>SC(e,kC),"decode"),Iz=24;async function RC(e){let t=await Mm({value:e,codec:fl,hasher:ol});return{cid:t.cid,linkedBlock:t.bytes}}i(RC,"encodePayload");o(RC,"encodePayload");function OC(e,t=Iz){let r=(t-e.length%t)%t,n=new Uint8Array(e.length+r);return n.set(e,0),n}i(OC,"pad");o(OC,"pad");async function NC(e){return(await Mm({value:e,codec:fl,hasher:wm})).cid}i(NC,"encodeIdentityCID");o(NC,"encodeIdentityCID");function PC(e){if(e=$t.asCID(e),e.code!==W0)throw new Error("CID codec must be dag-cbor");if(e.multihash.code!==wm.code)throw new Error("CID must use identity multihash");return DC(e.multihash.digest)}i(PC,"decodeIdentityCID");o(PC,"decodeIdentityCID");async function BC(e,t){return OC((await NC(e)).bytes,t)}i(BC,"prepareCleartext");o(BC,"prepareCleartext");function LC(e){return PC($t.decodeFirst(e)[0])}i(LC,"decodeCleartext");o(LC,"decodeCleartext");var kz=Symbol("abortable"),Mb=Symbol("aborted");function UC(e,t){if(t.aborted)return Promise.reject(Mb);let r,n=new Promise((a,s)=>{r=s});return t.addEventListener("abort",()=>{r(Mb)}),Promise.race([e,n])}i(UC,"abortable");o(UC,"abortable");var Dz=o((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"),FC="utils_abort_request",Zn;(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"})(Zn||(Zn={}));var jC={[Zn.PARSE_ERROR]:"Parse error",[Zn.INVALID_REQUEST]:"Invalid request",[Zn.METHOD_NOT_FOUND]:"Method not found",[Zn.INVALID_PARAMS]:"Invalid params",[Zn.INTERNAL_ERROR]:"Internal error"};function $C(e){return-32e3>=e&&e>=-32099}i($C,"isServerError");o($C,"isServerError");function Fm(e){return jC[e.toString()]??($C(e)?"Server error":"Application error")}i(Fm,"getErrorMessage");o(Fm,"getErrorMessage");var bs=i(class extends Error{static fromObject(e){return new bs(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,bs.prototype),this.code=e,this.data=r,this.message=t??Fm(e)}},"RPCError");o(bs,"RPCError");function ml(e){let t=jC[e];return o(i(function(n){return new bs(e,t,n)},"createError"),"createError")}i(ml,"createErrorFactory");o(ml,"createErrorFactory");var FY=ml(Zn.PARSE_ERROR),jY=ml(Zn.INVALID_REQUEST),$Y=ml(Zn.METHOD_NOT_FOUND),zY=ml(Zn.INVALID_PARAMS),HY=ml(Zn.INTERNAL_ERROR);function zC(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(zC,"_checkPrivateRedeclaration");o(zC,"_checkPrivateRedeclaration");function HC(e,t){return t.get?t.get.call(e):t.value}i(HC,"_classApplyDescriptorGet");o(HC,"_classApplyDescriptorGet");function qC(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(qC,"_classApplyDescriptorSet");o(qC,"_classApplyDescriptorSet");function H6(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(H6,"_classExtractFieldDescriptor");o(H6,"_classExtractFieldDescriptor");function S0(e,t){var r=H6(e,t,"get");return HC(e,r)}i(S0,"_classPrivateFieldGet");o(S0,"_classPrivateFieldGet");function VC(e,t,r){zC(e,t),t.set(e,r)}i(VC,"_classPrivateFieldInit");o(VC,"_classPrivateFieldInit");function KC(e,t,r){var n=H6(e,t,"set");return qC(e,n,r),r}i(KC,"_classPrivateFieldSet");o(KC,"_classPrivateFieldSet");var Hf=new WeakMap,Ib=i(class{get connection(){return S0(this,Hf)}createID(){return Dz()}request(e,t=void 0,r={}){let{signal:n}=r;if(n?.aborted)return Promise.reject(Mb);let a=this.createID(),s=S0(this,Hf).send({jsonrpc:"2.0",id:a,method:e,params:t}).then(c=>{if(c==null)throw new Error("Missing response");if(c.error!=null)throw bs.fromObject(c.error);return c.result});return n==null?s:(n.addEventListener("abort",()=>{this.notify(FC,{id:a})}),UC(s,n))}async notify(e,t=void 0){await S0(this,Hf).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){VC(this,Hf,{writable:!0,value:void 0}),KC(this,Hf,e)}},"RPCClient");o(Ib,"RPCClient");function kb(e,t){return{jsonrpc:"2.0",id:e,error:{code:t,message:Fm(t)}}}i(kb,"createErrorResponse");o(kb,"createErrorResponse");function GC(e,t,r){console.warn("Unhandled handler error",t,r)}i(GC,"fallbackOnHandlerError");o(GC,"fallbackOnHandlerError");function WC(e,t){console.warn("Unhandled invalid message",t)}i(WC,"fallbackOnInvalidMessage");o(WC,"fallbackOnInvalidMessage");function JC(e,t){console.warn("Unhandled notification",t)}i(JC,"fallbackOnNotification");o(JC,"fallbackOnNotification");function ZC(e,t={}){let r=t.onHandlerError??GC,n=t.onInvalidMessage??WC,a=t.onNotification??JC,s={};function c(l,h){if(h.method===FC){let p=h.params?.id;p!=null&&s[p]?.abort()}else a(l,h)}return i(c,"handleNotification"),o(c,"handleNotification"),o(i(async function(h,p){let g=p.id;if(p.jsonrpc!=="2.0"||p.method==null)return g==null?(n(h,p),null):kb(g,Zn.INVALID_REQUEST);let v=e[p.method];if(v==null)return g==null?(c(h,p),null):kb(g,Zn.METHOD_NOT_FOUND);try{let y;if(g!=null&&v[kz]){let x=new AbortController;s[g]=x,y=v(h,p.params,{signal:x.signal})}else y=v(h,p.params,{});let _=y==null?y:typeof y.then=="function"?await y:y;return g==null||s[g]?.signal.aborted?null:{jsonrpc:"2.0",id:g,result:_}}catch(y){if(g==null||s[g]?.signal.aborted)return r(h,p,y),null;let _;if(y instanceof bs)_=y.toObject();else{r(h,p,y);let x=y.code??-32e3;_={code:x,message:y.message||Fm(x)}}return{jsonrpc:"2.0",id:g,error:_}}finally{g!=null&&delete s[g]}},"handleRequest"),"handleRequest")}i(ZC,"createHandler");o(ZC,"createHandler");Ga();var Rz=ir(S$(),1),On=ir(ll(),1),Oz=`
679
+ `+String(J)));h(D);for(var j=0;j<D.callbacks.length;j++){var q=J[j];q instanceof Error?D.callbacks[j].reject(q):D.callbacks[j].resolve(q)}}).catch(function(J){l(O,D,J)})}i(c,"dispatchBatch"),o(c,"dispatchBatch");function l(O,D,P){h(D);for(var J=0;J<D.keys.length;J++)O.clear(D.keys[J]),D.callbacks[J].reject(P)}i(l,"failedDispatch"),o(l,"failedDispatch");function h(O){if(O.cacheHits)for(var D=0;D<O.cacheHits.length;D++)O.cacheHits[D]()}i(h,"resolveCacheHits"),o(h,"resolveCacheHits");function p(O){var D=!O||O.batch!==!1;if(!D)return 1;var P=O&&O.maxBatchSize;if(P===void 0)return 1/0;if(typeof P!="number"||P<1)throw new TypeError("maxBatchSize must be a positive number: "+P);return P}i(p,"getValidMaxBatchSize"),o(p,"getValidMaxBatchSize");function g(O){var D=O&&O.batchScheduleFn;if(D===void 0)return n;if(typeof D!="function")throw new TypeError("batchScheduleFn must be a function: "+D);return D}i(g,"getValidBatchScheduleFn"),o(g,"getValidBatchScheduleFn");function v(O){var D=O&&O.cacheKeyFn;if(D===void 0)return function(P){return P};if(typeof D!="function")throw new TypeError("cacheKeyFn must be a function: "+D);return D}i(v,"getValidCacheKeyFn"),o(v,"getValidCacheKeyFn");function y(O){var D=!O||O.cache!==!1;if(!D)return null;var P=O&&O.cacheMap;if(P===void 0)return new Map;if(P!==null){var J=["get","set","delete","clear"],j=J.filter(function(q){return P&&typeof P[q]!="function"});if(j.length!==0)throw new TypeError("Custom cacheMap missing methods: "+j.join(", "))}return P}i(y,"getValidCacheMap"),o(y,"getValidCacheMap");function _(O){return O&&O.name?O.name:null}i(_,"getValidName"),o(_,"getValidName");function x(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(x,"isArrayLike2"),o(x,"isArrayLike"),t.exports=r}}),D$=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 a=new Uint8Array(256),s=0;s<a.length;s++)a[s]=255;for(var c=0;c<n.length;c++){var l=n.charAt(c),h=l.charCodeAt(0);if(a[h]!==255)throw new TypeError(l+" is ambiguous");a[h]=c}var p=n.length,g=n.charAt(0),v=Math.log(p)/Math.log(256),y=Math.log(256)/Math.log(p);function _(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var P=0,J=0,j=0,q=D.length;j!==q&&D[j]===0;)j++,P++;for(var Q=(q-j)*y+1>>>0,Y=new Uint8Array(Q);j!==q;){for(var k=D[j],K=0,he=Q-1;(k!==0||K<J)&&he!==-1;he--,K++)k+=256*Y[he]>>>0,Y[he]=k%p>>>0,k=k/p>>>0;if(k!==0)throw new Error("Non-zero carry");J=K,j++}for(var me=Q-J;me!==Q&&Y[me]===0;)me++;for(var we=g.repeat(P);me<Q;++me)we+=n.charAt(Y[me]);return we}i(_,"encode9"),o(_,"encode");function x(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var P=0;if(D[P]!==" "){for(var J=0,j=0;D[P]===g;)J++,P++;for(var q=(D.length-P)*v+1>>>0,Q=new Uint8Array(q);D[P];){var Y=a[D.charCodeAt(P)];if(Y===255)return;for(var k=0,K=q-1;(Y!==0||k<j)&&K!==-1;K--,k++)Y+=p*Q[K]>>>0,Q[K]=Y%256>>>0,Y=Y/256>>>0;if(Y!==0)throw new Error("Non-zero carry");j=k,P++}if(D[P]!==" "){for(var he=q-j;he!==q&&Q[he]===0;)he++;for(var me=new Uint8Array(J+(q-he)),we=J;he!==q;)me[we++]=Q[he++];return me}}}i(x,"decodeUnsafe"),o(x,"decodeUnsafe");function O(D){var P=x(D);if(P)return P;throw new Error("Non-base"+p+" character")}return i(O,"decode9"),o(O,"decode"),{encode:_,decodeUnsafe:x,decode:O}}i(r,"base4"),o(r,"base"),t.exports=r}}),A6=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/util.js"(e,t){"use strict";var r=new TextDecoder,n=o(l=>r.decode(l),"decodeText"),a=new TextEncoder,s=o(l=>a.encode(l),"encodeText");function c(l,h){let p=new Uint8Array(h),g=0;for(let v of l)p.set(v,g),g+=v.length;return p}i(c,"concat4"),o(c,"concat"),t.exports={decodeText:n,encodeText:s,concat:c}}}),R$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/base.js"(e,t){"use strict";var{encodeText:r}=A6(),n=i(class{constructor(a,s,c,l){this.name=a,this.code=s,this.codeBuf=r(this.code),this.alphabet=l,this.codec=c(l)}encode(a){return this.codec.encode(a)}decode(a){for(let s of a)if(this.alphabet&&this.alphabet.indexOf(s)<0)throw new Error(`invalid character '${s}' in '${a}'`);return this.codec.decode(a)}},"Base");o(n,"Base"),t.exports=n}}),O$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/rfc4648.js"(e,t){"use strict";var r=o((s,c,l)=>{let h={};for(let x=0;x<c.length;++x)h[c[x]]=x;let p=s.length;for(;s[p-1]==="=";)--p;let g=new Uint8Array(p*l/8|0),v=0,y=0,_=0;for(let x=0;x<p;++x){let O=h[s[x]];if(O===void 0)throw new SyntaxError("Invalid character "+s[x]);y=y<<l|O,v+=l,v>=8&&(v-=8,g[_++]=255&y>>v)}if(v>=l||255&y<<8-v)throw new SyntaxError("Unexpected end of data");return g},"decode"),n=o((s,c,l)=>{let h=c[c.length-1]==="=",p=(1<<l)-1,g="",v=0,y=0;for(let _=0;_<s.length;++_)for(y=y<<8|s[_],v+=8;v>l;)v-=l,g+=c[p&y>>v];if(v&&(g+=c[p&y<<l-v]),h)for(;g.length*l&7;)g+="=";return g},"encode"),a=o(s=>c=>({encode(l){return n(l,c,s)},decode(l){return r(l,c,s)}}),"rfc4648");t.exports={rfc4648:a}}}),N$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/constants.js"(e,t){"use strict";var r=D$(),n=R$(),{rfc4648:a}=O$(),{decodeText:s,encodeText:c}=A6(),l=o(()=>({encode:s,decode:c}),"identity"),h=[["identity","\0",l,""],["base2","0",a(1),"01"],["base8","7",a(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",a(4),"0123456789abcdef"],["base16upper","F",a(4),"0123456789ABCDEF"],["base32hex","v",a(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",a(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",a(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",a(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",a(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",a(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",a(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",a(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],p=h.reduce((v,y)=>(v[y[0]]=new n(y[0],y[1],y[2],y[3]),v),{}),g=h.reduce((v,y)=>(v[y[1]]=p[y[0]],v),{});t.exports={names:p,codes:g}}}),P$=ze({"../../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/index.js"(e,t){"use strict";var r=N$(),{encodeText:n,decodeText:a,concat:s}=A6();function c(O,D){if(!D)throw new Error("requires an encoded Uint8Array");let{name:P,codeBuf:J}=v(O);return g(P,D),s([J,D],J.length+D.length)}i(c,"multibase"),o(c,"multibase");function l(O,D){let P=v(O),J=n(P.encode(D));return s([P.codeBuf,J],P.codeBuf.length+J.length)}i(l,"encode9"),o(l,"encode");function h(O){O instanceof Uint8Array&&(O=a(O));let D=O[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(D)&&(O=O.toLowerCase()),v(O[0]).decode(O.substring(1))}i(h,"decode9"),o(h,"decode");function p(O){if(O instanceof Uint8Array&&(O=a(O)),Object.prototype.toString.call(O)!=="[object String]")return!1;try{return v(O[0]).name}catch{return!1}}i(p,"isEncoded"),o(p,"isEncoded");function g(O,D){v(O).decode(a(D))}i(g,"validEncode"),o(g,"validEncode");function v(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(v,"encoding"),o(v,"encoding");function y(O){return O instanceof Uint8Array&&(O=a(O)),v(O[0])}i(y,"encodingFromData"),o(y,"encodingFromData"),e=t.exports=c,e.encode=l,e.decode=h,e.isEncoded=p,e.encoding=v,e.encodingFromData=y;var _=Object.freeze(r.names),x=Object.freeze(r.codes);e.names=_,e.codes=x}}),B$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/encode.js"(e,t){t.exports=c;var r=128,n=127,a=~n,s=Math.pow(2,31);function c(l,h,p){h=h||[],p=p||0;for(var g=p;l>=s;)h[p++]=l&255|r,l/=128;for(;l&a;)h[p++]=l&255|r,l>>>=7;return h[p]=l|0,c.bytes=p-g+1,h}i(c,"encode9"),o(c,"encode")}}),L$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/decode.js"(e,t){t.exports=a;var r=128,n=127;function a(s,h){var l=0,h=h||0,p=0,g=h,v,y=s.length;do{if(g>=y)throw a.bytes=0,new RangeError("Could not decode varint");v=s[g++],l+=p<28?(v&n)<<p:(v&n)*Math.pow(2,p),p+=7}while(v>=r);return a.bytes=g-h,l}i(a,"read2"),o(a,"read")}}),U$=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),a=Math.pow(2,21),s=Math.pow(2,28),c=Math.pow(2,35),l=Math.pow(2,42),h=Math.pow(2,49),p=Math.pow(2,56),g=Math.pow(2,63);t.exports=function(v){return v<r?1:v<n?2:v<a?3:v<s?4:v<c?5:v<l?6:v<h?7:v<p?8:v<g?9:10}}}),F$=ze({"../../../node_modules/.pnpm/varint@5.0.2/node_modules/varint/index.js"(e,t){t.exports={encode:B$(),decode:L$(),encodingLength:U$()}}}),j$=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}}}),$$=ze({"../../../node_modules/.pnpm/multihashes@4.0.3/node_modules/multihashes/src/index.js"(e,t){"use strict";var r=P$(),n=F$(),{names:a}=j$(),{toString:s}=(Ed(),Fy(Cx)),{fromString:c}=(b6(),Fy(Tx)),{concat:l}=(kS(),Fy(IS)),h={};for(let q in a){let Q=q;h[a[Q]]=Q}Object.freeze(h);function p(q){if(!(q instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(q,"base16")}i(p,"toHexString"),o(p,"toHexString");function g(q){return c(q,"base16")}i(g,"fromHexString"),o(g,"fromHexString");function v(q){if(!(q instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return s(r.encode("base58btc",q)).slice(1)}i(v,"toB58String"),o(v,"toB58String");function y(q){let Q=q instanceof Uint8Array?s(q):q;return r.decode("z"+Q)}i(y,"fromB58String"),o(y,"fromB58String");function _(q){if(!(q instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(q.length<2)throw new Error("multihash too short. must be > 2 bytes.");let Q=n.decode(q);if(!P(Q))throw new Error(`multihash unknown function code: 0x${Q.toString(16)}`);q=q.slice(n.decode.bytes);let Y=n.decode(q);if(Y<0)throw new Error(`multihash invalid length: ${Y}`);if(q=q.slice(n.decode.bytes),q.length!==Y)throw new Error(`multihash length inconsistent: 0x${s(q,"base16")}`);return{code:Q,name:h[Q],length:Y,digest:q}}i(_,"decode9"),o(_,"decode");function x(q,Q,Y){if(!q||Q===void 0)throw new Error("multihash encode requires at least two args: digest, code");let k=O(Q);if(!(q instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(Y==null&&(Y=q.length),Y&&q.length!==Y)throw new Error("digest length should be equal to specified length.");let K=n.encode(k),he=n.encode(Y);return l([K,he,q],K.length+he.length+q.length)}i(x,"encode9"),o(x,"encode");function O(q){let Q=q;if(typeof q=="string"){if(a[q]===void 0)throw new Error(`Unrecognized hash function named: ${q}`);Q=a[q]}if(typeof Q!="number")throw new Error(`Hash function code should be a number. Got: ${Q}`);if(h[Q]===void 0&&!D(Q))throw new Error(`Unrecognized function code: ${Q}`);return Q}i(O,"coerceCode"),o(O,"coerceCode");function D(q){return q>0&&q<16}i(D,"isAppCode"),o(D,"isAppCode");function P(q){return!!(D(q)||h[q])}i(P,"isValidCode"),o(P,"isValidCode");function J(q){_(q)}i(J,"validate6"),o(J,"validate");function j(q){return J(q),q.subarray(0,2)}i(j,"prefix"),o(j,"prefix"),t.exports={names:a,codes:h,toHexString:p,fromHexString:g,toB58String:v,fromB58String:y,decode:_,encode:x,coerceCode:O,isAppCode:D,validate:J,prefix:j,isValidCode:P}}}),LY=ir(pj());function zx(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}i(zx,"_catch");o(zx,"_catch");function Hx(){let e=new Map;return function(t,r){try{let n=i(function(c){if(a)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");o(n,"_temp2");let a,s=function(){if(t.params&&t.params["no-cache"]==="true")return Promise.resolve(r()).then(function(c){return a=1,c})}();return Promise.resolve(s&&s.then?s.then(n):n(s))}catch(n){return Promise.reject(n)}}}i(Hx,"inMemoryCache");o(Hx,"inMemoryCache");function qx(e,t){return t()}i(qx,"noCache");o(qx,"noCache");var z$="(?:%[0-9a-fA-F]{2})",UA=`(?:[a-zA-Z0-9._-]|${z$})`,H$="([a-z0-9]+)",q$=`((?:${UA}*:)*(${UA}+))`,FA="[a-zA-Z0-9_.:%-]",V$=`;${FA}+=${FA}*`,K$=`((${V$})*)`,G$="(/[^#?]*)?",W$="([?][^#]*)?",J$="(#.*)?",Z$=new RegExp(`^did:${H$}:${q$}${K$}${G$}${W$}${J$}$`);function Vx(e){if(e===""||!e)return null;let t=e.match(Z$);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 a of n){let s=a.split("=");r.params[s[0]]=s[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(Vx,"parse");o(Vx,"parse");var H0={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function Kx(e){return function(t,r,n){try{return Promise.resolve(zx(function(){return Promise.resolve(e(t,r,n)).then(function(a){return{...H0,didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:a}})},function(a){return{...H0,didResolutionMetadata:{error:"notFound",message:a.toString()}}}))}catch(a){return Promise.reject(a)}}}i(Kx,"wrapLegacyResolver");o(Kx,"wrapLegacyResolver");var Gx=i(class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=t.cache===!0?Hx():t.cache||qx,t.legacyResolvers&&Object.keys(t.legacyResolvers).map(r=>{this.registry[r]||(this.registry[r]=Kx(t.legacyResolvers[r]))})}resolve(e,t={}){try{let r=this,n=Vx(e);if(n===null)return Promise.resolve({...H0,didResolutionMetadata:{error:"invalidDid"}});let a=r.registry[n.method];return a?Promise.resolve(r.cache(n,()=>a(n.did,n,r,t))):Promise.resolve({...H0,didResolutionMetadata:{error:"unsupportedDidMethod"}})}catch(r){return Promise.reject(r)}}},"Resolver");o(Gx,"Resolver");kS();b6();Ed();h6();ym();Sx();var Wx=ir(kj()),Y$=ir(Mx()),Jx=ir(Jj()),Zx=ir(_6()),X$=ir(e$()),vb=ir(t$()),Yx=ir(a$()),Xx=ir(cl());function wi(e){return Ir(e,"base64url")}i(wi,"bytesToBase64url");o(wi,"bytesToBase64url");function Pn(e){let t=e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"");return Cr(t,"base64url")}i(Pn,"base64ToBytes");o(Pn,"base64ToBytes");function Tm(e){return Cr(e,"base58btc")}i(Tm,"base58ToBytes");o(Tm,"base58ToBytes");function q0(e){let t=e.startsWith("0x")?e.substring(2):e;return Cr(t.toLowerCase(),"base16")}i(q0,"hexToBytes");o(q0,"hexToBytes");function V0(e){return wi(Cr(e))}i(V0,"encodeBase64url");o(V0,"encodeBase64url");function S6(e){return Ir(Pn(e))}i(S6,"decodeBase64url");o(S6,"decodeBase64url");function ys(e){return Ir(e,"base16")}i(ys,"bytesToHex");o(ys,"bytesToHex");function x6(e){return Cr(e)}i(x6,"stringToBytes");o(x6,"stringToBytes");function Qx({r:e,s:t,recoveryParam:r},n){let a=new Uint8Array(n?65:64);if(a.set(Cr(e,"base16"),0),a.set(Cr(t,"base16"),32),n){if(typeof r>"u")throw new Error("Signer did not return a recoveryParam");a[64]=r}return wi(a)}i(Qx,"toJose");o(Qx,"toJose");function eT(e){let t=Pn(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=ys(t.slice(0,32)),n=ys(t.slice(32,64)),a=t.length===65?t[64]:void 0;return{r,s:n,recoveryParam:a}}i(eT,"fromJose");o(eT,"fromJose");function T6(e,t){return vs([Pn(e),Pn(t)])}i(T6,"toSealed");o(T6,"toSealed");var Q$=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,ez=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,tz=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function tT(e){if(typeof e=="string"){if(Q$.test(e))return q0(e);if(ez.test(e))return Tm(e);if(tz.test(e))return Pn(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(tT,"parseKey");o(tT,"parseKey");function C6(e){let t=typeof e=="string"?Cr(e):e;return(0,Wx.hash)(t)}i(C6,"sha2562");o(C6,"sha256");function rT(e){return new Uint8Array(Y$.keccak_256.arrayBuffer(e))}i(rT,"keccak");o(rT,"keccak");function nT(e){let t=Cr(e.slice(2),"base16");return`0x${Ir(rT(t).slice(-20),"base16")}`}i(nT,"toEthereumAddress");o(nT,"toEthereumAddress");function K0(e,t=new Uint8Array(4)){let r=Cr(e.toString(),"base10");return t.set(r,4-r.length),t}i(K0,"writeUint32BE");o(K0,"writeUint32BE");var eb=o(e=>vs([K0(e.length),e]),"lengthAndInput");function M6(e,t,r,n,a){if(t!==256)throw new Error(`Unsupported key length: ${t}`);let s=vs([eb(Cr(r)),eb(typeof n>"u"?new Uint8Array(0):n),eb(typeof a>"u"?new Uint8Array(0):a),K0(t)]),c=1;return(0,Wx.hash)(vs([K0(c),e,s]))}i(M6,"concatKDF");o(M6,"concatKDF");var UY=new Jx.ec("secp256k1");function iT(e){let t=tT(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"?x6(r):r,a=(0,Zx.sign)(t,n);return Promise.resolve(wi(a))}catch(n){return Promise.reject(n)}}}i(iT,"EdDSASigner");o(iT,"EdDSASigner");function I6(e){return typeof e=="object"&&"r"in e&&"s"in e}i(I6,"instanceOfEcdsaSignature");o(I6,"instanceOfEcdsaSignature");function yb(e){return o(i(function(r,n){try{return Promise.resolve(n(r)).then(function(a){if(I6(a))return Qx(a,e);if(e&&typeof eT(a).recoveryParam>"u")throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return a})}catch(a){return Promise.reject(a)}},"sign5"),"sign")}i(yb,"ES256KSignerAlg");o(yb,"ES256KSignerAlg");function bb(){return o(i(function(t,r){try{return Promise.resolve(r(t)).then(function(n){if(I6(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(bb,"Ed25519SignerAlg");o(bb,"Ed25519SignerAlg");var rz={ES256K:yb(),"ES256K-R":yb(!0),Ed25519:bb(),EdDSA:bb()};function aT(e){let t=rz[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(aT,"SignerAlg");o(aT,"SignerAlg");var k6=new Jx.ec("secp256k1");function ed(e,t=!1){let r=Pn(e);if(r.length!==(t?65:64))throw new Error("wrong signature length");let n=ys(r.slice(0,32)),a=ys(r.slice(32,64)),s={r:n,s:a};return t&&(s.recoveryParam=r[64]),s}i(ed,"toSignatureObject");o(ed,"toSignatureObject");function Cm(e){if(e.publicKeyBase58)return Tm(e.publicKeyBase58);if(e.publicKeyBase64)return Pn(e.publicKeyBase64);if(e.publicKeyHex)return q0(e.publicKeyHex);if(e.publicKeyJwk&&e.publicKeyJwk.crv==="secp256k1"&&e.publicKeyJwk.x&&e.publicKeyJwk.y)return q0(k6.keyFromPublic({x:ys(Pn(e.publicKeyJwk.x)),y:ys(Pn(e.publicKeyJwk.y))}).getPublic("hex"));if(e.publicKeyMultibase){let{base16:t,base58btc:r,base64:n,base64url:a}=z0;return t.decoder.or(r.decoder.or(n.decoder.or(a.decoder))).decode(e.publicKeyMultibase)}return new Uint8Array}i(Cm,"extractPublicKeyBytes");o(Cm,"extractPublicKeyBytes");function oT(e,t,r){let n=C6(e),a=ed(t),s=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=s.find(h=>{try{let p=Cm(h);return k6.keyFromPublic(p).verify(n,a)}catch{return!1}});if(!l&&c.length>0&&(l=D6(e,t,c)),!l)throw new Error("invalid_signature: Signature invalid for JWT");return l}i(oT,"verifyES256K");o(oT,"verifyES256K");function D6(e,t,r){let n;if(t.length>86)n=[ed(t,!0)];else{let c=ed(t,!1);n=[{...c,recoveryParam:0},{...c,recoveryParam:1}]}let a=o(c=>{let l=C6(e),h=k6.recoverPubKey(l,c,c.recoveryParam),p=h.encode("hex"),g=h.encode("hex",!0),v=nT(p);return r.find(_=>{var x,O,D;let P=ys(Cm(_));return P===p||P===g||((x=_.ethereumAddress)==null?void 0:x.toLowerCase())===v||((O=_.blockchainAccountId)==null||(D=O.split("@eip155"))==null?void 0:D[0].toLowerCase())===v})},"checkSignatureAgainstSigner"),s=n.map(a).filter(c=>typeof c<"u");if(s.length===0)throw new Error("invalid_signature: Signature invalid for JWT");return s[0]}i(D6,"verifyRecoverableES256K");o(D6,"verifyRecoverableES256K");function wb(e,t,r){let n=x6(e),a=Pn(t),s=r.find(c=>(0,Zx.verify)(Cm(c),n,a));if(!s)throw new Error("invalid_signature: Signature invalid for JWT");return s}i(wb,"verifyEd25519");o(wb,"verifyEd25519");var nz={ES256K:oT,"ES256K-R":D6,Ed25519:wb,EdDSA:wb};function R6(e){let t=nz[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}i(R6,"VerifierAlgorithm");o(R6,"VerifierAlgorithm");R6.toSignatureObject=ed;var iz=o(function(e,t,r={},n={}){try{r.alg||(r.alg=az);let a=typeof e=="string"?e:_b(e,n.canonicalize),s=[_b(r,n.canonicalize),a].join("."),c=aT(r.alg);return Promise.resolve(c(s,t)).then(function(l){return[s,l].join(".")})}catch(a){return Promise.reject(a)}},"createJWS"),az="ES256K";function _b(e,t=!1){return V0(t?(0,X$.default)(e):JSON.stringify(e))}i(_b,"encodeSection");o(_b,"encodeSection");function sT(e){let t=e.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(t)return{header:JSON.parse(S6(t[1])),payload:t[2],signature:t[3],data:`${t[1]}.${t[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}i(sT,"decodeJWS");o(sT,"decodeJWS");function cT({header:e,data:t,signature:r},n){return Array.isArray(n)||(n=[n]),R6(e.alg)(t,r,n)}i(cT,"verifyJWSDecoded");o(cT,"verifyJWSDecoded");function uT(e,t){let r=sT(e);return cT(r,t)}i(uT,"verifyJWS");o(uT,"verifyJWS");function lT(e,t,r){for(var n;;){var a=e();if(xo(a)&&(a=a.v),!a)return s;if(a.then){n=0;break}var s=r();if(s&&s.then)if(xo(s))s=s.s;else{n=1;break}if(t){var c=t();if(c&&c.then&&!xo(c)){n=2;break}}}var l=new Mc,h=Gr.bind(null,l,2);return(n===0?a.then(g):n===1?s.then(p):c.then(v)).then(void 0,h),l;function p(y){s=y;do{if(t&&(c=t(),c&&c.then&&!xo(c))){c.then(v).then(void 0,h);return}if(a=e(),!a||xo(a)&&!a.v){Gr(l,1,s);return}if(a.then){a.then(g).then(void 0,h);return}s=r(),xo(s)&&(s=s.v)}while(!s||!s.then);s.then(p).then(void 0,h)}i(p,"_resumeAfterBody"),o(p,"_resumeAfterBody");function g(y){y?(s=r(),s&&s.then?s.then(p).then(void 0,h):p(s)):Gr(l,1,s)}i(g,"_resumeAfterTest"),o(g,"_resumeAfterTest");function v(){(a=e())?a.then?a.then(g).then(void 0,h):g(a):Gr(l,1,s)}i(v,"_resumeAfterUpdate"),o(v,"_resumeAfterUpdate")}i(lT,"_for");o(lT,"_for");var oz=o(function(e,t){try{let r=i(function(p){if(l===null)throw new Error("failure: Failed to decrypt");return l},"_temp5");o(r,"_temp5");let n;hT(e);let a=JSON.parse(S6(e.protected));if(a.enc!==t.enc)throw new Error(`not_supported: Decrypter does not supported: '${a.enc}'`);let s=T6(e.ciphertext,e.tag),c=new Uint8Array(Buffer.from(e.aad?`${e.protected}.${e.aad}`:e.protected)),l=null,h=function(){return a.alg==="dir"&&t.alg==="dir"?Promise.resolve(t.decrypt(s,Pn(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 lT(function(){return!l&&p<e.recipients.length},function(){return p++},function(){let g=e.recipients[p];Object.assign(g.header,a);let v=function(){if(g.header.alg===t.alg)return Promise.resolve(t.decrypt(s,Pn(e.iv),c,g)).then(function(y){l=y})}();if(v&&v.then)return v.then(function(){})})}}()}();return Promise.resolve(h&&h.then?h.then(r):r(h))}catch(r){return Promise.reject(r)}},"decryptJWE"),jA=typeof Symbol<"u"?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function Gr(e,t,r){if(!e.s){if(r instanceof Mc)if(r.s)t&1&&(t=r.s),r=r.v;else{r.o=Gr.bind(null,e,t);return}if(r&&r.then){r.then(Gr.bind(null,e,t),Gr.bind(null,e,2));return}e.s=t,e.v=r;let n=e.o;n&&n(e)}}i(Gr,"_settle");o(Gr,"_settle");var Mc=function(){function e(){}return i(e,"_Pact2"),o(e,"_Pact"),e.prototype.then=function(t,r){let n=new e,a=this.s;if(a){let s=a&1?t:r;if(s){try{Gr(n,1,s(this.v))}catch(c){Gr(n,2,c)}return n}else return this}return this.o=function(s){try{let c=s.v;s.s&1?Gr(n,1,t?t(c):c):r?Gr(n,1,r(c)):Gr(n,2,c)}catch(c){Gr(n,2,c)}},n},e}();function xo(e){return e instanceof Mc&&e.s&1}i(xo,"_isSettledPact");o(xo,"_isSettledPact");function fT(e,t,r){var n=-1,a,s;function c(l){try{for(;++n<e.length&&(!r||!r());)if(l=t(n),l&&l.then)if(xo(l))l=l.v;else{l.then(c,s||(s=Gr.bind(null,a=new Mc,2)));return}a?Gr(a,1,l):a=l}catch(h){Gr(a||(a=new Mc),2,h)}}return i(c,"_cycle"),o(c,"_cycle"),c(),a}i(fT,"_forTo");o(fT,"_forTo");function dT(e,t,r){if(typeof e[jA]=="function"){let g=i(function(v){try{for(;!(a=n.next()).done&&(!r||!r());)if(v=t(a.value),v&&v.then)if(xo(v))v=v.v;else{v.then(g,c||(c=Gr.bind(null,s=new Mc,2)));return}s?Gr(s,1,v):s=v}catch(y){Gr(s||(s=new Mc),2,y)}},"_cycle");o(g,"_cycle");var n=e[jA](),a,s,c;if(g(),n.return){var l=o(function(v){try{a.done||n.return()}catch{}return v},"_fixup");if(s&&s.then)return s.then(l,function(v){throw l(v)});l()}return s}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 fT(h,function(g){return t(h[g])},r)}i(dT,"_forOf");o(dT,"_forOf");function hT(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(hT,"validateJWE");o(hT,"validateJWE");function Eb({ciphertext:e,tag:t,iv:r,protectedHeader:n,recipient:a},s){let c={protected:n,iv:wi(r),ciphertext:wi(e),tag:wi(t)};return s&&(c.aad=wi(s)),a&&(c.recipients=[a]),c}i(Eb,"encodeJWE");o(Eb,"encodeJWE");var sz=o(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(a){return Eb(a,n)})}else{let a=t[0].enc;if(!t.reduce((h,p)=>h&&p.enc===a,!0))throw new Error("invalid_argument: Incompatible encrypters passed");let s,c,l=dT(t,function(h){let p=function(){return s?Promise.resolve(h.encryptCek==null?void 0:h.encryptCek(s)).then(function(g){if(g){var v,y;(v=c)==null||(y=v.recipients)==null||y.push(g)}}):Promise.resolve(h.encrypt(e,r,n)).then(function(g){s=g.cek,c=Eb(g,n)})}();if(p&&p.then)return p.then(function(){})});return Promise.resolve(l&&l.then?l.then(function(){return c}):c)}}catch(a){return Promise.reject(a)}},"createJWE"),cz=o(function(e,t){try{let r=o(function(a){try{return Promise.resolve(t.resolve(a)).then(function({didResolutionMetadata:s,didDocument:c}){var l;if(s!=null&&s.error||c==null)throw new Error(`resolver_error: Could not resolve ${a}: ${s.error}, ${s.message}`);if(!c.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${a}`);let p=((l=c.keyAgreement)==null?void 0:l.map(g=>typeof g=="string"?[...c.publicKey||[],...c.verificationMethod||[]].find(v=>v.id===g):g).filter(g=>typeof g<"u")).filter(g=>g.type==="X25519KeyAgreementKey2019"&&Boolean(g.publicKeyBase58));if(!p.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${a}`);return p.map(g=>mT(Tm(g.publicKeyBase58),g.id))})}catch(s){return Promise.reject(s)}},"encryptersForDID"),n=e.map(a=>r(a));return Promise.resolve(Promise.all(n)).then(function(a){return[].concat(...a)})}catch(r){return Promise.reject(r)}},"resolveX25519Encrypters");function O6(e){let t=new Yx.XChaCha20Poly1305(e);return(r,n)=>{let a=(0,Xx.randomBytes)(t.nonceLength),s=t.seal(a,r,n);return{ciphertext:s.subarray(0,s.length-t.tagLength),tag:s.subarray(s.length-t.tagLength),iv:a}}}i(O6,"xc20pEncrypter");o(O6,"xc20pEncrypter");function pT(e){let t=o(function(s,c={},l){try{let h=V0(JSON.stringify(Object.assign({alg:a},c,{enc:n}))),p=new Uint8Array(Buffer.from(l?`${h}.${wi(l)}`:h));return Promise.resolve({...r(s,p),protectedHeader:h})}catch(h){return Promise.reject(h)}},"encrypt"),r=O6(e),n="XC20P",a="dir";return{alg:a,enc:n,encrypt:t}}i(pT,"xc20pDirEncrypter");o(pT,"xc20pDirEncrypter");function Ab(e){let t=o(function(n,a,s){try{return Promise.resolve(r.open(a,n,s))}catch(c){return Promise.reject(c)}},"decrypt"),r=new Yx.XChaCha20Poly1305(e);return{alg:"dir",enc:"XC20P",decrypt:t}}i(Ab,"xc20pDirDecrypter");o(Ab,"xc20pDirDecrypter");function mT(e,t){let r=o(function(l,h={},p){try{Object.assign(h,{alg:void 0});let g=(0,Xx.randomBytes)(32);return Promise.resolve(pT(g).encrypt(l,h,p)).then(function(v){return Promise.resolve(n(g)).then(function(y){return{...v,recipient:y,cek:g}})})}catch(g){return Promise.reject(g)}},"encrypt"),n=o(function(l){try{let h=(0,vb.generateKeyPair)(),p=(0,vb.sharedKey)(h.secretKey,e),g=M6(p,s,a),v=O6(g)(l),y={encrypted_key:wi(v.ciphertext),header:{alg:a,iv:wi(v.iv),tag:wi(v.tag),epk:{kty:"OKP",crv:c,x:wi(h.publicKey)}}};return t&&(y.header.kid=t),Promise.resolve(y)}catch(h){return Promise.reject(h)}},"encryptCek"),a="ECDH-ES+XC20PKW",s=256,c="X25519";return{alg:a,enc:"XC20P",encrypt:r,encryptCek:n}}i(mT,"x25519Encrypter");o(mT,"x25519Encrypter");function gT(e){if(!(e&&e.epk&&e.iv&&e.tag))throw new Error("bad_jwe: malformed header")}i(gT,"validateHeader");o(gT,"validateHeader");function vT(e){let t=o(function(s,c,l,h){try{let v=i(function(){let O=M6(_,n,r),D=T6(h.encrypted_key,h.header.tag);return Promise.resolve(Ab(O).decrypt(D,Pn(h.header.iv))).then(function(P){return P===null?null:Ab(P).decrypt(s,c,l)})},"_temp4");o(v,"_temp4");var p,g;if(gT((p=h)==null?void 0:p.header),h=h,((g=h.header.epk)==null?void 0:g.crv)!==a||typeof h.header.epk.x>"u")return Promise.resolve(null);let y=Pn(h.header.epk.x),_,x=function(){if(e instanceof Uint8Array)_=(0,vb.sharedKey)(e,y);else return Promise.resolve(e(y)).then(function(O){_=O})}();return Promise.resolve(x&&x.then?x.then(v):v(x))}catch(v){return Promise.reject(v)}},"decrypt"),r="ECDH-ES+XC20PKW",n=256,a="X25519";return{alg:r,enc:"XC20P",decrypt:t}}i(vT,"x25519Decrypter");o(vT,"x25519Decrypter");Ax();var w0=o(({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1}),"readonly"),Sb=o(function*(e,t){if(e!=null&&!(e instanceof Uint8Array))for(let[r,n]of Object.entries(e)){let a=[...t,r];if(n!=null&&typeof n=="object")if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s],h=$t.asCID(c);h?yield[l.join("/"),h]:typeof c=="object"&&(yield*Sb(c,l))}else{let s=$t.asCID(n);s?yield[a.join("/"),s]:yield*Sb(n,a)}}},"links"),xb=o(function*(e,t){if(e!=null)for(let[r,n]of Object.entries(e)){let a=[...t,r];if(yield a.join("/"),n!=null&&!(n instanceof Uint8Array)&&typeof n=="object"&&!$t.asCID(n))if(Array.isArray(n))for(let[s,c]of n.entries()){let l=[...a,s];yield l.join("/"),typeof c=="object"&&!$t.asCID(c)&&(yield*xb(c,l))}else yield*xb(n,a)}},"tree"),uz=o((e,t)=>{let r=e;for(let[n,a]of t.entries()){if(r=r[a],r==null)throw new Error(`Object has no property at ${t.slice(0,n+1).map(c=>`[${JSON.stringify(c)}]`).join("")}`);let s=$t.asCID(r);if(s)return{value:s,remaining:t.slice(n+1).join("/")}}return{value:r}},"get"),N6=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:w0(),bytes:w0(),value:w0(),asBlock:w0()})}links(){return Sb(this.value,[])}tree(){return xb(this.value,[])}get(e="/"){return uz(this.value,e.split("/").filter(Boolean))}},"Block");o(N6,"Block");var Mm=o(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),a=await r.digest(n),s=$t.create(1,t.code,a);return new N6({value:e,bytes:n,cid:s})},"encode"),lz=o(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),a=await r.digest(e),s=$t.create(1,t.code,a);return new N6({value:n,bytes:e,cid:s})},"decode");Ga();bm();Ex();m6();var fl={};xr(fl,{code:()=>W0,decode:()=>DC,encode:()=>Um,name:()=>Mz});var fz=["string","number","bigint","symbol"],dz=["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 yT(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(fz.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(bT(e))return"Buffer";let r=wT(e);return r||"Object"}i(yT,"is");o(yT,"is");function bT(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}i(bT,"isBuffer");o(bT,"isBuffer");function wT(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(dz.includes(t))return t}i(wT,"getObjectType");o(wT,"getObjectType");var je=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");o(je,"Type");je.uint=new je(0,"uint",!0);je.negint=new je(1,"negint",!0);je.bytes=new je(2,"bytes",!0);je.string=new je(3,"string",!0);je.array=new je(4,"array",!1);je.map=new je(5,"map",!1);je.tag=new je(6,"tag",!1);je.float=new je(7,"float",!0);je.false=new je(7,"false",!0);je.true=new je(7,"true",!0);je.null=new je(7,"null",!0);je.undefined=new je(7,"undefined",!0);je.break=new je(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");o(bt,"Token");var dl=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",hz=new TextDecoder,pz=new TextEncoder;function td(e){return dl&&globalThis.Buffer.isBuffer(e)}i(td,"isBuffer2");o(td,"isBuffer");function P6(e){return e instanceof Uint8Array?td(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}i(P6,"asU8A");o(P6,"asU8A");var mz=dl?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Cb(e,t,r):(e,t,r)=>r-t>64?hz.decode(e.subarray(t,r)):Cb(e,t,r),gz=dl?e=>e.length>64?globalThis.Buffer.from(e):Tb(e):e=>e.length>64?pz.encode(e):Tb(e),_o=o(e=>Uint8Array.from(e),"fromArray"),B6=dl?(e,t,r)=>td(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),vz=dl?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),P6(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let a of e)n+a.length>r.length&&(a=a.subarray(0,r.length-n)),r.set(a,n),n+=a.length;return r},yz=dl?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function _T(e,t){if(td(e)&&td(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(_T,"compare2");o(_T,"compare");function Tb(e,t=1/0){let r,n=e.length,a=null,s=[];for(let c=0;c<n;++c){if(r=e.charCodeAt(c),r>55295&&r<57344){if(!a){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}else if(c+1===n){(t-=3)>-1&&s.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&s.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}i(Tb,"utf8ToBytes");o(Tb,"utf8ToBytes");function Cb(e,t,r){let n=[];for(;t<r;){let a=e[t],s=null,c=a>239?4:a>223?3:a>191?2:1;if(t+c<=r){let l,h,p,g;switch(c){case 1:a<128&&(s=a);break;case 2:l=e[t+1],(l&192)===128&&(g=(a&31)<<6|l&63,g>127&&(s=g));break;case 3:l=e[t+1],h=e[t+2],(l&192)===128&&(h&192)===128&&(g=(a&15)<<12|(l&63)<<6|h&63,g>2047&&(g<55296||g>57343)&&(s=g));break;case 4:l=e[t+1],h=e[t+2],p=e[t+3],(l&192)===128&&(h&192)===128&&(p&192)===128&&(g=(a&15)<<18|(l&63)<<12|(h&63)<<6|p&63,g>65535&&g<1114112&&(s=g))}}s===null?(s=65533,c=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|s&1023),n.push(s),t+=c}return ET(n)}i(Cb,"utf8Slice");o(Cb,"utf8Slice");var $A=4096;function ET(e){let t=e.length;if(t<=$A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=$A));return r}i(ET,"decodeCodePointsArray");o(ET,"decodeCodePointsArray");var bz=256,L6=i(class{constructor(e=bz){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=yz(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=B6(r,0,this.cursor)}else t=vz(this.chunks,this.cursor);return e&&this.reset(),t}},"Bl");o(L6,"Bl");var Zt="CBOR decode error:",AT="CBOR encode error:",xd=[];xd[23]=1;xd[24]=2;xd[25]=3;xd[26]=5;xd[27]=9;function Lc(e,t,r){if(e.length-t<r)throw new Error(`${Zt} not enough data for type`)}i(Lc,"assertEnoughData");o(Lc,"assertEnoughData");var ln=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Cs(e,t,r){Lc(e,t,1);let n=e[t];if(r.strict===!0&&n<ln[0])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Cs,"readUint8");o(Cs,"readUint8");function Ms(e,t,r){Lc(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<ln[1])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Ms,"readUint16");o(Ms,"readUint16");function Is(e,t,r){Lc(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<ln[2])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);return n}i(Is,"readUint32");o(Is,"readUint32");function ks(e,t,r){Lc(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],a=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(a);if(r.strict===!0&&s<ln[3])throw new Error(`${Zt} integer encoded in more bytes than necessary (strict decode)`);if(s<=Number.MAX_SAFE_INTEGER)return Number(s);if(r.allowBigInt===!0)return s;throw new Error(`${Zt} integers outside of the safe integer range are not supported`)}i(ks,"readUint64");o(ks,"readUint64");function ST(e,t,r,n){return new bt(je.uint,Cs(e,t+1,n),2)}i(ST,"decodeUint8");o(ST,"decodeUint8");function xT(e,t,r,n){return new bt(je.uint,Ms(e,t+1,n),3)}i(xT,"decodeUint16");o(xT,"decodeUint16");function TT(e,t,r,n){return new bt(je.uint,Is(e,t+1,n),5)}i(TT,"decodeUint32");o(TT,"decodeUint32");function CT(e,t,r,n){return new bt(je.uint,ks(e,t+1,n),9)}i(CT,"decodeUint64");o(CT,"decodeUint64");function Ds(e,t){return Ai(e,0,t.value)}i(Ds,"encodeUint");o(Ds,"encodeUint");function Ai(e,t,r){if(r<ln[0]){let n=Number(r);e.push([t|n])}else if(r<ln[1]){let n=Number(r);e.push([t|24,n])}else if(r<ln[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<ln[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<ln[4]){let a=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));a[8]=s&255,s=s>>8,a[7]=s&255,s=s>>8,a[6]=s&255,s=s>>8,a[5]=s&255,a[4]=c&255,c=c>>8,a[3]=c&255,c=c>>8,a[2]=c&255,c=c>>8,a[1]=c&255,e.push(a)}else throw new Error(`${Zt} encountered BigInt larger than allowable range`)}}i(Ai,"encodeUintValue");o(Ai,"encodeUintValue");Ds.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize"),"encodedSize");Ai.encodedSize=o(i(function(t){return t<ln[0]?1:t<ln[1]?2:t<ln[2]?3:t<ln[3]?5:9},"encodedSize2"),"encodedSize");Ds.compareTokens=o(i(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens"),"compareTokens");function MT(e,t,r,n){return new bt(je.negint,-1-Cs(e,t+1,n),2)}i(MT,"decodeNegint8");o(MT,"decodeNegint8");function IT(e,t,r,n){return new bt(je.negint,-1-Ms(e,t+1,n),3)}i(IT,"decodeNegint16");o(IT,"decodeNegint16");function kT(e,t,r,n){return new bt(je.negint,-1-Is(e,t+1,n),5)}i(kT,"decodeNegint32");o(kT,"decodeNegint32");var U6=BigInt(-1),DT=BigInt(1);function RT(e,t,r,n){let a=ks(e,t+1,n);if(typeof a!="bigint"){let s=-1-a;if(s>=Number.MIN_SAFE_INTEGER)return new bt(je.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${Zt} integers outside of the safe integer range are not supported`);return new bt(je.negint,U6-BigInt(a),9)}i(RT,"decodeNegint64");o(RT,"decodeNegint64");function Im(e,t){let r=t.value,n=typeof r=="bigint"?r*U6-DT:r*-1-1;Ai(e,t.type.majorEncoded,n)}i(Im,"encodeNegint");o(Im,"encodeNegint");Im.encodedSize=o(i(function(t){let r=t.value,n=typeof r=="bigint"?r*U6-DT:r*-1-1;return n<ln[0]?1:n<ln[1]?2:n<ln[2]?3:n<ln[3]?5:9},"encodedSize3"),"encodedSize");Im.compareTokens=o(i(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens2"),"compareTokens");function hl(e,t,r,n){Lc(e,t,r+n);let a=B6(e,t+r,t+r+n);return new bt(je.bytes,a,r+n)}i(hl,"toToken");o(hl,"toToken");function OT(e,t,r,n){return hl(e,t,1,r)}i(OT,"decodeBytesCompact");o(OT,"decodeBytesCompact");function NT(e,t,r,n){return hl(e,t,2,Cs(e,t+1,n))}i(NT,"decodeBytes8");o(NT,"decodeBytes8");function PT(e,t,r,n){return hl(e,t,3,Ms(e,t+1,n))}i(PT,"decodeBytes16");o(PT,"decodeBytes16");function BT(e,t,r,n){return hl(e,t,5,Is(e,t+1,n))}i(BT,"decodeBytes32");o(BT,"decodeBytes32");function LT(e,t,r,n){let a=ks(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer bytes lengths not supported`);return hl(e,t,9,a)}i(LT,"decodeBytes64");o(LT,"decodeBytes64");function rd(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===je.string?gz(e.value):e.value),e.encodedBytes}i(rd,"tokenBytes");o(rd,"tokenBytes");function Td(e,t){let r=rd(t);Ai(e,t.type.majorEncoded,r.length),e.push(r)}i(Td,"encodeBytes");o(Td,"encodeBytes");Td.encodedSize=o(i(function(t){let r=rd(t);return Ai.encodedSize(r.length)+r.length},"encodedSize4"),"encodedSize");Td.compareTokens=o(i(function(t,r){return UT(rd(t),rd(r))},"compareTokens3"),"compareTokens");function UT(e,t){return e.length<t.length?-1:e.length>t.length?1:_T(e,t)}i(UT,"compareBytes");o(UT,"compareBytes");function pl(e,t,r,n,a){let s=r+n;Lc(e,t,s);let c=new bt(je.string,mz(e,t+r,t+s),s);return a.retainStringBytes===!0&&(c.byteValue=B6(e,t+r,t+s)),c}i(pl,"toToken2");o(pl,"toToken");function FT(e,t,r,n){return pl(e,t,1,r,n)}i(FT,"decodeStringCompact");o(FT,"decodeStringCompact");function jT(e,t,r,n){return pl(e,t,2,Cs(e,t+1,n),n)}i(jT,"decodeString8");o(jT,"decodeString8");function $T(e,t,r,n){return pl(e,t,3,Ms(e,t+1,n),n)}i($T,"decodeString16");o($T,"decodeString16");function zT(e,t,r,n){return pl(e,t,5,Is(e,t+1,n),n)}i(zT,"decodeString32");o(zT,"decodeString32");function HT(e,t,r,n){let a=ks(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer string lengths not supported`);return pl(e,t,9,a,n)}i(HT,"decodeString64");o(HT,"decodeString64");var wz=Td;function Uc(e,t,r,n){return new bt(je.array,n,r)}i(Uc,"toToken3");o(Uc,"toToken");function qT(e,t,r,n){return Uc(e,t,1,r)}i(qT,"decodeArrayCompact");o(qT,"decodeArrayCompact");function VT(e,t,r,n){return Uc(e,t,2,Cs(e,t+1,n))}i(VT,"decodeArray8");o(VT,"decodeArray8");function KT(e,t,r,n){return Uc(e,t,3,Ms(e,t+1,n))}i(KT,"decodeArray16");o(KT,"decodeArray16");function GT(e,t,r,n){return Uc(e,t,5,Is(e,t+1,n))}i(GT,"decodeArray32");o(GT,"decodeArray32");function WT(e,t,r,n){let a=ks(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer array lengths not supported`);return Uc(e,t,9,a)}i(WT,"decodeArray64");o(WT,"decodeArray64");function JT(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return Uc(e,t,1,1/0)}i(JT,"decodeArrayIndefinite");o(JT,"decodeArrayIndefinite");function km(e,t){Ai(e,je.array.majorEncoded,t.value)}i(km,"encodeArray");o(km,"encodeArray");km.compareTokens=Ds.compareTokens;km.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize5"),"encodedSize");function Fc(e,t,r,n){return new bt(je.map,n,r)}i(Fc,"toToken4");o(Fc,"toToken");function ZT(e,t,r,n){return Fc(e,t,1,r)}i(ZT,"decodeMapCompact");o(ZT,"decodeMapCompact");function YT(e,t,r,n){return Fc(e,t,2,Cs(e,t+1,n))}i(YT,"decodeMap8");o(YT,"decodeMap8");function XT(e,t,r,n){return Fc(e,t,3,Ms(e,t+1,n))}i(XT,"decodeMap16");o(XT,"decodeMap16");function QT(e,t,r,n){return Fc(e,t,5,Is(e,t+1,n))}i(QT,"decodeMap32");o(QT,"decodeMap32");function eC(e,t,r,n){let a=ks(e,t+1,n);if(typeof a=="bigint")throw new Error(`${Zt} 64-bit integer map lengths not supported`);return Fc(e,t,9,a)}i(eC,"decodeMap64");o(eC,"decodeMap64");function tC(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return Fc(e,t,1,1/0)}i(tC,"decodeMapIndefinite");o(tC,"decodeMapIndefinite");function Dm(e,t){Ai(e,je.map.majorEncoded,t.value)}i(Dm,"encodeMap");o(Dm,"encodeMap");Dm.compareTokens=Ds.compareTokens;Dm.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize6"),"encodedSize");function rC(e,t,r,n){return new bt(je.tag,r,1)}i(rC,"decodeTagCompact");o(rC,"decodeTagCompact");function nC(e,t,r,n){return new bt(je.tag,Cs(e,t+1,n),2)}i(nC,"decodeTag8");o(nC,"decodeTag8");function iC(e,t,r,n){return new bt(je.tag,Ms(e,t+1,n),3)}i(iC,"decodeTag16");o(iC,"decodeTag16");function aC(e,t,r,n){return new bt(je.tag,Is(e,t+1,n),5)}i(aC,"decodeTag32");o(aC,"decodeTag32");function oC(e,t,r,n){return new bt(je.tag,ks(e,t+1,n),9)}i(oC,"decodeTag64");o(oC,"decodeTag64");function Rm(e,t){Ai(e,je.tag.majorEncoded,t.value)}i(Rm,"encodeTag");o(Rm,"encodeTag");Rm.compareTokens=Ds.compareTokens;Rm.encodedSize=o(i(function(t){return Ai.encodedSize(t.value)},"encodedSize7"),"encodedSize");var _z=20,Ez=21,Az=22,Sz=23;function sC(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${Zt} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new bt(je.null,null,1):new bt(je.undefined,void 0,1)}i(sC,"decodeUndefined");o(sC,"decodeUndefined");function cC(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${Zt} indefinite length items not allowed`);return new bt(je.break,void 0,1)}i(cC,"decodeBreak");o(cC,"decodeBreak");function Om(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${Zt} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${Zt} Infinity values are not supported`)}return new bt(je.float,e,t)}i(Om,"createToken");o(Om,"createToken");function uC(e,t,r,n){return Om(Pm(e,t+1),3,n)}i(uC,"decodeFloat16");o(uC,"decodeFloat16");function lC(e,t,r,n){return Om(Bm(e,t+1),5,n)}i(lC,"decodeFloat32");o(lC,"decodeFloat32");function fC(e,t,r,n){return Om($6(e,t+1),9,n)}i(fC,"decodeFloat64");o(fC,"decodeFloat64");function Nm(e,t,r){let n=t.value;if(n===!1)e.push([je.float.majorEncoded|_z]);else if(n===!0)e.push([je.float.majorEncoded|Ez]);else if(n===null)e.push([je.float.majorEncoded|Az]);else if(n===void 0)e.push([je.float.majorEncoded|Sz]);else{let a,s=!1;(!r||r.float64!==!0)&&(F6(n),a=Pm(ca,1),n===a||Number.isNaN(n)?(ca[0]=249,e.push(ca.slice(0,3)),s=!0):(j6(n),a=Bm(ca,1),n===a&&(ca[0]=250,e.push(ca.slice(0,5)),s=!0))),s||(hC(n),a=$6(ca,1),ca[0]=251,e.push(ca.slice(0,9)))}}i(Nm,"encodeFloat");o(Nm,"encodeFloat");Nm.encodedSize=o(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){F6(n);let a=Pm(ca,1);if(n===a||Number.isNaN(n))return 3;if(j6(n),a=Bm(ca,1),n===a)return 5}return 9},"encodedSize8"),"encodedSize");var dC=new ArrayBuffer(9),qi=new DataView(dC,1),ca=new Uint8Array(dC,0);function F6(e){if(e===1/0)qi.setUint16(0,31744,!1);else if(e===-1/0)qi.setUint16(0,64512,!1);else if(Number.isNaN(e))qi.setUint16(0,32256,!1);else{qi.setFloat32(0,e);let t=qi.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)qi.setUint16(0,31744,!1);else if(r===0)qi.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let a=r-127;a<-24?qi.setUint16(0,0):a<-14?qi.setUint16(0,(t&2147483648)>>16|1<<24+a,!1):qi.setUint16(0,(t&2147483648)>>16|a+15<<10|n>>13,!1)}}}i(F6,"encodeFloat16");o(F6,"encodeFloat16");function Pm(e,t){if(e.length-t<2)throw new Error(`${Zt} 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,a=r&1023,s;return n===0?s=a*2**-24:n!==31?s=(a+1024)*2**(n-25):s=a===0?1/0:NaN,r&32768?-s:s}i(Pm,"readFloat16");o(Pm,"readFloat16");function j6(e){qi.setFloat32(0,e,!1)}i(j6,"encodeFloat32");o(j6,"encodeFloat32");function Bm(e,t){if(e.length-t<4)throw new Error(`${Zt} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}i(Bm,"readFloat32");o(Bm,"readFloat32");function hC(e){qi.setFloat64(0,e,!1)}i(hC,"encodeFloat64");o(hC,"encodeFloat64");function $6(e,t){if(e.length-t<8)throw new Error(`${Zt} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}i($6,"readFloat64");o($6,"readFloat64");Nm.compareTokens=Ds.compareTokens;function ar(e,t,r){throw new Error(`${Zt} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}i(ar,"invalidMinor");o(ar,"invalidMinor");function Cd(e){return()=>{throw new Error(`${Zt} ${e}`)}}i(Cd,"errorer");o(Cd,"errorer");var Je=[];for(let e=0;e<=23;e++)Je[e]=ar;Je[24]=ST;Je[25]=xT;Je[26]=TT;Je[27]=CT;Je[28]=ar;Je[29]=ar;Je[30]=ar;Je[31]=ar;for(let e=32;e<=55;e++)Je[e]=ar;Je[56]=MT;Je[57]=IT;Je[58]=kT;Je[59]=RT;Je[60]=ar;Je[61]=ar;Je[62]=ar;Je[63]=ar;for(let e=64;e<=87;e++)Je[e]=OT;Je[88]=NT;Je[89]=PT;Je[90]=BT;Je[91]=LT;Je[92]=ar;Je[93]=ar;Je[94]=ar;Je[95]=Cd("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)Je[e]=FT;Je[120]=jT;Je[121]=$T;Je[122]=zT;Je[123]=HT;Je[124]=ar;Je[125]=ar;Je[126]=ar;Je[127]=Cd("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)Je[e]=qT;Je[152]=VT;Je[153]=KT;Je[154]=GT;Je[155]=WT;Je[156]=ar;Je[157]=ar;Je[158]=ar;Je[159]=JT;for(let e=160;e<=183;e++)Je[e]=ZT;Je[184]=YT;Je[185]=XT;Je[186]=QT;Je[187]=eC;Je[188]=ar;Je[189]=ar;Je[190]=ar;Je[191]=tC;for(let e=192;e<=215;e++)Je[e]=rC;Je[216]=nC;Je[217]=iC;Je[218]=aC;Je[219]=oC;Je[220]=ar;Je[221]=ar;Je[222]=ar;Je[223]=ar;for(let e=224;e<=243;e++)Je[e]=Cd("simple values are not supported");Je[244]=ar;Je[245]=ar;Je[246]=ar;Je[247]=sC;Je[248]=Cd("simple values are not supported");Je[249]=uC;Je[250]=lC;Je[251]=fC;Je[252]=ar;Je[253]=ar;Je[254]=ar;Je[255]=cC;var Za=[];for(let e=0;e<24;e++)Za[e]=new bt(je.uint,e,1);for(let e=-1;e>=-24;e--)Za[31-e]=new bt(je.negint,e,1);Za[64]=new bt(je.bytes,new Uint8Array(0),1);Za[96]=new bt(je.string,"",1);Za[128]=new bt(je.array,0,1);Za[160]=new bt(je.map,0,1);Za[244]=new bt(je.false,!1,1);Za[245]=new bt(je.true,!0,1);Za[246]=new bt(je.null,null,1);function pC(e){switch(e.type){case je.false:return _o([244]);case je.true:return _o([245]);case je.null:return _o([246]);case je.bytes:return e.value.length?void 0:_o([64]);case je.string:return e.value===""?_o([96]):void 0;case je.array:return e.value===0?_o([128]):void 0;case je.map:return e.value===0?_o([160]):void 0;case je.uint:return e.value<24?_o([Number(e.value)]):void 0;case je.negint:if(e.value>=-24)return _o([31-Number(e.value)])}}i(pC,"quickEncodeToken");o(pC,"quickEncodeToken");var xz={float64:!1,mapSorter:yC,quickEncodeToken:pC};function mC(){let e=[];return e[je.uint.major]=Ds,e[je.negint.major]=Im,e[je.bytes.major]=Td,e[je.string.major]=wz,e[je.array.major]=km,e[je.map.major]=Dm,e[je.tag.major]=Rm,e[je.float.major]=Nm,e}i(mC,"makeCborEncoders");o(mC,"makeCborEncoders");var gC=mC(),tb=new L6,G0=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(`${AT} object contains circular references`);return new G0(t,e)}},"Ref");o(G0,"Ref");var ds={null:new bt(je.null,null),undefined:new bt(je.undefined,void 0),true:new bt(je.true,!0),false:new bt(je.false,!1),emptyArray:new bt(je.array,0),emptyMap:new bt(je.map,0)},bs={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new bt(je.float,e):e>=0?new bt(je.uint,e):new bt(je.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new bt(je.uint,e):new bt(je.negint,e)},Uint8Array(e,t,r,n){return new bt(je.bytes,e)},string(e,t,r,n){return new bt(je.string,e)},boolean(e,t,r,n){return e?ds.true:ds.false},null(e,t,r,n){return ds.null},undefined(e,t,r,n){return ds.undefined},ArrayBuffer(e,t,r,n){return new bt(je.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new bt(je.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[ds.emptyArray,new bt(je.break)]:ds.emptyArray;n=G0.createCheck(n,e);let a=[],s=0;for(let c of e)a[s++]=Zf(c,r,n);return r.addBreakTokens?[new bt(je.array,e.length),a,new bt(je.break)]:[new bt(je.array,e.length),a]},Object(e,t,r,n){let a=t!=="Object",s=a?e.keys():Object.keys(e),c=a?e.size:s.length;if(!c)return r.addBreakTokens===!0?[ds.emptyMap,new bt(je.break)]:ds.emptyMap;n=G0.createCheck(n,e);let l=[],h=0;for(let p of s)l[h++]=[Zf(p,r,n),Zf(a?e.get(p):e[p],r,n)];return vC(l,r),r.addBreakTokens?[new bt(je.map,c),l,new bt(je.break)]:[new bt(je.map,c),l]}};bs.Map=bs.Object;bs.Buffer=bs.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))bs[`${e}Array`]=bs.DataView;function Zf(e,t={},r){let n=yT(e),a=t&&t.typeEncoders&&t.typeEncoders[n]||bs[n];if(typeof a=="function"){let c=a(e,n,t,r);if(c!=null)return c}let s=bs[n];if(!s)throw new Error(`${AT} unsupported type: ${n}`);return s(e,n,t,r)}i(Zf,"objectToTokens");o(Zf,"objectToTokens");function vC(e,t){t.mapSorter&&e.sort(t.mapSorter)}i(vC,"sortMapEntries");o(vC,"sortMapEntries");function yC(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 a=r.type.major,s=gC[a].compareTokens(r,n);return s===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),s}i(yC,"mapSorter");o(yC,"mapSorter");function z6(e,t,r,n){if(Array.isArray(t))for(let a of t)z6(e,a,r,n);else r[t.type.major](e,t,n)}i(z6,"tokensToEncoded");o(z6,"tokensToEncoded");function bC(e,t,r){let n=Zf(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let a=r.quickEncodeToken(n);if(a)return a;let s=t[n.type.major];if(s.encodedSize){let c=s.encodedSize(n,r),l=new L6(c);if(s(l,n,r),l.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return P6(l.chunks[0])}}return tb.reset(),z6(tb,n,t,r),tb.toBytes(!0)}i(bC,"encodeCustom");o(bC,"encodeCustom");function wC(e,t){return t=Object.assign({},xz,t),bC(e,gC,t)}i(wC,"encode6");o(wC,"encode");var Tz={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},_C=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=Za[e];if(t===void 0){let r=Je[e];if(!r)throw new Error(`${Zt} 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");o(_C,"Tokeniser");var nd=Symbol.for("DONE"),Lm=Symbol.for("BREAK");function EC(e,t,r){let n=[];for(let a=0;a<e.value;a++){let s=qu(t,r);if(s===Lm){if(e.value===1/0)break;throw new Error(`${Zt} got unexpected break to lengthed array`)}if(s===nd)throw new Error(`${Zt} found array but not enough entries (got ${a}, expected ${e.value})`);n[a]=s}return n}i(EC,"tokenToArray");o(EC,"tokenToArray");function AC(e,t,r){let n=r.useMaps===!0,a=n?void 0:{},s=n?new Map:void 0;for(let c=0;c<e.value;c++){let l=qu(t,r);if(l===Lm){if(e.value===1/0)break;throw new Error(`${Zt} got unexpected break to lengthed map`)}if(l===nd)throw new Error(`${Zt} found map but not enough entries (got ${c} [no key], expected ${e.value})`);if(n!==!0&&typeof l!="string")throw new Error(`${Zt} non-string keys not supported (got ${typeof l})`);if(r.rejectDuplicateMapKeys===!0&&(n&&s.has(l)||!n&&l in a))throw new Error(`${Zt} found repeat map key "${l}"`);let h=qu(t,r);if(h===nd)throw new Error(`${Zt} found map but not enough entries (got ${c} [no value], expected ${e.value})`);n?s.set(l,h):a[l]=h}return n?s:a}i(AC,"tokenToMap");o(AC,"tokenToMap");function qu(e,t){if(e.done())return nd;let r=e.next();if(r.type===je.break)return Lm;if(r.type.terminal)return r.value;if(r.type===je.array)return EC(r,e,t);if(r.type===je.map)return AC(r,e,t);if(r.type===je.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=qu(e,t);return t.tags[r.value](n)}throw new Error(`${Zt} tag not supported (${r.value})`)}throw new Error("unsupported")}i(qu,"tokensToObject");o(qu,"tokensToObject");function SC(e,t){if(!(e instanceof Uint8Array))throw new Error(`${Zt} data to decode must be a Uint8Array`);t=Object.assign({},Tz,t);let r=t.tokenizer||new _C(e,t),n=qu(r,t);if(n===nd)throw new Error(`${Zt} did not find any content to decode`);if(n===Lm)throw new Error(`${Zt} got unexpected break`);if(!r.done())throw new Error(`${Zt} too many terminals, data makes no sense`);return n}i(SC,"decode7");o(SC,"decode");Ga();var xC=42;function TC(e){if(e.asCID!==e)return null;let t=$t.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new bt(je.tag,xC),new bt(je.bytes,r)]}i(TC,"cidEncoder");o(TC,"cidEncoder");function CC(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}i(CC,"undefinedEncoder");o(CC,"undefinedEncoder");function MC(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(MC,"numberEncoder");o(MC,"numberEncoder");var Cz={float64:!0,typeEncoders:{Object:TC,undefined:CC,number:MC}};function IC(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return $t.decode(e.subarray(1))}i(IC,"cidDecoder");o(IC,"cidDecoder");var kC={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};kC.tags[xC]=IC;var Mz="dag-cbor",W0=113,Um=o(e=>wC(e,Cz),"encode"),DC=o(e=>SC(e,kC),"decode"),Iz=24;async function RC(e){let t=await Mm({value:e,codec:fl,hasher:ol});return{cid:t.cid,linkedBlock:t.bytes}}i(RC,"encodePayload");o(RC,"encodePayload");function OC(e,t=Iz){let r=(t-e.length%t)%t,n=new Uint8Array(e.length+r);return n.set(e,0),n}i(OC,"pad");o(OC,"pad");async function NC(e){return(await Mm({value:e,codec:fl,hasher:wm})).cid}i(NC,"encodeIdentityCID");o(NC,"encodeIdentityCID");function PC(e){if(e=$t.asCID(e),e.code!==W0)throw new Error("CID codec must be dag-cbor");if(e.multihash.code!==wm.code)throw new Error("CID must use identity multihash");return DC(e.multihash.digest)}i(PC,"decodeIdentityCID");o(PC,"decodeIdentityCID");async function BC(e,t){return OC((await NC(e)).bytes,t)}i(BC,"prepareCleartext");o(BC,"prepareCleartext");function LC(e){return PC($t.decodeFirst(e)[0])}i(LC,"decodeCleartext");o(LC,"decodeCleartext");var kz=Symbol("abortable"),Mb=Symbol("aborted");function UC(e,t){if(t.aborted)return Promise.reject(Mb);let r,n=new Promise((a,s)=>{r=s});return t.addEventListener("abort",()=>{r(Mb)}),Promise.race([e,n])}i(UC,"abortable");o(UC,"abortable");var Dz=o((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"),FC="utils_abort_request",Zn;(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"})(Zn||(Zn={}));var jC={[Zn.PARSE_ERROR]:"Parse error",[Zn.INVALID_REQUEST]:"Invalid request",[Zn.METHOD_NOT_FOUND]:"Method not found",[Zn.INVALID_PARAMS]:"Invalid params",[Zn.INTERNAL_ERROR]:"Internal error"};function $C(e){return-32e3>=e&&e>=-32099}i($C,"isServerError");o($C,"isServerError");function Fm(e){return jC[e.toString()]??($C(e)?"Server error":"Application error")}i(Fm,"getErrorMessage");o(Fm,"getErrorMessage");var ws=i(class extends Error{static fromObject(e){return new ws(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,ws.prototype),this.code=e,this.data=r,this.message=t??Fm(e)}},"RPCError");o(ws,"RPCError");function ml(e){let t=jC[e];return o(i(function(n){return new ws(e,t,n)},"createError"),"createError")}i(ml,"createErrorFactory");o(ml,"createErrorFactory");var FY=ml(Zn.PARSE_ERROR),jY=ml(Zn.INVALID_REQUEST),$Y=ml(Zn.METHOD_NOT_FOUND),zY=ml(Zn.INVALID_PARAMS),HY=ml(Zn.INTERNAL_ERROR);function zC(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(zC,"_checkPrivateRedeclaration");o(zC,"_checkPrivateRedeclaration");function HC(e,t){return t.get?t.get.call(e):t.value}i(HC,"_classApplyDescriptorGet");o(HC,"_classApplyDescriptorGet");function qC(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(qC,"_classApplyDescriptorSet");o(qC,"_classApplyDescriptorSet");function H6(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(H6,"_classExtractFieldDescriptor");o(H6,"_classExtractFieldDescriptor");function S0(e,t){var r=H6(e,t,"get");return HC(e,r)}i(S0,"_classPrivateFieldGet");o(S0,"_classPrivateFieldGet");function VC(e,t,r){zC(e,t),t.set(e,r)}i(VC,"_classPrivateFieldInit");o(VC,"_classPrivateFieldInit");function KC(e,t,r){var n=H6(e,t,"set");return qC(e,n,r),r}i(KC,"_classPrivateFieldSet");o(KC,"_classPrivateFieldSet");var Hf=new WeakMap,Ib=i(class{get connection(){return S0(this,Hf)}createID(){return Dz()}request(e,t=void 0,r={}){let{signal:n}=r;if(n?.aborted)return Promise.reject(Mb);let a=this.createID(),s=S0(this,Hf).send({jsonrpc:"2.0",id:a,method:e,params:t}).then(c=>{if(c==null)throw new Error("Missing response");if(c.error!=null)throw ws.fromObject(c.error);return c.result});return n==null?s:(n.addEventListener("abort",()=>{this.notify(FC,{id:a})}),UC(s,n))}async notify(e,t=void 0){await S0(this,Hf).send({jsonrpc:"2.0",method:e,params:t})}constructor(e){VC(this,Hf,{writable:!0,value:void 0}),KC(this,Hf,e)}},"RPCClient");o(Ib,"RPCClient");function kb(e,t){return{jsonrpc:"2.0",id:e,error:{code:t,message:Fm(t)}}}i(kb,"createErrorResponse");o(kb,"createErrorResponse");function GC(e,t,r){console.warn("Unhandled handler error",t,r)}i(GC,"fallbackOnHandlerError");o(GC,"fallbackOnHandlerError");function WC(e,t){console.warn("Unhandled invalid message",t)}i(WC,"fallbackOnInvalidMessage");o(WC,"fallbackOnInvalidMessage");function JC(e,t){console.warn("Unhandled notification",t)}i(JC,"fallbackOnNotification");o(JC,"fallbackOnNotification");function ZC(e,t={}){let r=t.onHandlerError??GC,n=t.onInvalidMessage??WC,a=t.onNotification??JC,s={};function c(l,h){if(h.method===FC){let p=h.params?.id;p!=null&&s[p]?.abort()}else a(l,h)}return i(c,"handleNotification"),o(c,"handleNotification"),o(i(async function(h,p){let g=p.id;if(p.jsonrpc!=="2.0"||p.method==null)return g==null?(n(h,p),null):kb(g,Zn.INVALID_REQUEST);let v=e[p.method];if(v==null)return g==null?(c(h,p),null):kb(g,Zn.METHOD_NOT_FOUND);try{let y;if(g!=null&&v[kz]){let x=new AbortController;s[g]=x,y=v(h,p.params,{signal:x.signal})}else y=v(h,p.params,{});let _=y==null?y:typeof y.then=="function"?await y:y;return g==null||s[g]?.signal.aborted?null:{jsonrpc:"2.0",id:g,result:_}}catch(y){if(g==null||s[g]?.signal.aborted)return r(h,p,y),null;let _;if(y instanceof ws)_=y.toObject();else{r(h,p,y);let x=y.code??-32e3;_={code:x,message:y.message||Fm(x)}}return{jsonrpc:"2.0",id:g,error:_}}finally{g!=null&&delete s[g]}},"handleRequest"),"handleRequest")}i(ZC,"createHandler");o(ZC,"createHandler");Ga();var Rz=ir(S$(),1),On=ir(ll(),1),Oz=`
680
680
  sign-in-with-ethereum =
681
681
  domain %s" wants you to sign in with your Ethereum account:" LF
682
682
  address LF
@@ -824,7 +824,7 @@ DIGIT = %x30-39
824
824
  ; 0-9
825
825
  HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
826
826
  `,YC=i(class{constructor(e){let t=new Rz.default(Oz);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 a=On.default.ids,s=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.domain=On.default.utils.charsToString(q,Q,Y)),K},"domain");n.ast.callbacks.domain=s;let c=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.address=On.default.utils.charsToString(q,Q,Y)),K},"address");n.ast.callbacks.address=c;let l=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.statement=On.default.utils.charsToString(q,Q,Y)),K},"statement");n.ast.callbacks.statement=l;let h=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.uri||(k.uri=On.default.utils.charsToString(q,Q,Y))),K},"uri");n.ast.callbacks.uri=h;let p=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.version=On.default.utils.charsToString(q,Q,Y)),K},"version");n.ast.callbacks.version=p;let g=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.chainId=On.default.utils.charsToString(q,Q,Y)),K},"chainId");n.ast.callbacks["chain-id"]=g;let v=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.nonce=On.default.utils.charsToString(q,Q,Y)),K},"nonce");n.ast.callbacks.nonce=v;let y=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.issuedAt=On.default.utils.charsToString(q,Q,Y)),K},"issuedAt");n.ast.callbacks["issued-at"]=y;let _=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.expirationTime=On.default.utils.charsToString(q,Q,Y)),K},"expirationTime");n.ast.callbacks["expiration-time"]=_;let x=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.notBefore=On.default.utils.charsToString(q,Q,Y)),K},"notBefore");n.ast.callbacks["not-before"]=x;let O=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.requestId=On.default.utils.charsToString(q,Q,Y)),K},"requestId");n.ast.callbacks["request-id"]=O;let D=o(function(j,q,Q,Y,k){let K=a.SEM_OK;return j===a.SEM_PRE&&(k.resources=On.default.utils.charsToString(q,Q,Y).slice(3).split(`
827
- - `)),K},"resources");n.ast.callbacks.resources=D;let P=n.parse(r,"sign-in-with-ethereum",e);if(!P.success)throw new Error(`Invalid message: ${JSON.stringify(P)}`);let J={};n.ast.translate(J);for(let[j,q]of Object.entries(J))this[j]=q}},"ParsedMessage");o(YC,"ParsedMessage");function J0(){return J0=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},J0.apply(this,arguments)}i(J0,"_extends");o(J0,"_extends");var q6={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}"}}}},Nz={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}"}}}},V6={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}"}}}},Pz={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:q6,1:V6}}},Bz={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:q6,1:V6,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Md={2:q6,10:Nz,19:{assetName:V6,assetType:Pz,assetId:Bz}};function K6(e,t){return e.split(t.parameters.delimiter)}i(K6,"splitParams");o(K6,"splitParams");function gl(e,t){var r=K6(e,t),n={};return r.forEach(function(a,s){n[t.parameters.values[s].name]=a}),n}i(gl,"getParams");o(gl,"getParams");function jc(e,t){return Object.values(t.parameters.values).map(function(r){var n=e[r.name];return typeof n=="string"?n:jc(n,r)}).join(t.parameters.delimiter)}i(jc,"joinParams");o(jc,"joinParams");function vl(e,t){if(!new RegExp(t.regex).test(e))return!1;var r=K6(e,t);if(r.length!==Object.keys(t.parameters.values).length)return!1;var n=r.map(function(a,s){return new RegExp(t.parameters.values[s].regex).test(a)}).filter(function(a){return!!a});return n.length===r.length}i(vl,"isValidId");o(vl,"isValidId");var Ac=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"ChainId2"),o(e,"ChainId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();Ac.spec=Md[2];var id=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Ac(r.chainId),this.address=r.address}i(e,"AccountId2"),o(e,"AccountId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var a=gl(n,this.spec),s=a.namespace,c=a.reference,l=a.address,h=new Ac({namespace:s,reference:c});return new e({chainId:h,address:l}).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){var a=new Ac(n.chainId),s=J0({},a.toJSON(),{address:n.address});return jc(s,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON2"),"toJSON"),e}();id.spec=Md[10];var G6=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"AssetName2"),o(e,"AssetName"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();G6.spec=Md[19].assetName;var Lz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Ac(r.chainId),this.assetName=new G6(r.assetName)}i(e,"AssetType2"),o(e,"AssetType"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON2"),"toJSON"),e}();Lz.spec=Md[19].assetType;var Uz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Ac(r.chainId),this.assetName=new G6(r.assetName),this.tokenId=r.tokenId}i(e,"AssetId2"),o(e,"AssetId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON2"),"toJSON"),e}();Uz.spec=Md[19].assetId;var zA;(function(e){e.INVALID_SIGNATURE="Invalid signature.",e.EXPIRED_MESSAGE="Expired message.",e.MALFORMED_SESSION="Malformed session."})(zA||(zA={}));var Z0;(function(e){e.PERSONAL_SIGNATURE="Personal signature"})(Z0||(Z0={}));var XC=i(class{static fromCacao(e){let t=id.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 Ac(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=Z0.PERSONAL_SIGNATURE)),r}toMessage(e){return eM(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 YC(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");o(XC,"SiwxMessage");function QC(e,t){let r=`${e.domain} wants you to sign in with your ${t} account:`,n=`URI: ${e.uri}`,a=[r,e.address].join(`
827
+ - `)),K},"resources");n.ast.callbacks.resources=D;let P=n.parse(r,"sign-in-with-ethereum",e);if(!P.success)throw new Error(`Invalid message: ${JSON.stringify(P)}`);let J={};n.ast.translate(J);for(let[j,q]of Object.entries(J))this[j]=q}},"ParsedMessage");o(YC,"ParsedMessage");function J0(){return J0=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},J0.apply(this,arguments)}i(J0,"_extends");o(J0,"_extends");var q6={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}"}}}},Nz={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}"}}}},V6={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}"}}}},Pz={name:"assetType",regex:"[-:a-zA-Z0-9]{11,115}",parameters:{delimiter:"/",values:{0:q6,1:V6}}},Bz={name:"assetId",regex:"[-:a-zA-Z0-9]{13,148}",parameters:{delimiter:"/",values:{0:q6,1:V6,2:{name:"tokenId",regex:"[-a-zA-Z0-9]{1,32}"}}}},Md={2:q6,10:Nz,19:{assetName:V6,assetType:Pz,assetId:Bz}};function K6(e,t){return e.split(t.parameters.delimiter)}i(K6,"splitParams");o(K6,"splitParams");function gl(e,t){var r=K6(e,t),n={};return r.forEach(function(a,s){n[t.parameters.values[s].name]=a}),n}i(gl,"getParams");o(gl,"getParams");function jc(e,t){return Object.values(t.parameters.values).map(function(r){var n=e[r.name];return typeof n=="string"?n:jc(n,r)}).join(t.parameters.delimiter)}i(jc,"joinParams");o(jc,"joinParams");function vl(e,t){if(!new RegExp(t.regex).test(e))return!1;var r=K6(e,t);if(r.length!==Object.keys(t.parameters.values).length)return!1;var n=r.map(function(a,s){return new RegExp(t.parameters.values[s].regex).test(a)}).filter(function(a){return!!a});return n.length===r.length}i(vl,"isValidId");o(vl,"isValidId");var Sc=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"ChainId2"),o(e,"ChainId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();Sc.spec=Md[2];var id=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Sc(r.chainId),this.address=r.address}i(e,"AccountId2"),o(e,"AccountId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);var a=gl(n,this.spec),s=a.namespace,c=a.reference,l=a.address,h=new Sc({namespace:s,reference:c});return new e({chainId:h,address:l}).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){var a=new Sc(n.chainId),s=J0({},a.toJSON(),{address:n.address});return jc(s,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),address:this.address}},"toJSON2"),"toJSON"),e}();id.spec=Md[10];var G6=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.namespace=r.namespace,this.reference=r.reference}i(e,"AssetName2"),o(e,"AssetName"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{namespace:this.namespace,reference:this.reference}},"toJSON2"),"toJSON"),e}();G6.spec=Md[19].assetName;var Lz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Sc(r.chainId),this.assetName=new G6(r.assetName)}i(e,"AssetType2"),o(e,"AssetType"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName}},"toJSON2"),"toJSON"),e}();Lz.spec=Md[19].assetType;var Uz=function(){function e(r){typeof r=="string"&&(r=e.parse(r)),this.chainId=new Sc(r.chainId),this.assetName=new G6(r.assetName),this.tokenId=r.tokenId}i(e,"AssetId2"),o(e,"AssetId"),e.parse=o(i(function(n){if(!vl(n,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+n);return new e(gl(n,this.spec)).toJSON()},"parse3"),"parse"),e.format=o(i(function(n){return jc(n,this.spec)},"format"),"format");var t=e.prototype;return t.toString=o(i(function(){return e.format(this.toJSON())},"toString4"),"toString"),t.toJSON=o(i(function(){return{chainId:this.chainId.toJSON(),assetName:this.assetName.toJSON(),tokenId:this.tokenId}},"toJSON2"),"toJSON"),e}();Uz.spec=Md[19].assetId;var zA;(function(e){e.INVALID_SIGNATURE="Invalid signature.",e.EXPIRED_MESSAGE="Expired message.",e.MALFORMED_SESSION="Malformed session."})(zA||(zA={}));var Z0;(function(e){e.PERSONAL_SIGNATURE="Personal signature"})(Z0||(Z0={}));var XC=i(class{static fromCacao(e){let t=id.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 Sc(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=Z0.PERSONAL_SIGNATURE)),r}toMessage(e){return eM(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 YC(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");o(XC,"SiwxMessage");function QC(e,t){let r=`${e.domain} wants you to sign in with your ${t} account:`,n=`URI: ${e.uri}`,a=[r,e.address].join(`
828
828
  `),s=`Version: ${e.version}`;e.nonce||(e.nonce=(Math.random()+1).toString(36).substring(4));let c=`Nonce: ${e.nonce}`,l=[n,s,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(`
829
829
  `));let h=l.join(`
830
830
  `);return e.statement&&(a=[a,e.statement].join(`
@@ -838,11 +838,11 @@ HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
838
838
 
839
839
  `)),[a,p].join(`
840
840
 
841
- `)}i(eM,"asString");o(eM,"asString");var Db=i(class extends XC{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Z0.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}},"SiweMessage");o(Db,"SiweMessage");bm();var Fz=5*60,qY=new Date("2022-09-20").valueOf(),Y0;(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"),o(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"),o(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"),o(n,"fromSiwTezosMessage"),e.fromSiwTezosMessage=n;function a(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(a,"fromSiwStacksMessage"),o(a,"fromSiwStacksMessage"),e.fromSiwStacksMessage=a;async function s(l){return(await lz({bytes:l,codec:fl,hasher:ol})).value}i(s,"fromBlockBytes"),o(s,"fromBlockBytes"),e.fromBlockBytes=s;async function c(l,h={}){W6(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"),o(c,"verify"),e.verify=c})(Y0||(Y0={}));var X0;(function(e){function t(r){return Mm({value:r,codec:fl,hasher:ol})}i(t,"fromCacao"),o(t,"fromCacao"),e.fromCacao=t})(X0||(X0={}));function W6(e){if(e.s===null||e.s===void 0)throw new Error("CACAO does not have a signature")}i(W6,"assertSigned");o(W6,"assertSigned");function tM(e,t){let r=t.atTime?t.atTime.getTime():Date.now(),n=(t.clockSkewSecs??Fz)*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 a=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0;if(!t.disableExpirationCheck&&Date.parse(e.p.exp)+a+n<r)throw new Error("CACAO has expired")}i(tM,"verifyTimeChecks");o(tM,"verifyTimeChecks");var jz="logger/5.8.0",HA=!1,qA=!1,x0={debug:1,default:2,info:2,warning:3,error:4,off:5},VA=x0.default,rb=null;function rM(){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(rM,"_checkNormalize");o(rM,"_checkNormalize");var KA=rM(),Rb;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(Rb||(Rb={}));var la;(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"})(la||(la={}));var GA="0123456789abcdef",br=i(class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();x0[r]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(VA>x0[r])&&console.log.apply(console,t)}debug(...e){this._log(br.levels.DEBUG,e)}info(...e){this._log(br.levels.INFO,e)}warn(...e){this._log(br.levels.WARNING,e)}makeError(e,t,r){if(qA)return this.makeError("censored error",t,{});t||(t=br.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 g=0;g<h.length;g++)p+=GA[h[g]>>4],p+=GA[h[g]&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 a=e,s="";switch(t){case la.NUMERIC_FAULT:{s="NUMERIC_FAULT";let l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case la.CALL_EXCEPTION:case la.INSUFFICIENT_FUNDS:case la.MISSING_NEW:case la.NONCE_EXPIRED:case la.REPLACEMENT_UNDERPRICED:case la.TRANSACTION_REPLACED:case la.UNPREDICTABLE_GAS_LIMIT:s=t;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let c=new Error(e);return c.reason=a,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,br.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"),KA&&this.throwError("platform missing String.prototype.normalize",br.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:KA})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,br.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,br.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,br.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,br.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",br.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",br.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",br.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return rb||(rb=new br(jz)),rb}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),HA){if(!e)return;this.globalLogger().throwError("error censorship permanent",br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}qA=!!e,HA=!!t}static setLogLevel(e){let t=x0[e.toLowerCase()];if(t==null){br.globalLogger().warn("invalid log level - "+e);return}VA=t}static from(e){return new br(e)}},"Logger");o(br,"Logger");br.errors=la;br.levels=Rb;var $z="bytes/5.8.0",zr=new br($z);function J6(e){return!!e.toHexString}i(J6,"isHexable");o(J6,"isHexable");function Sc(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return Sc(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}i(Sc,"addSlice");o(Sc,"addSlice");function nM(e){return ha(e)&&!(e.length%2)||jm(e)}i(nM,"isBytesLike");o(nM,"isBytesLike");function Ob(e){return typeof e=="number"&&e==e&&e%1===0}i(Ob,"isInteger");o(Ob,"isInteger");function jm(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!Ob(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let r=e[t];if(!Ob(r)||r<0||r>=256)return!1}return!0}i(jm,"isBytes");o(jm,"isBytes");function qr(e,t){if(t||(t={}),typeof e=="number"){zr.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),Sc(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),J6(e)&&(e=e.toHexString()),ha(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":zr.throwArgumentError("hex data is odd-length","value",e));let n=[];for(let a=0;a<r.length;a+=2)n.push(parseInt(r.substring(a,a+2),16));return Sc(new Uint8Array(n))}return jm(e)?Sc(new Uint8Array(e)):zr.throwArgumentError("invalid arrayify value","value",e)}i(qr,"arrayify");o(qr,"arrayify");function iM(e){let t=e.map(a=>qr(a)),r=t.reduce((a,s)=>a+s.length,0),n=new Uint8Array(r);return t.reduce((a,s)=>(n.set(s,a),a+s.length),0),Sc(n)}i(iM,"concat3");o(iM,"concat");function aM(e,t){e=qr(e),e.length>t&&zr.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),Sc(r)}i(aM,"zeroPad");o(aM,"zeroPad");function ha(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}i(ha,"isHexString");o(ha,"isHexString");var nb="0123456789abcdef";function Nn(e,t){if(t||(t={}),typeof e=="number"){zr.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=nb[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),J6(e))return e.toHexString();if(ha(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":zr.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(jm(e)){let r="0x";for(let n=0;n<e.length;n++){let a=e[n];r+=nb[(a&240)>>4]+nb[a&15]}return r}return zr.throwArgumentError("invalid hexlify value","value",e)}i(Nn,"hexlify");o(Nn,"hexlify");function oM(e){if(typeof e!="string")e=Nn(e);else if(!ha(e)||e.length%2)return null;return(e.length-2)/2}i(oM,"hexDataLength");o(oM,"hexDataLength");function Nb(e,t,r){return typeof e!="string"?e=Nn(e):(!ha(e)||e.length%2)&&zr.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}i(Nb,"hexDataSlice");o(Nb,"hexDataSlice");function xc(e,t){for(typeof e!="string"?e=Nn(e):ha(e)||zr.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&zr.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}i(xc,"hexZeroPad");o(xc,"hexZeroPad");function Z6(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(nM(e)){let r=qr(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Nn(r.slice(0,32)),t.s=Nn(r.slice(32,64))):r.length===65?(t.r=Nn(r.slice(0,32)),t.s=Nn(r.slice(32,64)),t.v=r[64]):zr.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:zr.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Nn(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 a=aM(qr(t._vs),32);t._vs=Nn(a);let s=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=s:t.recoveryParam!==s&&zr.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;let c=Nn(a);t.s==null?t.s=c:t.s!==c&&zr.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?zr.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 a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&zr.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!ha(t.r)?zr.throwArgumentError("signature missing or invalid r","signature",e):t.r=xc(t.r,32),t.s==null||!ha(t.s)?zr.throwArgumentError("signature missing or invalid s","signature",e):t.s=xc(t.s,32);let r=qr(t.s);r[0]>=128&&zr.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let n=Nn(r);t._vs&&(ha(t._vs)||zr.throwArgumentError("signature invalid _vs","signature",e),t._vs=xc(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&zr.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}i(Z6,"splitSignature");o(Z6,"splitSignature");var zz=ir($x()),Hz="bignumber/5.8.0",qz=zz.default.BN,VY=new br(Hz);function sM(e){return new qz(e,36).toString(16)}i(sM,"_base36To16");o(sM,"_base36To16");var Vz=ir(Mx());function $m(e){return"0x"+Vz.default.keccak_256(qr(e))}i($m,"keccak256");o($m,"keccak256");var Kz="address/5.8.0",Gf=new br(Kz);function Pb(e){ha(e,20)||Gf.throwArgumentError("invalid address","address",e),e=e.toLowerCase();let t=e.substring(2).split(""),r=new Uint8Array(40);for(let a=0;a<40;a++)r[a]=t[a].charCodeAt(0);let n=qr($m(r));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}i(Pb,"getChecksumAddress");o(Pb,"getChecksumAddress");var Gz=9007199254740991;function cM(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}i(cM,"log10");o(cM,"log10");var Y6={};for(let e=0;e<10;e++)Y6[String(e)]=String(e);for(let e=0;e<26;e++)Y6[String.fromCharCode(65+e)]=String(10+e);var WA=Math.floor(cM(Gz));function uM(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>Y6[n]).join("");for(;t.length>=WA;){let n=t.substring(0,WA);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(uM,"ibanChecksum");o(uM,"ibanChecksum");function lM(e){let t=null;if(typeof e!="string"&&Gf.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=Pb(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Gf.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)!==uM(e)&&Gf.throwArgumentError("bad icap checksum","address",e),t=sM(e.substring(4));t.length<40;)t="0"+t;t=Pb("0x"+t)}else Gf.throwArgumentError("invalid address","address",e);return t}i(lM,"getAddress");o(lM,"getAddress");var Wz="properties/5.8.0",KY=new br(Wz);function Bu(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}i(Bu,"defineReadOnly");o(Bu,"defineReadOnly");var Jz="strings/5.8.0",fM=new br(Jz),Q0;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(Q0||(Q0={}));var Fu;(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"})(Fu||(Fu={}));function dM(e,t,r,n,a){return fM.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}i(dM,"errorFunc");o(dM,"errorFunc");function X6(e,t,r,n,a){if(e===Fu.BAD_PREFIX||e===Fu.UNEXPECTED_CONTINUE){let s=0;for(let c=t+1;c<r.length&&r[c]>>6===2;c++)s++;return s}return e===Fu.OVERRUN?r.length-t-1:0}i(X6,"ignoreFunc");o(X6,"ignoreFunc");function hM(e,t,r,n,a){return e===Fu.OVERLONG?(n.push(a),0):(n.push(65533),X6(e,t,r,n,a))}i(hM,"replaceFunc");o(hM,"replaceFunc");var GY=Object.freeze({error:dM,ignore:X6,replace:hM});function T0(e,t=Q0.current){t!=Q0.current&&(fM.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);if(a<128)r.push(a);else if(a<2048)r.push(a>>6|192),r.push(a&63|128);else if((a&64512)==55296){n++;let s=e.charCodeAt(n);if(n>=e.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((a&1023)<<10)+(s&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(a>>12|224),r.push(a>>6&63|128),r.push(a&63|128)}return qr(r)}i(T0,"toUtf8Bytes");o(T0,"toUtf8Bytes");var Zz=`Ethereum Signed Message:
842
- `;function pM(e){return typeof e=="string"&&(e=T0(e)),$m(iM([T0(Zz),T0(String(e.length)),e]))}i(pM,"hashMessage");o(pM,"hashMessage");var Mt=ir($x()),Ao=ir(Am());function $c(e,t,r){return r={path:t,exports:{},require:function(n,a){return mM(n,a??r.path)}},e(r,r.exports),r.exports}i($c,"createCommonjsModule");o($c,"createCommonjsModule");function mM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}i(mM,"commonjsRequire");o(mM,"commonjsRequire");var Q6=e2;function e2(e,t){if(!e)throw new Error(t||"Assertion failed")}i(e2,"assert");o(e2,"assert");e2.equal=o(i(function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)},"assertEqual"),"assertEqual");var da=$c(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 g=c.charCodeAt(p),v=g>>8,y=g&255;v?h.push(v,y):h.push(y)}return h}i(n,"toArray"),o(n,"toArray"),r.toArray=n;function a(c){return c.length===1?"0"+c:c}i(a,"zero2"),o(a,"zero2"),r.zero2=a;function s(c){for(var l="",h=0;h<c.length;h++)l+=a(c[h].toString(16));return l}i(s,"toHex"),o(s,"toHex"),r.toHex=s,r.encode=o(i(function(l,h){return h==="hex"?s(l):l},"encode9"),"encode")}),Si=$c(function(e,t){"use strict";var r=t;r.assert=Q6,r.toArray=da.toArray,r.zero2=da.zero2,r.toHex=da.toHex,r.encode=da.encode;function n(h,p,g){var v=new Array(Math.max(h.bitLength(),g)+1),y;for(y=0;y<v.length;y+=1)v[y]=0;var _=1<<p+1,x=h.clone();for(y=0;y<v.length;y++){var O,D=x.andln(_-1);x.isOdd()?(D>(_>>1)-1?O=(_>>1)-D:O=D,x.isubn(O)):O=0,v[y]=O,x.iushrn(1)}return v}i(n,"getNAF2"),o(n,"getNAF"),r.getNAF=n;function a(h,p){var g=[[],[]];h=h.clone(),p=p.clone();for(var v=0,y=0,_;h.cmpn(-v)>0||p.cmpn(-y)>0;){var x=h.andln(3)+v&3,O=p.andln(3)+y&3;x===3&&(x=-1),O===3&&(O=-1);var D;(x&1)===0?D=0:(_=h.andln(7)+v&7,(_===3||_===5)&&O===2?D=-x:D=x),g[0].push(D);var P;(O&1)===0?P=0:(_=p.andln(7)+y&7,(_===3||_===5)&&x===2?P=-O:P=O),g[1].push(P),2*v===D+1&&(v=1-v),2*y===P+1&&(y=1-y),h.iushrn(1),p.iushrn(1)}return g}i(a,"getJSF2"),o(a,"getJSF"),r.getJSF=a;function s(h,p,g){var v="_"+p;h.prototype[p]=o(i(function(){return this[v]!==void 0?this[v]:this[v]=g.call(this)},"cachedProperty2"),"cachedProperty")}i(s,"cachedProperty"),o(s,"cachedProperty"),r.cachedProperty=s;function c(h){return typeof h=="string"?r.toArray(h,"hex"):h}i(c,"parseBytes"),o(c,"parseBytes"),r.parseBytes=c;function l(h){return new Mt.default(h,"hex","le")}i(l,"intFromLE"),o(l,"intFromLE"),r.intFromLE=l}),em=Si.getNAF,Yz=Si.getJSF,tm=Si.assert;function Oo(e,t){this.type=e,this.p=new Mt.default(t.p,16),this.red=t.prime?Mt.default.red(t.prime):Mt.default.mont(this.p),this.zero=new Mt.default(0).toRed(this.red),this.one=new Mt.default(1).toRed(this.red),this.two=new Mt.default(2).toRed(this.red),this.n=t.n&&new Mt.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(Oo,"BaseCurve");o(Oo,"BaseCurve");var zc=Oo;Oo.prototype.point=o(i(function(){throw new Error("Not implemented")},"point"),"point");Oo.prototype.validate=o(i(function(){throw new Error("Not implemented")},"validate"),"validate");Oo.prototype._fixedNafMul=o(i(function(t,r){tm(t.precomputed);var n=t._getDoubles(),a=em(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var c=[],l,h;for(l=0;l<a.length;l+=n.step){h=0;for(var p=l+n.step-1;p>=l;p--)h=(h<<1)+a[p];c.push(h)}for(var g=this.jpoint(null,null,null),v=this.jpoint(null,null,null),y=s;y>0;y--){for(l=0;l<c.length;l++)h=c[l],h===y?v=v.mixedAdd(n.points[l]):h===-y&&(v=v.mixedAdd(n.points[l].neg()));g=g.add(v)}return g.toP()},"_fixedNafMul"),"_fixedNafMul");Oo.prototype._wnafMul=o(i(function(t,r){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var s=a.points,c=em(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 g=c[h];tm(g!==0),t.type==="affine"?g>0?l=l.mixedAdd(s[g-1>>1]):l=l.mixedAdd(s[-g-1>>1].neg()):g>0?l=l.add(s[g-1>>1]):l=l.add(s[-g-1>>1].neg())}return t.type==="affine"?l.toP():l},"_wnafMul"),"_wnafMul");Oo.prototype._wnafMulAdd=o(i(function(t,r,n,a,s){var c=this._wnafT1,l=this._wnafT2,h=this._wnafT3,p=0,g,v,y;for(g=0;g<a;g++){y=r[g];var _=y._getNAFPoints(t);c[g]=_.wnd,l[g]=_.points}for(g=a-1;g>=1;g-=2){var x=g-1,O=g;if(c[x]!==1||c[O]!==1){h[x]=em(n[x],c[x],this._bitLength),h[O]=em(n[O],c[O],this._bitLength),p=Math.max(h[x].length,p),p=Math.max(h[O].length,p);continue}var D=[r[x],null,null,r[O]];r[x].y.cmp(r[O].y)===0?(D[1]=r[x].add(r[O]),D[2]=r[x].toJ().mixedAdd(r[O].neg())):r[x].y.cmp(r[O].y.redNeg())===0?(D[1]=r[x].toJ().mixedAdd(r[O]),D[2]=r[x].add(r[O].neg())):(D[1]=r[x].toJ().mixedAdd(r[O]),D[2]=r[x].toJ().mixedAdd(r[O].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=Yz(n[x],n[O]);for(p=Math.max(J[0].length,p),h[x]=new Array(p),h[O]=new Array(p),v=0;v<p;v++){var j=J[0][v]|0,q=J[1][v]|0;h[x][v]=P[(j+1)*3+(q+1)],h[O][v]=0,l[x]=D}}var Q=this.jpoint(null,null,null),Y=this._wnafT4;for(g=p;g>=0;g--){for(var k=0;g>=0;){var K=!0;for(v=0;v<a;v++)Y[v]=h[v][g]|0,Y[v]!==0&&(K=!1);if(!K)break;k++,g--}if(g>=0&&k++,Q=Q.dblp(k),g<0)break;for(v=0;v<a;v++){var he=Y[v];he!==0&&(he>0?y=l[v][he-1>>1]:he<0&&(y=l[v][-he-1>>1].neg()),y.type==="affine"?Q=Q.mixedAdd(y):Q=Q.add(y))}}for(g=0;g<a;g++)l[g]=null;return s?Q:Q.toP()},"_wnafMulAdd"),"_wnafMulAdd");function xi(e,t){this.curve=e,this.type=t,this.precomputed=null}i(xi,"BasePoint");o(xi,"BasePoint");Oo.BasePoint=xi;xi.prototype.eq=o(i(function(){throw new Error("Not implemented")},"eq"),"eq");xi.prototype.validate=o(i(function(){return this.curve.validate(this)},"validate2"),"validate");Oo.prototype.decodePoint=o(i(function(t,r){t=Si.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?tm(t[t.length-1]%2===0):t[0]===7&&tm(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}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");xi.prototype.encodeCompressed=o(i(function(t){return this.encode(t,!0)},"encodeCompressed"),"encodeCompressed");xi.prototype._encode=o(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");xi.prototype.encode=o(i(function(t,r){return Si.encode(this._encode(r),t)},"encode8"),"encode");xi.prototype.precompute=o(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");xi.prototype._hasDoubles=o(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");xi.prototype._getDoubles=o(i(function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,s=0;s<r;s+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}},"_getDoubles"),"_getDoubles");xi.prototype._getNAFPoints=o(i(function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(a);return{wnd:t,points:r}},"_getNAFPoints"),"_getNAFPoints");xi.prototype._getBeta=o(i(function(){return null},"_getBeta"),"_getBeta");xi.prototype.dblp=o(i(function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r},"dblp"),"dblp");var t2=$c(function(e){typeof Object.create=="function"?e.exports=o(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=o(i(function(r,n){if(n){r.super_=n;var a=o(function(){},"TempCtor");a.prototype=n.prototype,r.prototype=new a,r.prototype.constructor=r}},"inherits"),"inherits")}),Xz=Si.assert;function Ti(e){zc.call(this,"short",e),this.a=new Mt.default(e.a,16).toRed(this.red),this.b=new Mt.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(Ti,"ShortCurve");o(Ti,"ShortCurve");t2(Ti,zc);var Qz=Ti;Ti.prototype._getEndomorphism=o(i(function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Mt.default(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=a[0].cmp(a[1])<0?a[0]:a[1],r=r.toRed(this.red)}if(t.lambda)n=new Mt.default(t.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],Xz(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 Mt.default(l.a,16),b:new Mt.default(l.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism"),"_getEndomorphism");Ti.prototype._getEndoRoots=o(i(function(t){var r=t===this.p?this.red:Mt.default.mont(t),n=new Mt.default(2).toRed(r).redInvm(),a=n.redNeg(),s=new Mt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=a.redAdd(s).fromRed(),l=a.redSub(s).fromRed();return[c,l]},"_getEndoRoots"),"_getEndoRoots");Ti.prototype._getEndoBasis=o(i(function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),s=new Mt.default(1),c=new Mt.default(0),l=new Mt.default(0),h=new Mt.default(1),p,g,v,y,_,x,O,D=0,P,J;n.cmpn(0)!==0;){var j=a.div(n);P=a.sub(j.mul(n)),J=l.sub(j.mul(s));var q=h.sub(j.mul(c));if(!v&&P.cmp(r)<0)p=O.neg(),g=s,v=P.neg(),y=J;else if(v&&++D===2)break;O=P,a=n,n=P,l=s,s=J,h=c,c=q}_=P.neg(),x=J;var Q=v.sqr().add(y.sqr()),Y=_.sqr().add(x.sqr());return Y.cmp(Q)>=0&&(_=p,x=g),v.negative&&(v=v.neg(),y=y.neg()),_.negative&&(_=_.neg(),x=x.neg()),[{a:v,b:y},{a:_,b:x}]},"_getEndoBasis"),"_getEndoBasis");Ti.prototype._endoSplit=o(i(function(t){var r=this.endo.basis,n=r[0],a=r[1],s=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),l=s.mul(n.a),h=c.mul(a.a),p=s.mul(n.b),g=c.mul(a.b),v=t.sub(l).sub(h),y=p.add(g).neg();return{k1:v,k2:y}},"_endoSplit"),"_endoSplit");Ti.prototype.pointFromX=o(i(function(t,r){t=new Mt.default(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=a.fromRed().isOdd();return(r&&!s||!r&&s)&&(a=a.redNeg()),this.point(t,a)},"pointFromX"),"pointFromX");Ti.prototype.validate=o(i(function(t){if(t.inf)return!0;var r=t.x,n=t.y,a=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate3"),"validate");Ti.prototype._endoWnafMulAdd=o(i(function(t,r,n){for(var a=this._endoWnafT1,s=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)),a[c*2]=h,a[c*2+1]=p,s[c*2]=l.k1,s[c*2+1]=l.k2}for(var g=this._wnafMulAdd(1,a,s,c*2,n),v=0;v<c*2;v++)a[v]=null,s[v]=null;return g},"_endoWnafMulAdd"),"_endoWnafMulAdd");function Yr(e,t,r,n){zc.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Mt.default(t,16),this.y=new Mt.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(Yr,"Point");o(Yr,"Point");t2(Yr,zc.BasePoint);Ti.prototype.point=o(i(function(t,r,n){return new Yr(this,t,r,n)},"point2"),"point");Ti.prototype.pointFromJSON=o(i(function(t,r){return Yr.fromJSON(this,t,r)},"pointFromJSON"),"pointFromJSON");Yr.prototype._getBeta=o(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,a=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return r}},"_getBeta2"),"_getBeta");Yr.prototype.toJSON=o(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");Yr.fromJSON=o(i(function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var a=t.point(r[0],r[1],n);if(!r[2])return a;function s(l){return t.point(l[0],l[1],n)}i(s,"obj2point"),o(s,"obj2point");var c=r[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(s))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(s))}},a},"fromJSON"),"fromJSON");Yr.prototype.inspect=o(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");Yr.prototype.isInfinity=o(i(function(){return this.inf},"isInfinity"),"isInfinity");Yr.prototype.add=o(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),a=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)},"add"),"add");Yr.prototype.dbl=o(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(),a=t.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(a),c=s.redSqr().redISub(this.x.redAdd(this.x)),l=s.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,l)},"dbl"),"dbl");Yr.prototype.getX=o(i(function(){return this.x.fromRed()},"getX"),"getX");Yr.prototype.getY=o(i(function(){return this.y.fromRed()},"getY"),"getY");Yr.prototype.mul=o(i(function(t){return t=new Mt.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");Yr.prototype.mulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s):this.curve._wnafMulAdd(1,a,s,2)},"mulAdd"),"mulAdd");Yr.prototype.jmulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s,!0):this.curve._wnafMulAdd(1,a,s,2,!0)},"jmulAdd"),"jmulAdd");Yr.prototype.eq=o(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");Yr.prototype.neg=o(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,a=o(function(s){return s.neg()},"negate");r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return r},"neg"),"neg");Yr.prototype.toJ=o(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 rn(e,t,r,n){zc.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mt.default(0)):(this.x=new Mt.default(t,16),this.y=new Mt.default(r,16),this.z=new Mt.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(rn,"JPoint");o(rn,"JPoint");t2(rn,zc.BasePoint);Ti.prototype.jpoint=o(i(function(t,r,n){return new rn(this,t,r,n)},"jpoint"),"jpoint");rn.prototype.toP=o(i(function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),a=this.y.redMul(r).redMul(t);return this.curve.point(n,a)},"toP"),"toP");rn.prototype.neg=o(i(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg2"),"neg");rn.prototype.add=o(i(function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(r),s=t.x.redMul(n),c=this.y.redMul(r.redMul(t.z)),l=t.y.redMul(n.redMul(this.z)),h=a.redSub(s),p=c.redSub(l);if(h.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=h.redSqr(),v=g.redMul(h),y=a.redMul(g),_=p.redSqr().redIAdd(v).redISub(y).redISub(y),x=p.redMul(y.redISub(_)).redISub(c.redMul(v)),O=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(_,x,O)},"add2"),"add");rn.prototype.mixedAdd=o(i(function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,a=t.x.redMul(r),s=this.y,c=t.y.redMul(r).redMul(this.z),l=n.redSub(a),h=s.redSub(c);if(l.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=l.redSqr(),g=p.redMul(l),v=n.redMul(p),y=h.redSqr().redIAdd(g).redISub(v).redISub(v),_=h.redMul(v.redISub(y)).redISub(s.redMul(g)),x=this.z.redMul(l);return this.curve.jpoint(y,_,x)},"mixedAdd"),"mixedAdd");rn.prototype.dblp=o(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 a=this.curve.a,s=this.curve.tinv,c=this.x,l=this.y,h=this.z,p=h.redSqr().redSqr(),g=l.redAdd(l);for(r=0;r<t;r++){var v=c.redSqr(),y=g.redSqr(),_=y.redSqr(),x=v.redAdd(v).redIAdd(v).redIAdd(a.redMul(p)),O=c.redMul(y),D=x.redSqr().redISub(O.redAdd(O)),P=O.redISub(D),J=x.redMul(P);J=J.redIAdd(J).redISub(_);var j=g.redMul(h);r+1<t&&(p=p.redMul(_)),c=D,h=j,g=J}return this.curve.jpoint(c,g.redMul(s),h)},"dblp2"),"dblp");rn.prototype.dbl=o(i(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl2"),"dbl");rn.prototype._zeroDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var h=a.redAdd(a).redIAdd(a),p=h.redSqr().redISub(l).redISub(l),g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),t=p,r=h.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.x.redSqr(),y=this.y.redSqr(),_=y.redSqr(),x=this.x.redAdd(y).redSqr().redISub(v).redISub(_);x=x.redIAdd(x);var O=v.redAdd(v).redIAdd(v),D=O.redSqr(),P=_.redIAdd(_);P=P.redIAdd(P),P=P.redIAdd(P),t=D.redISub(x).redISub(x),r=O.redMul(x.redISub(t)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)},"_zeroDbl"),"_zeroDbl");rn.prototype._threeDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var h=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),p=h.redSqr().redISub(l).redISub(l);t=p;var g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),r=h.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.z.redSqr(),y=this.y.redSqr(),_=this.x.redMul(y),x=this.x.redSub(v).redMul(this.x.redAdd(v));x=x.redAdd(x).redIAdd(x);var O=_.redIAdd(_);O=O.redIAdd(O);var D=O.redAdd(O);t=x.redSqr().redISub(D),n=this.y.redAdd(this.z).redSqr().redISub(y).redISub(v);var P=y.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),r=x.redMul(O.redISub(t)).redISub(P)}return this.curve.jpoint(t,r,n)},"_threeDbl"),"_threeDbl");rn.prototype._dbl=o(i(function(){var t=this.curve.a,r=this.x,n=this.y,a=this.z,s=a.redSqr().redSqr(),c=r.redSqr(),l=n.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(s)),p=r.redAdd(r);p=p.redIAdd(p);var g=p.redMul(l),v=h.redSqr().redISub(g.redAdd(g)),y=g.redISub(v),_=l.redSqr();_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=h.redMul(y).redISub(_),O=n.redAdd(n).redMul(a);return this.curve.jpoint(v,x,O)},"_dbl"),"_dbl");rn.prototype.trpl=o(i(function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),a=r.redSqr(),s=t.redAdd(t).redIAdd(t),c=s.redSqr(),l=this.x.redAdd(r).redSqr().redISub(t).redISub(a);l=l.redIAdd(l),l=l.redAdd(l).redIAdd(l),l=l.redISub(c);var h=l.redSqr(),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var g=s.redIAdd(l).redSqr().redISub(c).redISub(h).redISub(p),v=r.redMul(g);v=v.redIAdd(v),v=v.redIAdd(v);var y=this.x.redMul(h).redISub(v);y=y.redIAdd(y),y=y.redIAdd(y);var _=this.y.redMul(g.redMul(p.redISub(g)).redISub(l.redMul(h)));_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=this.z.redAdd(l).redSqr().redISub(n).redISub(h);return this.curve.jpoint(y,_,x)},"trpl"),"trpl");rn.prototype.mul=o(i(function(t,r){return t=new Mt.default(t,r),this.curve._wnafMul(this,t)},"mul2"),"mul");rn.prototype.eq=o(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 a=r.redMul(this.z),s=n.redMul(t.z);return this.y.redMul(s).redISub(t.y.redMul(a)).cmpn(0)===0},"eq3"),"eq");rn.prototype.eqXToP=o(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 a=t.clone(),s=this.curve.redN.redMul(r);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP"),"eqXToP");rn.prototype.inspect=o(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");rn.prototype.isInfinity=o(i(function(){return this.z.cmpn(0)===0},"isInfinity2"),"isInfinity");var C0=$c(function(e,t){"use strict";var r=t;r.base=zc,r.short=Qz,r.mont=null,r.edwards=null}),M0=$c(function(e,t){"use strict";var r=t,n=Si.assert;function a(l){l.type==="short"?this.curve=new C0.short(l):l.type==="edwards"?this.curve=new C0.edwards(l):this.curve=new C0.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(a,"PresetCurve"),o(a,"PresetCurve"),r.PresetCurve=a;function s(l,h){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var p=new a(h);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:p}),p}})}i(s,"defineCurve"),o(s,"defineCurve"),s("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:Ao.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:Ao.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:Ao.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:Ao.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"]}),s("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:Ao.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ao.default.sha256,gRed:!1,g:["9"]}),s("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:Ao.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}s("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:Ao.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Co(e){if(!(this instanceof Co))return new Co(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=da.toArray(e.entropy,e.entropyEnc||"hex"),r=da.toArray(e.nonce,e.nonceEnc||"hex"),n=da.toArray(e.pers,e.persEnc||"hex");Q6(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}i(Co,"HmacDRBG");o(Co,"HmacDRBG");var gM=Co;Co.prototype._init=o(i(function(t,r,n){var a=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656},"init"),"init");Co.prototype._hmac=o(i(function(){return new Ao.default.hmac(this.hash,this.K)},"hmac"),"hmac");Co.prototype._update=o(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");Co.prototype.reseed=o(i(function(t,r,n,a){typeof r!="string"&&(a=n,n=r,r=null),t=da.toArray(t,r),n=da.toArray(n,a),Q6(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},"reseed"),"reseed");Co.prototype.generate=o(i(function(t,r,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(a=n,n=r,r=null),n&&(n=da.toArray(n,a||"hex"),this._update(n));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var c=s.slice(0,t);return this._update(n),this._reseed++,da.encode(c,r)},"generate"),"generate");var Bb=Si.assert;function fn(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(fn,"KeyPair");o(fn,"KeyPair");var r2=fn;fn.fromPublic=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{pub:r,pubEnc:n})},"fromPublic"),"fromPublic");fn.fromPrivate=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{priv:r,privEnc:n})},"fromPrivate"),"fromPrivate");fn.prototype.validate=o(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");fn.prototype.getPublic=o(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");fn.prototype.getPrivate=o(i(function(t){return t==="hex"?this.priv.toString(16,2):this.priv},"getPrivate"),"getPrivate");fn.prototype._importPrivate=o(i(function(t,r){this.priv=new Mt.default(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate"),"_importPrivate");fn.prototype._importPublic=o(i(function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?Bb(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Bb(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");fn.prototype.derive=o(i(function(t){return t.validate()||Bb(t.validate(),"public point not validated"),t.mul(this.priv).getX()},"derive"),"derive");fn.prototype.sign=o(i(function(t,r,n){return this.ec.sign(t,this,r,n)},"sign2"),"sign");fn.prototype.verify=o(i(function(t,r,n){return this.ec.verify(t,r,this,void 0,n)},"verify2"),"verify");fn.prototype.inspect=o(i(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect3"),"inspect");var eH=Si.assert;function Id(e,t){if(e instanceof Id)return e;this._importDER(e,t)||(eH(e.r&&e.s,"Signature without r or s"),this.r=new Mt.default(e.r,16),this.s=new Mt.default(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}i(Id,"Signature");o(Id,"Signature");var zm=Id;function vM(){this.place=0}i(vM,"Position");o(vM,"Position");function I0(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||e[t.place]===0)return!1;for(var a=0,s=0,c=t.place;s<n;s++,c++)a<<=8,a|=e[c],a>>>=0;return a<=127?!1:(t.place=c,a)}i(I0,"getLength");o(I0,"getLength");function Lb(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(Lb,"rmPadding");o(Lb,"rmPadding");Id.prototype._importDER=o(i(function(t,r){t=Si.toArray(t,r);var n=new vM;if(t[n.place++]!==48)return!1;var a=I0(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var s=I0(t,n);if(s===!1||(t[n.place]&128)!==0)return!1;var c=t.slice(n.place,s+n.place);if(n.place+=s,t[n.place++]!==2)return!1;var l=I0(t,n);if(l===!1||t.length!==l+n.place||(t[n.place]&128)!==0)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 Mt.default(c),this.s=new Mt.default(h),this.recoveryParam=null,!0},"_importDER"),"_importDER");function k0(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(k0,"constructLength");o(k0,"constructLength");Id.prototype.toDER=o(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=Lb(r),n=Lb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];k0(a,r.length),a=a.concat(r),a.push(2),k0(a,n.length);var s=a.concat(n),c=[48];return k0(c,s.length),c=c.concat(s),Si.encode(c,t)},"toDER"),"toDER");var tH=o(function(){throw new Error("unsupported")},"rand"),bc=Si.assert;function Ei(e){if(!(this instanceof Ei))return new Ei(e);typeof e=="string"&&(bc(Object.prototype.hasOwnProperty.call(M0,e),"Unknown curve "+e),e=M0[e]),e instanceof M0.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(Ei,"EC");o(Ei,"EC");var rH=Ei;Ei.prototype.keyPair=o(i(function(t){return new r2(this,t)},"keyPair"),"keyPair");Ei.prototype.keyFromPrivate=o(i(function(t,r){return r2.fromPrivate(this,t,r)},"keyFromPrivate"),"keyFromPrivate");Ei.prototype.keyFromPublic=o(i(function(t,r){return r2.fromPublic(this,t,r)},"keyFromPublic"),"keyFromPublic");Ei.prototype.genKeyPair=o(i(function(t){t||(t={});for(var r=new gM({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||tH(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new Mt.default(2));;){var s=new Mt.default(r.generate(n));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair"),"genKeyPair");Ei.prototype._truncateToN=o(i(function(t,r,n){var a;if(Mt.default.isBN(t)||typeof t=="number")t=new Mt.default(t,16),a=t.byteLength();else if(typeof t=="object")a=t.length,t=new Mt.default(t,16);else{var s=t.toString();a=s.length+1>>>1,t=new Mt.default(s,16)}typeof n!="number"&&(n=a*8);var c=n-this.n.bitLength();return c>0&&(t=t.ushrn(c)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},"_truncateToN"),"_truncateToN");Ei.prototype.sign=o(i(function(t,r,n,a){if(typeof n=="object"&&(a=n,n=null),a||(a={}),typeof t!="string"&&typeof t!="number"&&!Mt.default.isBN(t)){bc(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),bc(t.length>>>0===t.length);for(var s=0;s<t.length;s++)bc((t[s]&255)===t[s])}r=this.keyFromPrivate(r,n),t=this._truncateToN(t,!1,a.msgBitLength),bc(!t.isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),l=r.getPrivate().toArray("be",c),h=t.toArray("be",c);bc(new Mt.default(h).eq(t),"Can not sign message");for(var p=new gM({hash:this.hash,entropy:l,nonce:h,pers:a.pers,persEnc:a.persEnc||"utf8"}),g=this.n.sub(new Mt.default(1)),v=0;;v++){var y=a.k?a.k(v):new Mt.default(p.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(g)>=0)){var _=this.g.mul(y);if(!_.isInfinity()){var x=_.getX(),O=x.umod(this.n);if(O.cmpn(0)!==0){var D=y.invm(this.n).mul(O.mul(r.getPrivate()).iadd(t));if(D=D.umod(this.n),D.cmpn(0)!==0){var P=(_.getY().isOdd()?1:0)|(x.cmp(O)!==0?2:0);return a.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),P^=1),new zm({r:O,s:D,recoveryParam:P})}}}}}},"sign3"),"sign");Ei.prototype.verify=o(i(function(t,r,n,a,s){s||(s={}),t=this._truncateToN(t,!1,s.msgBitLength),n=this.keyFromPublic(n,a),r=new zm(r,"hex");var c=r.r,l=r.s;if(c.cmpn(1)<0||c.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var h=l.invm(this.n),p=h.mul(t).umod(this.n),g=h.mul(c).umod(this.n),v;return this.curve._maxwellTrick?(v=this.g.jmulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.eqXToP(c)):(v=this.g.mulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.getX().umod(this.n).cmp(c)===0)},"verify3"),"verify");Ei.prototype.recoverPubKey=function(e,t,r,n){bc((3&r)===r,"The recovery param is more than two bits"),t=new zm(t,n);var a=this.n,s=new Mt.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 g=t.r.invm(a),v=a.sub(s).mul(g).umod(a),y=l.mul(g).umod(a);return this.g.mulAdd(v,c,y)};Ei.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new zm(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var s;try{s=this.recoverPubKey(e,t,a)}catch{continue}if(s.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var nH=$c(function(e,t){"use strict";var r=t;r.version="6.6.1",r.utils=Si,r.rand=function(){throw new Error("unsupported")},r.curve=C0,r.curves=M0,r.ec=rH,r.eddsa=null}),iH=nH.ec,aH="signing-key/5.8.0",Ub=new br(aH),ib=null;function fa(){return ib||(ib=new iH("secp256k1")),ib}i(fa,"getCurve");o(fa,"getCurve");var yM=i(class{constructor(e){Bu(this,"curve","secp256k1"),Bu(this,"privateKey",Nn(e)),oM(this.privateKey)!==32&&Ub.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=fa().keyFromPrivate(qr(this.privateKey));Bu(this,"publicKey","0x"+t.getPublic(!1,"hex")),Bu(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Bu(this,"_isSigningKey",!0)}_addPoint(e){let t=fa().keyFromPublic(qr(this.publicKey)),r=fa().keyFromPublic(qr(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=fa().keyFromPrivate(qr(this.privateKey)),r=qr(e);r.length!==32&&Ub.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return Z6({recoveryParam:n.recoveryParam,r:xc("0x"+n.r.toString(16),32),s:xc("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=fa().keyFromPrivate(qr(this.privateKey)),r=fa().keyFromPublic(qr(n2(e)));return xc("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}},"SigningKey");o(yM,"SigningKey");function bM(e,t){let r=Z6(t),n={r:qr(r.r),s:qr(r.s)};return"0x"+fa().recoverPubKey(qr(e),n,r.recoveryParam).encode("hex",!1)}i(bM,"recoverPublicKey");o(bM,"recoverPublicKey");function n2(e,t){let r=qr(e);if(r.length===32){let n=new yM(r);return t?"0x"+fa().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?Nn(r):"0x"+fa().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+fa().keyFromPublic(r).getPublic(!0,"hex"):Nn(r)}return Ub.throwArgumentError("invalid public or private key","key","[REDACTED]")}i(n2,"computePublicKey");o(n2,"computePublicKey");var oH="transactions/5.8.0",WY=new br(oH),JA;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(JA||(JA={}));function wM(e){let t=n2(e);return lM(Nb($m(Nb(t,1)),12))}i(wM,"computeAddress");o(wM,"computeAddress");function _M(e,t){return wM(bM(qr(e),t))}i(_M,"recoverAddress");o(_M,"recoverAddress");var sH="wallet/5.8.0",JY=new br(sH);function Fb(e,t){return _M(pM(e),t)}i(Fb,"verifyMessage");o(Fb,"verifyMessage");function EM(){return{eip191:async(e,t)=>{AM(e,t)}}}i(EM,"getEIP191Verifier");o(EM,"getEIP191Verifier");var cH=new Date("2022-09-20").valueOf();function AM(e,t){W6(e),tM(e,t);let n=[Fb(Db.fromCacao(e).toMessage(),e.s.s).toLowerCase()];if(Date.parse(e.p.iat)<=cH){let s=Fb(QC(Db.fromCacao(e),"Ethereum"),e.s.s).toLowerCase();n.push(s)}let a=id.parse(e.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(a))throw new Error("Signature does not belong to issuer")}i(AM,"verifyEIP191Signature");o(AM,"verifyEIP191Signature");Ed();b6();var uH=ir(cl(),1);Ed();function SM(){return Ir((0,uH.randomBytes)(16),"base64")}i(SM,"randomString");o(SM,"randomString");var xM="base64pad",TM="base64url";function CM(e){return Ir(e,xM)}i(CM,"encodeBase64");o(CM,"encodeBase64");function MM(e){return Ir(e,TM)}i(MM,"encodeBase64Url");o(MM,"encodeBase64Url");function IM(e){return Cr(e,xM)}i(IM,"decodeBase64");o(IM,"decodeBase64");function D0(e){return JSON.parse(Ir(Cr(e,TM)))}i(D0,"base64urlToJSON");o(D0,"base64urlToJSON");function kM(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(kM,"fromDagJWS");o(kM,"fromDagJWS");function DM(e,t){if(t){let r=t.toISOString().split(".")[0]+"Z";return`${e}?versionTime=${r}`}else return e}i(DM,"didWithTime");o(DM,"didWithTime");function RM(e){return e?Array.isArray(e)?e:[e]:[]}i(RM,"extractControllers");o(RM,"extractControllers");var lH={...EM()};function OM(e){return"registry"in e&&"cache"in e}i(OM,"isResolver");o(OM,"isResolver");var NM=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 NM({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Ib(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=OM(e)?e:new Gx(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=SM(),a=await this._client.request("did_authenticate",{nonce:n,aud:r,paths:t}),{kid:s}=await this.verifyJWS(a),c=D0(a.payload);if(!s.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 a=await X0.fromCacao(this._capability),s=$t.asCID(a.cid);if(!s)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://${s?.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 RC(e),a=MM(r.bytes);Object.assign(t,{linkedBlock:CM(n)});let s=await this.createJWS(a,t),c=$t.asCID(r);if(!c)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(s.link=c,this._capability){let l=await X0.fromCacao(this._capability);return{jws:s,linkedBlock:n,cacaoBlock:l.bytes}}return{jws:s,linkedBlock:n}}async verifyJWS(e,t={}){t=Object.assign({verifiers:lH},t),typeof e!="string"&&(e=kM(e));let r=D0(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 g=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,v=new Date(h).valueOf()+g;if(!(t.atTime&&t.atTime.getTime()<v))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 s=n.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&s===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await Y0.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!==s){let h=DM(t.issuer,t.atTime),g=(await this.resolve(h)).didDocument?.controller,v=RM(g);if(t.capability?.s&&t.capability.p.aud===s&&v.includes(t.capability.p.iss))await Y0.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(s?v.includes(s):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${r}`)}let c=n.didDocument?.verificationMethod||[];uT(e,c);let l;try{l=D0(e.split(".")[1])}catch{}return{kid:r,payload:l,didResolutionResult:n}}async createJWE(e,t,r={}){let n=await cz(t,this._resolver);return sz(e,n,r.protectedHeader,r.aad)}async createDagJWE(e,t,r={}){let n=await BC(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 IM(r)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return LC(t)}async resolve(e){let t=await this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:r,message:n}=t.didResolutionMetadata,a=n?`, ${n}`:"";throw new Error(`Failed to resolve ${e}: ${r}${a}`)}return t}constructor({provider:e,resolver:t={},resolverOptions:r,capability:n,parent:a}={}){if(e!=null&&(this._client=new Ib(e)),n){if(this._capability=n,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(t,r)}},"DID");o(NM,"DID");function fH(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(fH,"toUint8Array");o(fH,"toUint8Array");var ZA=ir(xm(),1);p6();var PM={};xr(PM,{keyToDidDoc:()=>BM});function BM(e,t){let r=`did:key:${t}`,n=`${r}#${t}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(BM,"keyToDidDoc");o(BM,"keyToDidDoc");var LM={};xr(LM,{keyToDidDoc:()=>FM});Ed();var dH=ir(_6(),1);function UM(e){let t=new Uint8Array(e.length+2);return t[0]=236,t[1]=1,t.set(e,2),`z${Ir(t,"base58btc")}`}i(UM,"encodeKey");o(UM,"encodeKey");function FM(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=(0,dH.convertPublicKeyToX25519)(e),s=`${r}#${UM(a)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:Ir(a,"base58btc")}]}}i(FM,"keyToDidDoc2");o(FM,"keyToDidDoc");var jM={};xr(jM,{keyToDidDoc:()=>eI,pubKeyBytesToXY:()=>s2});var $M={};xr($M,{ECPointDecompress:()=>JM});function zM(e){return e>=0?e:-e}i(zM,"n");o(zM,"n");function HM(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,a=1n,s=0n;for(;e!==0n;){let c=t/e,l=t%e,h=r-a*c,p=n-s*c;t=e,e=l,r=a,n=s,a=h,s=p}return{g:t,x:r,y:n}}i(HM,"r");o(HM,"r");function ad(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(ad,"e");o(ad,"e");function i2(e,t){let r=HM(ad(e,t),t);if(r.g!==1n)throw new RangeError(`${e.toString()} does not have inverse modulo ${t.toString()}`);return ad(r.x,t)}i(i2,"o");o(i2,"o");function qM(e,t,r){if(e.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=r??t.reduce((a,s)=>a*s,1n);return t.reduce((a,s,c)=>{let l=n/s;return ad(a+l*i2(l,s)%n*e[c]%n,n)},0n)}i(qM,"i");o(qM,"i");function VM(e){return e.map(t=>t[0]**(t[1]-1n)*(t[0]-1n)).reduce((t,r)=>r*t,1n)}i(VM,"a");o(VM,"a");function Vu(e,t,r,n){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=ad(e,r),t<0n)return i2(Vu(e,zM(t),r,n),r);if(n!==void 0)return function(s,c,l,h){let p=h.map(y=>y[0]**y[1]),g=h.map(y=>VM([y])),v=g.map((y,_)=>Vu(s,c%y,p[_]));return qM(v,p,l)}(e,t,r,function(s){let c={};return s.forEach(l=>{if(typeof l=="bigint"||typeof l=="number"){let h=String(l);c[h]===void 0?c[h]={p:BigInt(l),k:1n}:c[h].k+=1n}else{let h=String(l[0]);c[h]===void 0?c[h]={p:BigInt(l[0]),k:BigInt(l[1])}:c[h].k+=BigInt(l[1])}}),Object.values(c).map(l=>[l.p,l.k])}(n));let a=1n;for(;t>0;)t%2n===1n&&(a=a*e%r),t/=2n,e=e**2n%r;return a}i(Vu,"s");o(Vu,"s");var Yn={};xr(Yn,{pubKeyBytesToHex:()=>KM,publicKeyHexToUint8ArrayPointPair:()=>a2,publicKeyIntToUint8ArrayPointPair:()=>o2,publicKeyIntToXY:()=>WM,publicKeyToXY:()=>GM,testHexString:()=>Hm,testUint8Array:()=>yl});m6();function KM(e){if(!yl(e))throw new TypeError("input must be a Uint8Array");return Ir(e,"base16")}i(KM,"pubKeyBytesToHex");o(KM,"pubKeyBytesToHex");function GM(e){if(!Hm(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=a2(e),r=zu.encode(t.xOctet).slice(1),n=zu.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(GM,"publicKeyToXY");o(GM,"publicKeyToXY");function a2(e){if(!Hm(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=Cr(t,"base16"),a=Cr(r,"base16");return{xOctet:n,yOctet:a}}i(a2,"publicKeyHexToUint8ArrayPointPair");o(a2,"publicKeyHexToUint8ArrayPointPair");function Hm(e){let t=/^[A-Fa-f0-9]+$/i;return!!(t.exec(e)!==null&&t.test(e)&&typeof e=="string")}i(Hm,"testHexString");o(Hm,"testHexString");function yl(e){return e==null?!1:e.constructor===Uint8Array}i(yl,"testUint8Array");o(yl,"testUint8Array");function WM(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=o2(e),r=zu.encode(t.xOctet).slice(1),n=zu.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(WM,"publicKeyIntToXY");o(WM,"publicKeyIntToXY");function o2(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=Cr(t,"base10"),a=Cr(r,"base10");return{xOctet:n,yOctet:a}}i(o2,"publicKeyIntToUint8ArrayPointPair");o(o2,"publicKeyIntToUint8ArrayPointPair");function JM(e){if(!yl(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,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(JM,"ECPointDecompress");o(JM,"ECPointDecompress");var ZM={};xr(ZM,{ECPointDecompress:()=>YM});function YM(e){if(!yl(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,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(YM,"ECPointDecompress2");o(YM,"ECPointDecompress");var XM={};xr(XM,{ECPointDecompress:()=>QM});function QM(e){if(!yl(e))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(QM,"ECPointDecompress3");o(QM,"ECPointDecompress");function eI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=s2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(eI,"keyToDidDoc3");o(eI,"keyToDidDoc");function s2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e),r=t.length/2;if(r==64)return Yn.publicKeyToXY(t);if(r==65&&t.slice(0,2)=="04"){let n=t.slice(2);return Yn.publicKeyToXY(n)}if(r==33&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=$M.ECPointDecompress(n);return Yn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(s2,"pubKeyBytesToXY");o(s2,"pubKeyBytesToXY");var tI={};xr(tI,{keyToDidDoc:()=>rI,pubKeyBytesToXY:()=>c2});function rI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=c2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(rI,"keyToDidDoc4");o(rI,"keyToDidDoc");function c2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e),r=t.length/2;if(r==96)return Yn.publicKeyToXY(t);if(r==97&&t.slice(0,2)=="04"){let n=t.slice(2);return Yn.publicKeyToXY(n)}if(r==49&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=ZM.ECPointDecompress(n);return Yn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(c2,"pubKeyBytesToXY2");o(c2,"pubKeyBytesToXY");var nI={};xr(nI,{keyToDidDoc:()=>iI,pubKeyBytesToXY:()=>u2});function iI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=u2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(iI,"keyToDidDoc5");o(iI,"keyToDidDoc");function u2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e);if(132<=t.length&&t.length<=134&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let r=Cr(t,"base16"),n=XM.ECPointDecompress(r);return Yn.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}i(u2,"pubKeyBytesToXY3");o(u2,"pubKeyBytesToXY");var hH="application/did+ld+json",YA="application/did+json",pH={231:PM,237:LM,4608:jM,4609:tI,4610:nI};function mH(){return{key:async(e,t,r,n)=>{let a=n.accept||YA,s={didResolutionMetadata:{contentType:a},didDocument:null,didDocumentMetadata:{}};try{let c=ua.decode(t.id),l=ZA.default.decode(c),h=c.slice(ZA.default.decode.bytes),p=await pH[l].keyToDidDoc(h,t.id);a===hH?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):a===YA?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(c){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=c.toString()}return s}}}i(mH,"getResolver");o(mH,"getResolver");var aI=ir(_6(),1),gH=ir(M$(),1),vH="base64pad";function jb(e){return JSON.parse((0,gH.default)(e))}i(jb,"toStableObject");o(jb,"toStableObject");function oI(e){let t=new Uint8Array(e.length+2);return t[0]=237,t[1]=1,t.set(e,2),`did:key:z${Ir(t,"base58btc")}`}i(oI,"encodeDID");o(oI,"encodeDID");function $b(e){let[t,r,n]=e.split(".");return{payload:r,signatures:[{protected:t,signature:n}]}}i($b,"toGeneralJWS");o($b,"toGeneralJWS");var XA=o(async(e,t,r,n={})=>{let a=`${t}#${t.split(":")[2]}`,s=iT(r),c=jb(Object.assign(n,{kid:a,alg:"EdDSA"}));return iz(typeof e=="string"?e:jb(e),s,c)},"sign"),yH={did_authenticate:async({did:e,secretKey:t},r)=>{let n=await XA({did:e,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},e,t);return $b(n)},did_createJWS:async({did:e,secretKey:t},r)=>{if(r.did.split("#")[0]!==e)throw new bs(4100,`Unknown DID: ${e}`);let a=await XA(r.payload,e,t,r.protected);return{jws:$b(a)}},did_decryptJWE:async({secretKey:e},t)=>{let r=vT((0,aI.convertSecretKeyToX25519)(e));try{let n=await oz(t.jwe,r);return{cleartext:Ir(n,vH)}}catch(n){throw new bs(-32e3,n.message)}}},bH=i(class{constructor(e){let{secretKey:t,publicKey:r}=(0,aI.generateKeyPairFromSeed)(e),n=oI(r),a=ZC(yH);this._handle=async s=>await a({did:n,secretKey:t},s)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}},"Ed25519Provider");o(bH,"Ed25519Provider");var sI={};xr(sI,{JsonPatchError:()=>Ur,_areEquals:()=>Ku,applyOperation:()=>ps,applyPatch:()=>qm,applyReducer:()=>uI,deepClone:()=>EH,getValueByPointer:()=>od,validate:()=>f2,validator:()=>sd});var wH=function(){var e=o(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),o(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),_H=Object.prototype.hasOwnProperty;function rm(e,t){return _H.call(e,t)}i(rm,"hasOwnProperty");o(rm,"hasOwnProperty");function nm(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 a in e)rm(e,a)&&n.push(a);return n}i(nm,"_objectKeys");o(nm,"_objectKeys");function Xn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(Xn,"_deepClone");o(Xn,"_deepClone");function im(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(im,"isInteger2");o(im,"isInteger");function ds(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(ds,"escapePathComponent");o(ds,"escapePathComponent");function l2(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(l2,"unescapePathComponent");o(l2,"unescapePathComponent");function am(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(am(e[t]))return!0}else if(typeof e=="object"){for(var n=nm(e),a=n.length,s=0;s<a;s++)if(am(e[n[s]]))return!0}}return!1}i(am,"hasUndefined");o(am,"hasUndefined");function zb(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
843
- `)}i(zb,"patchErrorMessageFormatter");o(zb,"patchErrorMessageFormatter");var cI=function(e){wH(t,e);function t(r,n,a,s,c){var l=this.constructor,h=e.call(this,zb(r,{name:n,index:a,operation:s,tree:c}))||this;return h.name=n,h.index=a,h.operation=s,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=zb(r,{name:n,index:a,operation:s,tree:c}),h}return i(t,"PatchError2"),o(t,"PatchError"),t}(Error),Ur=cI,EH=Xn,Uu={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=od(r,this.path);n&&(n=Xn(n));var a=ps(r,{op:"remove",path:this.from}).removed;return ps(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=od(r,this.from);return ps(r,{op:"add",path:this.path,value:Xn(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Ku(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},AH={add:function(e,t,r){return im(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:Uu.move,copy:Uu.copy,test:Uu.test,_get:Uu._get};function od(e,t){if(t=="")return e;var r={op:"_get",path:t};return ps(e,r),r.value}i(od,"getValueByPointer");o(od,"getValueByPointer");function ps(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):sd(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=od(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=Ku(e,t.value),c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,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 Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=Xn(e));var l=t.path||"",h=l.split("/"),p=e,g=1,v=h.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=sd;;){if(_=h[g],_&&_.indexOf("~")!=-1&&(_=l2(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&h[g-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[_]===void 0?y=h.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!im(_))throw new Ur("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",s,t,e);im(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Ur("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=AH[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Uu[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Ur("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(ps,"applyOperation");o(ps,"applyOperation");function qm(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Xn(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=ps(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(qm,"applyPatch");o(qm,"applyPatch");function uI(e,t,r){var n=ps(e,t);if(n.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(uI,"applyReducer");o(uI,"applyReducer");function sd(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ur("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Uu[e.op]){if(typeof e.path!="string")throw new Ur("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ur('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 Ur("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 Ur("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")&&am(e.value))throw new Ur("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 a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Ur("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 Ur("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=f2([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ur("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(sd,"validator");o(sd,"validator");function f2(e,t,r){try{if(!Array.isArray(e))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)qm(Xn(t),Xn(e),r||!0);else{r=r||sd;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Ur)return a;throw a}}i(f2,"validate5");o(f2,"validate");function Ku(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),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!Ku(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!Ku(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(Ku,"_areEquals");o(Ku,"_areEquals");var lI={};xr(lI,{compare:()=>gI,generate:()=>om,observe:()=>mI,unobserve:()=>pI});var d2=new WeakMap,SH=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror2"),o(e,"Mirror"),e}(),xH=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo2"),o(e,"ObserverInfo"),e}();function fI(e){return d2.get(e)}i(fI,"getMirror");o(fI,"getMirror");function dI(e,t){return e.observers.get(t)}i(dI,"getObserverFromMirror");o(dI,"getObserverFromMirror");function hI(e,t){e.observers.delete(t.callback)}i(hI,"removeObserverFromMirror");o(hI,"removeObserverFromMirror");function pI(e,t){t.unobserve()}i(pI,"unobserve");o(pI,"unobserve");function mI(e,t){var r=[],n,a=fI(e);if(!a)a=new SH(e),d2.set(e,a);else{var s=dI(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=Xn(e),t){n.callback=t,n.next=null;var c=o(function(){om(n)},"dirtyCheck"),l=o(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(){om(n),clearTimeout(n.next),hI(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new xH(t,n)),n}i(mI,"observe");o(mI,"observe");function om(e,t){t===void 0&&(t=!1);var r=d2.get(e.object);Vm(r.value,e.object,e.patches,"",t),e.patches.length&&qm(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(om,"generate2");o(om,"generate");function Vm(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=nm(t),c=nm(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(rm(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?Vm(v,y,r,n+"/"+ds(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+ds(g),value:Xn(v)}),r.push({op:"replace",path:n+"/"+ds(g),value:Xn(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+ds(g),value:Xn(v)}),r.push({op:"remove",path:n+"/"+ds(g)}),h=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!rm(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+ds(g),value:Xn(t[g])})}}}i(Vm,"_generate");o(Vm,"_generate");function gI(e,t,r){r===void 0&&(r=!1);var n=[];return Vm(e,t,n,"",r),n}i(gI,"compare3");o(gI,"compare");var vI=Object.assign({},sI,lI,{JsonPatchError:cI,deepClone:Xn,escapePathComponent:ds,unescapePathComponent:l2}),TH=ir(Sd(),1),CH=ir(cl(),1),ei;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(ei||(ei={}));var QA=ir(Sd(),1);Ga();_d();var yI={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function bI(e){let t=yI[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(bI,"codeByName");o(bI,"codeByName");function wI(e){let t=Object.entries(yI).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(wI,"nameByCode");o(wI,"nameByCode");var Mo=i(class{},"StreamType");o(Mo,"StreamType");Mo.nameByCode=wI;Mo.codeByName=bI;var eS=ir(xm(),1);function Ji(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=Hb(c.value,t,r,n);else if(c.get!=null)c.get=Hb(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(Ji,"Memoize");o(Ji,"Memoize");var ab=new Map;function Hb(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let h of n)ab.has(h)?ab.get(h).push(l):ab.set(h,[l]);if(t||s.length>0||r>0){let h;t===!0?h=s.map(v=>v.toString()).join("!"):t?h=t.apply(this,s):h=s[0];let p=`${h}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(h)&&!g?c=l.get(h):(c=e.apply(this,s),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,s),l.set(h,c))}return c}}i(Hb,"getNewFunction");o(Hb,"getNewFunction");var h2=206;Ga();_d();bm();var tS=ir(xm(),1);function kd(e){try{return e()}catch(t){return t}}i(kd,"tryCatch");o(kd,"tryCatch");Ga();var rS=ir(xm(),1);al();function _c(e){let t=rS.default.decode(e),r=rS.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(_c,"readVarint");o(_c,"readVarint");function _I(e){return e===0||e===1}i(_I,"isCidVersion");o(_I,"isCidVersion");function qb(e){let[t,r]=_c(e);if(!_I(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=_c(r),[,s,c]=_c(a),[l,,h]=_c(s),p=a.subarray(0,c+h+l),g=a.subarray(c+h+l);return[$t.create(t,n,v6(p)),g]}i(qb,"readCid");o(qb,"readCid");Ga();_d();function Dd(e,t="StreamRef"){let[r,n]=_c(e);if(r!==h2)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=_c(n),c=qb(s),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:a,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=qb(h);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(Dd,"fromBytes");o(Dd,"fromBytes");var MH=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Km(e,t="StreamRef"){let r=MH.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=Ss.decode(n),s=Dd(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:p2(s.genesis,c)}:s}i(Km,"fromString4");o(Km,"fromString");function EI(e){try{return typeof e=="string"?$t.parse(e):$t.asCID(e)}catch{return null}}i(EI,"parseCID");o(EI,"parseCID");function p2(e,t=null){if(!t||t==="0")return null;let r=EI(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(p2,"parseCommit");o(p2,"parseCommit");var Rd=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate"),Ki=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata"),AI=i(class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ss.encode(e)}: contains commit`)}},"InvalidStreamIDBytesError");o(AI,"InvalidStreamIDBytesError");var SI=i(class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}},"InvalidStreamIDStringError");o(SI,"InvalidStreamIDStringError");function m2(e){let t=Dd(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new AI(e)}i(m2,"fromBytes2");o(m2,"fromBytes");function xI(e){return kd(()=>m2(e))}i(xI,"fromBytesNoThrow");o(xI,"fromBytesNoThrow");function g2(e){let t=Km(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new SI(e)}i(g2,"fromString5");o(g2,"fromString");function TI(e){return kd(()=>g2(e))}i(TI,"fromStringNoThrow");o(TI,"fromStringNoThrow");var nS=Symbol.for("@ceramicnetwork/streamid/StreamID"),Xt=i(class{constructor(e,t){if(this._tag=nS,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?Mo.codeByName(e):e,this._cid=typeof t=="string"?$t.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===nS}static async fromGenesis(e,t){let r=await Mm({value:t,codec:fl,hasher:ol});return new Xt(e,r.cid)}get type(){return this._type}get typeName(){return Mo.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=tS.default.encode(h2),t=tS.default.encode(this.type);return gs([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 Ss.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"StreamID");o(Xt,"StreamID");Xt.fromBytes=m2;Xt.fromBytesNoThrow=xI;Xt.fromString=g2;Xt.fromStringNoThrow=TI;Rd([Ji(),Ki("design:type",String),Ki("design:paramtypes",[])],Xt.prototype,"typeName",null);Rd([Ji(),Ki("design:type",Uint8Array),Ki("design:paramtypes",[])],Xt.prototype,"bytes",null);Rd([Ji(),Ki("design:type",Xt),Ki("design:paramtypes",[])],Xt.prototype,"baseID",null);Rd([Ji(),Ki("design:type",Function),Ki("design:paramtypes",[]),Ki("design:returntype",String)],Xt.prototype,"toString",null);Rd([Ji(),Ki("design:type",Function),Ki("design:paramtypes",[]),Ki("design:returntype",String)],Xt.prototype,"toUrl",null);var bl=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate2"),Qn=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata2"),ob=i(function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},"__classPrivateFieldSet"),Eo=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"),Pu,gc,qf,CI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ss.encode(e)}: no commit information provided`)}},"InvalidCommitIDBytesError");o(CI,"InvalidCommitIDBytesError");var MI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}},"InvalidCommitIDStringError");o(MI,"InvalidCommitIDStringError");function v2(e){let t=Dd(e,"CommitID");if(t.kind==="commit-id")return new Ar(t.type,t.genesis,t.commit);throw new CI(e)}i(v2,"fromBytes3");o(v2,"fromBytes");function II(e){return kd(()=>v2(e))}i(II,"fromBytesNoThrow2");o(II,"fromBytesNoThrow");function y2(e){let t=Km(e,"CommitID");if(t.kind==="commit-id")return new Ar(t.type,t.genesis,t.commit);throw new MI(e)}i(y2,"fromString6");o(y2,"fromString");function kI(e){return kd(()=>y2(e))}i(kI,"fromStringNoThrow2");o(kI,"fromStringNoThrow");var iS=Symbol.for("@ceramicnetwork/streamid/CommitID");function DI(e,t){return new Ar(e.type,e.cid,t)}i(DI,"make");o(DI,"make");var Ar=i(class{constructor(e,t,r=null){if(this._tag=iS,Pu.set(this,void 0),gc.set(this,void 0),qf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");ob(this,Pu,typeof e=="string"?Mo.codeByName(e):e,"f"),ob(this,gc,typeof t=="string"?$t.parse(t):t,"f"),ob(this,qf,p2(Eo(this,gc,"f"),r),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===iS}get baseID(){return new Xt(Eo(this,Pu,"f"),Eo(this,gc,"f"))}get type(){return Eo(this,Pu,"f")}get typeName(){return Mo.nameByCode(Eo(this,Pu,"f"))}get cid(){return Eo(this,gc,"f")}get commit(){return Eo(this,qf,"f")||Eo(this,gc,"f")}get bytes(){let e=eS.default.encode(h2),t=eS.default.encode(this.type),r=Eo(this,qf,"f")?.bytes||new Uint8Array([0]);return gs([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 Ss.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Pu=new WeakMap,gc=new WeakMap,qf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"CommitID");o(Ar,"CommitID");Ar.fromBytes=v2;Ar.fromBytesNoThrow=II;Ar.fromString=y2;Ar.fromStringNoThrow=kI;Ar.make=DI;bl([Ji(),Qn("design:type",Xt),Qn("design:paramtypes",[])],Ar.prototype,"baseID",null);bl([Ji(),Qn("design:type",String),Qn("design:paramtypes",[])],Ar.prototype,"typeName",null);bl([Ji(),Qn("design:type",$t),Qn("design:paramtypes",[])],Ar.prototype,"commit",null);bl([Ji(),Qn("design:type",Uint8Array),Qn("design:paramtypes",[])],Ar.prototype,"bytes",null);bl([Ji(),Qn("design:type",Function),Qn("design:paramtypes",[]),Qn("design:returntype",String)],Ar.prototype,"toString",null);bl([Ji(),Qn("design:type",Function),Qn("design:paramtypes",[]),Qn("design:returntype",String)],Ar.prototype,"toUrl",null);_d();var ws;(function(e){function t(a){let s=Dd(a);switch(s.kind){case"commit-id":return new Ar(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Ss.encode(a)}`)}}i(t,"fromBytes4"),o(t,"fromBytes"),e.fromBytes=t;function r(a){let s=Km(a);switch(s.kind){case"commit-id":return new Ar(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString7"),o(r,"fromString"),e.fromString=r;function n(a){if(Xt.isInstance(a)||Ar.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from4"),o(n,"from"),e.from=n})(ws||(ws={}));var Vb=o(function(e,t){return Vb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},Vb(e,t)},"extendStatics");function Ya(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Vb(e,t);function r(){this.constructor=e}i(r,"__"),o(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(Ya,"__extends2");o(Ya,"__extends");function RI(e,t,r,n){function a(s){return s instanceof r?s:new r(function(c){c(s)})}return i(a,"adopt"),o(a,"adopt"),new(r||(r=Promise))(function(s,c){function l(g){try{p(n.next(g))}catch(v){c(v)}}i(l,"fulfilled"),o(l,"fulfilled");function h(g){try{p(n.throw(g))}catch(v){c(v)}}i(h,"rejected"),o(h,"rejected");function p(g){g.done?s(g.value):a(g.value).then(l,h)}i(p,"step"),o(p,"step"),p((n=n.apply(e,t||[])).next())})}i(RI,"__awaiter");o(RI,"__awaiter");function b2(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=l(0),c.throw=l(1),c.return=l(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(p){return function(g){return h([p,g])}}function h(p){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(r=0)),r;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(g){p=[6,g],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}i(b2,"__generator");o(b2,"__generator");function Mc(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(Mc,"__values");o(Mc,"__values");function Io(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(Io,"__read");o(Io,"__read");function _s(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(_s,"__spreadArray");o(_s,"__spreadArray");function Tc(e){return this instanceof Tc?(this.v=e,this):new Tc(e)}i(Tc,"__await");o(Tc,"__await");function OI(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,s=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",c),a[Symbol.asyncIterator]=function(){return this},a;function c(_){return function(x){return Promise.resolve(x).then(_,v)}}function l(_,x){n[_]&&(a[_]=function(O){return new Promise(function(D,P){s.push([_,O,D,P])>1||h(_,O)})},x&&(a[_]=x(a[_])))}function h(_,x){try{p(n[_](x))}catch(O){y(s[0][3],O)}}function p(_){_.value instanceof Tc?Promise.resolve(_.value.v).then(g,v):y(s[0][2],_)}function g(_){h("next",_)}function v(_){h("throw",_)}function y(_,x){_(x),s.shift(),s.length&&h(s[0][0],s[0][1])}}i(OI,"__asyncGenerator");o(OI,"__asyncGenerator");function NI(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Mc=="function"?Mc(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(c){return new Promise(function(l,h){c=e[s](c),a(l,h,c.done,c.value)})}}function a(s,c,l,h){Promise.resolve(h).then(function(p){s({value:p,done:l})},c)}}i(NI,"__asyncValues");o(NI,"__asyncValues");function Sr(e){return typeof e=="function"}i(Sr,"isFunction");o(Sr,"isFunction");function Gm(e){var t=o(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(Gm,"createErrorClass");o(Gm,"createErrorClass");var sb=Gm(function(e){return o(i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
841
+ `)}i(eM,"asString");o(eM,"asString");var Db=i(class extends XC{toMessage(){return super.toMessage("Ethereum")}signMessage(){let e;switch(this.type){case Z0.PERSONAL_SIGNATURE:{e=this.toMessage();break}default:{e=this.toMessage();break}}return e}},"SiweMessage");o(Db,"SiweMessage");bm();var Fz=5*60,qY=new Date("2022-09-20").valueOf(),Y0;(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"),o(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"),o(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"),o(n,"fromSiwTezosMessage"),e.fromSiwTezosMessage=n;function a(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(a,"fromSiwStacksMessage"),o(a,"fromSiwStacksMessage"),e.fromSiwStacksMessage=a;async function s(l){return(await lz({bytes:l,codec:fl,hasher:ol})).value}i(s,"fromBlockBytes"),o(s,"fromBlockBytes"),e.fromBlockBytes=s;async function c(l,h={}){W6(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"),o(c,"verify"),e.verify=c})(Y0||(Y0={}));var X0;(function(e){function t(r){return Mm({value:r,codec:fl,hasher:ol})}i(t,"fromCacao"),o(t,"fromCacao"),e.fromCacao=t})(X0||(X0={}));function W6(e){if(e.s===null||e.s===void 0)throw new Error("CACAO does not have a signature")}i(W6,"assertSigned");o(W6,"assertSigned");function tM(e,t){let r=t.atTime?t.atTime.getTime():Date.now(),n=(t.clockSkewSecs??Fz)*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 a=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0;if(!t.disableExpirationCheck&&Date.parse(e.p.exp)+a+n<r)throw new Error("CACAO has expired")}i(tM,"verifyTimeChecks");o(tM,"verifyTimeChecks");var jz="logger/5.8.0",HA=!1,qA=!1,x0={debug:1,default:2,info:2,warning:3,error:4,off:5},VA=x0.default,rb=null;function rM(){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(rM,"_checkNormalize");o(rM,"_checkNormalize");var KA=rM(),Rb;(function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"})(Rb||(Rb={}));var la;(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"})(la||(la={}));var GA="0123456789abcdef",br=i(class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();x0[r]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(VA>x0[r])&&console.log.apply(console,t)}debug(...e){this._log(br.levels.DEBUG,e)}info(...e){this._log(br.levels.INFO,e)}warn(...e){this._log(br.levels.WARNING,e)}makeError(e,t,r){if(qA)return this.makeError("censored error",t,{});t||(t=br.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 g=0;g<h.length;g++)p+=GA[h[g]>>4],p+=GA[h[g]&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 a=e,s="";switch(t){case la.NUMERIC_FAULT:{s="NUMERIC_FAULT";let l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":s+="-"+l;break;case"negative-power":case"negative-width":s+="-unsupported";break;case"unbound-bitwise-result":s+="-unbound-result";break}break}case la.CALL_EXCEPTION:case la.INSUFFICIENT_FUNDS:case la.MISSING_NEW:case la.NONCE_EXPIRED:case la.REPLACEMENT_UNDERPRICED:case la.TRANSACTION_REPLACED:case la.UNPREDICTABLE_GAS_LIMIT:s=t;break}s&&(e+=" [ See: https://links.ethers.org/v5-errors-"+s+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let c=new Error(e);return c.reason=a,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,br.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"),KA&&this.throwError("platform missing String.prototype.normalize",br.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:KA})}checkSafeUint53(e,t){typeof e=="number"&&(t==null&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,br.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,br.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,br.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,br.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||e==null)&&this.throwError("missing new",br.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",br.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",br.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return rb||(rb=new br(jz)),rb}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),HA){if(!e)return;this.globalLogger().throwError("error censorship permanent",br.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}qA=!!e,HA=!!t}static setLogLevel(e){let t=x0[e.toLowerCase()];if(t==null){br.globalLogger().warn("invalid log level - "+e);return}VA=t}static from(e){return new br(e)}},"Logger");o(br,"Logger");br.errors=la;br.levels=Rb;var $z="bytes/5.8.0",zr=new br($z);function J6(e){return!!e.toHexString}i(J6,"isHexable");o(J6,"isHexable");function xc(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return xc(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}i(xc,"addSlice");o(xc,"addSlice");function nM(e){return ha(e)&&!(e.length%2)||jm(e)}i(nM,"isBytesLike");o(nM,"isBytesLike");function Ob(e){return typeof e=="number"&&e==e&&e%1===0}i(Ob,"isInteger");o(Ob,"isInteger");function jm(e){if(e==null)return!1;if(e.constructor===Uint8Array)return!0;if(typeof e=="string"||!Ob(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){let r=e[t];if(!Ob(r)||r<0||r>=256)return!1}return!0}i(jm,"isBytes");o(jm,"isBytes");function qr(e,t){if(t||(t={}),typeof e=="number"){zr.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),xc(new Uint8Array(r))}if(t.allowMissingPrefix&&typeof e=="string"&&e.substring(0,2)!=="0x"&&(e="0x"+e),J6(e)&&(e=e.toHexString()),ha(e)){let r=e.substring(2);r.length%2&&(t.hexPad==="left"?r="0"+r:t.hexPad==="right"?r+="0":zr.throwArgumentError("hex data is odd-length","value",e));let n=[];for(let a=0;a<r.length;a+=2)n.push(parseInt(r.substring(a,a+2),16));return xc(new Uint8Array(n))}return jm(e)?xc(new Uint8Array(e)):zr.throwArgumentError("invalid arrayify value","value",e)}i(qr,"arrayify");o(qr,"arrayify");function iM(e){let t=e.map(a=>qr(a)),r=t.reduce((a,s)=>a+s.length,0),n=new Uint8Array(r);return t.reduce((a,s)=>(n.set(s,a),a+s.length),0),xc(n)}i(iM,"concat3");o(iM,"concat");function aM(e,t){e=qr(e),e.length>t&&zr.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),xc(r)}i(aM,"zeroPad");o(aM,"zeroPad");function ha(e,t){return!(typeof e!="string"||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}i(ha,"isHexString");o(ha,"isHexString");var nb="0123456789abcdef";function Nn(e,t){if(t||(t={}),typeof e=="number"){zr.checkSafeUint53(e,"invalid hexlify value");let r="";for(;e;)r=nb[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),J6(e))return e.toHexString();if(ha(e))return e.length%2&&(t.hexPad==="left"?e="0x0"+e.substring(2):t.hexPad==="right"?e+="0":zr.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(jm(e)){let r="0x";for(let n=0;n<e.length;n++){let a=e[n];r+=nb[(a&240)>>4]+nb[a&15]}return r}return zr.throwArgumentError("invalid hexlify value","value",e)}i(Nn,"hexlify");o(Nn,"hexlify");function oM(e){if(typeof e!="string")e=Nn(e);else if(!ha(e)||e.length%2)return null;return(e.length-2)/2}i(oM,"hexDataLength");o(oM,"hexDataLength");function Nb(e,t,r){return typeof e!="string"?e=Nn(e):(!ha(e)||e.length%2)&&zr.throwArgumentError("invalid hexData","value",e),t=2+2*t,r!=null?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}i(Nb,"hexDataSlice");o(Nb,"hexDataSlice");function Tc(e,t){for(typeof e!="string"?e=Nn(e):ha(e)||zr.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&zr.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}i(Tc,"hexZeroPad");o(Tc,"hexZeroPad");function Z6(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(nM(e)){let r=qr(e);r.length===64?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Nn(r.slice(0,32)),t.s=Nn(r.slice(32,64))):r.length===65?(t.r=Nn(r.slice(0,32)),t.s=Nn(r.slice(32,64)),t.v=r[64]):zr.throwArgumentError("invalid signature string","signature",e),t.v<27&&(t.v===0||t.v===1?t.v+=27:zr.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Nn(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 a=aM(qr(t._vs),32);t._vs=Nn(a);let s=a[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=s:t.recoveryParam!==s&&zr.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),a[0]&=127;let c=Nn(a);t.s==null?t.s=c:t.s!==c&&zr.throwArgumentError("signature v mismatch _vs","signature",e)}if(t.recoveryParam==null)t.v==null?zr.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 a=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==a&&zr.throwArgumentError("signature recoveryParam mismatch v","signature",e)}t.r==null||!ha(t.r)?zr.throwArgumentError("signature missing or invalid r","signature",e):t.r=Tc(t.r,32),t.s==null||!ha(t.s)?zr.throwArgumentError("signature missing or invalid s","signature",e):t.s=Tc(t.s,32);let r=qr(t.s);r[0]>=128&&zr.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let n=Nn(r);t._vs&&(ha(t._vs)||zr.throwArgumentError("signature invalid _vs","signature",e),t._vs=Tc(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&zr.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}i(Z6,"splitSignature");o(Z6,"splitSignature");var zz=ir($x()),Hz="bignumber/5.8.0",qz=zz.default.BN,VY=new br(Hz);function sM(e){return new qz(e,36).toString(16)}i(sM,"_base36To16");o(sM,"_base36To16");var Vz=ir(Mx());function $m(e){return"0x"+Vz.default.keccak_256(qr(e))}i($m,"keccak256");o($m,"keccak256");var Kz="address/5.8.0",Gf=new br(Kz);function Pb(e){ha(e,20)||Gf.throwArgumentError("invalid address","address",e),e=e.toLowerCase();let t=e.substring(2).split(""),r=new Uint8Array(40);for(let a=0;a<40;a++)r[a]=t[a].charCodeAt(0);let n=qr($m(r));for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&(t[a]=t[a].toUpperCase()),(n[a>>1]&15)>=8&&(t[a+1]=t[a+1].toUpperCase());return"0x"+t.join("")}i(Pb,"getChecksumAddress");o(Pb,"getChecksumAddress");var Gz=9007199254740991;function cM(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}i(cM,"log10");o(cM,"log10");var Y6={};for(let e=0;e<10;e++)Y6[String(e)]=String(e);for(let e=0;e<26;e++)Y6[String.fromCharCode(65+e)]=String(10+e);var WA=Math.floor(cM(Gz));function uM(e){e=e.toUpperCase(),e=e.substring(4)+e.substring(0,2)+"00";let t=e.split("").map(n=>Y6[n]).join("");for(;t.length>=WA;){let n=t.substring(0,WA);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(uM,"ibanChecksum");o(uM,"ibanChecksum");function lM(e){let t=null;if(typeof e!="string"&&Gf.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))e.substring(0,2)!=="0x"&&(e="0x"+e),t=Pb(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Gf.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)!==uM(e)&&Gf.throwArgumentError("bad icap checksum","address",e),t=sM(e.substring(4));t.length<40;)t="0"+t;t=Pb("0x"+t)}else Gf.throwArgumentError("invalid address","address",e);return t}i(lM,"getAddress");o(lM,"getAddress");var Wz="properties/5.8.0",KY=new br(Wz);function Bu(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}i(Bu,"defineReadOnly");o(Bu,"defineReadOnly");var Jz="strings/5.8.0",fM=new br(Jz),Q0;(function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"})(Q0||(Q0={}));var Fu;(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"})(Fu||(Fu={}));function dM(e,t,r,n,a){return fM.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}i(dM,"errorFunc");o(dM,"errorFunc");function X6(e,t,r,n,a){if(e===Fu.BAD_PREFIX||e===Fu.UNEXPECTED_CONTINUE){let s=0;for(let c=t+1;c<r.length&&r[c]>>6===2;c++)s++;return s}return e===Fu.OVERRUN?r.length-t-1:0}i(X6,"ignoreFunc");o(X6,"ignoreFunc");function hM(e,t,r,n,a){return e===Fu.OVERLONG?(n.push(a),0):(n.push(65533),X6(e,t,r,n,a))}i(hM,"replaceFunc");o(hM,"replaceFunc");var GY=Object.freeze({error:dM,ignore:X6,replace:hM});function T0(e,t=Q0.current){t!=Q0.current&&(fM.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){let a=e.charCodeAt(n);if(a<128)r.push(a);else if(a<2048)r.push(a>>6|192),r.push(a&63|128);else if((a&64512)==55296){n++;let s=e.charCodeAt(n);if(n>=e.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");let c=65536+((a&1023)<<10)+(s&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(a>>12|224),r.push(a>>6&63|128),r.push(a&63|128)}return qr(r)}i(T0,"toUtf8Bytes");o(T0,"toUtf8Bytes");var Zz=`Ethereum Signed Message:
842
+ `;function pM(e){return typeof e=="string"&&(e=T0(e)),$m(iM([T0(Zz),T0(String(e.length)),e]))}i(pM,"hashMessage");o(pM,"hashMessage");var Mt=ir($x()),Ao=ir(Am());function $c(e,t,r){return r={path:t,exports:{},require:function(n,a){return mM(n,a??r.path)}},e(r,r.exports),r.exports}i($c,"createCommonjsModule");o($c,"createCommonjsModule");function mM(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}i(mM,"commonjsRequire");o(mM,"commonjsRequire");var Q6=e2;function e2(e,t){if(!e)throw new Error(t||"Assertion failed")}i(e2,"assert");o(e2,"assert");e2.equal=o(i(function(t,r,n){if(t!=r)throw new Error(n||"Assertion failed: "+t+" != "+r)},"assertEqual"),"assertEqual");var da=$c(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 g=c.charCodeAt(p),v=g>>8,y=g&255;v?h.push(v,y):h.push(y)}return h}i(n,"toArray"),o(n,"toArray"),r.toArray=n;function a(c){return c.length===1?"0"+c:c}i(a,"zero2"),o(a,"zero2"),r.zero2=a;function s(c){for(var l="",h=0;h<c.length;h++)l+=a(c[h].toString(16));return l}i(s,"toHex"),o(s,"toHex"),r.toHex=s,r.encode=o(i(function(l,h){return h==="hex"?s(l):l},"encode9"),"encode")}),Si=$c(function(e,t){"use strict";var r=t;r.assert=Q6,r.toArray=da.toArray,r.zero2=da.zero2,r.toHex=da.toHex,r.encode=da.encode;function n(h,p,g){var v=new Array(Math.max(h.bitLength(),g)+1),y;for(y=0;y<v.length;y+=1)v[y]=0;var _=1<<p+1,x=h.clone();for(y=0;y<v.length;y++){var O,D=x.andln(_-1);x.isOdd()?(D>(_>>1)-1?O=(_>>1)-D:O=D,x.isubn(O)):O=0,v[y]=O,x.iushrn(1)}return v}i(n,"getNAF2"),o(n,"getNAF"),r.getNAF=n;function a(h,p){var g=[[],[]];h=h.clone(),p=p.clone();for(var v=0,y=0,_;h.cmpn(-v)>0||p.cmpn(-y)>0;){var x=h.andln(3)+v&3,O=p.andln(3)+y&3;x===3&&(x=-1),O===3&&(O=-1);var D;(x&1)===0?D=0:(_=h.andln(7)+v&7,(_===3||_===5)&&O===2?D=-x:D=x),g[0].push(D);var P;(O&1)===0?P=0:(_=p.andln(7)+y&7,(_===3||_===5)&&x===2?P=-O:P=O),g[1].push(P),2*v===D+1&&(v=1-v),2*y===P+1&&(y=1-y),h.iushrn(1),p.iushrn(1)}return g}i(a,"getJSF2"),o(a,"getJSF"),r.getJSF=a;function s(h,p,g){var v="_"+p;h.prototype[p]=o(i(function(){return this[v]!==void 0?this[v]:this[v]=g.call(this)},"cachedProperty2"),"cachedProperty")}i(s,"cachedProperty"),o(s,"cachedProperty"),r.cachedProperty=s;function c(h){return typeof h=="string"?r.toArray(h,"hex"):h}i(c,"parseBytes"),o(c,"parseBytes"),r.parseBytes=c;function l(h){return new Mt.default(h,"hex","le")}i(l,"intFromLE"),o(l,"intFromLE"),r.intFromLE=l}),em=Si.getNAF,Yz=Si.getJSF,tm=Si.assert;function Oo(e,t){this.type=e,this.p=new Mt.default(t.p,16),this.red=t.prime?Mt.default.red(t.prime):Mt.default.mont(this.p),this.zero=new Mt.default(0).toRed(this.red),this.one=new Mt.default(1).toRed(this.red),this.two=new Mt.default(2).toRed(this.red),this.n=t.n&&new Mt.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(Oo,"BaseCurve");o(Oo,"BaseCurve");var zc=Oo;Oo.prototype.point=o(i(function(){throw new Error("Not implemented")},"point"),"point");Oo.prototype.validate=o(i(function(){throw new Error("Not implemented")},"validate"),"validate");Oo.prototype._fixedNafMul=o(i(function(t,r){tm(t.precomputed);var n=t._getDoubles(),a=em(r,1,this._bitLength),s=(1<<n.step+1)-(n.step%2===0?2:1);s/=3;var c=[],l,h;for(l=0;l<a.length;l+=n.step){h=0;for(var p=l+n.step-1;p>=l;p--)h=(h<<1)+a[p];c.push(h)}for(var g=this.jpoint(null,null,null),v=this.jpoint(null,null,null),y=s;y>0;y--){for(l=0;l<c.length;l++)h=c[l],h===y?v=v.mixedAdd(n.points[l]):h===-y&&(v=v.mixedAdd(n.points[l].neg()));g=g.add(v)}return g.toP()},"_fixedNafMul"),"_fixedNafMul");Oo.prototype._wnafMul=o(i(function(t,r){var n=4,a=t._getNAFPoints(n);n=a.wnd;for(var s=a.points,c=em(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 g=c[h];tm(g!==0),t.type==="affine"?g>0?l=l.mixedAdd(s[g-1>>1]):l=l.mixedAdd(s[-g-1>>1].neg()):g>0?l=l.add(s[g-1>>1]):l=l.add(s[-g-1>>1].neg())}return t.type==="affine"?l.toP():l},"_wnafMul"),"_wnafMul");Oo.prototype._wnafMulAdd=o(i(function(t,r,n,a,s){var c=this._wnafT1,l=this._wnafT2,h=this._wnafT3,p=0,g,v,y;for(g=0;g<a;g++){y=r[g];var _=y._getNAFPoints(t);c[g]=_.wnd,l[g]=_.points}for(g=a-1;g>=1;g-=2){var x=g-1,O=g;if(c[x]!==1||c[O]!==1){h[x]=em(n[x],c[x],this._bitLength),h[O]=em(n[O],c[O],this._bitLength),p=Math.max(h[x].length,p),p=Math.max(h[O].length,p);continue}var D=[r[x],null,null,r[O]];r[x].y.cmp(r[O].y)===0?(D[1]=r[x].add(r[O]),D[2]=r[x].toJ().mixedAdd(r[O].neg())):r[x].y.cmp(r[O].y.redNeg())===0?(D[1]=r[x].toJ().mixedAdd(r[O]),D[2]=r[x].add(r[O].neg())):(D[1]=r[x].toJ().mixedAdd(r[O]),D[2]=r[x].toJ().mixedAdd(r[O].neg()));var P=[-3,-1,-5,-7,0,7,5,1,3],J=Yz(n[x],n[O]);for(p=Math.max(J[0].length,p),h[x]=new Array(p),h[O]=new Array(p),v=0;v<p;v++){var j=J[0][v]|0,q=J[1][v]|0;h[x][v]=P[(j+1)*3+(q+1)],h[O][v]=0,l[x]=D}}var Q=this.jpoint(null,null,null),Y=this._wnafT4;for(g=p;g>=0;g--){for(var k=0;g>=0;){var K=!0;for(v=0;v<a;v++)Y[v]=h[v][g]|0,Y[v]!==0&&(K=!1);if(!K)break;k++,g--}if(g>=0&&k++,Q=Q.dblp(k),g<0)break;for(v=0;v<a;v++){var he=Y[v];he!==0&&(he>0?y=l[v][he-1>>1]:he<0&&(y=l[v][-he-1>>1].neg()),y.type==="affine"?Q=Q.mixedAdd(y):Q=Q.add(y))}}for(g=0;g<a;g++)l[g]=null;return s?Q:Q.toP()},"_wnafMulAdd"),"_wnafMulAdd");function xi(e,t){this.curve=e,this.type=t,this.precomputed=null}i(xi,"BasePoint");o(xi,"BasePoint");Oo.BasePoint=xi;xi.prototype.eq=o(i(function(){throw new Error("Not implemented")},"eq"),"eq");xi.prototype.validate=o(i(function(){return this.curve.validate(this)},"validate2"),"validate");Oo.prototype.decodePoint=o(i(function(t,r){t=Si.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?tm(t[t.length-1]%2===0):t[0]===7&&tm(t[t.length-1]%2===1);var a=this.point(t.slice(1,1+n),t.slice(1+n,1+2*n));return a}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");xi.prototype.encodeCompressed=o(i(function(t){return this.encode(t,!0)},"encodeCompressed"),"encodeCompressed");xi.prototype._encode=o(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");xi.prototype.encode=o(i(function(t,r){return Si.encode(this._encode(r),t)},"encode8"),"encode");xi.prototype.precompute=o(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");xi.prototype._hasDoubles=o(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");xi.prototype._getDoubles=o(i(function(t,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],a=this,s=0;s<r;s+=t){for(var c=0;c<t;c++)a=a.dbl();n.push(a)}return{step:t,points:n}},"_getDoubles"),"_getDoubles");xi.prototype._getNAFPoints=o(i(function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],n=(1<<t)-1,a=n===1?null:this.dbl(),s=1;s<n;s++)r[s]=r[s-1].add(a);return{wnd:t,points:r}},"_getNAFPoints"),"_getNAFPoints");xi.prototype._getBeta=o(i(function(){return null},"_getBeta"),"_getBeta");xi.prototype.dblp=o(i(function(t){for(var r=this,n=0;n<t;n++)r=r.dbl();return r},"dblp"),"dblp");var t2=$c(function(e){typeof Object.create=="function"?e.exports=o(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=o(i(function(r,n){if(n){r.super_=n;var a=o(function(){},"TempCtor");a.prototype=n.prototype,r.prototype=new a,r.prototype.constructor=r}},"inherits"),"inherits")}),Xz=Si.assert;function Ti(e){zc.call(this,"short",e),this.a=new Mt.default(e.a,16).toRed(this.red),this.b=new Mt.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(Ti,"ShortCurve");o(Ti,"ShortCurve");t2(Ti,zc);var Qz=Ti;Ti.prototype._getEndomorphism=o(i(function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,n;if(t.beta)r=new Mt.default(t.beta,16).toRed(this.red);else{var a=this._getEndoRoots(this.p);r=a[0].cmp(a[1])<0?a[0]:a[1],r=r.toRed(this.red)}if(t.lambda)n=new Mt.default(t.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?n=s[0]:(n=s[1],Xz(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 Mt.default(l.a,16),b:new Mt.default(l.b,16)}}):c=this._getEndoBasis(n),{beta:r,lambda:n,basis:c}}},"_getEndomorphism"),"_getEndomorphism");Ti.prototype._getEndoRoots=o(i(function(t){var r=t===this.p?this.red:Mt.default.mont(t),n=new Mt.default(2).toRed(r).redInvm(),a=n.redNeg(),s=new Mt.default(3).toRed(r).redNeg().redSqrt().redMul(n),c=a.redAdd(s).fromRed(),l=a.redSub(s).fromRed();return[c,l]},"_getEndoRoots"),"_getEndoRoots");Ti.prototype._getEndoBasis=o(i(function(t){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),n=t,a=this.n.clone(),s=new Mt.default(1),c=new Mt.default(0),l=new Mt.default(0),h=new Mt.default(1),p,g,v,y,_,x,O,D=0,P,J;n.cmpn(0)!==0;){var j=a.div(n);P=a.sub(j.mul(n)),J=l.sub(j.mul(s));var q=h.sub(j.mul(c));if(!v&&P.cmp(r)<0)p=O.neg(),g=s,v=P.neg(),y=J;else if(v&&++D===2)break;O=P,a=n,n=P,l=s,s=J,h=c,c=q}_=P.neg(),x=J;var Q=v.sqr().add(y.sqr()),Y=_.sqr().add(x.sqr());return Y.cmp(Q)>=0&&(_=p,x=g),v.negative&&(v=v.neg(),y=y.neg()),_.negative&&(_=_.neg(),x=x.neg()),[{a:v,b:y},{a:_,b:x}]},"_getEndoBasis"),"_getEndoBasis");Ti.prototype._endoSplit=o(i(function(t){var r=this.endo.basis,n=r[0],a=r[1],s=a.b.mul(t).divRound(this.n),c=n.b.neg().mul(t).divRound(this.n),l=s.mul(n.a),h=c.mul(a.a),p=s.mul(n.b),g=c.mul(a.b),v=t.sub(l).sub(h),y=p.add(g).neg();return{k1:v,k2:y}},"_endoSplit"),"_endoSplit");Ti.prototype.pointFromX=o(i(function(t,r){t=new Mt.default(t,16),t.red||(t=t.toRed(this.red));var n=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),a=n.redSqrt();if(a.redSqr().redSub(n).cmp(this.zero)!==0)throw new Error("invalid point");var s=a.fromRed().isOdd();return(r&&!s||!r&&s)&&(a=a.redNeg()),this.point(t,a)},"pointFromX"),"pointFromX");Ti.prototype.validate=o(i(function(t){if(t.inf)return!0;var r=t.x,n=t.y,a=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(a).redIAdd(this.b);return n.redSqr().redISub(s).cmpn(0)===0},"validate3"),"validate");Ti.prototype._endoWnafMulAdd=o(i(function(t,r,n){for(var a=this._endoWnafT1,s=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)),a[c*2]=h,a[c*2+1]=p,s[c*2]=l.k1,s[c*2+1]=l.k2}for(var g=this._wnafMulAdd(1,a,s,c*2,n),v=0;v<c*2;v++)a[v]=null,s[v]=null;return g},"_endoWnafMulAdd"),"_endoWnafMulAdd");function Yr(e,t,r,n){zc.BasePoint.call(this,e,"affine"),t===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Mt.default(t,16),this.y=new Mt.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(Yr,"Point");o(Yr,"Point");t2(Yr,zc.BasePoint);Ti.prototype.point=o(i(function(t,r,n){return new Yr(this,t,r,n)},"point2"),"point");Ti.prototype.pointFromJSON=o(i(function(t,r){return Yr.fromJSON(this,t,r)},"pointFromJSON"),"pointFromJSON");Yr.prototype._getBeta=o(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,a=o(function(s){return n.point(s.x.redMul(n.endo.beta),s.y)},"endoMul");t.beta=r,r.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(a)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(a)}}}return r}},"_getBeta2"),"_getBeta");Yr.prototype.toJSON=o(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");Yr.fromJSON=o(i(function(t,r,n){typeof r=="string"&&(r=JSON.parse(r));var a=t.point(r[0],r[1],n);if(!r[2])return a;function s(l){return t.point(l[0],l[1],n)}i(s,"obj2point"),o(s,"obj2point");var c=r[2];return a.precomputed={beta:null,doubles:c.doubles&&{step:c.doubles.step,points:[a].concat(c.doubles.points.map(s))},naf:c.naf&&{wnd:c.naf.wnd,points:[a].concat(c.naf.points.map(s))}},a},"fromJSON"),"fromJSON");Yr.prototype.inspect=o(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");Yr.prototype.isInfinity=o(i(function(){return this.inf},"isInfinity"),"isInfinity");Yr.prototype.add=o(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),a=r.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,a)},"add"),"add");Yr.prototype.dbl=o(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(),a=t.redInvm(),s=n.redAdd(n).redIAdd(n).redIAdd(r).redMul(a),c=s.redSqr().redISub(this.x.redAdd(this.x)),l=s.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,l)},"dbl"),"dbl");Yr.prototype.getX=o(i(function(){return this.x.fromRed()},"getX"),"getX");Yr.prototype.getY=o(i(function(){return this.y.fromRed()},"getY"),"getY");Yr.prototype.mul=o(i(function(t){return t=new Mt.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");Yr.prototype.mulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s):this.curve._wnafMulAdd(1,a,s,2)},"mulAdd"),"mulAdd");Yr.prototype.jmulAdd=o(i(function(t,r,n){var a=[this,r],s=[t,n];return this.curve.endo?this.curve._endoWnafMulAdd(a,s,!0):this.curve._wnafMulAdd(1,a,s,2,!0)},"jmulAdd"),"jmulAdd");Yr.prototype.eq=o(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");Yr.prototype.neg=o(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,a=o(function(s){return s.neg()},"negate");r.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(a)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(a)}}}return r},"neg"),"neg");Yr.prototype.toJ=o(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 rn(e,t,r,n){zc.BasePoint.call(this,e,"jacobian"),t===null&&r===null&&n===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Mt.default(0)):(this.x=new Mt.default(t,16),this.y=new Mt.default(r,16),this.z=new Mt.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(rn,"JPoint");o(rn,"JPoint");t2(rn,zc.BasePoint);Ti.prototype.jpoint=o(i(function(t,r,n){return new rn(this,t,r,n)},"jpoint"),"jpoint");rn.prototype.toP=o(i(function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),r=t.redSqr(),n=this.x.redMul(r),a=this.y.redMul(r).redMul(t);return this.curve.point(n,a)},"toP"),"toP");rn.prototype.neg=o(i(function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},"neg2"),"neg");rn.prototype.add=o(i(function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var r=t.z.redSqr(),n=this.z.redSqr(),a=this.x.redMul(r),s=t.x.redMul(n),c=this.y.redMul(r.redMul(t.z)),l=t.y.redMul(n.redMul(this.z)),h=a.redSub(s),p=c.redSub(l);if(h.cmpn(0)===0)return p.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=h.redSqr(),v=g.redMul(h),y=a.redMul(g),_=p.redSqr().redIAdd(v).redISub(y).redISub(y),x=p.redMul(y.redISub(_)).redISub(c.redMul(v)),O=this.z.redMul(t.z).redMul(h);return this.curve.jpoint(_,x,O)},"add2"),"add");rn.prototype.mixedAdd=o(i(function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var r=this.z.redSqr(),n=this.x,a=t.x.redMul(r),s=this.y,c=t.y.redMul(r).redMul(this.z),l=n.redSub(a),h=s.redSub(c);if(l.cmpn(0)===0)return h.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var p=l.redSqr(),g=p.redMul(l),v=n.redMul(p),y=h.redSqr().redIAdd(g).redISub(v).redISub(v),_=h.redMul(v.redISub(y)).redISub(s.redMul(g)),x=this.z.redMul(l);return this.curve.jpoint(y,_,x)},"mixedAdd"),"mixedAdd");rn.prototype.dblp=o(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 a=this.curve.a,s=this.curve.tinv,c=this.x,l=this.y,h=this.z,p=h.redSqr().redSqr(),g=l.redAdd(l);for(r=0;r<t;r++){var v=c.redSqr(),y=g.redSqr(),_=y.redSqr(),x=v.redAdd(v).redIAdd(v).redIAdd(a.redMul(p)),O=c.redMul(y),D=x.redSqr().redISub(O.redAdd(O)),P=O.redISub(D),J=x.redMul(P);J=J.redIAdd(J).redISub(_);var j=g.redMul(h);r+1<t&&(p=p.redMul(_)),c=D,h=j,g=J}return this.curve.jpoint(c,g.redMul(s),h)},"dblp2"),"dblp");rn.prototype.dbl=o(i(function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},"dbl2"),"dbl");rn.prototype._zeroDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var h=a.redAdd(a).redIAdd(a),p=h.redSqr().redISub(l).redISub(l),g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),t=p,r=h.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.x.redSqr(),y=this.y.redSqr(),_=y.redSqr(),x=this.x.redAdd(y).redSqr().redISub(v).redISub(_);x=x.redIAdd(x);var O=v.redAdd(v).redIAdd(v),D=O.redSqr(),P=_.redIAdd(_);P=P.redIAdd(P),P=P.redIAdd(P),t=D.redISub(x).redISub(x),r=O.redMul(x.redISub(t)).redISub(P),n=this.y.redMul(this.z),n=n.redIAdd(n)}return this.curve.jpoint(t,r,n)},"_zeroDbl"),"_zeroDbl");rn.prototype._threeDbl=o(i(function(){var t,r,n;if(this.zOne){var a=this.x.redSqr(),s=this.y.redSqr(),c=s.redSqr(),l=this.x.redAdd(s).redSqr().redISub(a).redISub(c);l=l.redIAdd(l);var h=a.redAdd(a).redIAdd(a).redIAdd(this.curve.a),p=h.redSqr().redISub(l).redISub(l);t=p;var g=c.redIAdd(c);g=g.redIAdd(g),g=g.redIAdd(g),r=h.redMul(l.redISub(p)).redISub(g),n=this.y.redAdd(this.y)}else{var v=this.z.redSqr(),y=this.y.redSqr(),_=this.x.redMul(y),x=this.x.redSub(v).redMul(this.x.redAdd(v));x=x.redAdd(x).redIAdd(x);var O=_.redIAdd(_);O=O.redIAdd(O);var D=O.redAdd(O);t=x.redSqr().redISub(D),n=this.y.redAdd(this.z).redSqr().redISub(y).redISub(v);var P=y.redSqr();P=P.redIAdd(P),P=P.redIAdd(P),P=P.redIAdd(P),r=x.redMul(O.redISub(t)).redISub(P)}return this.curve.jpoint(t,r,n)},"_threeDbl"),"_threeDbl");rn.prototype._dbl=o(i(function(){var t=this.curve.a,r=this.x,n=this.y,a=this.z,s=a.redSqr().redSqr(),c=r.redSqr(),l=n.redSqr(),h=c.redAdd(c).redIAdd(c).redIAdd(t.redMul(s)),p=r.redAdd(r);p=p.redIAdd(p);var g=p.redMul(l),v=h.redSqr().redISub(g.redAdd(g)),y=g.redISub(v),_=l.redSqr();_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=h.redMul(y).redISub(_),O=n.redAdd(n).redMul(a);return this.curve.jpoint(v,x,O)},"_dbl"),"_dbl");rn.prototype.trpl=o(i(function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),r=this.y.redSqr(),n=this.z.redSqr(),a=r.redSqr(),s=t.redAdd(t).redIAdd(t),c=s.redSqr(),l=this.x.redAdd(r).redSqr().redISub(t).redISub(a);l=l.redIAdd(l),l=l.redAdd(l).redIAdd(l),l=l.redISub(c);var h=l.redSqr(),p=a.redIAdd(a);p=p.redIAdd(p),p=p.redIAdd(p),p=p.redIAdd(p);var g=s.redIAdd(l).redSqr().redISub(c).redISub(h).redISub(p),v=r.redMul(g);v=v.redIAdd(v),v=v.redIAdd(v);var y=this.x.redMul(h).redISub(v);y=y.redIAdd(y),y=y.redIAdd(y);var _=this.y.redMul(g.redMul(p.redISub(g)).redISub(l.redMul(h)));_=_.redIAdd(_),_=_.redIAdd(_),_=_.redIAdd(_);var x=this.z.redAdd(l).redSqr().redISub(n).redISub(h);return this.curve.jpoint(y,_,x)},"trpl"),"trpl");rn.prototype.mul=o(i(function(t,r){return t=new Mt.default(t,r),this.curve._wnafMul(this,t)},"mul2"),"mul");rn.prototype.eq=o(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 a=r.redMul(this.z),s=n.redMul(t.z);return this.y.redMul(s).redISub(t.y.redMul(a)).cmpn(0)===0},"eq3"),"eq");rn.prototype.eqXToP=o(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 a=t.clone(),s=this.curve.redN.redMul(r);;){if(a.iadd(this.curve.n),a.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},"eqXToP"),"eqXToP");rn.prototype.inspect=o(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");rn.prototype.isInfinity=o(i(function(){return this.z.cmpn(0)===0},"isInfinity2"),"isInfinity");var C0=$c(function(e,t){"use strict";var r=t;r.base=zc,r.short=Qz,r.mont=null,r.edwards=null}),M0=$c(function(e,t){"use strict";var r=t,n=Si.assert;function a(l){l.type==="short"?this.curve=new C0.short(l):l.type==="edwards"?this.curve=new C0.edwards(l):this.curve=new C0.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(a,"PresetCurve"),o(a,"PresetCurve"),r.PresetCurve=a;function s(l,h){Object.defineProperty(r,l,{configurable:!0,enumerable:!0,get:function(){var p=new a(h);return Object.defineProperty(r,l,{configurable:!0,enumerable:!0,value:p}),p}})}i(s,"defineCurve"),o(s,"defineCurve"),s("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:Ao.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:Ao.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:Ao.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:Ao.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"]}),s("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:Ao.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Ao.default.sha256,gRed:!1,g:["9"]}),s("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:Ao.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var c;try{c=null.crash()}catch{c=void 0}s("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:Ao.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",c]})});function Co(e){if(!(this instanceof Co))return new Co(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=da.toArray(e.entropy,e.entropyEnc||"hex"),r=da.toArray(e.nonce,e.nonceEnc||"hex"),n=da.toArray(e.pers,e.persEnc||"hex");Q6(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}i(Co,"HmacDRBG");o(Co,"HmacDRBG");var gM=Co;Co.prototype._init=o(i(function(t,r,n){var a=t.concat(r).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656},"init"),"init");Co.prototype._hmac=o(i(function(){return new Ao.default.hmac(this.hash,this.K)},"hmac"),"hmac");Co.prototype._update=o(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");Co.prototype.reseed=o(i(function(t,r,n,a){typeof r!="string"&&(a=n,n=r,r=null),t=da.toArray(t,r),n=da.toArray(n,a),Q6(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(n||[])),this._reseed=1},"reseed"),"reseed");Co.prototype.generate=o(i(function(t,r,n,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(a=n,n=r,r=null),n&&(n=da.toArray(n,a||"hex"),this._update(n));for(var s=[];s.length<t;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var c=s.slice(0,t);return this._update(n),this._reseed++,da.encode(c,r)},"generate"),"generate");var Bb=Si.assert;function fn(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(fn,"KeyPair");o(fn,"KeyPair");var r2=fn;fn.fromPublic=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{pub:r,pubEnc:n})},"fromPublic"),"fromPublic");fn.fromPrivate=o(i(function(t,r,n){return r instanceof fn?r:new fn(t,{priv:r,privEnc:n})},"fromPrivate"),"fromPrivate");fn.prototype.validate=o(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");fn.prototype.getPublic=o(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");fn.prototype.getPrivate=o(i(function(t){return t==="hex"?this.priv.toString(16,2):this.priv},"getPrivate"),"getPrivate");fn.prototype._importPrivate=o(i(function(t,r){this.priv=new Mt.default(t,r||16),this.priv=this.priv.umod(this.ec.curve.n)},"_importPrivate"),"_importPrivate");fn.prototype._importPublic=o(i(function(t,r){if(t.x||t.y){this.ec.curve.type==="mont"?Bb(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&Bb(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");fn.prototype.derive=o(i(function(t){return t.validate()||Bb(t.validate(),"public point not validated"),t.mul(this.priv).getX()},"derive"),"derive");fn.prototype.sign=o(i(function(t,r,n){return this.ec.sign(t,this,r,n)},"sign2"),"sign");fn.prototype.verify=o(i(function(t,r,n){return this.ec.verify(t,r,this,void 0,n)},"verify2"),"verify");fn.prototype.inspect=o(i(function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},"inspect3"),"inspect");var eH=Si.assert;function Id(e,t){if(e instanceof Id)return e;this._importDER(e,t)||(eH(e.r&&e.s,"Signature without r or s"),this.r=new Mt.default(e.r,16),this.s=new Mt.default(e.s,16),e.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}i(Id,"Signature");o(Id,"Signature");var zm=Id;function vM(){this.place=0}i(vM,"Position");o(vM,"Position");function I0(e,t){var r=e[t.place++];if(!(r&128))return r;var n=r&15;if(n===0||n>4||e[t.place]===0)return!1;for(var a=0,s=0,c=t.place;s<n;s++,c++)a<<=8,a|=e[c],a>>>=0;return a<=127?!1:(t.place=c,a)}i(I0,"getLength");o(I0,"getLength");function Lb(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(Lb,"rmPadding");o(Lb,"rmPadding");Id.prototype._importDER=o(i(function(t,r){t=Si.toArray(t,r);var n=new vM;if(t[n.place++]!==48)return!1;var a=I0(t,n);if(a===!1||a+n.place!==t.length||t[n.place++]!==2)return!1;var s=I0(t,n);if(s===!1||(t[n.place]&128)!==0)return!1;var c=t.slice(n.place,s+n.place);if(n.place+=s,t[n.place++]!==2)return!1;var l=I0(t,n);if(l===!1||t.length!==l+n.place||(t[n.place]&128)!==0)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 Mt.default(c),this.s=new Mt.default(h),this.recoveryParam=null,!0},"_importDER"),"_importDER");function k0(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(k0,"constructLength");o(k0,"constructLength");Id.prototype.toDER=o(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=Lb(r),n=Lb(n);!n[0]&&!(n[1]&128);)n=n.slice(1);var a=[2];k0(a,r.length),a=a.concat(r),a.push(2),k0(a,n.length);var s=a.concat(n),c=[48];return k0(c,s.length),c=c.concat(s),Si.encode(c,t)},"toDER"),"toDER");var tH=o(function(){throw new Error("unsupported")},"rand"),wc=Si.assert;function Ei(e){if(!(this instanceof Ei))return new Ei(e);typeof e=="string"&&(wc(Object.prototype.hasOwnProperty.call(M0,e),"Unknown curve "+e),e=M0[e]),e instanceof M0.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(Ei,"EC");o(Ei,"EC");var rH=Ei;Ei.prototype.keyPair=o(i(function(t){return new r2(this,t)},"keyPair"),"keyPair");Ei.prototype.keyFromPrivate=o(i(function(t,r){return r2.fromPrivate(this,t,r)},"keyFromPrivate"),"keyFromPrivate");Ei.prototype.keyFromPublic=o(i(function(t,r){return r2.fromPublic(this,t,r)},"keyFromPublic"),"keyFromPublic");Ei.prototype.genKeyPair=o(i(function(t){t||(t={});for(var r=new gM({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||tH(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new Mt.default(2));;){var s=new Mt.default(r.generate(n));if(!(s.cmp(a)>0))return s.iaddn(1),this.keyFromPrivate(s)}},"genKeyPair"),"genKeyPair");Ei.prototype._truncateToN=o(i(function(t,r,n){var a;if(Mt.default.isBN(t)||typeof t=="number")t=new Mt.default(t,16),a=t.byteLength();else if(typeof t=="object")a=t.length,t=new Mt.default(t,16);else{var s=t.toString();a=s.length+1>>>1,t=new Mt.default(s,16)}typeof n!="number"&&(n=a*8);var c=n-this.n.bitLength();return c>0&&(t=t.ushrn(c)),!r&&t.cmp(this.n)>=0?t.sub(this.n):t},"_truncateToN"),"_truncateToN");Ei.prototype.sign=o(i(function(t,r,n,a){if(typeof n=="object"&&(a=n,n=null),a||(a={}),typeof t!="string"&&typeof t!="number"&&!Mt.default.isBN(t)){wc(typeof t=="object"&&t&&typeof t.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),wc(t.length>>>0===t.length);for(var s=0;s<t.length;s++)wc((t[s]&255)===t[s])}r=this.keyFromPrivate(r,n),t=this._truncateToN(t,!1,a.msgBitLength),wc(!t.isNeg(),"Can not sign a negative message");var c=this.n.byteLength(),l=r.getPrivate().toArray("be",c),h=t.toArray("be",c);wc(new Mt.default(h).eq(t),"Can not sign message");for(var p=new gM({hash:this.hash,entropy:l,nonce:h,pers:a.pers,persEnc:a.persEnc||"utf8"}),g=this.n.sub(new Mt.default(1)),v=0;;v++){var y=a.k?a.k(v):new Mt.default(p.generate(this.n.byteLength()));if(y=this._truncateToN(y,!0),!(y.cmpn(1)<=0||y.cmp(g)>=0)){var _=this.g.mul(y);if(!_.isInfinity()){var x=_.getX(),O=x.umod(this.n);if(O.cmpn(0)!==0){var D=y.invm(this.n).mul(O.mul(r.getPrivate()).iadd(t));if(D=D.umod(this.n),D.cmpn(0)!==0){var P=(_.getY().isOdd()?1:0)|(x.cmp(O)!==0?2:0);return a.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),P^=1),new zm({r:O,s:D,recoveryParam:P})}}}}}},"sign3"),"sign");Ei.prototype.verify=o(i(function(t,r,n,a,s){s||(s={}),t=this._truncateToN(t,!1,s.msgBitLength),n=this.keyFromPublic(n,a),r=new zm(r,"hex");var c=r.r,l=r.s;if(c.cmpn(1)<0||c.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var h=l.invm(this.n),p=h.mul(t).umod(this.n),g=h.mul(c).umod(this.n),v;return this.curve._maxwellTrick?(v=this.g.jmulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.eqXToP(c)):(v=this.g.mulAdd(p,n.getPublic(),g),v.isInfinity()?!1:v.getX().umod(this.n).cmp(c)===0)},"verify3"),"verify");Ei.prototype.recoverPubKey=function(e,t,r,n){wc((3&r)===r,"The recovery param is more than two bits"),t=new zm(t,n);var a=this.n,s=new Mt.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 g=t.r.invm(a),v=a.sub(s).mul(g).umod(a),y=l.mul(g).umod(a);return this.g.mulAdd(v,c,y)};Ei.prototype.getKeyRecoveryParam=function(e,t,r,n){if(t=new zm(t,n),t.recoveryParam!==null)return t.recoveryParam;for(var a=0;a<4;a++){var s;try{s=this.recoverPubKey(e,t,a)}catch{continue}if(s.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var nH=$c(function(e,t){"use strict";var r=t;r.version="6.6.1",r.utils=Si,r.rand=function(){throw new Error("unsupported")},r.curve=C0,r.curves=M0,r.ec=rH,r.eddsa=null}),iH=nH.ec,aH="signing-key/5.8.0",Ub=new br(aH),ib=null;function fa(){return ib||(ib=new iH("secp256k1")),ib}i(fa,"getCurve");o(fa,"getCurve");var yM=i(class{constructor(e){Bu(this,"curve","secp256k1"),Bu(this,"privateKey",Nn(e)),oM(this.privateKey)!==32&&Ub.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=fa().keyFromPrivate(qr(this.privateKey));Bu(this,"publicKey","0x"+t.getPublic(!1,"hex")),Bu(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Bu(this,"_isSigningKey",!0)}_addPoint(e){let t=fa().keyFromPublic(qr(this.publicKey)),r=fa().keyFromPublic(qr(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=fa().keyFromPrivate(qr(this.privateKey)),r=qr(e);r.length!==32&&Ub.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return Z6({recoveryParam:n.recoveryParam,r:Tc("0x"+n.r.toString(16),32),s:Tc("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=fa().keyFromPrivate(qr(this.privateKey)),r=fa().keyFromPublic(qr(n2(e)));return Tc("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}},"SigningKey");o(yM,"SigningKey");function bM(e,t){let r=Z6(t),n={r:qr(r.r),s:qr(r.s)};return"0x"+fa().recoverPubKey(qr(e),n,r.recoveryParam).encode("hex",!1)}i(bM,"recoverPublicKey");o(bM,"recoverPublicKey");function n2(e,t){let r=qr(e);if(r.length===32){let n=new yM(r);return t?"0x"+fa().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}else{if(r.length===33)return t?Nn(r):"0x"+fa().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return t?"0x"+fa().keyFromPublic(r).getPublic(!0,"hex"):Nn(r)}return Ub.throwArgumentError("invalid public or private key","key","[REDACTED]")}i(n2,"computePublicKey");o(n2,"computePublicKey");var oH="transactions/5.8.0",WY=new br(oH),JA;(function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"})(JA||(JA={}));function wM(e){let t=n2(e);return lM(Nb($m(Nb(t,1)),12))}i(wM,"computeAddress");o(wM,"computeAddress");function _M(e,t){return wM(bM(qr(e),t))}i(_M,"recoverAddress");o(_M,"recoverAddress");var sH="wallet/5.8.0",JY=new br(sH);function Fb(e,t){return _M(pM(e),t)}i(Fb,"verifyMessage");o(Fb,"verifyMessage");function EM(){return{eip191:async(e,t)=>{AM(e,t)}}}i(EM,"getEIP191Verifier");o(EM,"getEIP191Verifier");var cH=new Date("2022-09-20").valueOf();function AM(e,t){W6(e),tM(e,t);let n=[Fb(Db.fromCacao(e).toMessage(),e.s.s).toLowerCase()];if(Date.parse(e.p.iat)<=cH){let s=Fb(QC(Db.fromCacao(e),"Ethereum"),e.s.s).toLowerCase();n.push(s)}let a=id.parse(e.p.iss.replace("did:pkh:","")).address.toLowerCase();if(!n.includes(a))throw new Error("Signature does not belong to issuer")}i(AM,"verifyEIP191Signature");o(AM,"verifyEIP191Signature");Ed();b6();var uH=ir(cl(),1);Ed();function SM(){return Ir((0,uH.randomBytes)(16),"base64")}i(SM,"randomString");o(SM,"randomString");var xM="base64pad",TM="base64url";function CM(e){return Ir(e,xM)}i(CM,"encodeBase64");o(CM,"encodeBase64");function MM(e){return Ir(e,TM)}i(MM,"encodeBase64Url");o(MM,"encodeBase64Url");function IM(e){return Cr(e,xM)}i(IM,"decodeBase64");o(IM,"decodeBase64");function D0(e){return JSON.parse(Ir(Cr(e,TM)))}i(D0,"base64urlToJSON");o(D0,"base64urlToJSON");function kM(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(kM,"fromDagJWS");o(kM,"fromDagJWS");function DM(e,t){if(t){let r=t.toISOString().split(".")[0]+"Z";return`${e}?versionTime=${r}`}else return e}i(DM,"didWithTime");o(DM,"didWithTime");function RM(e){return e?Array.isArray(e)?e:[e]:[]}i(RM,"extractControllers");o(RM,"extractControllers");var lH={...EM()};function OM(e){return"registry"in e&&"cache"in e}i(OM,"isResolver");o(OM,"isResolver");var NM=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 NM({provider:this._client?.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(this._client==null)this._client=new Ib(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=OM(e)?e:new Gx(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=SM(),a=await this._client.request("did_authenticate",{nonce:n,aud:r,paths:t}),{kid:s}=await this.verifyJWS(a),c=D0(a.payload);if(!s.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 a=await X0.fromCacao(this._capability),s=$t.asCID(a.cid);if(!s)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://${s?.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 RC(e),a=MM(r.bytes);Object.assign(t,{linkedBlock:CM(n)});let s=await this.createJWS(a,t),c=$t.asCID(r);if(!c)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(s.link=c,this._capability){let l=await X0.fromCacao(this._capability);return{jws:s,linkedBlock:n,cacaoBlock:l.bytes}}return{jws:s,linkedBlock:n}}async verifyJWS(e,t={}){t=Object.assign({verifiers:lH},t),typeof e!="string"&&(e=kM(e));let r=D0(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 g=t.revocationPhaseOutSecs?t.revocationPhaseOutSecs*1e3:0,v=new Date(h).valueOf()+g;if(!(t.atTime&&t.atTime.getTime()<v))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 s=n.didDocument?.id;if(t.issuer&&t.issuer===t.capability?.p.iss&&s===t.capability.p.aud){if(!t.verifiers)throw new Error("Registered verifiers needed for CACAO");await Y0.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!==s){let h=DM(t.issuer,t.atTime),g=(await this.resolve(h)).didDocument?.controller,v=RM(g);if(t.capability?.s&&t.capability.p.aud===s&&v.includes(t.capability.p.iss))await Y0.verify(t.capability,{atTime:t.atTime?t.atTime:void 0,revocationPhaseOutSecs:t.revocationPhaseOutSecs,verifiers:t.verifiers??{}});else if(!(s?v.includes(s):!1))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${r}`)}let c=n.didDocument?.verificationMethod||[];uT(e,c);let l;try{l=D0(e.split(".")[1])}catch{}return{kid:r,payload:l,didResolutionResult:n}}async createJWE(e,t,r={}){let n=await cz(t,this._resolver);return sz(e,n,r.protectedHeader,r.aad)}async createDagJWE(e,t,r={}){let n=await BC(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 IM(r)}async decryptDagJWE(e){let t=await this.decryptJWE(e);return LC(t)}async resolve(e){let t=await this._resolver.resolve(e);if(t.didResolutionMetadata.error){let{error:r,message:n}=t.didResolutionMetadata,a=n?`, ${n}`:"";throw new Error(`Failed to resolve ${e}: ${r}${a}`)}return t}constructor({provider:e,resolver:t={},resolverOptions:r,capability:n,parent:a}={}){if(e!=null&&(this._client=new Ib(e)),n){if(this._capability=n,this._parentId=this._capability.p.iss,a&&this._parentId!==a)throw new Error("Capability issuer and parent not equal")}else a&&(this._parentId=a);this.setResolver(t,r)}},"DID");o(NM,"DID");function fH(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(fH,"toUint8Array");o(fH,"toUint8Array");var ZA=ir(xm(),1);p6();var PM={};xr(PM,{keyToDidDoc:()=>BM});function BM(e,t){let r=`did:key:${t}`,n=`${r}#${t}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(BM,"keyToDidDoc");o(BM,"keyToDidDoc");var LM={};xr(LM,{keyToDidDoc:()=>FM});Ed();var dH=ir(_6(),1);function UM(e){let t=new Uint8Array(e.length+2);return t[0]=236,t[1]=1,t.set(e,2),`z${Ir(t,"base58btc")}`}i(UM,"encodeKey");o(UM,"encodeKey");function FM(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=(0,dH.convertPublicKeyToX25519)(e),s=`${r}#${UM(a)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:Ir(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:s,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:Ir(a,"base58btc")}]}}i(FM,"keyToDidDoc2");o(FM,"keyToDidDoc");var jM={};xr(jM,{keyToDidDoc:()=>eI,pubKeyBytesToXY:()=>s2});var $M={};xr($M,{ECPointDecompress:()=>JM});function zM(e){return e>=0?e:-e}i(zM,"n");o(zM,"n");function HM(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,a=1n,s=0n;for(;e!==0n;){let c=t/e,l=t%e,h=r-a*c,p=n-s*c;t=e,e=l,r=a,n=s,a=h,s=p}return{g:t,x:r,y:n}}i(HM,"r");o(HM,"r");function ad(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(ad,"e");o(ad,"e");function i2(e,t){let r=HM(ad(e,t),t);if(r.g!==1n)throw new RangeError(`${e.toString()} does not have inverse modulo ${t.toString()}`);return ad(r.x,t)}i(i2,"o");o(i2,"o");function qM(e,t,r){if(e.length!==t.length)throw new RangeError("The remainders and modulos arrays should have the same length");let n=r??t.reduce((a,s)=>a*s,1n);return t.reduce((a,s,c)=>{let l=n/s;return ad(a+l*i2(l,s)%n*e[c]%n,n)},0n)}i(qM,"i");o(qM,"i");function VM(e){return e.map(t=>t[0]**(t[1]-1n)*(t[0]-1n)).reduce((t,r)=>r*t,1n)}i(VM,"a");o(VM,"a");function Vu(e,t,r,n){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=ad(e,r),t<0n)return i2(Vu(e,zM(t),r,n),r);if(n!==void 0)return function(s,c,l,h){let p=h.map(y=>y[0]**y[1]),g=h.map(y=>VM([y])),v=g.map((y,_)=>Vu(s,c%y,p[_]));return qM(v,p,l)}(e,t,r,function(s){let c={};return s.forEach(l=>{if(typeof l=="bigint"||typeof l=="number"){let h=String(l);c[h]===void 0?c[h]={p:BigInt(l),k:1n}:c[h].k+=1n}else{let h=String(l[0]);c[h]===void 0?c[h]={p:BigInt(l[0]),k:BigInt(l[1])}:c[h].k+=BigInt(l[1])}}),Object.values(c).map(l=>[l.p,l.k])}(n));let a=1n;for(;t>0;)t%2n===1n&&(a=a*e%r),t/=2n,e=e**2n%r;return a}i(Vu,"s");o(Vu,"s");var Yn={};xr(Yn,{pubKeyBytesToHex:()=>KM,publicKeyHexToUint8ArrayPointPair:()=>a2,publicKeyIntToUint8ArrayPointPair:()=>o2,publicKeyIntToXY:()=>WM,publicKeyToXY:()=>GM,testHexString:()=>Hm,testUint8Array:()=>yl});m6();function KM(e){if(!yl(e))throw new TypeError("input must be a Uint8Array");return Ir(e,"base16")}i(KM,"pubKeyBytesToHex");o(KM,"pubKeyBytesToHex");function GM(e){if(!Hm(e))throw new TypeError("input must be string with characters 0-9,A-F,a-f");let t=a2(e),r=zu.encode(t.xOctet).slice(1),n=zu.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(GM,"publicKeyToXY");o(GM,"publicKeyToXY");function a2(e){if(!Hm(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=Cr(t,"base16"),a=Cr(r,"base16");return{xOctet:n,yOctet:a}}i(a2,"publicKeyHexToUint8ArrayPointPair");o(a2,"publicKeyHexToUint8ArrayPointPair");function Hm(e){let t=/^[A-Fa-f0-9]+$/i;return!!(t.exec(e)!==null&&t.test(e)&&typeof e=="string")}i(Hm,"testHexString");o(Hm,"testHexString");function yl(e){return e==null?!1:e.constructor===Uint8Array}i(yl,"testUint8Array");o(yl,"testUint8Array");function WM(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=o2(e),r=zu.encode(t.xOctet).slice(1),n=zu.encode(t.yOctet).slice(1);return{xm:r,ym:n}}i(WM,"publicKeyIntToXY");o(WM,"publicKeyIntToXY");function o2(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=Cr(t,"base10"),a=Cr(r,"base10");return{xOctet:n,yOctet:a}}i(o2,"publicKeyIntToUint8ArrayPointPair");o(o2,"publicKeyIntToUint8ArrayPointPair");function JM(e){if(!yl(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,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(JM,"ECPointDecompress");o(JM,"ECPointDecompress");var ZM={};xr(ZM,{ECPointDecompress:()=>YM});function YM(e){if(!yl(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,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(YM,"ECPointDecompress2");o(YM,"ECPointDecompress");var XM={};xr(XM,{ECPointDecompress:()=>QM});function QM(e){if(!yl(e))throw new TypeError("input must be a Uint8Array");let r=BigInt(2)**521n-1n,n=1093849038073734274511112390766805569936207598951683748994586394495953116150735016013708737573759623248592132296706313309438452531591012912142327488478985984n,a=(r+1n)/4n,s=BigInt(e[0]-2),c=e.subarray(1),l=BigInt(Ir(c,"base10")),h=l**3n-l*3n+n,p=Vu(h,a,r);return p%2n!==s&&(p=r-p),{x:l,y:p}}i(QM,"ECPointDecompress3");o(QM,"ECPointDecompress");function eI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=s2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-256",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(eI,"keyToDidDoc3");o(eI,"keyToDidDoc");function s2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e),r=t.length/2;if(r==64)return Yn.publicKeyToXY(t);if(r==65&&t.slice(0,2)=="04"){let n=t.slice(2);return Yn.publicKeyToXY(n)}if(r==33&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=$M.ECPointDecompress(n);return Yn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(s2,"pubKeyBytesToXY");o(s2,"pubKeyBytesToXY");var tI={};xr(tI,{keyToDidDoc:()=>rI,pubKeyBytesToXY:()=>c2});function rI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=c2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-384",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(rI,"keyToDidDoc4");o(rI,"keyToDidDoc");function c2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e),r=t.length/2;if(r==96)return Yn.publicKeyToXY(t);if(r==97&&t.slice(0,2)=="04"){let n=t.slice(2);return Yn.publicKeyToXY(n)}if(r==49&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let n=Cr(t,"base16"),a=ZM.ECPointDecompress(n);return Yn.publicKeyIntToXY(a)}throw new Error("Unexpected pubKeyBytes")}i(c2,"pubKeyBytesToXY2");o(c2,"pubKeyBytesToXY");var nI={};xr(nI,{keyToDidDoc:()=>iI,pubKeyBytesToXY:()=>u2});function iI(e,t){let r=`did:key:${t}`,n=`${r}#${t}`,a=u2(e);return{id:r,verificationMethod:[{id:n,type:"JsonWebKey2020",controller:r,publicKeyJwk:{kty:"EC",crv:"P-521",x:a.xm,y:a.ym}}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}i(iI,"keyToDidDoc5");o(iI,"keyToDidDoc");function u2(e){if(!Yn.testUint8Array(e))throw new TypeError("input must be a Uint8Array");let t=Yn.pubKeyBytesToHex(e);if(132<=t.length&&t.length<=134&&(t.slice(0,2)=="03"||t.slice(0,2)=="02")){let r=Cr(t,"base16"),n=XM.ECPointDecompress(r);return Yn.publicKeyIntToXY(n)}throw new Error("Unexpected pubKeyBytes")}i(u2,"pubKeyBytesToXY3");o(u2,"pubKeyBytesToXY");var hH="application/did+ld+json",YA="application/did+json",pH={231:PM,237:LM,4608:jM,4609:tI,4610:nI};function mH(){return{key:async(e,t,r,n)=>{let a=n.accept||YA,s={didResolutionMetadata:{contentType:a},didDocument:null,didDocumentMetadata:{}};try{let c=ua.decode(t.id),l=ZA.default.decode(c),h=c.slice(ZA.default.decode.bytes),p=await pH[l].keyToDidDoc(h,t.id);a===hH?(p["@context"]="https://w3id.org/did/v1",s.didDocument=p):a===YA?s.didDocument=p:(delete s.didResolutionMetadata.contentType,s.didResolutionMetadata.error="representationNotSupported")}catch(c){s.didResolutionMetadata.error="invalidDid",s.didResolutionMetadata.message=c.toString()}return s}}}i(mH,"getResolver");o(mH,"getResolver");var aI=ir(_6(),1),gH=ir(M$(),1),vH="base64pad";function jb(e){return JSON.parse((0,gH.default)(e))}i(jb,"toStableObject");o(jb,"toStableObject");function oI(e){let t=new Uint8Array(e.length+2);return t[0]=237,t[1]=1,t.set(e,2),`did:key:z${Ir(t,"base58btc")}`}i(oI,"encodeDID");o(oI,"encodeDID");function $b(e){let[t,r,n]=e.split(".");return{payload:r,signatures:[{protected:t,signature:n}]}}i($b,"toGeneralJWS");o($b,"toGeneralJWS");var XA=o(async(e,t,r,n={})=>{let a=`${t}#${t.split(":")[2]}`,s=iT(r),c=jb(Object.assign(n,{kid:a,alg:"EdDSA"}));return iz(typeof e=="string"?e:jb(e),s,c)},"sign"),yH={did_authenticate:async({did:e,secretKey:t},r)=>{let n=await XA({did:e,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},e,t);return $b(n)},did_createJWS:async({did:e,secretKey:t},r)=>{if(r.did.split("#")[0]!==e)throw new ws(4100,`Unknown DID: ${e}`);let a=await XA(r.payload,e,t,r.protected);return{jws:$b(a)}},did_decryptJWE:async({secretKey:e},t)=>{let r=vT((0,aI.convertSecretKeyToX25519)(e));try{let n=await oz(t.jwe,r);return{cleartext:Ir(n,vH)}}catch(n){throw new ws(-32e3,n.message)}}},bH=i(class{constructor(e){let{secretKey:t,publicKey:r}=(0,aI.generateKeyPairFromSeed)(e),n=oI(r),a=ZC(yH);this._handle=async s=>await a({did:n,secretKey:t},s)}get isDidProvider(){return!0}async send(e){return await this._handle(e)}},"Ed25519Provider");o(bH,"Ed25519Provider");var sI={};xr(sI,{JsonPatchError:()=>Ur,_areEquals:()=>Ku,applyOperation:()=>ms,applyPatch:()=>qm,applyReducer:()=>uI,deepClone:()=>EH,getValueByPointer:()=>od,validate:()=>f2,validator:()=>sd});var wH=function(){var e=o(function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var s in a)a.hasOwnProperty(s)&&(n[s]=a[s])},e(t,r)},"extendStatics");return function(t,r){e(t,r);function n(){this.constructor=t}i(n,"__"),o(n,"__"),t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),_H=Object.prototype.hasOwnProperty;function rm(e,t){return _H.call(e,t)}i(rm,"hasOwnProperty");o(rm,"hasOwnProperty");function nm(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 a in e)rm(e,a)&&n.push(a);return n}i(nm,"_objectKeys");o(nm,"_objectKeys");function Xn(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}i(Xn,"_deepClone");o(Xn,"_deepClone");function im(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(im,"isInteger2");o(im,"isInteger");function hs(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}i(hs,"escapePathComponent");o(hs,"escapePathComponent");function l2(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}i(l2,"unescapePathComponent");o(l2,"unescapePathComponent");function am(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(am(e[t]))return!0}else if(typeof e=="object"){for(var n=nm(e),a=n.length,s=0;s<a;s++)if(am(e[n[s]]))return!0}}return!1}i(am,"hasUndefined");o(am,"hasUndefined");function zb(e,t){var r=[e];for(var n in t){var a=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof a<"u"&&r.push(n+": "+a)}return r.join(`
843
+ `)}i(zb,"patchErrorMessageFormatter");o(zb,"patchErrorMessageFormatter");var cI=function(e){wH(t,e);function t(r,n,a,s,c){var l=this.constructor,h=e.call(this,zb(r,{name:n,index:a,operation:s,tree:c}))||this;return h.name=n,h.index=a,h.operation=s,h.tree=c,Object.setPrototypeOf(h,l.prototype),h.message=zb(r,{name:n,index:a,operation:s,tree:c}),h}return i(t,"PatchError2"),o(t,"PatchError"),t}(Error),Ur=cI,EH=Xn,Uu={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=od(r,this.path);n&&(n=Xn(n));var a=ms(r,{op:"remove",path:this.from}).removed;return ms(r,{op:"add",path:this.path,value:a}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=od(r,this.from);return ms(r,{op:"add",path:this.path,value:Xn(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Ku(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},AH={add:function(e,t,r){return im(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:Uu.move,copy:Uu.copy,test:Uu.test,_get:Uu._get};function od(e,t){if(t=="")return e;var r={op:"_get",path:t};return ms(e,r),r.value}i(od,"getValueByPointer");o(od,"getValueByPointer");function ms(e,t,r,n,a,s){if(r===void 0&&(r=!1),n===void 0&&(n=!0),a===void 0&&(a=!0),s===void 0&&(s=0),r&&(typeof r=="function"?r(t,0,e,t.path):sd(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=od(e,t.from),t.op==="move"&&(c.removed=e),c;if(t.op==="test"){if(c.test=Ku(e,t.value),c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,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 Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",s,t,e);return c}}else{n||(e=Xn(e));var l=t.path||"",h=l.split("/"),p=e,g=1,v=h.length,y=void 0,_=void 0,x=void 0;for(typeof r=="function"?x=r:x=sd;;){if(_=h[g],_&&_.indexOf("~")!=-1&&(_=l2(_)),a&&(_=="__proto__"||_=="prototype"&&g>0&&h[g-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[_]===void 0?y=h.slice(0,g).join("/"):g==v-1&&(y=t.path),y!==void 0&&x(t,0,e,y)),g++,Array.isArray(p)){if(_==="-")_=p.length;else{if(r&&!im(_))throw new Ur("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",s,t,e);im(_)&&(_=~~_)}if(g>=v){if(r&&t.op==="add"&&_>p.length)throw new Ur("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",s,t,e);var c=AH[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}}else if(g>=v){var c=Uu[t.op].call(t,p,_,e);if(c.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",s,t,e);return c}if(p=p[_],r&&g<v&&(!p||typeof p!="object"))throw new Ur("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",s,t,e)}}}i(ms,"applyOperation");o(ms,"applyOperation");function qm(e,t,r,n,a){if(n===void 0&&(n=!0),a===void 0&&(a=!0),r&&!Array.isArray(t))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=Xn(e));for(var s=new Array(t.length),c=0,l=t.length;c<l;c++)s[c]=ms(e,t[c],r,!0,a,c),e=s[c].newDocument;return s.newDocument=e,s}i(qm,"applyPatch");o(qm,"applyPatch");function uI(e,t,r){var n=ms(e,t);if(n.test===!1)throw new Ur("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}i(uI,"applyReducer");o(uI,"applyReducer");function sd(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new Ur("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(Uu[e.op]){if(typeof e.path!="string")throw new Ur("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new Ur('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 Ur("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 Ur("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")&&am(e.value))throw new Ur("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 a=e.path.split("/").length,s=n.split("/").length;if(a!==s+1&&a!==s)throw new Ur("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 Ur("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=f2([c],r);if(l&&l.name==="OPERATION_PATH_UNRESOLVABLE")throw new Ur("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new Ur("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}i(sd,"validator");o(sd,"validator");function f2(e,t,r){try{if(!Array.isArray(e))throw new Ur("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)qm(Xn(t),Xn(e),r||!0);else{r=r||sd;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(a){if(a instanceof Ur)return a;throw a}}i(f2,"validate5");o(f2,"validate");function Ku(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),a,s,c;if(r&&n){if(s=e.length,s!=t.length)return!1;for(a=s;a--!==0;)if(!Ku(e[a],t[a]))return!1;return!0}if(r!=n)return!1;var l=Object.keys(e);if(s=l.length,s!==Object.keys(t).length)return!1;for(a=s;a--!==0;)if(!t.hasOwnProperty(l[a]))return!1;for(a=s;a--!==0;)if(c=l[a],!Ku(e[c],t[c]))return!1;return!0}return e!==e&&t!==t}i(Ku,"_areEquals");o(Ku,"_areEquals");var lI={};xr(lI,{compare:()=>gI,generate:()=>om,observe:()=>mI,unobserve:()=>pI});var d2=new WeakMap,SH=function(){function e(t){this.observers=new Map,this.obj=t}return i(e,"Mirror2"),o(e,"Mirror"),e}(),xH=function(){function e(t,r){this.callback=t,this.observer=r}return i(e,"ObserverInfo2"),o(e,"ObserverInfo"),e}();function fI(e){return d2.get(e)}i(fI,"getMirror");o(fI,"getMirror");function dI(e,t){return e.observers.get(t)}i(dI,"getObserverFromMirror");o(dI,"getObserverFromMirror");function hI(e,t){e.observers.delete(t.callback)}i(hI,"removeObserverFromMirror");o(hI,"removeObserverFromMirror");function pI(e,t){t.unobserve()}i(pI,"unobserve");o(pI,"unobserve");function mI(e,t){var r=[],n,a=fI(e);if(!a)a=new SH(e),d2.set(e,a);else{var s=dI(a,t);n=s&&s.observer}if(n)return n;if(n={},a.value=Xn(e),t){n.callback=t,n.next=null;var c=o(function(){om(n)},"dirtyCheck"),l=o(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(){om(n),clearTimeout(n.next),hI(a,n),typeof window<"u"&&(window.removeEventListener("mouseup",l),window.removeEventListener("keyup",l),window.removeEventListener("mousedown",l),window.removeEventListener("keydown",l),window.removeEventListener("change",l))},a.observers.set(t,new xH(t,n)),n}i(mI,"observe");o(mI,"observe");function om(e,t){t===void 0&&(t=!1);var r=d2.get(e.object);Vm(r.value,e.object,e.patches,"",t),e.patches.length&&qm(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}i(om,"generate2");o(om,"generate");function Vm(e,t,r,n,a){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var s=nm(t),c=nm(e),l=!1,h=!1,p=c.length-1;p>=0;p--){var g=c[p],v=e[g];if(rm(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var y=t[g];typeof v=="object"&&v!=null&&typeof y=="object"&&y!=null&&Array.isArray(v)===Array.isArray(y)?Vm(v,y,r,n+"/"+hs(g),a):v!==y&&(l=!0,a&&r.push({op:"test",path:n+"/"+hs(g),value:Xn(v)}),r.push({op:"replace",path:n+"/"+hs(g),value:Xn(y)}))}else Array.isArray(e)===Array.isArray(t)?(a&&r.push({op:"test",path:n+"/"+hs(g),value:Xn(v)}),r.push({op:"remove",path:n+"/"+hs(g)}),h=!0):(a&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),l=!0)}if(!(!h&&s.length==c.length))for(var p=0;p<s.length;p++){var g=s[p];!rm(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+hs(g),value:Xn(t[g])})}}}i(Vm,"_generate");o(Vm,"_generate");function gI(e,t,r){r===void 0&&(r=!1);var n=[];return Vm(e,t,n,"",r),n}i(gI,"compare3");o(gI,"compare");var vI=Object.assign({},sI,lI,{JsonPatchError:cI,deepClone:Xn,escapePathComponent:hs,unescapePathComponent:l2}),TH=ir(Sd(),1),CH=ir(cl(),1),ei;(function(e){e[e.PREFER_CACHE=0]="PREFER_CACHE",e[e.SYNC_ALWAYS=1]="SYNC_ALWAYS",e[e.NEVER_SYNC=2]="NEVER_SYNC"})(ei||(ei={}));var QA=ir(Sd(),1);Ga();_d();var yI={tile:0,"caip10-link":1,model:2,MID:3,UNLOADABLE:4};function bI(e){let t=yI[e];if(typeof t<"u")return t;throw new Error(`No stream type registered for name ${e}`)}i(bI,"codeByName");o(bI,"codeByName");function wI(e){let t=Object.entries(yI).find(([,r])=>r===e);if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}i(wI,"nameByCode");o(wI,"nameByCode");var Mo=i(class{},"StreamType");o(Mo,"StreamType");Mo.nameByCode=wI;Mo.codeByName=bI;var eS=ir(xm(),1);function Ji(e){let t,r,n;return typeof e=="object"?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(a,s,c)=>{if(c.value!=null)c.value=Hb(c.value,t,r,n);else if(c.get!=null)c.get=Hb(c.get,t,r,n);else throw"Only put a Memoize() decorator on a method or get accessor."}}i(Ji,"Memoize");o(Ji,"Memoize");var ab=new Map;function Hb(e,t,r=0,n){let a=Symbol("__memoized_map__");return function(...s){let c;this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let l=this[a];if(Array.isArray(n))for(let h of n)ab.has(h)?ab.get(h).push(l):ab.set(h,[l]);if(t||s.length>0||r>0){let h;t===!0?h=s.map(v=>v.toString()).join("!"):t?h=t.apply(this,s):h=s[0];let p=`${h}__timestamp`,g=!1;if(r>0)if(!l.has(p))g=!0;else{let v=l.get(p);g=Date.now()-v>r}l.has(h)&&!g?c=l.get(h):(c=e.apply(this,s),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,s),l.set(h,c))}return c}}i(Hb,"getNewFunction");o(Hb,"getNewFunction");var h2=206;Ga();_d();bm();var tS=ir(xm(),1);function kd(e){try{return e()}catch(t){return t}}i(kd,"tryCatch");o(kd,"tryCatch");Ga();var rS=ir(xm(),1);al();function Ec(e){let t=rS.default.decode(e),r=rS.default.decode.bytes,n=e.subarray(r);return[t,n,r]}i(Ec,"readVarint");o(Ec,"readVarint");function _I(e){return e===0||e===1}i(_I,"isCidVersion");o(_I,"isCidVersion");function qb(e){let[t,r]=Ec(e);if(!_I(t))throw new Error(`Unknown CID version ${t}`);let[n,a]=Ec(r),[,s,c]=Ec(a),[l,,h]=Ec(s),p=a.subarray(0,c+h+l),g=a.subarray(c+h+l);return[$t.create(t,n,v6(p)),g]}i(qb,"readCid");o(qb,"readCid");Ga();_d();function Dd(e,t="StreamRef"){let[r,n]=Ec(e);if(r!==h2)throw new Error(`Invalid ${t}, does not include streamid codec`);let[a,s]=Ec(n),c=qb(s),[l,h]=c;if(h.length===0)return{kind:"stream-id",type:a,genesis:l};if(h.length===1&&h[0]===0)return{kind:"commit-id",type:a,genesis:l,commit:null};{let[p]=qb(h);return{kind:"commit-id",type:a,genesis:l,commit:p}}}i(Dd,"fromBytes");o(Dd,"fromBytes");var MH=/(ceramic:\/\/|\/ceramic\/)?([a-zA-Z0-9]+)(\?commit=([a-zA-Z0-9]+))?/;function Km(e,t="StreamRef"){let r=MH.exec(e)||[],n=r[2];if(!n)throw new Error(`Malformed ${t} string: ${e}`);let a=Ts.decode(n),s=Dd(a),c=r[4];return c?{kind:"commit-id",type:s.type,genesis:s.genesis,commit:p2(s.genesis,c)}:s}i(Km,"fromString4");o(Km,"fromString");function EI(e){try{return typeof e=="string"?$t.parse(e):$t.asCID(e)}catch{return null}}i(EI,"parseCID");o(EI,"parseCID");function p2(e,t=null){if(!t||t==="0")return null;let r=EI(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(p2,"parseCommit");o(p2,"parseCommit");var Rd=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate"),Ki=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata"),AI=i(class extends Error{constructor(e){super(`Invalid StreamID bytes ${Ts.encode(e)}: contains commit`)}},"InvalidStreamIDBytesError");o(AI,"InvalidStreamIDBytesError");var SI=i(class extends Error{constructor(e){super(`Invalid StreamID string ${e}: contains commit`)}},"InvalidStreamIDStringError");o(SI,"InvalidStreamIDStringError");function m2(e){let t=Dd(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new AI(e)}i(m2,"fromBytes2");o(m2,"fromBytes");function xI(e){return kd(()=>m2(e))}i(xI,"fromBytesNoThrow");o(xI,"fromBytesNoThrow");function g2(e){let t=Km(e,"StreamID");if(t.kind==="stream-id")return new Xt(t.type,t.genesis);throw new SI(e)}i(g2,"fromString5");o(g2,"fromString");function TI(e){return kd(()=>g2(e))}i(TI,"fromStringNoThrow");o(TI,"fromStringNoThrow");var nS=Symbol.for("@ceramicnetwork/streamid/StreamID"),Xt=i(class{constructor(e,t){if(this._tag=nS,!(e||e===0))throw new Error("StreamID constructor: type required");if(!t)throw new Error("StreamID constructor: cid required");this._type=typeof e=="string"?Mo.codeByName(e):e,this._cid=typeof t=="string"?$t.parse(t):t}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===nS}static async fromGenesis(e,t){let r=await Mm({value:t,codec:fl,hasher:ol});return new Xt(e,r.cid)}get type(){return this._type}get typeName(){return Mo.nameByCode(this._type)}get cid(){return this._cid}get bytes(){let e=tS.default.encode(h2),t=tS.default.encode(this.type);return vs([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 Ts.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[Symbol.for("nodejs.util.inspect.custom")](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"StreamID");o(Xt,"StreamID");Xt.fromBytes=m2;Xt.fromBytesNoThrow=xI;Xt.fromString=g2;Xt.fromStringNoThrow=TI;Rd([Ji(),Ki("design:type",String),Ki("design:paramtypes",[])],Xt.prototype,"typeName",null);Rd([Ji(),Ki("design:type",Uint8Array),Ki("design:paramtypes",[])],Xt.prototype,"bytes",null);Rd([Ji(),Ki("design:type",Xt),Ki("design:paramtypes",[])],Xt.prototype,"baseID",null);Rd([Ji(),Ki("design:type",Function),Ki("design:paramtypes",[]),Ki("design:returntype",String)],Xt.prototype,"toString",null);Rd([Ji(),Ki("design:type",Function),Ki("design:paramtypes",[]),Ki("design:returntype",String)],Xt.prototype,"toUrl",null);var bl=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate2"),Qn=i(function(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)},"__metadata2"),ob=i(function(e,t,r,n,a){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!a:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?a.call(e,r):a?a.value=r:t.set(e,r),r},"__classPrivateFieldSet"),Eo=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"),Pu,vc,qf,CI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from bytes ${Ts.encode(e)}: no commit information provided`)}},"InvalidCommitIDBytesError");o(CI,"InvalidCommitIDBytesError");var MI=i(class extends Error{constructor(e){super(`Error while parsing CommitID from string ${e}: no commit information provided`)}},"InvalidCommitIDStringError");o(MI,"InvalidCommitIDStringError");function v2(e){let t=Dd(e,"CommitID");if(t.kind==="commit-id")return new Ar(t.type,t.genesis,t.commit);throw new CI(e)}i(v2,"fromBytes3");o(v2,"fromBytes");function II(e){return kd(()=>v2(e))}i(II,"fromBytesNoThrow2");o(II,"fromBytesNoThrow");function y2(e){let t=Km(e,"CommitID");if(t.kind==="commit-id")return new Ar(t.type,t.genesis,t.commit);throw new MI(e)}i(y2,"fromString6");o(y2,"fromString");function kI(e){return kd(()=>y2(e))}i(kI,"fromStringNoThrow2");o(kI,"fromStringNoThrow");var iS=Symbol.for("@ceramicnetwork/streamid/CommitID");function DI(e,t){return new Ar(e.type,e.cid,t)}i(DI,"make");o(DI,"make");var Ar=i(class{constructor(e,t,r=null){if(this._tag=iS,Pu.set(this,void 0),vc.set(this,void 0),qf.set(this,void 0),!e&&e!==0)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");ob(this,Pu,typeof e=="string"?Mo.codeByName(e):e,"f"),ob(this,vc,typeof t=="string"?$t.parse(t):t,"f"),ob(this,qf,p2(Eo(this,vc,"f"),r),"f")}static isInstance(e){return typeof e=="object"&&"_tag"in e&&e._tag===iS}get baseID(){return new Xt(Eo(this,Pu,"f"),Eo(this,vc,"f"))}get type(){return Eo(this,Pu,"f")}get typeName(){return Mo.nameByCode(Eo(this,Pu,"f"))}get cid(){return Eo(this,vc,"f")}get commit(){return Eo(this,qf,"f")||Eo(this,vc,"f")}get bytes(){let e=eS.default.encode(h2),t=eS.default.encode(this.type),r=Eo(this,qf,"f")?.bytes||new Uint8Array([0]);return vs([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 Ts.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Pu=new WeakMap,vc=new WeakMap,qf=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}},"CommitID");o(Ar,"CommitID");Ar.fromBytes=v2;Ar.fromBytesNoThrow=II;Ar.fromString=y2;Ar.fromStringNoThrow=kI;Ar.make=DI;bl([Ji(),Qn("design:type",Xt),Qn("design:paramtypes",[])],Ar.prototype,"baseID",null);bl([Ji(),Qn("design:type",String),Qn("design:paramtypes",[])],Ar.prototype,"typeName",null);bl([Ji(),Qn("design:type",$t),Qn("design:paramtypes",[])],Ar.prototype,"commit",null);bl([Ji(),Qn("design:type",Uint8Array),Qn("design:paramtypes",[])],Ar.prototype,"bytes",null);bl([Ji(),Qn("design:type",Function),Qn("design:paramtypes",[]),Qn("design:returntype",String)],Ar.prototype,"toString",null);bl([Ji(),Qn("design:type",Function),Qn("design:paramtypes",[]),Qn("design:returntype",String)],Ar.prototype,"toUrl",null);_d();var _s;(function(e){function t(a){let s=Dd(a);switch(s.kind){case"commit-id":return new Ar(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef bytes: ${Ts.encode(a)}`)}}i(t,"fromBytes4"),o(t,"fromBytes"),e.fromBytes=t;function r(a){let s=Km(a);switch(s.kind){case"commit-id":return new Ar(s.type,s.genesis,s.commit);case"stream-id":return new Xt(s.type,s.genesis);default:throw new Error(`Malformed StreamRef string: ${a}`)}}i(r,"fromString7"),o(r,"fromString"),e.fromString=r;function n(a){if(Xt.isInstance(a)||Ar.isInstance(a))return a;if(a instanceof Uint8Array)return t(a);if(typeof a=="string")return r(a);throw new Error(`Can not build CommitID or StreamID from ${JSON.stringify(a)}`)}i(n,"from4"),o(n,"from"),e.from=n})(_s||(_s={}));var Vb=o(function(e,t){return Vb=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},Vb(e,t)},"extendStatics");function Ya(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Vb(e,t);function r(){this.constructor=e}i(r,"__"),o(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}i(Ya,"__extends2");o(Ya,"__extends");function RI(e,t,r,n){function a(s){return s instanceof r?s:new r(function(c){c(s)})}return i(a,"adopt"),o(a,"adopt"),new(r||(r=Promise))(function(s,c){function l(g){try{p(n.next(g))}catch(v){c(v)}}i(l,"fulfilled"),o(l,"fulfilled");function h(g){try{p(n.throw(g))}catch(v){c(v)}}i(h,"rejected"),o(h,"rejected");function p(g){g.done?s(g.value):a(g.value).then(l,h)}i(p,"step"),o(p,"step"),p((n=n.apply(e,t||[])).next())})}i(RI,"__awaiter");o(RI,"__awaiter");function b2(e,t){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,a,s,c=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return c.next=l(0),c.throw=l(1),c.return=l(2),typeof Symbol=="function"&&(c[Symbol.iterator]=function(){return this}),c;function l(p){return function(g){return h([p,g])}}function h(p){if(n)throw new TypeError("Generator is already executing.");for(;c&&(c=0,p[0]&&(r=0)),r;)try{if(n=1,a&&(s=p[0]&2?a.return:p[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,p[1])).done)return s;switch(a=0,s&&(p=[p[0]&2,s.value]),p[0]){case 0:case 1:s=p;break;case 4:return r.label++,{value:p[1],done:!1};case 5:r.label++,a=p[1],p=[0];continue;case 7:p=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(p[0]===6||p[0]===2)){r=0;continue}if(p[0]===3&&(!s||p[1]>s[0]&&p[1]<s[3])){r.label=p[1];break}if(p[0]===6&&r.label<s[1]){r.label=s[1],s=p;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(p);break}s[2]&&r.ops.pop(),r.trys.pop();continue}p=t.call(e,r)}catch(g){p=[6,g],a=0}finally{n=s=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}i(b2,"__generator");o(b2,"__generator");function Ic(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}i(Ic,"__values");o(Ic,"__values");function Io(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),a,s=[],c;try{for(;(t===void 0||t-- >0)&&!(a=n.next()).done;)s.push(a.value)}catch(l){c={error:l}}finally{try{a&&!a.done&&(r=n.return)&&r.call(n)}finally{if(c)throw c.error}}return s}i(Io,"__read");o(Io,"__read");function Es(e,t,r){if(r||arguments.length===2)for(var n=0,a=t.length,s;n<a;n++)(s||!(n in t))&&(s||(s=Array.prototype.slice.call(t,0,n)),s[n]=t[n]);return e.concat(s||Array.prototype.slice.call(t))}i(Es,"__spreadArray");o(Es,"__spreadArray");function Cc(e){return this instanceof Cc?(this.v=e,this):new Cc(e)}i(Cc,"__await");o(Cc,"__await");function OI(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),a,s=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",c),a[Symbol.asyncIterator]=function(){return this},a;function c(_){return function(x){return Promise.resolve(x).then(_,v)}}function l(_,x){n[_]&&(a[_]=function(O){return new Promise(function(D,P){s.push([_,O,D,P])>1||h(_,O)})},x&&(a[_]=x(a[_])))}function h(_,x){try{p(n[_](x))}catch(O){y(s[0][3],O)}}function p(_){_.value instanceof Cc?Promise.resolve(_.value.v).then(g,v):y(s[0][2],_)}function g(_){h("next",_)}function v(_){h("throw",_)}function y(_,x){_(x),s.shift(),s.length&&h(s[0][0],s[0][1])}}i(OI,"__asyncGenerator");o(OI,"__asyncGenerator");function NI(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof Ic=="function"?Ic(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=e[s]&&function(c){return new Promise(function(l,h){c=e[s](c),a(l,h,c.done,c.value)})}}function a(s,c,l,h){Promise.resolve(h).then(function(p){s({value:p,done:l})},c)}}i(NI,"__asyncValues");o(NI,"__asyncValues");function Sr(e){return typeof e=="function"}i(Sr,"isFunction");o(Sr,"isFunction");function Gm(e){var t=o(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(Gm,"createErrorClass");o(Gm,"createErrorClass");var sb=Gm(function(e){return o(i(function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
844
844
  `+r.map(function(n,a){return a+1+") "+n.toString()}).join(`
845
- `):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl"),"UnsubscriptionErrorImpl")});function cd(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(cd,"arrRemove");o(cd,"arrRemove");var Od=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription2"),o(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Mc(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 g=this.initialTeardown;if(Sr(g))try{g()}catch(O){s=O instanceof sb?O.errors:[O]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Mc(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{Kb(x)}catch(O){s=s??[],O instanceof sb?s=_s(_s([],Io(s)),Io(O.errors)):s.push(O)}}}catch(O){n={error:O}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new sb(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Kb(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)&&cd(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&cd(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),PI=Od.EMPTY;function w2(e){return e instanceof Od||e&&"closed"in e&&Sr(e.remove)&&Sr(e.add)&&Sr(e.unsubscribe)}i(w2,"isSubscription");o(w2,"isSubscription");function Kb(e){Sr(e)?e():e.unsubscribe()}i(Kb,"execFinalizer");o(Kb,"execFinalizer");var Hc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},sm={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=sm.delegate;return a?.setTimeout?a.setTimeout.apply(a,_s([e,t],Io(r))):setTimeout.apply(void 0,_s([e,t],Io(r)))},clearTimeout:function(e){var t=sm.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function _2(e){sm.setTimeout(function(){var t=Hc.onUnhandledError;if(t)t(e);else throw e})}i(_2,"reportUnhandledError");o(_2,"reportUnhandledError");function Gb(){}i(Gb,"noop");o(Gb,"noop");var IH=function(){return Wm("C",void 0,void 0)}();function BI(e){return Wm("E",void 0,e)}i(BI,"errorNotification");o(BI,"errorNotification");function LI(e){return Wm("N",e,void 0)}i(LI,"nextNotification");o(LI,"nextNotification");function Wm(e,t,r){return{kind:e,value:t,error:r}}i(Wm,"createNotification");o(Wm,"createNotification");var Ec=null;function Yf(e){if(Hc.useDeprecatedSynchronousErrorHandling){var t=!Ec;if(t&&(Ec={errorThrown:!1,error:null}),e(),t){var r=Ec,n=r.errorThrown,a=r.error;if(Ec=null,n)throw a}}else e()}i(Yf,"errorContext");o(Yf,"errorContext");function UI(e){Hc.useDeprecatedSynchronousErrorHandling&&Ec&&(Ec.errorThrown=!0,Ec.error=e)}i(UI,"captureError");o(UI,"captureError");var E2=function(e){Ya(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,w2(r)&&r.add(n)):n.destination=RH,n}return i(t,"Subscriber2"),o(t,"Subscriber"),t.create=function(r,n,a){return new Wb(r,n,a)},t.prototype.next=function(r){this.isStopped?O0(LI(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?O0(BI(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?O0(IH,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}(Od),kH=Function.prototype.bind;function R0(e,t){return kH.call(e,t)}i(R0,"bind");o(R0,"bind");var DH=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver2"),o(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Wf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Wf(n)}else Wf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Wf(r)}},e}(),Wb=function(e){Ya(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Sr(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&Hc.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&R0(r.next,l),error:r.error&&R0(r.error,l),complete:r.complete&&R0(r.complete,l)}):c=r}return s.destination=new DH(c),s}return i(t,"SafeSubscriber2"),o(t,"SafeSubscriber"),t}(E2);function Wf(e){Hc.useDeprecatedSynchronousErrorHandling?UI(e):_2(e)}i(Wf,"handleUnhandledError");o(Wf,"handleUnhandledError");function FI(e){throw e}i(FI,"defaultErrorHandler");o(FI,"defaultErrorHandler");function O0(e,t){var r=Hc.onStoppedNotification;r&&sm.setTimeout(function(){return r(e,t)})}i(O0,"handleStoppedNotification");o(O0,"handleStoppedNotification");var RH={closed:!0,next:Gb,error:FI,complete:Gb},A2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Jm(e){return e}i(Jm,"identity3");o(Jm,"identity");function jI(e){return e.length===0?Jm:e.length===1?e[0]:o(i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped"),"piped")}i(jI,"pipeFromArray");o(jI,"pipeFromArray");var dn=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable2"),o(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 a=this,s=zI(t)?t:new Wb(t,r,n);return Yf(function(){var c=a,l=c.operator,h=c.source;s.add(l?l.call(s,h):h?a._subscribe(s):a._trySubscribe(s))}),s},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=Jb(r),new r(function(a,s){var c=new Wb({next:function(l){try{t(l)}catch(h){s(h),c.unsubscribe()}},error:s,complete:a});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[A2]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return jI(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Jb(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function Jb(e){var t;return(t=e??Hc.Promise)!==null&&t!==void 0?t:Promise}i(Jb,"getPromiseCtor");o(Jb,"getPromiseCtor");function $I(e){return e&&Sr(e.next)&&Sr(e.error)&&Sr(e.complete)}i($I,"isObserver");o($I,"isObserver");function zI(e){return e&&e instanceof E2||$I(e)&&w2(e)}i(zI,"isSubscriber");o(zI,"isSubscriber");function HI(e){return Sr(e?.lift)}i(HI,"hasLift");o(HI,"hasLift");function Xa(e){return function(t){if(HI(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(Xa,"operate");o(Xa,"operate");function ga(e,t,r,n,a){return new OH(e,t,r,n,a)}i(ga,"createOperatorSubscriber");o(ga,"createOperatorSubscriber");var OH=function(e){Ya(t,e);function t(r,n,a,s,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(g){r.error(g)}}:e.prototype._next,h._error=s?function(p){try{s(p)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,h._complete=a?function(){try{a()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,h}return i(t,"OperatorSubscriber2"),o(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}(E2),NH=Gm(function(e){return o(i(function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl"),"ObjectUnsubscribedErrorImpl")}),qI=function(e){Ya(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"),o(t,"Subject"),t.prototype.lift=function(r){var n=new aS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new NH},t.prototype.next=function(r){var n=this;Yf(function(){var a,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=Mc(n.currentObservers),l=c.next();!l.done;l=c.next()){var h=l.value;h.next(r)}}catch(p){a={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var n=this;Yf(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var a=n.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;Yf(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,a=this,s=a.hasError,c=a.isStopped,l=a.observers;return s||c?PI:(this.currentObservers=null,l.push(r),new Od(function(){n.currentObservers=null,cd(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,a=n.hasError,s=n.thrownError,c=n.isStopped;a?r.error(s):c&&r.complete()},t.prototype.asObservable=function(){var r=new dn;return r.source=this,r},t.create=function(r,n){return new aS(r,n)},t}(dn),aS=function(e){Ya(t,e);function t(r,n){var a=e.call(this)||this;return a.destination=r,a.source=n,a}return i(t,"AnonymousSubject2"),o(t,"AnonymousSubject"),t.prototype.next=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,r)},t.prototype.error=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.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,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&a!==void 0?a:PI},t}(qI),PH=function(e){Ya(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return i(t,"BehaviorSubject2"),o(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,a=r.thrownError,s=r._value;if(n)throw a;return this._throwIfClosed(),s},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(qI),VI={now:function(){return(VI.delegate||Date).now()},delegate:void 0},BH=function(e){Ya(t,e);function t(r,n){return e.call(this)||this}return i(t,"Action2"),o(t,"Action"),t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(Od),cm={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=cm.delegate;return a?.setInterval?a.setInterval.apply(a,_s([e,t],Io(r))):setInterval.apply(void 0,_s([e,t],Io(r)))},clearInterval:function(e){var t=cm.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},LH=function(e){Ya(t,e);function t(r,n){var a=e.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.pending=!1,a}return i(t,"AsyncAction2"),o(t,"AsyncAction"),t.prototype.schedule=function(r,n){var a;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,c=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(c,s,n)),this.pending=!0,this.delay=n,this.id=(a=this.id)!==null&&a!==void 0?a:this.requestAsyncId(c,this.id,n),this},t.prototype.requestAsyncId=function(r,n,a){return a===void 0&&(a=0),cm.setInterval(r.flush.bind(r,this),a)},t.prototype.recycleAsyncId=function(r,n,a){if(a===void 0&&(a=0),a!=null&&this.delay===a&&this.pending===!1)return n;n!=null&&cm.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var a=this._execute(r,n);if(a)return a;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var a=!1,s;try{this.work(r)}catch(c){a=!0,s=c||new Error("Scheduled action threw falsy error")}if(a)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,a=r.scheduler,s=a.actions;this.work=this.state=this.scheduler=null,this.pending=!1,cd(s,this),n!=null&&(this.id=this.recycleAsyncId(a,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(BH),oS=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return i(e,"Scheduler2"),o(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=VI.now,e}(),UH=function(e){Ya(t,e);function t(r,n){n===void 0&&(n=oS.now);var a=e.call(this,r,n)||this;return a.actions=[],a._active=!1,a}return i(t,"AsyncScheduler2"),o(t,"AsyncScheduler"),t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var a;this._active=!0;do if(a=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,a){for(;r=n.shift();)r.unsubscribe();throw a}},t}(oS),FH=new UH(LH),jH=FH,KI=new dn(function(e){return e.complete()});function S2(e){return e&&Sr(e.schedule)}i(S2,"isScheduler");o(S2,"isScheduler");function x2(e){return e[e.length-1]}i(x2,"last");o(x2,"last");function GI(e){return S2(x2(e))?e.pop():void 0}i(GI,"popScheduler");o(GI,"popScheduler");function WI(e,t){return typeof x2(e)=="number"?e.pop():t}i(WI,"popNumber");o(WI,"popNumber");var T2=o(function(e){return e&&typeof e.length=="number"&&typeof e!="function"},"isArrayLike");function C2(e){return Sr(e?.then)}i(C2,"isPromise");o(C2,"isPromise");function M2(e){return Sr(e[A2])}i(M2,"isInteropObservable");o(M2,"isInteropObservable");function I2(e){return Symbol.asyncIterator&&Sr(e?.[Symbol.asyncIterator])}i(I2,"isAsyncIterable");o(I2,"isAsyncIterable");function k2(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(k2,"createInvalidObservableTypeError");o(k2,"createInvalidObservableTypeError");function JI(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}i(JI,"getSymbolIterator");o(JI,"getSymbolIterator");var ZI=JI();function D2(e){return Sr(e?.[ZI])}i(D2,"isIterable");o(D2,"isIterable");function R2(e){return OI(this,arguments,o(i(function(){var r,n,a,s;return b2(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,Tc(r.read())];case 3:return n=c.sent(),a=n.value,s=n.done,s?[4,Tc(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Tc(a)];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(R2,"readableStreamLikeToAsyncGenerator");o(R2,"readableStreamLikeToAsyncGenerator");function O2(e){return Sr(e?.getReader)}i(O2,"isReadableStreamLike");o(O2,"isReadableStreamLike");function No(e){if(e instanceof dn)return e;if(e!=null){if(M2(e))return YI(e);if(T2(e))return XI(e);if(C2(e))return QI(e);if(I2(e))return N2(e);if(D2(e))return ek(e);if(O2(e))return tk(e)}throw k2(e)}i(No,"innerFrom");o(No,"innerFrom");function YI(e){return new dn(function(t){var r=e[A2]();if(Sr(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}i(YI,"fromInteropObservable");o(YI,"fromInteropObservable");function XI(e){return new dn(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}i(XI,"fromArrayLike");o(XI,"fromArrayLike");function QI(e){return new dn(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,_2)})}i(QI,"fromPromise");o(QI,"fromPromise");function ek(e){return new dn(function(t){var r,n;try{for(var a=Mc(e),s=a.next();!s.done;s=a.next()){var c=s.value;if(t.next(c),t.closed)return}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.complete()})}i(ek,"fromIterable");o(ek,"fromIterable");function N2(e){return new dn(function(t){rk(e,t).catch(function(r){return t.error(r)})})}i(N2,"fromAsyncIterable");o(N2,"fromAsyncIterable");function tk(e){return N2(R2(e))}i(tk,"fromReadableStreamLike");o(tk,"fromReadableStreamLike");function rk(e,t){var r,n,a,s;return RI(this,void 0,void 0,function(){var c,l;return b2(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),r=NI(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(),a={error:l},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}i(rk,"process2");o(rk,"process");function To(e,t,r,n,a){n===void 0&&(n=0),a===void 0&&(a=!1);var s=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!a)return s}i(To,"executeSchedule");o(To,"executeSchedule");function P2(e,t){return t===void 0&&(t=0),Xa(function(r,n){r.subscribe(ga(n,function(a){return To(n,e,function(){return n.next(a)},t)},function(){return To(n,e,function(){return n.complete()},t)},function(a){return To(n,e,function(){return n.error(a)},t)}))})}i(P2,"observeOn");o(P2,"observeOn");function B2(e,t){return t===void 0&&(t=0),Xa(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}i(B2,"subscribeOn");o(B2,"subscribeOn");function nk(e,t){return No(e).pipe(B2(t),P2(t))}i(nk,"scheduleObservable");o(nk,"scheduleObservable");function ik(e,t){return No(e).pipe(B2(t),P2(t))}i(ik,"schedulePromise");o(ik,"schedulePromise");function ak(e,t){return new dn(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}i(ak,"scheduleArray");o(ak,"scheduleArray");function ok(e,t){return new dn(function(r){var n;return To(r,t,function(){n=e[ZI](),To(r,t,function(){var a,s,c;try{a=n.next(),s=a.value,c=a.done}catch(l){r.error(l);return}c?r.complete():r.next(s)},0,!0)}),function(){return Sr(n?.return)&&n.return()}})}i(ok,"scheduleIterable");o(ok,"scheduleIterable");function L2(e,t){if(!e)throw new Error("Iterable cannot be null");return new dn(function(r){To(r,t,function(){var n=e[Symbol.asyncIterator]();To(r,t,function(){n.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}i(L2,"scheduleAsyncIterable");o(L2,"scheduleAsyncIterable");function sk(e,t){return L2(R2(e),t)}i(sk,"scheduleReadableStreamLike");o(sk,"scheduleReadableStreamLike");function ck(e,t){if(e!=null){if(M2(e))return nk(e,t);if(T2(e))return ak(e,t);if(C2(e))return ik(e,t);if(I2(e))return L2(e,t);if(D2(e))return ok(e,t);if(O2(e))return sk(e,t)}throw k2(e)}i(ck,"scheduled");o(ck,"scheduled");function uk(e,t){return t?ck(e,t):No(e)}i(uk,"from3");o(uk,"from");var lk=Gm(function(e){return o(i(function(){e(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl"),"EmptyErrorImpl")});function fk(e){return e instanceof Date&&!isNaN(e)}i(fk,"isValidDate");o(fk,"isValidDate");function U2(e,t){return Xa(function(r,n){var a=0;r.subscribe(ga(n,function(s){n.next(e.call(t,s,a++))}))})}i(U2,"map");o(U2,"map");var $H=Array.isArray;function dk(e,t){return $H(t)?e.apply(void 0,_s([],Io(t))):e(t)}i(dk,"callOrApply");o(dk,"callOrApply");function hk(e){return U2(function(t){return dk(e,t)})}i(hk,"mapOneOrManyArgs");o(hk,"mapOneOrManyArgs");function pk(e,t,r,n,a,s,c,l){var h=[],p=0,g=0,v=!1,y=o(function(){v&&!h.length&&!p&&t.complete()},"checkComplete"),_=o(function(O){return p<n?x(O):h.push(O)},"outerNext"),x=o(function(O){s&&t.next(O),p++;var D=!1;No(r(O,g++)).subscribe(ga(t,function(P){a?.(P),s?_(P):t.next(P)},function(){D=!0},void 0,function(){if(D)try{p--;for(var P=o(function(){var J=h.shift();c?To(t,c,function(){return x(J)}):x(J)},"_loop_1");h.length&&p<n;)P();y()}catch(J){t.error(J)}}))},"doInnerSub");return e.subscribe(ga(t,_,function(){v=!0,y()})),function(){l?.()}}i(pk,"mergeInternals");o(pk,"mergeInternals");function Zm(e,t,r){return r===void 0&&(r=1/0),Sr(t)?Zm(function(n,a){return U2(function(s,c){return t(n,s,a,c)})(No(e(n,a)))},r):(typeof t=="number"&&(r=t),Xa(function(n,a){return pk(n,a,e,r)}))}i(Zm,"mergeMap");o(Zm,"mergeMap");function mk(e){return e===void 0&&(e=1/0),Zm(Jm,e)}i(mk,"mergeAll");o(mk,"mergeAll");var zH=["addListener","removeListener"],HH=["addEventListener","removeEventListener"],qH=["on","off"];function um(e,t,r,n){if(Sr(r)&&(n=r,r=void 0),n)return um(e,t,r).pipe(hk(n));var a=Io(yk(e)?HH.map(function(l){return function(h){return e[l](t,h,r)}}):gk(e)?zH.map(Zb(e,t)):vk(e)?qH.map(Zb(e,t)):[],2),s=a[0],c=a[1];if(!s&&T2(e))return Zm(function(l){return um(l,t,r)})(No(e));if(!s)throw new TypeError("Invalid event target");return new dn(function(l){var h=o(function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];return l.next(1<p.length?p:p[0])},"handler");return s(h),function(){return c(h)}})}i(um,"fromEvent");o(um,"fromEvent");function Zb(e,t){return function(r){return function(n){return e[r](t,n)}}}i(Zb,"toCommonHandlerRegistry");o(Zb,"toCommonHandlerRegistry");function gk(e){return Sr(e.addListener)&&Sr(e.removeListener)}i(gk,"isNodeStyleEventEmitter");o(gk,"isNodeStyleEventEmitter");function vk(e){return Sr(e.on)&&Sr(e.off)}i(vk,"isJQueryStyleEventEmitter");o(vk,"isJQueryStyleEventEmitter");function yk(e){return Sr(e.addEventListener)&&Sr(e.removeEventListener)}i(yk,"isEventTarget");o(yk,"isEventTarget");function F2(e,t,r){e===void 0&&(e=0),r===void 0&&(r=jH);var n=-1;return t!=null&&(S2(t)?r=t:n=t),new dn(function(a){var s=fk(e)?+e-r.now():e;s<0&&(s=0);var c=0;return r.schedule(function(){a.closed||(a.next(c++),0<=n?this.schedule(void 0,n):a.complete())},s)})}i(F2,"timer");o(F2,"timer");function bk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=GI(e),n=WI(e,1/0),a=e;return a.length?a.length===1?No(a[0]):mk(n)(uk(a,r)):KI}i(bk,"merge");o(bk,"merge");function wk(e,t){return Xa(function(r,n){var a=0;r.subscribe(ga(n,function(s){return e.call(t,s,a++)&&n.next(s)}))})}i(wk,"filter");o(wk,"filter");function _k(e){return Xa(function(t,r){var n=!1;t.subscribe(ga(r,function(a){n=!0,r.next(a)},function(){n||r.next(e),r.complete()}))})}i(_k,"defaultIfEmpty");o(_k,"defaultIfEmpty");function Ek(e){return e<=0?function(){return KI}:Xa(function(t,r){var n=0;t.subscribe(ga(r,function(a){++n<=e&&(r.next(a),e<=n&&r.complete())}))})}i(Ek,"take");o(Ek,"take");function Ak(e){return e===void 0&&(e=Sk),Xa(function(t,r){var n=!1;t.subscribe(ga(r,function(a){n=!0,r.next(a)},function(){return n?r.complete():r.error(e())}))})}i(Ak,"throwIfEmpty");o(Ak,"throwIfEmpty");function Sk(){return new lk}i(Sk,"defaultErrorFactory");o(Sk,"defaultErrorFactory");function xk(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?wk(function(a,s){return e(a,s,n)}):Jm,Ek(1),r?_k(t):Ak(function(){return new lk}))}}i(xk,"first");o(xk,"first");function Tk(e,t){return Xa(function(r,n){var a=t??{},s=a.leading,c=s===void 0?!0:s,l=a.trailing,h=l===void 0?!1:l,p=!1,g=null,v=null,y=!1,_=o(function(){v?.unsubscribe(),v=null,h&&(D(),y&&n.complete())},"endThrottling"),x=o(function(){v=null,y&&n.complete()},"cleanupThrottling"),O=o(function(P){return v=No(e(P)).subscribe(ga(n,_,x))},"startThrottle"),D=o(function(){if(p){p=!1;var P=g;g=null,n.next(P),!y&&O(P)}},"send");r.subscribe(ga(n,function(P){p=!0,g=P,!(v&&!v.closed)&&(c?D():O(P))},function(){y=!0,!(h&&p&&v&&!v.closed)&&n.complete()}))})}i(Tk,"throttle");o(Tk,"throttle");var sS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(sS||(sS={}));var lm;(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"})(lm||(lm={}));var Yb;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Yb||(Yb={}));var Ym=i(class extends dn{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,QA.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Ar.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Ar.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Yb.ANCHOR).map(({cid:e})=>Ar.make(this.id,e))}get state(){return(0,QA.default)(this.state$.value)}async sync(e={}){e={sync:ei.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");o(Ym,"Stream");function Xm(){return e=>{}}i(Xm,"StreamStatic");o(Xm,"StreamStatic");var VH=ir(I$(),1);function Ck(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):(bk(...e.map(r=>um(r,"abort"))).pipe(xk()).subscribe(()=>{t.abort()}),t.signal)}i(Ck,"mergeAbortSignals");o(Ck,"mergeAbortSignals");var Mk=i(class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=F2(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}},"TimedAbortSignal");o(Mk,"TimedAbortSignal");async function Ik(e,t){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return e.addEventListener("abort",n),e.aborted&&r.abort(),t(r.signal).finally(()=>{e.removeEventListener("abort",n)})}i(Ik,"abortable2");o(Ik,"abortable");var KH=60*1e3*3;async function _i(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{...t.headers,"Content-Type":"application/json"}});let r=t.timeout||KH,n=new Mk(r),a=t.signal?Ck([t.signal,n.signal]):n.signal,s=await Ik(a,c=>(0,VH.default)(String(e),{...t,signal:c})).finally(()=>n.clear());if(!s.ok){let c=await s.text();throw new Error(`HTTP request to '${e}' failed with status '${s.statusText}': ${c}`)}return s.json()}i(_i,"fetchJson");o(_i,"fetchJson");var _0=ir(Sd(),1);Ga();function So(e){let t=$t.asCID(e);if(t)return t;if(typeof e=="string")return $t.parse(e);if(e instanceof Uint8Array)return $t.decode(e);throw new Error(`${e} cannot be converted to a CID`)}i(So,"toCID");o(So,"toCID");var cS=0,Hr=i(class{static streamIdFromState(e){return new Xt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,_0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Ir(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ir(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(e)&&(t.link=t.link.toString()),Hr.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=Ir(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,_0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=So(t.jws.link),t.linkedBlock=Cr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Cr(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(t)&&(t.link=So(t.link)),Hr.isAnchorCommit(t)&&(t.proof=So(t.proof)),t.id&&(t.id=So(t.id)),t.prev&&(t.prev=So(t.prev)),t.header?.model&&(t.header.model=Cr(t.header.model,"base64")),t)}static serializeState(e){let t=(0,_0.default)(e);return t.log=t.log.map(r=>({...r,cid:r.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=lm[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!=cS&&(t.metadata.unique=Ir(t.metadata.unique,"base64")),t.doctype=Mo.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,_0.default)(e);return t.doctype&&(t.type=Mo.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(r=>({...r,cid:So(r.cid)})),t.anchorProof&&(t.anchorProof.txHash=So(t.anchorProof.txHash),t.anchorProof.root=So(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=lm[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!=cS&&(t.metadata.unique=Cr(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Hr.serializeState(e))===JSON.stringify(Hr.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(Hr.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");o(Hr,"StreamUtils");var kk=i(class extends PH{next(e){let t=this.value;Hr.statesEqual(t,e)||super.next(e)}},"StreamStateSubject");o(kk,"StreamStateSubject");var GH=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate3"),bi,cb={anchor:!0,publish:!0,pin:!0,sync:ei.PREFER_CACHE},WH={sync:ei.PREFER_CACHE},uS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function N0(e,t){if(typeof e?.schema=="string")try{Ar.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=Ir((0,CH.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(N0,"headerFromMetadata");o(N0,"headerFromMetadata");async function Xb(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(Xb,"getAuthenticatedDID");o(Xb,"getAuthenticatedDID");async function P0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(P0,"throwReadOnlyError");o(P0,"throwReadOnlyError");var ko=bi=o(i(class extends Ym{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,TH.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...cb,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await bi.makeGenesis(s,r,n);return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...cb,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await bi._signDagJWS(t,r):r;return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...cb,...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 a=await bi.makeGenesis(t,null,r);return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...WH,...n};let a=ws.from(r);if(a.type!=bi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${bi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...uS,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...uS,...r};let a={header:N0(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await bi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=P0,this.patch=P0,this.sync=P0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return bi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=N0(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 a=vI.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await Xb(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 a=N0(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:a};return Um(c),c}let s={data:r,header:a};return bi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await Xb(t)).createDagJWS(r)}},"TileDocument2"),"TileDocument");ko.STREAM_TYPE_NAME="tile";ko.STREAM_TYPE_ID=0;ko=bi=GH([Xm()],ko);var JH=ir(k$(),1);function Dk(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(Dk,"_checkPrivateRedeclaration2");o(Dk,"_checkPrivateRedeclaration");function Rk(e,t){return t.get?t.get.call(e):t.value}i(Rk,"_classApplyDescriptorGet2");o(Rk,"_classApplyDescriptorGet");function Ok(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(Ok,"_classApplyDescriptorSet2");o(Ok,"_classApplyDescriptorSet");function j2(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(j2,"_classExtractFieldDescriptor2");o(j2,"_classExtractFieldDescriptor");function B0(e,t){var r=j2(e,t,"get");return Rk(e,r)}i(B0,"_classPrivateFieldGet2");o(B0,"_classPrivateFieldGet");function Qb(e,t,r){Dk(e,t),t.set(e,r)}i(Qb,"_classPrivateFieldInit2");o(Qb,"_classPrivateFieldInit");function e6(e,t,r){var n=j2(e,t,"set");return Ok(e,n,r),r}i(e6,"_classPrivateFieldSet2");o(e6,"_classPrivateFieldSet");function Nk(e){return typeof e=="string"||Ar.isInstance(e)||Xt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(Nk,"keyToQuery");o(Nk,"keyToQuery");function L0(e){return typeof e=="string"?ws.from(e).toString():Ar.isInstance(e)||Xt.isInstance(e)?e.toString():e.streamId.toString()}i(L0,"keyToString");o(L0,"keyToString");async function Pk(e){let t=await ko.makeGenesis({},null,{...e,deterministic:!0}),r=await Xt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(Pk,"getDeterministicQuery");o(Pk,"getDeterministicQuery");var ZH=o(()=>Promise.resolve([]),"tempBatchLoadFn"),E0=new WeakMap,ub=new WeakMap,YH=i(class extends JH.default{cache(e){if(!B0(this,ub))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,r){let n=await ko.create(B0(this,E0),e,t,r);return this.cache(n),n}async deterministic(e,t){let r=await Pk(e);try{return await super.load(r)}catch{let a=await ko.createFromGenesis(B0(this,E0),r.genesis,t);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,t,r,n){let a=L0(e);this.clear(a);let s=await this.load({streamId:a});return await s.update(t,r,n),s}constructor(e){super(ZH,{cache:!0,cacheKeyFn:L0,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Qb(this,E0,{writable:!0,value:void 0}),Qb(this,ub,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let r=await e.ceramic.multiQuery(t.map(Nk),e.multiqueryTimeout);return t.map(n=>{let a=L0(n),s=r[a];return s||new Error(`Failed to load stream: ${a}`)})},e6(this,E0,e.ceramic),e6(this,ub,!!e.cache)}},"TileLoader");o(YH,"TileLoader");function t6(e){return typeof e=="string"?Xt.fromString(e):e}i(t6,"typeStreamID");o(t6,"typeStreamID");function Bk(e,t){let r=new URL(e);for(let[n,a]of Object.entries(t))Xt.isInstance(a)?r.searchParams.set(n,a.toString()):typeof a=="object"?r.searchParams.set(n,JSON.stringify(a)):r.searchParams.set(n,a);return r}i(Bk,"serializeObjectToSearchParams");o(Bk,"serializeObjectToSearchParams");function r6(e){let t={};for(let[r,n]of Object.entries(e))Xt.isInstance(n)?t[r]=n.toString():t[r]=n;return t}i(r6,"serializeObjectForHttpPost");o(r6,"serializeObjectForHttpPost");var Vi=i(class extends dn{constructor(e,t,r){super(n=>{this.state$.observers.length===0&&(this.periodicSubscription=F2(0,r).pipe(Tk(()=>this._syncState(this.id,{sync:ei.PREFER_CACHE}))).subscribe()),this.state$.subscribe(n).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new kk(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 Vi._load(e,this._apiUrl,t);this.state$.next(Hr.deserializeState(r))}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,r,n,a){let s=new URL("./streams",e),{state:c}=await _i(s,{method:"post",body:{type:t,genesis:Hr.serializeCommit(r),opts:n}});return new Vi(Hr.deserializeState(c),e,a)}static async applyCommit(e,t,r,n,a){let s=new URL("./commits",e),{state:c}=await _i(s,{method:"post",body:{streamId:t.toString(),commit:Hr.serializeCommit(r),opts:n}});return new Vi(Hr.deserializeState(c),e,a)}static async _load(e,t,r){let n=Bk(new URL(`./streams/${e}`,t),r),{state:a}=await _i(n);return a}static async load(e,t,r,n){let a=await Vi._load(e,t,n);return new Vi(Hr.deserializeState(a),t,r)}static async loadStreamCommits(e,t){let r=new URL(`./commits/${e}`,t),{commits:n}=await _i(r);return n.map(a=>({cid:a.cid,value:Hr.deserializeCommit(a.value)}))}complete(){this.state$.complete()}},"Document");o(Vi,"Document");var ud;(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"})(ud||(ud={}));var lS=ir(Sd(),1),fS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(fS||(fS={}));var n6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(n6||(n6={}));var Lk=i(class extends dn{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,lS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Ar.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Ar.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===n6.ANCHOR).map(({cid:e})=>Ar.make(this.id,e))}get state(){return(0,lS.default)(this.state$.value)}async sync(e={}){e={sync:ud.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");o(Lk,"Stream");function Uk(){return e=>{}}i(Uk,"StreamStatic2");o(Uk,"StreamStatic");function Fk(e){if(typeof e=="string"&&e.includes("@")){let[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new id({address:t,chainId:r})}return new id(e)}i(Fk,"normalizeAccountId");o(Fk,"normalizeAccountId");var XH="(?:%[0-9a-fA-F]{2})",dS=`(?:[a-zA-Z0-9._-]|${XH})`,QH="([a-z0-9]+)",eq=`((?:${dS}*:)*(${dS}+))`,hS="[a-zA-Z0-9_.:%-]",tq=`;${hS}+=${hS}*`,rq=`((${tq})*)`,nq="(/[^#?]*)?",iq="([?][^#]*)?",aq="(#.*)?",oq=new RegExp(`^did:${QH}:${eq}${rq}${nq}${iq}${aq}$`);function jk(e){if(e===""||!e)return null;let t=e.match(oq);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 a of n){let s=a.split("=");r.params[s[0]]=s[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(jk,"parse2");o(jk,"parse");var sq=ir(Sd(),1),cq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate4"),yc,lb=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),pS={anchor:!1,publish:!0,sync:ud.PREFER_CACHE},fb={anchor:!0,publish:!0},uq={sync:ud.PREFER_CACHE},Gu=yc=o(i(class extends Lk{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,sq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(t,r,n={}){n={...pS,...n};let a=Fk(r),s=yc.makeGenesis(a);return yc.fromGenesis(t,s,n)}static async fromGenesis(t,r,n={}){return n={...pS,...n},t.createStreamFromGenesis(yc.STREAM_TYPE_ID,r,n)}async setDid(t,r,n={}){n={...fb,...n};let a=typeof t=="string"?t.trim():t.id;if(jk(a)?.did!==a)throw new Error(`DID is not valid: '${a}'`);let c=await r.createLink(a);return this.setDidProof(c,n)}async setDidProof(t,r={}){r={...fb,...r};let n=this.makeCommit(t),a=await this.api.applyCommit(this.id,n,r);this.state$.next(a.state)}async clearDid(t,r={}){r={...fb,...r};let n=await t.createLink("");return this.setDidProof(n,r)}static async load(t,r,n={}){n={...uq,...n};let a=ws.from(r);if(a.type!=yc.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${yc.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,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=lb,this.setDid=lb,this.sync=lb,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link2"),"Caip10Link");Gu.STREAM_TYPE_NAME="caip10-link";Gu.STREAM_TYPE_ID=1;Gu=yc=cq([Uk()],Gu);Ga();al();var lq=ir($$(),1),fq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate5"),$a,dq={sync:ei.PREFER_CACHE};async function i6(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(i6,"_ensureAuthenticated");o(i6,"_ensureAuthenticated");async function $k(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i($k,"throwReadOnlyError3");o($k,"throwReadOnlyError");var Ic=$a=o(i(class extends Ym{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:$a.MODEL}}static async create(t,r,n){$a.assertComplete(r);let a={publish:!0,anchor:!0,pin:!0,sync:ei.NEVER_SYNC,throwOnInvalidCommit:!0},s=await $a._makeGenesis(t,r,n);return await t.createStreamFromGenesis($a.STREAM_TYPE_ID,s,a)}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={...dq,...n};let a=ws.from(r);if(a.type!=$a.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${$a.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return await t.loadStream(a,n)}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return $a._signDagJWS(t,a)}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 i6(t),n={controller:t.did.hasParent?t.did.parent:t.did.id};else throw new Error("No controller specified");let a={controllers:[n.controller],model:$a.MODEL.bytes};return{data:r,header:a}}makeReadOnly(){this.sync=$k,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(t,r){return await i6(t),t.did.createDagJWS(r)}},"Model2"),"Model");Ic.STREAM_TYPE_NAME="model";Ic.STREAM_TYPE_ID=2;Ic.MODEL=function(){let e=Um("model-v1"),t=lq.default.encode(e,"identity"),r=Hu(W0,t),n=$t.createV1(W0,r);return new Xt("UNLOADABLE",n)}();Ic=$a=fq([Xm()],Ic);var hq=ir(cl(),1),pq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate6"),sa,mq={anchor:!0,publish:!0,pin:!0,sync:ei.NEVER_SYNC,syncTimeoutSeconds:0},gq={anchor:!1,publish:!1,pin:!0,sync:ei.PREFER_CACHE},vq={sync:ei.PREFER_CACHE},mS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function a6(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(a6,"_ensureAuthenticated2");o(a6,"_ensureAuthenticated");async function U0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(U0,"throwReadOnlyError4");o(U0,"throwReadOnlyError");var Wu=sa=o(i(class extends Ym{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,a={}){a={...mq,...a};let s=a.asDID?{did:a.asDID}:t,c=await sa._makeGenesis(s,r,n);return t.createStreamFromGenesis(sa.STREAM_TYPE_ID,c,a)}static async single(t,r,n={}){n={...gq,...n};let a=n.asDID?{did:n.asDID}:t;r={...r,deterministic:!0};let s=await sa._makeGenesis(a,null,r);return t.createStreamFromGenesis(sa.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={...vq,...n};let a=ws.from(r);if(a.type!=sa.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${sa.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async replace(t,r={}){r={...mS,...r};let n=r.asDID?{did:r.asDID}:this.api,a=await this._makeCommit(n,t),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}async patch(t,r={}){r={...mS,...r};let n={data:t,prev:this.tip,id:this.id.cid},a=await sa._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}makeReadOnly(){this.replace=U0,this.patch=U0,this.sync=U0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(t,r){let n=this._makeRawCommit(r);return sa._signDagJWS(t,n)}_makeRawCommit(t){return{data:vI.compare(this.content,t||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return n.deterministic?(Um(a),a):sa._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let a=n.controller;if(!a)if(t.did)await a6(t),a=t.did.hasParent?t.did.parent:t.did.id;else throw new Error("No controller specified");let s={controllers:[a],model:n.model.bytes};return n.deterministic||(s.unique=(0,hq.randomBytes)(12)),{data:r,header:s}}static async _signDagJWS(t,r){return await a6(t),t.did.createDagJWS(r)}},"ModelInstanceDocument2"),"ModelInstanceDocument");Wu.STREAM_TYPE_NAME="MID";Wu.STREAM_TYPE_ID=3;Wu=sa=pq([Xm()],Wu);var zk=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 _i(n,{method:"post",body:r})}async rm(e,t){let r=new URL(`./pins/${e}`,this._apiUrl);await _i(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 _i(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[a++],done:!1})}}}}}},"RemotePinApi");o(zk,"RemotePinApi");var Hk=i(class{constructor(e){this._fetchJson=_i,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:r6(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:r6(e)});return{edges:t.edges.map(n=>({cursor:n.cursor,node:Hr.deserializeState(n.node)})),pageInfo:t.pageInfo}}},"RemoteIndexApi");o(Hk,"RemoteIndexApi");var qk=i(class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=_i,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(s=>s.toString())}:void 0,a=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:n});return`${a.signatures[0].protected}.${a.payload}.${a.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");o(qk,"RemoteAdminApi");var yq="/api/v0/",bq="http://localhost:7007",wq={syncInterval:5e3},_q={anchor:!0,publish:!0,sync:ei.PREFER_CACHE},Eq={anchor:!0,publish:!0,sync:ei.PREFER_CACHE},gS={sync:ei.PREFER_CACHE},Aq=i(class{constructor(e=bq,t={}){this._config={...wq,...t},this._apiUrl=new URL(yq,e),this._streamCache=new Map,this.context={api:this},this.pin=new zk(this._apiUrl),this.index=new Hk(this._apiUrl);let r=(()=>this.did).bind(this);this.admin=new qk(this._apiUrl,r),this._streamConstructors={[Gu.STREAM_TYPE_ID]:Gu,[Ic.STREAM_TYPE_ID]:Ic,[Wu.STREAM_TYPE_ID]:Wu,[ko.STREAM_TYPE_ID]:ko}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,r={}){r={...Eq,...r};let n=await Vi.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),a=this._streamCache.get(n.id.toString());return a?(Hr.statesEqual(n.state,a.state)||a.next(n.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.id.toString(),n),this.buildStreamFromDocument(n))}async loadStream(e,t={}){t={...gS,...t};let r=ws.from(e),n=this._streamCache.get(r.baseID.toString());return n?await n._syncState(r,t):(n=await Vi.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(s=>({...s,streamId:typeof s.streamId=="string"?s.streamId:s.streamId.toString()})),n=new URL("./multiqueries",this._apiUrl),a=await _i(n,{method:"post",body:{queries:r,timeout:t}});return Object.entries(a).reduce((s,c)=>{let[l,h]=c,p=Hr.deserializeState(h),g=new Vi(p,this._apiUrl,this._config.syncInterval);return s[l]=this.buildStreamFromDocument(g),s},{})}loadStreamCommits(e){let t=t6(e);return Vi.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,r={}){r={..._q,...r};let n=t6(e),a=await Vi.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),s=this._streamCache.get(n.toString());return s?(s.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,t={}){t={...gS,...t};let{anchorStatus:r}=await _i(`${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 Vi(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 _i(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}},"CeramicClient");o(Aq,"CeramicClient");var nr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),o(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(nr||(nr={}));var rt=nr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),hs=o(e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},"getParsedType"),Ge=nr.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"]),Sq=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),za=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(a){return a.message},r={_errors:[]},n=o(a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let c=r,l=0;for(;l<s.path.length;){let h=s.path[l];l===s.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(t(s))):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,nr.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");o(za,"ZodError");za.create=e=>new za(e);var ld=o((e,t)=>{let r;switch(e.code){case Ge.invalid_type:e.received===rt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ge.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nr.jsonStringifyReplacer)}`;break;case Ge.unrecognized_keys:r=`Unrecognized key(s) in object: ${nr.joinValues(e.keys,", ")}`;break;case Ge.invalid_union:r="Invalid input";break;case Ge.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nr.joinValues(e.options)}`;break;case Ge.invalid_enum_value:r=`Invalid enum value. Expected ${nr.joinValues(e.options)}, received '${e.received}'`;break;case Ge.invalid_arguments:r="Invalid function arguments";break;case Ge.invalid_return_type:r="Invalid function return type";break;case Ge.invalid_date:r="Invalid date";break;case Ge.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}"`:nr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ge.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 Ge.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 Ge.custom:r="Invalid input";break;case Ge.invalid_intersection_types:r="Intersection results could not be merged";break;case Ge.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ge.not_finite:r="Number must be finite";break;default:r=t.defaultError,nr.assertNever(e)}return{message:r}},"errorMap"),Vk=ld;function Kk(e){Vk=e}i(Kk,"setErrorMap");o(Kk,"setErrorMap");function fd(){return Vk}i(fd,"getErrorMap");o(fd,"getErrorMap");var fm=o(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:a.message||l}},"makeIssue"),xq=[];function gt(e,t){let r=fm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,fd(),ld].filter(n=>!!n)});e.common.issues.push(r)}i(gt,"addIssueToContext");o(gt,"addIssueToContext");var Bn=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 Rt;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 Bn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:a,value:s}=n;if(a.status==="aborted"||s.status==="aborted")return Rt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),(typeof s.value<"u"||n.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},"ParseStatus");o(Bn,"ParseStatus");var Rt=Object.freeze({status:"aborted"}),Gk=o(e=>({status:"dirty",value:e}),"DIRTY"),xn=o(e=>({status:"valid",value:e}),"OK"),o6=o(e=>e.status==="aborted","isAborted"),s6=o(e=>e.status==="dirty","isDirty"),dm=o(e=>e.status==="valid","isValid"),hm=o(e=>typeof Promise!==void 0&&e instanceof Promise,"isAsync"),Jt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Jt||(Jt={}));var va=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");o(va,"ParseInputLazyPath");var vS=o((e,t)=>{if(dm(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new za(e.common.issues);return{success:!1,error:r}}},"handleResult");function zt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=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:a}:{errorMap:o((c,l)=>c.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:n??l.defaultError}:{message:r??l.defaultError},"customMap"),description:a}}i(zt,"processCreateParams");o(zt,"processCreateParams");var jt=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 hs(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bn,ctx:{common:e.parent.common,data:e.data,parsedType:hs(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(hm(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:hs(e)},a=this._parseSync({data:e,path:n.path,parent:n});return vS(n,a)}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:hs(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(hm(n)?n:Promise.resolve(n));return vS(r,a)}refine(e,t){let r=o(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,a)=>{let s=e(n),c=o(()=>a.addIssue({code:Ge.custom,...r(n)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(c(),!1)):s?!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 Gi({schema:this,typeName:Tt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ma.create(this)}nullable(){return As.create(this)}nullish(){return this.optional().nullable()}array(){return pa.create(this)}promise(){return Oc.create(this)}or(e){return Qu.create([this,e])}and(e){return el.create(this,e)}transform(e){return new Gi({schema:this,typeName:Tt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new il({innerType:this,defaultValue:t,typeName:Tt.ZodDefault})}brand(){return new z2({typeName:Tt.ZodBranded,type:this,...zt(void 0)})}catch(e){let t=typeof e=="function"?e:()=>e;return new gd({innerType:this,defaultValue:t,typeName:Tt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Nd.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");o(jt,"ZodType");var Tq=/^c[^\s-]{8,}$/i,Cq=/^([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,Mq=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Iq=o(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"),Do=i(class extends jt{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(n=>e.test(n),{validation:t,code:Ge.invalid_string,...Jt.errToObj(r)}),this.nonempty=e=>this.min(1,Jt.errToObj(e)),this.trim=()=>new Do({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rt.string){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.string,received:a.parsedType}),Rt}let r=new Bn,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,c=e.data.length<a.value;(s||c)&&(n=this._getOrReturnCtx(e,n),s?gt(n,{code:Ge.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&gt(n,{code:Ge.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Mq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"email",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Cq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"uuid",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Tq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"cuid",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),gt(n,{validation:"url",code:Ge.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"regex",code:Ge.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Iq(a).test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:"datetime",message:a.message}),r.dirty()):nr.assertNever(a);return{status:r.value,value:e.data}}_addCheck(e){return new Do({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jt.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,...Jt.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Jt.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Jt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Jt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Jt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Jt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Jt.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 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");o(Do,"ZodString");Do.create=e=>{var t;return new Do({checks:[],typeName:Tt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...zt(e)})};function Wk(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(Wk,"floatSafeRemainder");o(Wk,"floatSafeRemainder");var Es=i(class extends jt{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)!==rt.number){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.number,received:a.parsedType}),Rt}let r,n=new Bn;for(let a of this._def.checks)a.kind==="int"?nr.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Wk(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.not_finite,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Jt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jt.toString(t))}setLimit(e,t,r,n){return new Es({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Jt.toString(n)}]})}_addCheck(e){return new Es({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Jt.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")}},"ZodNumber");o(Es,"ZodNumber");Es.create=e=>new Es({checks:[],typeName:Tt.ZodNumber,coerce:e?.coerce||!1,...zt(e)});var Ju=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==rt.bigint){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.bigint,received:r.parsedType}),Rt}return xn(e.data)}},"ZodBigInt");o(Ju,"ZodBigInt");Ju.create=e=>{var t;return new Ju({typeName:Tt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...zt(e)})};var Zu=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==rt.boolean){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.boolean,received:r.parsedType}),Rt}return xn(e.data)}},"ZodBoolean");o(Zu,"ZodBoolean");Zu.create=e=>new Zu({typeName:Tt.ZodBoolean,coerce:e?.coerce||!1,...zt(e)});var kc=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rt.date){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.date,received:a.parsedType}),Rt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_date}),Rt}let r=new Bn,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):nr.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new kc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Jt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Jt.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");o(kc,"ZodDate");kc.create=e=>new kc({checks:[],coerce:e?.coerce||!1,typeName:Tt.ZodDate,...zt(e)});var dd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.symbol){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.symbol,received:r.parsedType}),Rt}return xn(e.data)}},"ZodSymbol");o(dd,"ZodSymbol");dd.create=e=>new dd({typeName:Tt.ZodSymbol,...zt(e)});var Yu=i(class extends jt{_parse(e){if(this._getType(e)!==rt.undefined){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.undefined,received:r.parsedType}),Rt}return xn(e.data)}},"ZodUndefined");o(Yu,"ZodUndefined");Yu.create=e=>new Yu({typeName:Tt.ZodUndefined,...zt(e)});var Xu=i(class extends jt{_parse(e){if(this._getType(e)!==rt.null){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.null,received:r.parsedType}),Rt}return xn(e.data)}},"ZodNull");o(Xu,"ZodNull");Xu.create=e=>new Xu({typeName:Tt.ZodNull,...zt(e)});var Dc=i(class extends jt{constructor(){super(...arguments),this._any=!0}_parse(e){return xn(e.data)}},"ZodAny");o(Dc,"ZodAny");Dc.create=e=>new Dc({typeName:Tt.ZodAny,...zt(e)});var ms=i(class extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xn(e.data)}},"ZodUnknown");o(ms,"ZodUnknown");ms.create=e=>new ms({typeName:Tt.ZodUnknown,...zt(e)});var Ha=i(class extends jt{_parse(e){let t=this._getOrReturnCtx(e);return gt(t,{code:Ge.invalid_type,expected:rt.never,received:t.parsedType}),Rt}},"ZodNever");o(Ha,"ZodNever");Ha.create=e=>new Ha({typeName:Tt.ZodNever,...zt(e)});var hd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.undefined){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.void,received:r.parsedType}),Rt}return xn(e.data)}},"ZodVoid");o(hd,"ZodVoid");hd.create=e=>new hd({typeName:Tt.ZodVoid,...zt(e)});var pa=i(class extends jt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==rt.array)return gt(t,{code:Ge.invalid_type,expected:rt.array,received:t.parsedType}),Rt;if(n.exactLength!==null){let s=t.data.length>n.exactLength.value,c=t.data.length<n.exactLength.value;(s||c)&&(gt(t,{code:s?Ge.too_big:Ge.too_small,minimum:c?n.exactLength.value:void 0,maximum:s?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&&(gt(t,{code:Ge.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&&(gt(t,{code:Ge.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((s,c)=>n.type._parseAsync(new va(t,s,t.path,c)))).then(s=>Bn.mergeArray(r,s));let a=t.data.map((s,c)=>n.type._parseSync(new va(t,s,t.path,c)));return Bn.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new pa({...this._def,minLength:{value:e,message:Jt.toString(t)}})}max(e,t){return new pa({...this._def,maxLength:{value:e,message:Jt.toString(t)}})}length(e,t){return new pa({...this._def,exactLength:{value:e,message:Jt.toString(t)}})}nonempty(e){return this.min(1,e)}},"ZodArray");o(pa,"ZodArray");pa.create=(e,t)=>new pa({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Tt.ZodArray,...zt(t)});var pm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(pm||(pm={}));var yS=o(e=>t=>new Dr({...e,shape:()=>({...e.shape(),...t})}),"AugmentFactory");function wc(e){if(e instanceof Dr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ma.create(wc(n))}return new Dr({...e._def,shape:()=>t})}else return e instanceof pa?pa.create(wc(e.element)):e instanceof ma?ma.create(wc(e.unwrap())):e instanceof As?As.create(wc(e.unwrap())):e instanceof qa?qa.create(e.items.map(t=>wc(t))):e}i(wc,"deepPartialify");o(wc,"deepPartialify");var Dr=i(class extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=yS(this._def),this.extend=yS(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=nr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==rt.object){let h=this._getOrReturnCtx(e);return gt(h,{code:Ge.invalid_type,expected:rt.object,received:h.parsedType}),Rt}let{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ha&&this._def.unknownKeys==="strip"))for(let h in n.data)s.includes(h)||c.push(h);let l=[];for(let h of s){let p=a[h],g=n.data[h];l.push({key:{status:"valid",value:h},value:p._parse(new va(n,g,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Ha){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&&(gt(n,{code:Ge.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 g=n.data[p];l.push({key:{status:"valid",value:p},value:h._parse(new va(n,g,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let p of l){let g=await p.key;h.push({key:g,value:await p.value,alwaysSet:p.alwaysSet})}return h}).then(h=>Bn.mergeObjectSync(r,h)):Bn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Jt.errToObj,new Dr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,a,s,c;let l=(s=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,r).message)!==null&&s!==void 0?s:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=Jt.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"})}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>pm.mergeShapes(this._def.shape(),e._def.shape()),typeName:Tt.ZodObject})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){let t={};return nr.objectKeys(e).map(r=>{this.shape[r]&&(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}omit(e){let t={};return nr.objectKeys(this.shape).map(r=>{nr.objectKeys(e).indexOf(r)===-1&&(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}deepPartial(){return wc(this)}partial(e){let t={};if(e)return nr.objectKeys(this.shape).map(r=>{nr.objectKeys(e).indexOf(r)===-1?t[r]=this.shape[r]:t[r]=this.shape[r].optional()}),new Dr({...this._def,shape:()=>t});for(let r in this.shape){let n=this.shape[r];t[r]=n.optional()}return new Dr({...this._def,shape:()=>t})}required(e){let t={};if(e)nr.objectKeys(this.shape).map(r=>{if(nr.objectKeys(e).indexOf(r)===-1)t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof ma;)a=a._def.innerType;t[r]=a}});else for(let r in this.shape){let a=this.shape[r];for(;a instanceof ma;)a=a._def.innerType;t[r]=a}return new Dr({...this._def,shape:()=>t})}keyof(){return $2(nr.objectKeys(this.shape))}},"ZodObject");o(Dr,"ZodObject");Dr.create=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strip",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});Dr.strictCreate=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strict",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});Dr.lazycreate=(e,t)=>new Dr({shape:e,unknownKeys:"strip",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});var Qu=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let s=a.map(c=>new za(c.ctx.common.issues));return gt(t,{code:Ge.invalid_union,unionErrors:s}),Rt}if(i(n,"handleResults"),o(n,"handleResults"),t.common.async)return Promise.all(r.map(async a=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let a,s=[];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"&&!a&&(a={result:p,ctx:h}),h.common.issues.length&&s.push(h.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let c=s.map(l=>new za(l));return gt(t,{code:Ge.invalid_union,unionErrors:c}),Rt}}get options(){return this._def.options}},"ZodUnion");o(Qu,"ZodUnion");Qu.create=(e,t)=>new Qu({options:e,typeName:Tt.ZodUnion,...zt(t)});var F0=o(e=>e instanceof tl?F0(e.schema):e instanceof Gi?F0(e.innerType()):e instanceof rl?[e.value]:e instanceof wl?e.options:e instanceof nl?Object.keys(e.enum):e instanceof il?F0(e._def.innerType):e instanceof Yu?[void 0]:e instanceof Xu?[null]:null,"getDiscriminator"),Qm=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.object)return gt(t,{code:Ge.invalid_type,expected:rt.object,received:t.parsedType}),Rt;let r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(gt(t,{code:Ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Rt)}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 a of t){let s=F0(a.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(n.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);n.set(c,a)}}return new Qm({typeName:Tt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...zt(r)})}},"ZodDiscriminatedUnion");o(Qm,"ZodDiscriminatedUnion");function mm(e,t){let r=hs(e),n=hs(t);if(e===t)return{valid:!0,data:e};if(r===rt.object&&n===rt.object){let a=nr.objectKeys(t),s=nr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let h=mm(e[l],t[l]);if(!h.valid)return{valid:!1};c[l]=h.data}return{valid:!0,data:c}}else if(r===rt.array&&n===rt.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],h=mm(c,l);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return r===rt.date&&n===rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(mm,"mergeValues");o(mm,"mergeValues");var el=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=o((a,s)=>{if(o6(a)||o6(s))return Rt;let c=mm(a.value,s.value);return c.valid?((s6(a)||s6(s))&&t.dirty(),{status:t.value,value:c.data}):(gt(r,{code:Ge.invalid_intersection_types}),Rt)},"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(([a,s])=>n(a,s)):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");o(el,"ZodIntersection");el.create=(e,t,r)=>new el({left:e,right:t,typeName:Tt.ZodIntersection,...zt(r)});var qa=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.array)return gt(r,{code:Ge.invalid_type,expected:rt.array,received:r.parsedType}),Rt;if(r.data.length<this._def.items.length)return gt(r,{code:Ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rt;!this._def.rest&&r.data.length>this._def.items.length&&(gt(r,{code:Ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=r.data.map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new va(r,s,r.path,c)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>Bn.mergeArray(t,s)):Bn.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new qa({...this._def,rest:e})}},"ZodTuple");o(qa,"ZodTuple");qa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qa({items:e,typeName:Tt.ZodTuple,rest:null,...zt(t)})};var pd=i(class extends jt{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!==rt.object)return gt(r,{code:Ge.invalid_type,expected:rt.object,received:r.parsedType}),Rt;let n=[],a=this._def.keyType,s=this._def.valueType;for(let c in r.data)n.push({key:a._parse(new va(r,c,r.path,c)),value:s._parse(new va(r,r.data[c],r.path,c))});return r.common.async?Bn.mergeObjectAsync(t,n):Bn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof jt?new pd({keyType:e,valueType:t,typeName:Tt.ZodRecord,...zt(r)}):new pd({keyType:Do.create(),valueType:e,typeName:Tt.ZodRecord,...zt(t)})}},"ZodRecord");o(pd,"ZodRecord");var md=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.map)return gt(r,{code:Ge.invalid_type,expected:rt.map,received:r.parsedType}),Rt;let n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([c,l],h)=>({key:n._parse(new va(r,c,r.path,[h,"key"])),value:a._parse(new va(r,l,r.path,[h,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of s){let h=await l.key,p=await l.value;if(h.status==="aborted"||p.status==="aborted")return Rt;(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 s){let h=l.key,p=l.value;if(h.status==="aborted"||p.status==="aborted")return Rt;(h.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(h.value,p.value)}return{status:t.value,value:c}}}},"ZodMap");o(md,"ZodMap");md.create=(e,t,r)=>new md({valueType:t,keyType:e,typeName:Tt.ZodMap,...zt(r)});var Rc=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.set)return gt(r,{code:Ge.invalid_type,expected:rt.set,received:r.parsedType}),Rt;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(gt(r,{code:Ge.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&&(gt(r,{code:Ge.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function s(l){let h=new Set;for(let p of l){if(p.status==="aborted")return Rt;p.status==="dirty"&&t.dirty(),h.add(p.value)}return{status:t.value,value:h}}i(s,"finalizeSet"),o(s,"finalizeSet");let c=[...r.data.values()].map((l,h)=>a._parse(new va(r,l,r.path,h)));return r.common.async?Promise.all(c).then(l=>s(l)):s(c)}min(e,t){return new Rc({...this._def,minSize:{value:e,message:Jt.toString(t)}})}max(e,t){return new Rc({...this._def,maxSize:{value:e,message:Jt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}},"ZodSet");o(Rc,"ZodSet");Rc.create=(e,t)=>new Rc({valueType:e,minSize:null,maxSize:null,typeName:Tt.ZodSet,...zt(t)});var ju=i(class extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.function)return gt(t,{code:Ge.invalid_type,expected:rt.function,received:t.parsedType}),Rt;function r(c,l){return fm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fd(),ld].filter(h=>!!h),issueData:{code:Ge.invalid_arguments,argumentsError:l}})}i(r,"makeArgsIssue"),o(r,"makeArgsIssue");function n(c,l){return fm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fd(),ld].filter(h=>!!h),issueData:{code:Ge.invalid_return_type,returnTypeError:l}})}i(n,"makeReturnsIssue"),o(n,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},s=t.data;return this._def.returns instanceof Oc?xn(async(...c)=>{let l=new za([]),h=await this._def.args.parseAsync(c,a).catch(v=>{throw l.addIssue(r(c,v)),l}),p=await s(...h);return await this._def.returns._def.type.parseAsync(p,a).catch(v=>{throw l.addIssue(n(p,v)),l})}):xn((...c)=>{let l=this._def.args.safeParse(c,a);if(!l.success)throw new za([r(c,l.error)]);let h=s(...l.data),p=this._def.returns.safeParse(h,a);if(!p.success)throw new za([n(h,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ju({...this._def,args:qa.create(e).rest(ms.create())})}returns(e){return new ju({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ju({args:e||qa.create([]).rest(ms.create()),returns:t||ms.create(),typeName:Tt.ZodFunction,...zt(r)})}},"ZodFunction");o(ju,"ZodFunction");var tl=i(class extends jt{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");o(tl,"ZodLazy");tl.create=(e,t)=>new tl({getter:e,typeName:Tt.ZodLazy,...zt(t)});var rl=i(class extends jt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return gt(t,{code:Ge.invalid_literal,expected:this._def.value}),Rt}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ZodLiteral");o(rl,"ZodLiteral");rl.create=(e,t)=>new rl({value:e,typeName:Tt.ZodLiteral,...zt(t)});function $2(e,t){return new wl({values:e,typeName:Tt.ZodEnum,...zt(t)})}i($2,"createZodEnum");o($2,"createZodEnum");var wl=i(class extends jt{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return gt(t,{expected:nr.joinValues(r),received:t.parsedType,code:Ge.invalid_type}),Rt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),r=this._def.values;return gt(t,{received:t.data,code:Ge.invalid_enum_value,options:r}),Rt}return xn(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}},"ZodEnum");o(wl,"ZodEnum");wl.create=$2;var nl=i(class extends jt{_parse(e){let t=nr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){let n=nr.objectValues(t);return gt(r,{expected:nr.joinValues(n),received:r.parsedType,code:Ge.invalid_type}),Rt}if(t.indexOf(e.data)===-1){let n=nr.objectValues(t);return gt(r,{received:r.data,code:Ge.invalid_enum_value,options:n}),Rt}return xn(e.data)}get enum(){return this._def.values}},"ZodNativeEnum");o(nl,"ZodNativeEnum");nl.create=(e,t)=>new nl({values:e,typeName:Tt.ZodNativeEnum,...zt(t)});var Oc=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.promise&&t.common.async===!1)return gt(t,{code:Ge.invalid_type,expected:rt.promise,received:t.parsedType}),Rt;let r=t.parsedType===rt.promise?t.data:Promise.resolve(t.data);return xn(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}},"ZodPromise");o(Oc,"ZodPromise");Oc.create=(e,t)=>new Oc({type:e,typeName:Tt.ZodPromise,...zt(t)});var Gi=i(class extends jt{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 s=n.transform(r.data);return r.common.async?Promise.resolve(s).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}let a={addIssue:s=>{gt(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="refinement"){let s=o(c=>{let l=n.refinement(c,a);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"?Rt:(c.status==="dirty"&&t.dirty(),s(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"?Rt:(c.status==="dirty"&&t.dirty(),s(c.value).then(()=>({status:t.value,value:c.value}))))}if(n.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!dm(s))return s;let c=n.transform(s.value,a);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(s=>dm(s)?Promise.resolve(n.transform(s.value,a)).then(c=>({status:t.value,value:c})):s);nr.assertNever(n)}},"ZodEffects");o(Gi,"ZodEffects");Gi.create=(e,t,r)=>new Gi({schema:e,typeName:Tt.ZodEffects,effect:t,...zt(r)});Gi.createWithPreprocess=(e,t,r)=>new Gi({schema:t,effect:{type:"preprocess",transform:e},typeName:Tt.ZodEffects,...zt(r)});var ma=i(class extends jt{_parse(e){return this._getType(e)===rt.undefined?xn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodOptional");o(ma,"ZodOptional");ma.create=(e,t)=>new ma({innerType:e,typeName:Tt.ZodOptional,...zt(t)});var As=i(class extends jt{_parse(e){return this._getType(e)===rt.null?xn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodNullable");o(As,"ZodNullable");As.create=(e,t)=>new As({innerType:e,typeName:Tt.ZodNullable,...zt(t)});var il=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}},"ZodDefault");o(il,"ZodDefault");il.create=(e,t)=>new il({innerType:e,typeName:Tt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});var gd=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.innerType._parse({data:t.data,path:t.path,parent:t});return hm(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()})):{status:"valid",value:r.status==="valid"?r.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}},"ZodCatch");o(gd,"ZodCatch");gd.create=(e,t)=>new gd({innerType:e,typeName:Tt.ZodCatch,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});var vd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.nan){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.nan,received:r.parsedType}),Rt}return{status:"valid",value:e.data}}},"ZodNaN");o(vd,"ZodNaN");vd.create=e=>new vd({typeName:Tt.ZodNaN,...zt(e)});var kq=Symbol("zod_brand"),z2=i(class extends jt{_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");o(z2,"ZodBranded");var Nd=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Rt:a.status==="dirty"?(t.dirty(),Gk(a.value)):this._def.out._parseAsync({data:a.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"?Rt: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 Nd({in:e,out:t,typeName:Tt.ZodPipeline})}},"ZodPipeline");o(Nd,"ZodPipeline");var Jk=o((e,t={},r)=>e?Dc.create().superRefine((n,a)=>{if(!e(n)){let s=typeof t=="function"?t(n):t,c=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...c,fatal:r})}}):Dc.create(),"custom"),Dq={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 Rq=o((e,t={message:`Input not instance of ${e.name}`})=>Jk(r=>r instanceof e,t,!0),"instanceOfType"),Zk=Do.create,Yk=Es.create,Oq=vd.create,Nq=Ju.create,Xk=Zu.create,Pq=kc.create,Bq=dd.create,Lq=Yu.create,Uq=Xu.create,Fq=Dc.create,jq=ms.create,$q=Ha.create,zq=hd.create,Hq=pa.create,qq=Dr.create,Vq=Dr.strictCreate,Kq=Qu.create,Gq=Qm.create,Wq=el.create,Jq=qa.create,Zq=pd.create,Yq=md.create,Xq=Rc.create,Qq=ju.create,eV=tl.create,tV=rl.create,rV=wl.create,nV=nl.create,iV=Oc.create,bS=Gi.create,aV=ma.create,oV=As.create,sV=Gi.createWithPreprocess,cV=Nd.create,uV=o(()=>Zk().optional(),"ostring"),lV=o(()=>Yk().optional(),"onumber"),fV=o(()=>Xk().optional(),"oboolean"),dV={string:e=>Do.create({...e,coerce:!0}),number:e=>Es.create({...e,coerce:!0}),boolean:e=>Zu.create({...e,coerce:!0}),bigint:e=>Ju.create({...e,coerce:!0}),date:e=>kc.create({...e,coerce:!0})},hV=Rt,H=Object.freeze({__proto__:null,defaultErrorMap:ld,setErrorMap:Kk,getErrorMap:fd,makeIssue:fm,EMPTY_PATH:xq,addIssueToContext:gt,ParseStatus:Bn,INVALID:Rt,DIRTY:Gk,OK:xn,isAborted:o6,isDirty:s6,isValid:dm,isAsync:hm,get util(){return nr},ZodParsedType:rt,getParsedType:hs,ZodType:jt,ZodString:Do,ZodNumber:Es,ZodBigInt:Ju,ZodBoolean:Zu,ZodDate:kc,ZodSymbol:dd,ZodUndefined:Yu,ZodNull:Xu,ZodAny:Dc,ZodUnknown:ms,ZodNever:Ha,ZodVoid:hd,ZodArray:pa,get objectUtil(){return pm},ZodObject:Dr,ZodUnion:Qu,ZodDiscriminatedUnion:Qm,ZodIntersection:el,ZodTuple:qa,ZodRecord:pd,ZodMap:md,ZodSet:Rc,ZodFunction:ju,ZodLazy:tl,ZodLiteral:rl,ZodEnum:wl,ZodNativeEnum:nl,ZodPromise:Oc,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:ma,ZodNullable:As,ZodDefault:il,ZodCatch:gd,ZodNaN:vd,BRAND:kq,ZodBranded:z2,ZodPipeline:Nd,custom:Jk,Schema:jt,ZodSchema:jt,late:Dq,get ZodFirstPartyTypeKind(){return Tt},coerce:dV,any:Fq,array:Hq,bigint:Nq,boolean:Xk,date:Pq,discriminatedUnion:Gq,effect:bS,enum:rV,function:Qq,instanceof:Rq,intersection:Wq,lazy:eV,literal:tV,map:Yq,nan:Oq,nativeEnum:nV,never:$q,null:Uq,nullable:oV,number:Yk,object:qq,oboolean:fV,onumber:lV,optional:aV,ostring:uV,pipeline:cV,preprocess:sV,promise:iV,record:Zq,set:Xq,strictObject:Vq,string:Zk,symbol:Bq,transformer:bS,tuple:Jq,undefined:Lq,union:Kq,unknown:jq,void:zq,NEVER:hV,ZodIssueCode:Ge,quotelessJson:Sq,ZodError:za}),pV=Object.defineProperty,mV=o((e,t)=>pV(e,"name",{value:t,configurable:!0}),"__name"),e1=H.array(H.string().or(H.record(H.any()))),eX=H.object({type:H.string().optional(),narrative:H.string().optional()}),t1=H.string().or(H.object({id:H.string(),type:H.string(),caption:H.string().optional()})),gV=H.object({type:H.string().min(1).or(H.string().array().nonempty()),latitude:H.number(),longitude:H.number()}),vV=H.object({type:H.string().min(1).or(H.string().array().nonempty()),addressCountry:H.string().optional(),addressCountryCode:H.string().optional(),addressRegion:H.string().optional(),addressLocality:H.string().optional(),streetAddress:H.string().optional(),postOfficeBoxNumber:H.string().optional(),postalCode:H.string().optional(),geo:gV.optional()}),yV=H.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(H.string()),Qk=H.object({type:H.string().min(1).or(H.string().array().nonempty()),identifier:H.string(),identifierType:yV}),yd=H.string().or(H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty().optional()),name:H.string().optional(),url:H.string().optional(),phone:H.string().optional(),description:H.string().optional(),endorsement:H.any().array().optional(),image:t1.optional(),email:H.string().email().optional(),address:vV.optional(),otherIdentifier:Qk.array().optional(),official:H.string().optional(),parentOrg:H.any().optional(),familyName:H.string().optional(),givenName:H.string().optional(),additionalName:H.string().optional(),patronymicName:H.string().optional(),honorificPrefix:H.string().optional(),honorificSuffix:H.string().optional(),familyNamePrefix:H.string().optional(),dateOfBirth:H.string().optional()}).catchall(H.any())),c6=H.object({id:H.string().optional()}).catchall(H.any()),A0=H.object({type:H.string(),id:H.string()}).catchall(H.any()),wS=H.object({id:H.string(),type:H.string()}).catchall(H.any()),_S=H.object({id:H.string().optional(),type:H.string()}).catchall(H.any()),ES=H.object({type:H.string(),id:H.string().optional()}).catchall(H.any()),AS=H.object({type:H.string().or(H.string().array().nonempty()),id:H.string().optional()}).catchall(H.any()),gm=H.object({"@context":e1,id:H.string().optional(),type:H.string().array().nonempty(),issuer:yd,credentialSubject:c6.or(c6.array()),refreshService:_S.or(_S.array()).optional(),credentialSchema:wS.or(wS.array()).optional(),issuanceDate:H.string().optional(),expirationDate:H.string().optional(),credentialStatus:A0.or(A0.array()).optional(),name:H.string().optional(),description:H.string().optional(),validFrom:H.string().optional(),validUntil:H.string().optional(),status:A0.or(A0.array()).optional(),termsOfUse:ES.or(ES.array()).optional(),evidence:AS.or(AS.array()).optional()}).catchall(H.any()),Va=H.object({type:H.string(),created:H.string(),challenge:H.string().optional(),domain:H.string().optional(),nonce:H.string().optional(),proofPurpose:H.string(),verificationMethod:H.string(),jws:H.string().optional()}).catchall(H.any()),SS=gm.extend({proof:Va.or(Va.array())}),bV=H.object({"@context":e1,id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),verifiableCredential:SS.or(SS.array()).optional(),holder:H.string().optional()}).catchall(H.any()),tX=bV.extend({proof:Va.or(Va.array())}),H2=H.object({kty:H.string(),crv:H.string(),x:H.string(),y:H.string().optional(),n:H.string().optional(),d:H.string().optional()}),rX=H2.omit({d:!0}).extend({d:H.string()}),wV=H.object({alg:H.string(),iv:H.string(),tag:H.string(),epk:H2.partial().optional(),kid:H.string().optional(),apv:H.string().optional(),apu:H.string().optional()}),_V=H.object({header:wV,encrypted_key:H.string()}),EV=H.object({protected:H.string(),iv:H.string(),ciphertext:H.string(),tag:H.string(),aad:H.string().optional(),recipients:_V.array().optional()}),vc=H.string().or(H.object({"@context":e1.optional(),id:H.string(),type:H.string(),controller:H.string(),publicKeyJwk:H2.optional(),publicKeyBase58:H.string().optional(),blockChainAccountId:H.string().optional()}).catchall(H.any())),AV=H.object({id:H.string(),type:H.string().or(H.string().array().nonempty()),serviceEndpoint:H.any().or(H.any().array().nonempty())}).catchall(H.any()),nX=H.object({"@context":e1,id:H.string(),alsoKnownAs:H.string().optional(),controller:H.string().or(H.string().array().nonempty()).optional(),verificationMethod:vc.array().optional(),authentication:vc.array().optional(),assertionMethod:vc.array().optional(),keyAgreement:vc.array().optional(),capabilityInvocation:vc.array().optional(),capabilityDelegation:vc.array().optional(),publicKey:vc.array().optional(),service:AV.array().optional(),proof:Va.or(Va.array()).optional()}).catchall(H.any()),SV=H.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(H.string()),r1=H.object({type:H.string().array().nonempty(),targetCode:H.string().optional(),targetDescription:H.string().optional(),targetName:H.string(),targetFramework:H.string().optional(),targetType:SV.optional(),targetUrl:H.string()}),xV=H.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"]),TV=xV.or(H.string()),CV=H.object({id:H.string().optional(),narrative:H.string().optional()}).catchall(H.any()),MV=H.object({id:H.string(),type:H.string().array().nonempty(),endorsementComment:H.string().optional()}),IV=gm.extend({credentialSubject:MV,proof:Va.or(Va.array()).optional()}),kV=H.object({id:H.string(),"@language":H.string().optional(),version:H.string().optional()}),DV=H.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(H.string()),RV=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:r1.array().optional(),description:H.string().optional(),level:H.string().optional(),name:H.string(),points:H.string().optional()}).catchall(H.any()),OV=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:r1.array().optional(),allowedValue:H.string().array().optional(),name:H.string(),requiredLevel:H.string().optional(),requiredValue:H.string().optional(),resultType:DV,rubricCriterionLevel:RV.array().optional(),valueMax:H.string().optional(),valueMin:H.string().optional()}).catchall(H.any()),NV=H.object({id:H.string().optional(),type:H.string().array().nonempty(),alignment:r1.array().optional(),achievementType:TV.optional(),creator:yd.optional(),creditsAvailable:H.number().optional(),criteria:CV,description:H.string(),endorsement:IV.array().optional(),fieldOfStudy:H.string().optional(),humanCode:H.string().optional(),image:t1.optional(),"@language":H.string().optional(),name:H.string(),otherIdentifier:Qk.array().optional(),related:kV.array().optional(),resultDescription:OV.array().optional(),specialization:H.string().optional(),tag:H.string().array().optional(),version:H.string().optional()}).catchall(H.any()),PV=H.object({type:H.string(),hashed:H.boolean(),identityHash:H.string(),identityType:H.string(),salt:H.string().optional()}),BV=H.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),LV=H.object({type:H.string().array().nonempty(),achievedLevel:H.string().optional(),alignment:r1.array().optional(),resultDescription:H.string().optional(),status:BV.optional(),value:H.string().optional()}).catchall(H.any()),xS=H.object({id:H.string().optional(),type:H.string().array().nonempty(),activityEndDate:H.string().optional(),activityStartDate:H.string().optional(),creditsEarned:H.number().optional(),achievement:NV.optional(),identifier:PV.array().optional(),image:t1.optional(),licenseNumber:H.string().optional(),narrative:H.string().optional(),result:LV.array().optional(),role:H.string().optional(),source:yd.optional(),term:H.string().optional()}).catchall(H.any()),UV=H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),narrative:H.string().optional(),name:H.string().optional(),description:H.string().optional(),genre:H.string().optional(),audience:H.string().optional()}).catchall(H.any()),FV=gm.extend({name:H.string().optional(),description:H.string().optional(),image:t1.optional(),credentialSubject:xS.or(xS.array()),endorsement:gm.array().optional(),evidence:UV.array().optional()}),iX=FV.extend({proof:Va.or(Va.array())}),aX=H.object({checks:H.string().array(),warnings:H.string().array(),errors:H.string().array()}),eD=H.enum(["Success","Failed","Error"]),oX=eD.enum,sX=H.object({check:H.string(),status:eD,message:H.string().optional(),details:H.string().optional()}),cX=H.object({title:H.string().optional(),createdAt:H.string().optional(),issuer:yd.optional(),issuee:yd.optional(),credentialSubject:c6.optional()}),uX=H.object({id:H.string(),uri:H.string()}).catchall(H.any()),lX=H.object({limit:H.number(),cursor:H.string().optional(),sort:H.string().optional()}),ti=H.object({cursor:H.string().optional(),hasMore:H.boolean()}),tD=H.object({encryptedRecord:EV,fields:H.string().array()}).catchall(H.any()),fX=ti.extend({records:tD.array()}),jV=tD.extend({id:H.string()}),dX=ti.extend({records:jV.array()}),TS=mV(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),$V=H.instanceof(RegExp).or(H.string().refine(e=>{try{return TS(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=TS(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),mr=H.string().or(H.object({$in:H.string().array()})).or(H.object({$regex:$V})),zV=H.object({backgroundColor:H.string().optional(),backgroundImage:H.string().optional(),fadeBackgroundImage:H.boolean().optional(),repeatBackgroundImage:H.boolean().optional(),fontColor:H.string().optional(),accentColor:H.string().optional(),accentFontColor:H.string().optional(),idBackgroundImage:H.string().optional(),fadeIdBackgroundImage:H.boolean().optional(),idBackgroundColor:H.string().optional(),repeatIdBackgroundImage:H.boolean().optional()}),Nc=H.object({profileId:H.string().min(3).max(40),displayName:H.string().default(""),shortBio:H.string().default(""),bio:H.string().default(""),did:H.string(),isPrivate:H.boolean().optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional(),websiteLink:H.string().optional(),isServiceProfile:H.boolean().default(!1).optional(),type:H.string().optional(),notificationsWebhook:H.string().url().startsWith("http").optional(),display:zV.optional()}),hX=H.object({profileId:mr,displayName:mr,shortBio:mr,bio:mr,email:mr,websiteLink:mr,isServiceProfile:H.boolean(),type:mr}).partial(),pX=ti.extend({records:Nc.array()}),mX=H.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),rD=H.object({id:H.string(),created:H.string(),displayName:H.string().default("").optional(),shortBio:H.string().default("").optional(),bio:H.string().default("").optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional()}),gX=ti.extend({records:rD.extend({did:H.string()}).array()}),vX=H.object({id:mr,displayName:mr,shortBio:mr,bio:mr,email:mr}).partial(),yX=ti.extend({records:H.object({profile:Nc,manager:rD.extend({did:H.string()}).optional()}).array()}),bX=H.object({uri:H.string(),to:H.string(),from:H.string(),sent:H.string().datetime(),received:H.string().datetime().optional()}),nD=H.object({role:H.string(),canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:H.string(),canCreateChildren:H.string(),canEditChildren:H.string(),canRevokeChildren:H.string(),canManageChildrenPermissions:H.string(),canManageChildrenProfiles:H.boolean().default(!1).optional(),canViewAnalytics:H.boolean()}),HV=H.object({role:mr,canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:mr,canCreateChildren:mr,canEditChildren:mr,canRevokeChildren:mr,canManageChildrenPermissions:mr,canManageChildrenProfiles:H.boolean(),canViewAnalytics:H.boolean()}).partial(),CS=H.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),qV=H.discriminatedUnion("type",[H.object({type:H.literal(CS.Values.GRANT_PERMISSIONS),data:H.object({claimUri:H.string(),targetUri:H.string(),permissions:nD.partial()})}),H.object({type:H.literal(CS.Values.ADD_ADMIN),data:H.object({claimUri:H.string(),targetUri:H.string()})})]),wX=H.object({type:mr,data:H.object({claimUri:mr,targetUri:mr,permissions:HV})}).deepPartial(),VV=H.object({id:H.string(),createdAt:H.string(),updatedAt:H.string()}).and(qV),_X=ti.extend({records:VV.array()}),u6=H.enum(["DRAFT","LIVE"]),KV=H.object({uri:H.string(),name:H.string().optional(),type:H.string().optional(),category:H.string().optional(),status:u6.optional(),autoConnectRecipients:H.boolean().optional(),meta:H.record(H.any()).optional(),claimPermissions:nD.optional()}),EX=H.object({uri:mr,name:mr,type:mr,category:mr,meta:H.record(mr),status:u6.or(H.object({$in:u6.array()})),autoConnectRecipients:H.boolean()}).partial(),AX=ti.extend({records:KV.array()}),GV=H.object({to:Nc,from:H.string(),received:H.string().optional(),uri:H.string().optional()}),SX=ti.extend({records:GV.array()}),xX=H.object({endpoint:H.string(),name:H.string(),did:H.string().optional()}),TX=H.object({ttlSeconds:H.number().optional(),totalUses:H.number().optional()}),WV=H.object({endpoint:H.string()}),CX=H.object({signingAuthority:WV,relationship:H.object({name:H.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:H.string()})}),MX=H.object({boostUri:H.string(),signingAuthority:H.object({endpoint:H.string(),name:H.string()})}),JV=H.enum(["live","stale","withdrawn"]),ZV=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({})}),iD=H.object({contract:ZV,owner:Nc,name:H.string(),subtitle:H.string().optional(),description:H.string().optional(),reasonForAccessing:H.string().optional(),image:H.string().optional(),uri:H.string(),needsGuardianConsent:H.boolean().optional(),redirectUrl:H.string().optional(),frontDoorBoostUri:H.string().optional(),createdAt:H.string(),updatedAt:H.string(),expiresAt:H.string().optional(),autoBoosts:H.string().array().optional()}),IX=ti.extend({records:iD.omit({owner:!0}).array()}),YV=H.object({credentials:H.object({categories:H.record(H.string().array()).default({})}),personal:H.record(H.string()).default({}),date:H.string()}),kX=ti.extend({records:YV.array()}),XV=H.object({credentials:H.object({category:H.string(),uri:H.string()}).array(),personal:H.record(H.string()).default({}),date:H.string(),contractUri:H.string()}),DX=ti.extend({records:XV.array()}),aD=H.object({sharing:H.boolean().optional(),shared:H.string().array().optional(),shareAll:H.boolean().optional(),shareUntil:H.string().optional()}),oD=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(aD).default({})}).default({}),personal:H.record(H.string()).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.boolean()).default({})}).default({}),personal:H.record(H.boolean()).default({})}).default({})}),RX=ti.extend({records:H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:oD,contract:iD,uri:H.string(),consenter:Nc,status:JV}).array()}),OX=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional()}),NX=H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}),PX=H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional(),id:mr.optional()}),QV=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(aD.optional()).optional()}).optional(),personal:H.record(H.string()).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}).optional()}),l6=H.enum(["consent","update","sync","withdraw","write"]),BX=H.object({terms:QV.optional(),action:l6.or(l6.array()).optional(),date:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),expiresAt:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),oneTime:H.boolean().optional()}),sD=H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:oD.optional(),id:H.string(),action:l6,date:H.string(),uris:H.string().array().optional()}),LX=ti.extend({records:sD.array()}),eK=H.object({credentialUri:H.string(),termsUri:H.string(),contractUri:H.string(),boostUri:H.string(),category:H.string().optional(),date:H.string()}),UX=ti.extend({records:eK.array()}),tK=H.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),rK=H.object({title:H.string().optional(),body:H.string().optional()}),nK=H.object({vcUris:H.array(H.string()).optional(),vpUris:H.array(H.string()).optional(),transaction:sD.optional()}),FX=H.object({type:tK,to:Nc.partial().and(H.object({did:H.string()})),from:Nc.partial().and(H.object({did:H.string()})),message:rK.optional(),data:nK.optional(),sent:H.string().datetime().optional()}),iK="auth-grant:",jX=H.object({id:H.string(),name:H.string(),description:H.string().optional(),challenge:H.string().startsWith(iK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:H.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:H.string(),createdAt:H.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:H.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),$X=H.object({id:H.string()}).catchall(H.any()),aK=H.enum(["active","revoked"]),zX=H.object({id:mr,name:mr,description:mr,status:aK}).partial(),n1=o(e=>`lc:ceramic:${e}`,"streamIdToCeramicURI"),HX=H.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 q2=z.object({credentials:mc.array()}).catchall(z.any()),cD=z.object({id:z.string(),title:z.string(),storageType:z.literal("ceramic").optional()}).catchall(z.any()),V2=z.object({credentials:mc.or(cD).array()}).strict();var uD={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials"};var i1=i(async(e,{modelData:t,credentialAlias:r}=uD)=>{let n=e.invoke.getCeramicClient(),a=new Lf({ceramic:n,model:t}),s=i(async(g=r)=>{let v=await a.get(g);if(!v)return{credentials:[]};let y=await q2.spa(v);if(y.success)return y.data;let _=await V2.spa(v);if(_.success){let D={credentials:_.data.credentials.map(P=>{if("uri"in P)return P;let{title:J,id:j,storageType:q,...Q}=P;return{...Q,id:J,uri:`lc:ceramic:${j.replace("ceramic://","")}`}})};return await a.set(r,D),D}throw console.error(y.error),new Error("Invalid credentials list stored in IDX")},"getCredentialsListFromIdx"),c=i(async(g,v)=>{if(!g)throw new Error("Must provide id to remove");v||(v=r);let y=await s(v);return y.credentials=y.credentials.filter(_=>_.id!==g),a.set(v,y)},"removeCredentialFromIdx"),l=i(async g=>(g||(g=r),a.set(g,{credentials:[]})),"removeAllCredentialsFromIdx"),h=i(async g=>{let v=await mc.parseAsync(g);if(!v)throw new Error("record is required");if(!v.uri)throw Error("No URI provided");await e.read.get(v.uri);let y=await s(r),_=y.credentials.findIndex(x=>x.id===v.id);return _>-1?y.credentials[_]=v:y.credentials.push(v),n1(await a.set(r,y))},"addCredentialInIdx"),p=i(async g=>{let v=mc.array().parse(g),y=await s(r);return await Promise.all(v.map(async _=>{await e.read.get(_.uri);let x=y.credentials.findIndex(O=>O.id===_.id);x>-1?y.credentials[x]=_:y.credentials.push(_)})),n1(await a.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 g=>(g.debug?.("learnCard.index.IDX.get"),(await s()).credentials),add:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await h(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},addMany:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await p(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},update:async g=>(g.debug?.("learnCard.index.IDX.update"),!1),remove:async(g,v)=>{g.debug?.("learnCard.index.IDX.remove");try{return await c(v),!0}catch(y){return console.error("Error removing credential from IDX:",y),!1}},removeAll:async g=>{g.debug?.("learnCard.index.IDX.removeAll");try{return await l(),!0}catch(v){return console.error("Error removing credentials from IDX:",v),!1}}},methods:{getCredentialsListFromIdx:async(g,v=r)=>(await s(v)).credentials,getVerifiableCredentialFromIdx:async(g,v)=>{let _=(await s())?.credentials?.find(D=>D?.id===v),x=g.read.get(_?.uri),O=await m0.safeParseAsync(x);return O.success?O.data:void 0},getVerifiableCredentialsFromIdx:async g=>{let y=(await s())?.credentials?.map(_=>_?.uri)??[];return(await Promise.all(y.map(async _=>g.read.get(_)))).filter(_=>!!_)},addVerifiableCredentialInIdx:async(g,v)=>{let y=mc.parse(v);if(!y)throw new Error("record is required");if(!y.uri)throw Error("No URI provided");await g.read.get(y.uri);let _=await s(r),x=_.credentials.findIndex(O=>O.id===y.id);return x>-1?_.credentials[x]=y:_.credentials.push(y),n1(await a.set(r,_))},removeVerifiableCredentialInIdx:async(g,v)=>c(v),removeAllVerifiableCredentialsInIdx:async()=>l(),getIDXIndex:async()=>a.get(r),setIDXIndex:async(g,v)=>a.set(r,v)}}},"getIDXPlugin");var oK=i1;
845
+ `):"",this.name="UnsubscriptionError",this.errors=r},"UnsubscriptionErrorImpl"),"UnsubscriptionErrorImpl")});function cd(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}i(cd,"arrRemove");o(cd,"arrRemove");var Od=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return i(e,"Subscription2"),o(e,"Subscription"),e.prototype.unsubscribe=function(){var t,r,n,a,s;if(!this.closed){this.closed=!0;var c=this._parentage;if(c)if(this._parentage=null,Array.isArray(c))try{for(var l=Ic(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 g=this.initialTeardown;if(Sr(g))try{g()}catch(O){s=O instanceof sb?O.errors:[O]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var y=Ic(v),_=y.next();!_.done;_=y.next()){var x=_.value;try{Kb(x)}catch(O){s=s??[],O instanceof sb?s=Es(Es([],Io(s)),Io(O.errors)):s.push(O)}}}catch(O){n={error:O}}finally{try{_&&!_.done&&(a=y.return)&&a.call(y)}finally{if(n)throw n.error}}}if(s)throw new sb(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)Kb(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)&&cd(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&cd(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),PI=Od.EMPTY;function w2(e){return e instanceof Od||e&&"closed"in e&&Sr(e.remove)&&Sr(e.add)&&Sr(e.unsubscribe)}i(w2,"isSubscription");o(w2,"isSubscription");function Kb(e){Sr(e)?e():e.unsubscribe()}i(Kb,"execFinalizer");o(Kb,"execFinalizer");var Hc={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},sm={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=sm.delegate;return a?.setTimeout?a.setTimeout.apply(a,Es([e,t],Io(r))):setTimeout.apply(void 0,Es([e,t],Io(r)))},clearTimeout:function(e){var t=sm.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function _2(e){sm.setTimeout(function(){var t=Hc.onUnhandledError;if(t)t(e);else throw e})}i(_2,"reportUnhandledError");o(_2,"reportUnhandledError");function Gb(){}i(Gb,"noop");o(Gb,"noop");var IH=function(){return Wm("C",void 0,void 0)}();function BI(e){return Wm("E",void 0,e)}i(BI,"errorNotification");o(BI,"errorNotification");function LI(e){return Wm("N",e,void 0)}i(LI,"nextNotification");o(LI,"nextNotification");function Wm(e,t,r){return{kind:e,value:t,error:r}}i(Wm,"createNotification");o(Wm,"createNotification");var Ac=null;function Yf(e){if(Hc.useDeprecatedSynchronousErrorHandling){var t=!Ac;if(t&&(Ac={errorThrown:!1,error:null}),e(),t){var r=Ac,n=r.errorThrown,a=r.error;if(Ac=null,n)throw a}}else e()}i(Yf,"errorContext");o(Yf,"errorContext");function UI(e){Hc.useDeprecatedSynchronousErrorHandling&&Ac&&(Ac.errorThrown=!0,Ac.error=e)}i(UI,"captureError");o(UI,"captureError");var E2=function(e){Ya(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,w2(r)&&r.add(n)):n.destination=RH,n}return i(t,"Subscriber2"),o(t,"Subscriber"),t.create=function(r,n,a){return new Wb(r,n,a)},t.prototype.next=function(r){this.isStopped?O0(LI(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?O0(BI(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?O0(IH,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}(Od),kH=Function.prototype.bind;function R0(e,t){return kH.call(e,t)}i(R0,"bind");o(R0,"bind");var DH=function(){function e(t){this.partialObserver=t}return i(e,"ConsumerObserver2"),o(e,"ConsumerObserver"),e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){Wf(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){Wf(n)}else Wf(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){Wf(r)}},e}(),Wb=function(e){Ya(t,e);function t(r,n,a){var s=e.call(this)||this,c;if(Sr(r)||!r)c={next:r??void 0,error:n??void 0,complete:a??void 0};else{var l;s&&Hc.useDeprecatedNextContext?(l=Object.create(r),l.unsubscribe=function(){return s.unsubscribe()},c={next:r.next&&R0(r.next,l),error:r.error&&R0(r.error,l),complete:r.complete&&R0(r.complete,l)}):c=r}return s.destination=new DH(c),s}return i(t,"SafeSubscriber2"),o(t,"SafeSubscriber"),t}(E2);function Wf(e){Hc.useDeprecatedSynchronousErrorHandling?UI(e):_2(e)}i(Wf,"handleUnhandledError");o(Wf,"handleUnhandledError");function FI(e){throw e}i(FI,"defaultErrorHandler");o(FI,"defaultErrorHandler");function O0(e,t){var r=Hc.onStoppedNotification;r&&sm.setTimeout(function(){return r(e,t)})}i(O0,"handleStoppedNotification");o(O0,"handleStoppedNotification");var RH={closed:!0,next:Gb,error:FI,complete:Gb},A2=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Jm(e){return e}i(Jm,"identity3");o(Jm,"identity");function jI(e){return e.length===0?Jm:e.length===1?e[0]:o(i(function(r){return e.reduce(function(n,a){return a(n)},r)},"piped"),"piped")}i(jI,"pipeFromArray");o(jI,"pipeFromArray");var dn=function(){function e(t){t&&(this._subscribe=t)}return i(e,"Observable2"),o(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 a=this,s=zI(t)?t:new Wb(t,r,n);return Yf(function(){var c=a,l=c.operator,h=c.source;s.add(l?l.call(s,h):h?a._subscribe(s):a._trySubscribe(s))}),s},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=Jb(r),new r(function(a,s){var c=new Wb({next:function(l){try{t(l)}catch(h){s(h),c.unsubscribe()}},error:s,complete:a});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[A2]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return jI(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=Jb(t),new t(function(n,a){var s;r.subscribe(function(c){return s=c},function(c){return a(c)},function(){return n(s)})})},e.create=function(t){return new e(t)},e}();function Jb(e){var t;return(t=e??Hc.Promise)!==null&&t!==void 0?t:Promise}i(Jb,"getPromiseCtor");o(Jb,"getPromiseCtor");function $I(e){return e&&Sr(e.next)&&Sr(e.error)&&Sr(e.complete)}i($I,"isObserver");o($I,"isObserver");function zI(e){return e&&e instanceof E2||$I(e)&&w2(e)}i(zI,"isSubscriber");o(zI,"isSubscriber");function HI(e){return Sr(e?.lift)}i(HI,"hasLift");o(HI,"hasLift");function Xa(e){return function(t){if(HI(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(Xa,"operate");o(Xa,"operate");function ga(e,t,r,n,a){return new OH(e,t,r,n,a)}i(ga,"createOperatorSubscriber");o(ga,"createOperatorSubscriber");var OH=function(e){Ya(t,e);function t(r,n,a,s,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(g){r.error(g)}}:e.prototype._next,h._error=s?function(p){try{s(p)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,h._complete=a?function(){try{a()}catch(p){r.error(p)}finally{this.unsubscribe()}}:e.prototype._complete,h}return i(t,"OperatorSubscriber2"),o(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}(E2),NH=Gm(function(e){return o(i(function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"},"ObjectUnsubscribedErrorImpl"),"ObjectUnsubscribedErrorImpl")}),qI=function(e){Ya(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"),o(t,"Subject"),t.prototype.lift=function(r){var n=new aS(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new NH},t.prototype.next=function(r){var n=this;Yf(function(){var a,s;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var c=Ic(n.currentObservers),l=c.next();!l.done;l=c.next()){var h=l.value;h.next(r)}}catch(p){a={error:p}}finally{try{l&&!l.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}}})},t.prototype.error=function(r){var n=this;Yf(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var a=n.observers;a.length;)a.shift().error(r)}})},t.prototype.complete=function(){var r=this;Yf(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,a=this,s=a.hasError,c=a.isStopped,l=a.observers;return s||c?PI:(this.currentObservers=null,l.push(r),new Od(function(){n.currentObservers=null,cd(l,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,a=n.hasError,s=n.thrownError,c=n.isStopped;a?r.error(s):c&&r.complete()},t.prototype.asObservable=function(){var r=new dn;return r.source=this,r},t.create=function(r,n){return new aS(r,n)},t}(dn),aS=function(e){Ya(t,e);function t(r,n){var a=e.call(this)||this;return a.destination=r,a.source=n,a}return i(t,"AnonymousSubject2"),o(t,"AnonymousSubject"),t.prototype.next=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.next)===null||a===void 0||a.call(n,r)},t.prototype.error=function(r){var n,a;(a=(n=this.destination)===null||n===void 0?void 0:n.error)===null||a===void 0||a.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,a;return(a=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&a!==void 0?a:PI},t}(qI),PH=function(e){Ya(t,e);function t(r){var n=e.call(this)||this;return n._value=r,n}return i(t,"BehaviorSubject2"),o(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,a=r.thrownError,s=r._value;if(n)throw a;return this._throwIfClosed(),s},t.prototype.next=function(r){e.prototype.next.call(this,this._value=r)},t}(qI),VI={now:function(){return(VI.delegate||Date).now()},delegate:void 0},BH=function(e){Ya(t,e);function t(r,n){return e.call(this)||this}return i(t,"Action2"),o(t,"Action"),t.prototype.schedule=function(r,n){return n===void 0&&(n=0),this},t}(Od),cm={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var a=cm.delegate;return a?.setInterval?a.setInterval.apply(a,Es([e,t],Io(r))):setInterval.apply(void 0,Es([e,t],Io(r)))},clearInterval:function(e){var t=cm.delegate;return(t?.clearInterval||clearInterval)(e)},delegate:void 0},LH=function(e){Ya(t,e);function t(r,n){var a=e.call(this,r,n)||this;return a.scheduler=r,a.work=n,a.pending=!1,a}return i(t,"AsyncAction2"),o(t,"AsyncAction"),t.prototype.schedule=function(r,n){var a;if(n===void 0&&(n=0),this.closed)return this;this.state=r;var s=this.id,c=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(c,s,n)),this.pending=!0,this.delay=n,this.id=(a=this.id)!==null&&a!==void 0?a:this.requestAsyncId(c,this.id,n),this},t.prototype.requestAsyncId=function(r,n,a){return a===void 0&&(a=0),cm.setInterval(r.flush.bind(r,this),a)},t.prototype.recycleAsyncId=function(r,n,a){if(a===void 0&&(a=0),a!=null&&this.delay===a&&this.pending===!1)return n;n!=null&&cm.clearInterval(n)},t.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var a=this._execute(r,n);if(a)return a;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(r,n){var a=!1,s;try{this.work(r)}catch(c){a=!0,s=c||new Error("Scheduled action threw falsy error")}if(a)return this.unsubscribe(),s},t.prototype.unsubscribe=function(){if(!this.closed){var r=this,n=r.id,a=r.scheduler,s=a.actions;this.work=this.state=this.scheduler=null,this.pending=!1,cd(s,this),n!=null&&(this.id=this.recycleAsyncId(a,n,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(BH),oS=function(){function e(t,r){r===void 0&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return i(e,"Scheduler2"),o(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=VI.now,e}(),UH=function(e){Ya(t,e);function t(r,n){n===void 0&&(n=oS.now);var a=e.call(this,r,n)||this;return a.actions=[],a._active=!1,a}return i(t,"AsyncScheduler2"),o(t,"AsyncScheduler"),t.prototype.flush=function(r){var n=this.actions;if(this._active){n.push(r);return}var a;this._active=!0;do if(a=r.execute(r.state,r.delay))break;while(r=n.shift());if(this._active=!1,a){for(;r=n.shift();)r.unsubscribe();throw a}},t}(oS),FH=new UH(LH),jH=FH,KI=new dn(function(e){return e.complete()});function S2(e){return e&&Sr(e.schedule)}i(S2,"isScheduler");o(S2,"isScheduler");function x2(e){return e[e.length-1]}i(x2,"last");o(x2,"last");function GI(e){return S2(x2(e))?e.pop():void 0}i(GI,"popScheduler");o(GI,"popScheduler");function WI(e,t){return typeof x2(e)=="number"?e.pop():t}i(WI,"popNumber");o(WI,"popNumber");var T2=o(function(e){return e&&typeof e.length=="number"&&typeof e!="function"},"isArrayLike");function C2(e){return Sr(e?.then)}i(C2,"isPromise");o(C2,"isPromise");function M2(e){return Sr(e[A2])}i(M2,"isInteropObservable");o(M2,"isInteropObservable");function I2(e){return Symbol.asyncIterator&&Sr(e?.[Symbol.asyncIterator])}i(I2,"isAsyncIterable");o(I2,"isAsyncIterable");function k2(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(k2,"createInvalidObservableTypeError");o(k2,"createInvalidObservableTypeError");function JI(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}i(JI,"getSymbolIterator");o(JI,"getSymbolIterator");var ZI=JI();function D2(e){return Sr(e?.[ZI])}i(D2,"isIterable");o(D2,"isIterable");function R2(e){return OI(this,arguments,o(i(function(){var r,n,a,s;return b2(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,Cc(r.read())];case 3:return n=c.sent(),a=n.value,s=n.done,s?[4,Cc(void 0)]:[3,5];case 4:return[2,c.sent()];case 5:return[4,Cc(a)];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(R2,"readableStreamLikeToAsyncGenerator");o(R2,"readableStreamLikeToAsyncGenerator");function O2(e){return Sr(e?.getReader)}i(O2,"isReadableStreamLike");o(O2,"isReadableStreamLike");function No(e){if(e instanceof dn)return e;if(e!=null){if(M2(e))return YI(e);if(T2(e))return XI(e);if(C2(e))return QI(e);if(I2(e))return N2(e);if(D2(e))return ek(e);if(O2(e))return tk(e)}throw k2(e)}i(No,"innerFrom");o(No,"innerFrom");function YI(e){return new dn(function(t){var r=e[A2]();if(Sr(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}i(YI,"fromInteropObservable");o(YI,"fromInteropObservable");function XI(e){return new dn(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}i(XI,"fromArrayLike");o(XI,"fromArrayLike");function QI(e){return new dn(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,_2)})}i(QI,"fromPromise");o(QI,"fromPromise");function ek(e){return new dn(function(t){var r,n;try{for(var a=Ic(e),s=a.next();!s.done;s=a.next()){var c=s.value;if(t.next(c),t.closed)return}}catch(l){r={error:l}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}t.complete()})}i(ek,"fromIterable");o(ek,"fromIterable");function N2(e){return new dn(function(t){rk(e,t).catch(function(r){return t.error(r)})})}i(N2,"fromAsyncIterable");o(N2,"fromAsyncIterable");function tk(e){return N2(R2(e))}i(tk,"fromReadableStreamLike");o(tk,"fromReadableStreamLike");function rk(e,t){var r,n,a,s;return RI(this,void 0,void 0,function(){var c,l;return b2(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),r=NI(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(),a={error:l},[3,11];case 6:return h.trys.push([6,,9,10]),n&&!n.done&&(s=r.return)?[4,s.call(r)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3,10];case 9:if(a)throw a.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}i(rk,"process2");o(rk,"process");function To(e,t,r,n,a){n===void 0&&(n=0),a===void 0&&(a=!1);var s=t.schedule(function(){r(),a?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(s),!a)return s}i(To,"executeSchedule");o(To,"executeSchedule");function P2(e,t){return t===void 0&&(t=0),Xa(function(r,n){r.subscribe(ga(n,function(a){return To(n,e,function(){return n.next(a)},t)},function(){return To(n,e,function(){return n.complete()},t)},function(a){return To(n,e,function(){return n.error(a)},t)}))})}i(P2,"observeOn");o(P2,"observeOn");function B2(e,t){return t===void 0&&(t=0),Xa(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}i(B2,"subscribeOn");o(B2,"subscribeOn");function nk(e,t){return No(e).pipe(B2(t),P2(t))}i(nk,"scheduleObservable");o(nk,"scheduleObservable");function ik(e,t){return No(e).pipe(B2(t),P2(t))}i(ik,"schedulePromise");o(ik,"schedulePromise");function ak(e,t){return new dn(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}i(ak,"scheduleArray");o(ak,"scheduleArray");function ok(e,t){return new dn(function(r){var n;return To(r,t,function(){n=e[ZI](),To(r,t,function(){var a,s,c;try{a=n.next(),s=a.value,c=a.done}catch(l){r.error(l);return}c?r.complete():r.next(s)},0,!0)}),function(){return Sr(n?.return)&&n.return()}})}i(ok,"scheduleIterable");o(ok,"scheduleIterable");function L2(e,t){if(!e)throw new Error("Iterable cannot be null");return new dn(function(r){To(r,t,function(){var n=e[Symbol.asyncIterator]();To(r,t,function(){n.next().then(function(a){a.done?r.complete():r.next(a.value)})},0,!0)})})}i(L2,"scheduleAsyncIterable");o(L2,"scheduleAsyncIterable");function sk(e,t){return L2(R2(e),t)}i(sk,"scheduleReadableStreamLike");o(sk,"scheduleReadableStreamLike");function ck(e,t){if(e!=null){if(M2(e))return nk(e,t);if(T2(e))return ak(e,t);if(C2(e))return ik(e,t);if(I2(e))return L2(e,t);if(D2(e))return ok(e,t);if(O2(e))return sk(e,t)}throw k2(e)}i(ck,"scheduled");o(ck,"scheduled");function uk(e,t){return t?ck(e,t):No(e)}i(uk,"from3");o(uk,"from");var lk=Gm(function(e){return o(i(function(){e(this),this.name="EmptyError",this.message="no elements in sequence"},"EmptyErrorImpl"),"EmptyErrorImpl")});function fk(e){return e instanceof Date&&!isNaN(e)}i(fk,"isValidDate");o(fk,"isValidDate");function U2(e,t){return Xa(function(r,n){var a=0;r.subscribe(ga(n,function(s){n.next(e.call(t,s,a++))}))})}i(U2,"map");o(U2,"map");var $H=Array.isArray;function dk(e,t){return $H(t)?e.apply(void 0,Es([],Io(t))):e(t)}i(dk,"callOrApply");o(dk,"callOrApply");function hk(e){return U2(function(t){return dk(e,t)})}i(hk,"mapOneOrManyArgs");o(hk,"mapOneOrManyArgs");function pk(e,t,r,n,a,s,c,l){var h=[],p=0,g=0,v=!1,y=o(function(){v&&!h.length&&!p&&t.complete()},"checkComplete"),_=o(function(O){return p<n?x(O):h.push(O)},"outerNext"),x=o(function(O){s&&t.next(O),p++;var D=!1;No(r(O,g++)).subscribe(ga(t,function(P){a?.(P),s?_(P):t.next(P)},function(){D=!0},void 0,function(){if(D)try{p--;for(var P=o(function(){var J=h.shift();c?To(t,c,function(){return x(J)}):x(J)},"_loop_1");h.length&&p<n;)P();y()}catch(J){t.error(J)}}))},"doInnerSub");return e.subscribe(ga(t,_,function(){v=!0,y()})),function(){l?.()}}i(pk,"mergeInternals");o(pk,"mergeInternals");function Zm(e,t,r){return r===void 0&&(r=1/0),Sr(t)?Zm(function(n,a){return U2(function(s,c){return t(n,s,a,c)})(No(e(n,a)))},r):(typeof t=="number"&&(r=t),Xa(function(n,a){return pk(n,a,e,r)}))}i(Zm,"mergeMap");o(Zm,"mergeMap");function mk(e){return e===void 0&&(e=1/0),Zm(Jm,e)}i(mk,"mergeAll");o(mk,"mergeAll");var zH=["addListener","removeListener"],HH=["addEventListener","removeEventListener"],qH=["on","off"];function um(e,t,r,n){if(Sr(r)&&(n=r,r=void 0),n)return um(e,t,r).pipe(hk(n));var a=Io(yk(e)?HH.map(function(l){return function(h){return e[l](t,h,r)}}):gk(e)?zH.map(Zb(e,t)):vk(e)?qH.map(Zb(e,t)):[],2),s=a[0],c=a[1];if(!s&&T2(e))return Zm(function(l){return um(l,t,r)})(No(e));if(!s)throw new TypeError("Invalid event target");return new dn(function(l){var h=o(function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];return l.next(1<p.length?p:p[0])},"handler");return s(h),function(){return c(h)}})}i(um,"fromEvent");o(um,"fromEvent");function Zb(e,t){return function(r){return function(n){return e[r](t,n)}}}i(Zb,"toCommonHandlerRegistry");o(Zb,"toCommonHandlerRegistry");function gk(e){return Sr(e.addListener)&&Sr(e.removeListener)}i(gk,"isNodeStyleEventEmitter");o(gk,"isNodeStyleEventEmitter");function vk(e){return Sr(e.on)&&Sr(e.off)}i(vk,"isJQueryStyleEventEmitter");o(vk,"isJQueryStyleEventEmitter");function yk(e){return Sr(e.addEventListener)&&Sr(e.removeEventListener)}i(yk,"isEventTarget");o(yk,"isEventTarget");function F2(e,t,r){e===void 0&&(e=0),r===void 0&&(r=jH);var n=-1;return t!=null&&(S2(t)?r=t:n=t),new dn(function(a){var s=fk(e)?+e-r.now():e;s<0&&(s=0);var c=0;return r.schedule(function(){a.closed||(a.next(c++),0<=n?this.schedule(void 0,n):a.complete())},s)})}i(F2,"timer");o(F2,"timer");function bk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=GI(e),n=WI(e,1/0),a=e;return a.length?a.length===1?No(a[0]):mk(n)(uk(a,r)):KI}i(bk,"merge");o(bk,"merge");function wk(e,t){return Xa(function(r,n){var a=0;r.subscribe(ga(n,function(s){return e.call(t,s,a++)&&n.next(s)}))})}i(wk,"filter");o(wk,"filter");function _k(e){return Xa(function(t,r){var n=!1;t.subscribe(ga(r,function(a){n=!0,r.next(a)},function(){n||r.next(e),r.complete()}))})}i(_k,"defaultIfEmpty");o(_k,"defaultIfEmpty");function Ek(e){return e<=0?function(){return KI}:Xa(function(t,r){var n=0;t.subscribe(ga(r,function(a){++n<=e&&(r.next(a),e<=n&&r.complete())}))})}i(Ek,"take");o(Ek,"take");function Ak(e){return e===void 0&&(e=Sk),Xa(function(t,r){var n=!1;t.subscribe(ga(r,function(a){n=!0,r.next(a)},function(){return n?r.complete():r.error(e())}))})}i(Ak,"throwIfEmpty");o(Ak,"throwIfEmpty");function Sk(){return new lk}i(Sk,"defaultErrorFactory");o(Sk,"defaultErrorFactory");function xk(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?wk(function(a,s){return e(a,s,n)}):Jm,Ek(1),r?_k(t):Ak(function(){return new lk}))}}i(xk,"first");o(xk,"first");function Tk(e,t){return Xa(function(r,n){var a=t??{},s=a.leading,c=s===void 0?!0:s,l=a.trailing,h=l===void 0?!1:l,p=!1,g=null,v=null,y=!1,_=o(function(){v?.unsubscribe(),v=null,h&&(D(),y&&n.complete())},"endThrottling"),x=o(function(){v=null,y&&n.complete()},"cleanupThrottling"),O=o(function(P){return v=No(e(P)).subscribe(ga(n,_,x))},"startThrottle"),D=o(function(){if(p){p=!1;var P=g;g=null,n.next(P),!y&&O(P)}},"send");r.subscribe(ga(n,function(P){p=!0,g=P,!(v&&!v.closed)&&(c?D():O(P))},function(){y=!0,!(h&&p&&v&&!v.closed)&&n.complete()}))})}i(Tk,"throttle");o(Tk,"throttle");var sS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(sS||(sS={}));var lm;(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"})(lm||(lm={}));var Yb;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(Yb||(Yb={}));var Ym=i(class extends dn{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,QA.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Ar.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Ar.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===Yb.ANCHOR).map(({cid:e})=>Ar.make(this.id,e))}get state(){return(0,QA.default)(this.state$.value)}async sync(e={}){e={sync:ei.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");o(Ym,"Stream");function Xm(){return e=>{}}i(Xm,"StreamStatic");o(Xm,"StreamStatic");var VH=ir(I$(),1);function Ck(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):(bk(...e.map(r=>um(r,"abort"))).pipe(xk()).subscribe(()=>{t.abort()}),t.signal)}i(Ck,"mergeAbortSignals");o(Ck,"mergeAbortSignals");var Mk=i(class{constructor(e){let t=new AbortController;if(this.signal=t.signal,e<=0){t.abort();return}this._subscription=F2(e).subscribe(()=>{t.abort()})}clear(){this._subscription?.unsubscribe()}},"TimedAbortSignal");o(Mk,"TimedAbortSignal");async function Ik(e,t){let r=new AbortController,n=o(()=>{r.abort()},"onAbort");return e.addEventListener("abort",n),e.aborted&&r.abort(),t(r.signal).finally(()=>{e.removeEventListener("abort",n)})}i(Ik,"abortable2");o(Ik,"abortable");var KH=60*1e3*3;async function _i(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{...t.headers,"Content-Type":"application/json"}});let r=t.timeout||KH,n=new Mk(r),a=t.signal?Ck([t.signal,n.signal]):n.signal,s=await Ik(a,c=>(0,VH.default)(String(e),{...t,signal:c})).finally(()=>n.clear());if(!s.ok){let c=await s.text();throw new Error(`HTTP request to '${e}' failed with status '${s.statusText}': ${c}`)}return s.json()}i(_i,"fetchJson");o(_i,"fetchJson");var _0=ir(Sd(),1);Ga();function So(e){let t=$t.asCID(e);if(t)return t;if(typeof e=="string")return $t.parse(e);if(e instanceof Uint8Array)return $t.decode(e);throw new Error(`${e} cannot be converted to a CID`)}i(So,"toCID");o(So,"toCID");var cS=0,Hr=i(class{static streamIdFromState(e){return new Xt(e.type,e.log[0].cid)}static serializeCommit(e){let t=(0,_0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=Ir(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Ir(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(e)&&(t.link=t.link.toString()),Hr.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=Ir(e.header.model,"base64")),t)}static deserializeCommit(e){let t=(0,_0.default)(e);return Hr.isSignedCommitContainer(t)?(t.jws.link=So(t.jws.link),t.linkedBlock=Cr(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=Cr(t.cacaoBlock,"base64")),t):(Hr.isSignedCommit(t)&&(t.link=So(t.link)),Hr.isAnchorCommit(t)&&(t.proof=So(t.proof)),t.id&&(t.id=So(t.id)),t.prev&&(t.prev=So(t.prev)),t.header?.model&&(t.header.model=Cr(t.header.model,"base64")),t)}static serializeState(e){let t=(0,_0.default)(e);return t.log=t.log.map(r=>({...r,cid:r.cid.toString()})),t.anchorStatus!=null&&(t.anchorStatus=lm[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!=cS&&(t.metadata.unique=Ir(t.metadata.unique,"base64")),t.doctype=Mo.nameByCode(t.type),t}static deserializeState(e){if(!e)return null;let t=(0,_0.default)(e);return t.doctype&&(t.type=Mo.codeByName(t.doctype),delete t.doctype),t.log=t.log.map(r=>({...r,cid:So(r.cid)})),t.anchorProof&&(t.anchorProof.txHash=So(t.anchorProof.txHash),t.anchorProof.root=So(t.anchorProof.root)),t.anchorStatus&&(t.anchorStatus=lm[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!=cS&&(t.metadata.unique=Cr(e.metadata.unique,"base64")),t}static statesEqual(e,t){return JSON.stringify(Hr.serializeState(e))===JSON.stringify(Hr.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(Hr.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");o(Hr,"StreamUtils");var kk=i(class extends PH{next(e){let t=this.value;Hr.statesEqual(t,e)||super.next(e)}},"StreamStateSubject");o(kk,"StreamStateSubject");var GH=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate3"),bi,cb={anchor:!0,publish:!0,pin:!0,sync:ei.PREFER_CACHE},WH={sync:ei.PREFER_CACHE},uS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function N0(e,t){if(typeof e?.schema=="string")try{Ar.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=Ir((0,CH.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(N0,"headerFromMetadata");o(N0,"headerFromMetadata");async function Xb(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(Xb,"getAuthenticatedDID");o(Xb,"getAuthenticatedDID");async function P0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(P0,"throwReadOnlyError");o(P0,"throwReadOnlyError");var ko=bi=o(i(class extends Ym{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,TH.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async create(t,r,n,a={}){a={...cb,...a},!n?.deterministic&&a.syncTimeoutSeconds==null&&(a.syncTimeoutSeconds=0);let s=a.asDID?{did:a.asDID}:t,c=await bi.makeGenesis(s,r,n);return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,c,a)}static async createFromGenesis(t,r,n={}){n={...cb,...n},r.header?.unique&&n.syncTimeoutSeconds==null&&(n.syncTimeoutSeconds=0);let a=r.data?await bi._signDagJWS(t,r):r;return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,a,n)}static async deterministic(t,r,n={}){if(n={...cb,...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 a=await bi.makeGenesis(t,null,r);return t.createStreamFromGenesis(bi.STREAM_TYPE_ID,a,n)}static async load(t,r,n={}){n={...WH,...n};let a=_s.from(r);if(a.type!=bi.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${bi.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async update(t,r,n={}){n={...uS,...n};let a=n.asDID?{did:n.asDID}:this.api,s=await this.makeCommit(a,t,r),c=await this.api.applyCommit(this.id,s,n);this.state$.next(c.state)}async patch(t,r={}){r={...uS,...r};let a={header:N0(this.metadata,!1),data:t,prev:this.tip,id:this.id.cid},s=await bi._signDagJWS(this.api,a),c=await this.api.applyCommit(this.id,s,r);this.state$.next(c.state)}makeReadOnly(){this.update=P0,this.patch=P0,this.sync=P0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}async makeCommit(t,r,n){let a=await this._makeRawCommit(r,n);return bi._signDagJWS(t,a)}async _makeRawCommit(t,r){r||(r={});let n=N0(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 a=vI.compare(this.content,t),s=this.state.log[0];return{header:n,data:a,prev:this.tip,id:s.cid}}static async makeGenesis(t,r,n){if(n||(n={}),!n.controllers||n.controllers.length===0)if(t.did){let c=await Xb(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 a=N0(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:a};return Um(c),c}let s={data:r,header:a};return bi._signDagJWS(t,s)}static async _signDagJWS(t,r){return(await Xb(t)).createDagJWS(r)}},"TileDocument2"),"TileDocument");ko.STREAM_TYPE_NAME="tile";ko.STREAM_TYPE_ID=0;ko=bi=GH([Xm()],ko);var JH=ir(k$(),1);function Dk(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}i(Dk,"_checkPrivateRedeclaration2");o(Dk,"_checkPrivateRedeclaration");function Rk(e,t){return t.get?t.get.call(e):t.value}i(Rk,"_classApplyDescriptorGet2");o(Rk,"_classApplyDescriptorGet");function Ok(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(Ok,"_classApplyDescriptorSet2");o(Ok,"_classApplyDescriptorSet");function j2(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}i(j2,"_classExtractFieldDescriptor2");o(j2,"_classExtractFieldDescriptor");function B0(e,t){var r=j2(e,t,"get");return Rk(e,r)}i(B0,"_classPrivateFieldGet2");o(B0,"_classPrivateFieldGet");function Qb(e,t,r){Dk(e,t),t.set(e,r)}i(Qb,"_classPrivateFieldInit2");o(Qb,"_classPrivateFieldInit");function e6(e,t,r){var n=j2(e,t,"set");return Ok(e,n,r),r}i(e6,"_classPrivateFieldSet2");o(e6,"_classPrivateFieldSet");function Nk(e){return typeof e=="string"||Ar.isInstance(e)||Xt.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}i(Nk,"keyToQuery");o(Nk,"keyToQuery");function L0(e){return typeof e=="string"?_s.from(e).toString():Ar.isInstance(e)||Xt.isInstance(e)?e.toString():e.streamId.toString()}i(L0,"keyToString");o(L0,"keyToString");async function Pk(e){let t=await ko.makeGenesis({},null,{...e,deterministic:!0}),r=await Xt.fromGenesis("tile",t);return{genesis:t,streamId:r}}i(Pk,"getDeterministicQuery");o(Pk,"getDeterministicQuery");var ZH=o(()=>Promise.resolve([]),"tempBatchLoadFn"),E0=new WeakMap,ub=new WeakMap,YH=i(class extends JH.default{cache(e){if(!B0(this,ub))return!1;let t=e.id.toString();return this.clear(t).prime(t,e),!0}async create(e,t,r){let n=await ko.create(B0(this,E0),e,t,r);return this.cache(n),n}async deterministic(e,t){let r=await Pk(e);try{return await super.load(r)}catch{let a=await ko.createFromGenesis(B0(this,E0),r.genesis,t);return this.cache(a),a}}async load(e){return await super.load(e)}async update(e,t,r,n){let a=L0(e);this.clear(a);let s=await this.load({streamId:a});return await s.update(t,r,n),s}constructor(e){super(ZH,{cache:!0,cacheKeyFn:L0,cacheMap:e.cache!=null&&typeof e.cache!="boolean"?e.cache:void 0}),Qb(this,E0,{writable:!0,value:void 0}),Qb(this,ub,{writable:!0,value:void 0}),this._batchLoadFn=async t=>{e.cache||this.clearAll();let r=await e.ceramic.multiQuery(t.map(Nk),e.multiqueryTimeout);return t.map(n=>{let a=L0(n),s=r[a];return s||new Error(`Failed to load stream: ${a}`)})},e6(this,E0,e.ceramic),e6(this,ub,!!e.cache)}},"TileLoader");o(YH,"TileLoader");function t6(e){return typeof e=="string"?Xt.fromString(e):e}i(t6,"typeStreamID");o(t6,"typeStreamID");function Bk(e,t){let r=new URL(e);for(let[n,a]of Object.entries(t))Xt.isInstance(a)?r.searchParams.set(n,a.toString()):typeof a=="object"?r.searchParams.set(n,JSON.stringify(a)):r.searchParams.set(n,a);return r}i(Bk,"serializeObjectToSearchParams");o(Bk,"serializeObjectToSearchParams");function r6(e){let t={};for(let[r,n]of Object.entries(e))Xt.isInstance(n)?t[r]=n.toString():t[r]=n;return t}i(r6,"serializeObjectForHttpPost");o(r6,"serializeObjectForHttpPost");var Vi=i(class extends dn{constructor(e,t,r){super(n=>{this.state$.observers.length===0&&(this.periodicSubscription=F2(0,r).pipe(Tk(()=>this._syncState(this.id,{sync:ei.PREFER_CACHE}))).subscribe()),this.state$.subscribe(n).add(()=>{this.state$.observers.length===0&&this.periodicSubscription?.unsubscribe()})}),this.state$=new kk(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 Vi._load(e,this._apiUrl,t);this.state$.next(Hr.deserializeState(r))}get id(){return new Xt(this.state$.value.type,this.state$.value.log[0].cid)}static async createFromGenesis(e,t,r,n,a){let s=new URL("./streams",e),{state:c}=await _i(s,{method:"post",body:{type:t,genesis:Hr.serializeCommit(r),opts:n}});return new Vi(Hr.deserializeState(c),e,a)}static async applyCommit(e,t,r,n,a){let s=new URL("./commits",e),{state:c}=await _i(s,{method:"post",body:{streamId:t.toString(),commit:Hr.serializeCommit(r),opts:n}});return new Vi(Hr.deserializeState(c),e,a)}static async _load(e,t,r){let n=Bk(new URL(`./streams/${e}`,t),r),{state:a}=await _i(n);return a}static async load(e,t,r,n){let a=await Vi._load(e,t,n);return new Vi(Hr.deserializeState(a),t,r)}static async loadStreamCommits(e,t){let r=new URL(`./commits/${e}`,t),{commits:n}=await _i(r);return n.map(a=>({cid:a.cid,value:Hr.deserializeCommit(a.value)}))}complete(){this.state$.complete()}},"Document");o(Vi,"Document");var ud;(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"})(ud||(ud={}));var lS=ir(Sd(),1),fS;(function(e){e[e.GENESIS=0]="GENESIS",e[e.PARTIAL=1]="PARTIAL",e[e.SIGNED=2]="SIGNED"})(fS||(fS={}));var n6;(function(e){e[e.GENESIS=0]="GENESIS",e[e.SIGNED=1]="SIGNED",e[e.ANCHOR=2]="ANCHOR"})(n6||(n6={}));var Lk=i(class extends dn{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,lS.default)(e?.content??t)}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Ar.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map(({cid:e})=>Ar.make(this.id,e))}get anchorCommitIds(){return this.state$.value.log.filter(({type:e})=>e===n6.ANCHOR).map(({cid:e})=>Ar.make(this.id,e))}get state(){return(0,lS.default)(this.state$.value)}async sync(e={}){e={sync:ud.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");o(Lk,"Stream");function Uk(){return e=>{}}i(Uk,"StreamStatic2");o(Uk,"StreamStatic");function Fk(e){if(typeof e=="string"&&e.includes("@")){let[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new id({address:t,chainId:r})}return new id(e)}i(Fk,"normalizeAccountId");o(Fk,"normalizeAccountId");var XH="(?:%[0-9a-fA-F]{2})",dS=`(?:[a-zA-Z0-9._-]|${XH})`,QH="([a-z0-9]+)",eq=`((?:${dS}*:)*(${dS}+))`,hS="[a-zA-Z0-9_.:%-]",tq=`;${hS}+=${hS}*`,rq=`((${tq})*)`,nq="(/[^#?]*)?",iq="([?][^#]*)?",aq="(#.*)?",oq=new RegExp(`^did:${QH}:${eq}${rq}${nq}${iq}${aq}$`);function jk(e){if(e===""||!e)return null;let t=e.match(oq);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 a of n){let s=a.split("=");r.params[s[0]]=s[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(jk,"parse2");o(jk,"parse");var sq=ir(Sd(),1),cq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate4"),bc,lb=o(()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")},"throwReadOnlyError"),pS={anchor:!1,publish:!0,sync:ud.PREFER_CACHE},fb={anchor:!0,publish:!0},uq={sync:ud.PREFER_CACHE},Gu=bc=o(i(class extends Lk{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}get metadata(){let{next:t,metadata:r}=this.state$.value;return(0,sq.default)(t?.metadata??r)}get controllers(){return this.metadata.controllers}static async fromAccount(t,r,n={}){n={...pS,...n};let a=Fk(r),s=bc.makeGenesis(a);return bc.fromGenesis(t,s,n)}static async fromGenesis(t,r,n={}){return n={...pS,...n},t.createStreamFromGenesis(bc.STREAM_TYPE_ID,r,n)}async setDid(t,r,n={}){n={...fb,...n};let a=typeof t=="string"?t.trim():t.id;if(jk(a)?.did!==a)throw new Error(`DID is not valid: '${a}'`);let c=await r.createLink(a);return this.setDidProof(c,n)}async setDidProof(t,r={}){r={...fb,...r};let n=this.makeCommit(t),a=await this.api.applyCommit(this.id,n,r);this.state$.next(a.state)}async clearDid(t,r={}){r={...fb,...r};let n=await t.createLink("");return this.setDidProof(n,r)}static async load(t,r,n={}){n={...uq,...n};let a=_s.from(r);if(a.type!=bc.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${bc.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,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=lb,this.setDid=lb,this.sync=lb,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link2"),"Caip10Link");Gu.STREAM_TYPE_NAME="caip10-link";Gu.STREAM_TYPE_ID=1;Gu=bc=cq([Uk()],Gu);Ga();al();var lq=ir($$(),1),fq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate5"),$a,dq={sync:ei.PREFER_CACHE};async function i6(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(i6,"_ensureAuthenticated");o(i6,"_ensureAuthenticated");async function $k(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i($k,"throwReadOnlyError3");o($k,"throwReadOnlyError");var kc=$a=o(i(class extends Ym{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}get metadata(){return{controller:this.state$.value.metadata.controllers[0],model:$a.MODEL}}static async create(t,r,n){$a.assertComplete(r);let a={publish:!0,anchor:!0,pin:!0,sync:ei.NEVER_SYNC,throwOnInvalidCommit:!0},s=await $a._makeGenesis(t,r,n);return await t.createStreamFromGenesis($a.STREAM_TYPE_ID,s,a)}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={...dq,...n};let a=_s.from(r);if(a.type!=$a.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${$a.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return await t.loadStream(a,n)}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return $a._signDagJWS(t,a)}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 i6(t),n={controller:t.did.hasParent?t.did.parent:t.did.id};else throw new Error("No controller specified");let a={controllers:[n.controller],model:$a.MODEL.bytes};return{data:r,header:a}}makeReadOnly(){this.sync=$k,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}static async _signDagJWS(t,r){return await i6(t),t.did.createDagJWS(r)}},"Model2"),"Model");kc.STREAM_TYPE_NAME="model";kc.STREAM_TYPE_ID=2;kc.MODEL=function(){let e=Um("model-v1"),t=lq.default.encode(e,"identity"),r=Hu(W0,t),n=$t.createV1(W0,r);return new Xt("UNLOADABLE",n)}();kc=$a=fq([Xm()],kc);var hq=ir(cl(),1),pq=i(function(e,t,r,n){var a=arguments.length,s=a<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,t,r,n);else for(var l=e.length-1;l>=0;l--)(c=e[l])&&(s=(a<3?c(s):a>3?c(t,r,s):c(t,r))||s);return a>3&&s&&Object.defineProperty(t,r,s),s},"__decorate6"),sa,mq={anchor:!0,publish:!0,pin:!0,sync:ei.NEVER_SYNC,syncTimeoutSeconds:0},gq={anchor:!1,publish:!1,pin:!0,sync:ei.PREFER_CACHE},vq={sync:ei.PREFER_CACHE},mS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};async function a6(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(a6,"_ensureAuthenticated2");o(a6,"_ensureAuthenticated");async function U0(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}i(U0,"throwReadOnlyError4");o(U0,"throwReadOnlyError");var Wu=sa=o(i(class extends Ym{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,a={}){a={...mq,...a};let s=a.asDID?{did:a.asDID}:t,c=await sa._makeGenesis(s,r,n);return t.createStreamFromGenesis(sa.STREAM_TYPE_ID,c,a)}static async single(t,r,n={}){n={...gq,...n};let a=n.asDID?{did:n.asDID}:t;r={...r,deterministic:!0};let s=await sa._makeGenesis(a,null,r);return t.createStreamFromGenesis(sa.STREAM_TYPE_ID,s,n)}static async load(t,r,n={}){n={...vq,...n};let a=_s.from(r);if(a.type!=sa.STREAM_TYPE_ID)throw new Error(`StreamID ${a.toString()} does not refer to a '${sa.STREAM_TYPE_NAME}' stream, but to a ${a.typeName}`);return t.loadStream(a,n)}async replace(t,r={}){r={...mS,...r};let n=r.asDID?{did:r.asDID}:this.api,a=await this._makeCommit(n,t),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}async patch(t,r={}){r={...mS,...r};let n={data:t,prev:this.tip,id:this.id.cid},a=await sa._signDagJWS(this.api,n),s=await this.api.applyCommit(this.id,a,r);this.state$.next(s.state)}makeReadOnly(){this.replace=U0,this.patch=U0,this.sync=U0,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}_makeCommit(t,r){let n=this._makeRawCommit(r);return sa._signDagJWS(t,n)}_makeRawCommit(t){return{data:vI.compare(this.content,t||{}),prev:this.tip,id:this.state.log[0].cid}}static async _makeGenesis(t,r,n){let a=await this._makeRawGenesis(t,r,n);return n.deterministic?(Um(a),a):sa._signDagJWS(t,a)}static async _makeRawGenesis(t,r,n){if(!n.model)throw new Error("Must specify a 'model' when creating a ModelInstanceDocument");let a=n.controller;if(!a)if(t.did)await a6(t),a=t.did.hasParent?t.did.parent:t.did.id;else throw new Error("No controller specified");let s={controllers:[a],model:n.model.bytes};return n.deterministic||(s.unique=(0,hq.randomBytes)(12)),{data:r,header:s}}static async _signDagJWS(t,r){return await a6(t),t.did.createDagJWS(r)}},"ModelInstanceDocument2"),"ModelInstanceDocument");Wu.STREAM_TYPE_NAME="MID";Wu.STREAM_TYPE_ID=3;Wu=sa=pq([Xm()],Wu);var zk=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 _i(n,{method:"post",body:r})}async rm(e,t){let r=new URL(`./pins/${e}`,this._apiUrl);await _i(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 _i(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let a=0;return{next(){return a===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[a++],done:!1})}}}}}},"RemotePinApi");o(zk,"RemotePinApi");var Hk=i(class{constructor(e){this._fetchJson=_i,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:r6(e)})).count}async query(e){let t=await this._fetchJson(this._collectionURL,{method:"POST",body:r6(e)});return{edges:t.edges.map(n=>({cursor:n.cursor,node:Hr.deserializeState(n.node)})),pageInfo:t.pageInfo}}},"RemoteIndexApi");o(Hk,"RemoteIndexApi");var qk=i(class{constructor(e,t){this._apiUrl=e,this._getDidFn=t,this._fetchJson=_i,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(s=>s.toString())}:void 0,a=await e.createJWS({code:t,requestPath:this.getModelsUrl().pathname,requestBody:n});return`${a.signatures[0].protected}.${a.payload}.${a.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");o(qk,"RemoteAdminApi");var yq="/api/v0/",bq="http://localhost:7007",wq={syncInterval:5e3},_q={anchor:!0,publish:!0,sync:ei.PREFER_CACHE},Eq={anchor:!0,publish:!0,sync:ei.PREFER_CACHE},gS={sync:ei.PREFER_CACHE},Aq=i(class{constructor(e=bq,t={}){this._config={...wq,...t},this._apiUrl=new URL(yq,e),this._streamCache=new Map,this.context={api:this},this.pin=new zk(this._apiUrl),this.index=new Hk(this._apiUrl);let r=(()=>this.did).bind(this);this.admin=new qk(this._apiUrl,r),this._streamConstructors={[Gu.STREAM_TYPE_ID]:Gu,[kc.STREAM_TYPE_ID]:kc,[Wu.STREAM_TYPE_ID]:Wu,[ko.STREAM_TYPE_ID]:ko}}get did(){return this.context.did}set did(e){this.context.did=e}async createStreamFromGenesis(e,t,r={}){r={...Eq,...r};let n=await Vi.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),a=this._streamCache.get(n.id.toString());return a?(Hr.statesEqual(n.state,a.state)||a.next(n.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.id.toString(),n),this.buildStreamFromDocument(n))}async loadStream(e,t={}){t={...gS,...t};let r=_s.from(e),n=this._streamCache.get(r.baseID.toString());return n?await n._syncState(r,t):(n=await Vi.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(s=>({...s,streamId:typeof s.streamId=="string"?s.streamId:s.streamId.toString()})),n=new URL("./multiqueries",this._apiUrl),a=await _i(n,{method:"post",body:{queries:r,timeout:t}});return Object.entries(a).reduce((s,c)=>{let[l,h]=c,p=Hr.deserializeState(h),g=new Vi(p,this._apiUrl,this._config.syncInterval);return s[l]=this.buildStreamFromDocument(g),s},{})}loadStreamCommits(e){let t=t6(e);return Vi.loadStreamCommits(t,this._apiUrl)}async applyCommit(e,t,r={}){r={..._q,...r};let n=t6(e),a=await Vi.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),s=this._streamCache.get(n.toString());return s?(s.next(a.state),this.buildStreamFromDocument(a)):(this._streamCache.set(n.toString(),a),this.buildStreamFromDocument(a))}async requestAnchor(e,t={}){t={...gS,...t};let{anchorStatus:r}=await _i(`${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 Vi(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 _i(this._apiUrl+"/node/chains");return this._supportedChains=e,e}async close(){Array.from(this._streamCache).map(([,e])=>{e.complete()}),this._streamCache.clear()}},"CeramicClient");o(Aq,"CeramicClient");var nr;(function(e){e.assertEqual=a=>a;function t(a){}i(t,"assertIs"),o(t,"assertIs"),e.assertIs=t;function r(a){throw new Error}i(r,"assertNever"),o(r,"assertNever"),e.assertNever=r,e.arrayToEnum=a=>{let s={};for(let c of a)s[c]=c;return s},e.getValidEnumValues=a=>{let s=e.objectKeys(a).filter(l=>typeof a[a[l]]!="number"),c={};for(let l of s)c[l]=a[l];return e.objectValues(c)},e.objectValues=a=>e.objectKeys(a).map(function(s){return a[s]}),e.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let s=[];for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&s.push(c);return s},e.find=(a,s)=>{for(let c of a)if(s(c))return c},e.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(c=>typeof c=="string"?`'${c}'`:c).join(s)}i(n,"joinValues"),o(n,"joinValues"),e.joinValues=n,e.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(nr||(nr={}));var rt=nr.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ps=o(e=>{switch(typeof e){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return isNaN(e)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(e)?rt.array:e===null?rt.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?rt.promise:typeof Map<"u"&&e instanceof Map?rt.map:typeof Set<"u"&&e instanceof Set?rt.set:typeof Date<"u"&&e instanceof Date?rt.date:rt.object;default:return rt.unknown}},"getParsedType"),Ge=nr.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"]),Sq=o(e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),"quotelessJson"),za=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(a){return a.message},r={_errors:[]},n=o(a=>{for(let s of a.issues)if(s.code==="invalid_union")s.unionErrors.map(n);else if(s.code==="invalid_return_type")n(s.returnTypeError);else if(s.code==="invalid_arguments")n(s.argumentsError);else if(s.path.length===0)r._errors.push(t(s));else{let c=r,l=0;for(;l<s.path.length;){let h=s.path[l];l===s.path.length-1?(c[h]=c[h]||{_errors:[]},c[h]._errors.push(t(s))):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,nr.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");o(za,"ZodError");za.create=e=>new za(e);var ld=o((e,t)=>{let r;switch(e.code){case Ge.invalid_type:e.received===rt.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case Ge.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,nr.jsonStringifyReplacer)}`;break;case Ge.unrecognized_keys:r=`Unrecognized key(s) in object: ${nr.joinValues(e.keys,", ")}`;break;case Ge.invalid_union:r="Invalid input";break;case Ge.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${nr.joinValues(e.options)}`;break;case Ge.invalid_enum_value:r=`Invalid enum value. Expected ${nr.joinValues(e.options)}, received '${e.received}'`;break;case Ge.invalid_arguments:r="Invalid function arguments";break;case Ge.invalid_return_type:r="Invalid function return type";break;case Ge.invalid_date:r="Invalid date";break;case Ge.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}"`:nr.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case Ge.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 Ge.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 Ge.custom:r="Invalid input";break;case Ge.invalid_intersection_types:r="Intersection results could not be merged";break;case Ge.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case Ge.not_finite:r="Number must be finite";break;default:r=t.defaultError,nr.assertNever(e)}return{message:r}},"errorMap"),Vk=ld;function Kk(e){Vk=e}i(Kk,"setErrorMap");o(Kk,"setErrorMap");function fd(){return Vk}i(fd,"getErrorMap");o(fd,"getErrorMap");var fm=o(e=>{let{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],c={...a,path:s},l="",h=n.filter(p=>!!p).slice().reverse();for(let p of h)l=p(c,{data:t,defaultError:l}).message;return{...a,path:s,message:a.message||l}},"makeIssue"),xq=[];function gt(e,t){let r=fm({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,fd(),ld].filter(n=>!!n)});e.common.issues.push(r)}i(gt,"addIssueToContext");o(gt,"addIssueToContext");var Bn=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 Rt;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 Bn.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let n of t){let{key:a,value:s}=n;if(a.status==="aborted"||s.status==="aborted")return Rt;a.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),(typeof s.value<"u"||n.alwaysSet)&&(r[a.value]=s.value)}return{status:e.value,value:r}}},"ParseStatus");o(Bn,"ParseStatus");var Rt=Object.freeze({status:"aborted"}),Gk=o(e=>({status:"dirty",value:e}),"DIRTY"),xn=o(e=>({status:"valid",value:e}),"OK"),o6=o(e=>e.status==="aborted","isAborted"),s6=o(e=>e.status==="dirty","isDirty"),dm=o(e=>e.status==="valid","isValid"),hm=o(e=>typeof Promise!==void 0&&e instanceof Promise,"isAsync"),Jt;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Jt||(Jt={}));var va=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");o(va,"ParseInputLazyPath");var vS=o((e,t)=>{if(dm(t))return{success:!0,data:t.value};{if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");let r=new za(e.common.issues);return{success:!1,error:r}}},"handleResult");function zt(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:a}=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:a}:{errorMap:o((c,l)=>c.code!=="invalid_type"?{message:l.defaultError}:typeof l.data>"u"?{message:n??l.defaultError}:{message:r??l.defaultError},"customMap"),description:a}}i(zt,"processCreateParams");o(zt,"processCreateParams");var jt=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 ps(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Bn,ctx:{common:e.parent.common,data:e.data,parsedType:ps(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(hm(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:ps(e)},a=this._parseSync({data:e,path:n.path,parent:n});return vS(n,a)}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:ps(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(hm(n)?n:Promise.resolve(n));return vS(r,a)}refine(e,t){let r=o(n=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(n):t,"getIssueProperties");return this._refinement((n,a)=>{let s=e(n),c=o(()=>a.addIssue({code:Ge.custom,...r(n)}),"setError");return typeof Promise<"u"&&s instanceof Promise?s.then(l=>l?!0:(c(),!1)):s?!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 Gi({schema:this,typeName:Tt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return ma.create(this)}nullable(){return Ss.create(this)}nullish(){return this.optional().nullable()}array(){return pa.create(this)}promise(){return Nc.create(this)}or(e){return Qu.create([this,e])}and(e){return el.create(this,e)}transform(e){return new Gi({schema:this,typeName:Tt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e=="function"?e:()=>e;return new il({innerType:this,defaultValue:t,typeName:Tt.ZodDefault})}brand(){return new z2({typeName:Tt.ZodBranded,type:this,...zt(void 0)})}catch(e){let t=typeof e=="function"?e:()=>e;return new gd({innerType:this,defaultValue:t,typeName:Tt.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Nd.create(this,e)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},"ZodType");o(jt,"ZodType");var Tq=/^c[^\s-]{8,}$/i,Cq=/^([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,Mq=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,Iq=o(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"),Do=i(class extends jt{constructor(){super(...arguments),this._regex=(e,t,r)=>this.refinement(n=>e.test(n),{validation:t,code:Ge.invalid_string,...Jt.errToObj(r)}),this.nonempty=e=>this.min(1,Jt.errToObj(e)),this.trim=()=>new Do({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rt.string){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.string,received:a.parsedType}),Rt}let r=new Bn,n;for(let a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){let s=e.data.length>a.value,c=e.data.length<a.value;(s||c)&&(n=this._getOrReturnCtx(e,n),s?gt(n,{code:Ge.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):c&&gt(n,{code:Ge.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")Mq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"email",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")Cq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"uuid",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")Tq.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"cuid",code:Ge.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),gt(n,{validation:"url",code:Ge.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{validation:"regex",code:Ge.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="startsWith"?e.data.startsWith(a.value)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?Iq(a).test(e.data)||(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.invalid_string,validation:"datetime",message:a.message}),r.dirty()):nr.assertNever(a);return{status:r.value,value:e.data}}_addCheck(e){return new Do({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Jt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Jt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Jt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Jt.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,...Jt.errToObj(e?.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Jt.errToObj(t)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Jt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Jt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Jt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Jt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Jt.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 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");o(Do,"ZodString");Do.create=e=>{var t;return new Do({checks:[],typeName:Tt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...zt(e)})};function Wk(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n,s=parseInt(e.toFixed(a).replace(".","")),c=parseInt(t.toFixed(a).replace(".",""));return s%c/Math.pow(10,a)}i(Wk,"floatSafeRemainder");o(Wk,"floatSafeRemainder");var As=i(class extends jt{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)!==rt.number){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.number,received:a.parsedType}),Rt}let r,n=new Bn;for(let a of this._def.checks)a.kind==="int"?nr.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.invalid_type,expected:"integer",received:"float",message:a.message}),n.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),n.dirty()):a.kind==="multipleOf"?Wk(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),gt(r,{code:Ge.not_finite,message:a.message}),n.dirty()):nr.assertNever(a);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Jt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Jt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Jt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Jt.toString(t))}setLimit(e,t,r,n){return new As({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Jt.toString(n)}]})}_addCheck(e){return new As({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Jt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Jt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Jt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Jt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Jt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Jt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Jt.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")}},"ZodNumber");o(As,"ZodNumber");As.create=e=>new As({checks:[],typeName:Tt.ZodNumber,coerce:e?.coerce||!1,...zt(e)});var Ju=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==rt.bigint){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.bigint,received:r.parsedType}),Rt}return xn(e.data)}},"ZodBigInt");o(Ju,"ZodBigInt");Ju.create=e=>{var t;return new Ju({typeName:Tt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...zt(e)})};var Zu=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==rt.boolean){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.boolean,received:r.parsedType}),Rt}return xn(e.data)}},"ZodBoolean");o(Zu,"ZodBoolean");Zu.create=e=>new Zu({typeName:Tt.ZodBoolean,coerce:e?.coerce||!1,...zt(e)});var Dc=i(class extends jt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rt.date){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_type,expected:rt.date,received:a.parsedType}),Rt}if(isNaN(e.data.getTime())){let a=this._getOrReturnCtx(e);return gt(a,{code:Ge.invalid_date}),Rt}let r=new Bn,n;for(let a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(n=this._getOrReturnCtx(e,n),gt(n,{code:Ge.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):nr.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Dc({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Jt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Jt.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");o(Dc,"ZodDate");Dc.create=e=>new Dc({checks:[],coerce:e?.coerce||!1,typeName:Tt.ZodDate,...zt(e)});var dd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.symbol){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.symbol,received:r.parsedType}),Rt}return xn(e.data)}},"ZodSymbol");o(dd,"ZodSymbol");dd.create=e=>new dd({typeName:Tt.ZodSymbol,...zt(e)});var Yu=i(class extends jt{_parse(e){if(this._getType(e)!==rt.undefined){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.undefined,received:r.parsedType}),Rt}return xn(e.data)}},"ZodUndefined");o(Yu,"ZodUndefined");Yu.create=e=>new Yu({typeName:Tt.ZodUndefined,...zt(e)});var Xu=i(class extends jt{_parse(e){if(this._getType(e)!==rt.null){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.null,received:r.parsedType}),Rt}return xn(e.data)}},"ZodNull");o(Xu,"ZodNull");Xu.create=e=>new Xu({typeName:Tt.ZodNull,...zt(e)});var Rc=i(class extends jt{constructor(){super(...arguments),this._any=!0}_parse(e){return xn(e.data)}},"ZodAny");o(Rc,"ZodAny");Rc.create=e=>new Rc({typeName:Tt.ZodAny,...zt(e)});var gs=i(class extends jt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return xn(e.data)}},"ZodUnknown");o(gs,"ZodUnknown");gs.create=e=>new gs({typeName:Tt.ZodUnknown,...zt(e)});var Ha=i(class extends jt{_parse(e){let t=this._getOrReturnCtx(e);return gt(t,{code:Ge.invalid_type,expected:rt.never,received:t.parsedType}),Rt}},"ZodNever");o(Ha,"ZodNever");Ha.create=e=>new Ha({typeName:Tt.ZodNever,...zt(e)});var hd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.undefined){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.void,received:r.parsedType}),Rt}return xn(e.data)}},"ZodVoid");o(hd,"ZodVoid");hd.create=e=>new hd({typeName:Tt.ZodVoid,...zt(e)});var pa=i(class extends jt{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==rt.array)return gt(t,{code:Ge.invalid_type,expected:rt.array,received:t.parsedType}),Rt;if(n.exactLength!==null){let s=t.data.length>n.exactLength.value,c=t.data.length<n.exactLength.value;(s||c)&&(gt(t,{code:s?Ge.too_big:Ge.too_small,minimum:c?n.exactLength.value:void 0,maximum:s?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&&(gt(t,{code:Ge.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&&(gt(t,{code:Ge.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((s,c)=>n.type._parseAsync(new va(t,s,t.path,c)))).then(s=>Bn.mergeArray(r,s));let a=t.data.map((s,c)=>n.type._parseSync(new va(t,s,t.path,c)));return Bn.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new pa({...this._def,minLength:{value:e,message:Jt.toString(t)}})}max(e,t){return new pa({...this._def,maxLength:{value:e,message:Jt.toString(t)}})}length(e,t){return new pa({...this._def,exactLength:{value:e,message:Jt.toString(t)}})}nonempty(e){return this.min(1,e)}},"ZodArray");o(pa,"ZodArray");pa.create=(e,t)=>new pa({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Tt.ZodArray,...zt(t)});var pm;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(pm||(pm={}));var yS=o(e=>t=>new Dr({...e,shape:()=>({...e.shape(),...t})}),"AugmentFactory");function _c(e){if(e instanceof Dr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=ma.create(_c(n))}return new Dr({...e._def,shape:()=>t})}else return e instanceof pa?pa.create(_c(e.element)):e instanceof ma?ma.create(_c(e.unwrap())):e instanceof Ss?Ss.create(_c(e.unwrap())):e instanceof qa?qa.create(e.items.map(t=>_c(t))):e}i(_c,"deepPartialify");o(_c,"deepPartialify");var Dr=i(class extends jt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=yS(this._def),this.extend=yS(this._def)}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=nr.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==rt.object){let h=this._getOrReturnCtx(e);return gt(h,{code:Ge.invalid_type,expected:rt.object,received:h.parsedType}),Rt}let{status:r,ctx:n}=this._processInputParams(e),{shape:a,keys:s}=this._getCached(),c=[];if(!(this._def.catchall instanceof Ha&&this._def.unknownKeys==="strip"))for(let h in n.data)s.includes(h)||c.push(h);let l=[];for(let h of s){let p=a[h],g=n.data[h];l.push({key:{status:"valid",value:h},value:p._parse(new va(n,g,n.path,h)),alwaysSet:h in n.data})}if(this._def.catchall instanceof Ha){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&&(gt(n,{code:Ge.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 g=n.data[p];l.push({key:{status:"valid",value:p},value:h._parse(new va(n,g,n.path,p)),alwaysSet:p in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let h=[];for(let p of l){let g=await p.key;h.push({key:g,value:await p.value,alwaysSet:p.alwaysSet})}return h}).then(h=>Bn.mergeObjectSync(r,h)):Bn.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return Jt.errToObj,new Dr({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var n,a,s,c;let l=(s=(a=(n=this._def).errorMap)===null||a===void 0?void 0:a.call(n,t,r).message)!==null&&s!==void 0?s:r.defaultError;return t.code==="unrecognized_keys"?{message:(c=Jt.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"})}setKey(e,t){return this.augment({[e]:t})}merge(e){return new Dr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>pm.mergeShapes(this._def.shape(),e._def.shape()),typeName:Tt.ZodObject})}catchall(e){return new Dr({...this._def,catchall:e})}pick(e){let t={};return nr.objectKeys(e).map(r=>{this.shape[r]&&(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}omit(e){let t={};return nr.objectKeys(this.shape).map(r=>{nr.objectKeys(e).indexOf(r)===-1&&(t[r]=this.shape[r])}),new Dr({...this._def,shape:()=>t})}deepPartial(){return _c(this)}partial(e){let t={};if(e)return nr.objectKeys(this.shape).map(r=>{nr.objectKeys(e).indexOf(r)===-1?t[r]=this.shape[r]:t[r]=this.shape[r].optional()}),new Dr({...this._def,shape:()=>t});for(let r in this.shape){let n=this.shape[r];t[r]=n.optional()}return new Dr({...this._def,shape:()=>t})}required(e){let t={};if(e)nr.objectKeys(this.shape).map(r=>{if(nr.objectKeys(e).indexOf(r)===-1)t[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof ma;)a=a._def.innerType;t[r]=a}});else for(let r in this.shape){let a=this.shape[r];for(;a instanceof ma;)a=a._def.innerType;t[r]=a}return new Dr({...this._def,shape:()=>t})}keyof(){return $2(nr.objectKeys(this.shape))}},"ZodObject");o(Dr,"ZodObject");Dr.create=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strip",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});Dr.strictCreate=(e,t)=>new Dr({shape:()=>e,unknownKeys:"strict",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});Dr.lazycreate=(e,t)=>new Dr({shape:e,unknownKeys:"strip",catchall:Ha.create(),typeName:Tt.ZodObject,...zt(t)});var Qu=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;function n(a){for(let c of a)if(c.result.status==="valid")return c.result;for(let c of a)if(c.result.status==="dirty")return t.common.issues.push(...c.ctx.common.issues),c.result;let s=a.map(c=>new za(c.ctx.common.issues));return gt(t,{code:Ge.invalid_union,unionErrors:s}),Rt}if(i(n,"handleResults"),o(n,"handleResults"),t.common.async)return Promise.all(r.map(async a=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await a._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(n);{let a,s=[];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"&&!a&&(a={result:p,ctx:h}),h.common.issues.length&&s.push(h.common.issues)}if(a)return t.common.issues.push(...a.ctx.common.issues),a.result;let c=s.map(l=>new za(l));return gt(t,{code:Ge.invalid_union,unionErrors:c}),Rt}}get options(){return this._def.options}},"ZodUnion");o(Qu,"ZodUnion");Qu.create=(e,t)=>new Qu({options:e,typeName:Tt.ZodUnion,...zt(t)});var F0=o(e=>e instanceof tl?F0(e.schema):e instanceof Gi?F0(e.innerType()):e instanceof rl?[e.value]:e instanceof wl?e.options:e instanceof nl?Object.keys(e.enum):e instanceof il?F0(e._def.innerType):e instanceof Yu?[void 0]:e instanceof Xu?[null]:null,"getDiscriminator"),Qm=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.object)return gt(t,{code:Ge.invalid_type,expected:rt.object,received:t.parsedType}),Rt;let r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(gt(t,{code:Ge.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Rt)}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 a of t){let s=F0(a.shape[e]);if(!s)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let c of s){if(n.has(c))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(c)}`);n.set(c,a)}}return new Qm({typeName:Tt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...zt(r)})}},"ZodDiscriminatedUnion");o(Qm,"ZodDiscriminatedUnion");function mm(e,t){let r=ps(e),n=ps(t);if(e===t)return{valid:!0,data:e};if(r===rt.object&&n===rt.object){let a=nr.objectKeys(t),s=nr.objectKeys(e).filter(l=>a.indexOf(l)!==-1),c={...e,...t};for(let l of s){let h=mm(e[l],t[l]);if(!h.valid)return{valid:!1};c[l]=h.data}return{valid:!0,data:c}}else if(r===rt.array&&n===rt.array){if(e.length!==t.length)return{valid:!1};let a=[];for(let s=0;s<e.length;s++){let c=e[s],l=t[s],h=mm(c,l);if(!h.valid)return{valid:!1};a.push(h.data)}return{valid:!0,data:a}}else return r===rt.date&&n===rt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}i(mm,"mergeValues");o(mm,"mergeValues");var el=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),n=o((a,s)=>{if(o6(a)||o6(s))return Rt;let c=mm(a.value,s.value);return c.valid?((s6(a)||s6(s))&&t.dirty(),{status:t.value,value:c.data}):(gt(r,{code:Ge.invalid_intersection_types}),Rt)},"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(([a,s])=>n(a,s)):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");o(el,"ZodIntersection");el.create=(e,t,r)=>new el({left:e,right:t,typeName:Tt.ZodIntersection,...zt(r)});var qa=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.array)return gt(r,{code:Ge.invalid_type,expected:rt.array,received:r.parsedType}),Rt;if(r.data.length<this._def.items.length)return gt(r,{code:Ge.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rt;!this._def.rest&&r.data.length>this._def.items.length&&(gt(r,{code:Ge.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let a=r.data.map((s,c)=>{let l=this._def.items[c]||this._def.rest;return l?l._parse(new va(r,s,r.path,c)):null}).filter(s=>!!s);return r.common.async?Promise.all(a).then(s=>Bn.mergeArray(t,s)):Bn.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new qa({...this._def,rest:e})}},"ZodTuple");o(qa,"ZodTuple");qa.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new qa({items:e,typeName:Tt.ZodTuple,rest:null,...zt(t)})};var pd=i(class extends jt{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!==rt.object)return gt(r,{code:Ge.invalid_type,expected:rt.object,received:r.parsedType}),Rt;let n=[],a=this._def.keyType,s=this._def.valueType;for(let c in r.data)n.push({key:a._parse(new va(r,c,r.path,c)),value:s._parse(new va(r,r.data[c],r.path,c))});return r.common.async?Bn.mergeObjectAsync(t,n):Bn.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof jt?new pd({keyType:e,valueType:t,typeName:Tt.ZodRecord,...zt(r)}):new pd({keyType:Do.create(),valueType:e,typeName:Tt.ZodRecord,...zt(t)})}},"ZodRecord");o(pd,"ZodRecord");var md=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.map)return gt(r,{code:Ge.invalid_type,expected:rt.map,received:r.parsedType}),Rt;let n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map(([c,l],h)=>({key:n._parse(new va(r,c,r.path,[h,"key"])),value:a._parse(new va(r,l,r.path,[h,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let l of s){let h=await l.key,p=await l.value;if(h.status==="aborted"||p.status==="aborted")return Rt;(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 s){let h=l.key,p=l.value;if(h.status==="aborted"||p.status==="aborted")return Rt;(h.status==="dirty"||p.status==="dirty")&&t.dirty(),c.set(h.value,p.value)}return{status:t.value,value:c}}}},"ZodMap");o(md,"ZodMap");md.create=(e,t,r)=>new md({valueType:t,keyType:e,typeName:Tt.ZodMap,...zt(r)});var Oc=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.set)return gt(r,{code:Ge.invalid_type,expected:rt.set,received:r.parsedType}),Rt;let n=this._def;n.minSize!==null&&r.data.size<n.minSize.value&&(gt(r,{code:Ge.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&&(gt(r,{code:Ge.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());let a=this._def.valueType;function s(l){let h=new Set;for(let p of l){if(p.status==="aborted")return Rt;p.status==="dirty"&&t.dirty(),h.add(p.value)}return{status:t.value,value:h}}i(s,"finalizeSet"),o(s,"finalizeSet");let c=[...r.data.values()].map((l,h)=>a._parse(new va(r,l,r.path,h)));return r.common.async?Promise.all(c).then(l=>s(l)):s(c)}min(e,t){return new Oc({...this._def,minSize:{value:e,message:Jt.toString(t)}})}max(e,t){return new Oc({...this._def,maxSize:{value:e,message:Jt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}},"ZodSet");o(Oc,"ZodSet");Oc.create=(e,t)=>new Oc({valueType:e,minSize:null,maxSize:null,typeName:Tt.ZodSet,...zt(t)});var ju=i(class extends jt{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.function)return gt(t,{code:Ge.invalid_type,expected:rt.function,received:t.parsedType}),Rt;function r(c,l){return fm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fd(),ld].filter(h=>!!h),issueData:{code:Ge.invalid_arguments,argumentsError:l}})}i(r,"makeArgsIssue"),o(r,"makeArgsIssue");function n(c,l){return fm({data:c,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,fd(),ld].filter(h=>!!h),issueData:{code:Ge.invalid_return_type,returnTypeError:l}})}i(n,"makeReturnsIssue"),o(n,"makeReturnsIssue");let a={errorMap:t.common.contextualErrorMap},s=t.data;return this._def.returns instanceof Nc?xn(async(...c)=>{let l=new za([]),h=await this._def.args.parseAsync(c,a).catch(v=>{throw l.addIssue(r(c,v)),l}),p=await s(...h);return await this._def.returns._def.type.parseAsync(p,a).catch(v=>{throw l.addIssue(n(p,v)),l})}):xn((...c)=>{let l=this._def.args.safeParse(c,a);if(!l.success)throw new za([r(c,l.error)]);let h=s(...l.data),p=this._def.returns.safeParse(h,a);if(!p.success)throw new za([n(h,p.error)]);return p.data})}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ju({...this._def,args:qa.create(e).rest(gs.create())})}returns(e){return new ju({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new ju({args:e||qa.create([]).rest(gs.create()),returns:t||gs.create(),typeName:Tt.ZodFunction,...zt(r)})}},"ZodFunction");o(ju,"ZodFunction");var tl=i(class extends jt{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");o(tl,"ZodLazy");tl.create=(e,t)=>new tl({getter:e,typeName:Tt.ZodLazy,...zt(t)});var rl=i(class extends jt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return gt(t,{code:Ge.invalid_literal,expected:this._def.value}),Rt}return{status:"valid",value:e.data}}get value(){return this._def.value}},"ZodLiteral");o(rl,"ZodLiteral");rl.create=(e,t)=>new rl({value:e,typeName:Tt.ZodLiteral,...zt(t)});function $2(e,t){return new wl({values:e,typeName:Tt.ZodEnum,...zt(t)})}i($2,"createZodEnum");o($2,"createZodEnum");var wl=i(class extends jt{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),r=this._def.values;return gt(t,{expected:nr.joinValues(r),received:t.parsedType,code:Ge.invalid_type}),Rt}if(this._def.values.indexOf(e.data)===-1){let t=this._getOrReturnCtx(e),r=this._def.values;return gt(t,{received:t.data,code:Ge.invalid_enum_value,options:r}),Rt}return xn(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}},"ZodEnum");o(wl,"ZodEnum");wl.create=$2;var nl=i(class extends jt{_parse(e){let t=nr.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){let n=nr.objectValues(t);return gt(r,{expected:nr.joinValues(n),received:r.parsedType,code:Ge.invalid_type}),Rt}if(t.indexOf(e.data)===-1){let n=nr.objectValues(t);return gt(r,{received:r.data,code:Ge.invalid_enum_value,options:n}),Rt}return xn(e.data)}get enum(){return this._def.values}},"ZodNativeEnum");o(nl,"ZodNativeEnum");nl.create=(e,t)=>new nl({values:e,typeName:Tt.ZodNativeEnum,...zt(t)});var Nc=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==rt.promise&&t.common.async===!1)return gt(t,{code:Ge.invalid_type,expected:rt.promise,received:t.parsedType}),Rt;let r=t.parsedType===rt.promise?t.data:Promise.resolve(t.data);return xn(r.then(n=>this._def.type.parseAsync(n,{path:t.path,errorMap:t.common.contextualErrorMap})))}},"ZodPromise");o(Nc,"ZodPromise");Nc.create=(e,t)=>new Nc({type:e,typeName:Tt.ZodPromise,...zt(t)});var Gi=i(class extends jt{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 s=n.transform(r.data);return r.common.async?Promise.resolve(s).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:s,path:r.path,parent:r})}let a={addIssue:s=>{gt(r,s),s.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),n.type==="refinement"){let s=o(c=>{let l=n.refinement(c,a);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"?Rt:(c.status==="dirty"&&t.dirty(),s(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"?Rt:(c.status==="dirty"&&t.dirty(),s(c.value).then(()=>({status:t.value,value:c.value}))))}if(n.type==="transform")if(r.common.async===!1){let s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!dm(s))return s;let c=n.transform(s.value,a);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(s=>dm(s)?Promise.resolve(n.transform(s.value,a)).then(c=>({status:t.value,value:c})):s);nr.assertNever(n)}},"ZodEffects");o(Gi,"ZodEffects");Gi.create=(e,t,r)=>new Gi({schema:e,typeName:Tt.ZodEffects,effect:t,...zt(r)});Gi.createWithPreprocess=(e,t,r)=>new Gi({schema:t,effect:{type:"preprocess",transform:e},typeName:Tt.ZodEffects,...zt(r)});var ma=i(class extends jt{_parse(e){return this._getType(e)===rt.undefined?xn(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodOptional");o(ma,"ZodOptional");ma.create=(e,t)=>new ma({innerType:e,typeName:Tt.ZodOptional,...zt(t)});var Ss=i(class extends jt{_parse(e){return this._getType(e)===rt.null?xn(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}},"ZodNullable");o(Ss,"ZodNullable");Ss.create=(e,t)=>new Ss({innerType:e,typeName:Tt.ZodNullable,...zt(t)});var il=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}},"ZodDefault");o(il,"ZodDefault");il.create=(e,t)=>new il({innerType:e,typeName:Tt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});var gd=i(class extends jt{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.innerType._parse({data:t.data,path:t.path,parent:t});return hm(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.defaultValue()})):{status:"valid",value:r.status==="valid"?r.value:this._def.defaultValue()}}removeDefault(){return this._def.innerType}},"ZodCatch");o(gd,"ZodCatch");gd.create=(e,t)=>new gd({innerType:e,typeName:Tt.ZodCatch,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...zt(t)});var vd=i(class extends jt{_parse(e){if(this._getType(e)!==rt.nan){let r=this._getOrReturnCtx(e);return gt(r,{code:Ge.invalid_type,expected:rt.nan,received:r.parsedType}),Rt}return{status:"valid",value:e.data}}},"ZodNaN");o(vd,"ZodNaN");vd.create=e=>new vd({typeName:Tt.ZodNaN,...zt(e)});var kq=Symbol("zod_brand"),z2=i(class extends jt{_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");o(z2,"ZodBranded");var Nd=i(class extends jt{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return o(async()=>{let a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Rt:a.status==="dirty"?(t.dirty(),Gk(a.value)):this._def.out._parseAsync({data:a.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"?Rt: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 Nd({in:e,out:t,typeName:Tt.ZodPipeline})}},"ZodPipeline");o(Nd,"ZodPipeline");var Jk=o((e,t={},r)=>e?Rc.create().superRefine((n,a)=>{if(!e(n)){let s=typeof t=="function"?t(n):t,c=typeof s=="string"?{message:s}:s;a.addIssue({code:"custom",...c,fatal:r})}}):Rc.create(),"custom"),Dq={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 Rq=o((e,t={message:`Input not instance of ${e.name}`})=>Jk(r=>r instanceof e,t,!0),"instanceOfType"),Zk=Do.create,Yk=As.create,Oq=vd.create,Nq=Ju.create,Xk=Zu.create,Pq=Dc.create,Bq=dd.create,Lq=Yu.create,Uq=Xu.create,Fq=Rc.create,jq=gs.create,$q=Ha.create,zq=hd.create,Hq=pa.create,qq=Dr.create,Vq=Dr.strictCreate,Kq=Qu.create,Gq=Qm.create,Wq=el.create,Jq=qa.create,Zq=pd.create,Yq=md.create,Xq=Oc.create,Qq=ju.create,eV=tl.create,tV=rl.create,rV=wl.create,nV=nl.create,iV=Nc.create,bS=Gi.create,aV=ma.create,oV=Ss.create,sV=Gi.createWithPreprocess,cV=Nd.create,uV=o(()=>Zk().optional(),"ostring"),lV=o(()=>Yk().optional(),"onumber"),fV=o(()=>Xk().optional(),"oboolean"),dV={string:e=>Do.create({...e,coerce:!0}),number:e=>As.create({...e,coerce:!0}),boolean:e=>Zu.create({...e,coerce:!0}),bigint:e=>Ju.create({...e,coerce:!0}),date:e=>Dc.create({...e,coerce:!0})},hV=Rt,H=Object.freeze({__proto__:null,defaultErrorMap:ld,setErrorMap:Kk,getErrorMap:fd,makeIssue:fm,EMPTY_PATH:xq,addIssueToContext:gt,ParseStatus:Bn,INVALID:Rt,DIRTY:Gk,OK:xn,isAborted:o6,isDirty:s6,isValid:dm,isAsync:hm,get util(){return nr},ZodParsedType:rt,getParsedType:ps,ZodType:jt,ZodString:Do,ZodNumber:As,ZodBigInt:Ju,ZodBoolean:Zu,ZodDate:Dc,ZodSymbol:dd,ZodUndefined:Yu,ZodNull:Xu,ZodAny:Rc,ZodUnknown:gs,ZodNever:Ha,ZodVoid:hd,ZodArray:pa,get objectUtil(){return pm},ZodObject:Dr,ZodUnion:Qu,ZodDiscriminatedUnion:Qm,ZodIntersection:el,ZodTuple:qa,ZodRecord:pd,ZodMap:md,ZodSet:Oc,ZodFunction:ju,ZodLazy:tl,ZodLiteral:rl,ZodEnum:wl,ZodNativeEnum:nl,ZodPromise:Nc,ZodEffects:Gi,ZodTransformer:Gi,ZodOptional:ma,ZodNullable:Ss,ZodDefault:il,ZodCatch:gd,ZodNaN:vd,BRAND:kq,ZodBranded:z2,ZodPipeline:Nd,custom:Jk,Schema:jt,ZodSchema:jt,late:Dq,get ZodFirstPartyTypeKind(){return Tt},coerce:dV,any:Fq,array:Hq,bigint:Nq,boolean:Xk,date:Pq,discriminatedUnion:Gq,effect:bS,enum:rV,function:Qq,instanceof:Rq,intersection:Wq,lazy:eV,literal:tV,map:Yq,nan:Oq,nativeEnum:nV,never:$q,null:Uq,nullable:oV,number:Yk,object:qq,oboolean:fV,onumber:lV,optional:aV,ostring:uV,pipeline:cV,preprocess:sV,promise:iV,record:Zq,set:Xq,strictObject:Vq,string:Zk,symbol:Bq,transformer:bS,tuple:Jq,undefined:Lq,union:Kq,unknown:jq,void:zq,NEVER:hV,ZodIssueCode:Ge,quotelessJson:Sq,ZodError:za}),pV=Object.defineProperty,mV=o((e,t)=>pV(e,"name",{value:t,configurable:!0}),"__name"),e1=H.array(H.string().or(H.record(H.any()))),eX=H.object({type:H.string().optional(),narrative:H.string().optional()}),t1=H.string().or(H.object({id:H.string(),type:H.string(),caption:H.string().optional()})),gV=H.object({type:H.string().min(1).or(H.string().array().nonempty()),latitude:H.number(),longitude:H.number()}),vV=H.object({type:H.string().min(1).or(H.string().array().nonempty()),addressCountry:H.string().optional(),addressCountryCode:H.string().optional(),addressRegion:H.string().optional(),addressLocality:H.string().optional(),streetAddress:H.string().optional(),postOfficeBoxNumber:H.string().optional(),postalCode:H.string().optional(),geo:gV.optional()}),yV=H.enum(["sourcedId","systemId","productId","userName","accountId","emailAddress","nationalIdentityNumber","isbn","issn","lisSourcedId","oneRosterSourcedId","sisSourcedId","ltiContextId","ltiDeploymentId","ltiToolId","ltiPlatformId","ltiUserId","identifier"]).or(H.string()),Qk=H.object({type:H.string().min(1).or(H.string().array().nonempty()),identifier:H.string(),identifierType:yV}),yd=H.string().or(H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty().optional()),name:H.string().optional(),url:H.string().optional(),phone:H.string().optional(),description:H.string().optional(),endorsement:H.any().array().optional(),image:t1.optional(),email:H.string().email().optional(),address:vV.optional(),otherIdentifier:Qk.array().optional(),official:H.string().optional(),parentOrg:H.any().optional(),familyName:H.string().optional(),givenName:H.string().optional(),additionalName:H.string().optional(),patronymicName:H.string().optional(),honorificPrefix:H.string().optional(),honorificSuffix:H.string().optional(),familyNamePrefix:H.string().optional(),dateOfBirth:H.string().optional()}).catchall(H.any())),c6=H.object({id:H.string().optional()}).catchall(H.any()),A0=H.object({type:H.string(),id:H.string()}).catchall(H.any()),wS=H.object({id:H.string(),type:H.string()}).catchall(H.any()),_S=H.object({id:H.string().optional(),type:H.string()}).catchall(H.any()),ES=H.object({type:H.string(),id:H.string().optional()}).catchall(H.any()),AS=H.object({type:H.string().or(H.string().array().nonempty()),id:H.string().optional()}).catchall(H.any()),gm=H.object({"@context":e1,id:H.string().optional(),type:H.string().array().nonempty(),issuer:yd,credentialSubject:c6.or(c6.array()),refreshService:_S.or(_S.array()).optional(),credentialSchema:wS.or(wS.array()).optional(),issuanceDate:H.string().optional(),expirationDate:H.string().optional(),credentialStatus:A0.or(A0.array()).optional(),name:H.string().optional(),description:H.string().optional(),validFrom:H.string().optional(),validUntil:H.string().optional(),status:A0.or(A0.array()).optional(),termsOfUse:ES.or(ES.array()).optional(),evidence:AS.or(AS.array()).optional()}).catchall(H.any()),Va=H.object({type:H.string(),created:H.string(),challenge:H.string().optional(),domain:H.string().optional(),nonce:H.string().optional(),proofPurpose:H.string(),verificationMethod:H.string(),jws:H.string().optional()}).catchall(H.any()),SS=gm.extend({proof:Va.or(Va.array())}),bV=H.object({"@context":e1,id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),verifiableCredential:SS.or(SS.array()).optional(),holder:H.string().optional()}).catchall(H.any()),tX=bV.extend({proof:Va.or(Va.array())}),H2=H.object({kty:H.string(),crv:H.string(),x:H.string(),y:H.string().optional(),n:H.string().optional(),d:H.string().optional()}),rX=H2.omit({d:!0}).extend({d:H.string()}),wV=H.object({alg:H.string(),iv:H.string(),tag:H.string(),epk:H2.partial().optional(),kid:H.string().optional(),apv:H.string().optional(),apu:H.string().optional()}),_V=H.object({header:wV,encrypted_key:H.string()}),EV=H.object({protected:H.string(),iv:H.string(),ciphertext:H.string(),tag:H.string(),aad:H.string().optional(),recipients:_V.array().optional()}),yc=H.string().or(H.object({"@context":e1.optional(),id:H.string(),type:H.string(),controller:H.string(),publicKeyJwk:H2.optional(),publicKeyBase58:H.string().optional(),blockChainAccountId:H.string().optional()}).catchall(H.any())),AV=H.object({id:H.string(),type:H.string().or(H.string().array().nonempty()),serviceEndpoint:H.any().or(H.any().array().nonempty())}).catchall(H.any()),nX=H.object({"@context":e1,id:H.string(),alsoKnownAs:H.string().optional(),controller:H.string().or(H.string().array().nonempty()).optional(),verificationMethod:yc.array().optional(),authentication:yc.array().optional(),assertionMethod:yc.array().optional(),keyAgreement:yc.array().optional(),capabilityInvocation:yc.array().optional(),capabilityDelegation:yc.array().optional(),publicKey:yc.array().optional(),service:AV.array().optional(),proof:Va.or(Va.array()).optional()}).catchall(H.any()),SV=H.enum(["ceasn:Competency","ceterms:Credential","CFItem","CFRubric","CFRubricCriterion","CFRubricCriterionLevel","CTDL"]).or(H.string()),r1=H.object({type:H.string().array().nonempty(),targetCode:H.string().optional(),targetDescription:H.string().optional(),targetName:H.string(),targetFramework:H.string().optional(),targetType:SV.optional(),targetUrl:H.string()}),xV=H.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"]),TV=xV.or(H.string()),CV=H.object({id:H.string().optional(),narrative:H.string().optional()}).catchall(H.any()),MV=H.object({id:H.string(),type:H.string().array().nonempty(),endorsementComment:H.string().optional()}),IV=gm.extend({credentialSubject:MV,proof:Va.or(Va.array()).optional()}),kV=H.object({id:H.string(),"@language":H.string().optional(),version:H.string().optional()}),DV=H.enum(["GradePointAverage","LetterGrade","Percent","PerformanceLevel","PredictedScore","RawScore","Result","RubricCriterion","RubricCriterionLevel","RubricScore","ScaledScore","Status"]).or(H.string()),RV=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:r1.array().optional(),description:H.string().optional(),level:H.string().optional(),name:H.string(),points:H.string().optional()}).catchall(H.any()),OV=H.object({id:H.string(),type:H.string().array().nonempty(),alignment:r1.array().optional(),allowedValue:H.string().array().optional(),name:H.string(),requiredLevel:H.string().optional(),requiredValue:H.string().optional(),resultType:DV,rubricCriterionLevel:RV.array().optional(),valueMax:H.string().optional(),valueMin:H.string().optional()}).catchall(H.any()),NV=H.object({id:H.string().optional(),type:H.string().array().nonempty(),alignment:r1.array().optional(),achievementType:TV.optional(),creator:yd.optional(),creditsAvailable:H.number().optional(),criteria:CV,description:H.string(),endorsement:IV.array().optional(),fieldOfStudy:H.string().optional(),humanCode:H.string().optional(),image:t1.optional(),"@language":H.string().optional(),name:H.string(),otherIdentifier:Qk.array().optional(),related:kV.array().optional(),resultDescription:OV.array().optional(),specialization:H.string().optional(),tag:H.string().array().optional(),version:H.string().optional()}).catchall(H.any()),PV=H.object({type:H.string(),hashed:H.boolean(),identityHash:H.string(),identityType:H.string(),salt:H.string().optional()}),BV=H.enum(["Completed","Enrolled","Failed","InProgress","OnHold","Withdrew"]),LV=H.object({type:H.string().array().nonempty(),achievedLevel:H.string().optional(),alignment:r1.array().optional(),resultDescription:H.string().optional(),status:BV.optional(),value:H.string().optional()}).catchall(H.any()),xS=H.object({id:H.string().optional(),type:H.string().array().nonempty(),activityEndDate:H.string().optional(),activityStartDate:H.string().optional(),creditsEarned:H.number().optional(),achievement:NV.optional(),identifier:PV.array().optional(),image:t1.optional(),licenseNumber:H.string().optional(),narrative:H.string().optional(),result:LV.array().optional(),role:H.string().optional(),source:yd.optional(),term:H.string().optional()}).catchall(H.any()),UV=H.object({id:H.string().optional(),type:H.string().or(H.string().array().nonempty()),narrative:H.string().optional(),name:H.string().optional(),description:H.string().optional(),genre:H.string().optional(),audience:H.string().optional()}).catchall(H.any()),FV=gm.extend({name:H.string().optional(),description:H.string().optional(),image:t1.optional(),credentialSubject:xS.or(xS.array()),endorsement:gm.array().optional(),evidence:UV.array().optional()}),iX=FV.extend({proof:Va.or(Va.array())}),aX=H.object({checks:H.string().array(),warnings:H.string().array(),errors:H.string().array()}),eD=H.enum(["Success","Failed","Error"]),oX=eD.enum,sX=H.object({check:H.string(),status:eD,message:H.string().optional(),details:H.string().optional()}),cX=H.object({title:H.string().optional(),createdAt:H.string().optional(),issuer:yd.optional(),issuee:yd.optional(),credentialSubject:c6.optional()}),uX=H.object({id:H.string(),uri:H.string()}).catchall(H.any()),lX=H.object({limit:H.number(),cursor:H.string().optional(),sort:H.string().optional()}),ti=H.object({cursor:H.string().optional(),hasMore:H.boolean()}),tD=H.object({encryptedRecord:EV,fields:H.string().array()}).catchall(H.any()),fX=ti.extend({records:tD.array()}),jV=tD.extend({id:H.string()}),dX=ti.extend({records:jV.array()}),TS=mV(e=>{let t=e.match(/^\/(.*)\/([gimsuy]*)$/);if(!t)throw new Error("Invalid RegExp string format");return{pattern:t[1],flags:t[2]}},"parseRegexString"),$V=H.instanceof(RegExp).or(H.string().refine(e=>{try{return TS(e),!0}catch{return!1}},{message:"Invalid RegExp string format. Must be in format '/pattern/flags'"}).transform(e=>{let{pattern:t,flags:r}=TS(e);try{return new RegExp(t,r)}catch(n){throw new Error(`Invalid RegExp: ${n.message}`)}})),mr=H.string().or(H.object({$in:H.string().array()})).or(H.object({$regex:$V})),zV=H.object({backgroundColor:H.string().optional(),backgroundImage:H.string().optional(),fadeBackgroundImage:H.boolean().optional(),repeatBackgroundImage:H.boolean().optional(),fontColor:H.string().optional(),accentColor:H.string().optional(),accentFontColor:H.string().optional(),idBackgroundImage:H.string().optional(),fadeIdBackgroundImage:H.boolean().optional(),idBackgroundColor:H.string().optional(),repeatIdBackgroundImage:H.boolean().optional()}),xs=H.object({profileId:H.string().min(3).max(40),displayName:H.string().default(""),shortBio:H.string().default(""),bio:H.string().default(""),did:H.string(),isPrivate:H.boolean().optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional(),websiteLink:H.string().optional(),isServiceProfile:H.boolean().default(!1).optional(),type:H.string().optional(),notificationsWebhook:H.string().url().startsWith("http").optional(),display:zV.optional(),role:H.string().default("").optional(),dob:H.string().default("").optional()}),hX=H.object({profileId:mr,displayName:mr,shortBio:mr,bio:mr,email:mr,websiteLink:mr,isServiceProfile:H.boolean(),type:mr}).partial(),pX=ti.extend({records:xs.array()}),mX=H.enum(["CONNECTED","PENDING_REQUEST_SENT","PENDING_REQUEST_RECEIVED","NOT_CONNECTED"]),rD=H.object({id:H.string(),created:H.string(),displayName:H.string().default("").optional(),shortBio:H.string().default("").optional(),bio:H.string().default("").optional(),email:H.string().optional(),image:H.string().optional(),heroImage:H.string().optional()}),gX=ti.extend({records:rD.extend({did:H.string()}).array()}),vX=H.object({id:mr,displayName:mr,shortBio:mr,bio:mr,email:mr}).partial(),yX=ti.extend({records:H.object({profile:xs,manager:rD.extend({did:H.string()}).optional()}).array()}),bX=H.object({uri:H.string(),to:H.string(),from:H.string(),sent:H.string().datetime(),received:H.string().datetime().optional()}),nD=H.object({role:H.string(),canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:H.string(),canCreateChildren:H.string(),canEditChildren:H.string(),canRevokeChildren:H.string(),canManageChildrenPermissions:H.string(),canManageChildrenProfiles:H.boolean().default(!1).optional(),canViewAnalytics:H.boolean()}),HV=H.object({role:mr,canEdit:H.boolean(),canIssue:H.boolean(),canRevoke:H.boolean(),canManagePermissions:H.boolean(),canIssueChildren:mr,canCreateChildren:mr,canEditChildren:mr,canRevokeChildren:mr,canManageChildrenPermissions:mr,canManageChildrenProfiles:H.boolean(),canViewAnalytics:H.boolean()}).partial(),CS=H.enum(["GRANT_PERMISSIONS","ADD_ADMIN"]),qV=H.discriminatedUnion("type",[H.object({type:H.literal(CS.Values.GRANT_PERMISSIONS),data:H.object({claimUri:H.string(),targetUri:H.string(),permissions:nD.partial()})}),H.object({type:H.literal(CS.Values.ADD_ADMIN),data:H.object({claimUri:H.string(),targetUri:H.string()})})]),wX=H.object({type:mr,data:H.object({claimUri:mr,targetUri:mr,permissions:HV})}).deepPartial(),VV=H.object({id:H.string(),createdAt:H.string(),updatedAt:H.string()}).and(qV),_X=ti.extend({records:VV.array()}),u6=H.enum(["DRAFT","LIVE"]),KV=H.object({uri:H.string(),name:H.string().optional(),type:H.string().optional(),category:H.string().optional(),status:u6.optional(),autoConnectRecipients:H.boolean().optional(),meta:H.record(H.any()).optional(),claimPermissions:nD.optional()}),EX=H.object({uri:mr,name:mr,type:mr,category:mr,meta:H.record(mr),status:u6.or(H.object({$in:u6.array()})),autoConnectRecipients:H.boolean()}).partial(),AX=ti.extend({records:KV.array()}),GV=H.object({to:xs,from:H.string(),received:H.string().optional(),uri:H.string().optional()}),SX=ti.extend({records:GV.array()}),xX=H.object({endpoint:H.string(),name:H.string(),did:H.string().optional()}),TX=H.object({ttlSeconds:H.number().optional(),totalUses:H.number().optional()}),WV=H.object({endpoint:H.string()}),CX=H.object({signingAuthority:WV,relationship:H.object({name:H.string().max(15).regex(/^[a-z0-9-]+$/,{message:"The input string must contain only lowercase letters, numbers, and hyphens."}),did:H.string()})}),MX=H.object({boostUri:H.string(),signingAuthority:H.object({endpoint:H.string(),name:H.string()})}),JV=H.enum(["live","stale","withdrawn"]),ZV=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean()})).default({})}).default({}),personal:H.record(H.object({required:H.boolean()})).default({})}).default({})}),iD=H.object({contract:ZV,owner:xs,name:H.string(),subtitle:H.string().optional(),description:H.string().optional(),reasonForAccessing:H.string().optional(),image:H.string().optional(),uri:H.string(),needsGuardianConsent:H.boolean().optional(),redirectUrl:H.string().optional(),frontDoorBoostUri:H.string().optional(),createdAt:H.string(),updatedAt:H.string(),expiresAt:H.string().optional(),autoBoosts:H.string().array().optional(),writers:H.array(xs).optional()}),IX=ti.extend({records:iD.omit({owner:!0}).array()}),YV=H.object({credentials:H.object({categories:H.record(H.string().array()).default({})}),personal:H.record(H.string()).default({}),date:H.string()}),kX=ti.extend({records:YV.array()}),XV=H.object({credentials:H.object({category:H.string(),uri:H.string()}).array(),personal:H.record(H.string()).default({}),date:H.string(),contractUri:H.string()}),DX=ti.extend({records:XV.array()}),aD=H.object({sharing:H.boolean().optional(),shared:H.string().array().optional(),shareAll:H.boolean().optional(),shareUntil:H.string().optional()}),oD=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(aD).default({})}).default({}),personal:H.record(H.string()).default({})}).default({}),write:H.object({credentials:H.object({categories:H.record(H.boolean()).default({})}).default({}),personal:H.record(H.boolean()).default({})}).default({}),deniedWriters:H.array(H.string()).optional()}),RX=ti.extend({records:H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:oD,contract:iD,uri:H.string(),consenter:xs,status:JV}).array()}),OX=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.object({required:H.boolean().optional()})).optional()}).optional(),personal:H.record(H.object({required:H.boolean().optional()})).optional()}).optional()}),NX=H.object({anonymize:H.boolean().optional(),credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}),PX=H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional(),id:mr.optional()}),QV=H.object({read:H.object({anonymize:H.boolean().optional(),credentials:H.object({shareAll:H.boolean().optional(),sharing:H.boolean().optional(),categories:H.record(aD.optional()).optional()}).optional(),personal:H.record(H.string()).optional()}).optional(),write:H.object({credentials:H.object({categories:H.record(H.boolean()).optional()}).optional(),personal:H.record(H.boolean()).optional()}).optional()}),l6=H.enum(["consent","update","sync","withdraw","write"]),BX=H.object({terms:QV.optional(),action:l6.or(l6.array()).optional(),date:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),expiresAt:H.object({$gt:H.string()}).or(H.object({$lt:H.string()})).or(H.object({$eq:H.string()})).optional(),oneTime:H.boolean().optional()}),sD=H.object({expiresAt:H.string().optional(),oneTime:H.boolean().optional(),terms:oD.optional(),id:H.string(),action:l6,date:H.string(),uris:H.string().array().optional()}),LX=ti.extend({records:sD.array()}),eK=H.object({credentialUri:H.string(),termsUri:H.string(),contractUri:H.string(),boostUri:H.string(),category:H.string().optional(),date:H.string()}),UX=ti.extend({records:eK.array()}),tK=H.enum(["CONNECTION_REQUEST","CONNECTION_ACCEPTED","CREDENTIAL_RECEIVED","CREDENTIAL_ACCEPTED","BOOST_RECEIVED","BOOST_ACCEPTED","PRESENTATION_REQUEST","PRESENTATION_RECEIVED","CONSENT_FLOW_TRANSACTION"]),rK=H.object({title:H.string().optional(),body:H.string().optional()}),nK=H.object({vcUris:H.array(H.string()).optional(),vpUris:H.array(H.string()).optional(),transaction:sD.optional()}),FX=H.object({type:tK,to:xs.partial().and(H.object({did:H.string()})),from:xs.partial().and(H.object({did:H.string()})),message:rK.optional(),data:nK.optional(),sent:H.string().datetime().optional()}),iK="auth-grant:",jX=H.object({id:H.string(),name:H.string(),description:H.string().optional(),challenge:H.string().startsWith(iK).min(10,{message:"Challenge is too short"}).max(100,{message:"Challenge is too long"}),status:H.enum(["revoked","active"],{required_error:"Status is required",invalid_type_error:"Status must be either active or revoked"}),scope:H.string(),createdAt:H.string().datetime({message:"createdAt must be a valid ISO 8601 datetime string"}),expiresAt:H.string().datetime({message:"expiresAt must be a valid ISO 8601 datetime string"}).nullish().optional()}),$X=H.object({id:H.string()}).catchall(H.any()),aK=H.enum(["active","revoked"]),zX=H.object({id:mr,name:mr,description:mr,status:aK}).partial(),n1=o(e=>`lc:ceramic:${e}`,"streamIdToCeramicURI"),HX=H.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 q2=z.object({credentials:gc.array()}).catchall(z.any()),cD=z.object({id:z.string(),title:z.string(),storageType:z.literal("ceramic").optional()}).catchall(z.any()),V2=z.object({credentials:gc.or(cD).array()}).strict();var uD={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials"};var i1=i(async(e,{modelData:t,credentialAlias:r}=uD)=>{let n=e.invoke.getCeramicClient(),a=new Lf({ceramic:n,model:t}),s=i(async(g=r)=>{let v=await a.get(g);if(!v)return{credentials:[]};let y=await q2.spa(v);if(y.success)return y.data;let _=await V2.spa(v);if(_.success){let D={credentials:_.data.credentials.map(P=>{if("uri"in P)return P;let{title:J,id:j,storageType:q,...Q}=P;return{...Q,id:J,uri:`lc:ceramic:${j.replace("ceramic://","")}`}})};return await a.set(r,D),D}throw console.error(y.error),new Error("Invalid credentials list stored in IDX")},"getCredentialsListFromIdx"),c=i(async(g,v)=>{if(!g)throw new Error("Must provide id to remove");v||(v=r);let y=await s(v);return y.credentials=y.credentials.filter(_=>_.id!==g),a.set(v,y)},"removeCredentialFromIdx"),l=i(async g=>(g||(g=r),a.set(g,{credentials:[]})),"removeAllCredentialsFromIdx"),h=i(async g=>{let v=await gc.parseAsync(g);if(!v)throw new Error("record is required");if(!v.uri)throw Error("No URI provided");await e.read.get(v.uri);let y=await s(r),_=y.credentials.findIndex(x=>x.id===v.id);return _>-1?y.credentials[_]=v:y.credentials.push(v),n1(await a.set(r,y))},"addCredentialInIdx"),p=i(async g=>{let v=gc.array().parse(g),y=await s(r);return await Promise.all(v.map(async _=>{await e.read.get(_.uri);let x=y.credentials.findIndex(O=>O.id===_.id);x>-1?y.credentials[x]=_:y.credentials.push(_)})),n1(await a.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 g=>(g.debug?.("learnCard.index.IDX.get"),(await s()).credentials),add:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await h(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},addMany:async(g,v)=>{g.debug?.("learnCard.index.IDX.add");try{return await p(v),!0}catch(y){return console.error("Error adding credential with IDX:",y),!1}},update:async g=>(g.debug?.("learnCard.index.IDX.update"),!1),remove:async(g,v)=>{g.debug?.("learnCard.index.IDX.remove");try{return await c(v),!0}catch(y){return console.error("Error removing credential from IDX:",y),!1}},removeAll:async g=>{g.debug?.("learnCard.index.IDX.removeAll");try{return await l(),!0}catch(v){return console.error("Error removing credentials from IDX:",v),!1}}},methods:{getCredentialsListFromIdx:async(g,v=r)=>(await s(v)).credentials,getVerifiableCredentialFromIdx:async(g,v)=>{let _=(await s())?.credentials?.find(D=>D?.id===v),x=g.read.get(_?.uri),O=await m0.safeParseAsync(x);return O.success?O.data:void 0},getVerifiableCredentialsFromIdx:async g=>{let y=(await s())?.credentials?.map(_=>_?.uri)??[];return(await Promise.all(y.map(async _=>g.read.get(_)))).filter(_=>!!_)},addVerifiableCredentialInIdx:async(g,v)=>{let y=gc.parse(v);if(!y)throw new Error("record is required");if(!y.uri)throw Error("No URI provided");await g.read.get(y.uri);let _=await s(r),x=_.credentials.findIndex(O=>O.id===y.id);return x>-1?_.credentials[x]=y:_.credentials.push(y),n1(await a.set(r,_))},removeVerifiableCredentialInIdx:async(g,v)=>c(v),removeAllVerifiableCredentialsInIdx:async()=>l(),getIDXIndex:async()=>a.get(r),setIDXIndex:async(g,v)=>a.set(r,v)}}},"getIDXPlugin");var oK=i1;
846
846
  /*!
847
847
  * The buffer module from node.js, for the browser.
848
848
  *