@wovin/base-agent 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +38 -36
- package/dist/index.min.js.map +1 -1
- package/package.json +2 -2
package/dist/index.min.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var Hf=Object.create,$o=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,ya=Object.getOwnPropertyNames,Xf=Object.getPrototypeOf,Yf=Object.prototype.hasOwnProperty,Ce=(e,t)=>function(){return t||(0,e[ya(e)[0]])((t={exports:{}}).exports,t),t.exports},No=(e,t)=>{for(var r in t)$o(e,r,{get:t[r],enumerable:!0})},Qf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ya(t))!Yf.call(e,i)&&i!==r&&$o(e,i,{get:()=>t[i],enumerable:!(n=Jf(t,i))||n.enumerable});return e},ft=(e,t,r)=>(r=e!=null?Hf(Xf(e)):{},Qf(t||!e||!e.__esModule?$o(r,"default",{value:e,enumerable:!0}):r,e));var qt=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(f){let _=new Map;function I(){return new Map(_)}f.Entries=I;function M(){return _.clear()}f.Clear=M;function C(w){return _.delete(w)}f.Delete=C;function P(w){return _.has(w)}f.Has=P;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(f){super(f)}};e.TypeBoxError=r;var n;(function(f){let _=new Map;function I(){return new Map(_)}f.Entries=I;function M(){return _.clear()}f.Clear=M;function C(w){return _.delete(w)}f.Delete=C;function P(w){return _.has(w)}f.Has=P;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(n||(e.FormatRegistry=n={}));var i;(function(f){function _(b){return Array.isArray(b)}f.IsArray=_;function I(b){return typeof b=="bigint"}f.IsBigInt=I;function M(b){return typeof b=="boolean"}f.IsBoolean=M;function C(b){return b instanceof globalThis.Date}f.IsDate=C;function P(b){return b===null}f.IsNull=P;function y(b){return typeof b=="number"}f.IsNumber=y;function T(b){return typeof b=="object"&&b!==null}f.IsObject=T;function w(b){return typeof b=="string"}f.IsString=w;function u(b){return b instanceof globalThis.Uint8Array}f.IsUint8Array=u;function A(b){return b===void 0}f.IsUndefined=A})(i||(e.ValueGuard=i={}));var s=class extends r{};e.TypeGuardUnknownTypeError=s;var o;(function(f){function _(m){try{return new RegExp(m),!0}catch{return!1}}function I(m){if(!i.IsString(m))return!1;for(let Ee=0;Ee<m.length;Ee++){let lt=m.charCodeAt(Ee);if(lt>=7&<<=13||lt===27||lt===127)return!1}return!0}function M(m){return y(m)||Fe(m)}function C(m){return i.IsUndefined(m)||i.IsBigInt(m)}function P(m){return i.IsUndefined(m)||i.IsNumber(m)}function y(m){return i.IsUndefined(m)||i.IsBoolean(m)}function T(m){return i.IsUndefined(m)||i.IsString(m)}function w(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)&&_(m)}function u(m){return i.IsUndefined(m)||i.IsString(m)&&I(m)}function A(m){return i.IsUndefined(m)||Fe(m)}function b(m){return me(m,"Any")&&T(m.$id)}f.TAny=b;function v(m){return me(m,"Array")&&m.type==="array"&&T(m.$id)&&Fe(m.items)&&P(m.minItems)&&P(m.maxItems)&&y(m.uniqueItems)&&A(m.contains)&&P(m.minContains)&&P(m.maxContains)}f.TArray=v;function $(m){return me(m,"AsyncIterator")&&m.type==="AsyncIterator"&&T(m.$id)&&Fe(m.items)}f.TAsyncIterator=$;function z(m){return me(m,"BigInt")&&m.type==="bigint"&&T(m.$id)&&C(m.exclusiveMaximum)&&C(m.exclusiveMinimum)&&C(m.maximum)&&C(m.minimum)&&C(m.multipleOf)}f.TBigInt=z;function te(m){return me(m,"Boolean")&&m.type==="boolean"&&T(m.$id)}f.TBoolean=te;function re(m){return me(m,"Constructor")&&m.type==="Constructor"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Ee=>Fe(Ee))&&Fe(m.returns)}f.TConstructor=re;function pe(m){return me(m,"Date")&&m.type==="Date"&&T(m.$id)&&P(m.exclusiveMaximumTimestamp)&&P(m.exclusiveMinimumTimestamp)&&P(m.maximumTimestamp)&&P(m.minimumTimestamp)&&P(m.multipleOfTimestamp)}f.TDate=pe;function ge(m){return me(m,"Function")&&m.type==="Function"&&T(m.$id)&&i.IsArray(m.parameters)&&m.parameters.every(Ee=>Fe(Ee))&&Fe(m.returns)}f.TFunction=ge;function $e(m){return me(m,"Integer")&&m.type==="integer"&&T(m.$id)&&P(m.exclusiveMaximum)&&P(m.exclusiveMinimum)&&P(m.maximum)&&P(m.minimum)&&P(m.multipleOf)}f.TInteger=$e;function De(m){return me(m,"Intersect")&&!(i.IsString(m.type)&&m.type!=="object")&&i.IsArray(m.allOf)&&m.allOf.every(Ee=>Fe(Ee)&&!bn(Ee))&&T(m.type)&&(y(m.unevaluatedProperties)||A(m.unevaluatedProperties))&&T(m.$id)}f.TIntersect=De;function vr(m){return me(m,"Iterator")&&m.type==="Iterator"&&T(m.$id)&&Fe(m.items)}f.TIterator=vr;function me(m,Ee){return rr(m)&&m[e.Kind]===Ee}f.TKindOf=me;function rr(m){return i.IsObject(m)&&e.Kind in m&&i.IsString(m[e.Kind])}f.TKind=rr;function br(m){return N(m)&&i.IsString(m.const)}f.TLiteralString=br;function O(m){return N(m)&&i.IsNumber(m.const)}f.TLiteralNumber=O;function ue(m){return N(m)&&i.IsBoolean(m.const)}f.TLiteralBoolean=ue;function N(m){return me(m,"Literal")&&T(m.$id)&&(i.IsBoolean(m.const)||i.IsNumber(m.const)||i.IsString(m.const))}f.TLiteral=N;function he(m){return me(m,"Never")&&i.IsObject(m.not)&&Object.getOwnPropertyNames(m.not).length===0}f.TNever=he;function ne(m){return me(m,"Not")&&Fe(m.not)}f.TNot=ne;function le(m){return me(m,"Null")&&m.type==="null"&&T(m.$id)}f.TNull=le;function Ae(m){return me(m,"Number")&&m.type==="number"&&T(m.$id)&&P(m.exclusiveMaximum)&&P(m.exclusiveMinimum)&&P(m.maximum)&&P(m.minimum)&&P(m.multipleOf)}f.TNumber=Ae;function Ue(m){return me(m,"Object")&&m.type==="object"&&T(m.$id)&&i.IsObject(m.properties)&&M(m.additionalProperties)&&P(m.minProperties)&&P(m.maxProperties)&&Object.entries(m.properties).every(([Ee,lt])=>I(Ee)&&Fe(lt))}f.TObject=Ue;function Ye(m){return me(m,"Promise")&&m.type==="Promise"&&T(m.$id)&&Fe(m.item)}f.TPromise=Ye;function He(m){return me(m,"Record")&&m.type==="object"&&T(m.$id)&&M(m.additionalProperties)&&i.IsObject(m.patternProperties)&&(Ee=>{let lt=Object.getOwnPropertyNames(Ee.patternProperties);return lt.length===1&&_(lt[0])&&i.IsObject(Ee.patternProperties)&&Fe(Ee.patternProperties[lt[0]])})(m)}f.TRecord=He;function Ze(m){return i.IsObject(m)&&e.Hint in m&&m[e.Hint]==="Recursive"}f.TRecursive=Ze;function zt(m){return me(m,"Ref")&&T(m.$id)&&i.IsString(m.$ref)}f.TRef=zt;function zr(m){return me(m,"String")&&m.type==="string"&&T(m.$id)&&P(m.minLength)&&P(m.maxLength)&&w(m.pattern)&&u(m.format)}f.TString=zr;function qr(m){return me(m,"Symbol")&&m.type==="symbol"&&T(m.$id)}f.TSymbol=qr;function _r(m){return me(m,"TemplateLiteral")&&m.type==="string"&&i.IsString(m.pattern)&&m.pattern[0]==="^"&&m.pattern[m.pattern.length-1]==="$"}f.TTemplateLiteral=_r;function ri(m){return me(m,"This")&&T(m.$id)&&i.IsString(m.$ref)}f.TThis=ri;function bn(m){return i.IsObject(m)&&e.Transform in m}f.TTransform=bn;function ke(m){return me(m,"Tuple")&&m.type==="array"&&T(m.$id)&&i.IsNumber(m.minItems)&&i.IsNumber(m.maxItems)&&m.minItems===m.maxItems&&(i.IsUndefined(m.items)&&i.IsUndefined(m.additionalItems)&&m.minItems===0||i.IsArray(m.items)&&m.items.every(Ee=>Fe(Ee)))}f.TTuple=ke;function ni(m){return me(m,"Undefined")&&m.type==="undefined"&&T(m.$id)}f.TUndefined=ni;function Eo(m){return wr(m)&&m.anyOf.every(Ee=>br(Ee)||O(Ee))}f.TUnionLiteral=Eo;function wr(m){return me(m,"Union")&&T(m.$id)&&i.IsObject(m)&&i.IsArray(m.anyOf)&&m.anyOf.every(Ee=>Fe(Ee))}f.TUnion=wr;function Gr(m){return me(m,"Uint8Array")&&m.type==="Uint8Array"&&T(m.$id)&&P(m.minByteLength)&&P(m.maxByteLength)}f.TUint8Array=Gr;function Qe(m){return me(m,"Unknown")&&T(m.$id)}f.TUnknown=Qe;function ii(m){return me(m,"Unsafe")}f.TUnsafe=ii;function _n(m){return me(m,"Void")&&m.type==="void"&&T(m.$id)}f.TVoid=_n;function So(m){return i.IsObject(m)&&m[e.Readonly]==="Readonly"}f.TReadonly=So;function Ro(m){return i.IsObject(m)&&m[e.Optional]==="Optional"}f.TOptional=Ro;function Fe(m){return i.IsObject(m)&&(b(m)||v(m)||te(m)||z(m)||$(m)||re(m)||pe(m)||ge(m)||$e(m)||De(m)||vr(m)||N(m)||he(m)||ne(m)||le(m)||Ae(m)||Ue(m)||Ye(m)||He(m)||zt(m)||zr(m)||qr(m)||_r(m)||ri(m)||ke(m)||ni(m)||wr(m)||Gr(m)||Qe(m)||ii(m)||_n(m)||rr(m)&&t.Has(m[e.Kind]))}f.TSchema=Fe})(o||(e.TypeGuard=o={}));var a;(function(f){function _(I){return I[e.Kind]==="Intersect"?I.allOf.every(M=>_(M)):I[e.Kind]==="Union"?I.anyOf.some(M=>_(M)):I[e.Kind]==="Undefined"?!0:I[e.Kind]==="Not"?!_(I.not):!1}f.Check=_})(a||(e.ExtendsUndefined=a={}));var l=class extends r{};e.TypeExtendsError=l;var c;(function(f){f[f.Union=0]="Union",f[f.True=1]="True",f[f.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var d;(function(f){function _(p){return p===c.False?p:c.True}function I(p){throw new l(p)}function M(p){return o.TNever(p)||o.TIntersect(p)||o.TUnion(p)||o.TUnknown(p)||o.TAny(p)}function C(p,h){return o.TNever(h)?me(p,h):o.TIntersect(h)?ge(p,h):o.TUnion(h)?Po(p,h):o.TUnknown(h)?ha(p,h):o.TAny(h)?P(p,h):I("StructuralRight")}function P(p,h){return c.True}function y(p,h){return o.TIntersect(h)?ge(p,h):o.TUnion(h)&&h.anyOf.some(_e=>o.TAny(_e)||o.TUnknown(_e))?c.True:o.TUnion(h)?c.Union:o.TUnknown(h)||o.TAny(h)?c.True:c.Union}function T(p,h){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)?c.True:c.False}function w(p,h){return o.TObject(h)&&_r(h)?c.True:M(h)?C(p,h):o.TArray(h)?_(Ie(p.items,h.items)):c.False}function u(p,h){return M(h)?C(p,h):o.TAsyncIterator(h)?_(Ie(p.items,h.items)):c.False}function A(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TBigInt(h)?c.True:c.False}function b(p,h){return o.TLiteral(p)&&i.IsBoolean(p.const)||o.TBoolean(p)?c.True:c.False}function v(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TBoolean(h)?c.True:c.False}function $(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TConstructor(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((_e,It)=>_(Ie(h.parameters[It],_e))===c.True)?_(Ie(p.returns,h.returns)):c.False:c.False}function z(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TDate(h)?c.True:c.False}function te(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TFunction(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((_e,It)=>_(Ie(h.parameters[It],_e))===c.True)?_(Ie(p.returns,h.returns)):c.False:c.False}function re(p,h){return o.TLiteral(p)&&i.IsNumber(p.const)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function pe(p,h){return o.TInteger(h)||o.TNumber(h)?c.True:M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):c.False}function ge(p,h){return h.allOf.every(_e=>Ie(p,_e)===c.True)?c.True:c.False}function $e(p,h){return p.allOf.some(_e=>Ie(_e,h)===c.True)?c.True:c.False}function De(p,h){return M(h)?C(p,h):o.TIterator(h)?_(Ie(p.items,h.items)):c.False}function vr(p,h){return o.TLiteral(h)&&h.const===p.const?c.True:M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TString(h)?_n(p,h):o.TNumber(h)?N(p,h):o.TInteger(h)?re(p,h):o.TBoolean(h)?b(p,h):c.False}function me(p,h){return c.False}function rr(p,h){return c.True}function br(p){let[h,_e]=[p,0];for(;o.TNot(h);)h=h.not,_e+=1;return _e%2===0?h:e.Type.Unknown()}function O(p,h){return o.TNot(p)?Ie(br(p),h):o.TNot(h)?Ie(p,br(h)):I("Invalid fallthrough for Not")}function ue(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TNull(h)?c.True:c.False}function N(p,h){return o.TLiteralNumber(p)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function he(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TInteger(h)||o.TNumber(h)?c.True:c.False}function ne(p,h){return Object.getOwnPropertyNames(p.properties).length===h}function le(p){return _r(p)}function Ae(p){return ne(p,0)||ne(p,1)&&"description"in p.properties&&o.TUnion(p.properties.description)&&p.properties.description.anyOf.length===2&&(o.TString(p.properties.description.anyOf[0])&&o.TUndefined(p.properties.description.anyOf[1])||o.TString(p.properties.description.anyOf[1])&&o.TUndefined(p.properties.description.anyOf[0]))}function Ue(p){return ne(p,0)}function Ye(p){return ne(p,0)}function He(p){return ne(p,0)}function Ze(p){return ne(p,0)}function zt(p){return _r(p)}function zr(p){let h=e.Type.Number();return ne(p,0)||ne(p,1)&&"length"in p.properties&&_(Ie(p.properties.length,h))===c.True}function qr(p){return ne(p,0)}function _r(p){let h=e.Type.Number();return ne(p,0)||ne(p,1)&&"length"in p.properties&&_(Ie(p.properties.length,h))===c.True}function ri(p){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return ne(p,0)||ne(p,1)&&"then"in p.properties&&_(Ie(p.properties.then,h))===c.True}function bn(p,h){return Ie(p,h)===c.False||o.TOptional(p)&&!o.TOptional(h)?c.False:c.True}function ke(p,h){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)||o.TLiteralString(p)&&le(h)||o.TLiteralNumber(p)&&Ue(h)||o.TLiteralBoolean(p)&&Ye(h)||o.TSymbol(p)&&Ae(h)||o.TBigInt(p)&&He(h)||o.TString(p)&&le(h)||o.TSymbol(p)&&Ae(h)||o.TNumber(p)&&Ue(h)||o.TInteger(p)&&Ue(h)||o.TBoolean(p)&&Ye(h)||o.TUint8Array(p)&&zt(h)||o.TDate(p)&&Ze(h)||o.TConstructor(p)&&qr(h)||o.TFunction(p)&&zr(h)?c.True:o.TRecord(p)&&o.TString(wr(p))?h[e.Hint]==="Record"?c.True:c.False:o.TRecord(p)&&o.TNumber(wr(p))?ne(h,0)?c.True:c.False:c.False}function ni(p,h){return M(h)?C(p,h):o.TRecord(h)?Qe(p,h):o.TObject(h)?(()=>{for(let _e of Object.getOwnPropertyNames(h.properties)){if(!(_e in p.properties)&&!o.TOptional(h.properties[_e]))return c.False;if(o.TOptional(h.properties[_e]))return c.True;if(bn(p.properties[_e],h.properties[_e])===c.False)return c.False}return c.True})():c.False}function Eo(p,h){return M(h)?C(p,h):o.TObject(h)&&ri(h)?c.True:o.TPromise(h)?_(Ie(p.item,h.item)):c.False}function wr(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():I("Unknown record key pattern")}function Gr(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:I("Unable to get record value schema")}function Qe(p,h){let[_e,It]=[wr(h),Gr(h)];return o.TLiteralString(p)&&o.TNumber(_e)&&_(Ie(p,It))===c.True?c.True:o.TUint8Array(p)&&o.TNumber(_e)||o.TString(p)&&o.TNumber(_e)||o.TArray(p)&&o.TNumber(_e)?Ie(p,It):o.TObject(p)?(()=>{for(let Wf of Object.getOwnPropertyNames(p.properties))if(bn(It,p.properties[Wf])===c.False)return c.False;return c.True})():c.False}function ii(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Ie(Gr(p),Gr(h)):c.False}function _n(p,h){return o.TLiteral(p)&&i.IsString(p.const)||o.TString(p)?c.True:c.False}function So(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TString(h)?c.True:c.False}function Ro(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TSymbol(h)?c.True:c.False}function Fe(p,h){return o.TTemplateLiteral(p)?Ie(k.Resolve(p),h):o.TTemplateLiteral(h)?Ie(p,k.Resolve(h)):I("Invalid fallthrough for TemplateLiteral")}function m(p,h){return o.TArray(h)&&p.items!==void 0&&p.items.every(_e=>Ie(_e,h.items)===c.True)}function Ee(p,h){return o.TNever(p)?c.True:o.TUnknown(p)?c.False:o.TAny(p)?c.Union:c.False}function lt(p,h){return M(h)?C(p,h):o.TObject(h)&&_r(h)||o.TArray(h)&&m(p,h)?c.True:o.TTuple(h)?i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||!i.IsUndefined(p.items)&&i.IsUndefined(h.items)?c.False:i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||p.items.every((_e,It)=>Ie(_e,h.items[It])===c.True)?c.True:c.False:c.False}function kf(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TUint8Array(h)?c.True:c.False}function Ff(p,h){return M(h)?C(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TVoid(h)?zf(p,h):o.TUndefined(h)?c.True:c.False}function Po(p,h){return h.anyOf.some(_e=>Ie(p,_e)===c.True)?c.True:c.False}function Kf(p,h){return p.anyOf.every(_e=>Ie(_e,h)===c.True)?c.True:c.False}function ha(p,h){return c.True}function Vf(p,h){return o.TNever(h)?me(p,h):o.TIntersect(h)?ge(p,h):o.TUnion(h)?Po(p,h):o.TAny(h)?P(p,h):o.TString(h)?_n(p,h):o.TNumber(h)?N(p,h):o.TInteger(h)?re(p,h):o.TBoolean(h)?b(p,h):o.TArray(h)?T(p,h):o.TTuple(h)?Ee(p,h):o.TObject(h)?ke(p,h):o.TUnknown(h)?c.True:c.False}function zf(p,h){return o.TUndefined(p)||o.TUndefined(p)?c.True:c.False}function qf(p,h){return o.TIntersect(h)?ge(p,h):o.TUnion(h)?Po(p,h):o.TUnknown(h)?ha(p,h):o.TAny(h)?P(p,h):o.TObject(h)?ke(p,h):o.TVoid(h)?c.True:c.False}function Ie(p,h){return o.TTemplateLiteral(p)||o.TTemplateLiteral(h)?Fe(p,h):o.TNot(p)||o.TNot(h)?O(p,h):o.TAny(p)?y(p,h):o.TArray(p)?w(p,h):o.TBigInt(p)?A(p,h):o.TBoolean(p)?v(p,h):o.TAsyncIterator(p)?u(p,h):o.TConstructor(p)?$(p,h):o.TDate(p)?z(p,h):o.TFunction(p)?te(p,h):o.TInteger(p)?pe(p,h):o.TIntersect(p)?$e(p,h):o.TIterator(p)?De(p,h):o.TLiteral(p)?vr(p,h):o.TNever(p)?rr(p,h):o.TNull(p)?ue(p,h):o.TNumber(p)?he(p,h):o.TObject(p)?ni(p,h):o.TRecord(p)?ii(p,h):o.TString(p)?So(p,h):o.TSymbol(p)?Ro(p,h):o.TTuple(p)?lt(p,h):o.TPromise(p)?Eo(p,h):o.TUint8Array(p)?kf(p,h):o.TUndefined(p)?Ff(p,h):o.TUnion(p)?Kf(p,h):o.TUnknown(p)?Vf(p,h):o.TVoid(p)?qf(p,h):I(`Unknown left type operand '${p[e.Kind]}'`)}function Gf(p,h){return Ie(p,h)}f.Extends=Gf})(d||(e.TypeExtends=d={}));var g;(function(f){function _(w){return w.map(u=>P(u))}function I(w){return new Date(w.getTime())}function M(w){return new Uint8Array(w)}function C(w){let u=Object.getOwnPropertyNames(w).reduce((b,v)=>({...b,[v]:P(w[v])}),{}),A=Object.getOwnPropertySymbols(w).reduce((b,v)=>({...b,[v]:P(w[v])}),{});return{...u,...A}}function P(w){return i.IsArray(w)?_(w):i.IsDate(w)?I(w):i.IsUint8Array(w)?M(w):i.IsObject(w)?C(w):w}function y(w){return w.map(u=>T(u))}f.Rest=y;function T(w,u={}){return{...P(w),...u}}f.Type=T})(g||(e.TypeClone=g={}));var x;(function(f){function _($){return $.map(z=>{let{[e.Optional]:te,...re}=g.Type(z);return re})}function I($){return $.every(z=>o.TOptional(z))}function M($){return $.some(z=>o.TOptional(z))}function C($){return I($.allOf)?e.Type.Optional(e.Type.Intersect(_($.allOf))):$}function P($){return M($.anyOf)?e.Type.Optional(e.Type.Union(_($.anyOf))):$}function y($){return $[e.Kind]==="Intersect"?C($):$[e.Kind]==="Union"?P($):$}function T($,z){let te=$.allOf.reduce((re,pe)=>{let ge=b(pe,z);return ge[e.Kind]==="Never"?re:[...re,ge]},[]);return y(e.Type.Intersect(te))}function w($,z){let te=$.anyOf.map(re=>b(re,z));return y(e.Type.Union(te))}function u($,z){let te=$.properties[z];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A($,z){let te=$.items;if(i.IsUndefined(te))return e.Type.Never();let re=te[z];return i.IsUndefined(re)?e.Type.Never():re}function b($,z){return $[e.Kind]==="Intersect"?T($,z):$[e.Kind]==="Union"?w($,z):$[e.Kind]==="Object"?u($,z):$[e.Kind]==="Tuple"?A($,z):e.Type.Never()}function v($,z,te={}){let re=z.map(pe=>b($,pe.toString()));return y(e.Type.Union(re,te))}f.Resolve=v})(x||(e.IndexedAccessor=x={}));var S;(function(f){function _(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toLowerCase()}${v}`}function I(A){let[b,v]=[A.slice(0,1),A.slice(1)];return`${b.toUpperCase()}${v}`}function M(A){return A.toUpperCase()}function C(A){return A.toLowerCase()}function P(A,b){let v=q.ParseExact(A.pattern);if(!U.Check(v))return{...A,pattern:y(A.pattern,b)};let te=[...L.Generate(v)].map(ge=>e.Type.Literal(ge)),re=T(te,b),pe=e.Type.Union(re);return e.Type.TemplateLiteral([pe])}function y(A,b){return typeof A=="string"?b==="Uncapitalize"?_(A):b==="Capitalize"?I(A):b==="Uppercase"?M(A):b==="Lowercase"?C(A):A:A.toString()}function T(A,b){if(A.length===0)return[];let[v,...$]=A;return[u(v,b),...T($,b)]}function w(A,b){return o.TTemplateLiteral(A)?P(A,b):o.TUnion(A)?e.Type.Union(T(A.anyOf,b)):o.TLiteral(A)?e.Type.Literal(y(A.const,b)):A}function u(A,b){return w(A,b)}f.Map=u})(S||(e.Intrinsic=S={}));var R;(function(f){function _(y,T){return e.Type.Intersect(y.allOf.map(w=>C(w,T)),{...y})}function I(y,T){return e.Type.Union(y.anyOf.map(w=>C(w,T)),{...y})}function M(y,T){return T(y)}function C(y,T){return y[e.Kind]==="Intersect"?_(y,T):y[e.Kind]==="Union"?I(y,T):y[e.Kind]==="Object"?M(y,T):y}function P(y,T,w){return{...C(g.Type(y),T),...w}}f.Map=P})(R||(e.ObjectMap=R={}));var K;(function(f){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function I(u,A){return u.allOf.reduce((b,v)=>[...b,...y(v,A)],[])}function M(u,A){let b=u.anyOf.map(v=>y(v,A));return[...b.reduce((v,$)=>$.map(z=>b.every(te=>te.includes(z))?v.add(z):v)[0],new Set)]}function C(u,A){return Object.getOwnPropertyNames(u.properties)}function P(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function y(u,A){return o.TIntersect(u)?I(u,A):o.TUnion(u)?M(u,A):o.TObject(u)?C(u,A):o.TRecord(u)?P(u,A):[]}function T(u,A){return[...new Set(y(u,A))]}f.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(v=>`(${_(v)})`).join("|")})$`}f.ResolvePattern=w})(K||(e.KeyResolver=K={}));var H=class extends r{};e.KeyArrayResolverError=H;var F;(function(f){function _(I){return Array.isArray(I)?I:o.TUnionLiteral(I)?I.anyOf.map(M=>M.const.toString()):o.TLiteral(I)?[I.const]:o.TTemplateLiteral(I)?(()=>{let M=q.ParseExact(I.pattern);if(!U.Check(M))throw new H("Cannot resolve keys from infinite template expression");return[...L.Generate(M)]})():[]}f.Resolve=_})(F||(e.KeyArrayResolver=F={}));var j;(function(f){function*_(M){for(let C of M.anyOf)C[e.Kind]==="Union"?yield*_(C):yield C}function I(M){return e.Type.Union([..._(M)],{...M})}f.Resolve=I})(j||(e.UnionResolver=j={}));var V=class extends r{};e.TemplateLiteralPatternError=V;var G;(function(f){function _(P){throw new V(P)}function I(P){return P.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(P,y){return o.TTemplateLiteral(P)?P.pattern.slice(1,P.pattern.length-1):o.TUnion(P)?`(${P.anyOf.map(T=>M(T,y)).join("|")})`:o.TNumber(P)?`${y}${e.PatternNumber}`:o.TInteger(P)?`${y}${e.PatternNumber}`:o.TBigInt(P)?`${y}${e.PatternNumber}`:o.TString(P)?`${y}${e.PatternString}`:o.TLiteral(P)?`${y}${I(P.const.toString())}`:o.TBoolean(P)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${P[e.Kind]}'`)}function C(P){return`^${P.map(y=>M(y,"")).join("")}$`}f.Create=C})(G||(e.TemplateLiteralPattern=G={}));var k;(function(f){function _(I){let M=q.ParseExact(I.pattern);if(!U.Check(M))return e.Type.String();let C=[...L.Generate(M)].map(P=>e.Type.Literal(P));return e.Type.Union(C)}f.Resolve=_})(k||(e.TemplateLiteralResolver=k={}));var Q=class extends r{};e.TemplateLiteralParserError=Q;var q;(function(f){function _($,z,te){return $[z]===te&&$.charCodeAt(z-1)!==92}function I($,z){return _($,z,"(")}function M($,z){return _($,z,")")}function C($,z){return _($,z,"|")}function P($){if(!(I($,0)&&M($,$.length-1)))return!1;let z=0;for(let te=0;te<$.length;te++)if(I($,te)&&(z+=1),M($,te)&&(z-=1),z===0&&te!==$.length-1)return!1;return!0}function y($){return $.slice(1,$.length-1)}function T($){let z=0;for(let te=0;te<$.length;te++)if(I($,te)&&(z+=1),M($,te)&&(z-=1),C($,te)&&z===0)return!0;return!1}function w($){for(let z=0;z<$.length;z++)if(I($,z))return!0;return!1}function u($){let[z,te]=[0,0],re=[];for(let ge=0;ge<$.length;ge++)if(I($,ge)&&(z+=1),M($,ge)&&(z-=1),C($,ge)&&z===0){let $e=$.slice(te,ge);$e.length>0&&re.push(b($e)),te=ge+1}let pe=$.slice(te);return pe.length>0&&re.push(b(pe)),re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"or",expr:re}}function A($){function z(pe,ge){if(!I(pe,ge))throw new Q("TemplateLiteralParser: Index must point to open parens");let $e=0;for(let De=ge;De<pe.length;De++)if(I(pe,De)&&($e+=1),M(pe,De)&&($e-=1),$e===0)return[ge,De];throw new Q("TemplateLiteralParser: Unclosed group parens in expression")}function te(pe,ge){for(let $e=ge;$e<pe.length;$e++)if(I(pe,$e))return[ge,$e];return[ge,pe.length]}let re=[];for(let pe=0;pe<$.length;pe++)if(I($,pe)){let[ge,$e]=z($,pe),De=$.slice(ge,$e+1);re.push(b(De)),pe=$e}else{let[ge,$e]=te($,pe),De=$.slice(ge,$e);De.length>0&&re.push(b(De)),pe=$e-1}return re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"and",expr:re}}function b($){return P($)?b(y($)):T($)?u($):w($)?A($):{type:"const",const:$}}f.Parse=b;function v($){return b($.slice(1,$.length-1))}f.ParseExact=v})(q||(e.TemplateLiteralParser=q={}));var ce=class extends r{};e.TemplateLiteralFiniteError=ce;var U;(function(f){function _(y){throw new ce(y)}function I(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function M(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function C(y){return y.type==="const"&&y.const===".*"}function P(y){return M(y)?!0:I(y)||C(y)?!1:y.type==="and"?y.expr.every(T=>P(T)):y.type==="or"?y.expr.every(T=>P(T)):y.type==="const"?!0:_("Unknown expression type")}f.Check=P})(U||(e.TemplateLiteralFinite=U={}));var D=class extends r{};e.TemplateLiteralGeneratorError=D;var L;(function(f){function*_(y){if(y.length===1)return yield*y[0];for(let T of y[0])for(let w of _(y.slice(1)))yield`${T}${w}`}function*I(y){return yield*_(y.expr.map(T=>[...P(T)]))}function*M(y){for(let T of y.expr)yield*P(T)}function*C(y){return yield y.const}function*P(y){return y.type==="and"?yield*I(y):y.type==="or"?yield*M(y):y.type==="const"?yield*C(y):(()=>{throw new D("Unknown expression")})()}f.Generate=P})(L||(e.TemplateLiteralGenerator=L={}));var ee;(function(f){function*_(P){let y=P.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let T=y.split("|").map(w=>e.Type.Literal(w.trim()));return T.length===0?e.Type.Never():T.length===1?T[0]:e.Type.Union(T)})()}function*I(P){if(P[1]!=="{"){let y=e.Type.Literal("$"),T=M(P.slice(1));return yield*[y,...T]}for(let y=2;y<P.length;y++)if(P[y]==="}"){let T=_(P.slice(2,y)),w=M(P.slice(y+1));return yield*[...T,...w]}yield e.Type.Literal(P)}function*M(P){for(let y=0;y<P.length;y++)if(P[y]==="$"){let T=e.Type.Literal(P.slice(0,y)),w=I(P.slice(y));return yield*[T,...w]}yield e.Type.Literal(P)}function C(P){return[...M(P)]}f.Parse=C})(ee||(e.TemplateLiteralDslParser=ee={}));var ie=class{constructor(f){this.schema=f}Decode(f){return new Y(this.schema,f)}};e.TransformDecodeBuilder=ie;var Y=class{constructor(f,_){this.schema=f,this.decode=_}Encode(f){let _=g.Type(this.schema);return o.TTransform(_)?(()=>{let C={Encode:P=>_[e.Transform].Encode(f(P)),Decode:P=>this.decode(_[e.Transform].Decode(P))};return{..._,[e.Transform]:C}})():(()=>{let I={Decode:this.decode,Encode:f};return{..._,[e.Transform]:I}})()}};e.TransformEncodeBuilder=Y;var se=0,B=class extends r{};e.TypeBuilderError=B;var W=class{Create(f){return f}Throw(f){throw new B(f)}Discard(f,_){return _.reduce((I,M)=>{let{[M]:C,...P}=I;return P},f)}Strict(f){return JSON.parse(JSON.stringify(f))}};e.TypeBuilder=W;var X=class extends W{ReadonlyOptional(f){return this.Readonly(this.Optional(f))}Readonly(f){return{...g.Type(f),[e.Readonly]:"Readonly"}}Optional(f){return{...g.Type(f),[e.Optional]:"Optional"}}Any(f={}){return this.Create({...f,[e.Kind]:"Any"})}Array(f,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(f)})}Boolean(f={}){return this.Create({...f,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(f,_={}){return{...S.Map(g.Type(f),"Capitalize"),..._}}Composite(f,_){let I=e.Type.Intersect(f,{}),C=K.ResolveKeys(I,{includePatterns:!1}).reduce((P,y)=>({...P,[y]:e.Type.Index(I,[y])}),{});return e.Type.Object(C,_)}Enum(f,_={}){if(i.IsUndefined(f))return this.Throw("Enum undefined or empty");let I=Object.getOwnPropertyNames(f).filter(P=>isNaN(P)).map(P=>f[P]),C=[...new Set(I)].map(P=>e.Type.Literal(P));return this.Union(C,{..._,[e.Hint]:"Enum"})}Extends(f,_,I,M,C={}){switch(d.Extends(f,_)){case c.Union:return this.Union([g.Type(I,C),g.Type(M,C)]);case c.True:return g.Type(I,C);case c.False:return g.Type(M,C)}}Exclude(f,_,I={}){return o.TTemplateLiteral(f)?this.Exclude(k.Resolve(f),_,I):o.TTemplateLiteral(_)?this.Exclude(f,k.Resolve(_),I):o.TUnion(f)?(()=>{let M=f.anyOf.filter(C=>d.Extends(C,_)===c.False);return M.length===1?g.Type(M[0],I):this.Union(M,I)})():d.Extends(f,_)!==c.False?this.Never(I):g.Type(f,I)}Extract(f,_,I={}){return o.TTemplateLiteral(f)?this.Extract(k.Resolve(f),_,I):o.TTemplateLiteral(_)?this.Extract(f,k.Resolve(_),I):o.TUnion(f)?(()=>{let M=f.anyOf.filter(C=>d.Extends(C,_)!==c.False);return M.length===1?g.Type(M[0],I):this.Union(M,I)})():d.Extends(f,_)!==c.False?g.Type(f,I):this.Never(I)}Index(f,_,I={}){return o.TArray(f)&&o.TNumber(_)?g.Type(f.items,I):o.TTuple(f)&&o.TNumber(_)?(()=>{let C=(i.IsUndefined(f.items)?[]:f.items).map(P=>g.Type(P));return this.Union(C,I)})():(()=>{let M=F.Resolve(_),C=g.Type(f);return x.Resolve(C,M,I)})()}Integer(f={}){return this.Create({...f,[e.Kind]:"Integer",type:"integer"})}Intersect(f,_={}){if(f.length===0)return e.Type.Never();if(f.length===1)return g.Type(f[0],_);f.some(P=>o.TTransform(P))&&this.Throw("Cannot intersect transform types");let I=f.every(P=>o.TObject(P)),M=g.Rest(f),C=o.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||o.TSchema(_.unevaluatedProperties)||I?this.Create({..._,...C,[e.Kind]:"Intersect",type:"object",allOf:M}):this.Create({..._,...C,[e.Kind]:"Intersect",allOf:M})}KeyOf(f,_={}){return o.TRecord(f)?(()=>{let I=Object.getOwnPropertyNames(f.patternProperties)[0];return I===e.PatternNumberExact?this.Number(_):I===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(f)?(()=>{let M=(i.IsUndefined(f.items)?[]:f.items).map((C,P)=>e.Type.Literal(P.toString()));return this.Union(M,_)})():o.TArray(f)?this.Number(_):(()=>{let I=K.ResolveKeys(f,{includePatterns:!1});if(I.length===0)return this.Never(_);let M=I.map(C=>this.Literal(C));return this.Union(M,_)})()}Literal(f,_={}){return this.Create({..._,[e.Kind]:"Literal",const:f,type:typeof f})}Lowercase(f,_={}){return{...S.Map(g.Type(f),"Lowercase"),..._}}Never(f={}){return this.Create({...f,[e.Kind]:"Never",not:{}})}Not(f,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(f)})}Null(f={}){return this.Create({...f,[e.Kind]:"Null",type:"null"})}Number(f={}){return this.Create({...f,[e.Kind]:"Number",type:"number"})}Object(f,_={}){let I=Object.getOwnPropertyNames(f),M=I.filter(T=>o.TOptional(f[T])),C=I.filter(T=>!M.includes(T)),P=o.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},y=I.reduce((T,w)=>({...T,[w]:g.Type(f[w])}),{});return C.length>0?this.Create({..._,...P,[e.Kind]:"Object",type:"object",properties:y,required:C}):this.Create({..._,...P,[e.Kind]:"Object",type:"object",properties:y})}Omit(f,_,I={}){let M=F.Resolve(_);return R.Map(this.Discard(g.Type(f),["$id",e.Transform]),C=>{i.IsArray(C.required)&&(C.required=C.required.filter(P=>!M.includes(P)),C.required.length===0&&delete C.required);for(let P of Object.getOwnPropertyNames(C.properties))M.includes(P)&&delete C.properties[P];return this.Create(C)},I)}Partial(f,_={}){return R.Map(this.Discard(g.Type(f),["$id",e.Transform]),I=>{let M=Object.getOwnPropertyNames(I.properties).reduce((C,P)=>({...C,[P]:this.Optional(I.properties[P])}),{});return this.Object(M,this.Discard(I,["required"]))},_)}Pick(f,_,I={}){let M=F.Resolve(_);return R.Map(this.Discard(g.Type(f),["$id",e.Transform]),C=>{i.IsArray(C.required)&&(C.required=C.required.filter(P=>M.includes(P)),C.required.length===0&&delete C.required);for(let P of Object.getOwnPropertyNames(C.properties))M.includes(P)||delete C.properties[P];return this.Create(C)},I)}Record(f,_,I={}){return o.TTemplateLiteral(f)?(()=>{let M=q.ParseExact(f.pattern);return U.Check(M)?this.Object([...L.Generate(M)].reduce((C,P)=>({...C,[P]:g.Type(_)}),{}),I):this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[f.pattern]:g.Type(_)}})})():o.TUnion(f)?(()=>{let M=j.Resolve(f);if(o.TUnionLiteral(M)){let C=M.anyOf.reduce((P,y)=>({...P,[y.const]:g.Type(_)}),{});return this.Object(C,{...I,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(f)?i.IsString(f.const)||i.IsNumber(f.const)?this.Object({[f.const]:g.Type(_)},I):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(f)||o.TNumber(f)?this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):o.TString(f)?(()=>{let M=i.IsUndefined(f.pattern)?e.PatternStringExact:f.pattern;return this.Create({...I,[e.Kind]:"Record",type:"object",patternProperties:{[M]:g.Type(_)}})})():this.Never()}Recursive(f,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${se++}`);let I=f({[e.Kind]:"This",$ref:`${_.$id}`});return I.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...I})}Ref(f,_={}){return i.IsString(f)?this.Create({..._,[e.Kind]:"Ref",$ref:f}):(i.IsUndefined(f.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:f.$id}))}Required(f,_={}){return R.Map(this.Discard(g.Type(f),["$id",e.Transform]),I=>{let M=Object.getOwnPropertyNames(I.properties).reduce((C,P)=>({...C,[P]:this.Discard(I.properties[P],[e.Optional])}),{});return this.Object(M,I)},_)}Rest(f){return o.TTuple(f)&&!i.IsUndefined(f.items)?g.Rest(f.items):o.TIntersect(f)?g.Rest(f.allOf):o.TUnion(f)?g.Rest(f.anyOf):[]}String(f={}){return this.Create({...f,[e.Kind]:"String",type:"string"})}TemplateLiteral(f,_={}){let I=i.IsString(f)?G.Create(ee.Parse(f)):G.Create(f);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:I})}Transform(f){return new ie(f)}Tuple(f,_={}){let[I,M,C]=[!1,f.length,f.length],P=g.Rest(f),y=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:P,additionalItems:I,minItems:M,maxItems:C}:{..._,[e.Kind]:"Tuple",type:"array",minItems:M,maxItems:C};return this.Create(y)}Uncapitalize(f,_={}){return{...S.Map(g.Type(f),"Uncapitalize"),..._}}Union(f,_={}){return o.TTemplateLiteral(f)?k.Resolve(f):(()=>{let I=f;if(I.length===0)return this.Never(_);if(I.length===1)return this.Create(g.Type(I[0],_));let M=g.Rest(I);return this.Create({..._,[e.Kind]:"Union",anyOf:M})})()}Unknown(f={}){return this.Create({...f,[e.Kind]:"Unknown"})}Unsafe(f={}){return this.Create({...f,[e.Kind]:f[e.Kind]||"Unsafe"})}Uppercase(f,_={}){return{...S.Map(g.Type(f),"Uppercase"),..._}}};e.JsonTypeBuilder=X;var fe=class extends X{AsyncIterator(f,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(f)})}Awaited(f,_={}){let I=M=>M.length>0?(()=>{let[C,...P]=M;return[this.Awaited(C),...I(P)]})():M;return o.TIntersect(f)?e.Type.Intersect(I(f.allOf)):o.TUnion(f)?e.Type.Union(I(f.anyOf)):o.TPromise(f)?this.Awaited(f.item):g.Type(f,_)}BigInt(f={}){return this.Create({...f,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(f,_={}){return this.Tuple([...f.parameters],{..._})}Constructor(f,_,I){let[M,C]=[g.Rest(f),g.Type(_)];return this.Create({...I,[e.Kind]:"Constructor",type:"Constructor",parameters:M,returns:C})}Date(f={}){return this.Create({...f,[e.Kind]:"Date",type:"Date"})}Function(f,_,I){let[M,C]=[g.Rest(f),g.Type(_)];return this.Create({...I,[e.Kind]:"Function",type:"Function",parameters:M,returns:C})}InstanceType(f,_={}){return g.Type(f.returns,_)}Iterator(f,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(f)})}Parameters(f,_={}){return this.Tuple(f.parameters,{..._})}Promise(f,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(f)})}RegExp(f,_={}){let I=i.IsString(f)?f:f.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:I})}RegEx(f,_={}){return this.RegExp(f,_)}ReturnType(f,_={}){return g.Type(f.returns,_)}Symbol(f){return this.Create({...f,[e.Kind]:"Symbol",type:"symbol"})}Undefined(f={}){return this.Create({...f,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(f={}){return this.Create({...f,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(f={}){return this.Create({...f,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=fe,e.JsonType=new X,e.Type=new fe}}),Wr=ft(qt(),1),{String:Zf,Optional:ed,Boolean:td,Object:rd,Number:nd}=Wr.Type,id=Zf.bind(Wr.Type),od=nd.bind(Wr.Type),UI=rd.bind(Wr.Type),MI=ed.bind(Wr.Type),sd=td.bind(Wr.Type),DI=id(),BI=od(),LI=sd();function ga(e){return Array.isArray(e)?e:[e]}var ad={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},ud=ad;function ae(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:ud[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var cd={};function wi(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:cd}var Ma=Object.assign,di=Object.getOwnPropertyDescriptor,Bt=Object.defineProperty,In=Object.prototype,pi=[];Object.freeze(pi);var qo={};Object.freeze(qo);var ld=typeof Proxy<"u",fd=Object.toString();function Da(){ld||ae("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function wn(e){J.verifyProxies&&ae("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function _t(){return++J.mobxGuid}function Go(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Jr=function(){};function Me(e){return typeof e=="function"}function Ar(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function Ti(e){return e!==null&&typeof e=="object"}function $t(e){if(!Ti(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===fd}function Ba(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Ai(e,t,r){Bt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function La(e,t,r){Bt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function sr(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return Ti(n)&&n[r]===!0}}function Zr(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function dd(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function Gt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var ja=typeof Object.getOwnPropertySymbols<"u";function pd(e){var t=Object.keys(e);if(!ja)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return In.propertyIsEnumerable.call(e,n)})):t}var Oi=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:ja?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Uo(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function ka(e){return e===null?null:typeof e=="object"?""+e:e}function gt(e,t){return In.hasOwnProperty.call(e,t)}var hd=Object.getOwnPropertyDescriptors||function(t){var r={};return Oi(t).forEach(function(n){r[n]=di(t,n)}),r};function nt(e,t){return!!(e&t)}function it(e,t,r){return r?e|=t:e&=~t,e}function ma(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function va(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,gd(n.key),n)}}function en(e,t,r){return t&&va(e.prototype,t),r&&va(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Xr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=md(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function
|
|
1
|
+
var Yf=Object.create,Mo=Object.defineProperty,Qf=Object.getOwnPropertyDescriptor,va=Object.getOwnPropertyNames,Zf=Object.getPrototypeOf,ed=Object.prototype.hasOwnProperty,Ne=(e,t)=>function(){return t||(0,e[va(e)[0]])((t={exports:{}}).exports,t),t.exports},ir=(e,t)=>{for(var r in t)Mo(e,r,{get:t[r],enumerable:!0})},td=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of va(t))!ed.call(e,i)&&i!==r&&Mo(e,i,{get:()=>t[i],enumerable:!(n=Qf(t,i))||n.enumerable});return e},ft=(e,t,r)=>(r=e!=null?Yf(Zf(e)):{},td(t||!e||!e.__esModule?Mo(r,"default",{value:e,enumerable:!0}):r,e));var Gt=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/typebox.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Type=e.JsonType=e.JavaScriptTypeBuilder=e.JsonTypeBuilder=e.TypeBuilder=e.TypeBuilderError=e.TransformEncodeBuilder=e.TransformDecodeBuilder=e.TemplateLiteralDslParser=e.TemplateLiteralGenerator=e.TemplateLiteralGeneratorError=e.TemplateLiteralFinite=e.TemplateLiteralFiniteError=e.TemplateLiteralParser=e.TemplateLiteralParserError=e.TemplateLiteralResolver=e.TemplateLiteralPattern=e.TemplateLiteralPatternError=e.UnionResolver=e.KeyArrayResolver=e.KeyArrayResolverError=e.KeyResolver=e.ObjectMap=e.Intrinsic=e.IndexedAccessor=e.TypeClone=e.TypeExtends=e.TypeExtendsResult=e.TypeExtendsError=e.ExtendsUndefined=e.TypeGuard=e.TypeGuardUnknownTypeError=e.ValueGuard=e.FormatRegistry=e.TypeBoxError=e.TypeRegistry=e.PatternStringExact=e.PatternNumberExact=e.PatternBooleanExact=e.PatternString=e.PatternNumber=e.PatternBoolean=e.Kind=e.Hint=e.Optional=e.Readonly=e.Transform=void 0,e.Transform=Symbol.for("TypeBox.Transform"),e.Readonly=Symbol.for("TypeBox.Readonly"),e.Optional=Symbol.for("TypeBox.Optional"),e.Hint=Symbol.for("TypeBox.Hint"),e.Kind=Symbol.for("TypeBox.Kind"),e.PatternBoolean="(true|false)",e.PatternNumber="(0|[1-9][0-9]*)",e.PatternString="(.*)",e.PatternBooleanExact=`^${e.PatternBoolean}$`,e.PatternNumberExact=`^${e.PatternNumber}$`,e.PatternStringExact=`^${e.PatternString}$`;var t;(function(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function M(){return _.clear()}f.Clear=M;function N(w){return _.delete(w)}f.Delete=N;function R(w){return _.has(w)}f.Has=R;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(t||(e.TypeRegistry=t={}));var r=class extends Error{constructor(f){super(f)}};e.TypeBoxError=r;var n;(function(f){let _=new Map;function E(){return new Map(_)}f.Entries=E;function M(){return _.clear()}f.Clear=M;function N(w){return _.delete(w)}f.Delete=N;function R(w){return _.has(w)}f.Has=R;function y(w,u){_.set(w,u)}f.Set=y;function T(w){return _.get(w)}f.Get=T})(n||(e.FormatRegistry=n={}));var i;(function(f){function _(v){return Array.isArray(v)}f.IsArray=_;function E(v){return typeof v=="bigint"}f.IsBigInt=E;function M(v){return typeof v=="boolean"}f.IsBoolean=M;function N(v){return v instanceof globalThis.Date}f.IsDate=N;function R(v){return v===null}f.IsNull=R;function y(v){return typeof v=="number"}f.IsNumber=y;function T(v){return typeof v=="object"&&v!==null}f.IsObject=T;function w(v){return typeof v=="string"}f.IsString=w;function u(v){return v instanceof globalThis.Uint8Array}f.IsUint8Array=u;function A(v){return v===void 0}f.IsUndefined=A})(i||(e.ValueGuard=i={}));var s=class extends r{};e.TypeGuardUnknownTypeError=s;var o;(function(f){function _(b){try{return new RegExp(b),!0}catch{return!1}}function E(b){if(!i.IsString(b))return!1;for(let Ie=0;Ie<b.length;Ie++){let lt=b.charCodeAt(Ie);if(lt>=7&<<=13||lt===27||lt===127)return!1}return!0}function M(b){return y(b)||Fe(b)}function N(b){return i.IsUndefined(b)||i.IsBigInt(b)}function R(b){return i.IsUndefined(b)||i.IsNumber(b)}function y(b){return i.IsUndefined(b)||i.IsBoolean(b)}function T(b){return i.IsUndefined(b)||i.IsString(b)}function w(b){return i.IsUndefined(b)||i.IsString(b)&&E(b)&&_(b)}function u(b){return i.IsUndefined(b)||i.IsString(b)&&E(b)}function A(b){return i.IsUndefined(b)||Fe(b)}function v(b){return be(b,"Any")&&T(b.$id)}f.TAny=v;function m(b){return be(b,"Array")&&b.type==="array"&&T(b.$id)&&Fe(b.items)&&R(b.minItems)&&R(b.maxItems)&&y(b.uniqueItems)&&A(b.contains)&&R(b.minContains)&&R(b.maxContains)}f.TArray=m;function P(b){return be(b,"AsyncIterator")&&b.type==="AsyncIterator"&&T(b.$id)&&Fe(b.items)}f.TAsyncIterator=P;function q(b){return be(b,"BigInt")&&b.type==="bigint"&&T(b.$id)&&N(b.exclusiveMaximum)&&N(b.exclusiveMinimum)&&N(b.maximum)&&N(b.minimum)&&N(b.multipleOf)}f.TBigInt=q;function te(b){return be(b,"Boolean")&&b.type==="boolean"&&T(b.$id)}f.TBoolean=te;function re(b){return be(b,"Constructor")&&b.type==="Constructor"&&T(b.$id)&&i.IsArray(b.parameters)&&b.parameters.every(Ie=>Fe(Ie))&&Fe(b.returns)}f.TConstructor=re;function pe(b){return be(b,"Date")&&b.type==="Date"&&T(b.$id)&&R(b.exclusiveMaximumTimestamp)&&R(b.exclusiveMinimumTimestamp)&&R(b.maximumTimestamp)&&R(b.minimumTimestamp)&&R(b.multipleOfTimestamp)}f.TDate=pe;function ge(b){return be(b,"Function")&&b.type==="Function"&&T(b.$id)&&i.IsArray(b.parameters)&&b.parameters.every(Ie=>Fe(Ie))&&Fe(b.returns)}f.TFunction=ge;function Pe(b){return be(b,"Integer")&&b.type==="integer"&&T(b.$id)&&R(b.exclusiveMaximum)&&R(b.exclusiveMinimum)&&R(b.maximum)&&R(b.minimum)&&R(b.multipleOf)}f.TInteger=Pe;function De(b){return be(b,"Intersect")&&!(i.IsString(b.type)&&b.type!=="object")&&i.IsArray(b.allOf)&&b.allOf.every(Ie=>Fe(Ie)&&!wn(Ie))&&T(b.type)&&(y(b.unevaluatedProperties)||A(b.unevaluatedProperties))&&T(b.$id)}f.TIntersect=De;function _r(b){return be(b,"Iterator")&&b.type==="Iterator"&&T(b.$id)&&Fe(b.items)}f.TIterator=_r;function be(b,Ie){return nr(b)&&b[e.Kind]===Ie}f.TKindOf=be;function nr(b){return i.IsObject(b)&&e.Kind in b&&i.IsString(b[e.Kind])}f.TKind=nr;function wr(b){return $(b)&&i.IsString(b.const)}f.TLiteralString=wr;function O(b){return $(b)&&i.IsNumber(b.const)}f.TLiteralNumber=O;function ue(b){return $(b)&&i.IsBoolean(b.const)}f.TLiteralBoolean=ue;function $(b){return be(b,"Literal")&&T(b.$id)&&(i.IsBoolean(b.const)||i.IsNumber(b.const)||i.IsString(b.const))}f.TLiteral=$;function he(b){return be(b,"Never")&&i.IsObject(b.not)&&Object.getOwnPropertyNames(b.not).length===0}f.TNever=he;function ne(b){return be(b,"Not")&&Fe(b.not)}f.TNot=ne;function le(b){return be(b,"Null")&&b.type==="null"&&T(b.$id)}f.TNull=le;function Ae(b){return be(b,"Number")&&b.type==="number"&&T(b.$id)&&R(b.exclusiveMaximum)&&R(b.exclusiveMinimum)&&R(b.maximum)&&R(b.minimum)&&R(b.multipleOf)}f.TNumber=Ae;function Ue(b){return be(b,"Object")&&b.type==="object"&&T(b.$id)&&i.IsObject(b.properties)&&M(b.additionalProperties)&&R(b.minProperties)&&R(b.maxProperties)&&Object.entries(b.properties).every(([Ie,lt])=>E(Ie)&&Fe(lt))}f.TObject=Ue;function Ye(b){return be(b,"Promise")&&b.type==="Promise"&&T(b.$id)&&Fe(b.item)}f.TPromise=Ye;function He(b){return be(b,"Record")&&b.type==="object"&&T(b.$id)&&M(b.additionalProperties)&&i.IsObject(b.patternProperties)&&(Ie=>{let lt=Object.getOwnPropertyNames(Ie.patternProperties);return lt.length===1&&_(lt[0])&&i.IsObject(Ie.patternProperties)&&Fe(Ie.patternProperties[lt[0]])})(b)}f.TRecord=He;function Ze(b){return i.IsObject(b)&&e.Hint in b&&b[e.Hint]==="Recursive"}f.TRecursive=Ze;function zt(b){return be(b,"Ref")&&T(b.$id)&&i.IsString(b.$ref)}f.TRef=zt;function zr(b){return be(b,"String")&&b.type==="string"&&T(b.$id)&&R(b.minLength)&&R(b.maxLength)&&w(b.pattern)&&u(b.format)}f.TString=zr;function Gr(b){return be(b,"Symbol")&&b.type==="symbol"&&T(b.$id)}f.TSymbol=Gr;function Tr(b){return be(b,"TemplateLiteral")&&b.type==="string"&&i.IsString(b.pattern)&&b.pattern[0]==="^"&&b.pattern[b.pattern.length-1]==="$"}f.TTemplateLiteral=Tr;function si(b){return be(b,"This")&&T(b.$id)&&i.IsString(b.$ref)}f.TThis=si;function wn(b){return i.IsObject(b)&&e.Transform in b}f.TTransform=wn;function ke(b){return be(b,"Tuple")&&b.type==="array"&&T(b.$id)&&i.IsNumber(b.minItems)&&i.IsNumber(b.maxItems)&&b.minItems===b.maxItems&&(i.IsUndefined(b.items)&&i.IsUndefined(b.additionalItems)&&b.minItems===0||i.IsArray(b.items)&&b.items.every(Ie=>Fe(Ie)))}f.TTuple=ke;function ai(b){return be(b,"Undefined")&&b.type==="undefined"&&T(b.$id)}f.TUndefined=ai;function $o(b){return Ar(b)&&b.anyOf.every(Ie=>wr(Ie)||O(Ie))}f.TUnionLiteral=$o;function Ar(b){return be(b,"Union")&&T(b.$id)&&i.IsObject(b)&&i.IsArray(b.anyOf)&&b.anyOf.every(Ie=>Fe(Ie))}f.TUnion=Ar;function Wr(b){return be(b,"Uint8Array")&&b.type==="Uint8Array"&&T(b.$id)&&R(b.minByteLength)&&R(b.maxByteLength)}f.TUint8Array=Wr;function Qe(b){return be(b,"Unknown")&&T(b.$id)}f.TUnknown=Qe;function ui(b){return be(b,"Unsafe")}f.TUnsafe=ui;function Tn(b){return be(b,"Void")&&b.type==="void"&&T(b.$id)}f.TVoid=Tn;function No(b){return i.IsObject(b)&&b[e.Readonly]==="Readonly"}f.TReadonly=No;function Co(b){return i.IsObject(b)&&b[e.Optional]==="Optional"}f.TOptional=Co;function Fe(b){return i.IsObject(b)&&(v(b)||m(b)||te(b)||q(b)||P(b)||re(b)||pe(b)||ge(b)||Pe(b)||De(b)||_r(b)||$(b)||he(b)||ne(b)||le(b)||Ae(b)||Ue(b)||Ye(b)||He(b)||zt(b)||zr(b)||Gr(b)||Tr(b)||si(b)||ke(b)||ai(b)||Ar(b)||Wr(b)||Qe(b)||ui(b)||Tn(b)||nr(b)&&t.Has(b[e.Kind]))}f.TSchema=Fe})(o||(e.TypeGuard=o={}));var a;(function(f){function _(E){return E[e.Kind]==="Intersect"?E.allOf.every(M=>_(M)):E[e.Kind]==="Union"?E.anyOf.some(M=>_(M)):E[e.Kind]==="Undefined"?!0:E[e.Kind]==="Not"?!_(E.not):!1}f.Check=_})(a||(e.ExtendsUndefined=a={}));var l=class extends r{};e.TypeExtendsError=l;var c;(function(f){f[f.Union=0]="Union",f[f.True=1]="True",f[f.False=2]="False"})(c||(e.TypeExtendsResult=c={}));var d;(function(f){function _(p){return p===c.False?p:c.True}function E(p){throw new l(p)}function M(p){return o.TNever(p)||o.TIntersect(p)||o.TUnion(p)||o.TUnknown(p)||o.TAny(p)}function N(p,h){return o.TNever(h)?be(p,h):o.TIntersect(h)?ge(p,h):o.TUnion(h)?Uo(p,h):o.TUnknown(h)?ma(p,h):o.TAny(h)?R(p,h):E("StructuralRight")}function R(p,h){return c.True}function y(p,h){return o.TIntersect(h)?ge(p,h):o.TUnion(h)&&h.anyOf.some(_e=>o.TAny(_e)||o.TUnknown(_e))?c.True:o.TUnion(h)?c.Union:o.TUnknown(h)||o.TAny(h)?c.True:c.Union}function T(p,h){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)?c.True:c.False}function w(p,h){return o.TObject(h)&&Tr(h)?c.True:M(h)?N(p,h):o.TArray(h)?_(Ee(p.items,h.items)):c.False}function u(p,h){return M(h)?N(p,h):o.TAsyncIterator(h)?_(Ee(p.items,h.items)):c.False}function A(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TBigInt(h)?c.True:c.False}function v(p,h){return o.TLiteral(p)&&i.IsBoolean(p.const)||o.TBoolean(p)?c.True:c.False}function m(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TBoolean(h)?c.True:c.False}function P(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TConstructor(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((_e,Et)=>_(Ee(h.parameters[Et],_e))===c.True)?_(Ee(p.returns,h.returns)):c.False:c.False}function q(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TDate(h)?c.True:c.False}function te(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TFunction(h)?p.parameters.length>h.parameters.length?c.False:p.parameters.every((_e,Et)=>_(Ee(h.parameters[Et],_e))===c.True)?_(Ee(p.returns,h.returns)):c.False:c.False}function re(p,h){return o.TLiteral(p)&&i.IsNumber(p.const)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function pe(p,h){return o.TInteger(h)||o.TNumber(h)?c.True:M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):c.False}function ge(p,h){return h.allOf.every(_e=>Ee(p,_e)===c.True)?c.True:c.False}function Pe(p,h){return p.allOf.some(_e=>Ee(_e,h)===c.True)?c.True:c.False}function De(p,h){return M(h)?N(p,h):o.TIterator(h)?_(Ee(p.items,h.items)):c.False}function _r(p,h){return o.TLiteral(h)&&h.const===p.const?c.True:M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TString(h)?Tn(p,h):o.TNumber(h)?$(p,h):o.TInteger(h)?re(p,h):o.TBoolean(h)?v(p,h):c.False}function be(p,h){return c.False}function nr(p,h){return c.True}function wr(p){let[h,_e]=[p,0];for(;o.TNot(h);)h=h.not,_e+=1;return _e%2===0?h:e.Type.Unknown()}function O(p,h){return o.TNot(p)?Ee(wr(p),h):o.TNot(h)?Ee(p,wr(h)):E("Invalid fallthrough for Not")}function ue(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TNull(h)?c.True:c.False}function $(p,h){return o.TLiteralNumber(p)||o.TNumber(p)||o.TInteger(p)?c.True:c.False}function he(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TInteger(h)||o.TNumber(h)?c.True:c.False}function ne(p,h){return Object.getOwnPropertyNames(p.properties).length===h}function le(p){return Tr(p)}function Ae(p){return ne(p,0)||ne(p,1)&&"description"in p.properties&&o.TUnion(p.properties.description)&&p.properties.description.anyOf.length===2&&(o.TString(p.properties.description.anyOf[0])&&o.TUndefined(p.properties.description.anyOf[1])||o.TString(p.properties.description.anyOf[1])&&o.TUndefined(p.properties.description.anyOf[0]))}function Ue(p){return ne(p,0)}function Ye(p){return ne(p,0)}function He(p){return ne(p,0)}function Ze(p){return ne(p,0)}function zt(p){return Tr(p)}function zr(p){let h=e.Type.Number();return ne(p,0)||ne(p,1)&&"length"in p.properties&&_(Ee(p.properties.length,h))===c.True}function Gr(p){return ne(p,0)}function Tr(p){let h=e.Type.Number();return ne(p,0)||ne(p,1)&&"length"in p.properties&&_(Ee(p.properties.length,h))===c.True}function si(p){let h=e.Type.Function([e.Type.Any()],e.Type.Any());return ne(p,0)||ne(p,1)&&"then"in p.properties&&_(Ee(p.properties.then,h))===c.True}function wn(p,h){return Ee(p,h)===c.False||o.TOptional(p)&&!o.TOptional(h)?c.False:c.True}function ke(p,h){return o.TUnknown(p)?c.False:o.TAny(p)?c.Union:o.TNever(p)||o.TLiteralString(p)&&le(h)||o.TLiteralNumber(p)&&Ue(h)||o.TLiteralBoolean(p)&&Ye(h)||o.TSymbol(p)&&Ae(h)||o.TBigInt(p)&&He(h)||o.TString(p)&&le(h)||o.TSymbol(p)&&Ae(h)||o.TNumber(p)&&Ue(h)||o.TInteger(p)&&Ue(h)||o.TBoolean(p)&&Ye(h)||o.TUint8Array(p)&&zt(h)||o.TDate(p)&&Ze(h)||o.TConstructor(p)&&Gr(h)||o.TFunction(p)&&zr(h)?c.True:o.TRecord(p)&&o.TString(Ar(p))?h[e.Hint]==="Record"?c.True:c.False:o.TRecord(p)&&o.TNumber(Ar(p))?ne(h,0)?c.True:c.False:c.False}function ai(p,h){return M(h)?N(p,h):o.TRecord(h)?Qe(p,h):o.TObject(h)?(()=>{for(let _e of Object.getOwnPropertyNames(h.properties)){if(!(_e in p.properties)&&!o.TOptional(h.properties[_e]))return c.False;if(o.TOptional(h.properties[_e]))return c.True;if(wn(p.properties[_e],h.properties[_e])===c.False)return c.False}return c.True})():c.False}function $o(p,h){return M(h)?N(p,h):o.TObject(h)&&si(h)?c.True:o.TPromise(h)?_(Ee(p.item,h.item)):c.False}function Ar(p){return e.PatternNumberExact in p.patternProperties?e.Type.Number():e.PatternStringExact in p.patternProperties?e.Type.String():E("Unknown record key pattern")}function Wr(p){return e.PatternNumberExact in p.patternProperties?p.patternProperties[e.PatternNumberExact]:e.PatternStringExact in p.patternProperties?p.patternProperties[e.PatternStringExact]:E("Unable to get record value schema")}function Qe(p,h){let[_e,Et]=[Ar(h),Wr(h)];return o.TLiteralString(p)&&o.TNumber(_e)&&_(Ee(p,Et))===c.True?c.True:o.TUint8Array(p)&&o.TNumber(_e)||o.TString(p)&&o.TNumber(_e)||o.TArray(p)&&o.TNumber(_e)?Ee(p,Et):o.TObject(p)?(()=>{for(let Xf of Object.getOwnPropertyNames(p.properties))if(wn(Et,p.properties[Xf])===c.False)return c.False;return c.True})():c.False}function ui(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Ee(Wr(p),Wr(h)):c.False}function Tn(p,h){return o.TLiteral(p)&&i.IsString(p.const)||o.TString(p)?c.True:c.False}function No(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TString(h)?c.True:c.False}function Co(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TSymbol(h)?c.True:c.False}function Fe(p,h){return o.TTemplateLiteral(p)?Ee(k.Resolve(p),h):o.TTemplateLiteral(h)?Ee(p,k.Resolve(h)):E("Invalid fallthrough for TemplateLiteral")}function b(p,h){return o.TArray(h)&&p.items!==void 0&&p.items.every(_e=>Ee(_e,h.items)===c.True)}function Ie(p,h){return o.TNever(p)?c.True:o.TUnknown(p)?c.False:o.TAny(p)?c.Union:c.False}function lt(p,h){return M(h)?N(p,h):o.TObject(h)&&Tr(h)||o.TArray(h)&&b(p,h)?c.True:o.TTuple(h)?i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||!i.IsUndefined(p.items)&&i.IsUndefined(h.items)?c.False:i.IsUndefined(p.items)&&!i.IsUndefined(h.items)||p.items.every((_e,Et)=>Ee(_e,h.items[Et])===c.True)?c.True:c.False:c.False}function Vf(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TUint8Array(h)?c.True:c.False}function qf(p,h){return M(h)?N(p,h):o.TObject(h)?ke(p,h):o.TRecord(h)?Qe(p,h):o.TVoid(h)?Wf(p,h):o.TUndefined(h)?c.True:c.False}function Uo(p,h){return h.anyOf.some(_e=>Ee(p,_e)===c.True)?c.True:c.False}function zf(p,h){return p.anyOf.every(_e=>Ee(_e,h)===c.True)?c.True:c.False}function ma(p,h){return c.True}function Gf(p,h){return o.TNever(h)?be(p,h):o.TIntersect(h)?ge(p,h):o.TUnion(h)?Uo(p,h):o.TAny(h)?R(p,h):o.TString(h)?Tn(p,h):o.TNumber(h)?$(p,h):o.TInteger(h)?re(p,h):o.TBoolean(h)?v(p,h):o.TArray(h)?T(p,h):o.TTuple(h)?Ie(p,h):o.TObject(h)?ke(p,h):o.TUnknown(h)?c.True:c.False}function Wf(p,h){return o.TUndefined(p)||o.TUndefined(p)?c.True:c.False}function Hf(p,h){return o.TIntersect(h)?ge(p,h):o.TUnion(h)?Uo(p,h):o.TUnknown(h)?ma(p,h):o.TAny(h)?R(p,h):o.TObject(h)?ke(p,h):o.TVoid(h)?c.True:c.False}function Ee(p,h){return o.TTemplateLiteral(p)||o.TTemplateLiteral(h)?Fe(p,h):o.TNot(p)||o.TNot(h)?O(p,h):o.TAny(p)?y(p,h):o.TArray(p)?w(p,h):o.TBigInt(p)?A(p,h):o.TBoolean(p)?m(p,h):o.TAsyncIterator(p)?u(p,h):o.TConstructor(p)?P(p,h):o.TDate(p)?q(p,h):o.TFunction(p)?te(p,h):o.TInteger(p)?pe(p,h):o.TIntersect(p)?Pe(p,h):o.TIterator(p)?De(p,h):o.TLiteral(p)?_r(p,h):o.TNever(p)?nr(p,h):o.TNull(p)?ue(p,h):o.TNumber(p)?he(p,h):o.TObject(p)?ai(p,h):o.TRecord(p)?ui(p,h):o.TString(p)?No(p,h):o.TSymbol(p)?Co(p,h):o.TTuple(p)?lt(p,h):o.TPromise(p)?$o(p,h):o.TUint8Array(p)?Vf(p,h):o.TUndefined(p)?qf(p,h):o.TUnion(p)?zf(p,h):o.TUnknown(p)?Gf(p,h):o.TVoid(p)?Hf(p,h):E(`Unknown left type operand '${p[e.Kind]}'`)}function Jf(p,h){return Ee(p,h)}f.Extends=Jf})(d||(e.TypeExtends=d={}));var g;(function(f){function _(w){return w.map(u=>R(u))}function E(w){return new Date(w.getTime())}function M(w){return new Uint8Array(w)}function N(w){let u=Object.getOwnPropertyNames(w).reduce((v,m)=>({...v,[m]:R(w[m])}),{}),A=Object.getOwnPropertySymbols(w).reduce((v,m)=>({...v,[m]:R(w[m])}),{});return{...u,...A}}function R(w){return i.IsArray(w)?_(w):i.IsDate(w)?E(w):i.IsUint8Array(w)?M(w):i.IsObject(w)?N(w):w}function y(w){return w.map(u=>T(u))}f.Rest=y;function T(w,u={}){return{...R(w),...u}}f.Type=T})(g||(e.TypeClone=g={}));var C;(function(f){function _(P){return P.map(q=>{let{[e.Optional]:te,...re}=g.Type(q);return re})}function E(P){return P.every(q=>o.TOptional(q))}function M(P){return P.some(q=>o.TOptional(q))}function N(P){return E(P.allOf)?e.Type.Optional(e.Type.Intersect(_(P.allOf))):P}function R(P){return M(P.anyOf)?e.Type.Optional(e.Type.Union(_(P.anyOf))):P}function y(P){return P[e.Kind]==="Intersect"?N(P):P[e.Kind]==="Union"?R(P):P}function T(P,q){let te=P.allOf.reduce((re,pe)=>{let ge=v(pe,q);return ge[e.Kind]==="Never"?re:[...re,ge]},[]);return y(e.Type.Intersect(te))}function w(P,q){let te=P.anyOf.map(re=>v(re,q));return y(e.Type.Union(te))}function u(P,q){let te=P.properties[q];return i.IsUndefined(te)?e.Type.Never():e.Type.Union([te])}function A(P,q){let te=P.items;if(i.IsUndefined(te))return e.Type.Never();let re=te[q];return i.IsUndefined(re)?e.Type.Never():re}function v(P,q){return P[e.Kind]==="Intersect"?T(P,q):P[e.Kind]==="Union"?w(P,q):P[e.Kind]==="Object"?u(P,q):P[e.Kind]==="Tuple"?A(P,q):e.Type.Never()}function m(P,q,te={}){let re=q.map(pe=>v(P,pe.toString()));return y(e.Type.Union(re,te))}f.Resolve=m})(C||(e.IndexedAccessor=C={}));var S;(function(f){function _(A){let[v,m]=[A.slice(0,1),A.slice(1)];return`${v.toLowerCase()}${m}`}function E(A){let[v,m]=[A.slice(0,1),A.slice(1)];return`${v.toUpperCase()}${m}`}function M(A){return A.toUpperCase()}function N(A){return A.toLowerCase()}function R(A,v){let m=z.ParseExact(A.pattern);if(!U.Check(m))return{...A,pattern:y(A.pattern,v)};let te=[...L.Generate(m)].map(ge=>e.Type.Literal(ge)),re=T(te,v),pe=e.Type.Union(re);return e.Type.TemplateLiteral([pe])}function y(A,v){return typeof A=="string"?v==="Uncapitalize"?_(A):v==="Capitalize"?E(A):v==="Uppercase"?M(A):v==="Lowercase"?N(A):A:A.toString()}function T(A,v){if(A.length===0)return[];let[m,...P]=A;return[u(m,v),...T(P,v)]}function w(A,v){return o.TTemplateLiteral(A)?R(A,v):o.TUnion(A)?e.Type.Union(T(A.anyOf,v)):o.TLiteral(A)?e.Type.Literal(y(A.const,v)):A}function u(A,v){return w(A,v)}f.Map=u})(S||(e.Intrinsic=S={}));var x;(function(f){function _(y,T){return e.Type.Intersect(y.allOf.map(w=>N(w,T)),{...y})}function E(y,T){return e.Type.Union(y.anyOf.map(w=>N(w,T)),{...y})}function M(y,T){return T(y)}function N(y,T){return y[e.Kind]==="Intersect"?_(y,T):y[e.Kind]==="Union"?E(y,T):y[e.Kind]==="Object"?M(y,T):y}function R(y,T,w){return{...N(g.Type(y),T),...w}}f.Map=R})(x||(e.ObjectMap=x={}));var K;(function(f){function _(u){return u[0]==="^"&&u[u.length-1]==="$"?u.slice(1,u.length-1):u}function E(u,A){return u.allOf.reduce((v,m)=>[...v,...y(m,A)],[])}function M(u,A){let v=u.anyOf.map(m=>y(m,A));return[...v.reduce((m,P)=>P.map(q=>v.every(te=>te.includes(q))?m.add(q):m)[0],new Set)]}function N(u,A){return Object.getOwnPropertyNames(u.properties)}function R(u,A){return A.includePatterns?Object.getOwnPropertyNames(u.patternProperties):[]}function y(u,A){return o.TIntersect(u)?E(u,A):o.TUnion(u)?M(u,A):o.TObject(u)?N(u,A):o.TRecord(u)?R(u,A):[]}function T(u,A){return[...new Set(y(u,A))]}f.ResolveKeys=T;function w(u){return`^(${T(u,{includePatterns:!0}).map(m=>`(${_(m)})`).join("|")})$`}f.ResolvePattern=w})(K||(e.KeyResolver=K={}));var H=class extends r{};e.KeyArrayResolverError=H;var F;(function(f){function _(E){return Array.isArray(E)?E:o.TUnionLiteral(E)?E.anyOf.map(M=>M.const.toString()):o.TLiteral(E)?[E.const]:o.TTemplateLiteral(E)?(()=>{let M=z.ParseExact(E.pattern);if(!U.Check(M))throw new H("Cannot resolve keys from infinite template expression");return[...L.Generate(M)]})():[]}f.Resolve=_})(F||(e.KeyArrayResolver=F={}));var j;(function(f){function*_(M){for(let N of M.anyOf)N[e.Kind]==="Union"?yield*_(N):yield N}function E(M){return e.Type.Union([..._(M)],{...M})}f.Resolve=E})(j||(e.UnionResolver=j={}));var V=class extends r{};e.TemplateLiteralPatternError=V;var G;(function(f){function _(R){throw new V(R)}function E(R){return R.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function M(R,y){return o.TTemplateLiteral(R)?R.pattern.slice(1,R.pattern.length-1):o.TUnion(R)?`(${R.anyOf.map(T=>M(T,y)).join("|")})`:o.TNumber(R)?`${y}${e.PatternNumber}`:o.TInteger(R)?`${y}${e.PatternNumber}`:o.TBigInt(R)?`${y}${e.PatternNumber}`:o.TString(R)?`${y}${e.PatternString}`:o.TLiteral(R)?`${y}${E(R.const.toString())}`:o.TBoolean(R)?`${y}${e.PatternBoolean}`:_(`Unexpected Kind '${R[e.Kind]}'`)}function N(R){return`^${R.map(y=>M(y,"")).join("")}$`}f.Create=N})(G||(e.TemplateLiteralPattern=G={}));var k;(function(f){function _(E){let M=z.ParseExact(E.pattern);if(!U.Check(M))return e.Type.String();let N=[...L.Generate(M)].map(R=>e.Type.Literal(R));return e.Type.Union(N)}f.Resolve=_})(k||(e.TemplateLiteralResolver=k={}));var Q=class extends r{};e.TemplateLiteralParserError=Q;var z;(function(f){function _(P,q,te){return P[q]===te&&P.charCodeAt(q-1)!==92}function E(P,q){return _(P,q,"(")}function M(P,q){return _(P,q,")")}function N(P,q){return _(P,q,"|")}function R(P){if(!(E(P,0)&&M(P,P.length-1)))return!1;let q=0;for(let te=0;te<P.length;te++)if(E(P,te)&&(q+=1),M(P,te)&&(q-=1),q===0&&te!==P.length-1)return!1;return!0}function y(P){return P.slice(1,P.length-1)}function T(P){let q=0;for(let te=0;te<P.length;te++)if(E(P,te)&&(q+=1),M(P,te)&&(q-=1),N(P,te)&&q===0)return!0;return!1}function w(P){for(let q=0;q<P.length;q++)if(E(P,q))return!0;return!1}function u(P){let[q,te]=[0,0],re=[];for(let ge=0;ge<P.length;ge++)if(E(P,ge)&&(q+=1),M(P,ge)&&(q-=1),N(P,ge)&&q===0){let Pe=P.slice(te,ge);Pe.length>0&&re.push(v(Pe)),te=ge+1}let pe=P.slice(te);return pe.length>0&&re.push(v(pe)),re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"or",expr:re}}function A(P){function q(pe,ge){if(!E(pe,ge))throw new Q("TemplateLiteralParser: Index must point to open parens");let Pe=0;for(let De=ge;De<pe.length;De++)if(E(pe,De)&&(Pe+=1),M(pe,De)&&(Pe-=1),Pe===0)return[ge,De];throw new Q("TemplateLiteralParser: Unclosed group parens in expression")}function te(pe,ge){for(let Pe=ge;Pe<pe.length;Pe++)if(E(pe,Pe))return[ge,Pe];return[ge,pe.length]}let re=[];for(let pe=0;pe<P.length;pe++)if(E(P,pe)){let[ge,Pe]=q(P,pe),De=P.slice(ge,Pe+1);re.push(v(De)),pe=Pe}else{let[ge,Pe]=te(P,pe),De=P.slice(ge,Pe);De.length>0&&re.push(v(De)),pe=Pe-1}return re.length===0?{type:"const",const:""}:re.length===1?re[0]:{type:"and",expr:re}}function v(P){return R(P)?v(y(P)):T(P)?u(P):w(P)?A(P):{type:"const",const:P}}f.Parse=v;function m(P){return v(P.slice(1,P.length-1))}f.ParseExact=m})(z||(e.TemplateLiteralParser=z={}));var ce=class extends r{};e.TemplateLiteralFiniteError=ce;var U;(function(f){function _(y){throw new ce(y)}function E(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="0"&&y.expr[1].type==="const"&&y.expr[1].const==="[1-9][0-9]*"}function M(y){return y.type==="or"&&y.expr.length===2&&y.expr[0].type==="const"&&y.expr[0].const==="true"&&y.expr[1].type==="const"&&y.expr[1].const==="false"}function N(y){return y.type==="const"&&y.const===".*"}function R(y){return M(y)?!0:E(y)||N(y)?!1:y.type==="and"?y.expr.every(T=>R(T)):y.type==="or"?y.expr.every(T=>R(T)):y.type==="const"?!0:_("Unknown expression type")}f.Check=R})(U||(e.TemplateLiteralFinite=U={}));var D=class extends r{};e.TemplateLiteralGeneratorError=D;var L;(function(f){function*_(y){if(y.length===1)return yield*y[0];for(let T of y[0])for(let w of _(y.slice(1)))yield`${T}${w}`}function*E(y){return yield*_(y.expr.map(T=>[...R(T)]))}function*M(y){for(let T of y.expr)yield*R(T)}function*N(y){return yield y.const}function*R(y){return y.type==="and"?yield*E(y):y.type==="or"?yield*M(y):y.type==="const"?yield*N(y):(()=>{throw new D("Unknown expression")})()}f.Generate=R})(L||(e.TemplateLiteralGenerator=L={}));var ee;(function(f){function*_(R){let y=R.trim().replace(/"|'/g,"");return y==="boolean"?yield e.Type.Boolean():y==="number"?yield e.Type.Number():y==="bigint"?yield e.Type.BigInt():y==="string"?yield e.Type.String():yield(()=>{let T=y.split("|").map(w=>e.Type.Literal(w.trim()));return T.length===0?e.Type.Never():T.length===1?T[0]:e.Type.Union(T)})()}function*E(R){if(R[1]!=="{"){let y=e.Type.Literal("$"),T=M(R.slice(1));return yield*[y,...T]}for(let y=2;y<R.length;y++)if(R[y]==="}"){let T=_(R.slice(2,y)),w=M(R.slice(y+1));return yield*[...T,...w]}yield e.Type.Literal(R)}function*M(R){for(let y=0;y<R.length;y++)if(R[y]==="$"){let T=e.Type.Literal(R.slice(0,y)),w=E(R.slice(y));return yield*[T,...w]}yield e.Type.Literal(R)}function N(R){return[...M(R)]}f.Parse=N})(ee||(e.TemplateLiteralDslParser=ee={}));var ie=class{constructor(f){this.schema=f}Decode(f){return new Y(this.schema,f)}};e.TransformDecodeBuilder=ie;var Y=class{constructor(f,_){this.schema=f,this.decode=_}Encode(f){let _=g.Type(this.schema);return o.TTransform(_)?(()=>{let N={Encode:R=>_[e.Transform].Encode(f(R)),Decode:R=>this.decode(_[e.Transform].Decode(R))};return{..._,[e.Transform]:N}})():(()=>{let E={Decode:this.decode,Encode:f};return{..._,[e.Transform]:E}})()}};e.TransformEncodeBuilder=Y;var se=0,B=class extends r{};e.TypeBuilderError=B;var W=class{Create(f){return f}Throw(f){throw new B(f)}Discard(f,_){return _.reduce((E,M)=>{let{[M]:N,...R}=E;return R},f)}Strict(f){return JSON.parse(JSON.stringify(f))}};e.TypeBuilder=W;var X=class extends W{ReadonlyOptional(f){return this.Readonly(this.Optional(f))}Readonly(f){return{...g.Type(f),[e.Readonly]:"Readonly"}}Optional(f){return{...g.Type(f),[e.Optional]:"Optional"}}Any(f={}){return this.Create({...f,[e.Kind]:"Any"})}Array(f,_={}){return this.Create({..._,[e.Kind]:"Array",type:"array",items:g.Type(f)})}Boolean(f={}){return this.Create({...f,[e.Kind]:"Boolean",type:"boolean"})}Capitalize(f,_={}){return{...S.Map(g.Type(f),"Capitalize"),..._}}Composite(f,_){let E=e.Type.Intersect(f,{}),N=K.ResolveKeys(E,{includePatterns:!1}).reduce((R,y)=>({...R,[y]:e.Type.Index(E,[y])}),{});return e.Type.Object(N,_)}Enum(f,_={}){if(i.IsUndefined(f))return this.Throw("Enum undefined or empty");let E=Object.getOwnPropertyNames(f).filter(R=>isNaN(R)).map(R=>f[R]),N=[...new Set(E)].map(R=>e.Type.Literal(R));return this.Union(N,{..._,[e.Hint]:"Enum"})}Extends(f,_,E,M,N={}){switch(d.Extends(f,_)){case c.Union:return this.Union([g.Type(E,N),g.Type(M,N)]);case c.True:return g.Type(E,N);case c.False:return g.Type(M,N)}}Exclude(f,_,E={}){return o.TTemplateLiteral(f)?this.Exclude(k.Resolve(f),_,E):o.TTemplateLiteral(_)?this.Exclude(f,k.Resolve(_),E):o.TUnion(f)?(()=>{let M=f.anyOf.filter(N=>d.Extends(N,_)===c.False);return M.length===1?g.Type(M[0],E):this.Union(M,E)})():d.Extends(f,_)!==c.False?this.Never(E):g.Type(f,E)}Extract(f,_,E={}){return o.TTemplateLiteral(f)?this.Extract(k.Resolve(f),_,E):o.TTemplateLiteral(_)?this.Extract(f,k.Resolve(_),E):o.TUnion(f)?(()=>{let M=f.anyOf.filter(N=>d.Extends(N,_)!==c.False);return M.length===1?g.Type(M[0],E):this.Union(M,E)})():d.Extends(f,_)!==c.False?g.Type(f,E):this.Never(E)}Index(f,_,E={}){return o.TArray(f)&&o.TNumber(_)?g.Type(f.items,E):o.TTuple(f)&&o.TNumber(_)?(()=>{let N=(i.IsUndefined(f.items)?[]:f.items).map(R=>g.Type(R));return this.Union(N,E)})():(()=>{let M=F.Resolve(_),N=g.Type(f);return C.Resolve(N,M,E)})()}Integer(f={}){return this.Create({...f,[e.Kind]:"Integer",type:"integer"})}Intersect(f,_={}){if(f.length===0)return e.Type.Never();if(f.length===1)return g.Type(f[0],_);f.some(R=>o.TTransform(R))&&this.Throw("Cannot intersect transform types");let E=f.every(R=>o.TObject(R)),M=g.Rest(f),N=o.TSchema(_.unevaluatedProperties)?{unevaluatedProperties:g.Type(_.unevaluatedProperties)}:{};return _.unevaluatedProperties===!1||o.TSchema(_.unevaluatedProperties)||E?this.Create({..._,...N,[e.Kind]:"Intersect",type:"object",allOf:M}):this.Create({..._,...N,[e.Kind]:"Intersect",allOf:M})}KeyOf(f,_={}){return o.TRecord(f)?(()=>{let E=Object.getOwnPropertyNames(f.patternProperties)[0];return E===e.PatternNumberExact?this.Number(_):E===e.PatternStringExact?this.String(_):this.Throw("Unable to resolve key type from Record key pattern")})():o.TTuple(f)?(()=>{let M=(i.IsUndefined(f.items)?[]:f.items).map((N,R)=>e.Type.Literal(R.toString()));return this.Union(M,_)})():o.TArray(f)?this.Number(_):(()=>{let E=K.ResolveKeys(f,{includePatterns:!1});if(E.length===0)return this.Never(_);let M=E.map(N=>this.Literal(N));return this.Union(M,_)})()}Literal(f,_={}){return this.Create({..._,[e.Kind]:"Literal",const:f,type:typeof f})}Lowercase(f,_={}){return{...S.Map(g.Type(f),"Lowercase"),..._}}Never(f={}){return this.Create({...f,[e.Kind]:"Never",not:{}})}Not(f,_){return this.Create({..._,[e.Kind]:"Not",not:g.Type(f)})}Null(f={}){return this.Create({...f,[e.Kind]:"Null",type:"null"})}Number(f={}){return this.Create({...f,[e.Kind]:"Number",type:"number"})}Object(f,_={}){let E=Object.getOwnPropertyNames(f),M=E.filter(T=>o.TOptional(f[T])),N=E.filter(T=>!M.includes(T)),R=o.TSchema(_.additionalProperties)?{additionalProperties:g.Type(_.additionalProperties)}:{},y=E.reduce((T,w)=>({...T,[w]:g.Type(f[w])}),{});return N.length>0?this.Create({..._,...R,[e.Kind]:"Object",type:"object",properties:y,required:N}):this.Create({..._,...R,[e.Kind]:"Object",type:"object",properties:y})}Omit(f,_,E={}){let M=F.Resolve(_);return x.Map(this.Discard(g.Type(f),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(R=>!M.includes(R)),N.required.length===0&&delete N.required);for(let R of Object.getOwnPropertyNames(N.properties))M.includes(R)&&delete N.properties[R];return this.Create(N)},E)}Partial(f,_={}){return x.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let M=Object.getOwnPropertyNames(E.properties).reduce((N,R)=>({...N,[R]:this.Optional(E.properties[R])}),{});return this.Object(M,this.Discard(E,["required"]))},_)}Pick(f,_,E={}){let M=F.Resolve(_);return x.Map(this.Discard(g.Type(f),["$id",e.Transform]),N=>{i.IsArray(N.required)&&(N.required=N.required.filter(R=>M.includes(R)),N.required.length===0&&delete N.required);for(let R of Object.getOwnPropertyNames(N.properties))M.includes(R)||delete N.properties[R];return this.Create(N)},E)}Record(f,_,E={}){return o.TTemplateLiteral(f)?(()=>{let M=z.ParseExact(f.pattern);return U.Check(M)?this.Object([...L.Generate(M)].reduce((N,R)=>({...N,[R]:g.Type(_)}),{}),E):this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[f.pattern]:g.Type(_)}})})():o.TUnion(f)?(()=>{let M=j.Resolve(f);if(o.TUnionLiteral(M)){let N=M.anyOf.reduce((R,y)=>({...R,[y.const]:g.Type(_)}),{});return this.Object(N,{...E,[e.Hint]:"Record"})}else this.Throw("Record key of type union contains non-literal types")})():o.TLiteral(f)?i.IsString(f.const)||i.IsNumber(f.const)?this.Object({[f.const]:g.Type(_)},E):this.Throw("Record key of type literal is not of type string or number"):o.TInteger(f)||o.TNumber(f)?this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[e.PatternNumberExact]:g.Type(_)}}):o.TString(f)?(()=>{let M=i.IsUndefined(f.pattern)?e.PatternStringExact:f.pattern;return this.Create({...E,[e.Kind]:"Record",type:"object",patternProperties:{[M]:g.Type(_)}})})():this.Never()}Recursive(f,_={}){i.IsUndefined(_.$id)&&(_.$id=`T${se++}`);let E=f({[e.Kind]:"This",$ref:`${_.$id}`});return E.$id=_.$id,this.Create({..._,[e.Hint]:"Recursive",...E})}Ref(f,_={}){return i.IsString(f)?this.Create({..._,[e.Kind]:"Ref",$ref:f}):(i.IsUndefined(f.$id)&&this.Throw("Reference target type must specify an $id"),this.Create({..._,[e.Kind]:"Ref",$ref:f.$id}))}Required(f,_={}){return x.Map(this.Discard(g.Type(f),["$id",e.Transform]),E=>{let M=Object.getOwnPropertyNames(E.properties).reduce((N,R)=>({...N,[R]:this.Discard(E.properties[R],[e.Optional])}),{});return this.Object(M,E)},_)}Rest(f){return o.TTuple(f)&&!i.IsUndefined(f.items)?g.Rest(f.items):o.TIntersect(f)?g.Rest(f.allOf):o.TUnion(f)?g.Rest(f.anyOf):[]}String(f={}){return this.Create({...f,[e.Kind]:"String",type:"string"})}TemplateLiteral(f,_={}){let E=i.IsString(f)?G.Create(ee.Parse(f)):G.Create(f);return this.Create({..._,[e.Kind]:"TemplateLiteral",type:"string",pattern:E})}Transform(f){return new ie(f)}Tuple(f,_={}){let[E,M,N]=[!1,f.length,f.length],R=g.Rest(f),y=f.length>0?{..._,[e.Kind]:"Tuple",type:"array",items:R,additionalItems:E,minItems:M,maxItems:N}:{..._,[e.Kind]:"Tuple",type:"array",minItems:M,maxItems:N};return this.Create(y)}Uncapitalize(f,_={}){return{...S.Map(g.Type(f),"Uncapitalize"),..._}}Union(f,_={}){return o.TTemplateLiteral(f)?k.Resolve(f):(()=>{let E=f;if(E.length===0)return this.Never(_);if(E.length===1)return this.Create(g.Type(E[0],_));let M=g.Rest(E);return this.Create({..._,[e.Kind]:"Union",anyOf:M})})()}Unknown(f={}){return this.Create({...f,[e.Kind]:"Unknown"})}Unsafe(f={}){return this.Create({...f,[e.Kind]:f[e.Kind]||"Unsafe"})}Uppercase(f,_={}){return{...S.Map(g.Type(f),"Uppercase"),..._}}};e.JsonTypeBuilder=X;var fe=class extends X{AsyncIterator(f,_={}){return this.Create({..._,[e.Kind]:"AsyncIterator",type:"AsyncIterator",items:g.Type(f)})}Awaited(f,_={}){let E=M=>M.length>0?(()=>{let[N,...R]=M;return[this.Awaited(N),...E(R)]})():M;return o.TIntersect(f)?e.Type.Intersect(E(f.allOf)):o.TUnion(f)?e.Type.Union(E(f.anyOf)):o.TPromise(f)?this.Awaited(f.item):g.Type(f,_)}BigInt(f={}){return this.Create({...f,[e.Kind]:"BigInt",type:"bigint"})}ConstructorParameters(f,_={}){return this.Tuple([...f.parameters],{..._})}Constructor(f,_,E){let[M,N]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Constructor",type:"Constructor",parameters:M,returns:N})}Date(f={}){return this.Create({...f,[e.Kind]:"Date",type:"Date"})}Function(f,_,E){let[M,N]=[g.Rest(f),g.Type(_)];return this.Create({...E,[e.Kind]:"Function",type:"Function",parameters:M,returns:N})}InstanceType(f,_={}){return g.Type(f.returns,_)}Iterator(f,_={}){return this.Create({..._,[e.Kind]:"Iterator",type:"Iterator",items:g.Type(f)})}Parameters(f,_={}){return this.Tuple(f.parameters,{..._})}Promise(f,_={}){return this.Create({..._,[e.Kind]:"Promise",type:"Promise",item:g.Type(f)})}RegExp(f,_={}){let E=i.IsString(f)?f:f.source;return this.Create({..._,[e.Kind]:"String",type:"string",pattern:E})}RegEx(f,_={}){return this.RegExp(f,_)}ReturnType(f,_={}){return g.Type(f.returns,_)}Symbol(f){return this.Create({...f,[e.Kind]:"Symbol",type:"symbol"})}Undefined(f={}){return this.Create({...f,[e.Kind]:"Undefined",type:"undefined"})}Uint8Array(f={}){return this.Create({...f,[e.Kind]:"Uint8Array",type:"Uint8Array"})}Void(f={}){return this.Create({...f,[e.Kind]:"Void",type:"void"})}};e.JavaScriptTypeBuilder=fe,e.JsonType=new X,e.Type=new fe}}),Hr=ft(Gt(),1),{String:rd,Optional:nd,Boolean:id,Object:od,Number:sd}=Hr.Type,ad=rd.bind(Hr.Type),ud=sd.bind(Hr.Type),Y1=od.bind(Hr.Type),Q1=nd.bind(Hr.Type),cd=id.bind(Hr.Type),Z1=ad(),eE=ud(),tE=cd();function _a(e){return Array.isArray(e)?e:[e]}var ld=["Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function fd(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(t==="string"||t==="number"||t==="bigint"||t==="symbol")return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(e instanceof Uint8Array)return"Uint8Array";if(e.constructor===Object)return"Object";let r=dd(e);return r||"Object"}function dd(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(ld.includes(t))return t}var 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}static equals(e,t){return e===t||e.major===t.major&&e.name===t.name}};I.uint=new I(0,"uint",!0);I.negint=new I(1,"negint",!0);I.bytes=new I(2,"bytes",!0);I.string=new I(3,"string",!0);I.array=new I(4,"array",!1);I.map=new I(5,"map",!1);I.tag=new I(6,"tag",!1);I.float=new I(7,"float",!0);I.false=new I(7,"false",!0);I.true=new I(7,"true",!0);I.null=new I(7,"null",!0);I.undefined=new I(7,"undefined",!0);I.break=new I(7,"break",!0);var Z=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}`}},Sn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",pd=new TextEncoder;function fi(e){return Sn&&globalThis.Buffer.isBuffer(e)}function xn(e){return e instanceof Uint8Array?fi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var hd=24,yd=200,Fo=Sn?e=>e.length>=hd?globalThis.Buffer.from(e):wa(e):e=>e.length>=yd?pd.encode(e):wa(e),Wt=e=>Uint8Array.from(e),gd=Sn?(e,t,r)=>fi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),bd=Sn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),xn(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},md=Sn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function Na(e,t){if(fi(e)&&fi(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}function wa(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(i>=55296&&i<=57343&&(i=65533),t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}var Ta=4096;function Ca(e){let t=e.length;if(t<=Ta)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Ta));return r}var vd=256,Ua=class{constructor(e=vd){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=md(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=gd(r,0,this.cursor)}else t=bd(this.chunks,this.cursor);return e&&this.reset(),t}},_d=class{constructor(e){this.dest=e,this.cursor=0,this.chunks=[e]}reset(){this.cursor=0}push(e){if(this.cursor+e.length>this.dest.length)throw new Error("write out of bounds, destination buffer is too small");this.dest.set(e,this.cursor),this.cursor+=e.length}toBytes(e=!1){let t=this.dest.subarray(0,this.cursor);return e&&this.reset(),t}},de="CBOR decode error:",cr="CBOR encode error:",Rn=[];Rn[23]=1;Rn[24]=2;Rn[25]=3;Rn[26]=5;Rn[27]=9;function Jr(e,t,r){if(e.length-t<r)throw new Error(`${de} not enough data for type`)}var ze=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Or(e,t,r){Jr(e,t,1);let n=e[t];if(r.strict===!0&&n<ze[0])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function Er(e,t,r){Jr(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<ze[1])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function Ir(e,t,r){Jr(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<ze[2])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function Sr(e,t,r){Jr(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<ze[3])throw new Error(`${de} 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(`${de} integers outside of the safe integer range are not supported`)}function wd(e,t,r,n){return new Z(I.uint,Or(e,t+1,n),2)}function Td(e,t,r,n){return new Z(I.uint,Er(e,t+1,n),3)}function Ad(e,t,r,n){return new Z(I.uint,Ir(e,t+1,n),5)}function Od(e,t,r,n){return new Z(I.uint,Sr(e,t+1,n),9)}function xr(e,t){return pt(e,0,t.value)}function pt(e,t,r){if(r<ze[0]){let n=Number(r);e.push([t|n])}else if(r<ze[1]){let n=Number(r);e.push([t|24,n])}else if(r<ze[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<ze[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<ze[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${de} encountered BigInt larger than allowable range`)}}xr.encodedSize=function(t){return pt.encodedSize(t.value)};pt.encodedSize=function(t){return t<ze[0]?1:t<ze[1]?2:t<ze[2]?3:t<ze[3]?5:9};xr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function Ed(e,t,r,n){return new Z(I.negint,-1-Or(e,t+1,n),2)}function Id(e,t,r,n){return new Z(I.negint,-1-Er(e,t+1,n),3)}function Sd(e,t,r,n){return new Z(I.negint,-1-Ir(e,t+1,n),5)}var Ko=BigInt(-1),Ma=BigInt(1);function xd(e,t,r,n){let i=Sr(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new Z(I.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${de} integers outside of the safe integer range are not supported`);return new Z(I.negint,Ko-BigInt(i),9)}function Vo(e,t){let r=t.value,n=typeof r=="bigint"?r*Ko-Ma:r*-1-1;pt(e,t.type.majorEncoded,n)}Vo.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*Ko-Ma:r*-1-1;return n<ze[0]?1:n<ze[1]?2:n<ze[2]?3:n<ze[3]?5:9};Vo.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Pn(e,t,r,n){Jr(e,t,r+n);let i=e.slice(t+r,t+r+n);return new Z(I.bytes,i,r+n)}function Rd(e,t,r,n){return Pn(e,t,1,r)}function Pd(e,t,r,n){return Pn(e,t,2,Or(e,t+1,n))}function $d(e,t,r,n){return Pn(e,t,3,Er(e,t+1,n))}function Nd(e,t,r,n){return Pn(e,t,5,Ir(e,t+1,n))}function Cd(e,t,r,n){let i=Sr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer bytes lengths not supported`);return Pn(e,t,9,i)}function di(e){return e.encodedBytes===void 0&&(e.encodedBytes=I.equals(e.type,I.string)?Fo(e.value):e.value),e.encodedBytes}function gi(e,t){let r=di(t);pt(e,t.type.majorEncoded,r.length),e.push(r)}gi.encodedSize=function(t){let r=di(t);return pt.encodedSize(r.length)+r.length};gi.compareTokens=function(t,r){return Ud(di(t),di(r))};function Ud(e,t){return e.length<t.length?-1:e.length>t.length?1:Na(e,t)}var Aa=new TextDecoder,Md=32;function Dd(e,t,r){if(r-t<Md){let i="";for(let s=t;s<r;s++){let o=e[s];if(o&128)return Aa.decode(e.subarray(t,r));i+=String.fromCharCode(o)}return i}return Aa.decode(e.subarray(t,r))}function $n(e,t,r,n,i){let s=r+n;Jr(e,t,s);let o=new Z(I.string,Dd(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=e.slice(t+r,t+s)),o}function Bd(e,t,r,n){return $n(e,t,1,r,n)}function Ld(e,t,r,n){return $n(e,t,2,Or(e,t+1,n),n)}function jd(e,t,r,n){return $n(e,t,3,Er(e,t+1,n),n)}function kd(e,t,r,n){return $n(e,t,5,Ir(e,t+1,n),n)}function Fd(e,t,r,n){let i=Sr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer string lengths not supported`);return $n(e,t,9,i,n)}var Kd=gi;function Xr(e,t,r,n){return new Z(I.array,n,r)}function Vd(e,t,r,n){return Xr(e,t,1,r)}function qd(e,t,r,n){return Xr(e,t,2,Or(e,t+1,n))}function zd(e,t,r,n){return Xr(e,t,3,Er(e,t+1,n))}function Gd(e,t,r,n){return Xr(e,t,5,Ir(e,t+1,n))}function Wd(e,t,r,n){let i=Sr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer array lengths not supported`);return Xr(e,t,9,i)}function Hd(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return Xr(e,t,1,1/0)}function qo(e,t){pt(e,I.array.majorEncoded,t.value)}qo.compareTokens=xr.compareTokens;qo.encodedSize=function(t){return pt.encodedSize(t.value)};function Yr(e,t,r,n){return new Z(I.map,n,r)}function Jd(e,t,r,n){return Yr(e,t,1,r)}function Xd(e,t,r,n){return Yr(e,t,2,Or(e,t+1,n))}function Yd(e,t,r,n){return Yr(e,t,3,Er(e,t+1,n))}function Qd(e,t,r,n){return Yr(e,t,5,Ir(e,t+1,n))}function Zd(e,t,r,n){let i=Sr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer map lengths not supported`);return Yr(e,t,9,i)}function ep(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return Yr(e,t,1,1/0)}function zo(e,t){pt(e,I.map.majorEncoded,t.value)}zo.compareTokens=xr.compareTokens;zo.encodedSize=function(t){return pt.encodedSize(t.value)};function tp(e,t,r,n){return new Z(I.tag,r,1)}function rp(e,t,r,n){return new Z(I.tag,Or(e,t+1,n),2)}function np(e,t,r,n){return new Z(I.tag,Er(e,t+1,n),3)}function ip(e,t,r,n){return new Z(I.tag,Ir(e,t+1,n),5)}function op(e,t,r,n){return new Z(I.tag,Sr(e,t+1,n),9)}function Go(e,t){pt(e,I.tag.majorEncoded,t.value)}Go.compareTokens=xr.compareTokens;Go.encodedSize=function(t){return pt.encodedSize(t.value)};var Da=20,Ba=21,La=22,ja=23;function sp(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${de} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Z(I.null,null,1):new Z(I.undefined,void 0,1)}function ap(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return new Z(I.break,void 0,1)}function Wo(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${de} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${de} Infinity values are not supported`)}return new Z(I.float,e,t)}function up(e,t,r,n){return Wo(Jo(e,t+1),3,n)}function cp(e,t,r,n){return Wo(Xo(e,t+1),5,n)}function lp(e,t,r,n){return Wo(Va(e,t+1),9,n)}function Ho(e,t,r){let n=t.value;if(n===!1)e.push([I.float.majorEncoded|Da]);else if(n===!0)e.push([I.float.majorEncoded|Ba]);else if(n===null)e.push([I.float.majorEncoded|La]);else if(n===void 0)e.push([I.float.majorEncoded|ja]);else{let i,s=!1;(!r||r.float64!==!0)&&(Fa(n),i=Jo(It,1),n===i||Number.isNaN(n)?(It[0]=249,e.push(It.slice(0,3)),s=!0):(Ka(n),i=Xo(It,1),n===i&&(It[0]=250,e.push(It.slice(0,5)),s=!0))),s||(fp(n),i=Va(It,1),It[0]=251,e.push(It.slice(0,9)))}}Ho.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Fa(n);let i=Jo(It,1);if(n===i||Number.isNaN(n))return 3;if(Ka(n),i=Xo(It,1),n===i)return 5}return 9};var ka=new ArrayBuffer(9),dt=new DataView(ka,1),It=new Uint8Array(ka,0);function Fa(e){if(e===1/0)dt.setUint16(0,31744,!1);else if(e===-1/0)dt.setUint16(0,64512,!1);else if(Number.isNaN(e))dt.setUint16(0,32256,!1);else{dt.setFloat32(0,e);let t=dt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)dt.setUint16(0,31744,!1);else if(r===0)dt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?dt.setUint16(0,0):i<-14?dt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):dt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Jo(e,t){if(e.length-t<2)throw new Error(`${de} 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,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function Ka(e){dt.setFloat32(0,e,!1)}function Xo(e,t){if(e.length-t<4)throw new Error(`${de} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function fp(e){dt.setFloat64(0,e,!1)}function Va(e,t){if(e.length-t<8)throw new Error(`${de} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Ho.compareTokens=xr.compareTokens;function we(e,t,r){throw new Error(`${de} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function bi(e){return()=>{throw new Error(`${de} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=we;oe[24]=wd;oe[25]=Td;oe[26]=Ad;oe[27]=Od;oe[28]=we;oe[29]=we;oe[30]=we;oe[31]=we;for(let e=32;e<=55;e++)oe[e]=we;oe[56]=Ed;oe[57]=Id;oe[58]=Sd;oe[59]=xd;oe[60]=we;oe[61]=we;oe[62]=we;oe[63]=we;for(let e=64;e<=87;e++)oe[e]=Rd;oe[88]=Pd;oe[89]=$d;oe[90]=Nd;oe[91]=Cd;oe[92]=we;oe[93]=we;oe[94]=we;oe[95]=bi("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=Bd;oe[120]=Ld;oe[121]=jd;oe[122]=kd;oe[123]=Fd;oe[124]=we;oe[125]=we;oe[126]=we;oe[127]=bi("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=Vd;oe[152]=qd;oe[153]=zd;oe[154]=Gd;oe[155]=Wd;oe[156]=we;oe[157]=we;oe[158]=we;oe[159]=Hd;for(let e=160;e<=183;e++)oe[e]=Jd;oe[184]=Xd;oe[185]=Yd;oe[186]=Qd;oe[187]=Zd;oe[188]=we;oe[189]=we;oe[190]=we;oe[191]=ep;for(let e=192;e<=215;e++)oe[e]=tp;oe[216]=rp;oe[217]=np;oe[218]=ip;oe[219]=op;oe[220]=we;oe[221]=we;oe[222]=we;oe[223]=we;for(let e=224;e<=243;e++)oe[e]=bi("simple values are not supported");oe[244]=we;oe[245]=we;oe[246]=we;oe[247]=sp;oe[248]=bi("simple values are not supported");oe[249]=up;oe[250]=cp;oe[251]=lp;oe[252]=we;oe[253]=we;oe[254]=we;oe[255]=ap;var Bt=[];for(let e=0;e<24;e++)Bt[e]=new Z(I.uint,e,1);for(let e=-1;e>=-24;e--)Bt[31-e]=new Z(I.negint,e,1);Bt[64]=new Z(I.bytes,new Uint8Array(0),1);Bt[96]=new Z(I.string,"",1);Bt[128]=new Z(I.array,0,1);Bt[160]=new Z(I.map,0,1);Bt[244]=new Z(I.false,!1,1);Bt[245]=new Z(I.true,!0,1);Bt[246]=new Z(I.null,null,1);function dp(e){switch(e.type){case I.false:return Wt([244]);case I.true:return Wt([245]);case I.null:return Wt([246]);case I.bytes:return e.value.length?void 0:Wt([64]);case I.string:return e.value===""?Wt([96]):void 0;case I.array:return e.value===0?Wt([128]):void 0;case I.map:return e.value===0?Wt([160]):void 0;case I.uint:return e.value<24?Wt([Number(e.value)]):void 0;case I.negint:if(e.value>=-24)return Wt([31-Number(e.value)])}}var pp=Object.freeze({float64:!0,mapSorter:bp,quickEncodeToken:dp});function Yo(){let e=[];return e[I.uint.major]=xr,e[I.negint.major]=Vo,e[I.bytes.major]=gi,e[I.string.major]=Kd,e[I.array.major]=qo,e[I.map.major]=zo,e[I.tag.major]=Go,e[I.float.major]=Ho,e}var hp=Yo(),yp=new Ua,Oa=class qa{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(`${cr} object contains circular references`);return new qa(r,t)}},or={null:new Z(I.null,null),undefined:new Z(I.undefined,void 0),true:new Z(I.true,!0),false:new Z(I.false,!1),emptyArray:new Z(I.array,0),emptyMap:new Z(I.map,0)},ur={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Z(I.float,e):e>=0?new Z(I.uint,e):new Z(I.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Z(I.uint,e):new Z(I.negint,e)},Uint8Array(e,t,r,n){return new Z(I.bytes,e)},string(e,t,r,n){return new Z(I.string,e)},boolean(e,t,r,n){return e?or.true:or.false},null(e,t,r,n){return or.null},undefined(e,t,r,n){return or.undefined},ArrayBuffer(e,t,r,n){return new Z(I.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Z(I.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[or.emptyArray,new Z(I.break)]:or.emptyArray;n=Oa.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=ci(o,r,n);return r.addBreakTokens?[new Z(I.array,e.length),i,new Z(I.break)]:[new Z(I.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length,a;if(o){a=new Array(o),n=Oa.createCheck(n,e);let l=!i&&r.ignoreUndefinedProperties,c=0;for(let d of s){let g=i?e.get(d):e[d];l&&g===void 0||(a[c++]=[ci(d,r,n),ci(g,r,n)])}c<o&&(a.length=c)}return a?.length?(gp(a,r),r.addBreakTokens?[new Z(I.map,a.length),a,new Z(I.break)]:[new Z(I.map,a.length),a]):r.addBreakTokens===!0?[or.emptyMap,new Z(I.break)]:or.emptyMap}};ur.Map=ur.Object;ur.Buffer=ur.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))ur[`${e}Array`]=ur.DataView;function ci(e,t={},r){let n=fd(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||ur[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=ur[n];if(!s)throw new Error(`${cr} unsupported type: ${n}`);return s(e,n,t,r)}function gp(e,t){t.mapSorter&&e.sort(t.mapSorter)}function bp(e,t){if(e[0]instanceof Z&&t[0]instanceof Z){let r=e[0],n=t[0];return r._keyBytes||(r._keyBytes=Ea(r.value)),n._keyBytes||(n._keyBytes=Ea(n.value)),Na(r._keyBytes,n._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}function Ea(e){return Qo(e,hp,pp)}function za(e,t,r,n){if(Array.isArray(t))for(let i of t)za(e,i,r,n);else r[t.type.major](e,t,n)}var mE=I.uint.majorEncoded,vE=I.negint.majorEncoded,_E=I.bytes.majorEncoded,wE=I.string.majorEncoded,TE=I.array.majorEncoded,AE=I.float.majorEncoded|Da,OE=I.float.majorEncoded|Ba,EE=I.float.majorEncoded|La,IE=I.float.majorEncoded|ja,SE=BigInt(-1),xE=BigInt(1);function Qo(e,t,r,n){let i=n instanceof Uint8Array,s=i?new _d(n):yp,o=ci(e,r);if(!Array.isArray(o)&&r.quickEncodeToken){let a=r.quickEncodeToken(o);if(a)return i?(s.push(a),s.toBytes()):a;let l=t[o.type.major];if(l.encodedSize){let c=l.encodedSize(o,r);if(i||(s=new Ua(c)),l(s,o,r),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${o} was wrong`);return i?s.toBytes():xn(s.chunks[0])}}return s.reset(),za(s,o,t,r),s.toBytes(!0)}var mp={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},vp=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Bt[e];if(t===void 0){let r=oe[e];if(!r)throw new Error(`${de} 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}},En=Symbol.for("DONE"),mi=Symbol.for("BREAK");function _p(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=In(t,r);if(s===mi){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed array`)}if(s===En)throw new Error(`${de} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function wp(e,t,r){let n=r.useMaps===!0,i=r.rejectDuplicateMapKeys===!0,s=n?void 0:{},o=n?new Map:void 0;for(let a=0;a<e.value;a++){let l=In(t,r);if(l===mi){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed map`)}if(l===En)throw new Error(`${de} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(!n&&typeof l!="string")throw new Error(`${de} non-string keys not supported (got ${typeof l})`);if(i&&(n&&o.has(l)||!n&&Object.hasOwn(s,l)))throw new Error(`${de} found repeat map key "${l}"`);let c=In(t,r);if(c===En)throw new Error(`${de} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?o.set(l,c):s[l]=c}return n?o:s}function In(e,t){if(e.done())return En;let r=e.next();if(I.equals(r.type,I.break))return mi;if(r.type.terminal)return r.value;if(I.equals(r.type,I.array))return _p(r,e,t);if(I.equals(r.type,I.map))return wp(r,e,t);if(I.equals(r.type,I.tag)){if(t.tags&&typeof t.tags[r.value]=="function"){let n=In(e,t);return t.tags[r.value](n)}throw new Error(`${de} tag not supported (${r.value})`)}throw new Error("unsupported")}function Tp(e,t){if(!(e instanceof Uint8Array))throw new Error(`${de} data to decode must be a Uint8Array`);t=Object.assign({},mp,t);let r=xn(e),n=t.tokenizer||new vp(r,t),i=In(n,t);if(i===En)throw new Error(`${de} did not find any content to decode`);if(i===mi)throw new Error(`${de} got unexpected break`);return[i,e.subarray(n.pos())]}function Zo(e,t){let[r,n]=Tp(e,t);if(n.length>0)throw new Error(`${de} too many terminals, data makes no sense`);return r}var Ap={};ir(Ap,{base36:()=>li,base36upper:()=>Dp});var RE=new Uint8Array(0);function Op(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}function es(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")}function Ep(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 i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(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 K=0,H=0,F=0,j=x.length;F!==j&&x[F]===0;)F++,K++;for(var V=(j-F)*d+1>>>0,G=new Uint8Array(V);F!==j;){for(var k=x[F],Q=0,z=V-1;(k!==0||Q<H)&&z!==-1;z--,Q++)k+=256*G[z]>>>0,G[z]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");H=Q,F++}for(var ce=V-H;ce!==V&&G[ce]===0;)ce++;for(var U=l.repeat(K);ce<V;++ce)U+=e.charAt(G[ce]);return U}function C(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var K=0;if(x[K]!==" "){for(var H=0,F=0;x[K]===l;)H++,K++;for(var j=(x.length-K)*c+1>>>0,V=new Uint8Array(j);x[K];){var G=r[x.charCodeAt(K)];if(G===255)return;for(var k=0,Q=j-1;(G!==0||k<F)&&Q!==-1;Q--,k++)G+=a*V[Q]>>>0,V[Q]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");F=k,K++}if(x[K]!==" "){for(var z=j-F;z!==j&&V[z]===0;)z++;for(var ce=new Uint8Array(H+(j-z)),U=H;z!==j;)ce[U++]=V[z++];return ce}}}function S(x){var K=C(x);if(K)return K;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:S}}var Ip=Ep,Sp=Ip,xp=Sp,Rp=class{name;prefix;baseEncode;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")}},Pp=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,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 Ga(this,e)}},$p=class{decoders;constructor(e){this.decoders=e}or(e){return Ga(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Ga(e,t){return new $p({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Np=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Rp(e,t,r),this.decoder=new Pp(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function Wa({name:e,prefix:t,encode:r,decode:n}){return new Np(e,t,r,n)}function vi({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=xp(r,e);return Wa({prefix:t,name:e,encode:n,decode:s=>es(i(s))})}function Cp(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),o=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,o+=r,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=r||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s}function Up(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s}function Mp(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function nt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=Mp(n);return Wa({prefix:t,name:e,encode(s){return Up(s,n,r)},decode(s){return Cp(s,i,r,e)}})}var li=vi({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Dp=vi({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Bp=Ha,Ia=128,Lp=127,jp=~Lp,kp=Math.pow(2,31);function Ha(e,t,r){t=t||[],r=r||0;for(var n=r;e>=kp;)t[r++]=e&255|Ia,e/=128;for(;e&jp;)t[r++]=e&255|Ia,e>>>=7;return t[r]=e|0,Ha.bytes=r-n+1,t}var Fp=Bo,Kp=128,Sa=127;function Bo(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Bo.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Sa)<<i:(o&Sa)*Math.pow(2,i),i+=7}while(o>=Kp);return Bo.bytes=s-n,r}var Vp=Math.pow(2,7),qp=Math.pow(2,14),zp=Math.pow(2,21),Gp=Math.pow(2,28),Wp=Math.pow(2,35),Hp=Math.pow(2,42),Jp=Math.pow(2,49),Xp=Math.pow(2,56),Yp=Math.pow(2,63),Qp=function(e){return e<Vp?1:e<qp?2:e<zp?3:e<Gp?4:e<Wp?5:e<Hp?6:e<Jp?7:e<Xp?8:e<Yp?9:10},Zp={encode:Bp,decode:Fp,encodingLength:Qp},eh=Zp,pi=eh;function Lo(e,t=0){return[pi.decode(e,t),pi.decode.bytes]}function hi(e,t,r=0){return pi.encode(e,t,r),t}function yi(e){return pi.encodingLength(e)}function th(e,t){let r=t.byteLength,n=yi(e),i=n+yi(r),s=new Uint8Array(i+r);return hi(e,s,0),hi(r,s,n),s.set(t,i),new ts(e,r,t,s)}function Ja(e){let t=es(e),[r,n]=Lo(t),[i,s]=Lo(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new ts(r,i,o,t)}function rh(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Op(e.bytes,r.bytes)}}var ts=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},nh={};ir(nh,{base32:()=>On,base32hex:()=>ah,base32hexpad:()=>ch,base32hexpadupper:()=>lh,base32hexupper:()=>uh,base32pad:()=>oh,base32padupper:()=>sh,base32upper:()=>ih,base32z:()=>fh});var On=nt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ih=nt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),oh=nt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sh=nt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ah=nt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),uh=nt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ch=nt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),lh=nt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),fh=nt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),dh={};ir(dh,{base58btc:()=>Ht,base58flickr:()=>ph});var Ht=vi({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ph=vi({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});function xa(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return yh(r,jo(e),t??Ht.encoder);default:return gh(r,jo(e),t??On.encoder)}}var Ra=new WeakMap;function jo(e){let t=Ra.get(e);if(t==null){let r=new Map;return Ra.set(e,r),r}return t}var Qr=class Je{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==An)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==bh)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=th(t,r);return Je.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Je.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&rh(t.multihash,n.multihash)}toString(t){return xa(this,t)}toJSON(){return{"/":xa(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof Je)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Je(n,i,s,o??Pa(n,i,s.bytes))}else if(r[mh]===!0){let{version:n,multihash:i,code:s}=r,o=Ja(i);return Je.create(n,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==An)throw new Error(`Version 0 CID must use dag-pb (code: ${An}) block encoding`);return new Je(t,r,n,n.bytes)}case 1:{let i=Pa(t,r,n.bytes);return new Je(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Je.create(0,An,t)}static createV1(t,r){return Je.create(1,t,r)}static decode(t){let[r,n]=Je.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Je.inspectBytes(t),n=r.size-r.multihashSize,i=es(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new ts(r.multihashCode,r.digestSize,s,i);return[r.version===0?Je.createV0(o):Je.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,C]=Lo(t.subarray(r));return r+=C,g},i=n(),s=An;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),l=n(),c=r+l,d=c-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,r){let[n,i]=hh(t,r),s=Je.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return jo(s).set(n,t),s}};function hh(e,t){switch(e[0]){case"Q":{let r=t??Ht;return[Ht.prefix,r.decode(`${Ht.prefix}${e}`)]}case Ht.prefix:{let r=t??Ht;return[Ht.prefix,r.decode(e)]}case On.prefix:{let r=t??On;return[On.prefix,r.decode(e)]}case li.prefix:{let r=t??li;return[li.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function yh(e,t,r){let{prefix:n}=r;if(n!==Ht.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i}function gh(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i}var An=112,bh=18;function Pa(e,t,r){let n=yi(e),i=n+yi(t),s=new Uint8Array(i+r.byteLength);return hi(e,s,0),hi(t,s,n),s.set(r,i),s}var mh=Symbol.for("@ipld/js-cid/CID");function vh(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Xa(e,t,r=""){let n=vh(e),i=e?.length,s=t!==void 0;if(!n||s&&i!==t){let o=r&&`"${r}" `,a=s?` of length ${t}`:"",l=n?`length=${i}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+a+", got "+l)}return e}function $a(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _h(e,t){Xa(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}function ko(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Do(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Dt(e,t){return e<<32-t|e>>>t}function wh(e,t={}){let r=(i,s)=>e(s).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}var Th=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function Ah(e,t,r){return e&t^~e&r}function Oh(e,t,r){return e&t^e&r^t&r}var Eh=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=Do(this.buffer)}update(e){$a(this),Xa(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){let o=Math.min(n-this.pos,i-s);if(o===n){let a=Do(e);for(;n<=i-s;s+=n)this.process(a,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){$a(this),_h(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,ko(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let d=s;d<n;d++)t[d]=0;r.setBigUint64(n-8,BigInt(this.length*8),i),this.process(r,0);let o=Do(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let l=a/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)o.setUint32(4*d,c[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=o,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},sr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);var PE=BigInt(2**32-1);var Ih=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ar=new Uint32Array(64),Sh=class extends Eh{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)ar[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=ar[d-15],C=ar[d-2],S=Dt(g,7)^Dt(g,18)^g>>>3,x=Dt(C,17)^Dt(C,19)^C>>>10;ar[d]=x+ar[d-7]+S+ar[d-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:l,H:c}=this;for(let d=0;d<64;d++){let g=Dt(o,6)^Dt(o,11)^Dt(o,25),C=c+g+Ah(o,a,l)+Ih[d]+ar[d]|0,x=(Dt(r,2)^Dt(r,13)^Dt(r,22))+Oh(r,n,i)|0;c=l,l=a,a=o,o=s+C|0,s=i,i=n,n=r,r=C+x|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,n,i,s,o,a,l,c)}roundClean(){ko(ar)}destroy(){this.set(0,0,0,0,0,0,0,0),ko(this.buffer)}},xh=class extends Sh{A=sr[0]|0;B=sr[1]|0;C=sr[2]|0;D=sr[3]|0;E=sr[4]|0;F=sr[5]|0;G=sr[6]|0;H=sr[7]|0;constructor(){super(32)}};var Ya=wh(()=>new xh,Th(1));var $E=new Uint8Array(0);function Qa(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}function _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")}function Rh(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 i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(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 K=0,H=0,F=0,j=x.length;F!==j&&x[F]===0;)F++,K++;for(var V=(j-F)*d+1>>>0,G=new Uint8Array(V);F!==j;){for(var k=x[F],Q=0,z=V-1;(k!==0||Q<H)&&z!==-1;z--,Q++)k+=256*G[z]>>>0,G[z]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");H=Q,F++}for(var ce=V-H;ce!==V&&G[ce]===0;)ce++;for(var U=l.repeat(K);ce<V;++ce)U+=e.charAt(G[ce]);return U}function C(x){if(typeof x!="string")throw new TypeError("Expected String");if(x.length===0)return new Uint8Array;var K=0;if(x[K]!==" "){for(var H=0,F=0;x[K]===l;)H++,K++;for(var j=(x.length-K)*c+1>>>0,V=new Uint8Array(j);x[K];){var G=r[x.charCodeAt(K)];if(G===255)return;for(var k=0,Q=j-1;(G!==0||k<F)&&Q!==-1;Q--,k++)G+=a*V[Q]>>>0,V[Q]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");F=k,K++}if(x[K]!==" "){for(var z=j-F;z!==j&&V[z]===0;)z++;for(var ce=new Uint8Array(H+(j-z)),U=H;z!==j;)ce[U++]=V[z++];return ce}}}function S(x){var K=C(x);if(K)return K;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:C,decode:S}}var Ph=Rh,$h=Ph,Nh=$h,Ch=class{name;prefix;baseEncode;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")}},Uh=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,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 Za(this,e)}},Mh=class{decoders;constructor(e){this.decoders=e}or(e){return Za(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function Za(e,t){return new Mh({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Dh=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new Ch(e,t,r),this.decoder=new Uh(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function eu({name:e,prefix:t,encode:r,decode:n}){return new Dh(e,t,r,n)}function Nn({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=Nh(r,e);return eu({prefix:t,name:e,encode:n,decode:s=>_i(i(s))})}function Bh(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),o=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,o+=r,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=r||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s}function Lh(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s}function jh(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function Lt({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=jh(n);return eu({prefix:t,name:e,encode(s){return Lh(s,n,r)},decode(s){return Bh(s,i,r,e)}})}var wi=Nn({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),NE=Nn({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var kh={};ir(kh,{base64:()=>Ti,base64pad:()=>Fh,base64url:()=>Kh,base64urlpad:()=>Vh});var Ti=nt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Fh=nt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Kh=nt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Vh=nt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var qh={0:"Invalid value for configuration 'enforceActions', expected 'never', 'always' or 'observed'",1:function(t,r){return"Cannot apply '"+t+"' to '"+r.toString()+"': Field not found."},5:"'keys()' can only be used on observable objects, arrays, sets and maps",6:"'values()' can only be used on observable objects, arrays, sets and maps",7:"'entries()' can only be used on observable objects, arrays and maps",8:"'set()' can only be used on observable objects, arrays and maps",9:"'remove()' can only be used on observable objects, arrays and maps",10:"'has()' can only be used on observable objects, arrays and maps",11:"'get()' can only be used on observable objects, arrays and maps",12:"Invalid annotation",13:"Dynamic observable objects cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",14:"Intercept handlers should return nothing or a change object",15:"Observable arrays cannot be frozen. If you're passing observables to 3rd party component/function that calls Object.freeze, pass copy instead: toJS(observable)",16:"Modification exception: the internal structure of an observable array was changed.",17:function(t,r){return"[mobx.array] Index out of bounds, "+t+" is larger than "+r},18:"mobx.map requires Map polyfill for the current browser. Check babel-polyfill or core-js/es6/map.js",19:function(t){return"Cannot initialize from classes that inherit from Map: "+t.constructor.name},20:function(t){return"Cannot initialize map from "+t},21:function(t){return"Cannot convert to map from '"+t+"'"},22:"mobx.set requires Set polyfill for the current browser. Check babel-polyfill or core-js/es6/set.js",23:"It is not possible to get index atoms from arrays",24:function(t){return"Cannot obtain administration from "+t},25:function(t,r){return"the entry '"+t+"' does not exist in the observable map '"+r+"'"},26:"please specify a property",27:function(t,r){return"no observable property '"+t.toString()+"' found on the observable object '"+r+"'"},28:function(t){return"Cannot obtain atom from "+t},29:"Expecting some object",30:"invalid action stack. did you forget to finish an action?",31:"missing option for computed: get",32:function(t,r){return"Cycle detected in computation "+t+": "+r},33:function(t){return"The setter of computed value '"+t+"' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"},34:function(t){return"[ComputedValue '"+t+"'] It is not possible to assign a new value to a computed value."},35:"There are multiple, different versions of MobX active. Make sure MobX is loaded only once or use `configure({ isolateGlobalState: true })`",36:"isolateGlobalState should be called before MobX is running any reactions",37:function(t){return"[mobx] `observableArray."+t+"()` mutates the array in-place, which is not allowed inside a derivation. Use `array.slice()."+t+"()` instead"},38:"'ownKeys()' can only be used on observable objects",39:"'defineProperty()' can only be used on observable objects"},zh=qh;function ae(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];var i=typeof e=="string"?e:zh[e];throw typeof i=="function"&&(i=i.apply(null,r)),new Error("[MobX] "+i)}var Gh={};function ji(){return typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:Gh}var vu=Object.assign,Pi=Object.getOwnPropertyDescriptor,kt=Object.defineProperty,Bn=Object.prototype,$i=[];Object.freeze($i);var ys={};Object.freeze(ys);var Wh=typeof Proxy<"u",Hh=Object.toString();function _u(){Wh||ae("`Proxy` objects are not available in the current environment. Please configure MobX to enable a fallback implementation.`")}function Cn(e){J.verifyProxies&&ae("MobX is currently configured to be able to run in ES5 mode, but in ES5 MobX won't be able to "+e)}function Tt(){return++J.mobxGuid}function gs(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var en=function(){};function Me(e){return typeof e=="function"}function Pr(e){var t=typeof e;switch(t){case"string":case"symbol":case"number":return!0}return!1}function ki(e){return e!==null&&typeof e=="object"}function $t(e){if(!ki(e))return!1;var t=Object.getPrototypeOf(e);if(t==null)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r.toString()===Hh}function wu(e){var t=e?.constructor;return t?t.name==="GeneratorFunction"||t.displayName==="GeneratorFunction":!1}function Fi(e,t,r){kt(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Tu(e,t,r){kt(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function pr(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(n){return ki(n)&&n[r]===!0}}function on(e){return e!=null&&Object.prototype.toString.call(e)==="[object Map]"}function Jh(e){var t=Object.getPrototypeOf(e),r=Object.getPrototypeOf(t),n=Object.getPrototypeOf(r);return n===null}function Jt(e){return e!=null&&Object.prototype.toString.call(e)==="[object Set]"}var Au=typeof Object.getOwnPropertySymbols<"u";function Xh(e){var t=Object.keys(e);if(!Au)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter(function(n){return Bn.propertyIsEnumerable.call(e,n)})):t}var Ki=typeof Reflect<"u"&&Reflect.ownKeys?Reflect.ownKeys:Au?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function is(e){return typeof e=="string"?e:typeof e=="symbol"?e.toString():new String(e).toString()}function Ou(e){return e===null?null:typeof e=="object"?""+e:e}function mt(e,t){return Bn.hasOwnProperty.call(e,t)}var Yh=Object.getOwnPropertyDescriptors||function(t){var r={};return Ki(t).forEach(function(n){r[n]=Pi(t,n)}),r};function it(e,t){return!!(e&t)}function ot(e,t,r){return r?e|=t:e&=~t,e}function tu(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ru(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Zh(n.key),n)}}function sn(e,t,r){return t&&ru(e.prototype,t),r&&ru(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function tn(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=ey(e))||t&&e&&typeof e.length=="number"){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qt(){return Qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qt.apply(null,arguments)}function Eu(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,os(e,t)}function os(e,t){return os=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},os(e,t)}function Qh(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Zh(e){var t=Qh(e,"string");return typeof t=="symbol"?t:t+""}function ey(e,t){if(e){if(typeof e=="string")return tu(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?tu(e,t):void 0}}var et=Symbol("mobx-stored-annotations");function Ft(e){function t(r,n){if(jn(n))return e.decorate_20223_(r,n);Ln(r,n,e)}return Object.assign(t,e)}function Ln(e,t,r){if(mt(e,et)||Fi(e,et,Qt({},e[et])),Ni(r)&&!mt(e[et],t)){var n=e.constructor.name+".prototype."+t.toString();ae("'"+n+"' is decorated with 'override', but no such decorated member was found on prototype.")}ty(e,r,t),Ni(r)||(e[et][t]=r)}function ty(e,t,r){if(!Ni(t)&&mt(e[et],r)){var n=e.constructor.name+".prototype."+r.toString(),i=e[et][r].annotationType_,s=t.annotationType_;ae("Cannot apply '@"+s+"' to '"+n+"':"+(`
|
|
3
3
|
The field is already decorated with '@`+i+"'.")+`
|
|
4
4
|
Re-decorating fields is not allowed.
|
|
5
|
-
Use '@override' decorator for methods overridden by subclass.`)}}function
|
|
6
|
-
'`+s.annotationType_+"' can only be used on properties with a function value."))}function
|
|
7
|
-
'`+i+"' can only be used on properties with a function value."))}function
|
|
8
|
-
'`+i+"' can only be used on properties with a generator function value."))}function
|
|
9
|
-
'`+i+"' can only be used on getter(+setter) properties."))}function
|
|
10
|
-
'`+i+"' cannot be used on getter/setter properties"))}var Vd="true",zd=Ga();function Ga(e){return{annotationType_:Vd,options_:e,make_:qd,extend_:Gd,decorate_20223_:Wd}}function qd(e,t,r,n){var i,s;if(r.get)return xe.make_(e,t,r,n);if(r.set){var o=Ir(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(Bt(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(Ba(r.value)){var l,c=(l=this.options_)!=null&&l.autoBind?Yr.bound:Yr;return c.make_(e,t,r,n)}var d=(a=this.options_)!=null&&a.autoBind?An.bound:An;return d.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?Re.ref:Re;if(typeof r.value=="function"&&(s=this.options_)!=null&&s.autoBind){var x;r.value=r.value.bind((x=e.proxy_)!=null?x:e.target_)}return g.make_(e,t,r,n)}function Gd(e,t,r,n){var i,s;if(r.get)return xe.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:Ir(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?Re.ref:Re;return a.extend_(e,t,r,n)}function Wd(e,t){ae("'"+this.annotationType_+"' cannot be used as a decorator")}var Hd="observable",Jd="observable.ref",Xd="observable.shallow",Yd="observable.struct",Wa={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze(Wa);function oi(e){return e||Wa}var Do=Si(Hd),Qd=Si(Jd,{enhancer:Ei}),Zd=Si(Xd,{enhancer:Od}),ep=Si(Yd,{enhancer:Id}),Ha=Lt(Do);function si(e){return e.deep===!0?Or:e.deep===!1?Ei:rp(e.defaultDecorator)}function tp(e){var t;return e?(t=e.defaultDecorator)!=null?t:Ga(e):void 0}function rp(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:Or}function Ja(e,t,r){if(Sn(t))return Do.decorate_20223_(e,t);if(Ar(t)){En(e,t,Do);return}return Qr(e)?e:$t(e)?Re.object(e,t,r):Array.isArray(e)?Re.array(e,t):Zr(e)?Re.map(e,t):Gt(e)?Re.set(e,t):typeof e=="object"&&e!==null?e:Re.box(e,t)}Ma(Ja,Ha);var np={box:function(t,r){var n=oi(r);return new ir(t,si(n),n.name,!0,n.equals)},array:function(t,r){var n=oi(r);return(J.useProxies===!1||n.proxy===!1?nh:Wp)(t,si(n),n.name)},map:function(t,r){var n=oi(r);return new wu(t,si(n),n.name)},set:function(t,r){var n=oi(r);return new Tu(t,si(n),n.name)},object:function(t,r,n){return $r(function(){return Dp(J.useProxies===!1||n?.proxy===!1?on({},n):zp({},n),t,r)})},ref:Lt(Qd),shallow:Lt(Zd),deep:Ha,struct:Lt(ep)},Re=Ma(Ja,np),Xa="computed",ip="computed.struct",Bo=Ho(Xa),op=Ho(ip,{equals:Be.structural}),xe=function(t,r){if(Sn(r))return Bo.decorate_20223_(t,r);if(Ar(r))return En(t,r,Bo);if($t(t))return Lt(Ho(Xa,t));Me(t)||ae("First argument to `computed` should be an expression."),Me(r)&&ae("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=$t(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new vt(n)};Object.assign(xe,Bo);xe.struct=Lt(op);var ba,_a,yi=0,sp=1,ap=(ba=(_a=di(function(){},"name"))==null?void 0:_a.configurable)!=null?ba:!1,wa={value:"action",configurable:!0,writable:!1,enumerable:!1};function Ir(e,t,r,n){r===void 0&&(r=!1),Me(t)||ae("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ae("actions should have valid names, got: '"+e+"'");function i(){return Ya(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},ap&&(wa.value=e,Bt(i,"name",wa)),i}function Ya(e,t,r,n,i){var s=up(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{cp(s)}}function up(e,t,r,n){var i=qe()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):pi;ot({type:Xo,name:e,object:r,arguments:o})}var a=J.trackingDerivation,l=!t||!a;ht();var c=J.allowStateChanges;l&&(Rr(),c=Ri(!0));var d=Jo(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:s,actionId_:sp++,parentActionId_:yi};return yi=g.actionId_,g}function cp(e){yi!==e.actionId_&&ae(30),yi=e.parentActionId_,e.error_!==void 0&&(J.suppressReactionErrors=!0),Pi(e.prevAllowStateChanges_),Tn(e.prevAllowStateReads_),yt(),e.runAsAction_&&Ht(e.prevDerivation_),e.notifySpy_&&st({time:Date.now()-e.startTime_}),J.suppressReactionErrors=!1}function lp(e,t){var r=Ri(e);try{return t()}finally{Pi(r)}}function Ri(e){var t=J.allowStateChanges;return J.allowStateChanges=e,t}function Pi(e){J.allowStateChanges=e}var fp="create",ir=function(e){function t(n,i,s,o,a){var l;return s===void 0&&(s="ObservableValue@"+_t()),o===void 0&&(o=!0),a===void 0&&(a=Be.default),l=e.call(this,s)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=s,l.equals=a,l.value_=i(n,void 0,s),o&&qe()&&Er({type:fp,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}Fa(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==J.UNCHANGED){var o=qe();o&&ot({type:St,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&st()}},r.prepareNewValue_=function(i){if(Dt(this),dt(this)){var s=pt(this,{object:this,type:St,newValue:i});if(!s)return J.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?J.UNCHANGED:i},r.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),Rt(this)&&Pt(this,{type:St,object:this,newValue:i,oldValue:s})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return Cn(this,i)},r.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:St,newValue:this.value_,oldValue:void 0}),xn(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return ka(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(ar),dp=sr("ObservableValue",ir),vt=function(){function e(r){this.dependenciesState_=we.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=we.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new gi(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=mt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||ae(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+_t(),r.set&&(this.setter_=Ir(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Be.structural:Be.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){wp(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&ae(32,this.name_,this.derivation),J.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)Lo(this)&&(this.warnAboutUntrackedRead_(),ht(),this.value_=this.computeValue_(!1),yt());else if(ou(this),Lo(this)){var n=J.trackingContext;this.keepAlive_&&!n&&(J.trackingContext=this),this.trackAndCompute()&&_p(this),J.trackingContext=n}var i=this.value_;if(ci(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&ae(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else ae(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===we.NOT_TRACKING_,s=this.computeValue_(!0),o=i||ci(n)||ci(s)||!this.equals_(n,s);return o&&(this.value_=s,qe()&&Er({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:s})),o},t.computeValue_=function(n){this.isComputing=!0;var i=Ri(!1),s;if(n)s=Za(this,this.derivation,this.scope_);else if(J.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new gi(o)}return Pi(i),this.isComputing=!1,s},t.suspend_=function(){this.keepAlive_||(jo(this),this.value_=void 0,this.isTracing_!==mt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var s=this,o=!0,a=void 0;return wt(function(){var l=s.get();if(!o||i){var c=Rr();n({observableKind:"computed",debugObjectName:s.name_,type:St,object:s,newValue:l,oldValue:a}),Ht(c)}o=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==mt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:J.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return ka(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},en(e,[{key:"isComputing",get:function(){return nt(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=it(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return nt(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=it(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return nt(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=it(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return nt(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=it(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return nt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=it(this.flags_,e.diffValueMask_,n===1)}}])}();vt.isComputingMask_=1;vt.isRunningSetterMask_=2;vt.isBeingObservedMask_=4;vt.isPendingUnobservationMask_=8;vt.diffValueMask_=16;var Pn=sr("ComputedValue",vt),we;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(we||(we={}));var mt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(mt||(mt={}));var gi=function(t){this.cause=void 0,this.cause=t};function ci(e){return e instanceof gi}function Lo(e){switch(e.dependenciesState_){case we.UP_TO_DATE_:return!1;case we.NOT_TRACKING_:case we.STALE_:return!0;case we.POSSIBLY_STALE_:{for(var t=Jo(!0),r=Rr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(Pn(o)){if(J.disableErrorBoundaries)o.get();else try{o.get()}catch{return Ht(r),Tn(t),!0}if(e.dependenciesState_===we.STALE_)return Ht(r),Tn(t),!0}}return eu(e),Ht(r),Tn(t),!1}}}function Qa(){return J.trackingDerivation!==null}function Dt(e){var t=e.observers_.size>0;!J.allowStateChanges&&(t||J.enforceActions==="always")&&console.warn("[MobX] "+(J.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function pp(e){!J.allowStateReads&&J.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Za(e,t,r){var n=Jo(!0);eu(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++J.runId;var i=J.trackingDerivation;J.trackingDerivation=e,J.inBatch++;var s;if(J.disableErrorBoundaries===!0)s=t.call(r);else try{s=t.call(r)}catch(o){s=new gi(o)}return J.inBatch--,J.trackingDerivation=i,yp(e),hp(e),Tn(n),s}function hp(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:J.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function yp(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=we.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var a=r[o];a.diffValue===0&&(a.diffValue=1,i!==o&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,s=t.length;s--;){var l=t[s];l.diffValue===0&&nu(l,e),l.diffValue=0}for(;i--;){var c=r[i];c.diffValue===1&&(c.diffValue=0,bp(c,e))}n!==we.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function jo(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)nu(t[r],e);e.dependenciesState_=we.NOT_TRACKING_}function Se(e){var t=Rr();try{return e()}finally{Ht(t)}}function Rr(){var e=J.trackingDerivation;return J.trackingDerivation=null,e}function Ht(e){J.trackingDerivation=e}function Jo(e){var t=J.allowStateReads;return J.allowStateReads=e,t}function Tn(e){J.allowStateReads=e}function eu(e){if(e.dependenciesState_!==we.UP_TO_DATE_){e.dependenciesState_=we.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=we.UP_TO_DATE_}}var li=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},fi=!0,tu=!1,J=function(){var e=wi();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(fi=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new li().version&&(fi=!1),fi?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new li):(setTimeout(function(){tu||ae(35)},1),new li)}();function gp(){if((J.pendingReactions.length||J.inBatch||J.isRunningReactions)&&ae(36),tu=!0,fi){var e=wi();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),J=new li}}function ru(){return J}function mp(e){return e.observers_&&e.observers_.size>0}function vp(e){return e.observers_}function bp(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function nu(e,t){e.observers_.delete(t),e.observers_.size===0&&iu(e)}function iu(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,J.pendingUnobservations.push(e))}function ht(){J.inBatch++}function yt(){if(--J.inBatch===0){cu();for(var e=J.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof vt&&r.suspend_())}J.pendingUnobservations=[]}}function ou(e){pp(e);var t=J.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&J.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&J.inBatch>0&&iu(e),!1)}function su(e){e.lowestObserverState_!==we.STALE_&&(e.lowestObserverState_=we.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===we.UP_TO_DATE_&&(t.isTracing_!==mt.NONE&&au(t,e),t.onBecomeStale_()),t.dependenciesState_=we.STALE_}))}function _p(e){e.lowestObserverState_!==we.STALE_&&(e.lowestObserverState_=we.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===we.POSSIBLY_STALE_?(t.dependenciesState_=we.STALE_,t.isTracing_!==mt.NONE&&au(t,e)):t.dependenciesState_===we.UP_TO_DATE_&&(e.lowestObserverState_=we.UP_TO_DATE_)}))}function wp(e){e.lowestObserverState_===we.UP_TO_DATE_&&(e.lowestObserverState_=we.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===we.UP_TO_DATE_&&(t.dependenciesState_=we.POSSIBLY_STALE_,t.onBecomeStale_())}))}function au(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===mt.BREAK){var r=[];uu($n(e),r,1),new Function(`debugger;
|
|
5
|
+
Use '@override' decorator for methods overridden by subclass.`)}}function ry(e){return mt(e,et)||Fi(e,et,Qt({},e[et])),e[et]}function jn(e){return typeof e=="object"&&typeof e.kind=="string"}function Vi(e,t){t.includes(e.kind)||ae("The decorator applied to '"+String(e.name)+"' cannot be used on a "+e.kind+" element")}var ye=Symbol("mobx administration"),hr=function(){function e(r){r===void 0&&(r="Atom@"+Tt()),this.name_=void 0,this.flags_=0,this.observers_=new Set,this.lastAccessedBy_=0,this.lowestObserverState_=Te.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=r}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.reportObserved=function(){return Vu(this)},t.reportChanged=function(){gt(),qu(this),bt()},t.toString=function(){return this.name_},sn(e,[{key:"isBeingObserved",get:function(){return it(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=ot(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return it(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=ot(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return it(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=ot(this.flags_,e.diffValueMask_,n===1)}}])}();hr.isBeingObservedMask_=1;hr.isPendingUnobservationMask_=2;hr.diffValueMask_=4;var bs=pr("Atom",hr);function Iu(e,t,r){t===void 0&&(t=en),r===void 0&&(r=en);var n=new hr(e);return t!==en&&un(n,t),r!==en&&Dr(n,r),n}function ny(e,t){return e===t}function iy(e,t){return Es(e,t)}function oy(e,t){return Es(e,t,1)}function sy(e,t){return Object.is?Object.is(e,t):e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Be={identity:ny,structural:iy,default:sy,shallow:oy};function $r(e,t,r){return nn(e)?e:Array.isArray(e)?xe.array(e,{name:r}):$t(e)?xe.object(e,void 0,{name:r}):on(e)?xe.map(e,{name:r}):Jt(e)?xe.set(e,{name:r}):typeof e=="function"&&!dr(e)&&!Dn(e)?wu(e)?rn(e):Mn(r,e):e}function ay(e,t,r){if(e==null||Ur(e)||cn(e)||Kt(e)||St(e))return e;if(Array.isArray(e))return xe.array(e,{name:r,deep:!1});if($t(e))return xe.object(e,void 0,{name:r,deep:!1});if(on(e))return xe.map(e,{name:r,deep:!1});if(Jt(e))return xe.set(e,{name:r,deep:!1});ae("The shallow modifier / decorator can only used in combination with arrays, objects, maps and sets")}function qi(e){return e}function uy(e,t){return nn(e)&&ae("observable.struct should not be used with observable values"),Es(e,t)?t:e}var cy="override";function Ni(e){return e.annotationType_===cy}function kn(e,t){return{annotationType_:e,options_:t,make_:ly,extend_:fy,decorate_20223_:dy}}function ly(e,t,r,n){var i;if((i=this.options_)!=null&&i.bound)return this.extend_(e,t,r,!1)===null?0:1;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if(dr(r.value))return 1;var s=Su(e,this,t,r,!1);return kt(n,t,s),2}function fy(e,t,r,n){var i=Su(e,this,t,r);return e.defineProperty_(t,i,n)}function dy(e,t){Vi(t,["method","field"]);var r=t.kind,n=t.name,i=t.addInitializer,s=this,o=function(c){var d,g,C,S;return Nr((d=(g=s.options_)==null?void 0:g.name)!=null?d:n.toString(),c,(C=(S=s.options_)==null?void 0:S.autoAction)!=null?C:!1)};if(r=="field")return function(l){var c,d=l;return dr(d)||(d=o(d)),(c=s.options_)!=null&&c.bound&&(d=d.bind(this),d.isMobxAction=!0),d};if(r=="method"){var a;return dr(e)||(e=o(e)),(a=this.options_)!=null&&a.bound&&i(function(){var l=this,c=l[n].bind(l);c.isMobxAction=!0,l[n]=c}),e}ae("Cannot apply '"+s.annotationType_+"' to '"+String(n)+"' (kind: "+r+"):"+(`
|
|
6
|
+
'`+s.annotationType_+"' can only be used on properties with a function value."))}function py(e,t,r,n){var i=t.annotationType_,s=n.value;Me(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
7
|
+
'`+i+"' can only be used on properties with a function value."))}function Su(e,t,r,n,i){var s,o,a,l,c,d,g;i===void 0&&(i=J.safeDescriptors),py(e,t,r,n);var C=n.value;if((s=t.options_)!=null&&s.bound){var S;C=C.bind((S=e.proxy_)!=null?S:e.target_)}return{value:Nr((o=(a=t.options_)==null?void 0:a.name)!=null?o:r.toString(),C,(l=(c=t.options_)==null?void 0:c.autoAction)!=null?l:!1,(d=t.options_)!=null&&d.bound?(g=e.proxy_)!=null?g:e.target_:void 0),configurable:i?e.isPlainObject_:!0,enumerable:!1,writable:!i}}function xu(e,t){return{annotationType_:e,options_:t,make_:hy,extend_:yy,decorate_20223_:gy}}function hy(e,t,r,n){var i;if(n===e.target_)return this.extend_(e,t,r,!1)===null?0:2;if((i=this.options_)!=null&&i.bound&&(!mt(e.target_,t)||!Dn(e.target_[t]))&&this.extend_(e,t,r,!1)===null)return 0;if(Dn(r.value))return 1;var s=Ru(e,this,t,r,!1,!1);return kt(n,t,s),2}function yy(e,t,r,n){var i,s=Ru(e,this,t,r,(i=this.options_)==null?void 0:i.bound);return e.defineProperty_(t,s,n)}function gy(e,t){var r;Vi(t,["method"]);var n=t.name,i=t.addInitializer;return Dn(e)||(e=rn(e)),(r=this.options_)!=null&&r.bound&&i(function(){var s=this,o=s[n].bind(s);o.isMobXFlow=!0,s[n]=o}),e}function by(e,t,r,n){var i=t.annotationType_,s=n.value;Me(s)||ae("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
8
|
+
'`+i+"' can only be used on properties with a generator function value."))}function Ru(e,t,r,n,i,s){s===void 0&&(s=J.safeDescriptors),by(e,t,r,n);var o=n.value;if(Dn(o)||(o=rn(o)),i){var a;o=o.bind((a=e.proxy_)!=null?a:e.target_),o.isMobXFlow=!0}return{value:o,configurable:s?e.isPlainObject_:!0,enumerable:!1,writable:!s}}function ms(e,t){return{annotationType_:e,options_:t,make_:my,extend_:vy,decorate_20223_:_y}}function my(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function vy(e,t,r,n){return wy(e,this,t,r),e.defineComputedProperty_(t,Qt({},this.options_,{get:r.get,set:r.set}),n)}function _y(e,t){Vi(t,["getter"]);var r=this,n=t.name,i=t.addInitializer;return i(function(){var s=ln(this)[ye],o=Qt({},r.options_,{get:e,context:this});o.name||(o.name=s.name_+"."+n.toString()),s.values_.set(n,new _t(o))}),function(){return this[ye].getObservablePropValue_(n)}}function wy(e,t,r,n){var i=t.annotationType_,s=n.get;s||ae("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
9
|
+
'`+i+"' can only be used on getter(+setter) properties."))}function zi(e,t){return{annotationType_:e,options_:t,make_:Ty,extend_:Ay,decorate_20223_:Oy}}function Ty(e,t,r){return this.extend_(e,t,r,!1)===null?0:1}function Ay(e,t,r,n){var i,s;return Ey(e,this,t,r),e.defineObservableProperty_(t,r.value,(i=(s=this.options_)==null?void 0:s.enhancer)!=null?i:$r,n)}function Oy(e,t){if(t.kind==="field")throw ae("Please use `@observable accessor "+String(t.name)+"` instead of `@observable "+String(t.name)+"`");Vi(t,["accessor"]);var r=this,n=t.kind,i=t.name,s=new WeakSet;function o(a,l){var c,d,g=ln(a)[ye],C=new fr(l,(c=(d=r.options_)==null?void 0:d.enhancer)!=null?c:$r,g.name_+"."+i.toString(),!1);g.values_.set(i,C),s.add(a)}if(n=="accessor")return{get:function(){return s.has(this)||o(this,e.get.call(this)),this[ye].getObservablePropValue_(i)},set:function(l){return s.has(this)||o(this,l),this[ye].setObservablePropValue_(i,l)},init:function(l){return s.has(this)||o(this,l),l}}}function Ey(e,t,r,n){var i=t.annotationType_;"value"in n||ae("Cannot apply '"+i+"' to '"+e.name_+"."+r.toString()+"':"+(`
|
|
10
|
+
'`+i+"' cannot be used on getter/setter properties"))}var Iy="true",Sy=Pu();function Pu(e){return{annotationType_:Iy,options_:e,make_:xy,extend_:Ry,decorate_20223_:Py}}function xy(e,t,r,n){var i,s;if(r.get)return Ce.make_(e,t,r,n);if(r.set){var o=Nr(t.toString(),r.set);return n===e.target_?e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:o})===null?0:2:(kt(n,t,{configurable:!0,set:o}),2)}if(n!==e.target_&&typeof r.value=="function"){var a;if(wu(r.value)){var l,c=(l=this.options_)!=null&&l.autoBind?rn.bound:rn;return c.make_(e,t,r,n)}var d=(a=this.options_)!=null&&a.autoBind?Mn.bound:Mn;return d.make_(e,t,r,n)}var g=((i=this.options_)==null?void 0:i.deep)===!1?xe.ref:xe;if(typeof r.value=="function"&&(s=this.options_)!=null&&s.autoBind){var C;r.value=r.value.bind((C=e.proxy_)!=null?C:e.target_)}return g.make_(e,t,r,n)}function Ry(e,t,r,n){var i,s;if(r.get)return Ce.extend_(e,t,r,n);if(r.set)return e.defineProperty_(t,{configurable:J.safeDescriptors?e.isPlainObject_:!0,set:Nr(t.toString(),r.set)},n);if(typeof r.value=="function"&&(i=this.options_)!=null&&i.autoBind){var o;r.value=r.value.bind((o=e.proxy_)!=null?o:e.target_)}var a=((s=this.options_)==null?void 0:s.deep)===!1?xe.ref:xe;return a.extend_(e,t,r,n)}function Py(e,t){ae("'"+this.annotationType_+"' cannot be used as a decorator")}var $y="observable",Ny="observable.ref",Cy="observable.shallow",Uy="observable.struct",$u={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};Object.freeze($u);function Ai(e){return e||$u}var ss=zi($y),My=zi(Ny,{enhancer:qi}),Dy=zi(Cy,{enhancer:ay}),By=zi(Uy,{enhancer:uy}),Nu=Ft(ss);function Oi(e){return e.deep===!0?$r:e.deep===!1?qi:jy(e.defaultDecorator)}function Ly(e){var t;return e?(t=e.defaultDecorator)!=null?t:Pu(e):void 0}function jy(e){var t,r;return e&&(t=(r=e.options_)==null?void 0:r.enhancer)!=null?t:$r}function Cu(e,t,r){if(jn(t))return ss.decorate_20223_(e,t);if(Pr(t)){Ln(e,t,ss);return}return nn(e)?e:$t(e)?xe.object(e,t,r):Array.isArray(e)?xe.array(e,t):on(e)?xe.map(e,t):Jt(e)?xe.set(e,t):typeof e=="object"&&e!==null?e:xe.box(e,t)}vu(Cu,Nu);var ky={box:function(t,r){var n=Ai(r);return new fr(t,Oi(n),n.name,!0,n.equals)},array:function(t,r){var n=Ai(r);return(J.useProxies===!1||n.proxy===!1?kg:Pg)(t,Oi(n),n.name)},map:function(t,r){var n=Ai(r);return new oc(t,Oi(n),n.name)},set:function(t,r){var n=Ai(r);return new sc(t,Oi(n),n.name)},object:function(t,r,n){return Br(function(){return vg(J.useProxies===!1||n?.proxy===!1?ln({},n):Sg({},n),t,r)})},ref:Ft(My),shallow:Ft(Dy),deep:Nu,struct:Ft(By)},xe=vu(Cu,ky),Uu="computed",Fy="computed.struct",as=ms(Uu),Ky=ms(Fy,{equals:Be.structural}),Ce=function(t,r){if(jn(r))return as.decorate_20223_(t,r);if(Pr(r))return Ln(t,r,as);if($t(t))return Ft(ms(Uu,t));Me(t)||ae("First argument to `computed` should be an expression."),Me(r)&&ae("A setter as second argument is no longer supported, use `{ set: fn }` option instead");var n=$t(r)?r:{};return n.get=t,n.name||(n.name=t.name||""),new _t(n)};Object.assign(Ce,as);Ce.struct=Ft(Ky);var nu,iu,Ci=0,Vy=1,qy=(nu=(iu=Pi(function(){},"name"))==null?void 0:iu.configurable)!=null?nu:!1,ou={value:"action",configurable:!0,writable:!1,enumerable:!1};function Nr(e,t,r,n){r===void 0&&(r=!1),Me(t)||ae("`action` can only be invoked on functions"),(typeof e!="string"||!e)&&ae("actions should have valid names, got: '"+e+"'");function i(){return Mu(e,r,t,n||this,arguments)}return i.isMobxAction=!0,i.toString=function(){return t.toString()},qy&&(ou.value=e,kt(i,"name",ou)),i}function Mu(e,t,r,n,i){var s=zy(e,t,n,i);try{return r.apply(n,i)}catch(o){throw s.error_=o,o}finally{Gy(s)}}function zy(e,t,r,n){var i=Ge()&&!!e,s=0;if(i){s=Date.now();var o=n?Array.from(n):$i;st({type:_s,name:e,object:r,arguments:o})}var a=J.trackingDerivation,l=!t||!a;gt();var c=J.allowStateChanges;l&&(Mr(),c=Gi(!0));var d=vs(!0),g={runAsAction_:l,prevDerivation_:a,prevAllowStateChanges_:c,prevAllowStateReads_:d,notifySpy_:i,startTime_:s,actionId_:Vy++,parentActionId_:Ci};return Ci=g.actionId_,g}function Gy(e){Ci!==e.actionId_&&ae(30),Ci=e.parentActionId_,e.error_!==void 0&&(J.suppressReactionErrors=!0),Wi(e.prevAllowStateChanges_),Un(e.prevAllowStateReads_),bt(),e.runAsAction_&&Yt(e.prevDerivation_),e.notifySpy_&&at({time:Date.now()-e.startTime_}),J.suppressReactionErrors=!1}function Wy(e,t){var r=Gi(e);try{return t()}finally{Wi(r)}}function Gi(e){var t=J.allowStateChanges;return J.allowStateChanges=e,t}function Wi(e){J.allowStateChanges=e}var Hy="create",fr=function(e){function t(n,i,s,o,a){var l;return s===void 0&&(s="ObservableValue@"+Tt()),o===void 0&&(o=!0),a===void 0&&(a=Be.default),l=e.call(this,s)||this,l.enhancer=void 0,l.name_=void 0,l.equals=void 0,l.hasUnreportedChange_=!1,l.interceptors_=void 0,l.changeListeners_=void 0,l.value_=void 0,l.dehancer=void 0,l.enhancer=i,l.name_=s,l.equals=a,l.value_=i(n,void 0,s),o&&Ge()&&Cr({type:Hy,object:l,observableKind:"value",debugObjectName:l.name_,newValue:""+l.value_}),l}Eu(t,e);var r=t.prototype;return r.dehanceValue=function(i){return this.dehancer!==void 0?this.dehancer(i):i},r.set=function(i){var s=this.value_;if(i=this.prepareNewValue_(i),i!==J.UNCHANGED){var o=Ge();o&&st({type:xt,object:this,observableKind:"value",debugObjectName:this.name_,newValue:i,oldValue:s}),this.setNewValue_(i),o&&at()}},r.prepareNewValue_=function(i){if(jt(this),ht(this)){var s=yt(this,{object:this,type:xt,newValue:i});if(!s)return J.UNCHANGED;i=s.newValue}return i=this.enhancer(i,this.value_,this.name_),this.equals(this.value_,i)?J.UNCHANGED:i},r.setNewValue_=function(i){var s=this.value_;this.value_=i,this.reportChanged(),Rt(this)&&Pt(this,{type:xt,object:this,newValue:i,oldValue:s})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(i){return qn(this,i)},r.observe_=function(i,s){return s&&i({observableKind:"value",debugObjectName:this.name_,object:this,type:xt,newValue:this.value_,oldValue:void 0}),zn(this,i)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Ou(this.get())},r[Symbol.toPrimitive]=function(){return this.valueOf()},t}(hr),Jy=pr("ObservableValue",fr),_t=function(){function e(r){this.dependenciesState_=Te.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.observers_=new Set,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=Te.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new Ui(null),this.name_=void 0,this.triggeredBy_=void 0,this.flags_=0,this.derivation=void 0,this.setter_=void 0,this.isTracing_=vt.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,r.get||ae(31),this.derivation=r.get,this.name_=r.name||"ComputedValue@"+Tt(),r.set&&(this.setter_=Nr(this.name_+"-setter",r.set)),this.equals_=r.equals||(r.compareStructural||r.struct?Be.structural:Be.default),this.scope_=r.context,this.requiresReaction_=r.requiresReaction,this.keepAlive_=!!r.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){ig(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach(function(n){return n()})},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach(function(n){return n()})},t.get=function(){if(this.isComputing&&ae(32,this.name_,this.derivation),J.inBatch===0&&this.observers_.size===0&&!this.keepAlive_)us(this)&&(this.warnAboutUntrackedRead_(),gt(),this.value_=this.computeValue_(!1),bt());else if(Vu(this),us(this)){var n=J.trackingContext;this.keepAlive_&&!n&&(J.trackingContext=this),this.trackAndCompute()&&ng(this),J.trackingContext=n}var i=this.value_;if(Si(i))throw i.cause;return i},t.set=function(n){if(this.setter_){this.isRunningSetter&&ae(33,this.name_),this.isRunningSetter=!0;try{this.setter_.call(this.scope_,n)}finally{this.isRunningSetter=!1}}else ae(34,this.name_)},t.trackAndCompute=function(){var n=this.value_,i=this.dependenciesState_===Te.NOT_TRACKING_,s=this.computeValue_(!0),o=i||Si(n)||Si(s)||!this.equals_(n,s);return o&&(this.value_=s,Ge()&&Cr({observableKind:"computed",debugObjectName:this.name_,object:this.scope_,type:"update",oldValue:n,newValue:s})),o},t.computeValue_=function(n){this.isComputing=!0;var i=Gi(!1),s;if(n)s=Bu(this,this.derivation,this.scope_);else if(J.disableErrorBoundaries===!0)s=this.derivation.call(this.scope_);else try{s=this.derivation.call(this.scope_)}catch(o){s=new Ui(o)}return Wi(i),this.isComputing=!1,s},t.suspend_=function(){this.keepAlive_||(cs(this),this.value_=void 0,this.isTracing_!==vt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' was suspended and it will recompute on the next access."))},t.observe_=function(n,i){var s=this,o=!0,a=void 0;return At(function(){var l=s.get();if(!o||i){var c=Mr();n({observableKind:"computed",debugObjectName:s.name_,type:xt,object:s,newValue:l,oldValue:a}),Yt(c)}o=!1,a=l})},t.warnAboutUntrackedRead_=function(){this.isTracing_!==vt.NONE&&console.log("[mobx.trace] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute."),(typeof this.requiresReaction_=="boolean"?this.requiresReaction_:J.computedRequiresReaction)&&console.warn("[mobx] Computed value '"+this.name_+"' is being read outside a reactive context. Doing a full recompute.")},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Ou(this.get())},t[Symbol.toPrimitive]=function(){return this.valueOf()},sn(e,[{key:"isComputing",get:function(){return it(this.flags_,e.isComputingMask_)},set:function(n){this.flags_=ot(this.flags_,e.isComputingMask_,n)}},{key:"isRunningSetter",get:function(){return it(this.flags_,e.isRunningSetterMask_)},set:function(n){this.flags_=ot(this.flags_,e.isRunningSetterMask_,n)}},{key:"isBeingObserved",get:function(){return it(this.flags_,e.isBeingObservedMask_)},set:function(n){this.flags_=ot(this.flags_,e.isBeingObservedMask_,n)}},{key:"isPendingUnobservation",get:function(){return it(this.flags_,e.isPendingUnobservationMask_)},set:function(n){this.flags_=ot(this.flags_,e.isPendingUnobservationMask_,n)}},{key:"diffValue",get:function(){return it(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=ot(this.flags_,e.diffValueMask_,n===1)}}])}();_t.isComputingMask_=1;_t.isRunningSetterMask_=2;_t.isBeingObservedMask_=4;_t.isPendingUnobservationMask_=8;_t.diffValueMask_=16;var Fn=pr("ComputedValue",_t),Te;(function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"})(Te||(Te={}));var vt;(function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"})(vt||(vt={}));var Ui=function(t){this.cause=void 0,this.cause=t};function Si(e){return e instanceof Ui}function us(e){switch(e.dependenciesState_){case Te.UP_TO_DATE_:return!1;case Te.NOT_TRACKING_:case Te.STALE_:return!0;case Te.POSSIBLY_STALE_:{for(var t=vs(!0),r=Mr(),n=e.observing_,i=n.length,s=0;s<i;s++){var o=n[s];if(Fn(o)){if(J.disableErrorBoundaries)o.get();else try{o.get()}catch{return Yt(r),Un(t),!0}if(e.dependenciesState_===Te.STALE_)return Yt(r),Un(t),!0}}return Lu(e),Yt(r),Un(t),!1}}}function Du(){return J.trackingDerivation!==null}function jt(e){var t=e.observers_.size>0;!J.allowStateChanges&&(t||J.enforceActions==="always")&&console.warn("[MobX] "+(J.enforceActions?"Since strict-mode is enabled, changing (observed) observable values without using an action is not allowed. Tried to modify: ":"Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, a computed value or the render function of a React component? You can wrap side effects in 'runInAction' (or decorate functions with 'action') if needed. Tried to modify: ")+e.name_)}function Xy(e){!J.allowStateReads&&J.observableRequiresReaction&&console.warn("[mobx] Observable '"+e.name_+"' being read outside a reactive context.")}function Bu(e,t,r){var n=vs(!0);Lu(e),e.newObserving_=new Array(e.runId_===0?100:e.observing_.length),e.unboundDepsCount_=0,e.runId_=++J.runId;var i=J.trackingDerivation;J.trackingDerivation=e,J.inBatch++;var s;if(J.disableErrorBoundaries===!0)s=t.call(r);else try{s=t.call(r)}catch(o){s=new Ui(o)}return J.inBatch--,J.trackingDerivation=i,Qy(e),Yy(e),Un(n),s}function Yy(e){e.observing_.length===0&&(typeof e.requiresObservable_=="boolean"?e.requiresObservable_:J.reactionRequiresObservable)&&console.warn("[mobx] Derivation '"+e.name_+"' is created/updated without reading any observable value.")}function Qy(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,n=Te.UP_TO_DATE_,i=0,s=e.unboundDepsCount_,o=0;o<s;o++){var a=r[o];a.diffValue===0&&(a.diffValue=1,i!==o&&(r[i]=a),i++),a.dependenciesState_>n&&(n=a.dependenciesState_)}for(r.length=i,e.newObserving_=null,s=t.length;s--;){var l=t[s];l.diffValue===0&&Fu(l,e),l.diffValue=0}for(;i--;){var c=r[i];c.diffValue===1&&(c.diffValue=0,rg(c,e))}n!==Te.UP_TO_DATE_&&(e.dependenciesState_=n,e.onBecomeStale_())}function cs(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Fu(t[r],e);e.dependenciesState_=Te.NOT_TRACKING_}function Se(e){var t=Mr();try{return e()}finally{Yt(t)}}function Mr(){var e=J.trackingDerivation;return J.trackingDerivation=null,e}function Yt(e){J.trackingDerivation=e}function vs(e){var t=J.allowStateReads;return J.allowStateReads=e,t}function Un(e){J.allowStateReads=e}function Lu(e){if(e.dependenciesState_!==Te.UP_TO_DATE_){e.dependenciesState_=Te.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=Te.UP_TO_DATE_}}var xi=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},Ri=!0,ju=!1,J=function(){var e=ji();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(Ri=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==new xi().version&&(Ri=!1),Ri?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new xi):(setTimeout(function(){ju||ae(35)},1),new xi)}();function Zy(){if((J.pendingReactions.length||J.inBatch||J.isRunningReactions)&&ae(36),ju=!0,Ri){var e=ji();--e.__mobxInstanceCount===0&&(e.__mobxGlobals=void 0),J=new xi}}function ku(){return J}function eg(e){return e.observers_&&e.observers_.size>0}function tg(e){return e.observers_}function rg(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Fu(e,t){e.observers_.delete(t),e.observers_.size===0&&Ku(e)}function Ku(e){e.isPendingUnobservation===!1&&(e.isPendingUnobservation=!0,J.pendingUnobservations.push(e))}function gt(){J.inBatch++}function bt(){if(--J.inBatch===0){Wu();for(var e=J.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation=!1,r.observers_.size===0&&(r.isBeingObserved&&(r.isBeingObserved=!1,r.onBUO()),r instanceof _t&&r.suspend_())}J.pendingUnobservations=[]}}function Vu(e){Xy(e);var t=J.trackingDerivation;return t!==null?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved&&J.trackingContext&&(e.isBeingObserved=!0,e.onBO())),e.isBeingObserved):(e.observers_.size===0&&J.inBatch>0&&Ku(e),!1)}function qu(e){e.lowestObserverState_!==Te.STALE_&&(e.lowestObserverState_=Te.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.UP_TO_DATE_&&(t.isTracing_!==vt.NONE&&zu(t,e),t.onBecomeStale_()),t.dependenciesState_=Te.STALE_}))}function ng(e){e.lowestObserverState_!==Te.STALE_&&(e.lowestObserverState_=Te.STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.POSSIBLY_STALE_?(t.dependenciesState_=Te.STALE_,t.isTracing_!==vt.NONE&&zu(t,e)):t.dependenciesState_===Te.UP_TO_DATE_&&(e.lowestObserverState_=Te.UP_TO_DATE_)}))}function ig(e){e.lowestObserverState_===Te.UP_TO_DATE_&&(e.lowestObserverState_=Te.POSSIBLY_STALE_,e.observers_.forEach(function(t){t.dependenciesState_===Te.UP_TO_DATE_&&(t.dependenciesState_=Te.POSSIBLY_STALE_,t.onBecomeStale_())}))}function zu(e,t){if(console.log("[mobx.trace] '"+e.name_+"' is invalidated due to a change in: '"+t.name_+"'"),e.isTracing_===vt.BREAK){var r=[];Gu(Kn(e),r,1),new Function(`debugger;
|
|
11
11
|
/*
|
|
12
12
|
Tracing '`+e.name_+`'
|
|
13
13
|
|
|
@@ -15,50 +15,55 @@ You are entering this break point because derivation '`+e.name_+"' is being trac
|
|
|
15
15
|
Just follow the stacktrace you should now see in the devtools to see precisely what piece of your code is causing this update
|
|
16
16
|
The stackframe you are looking for is at least ~6-8 stack-frames up.
|
|
17
17
|
|
|
18
|
-
`+(e instanceof
|
|
18
|
+
`+(e instanceof _t?e.derivation.toString().replace(/[*]\//g,"/"):"")+`
|
|
19
19
|
|
|
20
20
|
The dependencies for this derivation are:
|
|
21
21
|
|
|
22
22
|
`+r.join(`
|
|
23
23
|
`)+`
|
|
24
24
|
*/
|
|
25
|
-
`)()}}function uu(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return uu(n,t,r+1)})}var Nt=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+_t()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=we.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=mt.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,J.pendingReactions.push(this),cu())},t.runReaction_=function(){if(!this.isDisposed){ht(),this.isScheduled=!1;var n=J.trackingContext;if(J.trackingContext=this,Lo(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&qe()&&Er({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}J.trackingContext=n,yt()}},t.track=function(n){if(!this.isDisposed){ht();var i=qe(),s;i&&(s=Date.now(),ot({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=J.trackingContext;J.trackingContext=this;var a=Za(this,n,void 0);J.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&jo(this),ci(a)&&this.reportExceptionInDerivation_(a.cause),i&&st({time:Date.now()-s}),yt()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(J.disableErrorBoundaries)throw n;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";J.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,n),qe()&&Er({type:"error",name:this.name_,message:s,error:""+n}),J.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(ht(),jo(this),yt()))},t.getDisposer_=function(n){var i=this,s=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",s),s[ye]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),Yo(this,n)},en(e,[{key:"isDisposed",get:function(){return nt(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=it(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return nt(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=it(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return nt(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=it(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return nt(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=it(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return nt(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=it(this.flags_,e.diffValueMask_,n===1)}}])}();Nt.isDisposedMask_=1;Nt.isScheduledMask_=2;Nt.isTrackPendingMask_=4;Nt.isRunningMask_=8;Nt.diffValueMask_=16;var Ta=100,ko=function(t){return t()};function cu(){J.inBatch>0||J.isRunningReactions||ko(Tp)}function Tp(){J.isRunningReactions=!0;for(var e=J.pendingReactions,t=0;e.length>0;){++t===Ta&&(console.error("Reaction doesn't converge to a stable state after "+Ta+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}J.isRunningReactions=!1}var mi=sr("Reaction",Nt);function Ap(e){var t=ko;ko=function(n){return e(function(){return t(n)})}}function qe(){return!!J.spyListeners.length}function Er(e){if(J.spyListeners.length)for(var t=J.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function ot(e){var t=Jt({},e,{spyReportStart:!0});Er(t)}var Op={type:"report-end",spyReportEnd:!0};function st(e){Er(e?Jt({},e,{type:"report-end",spyReportEnd:!0}):Op)}function Ip(e){return J.spyListeners.push(e),Go(function(){J.spyListeners=J.spyListeners.filter(function(t){return t!==e})})}var Xo="action",Ep="action.bound",lu="autoAction",Sp="autoAction.bound",fu="<unnamed action>",Fo=Rn(Xo),Rp=Rn(Ep,{bound:!0}),Ko=Rn(lu,{autoAction:!0}),Pp=Rn(Sp,{autoAction:!0,bound:!0});function du(e){var t=function(n,i){if(Me(n))return Ir(n.name||fu,n,e);if(Me(i))return Ir(n,i,e);if(Sn(i))return(e?Ko:Fo).decorate_20223_(n,i);if(Ar(i))return En(n,i,e?Ko:Fo);if(Ar(n))return Lt(Rn(e?lu:Xo,{name:n,autoAction:e}));ae("Invalid arguments for `action`")};return t}var tt=du(!1);Object.assign(tt,Fo);var An=du(!0);Object.assign(An,Ko);tt.bound=Lt(Rp);An.bound=Lt(Pp);function tn(e){return Ya(e.name||fu,!1,e,this,void 0)}function or(e){return Me(e)&&e.isMobxAction===!0}function wt(e,t){var r,n,i,s;t===void 0&&(t=qo),Me(e)||ae("Autorun expects a function as first argument"),or(e)&&ae("Autorun does not accept actions since actions are untrackable");var o=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+_t(),a=!t.scheduler&&!t.delay,l;if(a)l=new Nt(o,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=pu(t),d=!1;l=new Nt(o,function(){d||(d=!0,c(function(){d=!1,l.isDisposed||l.track(g)}))},t.onError,t.requiresObservable)}function g(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((s=t)==null?void 0:s.signal)}var $p=function(t){return t()};function pu(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:$p}function hu(e,t,r){var n,i,s;r===void 0&&(r=qo),(!Me(e)||!Me(t))&&ae("First and second argument to reaction should be functions"),$t(r)||ae("Third argument of reactions should be an object");var o=(n=r.name)!=null?n:"Reaction@"+_t(),a=tt(o,r.onError?Np(r.onError,t):t),l=!r.scheduler&&!r.delay,c=pu(r),d=!0,g=!1,x,S=r.compareStructural?Be.structural:r.equals||Be.default,R=new Nt(o,function(){d||l?K():g||(g=!0,c(K))},r.onError,r.requiresObservable);function K(){if(g=!1,!R.isDisposed){var H=!1,F=x;R.track(function(){var j=lp(!1,function(){return e(R)});H=d||!S(x,j),x=j}),(d&&r.fireImmediately||!d&&H)&&a(x,F,R),d=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||R.schedule_(),R.getDisposer_((s=r)==null?void 0:s.signal)}function Np(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var Cp="onBO",xp="onBUO";function rn(e,t,r){return yu(Cp,e,t,r)}function Pr(e,t,r){return yu(xp,e,t,r)}function yu(e,t,r,n){var i=typeof n=="function"?bt(t,r):bt(t),s=Me(n)?n:r,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}var Up="never",ai="always",Mp="observed";function gu(e){e.isolateGlobalState===!0&&gp();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(J.useProxies=t===ai?!0:t===Up?!1:typeof Proxy<"u"),t==="ifavailable"&&(J.verifyProxies=!0),r!==void 0){var n=r===ai?ai:r===Mp;J.enforceActions=n,J.allowStateChanges=!(n===!0||n===ai)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(J[i]=!!e[i])}),J.allowStateReads=!J.observableRequiresReaction,J.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&Ap(e.reactionScheduler)}function Dp(e,t,r,n){arguments.length>4&&ae("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ae("'extendObservable' expects an object as first argument"),jt(e)&&ae("'extendObservable' should not be used on maps, use map.merge instead"),$t(t)||ae("'extendObservable' only accepts plain objects as second argument"),(Qr(t)||Qr(r))&&ae("Extending an object with another observable (object) is not supported");var i=hd(t);return $r(function(){var s=on(e,n)[ye];Oi(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function $n(e,t){return mu(bt(e,t))}function mu(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=Bp(e.observing_).map(mu)),t}function Nn(e,t){return vu(bt(e,t))}function vu(e){var t={name:e.name_};return mp(e)&&(t.observers=Array.from(vp(e)).map(vu)),t}function Bp(e){return Array.from(new Set(e))}var Lp=0;function bu(){this.message="FLOW_CANCELLED"}bu.prototype=Object.create(Error.prototype);var Co=za("flow"),jp=za("flow.bound",{bound:!0}),Yr=Object.assign(function(t,r){if(Sn(r))return Co.decorate_20223_(t,r);if(Ar(r))return En(t,r,Co);arguments.length!==1&&ae("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",s=function(){var a=this,l=arguments,c=++Lp,d=tt(i+" - runid: "+c+" - init",n).apply(a,l),g,x=void 0,S=new Promise(function(R,K){var H=0;g=K;function F(G){x=void 0;var k;try{k=tt(i+" - runid: "+c+" - yield "+H++,d.next).call(d,G)}catch(Q){return K(Q)}V(k)}function j(G){x=void 0;var k;try{k=tt(i+" - runid: "+c+" - yield "+H++,d.throw).call(d,G)}catch(Q){return K(Q)}V(k)}function V(G){if(Me(G?.then)){G.then(V,K);return}return G.done?R(G.value):(x=Promise.resolve(G.value),x.then(F,j))}F(void 0)});return S.cancel=tt(i+" - runid: "+c+" - cancel",function(){try{x&&Aa(x);var R=d.return(void 0),K=Promise.resolve(R.value);K.then(Jr,Jr),Aa(K),g(new bu)}catch(H){g(H)}}),S};return s.isMobXFlow=!0,s},Co);Yr.bound=Lt(jp);function Aa(e){Me(e.cancel)&&e.cancel()}function On(e){return e?.isMobXFlow===!0}function kp(e,t){return e?t!==void 0?jt(e)||nn(e)?ae("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Sr(e)?e[ye].values_.has(t):!1:Sr(e)||!!e[ye]||Wo(e)||mi(e)||Pn(e):!1}function Qr(e){return arguments.length!==1&&ae("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),kp(e)}function Fp(e){if(Sr(e))return e[ye].ownKeys_();ae(38)}function ui(e,t,r){return e.set(t,r),r}function Hr(e,t){if(e==null||typeof e!="object"||e instanceof Date||!Qr(e))return e;if(dp(e)||Pn(e))return Hr(e.get(),t);if(t.has(e))return t.get(e);if(nn(e)){var r=ui(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=Hr(o,t)}),r}if(Et(e)){var n=ui(t,e,new Set);return e.forEach(function(o){n.add(Hr(o,t))}),n}if(jt(e)){var i=ui(t,e,new Map);return e.forEach(function(o,a){i.set(a,Hr(o,t))}),i}else{var s=ui(t,e,{});return Fp(e).forEach(function(o){In.propertyIsEnumerable.call(e,o)&&(s[o]=Hr(e[o],t))}),s}}function Xt(e,t){return t&&ae("toJS no longer supports options"),Hr(e,new Map)}function Yo(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=Kp(r);if(!i)return ae("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===mt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?mt.BREAK:mt.LOG}function Kp(e){switch(e.length){case 0:return J.trackingDerivation;case 1:return bt(e[0]);case 2:return bt(e[0],e[1])}}function Wt(e,t){t===void 0&&(t=void 0),ht();try{return e.apply(t)}finally{yt()}}function Tr(e){return e[ye]}var Vp={has:function(t,r){return J.trackingDerivation&&wn("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Tr(t).has_(r)},get:function(t,r){return Tr(t).get_(r)},set:function(t,r,n){var i;return Ar(r)?(Tr(t).values_.has(r)||wn("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Tr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return wn("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Ar(r)?(n=Tr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return wn("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Tr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return J.trackingDerivation&&wn("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Tr(t).ownKeys_()},preventExtensions:function(t){ae(13)}};function zp(e,t){var r,n;return Da(),e=on(e,t),(n=(r=e[ye]).proxy_)!=null?n:r.proxy_=new Proxy(e,Vp)}function dt(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function Cn(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Go(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function pt(e,t){var r=Rr();try{for(var n=[].concat(e.interceptors_||[]),i=0,s=n.length;i<s&&(t=n[i](t),t&&!t.type&&ae(14),!!t);i++);return t}finally{Ht(r)}}function Rt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function xn(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Go(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Pt(e,t){var r=Rr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,s=n.length;i<s;i++)n[i](t);Ht(r)}}function ur(e,t,r){return $r(function(){var n,i=on(e,r)[ye];t&&e[et]&&ae("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=bd(e)),Oi(t).forEach(function(s){return i.make_(s,t[s])})}),e}var Oa="splice",St="update",qp=1e4,Gp={get:function(t,r){var n=t[ye];return r===ye?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):gt(vi,r)?vi[r]:t[r]},set:function(t,r,n){var i=t[ye];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){ae(15)}},Qo=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+_t()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new ar(r),this.enhancer_=function(o,a){return n(o,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return Cn(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),xn(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&ae("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var s=new Array(n-i),o=0;o<n-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&ae(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&Iu(n+i+1)},t.spliceWithArray_=function(n,i,s){var o=this;Dt(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),s===void 0&&(s=pi),dt(this)){var l=pt(this,{object:this.proxy_,type:Oa,index:n,removedCount:i,added:s});if(!l)return pi;i=l.removedCount,s=l.added}s=s.length===0?s:s.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(a,c);var d=this.spliceItemsIntoValues_(n,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(n,s,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(n,i,s){if(s.length<qp){var o;return(o=this.values_).splice.apply(o,[n,i].concat(s))}else{var a=this.values_.slice(n,n+i),l=this.values_.slice(n+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[n+c]=s[c];for(var d=0;d<l.length;d++)this.values_[n+s.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(n,i,s){var o=!this.owned_&&qe(),a=Rt(this),l=a||o?{observableKind:"array",object:this.proxy_,type:St,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:s}:null;o&&ot(l),this.atom_.reportChanged(),a&&Pt(this,l),o&&st()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&qe(),a=Rt(this),l=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Oa,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&ot(l),this.atom_.reportChanged(),a&&Pt(this,l),o&&st()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var s=this.values_;if(this.legacyMode_&&n>s.length&&ae(17,n,s.length),n<s.length){Dt(this.atom_);var o=s[n];if(dt(this)){var a=pt(this,{type:St,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var l=i!==o;l&&(s[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var c=new Array(n+1-s.length),d=0;d<c.length-1;d++)c[d]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e}();function Wp(e,t,r,n){return r===void 0&&(r="ObservableArray@"+_t()),n===void 0&&(n=!1),Da(),$r(function(){var i=new Qo(r,t,n,!1);La(i.values_,ye,i);var s=new Proxy(i.values_,Gp);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var vi={clear:function(){return this.splice(0)},replace:function(t){var r=this[ye];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var o=this[ye];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[ye].spliceWithArray_(t,r,n)},push:function(){for(var t=this[ye],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[ye].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[ye],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return J.trackingDerivation&&ae(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){J.trackingDerivation&&ae(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[ye],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Pe("at",at);Pe("concat",at);Pe("flat",at);Pe("includes",at);Pe("indexOf",at);Pe("join",at);Pe("lastIndexOf",at);Pe("slice",at);Pe("toString",at);Pe("toLocaleString",at);Pe("toSorted",at);Pe("toSpliced",at);Pe("with",at);Pe("every",Ct);Pe("filter",Ct);Pe("find",Ct);Pe("findIndex",Ct);Pe("findLast",Ct);Pe("findLastIndex",Ct);Pe("flatMap",Ct);Pe("forEach",Ct);Pe("map",Ct);Pe("some",Ct);Pe("toReversed",Ct);Pe("reduce",_u);Pe("reduceRight",_u);function Pe(e,t){typeof Array.prototype[e]=="function"&&(vi[e]=t(e))}function at(e){return function(){var t=this[ye];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ct(e){return function(t,r){var n=this,i=this[ye];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(r,o,a,n)})}}function _u(e){return function(){var t=this,r=this[ye];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,t)},n[e].apply(n,arguments)}}var Hp=sr("ObservableArrayAdministration",Qo);function nn(e){return Ti(e)&&Hp(e[ye])}var Jp={},nr="add",bi="delete",wu=function(){function e(r,n,i){var s=this;n===void 0&&(n=Or),i===void 0&&(i="ObservableMap@"+_t()),this.enhancer_=void 0,this.name_=void 0,this[ye]=Jp,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Me(Map)||ae(18),$r(function(){s.keysAtom_=Ka(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,r&&s.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!J.trackingDerivation)return this.has_(n);var s=this.hasMap_.get(n);if(!s){var o=s=new ir(this.has_(n),Ei,this.name_+"."+Uo(n)+"?",!1);this.hasMap_.set(n,o),Pr(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(dt(this)){var o=pt(this,{type:s?St:nr,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return s?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(Dt(this.keysAtom_),dt(this)){var s=pt(this,{type:bi,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=qe(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:bi,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&ot(l),Wt(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(n))==null||c.setNewValue_(!1);var d=i.data_.get(n);d.setNewValue_(void 0),i.data_.delete(n)}),a&&Pt(this,l),o&&st(),!0}return!1},t.updateValue_=function(n,i){var s=this.data_.get(n);if(i=s.prepareNewValue_(i),i!==J.UNCHANGED){var o=qe(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:St,object:this,oldValue:s.value_,name:n,newValue:i}:null;o&&ot(l),s.setNewValue_(i),a&&Pt(this,l),o&&st()}},t.addValue_=function(n,i){var s=this;Dt(this.keysAtom_),Wt(function(){var c,d=new ir(i,s.enhancer_,s.name_+"."+Uo(n),!1);s.data_.set(n,d),i=d.value_,(c=s.hasMap_.get(n))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=qe(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:nr,object:this,name:n,newValue:i}:null;o&&ot(l),a&&Pt(this,l),o&&st()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return Ia({next:function(){var o=i.next(),a=o.done,l=o.value;return{done:a,value:a?void 0:n.get(l)}}})},t.entries=function(){var n=this,i=this.keys();return Ia({next:function(){var o=i.next(),a=o.done,l=o.value;return{done:a,value:a?void 0:[l,n.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var s=Xr(this),o;!(o=s()).done;){var a=o.value,l=a[0],c=a[1];n.call(i,c,l,this)}},t.merge=function(n){var i=this;return jt(n)&&(n=new Map(n)),Wt(function(){$t(n)?pd(n).forEach(function(s){return i.set(s,n[s])}):Array.isArray(n)?n.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):Zr(n)?(dd(n)||ae(19,n),n.forEach(function(s,o){return i.set(o,s)})):n!=null&&ae(20,n)}),this},t.clear=function(){var n=this;Wt(function(){Se(function(){for(var i=Xr(n.keys()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Wt(function(){for(var s=Xp(n),o=new Map,a=!1,l=Xr(i.data_.keys()),c;!(c=l()).done;){var d=c.value;if(!s.has(d)){var g=i.delete(d);if(g)a=!0;else{var x=i.data_.get(d);o.set(d,x)}}}for(var S=Xr(s.entries()),R;!(R=S()).done;){var K=R.value,H=K[0],F=K[1],j=i.data_.has(H);if(i.set(H,F),i.data_.has(H)){var V=i.data_.get(H);o.set(H,V),j||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var G=i.data_.keys(),k=o.keys(),Q=G.next(),q=k.next();!Q.done;){if(Q.value!==q.value){i.keysAtom_.reportChanged();break}Q=G.next(),q=k.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with maps."),xn(this,n)},t.intercept_=function(n){return Cn(this,n)},en(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),jt=sr("ObservableMap",wu);function Ia(e){return e[Symbol.toStringTag]="MapIterator",rs(e)}function Xp(e){if(Zr(e)||jt(e))return e;if(Array.isArray(e))return new Map(e);if($t(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return ae(21,e)}var Yp={},Tu=function(){function e(r,n,i){var s=this;n===void 0&&(n=Or),i===void 0&&(i="ObservableSet@"+_t()),this.name_=void 0,this[ye]=Yp,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Me(Set)||ae(22),this.enhancer_=function(o,a){return n(o,a,i)},$r(function(){s.atom_=Ka(s.name_),r&&s.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Wt(function(){Se(function(){for(var i=Xr(n.data_.values()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.forEach=function(n,i){for(var s=Xr(this),o;!(o=s()).done;){var a=o.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(Dt(this.atom_),dt(this)){var s=pt(this,{type:nr,object:this,newValue:n});if(!s)return this;n=s.newValue}if(!this.has(n)){Wt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=qe(),a=Rt(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:nr,object:this,newValue:n}:null;o&&ot(l),a&&Pt(this,l),o&&st()}return this},t.delete=function(n){var i=this;if(dt(this)){var s=pt(this,{type:bi,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=qe(),a=Rt(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:bi,object:this,oldValue:n}:null;return o&&ot(l),Wt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Pt(this,l),o&&st(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return Ea({next:function(){var s=n.next(),o=s.value,a=s.done;return a?{value:void 0,done:a}:{value:[o,o],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return Ea({next:function(){var o=i.next(),a=o.value,l=o.done;return l?{value:void 0,done:l}:{value:n.dehanceValue_(a),done:l}}})},t.intersection=function(n){if(Gt(n)&&!Et(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(Gt(n)&&!Et(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(Gt(n)&&!Et(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(Gt(n)&&!Et(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return Et(n)&&(n=new Set(n)),Wt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):Gt(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):n!=null&&ae("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with sets."),xn(this,n)},t.intercept_=function(n){return Cn(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},en(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),Et=sr("ObservableSet",Tu);function Ea(e){return e[Symbol.toStringTag]="SetIterator",rs(e)}var Sa=Object.create(null),Ra="remove",Vo=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=zd),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new ar(this.name_+".keys"),this.isPlainObject_=$t(this.target_),Eu(this.defaultAnnotation_)||ae("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var s=this.values_.get(n);if(s instanceof vt)return s.set(i),!0;if(dt(this)){var o=pt(this,{type:St,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==J.UNCHANGED){var a=Rt(this),l=qe(),c=a||l?{type:St,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:n,newValue:i}:null;l&&ot(c),s.setNewValue_(i),a&&Pt(this,c),l&&st()}return!0},t.get_=function(n){return J.trackingDerivation&&!gt(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),gt(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):s?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(n){if(!J.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new ir(n in this.target_,Ei,this.name_+"."+Uo(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(Na(this,i,n),!(n in this.target_)){var s;if((s=this.target_[et])!=null&&s[n])return;ae(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==In;){var a=di(o,n);if(a){var l=i.make_(this,n,a,o);if(l===0)return;if(l===1)break}o=Object.getPrototypeOf(o)}$a(this,i,n)}},t.extend_=function(n,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(n,i,o);Na(this,s,n);var a=s.extend_(this,n,i,o);return a&&$a(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),Dt(this.keysAtom_);try{ht();var o=this.delete_(n);if(!o)return o;if(dt(this)){var a=pt(this,{object:this.proxy_||this.target_,name:n,type:nr,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=Jt({},i,{value:l}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else Bt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{yt()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),Dt(this.keysAtom_);try{ht();var a=this.delete_(n);if(!a)return a;if(dt(this)){var l=pt(this,{object:this.proxy_||this.target_,name:n,type:nr,newValue:i});if(!l)return null;i=l.newValue}var c=Pa(n),d={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,d))return!1}else Bt(this.target_,n,d);var g=new ir(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{yt()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),Dt(this.keysAtom_);try{ht();var o=this.delete_(n);if(!o)return o;if(dt(this)){var a=pt(this,{object:this.proxy_||this.target_,name:n,type:nr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var l=Pa(n),c={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(s){if(!Reflect.defineProperty(this.target_,n,c))return!1}else Bt(this.target_,n,c);this.values_.set(n,new vt(i)),this.notifyPropertyAddition_(n,void 0)}finally{yt()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),Dt(this.keysAtom_),!gt(this.target_,n))return!0;if(dt(this)){var s=pt(this,{object:this.proxy_||this.target_,name:n,type:Ra});if(!s)return null}try{var o;ht();var a=Rt(this),l=qe(),c=this.values_.get(n),d=void 0;if(!c&&(a||l)){var g;d=(g=di(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],c&&(this.values_.delete(n),c instanceof ir&&(d=c.value_),su(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),a||l){var x={type:Ra,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:n};l&&ot(x),a&&Pt(this,x),l&&st()}}finally{yt()}return!0},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support the fire immediately property for observable objects."),xn(this,n)},t.intercept_=function(n){return Cn(this,n)},t.notifyPropertyAddition_=function(n,i){var s,o=Rt(this),a=qe();if(o||a){var l=o||a?{type:nr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;a&&ot(l),o&&Pt(this,l),a&&st()}(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Oi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function on(e,t){var r;if(t&&Sr(e)&&ae("Options can't be provided for already observable objects."),gt(e,ye))return es(e)instanceof Vo||ae("Cannot convert '"+_i(e)+`' into observable object:
|
|
25
|
+
`)()}}function Gu(e,t,r){if(t.length>=1e3){t.push("(and many more)");return}t.push(""+" ".repeat(r-1)+e.name),e.dependencies&&e.dependencies.forEach(function(n){return Gu(n,t,r+1)})}var Nt=function(){function e(r,n,i,s){r===void 0&&(r="Reaction@"+Tt()),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=Te.NOT_TRACKING_,this.runId_=0,this.unboundDepsCount_=0,this.flags_=0,this.isTracing_=vt.NONE,this.name_=r,this.onInvalidate_=n,this.errorHandler_=i,this.requiresObservable_=s}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled||(this.isScheduled=!0,J.pendingReactions.push(this),Wu())},t.runReaction_=function(){if(!this.isDisposed){gt(),this.isScheduled=!1;var n=J.trackingContext;if(J.trackingContext=this,us(this)){this.isTrackPending=!0;try{this.onInvalidate_(),this.isTrackPending&&Ge()&&Cr({name:this.name_,type:"scheduled-reaction"})}catch(i){this.reportExceptionInDerivation_(i)}}J.trackingContext=n,bt()}},t.track=function(n){if(!this.isDisposed){gt();var i=Ge(),s;i&&(s=Date.now(),st({name:this.name_,type:"reaction"})),this.isRunning=!0;var o=J.trackingContext;J.trackingContext=this;var a=Bu(this,n,void 0);J.trackingContext=o,this.isRunning=!1,this.isTrackPending=!1,this.isDisposed&&cs(this),Si(a)&&this.reportExceptionInDerivation_(a.cause),i&&at({time:Date.now()-s}),bt()}},t.reportExceptionInDerivation_=function(n){var i=this;if(this.errorHandler_){this.errorHandler_(n,this);return}if(J.disableErrorBoundaries)throw n;var s="[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '"+this+"'";J.suppressReactionErrors?console.warn("[mobx] (error in reaction '"+this.name_+"' suppressed, fix error of causing action below)"):console.error(s,n),Ge()&&Cr({type:"error",name:this.name_,message:s,error:""+n}),J.globalReactionErrorHandlers.forEach(function(o){return o(n,i)})},t.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.isRunning||(gt(),cs(this),bt()))},t.getDisposer_=function(n){var i=this,s=function o(){i.dispose(),n==null||n.removeEventListener==null||n.removeEventListener("abort",o)};return n==null||n.addEventListener==null||n.addEventListener("abort",s),s[ye]=this,s},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(n){n===void 0&&(n=!1),ws(this,n)},sn(e,[{key:"isDisposed",get:function(){return it(this.flags_,e.isDisposedMask_)},set:function(n){this.flags_=ot(this.flags_,e.isDisposedMask_,n)}},{key:"isScheduled",get:function(){return it(this.flags_,e.isScheduledMask_)},set:function(n){this.flags_=ot(this.flags_,e.isScheduledMask_,n)}},{key:"isTrackPending",get:function(){return it(this.flags_,e.isTrackPendingMask_)},set:function(n){this.flags_=ot(this.flags_,e.isTrackPendingMask_,n)}},{key:"isRunning",get:function(){return it(this.flags_,e.isRunningMask_)},set:function(n){this.flags_=ot(this.flags_,e.isRunningMask_,n)}},{key:"diffValue",get:function(){return it(this.flags_,e.diffValueMask_)?1:0},set:function(n){this.flags_=ot(this.flags_,e.diffValueMask_,n===1)}}])}();Nt.isDisposedMask_=1;Nt.isScheduledMask_=2;Nt.isTrackPendingMask_=4;Nt.isRunningMask_=8;Nt.diffValueMask_=16;var su=100,ls=function(t){return t()};function Wu(){J.inBatch>0||J.isRunningReactions||ls(og)}function og(){J.isRunningReactions=!0;for(var e=J.pendingReactions,t=0;e.length>0;){++t===su&&(console.error("Reaction doesn't converge to a stable state after "+su+" iterations."+(" Probably there is a cycle in the reactive function: "+e[0])),e.splice(0));for(var r=e.splice(0),n=0,i=r.length;n<i;n++)r[n].runReaction_()}J.isRunningReactions=!1}var Mi=pr("Reaction",Nt);function sg(e){var t=ls;ls=function(n){return e(function(){return t(n)})}}function Ge(){return!!J.spyListeners.length}function Cr(e){if(J.spyListeners.length)for(var t=J.spyListeners,r=0,n=t.length;r<n;r++)t[r](e)}function st(e){var t=Qt({},e,{spyReportStart:!0});Cr(t)}var ag={type:"report-end",spyReportEnd:!0};function at(e){Cr(e?Qt({},e,{type:"report-end",spyReportEnd:!0}):ag)}function ug(e){return J.spyListeners.push(e),gs(function(){J.spyListeners=J.spyListeners.filter(function(t){return t!==e})})}var _s="action",cg="action.bound",Hu="autoAction",lg="autoAction.bound",Ju="<unnamed action>",fs=kn(_s),fg=kn(cg,{bound:!0}),ds=kn(Hu,{autoAction:!0}),dg=kn(lg,{autoAction:!0,bound:!0});function Xu(e){var t=function(n,i){if(Me(n))return Nr(n.name||Ju,n,e);if(Me(i))return Nr(n,i,e);if(jn(i))return(e?ds:fs).decorate_20223_(n,i);if(Pr(i))return Ln(n,i,e?ds:fs);if(Pr(n))return Ft(kn(e?Hu:_s,{name:n,autoAction:e}));ae("Invalid arguments for `action`")};return t}var tt=Xu(!1);Object.assign(tt,fs);var Mn=Xu(!0);Object.assign(Mn,ds);tt.bound=Ft(fg);Mn.bound=Ft(dg);function an(e){return Mu(e.name||Ju,!1,e,this,void 0)}function dr(e){return Me(e)&&e.isMobxAction===!0}function At(e,t){var r,n,i,s;t===void 0&&(t=ys),Me(e)||ae("Autorun expects a function as first argument"),dr(e)&&ae("Autorun does not accept actions since actions are untrackable");var o=(r=(n=t)==null?void 0:n.name)!=null?r:e.name||"Autorun@"+Tt(),a=!t.scheduler&&!t.delay,l;if(a)l=new Nt(o,function(){this.track(g)},t.onError,t.requiresObservable);else{var c=Yu(t),d=!1;l=new Nt(o,function(){d||(d=!0,c(function(){d=!1,l.isDisposed||l.track(g)}))},t.onError,t.requiresObservable)}function g(){e(l)}return(i=t)!=null&&(i=i.signal)!=null&&i.aborted||l.schedule_(),l.getDisposer_((s=t)==null?void 0:s.signal)}var pg=function(t){return t()};function Yu(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:pg}function Qu(e,t,r){var n,i,s;r===void 0&&(r=ys),(!Me(e)||!Me(t))&&ae("First and second argument to reaction should be functions"),$t(r)||ae("Third argument of reactions should be an object");var o=(n=r.name)!=null?n:"Reaction@"+Tt(),a=tt(o,r.onError?hg(r.onError,t):t),l=!r.scheduler&&!r.delay,c=Yu(r),d=!0,g=!1,C,S=r.compareStructural?Be.structural:r.equals||Be.default,x=new Nt(o,function(){d||l?K():g||(g=!0,c(K))},r.onError,r.requiresObservable);function K(){if(g=!1,!x.isDisposed){var H=!1,F=C;x.track(function(){var j=Wy(!1,function(){return e(x)});H=d||!S(C,j),C=j}),(d&&r.fireImmediately||!d&&H)&&a(C,F,x),d=!1}}return(i=r)!=null&&(i=i.signal)!=null&&i.aborted||x.schedule_(),x.getDisposer_((s=r)==null?void 0:s.signal)}function hg(e,t){return function(){try{return t.apply(this,arguments)}catch(r){e.call(this,r)}}}var yg="onBO",gg="onBUO";function un(e,t,r){return Zu(yg,e,t,r)}function Dr(e,t,r){return Zu(gg,e,t,r)}function Zu(e,t,r,n){var i=typeof n=="function"?wt(t,r):wt(t),s=Me(n)?n:r,o=e+"L";return i[o]?i[o].add(s):i[o]=new Set([s]),function(){var a=i[o];a&&(a.delete(s),a.size===0&&delete i[o])}}var bg="never",Ei="always",mg="observed";function ec(e){e.isolateGlobalState===!0&&Zy();var t=e.useProxies,r=e.enforceActions;if(t!==void 0&&(J.useProxies=t===Ei?!0:t===bg?!1:typeof Proxy<"u"),t==="ifavailable"&&(J.verifyProxies=!0),r!==void 0){var n=r===Ei?Ei:r===mg;J.enforceActions=n,J.allowStateChanges=!(n===!0||n===Ei)}["computedRequiresReaction","reactionRequiresObservable","observableRequiresReaction","disableErrorBoundaries","safeDescriptors"].forEach(function(i){i in e&&(J[i]=!!e[i])}),J.allowStateReads=!J.observableRequiresReaction,J.disableErrorBoundaries===!0&&console.warn("WARNING: Debug feature only. MobX will NOT recover from errors when `disableErrorBoundaries` is enabled."),e.reactionScheduler&&sg(e.reactionScheduler)}function vg(e,t,r,n){arguments.length>4&&ae("'extendObservable' expected 2-4 arguments"),typeof e!="object"&&ae("'extendObservable' expects an object as first argument"),Kt(e)&&ae("'extendObservable' should not be used on maps, use map.merge instead"),$t(t)||ae("'extendObservable' only accepts plain objects as second argument"),(nn(t)||nn(r))&&ae("Extending an object with another observable (object) is not supported");var i=Yh(t);return Br(function(){var s=ln(e,n)[ye];Ki(i).forEach(function(o){s.extend_(o,i[o],r&&o in r?r[o]:!0)})}),e}function Kn(e,t){return tc(wt(e,t))}function tc(e){var t={name:e.name_};return e.observing_&&e.observing_.length>0&&(t.dependencies=_g(e.observing_).map(tc)),t}function Vn(e,t){return rc(wt(e,t))}function rc(e){var t={name:e.name_};return eg(e)&&(t.observers=Array.from(tg(e)).map(rc)),t}function _g(e){return Array.from(new Set(e))}var wg=0;function nc(){this.message="FLOW_CANCELLED"}nc.prototype=Object.create(Error.prototype);var rs=xu("flow"),Tg=xu("flow.bound",{bound:!0}),rn=Object.assign(function(t,r){if(jn(r))return rs.decorate_20223_(t,r);if(Pr(r))return Ln(t,r,rs);arguments.length!==1&&ae("Flow expects single argument with generator function");var n=t,i=n.name||"<unnamed flow>",s=function(){var a=this,l=arguments,c=++wg,d=tt(i+" - runid: "+c+" - init",n).apply(a,l),g,C=void 0,S=new Promise(function(x,K){var H=0;g=K;function F(G){C=void 0;var k;try{k=tt(i+" - runid: "+c+" - yield "+H++,d.next).call(d,G)}catch(Q){return K(Q)}V(k)}function j(G){C=void 0;var k;try{k=tt(i+" - runid: "+c+" - yield "+H++,d.throw).call(d,G)}catch(Q){return K(Q)}V(k)}function V(G){if(Me(G?.then)){G.then(V,K);return}return G.done?x(G.value):(C=Promise.resolve(G.value),C.then(F,j))}F(void 0)});return S.cancel=tt(i+" - runid: "+c+" - cancel",function(){try{C&&au(C);var x=d.return(void 0),K=Promise.resolve(x.value);K.then(en,en),au(K),g(new nc)}catch(H){g(H)}}),S};return s.isMobXFlow=!0,s},rs);rn.bound=Ft(Tg);function au(e){Me(e.cancel)&&e.cancel()}function Dn(e){return e?.isMobXFlow===!0}function Ag(e,t){return e?t!==void 0?Kt(e)||cn(e)?ae("isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead."):Ur(e)?e[ye].values_.has(t):!1:Ur(e)||!!e[ye]||bs(e)||Mi(e)||Fn(e):!1}function nn(e){return arguments.length!==1&&ae("isObservable expects only 1 argument. Use isObservableProp to inspect the observability of a property"),Ag(e)}function Og(e){if(Ur(e))return e[ye].ownKeys_();ae(38)}function Ii(e,t,r){return e.set(t,r),r}function Zr(e,t){if(e==null||typeof e!="object"||e instanceof Date||!nn(e))return e;if(Jy(e)||Fn(e))return Zr(e.get(),t);if(t.has(e))return t.get(e);if(cn(e)){var r=Ii(t,e,new Array(e.length));return e.forEach(function(o,a){r[a]=Zr(o,t)}),r}if(St(e)){var n=Ii(t,e,new Set);return e.forEach(function(o){n.add(Zr(o,t))}),n}if(Kt(e)){var i=Ii(t,e,new Map);return e.forEach(function(o,a){i.set(a,Zr(o,t))}),i}else{var s=Ii(t,e,{});return Og(e).forEach(function(o){Bn.propertyIsEnumerable.call(e,o)&&(s[o]=Zr(e[o],t))}),s}}function Zt(e,t){return t&&ae("toJS no longer supports options"),Zr(e,new Map)}function ws(){for(var e=!1,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[r.length-1]=="boolean"&&(e=r.pop());var i=Eg(r);if(!i)return ae("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");i.isTracing_===vt.NONE&&console.log("[mobx.trace] '"+i.name_+"' tracing enabled"),i.isTracing_=e?vt.BREAK:vt.LOG}function Eg(e){switch(e.length){case 0:return J.trackingDerivation;case 1:return wt(e[0]);case 2:return wt(e[0],e[1])}}function Xt(e,t){t===void 0&&(t=void 0),gt();try{return e.apply(t)}finally{bt()}}function Rr(e){return e[ye]}var Ig={has:function(t,r){return J.trackingDerivation&&Cn("detect new properties using the 'in' operator. Use 'has' from 'mobx' instead."),Rr(t).has_(r)},get:function(t,r){return Rr(t).get_(r)},set:function(t,r,n){var i;return Pr(r)?(Rr(t).values_.has(r)||Cn("add a new observable property through direct assignment. Use 'set' from 'mobx' instead."),(i=Rr(t).set_(r,n,!0))!=null?i:!0):!1},deleteProperty:function(t,r){var n;return Cn("delete properties from an observable object. Use 'remove' from 'mobx' instead."),Pr(r)?(n=Rr(t).delete_(r,!0))!=null?n:!0:!1},defineProperty:function(t,r,n){var i;return Cn("define property on an observable object. Use 'defineProperty' from 'mobx' instead."),(i=Rr(t).defineProperty_(r,n))!=null?i:!0},ownKeys:function(t){return J.trackingDerivation&&Cn("iterate keys to detect added / removed properties. Use 'keys' from 'mobx' instead."),Rr(t).ownKeys_()},preventExtensions:function(t){ae(13)}};function Sg(e,t){var r,n;return _u(),e=ln(e,t),(n=(r=e[ye]).proxy_)!=null?n:r.proxy_=new Proxy(e,Ig)}function ht(e){return e.interceptors_!==void 0&&e.interceptors_.length>0}function qn(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),gs(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function yt(e,t){var r=Mr();try{for(var n=[].concat(e.interceptors_||[]),i=0,s=n.length;i<s&&(t=n[i](t),t&&!t.type&&ae(14),!!t);i++);return t}finally{Yt(r)}}function Rt(e){return e.changeListeners_!==void 0&&e.changeListeners_.length>0}function zn(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),gs(function(){var n=r.indexOf(t);n!==-1&&r.splice(n,1)})}function Pt(e,t){var r=Mr(),n=e.changeListeners_;if(n){n=n.slice();for(var i=0,s=n.length;i<s;i++)n[i](t);Yt(r)}}function yr(e,t,r){return Br(function(){var n,i=ln(e,r)[ye];t&&e[et]&&ae("makeObservable second arg must be nullish when using decorators. Mixing @decorator syntax with annotations is not supported."),(n=t)!=null||(t=ry(e)),Ki(t).forEach(function(s){return i.make_(s,t[s])})}),e}var uu="splice",xt="update",xg=1e4,Rg={get:function(t,r){var n=t[ye];return r===ye?n:r==="length"?n.getArrayLength_():typeof r=="string"&&!isNaN(r)?n.get_(parseInt(r)):mt(Di,r)?Di[r]:t[r]},set:function(t,r,n){var i=t[ye];return r==="length"&&i.setArrayLength_(n),typeof r=="symbol"||isNaN(r)?t[r]=n:i.set_(parseInt(r),n),!0},preventExtensions:function(){ae(15)}},Ts=function(){function e(r,n,i,s){r===void 0&&(r="ObservableArray@"+Tt()),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=i,this.legacyMode_=s,this.atom_=new hr(r),this.enhancer_=function(o,a){return n(o,a,r+"[..]")}}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.dehanceValues_=function(n){return this.dehancer!==void 0&&n.length>0?n.map(this.dehancer):n},t.intercept_=function(n){return qn(this,n)},t.observe_=function(n,i){return i===void 0&&(i=!1),i&&n({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),zn(this,n)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(n){(typeof n!="number"||isNaN(n)||n<0)&&ae("Out of range: "+n);var i=this.values_.length;if(n!==i)if(n>i){for(var s=new Array(n-i),o=0;o<n-i;o++)s[o]=void 0;this.spliceWithArray_(i,0,s)}else this.spliceWithArray_(n,i-n)},t.updateArrayLength_=function(n,i){n!==this.lastKnownLength_&&ae(16),this.lastKnownLength_+=i,this.legacyMode_&&i>0&&cc(n+i+1)},t.spliceWithArray_=function(n,i,s){var o=this;jt(this.atom_);var a=this.values_.length;if(n===void 0?n=0:n>a?n=a:n<0&&(n=Math.max(0,a+n)),arguments.length===1?i=a-n:i==null?i=0:i=Math.max(0,Math.min(i,a-n)),s===void 0&&(s=$i),ht(this)){var l=yt(this,{object:this.proxy_,type:uu,index:n,removedCount:i,added:s});if(!l)return $i;i=l.removedCount,s=l.added}s=s.length===0?s:s.map(function(g){return o.enhancer_(g,void 0)}),this.legacyMode_;var c=s.length-i;this.updateArrayLength_(a,c);var d=this.spliceItemsIntoValues_(n,i,s);return(i!==0||s.length!==0)&&this.notifyArraySplice_(n,s,d),this.dehanceValues_(d)},t.spliceItemsIntoValues_=function(n,i,s){if(s.length<xg){var o;return(o=this.values_).splice.apply(o,[n,i].concat(s))}else{var a=this.values_.slice(n,n+i),l=this.values_.slice(n+i);this.values_.length+=s.length-i;for(var c=0;c<s.length;c++)this.values_[n+c]=s[c];for(var d=0;d<l.length;d++)this.values_[n+s.length+d]=l[d];return a}},t.notifyArrayChildUpdate_=function(n,i,s){var o=!this.owned_&&Ge(),a=Rt(this),l=a||o?{observableKind:"array",object:this.proxy_,type:xt,debugObjectName:this.atom_.name_,index:n,newValue:i,oldValue:s}:null;o&&st(l),this.atom_.reportChanged(),a&&Pt(this,l),o&&at()},t.notifyArraySplice_=function(n,i,s){var o=!this.owned_&&Ge(),a=Rt(this),l=a||o?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:uu,index:n,removed:s,added:i,removedCount:s.length,addedCount:i.length}:null;o&&st(l),this.atom_.reportChanged(),a&&Pt(this,l),o&&at()},t.get_=function(n){if(this.legacyMode_&&n>=this.values_.length){console.warn("[mobx.array] Attempt to read an array index ("+n+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX");return}return this.atom_.reportObserved(),this.dehanceValue_(this.values_[n])},t.set_=function(n,i){var s=this.values_;if(this.legacyMode_&&n>s.length&&ae(17,n,s.length),n<s.length){jt(this.atom_);var o=s[n];if(ht(this)){var a=yt(this,{type:xt,object:this.proxy_,index:n,newValue:i});if(!a)return;i=a.newValue}i=this.enhancer_(i,o);var l=i!==o;l&&(s[n]=i,this.notifyArrayChildUpdate_(n,i,o))}else{for(var c=new Array(n+1-s.length),d=0;d<c.length-1;d++)c[d]=void 0;c[c.length-1]=i,this.spliceWithArray_(s.length,0,c)}},e}();function Pg(e,t,r,n){return r===void 0&&(r="ObservableArray@"+Tt()),n===void 0&&(n=!1),_u(),Br(function(){var i=new Ts(r,t,n,!1);Tu(i.values_,ye,i);var s=new Proxy(i.values_,Rg);return i.proxy_=s,e&&e.length&&i.spliceWithArray_(0,0,e),s})}var Di={clear:function(){return this.splice(0)},replace:function(t){var r=this[ye];return r.spliceWithArray_(0,r.values_.length,t)},toJSON:function(){return this.slice()},splice:function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),s=2;s<n;s++)i[s-2]=arguments[s];var o=this[ye];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(t);case 2:return o.spliceWithArray_(t,r)}return o.spliceWithArray_(t,r,i)},spliceWithArray:function(t,r,n){return this[ye].spliceWithArray_(t,r,n)},push:function(){for(var t=this[ye],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(t.values_.length,0,n),t.values_.length},pop:function(){return this.splice(Math.max(this[ye].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var t=this[ye],r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return t.spliceWithArray_(0,0,n),t.values_.length},reverse:function(){return J.trackingDerivation&&ae(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){J.trackingDerivation&&ae(37,"sort");var t=this.slice();return t.sort.apply(t,arguments),this.replace(t),this},remove:function(t){var r=this[ye],n=r.dehanceValues_(r.values_).indexOf(t);return n>-1?(this.splice(n,1),!0):!1}};Re("at",ut);Re("concat",ut);Re("flat",ut);Re("includes",ut);Re("indexOf",ut);Re("join",ut);Re("lastIndexOf",ut);Re("slice",ut);Re("toString",ut);Re("toLocaleString",ut);Re("toSorted",ut);Re("toSpliced",ut);Re("with",ut);Re("every",Ct);Re("filter",Ct);Re("find",Ct);Re("findIndex",Ct);Re("findLast",Ct);Re("findLastIndex",Ct);Re("flatMap",Ct);Re("forEach",Ct);Re("map",Ct);Re("some",Ct);Re("toReversed",Ct);Re("reduce",ic);Re("reduceRight",ic);function Re(e,t){typeof Array.prototype[e]=="function"&&(Di[e]=t(e))}function ut(e){return function(){var t=this[ye];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ct(e){return function(t,r){var n=this,i=this[ye];i.atom_.reportObserved();var s=i.dehanceValues_(i.values_);return s[e](function(o,a){return t.call(r,o,a,n)})}}function ic(e){return function(){var t=this,r=this[ye];r.atom_.reportObserved();var n=r.dehanceValues_(r.values_),i=arguments[0];return arguments[0]=function(s,o,a){return i(s,o,a,t)},n[e].apply(n,arguments)}}var $g=pr("ObservableArrayAdministration",Ts);function cn(e){return ki(e)&&$g(e[ye])}var Ng={},lr="add",Bi="delete",oc=function(){function e(r,n,i){var s=this;n===void 0&&(n=$r),i===void 0&&(i="ObservableMap@"+Tt()),this.enhancer_=void 0,this.name_=void 0,this[ye]=Ng,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=n,this.name_=i,Me(Map)||ae(18),Br(function(){s.keysAtom_=Iu(s.name_+".keys()"),s.data_=new Map,s.hasMap_=new Map,r&&s.merge(r)})}var t=e.prototype;return t.has_=function(n){return this.data_.has(n)},t.has=function(n){var i=this;if(!J.trackingDerivation)return this.has_(n);var s=this.hasMap_.get(n);if(!s){var o=s=new fr(this.has_(n),qi,this.name_+"."+is(n)+"?",!1);this.hasMap_.set(n,o),Dr(o,function(){return i.hasMap_.delete(n)})}return s.get()},t.set=function(n,i){var s=this.has_(n);if(ht(this)){var o=yt(this,{type:s?xt:lr,object:this,newValue:i,name:n});if(!o)return this;i=o.newValue}return s?this.updateValue_(n,i):this.addValue_(n,i),this},t.delete=function(n){var i=this;if(jt(this.keysAtom_),ht(this)){var s=yt(this,{type:Bi,object:this,name:n});if(!s)return!1}if(this.has_(n)){var o=Ge(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:Bi,object:this,oldValue:this.data_.get(n).value_,name:n}:null;return o&&st(l),Xt(function(){var c;i.keysAtom_.reportChanged(),(c=i.hasMap_.get(n))==null||c.setNewValue_(!1);var d=i.data_.get(n);d.setNewValue_(void 0),i.data_.delete(n)}),a&&Pt(this,l),o&&at(),!0}return!1},t.updateValue_=function(n,i){var s=this.data_.get(n);if(i=s.prepareNewValue_(i),i!==J.UNCHANGED){var o=Ge(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:xt,object:this,oldValue:s.value_,name:n,newValue:i}:null;o&&st(l),s.setNewValue_(i),a&&Pt(this,l),o&&at()}},t.addValue_=function(n,i){var s=this;jt(this.keysAtom_),Xt(function(){var c,d=new fr(i,s.enhancer_,s.name_+"."+is(n),!1);s.data_.set(n,d),i=d.value_,(c=s.hasMap_.get(n))==null||c.setNewValue_(!0),s.keysAtom_.reportChanged()});var o=Ge(),a=Rt(this),l=a||o?{observableKind:"map",debugObjectName:this.name_,type:lr,object:this,name:n,newValue:i}:null;o&&st(l),a&&Pt(this,l),o&&at()},t.get=function(n){return this.has(n)?this.dehanceValue_(this.data_.get(n).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var n=this,i=this.keys();return cu({next:function(){var o=i.next(),a=o.done,l=o.value;return{done:a,value:a?void 0:n.get(l)}}})},t.entries=function(){var n=this,i=this.keys();return cu({next:function(){var o=i.next(),a=o.done,l=o.value;return{done:a,value:a?void 0:[l,n.get(l)]}}})},t[Symbol.iterator]=function(){return this.entries()},t.forEach=function(n,i){for(var s=tn(this),o;!(o=s()).done;){var a=o.value,l=a[0],c=a[1];n.call(i,c,l,this)}},t.merge=function(n){var i=this;return Kt(n)&&(n=new Map(n)),Xt(function(){$t(n)?Xh(n).forEach(function(s){return i.set(s,n[s])}):Array.isArray(n)?n.forEach(function(s){var o=s[0],a=s[1];return i.set(o,a)}):on(n)?(Jh(n)||ae(19,n),n.forEach(function(s,o){return i.set(o,s)})):n!=null&&ae(20,n)}),this},t.clear=function(){var n=this;Xt(function(){Se(function(){for(var i=tn(n.keys()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.replace=function(n){var i=this;return Xt(function(){for(var s=Cg(n),o=new Map,a=!1,l=tn(i.data_.keys()),c;!(c=l()).done;){var d=c.value;if(!s.has(d)){var g=i.delete(d);if(g)a=!0;else{var C=i.data_.get(d);o.set(d,C)}}}for(var S=tn(s.entries()),x;!(x=S()).done;){var K=x.value,H=K[0],F=K[1],j=i.data_.has(H);if(i.set(H,F),i.data_.has(H)){var V=i.data_.get(H);o.set(H,V),j||(a=!0)}}if(!a)if(i.data_.size!==o.size)i.keysAtom_.reportChanged();else for(var G=i.data_.keys(),k=o.keys(),Q=G.next(),z=k.next();!Q.done;){if(Q.value!==z.value){i.keysAtom_.reportChanged();break}Q=G.next(),z=k.next()}i.data_=o}),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with maps."),zn(this,n)},t.intercept_=function(n){return qn(this,n)},sn(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Map"}}])}(),Kt=pr("ObservableMap",oc);function cu(e){return e[Symbol.toStringTag]="MapIterator",Is(e)}function Cg(e){if(on(e)||Kt(e))return e;if(Array.isArray(e))return new Map(e);if($t(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}else return ae(21,e)}var Ug={},sc=function(){function e(r,n,i){var s=this;n===void 0&&(n=$r),i===void 0&&(i="ObservableSet@"+Tt()),this.name_=void 0,this[ye]=Ug,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=i,Me(Set)||ae(22),this.enhancer_=function(o,a){return n(o,a,i)},Br(function(){s.atom_=Iu(s.name_),r&&s.replace(r)})}var t=e.prototype;return t.dehanceValue_=function(n){return this.dehancer!==void 0?this.dehancer(n):n},t.clear=function(){var n=this;Xt(function(){Se(function(){for(var i=tn(n.data_.values()),s;!(s=i()).done;){var o=s.value;n.delete(o)}})})},t.forEach=function(n,i){for(var s=tn(this),o;!(o=s()).done;){var a=o.value;n.call(i,a,a,this)}},t.add=function(n){var i=this;if(jt(this.atom_),ht(this)){var s=yt(this,{type:lr,object:this,newValue:n});if(!s)return this;n=s.newValue}if(!this.has(n)){Xt(function(){i.data_.add(i.enhancer_(n,void 0)),i.atom_.reportChanged()});var o=Ge(),a=Rt(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:lr,object:this,newValue:n}:null;o&&st(l),a&&Pt(this,l),o&&at()}return this},t.delete=function(n){var i=this;if(ht(this)){var s=yt(this,{type:Bi,object:this,oldValue:n});if(!s)return!1}if(this.has(n)){var o=Ge(),a=Rt(this),l=a||o?{observableKind:"set",debugObjectName:this.name_,type:Bi,object:this,oldValue:n}:null;return o&&st(l),Xt(function(){i.atom_.reportChanged(),i.data_.delete(n)}),a&&Pt(this,l),o&&at(),!0}return!1},t.has=function(n){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(n))},t.entries=function(){var n=this.values();return lu({next:function(){var s=n.next(),o=s.value,a=s.done;return a?{value:void 0,done:a}:{value:[o,o],done:a}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var n=this,i=this.data_.values();return lu({next:function(){var o=i.next(),a=o.value,l=o.done;return l?{value:void 0,done:l}:{value:n.dehanceValue_(a),done:l}}})},t.intersection=function(n){if(Jt(n)&&!St(n))return n.intersection(this);var i=new Set(this);return i.intersection(n)},t.union=function(n){if(Jt(n)&&!St(n))return n.union(this);var i=new Set(this);return i.union(n)},t.difference=function(n){return new Set(this).difference(n)},t.symmetricDifference=function(n){if(Jt(n)&&!St(n))return n.symmetricDifference(this);var i=new Set(this);return i.symmetricDifference(n)},t.isSubsetOf=function(n){return new Set(this).isSubsetOf(n)},t.isSupersetOf=function(n){return new Set(this).isSupersetOf(n)},t.isDisjointFrom=function(n){if(Jt(n)&&!St(n))return n.isDisjointFrom(this);var i=new Set(this);return i.isDisjointFrom(n)},t.replace=function(n){var i=this;return St(n)&&(n=new Set(n)),Xt(function(){Array.isArray(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):Jt(n)?(i.clear(),n.forEach(function(s){return i.add(s)})):n!=null&&ae("Cannot initialize set from "+n)}),this},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support fireImmediately=true in combination with sets."),zn(this,n)},t.intercept_=function(n){return qn(this,n)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Symbol.iterator]=function(){return this.values()},sn(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Symbol.toStringTag,get:function(){return"Set"}}])}(),St=pr("ObservableSet",sc);function lu(e){return e[Symbol.toStringTag]="SetIterator",Is(e)}var fu=Object.create(null),du="remove",ps=function(){function e(r,n,i,s){n===void 0&&(n=new Map),s===void 0&&(s=Sy),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=r,this.values_=n,this.name_=i,this.defaultAnnotation_=s,this.keysAtom_=new hr(this.name_+".keys"),this.isPlainObject_=$t(this.target_),lc(this.defaultAnnotation_)||ae("defaultAnnotation must be valid annotation"),this.appliedAnnotations_={}}var t=e.prototype;return t.getObservablePropValue_=function(n){return this.values_.get(n).get()},t.setObservablePropValue_=function(n,i){var s=this.values_.get(n);if(s instanceof _t)return s.set(i),!0;if(ht(this)){var o=yt(this,{type:xt,object:this.proxy_||this.target_,name:n,newValue:i});if(!o)return null;i=o.newValue}if(i=s.prepareNewValue_(i),i!==J.UNCHANGED){var a=Rt(this),l=Ge(),c=a||l?{type:xt,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:s.value_,name:n,newValue:i}:null;l&&st(c),s.setNewValue_(i),a&&Pt(this,c),l&&at()}return!0},t.get_=function(n){return J.trackingDerivation&&!mt(this.target_,n)&&this.has_(n),this.target_[n]},t.set_=function(n,i,s){return s===void 0&&(s=!1),mt(this.target_,n)?this.values_.has(n)?this.setObservablePropValue_(n,i):s?Reflect.set(this.target_,n,i):(this.target_[n]=i,!0):this.extend_(n,{value:i,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,s)},t.has_=function(n){if(!J.trackingDerivation)return n in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var i=this.pendingKeys_.get(n);return i||(i=new fr(n in this.target_,qi,this.name_+"."+is(n)+"?",!1),this.pendingKeys_.set(n,i)),i.get()},t.make_=function(n,i){if(i===!0&&(i=this.defaultAnnotation_),i!==!1){if(yu(this,i,n),!(n in this.target_)){var s;if((s=this.target_[et])!=null&&s[n])return;ae(1,i.annotationType_,this.name_+"."+n.toString())}for(var o=this.target_;o&&o!==Bn;){var a=Pi(o,n);if(a){var l=i.make_(this,n,a,o);if(l===0)return;if(l===1)break}o=Object.getPrototypeOf(o)}hu(this,i,n)}},t.extend_=function(n,i,s,o){if(o===void 0&&(o=!1),s===!0&&(s=this.defaultAnnotation_),s===!1)return this.defineProperty_(n,i,o);yu(this,s,n);var a=s.extend_(this,n,i,o);return a&&hu(this,s,n),a},t.defineProperty_=function(n,i,s){s===void 0&&(s=!1),jt(this.keysAtom_);try{gt();var o=this.delete_(n);if(!o)return o;if(ht(this)){var a=yt(this,{object:this.proxy_||this.target_,name:n,type:lr,newValue:i.value});if(!a)return null;var l=a.newValue;i.value!==l&&(i=Qt({},i,{value:l}))}if(s){if(!Reflect.defineProperty(this.target_,n,i))return!1}else kt(this.target_,n,i);this.notifyPropertyAddition_(n,i.value)}finally{bt()}return!0},t.defineObservableProperty_=function(n,i,s,o){o===void 0&&(o=!1),jt(this.keysAtom_);try{gt();var a=this.delete_(n);if(!a)return a;if(ht(this)){var l=yt(this,{object:this.proxy_||this.target_,name:n,type:lr,newValue:i});if(!l)return null;i=l.newValue}var c=pu(n),d={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!0,get:c.get,set:c.set};if(o){if(!Reflect.defineProperty(this.target_,n,d))return!1}else kt(this.target_,n,d);var g=new fr(i,s,this.name_+"."+n.toString(),!1);this.values_.set(n,g),this.notifyPropertyAddition_(n,g.value_)}finally{bt()}return!0},t.defineComputedProperty_=function(n,i,s){s===void 0&&(s=!1),jt(this.keysAtom_);try{gt();var o=this.delete_(n);if(!o)return o;if(ht(this)){var a=yt(this,{object:this.proxy_||this.target_,name:n,type:lr,newValue:void 0});if(!a)return null}i.name||(i.name=this.name_+"."+n.toString()),i.context=this.proxy_||this.target_;var l=pu(n),c={configurable:J.safeDescriptors?this.isPlainObject_:!0,enumerable:!1,get:l.get,set:l.set};if(s){if(!Reflect.defineProperty(this.target_,n,c))return!1}else kt(this.target_,n,c);this.values_.set(n,new _t(i)),this.notifyPropertyAddition_(n,void 0)}finally{bt()}return!0},t.delete_=function(n,i){if(i===void 0&&(i=!1),jt(this.keysAtom_),!mt(this.target_,n))return!0;if(ht(this)){var s=yt(this,{object:this.proxy_||this.target_,name:n,type:du});if(!s)return null}try{var o;gt();var a=Rt(this),l=Ge(),c=this.values_.get(n),d=void 0;if(!c&&(a||l)){var g;d=(g=Pi(this.target_,n))==null?void 0:g.value}if(i){if(!Reflect.deleteProperty(this.target_,n))return!1}else delete this.target_[n];if(delete this.appliedAnnotations_[n],c&&(this.values_.delete(n),c instanceof fr&&(d=c.value_),qu(c)),this.keysAtom_.reportChanged(),(o=this.pendingKeys_)==null||(o=o.get(n))==null||o.set(n in this.target_),a||l){var C={type:du,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:d,name:n};l&&st(C),a&&Pt(this,C),l&&at()}}finally{bt()}return!0},t.observe_=function(n,i){return i===!0&&ae("`observe` doesn't support the fire immediately property for observable objects."),zn(this,n)},t.intercept_=function(n){return qn(this,n)},t.notifyPropertyAddition_=function(n,i){var s,o=Rt(this),a=Ge();if(o||a){var l=o||a?{type:lr,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:n,newValue:i}:null;a&&st(l),o&&Pt(this,l),a&&at()}(s=this.pendingKeys_)==null||(s=s.get(n))==null||s.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Ki(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function ln(e,t){var r;if(t&&Ur(e)&&ae("Options can't be provided for already observable objects."),mt(e,ye))return Os(e)instanceof ps||ae("Cannot convert '"+Li(e)+`' into observable object:
|
|
26
26
|
The target is already observable of different type.
|
|
27
|
-
Extending builtins is not supported.`),e;Object.isExtensible(e)||ae("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:($t(e)?"ObservableObject":e.constructor.name)+"@"+
|
|
27
|
+
Extending builtins is not supported.`),e;Object.isExtensible(e)||ae("Cannot make the designated object observable; it is not extensible");var n=(r=t?.name)!=null?r:($t(e)?"ObservableObject":e.constructor.name)+"@"+Tt(),i=new ps(e,new Map,String(n),Ly(t));return Fi(e,ye,i),e}var Mg=pr("ObservableObjectAdministration",ps);function pu(e){return fu[e]||(fu[e]={get:function(){return this[ye].getObservablePropValue_(e)},set:function(r){return this[ye].setObservablePropValue_(e,r)}})}function Ur(e){return ki(e)?Mg(e[ye]):!1}function hu(e,t,r){var n;e.appliedAnnotations_[r]=t,(n=e.target_[et])==null||delete n[r]}function yu(e,t,r){if(lc(t)||ae("Cannot annotate '"+e.name_+"."+r.toString()+"': Invalid annotation."),!Ni(t)&&mt(e.appliedAnnotations_,r)){var n=e.name_+"."+r.toString(),i=e.appliedAnnotations_[r].annotationType_,s=t.annotationType_;ae("Cannot apply '"+s+"' to '"+n+"':"+(`
|
|
28
28
|
The field is already annotated with '`+i+"'.")+`
|
|
29
29
|
Re-annotating fields is not allowed.
|
|
30
|
-
Use 'override' annotation for methods overridden by subclass.`)}}var
|
|
30
|
+
Use 'override' annotation for methods overridden by subclass.`)}}var Dg=uc(0),Bg=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,e===!1}(),ns=0,ac=function(){};function Lg(e,t){Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):e.prototype.__proto__!==void 0?e.prototype.__proto__=t:e.prototype=t}Lg(ac,Array.prototype);var As=function(e){function t(n,i,s,o){var a;return s===void 0&&(s="ObservableArray@"+Tt()),o===void 0&&(o=!1),a=e.call(this)||this,Br(function(){var l=new Ts(s,i,o,!0);l.proxy_=a,Tu(a,ye,l),n&&n.length&&a.spliceWithArray(0,0,n),Bg&&Object.defineProperty(a,"0",Dg)}),a}Eu(t,e);var r=t.prototype;return r.concat=function(){this[ye].atom_.reportObserved();for(var i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return Array.prototype.concat.apply(this.slice(),s.map(function(a){return cn(a)?a.slice():a}))},r[Symbol.iterator]=function(){var n=this,i=0;return Is({next:function(){return i<n.length?{value:n[i++],done:!1}:{done:!0,value:void 0}}})},sn(t,[{key:"length",get:function(){return this[ye].getArrayLength_()},set:function(i){this[ye].setArrayLength_(i)}},{key:Symbol.toStringTag,get:function(){return"Array"}}])}(ac);Object.entries(Di).forEach(function(e){var t=e[0],r=e[1];t!=="concat"&&Fi(As.prototype,t,r)});function uc(e){return{enumerable:!1,configurable:!0,get:function(){return this[ye].get_(e)},set:function(r){this[ye].set_(e,r)}}}function jg(e){kt(As.prototype,""+e,uc(e))}function cc(e){if(e>ns){for(var t=ns;t<e+100;t++)jg(t);ns=e}}cc(1e3);function kg(e,t,r){return new As(e,t,r)}function wt(e,t){if(typeof e=="object"&&e!==null){if(cn(e))return t!==void 0&&ae(23),e[ye].atom_;if(St(e))return e.atom_;if(Kt(e)){if(t===void 0)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||ae(25,t,Li(e)),r}if(Ur(e)){if(!t)return ae(26);var n=e[ye].values_.get(t);return n||ae(27,t,Li(e)),n}if(bs(e)||Fn(e)||Mi(e))return e}else if(Me(e)&&Mi(e[ye]))return e[ye];ae(28)}function Os(e,t){if(e||ae(29),t!==void 0)return Os(wt(e,t));if(bs(e)||Fn(e)||Mi(e)||Kt(e)||St(e))return e;if(e[ye])return e[ye];ae(24,e)}function Li(e,t){var r;if(t!==void 0)r=wt(e,t);else{if(dr(e))return e.name;Ur(e)||Kt(e)||St(e)?r=Os(e):r=wt(e)}return r.name_}function Br(e){var t=Mr(),r=Gi(!0);gt();try{return e()}finally{bt(),Wi(r),Yt(t)}}var gu=Bn.toString;function Es(e,t,r){return r===void 0&&(r=-1),hs(e,t,r)}function hs(e,t,r,n,i){if(e===t)return e!==0||1/e===1/t;if(e==null||t==null)return!1;if(e!==e)return t!==t;var s=typeof e;if(s!=="function"&&s!=="object"&&typeof t!="object")return!1;var o=gu.call(e);if(o!==gu.call(t))return!1;switch(o){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:+e==0?1/+e===1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return typeof Symbol<"u"&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++;break}e=bu(e),t=bu(t);var a=o==="[object Array]";if(!a){if(typeof e!="object"||typeof t!="object")return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(Me(l)&&l instanceof l&&Me(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(r===0)return!1;r<0&&(r=-1),n=n||[],i=i||[];for(var d=n.length;d--;)if(n[d]===e)return i[d]===t;if(n.push(e),i.push(t),a){if(d=e.length,d!==t.length)return!1;for(;d--;)if(!hs(e[d],t[d],r-1,n,i))return!1}else{var g=Object.keys(e),C=g.length;if(Object.keys(t).length!==C)return!1;for(var S=0;S<C;S++){var x=g[S];if(!(mt(t,x)&&hs(e[x],t[x],r-1,n,i)))return!1}}return n.pop(),i.pop(),!0}function bu(e){return cn(e)?e.slice():on(e)||Kt(e)||Jt(e)||St(e)?Array.from(e.entries()):e}var mu,Fg=((mu=ji().Iterator)==null?void 0:mu.prototype)||{};function Is(e){return e[Symbol.iterator]=Kg,Object.assign(Object.create(Fg),e)}function Kg(){return this}function lc(e){return e instanceof Object&&typeof e.annotationType_=="string"&&Me(e.make_)&&Me(e.extend_)}["Symbol","Map","Set"].forEach(function(e){var t=ji();typeof t[e]>"u"&&ae("MobX requires global '"+e+"' to be available or polyfilled")});typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__=="object"&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:ug,extras:{getDebugName:Li},$mobx:ye});var Vg=Ne({"../../../node_modules/.pnpm/browser-or-node@2.1.1/node_modules/browser-or-node/lib/index.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},r=typeof window<"u"&&typeof window.document<"u",n=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,i=(typeof self>"u"?"undefined":t(self))==="object"&&self.constructor&&self.constructor.name==="DedicatedWorkerGlobalScope",s=typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&(navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),o=typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u";e.isBrowser=r,e.isWebWorker=i,e.isNode=n,e.isJsDom=s,e.isDeno=o}}),qg=Ne({"../../../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 i=typeof n.cycles=="boolean"?n.cycles:!1,s=n.cmp&&function(a){return function(l){return function(c,d){var g={key:c,value:l[c]},C={key:d,value:l[d]};return a(g,C)}}}(n.cmp),o=[];return function a(l){if(l&&l.toJSON&&typeof l.toJSON=="function"&&(l=l.toJSON()),l!==void 0){if(typeof l=="number")return isFinite(l)?""+l:"null";if(typeof l!="object")return JSON.stringify(l);var c,d;if(Array.isArray(l)){for(d="[",c=0;c<l.length;c++)c&&(d+=","),d+=a(l[c])||"null";return d+"]"}if(l===null)return"null";if(o.indexOf(l)!==-1){if(i)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var g=o.push(l)-1,C=Object.keys(l).sort(s&&s(l));for(d="",c=0;c<C.length;c++){var S=C[c],x=a(l[S]);x&&(d&&(d+=","),d+=JSON.stringify(S)+":"+x)}return o.splice(g,1),"{"+d+"}"}}(r)}}}),zg=Ne({"../../../node_modules/.pnpm/safe-stable-stringify@2.5.0/node_modules/safe-stable-stringify/index.js"(e,t){"use strict";var{hasOwnProperty:r}=Object.prototype,n=F();n.configure=F,n.stringify=n,n.default=n,e.stringify=n,e.configure=F,t.exports=n;var i=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function s(j){return j.length<5e3&&!i.test(j)?`"${j}"`:JSON.stringify(j)}function o(j,V){if(j.length>200||V)return j.sort(V);for(let G=1;G<j.length;G++){let k=j[G],Q=G;for(;Q!==0&&j[Q-1]>k;)j[Q]=j[Q-1],Q--;j[Q]=k}return j}var a=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function l(j){return a.call(j)!==void 0&&j.length!==0}function c(j,V,G){j.length<G&&(G=j.length);let k=V===","?"":" ",Q=`"0":${k}${j[0]}`;for(let z=1;z<G;z++)Q+=`${V}"${z}":${k}${j[z]}`;return Q}function d(j){if(r.call(j,"circularValue")){let V=j.circularValue;if(typeof V=="string")return`"${V}"`;if(V==null)return V;if(V===Error||V===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function g(j){let V;if(r.call(j,"deterministic")&&(V=j.deterministic,typeof V!="boolean"&&typeof V!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return V===void 0?!0:V}function C(j,V){let G;if(r.call(j,V)&&(G=j[V],typeof G!="boolean"))throw new TypeError(`The "${V}" argument must be of type boolean`);return G===void 0?!0:G}function S(j,V){let G;if(r.call(j,V)){if(G=j[V],typeof G!="number")throw new TypeError(`The "${V}" argument must be of type number`);if(!Number.isInteger(G))throw new TypeError(`The "${V}" argument must be an integer`);if(G<1)throw new RangeError(`The "${V}" argument must be >= 1`)}return G===void 0?1/0:G}function x(j){return j===1?"1 item":`${j} items`}function K(j){let V=new Set;for(let G of j)(typeof G=="string"||typeof G=="number")&&V.add(String(G));return V}function H(j){if(r.call(j,"strict")){let V=j.strict;if(typeof V!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(V)return G=>{let k=`Object can not safely be stringified. Received type ${typeof G}`;throw typeof G!="function"&&(k+=` (${G.toString()})`),new Error(k)}}}function F(j){j={...j};let V=H(j);V&&(j.bigint===void 0&&(j.bigint=!1),"circularValue"in j||(j.circularValue=Error));let G=d(j),k=C(j,"bigint"),Q=g(j),z=typeof Q=="function"?Q:void 0,ce=S(j,"maximumDepth"),U=S(j,"maximumBreadth");function D(se,B,W,X,fe,f){let _=B[se];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(se)),_=X.call(B,se,_),typeof _){case"string":return s(_);case"object":{if(_===null)return"null";if(W.indexOf(_)!==-1)return G;let E="",M=",",N=f;if(Array.isArray(_)){if(_.length===0)return"[]";if(ce<W.length+1)return'"[Array]"';W.push(_),fe!==""&&(f+=fe,E+=`
|
|
31
31
|
${f}`,M=`,
|
|
32
|
-
${f}`);let A=Math.min(_.length,U),
|
|
33
|
-
${
|
|
34
|
-
${f}`,T=" ");let u=Math.min(y,U);Q&&!l(_)&&(
|
|
35
|
-
${f}${
|
|
36
|
-
${
|
|
32
|
+
${f}`);let A=Math.min(_.length,U),v=0;for(;v<A-1;v++){let P=D(String(v),_,W,X,fe,f);E+=P!==void 0?P:"null",E+=M}let m=D(String(v),_,W,X,fe,f);if(E+=m!==void 0?m:"null",_.length-1>U){let P=_.length-U-1;E+=`${M}"... ${x(P)} not stringified"`}return fe!==""&&(E+=`
|
|
33
|
+
${N}`),W.pop(),`[${E}]`}let R=Object.keys(_),y=R.length;if(y===0)return"{}";if(ce<W.length+1)return'"[Object]"';let T="",w="";fe!==""&&(f+=fe,M=`,
|
|
34
|
+
${f}`,T=" ");let u=Math.min(y,U);Q&&!l(_)&&(R=o(R,z)),W.push(_);for(let A=0;A<u;A++){let v=R[A],m=D(v,_,W,X,fe,f);m!==void 0&&(E+=`${w}${s(v)}:${T}${m}`,w=M)}if(y>U){let A=y-U;E+=`${w}"...":${T}"${x(A)} not stringified"`,w=M}return fe!==""&&w.length>1&&(E=`
|
|
35
|
+
${f}${E}
|
|
36
|
+
${N}`),W.pop(),`{${E}}`}case"number":return isFinite(_)?String(_):V?V(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(_);default:return V?V(_):void 0}}function L(se,B,W,X,fe,f){switch(typeof B=="object"&&B!==null&&typeof B.toJSON=="function"&&(B=B.toJSON(se)),typeof B){case"string":return s(B);case"object":{if(B===null)return"null";if(W.indexOf(B)!==-1)return G;let _=f,E="",M=",";if(Array.isArray(B)){if(B.length===0)return"[]";if(ce<W.length+1)return'"[Array]"';W.push(B),fe!==""&&(f+=fe,E+=`
|
|
37
37
|
${f}`,M=`,
|
|
38
|
-
${f}`);let y=Math.min(B.length,U),T=0;for(;T<y-1;T++){let u=L(String(T),B[T],W,X,fe,f);
|
|
39
|
-
${_}`),W.pop(),`[${
|
|
40
|
-
${f}`,
|
|
41
|
-
${f}${
|
|
42
|
-
${_}`),W.pop(),`{${
|
|
38
|
+
${f}`);let y=Math.min(B.length,U),T=0;for(;T<y-1;T++){let u=L(String(T),B[T],W,X,fe,f);E+=u!==void 0?u:"null",E+=M}let w=L(String(T),B[T],W,X,fe,f);if(E+=w!==void 0?w:"null",B.length-1>U){let u=B.length-U-1;E+=`${M}"... ${x(u)} not stringified"`}return fe!==""&&(E+=`
|
|
39
|
+
${_}`),W.pop(),`[${E}]`}W.push(B);let N="";fe!==""&&(f+=fe,M=`,
|
|
40
|
+
${f}`,N=" ");let R="";for(let y of X){let T=L(y,B[y],W,X,fe,f);T!==void 0&&(E+=`${R}${s(y)}:${N}${T}`,R=M)}return fe!==""&&R.length>1&&(E=`
|
|
41
|
+
${f}${E}
|
|
42
|
+
${_}`),W.pop(),`{${E}}`}case"number":return isFinite(B)?String(B):V?V(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(B);default:return V?V(B):void 0}}function ee(se,B,W,X,fe){switch(typeof B){case"string":return s(B);case"object":{if(B===null)return"null";if(typeof B.toJSON=="function"){if(B=B.toJSON(se),typeof B!="object")return ee(se,B,W,X,fe);if(B===null)return"null"}if(W.indexOf(B)!==-1)return G;let f=fe;if(Array.isArray(B)){if(B.length===0)return"[]";if(ce<W.length+1)return'"[Array]"';W.push(B),fe+=X;let T=`
|
|
43
43
|
${fe}`,w=`,
|
|
44
|
-
${fe}`,u=Math.min(B.length,U),A=0;for(;A<u-1;A++){let
|
|
45
|
-
${f}`,W.pop(),`[${T}]`}let _=Object.keys(B),
|
|
46
|
-
${fe}`,
|
|
47
|
-
${fe}${
|
|
48
|
-
${f}`),W.pop(),`{${C}}`}case"number":return isFinite(B)?String(B):V?V(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(B);default:return V?V(B):void 0}}function ie(se,B,W){switch(typeof B){case"string":return s(B);case"object":{if(B===null)return"null";if(typeof B.toJSON=="function"){if(B=B.toJSON(se),typeof B!="object")return ie(se,B,W);if(B===null)return"null"}if(W.indexOf(B)!==-1)return G;let X="",fe=B.length!==void 0;if(fe&&Array.isArray(B)){if(B.length===0)return"[]";if(ce<W.length+1)return'"[Array]"';W.push(B);let C=Math.min(B.length,U),P=0;for(;P<C-1;P++){let T=ie(String(P),B[P],W);X+=T!==void 0?T:"null",X+=","}let y=ie(String(P),B[P],W);if(X+=y!==void 0?y:"null",B.length-1>U){let T=B.length-U-1;X+=`,"... ${R(T)} not stringified"`}return W.pop(),`[${X}]`}let f=Object.keys(B),_=f.length;if(_===0)return"{}";if(ce<W.length+1)return'"[Object]"';let I="",M=Math.min(_,U);fe&&l(B)&&(X+=c(B,",",U),f=f.slice(B.length),M-=B.length,I=","),Q&&(f=o(f,q)),W.push(B);for(let C=0;C<M;C++){let P=f[C],y=ie(P,B[P],W);y!==void 0&&(X+=`${I}${s(P)}:${y}`,I=",")}if(_>U){let C=_-U;X+=`${I}"...":"${R(C)} not stringified"`}return W.pop(),`{${X}}`}case"number":return isFinite(B)?String(B):V?V(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(B);default:return V?V(B):void 0}}function Y(se,B,W){if(arguments.length>1){let X="";if(typeof W=="number"?X=" ".repeat(Math.min(W,10)):typeof W=="string"&&(X=W.slice(0,10)),B!=null){if(typeof B=="function")return D("",{"":se},[],B,X,"");if(Array.isArray(B))return L("",se,[],K(B),X,"")}if(X.length!==0)return ee("",se,[],X,"")}return ie("",se,[])}return Y}}}),cn=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(k){return c(k)&&Symbol.asyncIterator in k}e.IsAsyncIterator=t;function r(k){return c(k)&&Symbol.iterator in k}e.IsIterator=r;function n(k){return ArrayBuffer.isView(k)}e.IsTypedArray=n;function i(k){return k instanceof Promise}e.IsPromise=i;function s(k){return k instanceof Uint8Array}e.IsUint8Array=s;function o(k){return k instanceof Date&&Number.isFinite(k.getTime())}e.IsDate=o;function a(k,Q){return Q in k}e.HasPropertyKey=a;function l(k){return c(k)&&j(k.constructor)&&k.constructor.name==="Object"}e.IsPlainObject=l;function c(k){return k!==null&&typeof k=="object"}e.IsObject=c;function d(k){return Array.isArray(k)&&!ArrayBuffer.isView(k)}e.IsArray=d;function g(k){return k===void 0}e.IsUndefined=g;function x(k){return k===null}e.IsNull=x;function S(k){return typeof k=="boolean"}e.IsBoolean=S;function R(k){return typeof k=="number"}e.IsNumber=R;function K(k){return R(k)&&Number.isInteger(k)}e.IsInteger=K;function H(k){return typeof k=="bigint"}e.IsBigInt=H;function F(k){return typeof k=="string"}e.IsString=F;function j(k){return typeof k=="function"}e.IsFunction=j;function V(k){return typeof k=="symbol"}e.IsSymbol=V;function G(k){return H(k)||S(k)||x(k)||R(k)||F(k)||V(k)||g(k)}e.IsValueType=G}}),Kc=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=cn(),r=oo(),n=qt(),i=class extends n.TypeBoxError{constructor(d){super(`Duplicate type kind '${d}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends n.TypeBoxError{constructor(d){super(`Duplicate string format '${d}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(d){function g(S,R){if(n.TypeRegistry.Has(S))throw new i(S);return n.TypeRegistry.Set(S,R),(K={})=>n.Type.Unsafe({...K,[n.Kind]:S})}d.Type=g;function x(S,R){if(n.FormatRegistry.Has(S))throw new s(S);return n.FormatRegistry.Set(S,R),S}d.Format=x})(o||(e.TypeSystem=o={}));var a;(function(d){let g=c;function x(){g=c}d.Reset=x;function S(K){g=K}d.Set=S;function R(){return g}d.Get=R})(a||(e.TypeSystemErrorFunction=a={}));var l;(function(d){d.ExactOptionalPropertyTypes=!1,d.AllowArrayObject=!1,d.AllowNaN=!1,d.AllowNullVoid=!1;function g(H,F){return d.ExactOptionalPropertyTypes?F in H:H[F]!==void 0}d.IsExactOptionalProperty=g;function x(H){let F=(0,t.IsObject)(H);return d.AllowArrayObject?F:F&&!(0,t.IsArray)(H)}d.IsObjectLike=x;function S(H){return x(H)&&!(H instanceof Date)&&!(H instanceof Uint8Array)}d.IsRecordLike=S;function R(H){let F=(0,t.IsNumber)(H);return d.AllowNaN?F:F&&Number.isFinite(H)}d.IsNumberLike=R;function K(H){let F=(0,t.IsUndefined)(H);return d.AllowNullVoid?F||H===null:F}d.IsVoidLike=K})(l||(e.TypeSystemPolicy=l={}));function c(d,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${d.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${d.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${d.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${d.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${d.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${d.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${d.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${d.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${d.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${d.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${d.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${d.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${d.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof d.const=="string"?`'${d.const}'`:d.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${d.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${d.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${d.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${d.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${d.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${d.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${d.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${d.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${d.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${d.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${d.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${d.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${d[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),io=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=qt(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,s){let o=s.findIndex(a=>a.$id===i.$ref);if(o===-1)throw new r(i);return s[o]}e.Deref=n}}),$s=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=cn(),r=class extends Error{constructor(D){super("Unable to hash value"),this.value=D}};e.ValueHashError=r;var n;(function(D){D[D.Undefined=0]="Undefined",D[D.Null=1]="Null",D[D.Boolean=2]="Boolean",D[D.Number=3]="Number",D[D.String=4]="String",D[D.Object=5]="Object",D[D.Array=6]="Array",D[D.Date=7]="Date",D[D.Uint8Array=8]="Uint8Array",D[D.Symbol=9]="Symbol",D[D.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((D,L)=>BigInt(L)),l=new Float64Array(1),c=new DataView(l.buffer),d=new Uint8Array(l.buffer);function*g(D){let L=D===0?1:Math.ceil(Math.floor(Math.log2(D)+1)/8);for(let ee=0;ee<L;ee++)yield D>>8*(L-1-ee)&255}function x(D){ce(n.Array);for(let L of D)q(L)}function S(D){ce(n.Boolean),ce(D?1:0)}function R(D){ce(n.BigInt),c.setBigInt64(0,D);for(let L of d)ce(L)}function K(D){ce(n.Date),q(D.getTime())}function H(D){ce(n.Null)}function F(D){ce(n.Number),c.setFloat64(0,D);for(let L of d)ce(L)}function j(D){ce(n.Object);for(let L of globalThis.Object.keys(D).sort())q(L),q(D[L])}function V(D){ce(n.String);for(let L=0;L<D.length;L++)for(let ee of g(D.charCodeAt(L)))ce(ee)}function G(D){ce(n.Symbol),q(D.description)}function k(D){ce(n.Uint8Array);for(let L=0;L<D.length;L++)ce(D[L])}function Q(D){return ce(n.Undefined)}function q(D){if((0,t.IsArray)(D))return x(D);if((0,t.IsBoolean)(D))return S(D);if((0,t.IsBigInt)(D))return R(D);if((0,t.IsDate)(D))return K(D);if((0,t.IsNull)(D))return H(D);if((0,t.IsNumber)(D))return F(D);if((0,t.IsPlainObject)(D))return j(D);if((0,t.IsString)(D))return V(D);if((0,t.IsSymbol)(D))return G(D);if((0,t.IsUint8Array)(D))return k(D);if((0,t.IsUndefined)(D))return Q(D);throw new r(D)}function ce(D){i=i^a[D],i=i*s%o}function U(D){return i=BigInt("14695981039346656037"),q(D),i}e.Hash=U}}),oo=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=cn(),r=Kc(),n=io(),i=$s(),s=qt(),o;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var a=class extends s.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function l(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=l;function c(u){return u!==void 0}var d=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=d;function g(u,A,b,v){return{type:u,schema:A,path:b,value:v,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*x(u,A,b,v){}function*S(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(o.Array,u,b,v);c(u.minItems)&&!(v.length>=u.minItems)&&(yield g(o.ArrayMinItems,u,b,v)),c(u.maxItems)&&!(v.length<=u.maxItems)&&(yield g(o.ArrayMaxItems,u,b,v));for(let te=0;te<v.length;te++)yield*T(u.items,A,`${b}/${te}`,v[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let re of v){let pe=(0,i.Hash)(re);if(te.has(pe))return!1;te.add(pe)}return!0}()&&(yield g(o.ArrayUniqueItems,u,b,v)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let $=c(u.contains)?u.contains:s.Type.Never(),z=v.reduce((te,re,pe)=>T($,A,`${b}${pe}`,re).next().done===!0?te+1:te,0);z===0&&(yield g(o.ArrayContains,u,b,v)),(0,t.IsNumber)(u.minContains)&&z<u.minContains&&(yield g(o.ArrayMinContains,u,b,v)),(0,t.IsNumber)(u.maxContains)&&z>u.maxContains&&(yield g(o.ArrayMaxContains,u,b,v))}function*R(u,A,b,v){(0,t.IsAsyncIterator)(v)||(yield g(o.AsyncIterator,u,b,v))}function*K(u,A,b,v){if(!(0,t.IsBigInt)(v))return yield g(o.BigInt,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.BigIntExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.BigIntExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.BigIntMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.BigIntMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==BigInt(0)&&(yield g(o.BigIntMultipleOf,u,b,v))}function*H(u,A,b,v){(0,t.IsBoolean)(v)||(yield g(o.Boolean,u,b,v))}function*F(u,A,b,v){yield*T(u.returns,A,b,v.prototype)}function*j(u,A,b,v){if(!(0,t.IsDate)(v))return yield g(o.Date,u,b,v);c(u.exclusiveMaximumTimestamp)&&!(v.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(o.DateExclusiveMaximumTimestamp,u,b,v)),c(u.exclusiveMinimumTimestamp)&&!(v.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(o.DateExclusiveMinimumTimestamp,u,b,v)),c(u.maximumTimestamp)&&!(v.getTime()<=u.maximumTimestamp)&&(yield g(o.DateMaximumTimestamp,u,b,v)),c(u.minimumTimestamp)&&!(v.getTime()>=u.minimumTimestamp)&&(yield g(o.DateMinimumTimestamp,u,b,v)),c(u.multipleOfTimestamp)&&v.getTime()%u.multipleOfTimestamp!==0&&(yield g(o.DateMultipleOfTimestamp,u,b,v))}function*V(u,A,b,v){(0,t.IsFunction)(v)||(yield g(o.Function,u,b,v))}function*G(u,A,b,v){if(!(0,t.IsInteger)(v))return yield g(o.Integer,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.IntegerExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.IntegerExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.IntegerMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.IntegerMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(o.IntegerMultipleOf,u,b,v))}function*k(u,A,b,v){for(let $ of u.allOf){let z=T($,A,b,v).next();z.done||(yield g(o.Intersect,u,b,v),yield z.value)}if(u.unevaluatedProperties===!1){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let z of Object.getOwnPropertyNames(v))$.test(z)||(yield g(o.IntersectUnevaluatedProperties,u,`${b}/${z}`,v))}if(typeof u.unevaluatedProperties=="object"){let $=new RegExp(s.KeyResolver.ResolvePattern(u));for(let z of Object.getOwnPropertyNames(v))if(!$.test(z)){let te=T(u.unevaluatedProperties,A,`${b}/${z}`,v[z]).next();te.done||(yield te.value)}}}function*Q(u,A,b,v){(0,t.IsIterator)(v)||(yield g(o.Iterator,u,b,v))}function*q(u,A,b,v){v!==u.const&&(yield g(o.Literal,u,b,v))}function*ce(u,A,b,v){yield g(o.Never,u,b,v)}function*U(u,A,b,v){T(u.not,A,b,v).next().done===!0&&(yield g(o.Not,u,b,v))}function*D(u,A,b,v){(0,t.IsNull)(v)||(yield g(o.Null,u,b,v))}function*L(u,A,b,v){if(!r.TypeSystemPolicy.IsNumberLike(v))return yield g(o.Number,u,b,v);c(u.exclusiveMaximum)&&!(v<u.exclusiveMaximum)&&(yield g(o.NumberExclusiveMaximum,u,b,v)),c(u.exclusiveMinimum)&&!(v>u.exclusiveMinimum)&&(yield g(o.NumberExclusiveMinimum,u,b,v)),c(u.maximum)&&!(v<=u.maximum)&&(yield g(o.NumberMaximum,u,b,v)),c(u.minimum)&&!(v>=u.minimum)&&(yield g(o.NumberMinimum,u,b,v)),c(u.multipleOf)&&v%u.multipleOf!==0&&(yield g(o.NumberMultipleOf,u,b,v))}function*ee(u,A,b,v){if(!r.TypeSystemPolicy.IsObjectLike(v))return yield g(o.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,b,v));let $=Array.isArray(u.required)?u.required:[],z=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(v);for(let re of $)te.includes(re)||(yield g(o.ObjectRequiredProperty,u.properties[re],`${b}/${l(re)}`,void 0));if(u.additionalProperties===!1)for(let re of te)z.includes(re)||(yield g(o.ObjectAdditionalProperties,u,`${b}/${l(re)}`,v[re]));if(typeof u.additionalProperties=="object")for(let re of te)z.includes(re)||(yield*T(u.additionalProperties,A,`${b}/${l(re)}`,v[re]));for(let re of z){let pe=u.properties[re];u.required&&u.required.includes(re)?(yield*T(pe,A,`${b}/${l(re)}`,v[re]),s.ExtendsUndefined.Check(u)&&!(re in v)&&(yield g(o.ObjectRequiredProperty,pe,`${b}/${l(re)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(v,re)&&(yield*T(pe,A,`${b}/${l(re)}`,v[re]))}}function*ie(u,A,b,v){(0,t.IsPromise)(v)||(yield g(o.Promise,u,b,v))}function*Y(u,A,b,v){if(!r.TypeSystemPolicy.IsRecordLike(v))return yield g(o.Object,u,b,v);c(u.minProperties)&&!(Object.getOwnPropertyNames(v).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,b,v)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(v).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,b,v));let[$,z]=Object.entries(u.patternProperties)[0],te=new RegExp($);for(let[re,pe]of Object.entries(v))te.test(re)&&(yield*T(z,A,`${b}/${l(re)}`,pe));if(typeof u.additionalProperties=="object")for(let[re,pe]of Object.entries(v))te.test(re)||(yield*T(u.additionalProperties,A,`${b}/${l(re)}`,pe));if(u.additionalProperties===!1){for(let[re,pe]of Object.entries(v))if(!te.test(re))return yield g(o.ObjectAdditionalProperties,u,`${b}/${l(re)}`,pe)}}function*se(u,A,b,v){yield*T((0,n.Deref)(u,A),A,b,v)}function*B(u,A,b,v){if(!(0,t.IsString)(v))return yield g(o.String,u,b,v);c(u.minLength)&&!(v.length>=u.minLength)&&(yield g(o.StringMinLength,u,b,v)),c(u.maxLength)&&!(v.length<=u.maxLength)&&(yield g(o.StringMaxLength,u,b,v)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(v)||(yield g(o.StringPattern,u,b,v))),(0,t.IsString)(u.format)&&(s.FormatRegistry.Has(u.format)?s.FormatRegistry.Get(u.format)(v)||(yield g(o.StringFormat,u,b,v)):yield g(o.StringFormatUnknown,u,b,v))}function*W(u,A,b,v){(0,t.IsSymbol)(v)||(yield g(o.Symbol,u,b,v))}function*X(u,A,b,v){if(!(0,t.IsString)(v))return yield g(o.String,u,b,v);new RegExp(u.pattern).test(v)||(yield g(o.StringPattern,u,b,v))}function*fe(u,A,b,v){yield*T((0,n.Deref)(u,A),A,b,v)}function*f(u,A,b,v){if(!(0,t.IsArray)(v))return yield g(o.Tuple,u,b,v);if(u.items===void 0&&v.length!==0)return yield g(o.TupleLength,u,b,v);if(v.length!==u.maxItems)return yield g(o.TupleLength,u,b,v);if(u.items)for(let $=0;$<u.items.length;$++)yield*T(u.items[$],A,`${b}/${$}`,v[$])}function*_(u,A,b,v){(0,t.IsUndefined)(v)||(yield g(o.Undefined,u,b,v))}function*I(u,A,b,v){let $=0;for(let z of u.anyOf){let te=[...T(z,A,b,v)];if(te.length===0)return;$+=te.length}$>0&&(yield g(o.Union,u,b,v))}function*M(u,A,b,v){if(!(0,t.IsUint8Array)(v))return yield g(o.Uint8Array,u,b,v);c(u.maxByteLength)&&!(v.length<=u.maxByteLength)&&(yield g(o.Uint8ArrayMaxByteLength,u,b,v)),c(u.minByteLength)&&!(v.length>=u.minByteLength)&&(yield g(o.Uint8ArrayMinByteLength,u,b,v))}function*C(u,A,b,v){}function*P(u,A,b,v){r.TypeSystemPolicy.IsVoidLike(v)||(yield g(o.Void,u,b,v))}function*y(u,A,b,v){s.TypeRegistry.Get(u[s.Kind])(u,v)||(yield g(o.Kind,u,b,v))}function*T(u,A,b,v){let $=c(u.$id)?[...A,u]:A,z=u;switch(z[s.Kind]){case"Any":return yield*x(z,$,b,v);case"Array":return yield*S(z,$,b,v);case"AsyncIterator":return yield*R(z,$,b,v);case"BigInt":return yield*K(z,$,b,v);case"Boolean":return yield*H(z,$,b,v);case"Constructor":return yield*F(z,$,b,v);case"Date":return yield*j(z,$,b,v);case"Function":return yield*V(z,$,b,v);case"Integer":return yield*G(z,$,b,v);case"Intersect":return yield*k(z,$,b,v);case"Iterator":return yield*Q(z,$,b,v);case"Literal":return yield*q(z,$,b,v);case"Never":return yield*ce(z,$,b,v);case"Not":return yield*U(z,$,b,v);case"Null":return yield*D(z,$,b,v);case"Number":return yield*L(z,$,b,v);case"Object":return yield*ee(z,$,b,v);case"Promise":return yield*ie(z,$,b,v);case"Record":return yield*Y(z,$,b,v);case"Ref":return yield*se(z,$,b,v);case"String":return yield*B(z,$,b,v);case"Symbol":return yield*W(z,$,b,v);case"TemplateLiteral":return yield*X(z,$,b,v);case"This":return yield*fe(z,$,b,v);case"Tuple":return yield*f(z,$,b,v);case"Undefined":return yield*_(z,$,b,v);case"Union":return yield*I(z,$,b,v);case"Uint8Array":return yield*M(z,$,b,v);case"Unknown":return yield*C(z,$,b,v);case"Void":return yield*P(z,$,b,v);default:if(!s.TypeRegistry.Has(z[s.Kind]))throw new a(u);return yield*y(z,$,b,v)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new d(A)}e.Errors=w}}),ch=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(oo(),e)}}),Vc=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,l)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=oo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(Kc(),e)}}),lh=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=cn(),r=Vc(),n=io(),i=$s(),s=qt(),o=class extends s.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=o;function a(y){return y[s.Kind]==="Any"||y[s.Kind]==="Unknown"}function l(y){return y!==void 0}function c(y,T,w){return!0}function d(y,T,w){if(!(0,t.IsArray)(w)||l(y.minItems)&&!(w.length>=y.minItems)||l(y.maxItems)&&!(w.length<=y.maxItems)||!w.every(b=>C(y.items,T,b))||y.uniqueItems===!0&&!function(){let b=new Set;for(let v of w){let $=(0,i.Hash)(v);if(b.has($))return!1;b.add($)}return!0}())return!1;if(!(l(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let u=l(y.contains)?y.contains:s.Type.Never(),A=w.reduce((b,v)=>C(u,T,v)?b+1:b,0);return!(A===0||(0,t.IsNumber)(y.minContains)&&A<y.minContains||(0,t.IsNumber)(y.maxContains)&&A>y.maxContains)}function g(y,T,w){return(0,t.IsAsyncIterator)(w)}function x(y,T,w){return!(!(0,t.IsBigInt)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==BigInt(0))}function S(y,T,w){return(0,t.IsBoolean)(w)}function R(y,T,w){return C(y.returns,T,w.prototype)}function K(y,T,w){return!(!(0,t.IsDate)(w)||l(y.exclusiveMaximumTimestamp)&&!(w.getTime()<y.exclusiveMaximumTimestamp)||l(y.exclusiveMinimumTimestamp)&&!(w.getTime()>y.exclusiveMinimumTimestamp)||l(y.maximumTimestamp)&&!(w.getTime()<=y.maximumTimestamp)||l(y.minimumTimestamp)&&!(w.getTime()>=y.minimumTimestamp)||l(y.multipleOfTimestamp)&&w.getTime()%y.multipleOfTimestamp!==0)}function H(y,T,w){return(0,t.IsFunction)(w)}function F(y,T,w){return!(!(0,t.IsInteger)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function j(y,T,w){let u=y.allOf.every(A=>C(A,T,w));if(y.unevaluatedProperties===!1){let A=new RegExp(s.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v));return u&&b}else if(s.TypeGuard.TSchema(y.unevaluatedProperties)){let A=new RegExp(s.KeyResolver.ResolvePattern(y)),b=Object.getOwnPropertyNames(w).every(v=>A.test(v)||C(y.unevaluatedProperties,T,w[v]));return u&&b}else return u}function V(y,T,w){return(0,t.IsIterator)(w)}function G(y,T,w){return w===y.const}function k(y,T,w){return!1}function Q(y,T,w){return!C(y.not,T,w)}function q(y,T,w){return(0,t.IsNull)(w)}function ce(y,T,w){return!(!r.TypeSystemPolicy.IsNumberLike(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.minimum)&&!(w>=y.minimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function U(y,T,w){if(!r.TypeSystemPolicy.IsObjectLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let u=Object.getOwnPropertyNames(y.properties);for(let A of u){let b=y.properties[A];if(y.required&&y.required.includes(A)){if(!C(b,T,w[A])||(s.ExtendsUndefined.Check(b)||a(b))&&!(A in w))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!C(b,T,w[A]))return!1}if(y.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return y.required&&y.required.length===u.length&&A.length===u.length?!0:A.every(b=>u.includes(b))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(b=>u.includes(b)||C(y.additionalProperties,T,w[b])):!0}function D(y,T,w){return(0,t.IsPromise)(w)}function L(y,T,w){if(!r.TypeSystemPolicy.IsRecordLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let[u,A]=Object.entries(y.patternProperties)[0],b=new RegExp(u),v=Object.entries(w).every(([te,re])=>b.test(te)?C(A,T,re):!0),$=typeof y.additionalProperties=="object"?Object.entries(w).every(([te,re])=>b.test(te)?!0:C(y.additionalProperties,T,re)):!0,z=y.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>b.test(te)):!0;return v&&$&&z}function ee(y,T,w){return C((0,n.Deref)(y,T),T,w)}function ie(y,T,w){return!(0,t.IsString)(w)||l(y.minLength)&&!(w.length>=y.minLength)||l(y.maxLength)&&!(w.length<=y.maxLength)||l(y.pattern)&&!new RegExp(y.pattern).test(w)?!1:l(y.format)?s.FormatRegistry.Has(y.format)?s.FormatRegistry.Get(y.format)(w):!1:!0}function Y(y,T,w){return(0,t.IsSymbol)(w)}function se(y,T,w){return(0,t.IsString)(w)&&new RegExp(y.pattern).test(w)}function B(y,T,w){return C((0,n.Deref)(y,T),T,w)}function W(y,T,w){if(!(0,t.IsArray)(w)||y.items===void 0&&w.length!==0||w.length!==y.maxItems)return!1;if(!y.items)return!0;for(let u=0;u<y.items.length;u++)if(!C(y.items[u],T,w[u]))return!1;return!0}function X(y,T,w){return(0,t.IsUndefined)(w)}function fe(y,T,w){return y.anyOf.some(u=>C(u,T,w))}function f(y,T,w){return!(!(0,t.IsUint8Array)(w)||l(y.maxByteLength)&&!(w.length<=y.maxByteLength)||l(y.minByteLength)&&!(w.length>=y.minByteLength))}function _(y,T,w){return!0}function I(y,T,w){return r.TypeSystemPolicy.IsVoidLike(w)}function M(y,T,w){return s.TypeRegistry.Has(y[s.Kind])?s.TypeRegistry.Get(y[s.Kind])(y,w):!1}function C(y,T,w){let u=l(y.$id)?[...T,y]:T,A=y;switch(A[s.Kind]){case"Any":return c(A,u,w);case"Array":return d(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return x(A,u,w);case"Boolean":return S(A,u,w);case"Constructor":return R(A,u,w);case"Date":return K(A,u,w);case"Function":return H(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return j(A,u,w);case"Iterator":return V(A,u,w);case"Literal":return G(A,u,w);case"Never":return k(A,u,w);case"Not":return Q(A,u,w);case"Null":return q(A,u,w);case"Number":return ce(A,u,w);case"Object":return U(A,u,w);case"Promise":return D(A,u,w);case"Record":return L(A,u,w);case"Ref":return ee(A,u,w);case"String":return ie(A,u,w);case"Symbol":return Y(A,u,w);case"TemplateLiteral":return se(A,u,w);case"This":return B(A,u,w);case"Tuple":return W(A,u,w);case"Undefined":return X(A,u,w);case"Union":return fe(A,u,w);case"Uint8Array":return f(A,u,w);case"Unknown":return _(A,u,w);case"Void":return I(A,u,w);default:if(!s.TypeRegistry.Has(A[s.Kind]))throw new o(A);return M(A,u,w)}}function P(...y){return y.length===3?C(y[0],y[1],y[2]):C(y[0],[],y[1])}e.Check=P}}),fh=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=cn(),r=io(),n=lh(),i=qt(),s=class extends i.TypeBoxError{constructor(x,S,R){super("Unable to decode due to invalid value"),this.schema=x,this.value=S,this.error=R}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(x,S,R){super("Unable to encode due to invalid value"),this.schema=x,this.value=S,this.error=R}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(x,S,R){super(`${R instanceof Error?R.message:"Unknown error"}`),this.schema=x,this.value=S}};e.TransformDecodeError=a;var l=class extends i.TypeBoxError{constructor(x,S,R){super(`${R instanceof Error?R.message:"Unknown error"}`),this.schema=x,this.value=S}};e.TransformEncodeError=l;var c;(function(x){function S(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function R(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function K(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.returns,se)||Y.parameters.some(B=>L(B,se))}function H(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.returns,se)||Y.parameters.some(B=>L(B,se))}function F(Y,se){return i.TypeGuard.TTransform(Y)||i.TypeGuard.TTransform(Y.unevaluatedProperties)||Y.allOf.some(B=>L(B,se))}function j(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function V(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.not,se)}function G(Y,se){return i.TypeGuard.TTransform(Y)||Object.values(Y.properties).some(B=>L(B,se))||i.TypeGuard.TSchema(Y.additionalProperties)&&L(Y.additionalProperties,se)}function k(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.item,se)}function Q(Y,se){let B=Object.getOwnPropertyNames(Y.patternProperties)[0],W=Y.patternProperties[B];return i.TypeGuard.TTransform(Y)||L(W,se)||i.TypeGuard.TSchema(Y.additionalProperties)&&i.TypeGuard.TTransform(Y.additionalProperties)}function q(Y,se){return i.TypeGuard.TTransform(Y)?!0:L((0,r.Deref)(Y,se),se)}function ce(Y,se){return i.TypeGuard.TTransform(Y)?!0:L((0,r.Deref)(Y,se),se)}function U(Y,se){return i.TypeGuard.TTransform(Y)||!(0,t.IsUndefined)(Y.items)&&Y.items.some(B=>L(B,se))}function D(Y,se){return i.TypeGuard.TTransform(Y)||Y.anyOf.some(B=>L(B,se))}function L(Y,se){let B=(0,t.IsString)(Y.$id)?[...se,Y]:se,W=Y;if(Y.$id&&ee.has(Y.$id))return!1;switch(Y.$id&&ee.add(Y.$id),Y[i.Kind]){case"Array":return S(W,B);case"AsyncIterator":return R(W,B);case"Constructor":return K(W,B);case"Function":return H(W,B);case"Intersect":return F(W,B);case"Iterator":return j(W,B);case"Not":return V(W,B);case"Object":return G(W,B);case"Promise":return k(W,B);case"Record":return Q(W,B);case"Ref":return q(W,B);case"This":return ce(W,B);case"Tuple":return U(W,B);case"Union":return D(W,B);default:return i.TypeGuard.TTransform(Y)}}let ee=new Set;function ie(Y,se){return ee.clear(),L(Y,se)}x.Has=ie})(c||(e.HasTransform=c={}));var d;(function(x){function S(U,D){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Decode(D):D}catch(L){throw new a(U,D,L)}}function R(U,D,L){return(0,t.IsArray)(L)?S(U,L.map(ee=>q(U.items,D,ee))):S(U,L)}function K(U,D,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return S(U,L);let ee=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),ie=ee.reduce((W,X)=>X in W?{...W,[X]:q(i.IndexedAccessor.Resolve(U,[X]),D,W[X])}:W,L);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return S(U,ie);let Y=Object.getOwnPropertyNames(ie),se=U.unevaluatedProperties,B=Y.reduce((W,X)=>ee.includes(X)?W:{...W,[X]:S(se,W[X])},ie);return S(U,B)}function H(U,D,L){return S(U,q(U.not,D,L))}function F(U,D,L){if(!(0,t.IsPlainObject)(L))return S(U,L);let ee=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),ie=ee.reduce((W,X)=>X in W?{...W,[X]:q(U.properties[X],D,W[X])}:W,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,ie);let Y=Object.getOwnPropertyNames(ie),se=U.additionalProperties,B=Y.reduce((W,X)=>ee.includes(X)?W:{...W,[X]:S(se,W[X])},ie);return S(U,B)}function j(U,D,L){if(!(0,t.IsPlainObject)(L))return S(U,L);let ee=Object.getOwnPropertyNames(U.patternProperties)[0],ie=new RegExp(ee),Y=Object.getOwnPropertyNames(L).reduce((X,fe)=>ie.test(fe)?{...X,[fe]:q(U.patternProperties[ee],D,X[fe])}:X,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,Y);let se=Object.getOwnPropertyNames(Y),B=U.additionalProperties,W=se.reduce((X,fe)=>ie.test(fe)?X:{...X,[fe]:S(B,X[fe])},Y);return S(U,W)}function V(U,D,L){let ee=(0,r.Deref)(U,D);return S(U,q(ee,D,L))}function G(U,D,L){let ee=(0,r.Deref)(U,D);return S(U,q(ee,D,L))}function k(U,D,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(U.items)?S(U,U.items.map((ee,ie)=>q(ee,D,L[ie]))):S(U,L)}function Q(U,D,L){let ee=S(U,L);for(let ie of U.anyOf)if((0,n.Check)(ie,D,ee))return q(ie,D,ee);return ee}function q(U,D,L){let ee=typeof U.$id=="string"?[...D,U]:D,ie=U;switch(U[i.Kind]){case"Array":return R(ie,ee,L);case"Intersect":return K(ie,ee,L);case"Not":return H(ie,ee,L);case"Object":return F(ie,ee,L);case"Record":return j(ie,ee,L);case"Ref":return V(ie,ee,L);case"Symbol":return S(ie,L);case"This":return G(ie,ee,L);case"Tuple":return k(ie,ee,L);case"Union":return Q(ie,ee,L);default:return S(ie,L)}}function ce(U,D,L){return q(U,D,L)}x.Decode=ce})(d||(e.DecodeTransform=d={}));var g;(function(x){function S(U,D){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Encode(D):D}catch(L){throw new l(U,D,L)}}function R(U,D,L){let ee=S(U,L);return(0,t.IsArray)(ee)?ee.map(ie=>q(U.items,D,ie)):ee}function K(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return ee;let ie=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Y=ie.reduce((W,X)=>X in ee?{...W,[X]:q(i.IndexedAccessor.Resolve(U,[X]),D,W[X])}:W,ee);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return S(U,Y);let se=Object.getOwnPropertyNames(Y),B=U.unevaluatedProperties;return se.reduce((W,X)=>ie.includes(X)?W:{...W,[X]:S(B,W[X])},Y)}function H(U,D,L){return S(U.not,S(U,L))}function F(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L))return ee;let ie=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Y=ie.reduce((W,X)=>X in W?{...W,[X]:q(U.properties[X],D,W[X])}:W,ee);if(!i.TypeGuard.TSchema(U.additionalProperties))return Y;let se=Object.getOwnPropertyNames(Y),B=U.additionalProperties;return se.reduce((W,X)=>ie.includes(X)?W:{...W,[X]:S(B,W[X])},Y)}function j(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L))return ee;let ie=Object.getOwnPropertyNames(U.patternProperties)[0],Y=new RegExp(ie),se=Object.getOwnPropertyNames(L).reduce((X,fe)=>Y.test(fe)?{...X,[fe]:q(U.patternProperties[ie],D,X[fe])}:X,ee);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,se);let B=Object.getOwnPropertyNames(se),W=U.additionalProperties;return B.reduce((X,fe)=>Y.test(fe)?X:{...X,[fe]:S(W,X[fe])},se)}function V(U,D,L){let ee=(0,r.Deref)(U,D),ie=q(ee,D,L);return S(U,ie)}function G(U,D,L){let ee=(0,r.Deref)(U,D),ie=q(ee,D,L);return S(U,ie)}function k(U,D,L){let ee=S(U,L);return(0,t.IsArray)(U.items)?U.items.map((ie,Y)=>q(ie,D,ee[Y])):[]}function Q(U,D,L){for(let ee of U.anyOf){if(!(0,n.Check)(ee,D,L))continue;let ie=q(ee,D,L);return S(U,ie)}for(let ee of U.anyOf){let ie=q(ee,D,L);if((0,n.Check)(U,D,ie))return S(U,ie)}return S(U,L)}function q(U,D,L){let ee=typeof U.$id=="string"?[...D,U]:D,ie=U;switch(U[i.Kind]){case"Array":return R(ie,ee,L);case"Intersect":return K(ie,ee,L);case"Not":return H(ie,ee,L);case"Object":return F(ie,ee,L);case"Record":return j(ie,ee,L);case"Ref":return V(ie,ee,L);case"This":return G(ie,ee,L);case"Tuple":return k(ie,ee,L);case"Union":return Q(ie,ee,L);default:return S(ie,L)}}function ce(U,D,L){return q(U,D,L)}x.Encode=ce})(g||(e.EncodeTransform=g={}))}}),dh=Ce({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=fh(),r=cn(),n=oo(),i=Vc(),s=io(),o=$s(),a=qt(),l=class{constructor(F,j,V,G){this.schema=F,this.references=j,this.checkFunc=V,this.code=G,this.hasTransform=t.HasTransform.Has(F,j)}Code(){return this.code}Errors(F){return(0,n.Errors)(this.schema,this.references,F)}Check(F){return this.checkFunc(F)}Decode(F){if(!this.checkFunc(F))throw new t.TransformDecodeCheckError(this.schema,F,this.Errors(F).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,F):F}Encode(F){let j=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(j))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return j}};e.TypeCheck=l;var c;(function(F){function j(Q){return Q===36}F.DollarSign=j;function V(Q){return Q===95}F.IsUnderscore=V;function G(Q){return Q>=65&&Q<=90||Q>=97&&Q<=122}F.IsAlpha=G;function k(Q){return Q>=48&&Q<=57}F.IsNumeric=k})(c||(c={}));var d;(function(F){function j(Q){return Q.length===0?!1:c.IsNumeric(Q.charCodeAt(0))}function V(Q){if(j(Q))return!1;for(let q=0;q<Q.length;q++){let ce=Q.charCodeAt(q);if(!(c.IsAlpha(ce)||c.IsNumeric(ce)||c.DollarSign(ce)||c.IsUnderscore(ce)))return!1}return!0}function G(Q){return Q.replace(/'/g,"\\'")}function k(Q,q){return V(q)?`${Q}.${q}`:`${Q}['${G(q)}']`}F.Encode=k})(d||(d={}));var g;(function(F){function j(V){let G=[];for(let k=0;k<V.length;k++){let Q=V.charCodeAt(k);c.IsNumeric(Q)||c.IsAlpha(Q)?G.push(V.charAt(k)):G.push(`_${Q}_`)}return G.join("").replace(/__/g,"_")}F.Encode=j})(g||(g={}));var x;(function(F){function j(V){return V.replace(/'/g,"\\'")}F.Escape=j})(x||(x={}));var S=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=S;var R=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=R;var K;(function(F){function j(q,ce,U){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${ce}' in ${q} ? ${U} : true)`:`(${d.Encode(q,ce)} !== undefined ? ${U} : true)`}F.IsExactOptionalProperty=j;function V(q){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${q} === 'object' && ${q} !== null)`:`(typeof ${q} === 'object' && ${q} !== null && !Array.isArray(${q}))`}F.IsObjectLike=V;function G(q){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${q} === 'object' && ${q} !== null && !(${q} instanceof Date) && !(${q} instanceof Uint8Array))`:`(typeof ${q} === 'object' && ${q} !== null && !Array.isArray(${q}) && !(${q} instanceof Date) && !(${q} instanceof Uint8Array))`}F.IsRecordLike=G;function k(q){return i.TypeSystemPolicy.AllowNaN?`typeof ${q} === 'number'`:`(typeof ${q} === 'number' && Number.isFinite(${q}))`}F.IsNumberLike=k;function Q(q){return i.TypeSystemPolicy.AllowNullVoid?`(${q} === undefined || ${q} === null)`:`${q} === undefined`}F.IsVoidLike=Q})(K||(e.Policy=K={}));var H;(function(F){function j(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*V(O,ue,N){yield"true"}function*G(O,ue,N){yield`Array.isArray(${N})`;let[he,ne]=[De("value","any"),De("acc","number")];(0,r.IsNumber)(O.maxItems)&&(yield`${N}.length <= ${O.maxItems}`),(0,r.IsNumber)(O.minItems)&&(yield`${N}.length >= ${O.minItems}`);let le=re(O.items,ue,"value");if(yield`${N}.every((${he}) => ${le})`,a.TypeGuard.TSchema(O.contains)||(0,r.IsNumber)(O.minContains)||(0,r.IsNumber)(O.maxContains)){let Ae=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),Ue=re(Ae,ue,"value"),Ye=(0,r.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],He=(0,r.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],Ze=`const count = value.reduce((${ne}, ${he}) => ${Ue} ? acc + 1 : acc, 0)`,zt=["(count > 0)",...Ye,...He].join(" && ");yield`((${he}) => { ${Ze}; return ${zt}})(${N})`}O.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${N})`)}function*k(O,ue,N){yield`(typeof value === 'object' && Symbol.asyncIterator in ${N})`}function*Q(O,ue,N){yield`(typeof ${N} === 'bigint')`,(0,r.IsBigInt)(O.exclusiveMaximum)&&(yield`${N} < BigInt(${O.exclusiveMaximum})`),(0,r.IsBigInt)(O.exclusiveMinimum)&&(yield`${N} > BigInt(${O.exclusiveMinimum})`),(0,r.IsBigInt)(O.maximum)&&(yield`${N} <= BigInt(${O.maximum})`),(0,r.IsBigInt)(O.minimum)&&(yield`${N} >= BigInt(${O.minimum})`),(0,r.IsBigInt)(O.multipleOf)&&(yield`(${N} % BigInt(${O.multipleOf})) === 0`)}function*q(O,ue,N){yield`(typeof ${N} === 'boolean')`}function*ce(O,ue,N){yield*z(O.returns,ue,`${N}.prototype`)}function*U(O,ue,N){yield`(${N} instanceof Date) && Number.isFinite(${N}.getTime())`,(0,r.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${N}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${N}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(O.maximumTimestamp)&&(yield`${N}.getTime() <= ${O.maximumTimestamp}`),(0,r.IsNumber)(O.minimumTimestamp)&&(yield`${N}.getTime() >= ${O.minimumTimestamp}`),(0,r.IsNumber)(O.multipleOfTimestamp)&&(yield`(${N}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*D(O,ue,N){yield`(typeof ${N} === 'function')`}function*L(O,ue,N){yield`(typeof ${N} === 'number' && Number.isInteger(${N}))`,(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*ee(O,ue,N){let he=O.allOf.map(ne=>re(ne,ue,N)).join(" && ");if(O.unevaluatedProperties===!1){let ne=ge(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),le=`Object.getOwnPropertyNames(${N}).every(key => ${ne}.test(key))`;yield`(${he} && ${le})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let ne=ge(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),le=`Object.getOwnPropertyNames(${N}).every(key => ${ne}.test(key) || ${re(O.unevaluatedProperties,ue,`${N}[key]`)})`;yield`(${he} && ${le})`}else yield`(${he})`}function*ie(O,ue,N){yield`(typeof value === 'object' && Symbol.iterator in ${N})`}function*Y(O,ue,N){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${N} === ${O.const})`:yield`(${N} === '${x.Escape(O.const)}')`}function*se(O,ue,N){yield"false"}function*B(O,ue,N){yield`(!${re(O.not,ue,N)})`}function*W(O,ue,N){yield`(${N} === null)`}function*X(O,ue,N){yield K.IsNumberLike(N),(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${N} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${N} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${N} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${N} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${N} % ${O.multipleOf}) === 0`)}function*fe(O,ue,N){yield K.IsObjectLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let he=Object.getOwnPropertyNames(O.properties);for(let ne of he){let le=d.Encode(N,ne),Ae=O.properties[ne];if(O.required&&O.required.includes(ne))yield*z(Ae,ue,le),(a.ExtendsUndefined.Check(Ae)||j(Ae))&&(yield`('${ne}' in ${N})`);else{let Ue=re(Ae,ue,le);yield K.IsExactOptionalProperty(N,ne,Ue)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===he.length)yield`Object.getOwnPropertyNames(${N}).length === ${he.length}`;else{let ne=`[${he.map(le=>`'${le}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${N}).every(key => ${ne}.includes(key))`}if(typeof O.additionalProperties=="object"){let ne=re(O.additionalProperties,ue,`${N}[key]`),le=`[${he.map(Ae=>`'${Ae}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${N}).every(key => ${le}.includes(key) || ${ne}))`}}function*f(O,ue,N){yield`(typeof value === 'object' && typeof ${N}.then === 'function')`}function*_(O,ue,N){yield K.IsRecordLike(N),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${N}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${N}).length <= ${O.maxProperties}`);let[he,ne]=Object.entries(O.patternProperties)[0],le=ge(`${new RegExp(he)}`),Ae=re(ne,ue,"value"),Ue=a.TypeGuard.TSchema(O.additionalProperties)?re(O.additionalProperties,ue,N):O.additionalProperties===!1?"false":"true",Ye=`(${le}.test(key) ? ${Ae} : ${Ue})`;yield`(Object.entries(${N}).every(([key, value]) => ${Ye}))`}function*I(O,ue,N){let he=(0,s.Deref)(O,ue);if(te.functions.has(O.$ref))return yield`${pe(O.$ref)}(${N})`;yield*z(he,ue,N)}function*M(O,ue,N){yield`(typeof ${N} === 'string')`,(0,r.IsNumber)(O.maxLength)&&(yield`${N}.length <= ${O.maxLength}`),(0,r.IsNumber)(O.minLength)&&(yield`${N}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${ge(`${new RegExp(O.pattern)};`)}.test(${N})`),O.format!==void 0&&(yield`format('${O.format}', ${N})`)}function*C(O,ue,N){yield`(typeof ${N} === 'symbol')`}function*P(O,ue,N){yield`(typeof ${N} === 'string')`,yield`${ge(`${new RegExp(O.pattern)};`)}.test(${N})`}function*y(O,ue,N){yield`${pe(O.$ref)}(${N})`}function*T(O,ue,N){if(yield`Array.isArray(${N})`,O.items===void 0)return yield`${N}.length === 0`;yield`(${N}.length === ${O.maxItems})`;for(let he=0;he<O.items.length;he++)yield`${re(O.items[he],ue,`${N}[${he}]`)}`}function*w(O,ue,N){yield`${N} === undefined`}function*u(O,ue,N){yield`(${O.anyOf.map(ne=>re(ne,ue,N)).join(" || ")})`}function*A(O,ue,N){yield`${N} instanceof Uint8Array`,(0,r.IsNumber)(O.maxByteLength)&&(yield`(${N}.length <= ${O.maxByteLength})`),(0,r.IsNumber)(O.minByteLength)&&(yield`(${N}.length >= ${O.minByteLength})`)}function*b(O,ue,N){yield"true"}function*v(O,ue,N){yield K.IsVoidLike(N)}function*$(O,ue,N){let he=te.instances.size;te.instances.set(he,O),yield`kind('${O[a.Kind]}', ${he}, ${N})`}function*z(O,ue,N,he=!0){let ne=(0,r.IsString)(O.$id)?[...ue,O]:ue,le=O;if(he&&(0,r.IsString)(O.$id)){let Ae=pe(O.$id);if(te.functions.has(Ae))return yield`${Ae}(${N})`;{let Ue=$e(Ae,O,ue,"value",!1);return te.functions.set(Ae,Ue),yield`${Ae}(${N})`}}switch(le[a.Kind]){case"Any":return yield*V(le,ne,N);case"Array":return yield*G(le,ne,N);case"AsyncIterator":return yield*k(le,ne,N);case"BigInt":return yield*Q(le,ne,N);case"Boolean":return yield*q(le,ne,N);case"Constructor":return yield*ce(le,ne,N);case"Date":return yield*U(le,ne,N);case"Function":return yield*D(le,ne,N);case"Integer":return yield*L(le,ne,N);case"Intersect":return yield*ee(le,ne,N);case"Iterator":return yield*ie(le,ne,N);case"Literal":return yield*Y(le,ne,N);case"Never":return yield*se(le,ne,N);case"Not":return yield*B(le,ne,N);case"Null":return yield*W(le,ne,N);case"Number":return yield*X(le,ne,N);case"Object":return yield*fe(le,ne,N);case"Promise":return yield*f(le,ne,N);case"Record":return yield*_(le,ne,N);case"Ref":return yield*I(le,ne,N);case"String":return yield*M(le,ne,N);case"Symbol":return yield*C(le,ne,N);case"TemplateLiteral":return yield*P(le,ne,N);case"This":return yield*y(le,ne,N);case"Tuple":return yield*T(le,ne,N);case"Undefined":return yield*w(le,ne,N);case"Union":return yield*u(le,ne,N);case"Uint8Array":return yield*A(le,ne,N);case"Unknown":return yield*b(le,ne,N);case"Void":return yield*v(le,ne,N);default:if(!a.TypeRegistry.Has(le[a.Kind]))throw new S(O);return yield*$(le,ne,N)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function re(O,ue,N,he=!0){return`(${[...z(O,ue,N,he)].join(" && ")})`}function pe(O){return`check_${g.Encode(O)}`}function ge(O){let ue=`local_${te.variables.size}`;return te.variables.set(ue,`const ${ue} = ${O}`),ue}function $e(O,ue,N,he,ne=!0){let[le,Ae]=[`
|
|
49
|
-
`,Ze=>"".padStart(Ze," ")],Ue=De("value","any"),Ye=
|
|
50
|
-
}`}function De(O,ue){let
|
|
44
|
+
${fe}`,u=Math.min(B.length,U),A=0;for(;A<u-1;A++){let m=ee(String(A),B[A],W,X,fe);T+=m!==void 0?m:"null",T+=w}let v=ee(String(A),B[A],W,X,fe);if(T+=v!==void 0?v:"null",B.length-1>U){let m=B.length-U-1;T+=`${w}"... ${x(m)} not stringified"`}return T+=`
|
|
45
|
+
${f}`,W.pop(),`[${T}]`}let _=Object.keys(B),E=_.length;if(E===0)return"{}";if(ce<W.length+1)return'"[Object]"';fe+=X;let M=`,
|
|
46
|
+
${fe}`,N="",R="",y=Math.min(E,U);l(B)&&(N+=c(B,M,U),_=_.slice(B.length),y-=B.length,R=M),Q&&(_=o(_,z)),W.push(B);for(let T=0;T<y;T++){let w=_[T],u=ee(w,B[w],W,X,fe);u!==void 0&&(N+=`${R}${s(w)}: ${u}`,R=M)}if(E>U){let T=E-U;N+=`${R}"...": "${x(T)} not stringified"`,R=M}return R!==""&&(N=`
|
|
47
|
+
${fe}${N}
|
|
48
|
+
${f}`),W.pop(),`{${N}}`}case"number":return isFinite(B)?String(B):V?V(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(B);default:return V?V(B):void 0}}function ie(se,B,W){switch(typeof B){case"string":return s(B);case"object":{if(B===null)return"null";if(typeof B.toJSON=="function"){if(B=B.toJSON(se),typeof B!="object")return ie(se,B,W);if(B===null)return"null"}if(W.indexOf(B)!==-1)return G;let X="",fe=B.length!==void 0;if(fe&&Array.isArray(B)){if(B.length===0)return"[]";if(ce<W.length+1)return'"[Array]"';W.push(B);let N=Math.min(B.length,U),R=0;for(;R<N-1;R++){let T=ie(String(R),B[R],W);X+=T!==void 0?T:"null",X+=","}let y=ie(String(R),B[R],W);if(X+=y!==void 0?y:"null",B.length-1>U){let T=B.length-U-1;X+=`,"... ${x(T)} not stringified"`}return W.pop(),`[${X}]`}let f=Object.keys(B),_=f.length;if(_===0)return"{}";if(ce<W.length+1)return'"[Object]"';let E="",M=Math.min(_,U);fe&&l(B)&&(X+=c(B,",",U),f=f.slice(B.length),M-=B.length,E=","),Q&&(f=o(f,z)),W.push(B);for(let N=0;N<M;N++){let R=f[N],y=ie(R,B[R],W);y!==void 0&&(X+=`${E}${s(R)}:${y}`,E=",")}if(_>U){let N=_-U;X+=`${E}"...":"${x(N)} not stringified"`}return W.pop(),`{${X}}`}case"number":return isFinite(B)?String(B):V?V(B):"null";case"boolean":return B===!0?"true":"false";case"undefined":return;case"bigint":if(k)return String(B);default:return V?V(B):void 0}}function Y(se,B,W){if(arguments.length>1){let X="";if(typeof W=="number"?X=" ".repeat(Math.min(W,10)):typeof W=="string"&&(X=W.slice(0,10)),B!=null){if(typeof B=="function")return D("",{"":se},[],B,X,"");if(Array.isArray(B))return L("",se,[],K(B),X,"")}if(X.length!==0)return ee("",se,[],X,"")}return ie("",se,[])}return Y}}}),hn=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/guard.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IsValueType=e.IsSymbol=e.IsFunction=e.IsString=e.IsBigInt=e.IsInteger=e.IsNumber=e.IsBoolean=e.IsNull=e.IsUndefined=e.IsArray=e.IsObject=e.IsPlainObject=e.HasPropertyKey=e.IsDate=e.IsUint8Array=e.IsPromise=e.IsTypedArray=e.IsIterator=e.IsAsyncIterator=void 0;function t(k){return c(k)&&Symbol.asyncIterator in k}e.IsAsyncIterator=t;function r(k){return c(k)&&Symbol.iterator in k}e.IsIterator=r;function n(k){return ArrayBuffer.isView(k)}e.IsTypedArray=n;function i(k){return k instanceof Promise}e.IsPromise=i;function s(k){return k instanceof Uint8Array}e.IsUint8Array=s;function o(k){return k instanceof Date&&Number.isFinite(k.getTime())}e.IsDate=o;function a(k,Q){return Q in k}e.HasPropertyKey=a;function l(k){return c(k)&&j(k.constructor)&&k.constructor.name==="Object"}e.IsPlainObject=l;function c(k){return k!==null&&typeof k=="object"}e.IsObject=c;function d(k){return Array.isArray(k)&&!ArrayBuffer.isView(k)}e.IsArray=d;function g(k){return k===void 0}e.IsUndefined=g;function C(k){return k===null}e.IsNull=C;function S(k){return typeof k=="boolean"}e.IsBoolean=S;function x(k){return typeof k=="number"}e.IsNumber=x;function K(k){return x(k)&&Number.isInteger(k)}e.IsInteger=K;function H(k){return typeof k=="bigint"}e.IsBigInt=H;function F(k){return typeof k=="string"}e.IsString=F;function j(k){return typeof k=="function"}e.IsFunction=j;function V(k){return typeof k=="symbol"}e.IsSymbol=V;function G(k){return H(k)||S(k)||C(k)||x(k)||F(k)||V(k)||g(k)}e.IsValueType=G}}),yl=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/system.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultErrorFunction=e.TypeSystemPolicy=e.TypeSystemErrorFunction=e.TypeSystem=e.TypeSystemDuplicateFormat=e.TypeSystemDuplicateTypeKind=void 0;var t=hn(),r=bo(),n=Gt(),i=class extends n.TypeBoxError{constructor(d){super(`Duplicate type kind '${d}' detected`)}};e.TypeSystemDuplicateTypeKind=i;var s=class extends n.TypeBoxError{constructor(d){super(`Duplicate string format '${d}' detected`)}};e.TypeSystemDuplicateFormat=s;var o;(function(d){function g(S,x){if(n.TypeRegistry.Has(S))throw new i(S);return n.TypeRegistry.Set(S,x),(K={})=>n.Type.Unsafe({...K,[n.Kind]:S})}d.Type=g;function C(S,x){if(n.FormatRegistry.Has(S))throw new s(S);return n.FormatRegistry.Set(S,x),S}d.Format=C})(o||(e.TypeSystem=o={}));var a;(function(d){let g=c;function C(){g=c}d.Reset=C;function S(K){g=K}d.Set=S;function x(){return g}d.Get=x})(a||(e.TypeSystemErrorFunction=a={}));var l;(function(d){d.ExactOptionalPropertyTypes=!1,d.AllowArrayObject=!1,d.AllowNaN=!1,d.AllowNullVoid=!1;function g(H,F){return d.ExactOptionalPropertyTypes?F in H:H[F]!==void 0}d.IsExactOptionalProperty=g;function C(H){let F=(0,t.IsObject)(H);return d.AllowArrayObject?F:F&&!(0,t.IsArray)(H)}d.IsObjectLike=C;function S(H){return C(H)&&!(H instanceof Date)&&!(H instanceof Uint8Array)}d.IsRecordLike=S;function x(H){let F=(0,t.IsNumber)(H);return d.AllowNaN?F:F&&Number.isFinite(H)}d.IsNumberLike=x;function K(H){let F=(0,t.IsUndefined)(H);return d.AllowNullVoid?F||H===null:F}d.IsVoidLike=K})(l||(e.TypeSystemPolicy=l={}));function c(d,g){switch(g){case r.ValueErrorType.ArrayContains:return"Expected array to contain at least one matching value";case r.ValueErrorType.ArrayMaxContains:return`Expected array to contain no more than ${d.maxContains} matching values`;case r.ValueErrorType.ArrayMinContains:return`Expected array to contain at least ${d.minContains} matching values`;case r.ValueErrorType.ArrayMaxItems:return`Expected array length to be less or equal to ${d.maxItems}`;case r.ValueErrorType.ArrayMinItems:return`Expected array length to be greater or equal to ${d.minItems}`;case r.ValueErrorType.ArrayUniqueItems:return"Expected array elements to be unique";case r.ValueErrorType.Array:return"Expected array";case r.ValueErrorType.AsyncIterator:return"Expected AsyncIterator";case r.ValueErrorType.BigIntExclusiveMaximum:return`Expected bigint to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.BigIntExclusiveMinimum:return`Expected bigint to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.BigIntMaximum:return`Expected bigint to be less or equal to ${d.maximum}`;case r.ValueErrorType.BigIntMinimum:return`Expected bigint to be greater or equal to ${d.minimum}`;case r.ValueErrorType.BigIntMultipleOf:return`Expected bigint to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.BigInt:return"Expected bigint";case r.ValueErrorType.Boolean:return"Expected boolean";case r.ValueErrorType.DateExclusiveMinimumTimestamp:return`Expected Date timestamp to be greater than ${d.exclusiveMinimumTimestamp}`;case r.ValueErrorType.DateExclusiveMaximumTimestamp:return`Expected Date timestamp to be less than ${d.exclusiveMaximumTimestamp}`;case r.ValueErrorType.DateMinimumTimestamp:return`Expected Date timestamp to be greater or equal to ${d.minimumTimestamp}`;case r.ValueErrorType.DateMaximumTimestamp:return`Expected Date timestamp to be less or equal to ${d.maximumTimestamp}`;case r.ValueErrorType.DateMultipleOfTimestamp:return`Expected Date timestamp to be a multiple of ${d.multipleOfTimestamp}`;case r.ValueErrorType.Date:return"Expected Date";case r.ValueErrorType.Function:return"Expected function";case r.ValueErrorType.IntegerExclusiveMaximum:return`Expected integer to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.IntegerExclusiveMinimum:return`Expected integer to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.IntegerMaximum:return`Expected integer to be less or equal to ${d.maximum}`;case r.ValueErrorType.IntegerMinimum:return`Expected integer to be greater or equal to ${d.minimum}`;case r.ValueErrorType.IntegerMultipleOf:return`Expected integer to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.Integer:return"Expected integer";case r.ValueErrorType.IntersectUnevaluatedProperties:return"Unexpected property";case r.ValueErrorType.Intersect:return"Expected all values to match";case r.ValueErrorType.Iterator:return"Expected Iterator";case r.ValueErrorType.Literal:return`Expected ${typeof d.const=="string"?`'${d.const}'`:d.const}`;case r.ValueErrorType.Never:return"Never";case r.ValueErrorType.Not:return"Value should not match";case r.ValueErrorType.Null:return"Expected null";case r.ValueErrorType.NumberExclusiveMaximum:return`Expected number to be less than ${d.exclusiveMaximum}`;case r.ValueErrorType.NumberExclusiveMinimum:return`Expected number to be greater than ${d.exclusiveMinimum}`;case r.ValueErrorType.NumberMaximum:return`Expected number to be less or equal to ${d.maximum}`;case r.ValueErrorType.NumberMinimum:return`Expected number to be greater or equal to ${d.minimum}`;case r.ValueErrorType.NumberMultipleOf:return`Expected number to be a multiple of ${d.multipleOf}`;case r.ValueErrorType.Number:return"Expected number";case r.ValueErrorType.Object:return"Expected object";case r.ValueErrorType.ObjectAdditionalProperties:return"Unexpected property";case r.ValueErrorType.ObjectMaxProperties:return`Expected object to have no more than ${d.maxProperties} properties`;case r.ValueErrorType.ObjectMinProperties:return`Expected object to have at least ${d.minProperties} properties`;case r.ValueErrorType.ObjectRequiredProperty:return"Required property";case r.ValueErrorType.Promise:return"Expected Promise";case r.ValueErrorType.StringFormatUnknown:return`Unknown format '${d.format}'`;case r.ValueErrorType.StringFormat:return`Expected string to match '${d.format}' format`;case r.ValueErrorType.StringMaxLength:return`Expected string length less or equal to ${d.maxLength}`;case r.ValueErrorType.StringMinLength:return`Expected string length greater or equal to ${d.minLength}`;case r.ValueErrorType.StringPattern:return`Expected string to match '${d.pattern}'`;case r.ValueErrorType.String:return"Expected string";case r.ValueErrorType.Symbol:return"Expected symbol";case r.ValueErrorType.TupleLength:return`Expected tuple to have ${d.maxItems||0} elements`;case r.ValueErrorType.Tuple:return"Expected tuple";case r.ValueErrorType.Uint8ArrayMaxByteLength:return`Expected byte length less or equal to ${d.maxByteLength}`;case r.ValueErrorType.Uint8ArrayMinByteLength:return`Expected byte length greater or equal to ${d.minByteLength}`;case r.ValueErrorType.Uint8Array:return"Expected Uint8Array";case r.ValueErrorType.Undefined:return"Expected undefined";case r.ValueErrorType.Union:return"Expected union value";case r.ValueErrorType.Void:return"Expected void";case r.ValueErrorType.Kind:return`Expected kind '${d[n.Kind]}'`;default:return"Unknown error type"}}e.DefaultErrorFunction=c}}),go=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/deref.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Deref=e.TypeDereferenceError=void 0;var t=Gt(),r=class extends t.TypeBoxError{constructor(i){super(`Unable to dereference schema with $id '${i.$id}'`),this.schema=i}};e.TypeDereferenceError=r;function n(i,s){let o=s.findIndex(a=>a.$id===i.$ref);if(o===-1)throw new r(i);return s[o]}e.Deref=n}}),Ws=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/hash.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.ByteMarker=e.ValueHashError=void 0;var t=hn(),r=class extends Error{constructor(D){super("Unable to hash value"),this.value=D}};e.ValueHashError=r;var n;(function(D){D[D.Undefined=0]="Undefined",D[D.Null=1]="Null",D[D.Boolean=2]="Boolean",D[D.Number=3]="Number",D[D.String=4]="String",D[D.Object=5]="Object",D[D.Array=6]="Array",D[D.Date=7]="Date",D[D.Uint8Array=8]="Uint8Array",D[D.Symbol=9]="Symbol",D[D.BigInt=10]="BigInt"})(n||(e.ByteMarker=n={}));var i=BigInt("14695981039346656037"),[s,o]=[BigInt("1099511628211"),BigInt("2")**BigInt("64")],a=Array.from({length:256}).map((D,L)=>BigInt(L)),l=new Float64Array(1),c=new DataView(l.buffer),d=new Uint8Array(l.buffer);function*g(D){let L=D===0?1:Math.ceil(Math.floor(Math.log2(D)+1)/8);for(let ee=0;ee<L;ee++)yield D>>8*(L-1-ee)&255}function C(D){ce(n.Array);for(let L of D)z(L)}function S(D){ce(n.Boolean),ce(D?1:0)}function x(D){ce(n.BigInt),c.setBigInt64(0,D);for(let L of d)ce(L)}function K(D){ce(n.Date),z(D.getTime())}function H(D){ce(n.Null)}function F(D){ce(n.Number),c.setFloat64(0,D);for(let L of d)ce(L)}function j(D){ce(n.Object);for(let L of globalThis.Object.keys(D).sort())z(L),z(D[L])}function V(D){ce(n.String);for(let L=0;L<D.length;L++)for(let ee of g(D.charCodeAt(L)))ce(ee)}function G(D){ce(n.Symbol),z(D.description)}function k(D){ce(n.Uint8Array);for(let L=0;L<D.length;L++)ce(D[L])}function Q(D){return ce(n.Undefined)}function z(D){if((0,t.IsArray)(D))return C(D);if((0,t.IsBoolean)(D))return S(D);if((0,t.IsBigInt)(D))return x(D);if((0,t.IsDate)(D))return K(D);if((0,t.IsNull)(D))return H(D);if((0,t.IsNumber)(D))return F(D);if((0,t.IsPlainObject)(D))return j(D);if((0,t.IsString)(D))return V(D);if((0,t.IsSymbol)(D))return G(D);if((0,t.IsUint8Array)(D))return k(D);if((0,t.IsUndefined)(D))return Q(D);throw new r(D)}function ce(D){i=i^a[D],i=i*s%o}function U(D){return i=BigInt("14695981039346656037"),z(D),i}e.Hash=U}}),bo=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/errors.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Errors=e.ValueErrorIterator=e.EscapeKey=e.ValueErrorsUnknownTypeError=e.ValueErrorType=void 0;var t=hn(),r=yl(),n=go(),i=Ws(),s=Gt(),o;(function(u){u[u.ArrayContains=0]="ArrayContains",u[u.ArrayMaxContains=1]="ArrayMaxContains",u[u.ArrayMaxItems=2]="ArrayMaxItems",u[u.ArrayMinContains=3]="ArrayMinContains",u[u.ArrayMinItems=4]="ArrayMinItems",u[u.ArrayUniqueItems=5]="ArrayUniqueItems",u[u.Array=6]="Array",u[u.AsyncIterator=7]="AsyncIterator",u[u.BigIntExclusiveMaximum=8]="BigIntExclusiveMaximum",u[u.BigIntExclusiveMinimum=9]="BigIntExclusiveMinimum",u[u.BigIntMaximum=10]="BigIntMaximum",u[u.BigIntMinimum=11]="BigIntMinimum",u[u.BigIntMultipleOf=12]="BigIntMultipleOf",u[u.BigInt=13]="BigInt",u[u.Boolean=14]="Boolean",u[u.DateExclusiveMaximumTimestamp=15]="DateExclusiveMaximumTimestamp",u[u.DateExclusiveMinimumTimestamp=16]="DateExclusiveMinimumTimestamp",u[u.DateMaximumTimestamp=17]="DateMaximumTimestamp",u[u.DateMinimumTimestamp=18]="DateMinimumTimestamp",u[u.DateMultipleOfTimestamp=19]="DateMultipleOfTimestamp",u[u.Date=20]="Date",u[u.Function=21]="Function",u[u.IntegerExclusiveMaximum=22]="IntegerExclusiveMaximum",u[u.IntegerExclusiveMinimum=23]="IntegerExclusiveMinimum",u[u.IntegerMaximum=24]="IntegerMaximum",u[u.IntegerMinimum=25]="IntegerMinimum",u[u.IntegerMultipleOf=26]="IntegerMultipleOf",u[u.Integer=27]="Integer",u[u.IntersectUnevaluatedProperties=28]="IntersectUnevaluatedProperties",u[u.Intersect=29]="Intersect",u[u.Iterator=30]="Iterator",u[u.Kind=31]="Kind",u[u.Literal=32]="Literal",u[u.Never=33]="Never",u[u.Not=34]="Not",u[u.Null=35]="Null",u[u.NumberExclusiveMaximum=36]="NumberExclusiveMaximum",u[u.NumberExclusiveMinimum=37]="NumberExclusiveMinimum",u[u.NumberMaximum=38]="NumberMaximum",u[u.NumberMinimum=39]="NumberMinimum",u[u.NumberMultipleOf=40]="NumberMultipleOf",u[u.Number=41]="Number",u[u.ObjectAdditionalProperties=42]="ObjectAdditionalProperties",u[u.ObjectMaxProperties=43]="ObjectMaxProperties",u[u.ObjectMinProperties=44]="ObjectMinProperties",u[u.ObjectRequiredProperty=45]="ObjectRequiredProperty",u[u.Object=46]="Object",u[u.Promise=47]="Promise",u[u.StringFormatUnknown=48]="StringFormatUnknown",u[u.StringFormat=49]="StringFormat",u[u.StringMaxLength=50]="StringMaxLength",u[u.StringMinLength=51]="StringMinLength",u[u.StringPattern=52]="StringPattern",u[u.String=53]="String",u[u.Symbol=54]="Symbol",u[u.TupleLength=55]="TupleLength",u[u.Tuple=56]="Tuple",u[u.Uint8ArrayMaxByteLength=57]="Uint8ArrayMaxByteLength",u[u.Uint8ArrayMinByteLength=58]="Uint8ArrayMinByteLength",u[u.Uint8Array=59]="Uint8Array",u[u.Undefined=60]="Undefined",u[u.Union=61]="Union",u[u.Void=62]="Void"})(o||(e.ValueErrorType=o={}));var a=class extends s.TypeBoxError{constructor(u){super("Unknown type"),this.schema=u}};e.ValueErrorsUnknownTypeError=a;function l(u){return u.replace(/~/g,"~0").replace(/\//g,"~1")}e.EscapeKey=l;function c(u){return u!==void 0}var d=class{constructor(u){this.iterator=u}[Symbol.iterator](){return this.iterator}First(){let u=this.iterator.next();return u.done?void 0:u.value}};e.ValueErrorIterator=d;function g(u,A,v,m){return{type:u,schema:A,path:v,value:m,message:r.TypeSystemErrorFunction.Get()(A,u)}}function*C(u,A,v,m){}function*S(u,A,v,m){if(!(0,t.IsArray)(m))return yield g(o.Array,u,v,m);c(u.minItems)&&!(m.length>=u.minItems)&&(yield g(o.ArrayMinItems,u,v,m)),c(u.maxItems)&&!(m.length<=u.maxItems)&&(yield g(o.ArrayMaxItems,u,v,m));for(let te=0;te<m.length;te++)yield*T(u.items,A,`${v}/${te}`,m[te]);if(u.uniqueItems===!0&&!function(){let te=new Set;for(let re of m){let pe=(0,i.Hash)(re);if(te.has(pe))return!1;te.add(pe)}return!0}()&&(yield g(o.ArrayUniqueItems,u,v,m)),!(c(u.contains)||c(u.minContains)||c(u.maxContains)))return;let P=c(u.contains)?u.contains:s.Type.Never(),q=m.reduce((te,re,pe)=>T(P,A,`${v}${pe}`,re).next().done===!0?te+1:te,0);q===0&&(yield g(o.ArrayContains,u,v,m)),(0,t.IsNumber)(u.minContains)&&q<u.minContains&&(yield g(o.ArrayMinContains,u,v,m)),(0,t.IsNumber)(u.maxContains)&&q>u.maxContains&&(yield g(o.ArrayMaxContains,u,v,m))}function*x(u,A,v,m){(0,t.IsAsyncIterator)(m)||(yield g(o.AsyncIterator,u,v,m))}function*K(u,A,v,m){if(!(0,t.IsBigInt)(m))return yield g(o.BigInt,u,v,m);c(u.exclusiveMaximum)&&!(m<u.exclusiveMaximum)&&(yield g(o.BigIntExclusiveMaximum,u,v,m)),c(u.exclusiveMinimum)&&!(m>u.exclusiveMinimum)&&(yield g(o.BigIntExclusiveMinimum,u,v,m)),c(u.maximum)&&!(m<=u.maximum)&&(yield g(o.BigIntMaximum,u,v,m)),c(u.minimum)&&!(m>=u.minimum)&&(yield g(o.BigIntMinimum,u,v,m)),c(u.multipleOf)&&m%u.multipleOf!==BigInt(0)&&(yield g(o.BigIntMultipleOf,u,v,m))}function*H(u,A,v,m){(0,t.IsBoolean)(m)||(yield g(o.Boolean,u,v,m))}function*F(u,A,v,m){yield*T(u.returns,A,v,m.prototype)}function*j(u,A,v,m){if(!(0,t.IsDate)(m))return yield g(o.Date,u,v,m);c(u.exclusiveMaximumTimestamp)&&!(m.getTime()<u.exclusiveMaximumTimestamp)&&(yield g(o.DateExclusiveMaximumTimestamp,u,v,m)),c(u.exclusiveMinimumTimestamp)&&!(m.getTime()>u.exclusiveMinimumTimestamp)&&(yield g(o.DateExclusiveMinimumTimestamp,u,v,m)),c(u.maximumTimestamp)&&!(m.getTime()<=u.maximumTimestamp)&&(yield g(o.DateMaximumTimestamp,u,v,m)),c(u.minimumTimestamp)&&!(m.getTime()>=u.minimumTimestamp)&&(yield g(o.DateMinimumTimestamp,u,v,m)),c(u.multipleOfTimestamp)&&m.getTime()%u.multipleOfTimestamp!==0&&(yield g(o.DateMultipleOfTimestamp,u,v,m))}function*V(u,A,v,m){(0,t.IsFunction)(m)||(yield g(o.Function,u,v,m))}function*G(u,A,v,m){if(!(0,t.IsInteger)(m))return yield g(o.Integer,u,v,m);c(u.exclusiveMaximum)&&!(m<u.exclusiveMaximum)&&(yield g(o.IntegerExclusiveMaximum,u,v,m)),c(u.exclusiveMinimum)&&!(m>u.exclusiveMinimum)&&(yield g(o.IntegerExclusiveMinimum,u,v,m)),c(u.maximum)&&!(m<=u.maximum)&&(yield g(o.IntegerMaximum,u,v,m)),c(u.minimum)&&!(m>=u.minimum)&&(yield g(o.IntegerMinimum,u,v,m)),c(u.multipleOf)&&m%u.multipleOf!==0&&(yield g(o.IntegerMultipleOf,u,v,m))}function*k(u,A,v,m){for(let P of u.allOf){let q=T(P,A,v,m).next();q.done||(yield g(o.Intersect,u,v,m),yield q.value)}if(u.unevaluatedProperties===!1){let P=new RegExp(s.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(m))P.test(q)||(yield g(o.IntersectUnevaluatedProperties,u,`${v}/${q}`,m))}if(typeof u.unevaluatedProperties=="object"){let P=new RegExp(s.KeyResolver.ResolvePattern(u));for(let q of Object.getOwnPropertyNames(m))if(!P.test(q)){let te=T(u.unevaluatedProperties,A,`${v}/${q}`,m[q]).next();te.done||(yield te.value)}}}function*Q(u,A,v,m){(0,t.IsIterator)(m)||(yield g(o.Iterator,u,v,m))}function*z(u,A,v,m){m!==u.const&&(yield g(o.Literal,u,v,m))}function*ce(u,A,v,m){yield g(o.Never,u,v,m)}function*U(u,A,v,m){T(u.not,A,v,m).next().done===!0&&(yield g(o.Not,u,v,m))}function*D(u,A,v,m){(0,t.IsNull)(m)||(yield g(o.Null,u,v,m))}function*L(u,A,v,m){if(!r.TypeSystemPolicy.IsNumberLike(m))return yield g(o.Number,u,v,m);c(u.exclusiveMaximum)&&!(m<u.exclusiveMaximum)&&(yield g(o.NumberExclusiveMaximum,u,v,m)),c(u.exclusiveMinimum)&&!(m>u.exclusiveMinimum)&&(yield g(o.NumberExclusiveMinimum,u,v,m)),c(u.maximum)&&!(m<=u.maximum)&&(yield g(o.NumberMaximum,u,v,m)),c(u.minimum)&&!(m>=u.minimum)&&(yield g(o.NumberMinimum,u,v,m)),c(u.multipleOf)&&m%u.multipleOf!==0&&(yield g(o.NumberMultipleOf,u,v,m))}function*ee(u,A,v,m){if(!r.TypeSystemPolicy.IsObjectLike(m))return yield g(o.Object,u,v,m);c(u.minProperties)&&!(Object.getOwnPropertyNames(m).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,m)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(m).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,m));let P=Array.isArray(u.required)?u.required:[],q=Object.getOwnPropertyNames(u.properties),te=Object.getOwnPropertyNames(m);for(let re of P)te.includes(re)||(yield g(o.ObjectRequiredProperty,u.properties[re],`${v}/${l(re)}`,void 0));if(u.additionalProperties===!1)for(let re of te)q.includes(re)||(yield g(o.ObjectAdditionalProperties,u,`${v}/${l(re)}`,m[re]));if(typeof u.additionalProperties=="object")for(let re of te)q.includes(re)||(yield*T(u.additionalProperties,A,`${v}/${l(re)}`,m[re]));for(let re of q){let pe=u.properties[re];u.required&&u.required.includes(re)?(yield*T(pe,A,`${v}/${l(re)}`,m[re]),s.ExtendsUndefined.Check(u)&&!(re in m)&&(yield g(o.ObjectRequiredProperty,pe,`${v}/${l(re)}`,void 0))):r.TypeSystemPolicy.IsExactOptionalProperty(m,re)&&(yield*T(pe,A,`${v}/${l(re)}`,m[re]))}}function*ie(u,A,v,m){(0,t.IsPromise)(m)||(yield g(o.Promise,u,v,m))}function*Y(u,A,v,m){if(!r.TypeSystemPolicy.IsRecordLike(m))return yield g(o.Object,u,v,m);c(u.minProperties)&&!(Object.getOwnPropertyNames(m).length>=u.minProperties)&&(yield g(o.ObjectMinProperties,u,v,m)),c(u.maxProperties)&&!(Object.getOwnPropertyNames(m).length<=u.maxProperties)&&(yield g(o.ObjectMaxProperties,u,v,m));let[P,q]=Object.entries(u.patternProperties)[0],te=new RegExp(P);for(let[re,pe]of Object.entries(m))te.test(re)&&(yield*T(q,A,`${v}/${l(re)}`,pe));if(typeof u.additionalProperties=="object")for(let[re,pe]of Object.entries(m))te.test(re)||(yield*T(u.additionalProperties,A,`${v}/${l(re)}`,pe));if(u.additionalProperties===!1){for(let[re,pe]of Object.entries(m))if(!te.test(re))return yield g(o.ObjectAdditionalProperties,u,`${v}/${l(re)}`,pe)}}function*se(u,A,v,m){yield*T((0,n.Deref)(u,A),A,v,m)}function*B(u,A,v,m){if(!(0,t.IsString)(m))return yield g(o.String,u,v,m);c(u.minLength)&&!(m.length>=u.minLength)&&(yield g(o.StringMinLength,u,v,m)),c(u.maxLength)&&!(m.length<=u.maxLength)&&(yield g(o.StringMaxLength,u,v,m)),(0,t.IsString)(u.pattern)&&(new RegExp(u.pattern).test(m)||(yield g(o.StringPattern,u,v,m))),(0,t.IsString)(u.format)&&(s.FormatRegistry.Has(u.format)?s.FormatRegistry.Get(u.format)(m)||(yield g(o.StringFormat,u,v,m)):yield g(o.StringFormatUnknown,u,v,m))}function*W(u,A,v,m){(0,t.IsSymbol)(m)||(yield g(o.Symbol,u,v,m))}function*X(u,A,v,m){if(!(0,t.IsString)(m))return yield g(o.String,u,v,m);new RegExp(u.pattern).test(m)||(yield g(o.StringPattern,u,v,m))}function*fe(u,A,v,m){yield*T((0,n.Deref)(u,A),A,v,m)}function*f(u,A,v,m){if(!(0,t.IsArray)(m))return yield g(o.Tuple,u,v,m);if(u.items===void 0&&m.length!==0)return yield g(o.TupleLength,u,v,m);if(m.length!==u.maxItems)return yield g(o.TupleLength,u,v,m);if(u.items)for(let P=0;P<u.items.length;P++)yield*T(u.items[P],A,`${v}/${P}`,m[P])}function*_(u,A,v,m){(0,t.IsUndefined)(m)||(yield g(o.Undefined,u,v,m))}function*E(u,A,v,m){let P=0;for(let q of u.anyOf){let te=[...T(q,A,v,m)];if(te.length===0)return;P+=te.length}P>0&&(yield g(o.Union,u,v,m))}function*M(u,A,v,m){if(!(0,t.IsUint8Array)(m))return yield g(o.Uint8Array,u,v,m);c(u.maxByteLength)&&!(m.length<=u.maxByteLength)&&(yield g(o.Uint8ArrayMaxByteLength,u,v,m)),c(u.minByteLength)&&!(m.length>=u.minByteLength)&&(yield g(o.Uint8ArrayMinByteLength,u,v,m))}function*N(u,A,v,m){}function*R(u,A,v,m){r.TypeSystemPolicy.IsVoidLike(m)||(yield g(o.Void,u,v,m))}function*y(u,A,v,m){s.TypeRegistry.Get(u[s.Kind])(u,m)||(yield g(o.Kind,u,v,m))}function*T(u,A,v,m){let P=c(u.$id)?[...A,u]:A,q=u;switch(q[s.Kind]){case"Any":return yield*C(q,P,v,m);case"Array":return yield*S(q,P,v,m);case"AsyncIterator":return yield*x(q,P,v,m);case"BigInt":return yield*K(q,P,v,m);case"Boolean":return yield*H(q,P,v,m);case"Constructor":return yield*F(q,P,v,m);case"Date":return yield*j(q,P,v,m);case"Function":return yield*V(q,P,v,m);case"Integer":return yield*G(q,P,v,m);case"Intersect":return yield*k(q,P,v,m);case"Iterator":return yield*Q(q,P,v,m);case"Literal":return yield*z(q,P,v,m);case"Never":return yield*ce(q,P,v,m);case"Not":return yield*U(q,P,v,m);case"Null":return yield*D(q,P,v,m);case"Number":return yield*L(q,P,v,m);case"Object":return yield*ee(q,P,v,m);case"Promise":return yield*ie(q,P,v,m);case"Record":return yield*Y(q,P,v,m);case"Ref":return yield*se(q,P,v,m);case"String":return yield*B(q,P,v,m);case"Symbol":return yield*W(q,P,v,m);case"TemplateLiteral":return yield*X(q,P,v,m);case"This":return yield*fe(q,P,v,m);case"Tuple":return yield*f(q,P,v,m);case"Undefined":return yield*_(q,P,v,m);case"Union":return yield*E(q,P,v,m);case"Uint8Array":return yield*M(q,P,v,m);case"Unknown":return yield*N(q,P,v,m);case"Void":return yield*R(q,P,v,m);default:if(!s.TypeRegistry.Has(q[s.Kind]))throw new a(u);return yield*y(q,P,v,m)}}function w(...u){let A=u.length===3?T(u[0],u[1],"",u[2]):T(u[0],[],"",u[1]);return new d(A)}e.Errors=w}}),Gg=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/errors/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=e&&e.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&t(i,n,s)};Object.defineProperty(e,"__esModule",{value:!0}),r(bo(),e)}}),gl=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/system/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,l)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorType=void 0;var n=bo();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),r(yl(),e)}}),Wg=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/check.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Check=e.ValueCheckUnknownTypeError=void 0;var t=hn(),r=gl(),n=go(),i=Ws(),s=Gt(),o=class extends s.TypeBoxError{constructor(y){super("Unknown type"),this.schema=y}};e.ValueCheckUnknownTypeError=o;function a(y){return y[s.Kind]==="Any"||y[s.Kind]==="Unknown"}function l(y){return y!==void 0}function c(y,T,w){return!0}function d(y,T,w){if(!(0,t.IsArray)(w)||l(y.minItems)&&!(w.length>=y.minItems)||l(y.maxItems)&&!(w.length<=y.maxItems)||!w.every(v=>N(y.items,T,v))||y.uniqueItems===!0&&!function(){let v=new Set;for(let m of w){let P=(0,i.Hash)(m);if(v.has(P))return!1;v.add(P)}return!0}())return!1;if(!(l(y.contains)||(0,t.IsNumber)(y.minContains)||(0,t.IsNumber)(y.maxContains)))return!0;let u=l(y.contains)?y.contains:s.Type.Never(),A=w.reduce((v,m)=>N(u,T,m)?v+1:v,0);return!(A===0||(0,t.IsNumber)(y.minContains)&&A<y.minContains||(0,t.IsNumber)(y.maxContains)&&A>y.maxContains)}function g(y,T,w){return(0,t.IsAsyncIterator)(w)}function C(y,T,w){return!(!(0,t.IsBigInt)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==BigInt(0))}function S(y,T,w){return(0,t.IsBoolean)(w)}function x(y,T,w){return N(y.returns,T,w.prototype)}function K(y,T,w){return!(!(0,t.IsDate)(w)||l(y.exclusiveMaximumTimestamp)&&!(w.getTime()<y.exclusiveMaximumTimestamp)||l(y.exclusiveMinimumTimestamp)&&!(w.getTime()>y.exclusiveMinimumTimestamp)||l(y.maximumTimestamp)&&!(w.getTime()<=y.maximumTimestamp)||l(y.minimumTimestamp)&&!(w.getTime()>=y.minimumTimestamp)||l(y.multipleOfTimestamp)&&w.getTime()%y.multipleOfTimestamp!==0)}function H(y,T,w){return(0,t.IsFunction)(w)}function F(y,T,w){return!(!(0,t.IsInteger)(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.minimum)&&!(w>=y.minimum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function j(y,T,w){let u=y.allOf.every(A=>N(A,T,w));if(y.unevaluatedProperties===!1){let A=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(w).every(m=>A.test(m));return u&&v}else if(s.TypeGuard.TSchema(y.unevaluatedProperties)){let A=new RegExp(s.KeyResolver.ResolvePattern(y)),v=Object.getOwnPropertyNames(w).every(m=>A.test(m)||N(y.unevaluatedProperties,T,w[m]));return u&&v}else return u}function V(y,T,w){return(0,t.IsIterator)(w)}function G(y,T,w){return w===y.const}function k(y,T,w){return!1}function Q(y,T,w){return!N(y.not,T,w)}function z(y,T,w){return(0,t.IsNull)(w)}function ce(y,T,w){return!(!r.TypeSystemPolicy.IsNumberLike(w)||l(y.exclusiveMaximum)&&!(w<y.exclusiveMaximum)||l(y.exclusiveMinimum)&&!(w>y.exclusiveMinimum)||l(y.minimum)&&!(w>=y.minimum)||l(y.maximum)&&!(w<=y.maximum)||l(y.multipleOf)&&w%y.multipleOf!==0)}function U(y,T,w){if(!r.TypeSystemPolicy.IsObjectLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let u=Object.getOwnPropertyNames(y.properties);for(let A of u){let v=y.properties[A];if(y.required&&y.required.includes(A)){if(!N(v,T,w[A])||(s.ExtendsUndefined.Check(v)||a(v))&&!(A in w))return!1}else if(r.TypeSystemPolicy.IsExactOptionalProperty(w,A)&&!N(v,T,w[A]))return!1}if(y.additionalProperties===!1){let A=Object.getOwnPropertyNames(w);return y.required&&y.required.length===u.length&&A.length===u.length?!0:A.every(v=>u.includes(v))}else return typeof y.additionalProperties=="object"?Object.getOwnPropertyNames(w).every(v=>u.includes(v)||N(y.additionalProperties,T,w[v])):!0}function D(y,T,w){return(0,t.IsPromise)(w)}function L(y,T,w){if(!r.TypeSystemPolicy.IsRecordLike(w)||l(y.minProperties)&&!(Object.getOwnPropertyNames(w).length>=y.minProperties)||l(y.maxProperties)&&!(Object.getOwnPropertyNames(w).length<=y.maxProperties))return!1;let[u,A]=Object.entries(y.patternProperties)[0],v=new RegExp(u),m=Object.entries(w).every(([te,re])=>v.test(te)?N(A,T,re):!0),P=typeof y.additionalProperties=="object"?Object.entries(w).every(([te,re])=>v.test(te)?!0:N(y.additionalProperties,T,re)):!0,q=y.additionalProperties===!1?Object.getOwnPropertyNames(w).every(te=>v.test(te)):!0;return m&&P&&q}function ee(y,T,w){return N((0,n.Deref)(y,T),T,w)}function ie(y,T,w){return!(0,t.IsString)(w)||l(y.minLength)&&!(w.length>=y.minLength)||l(y.maxLength)&&!(w.length<=y.maxLength)||l(y.pattern)&&!new RegExp(y.pattern).test(w)?!1:l(y.format)?s.FormatRegistry.Has(y.format)?s.FormatRegistry.Get(y.format)(w):!1:!0}function Y(y,T,w){return(0,t.IsSymbol)(w)}function se(y,T,w){return(0,t.IsString)(w)&&new RegExp(y.pattern).test(w)}function B(y,T,w){return N((0,n.Deref)(y,T),T,w)}function W(y,T,w){if(!(0,t.IsArray)(w)||y.items===void 0&&w.length!==0||w.length!==y.maxItems)return!1;if(!y.items)return!0;for(let u=0;u<y.items.length;u++)if(!N(y.items[u],T,w[u]))return!1;return!0}function X(y,T,w){return(0,t.IsUndefined)(w)}function fe(y,T,w){return y.anyOf.some(u=>N(u,T,w))}function f(y,T,w){return!(!(0,t.IsUint8Array)(w)||l(y.maxByteLength)&&!(w.length<=y.maxByteLength)||l(y.minByteLength)&&!(w.length>=y.minByteLength))}function _(y,T,w){return!0}function E(y,T,w){return r.TypeSystemPolicy.IsVoidLike(w)}function M(y,T,w){return s.TypeRegistry.Has(y[s.Kind])?s.TypeRegistry.Get(y[s.Kind])(y,w):!1}function N(y,T,w){let u=l(y.$id)?[...T,y]:T,A=y;switch(A[s.Kind]){case"Any":return c(A,u,w);case"Array":return d(A,u,w);case"AsyncIterator":return g(A,u,w);case"BigInt":return C(A,u,w);case"Boolean":return S(A,u,w);case"Constructor":return x(A,u,w);case"Date":return K(A,u,w);case"Function":return H(A,u,w);case"Integer":return F(A,u,w);case"Intersect":return j(A,u,w);case"Iterator":return V(A,u,w);case"Literal":return G(A,u,w);case"Never":return k(A,u,w);case"Not":return Q(A,u,w);case"Null":return z(A,u,w);case"Number":return ce(A,u,w);case"Object":return U(A,u,w);case"Promise":return D(A,u,w);case"Record":return L(A,u,w);case"Ref":return ee(A,u,w);case"String":return ie(A,u,w);case"Symbol":return Y(A,u,w);case"TemplateLiteral":return se(A,u,w);case"This":return B(A,u,w);case"Tuple":return W(A,u,w);case"Undefined":return X(A,u,w);case"Union":return fe(A,u,w);case"Uint8Array":return f(A,u,w);case"Unknown":return _(A,u,w);case"Void":return E(A,u,w);default:if(!s.TypeRegistry.Has(A[s.Kind]))throw new o(A);return M(A,u,w)}}function R(...y){return y.length===3?N(y[0],y[1],y[2]):N(y[0],[],y[1])}e.Check=R}}),Hg=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/value/transform.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.EncodeTransform=e.DecodeTransform=e.HasTransform=e.TransformEncodeError=e.TransformDecodeError=e.TransformEncodeCheckError=e.TransformDecodeCheckError=void 0;var t=hn(),r=go(),n=Wg(),i=Gt(),s=class extends i.TypeBoxError{constructor(C,S,x){super("Unable to decode due to invalid value"),this.schema=C,this.value=S,this.error=x}};e.TransformDecodeCheckError=s;var o=class extends i.TypeBoxError{constructor(C,S,x){super("Unable to encode due to invalid value"),this.schema=C,this.value=S,this.error=x}};e.TransformEncodeCheckError=o;var a=class extends i.TypeBoxError{constructor(C,S,x){super(`${x instanceof Error?x.message:"Unknown error"}`),this.schema=C,this.value=S}};e.TransformDecodeError=a;var l=class extends i.TypeBoxError{constructor(C,S,x){super(`${x instanceof Error?x.message:"Unknown error"}`),this.schema=C,this.value=S}};e.TransformEncodeError=l;var c;(function(C){function S(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function x(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function K(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.returns,se)||Y.parameters.some(B=>L(B,se))}function H(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.returns,se)||Y.parameters.some(B=>L(B,se))}function F(Y,se){return i.TypeGuard.TTransform(Y)||i.TypeGuard.TTransform(Y.unevaluatedProperties)||Y.allOf.some(B=>L(B,se))}function j(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.items,se)}function V(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.not,se)}function G(Y,se){return i.TypeGuard.TTransform(Y)||Object.values(Y.properties).some(B=>L(B,se))||i.TypeGuard.TSchema(Y.additionalProperties)&&L(Y.additionalProperties,se)}function k(Y,se){return i.TypeGuard.TTransform(Y)||L(Y.item,se)}function Q(Y,se){let B=Object.getOwnPropertyNames(Y.patternProperties)[0],W=Y.patternProperties[B];return i.TypeGuard.TTransform(Y)||L(W,se)||i.TypeGuard.TSchema(Y.additionalProperties)&&i.TypeGuard.TTransform(Y.additionalProperties)}function z(Y,se){return i.TypeGuard.TTransform(Y)?!0:L((0,r.Deref)(Y,se),se)}function ce(Y,se){return i.TypeGuard.TTransform(Y)?!0:L((0,r.Deref)(Y,se),se)}function U(Y,se){return i.TypeGuard.TTransform(Y)||!(0,t.IsUndefined)(Y.items)&&Y.items.some(B=>L(B,se))}function D(Y,se){return i.TypeGuard.TTransform(Y)||Y.anyOf.some(B=>L(B,se))}function L(Y,se){let B=(0,t.IsString)(Y.$id)?[...se,Y]:se,W=Y;if(Y.$id&&ee.has(Y.$id))return!1;switch(Y.$id&&ee.add(Y.$id),Y[i.Kind]){case"Array":return S(W,B);case"AsyncIterator":return x(W,B);case"Constructor":return K(W,B);case"Function":return H(W,B);case"Intersect":return F(W,B);case"Iterator":return j(W,B);case"Not":return V(W,B);case"Object":return G(W,B);case"Promise":return k(W,B);case"Record":return Q(W,B);case"Ref":return z(W,B);case"This":return ce(W,B);case"Tuple":return U(W,B);case"Union":return D(W,B);default:return i.TypeGuard.TTransform(Y)}}let ee=new Set;function ie(Y,se){return ee.clear(),L(Y,se)}C.Has=ie})(c||(e.HasTransform=c={}));var d;(function(C){function S(U,D){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Decode(D):D}catch(L){throw new a(U,D,L)}}function x(U,D,L){return(0,t.IsArray)(L)?S(U,L.map(ee=>z(U.items,D,ee))):S(U,L)}function K(U,D,L){if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return S(U,L);let ee=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),ie=ee.reduce((W,X)=>X in W?{...W,[X]:z(i.IndexedAccessor.Resolve(U,[X]),D,W[X])}:W,L);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return S(U,ie);let Y=Object.getOwnPropertyNames(ie),se=U.unevaluatedProperties,B=Y.reduce((W,X)=>ee.includes(X)?W:{...W,[X]:S(se,W[X])},ie);return S(U,B)}function H(U,D,L){return S(U,z(U.not,D,L))}function F(U,D,L){if(!(0,t.IsPlainObject)(L))return S(U,L);let ee=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),ie=ee.reduce((W,X)=>X in W?{...W,[X]:z(U.properties[X],D,W[X])}:W,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,ie);let Y=Object.getOwnPropertyNames(ie),se=U.additionalProperties,B=Y.reduce((W,X)=>ee.includes(X)?W:{...W,[X]:S(se,W[X])},ie);return S(U,B)}function j(U,D,L){if(!(0,t.IsPlainObject)(L))return S(U,L);let ee=Object.getOwnPropertyNames(U.patternProperties)[0],ie=new RegExp(ee),Y=Object.getOwnPropertyNames(L).reduce((X,fe)=>ie.test(fe)?{...X,[fe]:z(U.patternProperties[ee],D,X[fe])}:X,L);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,Y);let se=Object.getOwnPropertyNames(Y),B=U.additionalProperties,W=se.reduce((X,fe)=>ie.test(fe)?X:{...X,[fe]:S(B,X[fe])},Y);return S(U,W)}function V(U,D,L){let ee=(0,r.Deref)(U,D);return S(U,z(ee,D,L))}function G(U,D,L){let ee=(0,r.Deref)(U,D);return S(U,z(ee,D,L))}function k(U,D,L){return(0,t.IsArray)(L)&&(0,t.IsArray)(U.items)?S(U,U.items.map((ee,ie)=>z(ee,D,L[ie]))):S(U,L)}function Q(U,D,L){let ee=S(U,L);for(let ie of U.anyOf)if((0,n.Check)(ie,D,ee))return z(ie,D,ee);return ee}function z(U,D,L){let ee=typeof U.$id=="string"?[...D,U]:D,ie=U;switch(U[i.Kind]){case"Array":return x(ie,ee,L);case"Intersect":return K(ie,ee,L);case"Not":return H(ie,ee,L);case"Object":return F(ie,ee,L);case"Record":return j(ie,ee,L);case"Ref":return V(ie,ee,L);case"Symbol":return S(ie,L);case"This":return G(ie,ee,L);case"Tuple":return k(ie,ee,L);case"Union":return Q(ie,ee,L);default:return S(ie,L)}}function ce(U,D,L){return z(U,D,L)}C.Decode=ce})(d||(e.DecodeTransform=d={}));var g;(function(C){function S(U,D){try{return i.TypeGuard.TTransform(U)?U[i.Transform].Encode(D):D}catch(L){throw new l(U,D,L)}}function x(U,D,L){let ee=S(U,L);return(0,t.IsArray)(ee)?ee.map(ie=>z(U.items,D,ie)):ee}function K(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L)||(0,t.IsValueType)(L))return ee;let ie=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Y=ie.reduce((W,X)=>X in ee?{...W,[X]:z(i.IndexedAccessor.Resolve(U,[X]),D,W[X])}:W,ee);if(!i.TypeGuard.TTransform(U.unevaluatedProperties))return S(U,Y);let se=Object.getOwnPropertyNames(Y),B=U.unevaluatedProperties;return se.reduce((W,X)=>ie.includes(X)?W:{...W,[X]:S(B,W[X])},Y)}function H(U,D,L){return S(U.not,S(U,L))}function F(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L))return ee;let ie=i.KeyResolver.ResolveKeys(U,{includePatterns:!1}),Y=ie.reduce((W,X)=>X in W?{...W,[X]:z(U.properties[X],D,W[X])}:W,ee);if(!i.TypeGuard.TSchema(U.additionalProperties))return Y;let se=Object.getOwnPropertyNames(Y),B=U.additionalProperties;return se.reduce((W,X)=>ie.includes(X)?W:{...W,[X]:S(B,W[X])},Y)}function j(U,D,L){let ee=S(U,L);if(!(0,t.IsPlainObject)(L))return ee;let ie=Object.getOwnPropertyNames(U.patternProperties)[0],Y=new RegExp(ie),se=Object.getOwnPropertyNames(L).reduce((X,fe)=>Y.test(fe)?{...X,[fe]:z(U.patternProperties[ie],D,X[fe])}:X,ee);if(!i.TypeGuard.TSchema(U.additionalProperties))return S(U,se);let B=Object.getOwnPropertyNames(se),W=U.additionalProperties;return B.reduce((X,fe)=>Y.test(fe)?X:{...X,[fe]:S(W,X[fe])},se)}function V(U,D,L){let ee=(0,r.Deref)(U,D),ie=z(ee,D,L);return S(U,ie)}function G(U,D,L){let ee=(0,r.Deref)(U,D),ie=z(ee,D,L);return S(U,ie)}function k(U,D,L){let ee=S(U,L);return(0,t.IsArray)(U.items)?U.items.map((ie,Y)=>z(ie,D,ee[Y])):[]}function Q(U,D,L){for(let ee of U.anyOf){if(!(0,n.Check)(ee,D,L))continue;let ie=z(ee,D,L);return S(U,ie)}for(let ee of U.anyOf){let ie=z(ee,D,L);if((0,n.Check)(U,D,ie))return S(U,ie)}return S(U,L)}function z(U,D,L){let ee=typeof U.$id=="string"?[...D,U]:D,ie=U;switch(U[i.Kind]){case"Array":return x(ie,ee,L);case"Intersect":return K(ie,ee,L);case"Not":return H(ie,ee,L);case"Object":return F(ie,ee,L);case"Record":return j(ie,ee,L);case"Ref":return V(ie,ee,L);case"This":return G(ie,ee,L);case"Tuple":return k(ie,ee,L);case"Union":return Q(ie,ee,L);default:return S(ie,L)}}function ce(U,D,L){return z(U,D,L)}C.Encode=ce})(g||(e.EncodeTransform=g={}))}}),Jg=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/compiler.js"(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TypeCompiler=e.Policy=e.TypeCompilerTypeGuardError=e.TypeCompilerUnknownTypeError=e.TypeCheck=void 0;var t=Hg(),r=hn(),n=bo(),i=gl(),s=go(),o=Ws(),a=Gt(),l=class{constructor(F,j,V,G){this.schema=F,this.references=j,this.checkFunc=V,this.code=G,this.hasTransform=t.HasTransform.Has(F,j)}Code(){return this.code}Errors(F){return(0,n.Errors)(this.schema,this.references,F)}Check(F){return this.checkFunc(F)}Decode(F){if(!this.checkFunc(F))throw new t.TransformDecodeCheckError(this.schema,F,this.Errors(F).First());return this.hasTransform?t.DecodeTransform.Decode(this.schema,this.references,F):F}Encode(F){let j=this.hasTransform?t.EncodeTransform.Encode(this.schema,this.references,F):F;if(!this.checkFunc(j))throw new t.TransformEncodeCheckError(this.schema,F,this.Errors(F).First());return j}};e.TypeCheck=l;var c;(function(F){function j(Q){return Q===36}F.DollarSign=j;function V(Q){return Q===95}F.IsUnderscore=V;function G(Q){return Q>=65&&Q<=90||Q>=97&&Q<=122}F.IsAlpha=G;function k(Q){return Q>=48&&Q<=57}F.IsNumeric=k})(c||(c={}));var d;(function(F){function j(Q){return Q.length===0?!1:c.IsNumeric(Q.charCodeAt(0))}function V(Q){if(j(Q))return!1;for(let z=0;z<Q.length;z++){let ce=Q.charCodeAt(z);if(!(c.IsAlpha(ce)||c.IsNumeric(ce)||c.DollarSign(ce)||c.IsUnderscore(ce)))return!1}return!0}function G(Q){return Q.replace(/'/g,"\\'")}function k(Q,z){return V(z)?`${Q}.${z}`:`${Q}['${G(z)}']`}F.Encode=k})(d||(d={}));var g;(function(F){function j(V){let G=[];for(let k=0;k<V.length;k++){let Q=V.charCodeAt(k);c.IsNumeric(Q)||c.IsAlpha(Q)?G.push(V.charAt(k)):G.push(`_${Q}_`)}return G.join("").replace(/__/g,"_")}F.Encode=j})(g||(g={}));var C;(function(F){function j(V){return V.replace(/'/g,"\\'")}F.Escape=j})(C||(C={}));var S=class extends a.TypeBoxError{constructor(F){super("Unknown type"),this.schema=F}};e.TypeCompilerUnknownTypeError=S;var x=class extends a.TypeBoxError{constructor(F){super("Preflight validation check failed to guard for the given schema"),this.schema=F}};e.TypeCompilerTypeGuardError=x;var K;(function(F){function j(z,ce,U){return i.TypeSystemPolicy.ExactOptionalPropertyTypes?`('${ce}' in ${z} ? ${U} : true)`:`(${d.Encode(z,ce)} !== undefined ? ${U} : true)`}F.IsExactOptionalProperty=j;function V(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null)`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}))`}F.IsObjectLike=V;function G(z){return i.TypeSystemPolicy.AllowArrayObject?`(typeof ${z} === 'object' && ${z} !== null && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`:`(typeof ${z} === 'object' && ${z} !== null && !Array.isArray(${z}) && !(${z} instanceof Date) && !(${z} instanceof Uint8Array))`}F.IsRecordLike=G;function k(z){return i.TypeSystemPolicy.AllowNaN?`typeof ${z} === 'number'`:`(typeof ${z} === 'number' && Number.isFinite(${z}))`}F.IsNumberLike=k;function Q(z){return i.TypeSystemPolicy.AllowNullVoid?`(${z} === undefined || ${z} === null)`:`${z} === undefined`}F.IsVoidLike=Q})(K||(e.Policy=K={}));var H;(function(F){function j(O){return O[a.Kind]==="Any"||O[a.Kind]==="Unknown"}function*V(O,ue,$){yield"true"}function*G(O,ue,$){yield`Array.isArray(${$})`;let[he,ne]=[De("value","any"),De("acc","number")];(0,r.IsNumber)(O.maxItems)&&(yield`${$}.length <= ${O.maxItems}`),(0,r.IsNumber)(O.minItems)&&(yield`${$}.length >= ${O.minItems}`);let le=re(O.items,ue,"value");if(yield`${$}.every((${he}) => ${le})`,a.TypeGuard.TSchema(O.contains)||(0,r.IsNumber)(O.minContains)||(0,r.IsNumber)(O.maxContains)){let Ae=a.TypeGuard.TSchema(O.contains)?O.contains:a.Type.Never(),Ue=re(Ae,ue,"value"),Ye=(0,r.IsNumber)(O.minContains)?[`(count >= ${O.minContains})`]:[],He=(0,r.IsNumber)(O.maxContains)?[`(count <= ${O.maxContains})`]:[],Ze=`const count = value.reduce((${ne}, ${he}) => ${Ue} ? acc + 1 : acc, 0)`,zt=["(count > 0)",...Ye,...He].join(" && ");yield`((${he}) => { ${Ze}; return ${zt}})(${$})`}O.uniqueItems===!0&&(yield`((${he}) => { const set = new Set(); for(const element of value) { const hashed = hash(element); if(set.has(hashed)) { return false } else { set.add(hashed) } } return true } )(${$})`)}function*k(O,ue,$){yield`(typeof value === 'object' && Symbol.asyncIterator in ${$})`}function*Q(O,ue,$){yield`(typeof ${$} === 'bigint')`,(0,r.IsBigInt)(O.exclusiveMaximum)&&(yield`${$} < BigInt(${O.exclusiveMaximum})`),(0,r.IsBigInt)(O.exclusiveMinimum)&&(yield`${$} > BigInt(${O.exclusiveMinimum})`),(0,r.IsBigInt)(O.maximum)&&(yield`${$} <= BigInt(${O.maximum})`),(0,r.IsBigInt)(O.minimum)&&(yield`${$} >= BigInt(${O.minimum})`),(0,r.IsBigInt)(O.multipleOf)&&(yield`(${$} % BigInt(${O.multipleOf})) === 0`)}function*z(O,ue,$){yield`(typeof ${$} === 'boolean')`}function*ce(O,ue,$){yield*q(O.returns,ue,`${$}.prototype`)}function*U(O,ue,$){yield`(${$} instanceof Date) && Number.isFinite(${$}.getTime())`,(0,r.IsNumber)(O.exclusiveMaximumTimestamp)&&(yield`${$}.getTime() < ${O.exclusiveMaximumTimestamp}`),(0,r.IsNumber)(O.exclusiveMinimumTimestamp)&&(yield`${$}.getTime() > ${O.exclusiveMinimumTimestamp}`),(0,r.IsNumber)(O.maximumTimestamp)&&(yield`${$}.getTime() <= ${O.maximumTimestamp}`),(0,r.IsNumber)(O.minimumTimestamp)&&(yield`${$}.getTime() >= ${O.minimumTimestamp}`),(0,r.IsNumber)(O.multipleOfTimestamp)&&(yield`(${$}.getTime() % ${O.multipleOfTimestamp}) === 0`)}function*D(O,ue,$){yield`(typeof ${$} === 'function')`}function*L(O,ue,$){yield`(typeof ${$} === 'number' && Number.isInteger(${$}))`,(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${$} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${$} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${$} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${$} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${$} % ${O.multipleOf}) === 0`)}function*ee(O,ue,$){let he=O.allOf.map(ne=>re(ne,ue,$)).join(" && ");if(O.unevaluatedProperties===!1){let ne=ge(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),le=`Object.getOwnPropertyNames(${$}).every(key => ${ne}.test(key))`;yield`(${he} && ${le})`}else if(a.TypeGuard.TSchema(O.unevaluatedProperties)){let ne=ge(`${new RegExp(a.KeyResolver.ResolvePattern(O))};`),le=`Object.getOwnPropertyNames(${$}).every(key => ${ne}.test(key) || ${re(O.unevaluatedProperties,ue,`${$}[key]`)})`;yield`(${he} && ${le})`}else yield`(${he})`}function*ie(O,ue,$){yield`(typeof value === 'object' && Symbol.iterator in ${$})`}function*Y(O,ue,$){typeof O.const=="number"||typeof O.const=="boolean"?yield`(${$} === ${O.const})`:yield`(${$} === '${C.Escape(O.const)}')`}function*se(O,ue,$){yield"false"}function*B(O,ue,$){yield`(!${re(O.not,ue,$)})`}function*W(O,ue,$){yield`(${$} === null)`}function*X(O,ue,$){yield K.IsNumberLike($),(0,r.IsNumber)(O.exclusiveMaximum)&&(yield`${$} < ${O.exclusiveMaximum}`),(0,r.IsNumber)(O.exclusiveMinimum)&&(yield`${$} > ${O.exclusiveMinimum}`),(0,r.IsNumber)(O.maximum)&&(yield`${$} <= ${O.maximum}`),(0,r.IsNumber)(O.minimum)&&(yield`${$} >= ${O.minimum}`),(0,r.IsNumber)(O.multipleOf)&&(yield`(${$} % ${O.multipleOf}) === 0`)}function*fe(O,ue,$){yield K.IsObjectLike($),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${O.maxProperties}`);let he=Object.getOwnPropertyNames(O.properties);for(let ne of he){let le=d.Encode($,ne),Ae=O.properties[ne];if(O.required&&O.required.includes(ne))yield*q(Ae,ue,le),(a.ExtendsUndefined.Check(Ae)||j(Ae))&&(yield`('${ne}' in ${$})`);else{let Ue=re(Ae,ue,le);yield K.IsExactOptionalProperty($,ne,Ue)}}if(O.additionalProperties===!1)if(O.required&&O.required.length===he.length)yield`Object.getOwnPropertyNames(${$}).length === ${he.length}`;else{let ne=`[${he.map(le=>`'${le}'`).join(", ")}]`;yield`Object.getOwnPropertyNames(${$}).every(key => ${ne}.includes(key))`}if(typeof O.additionalProperties=="object"){let ne=re(O.additionalProperties,ue,`${$}[key]`),le=`[${he.map(Ae=>`'${Ae}'`).join(", ")}]`;yield`(Object.getOwnPropertyNames(${$}).every(key => ${le}.includes(key) || ${ne}))`}}function*f(O,ue,$){yield`(typeof value === 'object' && typeof ${$}.then === 'function')`}function*_(O,ue,$){yield K.IsRecordLike($),(0,r.IsNumber)(O.minProperties)&&(yield`Object.getOwnPropertyNames(${$}).length >= ${O.minProperties}`),(0,r.IsNumber)(O.maxProperties)&&(yield`Object.getOwnPropertyNames(${$}).length <= ${O.maxProperties}`);let[he,ne]=Object.entries(O.patternProperties)[0],le=ge(`${new RegExp(he)}`),Ae=re(ne,ue,"value"),Ue=a.TypeGuard.TSchema(O.additionalProperties)?re(O.additionalProperties,ue,$):O.additionalProperties===!1?"false":"true",Ye=`(${le}.test(key) ? ${Ae} : ${Ue})`;yield`(Object.entries(${$}).every(([key, value]) => ${Ye}))`}function*E(O,ue,$){let he=(0,s.Deref)(O,ue);if(te.functions.has(O.$ref))return yield`${pe(O.$ref)}(${$})`;yield*q(he,ue,$)}function*M(O,ue,$){yield`(typeof ${$} === 'string')`,(0,r.IsNumber)(O.maxLength)&&(yield`${$}.length <= ${O.maxLength}`),(0,r.IsNumber)(O.minLength)&&(yield`${$}.length >= ${O.minLength}`),O.pattern!==void 0&&(yield`${ge(`${new RegExp(O.pattern)};`)}.test(${$})`),O.format!==void 0&&(yield`format('${O.format}', ${$})`)}function*N(O,ue,$){yield`(typeof ${$} === 'symbol')`}function*R(O,ue,$){yield`(typeof ${$} === 'string')`,yield`${ge(`${new RegExp(O.pattern)};`)}.test(${$})`}function*y(O,ue,$){yield`${pe(O.$ref)}(${$})`}function*T(O,ue,$){if(yield`Array.isArray(${$})`,O.items===void 0)return yield`${$}.length === 0`;yield`(${$}.length === ${O.maxItems})`;for(let he=0;he<O.items.length;he++)yield`${re(O.items[he],ue,`${$}[${he}]`)}`}function*w(O,ue,$){yield`${$} === undefined`}function*u(O,ue,$){yield`(${O.anyOf.map(ne=>re(ne,ue,$)).join(" || ")})`}function*A(O,ue,$){yield`${$} instanceof Uint8Array`,(0,r.IsNumber)(O.maxByteLength)&&(yield`(${$}.length <= ${O.maxByteLength})`),(0,r.IsNumber)(O.minByteLength)&&(yield`(${$}.length >= ${O.minByteLength})`)}function*v(O,ue,$){yield"true"}function*m(O,ue,$){yield K.IsVoidLike($)}function*P(O,ue,$){let he=te.instances.size;te.instances.set(he,O),yield`kind('${O[a.Kind]}', ${he}, ${$})`}function*q(O,ue,$,he=!0){let ne=(0,r.IsString)(O.$id)?[...ue,O]:ue,le=O;if(he&&(0,r.IsString)(O.$id)){let Ae=pe(O.$id);if(te.functions.has(Ae))return yield`${Ae}(${$})`;{let Ue=Pe(Ae,O,ue,"value",!1);return te.functions.set(Ae,Ue),yield`${Ae}(${$})`}}switch(le[a.Kind]){case"Any":return yield*V(le,ne,$);case"Array":return yield*G(le,ne,$);case"AsyncIterator":return yield*k(le,ne,$);case"BigInt":return yield*Q(le,ne,$);case"Boolean":return yield*z(le,ne,$);case"Constructor":return yield*ce(le,ne,$);case"Date":return yield*U(le,ne,$);case"Function":return yield*D(le,ne,$);case"Integer":return yield*L(le,ne,$);case"Intersect":return yield*ee(le,ne,$);case"Iterator":return yield*ie(le,ne,$);case"Literal":return yield*Y(le,ne,$);case"Never":return yield*se(le,ne,$);case"Not":return yield*B(le,ne,$);case"Null":return yield*W(le,ne,$);case"Number":return yield*X(le,ne,$);case"Object":return yield*fe(le,ne,$);case"Promise":return yield*f(le,ne,$);case"Record":return yield*_(le,ne,$);case"Ref":return yield*E(le,ne,$);case"String":return yield*M(le,ne,$);case"Symbol":return yield*N(le,ne,$);case"TemplateLiteral":return yield*R(le,ne,$);case"This":return yield*y(le,ne,$);case"Tuple":return yield*T(le,ne,$);case"Undefined":return yield*w(le,ne,$);case"Union":return yield*u(le,ne,$);case"Uint8Array":return yield*A(le,ne,$);case"Unknown":return yield*v(le,ne,$);case"Void":return yield*m(le,ne,$);default:if(!a.TypeRegistry.Has(le[a.Kind]))throw new S(O);return yield*P(le,ne,$)}}let te={language:"javascript",functions:new Map,variables:new Map,instances:new Map};function re(O,ue,$,he=!0){return`(${[...q(O,ue,$,he)].join(" && ")})`}function pe(O){return`check_${g.Encode(O)}`}function ge(O){let ue=`local_${te.variables.size}`;return te.variables.set(ue,`const ${ue} = ${O}`),ue}function Pe(O,ue,$,he,ne=!0){let[le,Ae]=[`
|
|
49
|
+
`,Ze=>"".padStart(Ze," ")],Ue=De("value","any"),Ye=_r("boolean"),He=[...q(ue,$,he,ne)].map(Ze=>`${Ae(4)}${Ze}`).join(` &&${le}`);return`function ${O}(${Ue})${Ye} {${le}${Ae(2)}return (${le}${He}${le}${Ae(2)})
|
|
50
|
+
}`}function De(O,ue){let $=te.language==="typescript"?`: ${ue}`:"";return`${O}${$}`}function _r(O){return te.language==="typescript"?`: ${O}`:""}function be(O,ue,$){let he=Pe("check",O,ue,"value"),ne=De("value","any"),le=_r("boolean"),Ae=[...te.functions.values()],Ue=[...te.variables.values()],Ye=(0,r.IsString)(O.$id)?`return function check(${ne})${le} {
|
|
51
51
|
return ${pe(O.$id)}(value)
|
|
52
52
|
}`:`return ${he}`;return[...Ue,...Ae,Ye].join(`
|
|
53
|
-
`)}function
|
|
54
|
-
`)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};
|
|
53
|
+
`)}function nr(...O){let ue={language:"javascript"},[$,he,ne]=O.length===2&&(0,r.IsArray)(O[1])?[O[0],O[1],ue]:O.length===2&&!(0,r.IsArray)(O[1])?[O[0],[],O[1]]:O.length===3?[O[0],O[1],O[2]]:O.length===1?[O[0],[],ue]:[null,[],ue];if(te.language=ne.language,te.variables.clear(),te.functions.clear(),te.instances.clear(),!a.TypeGuard.TSchema($))throw new x($);for(let le of he)if(!a.TypeGuard.TSchema(le))throw new x(le);return be($,he,ne)}F.Code=nr;function wr(O,ue=[]){let $=nr(O,ue,{language:"javascript"}),he=globalThis.Function("kind","format","hash",$),ne=new Map(te.instances);function le(He,Ze,zt){if(!a.TypeRegistry.Has(He)||!ne.has(Ze))return!1;let zr=a.TypeRegistry.Get(He),Gr=ne.get(Ze);return zr(Gr,zt)}function Ae(He,Ze){return a.FormatRegistry.Has(He)?a.FormatRegistry.Get(He)(Ze):!1}function Ue(He){return(0,o.Hash)(He)}let Ye=he(le,Ae,Ue);return new l(O,ue,Ye,$)}F.Compile=wr})(H||(e.TypeCompiler=H={}))}}),Xg=Ne({"../../../node_modules/.pnpm/@sinclair+typebox@0.31.28/node_modules/@sinclair/typebox/compiler/index.js"(e){"use strict";var t=e&&e.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var l=Object.getOwnPropertyDescriptor(s,o);(!l||("get"in l?!s.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,l)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),r=e&&e.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&t(s,i,o)};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueErrorIterator=e.ValueErrorType=void 0;var n=Gg();Object.defineProperty(e,"ValueErrorType",{enumerable:!0,get:function(){return n.ValueErrorType}}),Object.defineProperty(e,"ValueErrorIterator",{enumerable:!0,get:function(){return n.ValueErrorIterator}}),r(Jg(),e)}}),eo=ft(Vg(),1),Yg=ft(qg(),1),bl=!1,ml=!1;eo.isNode&&(process?.env?.LOGGER_TIME_PREFIX&&(bl=process?.env?.LOGGER_TIME_PREFIX==="true"),process?.env?.LOGGER_PERF_PREFIX&&(ml=process?.env?.LOGGER_PERF_PREFIX==="true"));var Qg={prefix:void 0,time:bl,delta:ml,dimDebugOnServer:!0,printOriginOnServer:!0,serverInspectOptions:{},customFormattersOnServer:!0,printStackLinesOnServer:!1,dim:!0},Ss=[],vl=class{sinceFirst=0;sinceLast=0;time=!1;delta=!1;constructor(e,t,r,n){Object.assign(this,{sinceFirst:e,sinceLast:t,time:r,delta:n})}toString(){let e=this.sinceFirst*.001,t=e.toFixed(e<5?2:1),r=this.sinceLast<1e3?`${this.sinceLast.toFixed(0)}`.padStart(5," "):`${`${(this.sinceLast*.001).toFixed(this.sinceLast<1e4?1:0)}`.padStart(4," ")}s`;return`[${[this.time?t:null,this.delta?r:null].filter(n=>n!=null).join(",")}]`}},_l=class{constructor(e,t){Object.assign(this,{style:e,string:t})}},Jn=!1,Oe=class rt{static ERROR=2;static WARN=4;static INFO=6;static LOG=6;static DEBUG=8;static VERBOSE=10;static firstLog=0;static lastLog=0;static setup(t=rt.INFO,r={}){r=Object.assign({},Qg,r),t>10&&console.debug("setup logger",{config:r});let n=this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}),i=(...l)=>{typeof window<"u"&&window?.FORCE_DISABLE_LOGLEVEL&&n(...l)};i.isDisabled=!0,i.isEnabled=!1;let s=this.wrapLog(console.groupCollapsed,r),o=(l,c)=>{function d(...C){let S=C[C.length-1];return S===i?S():(s(...C.slice(0,-1)),(async()=>{try{let x=S();return x instanceof Promise?await x:x}finally{console.groupEnd()}})())}let g=Object.assign(c.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:c});return l?g:Object.assign(i.bind({}),{isEnabled:l,isDisabled:!l,group:d,force:g})},a=o(t>=rt.ERROR,this.wrapLog(console.error,r));return{ERROR:(...l)=>(a(...l),new Error(l.map(c=>typeof c=="string"?c:(0,Yg.default)(c)).join(" "))),WARN:o(t>=rt.WARN,this.wrapLog(console.warn,r)),LOG:o(t>=rt.INFO,this.wrapLog(console.log,r)),DEBUG:o(t>=rt.DEBUG,this.wrapLog(console.log,{...r,dim:r.dimDebugOnServer})),VERBOSE:o(t>=rt.VERBOSE,this.wrapLog(console.debug,{...r,dim:r.dimDebugOnServer}))}}static wrapLog(t,r){if(eo.isNode)return t.bind(console);{let n=[];if(r.time||r.delta){let i=eo.isBrowser&&navigator.userAgent.includes("Chrome")?["",rt.timeStr(!!r.time,!!r.delta)]:[];n.push(...i)}return r.prefix&&(Jn?n.push(new _l("dim",r.prefix)):n.push(r.prefix)),t.bind(console,...n)}}static timeStr(t,r,n=0){if(!performance.now)return;let i=performance.now();rt.firstLog||(rt.firstLog=i,rt.lastLog=i);let s=new vl(i-rt.firstLog,i-rt.lastLog,t,r);return rt.lastLog=i,n?s.toString():s}static getOriginFromStack(t){let r=!1;for(let n of t.split(`
|
|
54
|
+
`)){let i=n.match(/^\s+at\s+(.*)/);if(i){if(r)return i[1].trim().replace(__dirname,"");r=!0}}}};eo.isBrowser&&(window.devtoolsFormatters=window.devtoolsFormatters??[],window.devtoolsFormatters.push({header:e=>{if(Ss&&Ss.length){for(let t of Ss)if(t.match(e))return["span",{},t.format(e)]}return null},hasBody:()=>!0},{header:e=>{if(!(e instanceof vl))return null;Jn||(Jn=!0);let t=Oe.timeStr(e.time,e.delta);return["span",{style:"font-weight: light; color: grey"},t?.toString()]},hasBody:()=>!1},{header:e=>e instanceof _l?(Jn||(Jn=!0),["span",{style:"font-weight: light; color: grey; "},e.string]):null,hasBody:()=>!1}));var Zg=typeof global=="object"&&global&&global.Object===Object&&global,wl=Zg,eb=typeof self=="object"&&self&&self.Object===Object&&self,tb=wl||eb||Function("return this")(),ct=tb,rb=ct.Symbol,Vt=rb,Tl=Object.prototype,nb=Tl.hasOwnProperty,ib=Tl.toString,Gn=Vt?Vt.toStringTag:void 0;function ob(e){var t=nb.call(e,Gn),r=e[Gn];try{e[Gn]=void 0;var n=!0}catch{}var i=ib.call(e);return n&&(t?e[Gn]=r:delete e[Gn]),i}var sb=ob,ab=Object.prototype,ub=ab.toString;function cb(e){return ub.call(e)}var lb=cb,fb="[object Null]",db="[object Undefined]",fc=Vt?Vt.toStringTag:void 0;function pb(e){return e==null?e===void 0?db:fb:fc&&fc in Object(e)?sb(e):lb(e)}var yn=pb;function hb(e){return e!=null&&typeof e=="object"}var br=hb,yb="[object Symbol]";function gb(e){return typeof e=="symbol"||br(e)&&yn(e)==yb}var dn=gb;function bb(e,t){for(var r=-1,n=e==null?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var Al=bb,mb=Array.isArray,Mt=mb,vb=1/0,dc=Vt?Vt.prototype:void 0,pc=dc?dc.toString:void 0;function Ol(e){if(typeof e=="string")return e;if(Mt(e))return Al(e,Ol)+"";if(dn(e))return pc?pc.call(e):"";var t=e+"";return t=="0"&&1/e==-vb?"-0":t}var _b=Ol,wb=/\s/;function Tb(e){for(var t=e.length;t--&&wb.test(e.charAt(t)););return t}var Ab=Tb,Ob=/^\s+/;function Eb(e){return e&&e.slice(0,Ab(e)+1).replace(Ob,"")}var Ib=Eb;function Sb(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var er=Sb,hc=NaN,xb=/^[-+]0x[0-9a-f]+$/i,Rb=/^0b[01]+$/i,Pb=/^0o[0-7]+$/i,$b=parseInt;function Nb(e){if(typeof e=="number")return e;if(dn(e))return hc;if(er(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=er(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=Ib(e);var r=Rb.test(e);return r||Pb.test(e)?$b(e.slice(2),r?2:8):xb.test(e)?hc:+e}var Cb=Nb,yc=1/0,Ub=17976931348623157e292;function Mb(e){if(!e)return e===0?e:0;if(e=Cb(e),e===yc||e===-yc){var t=e<0?-1:1;return t*Ub}return e===e?e:0}var Db=Mb;function Bb(e){var t=Db(e),r=t%1;return t===t?r?t-r:t:0}var gc=Bb;function Lb(e){return e}var mo=Lb,jb="[object AsyncFunction]",kb="[object Function]",Fb="[object GeneratorFunction]",Kb="[object Proxy]";function Vb(e){if(!er(e))return!1;var t=yn(e);return t==kb||t==Fb||t==jb||t==Kb}var El=Vb,qb=ct["__core-js_shared__"],xs=qb,bc=function(){var e=/[^.]+$/.exec(xs&&xs.keys&&xs.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function zb(e){return!!bc&&bc in e}var Gb=zb,Wb=Function.prototype,Hb=Wb.toString;function Jb(e){if(e!=null){try{return Hb.call(e)}catch{}try{return e+""}catch{}}return""}var Kr=Jb,Xb=/[\\^$.*+?()[\]{}|]/g,Yb=/^\[object .+?Constructor\]$/,Qb=Function.prototype,Zb=Object.prototype,em=Qb.toString,tm=Zb.hasOwnProperty,rm=RegExp("^"+em.call(tm).replace(Xb,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function nm(e){if(!er(e)||Gb(e))return!1;var t=El(e)?rm:Yb;return t.test(Kr(e))}var im=nm;function om(e,t){return e?.[t]}var sm=om;function am(e,t){var r=sm(e,t);return im(r)?r:void 0}var Vr=am,um=Vr(ct,"WeakMap"),Yn=um,cm=Yn&&new Yn,to=cm,lm=to?function(e,t){return to.set(e,t),e}:mo,Il=lm,mc=Object.create,fm=function(){function e(){}return function(t){if(!er(t))return{};if(mc)return mc(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}(),Hs=fm;function dm(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Hs(e.prototype),n=e.apply(r,t);return er(n)?n:r}}var Qn=dm,pm=1;function hm(e,t,r){var n=t&pm,i=Qn(e);function s(){var o=this&&this!==ct&&this instanceof s?i:e;return o.apply(n?r:this,arguments)}return s}var ym=hm;function gm(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}var Js=gm,bm=Math.max;function mm(e,t,r,n){for(var i=-1,s=e.length,o=r.length,a=-1,l=t.length,c=bm(s-o,0),d=Array(l+c),g=!n;++a<l;)d[a]=t[a];for(;++i<o;)(g||i<s)&&(d[r[i]]=e[i]);for(;c--;)d[a++]=e[i++];return d}var Sl=mm,vm=Math.max;function _m(e,t,r,n){for(var i=-1,s=e.length,o=-1,a=r.length,l=-1,c=t.length,d=vm(s-a,0),g=Array(d+c),C=!n;++i<d;)g[i]=e[i];for(var S=i;++l<c;)g[S+l]=t[l];for(;++o<a;)(C||i<s)&&(g[S+r[o]]=e[i++]);return g}var xl=_m;function wm(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}var Tm=wm;function Am(){}var Xs=Am,Om=4294967295;function ro(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Om,this.__views__=[]}ro.prototype=Hs(Xs.prototype);ro.prototype.constructor=ro;var Ys=ro;function Em(){}var Rl=Em,Im=to?function(e){return to.get(e)}:Rl,Pl=Im,Sm={},vc=Sm,xm=Object.prototype,Rm=xm.hasOwnProperty;function Pm(e){for(var t=e.name+"",r=vc[t],n=Rm.call(vc,t)?r.length:0;n--;){var i=r[n],s=i.func;if(s==null||s==e)return i.name}return t}var $m=Pm;function no(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}no.prototype=Hs(Xs.prototype);no.prototype.constructor=no;var Bs=no;function Nm(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}var $l=Nm;function Cm(e){if(e instanceof Ys)return e.clone();var t=new Bs(e.__wrapped__,e.__chain__);return t.__actions__=$l(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Um=Cm,Mm=Object.prototype,Dm=Mm.hasOwnProperty;function io(e){if(br(e)&&!Mt(e)&&!(e instanceof Ys)){if(e instanceof Bs)return e;if(Dm.call(e,"__wrapped__"))return Um(e)}return new Bs(e)}io.prototype=Xs.prototype;io.prototype.constructor=io;var Bm=io;function Lm(e){var t=$m(e),r=Bm[t];if(typeof r!="function"||!(t in Ys.prototype))return!1;if(e===r)return!0;var n=Pl(r);return!!n&&e===n[0]}var jm=Lm,km=800,Fm=16,Km=Date.now;function Vm(e){var t=0,r=0;return function(){var n=Km(),i=Fm-(n-r);if(r=n,i>0){if(++t>=km)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Nl=Vm,qm=Nl(Il),Cl=qm,zm=/\{\n\/\* \[wrapped with (.+)\] \*/,Gm=/,? & /;function Wm(e){var t=e.match(zm);return t?t[1].split(Gm):[]}var Hm=Wm,Jm=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;function Xm(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(Jm,`{
|
|
55
55
|
/* [wrapped with `+t+`] */
|
|
56
|
-
`)}var hg=pg;function yg(e){return function(){return e}}var gg=yg,mg=function(){try{var e=Br(Object,"defineProperty");return e({},"",{}),e}catch{}}(),Vi=mg,vg=Vi?function(e,t){return Vi(e,"toString",{configurable:!0,enumerable:!1,value:gg(t),writable:!0})}:so,bg=vg,_g=ol(bg),Ms=_g;function wg(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var Tg=wg;function Ag(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var Og=Ag;function Ig(e){return e!==e}var Eg=Ig;function Sg(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var Rg=Sg;function Pg(e,t,r){return t===t?Rg(e,t,r):Og(e,Eg,r)}var $g=Pg;function Ng(e,t){var r=e==null?0:e.length;return!!r&&$g(e,t,0)>-1}var al=Ng,Cg=1,xg=2,Ug=8,Mg=16,Dg=32,Bg=64,Lg=128,jg=256,kg=512,Fg=[["ary",Lg],["bind",Cg],["bindKey",xg],["curry",Ug],["curryRight",Mg],["flip",kg],["partial",Dg],["partialRight",Bg],["rearg",jg]];function Kg(e,t){return Tg(Fg,function(r){var n="_."+r[0];t&r[1]&&!al(e,n)&&e.push(n)}),e.sort()}var Vg=Kg;function zg(e,t,r){var n=t+"";return Ms(e,hg(n,Vg(fg(n),r)))}var ul=zg,qg=1,Gg=2,Wg=4,Hg=8,Du=32,Bu=64;function Jg(e,t,r,n,i,s,o,a,l,c){var d=t&Hg,g=d?o:void 0,x=d?void 0:o,S=d?s:void 0,R=d?void 0:s;t|=d?Du:Bu,t&=~(d?Bu:Du),t&Wg||(t&=~(qg|Gg));var K=[e,t,i,S,g,R,x,a,l,c],H=r.apply(void 0,K);return rg(e)&&sl(H,K),H.placeholder=n,ul(H,e,t)}var cl=Jg;function Xg(e){var t=e;return t.placeholder}var Ds=Xg,Yg=9007199254740991,Qg=/^(?:0|[1-9]\d*)$/;function Zg(e,t){var r=typeof e;return t=t??Yg,!!t&&(r=="number"||r!="symbol"&&Qg.test(e))&&e>-1&&e%1==0&&e<t}var ao=Zg,em=Math.min;function tm(e,t){for(var r=e.length,n=em(t.length,r),i=il(e);n--;){var s=t[n];e[n]=ao(s,r)?i[s]:void 0}return e}var rm=tm,Lu="__lodash_placeholder__";function nm(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r];(o===t||o===Lu)&&(e[r]=Lu,s[i++]=r)}return s}var Kn=nm,im=1,om=2,sm=8,am=16,um=128,cm=512;function ll(e,t,r,n,i,s,o,a,l,c){var d=t&um,g=t&im,x=t&om,S=t&(sm|am),R=t&cm,K=x?void 0:Fn(e);function H(){for(var F=arguments.length,j=Array(F),V=F;V--;)j[V]=arguments[V];if(S)var G=Ds(H),k=jy(j,G);if(n&&(j=el(j,n,i,S)),s&&(j=tl(j,s,o,S)),F-=k,S&&F<c){var Q=Kn(j,G);return cl(e,t,ll,H.placeholder,r,j,Q,a,l,c-F)}var q=g?r:this,ce=x?q[e]:e;return F=j.length,a?j=rm(j,a):R&&F>1&&j.reverse(),d&&l<F&&(j.length=l),this&&this!==ut&&this instanceof H&&(ce=K||Fn(ce)),ce.apply(q,j)}return H}var fl=ll;function lm(e,t,r){var n=Fn(e);function i(){for(var s=arguments.length,o=Array(s),a=s,l=Ds(i);a--;)o[a]=arguments[a];var c=s<3&&o[0]!==l&&o[s-1]!==l?[]:Kn(o,l);if(s-=c.length,s<r)return cl(e,t,fl,i.placeholder,void 0,o,c,void 0,void 0,r-s);var d=this&&this!==ut&&this instanceof i?n:e;return Cs(d,this,o)}return i}var fm=lm,dm=1;function pm(e,t,r,n){var i=t&dm,s=Fn(e);function o(){for(var a=-1,l=arguments.length,c=-1,d=n.length,g=Array(d+l),x=this&&this!==ut&&this instanceof o?s:e;++c<d;)g[c]=n[c];for(;l--;)g[c++]=arguments[++a];return Cs(x,i?r:this,g)}return o}var hm=pm,ju="__lodash_placeholder__",os=1,ym=2,gm=4,ku=8,Mn=128,Fu=256,mm=Math.min;function vm(e,t){var r=e[1],n=t[1],i=r|n,s=i<(os|ym|Mn),o=n==Mn&&r==ku||n==Mn&&r==Fu&&e[7].length<=t[8]||n==(Mn|Fu)&&t[7].length<=t[8]&&r==ku;if(!(s||o))return e;n&os&&(e[2]=t[2],i|=r&os?0:gm);var a=t[3];if(a){var l=e[3];e[3]=l?el(l,a,t[4]):a,e[4]=l?Kn(e[3],ju):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?tl(l,a,t[6]):a,e[6]=l?Kn(e[5],ju):t[6]),a=t[7],a&&(e[7]=a),n&Mn&&(e[8]=e[8]==null?t[8]:mm(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var bm=vm,_m="Expected a function",Ku=1,wm=2,ss=8,as=16,us=32,Vu=64,zu=Math.max;function Tm(e,t,r,n,i,s,o,a){var l=t&wm;if(!l&&typeof e!="function")throw new TypeError(_m);var c=n?n.length:0;if(c||(t&=~(us|Vu),n=i=void 0),o=o===void 0?o:zu(Cu(o),0),a=a===void 0?a:Cu(a),c-=i?i.length:0,t&Vu){var d=n,g=i;n=i=void 0}var x=l?void 0:nl(e),S=[e,t,r,n,i,d,g,s,o,a];if(x&&bm(S,x),e=S[0],t=S[1],r=S[2],n=S[3],i=S[4],a=S[9]=S[9]===void 0?l?0:e.length:zu(S[9]-c,0),!a&&t&(ss|as)&&(t&=~(ss|as)),!t||t==Ku)var R=Cy(e,t,r);else t==ss||t==as?R=fm(e,t,a):(t==us||t==(Ku|us))&&!i.length?R=hm(e,t,r,n):R=fl.apply(void 0,S);var K=x?Zc:sl;return ul(K(R,S),e,t)}var Am=Tm;function Om(e,t,r){t=="__proto__"&&Vi?Vi(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var Im=Om;function Em(e,t){return e===t||e!==e&&t!==t}var Bs=Em,Sm=Object.prototype,Rm=Sm.hasOwnProperty;function Pm(e,t,r){var n=e[t];(!(Rm.call(e,t)&&Bs(n,r))||r===void 0&&!(t in e))&&Im(e,t,r)}var $m=Pm,qu=Math.max;function Nm(e,t,r){return t=qu(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=qu(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),Cs(e,this,a)}}var dl=Nm;function Cm(e,t){return Ms(dl(e,t,so),e+"")}var pl=Cm,xm=9007199254740991;function Um(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=xm}var Ls=Um;function Mm(e){return e!=null&&Ls(e.length)&&!Qc(e)}var hl=Mm,Dm=Object.prototype;function Bm(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Dm;return e===r}var Lm=Bm;function jm(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var km=jm,Fm="[object Arguments]";function Km(e){return hr(e)&&ln(e)==Fm}var Gu=Km,yl=Object.prototype,Vm=yl.hasOwnProperty,zm=yl.propertyIsEnumerable,qm=Gu(function(){return arguments}())?Gu:function(e){return hr(e)&&Vm.call(e,"callee")&&!zm.call(e,"callee")},js=qm;function Gm(){return!1}var Wm=Gm,gl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Wu=gl&&typeof module=="object"&&module&&!module.nodeType&&module,Hm=Wu&&Wu.exports===gl,Hu=Hm?ut.Buffer:void 0,Jm=Hu?Hu.isBuffer:void 0,Xm=Jm||Wm,ms=Xm,Ym="[object Arguments]",Qm="[object Array]",Zm="[object Boolean]",ev="[object Date]",tv="[object Error]",rv="[object Function]",nv="[object Map]",iv="[object Number]",ov="[object Object]",sv="[object RegExp]",av="[object Set]",uv="[object String]",cv="[object WeakMap]",lv="[object ArrayBuffer]",fv="[object DataView]",dv="[object Float32Array]",pv="[object Float64Array]",hv="[object Int8Array]",yv="[object Int16Array]",gv="[object Int32Array]",mv="[object Uint8Array]",vv="[object Uint8ClampedArray]",bv="[object Uint16Array]",_v="[object Uint32Array]",Ne={};Ne[dv]=Ne[pv]=Ne[hv]=Ne[yv]=Ne[gv]=Ne[mv]=Ne[vv]=Ne[bv]=Ne[_v]=!0;Ne[Ym]=Ne[Qm]=Ne[lv]=Ne[Zm]=Ne[fv]=Ne[ev]=Ne[tv]=Ne[rv]=Ne[nv]=Ne[iv]=Ne[ov]=Ne[sv]=Ne[av]=Ne[uv]=Ne[cv]=!1;function wv(e){return hr(e)&&Ls(e.length)&&!!Ne[ln(e)]}var Tv=wv;function Av(e){return function(t){return e(t)}}var ml=Av,vl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,jn=vl&&typeof module=="object"&&module&&!module.nodeType&&module,Ov=jn&&jn.exports===vl,cs=Ov&&Hc.process,Iv=function(){try{var e=jn&&jn.require&&jn.require("util").types;return e||cs&&cs.binding&&cs.binding("util")}catch{}}(),Ju=Iv,Xu=Ju&&Ju.isTypedArray,Ev=Xu?ml(Xu):Tv,bl=Ev,Sv=Object.prototype,Rv=Sv.hasOwnProperty;function Pv(e,t){var r=Mt(e),n=!r&&js(e),i=!r&&!n&&ms(e),s=!r&&!n&&!i&&bl(e),o=r||n||i||s,a=o?km(e.length,String):[],l=a.length;for(var c in e)(t||Rv.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||ao(c,l)))&&a.push(c);return a}var $v=Pv;function Nv(e,t){return function(r){return e(t(r))}}var Cv=Nv,xv=Cv(Object.keys,Object),Uv=xv,Mv=Object.prototype,Dv=Mv.hasOwnProperty;function Bv(e){if(!Lm(e))return Uv(e);var t=[];for(var r in Object(e))Dv.call(e,r)&&r!="constructor"&&t.push(r);return t}var Lv=Bv;function jv(e){return hl(e)?$v(e):Lv(e)}var _l=jv,kv=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Fv=/^\w*$/;function Kv(e,t){if(Mt(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||an(e)?!0:Fv.test(e)||!kv.test(e)||t!=null&&e in Object(t)}var ks=Kv,Vv=Br(Object,"create"),Vn=Vv;function zv(){this.__data__=Vn?Vn(null):{},this.size=0}var qv=zv;function Gv(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Wv=Gv,Hv="__lodash_hash_undefined__",Jv=Object.prototype,Xv=Jv.hasOwnProperty;function Yv(e){var t=this.__data__;if(Vn){var r=t[e];return r===Hv?void 0:r}return Xv.call(t,e)?t[e]:void 0}var Qv=Yv,Zv=Object.prototype,eb=Zv.hasOwnProperty;function tb(e){var t=this.__data__;return Vn?t[e]!==void 0:eb.call(t,e)}var rb=tb,nb="__lodash_hash_undefined__";function ib(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Vn&&t===void 0?nb:t,this}var ob=ib;function fn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}fn.prototype.clear=qv;fn.prototype.delete=Wv;fn.prototype.get=Qv;fn.prototype.has=rb;fn.prototype.set=ob;var Yu=fn;function sb(){this.__data__=[],this.size=0}var ab=sb;function ub(e,t){for(var r=e.length;r--;)if(Bs(e[r][0],t))return r;return-1}var uo=ub,cb=Array.prototype,lb=cb.splice;function fb(e){var t=this.__data__,r=uo(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():lb.call(t,r,1),--this.size,!0}var db=fb;function pb(e){var t=this.__data__,r=uo(t,e);return r<0?void 0:t[r][1]}var hb=pb;function yb(e){return uo(this.__data__,e)>-1}var gb=yb;function mb(e,t){var r=this.__data__,n=uo(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var vb=mb;function dn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}dn.prototype.clear=ab;dn.prototype.delete=db;dn.prototype.get=hb;dn.prototype.has=gb;dn.prototype.set=vb;var co=dn,bb=Br(ut,"Map"),zn=bb;function _b(){this.size=0,this.__data__={hash:new Yu,map:new(zn||co),string:new Yu}}var wb=_b;function Tb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Ab=Tb;function Ob(e,t){var r=e.__data__;return Ab(t)?r[typeof t=="string"?"string":"hash"]:r.map}var lo=Ob;function Ib(e){var t=lo(this,e).delete(e);return this.size-=t?1:0,t}var Eb=Ib;function Sb(e){return lo(this,e).get(e)}var Rb=Sb;function Pb(e){return lo(this,e).has(e)}var $b=Pb;function Nb(e,t){var r=lo(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var Cb=Nb;function pn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}pn.prototype.clear=wb;pn.prototype.delete=Eb;pn.prototype.get=Rb;pn.prototype.has=$b;pn.prototype.set=Cb;var fo=pn,xb="Expected a function";function Fs(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(xb);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(Fs.Cache||fo),r}Fs.Cache=fo;var Ub=Fs,Mb=500;function Db(e){var t=Ub(e,function(n){return r.size===Mb&&r.clear(),n}),r=t.cache;return t}var Bb=Db,Lb=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,jb=/\\(\\)?/g,kb=Bb(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Lb,function(r,n,i,s){t.push(i?s.replace(jb,"$1"):n||r)}),t}),Fb=kb;function Kb(e){return e==null?"":Bh(e)}var Vb=Kb;function zb(e,t){return Mt(e)?e:ks(e,t)?[e]:Fb(Vb(e))}var po=zb,qb=1/0;function Gb(e){if(typeof e=="string"||an(e))return e;var t=e+"";return t=="0"&&1/e==-qb?"-0":t}var Hn=Gb;function Wb(e,t){t=po(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Hn(t[r++])];return r&&r==n?e:void 0}var Ks=Wb;function Hb(e,t,r){var n=e==null?void 0:Ks(e,t);return n===void 0?r:n}var Jb=Hb;function Xb(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var wl=Xb,Qu=Ft?Ft.isConcatSpreadable:void 0;function Yb(e){return Mt(e)||js(e)||!!(Qu&&e&&e[Qu])}var Qb=Yb;function Tl(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=Qb),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Tl(a,t-1,r,n,i):wl(i,a):n||(i[i.length]=a)}return i}var Zb=Tl;function e_(e){var t=e==null?0:e.length;return t?Zb(e,1):[]}var t_=e_;function r_(e){return Ms(dl(e,void 0,t_),e+"")}var n_=r_;function i_(){this.__data__=new co,this.size=0}var o_=i_;function s_(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var a_=s_;function u_(e){return this.__data__.get(e)}var c_=u_;function l_(e){return this.__data__.has(e)}var f_=l_,d_=200;function p_(e,t){var r=this.__data__;if(r instanceof co){var n=r.__data__;if(!zn||n.length<d_-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new fo(n)}return r.set(e,t),this.size=r.size,this}var h_=p_;function hn(e){var t=this.__data__=new co(e);this.size=t.size}hn.prototype.clear=o_;hn.prototype.delete=a_;hn.prototype.get=c_;hn.prototype.has=f_;hn.prototype.set=h_;var Ci=hn;function y_(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var g_=y_;function m_(){return[]}var v_=m_,b_=Object.prototype,__=b_.propertyIsEnumerable,Zu=Object.getOwnPropertySymbols,w_=Zu?function(e){return e==null?[]:(e=Object(e),g_(Zu(e),function(t){return __.call(e,t)}))}:v_,T_=w_;function A_(e,t,r){var n=t(e);return Mt(e)?n:wl(n,r(e))}var O_=A_;function I_(e){return O_(e,_l,T_)}var ec=I_,E_=Br(ut,"DataView"),vs=E_,S_=Br(ut,"Promise"),bs=S_,R_=Br(ut,"Set"),sn=R_,tc="[object Map]",P_="[object Object]",rc="[object Promise]",nc="[object Set]",ic="[object WeakMap]",oc="[object DataView]",$_=Dr(vs),N_=Dr(zn),C_=Dr(bs),x_=Dr(sn),U_=Dr(kn),xr=ln;(vs&&xr(new vs(new ArrayBuffer(1)))!=oc||zn&&xr(new zn)!=tc||bs&&xr(bs.resolve())!=rc||sn&&xr(new sn)!=nc||kn&&xr(new kn)!=ic)&&(xr=function(e){var t=ln(e),r=t==P_?e.constructor:void 0,n=r?Dr(r):"";if(n)switch(n){case $_:return oc;case N_:return tc;case C_:return rc;case x_:return nc;case U_:return ic}return t});var sc=xr,M_=ut.Uint8Array,ac=M_,D_="__lodash_hash_undefined__";function B_(e){return this.__data__.set(e,D_),this}var L_=B_;function j_(e){return this.__data__.has(e)}var k_=j_;function zi(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new fo;++t<r;)this.add(e[t])}zi.prototype.add=zi.prototype.push=L_;zi.prototype.has=k_;var Al=zi;function F_(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var K_=F_;function V_(e,t){return e.has(t)}var Ol=V_,z_=1,q_=2;function G_(e,t,r,n,i,s){var o=r&z_,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var g=-1,x=!0,S=r&q_?new Al:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var R=e[g],K=t[g];if(n)var H=o?n(K,R,g,t,e,s):n(R,K,g,e,t,s);if(H!==void 0){if(H)continue;x=!1;break}if(S){if(!K_(t,function(F,j){if(!Ol(S,j)&&(R===F||i(R,F,r,n,s)))return S.push(j)})){x=!1;break}}else if(!(R===K||i(R,K,r,n,s))){x=!1;break}}return s.delete(e),s.delete(t),x}var Il=G_;function W_(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var H_=W_;function J_(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var El=J_,X_=1,Y_=2,Q_="[object Boolean]",Z_="[object Date]",ew="[object Error]",tw="[object Map]",rw="[object Number]",nw="[object RegExp]",iw="[object Set]",ow="[object String]",sw="[object Symbol]",aw="[object ArrayBuffer]",uw="[object DataView]",uc=Ft?Ft.prototype:void 0,ls=uc?uc.valueOf:void 0;function cw(e,t,r,n,i,s,o){switch(r){case uw:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case aw:return!(e.byteLength!=t.byteLength||!s(new ac(e),new ac(t)));case Q_:case Z_:case rw:return Bs(+e,+t);case ew:return e.name==t.name&&e.message==t.message;case nw:case ow:return e==t+"";case tw:var a=H_;case iw:var l=n&X_;if(a||(a=El),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;n|=Y_,o.set(e,t);var d=Il(a(e),a(t),n,i,s,o);return o.delete(e),d;case sw:if(ls)return ls.call(e)==ls.call(t)}return!1}var lw=cw,fw=1,dw=Object.prototype,pw=dw.hasOwnProperty;function hw(e,t,r,n,i,s){var o=r&fw,a=ec(e),l=a.length,c=ec(t),d=c.length;if(l!=d&&!o)return!1;for(var g=l;g--;){var x=a[g];if(!(o?x in t:pw.call(t,x)))return!1}var S=s.get(e),R=s.get(t);if(S&&R)return S==t&&R==e;var K=!0;s.set(e,t),s.set(t,e);for(var H=o;++g<l;){x=a[g];var F=e[x],j=t[x];if(n)var V=o?n(j,F,x,t,e,s):n(F,j,x,e,t,s);if(!(V===void 0?F===j||i(F,j,r,n,s):V)){K=!1;break}H||(H=x=="constructor")}if(K&&!H){var G=e.constructor,k=t.constructor;G!=k&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof k=="function"&&k instanceof k)&&(K=!1)}return s.delete(e),s.delete(t),K}var yw=hw,gw=1,cc="[object Arguments]",lc="[object Array]",$i="[object Object]",mw=Object.prototype,fc=mw.hasOwnProperty;function vw(e,t,r,n,i,s){var o=Mt(e),a=Mt(t),l=o?lc:sc(e),c=a?lc:sc(t);l=l==cc?$i:l,c=c==cc?$i:c;var d=l==$i,g=c==$i,x=l==c;if(x&&ms(e)){if(!ms(t))return!1;o=!0,d=!1}if(x&&!d)return s||(s=new Ci),o||bl(e)?Il(e,t,r,n,i,s):lw(e,t,l,r,n,i,s);if(!(r&gw)){var S=d&&fc.call(e,"__wrapped__"),R=g&&fc.call(t,"__wrapped__");if(S||R){var K=S?e.value():e,H=R?t.value():t;return s||(s=new Ci),i(K,H,r,n,s)}}return x?(s||(s=new Ci),yw(e,t,r,n,i,s)):!1}var bw=vw;function Sl(e,t,r,n,i){return e===t?!0:e==null||t==null||!hr(e)&&!hr(t)?e!==e&&t!==t:bw(e,t,r,n,Sl,i)}var Rl=Sl,_w=1,ww=2;function Tw(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var l=a[0],c=e[l],d=a[1];if(o&&a[2]){if(c===void 0&&!(l in e))return!1}else{var g=new Ci;if(n)var x=n(c,d,l,e,t,g);if(!(x===void 0?Rl(d,c,_w|ww,n,g):x))return!1}}return!0}var Aw=Tw;function Ow(e){return e===e&&!Qt(e)}var Pl=Ow;function Iw(e){for(var t=_l(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,Pl(i)]}return t}var Ew=Iw;function Sw(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var $l=Sw;function Rw(e){var t=Ew(e);return t.length==1&&t[0][2]?$l(t[0][0],t[0][1]):function(r){return r===e||Aw(r,e,t)}}var Pw=Rw;function $w(e,t){return e!=null&&t in Object(e)}var Nw=$w;function Cw(e,t,r){t=po(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=Hn(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&Ls(i)&&ao(o,i)&&(Mt(e)||js(e)))}var xw=Cw;function Uw(e,t){return e!=null&&xw(e,t,Nw)}var Nl=Uw,Mw=1,Dw=2;function Bw(e,t){return ks(e)&&Pl(t)?$l(Hn(e),t):function(r){var n=Jb(r,e);return n===void 0&&n===t?Nl(r,e):Rl(t,n,Mw|Dw)}}var Lw=Bw;function jw(e){return function(t){return t?.[e]}}var kw=jw;function Fw(e){return function(t){return Ks(t,e)}}var Kw=Fw;function Vw(e){return ks(e)?kw(Hn(e)):Kw(e)}var zw=Vw;function qw(e){return typeof e=="function"?e:e==null?so:typeof e=="object"?Mt(e)?Lw(e[0],e[1]):Pw(e):zw(e)}var Gw=qw;function Ww(e){return hr(e)&&hl(e)}var Hw=Ww;function Jw(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var Xw=Jw,Yw=200;function Qw(e,t,r,n){var i=-1,s=al,o=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=Xc(t,ml(r))),n?(s=Xw,o=!1):t.length>=Yw&&(s=Ol,o=!1,t=new Al(t));e:for(;++i<a;){var d=e[i],g=r==null?d:r(d);if(d=n||d!==0?d:0,o&&g===g){for(var x=c;x--;)if(t[x]===g)continue e;l.push(d)}else s(t,g,n)||l.push(d)}return l}var Zw=Qw;function eT(e,t,r,n){if(!Qt(e))return e;t=po(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var l=Hn(t[i]),c=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=o){var d=a[l];c=n?n(d,l,a):void 0,c===void 0&&(c=Qt(d)?d:ao(t[i+1])?[]:{})}$m(a,l,c),a=a[l]}return e}var tT=eT;function rT(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=Ks(e,o);r(a,o)&&tT(s,po(o,e),a)}return s}var nT=rT,iT=32,Vs=pl(function(e,t){var r=Kn(t,Ds(Vs));return Am(e,iT,void 0,t,r)});Vs.placeholder={};var oT=Vs;function sT(e,t){return nT(e,t,function(r,n){return Nl(e,n)})}var aT=sT,uT=n_(function(e,t){return e==null?{}:aT(e,t)}),dc=uT,cT=4294967295,lT=cT-1,fT=Math.floor,dT=Math.min;function pT(e,t,r,n){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=r(t);for(var o=t!==t,a=t===null,l=an(t),c=t===void 0;i<s;){var d=fT((i+s)/2),g=r(e[d]),x=g!==void 0,S=g===null,R=g===g,K=an(g);if(o)var H=n||R;else c?H=R&&(n||x):a?H=R&&x&&(n||!S):l?H=R&&x&&!S&&(n||!K):S||K?H=!1:H=n?g<=t:g<t;H?i=d+1:s=d}return dT(s,lT)}var hT=pT;function yT(e,t,r){return hT(e,t,Gw(r,2))}var gT=yT,mT=1/0,iE=sn&&1/El(new sn([,-0]))[1]==mT?function(e){return new sn(e)}:rl;var vT=pl(function(e,t){return Hw(e)?Zw(e,t):[]}),pc=vT,Cl=ft(uh(),1),oE=Cl.default.configure,Mr=Cl.default,fs=100,{WARN:bT,LOG:sE,DEBUG:Ke,VERBOSE:ve,ERROR:aE}=Oe.setup(Oe.INFO),qi=Re.set();gu({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var ze=({caller:e,thread:t,pattern:r,args:n})=>Se(()=>(n=n||r,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${n?`{${typeof n=="string"?n:Mr(n)}}`:""}`));function xl(e,t){return Se(()=>Be.structural(e.get(),t.get()))}function yn(e,t){return Be.shallow(e.applogs,t.applogs)}function ho(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(ve.isEnabled&&ve("queryNodesComparer",r,n,i),!Be.structural(n.variables,i.variables))return ve.isEnabled&&ve("[queryNodesComparer] changed vars:",r,n,i),!1;if(!yn(n.logsOfThisNode,i.logsOfThisNode))return ve.isEnabled&&ve("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return ve.isEnabled&&ve("[queryNodesComparer] equal:",{a:e,b:t}),!0}var _T=0;function Kt(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++_T}{${t}}`;ve.isEnabled&&ve(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=Ml(e,a=>{i?Se(()=>(r??Be.structural)(i,a))?Ke.isEnabled&&Ke(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),Ke.isEnabled&&Ke(`[${n}] updated`,{updatedItems:a,observableArr:i})):i=Re.array(a,{deep:!1,name:t,equals:r})},{name:n});if(n.includes("useRoots")){var o=bt(i);Ke(`[${n}] deps`,{disposeAutorun:s,rootsAtom:o,observableArr:i,observers:Nn(i)}),tn(()=>qi.add(o))}return ve.isEnabled&&rn(i,()=>{ve(`[${n}] observed`,Nn(i),{rootsAtom:o,observableArr:i})}),Pr(i,()=>{ve.isEnabled&&ve(`[${n}] dispose`),o&&tn(()=>qi.delete(o)),s()}),i}var wT=0;function Ul(e,{name:t}={}){let r=`observableSetMap@${++wT}{${t}}`;ve.isEnabled&&ve(`[${r}] create`,{fnname:e.name,fn:e,name:t});let n,i=Ml(e,o=>{if(!n)n=Re.set(o,{deep:!1,name:t});else{let{deleted:a,added:l}=Se(()=>{let c=new Set(n.values()),d=new Set;for(let g of o)n.has(g)?(ve.isEnabled&&ve(`[${r}] unchanged`,g,{updatedItems:o,observableSet:n}),c.delete(g)):d.add(g);return Ke.isEnabled&&Ke(`[${r}] updated:`,{unseen:c,added:d,updatedItems:o,observableSet:n}),{added:d,deleted:c}});for(let c of a)n.delete(c);for(let c of l)n.add(c)}},{name:r});if(r.includes("useRoots")){var s=bt(n);Ke.isEnabled&&Ke(`[${r}] deps`,{disposeAutorun:i,rootsAtom:s,observableSet:n,observers:Nn(n)}),tn(()=>qi.add(s))}return ve.isEnabled&&rn(n,()=>{ve(`[${r}] observed`,Nn(n),{rootsAtom:s,observableSet:n})}),Pr(n,()=>{ve.isEnabled&&ve(`[${r}] dispose`),s&&tn(()=>qi.delete(s)),i()}),n}function Ml(e,t=null,{name:r}={}){Ke.isEnabled&&Ke("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,s=new Nt(n,function(...c){Ke.isEnabled&&Ke(`[${n}] reaction.invalidate`,c),o()});function o(){s.track(function(){let c=fs&&performance.now();Ke.isEnabled&&Ke(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),Ke.isEnabled&&Ke(`[${n}] runAndTrack =>`,i),tn(()=>{t?.(i)}),fs&&performance.now()-c>fs&&bT(`[${n}] took ${performance.now()-c}ms`)})}return o(),Ke.isEnabled&&Ke(`[${n}] deps of reaction`,{reaction:s,result:i,deps:$n(s)}),()=>{ve.isEnabled&&ve(`[${n}] dispose`),setTimeout(()=>s.dispose())}}function We(e,t,r=!1){if(or(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,s=typeof r=="boolean"?{keepAlive:r}:r,o=new Map;return function(...a){let l,c=Se(()=>{let S=a;for(let R=0;R<a.length;R++)a[R]instanceof un&&a===S&&(S=a.slice());return S}),d=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...a)}}`:""}`;for(let[S,R]of o.entries())if(AT(S,c)){l=R;break}else if(ve.isEnabled)for(let K=0;K<S.length;K++)S[K]instanceof un&&S[K].name===a[K].name&&Be.structural(pc(S,S[K]),pc(c,c[K]))&&ve.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(S[K]).filter(H=>!Be.structural(S[K][H],a[K][H])),cacheArg:S[K],freshArg:a[K]});if(l){let S=l.get();return ve.isEnabled&&ve(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:S}),S}if(!s.keepAlive&&!Qa())return!n&&ru().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);ve.isEnabled&&ve(`[${d}] new computation`,{untrackedArgs:c});let g,x=xe(()=>(ve.isEnabled&&ve(`[${d}] update->rerun`,Se(()=>({args:a})),t),ve.isEnabled&&Yo(),g=t.apply(this,a)),{...s,name:d});if(ve.isEnabled&&ve(`[${d}] deps`,$n(x),{untrackedArgs:c}),o.set(c,x),!s.keepAlive){let S=Pr(x,()=>{ve.isEnabled&&ve(`[${d}] dispose`,x),S(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return x.get()}}function TT(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?r+=s+`
|
|
56
|
+
`)}var Ym=Xm;function Qm(e){return function(){return e}}var Zm=Qm,ev=function(){try{var e=Vr(Object,"defineProperty");return e({},"",{}),e}catch{}}(),oo=ev,tv=oo?function(e,t){return oo(e,"toString",{configurable:!0,enumerable:!1,value:Zm(t),writable:!0})}:mo,rv=tv,nv=Nl(rv),Qs=nv;function iv(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var ov=iv;function sv(e,t,r,n){for(var i=e.length,s=r+(n?1:-1);n?s--:++s<i;)if(t(e[s],s,e))return s;return-1}var av=sv;function uv(e){return e!==e}var cv=uv;function lv(e,t,r){for(var n=r-1,i=e.length;++n<i;)if(e[n]===t)return n;return-1}var fv=lv;function dv(e,t,r){return t===t?fv(e,t,r):av(e,cv,r)}var pv=dv;function hv(e,t){var r=e==null?0:e.length;return!!r&&pv(e,t,0)>-1}var Ul=hv,yv=1,gv=2,bv=8,mv=16,vv=32,_v=64,wv=128,Tv=256,Av=512,Ov=[["ary",wv],["bind",yv],["bindKey",gv],["curry",bv],["curryRight",mv],["flip",Av],["partial",vv],["partialRight",_v],["rearg",Tv]];function Ev(e,t){return ov(Ov,function(r){var n="_."+r[0];t&r[1]&&!Ul(e,n)&&e.push(n)}),e.sort()}var Iv=Ev;function Sv(e,t,r){var n=t+"";return Qs(e,Ym(n,Iv(Hm(n),r)))}var Ml=Sv,xv=1,Rv=2,Pv=4,$v=8,_c=32,wc=64;function Nv(e,t,r,n,i,s,o,a,l,c){var d=t&$v,g=d?o:void 0,C=d?void 0:o,S=d?s:void 0,x=d?void 0:s;t|=d?_c:wc,t&=~(d?wc:_c),t&Pv||(t&=~(xv|Rv));var K=[e,t,i,S,g,x,C,a,l,c],H=r.apply(void 0,K);return jm(e)&&Cl(H,K),H.placeholder=n,Ml(H,e,t)}var Dl=Nv;function Cv(e){var t=e;return t.placeholder}var Zs=Cv,Uv=9007199254740991,Mv=/^(?:0|[1-9]\d*)$/;function Dv(e,t){var r=typeof e;return t=t??Uv,!!t&&(r=="number"||r!="symbol"&&Mv.test(e))&&e>-1&&e%1==0&&e<t}var vo=Dv,Bv=Math.min;function Lv(e,t){for(var r=e.length,n=Bv(t.length,r),i=$l(e);n--;){var s=t[n];e[n]=vo(s,r)?i[s]:void 0}return e}var jv=Lv,Tc="__lodash_placeholder__";function kv(e,t){for(var r=-1,n=e.length,i=0,s=[];++r<n;){var o=e[r];(o===t||o===Tc)&&(e[r]=Tc,s[i++]=r)}return s}var Zn=kv,Fv=1,Kv=2,Vv=8,qv=16,zv=128,Gv=512;function Bl(e,t,r,n,i,s,o,a,l,c){var d=t&zv,g=t&Fv,C=t&Kv,S=t&(Vv|qv),x=t&Gv,K=C?void 0:Qn(e);function H(){for(var F=arguments.length,j=Array(F),V=F;V--;)j[V]=arguments[V];if(S)var G=Zs(H),k=Tm(j,G);if(n&&(j=Sl(j,n,i,S)),s&&(j=xl(j,s,o,S)),F-=k,S&&F<c){var Q=Zn(j,G);return Dl(e,t,Bl,H.placeholder,r,j,Q,a,l,c-F)}var z=g?r:this,ce=C?z[e]:e;return F=j.length,a?j=jv(j,a):x&&F>1&&j.reverse(),d&&l<F&&(j.length=l),this&&this!==ct&&this instanceof H&&(ce=K||Qn(ce)),ce.apply(z,j)}return H}var Ll=Bl;function Wv(e,t,r){var n=Qn(e);function i(){for(var s=arguments.length,o=Array(s),a=s,l=Zs(i);a--;)o[a]=arguments[a];var c=s<3&&o[0]!==l&&o[s-1]!==l?[]:Zn(o,l);if(s-=c.length,s<r)return Dl(e,t,Ll,i.placeholder,void 0,o,c,void 0,void 0,r-s);var d=this&&this!==ct&&this instanceof i?n:e;return Js(d,this,o)}return i}var Hv=Wv,Jv=1;function Xv(e,t,r,n){var i=t&Jv,s=Qn(e);function o(){for(var a=-1,l=arguments.length,c=-1,d=n.length,g=Array(d+l),C=this&&this!==ct&&this instanceof o?s:e;++c<d;)g[c]=n[c];for(;l--;)g[c++]=arguments[++a];return Js(C,i?r:this,g)}return o}var Yv=Xv,Ac="__lodash_placeholder__",Rs=1,Qv=2,Zv=4,Oc=8,Wn=128,Ec=256,e_=Math.min;function t_(e,t){var r=e[1],n=t[1],i=r|n,s=i<(Rs|Qv|Wn),o=n==Wn&&r==Oc||n==Wn&&r==Ec&&e[7].length<=t[8]||n==(Wn|Ec)&&t[7].length<=t[8]&&r==Oc;if(!(s||o))return e;n&Rs&&(e[2]=t[2],i|=r&Rs?0:Zv);var a=t[3];if(a){var l=e[3];e[3]=l?Sl(l,a,t[4]):a,e[4]=l?Zn(e[3],Ac):t[4]}return a=t[5],a&&(l=e[5],e[5]=l?xl(l,a,t[6]):a,e[6]=l?Zn(e[5],Ac):t[6]),a=t[7],a&&(e[7]=a),n&Wn&&(e[8]=e[8]==null?t[8]:e_(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}var r_=t_,n_="Expected a function",Ic=1,i_=2,Ps=8,$s=16,Ns=32,Sc=64,xc=Math.max;function o_(e,t,r,n,i,s,o,a){var l=t&i_;if(!l&&typeof e!="function")throw new TypeError(n_);var c=n?n.length:0;if(c||(t&=~(Ns|Sc),n=i=void 0),o=o===void 0?o:xc(gc(o),0),a=a===void 0?a:gc(a),c-=i?i.length:0,t&Sc){var d=n,g=i;n=i=void 0}var C=l?void 0:Pl(e),S=[e,t,r,n,i,d,g,s,o,a];if(C&&r_(S,C),e=S[0],t=S[1],r=S[2],n=S[3],i=S[4],a=S[9]=S[9]===void 0?l?0:e.length:xc(S[9]-c,0),!a&&t&(Ps|$s)&&(t&=~(Ps|$s)),!t||t==Ic)var x=ym(e,t,r);else t==Ps||t==$s?x=Hv(e,t,a):(t==Ns||t==(Ic|Ns))&&!i.length?x=Yv(e,t,r,n):x=Ll.apply(void 0,S);var K=C?Il:Cl;return Ml(K(x,S),e,t)}var s_=o_;function a_(e,t,r){t=="__proto__"&&oo?oo(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}var u_=a_;function c_(e,t){return e===t||e!==e&&t!==t}var ea=c_,l_=Object.prototype,f_=l_.hasOwnProperty;function d_(e,t,r){var n=e[t];(!(f_.call(e,t)&&ea(n,r))||r===void 0&&!(t in e))&&u_(e,t,r)}var p_=d_,Rc=Math.max;function h_(e,t,r){return t=Rc(t===void 0?e.length-1:t,0),function(){for(var n=arguments,i=-1,s=Rc(n.length-t,0),o=Array(s);++i<s;)o[i]=n[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=n[i];return a[t]=r(o),Js(e,this,a)}}var jl=h_;function y_(e,t){return Qs(jl(e,t,mo),e+"")}var kl=y_,g_=9007199254740991;function b_(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=g_}var ta=b_;function m_(e){return e!=null&&ta(e.length)&&!El(e)}var Fl=m_,v_=Object.prototype;function __(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||v_;return e===r}var w_=__;function T_(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}var A_=T_,O_="[object Arguments]";function E_(e){return br(e)&&yn(e)==O_}var Pc=E_,Kl=Object.prototype,I_=Kl.hasOwnProperty,S_=Kl.propertyIsEnumerable,x_=Pc(function(){return arguments}())?Pc:function(e){return br(e)&&I_.call(e,"callee")&&!S_.call(e,"callee")},ra=x_;function R_(){return!1}var P_=R_,Vl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$c=Vl&&typeof module=="object"&&module&&!module.nodeType&&module,$_=$c&&$c.exports===Vl,Nc=$_?ct.Buffer:void 0,N_=Nc?Nc.isBuffer:void 0,C_=N_||P_,Ls=C_,U_="[object Arguments]",M_="[object Array]",D_="[object Boolean]",B_="[object Date]",L_="[object Error]",j_="[object Function]",k_="[object Map]",F_="[object Number]",K_="[object Object]",V_="[object RegExp]",q_="[object Set]",z_="[object String]",G_="[object WeakMap]",W_="[object ArrayBuffer]",H_="[object DataView]",J_="[object Float32Array]",X_="[object Float64Array]",Y_="[object Int8Array]",Q_="[object Int16Array]",Z_="[object Int32Array]",e0="[object Uint8Array]",t0="[object Uint8ClampedArray]",r0="[object Uint16Array]",n0="[object Uint32Array]",$e={};$e[J_]=$e[X_]=$e[Y_]=$e[Q_]=$e[Z_]=$e[e0]=$e[t0]=$e[r0]=$e[n0]=!0;$e[U_]=$e[M_]=$e[W_]=$e[D_]=$e[H_]=$e[B_]=$e[L_]=$e[j_]=$e[k_]=$e[F_]=$e[K_]=$e[V_]=$e[q_]=$e[z_]=$e[G_]=!1;function i0(e){return br(e)&&ta(e.length)&&!!$e[yn(e)]}var o0=i0;function s0(e){return function(t){return e(t)}}var ql=s0,zl=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Xn=zl&&typeof module=="object"&&module&&!module.nodeType&&module,a0=Xn&&Xn.exports===zl,Cs=a0&&wl.process,u0=function(){try{var e=Xn&&Xn.require&&Xn.require("util").types;return e||Cs&&Cs.binding&&Cs.binding("util")}catch{}}(),Cc=u0,Uc=Cc&&Cc.isTypedArray,c0=Uc?ql(Uc):o0,Gl=c0,l0=Object.prototype,f0=l0.hasOwnProperty;function d0(e,t){var r=Mt(e),n=!r&&ra(e),i=!r&&!n&&Ls(e),s=!r&&!n&&!i&&Gl(e),o=r||n||i||s,a=o?A_(e.length,String):[],l=a.length;for(var c in e)(t||f0.call(e,c))&&!(o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||vo(c,l)))&&a.push(c);return a}var p0=d0;function h0(e,t){return function(r){return e(t(r))}}var y0=h0,g0=y0(Object.keys,Object),b0=g0,m0=Object.prototype,v0=m0.hasOwnProperty;function _0(e){if(!w_(e))return b0(e);var t=[];for(var r in Object(e))v0.call(e,r)&&r!="constructor"&&t.push(r);return t}var w0=_0;function T0(e){return Fl(e)?p0(e):w0(e)}var Wl=T0,A0=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O0=/^\w*$/;function E0(e,t){if(Mt(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||dn(e)?!0:O0.test(e)||!A0.test(e)||t!=null&&e in Object(t)}var na=E0,I0=Vr(Object,"create"),ei=I0;function S0(){this.__data__=ei?ei(null):{},this.size=0}var x0=S0;function R0(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var P0=R0,$0="__lodash_hash_undefined__",N0=Object.prototype,C0=N0.hasOwnProperty;function U0(e){var t=this.__data__;if(ei){var r=t[e];return r===$0?void 0:r}return C0.call(t,e)?t[e]:void 0}var M0=U0,D0=Object.prototype,B0=D0.hasOwnProperty;function L0(e){var t=this.__data__;return ei?t[e]!==void 0:B0.call(t,e)}var j0=L0,k0="__lodash_hash_undefined__";function F0(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ei&&t===void 0?k0:t,this}var K0=F0;function gn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}gn.prototype.clear=x0;gn.prototype.delete=P0;gn.prototype.get=M0;gn.prototype.has=j0;gn.prototype.set=K0;var Mc=gn;function V0(){this.__data__=[],this.size=0}var q0=V0;function z0(e,t){for(var r=e.length;r--;)if(ea(e[r][0],t))return r;return-1}var _o=z0,G0=Array.prototype,W0=G0.splice;function H0(e){var t=this.__data__,r=_o(t,e);if(r<0)return!1;var n=t.length-1;return r==n?t.pop():W0.call(t,r,1),--this.size,!0}var J0=H0;function X0(e){var t=this.__data__,r=_o(t,e);return r<0?void 0:t[r][1]}var Y0=X0;function Q0(e){return _o(this.__data__,e)>-1}var Z0=Q0;function ew(e,t){var r=this.__data__,n=_o(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var tw=ew;function bn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}bn.prototype.clear=q0;bn.prototype.delete=J0;bn.prototype.get=Y0;bn.prototype.has=Z0;bn.prototype.set=tw;var wo=bn,rw=Vr(ct,"Map"),ti=rw;function nw(){this.size=0,this.__data__={hash:new Mc,map:new(ti||wo),string:new Mc}}var iw=nw;function ow(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var sw=ow;function aw(e,t){var r=e.__data__;return sw(t)?r[typeof t=="string"?"string":"hash"]:r.map}var To=aw;function uw(e){var t=To(this,e).delete(e);return this.size-=t?1:0,t}var cw=uw;function lw(e){return To(this,e).get(e)}var fw=lw;function dw(e){return To(this,e).has(e)}var pw=dw;function hw(e,t){var r=To(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var yw=hw;function mn(e){var t=-1,r=e==null?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}mn.prototype.clear=iw;mn.prototype.delete=cw;mn.prototype.get=fw;mn.prototype.has=pw;mn.prototype.set=yw;var Ao=mn,gw="Expected a function";function ia(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(gw);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(ia.Cache||Ao),r}ia.Cache=Ao;var bw=ia,mw=500;function vw(e){var t=bw(e,function(n){return r.size===mw&&r.clear(),n}),r=t.cache;return t}var _w=vw,ww=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Tw=/\\(\\)?/g,Aw=_w(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(ww,function(r,n,i,s){t.push(i?s.replace(Tw,"$1"):n||r)}),t}),Ow=Aw;function Ew(e){return e==null?"":_b(e)}var Iw=Ew;function Sw(e,t){return Mt(e)?e:na(e,t)?[e]:Ow(Iw(e))}var Oo=Sw,xw=1/0;function Rw(e){if(typeof e=="string"||dn(e))return e;var t=e+"";return t=="0"&&1/e==-xw?"-0":t}var ni=Rw;function Pw(e,t){t=Oo(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[ni(t[r++])];return r&&r==n?e:void 0}var oa=Pw;function $w(e,t,r){var n=e==null?void 0:oa(e,t);return n===void 0?r:n}var Nw=$w;function Cw(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}var Hl=Cw,Dc=Vt?Vt.isConcatSpreadable:void 0;function Uw(e){return Mt(e)||ra(e)||!!(Dc&&e&&e[Dc])}var Mw=Uw;function Jl(e,t,r,n,i){var s=-1,o=e.length;for(r||(r=Mw),i||(i=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?Jl(a,t-1,r,n,i):Hl(i,a):n||(i[i.length]=a)}return i}var Dw=Jl;function Bw(e){var t=e==null?0:e.length;return t?Dw(e,1):[]}var Lw=Bw;function jw(e){return Qs(jl(e,void 0,Lw),e+"")}var kw=jw;function Fw(){this.__data__=new wo,this.size=0}var Kw=Fw;function Vw(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var qw=Vw;function zw(e){return this.__data__.get(e)}var Gw=zw;function Ww(e){return this.__data__.has(e)}var Hw=Ww,Jw=200;function Xw(e,t){var r=this.__data__;if(r instanceof wo){var n=r.__data__;if(!ti||n.length<Jw-1)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Ao(n)}return r.set(e,t),this.size=r.size,this}var Yw=Xw;function vn(e){var t=this.__data__=new wo(e);this.size=t.size}vn.prototype.clear=Kw;vn.prototype.delete=qw;vn.prototype.get=Gw;vn.prototype.has=Hw;vn.prototype.set=Yw;var Xi=vn;function Qw(e,t){for(var r=-1,n=e==null?0:e.length,i=0,s=[];++r<n;){var o=e[r];t(o,r,e)&&(s[i++]=o)}return s}var Zw=Qw;function eT(){return[]}var tT=eT,rT=Object.prototype,nT=rT.propertyIsEnumerable,Bc=Object.getOwnPropertySymbols,iT=Bc?function(e){return e==null?[]:(e=Object(e),Zw(Bc(e),function(t){return nT.call(e,t)}))}:tT,oT=iT;function sT(e,t,r){var n=t(e);return Mt(e)?n:Hl(n,r(e))}var aT=sT;function uT(e){return aT(e,Wl,oT)}var Lc=uT,cT=Vr(ct,"DataView"),js=cT,lT=Vr(ct,"Promise"),ks=lT,fT=Vr(ct,"Set"),fn=fT,jc="[object Map]",dT="[object Object]",kc="[object Promise]",Fc="[object Set]",Kc="[object WeakMap]",Vc="[object DataView]",pT=Kr(js),hT=Kr(ti),yT=Kr(ks),gT=Kr(fn),bT=Kr(Yn),kr=yn;(js&&kr(new js(new ArrayBuffer(1)))!=Vc||ti&&kr(new ti)!=jc||ks&&kr(ks.resolve())!=kc||fn&&kr(new fn)!=Fc||Yn&&kr(new Yn)!=Kc)&&(kr=function(e){var t=yn(e),r=t==dT?e.constructor:void 0,n=r?Kr(r):"";if(n)switch(n){case pT:return Vc;case hT:return jc;case yT:return kc;case gT:return Fc;case bT:return Kc}return t});var qc=kr,mT=ct.Uint8Array,zc=mT,vT="__lodash_hash_undefined__";function _T(e){return this.__data__.set(e,vT),this}var wT=_T;function TT(e){return this.__data__.has(e)}var AT=TT;function so(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Ao;++t<r;)this.add(e[t])}so.prototype.add=so.prototype.push=wT;so.prototype.has=AT;var Xl=so;function OT(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var ET=OT;function IT(e,t){return e.has(t)}var Yl=IT,ST=1,xT=2;function RT(e,t,r,n,i,s){var o=r&ST,a=e.length,l=t.length;if(a!=l&&!(o&&l>a))return!1;var c=s.get(e),d=s.get(t);if(c&&d)return c==t&&d==e;var g=-1,C=!0,S=r&xT?new Xl:void 0;for(s.set(e,t),s.set(t,e);++g<a;){var x=e[g],K=t[g];if(n)var H=o?n(K,x,g,t,e,s):n(x,K,g,e,t,s);if(H!==void 0){if(H)continue;C=!1;break}if(S){if(!ET(t,function(F,j){if(!Yl(S,j)&&(x===F||i(x,F,r,n,s)))return S.push(j)})){C=!1;break}}else if(!(x===K||i(x,K,r,n,s))){C=!1;break}}return s.delete(e),s.delete(t),C}var Ql=RT;function PT(e){var t=-1,r=Array(e.size);return e.forEach(function(n,i){r[++t]=[i,n]}),r}var $T=PT;function NT(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var Zl=NT,CT=1,UT=2,MT="[object Boolean]",DT="[object Date]",BT="[object Error]",LT="[object Map]",jT="[object Number]",kT="[object RegExp]",FT="[object Set]",KT="[object String]",VT="[object Symbol]",qT="[object ArrayBuffer]",zT="[object DataView]",Gc=Vt?Vt.prototype:void 0,Us=Gc?Gc.valueOf:void 0;function GT(e,t,r,n,i,s,o){switch(r){case zT:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case qT:return!(e.byteLength!=t.byteLength||!s(new zc(e),new zc(t)));case MT:case DT:case jT:return ea(+e,+t);case BT:return e.name==t.name&&e.message==t.message;case kT:case KT:return e==t+"";case LT:var a=$T;case FT:var l=n&CT;if(a||(a=Zl),e.size!=t.size&&!l)return!1;var c=o.get(e);if(c)return c==t;n|=UT,o.set(e,t);var d=Ql(a(e),a(t),n,i,s,o);return o.delete(e),d;case VT:if(Us)return Us.call(e)==Us.call(t)}return!1}var WT=GT,HT=1,JT=Object.prototype,XT=JT.hasOwnProperty;function YT(e,t,r,n,i,s){var o=r&HT,a=Lc(e),l=a.length,c=Lc(t),d=c.length;if(l!=d&&!o)return!1;for(var g=l;g--;){var C=a[g];if(!(o?C in t:XT.call(t,C)))return!1}var S=s.get(e),x=s.get(t);if(S&&x)return S==t&&x==e;var K=!0;s.set(e,t),s.set(t,e);for(var H=o;++g<l;){C=a[g];var F=e[C],j=t[C];if(n)var V=o?n(j,F,C,t,e,s):n(F,j,C,e,t,s);if(!(V===void 0?F===j||i(F,j,r,n,s):V)){K=!1;break}H||(H=C=="constructor")}if(K&&!H){var G=e.constructor,k=t.constructor;G!=k&&"constructor"in e&&"constructor"in t&&!(typeof G=="function"&&G instanceof G&&typeof k=="function"&&k instanceof k)&&(K=!1)}return s.delete(e),s.delete(t),K}var QT=YT,ZT=1,Wc="[object Arguments]",Hc="[object Array]",Hi="[object Object]",eA=Object.prototype,Jc=eA.hasOwnProperty;function tA(e,t,r,n,i,s){var o=Mt(e),a=Mt(t),l=o?Hc:qc(e),c=a?Hc:qc(t);l=l==Wc?Hi:l,c=c==Wc?Hi:c;var d=l==Hi,g=c==Hi,C=l==c;if(C&&Ls(e)){if(!Ls(t))return!1;o=!0,d=!1}if(C&&!d)return s||(s=new Xi),o||Gl(e)?Ql(e,t,r,n,i,s):WT(e,t,l,r,n,i,s);if(!(r&ZT)){var S=d&&Jc.call(e,"__wrapped__"),x=g&&Jc.call(t,"__wrapped__");if(S||x){var K=S?e.value():e,H=x?t.value():t;return s||(s=new Xi),i(K,H,r,n,s)}}return C?(s||(s=new Xi),QT(e,t,r,n,i,s)):!1}var rA=tA;function ef(e,t,r,n,i){return e===t?!0:e==null||t==null||!br(e)&&!br(t)?e!==e&&t!==t:rA(e,t,r,n,ef,i)}var tf=ef,nA=1,iA=2;function oA(e,t,r,n){var i=r.length,s=i,o=!n;if(e==null)return!s;for(e=Object(e);i--;){var a=r[i];if(o&&a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<s;){a=r[i];var l=a[0],c=e[l],d=a[1];if(o&&a[2]){if(c===void 0&&!(l in e))return!1}else{var g=new Xi;if(n)var C=n(c,d,l,e,t,g);if(!(C===void 0?tf(d,c,nA|iA,n,g):C))return!1}}return!0}var sA=oA;function aA(e){return e===e&&!er(e)}var rf=aA;function uA(e){for(var t=Wl(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,rf(i)]}return t}var cA=uA;function lA(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}var nf=lA;function fA(e){var t=cA(e);return t.length==1&&t[0][2]?nf(t[0][0],t[0][1]):function(r){return r===e||sA(r,e,t)}}var dA=fA;function pA(e,t){return e!=null&&t in Object(e)}var hA=pA;function yA(e,t,r){t=Oo(t,e);for(var n=-1,i=t.length,s=!1;++n<i;){var o=ni(t[n]);if(!(s=e!=null&&r(e,o)))break;e=e[o]}return s||++n!=i?s:(i=e==null?0:e.length,!!i&&ta(i)&&vo(o,i)&&(Mt(e)||ra(e)))}var gA=yA;function bA(e,t){return e!=null&&gA(e,t,hA)}var of=bA,mA=1,vA=2;function _A(e,t){return na(e)&&rf(t)?nf(ni(e),t):function(r){var n=Nw(r,e);return n===void 0&&n===t?of(r,e):tf(t,n,mA|vA)}}var wA=_A;function TA(e){return function(t){return t?.[e]}}var AA=TA;function OA(e){return function(t){return oa(t,e)}}var EA=OA;function IA(e){return na(e)?AA(ni(e)):EA(e)}var SA=IA;function xA(e){return typeof e=="function"?e:e==null?mo:typeof e=="object"?Mt(e)?wA(e[0],e[1]):dA(e):SA(e)}var RA=xA;function PA(e){return br(e)&&Fl(e)}var $A=PA;function NA(e,t,r){for(var n=-1,i=e==null?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}var CA=NA,UA=200;function MA(e,t,r,n){var i=-1,s=Ul,o=!0,a=e.length,l=[],c=t.length;if(!a)return l;r&&(t=Al(t,ql(r))),n?(s=CA,o=!1):t.length>=UA&&(s=Yl,o=!1,t=new Xl(t));e:for(;++i<a;){var d=e[i],g=r==null?d:r(d);if(d=n||d!==0?d:0,o&&g===g){for(var C=c;C--;)if(t[C]===g)continue e;l.push(d)}else s(t,g,n)||l.push(d)}return l}var DA=MA;function BA(e,t,r,n){if(!er(e))return e;t=Oo(t,e);for(var i=-1,s=t.length,o=s-1,a=e;a!=null&&++i<s;){var l=ni(t[i]),c=r;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=o){var d=a[l];c=n?n(d,l,a):void 0,c===void 0&&(c=er(d)?d:vo(t[i+1])?[]:{})}p_(a,l,c),a=a[l]}return e}var LA=BA;function jA(e,t,r){for(var n=-1,i=t.length,s={};++n<i;){var o=t[n],a=oa(e,o);r(a,o)&&LA(s,Oo(o,e),a)}return s}var kA=jA,FA=32,sa=kl(function(e,t){var r=Zn(t,Zs(sa));return s_(e,FA,void 0,t,r)});sa.placeholder={};var KA=sa;function VA(e,t){return kA(e,t,function(r,n){return of(e,n)})}var qA=VA,zA=kw(function(e,t){return e==null?{}:qA(e,t)}),Xc=zA,GA=4294967295,WA=GA-1,HA=Math.floor,JA=Math.min;function XA(e,t,r,n){var i=0,s=e==null?0:e.length;if(s===0)return 0;t=r(t);for(var o=t!==t,a=t===null,l=dn(t),c=t===void 0;i<s;){var d=HA((i+s)/2),g=r(e[d]),C=g!==void 0,S=g===null,x=g===g,K=dn(g);if(o)var H=n||x;else c?H=x&&(n||C):a?H=x&&C&&(n||!S):l?H=x&&C&&!S&&(n||!K):S||K?H=!1:H=n?g<=t:g<t;H?i=d+1:s=d}return JA(s,WA)}var YA=XA;function QA(e,t,r){return YA(e,t,RA(r,2))}var ZA=QA,eO=1/0,rI=fn&&1/Zl(new fn([,-0]))[1]==eO?function(e){return new fn(e)}:Rl;var tO=kl(function(e,t){return $A(e)?DA(e,t):[]}),Yc=tO,sf=ft(zg(),1),nI=sf.default.configure,Fr=sf.default,Ms=100,{WARN:rO,LOG:iI,DEBUG:Ke,VERBOSE:me,ERROR:oI}=Oe.setup(Oe.INFO),ao=xe.set();ec({enforceActions:"always"});if(!new class{xyz}().hasOwnProperty("xyz"))throw new Error("Transpiler is not configured correctly");var qe=({caller:e,thread:t,pattern:r,args:n})=>Se(()=>(n=n||r,`${!Array.isArray(t)&&t?.name?t.name+" | ":""}${e??"caller?"}${n?`{${typeof n=="string"?n:Fr(n)}}`:""}`));function af(e,t){return Se(()=>Be.structural(e.get(),t.get()))}function _n(e,t){return Be.shallow(e.applogs,t.applogs)}function Eo(e,t){if(e.size!==t.size)return!1;for(let r=0;r<e.size;r++){let n=e.nodes[r],i=t.nodes[r];if(me.isEnabled&&me("queryNodesComparer",r,n,i),!Be.structural(n.variables,i.variables))return me.isEnabled&&me("[queryNodesComparer] changed vars:",r,n,i),!1;if(!_n(n.logsOfThisNode,i.logsOfThisNode))return me.isEnabled&&me("[queryNodesComparer] changed logsOfThisNode:",r,n,i),!1}return me.isEnabled&&me("[queryNodesComparer] equal:",{a:e,b:t}),!0}var nO=0;function qt(e,{name:t,equals:r}={}){let n=`observableArrayMap@${++nO}{${t}}`;me.isEnabled&&me(`[${n}] create`,{fnname:e.name,fn:e,name:t,equals:r});let i,s=cf(e,a=>{i?Se(()=>(r??Be.structural)(i,a))?Ke.isEnabled&&Ke(`[${n}] update skipped`,{updatedItems:a,observableArr:i}):(i.replace(a),Ke.isEnabled&&Ke(`[${n}] updated`,{updatedItems:a,observableArr:i})):i=xe.array(a,{deep:!1,name:t,equals:r})},{name:n});if(n.includes("useRoots")){var o=wt(i);Ke(`[${n}] deps`,{disposeAutorun:s,rootsAtom:o,observableArr:i,observers:Vn(i)}),an(()=>ao.add(o))}return me.isEnabled&&un(i,()=>{me(`[${n}] observed`,Vn(i),{rootsAtom:o,observableArr:i})}),Dr(i,()=>{me.isEnabled&&me(`[${n}] dispose`),o&&an(()=>ao.delete(o)),s()}),i}var iO=0;function uf(e,{name:t}={}){let r=`observableSetMap@${++iO}{${t}}`;me.isEnabled&&me(`[${r}] create`,{fnname:e.name,fn:e,name:t});let n,i=cf(e,o=>{if(!n)n=xe.set(o,{deep:!1,name:t});else{let{deleted:a,added:l}=Se(()=>{let c=new Set(n.values()),d=new Set;for(let g of o)n.has(g)?(me.isEnabled&&me(`[${r}] unchanged`,g,{updatedItems:o,observableSet:n}),c.delete(g)):d.add(g);return Ke.isEnabled&&Ke(`[${r}] updated:`,{unseen:c,added:d,updatedItems:o,observableSet:n}),{added:d,deleted:c}});for(let c of a)n.delete(c);for(let c of l)n.add(c)}},{name:r});if(r.includes("useRoots")){var s=wt(n);Ke.isEnabled&&Ke(`[${r}] deps`,{disposeAutorun:i,rootsAtom:s,observableSet:n,observers:Vn(n)}),an(()=>ao.add(s))}return me.isEnabled&&un(n,()=>{me(`[${r}] observed`,Vn(n),{rootsAtom:s,observableSet:n})}),Dr(n,()=>{me.isEnabled&&me(`[${r}] dispose`),s&&an(()=>ao.delete(s)),i()}),n}function cf(e,t=null,{name:r}={}){Ke.isEnabled&&Ke("[autorunButAlsoImmediately] create",{fnname:e.name,fn:e,name:r});let n=`${r}.autorunImm`,i,s=new Nt(n,function(...c){Ke.isEnabled&&Ke(`[${n}] reaction.invalidate`,c),o()});function o(){s.track(function(){let c=Ms&&performance.now();Ke.isEnabled&&Ke(`[${n}] runAndTrack:`,{name:r??e.name,fn:e}),i=e(),Ke.isEnabled&&Ke(`[${n}] runAndTrack =>`,i),an(()=>{t?.(i)}),Ms&&performance.now()-c>Ms&&rO(`[${n}] took ${performance.now()-c}ms`)})}return o(),Ke.isEnabled&&Ke(`[${n}] deps of reaction`,{reaction:s,result:i,deps:Kn(s)}),()=>{me.isEnabled&&me(`[${n}] dispose`),setTimeout(()=>s.dispose())}}function We(e,t,r=!1){if(dr(t))throw new Error("computedFnDeepCompare shouldn't be used on actions");let n=!1,i=0,s=typeof r=="boolean"?{keepAlive:r}:r,o=new Map;return function(...a){let l,c=Se(()=>{let S=a;for(let x=0;x<a.length;x++)a[x]instanceof pn&&a===S&&(S=a.slice());return S}),d=`computedFnDeepCompare(${e||t.name}#${++i})${s.argsDebugName?`{${s.argsDebugName(...a)}}`:""}`;for(let[S,x]of o.entries())if(sO(S,c)){l=x;break}else if(me.isEnabled)for(let K=0;K<S.length;K++)S[K]instanceof pn&&S[K].name===a[K].name&&Be.structural(Yc(S,S[K]),Yc(c,c[K]))&&me.force(`[${d}] threadState mismatch => cachebust`,{diffFields:Object.keys(S[K]).filter(H=>!Be.structural(S[K][H],a[K][H])),cacheArg:S[K],freshArg:a[K]});if(l){let S=l.get();return me.isEnabled&&me(`[${d}] cache hit`,{untrackedArgs:c,cachedResult:S}),S}if(!s.keepAlive&&!Du())return!n&&ku().computedRequiresReaction&&(console.warn("invoking a computedFn from outside an reactive context won't be memoized, unless keepAlive is set"),n=!0),t.apply(this,a);me.isEnabled&&me(`[${d}] new computation`,{untrackedArgs:c});let g,C=Ce(()=>(me.isEnabled&&me(`[${d}] update->rerun`,Se(()=>({args:a})),t),me.isEnabled&&ws(),g=t.apply(this,a)),{...s,name:d});if(me.isEnabled&&me(`[${d}] deps`,Kn(C),{untrackedArgs:c}),o.set(c,C),!s.keepAlive){let S=Dr(C,()=>{me.isEnabled&&me(`[${d}] dispose`,C),S(),o.delete(c),s.onCleanup&&s.onCleanup(g,...a),g=void 0})}return C.get()}}function oO(e){let t=0,r="",n=0;for(let i=0;i<e.length;i++){let s=e[i];s==="("?r+=s+`
|
|
57
57
|
`+" ".repeat(++t):s===")"?r+=`
|
|
58
58
|
`+" ".repeat(--t)+s:s===","&&n===0?r+=s+`
|
|
59
59
|
`+" ".repeat(t):s==="{"&&n===0?(n++,r+=s+`
|
|
60
60
|
`+" ".repeat(t+1)):s==="}"&&n===1?(n--,r+=`
|
|
61
|
-
`+" ".repeat(t)+s):s==="{"&&n>0?(n++,r+=s):(s==="}"&&n>1&&n--,r+=s)}return r}function AT(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof un){if(t[r]!==e[r])return!1}else if(!Be.structural(e[r],t[r]))return!1;return!0}var{WARN:hc,LOG:uE,DEBUG:OT,VERBOSE:cE,ERROR:Nr}=Oe.setup(Oe.INFO,{prefix:"[thread]"});function Zt(e){return e.init!==void 0}var un=class{constructor(e,t,r,n=[],i={}){this.name=e,this._applogs=n,this.parents=t===null?null:ga(t),this.filters=r,Se(()=>this.parents?.length===0)&&hc("[Thread] empty parents array",e),i.skipObservable||ur(this,{applogsCids:xe,applogsByCid:xe,insert:tt,size:xe,isEmpty:xe,firstLog:xe,latestLog:xe},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Nr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Nr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Nr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Nr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Nr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Nr("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):hc("unsubscribe called for non-existent",e)}notifySubscribers(e){OT(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw Nr("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Se(()=>this.size)}get nameAndSizeUntracked(){return Se(()=>`${this.name} (${this.size})`)}get prettyName(){return TT(this.name)}get hasParents(){return!!this.parents?.length}};var Dl=class Bl extends un{static fromArray(t,r){return new Bl(r||"static",null,[],t)}constructor(t,r,n,i){super(t,r,n,i,{skipObservable:!0})}get readOnly(){return!0}},Ll={};No(Ll,{code:()=>uf,decode:()=>na,encode:()=>ra,format:()=>Ic,name:()=>UA,parse:()=>DA,stringify:()=>Ic});var IT=["Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function ET(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(t==="string"||t==="number"||t==="bigint"||t==="symbol")return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(e instanceof Uint8Array)return"Uint8Array";if(e.constructor===Object)return"Object";let r=ST(e);return r||"Object"}function ST(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(IT.includes(t))return t}var E=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}static equals(e,t){return e===t||e.major===t.major&&e.name===t.name}};E.uint=new E(0,"uint",!0);E.negint=new E(1,"negint",!0);E.bytes=new E(2,"bytes",!0);E.string=new E(3,"string",!0);E.array=new E(4,"array",!1);E.map=new E(5,"map",!1);E.tag=new E(6,"tag",!1);E.float=new E(7,"float",!0);E.false=new E(7,"false",!0);E.true=new E(7,"true",!0);E.null=new E(7,"null",!0);E.undefined=new E(7,"undefined",!0);E.break=new E(7,"break",!0);var Z=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}`}},Jn=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",RT=new TextEncoder;function Gi(e){return Jn&&globalThis.Buffer.isBuffer(e)}function yo(e){return e instanceof Uint8Array?Gi(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}var PT=24,$T=200,jl=Jn?e=>e.length>=PT?globalThis.Buffer.from(e):yc(e):e=>e.length>=$T?RT.encode(e):yc(e),Yt=e=>Uint8Array.from(e),NT=Jn?(e,t,r)=>Gi(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),CT=Jn?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),yo(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let i of e)n+i.length>r.length&&(i=i.subarray(0,r.length-n)),r.set(i,n),n+=i.length;return r},xT=Jn?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function kl(e,t){if(Gi(e)&&Gi(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}function yc(e){let t=[],r=0;for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);i<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=i&63|128):(i&64512)===55296&&n+1<e.length&&(e.charCodeAt(n+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++n)&1023),t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=i&63|128):(i>=55296&&i<=57343&&(i=65533),t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=i&63|128)}return t}var gc=4096;function UT(e){let t=e.length;if(t<=gc)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=gc));return r}var MT=256,Fl=class{constructor(e=MT){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=xT(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=NT(r,0,this.cursor)}else t=CT(this.chunks,this.cursor);return e&&this.reset(),t}},DT=class{constructor(e){this.dest=e,this.cursor=0,this.chunks=[e]}reset(){this.cursor=0}push(e){if(this.cursor+e.length>this.dest.length)throw new Error("write out of bounds, destination buffer is too small");this.dest.set(e,this.cursor),this.cursor+=e.length}toBytes(e=!1){let t=this.dest.subarray(0,this.cursor);return e&&this.reset(),t}},de="CBOR decode error:",Ur="CBOR encode error:",Xn=[];Xn[23]=1;Xn[24]=2;Xn[25]=3;Xn[26]=5;Xn[27]=9;function gn(e,t,r){if(e.length-t<r)throw new Error(`${de} not enough data for type`)}var Ge=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Lr(e,t,r){gn(e,t,1);let n=e[t];if(r.strict===!0&&n<Ge[0])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function jr(e,t,r){gn(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<Ge[1])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function kr(e,t,r){gn(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<Ge[2])throw new Error(`${de} integer encoded in more bytes than necessary (strict decode)`);return n}function Fr(e,t,r){gn(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],s=(BigInt(n)<<BigInt(32))+BigInt(i);if(r.strict===!0&&s<Ge[3])throw new Error(`${de} 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(`${de} integers outside of the safe integer range are not supported`)}function BT(e,t,r,n){return new Z(E.uint,Lr(e,t+1,n),2)}function LT(e,t,r,n){return new Z(E.uint,jr(e,t+1,n),3)}function jT(e,t,r,n){return new Z(E.uint,kr(e,t+1,n),5)}function kT(e,t,r,n){return new Z(E.uint,Fr(e,t+1,n),9)}function Kr(e,t){return Ot(e,0,t.value)}function Ot(e,t,r){if(r<Ge[0]){let n=Number(r);e.push([t|n])}else if(r<Ge[1]){let n=Number(r);e.push([t|24,n])}else if(r<Ge[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<Ge[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<Ge[4]){let i=[t|27,0,0,0,0,0,0,0],s=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));i[8]=s&255,s=s>>8,i[7]=s&255,s=s>>8,i[6]=s&255,s=s>>8,i[5]=s&255,i[4]=o&255,o=o>>8,i[3]=o&255,o=o>>8,i[2]=o&255,o=o>>8,i[1]=o&255,e.push(i)}else throw new Error(`${de} encountered BigInt larger than allowable range`)}}Kr.encodedSize=function(t){return Ot.encodedSize(t.value)};Ot.encodedSize=function(t){return t<Ge[0]?1:t<Ge[1]?2:t<Ge[2]?3:t<Ge[3]?5:9};Kr.compareTokens=function(t,r){return t.value<r.value?-1:t.value>r.value?1:0};function FT(e,t,r,n){return new Z(E.negint,-1-Lr(e,t+1,n),2)}function KT(e,t,r,n){return new Z(E.negint,-1-jr(e,t+1,n),3)}function VT(e,t,r,n){return new Z(E.negint,-1-kr(e,t+1,n),5)}var zs=BigInt(-1),Kl=BigInt(1);function zT(e,t,r,n){let i=Fr(e,t+1,n);if(typeof i!="bigint"){let s=-1-i;if(s>=Number.MIN_SAFE_INTEGER)return new Z(E.negint,s,9)}if(n.allowBigInt!==!0)throw new Error(`${de} integers outside of the safe integer range are not supported`);return new Z(E.negint,zs-BigInt(i),9)}function qs(e,t){let r=t.value,n=typeof r=="bigint"?r*zs-Kl:r*-1-1;Ot(e,t.type.majorEncoded,n)}qs.encodedSize=function(t){let r=t.value,n=typeof r=="bigint"?r*zs-Kl:r*-1-1;return n<Ge[0]?1:n<Ge[1]?2:n<Ge[2]?3:n<Ge[3]?5:9};qs.compareTokens=function(t,r){return t.value<r.value?1:t.value>r.value?-1:0};function Yn(e,t,r,n){gn(e,t,r+n);let i=e.slice(t+r,t+r+n);return new Z(E.bytes,i,r+n)}function qT(e,t,r,n){return Yn(e,t,1,r)}function GT(e,t,r,n){return Yn(e,t,2,Lr(e,t+1,n))}function WT(e,t,r,n){return Yn(e,t,3,jr(e,t+1,n))}function HT(e,t,r,n){return Yn(e,t,5,kr(e,t+1,n))}function JT(e,t,r,n){let i=Fr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer bytes lengths not supported`);return Yn(e,t,9,i)}function Wi(e){return e.encodedBytes===void 0&&(e.encodedBytes=E.equals(e.type,E.string)?jl(e.value):e.value),e.encodedBytes}function go(e,t){let r=Wi(t);Ot(e,t.type.majorEncoded,r.length),e.push(r)}go.encodedSize=function(t){let r=Wi(t);return Ot.encodedSize(r.length)+r.length};go.compareTokens=function(t,r){return XT(Wi(t),Wi(r))};function XT(e,t){return e.length<t.length?-1:e.length>t.length?1:kl(e,t)}var mc=new TextDecoder,YT=32;function QT(e,t,r){if(r-t<YT){let i="";for(let s=t;s<r;s++){let o=e[s];if(o&128)return mc.decode(e.subarray(t,r));i+=String.fromCharCode(o)}return i}return mc.decode(e.subarray(t,r))}function Qn(e,t,r,n,i){let s=r+n;gn(e,t,s);let o=new Z(E.string,QT(e,t+r,t+s),s);return i.retainStringBytes===!0&&(o.byteValue=e.slice(t+r,t+s)),o}function ZT(e,t,r,n){return Qn(e,t,1,r,n)}function e0(e,t,r,n){return Qn(e,t,2,Lr(e,t+1,n),n)}function t0(e,t,r,n){return Qn(e,t,3,jr(e,t+1,n),n)}function r0(e,t,r,n){return Qn(e,t,5,kr(e,t+1,n),n)}function n0(e,t,r,n){let i=Fr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer string lengths not supported`);return Qn(e,t,9,i,n)}var i0=go;function mn(e,t,r,n){return new Z(E.array,n,r)}function o0(e,t,r,n){return mn(e,t,1,r)}function s0(e,t,r,n){return mn(e,t,2,Lr(e,t+1,n))}function a0(e,t,r,n){return mn(e,t,3,jr(e,t+1,n))}function u0(e,t,r,n){return mn(e,t,5,kr(e,t+1,n))}function c0(e,t,r,n){let i=Fr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer array lengths not supported`);return mn(e,t,9,i)}function l0(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return mn(e,t,1,1/0)}function Gs(e,t){Ot(e,E.array.majorEncoded,t.value)}Gs.compareTokens=Kr.compareTokens;Gs.encodedSize=function(t){return Ot.encodedSize(t.value)};function vn(e,t,r,n){return new Z(E.map,n,r)}function f0(e,t,r,n){return vn(e,t,1,r)}function d0(e,t,r,n){return vn(e,t,2,Lr(e,t+1,n))}function p0(e,t,r,n){return vn(e,t,3,jr(e,t+1,n))}function h0(e,t,r,n){return vn(e,t,5,kr(e,t+1,n))}function y0(e,t,r,n){let i=Fr(e,t+1,n);if(typeof i=="bigint")throw new Error(`${de} 64-bit integer map lengths not supported`);return vn(e,t,9,i)}function g0(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return vn(e,t,1,1/0)}function Ws(e,t){Ot(e,E.map.majorEncoded,t.value)}Ws.compareTokens=Kr.compareTokens;Ws.encodedSize=function(t){return Ot.encodedSize(t.value)};function m0(e,t,r,n){return new Z(E.tag,r,1)}function v0(e,t,r,n){return new Z(E.tag,Lr(e,t+1,n),2)}function b0(e,t,r,n){return new Z(E.tag,jr(e,t+1,n),3)}function _0(e,t,r,n){return new Z(E.tag,kr(e,t+1,n),5)}function w0(e,t,r,n){return new Z(E.tag,Fr(e,t+1,n),9)}function Hs(e,t){Ot(e,E.tag.majorEncoded,t.value)}Hs.compareTokens=Kr.compareTokens;Hs.encodedSize=function(t){return Ot.encodedSize(t.value)};var Vl=20,zl=21,ql=22,Gl=23;function T0(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${de} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new Z(E.null,null,1):new Z(E.undefined,void 0,1)}function A0(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${de} indefinite length items not allowed`);return new Z(E.break,void 0,1)}function Js(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${de} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${de} Infinity values are not supported`)}return new Z(E.float,e,t)}function O0(e,t,r,n){return Js(Ys(e,t+1),3,n)}function I0(e,t,r,n){return Js(Qs(e,t+1),5,n)}function E0(e,t,r,n){return Js(Xl(e,t+1),9,n)}function Xs(e,t,r){let n=t.value;if(n===!1)e.push([E.float.majorEncoded|Vl]);else if(n===!0)e.push([E.float.majorEncoded|zl]);else if(n===null)e.push([E.float.majorEncoded|ql]);else if(n===void 0)e.push([E.float.majorEncoded|Gl]);else{let i,s=!1;(!r||r.float64!==!0)&&(Hl(n),i=Ys(Ut,1),n===i||Number.isNaN(n)?(Ut[0]=249,e.push(Ut.slice(0,3)),s=!0):(Jl(n),i=Qs(Ut,1),n===i&&(Ut[0]=250,e.push(Ut.slice(0,5)),s=!0))),s||(S0(n),i=Xl(Ut,1),Ut[0]=251,e.push(Ut.slice(0,9)))}}Xs.encodedSize=function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Hl(n);let i=Ys(Ut,1);if(n===i||Number.isNaN(n))return 3;if(Jl(n),i=Qs(Ut,1),n===i)return 5}return 9};var Wl=new ArrayBuffer(9),Tt=new DataView(Wl,1),Ut=new Uint8Array(Wl,0);function Hl(e){if(e===1/0)Tt.setUint16(0,31744,!1);else if(e===-1/0)Tt.setUint16(0,64512,!1);else if(Number.isNaN(e))Tt.setUint16(0,32256,!1);else{Tt.setFloat32(0,e);let t=Tt.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)Tt.setUint16(0,31744,!1);else if(r===0)Tt.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let i=r-127;i<-24?Tt.setUint16(0,0):i<-14?Tt.setUint16(0,(t&2147483648)>>16|1<<24+i,!1):Tt.setUint16(0,(t&2147483648)>>16|i+15<<10|n>>13,!1)}}}function Ys(e,t){if(e.length-t<2)throw new Error(`${de} 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,i=r&1023,s;return n===0?s=i*2**-24:n!==31?s=(i+1024)*2**(n-25):s=i===0?1/0:NaN,r&32768?-s:s}function Jl(e){Tt.setFloat32(0,e,!1)}function Qs(e,t){if(e.length-t<4)throw new Error(`${de} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function S0(e){Tt.setFloat64(0,e,!1)}function Xl(e,t){if(e.length-t<8)throw new Error(`${de} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}Xs.compareTokens=Kr.compareTokens;function Te(e,t,r){throw new Error(`${de} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function mo(e){return()=>{throw new Error(`${de} ${e}`)}}var oe=[];for(let e=0;e<=23;e++)oe[e]=Te;oe[24]=BT;oe[25]=LT;oe[26]=jT;oe[27]=kT;oe[28]=Te;oe[29]=Te;oe[30]=Te;oe[31]=Te;for(let e=32;e<=55;e++)oe[e]=Te;oe[56]=FT;oe[57]=KT;oe[58]=VT;oe[59]=zT;oe[60]=Te;oe[61]=Te;oe[62]=Te;oe[63]=Te;for(let e=64;e<=87;e++)oe[e]=qT;oe[88]=GT;oe[89]=WT;oe[90]=HT;oe[91]=JT;oe[92]=Te;oe[93]=Te;oe[94]=Te;oe[95]=mo("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)oe[e]=ZT;oe[120]=e0;oe[121]=t0;oe[122]=r0;oe[123]=n0;oe[124]=Te;oe[125]=Te;oe[126]=Te;oe[127]=mo("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)oe[e]=o0;oe[152]=s0;oe[153]=a0;oe[154]=u0;oe[155]=c0;oe[156]=Te;oe[157]=Te;oe[158]=Te;oe[159]=l0;for(let e=160;e<=183;e++)oe[e]=f0;oe[184]=d0;oe[185]=p0;oe[186]=h0;oe[187]=y0;oe[188]=Te;oe[189]=Te;oe[190]=Te;oe[191]=g0;for(let e=192;e<=215;e++)oe[e]=m0;oe[216]=v0;oe[217]=b0;oe[218]=_0;oe[219]=w0;oe[220]=Te;oe[221]=Te;oe[222]=Te;oe[223]=Te;for(let e=224;e<=243;e++)oe[e]=mo("simple values are not supported");oe[244]=Te;oe[245]=Te;oe[246]=Te;oe[247]=T0;oe[248]=mo("simple values are not supported");oe[249]=O0;oe[250]=I0;oe[251]=E0;oe[252]=Te;oe[253]=Te;oe[254]=Te;oe[255]=A0;var Vt=[];for(let e=0;e<24;e++)Vt[e]=new Z(E.uint,e,1);for(let e=-1;e>=-24;e--)Vt[31-e]=new Z(E.negint,e,1);Vt[64]=new Z(E.bytes,new Uint8Array(0),1);Vt[96]=new Z(E.string,"",1);Vt[128]=new Z(E.array,0,1);Vt[160]=new Z(E.map,0,1);Vt[244]=new Z(E.false,!1,1);Vt[245]=new Z(E.true,!0,1);Vt[246]=new Z(E.null,null,1);function R0(e){switch(e.type){case E.false:return Yt([244]);case E.true:return Yt([245]);case E.null:return Yt([246]);case E.bytes:return e.value.length?void 0:Yt([64]);case E.string:return e.value===""?Yt([96]):void 0;case E.array:return e.value===0?Yt([128]):void 0;case E.map:return e.value===0?Yt([160]):void 0;case E.uint:return e.value<24?Yt([Number(e.value)]):void 0;case E.negint:if(e.value>=-24)return Yt([31-Number(e.value)])}}var P0=Object.freeze({float64:!0,mapSorter:x0,quickEncodeToken:R0});function Zs(){let e=[];return e[E.uint.major]=Kr,e[E.negint.major]=qs,e[E.bytes.major]=go,e[E.string.major]=i0,e[E.array.major]=Gs,e[E.map.major]=Ws,e[E.tag.major]=Hs,e[E.float.major]=Xs,e}var $0=Zs(),N0=new Fl,vc=class Yl{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(`${Ur} object contains circular references`);return new Yl(r,t)}},cr={null:new Z(E.null,null),undefined:new Z(E.undefined,void 0),true:new Z(E.true,!0),false:new Z(E.false,!1),emptyArray:new Z(E.array,0),emptyMap:new Z(E.map,0)},yr={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new Z(E.float,e):e>=0?new Z(E.uint,e):new Z(E.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new Z(E.uint,e):new Z(E.negint,e)},Uint8Array(e,t,r,n){return new Z(E.bytes,e)},string(e,t,r,n){return new Z(E.string,e)},boolean(e,t,r,n){return e?cr.true:cr.false},null(e,t,r,n){return cr.null},undefined(e,t,r,n){return cr.undefined},ArrayBuffer(e,t,r,n){return new Z(E.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new Z(E.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[cr.emptyArray,new Z(E.break)]:cr.emptyArray;n=vc.createCheck(n,e);let i=[],s=0;for(let o of e)i[s++]=xi(o,r,n);return r.addBreakTokens?[new Z(E.array,e.length),i,new Z(E.break)]:[new Z(E.array,e.length),i]},Object(e,t,r,n){let i=t!=="Object",s=i?e.keys():Object.keys(e),o=i?e.size:s.length,a;if(o){a=new Array(o),n=vc.createCheck(n,e);let l=!i&&r.ignoreUndefinedProperties,c=0;for(let d of s){let g=i?e.get(d):e[d];l&&g===void 0||(a[c++]=[xi(d,r,n),xi(g,r,n)])}c<o&&(a.length=c)}return a?.length?(C0(a,r),r.addBreakTokens?[new Z(E.map,a.length),a,new Z(E.break)]:[new Z(E.map,a.length),a]):r.addBreakTokens===!0?[cr.emptyMap,new Z(E.break)]:cr.emptyMap}};yr.Map=yr.Object;yr.Buffer=yr.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))yr[`${e}Array`]=yr.DataView;function xi(e,t={},r){let n=ET(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||yr[n];if(typeof i=="function"){let o=i(e,n,t,r);if(o!=null)return o}let s=yr[n];if(!s)throw new Error(`${Ur} unsupported type: ${n}`);return s(e,n,t,r)}function C0(e,t){t.mapSorter&&e.sort(t.mapSorter)}function x0(e,t){if(e[0]instanceof Z&&t[0]instanceof Z){let r=e[0],n=t[0];return r._keyBytes||(r._keyBytes=bc(r.value)),n._keyBytes||(n._keyBytes=bc(n.value)),kl(r._keyBytes,n._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}function bc(e){return Zl(e,$0,P0)}function Ql(e,t,r,n){if(Array.isArray(t))for(let i of t)Ql(e,i,r,n);else r[t.type.major](e,t,n)}var lE=E.uint.majorEncoded,fE=E.negint.majorEncoded,dE=E.bytes.majorEncoded,pE=E.string.majorEncoded,hE=E.array.majorEncoded,yE=E.float.majorEncoded|Vl,gE=E.float.majorEncoded|zl,mE=E.float.majorEncoded|ql,vE=E.float.majorEncoded|Gl,bE=BigInt(-1),_E=BigInt(1);function Zl(e,t,r,n){let i=n instanceof Uint8Array,s=i?new DT(n):N0,o=xi(e,r);if(!Array.isArray(o)&&r.quickEncodeToken){let a=r.quickEncodeToken(o);if(a)return i?(s.push(a),s.toBytes()):a;let l=t[o.type.major];if(l.encodedSize){let c=l.encodedSize(o,r);if(i||(s=new Fl(c)),l(s,o,r),s.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${o} was wrong`);return i?s.toBytes():yo(s.chunks[0])}}return s.reset(),Ql(s,o,t,r),s.toBytes(!0)}var U0={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},M0=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],t=Vt[e];if(t===void 0){let r=oe[e];if(!r)throw new Error(`${de} 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}},qn=Symbol.for("DONE"),vo=Symbol.for("BREAK");function D0(e,t,r){let n=[];for(let i=0;i<e.value;i++){let s=Gn(t,r);if(s===vo){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed array`)}if(s===qn)throw new Error(`${de} found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=s}return n}function B0(e,t,r){let n=r.useMaps===!0,i=r.rejectDuplicateMapKeys===!0,s=n?void 0:{},o=n?new Map:void 0;for(let a=0;a<e.value;a++){let l=Gn(t,r);if(l===vo){if(e.value===1/0)break;throw new Error(`${de} got unexpected break to lengthed map`)}if(l===qn)throw new Error(`${de} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(!n&&typeof l!="string")throw new Error(`${de} non-string keys not supported (got ${typeof l})`);if(i&&(n&&o.has(l)||!n&&Object.hasOwn(s,l)))throw new Error(`${de} found repeat map key "${l}"`);let c=Gn(t,r);if(c===qn)throw new Error(`${de} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?o.set(l,c):s[l]=c}return n?o:s}function Gn(e,t){if(e.done())return qn;let r=e.next();if(E.equals(r.type,E.break))return vo;if(r.type.terminal)return r.value;if(E.equals(r.type,E.array))return D0(r,e,t);if(E.equals(r.type,E.map))return B0(r,e,t);if(E.equals(r.type,E.tag)){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Gn(e,t);return t.tags[r.value](n)}throw new Error(`${de} tag not supported (${r.value})`)}throw new Error("unsupported")}function L0(e,t){if(!(e instanceof Uint8Array))throw new Error(`${de} data to decode must be a Uint8Array`);t=Object.assign({},U0,t);let r=yo(e),n=t.tokenizer||new M0(r,t),i=Gn(n,t);if(i===qn)throw new Error(`${de} did not find any content to decode`);if(i===vo)throw new Error(`${de} got unexpected break`);return[i,e.subarray(n.pos())]}function ef(e,t){let[r,n]=L0(e,t);if(n.length>0)throw new Error(`${de} too many terminals, data makes no sense`);return r}var j0=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(E.equals(t.type,E.array)&&(t.elements++,t.elements!==1&&e.push([44])),E.equals(t.type,E.map)&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[E.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[E.negint.major](e,t){this[E.uint.major](e,t)}[E.bytes.major](e,t){throw new Error(`${Ur} unsupported type: Uint8Array`)}[E.string.major](e,t){this.prefix(e);let r=jl(JSON.stringify(t.value));e.push(r.length>32?yo(r):r)}[E.array.major](e,t){this.prefix(e),this.inRecursive.push({type:E.array,elements:0}),e.push([91])}[E.map.major](e,t){this.prefix(e),this.inRecursive.push({type:E.map,elements:0}),e.push([123])}[E.tag.major](e,t){}[E.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(E.equals(s.type,E.array))e.push([93]);else if(E.equals(s.type,E.map))e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${Ur} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s),!i&&(n[s]===46||n[s]===101||n[s]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function k0(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${Ur} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==E.string||n.type!==E.string)throw new Error(`${Ur} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${Ur} unexpected duplicate map keys, this is not supported`)}var F0={addBreakTokens:!0,mapSorter:k0};function K0(e,t){return t=Object.assign({},F0,t),Zl(e,new j0,t)}var tf=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${de} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${de} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=o=>{for(;!this.done();){let a=this.ch();if(o.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new Z(E.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${de} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${de} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return r?new Z(E.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new Z(s>=0?E.uint:E.negint,s,this._pos-e):new Z(s>=0?E.uint:E.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${de} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new Z(E.string,a,s)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${de} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${de} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},n=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${de} unexpected unicode sequence at position ${this._pos}`);let a,l,c,d;switch(o){case 1:i<128&&(s=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(s=d));break;case 3:a=this.data[this._pos+1],l=this.data[this._pos+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:a=this.data[this._pos+1],l=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(s=d))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${de} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${de} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new Z(E.string,UT(t),this._pos-e);default:if(i<32)throw new Error(`${de} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${de} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new Z(E.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new Z(E.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new Z(E.null,null,4);case 102:return this.expect([102,97,108,115,101]),new Z(E.false,!1,5);case 116:return this.expect([116,114,117,101]),new Z(E.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${de} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new Z(E.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new Z(E.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new Z(E.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new Z(E.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${de} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function V0(e,t){return t=Object.assign({tokenizer:new tf(e,t)},t),ef(e,t)}var wE=new Uint8Array(0);function z0(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}function ea(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")}function q0(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 i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var K=0,H=0,F=0,j=R.length;F!==j&&R[F]===0;)F++,K++;for(var V=(j-F)*d+1>>>0,G=new Uint8Array(V);F!==j;){for(var k=R[F],Q=0,q=V-1;(k!==0||Q<H)&&q!==-1;q--,Q++)k+=256*G[q]>>>0,G[q]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");H=Q,F++}for(var ce=V-H;ce!==V&&G[ce]===0;)ce++;for(var U=l.repeat(K);ce<V;++ce)U+=e.charAt(G[ce]);return U}function x(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var K=0;if(R[K]!==" "){for(var H=0,F=0;R[K]===l;)H++,K++;for(var j=(R.length-K)*c+1>>>0,V=new Uint8Array(j);R[K];){var G=r[R.charCodeAt(K)];if(G===255)return;for(var k=0,Q=j-1;(G!==0||k<F)&&Q!==-1;Q--,k++)G+=a*V[Q]>>>0,V[Q]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");F=k,K++}if(R[K]!==" "){for(var q=j-F;q!==j&&V[q]===0;)q++;for(var ce=new Uint8Array(H+(j-q)),U=H;q!==j;)ce[U++]=V[q++];return ce}}}function S(R){var K=x(R);if(K)return K;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:x,decode:S}}var G0=q0,W0=G0,H0=W0,J0=class{name;prefix;baseEncode;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")}},X0=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,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 rf(this,e)}},Y0=class{decoders;constructor(e){this.decoders=e}or(e){return rf(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function rf(e,t){return new Y0({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var Q0=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new J0(e,t,r),this.decoder=new X0(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function nf({name:e,prefix:t,encode:r,decode:n}){return new Q0(e,t,r,n)}function bo({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=H0(r,e);return nf({prefix:t,name:e,encode:n,decode:s=>ea(i(s))})}function Z0(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),o=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,o+=r,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=r||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s}function eA(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s}function tA(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function ct({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=tA(n);return nf({prefix:t,name:e,encode(s){return eA(s,n,r)},decode(s){return Z0(s,i,r,e)}})}var Ui=ct({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),TE=ct({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),AE=ct({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),OE=ct({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),IE=ct({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),EE=ct({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),SE=ct({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),RE=ct({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),PE=ct({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),ds=bo({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),$E=bo({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),dr=bo({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),NE=bo({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),rA=of,_c=128,nA=127,iA=~nA,oA=Math.pow(2,31);function of(e,t,r){t=t||[],r=r||0;for(var n=r;e>=oA;)t[r++]=e&255|_c,e/=128;for(;e&iA;)t[r++]=e&255|_c,e>>>=7;return t[r]=e|0,of.bytes=r-n+1,t}var sA=_s,aA=128,wc=127;function _s(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw _s.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&wc)<<i:(o&wc)*Math.pow(2,i),i+=7}while(o>=aA);return _s.bytes=s-n,r}var uA=Math.pow(2,7),cA=Math.pow(2,14),lA=Math.pow(2,21),fA=Math.pow(2,28),dA=Math.pow(2,35),pA=Math.pow(2,42),hA=Math.pow(2,49),yA=Math.pow(2,56),gA=Math.pow(2,63),mA=function(e){return e<uA?1:e<cA?2:e<lA?3:e<fA?4:e<dA?5:e<pA?6:e<hA?7:e<yA?8:e<gA?9:10},vA={encode:rA,decode:sA,encodingLength:mA},bA=vA,Hi=bA;function ws(e,t=0){return[Hi.decode(e,t),Hi.decode.bytes]}function Ji(e,t,r=0){return Hi.encode(e,t,r),t}function Xi(e){return Hi.encodingLength(e)}function _A(e,t){let r=t.byteLength,n=Xi(e),i=n+Xi(r),s=new Uint8Array(i+r);return Ji(e,s,0),Ji(r,s,n),s.set(t,i),new ta(e,r,t,s)}function sf(e){let t=ea(e),[r,n]=ws(t),[i,s]=ws(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new ta(r,i,o,t)}function wA(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&z0(e.bytes,r.bytes)}}var ta=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function Tc(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return AA(r,Ts(e),t??dr.encoder);default:return OA(r,Ts(e),t??Ui.encoder)}}var Ac=new WeakMap;function Ts(e){let t=Ac.get(e);if(t==null){let r=new Map;return Ac.set(e,r),r}return t}var Zn=class Je{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Dn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==IA)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Je.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=_A(t,r);return Je.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Je.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&wA(t.multihash,n.multihash)}toString(t){return Tc(this,t)}toJSON(){return{"/":Tc(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof Je)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Je(n,i,s,o??Oc(n,i,s.bytes))}else if(r[EA]===!0){let{version:n,multihash:i,code:s}=r,o=sf(i);return Je.create(n,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Dn)throw new Error(`Version 0 CID must use dag-pb (code: ${Dn}) block encoding`);return new Je(t,r,n,n.bytes)}case 1:{let i=Oc(t,r,n.bytes);return new Je(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Je.create(0,Dn,t)}static createV1(t,r){return Je.create(1,t,r)}static decode(t){let[r,n]=Je.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Je.inspectBytes(t),n=r.size-r.multihashSize,i=ea(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new ta(r.multihashCode,r.digestSize,s,i);return[r.version===0?Je.createV0(o):Je.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,x]=ws(t.subarray(r));return r+=x,g},i=n(),s=Dn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),l=n(),c=r+l,d=c-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,r){let[n,i]=TA(t,r),s=Je.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ts(s).set(n,t),s}};function TA(e,t){switch(e[0]){case"Q":{let r=t??dr;return[dr.prefix,r.decode(`${dr.prefix}${e}`)]}case dr.prefix:{let r=t??dr;return[dr.prefix,r.decode(e)]}case Ui.prefix:{let r=t??Ui;return[Ui.prefix,r.decode(e)]}case ds.prefix:{let r=t??ds;return[ds.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function AA(e,t,r){let{prefix:n}=r;if(n!==dr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i}function OA(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i}var Dn=112,IA=18;function Oc(e,t,r){let n=Xi(e),i=n+Xi(t),s=new Uint8Array(i+r.byteLength);return Ji(e,s,0),Ji(t,s,n),s.set(r,i),s}var EA=Symbol.for("@ipld/js-cid/CID"),af=ct({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),CE=ct({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),xE=ct({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),UE=ct({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});function SA(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function RA(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Zn.asCID(e);if(!t)return null;let r=t.toString();return[new Z(E.map,1/0,1),new Z(E.string,"/",1),new Z(E.string,r,r.length),new Z(E.break,void 0,1)]}function Yi(e){let t=af.encode(e).slice(1);return[new Z(E.map,1/0,1),new Z(E.string,"/",1),new Z(E.map,1/0,1),new Z(E.string,"bytes",5),new Z(E.string,t,t.length),new Z(E.break,void 0,1),new Z(E.break,void 0,1)]}function xt(e){return Yi(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function PA(e){return Yi(new Uint8Array(e))}function $A(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function NA(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}var CA={typeEncoders:{Object:RA,Buffer:Yi,Uint8Array:Yi,Int8Array:xt,Uint16Array:xt,Int16Array:xt,Uint32Array:xt,Int32Array:xt,Float32Array:xt,Float64Array:xt,Uint8ClampedArray:xt,BigInt64Array:xt,BigUint64Array:xt,DataView:xt,ArrayBuffer:PA,undefined:$A,number:NA}},xA=class extends tf{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===E.map){let t=this._next();if(t.type===E.string&&t.value==="/"){let r=this._next();if(r.type===E.string){if(this._next().type!==E.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new Z(E.tag,42,0)}if(r.type===E.map){let n=this._next();if(n.type===E.string&&n.value==="bytes"){let i=this._next();if(i.type===E.string){for(let o=0;o<2;o++)if(this._next().type!==E.break)throw new Error("Invalid encoded Bytes form");let s=af.decode(`m${i.value}`);return new Z(E.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},As={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};As.tags[42]=Zn.parse;var UA="dag-json",uf=297,ra=e=>K0(e,CA),na=e=>{let t=SA(e),r=Object.assign(As,{tokenizer:new xA(t,As)});return V0(t,r)},Ic=e=>MA.decode(ra(e)),MA=new TextDecoder,DA=e=>na(BA.encode(e)),BA=new TextEncoder;function LA(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function cf(e,t,r=""){let n=LA(e),i=e?.length,s=t!==void 0;if(!n||s&&i!==t){let o=r&&`"${r}" `,a=s?` of length ${t}`:"",l=n?`length=${i}`:`type=${typeof e}`;throw new Error(o+"expected Uint8Array"+a+", got "+l)}return e}function Ec(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function jA(e,t){cf(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw new Error('"digestInto() output" expected to be of length >='+r)}function Os(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ps(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function kt(e,t){return e<<32-t|e>>>t}function kA(e,t={}){let r=(i,s)=>e(s).update(i).digest(),n=e(void 0);return r.outputLen=n.outputLen,r.blockLen=n.blockLen,r.create=i=>e(i),Object.assign(r,t),Object.freeze(r)}var FA=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function KA(e,t,r){return e&t^~e&r}function VA(e,t,r){return e&t^e&r^t&r}var zA=class{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,n){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=ps(this.buffer)}update(e){Ec(this),cf(e);let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let s=0;s<i;){let o=Math.min(n-this.pos,i-s);if(o===n){let a=ps(e);for(;n<=i-s;s+=n)this.process(a,s);continue}r.set(e.subarray(s,s+o),this.pos),this.pos+=o,s+=o,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ec(this),jA(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:s}=this;t[s++]=128,Os(this.buffer.subarray(s)),this.padOffset>n-s&&(this.process(r,0),s=0);for(let d=s;d<n;d++)t[d]=0;r.setBigUint64(n-8,BigInt(this.length*8),i),this.process(r,0);let o=ps(e),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");let l=a/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<l;d++)o.setUint32(4*d,c[d],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:s,pos:o}=this;return e.destroyed=s,e.finished=i,e.length=n,e.pos=o,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}},lr=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qA=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),fr=new Uint32Array(64),GA=class extends zA{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:n,E:i,F:s,G:o,H:a}=this;return[e,t,r,n,i,s,o,a]}set(e,t,r,n,i,s,o,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=n|0,this.E=i|0,this.F=s|0,this.G=o|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)fr[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let g=fr[d-15],x=fr[d-2],S=kt(g,7)^kt(g,18)^g>>>3,R=kt(x,17)^kt(x,19)^x>>>10;fr[d]=R+fr[d-7]+S+fr[d-16]|0}let{A:r,B:n,C:i,D:s,E:o,F:a,G:l,H:c}=this;for(let d=0;d<64;d++){let g=kt(o,6)^kt(o,11)^kt(o,25),x=c+g+KA(o,a,l)+qA[d]+fr[d]|0,R=(kt(r,2)^kt(r,13)^kt(r,22))+VA(r,n,i)|0;c=l,l=a,a=o,o=s+x|0,s=i,i=n,n=r,r=x+R|0}r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,s=s+this.D|0,o=o+this.E|0,a=a+this.F|0,l=l+this.G|0,c=c+this.H|0,this.set(r,n,i,s,o,a,l,c)}roundClean(){Os(fr)}destroy(){this.set(0,0,0,0,0,0,0,0),Os(this.buffer)}},WA=class extends GA{A=lr[0]|0;B=lr[1]|0;C=lr[2]|0;D=lr[3]|0;E=lr[4]|0;F=lr[5]|0;G=lr[6]|0;H=lr[7]|0;constructor(){super(32)}},HA=kA(()=>new WA,FA(1)),ME=new Uint8Array(0);function JA(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}function ia(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")}function XA(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 i=0;i<e.length;i++){var s=e.charAt(i),o=s.charCodeAt(0);if(r[o]!==255)throw new TypeError(s+" is ambiguous");r[o]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function g(R){if(R instanceof Uint8Array||(ArrayBuffer.isView(R)?R=new Uint8Array(R.buffer,R.byteOffset,R.byteLength):Array.isArray(R)&&(R=Uint8Array.from(R))),!(R instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(R.length===0)return"";for(var K=0,H=0,F=0,j=R.length;F!==j&&R[F]===0;)F++,K++;for(var V=(j-F)*d+1>>>0,G=new Uint8Array(V);F!==j;){for(var k=R[F],Q=0,q=V-1;(k!==0||Q<H)&&q!==-1;q--,Q++)k+=256*G[q]>>>0,G[q]=k%a>>>0,k=k/a>>>0;if(k!==0)throw new Error("Non-zero carry");H=Q,F++}for(var ce=V-H;ce!==V&&G[ce]===0;)ce++;for(var U=l.repeat(K);ce<V;++ce)U+=e.charAt(G[ce]);return U}function x(R){if(typeof R!="string")throw new TypeError("Expected String");if(R.length===0)return new Uint8Array;var K=0;if(R[K]!==" "){for(var H=0,F=0;R[K]===l;)H++,K++;for(var j=(R.length-K)*c+1>>>0,V=new Uint8Array(j);R[K];){var G=r[R.charCodeAt(K)];if(G===255)return;for(var k=0,Q=j-1;(G!==0||k<F)&&Q!==-1;Q--,k++)G+=a*V[Q]>>>0,V[Q]=G%256>>>0,G=G/256>>>0;if(G!==0)throw new Error("Non-zero carry");F=k,K++}if(R[K]!==" "){for(var q=j-F;q!==j&&V[q]===0;)q++;for(var ce=new Uint8Array(H+(j-q)),U=H;q!==j;)ce[U++]=V[q++];return ce}}}function S(R){var K=x(R);if(K)return K;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:x,decode:S}}var YA=XA,QA=YA,ZA=QA,eO=class{name;prefix;baseEncode;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")}},tO=class{name;prefix;baseDecode;prefixCodePoint;constructor(e,t,r){this.name=e,this.prefix=t;let n=t.codePointAt(0);if(n===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=n,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 lf(this,e)}},rO=class{decoders;constructor(e){this.decoders=e}or(e){return lf(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r!=null)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}};function lf(e,t){return new rO({...e.decoders??{[e.prefix]:e},...t.decoders??{[t.prefix]:t}})}var nO=class{name;prefix;baseEncode;baseDecode;encoder;decoder;constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new eO(e,t,r),this.decoder=new tO(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}};function ff({name:e,prefix:t,encode:r,decode:n}){return new nO(e,t,r,n)}function _o({name:e,prefix:t,alphabet:r}){let{encode:n,decode:i}=ZA(r,e);return ff({prefix:t,name:e,encode:n,decode:s=>ia(i(s))})}function iO(e,t,r,n){let i=e.length;for(;e[i-1]==="=";)--i;let s=new Uint8Array(i*r/8|0),o=0,a=0,l=0;for(let c=0;c<i;++c){let d=t[e[c]];if(d===void 0)throw new SyntaxError(`Non-${n} character`);a=a<<r|d,o+=r,o>=8&&(o-=8,s[l++]=255&a>>o)}if(o>=r||255&a<<8-o)throw new SyntaxError("Unexpected end of data");return s}function oO(e,t,r){let n=t[t.length-1]==="=",i=(1<<r)-1,s="",o=0,a=0;for(let l=0;l<e.length;++l)for(a=a<<8|e[l],o+=8;o>r;)o-=r,s+=t[i&a>>o];if(o!==0&&(s+=t[i&a<<r-o]),n)for(;s.length*r&7;)s+="=";return s}function sO(e){let t={};for(let r=0;r<e.length;++r)t[e[r]]=r;return t}function er({name:e,prefix:t,bitsPerChar:r,alphabet:n}){let i=sO(n);return ff({prefix:t,name:e,encode(s){return oO(s,n,r)},decode(s){return iO(s,i,r,e)}})}var Mi=er({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),DE=er({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),BE=er({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),LE=er({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),jE=er({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),kE=er({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),FE=er({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),KE=er({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),VE=er({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),hs=_o({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),zE=_o({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),pr=_o({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),qE=_o({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),df={};No(df,{Digest:()=>wo,create:()=>oa,decode:()=>hf,equals:()=>yf,hasCode:()=>IO});var aO=pf,Sc=128,uO=127,cO=~uO,lO=Math.pow(2,31);function pf(e,t,r){t=t||[],r=r||0;for(var n=r;e>=lO;)t[r++]=e&255|Sc,e/=128;for(;e&cO;)t[r++]=e&255|Sc,e>>>=7;return t[r]=e|0,pf.bytes=r-n+1,t}var fO=Is,dO=128,Rc=127;function Is(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Is.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&Rc)<<i:(o&Rc)*Math.pow(2,i),i+=7}while(o>=dO);return Is.bytes=s-n,r}var pO=Math.pow(2,7),hO=Math.pow(2,14),yO=Math.pow(2,21),gO=Math.pow(2,28),mO=Math.pow(2,35),vO=Math.pow(2,42),bO=Math.pow(2,49),_O=Math.pow(2,56),wO=Math.pow(2,63),TO=function(e){return e<pO?1:e<hO?2:e<yO?3:e<gO?4:e<mO?5:e<vO?6:e<bO?7:e<_O?8:e<wO?9:10},AO={encode:aO,decode:fO,encodingLength:TO},OO=AO,Qi=OO;function Es(e,t=0){return[Qi.decode(e,t),Qi.decode.bytes]}function Zi(e,t,r=0){return Qi.encode(e,t,r),t}function eo(e){return Qi.encodingLength(e)}function oa(e,t){let r=t.byteLength,n=eo(e),i=n+eo(r),s=new Uint8Array(i+r);return Zi(e,s,0),Zi(r,s,n),s.set(t,i),new wo(e,r,t,s)}function hf(e){let t=ia(e),[r,n]=Es(t),[i,s]=Es(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new wo(r,i,o,t)}function yf(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&JA(e.bytes,r.bytes)}}var wo=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function IO(e,t){return e.code===t}function Pc(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return SO(r,Ss(e),t??pr.encoder);default:return RO(r,Ss(e),t??Mi.encoder)}}var $c=new WeakMap;function Ss(e){let t=$c.get(e);if(t==null){let r=new Map;return $c.set(e,r),r}return t}var gf=class Xe{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Bn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==PO)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Xe.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=oa(t,r);return Xe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Xe.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&yf(t.multihash,n.multihash)}toString(t){return Pc(this,t)}toJSON(){return{"/":Pc(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof Xe)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Xe(n,i,s,o??Nc(n,i,s.bytes))}else if(r[$O]===!0){let{version:n,multihash:i,code:s}=r,o=hf(i);return Xe.create(n,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Bn)throw new Error(`Version 0 CID must use dag-pb (code: ${Bn}) block encoding`);return new Xe(t,r,n,n.bytes)}case 1:{let i=Nc(t,r,n.bytes);return new Xe(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Xe.create(0,Bn,t)}static createV1(t,r){return Xe.create(1,t,r)}static decode(t){let[r,n]=Xe.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Xe.inspectBytes(t),n=r.size-r.multihashSize,i=ia(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new wo(r.multihashCode,r.digestSize,s,i);return[r.version===0?Xe.createV0(o):Xe.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,x]=Es(t.subarray(r));return r+=x,g},i=n(),s=Bn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),l=n(),c=r+l,d=c-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,r){let[n,i]=EO(t,r),s=Xe.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return Ss(s).set(n,t),s}};function EO(e,t){switch(e[0]){case"Q":{let r=t??pr;return[pr.prefix,r.decode(`${pr.prefix}${e}`)]}case pr.prefix:{let r=t??pr;return[pr.prefix,r.decode(e)]}case Mi.prefix:{let r=t??Mi;return[Mi.prefix,r.decode(e)]}case hs.prefix:{let r=t??hs;return[hs.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function SO(e,t,r){let{prefix:n}=r;if(n!==pr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i}function RO(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i}var Bn=112,PO=18;function Nc(e,t,r){let n=eo(e),i=n+eo(t),s=new Uint8Array(i+r.byteLength);return Zi(e,s,0),Zi(t,s,n),s.set(r,i),s}var $O=Symbol.for("@ipld/js-cid/CID"),NO=20;function mf({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new CO(e,t,r,n,i)}var CO=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,n,i){this.name=e,this.code=t,this.encode=r,this.minDigestLength=n??NO,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?Cc(r,this.code,t?.truncate):r.then(n=>Cc(n,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function Cc(e,t,r){if(r!=null&&r!==e.byteLength){if(r>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r)}return oa(t,e)}var Ve=ft(qt(),1),vf=ft(ph(),1),xc=e=>Ve.Type.Union([e,Ve.Type.Null()]);var bf=/^(k51qz|baguq)[0-9a-z]{56,57}$/,xO=/^[0-9A-Fa-f]{7,8}$/g;Ve.FormatRegistry.Set("EntityID",e=>!!e.match(xO)||!!e.match(bf));var UO=Ve.Type.String(),MO=e=>e?.enc instanceof Uint8Array;Ve.FormatRegistry.Set("CID",e=>!!e.match(bf));var _f=Ve.Type.String({format:"CID"}),DO=/^http([s]?):\/\/.*\..*/;Ve.FormatRegistry.Set("URL",e=>!!e.match(DO));var GE=Ve.Type.String({format:"URL"}),wf=Ve.Type.Object({en:UO,at:Ve.Type.String(),vl:xc(Ve.Type.Union([Ve.Type.String(),Ve.Type.Boolean(),Ve.Type.Number()])),ts:Ve.Type.String(),ag:Ve.Type.String(),pv:xc(_f)}),Uc=vf.TypeCompiler.Compile(wf);var WE=Uc.Check.bind(Uc),BO=Ve.Type.Composite([Ve.Type.Object({cid:_f}),wf]),Rs=vf.TypeCompiler.Compile(BO),LO=e=>Array.from(Rs.Errors(e)),Tf=Rs.Check.bind(Rs);function Af(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var jO=mf({name:"sha2-256",code:18,encode:Af("SHA-256")}),HE=mf({name:"sha2-512",code:19,encode:Af("SHA-512")}),{WARN:Mc,LOG:JE,DEBUG:kO,VERBOSE:Of,ERROR:FO}=Oe.setup(Oe.INFO);function If(e,t=["cid"]){if(!e)throw FO("falsy log",e);let r=e.cid;if(MO(e))return r||(r=sa(Ef(e).bytes).toString()),Mc("preparing an encrypted applog - really?"),{log:e,cid:r};let n={};for(let[i,s]of Object.entries(e))s===void 0&&(Mc(`log.${i} is undefined, which is not allowed - encoding as null`,e),s=null),t.includes(i)?Of("excluding app log",{key:i,val:s}):n[i]=s;return{log:n,cid:r}}function KO(e){return sa(VO(e).bytes)}function VO(e){return Ef(If(e)?.log)}function sa(e){let t=HA(e),r=df.create(jO.code,t),n=gf.create(1,uf,r);return Of("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Ef(e){kO("[encodeBlock]",e);let t=ra(e);return{bytes:t,cid:sa(t)}}function Dc(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function zO(e,t){let r=Dc(e),n=Dc(t);return+r<+n}var{WARN:qO,LOG:XE,DEBUG:YE,VERBOSE:to,ERROR:ro}=Oe.setup(Oe.INFO),GO=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Sf=(e,t,r)=>Be.structural(dc(t,e),dc(r,e)),WO=(e,t,r="asc")=>GO(e.ts,t.ts,r),QE=oT(Sf,["en","at"]);function Wn(e,t="asc"){return e.sort((r,n)=>WO(r,n,t))}var HO=(e,t)=>zO(new Date(e.ts),new Date(t.ts));var JO=()=>{qO("[removeDuplicateAppLogs] mode not set; pass 'safety' or 'cleanup' for optimal behavior")},Bc=e=>{let t=new Map,r=to.isEnabled;for(let n of e){if(!n)throw ro("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!n.cid)throw ro("applog with missing CID",n),new Error("applog with missing CID");let i=n.cid,s=t.get(i);s?r&&to("Skipping duplicate applog:",[s,n]):t.set(i,n)}return Array.from(t.values())},XO=e=>{let t=new Set,r=to.isEnabled,n=r?new Map:null,i=null,s=0;for(let o of e){if(!o)throw ro("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!o.cid)throw ro("applog with missing CID",o),new Error("applog with missing CID");let a=o.cid;t.has(a)?(i||(i=e.slice(0,s)),r&&to("Skipping duplicate applog:",[n?.get(a),o])):(t.add(a),n&&n.set(a,o),i&&i.push(o)),s++}return i??e},Rf=(e,t)=>t?t==="safety"?XO(e):Bc(e):(JO(),Bc(e));function YO(e){return typeof e=="string"&&e.startsWith("?")}function QO(e){return e.slice(1)}function aa(e,t){let r={},n={};for(let[i,s]of Object.entries(e))if(YO(s)){let o=QO(s),a=t[o];a?n[i]=a:r[i]=o}else n[i]=s;return[n,r]}function ZO(e,t,r){let n;if(t){let i=typeof t;i==="string"?n=t===r:i==="function"?n=t(r):typeof t.has=="function"?n=t.has(r):Array.isArray(t)&&!Array.isArray(r)?n=t.includes(r):n=t===r}else n=t===r;return e.charAt(0)==="!"?!n:n}var Pf=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},Lc=function(t){return Pf(t)/t.length},At={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return At.max(e)-At.min(e)},midrange:function(e){return At.range(e)/2},sum:Pf,mean:Lc,average:Lc,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=At.mean(e);return At.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(At.variance(e))},meanAbsoluteDeviation:function(e){var t=At.mean(e);return At.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=At.mean(e),r=At.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};At.average=At.mean;var $f=function(e,t=13,r){if(!e?.length)throw new Error(`Empty string: ${e}`);let n=3735928559^t,i=1103547991^t;for(let o=0,a;o<e.length;o++)a=e.charCodeAt(o),n=Math.imul(n^a,2654435761),i=Math.imul(i^a,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(16).slice(-r).padStart(r,"0")};function Nf(){return new Date().toISOString()}var{WARN:eI,LOG:ZE,DEBUG:je,VERBOSE:e1,ERROR:no}=Oe.setup(Oe.INFO);function tI(e,t){je(`[ensureTsPvAndFinalizeApplogs] ENTER - ${e.length} applogs, thread size=${t.size}`);let r=Nf(),n=t;je("[ensureTsPvAndFinalizeApplogs] About to map over applogs");let i=e.map((s,o)=>{je(`[ensureTsPvAndFinalizeApplogs] Processing applog ${o+1}/${e.length}`);let a=rI(s,{ts:r,threadForPv:n});return je(`[ensureTsPvAndFinalizeApplogs] Finalized applog ${o+1}/${e.length}`),a});return je(`[ensureTsPvAndFinalizeApplogs] EXIT - mapped ${i.length} applogs`),i}function rI(e,{ts:t,threadForPv:r}={}){je(`[finalizeApplogForInsert] ENTER - en=${e.en}, at=${e.at}`),je("[finalizeApplogForInsert] About to call withTs");let n=oI(e,t??Nf());je(`[finalizeApplogForInsert] About to call withPvFrom (thread size=${r?.size??"null"})`);let i=sI(n,r);je("[finalizeApplogForInsert] About to call encodeApplogAndGetCid");let s=KO(i).toString();je(`[finalizeApplogForInsert] CID created: ${s}`),e.cid&&e.cid!==s&&eI("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(je("[finalizeApplogForInsert] About to validate applog"),!Tf(o))throw no(`Bogus Applog ${JSON.stringify(o)}`,LO(o));return je(`[finalizeApplogForInsert] EXIT - CID=${s}`),Object.freeze(o)}function nI(e){return!!e.ts}function iI(e){return!!e.pv}function oI(e,t){return nI(e)?e:{...e,ts:t}}function sI(e,t){if(je(`[withPvFrom] ENTER - en=${e.en}, at=${e.at}, hasPv=${e.pv!==void 0}`),e.pv!==void 0)return je("[withPvFrom] EXIT early - pv already set"),e;if(t){let{en:r,at:n}=e;je(`[withPvFrom] About to call thread.findLast for en=${r}, at=${n}, thread.size=${t.size}`);let i=t.findLast(o=>o.en==r&&o.at==n);if(je(`[withPvFrom] findLast completed, found=${!!i}`),je("[withPvFrom] About to check equality"),Sf(["en","at","vl","ts","ag"],e,i))throw no("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let s=(e.pv!==void 0?e.pv:i?.cid)??null;return je(`[withPvFrom] EXIT - prevLogCid=${s}`),{...e,pv:s}}else{if(!iI(e))throw no("[withPvFrom] no thread and no pv:",e);return je("[withPvFrom] EXIT - no thread, returning log with existing pv"),e}}function To(e){let t=()=>(Se(()=>e.length<2&&je(`joinThreads with count=${e.length}`)),Wn(Rf(e.flatMap(i=>{let s=i.applogs;if(!s)throw no("falsy applogs of thread",i),new Error("falsy applogs of thread");return s}),"cleanup"))),r=Se(()=>t()),n=tt(function(i,s){return Zt(i)?{init:Se(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.removed?.filter(o=>!!this.parents.some(l=>l===s?!1:l.hasApplog(o,!0)))}});return new Ao(Se(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:jc,LOG:t1,DEBUG:kc,VERBOSE:Cr,ERROR:Ni}=Oe.setup(Oe.INFO),Ao=class Ps extends un{constructor(t,r,n,i,s,o=null,a){super(t,r,n,s?Re.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=s,this._writeMapper=o,this._readOnly=a,ur(this,{onParentUpdate:tt}),s&&this.subscribeToParents()}static mapWrites(t,r,n){return new Ps(`${r}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,n)}static asReadOnly(t){return t.readOnly?t:new Ps(`readOnly(${t.name})`,t,t.filters,t._applogs,null,null,!0)}_parentSubscriptions=null;insert(t){if(this.readOnly)throw Ni("[MappedThread] insert() called on read-only thread:",this.nameAndSizeUntracked);let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insert(r))}insertRaw(t){if(this.readOnly)throw Ni("[MappedThread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insertRaw(r))}subscribeToParents(){this._parentSubscriptions=new Map;let t=wt(()=>{this.parents.length||jc("MappedThread has no parents",this),Cr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(n=>n.name));let r=new Set([...this._parentSubscriptions.keys()]);for(let n of this.parents){r.delete(n)&&Cr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,n.nameAndSizeUntracked),Cr(`[MappedThread: ${this.name}] sub to new parent`,n.nameAndSizeUntracked);let s=this.onParentUpdate.bind(this,n),o=n.subscribe(s);this._parentSubscriptions.set(n,o)}for(let n of r)Cr(`[MappedThread: ${this.name}] un-subscribing from old parent`,n.nameAndSizeUntracked),this._parentSubscriptions.get(n)(),this._parentSubscriptions.delete(n)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Ni("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);kc(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&jc(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Se(()=>Xt(t.applogs))})})}onParentUpdate(t,r){Cr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,r);let n=this._eventMapper?this._eventMapper(r,t):r;if(this._eventMapper)if(Cr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,n),Zt(n))this._applogs.replace([...n.init]);else{for(let i of n.added)this._applogs.splice(gT(this._applogs,i,"ts"),0,i);if(n.removed){for(let i of n.removed)if(!this._applogs.remove(i))if(!Zt(r)&&r.removed?.includes(i))kc("Ignoring remove event for non-existent because it was part of parent event's removed",i,r);else throw Ni(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:r,mapResult:n})}}Cr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,$n(this._applogs)),this.notifySubscribers(n)}get readOnly(){return this._readOnly??!1}},{WARN:r1,LOG:n1,DEBUG:i1,VERBOSE:ys,ERROR:aI}=Oe.setup(Oe.INFO),gr=We("rollingFilter",function(t,r,n={}){let i=uI(r),s=Fc(i),o=Re.array(Se(function(){return s(t.applogs)}),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Mr(i)}}`}`}),a=g=>{let x;return Zt(g)?x={init:s(g.init)}:x={added:s(g.added),removed:g.removed},ys(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",x),x},l=new Ao(`${t.name} | ${n.name||`rollingFilter{${Mr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=hu(()=>Xt(r),g=>{ys(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=Fc(i),l.triggerRemap()}),d=Pr(o,()=>{ys(`rollingFilter<${Se(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),c(),d()});return l},{equals:yn,argsDebugName:(e,t,r)=>ze({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Cf=We("rollingMapper",function(t,r,n={}){let i=Se(()=>r.call(null,{init:t.applogs},t));if(!Zt(i))throw aI("Initial run must return init event");let s=i.init;return new Ao(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,r)},{equals:yn,argsDebugName:(e,t,r)=>ze({caller:"rollingMapper",thread:e,args:r})}),o1=We("rollingAcc",function(t,r,n,i={}){let s=tt(n);return s({init:t.applogs},r),t.subscribe(o=>{s(o,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),uI=function(t){let r=Se(function(){return Object.fromEntries(Object.entries(Xt(t)).map(([i,s])=>[Xt(i),Xt(s)]))});if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function Fc(e){return function(r){return r.filter(function(i){for(let s of Object.keys(e)){let o=e[s];if(o===void 0)continue;let a=i[s.startsWith("!")?s.slice(1):s];if(!ZO(s,o,a))return!1}return!0})}}var s1=Ao.asReadOnly;var{WARN:cI,LOG:lI,DEBUG:Le,VERBOSE:xf,ERROR:Di}=Oe.setup(Oe.INFO),fI=class extends un{constructor(e,t=[],r){super(e,null,r,t),ur(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(r=>!e.includes(r.cid)),t-this.applogs.length}insert(e){Le(`[WriteableThread.insert] ENTER - ${e.length} applogs for thread "${this.name}"`),Le("[WriteableThread.insert] About to call ensureTsPvAndFinalizeApplogs");let t=tI(e,this);Le(`[WriteableThread.insert] ensureTsPvAndFinalizeApplogs completed, mapped=${t.length} applogs`),Le("[WriteableThread.insert] About to call insertRaw");let r=this.insertRaw(t);return Le("[WriteableThread.insert] insertRaw completed"),r}insertMissing(e,t=!1){let r=e.filter(n=>!this.hasApplog(n,t));return r.length===0?(xf("[insertMissing] no missing applogs"),[]):this.insertRaw(r)??[]}insertRaw(e){Le(`[WriteableThread.insertRaw] ENTER - ${e.length} applogs for thread "${this.name}"`),Le("[WriteableThread.insertRaw] About to deduplicate");let t=Rf(e,"safety");if(t.length!==e.length)throw Di(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});Le("[WriteableThread.insertRaw] Deduplication done"),Le("[WriteableThread.insertRaw] About to validate");let r=e.filter(s=>!Tf(s));if(r.length)throw Di(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});Le("[WriteableThread.insertRaw] Validation done"),Le("[WriteableThread.insertRaw] About to check for existing");let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw Di(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(Le("[WriteableThread.insertRaw] Existing check done"),!e.length){cI("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof ua)?lI:Le)("Inserting:",e.length===1?e[0]:e,{ds:this}),Le("[WriteableThread.insertRaw] About to sort applogs"),Wn(e);let i=this._applogs.length&&HO(e[0],this._applogs[this._applogs.length-1]);return Le("[WriteableThread.insertRaw] About to push to _applogs array"),this._applogs.push(...e),i&&(Le("[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)"),Wn(this._applogs)),Le("[WriteableThread.insertRaw] About to notify subscribers"),this.notifySubscribers({added:e,removed:null}),Le("[WriteableThread.insertRaw] Subscribers notified"),Le("[WriteableThread.insertRaw] About to call persist (void - not awaited)"),this.persist(e),Le(`[WriteableThread.insertRaw] EXIT - returning ${e.length} applogs`),e}get readOnly(){return!1}},ua=class Bi extends fI{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,ur(this,{_applogs:Re.shallow})}static empty(t){return Bi.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Bi(r??"in-memory",t,[],n)}static fromReadOnlyArray(t,r){return new Bi(r??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(xf("[InMem.persist] no persist for",t),this.readOnly)throw Di("[persist] called for readOnly thread")}},{WARN:a1,LOG:u1,DEBUG:c1,VERBOSE:l1,ERROR:f1}=Oe.setup(Oe.INFO);var{WARN:tS,LOG:rS,DEBUG:nS,VERBOSE:iS,ERROR:oS}=Oe.setup(Oe.INFO);function ca(e){return $f(e,31,7)}var pI=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,ur(this,{threadOfTrail:xe})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?To([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Uf=class{constructor(e){this.nodes=e,ur(this,{threadOfAllTrails:xe,size:xe,isEmpty:xe})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Se(()=>this.records.length)}get records(){return Kt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return To(Kt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return Kt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return Kt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return To(Kt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:lS,LOG:Oo,DEBUG:tr,VERBOSE:be,ERROR:Vr}=Oe.setup(Oe.INFO,{prefix:"[q]"}),la=null,hI=We("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(be(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return tr("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw Vr("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Cf(t,function(a,l){let c=Zt(a),d,g=[],x=c?null:[];c?(i=new Map,d=a.init):d=a.added;let S;for(let R=r?0:d.length-1;r?R<d.length:R>=0;r?R++:R--){let K=d[R],H=K.en+"|"+K.at;if(S&&(r?S>K.ts:S<K.ts))throw Vr("lastWriteWins.mapper logs not sorted:",S,r?">":"<",K.ts,{log:K,i:R,newLogs:d,inverseToOnlyReturnFirstLogs:r});S=K.ts;let F=i.get(H);(!F||(r?F.ts>K.ts:F.ts<K.ts))&&(F&&!c&&x.push(F),g.push(K),i.set(H,K))}return Wn(g),be.isDisabled||be(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([R,K])=>[R,K?.length])),toAdd:g.length,toRemove:x}:{...a,toAdd:g,toRemove:x}),c?{init:g}:{added:g,removed:x}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return be.isDisabled||wt(()=>{be(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:yn,argsDebugName:e=>ze({caller:"lastWriteWins",thread:e})}),fS=We("withoutDeleted",function(t){if(be.isEnabled&&be(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw Vr("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=gr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});be.isEnabled&&be(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Se(function(){return[...r.applogs]}));let n=ze({caller:"allDeletedEntities",thread:t}),i=Ul(function(){return r.map(o=>o.en)},{name:n});return be.isEnabled&&wt(()=>{be(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),gr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:yn}),Mf=We("query",function e(t,r,n={},i={}){TI();let s=Df(t);tr(`query<${s.nameAndSizeUntracked}>:`,r);let o=Array.isArray(r)?r:[r],a;if(o.length===1)a=null;else{let d=o.slice(0,-1);a=e(s,d,n,i)}let l=o[o.length-1],c=yI(s,a,l,i);return be.isDisabled||wt(()=>be("query result:",Xt(c))),c},{equals:ho,argsDebugName:(e,t,r)=>ze({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),yI=We("queryStep",function(t,r,n,i={}){if(tr(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function s(a){let[l,c]=aa(n,a?.variables??{});be("[queryStep.doQuery] patternWithoutVars: ",l);let d=gr(t,l),g=Io(c),x=Kt(function(){let R=d.map(K=>({log:K,vars:g(K)}));return be.isEnabled&&be("[queryStep.doQuery] step node:",a?.variables," =>",R,"from:",Se(()=>d.applogs)),R.map(({log:K,vars:H})=>{let F=Object.assign({},a?.variables,H);return new pI(Dl.fromArray([K],ze({caller:"QueryNode",thread:d,pattern:`${Mr(F)}@${Mr(l)}`})),F,a)})},{name:ze({caller:"doQuery.mapNodes",thread:d,pattern:n})});return be.isEnabled&&wt(()=>be("[queryStep.doQuery] resultNodes:",[...x])),i.debug&&Oo("[queryStep] step result:",Se(()=>x.map(({variables:S,logsOfThisNode:R})=>({variables:S,thread:R})))),x}let o=Kt(function(){return tr(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(s)]:[...s(null)]},{name:ze({caller:"queryStep",thread:t,pattern:n})});return be.isEnabled&&wt(()=>be("[queryStep] observableResultNodes:",[...o])),new Uf(o)},{equals:ho,argsDebugName:(e,t,r)=>ze({caller:"queryStep",thread:e,pattern:r})}),dS=We("queryNot",function(t,r,n,i={}){let s=r.nodes;tr(`queryNot<${t.nameAndSizeUntracked}> from: ${s.length} nodes`);let o=Array.isArray(n)?n:[n];for(let a of o){if(!Object.entries(n).length)throw new Error("Pattern is empty");s=s.filter(function({variables:c}){let[d,g]=aa(a,c??{});be("[queryNot] patternWithoutVars: ",d);let x=gr(t,d);return be("[queryNot] step node:",c," =>",x.size,"applogs"),be.isDisabled||be("[queryNot] step node:",c," => empty?",Se(()=>x.applogs)),i.debug&&Oo("[queryNot] node result:",c,"=>",x.applogs),x.isEmpty})}return new Uf(s)},{equals:ho,argsDebugName:(e,t,r)=>ze({caller:"queryNot",thread:e,pattern:r})}),pS=We("filterAndMap",function(t,r,n){tr(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=gr(t,r);be.isEnabled&&(be("[filterAndMap] filtered:",i.untrackedSize),wt(()=>be("[filterAndMap] filtered:",i.applogs)));let s=ze({thread:t,pattern:r,caller:"filterAndMap"}),o=Kt(()=>vI(i,n),{name:s});return be.isDisabled||wt(()=>be("[filterAndMap] mapped:",o)),o},{equals:Be.structural,argsDebugName:(e,t)=>ze({caller:"filterAndMap",thread:e,pattern:t})}),hS=We("queryAndMap",function(t,r,n,i={}){let s=Df(t);tr(`queryAndMap<${s.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let o=ze({thread:s,caller:"queryAndMap"}),a=Mf(s,r);be("[queryAndMap] filtered count:",a.untrackedSize);let l=Kt(()=>bI(a,n),{name:o});return be.isDisabled||wt(()=>be("[queryAndMap] result:",Xt(l))),l},{equals:Be.structural,argsDebugName:(e,t)=>ze({caller:"queryAndMap",thread:e,pattern:t})}),yS=We("queryEntity",function(t,r,n,i){tr(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=gr(t,{en:n,at:_I(r,i)});return be("queryEntity applogs:",s.applogs),xe(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(r.length+1),a])))},{equals:xl,argsDebugName:(e,t,r)=>ze({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),gS=We("agentsOfThread",function(t){tr(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=Re.map(),n=tt(s=>{for(let o of Zt(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!Zt(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw Vr("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}Oo(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return rn(r,i),r}),gI=We("entityOverlap",function(t,r){return Oo(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),xe(()=>{let n=new Set(t.map(s=>s.en)),i=new Set(r.map(s=>s.en));return[...n].filter(s=>i.has(s))})});var mS=We("entityOverlapCount",function(t,r){return xe(()=>gI(t,r).get().length)}),mI=We("querySingle",function(t,r,n={}){let i=Mf(t,r,n);return xe(()=>{if(i.isEmpty)return null;if(i.size>1)throw Vr("[querySingle] got",i.size,"results:",i);let s=i.nodes[0].logsOfThisNode;if(s.size!=1)throw Vr("[querySingle] single result, but got",s.size,"logs:",s.applogs);return s.applogs[0]})},{equals:Be.structural,argsDebugName:(e,t)=>ze({caller:"querySingle",thread:e,pattern:t})}),vS=We("querySingleAndMap",function(t,r,n,i={}){let s=mI(t,r,i);return xe(()=>{let o=s.get();if(o)return typeof n=="string"?o[n]:Io(n)(o)})},{equals:Be.structural,argsDebugName:(e,t)=>ze({caller:"querySingleAndMap",thread:e,pattern:t})}),vI=function(t,r){return typeof r=="function"?t.map(r):typeof r=="string"?t.map(n=>n[r]):t.map(Io(r))},bI=function(t,r){return typeof r=="function"?t.records.map(r):typeof r=="string"?t.nodes.map(n=>{if(!Object.hasOwn(n.record,r)){if(n.logsOfThisNode.size!==1)throw Vr(`not sure what to map (it's not a var and a result node log count of ${n.logsOfThisNode.size})`);return n.logsOfThisNode.firstLog[r]}return n.record[r]}):t.nodes.map(n=>Io(r)(t))};function Io(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function _I(e,t){return t.map(r=>wI(e,r))}function wI(e,t){return`${e}/${t}`}function Df(e,t){return Array.isArray(e)?ua.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function TI(){if(la!=null&&performance.now()>=la)throw new AI(la)}var AI=class extends Error{constructor(e){super(e)}};var OI=Ce({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=o;var r=128,n=127,i=~n,s=Math.pow(2,31);function o(a,l,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw o.bytes=0,new RangeError("Could not encode varint");l=l||[],c=c||0;for(var d=c;a>=s;)l[c++]=a&255|r,a/=128;for(;a&i;)l[c++]=a&255|r,a>>>=7;return l[c]=a|0,o.bytes=c-d+1,l}}}),II=Ce({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(s,l){var a=0,l=l||0,c=0,d=l,g,x=s.length;do{if(d>=x||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=s[d++],a+=c<28?(g&n)<<c:(g&n)*Math.pow(2,c),c+=7}while(g>=r);return i.bytes=d-l,a}}}),EI=Ce({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),s=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),l=Math.pow(2,49),c=Math.pow(2,56),d=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<s?4:g<o?5:g<a?6:g<l?7:g<c?8:g<d?9:10}}}),da=Ce({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:OI(),decode:II(),encodingLength:EI()}}}),Lf=42;function SI(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Zn.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Z(E.tag,Lf),new Z(E.bytes,r)]}function RI(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function PI(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}function $I(e){for(let t of e.keys())if(typeof t!="string"||t.length===0)throw new Error("Non-string Map keys are not supported by the IPLD Data Model and cannot be encoded");return null}var Bf={float64:!0,typeEncoders:{Map:$I,Object:SI,undefined:RI,number:PI}},CS={...Bf,typeEncoders:{...Bf.typeEncoders}};function NI(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Zn.decode(e.subarray(1))}var fa={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};fa.tags[Lf]=NI;var xS={...fa,tags:fa.tags.slice()};var US=ft(da(),1);var mr={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},ei={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":mr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(mr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ei["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=ei["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:mr.Int,CarV1HeaderOrV2Pragma:e=>{if(mr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=ei["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.roots=a}}break;case"version":{n--;let a=ei.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},ti={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":mr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(mr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ti["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=ti["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:mr.Int,CarV1HeaderOrV2Pragma:e=>{if(mr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=ti["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.roots=a}}break;case"version":{n--;let a=ti.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},MS={toTyped:ei.CarV1HeaderOrV2Pragma,toRepresentation:ti.CarV1HeaderOrV2Pragma},DS=Zs(),BS=ft(da(),1),LS=[new Z(E.map,2),new Z(E.string,"version"),new Z(E.uint,1),new Z(E.string,"roots")],jS=new Z(E.tag,42);var kS=ft(da(),1);var{WARN:FS,LOG:KS,DEBUG:VS,VERBOSE:zS,ERROR:qS}=Oe.setup(Oe.INFO);var{WARN:GS,LOG:WS,DEBUG:HS,VERBOSE:JS,ERROR:XS}=Oe.setup(Oe.INFO);var pa=class{app;username;devicename;signer},jf=class extends pa{constructor(t){super(),Object.assign(this,t)}get did(){return this.signer.did}async sign(t){return await this.signer.sign(t)}get ag(){return ca(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{jf as BaseAgent};
|
|
61
|
+
`+" ".repeat(t)+s):s==="{"&&n>0?(n++,r+=s):(s==="}"&&n>1&&n--,r+=s)}return r}function sO(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]instanceof pn){if(t[r]!==e[r])return!1}else if(!Be.structural(e[r],t[r]))return!1;return!0}var{WARN:Qc,LOG:sI,DEBUG:aO,VERBOSE:aI,ERROR:Lr}=Oe.setup(Oe.INFO,{prefix:"[thread]"});function tr(e){return e.init!==void 0}var pn=class{constructor(e,t,r,n=[],i={}){this.name=e,this._applogs=n,this.parents=t===null?null:_a(t),this.filters=r,Se(()=>this.parents?.length===0)&&Qc("[Thread] empty parents array",e),i.skipObservable||yr(this,{applogsCids:Ce,applogsByCid:Ce,insert:tt,size:Ce,isEmpty:Ce,firstLog:Ce,latestLog:Ce},{name:`Thread{${e}}`})}filters;parents;_subscribers=[];get readOnly(){return this.parents.length!==1?!0:this.parents[0].readOnly}insert(e){if(this.readOnly)throw Lr("[Thread] insert() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Lr("[Thread] insert() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Lr("[Thread] insert() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insert(e)}insertRaw(e){if(this.readOnly)throw Lr("[Thread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);if(!this.parents)throw Lr("[Thread] insertRaw() called on non-writable thread without parents:",this.nameAndSizeUntracked);if(this.parents?.length!==1)throw Lr("[Thread] insertRaw() called on thread with multiple parents:",this.nameAndSizeUntracked);return this.parents[0].insertRaw(e)}subscribe(e){return this._subscribers.push(e),this.unsubscribe.bind(this,e)}unsubscribe(e){let t=this._subscribers.indexOf(e);t!==-1?this._subscribers.splice(t,1):Qc("unsubscribe called for non-existent",e)}notifySubscribers(e){aO(`[thread: ${this.name}] notifying`,this._subscribers.length,"subscribers of",{...e,subs:this._subscribers});for(let t of this._subscribers)t(e)}get applogs(){return this._applogs}get applogsCids(){return this._applogs.map(e=>e.cid)}map(e){return this.applogs.map(e)}get findLast(){return this.applogs.findLast.bind(this.applogs)}get findFirst(){return this.applogs.find.bind(this.applogs)}get firstLog(){return this.applogs[0]}get latestLog(){return this.applogs[this.applogs.length-1]}hasApplog(e,t){if(t)return this.applogs.includes(e);if(!e.cid)throw Lr("[hasApplogs] applog without CID:",e);return this.hasApplogCid(e.cid)}hasApplogCid(e){return this.applogsCids.includes(e.toString())}get applogsByCid(){return new Map(this.applogs.map(e=>[e.cid,e]))}getApplog(e){return this.applogsByCid.get(e.toString())}hasApplogWithDiffTs(e){return this.applogs.find(t=>t.en===e.en&&t.at===e.at&&t.vl===e.vl&&t.ag===e.ag)}get isEmpty(){return this.size===0}get size(){return this.applogs.length}get length(){return this.applogs.length}get untrackedSize(){return Se(()=>this.size)}get nameAndSizeUntracked(){return Se(()=>`${this.name} (${this.size})`)}get prettyName(){return oO(this.name)}get hasParents(){return!!this.parents?.length}};var lf=class ff extends pn{static fromArray(t,r){return new ff(r||"static",null,[],t)}constructor(t,r,n,i){super(t,r,n,i,{skipObservable:!0})}get readOnly(){return!0}},df={};ir(df,{code:()=>hf,decode:()=>ua,encode:()=>aa,format:()=>Zc,name:()=>_O,parse:()=>TO,stringify:()=>Zc});var uO=class extends Array{constructor(){super(),this.inRecursive=[]}prefix(e){let t=this.inRecursive[this.inRecursive.length-1];t&&(I.equals(t.type,I.array)&&(t.elements++,t.elements!==1&&e.push([44])),I.equals(t.type,I.map)&&(t.elements++,t.elements!==1&&(t.elements%2===1?e.push([44]):e.push([58]))))}[I.uint.major](e,t){this.prefix(e);let r=String(t.value),n=[];for(let i=0;i<r.length;i++)n[i]=r.charCodeAt(i);e.push(n)}[I.negint.major](e,t){this[I.uint.major](e,t)}[I.bytes.major](e,t){throw new Error(`${cr} unsupported type: Uint8Array`)}[I.string.major](e,t){this.prefix(e);let r=Fo(JSON.stringify(t.value));e.push(r.length>32?xn(r):r)}[I.array.major](e,t){this.prefix(e),this.inRecursive.push({type:I.array,elements:0}),e.push([91])}[I.map.major](e,t){this.prefix(e),this.inRecursive.push({type:I.map,elements:0}),e.push([123])}[I.tag.major](e,t){}[I.float.major](e,t){if(t.type.name==="break"){let s=this.inRecursive.pop();if(s){if(I.equals(s.type,I.array))e.push([93]);else if(I.equals(s.type,I.map))e.push([125]);else throw new Error("Unexpected recursive type; this should not happen!");return}throw new Error("Unexpected break; this should not happen!")}if(t.value===void 0)throw new Error(`${cr} unsupported type: undefined`);if(this.prefix(e),t.type.name==="true"){e.push([116,114,117,101]);return}else if(t.type.name==="false"){e.push([102,97,108,115,101]);return}else if(t.type.name==="null"){e.push([110,117,108,108]);return}let r=String(t.value),n=[],i=!1;for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s),!i&&(n[s]===46||n[s]===101||n[s]===69)&&(i=!0);i||(n.push(46),n.push(48)),e.push(n)}};function cO(e,t){if(Array.isArray(e[0])||Array.isArray(t[0]))throw new Error(`${cr} complex map keys are not supported`);let r=e[0],n=t[0];if(r.type!==I.string||n.type!==I.string)throw new Error(`${cr} non-string map keys are not supported`);if(r<n)return-1;if(r>n)return 1;throw new Error(`${cr} unexpected duplicate map keys, this is not supported`)}var lO={addBreakTokens:!0,mapSorter:cO};function fO(e,t){return t=Object.assign({},lO,t),Qo(e,new uO,t)}var pf=class{constructor(e,t={}){this._pos=0,this.data=e,this.options=t,this.modeStack=["value"],this.lastToken=""}pos(){return this._pos}done(){return this._pos>=this.data.length}ch(){return this.data[this._pos]}currentMode(){return this.modeStack[this.modeStack.length-1]}skipWhitespace(){let e=this.ch();for(;e===32||e===9||e===13||e===10;)e=this.data[++this._pos]}expect(e){if(this.data.length-this._pos<e.length)throw new Error(`${de} unexpected end of input at position ${this._pos}`);for(let t=0;t<e.length;t++)if(this.data[this._pos++]!==e[t])throw new Error(`${de} unexpected token at position ${this._pos}, expected to find '${String.fromCharCode(...e)}'`)}parseNumber(){let e=this._pos,t=!1,r=!1,n=o=>{for(;!this.done();){let a=this.ch();if(o.includes(a))this._pos++;else break}};if(this.ch()===45&&(t=!0,this._pos++),this.ch()===48)if(this._pos++,this.ch()===46)this._pos++,r=!0;else return new Z(I.uint,0,this._pos-e);if(n([48,49,50,51,52,53,54,55,56,57]),t&&this._pos===e+1)throw new Error(`${de} unexpected token at position ${this._pos}`);if(!this.done()&&this.ch()===46){if(r)throw new Error(`${de} unexpected token at position ${this._pos}`);r=!0,this._pos++,n([48,49,50,51,52,53,54,55,56,57])}!this.done()&&(this.ch()===101||this.ch()===69)&&(r=!0,this._pos++,!this.done()&&(this.ch()===43||this.ch()===45)&&this._pos++,n([48,49,50,51,52,53,54,55,56,57]));let i=String.fromCharCode.apply(null,this.data.subarray(e,this._pos)),s=parseFloat(i);return r?new Z(I.float,s,this._pos-e):this.options.allowBigInt!==!0||Number.isSafeInteger(s)?new Z(s>=0?I.uint:I.negint,s,this._pos-e):new Z(s>=0?I.uint:I.negint,BigInt(i),this._pos-e)}parseString(){if(this.ch()!==34)throw new Error(`${de} unexpected character at position ${this._pos}; this shouldn't happen`);this._pos++;for(let i=this._pos,s=0;i<this.data.length&&s<65536;i++,s++){let o=this.data[i];if(o===92||o<32||o>=128)break;if(o===34){let a=String.fromCharCode.apply(null,this.data.subarray(this._pos,i));return this._pos=i+1,new Z(I.string,a,s)}}let e=this._pos,t=[],r=()=>{if(this._pos+4>=this.data.length)throw new Error(`${de} unexpected end of unicode escape sequence at position ${this._pos}`);let i=0;for(let s=0;s<4;s++){let o=this.ch();if(o>=48&&o<=57)o-=48;else if(o>=97&&o<=102)o=o-97+10;else if(o>=65&&o<=70)o=o-65+10;else throw new Error(`${de} unexpected unicode escape character at position ${this._pos}`);i=i*16+o,this._pos++}return i},n=()=>{let i=this.ch(),s=null,o=i>239?4:i>223?3:i>191?2:1;if(this._pos+o>this.data.length)throw new Error(`${de} unexpected unicode sequence at position ${this._pos}`);let a,l,c,d;switch(o){case 1:i<128&&(s=i);break;case 2:a=this.data[this._pos+1],(a&192)===128&&(d=(i&31)<<6|a&63,d>127&&(s=d));break;case 3:a=this.data[this._pos+1],l=this.data[this._pos+2],(a&192)===128&&(l&192)===128&&(d=(i&15)<<12|(a&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:a=this.data[this._pos+1],l=this.data[this._pos+2],c=this.data[this._pos+3],(a&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(a&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(s=d))}s===null?(s=65533,o=1):s>65535&&(s-=65536,t.push(s>>>10&1023|55296),s=56320|s&1023),t.push(s),this._pos+=o};for(;!this.done();){let i=this.ch(),s;switch(i){case 92:if(this._pos++,this.done())throw new Error(`${de} unexpected string termination at position ${this._pos}`);switch(s=this.ch(),this._pos++,s){case 34:case 39:case 92:case 47:t.push(s);break;case 98:t.push(8);break;case 116:t.push(9);break;case 110:t.push(10);break;case 102:t.push(12);break;case 114:t.push(13);break;case 117:t.push(r());break;default:throw new Error(`${de} unexpected string escape character at position ${this._pos}`)}break;case 34:return this._pos++,new Z(I.string,Ca(t),this._pos-e);default:if(i<32)throw new Error(`${de} invalid control character at position ${this._pos}`);i<128?(t.push(i),this._pos++):n()}}throw new Error(`${de} unexpected end of string at position ${this._pos}`)}parseValue(){switch(this.ch()){case 123:return this.modeStack.push("obj-start"),this._pos++,new Z(I.map,1/0,1);case 91:return this.modeStack.push("array-start"),this._pos++,new Z(I.array,1/0,1);case 34:return this.parseString();case 110:return this.expect([110,117,108,108]),new Z(I.null,null,4);case 102:return this.expect([102,97,108,115,101]),new Z(I.false,!1,5);case 116:return this.expect([116,114,117,101]),new Z(I.true,!0,4);case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.parseNumber();default:throw new Error(`${de} unexpected character at position ${this._pos}`)}}next(){switch(this.skipWhitespace(),this.currentMode()){case"value":return this.modeStack.pop(),this.parseValue();case"array-value":{if(this.modeStack.pop(),this.ch()===93)return this._pos++,this.skipWhitespace(),new Z(I.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting array delimiter but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue()}case"array-start":return this.modeStack.pop(),this.ch()===93?(this._pos++,this.skipWhitespace(),new Z(I.break,void 0,1)):(this.modeStack.push("array-value"),this.skipWhitespace(),this.parseValue());case"obj-key":if(this.ch()===125)return this.modeStack.pop(),this._pos++,this.skipWhitespace(),new Z(I.break,void 0,1);if(this.ch()!==44)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting object delimiter but found '${String.fromCharCode(this.ch())}'`);this._pos++,this.skipWhitespace();case"obj-start":{if(this.modeStack.pop(),this.ch()===125)return this._pos++,this.skipWhitespace(),new Z(I.break,void 0,1);let e=this.parseString();if(this.skipWhitespace(),this.ch()!==58)throw new Error(`${de} unexpected character at position ${this._pos}, was expecting key/value delimiter ':' but found '${String.fromCharCode(this.ch())}'`);return this._pos++,this.modeStack.push("obj-value"),e}case"obj-value":return this.modeStack.pop(),this.modeStack.push("obj-key"),this.skipWhitespace(),this.parseValue();default:throw new Error(`${de} unexpected parse state at position ${this._pos}; this shouldn't happen`)}}};function dO(e,t){return t=Object.assign({tokenizer:new pf(e,t)},t),Zo(e,t)}function pO(e){return e instanceof ArrayBuffer?new Uint8Array(e,0,e.byteLength):e}function hO(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Qr.asCID(e);if(!t)return null;let r=t.toString();return[new Z(I.map,1/0,1),new Z(I.string,"/",1),new Z(I.string,r,r.length),new Z(I.break,void 0,1)]}function uo(e){let t=Ti.encode(e).slice(1);return[new Z(I.map,1/0,1),new Z(I.string,"/",1),new Z(I.map,1/0,1),new Z(I.string,"bytes",5),new Z(I.string,t,t.length),new Z(I.break,void 0,1),new Z(I.break,void 0,1)]}function Ut(e){return uo(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function yO(e){return uo(new Uint8Array(e))}function gO(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function bO(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}var mO={typeEncoders:{Object:hO,Buffer:uo,Uint8Array:uo,Int8Array:Ut,Uint16Array:Ut,Int16Array:Ut,Uint32Array:Ut,Int32Array:Ut,Float32Array:Ut,Float64Array:Ut,Uint8ClampedArray:Ut,BigInt64Array:Ut,BigUint64Array:Ut,DataView:Ut,ArrayBuffer:yO,undefined:gO,number:bO}},vO=class extends pf{constructor(e,t){super(e,t),this.tokenBuffer=[]}done(){return this.tokenBuffer.length===0&&super.done()}_next(){return this.tokenBuffer.length>0?this.tokenBuffer.pop():super.next()}next(){let e=this._next();if(e.type===I.map){let t=this._next();if(t.type===I.string&&t.value==="/"){let r=this._next();if(r.type===I.string){if(this._next().type!==I.break)throw new Error("Invalid encoded CID form");return this.tokenBuffer.push(r),new Z(I.tag,42,0)}if(r.type===I.map){let n=this._next();if(n.type===I.string&&n.value==="bytes"){let i=this._next();if(i.type===I.string){for(let o=0;o<2;o++)if(this._next().type!==I.break)throw new Error("Invalid encoded Bytes form");let s=Ti.decode(`m${i.value}`);return new Z(I.bytes,s,i.value.length)}this.tokenBuffer.push(i)}this.tokenBuffer.push(n)}this.tokenBuffer.push(r)}this.tokenBuffer.push(t)}return e}},Fs={allowIndefinite:!1,allowUndefined:!1,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};Fs.tags[42]=Qr.parse;var _O="dag-json",hf=297,aa=e=>fO(e,mO),ua=e=>{let t=pO(e),r=Object.assign(Fs,{tokenizer:new vO(t,Fs)});return dO(t,r)},Zc=e=>wO.decode(aa(e)),wO=new TextDecoder,TO=e=>ua(AO.encode(e)),AO=new TextEncoder,Yi=Lt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),uI=Lt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),cI=Lt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),lI=Lt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),fI=Lt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),dI=Lt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),pI=Lt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),hI=Lt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),yI=Lt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),gr=Nn({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),gI=Nn({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),yf={};ir(yf,{Digest:()=>Io,create:()=>ca,decode:()=>bf,equals:()=>mf,hasCode:()=>KO});var OO=gf,el=128,EO=127,IO=~EO,SO=Math.pow(2,31);function gf(e,t,r){t=t||[],r=r||0;for(var n=r;e>=SO;)t[r++]=e&255|el,e/=128;for(;e&IO;)t[r++]=e&255|el,e>>>=7;return t[r]=e|0,gf.bytes=r-n+1,t}var xO=Ks,RO=128,tl=127;function Ks(e,n){var r=0,n=n||0,i=0,s=n,o,a=e.length;do{if(s>=a)throw Ks.bytes=0,new RangeError("Could not decode varint");o=e[s++],r+=i<28?(o&tl)<<i:(o&tl)*Math.pow(2,i),i+=7}while(o>=RO);return Ks.bytes=s-n,r}var PO=Math.pow(2,7),$O=Math.pow(2,14),NO=Math.pow(2,21),CO=Math.pow(2,28),UO=Math.pow(2,35),MO=Math.pow(2,42),DO=Math.pow(2,49),BO=Math.pow(2,56),LO=Math.pow(2,63),jO=function(e){return e<PO?1:e<$O?2:e<NO?3:e<CO?4:e<UO?5:e<MO?6:e<DO?7:e<BO?8:e<LO?9:10},kO={encode:OO,decode:xO,encodingLength:jO},FO=kO,co=FO;function Vs(e,t=0){return[co.decode(e,t),co.decode.bytes]}function lo(e,t,r=0){return co.encode(e,t,r),t}function fo(e){return co.encodingLength(e)}function ca(e,t){let r=t.byteLength,n=fo(e),i=n+fo(r),s=new Uint8Array(i+r);return lo(e,s,0),lo(r,s,n),s.set(t,i),new Io(e,r,t,s)}function bf(e){let t=_i(e),[r,n]=Vs(t),[i,s]=Vs(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw new Error("Incorrect length");return new Io(r,i,o,t)}function mf(e,t){if(e===t)return!0;{let r=t;return e.code===r.code&&e.size===r.size&&r.bytes instanceof Uint8Array&&Qa(e.bytes,r.bytes)}}var Io=class{code;size;digest;bytes;constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}};function KO(e,t){return e.code===t}function rl(e,t){let{bytes:r,version:n}=e;switch(n){case 0:return qO(r,qs(e),t??gr.encoder);default:return zO(r,qs(e),t??Yi.encoder)}}var nl=new WeakMap;function qs(e){let t=nl.get(e);if(t==null){let r=new Map;return nl.set(e,r),r}return t}var vf=class Xe{code;version;multihash;bytes;"/";constructor(t,r,n,i){this.code=r,this.version=t,this.multihash=n,this.bytes=i,this["/"]=i}get asCID(){return this}get byteOffset(){return this.bytes.byteOffset}get byteLength(){return this.bytes.byteLength}toV0(){switch(this.version){case 0:return this;case 1:{let{code:t,multihash:r}=this;if(t!==Hn)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(r.code!==GO)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return Xe.createV0(r)}default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}toV1(){switch(this.version){case 0:{let{code:t,digest:r}=this.multihash,n=ca(t,r);return Xe.createV1(this.code,n)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 1. This is a bug please report`)}}equals(t){return Xe.equals(this,t)}static equals(t,r){let n=r;return n!=null&&t.code===n.code&&t.version===n.version&&mf(t.multihash,n.multihash)}toString(t){return rl(this,t)}toJSON(){return{"/":rl(this)}}link(){return this}[Symbol.toStringTag]="CID";[Symbol.for("nodejs.util.inspect.custom")](){return`CID(${this.toString()})`}static asCID(t){if(t==null)return null;let r=t;if(r instanceof Xe)return r;if(r["/"]!=null&&r["/"]===r.bytes||r.asCID===r){let{version:n,code:i,multihash:s,bytes:o}=r;return new Xe(n,i,s,o??il(n,i,s.bytes))}else if(r[WO]===!0){let{version:n,multihash:i,code:s}=r,o=bf(i);return Xe.create(n,s,o)}else return null}static create(t,r,n){if(typeof r!="number")throw new Error("String codecs are no longer supported");if(!(n.bytes instanceof Uint8Array))throw new Error("Invalid digest");switch(t){case 0:{if(r!==Hn)throw new Error(`Version 0 CID must use dag-pb (code: ${Hn}) block encoding`);return new Xe(t,r,n,n.bytes)}case 1:{let i=il(t,r,n.bytes);return new Xe(t,r,n,i)}default:throw new Error("Invalid version")}}static createV0(t){return Xe.create(0,Hn,t)}static createV1(t,r){return Xe.create(1,t,r)}static decode(t){let[r,n]=Xe.decodeFirst(t);if(n.length!==0)throw new Error("Incorrect length");return r}static decodeFirst(t){let r=Xe.inspectBytes(t),n=r.size-r.multihashSize,i=_i(t.subarray(n,n+r.multihashSize));if(i.byteLength!==r.multihashSize)throw new Error("Incorrect length");let s=i.subarray(r.multihashSize-r.digestSize),o=new Io(r.multihashCode,r.digestSize,s,i);return[r.version===0?Xe.createV0(o):Xe.createV1(r.codec,o),t.subarray(r.size)]}static inspectBytes(t){let r=0,n=()=>{let[g,C]=Vs(t.subarray(r));return r+=C,g},i=n(),s=Hn;if(i===18?(i=0,r=0):s=n(),i!==0&&i!==1)throw new RangeError(`Invalid CID version ${i}`);let o=r,a=n(),l=n(),c=r+l,d=c-o;return{version:i,codec:s,multihashCode:a,digestSize:l,multihashSize:d,size:c}}static parse(t,r){let[n,i]=VO(t,r),s=Xe.decode(i);if(s.version===0&&t[0]!=="Q")throw Error("Version 0 CID string must not include multibase prefix");return qs(s).set(n,t),s}};function VO(e,t){switch(e[0]){case"Q":{let r=t??gr;return[gr.prefix,r.decode(`${gr.prefix}${e}`)]}case gr.prefix:{let r=t??gr;return[gr.prefix,r.decode(e)]}case Yi.prefix:{let r=t??Yi;return[Yi.prefix,r.decode(e)]}case wi.prefix:{let r=t??wi;return[wi.prefix,r.decode(e)]}default:{if(t==null)throw Error("To parse non base32, base36 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}}function qO(e,t,r){let{prefix:n}=r;if(n!==gr.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(i==null){let s=r.encode(e).slice(1);return t.set(n,s),s}else return i}function zO(e,t,r){let{prefix:n}=r,i=t.get(n);if(i==null){let s=r.encode(e);return t.set(n,s),s}else return i}var Hn=112,GO=18;function il(e,t,r){let n=fo(e),i=n+fo(t),s=new Uint8Array(i+r.byteLength);return lo(e,s,0),lo(t,s,n),s.set(r,i),s}var WO=Symbol.for("@ipld/js-cid/CID"),HO=20;function _f({name:e,code:t,encode:r,minDigestLength:n,maxDigestLength:i}){return new JO(e,t,r,n,i)}var JO=class{name;code;encode;minDigestLength;maxDigestLength;constructor(e,t,r,n,i){this.name=e,this.code=t,this.encode=r,this.minDigestLength=n??HO,this.maxDigestLength=i}digest(e,t){if(t?.truncate!=null){if(t.truncate<this.minDigestLength)throw new Error(`Invalid truncate option, must be greater than or equal to ${this.minDigestLength}`);if(this.maxDigestLength!=null&&t.truncate>this.maxDigestLength)throw new Error(`Invalid truncate option, must be less than or equal to ${this.maxDigestLength}`)}if(e instanceof Uint8Array){let r=this.encode(e);return r instanceof Uint8Array?ol(r,this.code,t?.truncate):r.then(n=>ol(n,this.code,t?.truncate))}else throw Error("Unknown type, must be binary type")}};function ol(e,t,r){if(r!=null&&r!==e.byteLength){if(r>e.byteLength)throw new Error(`Invalid truncate option, must be less than or equal to ${e.byteLength}`);e=e.subarray(0,r)}return ca(t,e)}var Ve=ft(Gt(),1),wf=ft(Xg(),1),sl=e=>Ve.Type.Union([e,Ve.Type.Null()]);var Tf=/^(k51qz|baguq)[0-9a-z]{56,57}$/,XO=/^[0-9A-Fa-f]{7,8}$/g;Ve.FormatRegistry.Set("EntityID",e=>!!e.match(XO)||!!e.match(Tf));var YO=Ve.Type.String(),QO=e=>e?.enc instanceof Uint8Array;Ve.FormatRegistry.Set("CID",e=>!!e.match(Tf));var Af=Ve.Type.String({format:"CID"}),ZO=/^http([s]?):\/\/.*\..*/;Ve.FormatRegistry.Set("URL",e=>!!e.match(ZO));var bI=Ve.Type.String({format:"URL"}),Of=Ve.Type.Object({en:YO,at:Ve.Type.String(),vl:sl(Ve.Type.Union([Ve.Type.String(),Ve.Type.Boolean(),Ve.Type.Number()])),ts:Ve.Type.String(),ag:Ve.Type.String(),pv:sl(Af)}),al=wf.TypeCompiler.Compile(Of);var mI=al.Check.bind(al),e1=Ve.Type.Composite([Ve.Type.Object({cid:Af}),Of]),zs=wf.TypeCompiler.Compile(e1),t1=e=>Array.from(zs.Errors(e)),Ef=zs.Check.bind(zs);function If(e){return async t=>new Uint8Array(await crypto.subtle.digest(e,t))}var r1=_f({name:"sha2-256",code:18,encode:If("SHA-256")}),vI=_f({name:"sha2-512",code:19,encode:If("SHA-512")}),{WARN:ul,LOG:_I,DEBUG:n1,VERBOSE:Sf,ERROR:i1}=Oe.setup(Oe.INFO);function xf(e,t=["cid"]){if(!e)throw i1("falsy log",e);let r=e.cid;if(QO(e))return r||(r=la(Rf(e).bytes).toString()),ul("preparing an encrypted applog - really?"),{log:e,cid:r};let n={};for(let[i,s]of Object.entries(e))s===void 0&&(ul(`log.${i} is undefined, which is not allowed - encoding as null`,e),s=null),t.includes(i)?Sf("excluding app log",{key:i,val:s}):n[i]=s;return{log:n,cid:r}}function o1(e){return la(s1(e).bytes)}function s1(e){return Rf(xf(e)?.log)}function la(e){let t=Ya(e),r=yf.create(r1.code,t),n=vf.create(1,hf,r);return Sf("[getCidSync]",{bytes:e,hash:t,digest:r,cid:n}),n}function Rf(e){n1("[encodeBlock]",e);let t=aa(e);return{bytes:t,cid:la(t)}}function cl(e){let t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function a1(e,t){let r=cl(e),n=cl(t);return+r<+n}var{WARN:u1,LOG:wI,DEBUG:TI,VERBOSE:po,ERROR:ho}=Oe.setup(Oe.INFO),c1=(e,t,r="asc")=>r==="asc"?e.localeCompare(t,"en-US"):t.localeCompare(e,"en-US"),Pf=(e,t,r)=>Be.structural(Xc(t,e),Xc(r,e)),l1=(e,t,r="asc")=>c1(e.ts,t.ts,r),AI=KA(Pf,["en","at"]);function ri(e,t="asc"){return e.sort((r,n)=>l1(r,n,t))}var f1=(e,t)=>a1(new Date(e.ts),new Date(t.ts));var d1=()=>{u1("[removeDuplicateAppLogs] mode not set; pass 'safety' or 'cleanup' for optimal behavior")},ll=e=>{let t=new Map,r=po.isEnabled;for(let n of e){if(!n)throw ho("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!n.cid)throw ho("applog with missing CID",n),new Error("applog with missing CID");let i=n.cid,s=t.get(i);s?r&&po("Skipping duplicate applog:",[s,n]):t.set(i,n)}return Array.from(t.values())},p1=e=>{let t=new Set,r=po.isEnabled,n=r?new Map:null,i=null,s=0;for(let o of e){if(!o)throw ho("falsy entry in applogs",e),new Error("falsy entry in applogs");if(!o.cid)throw ho("applog with missing CID",o),new Error("applog with missing CID");let a=o.cid;t.has(a)?(i||(i=e.slice(0,s)),r&&po("Skipping duplicate applog:",[n?.get(a),o])):(t.add(a),n&&n.set(a,o),i&&i.push(o)),s++}return i??e},$f=(e,t)=>t?t==="safety"?p1(e):ll(e):(d1(),ll(e));function h1(e){return typeof e=="string"&&e.startsWith("?")}function y1(e){return e.slice(1)}function fa(e,t){let r={},n={};for(let[i,s]of Object.entries(e))if(h1(s)){let o=y1(s),a=t[o];a?n[i]=a:r[i]=o}else n[i]=s;return[n,r]}function g1(e,t,r){let n;if(t){let i=typeof t;i==="string"?n=t===r:i==="function"?n=t(r):typeof t.has=="function"?n=t.has(r):Array.isArray(t)&&!Array.isArray(r)?n=t.includes(r):n=t===r}else n=t===r;return e.charAt(0)==="!"?!n:n}var Nf=function(t){for(var r=0,n=0,i=t.length;n<i;n++)r+=t[n];return r},fl=function(t){return Nf(t)/t.length},Ot={max:function(e){return Math.max.apply(null,e)},min:function(e){return Math.min.apply(null,e)},range:function(e){return Ot.max(e)-Ot.min(e)},midrange:function(e){return Ot.range(e)/2},sum:Nf,mean:fl,average:fl,median:function(e){e.sort(function(r,n){return r-n});var t=e.length/2;return t%1?e[t-.5]:(e[t-1]+e[t])/2},modes:function(e){if(!e.length)return[];var t={},r=0,n=[];return e.forEach(function(i){t[i]?t[i]++:t[i]=1,t[i]>r?(n=[i],r=t[i]):t[i]===r&&(n.push(i),r=t[i])}),n},variance:function(e){var t=Ot.mean(e);return Ot.mean(e.map(function(r){return Math.pow(r-t,2)}))},standardDeviation:function(e){return Math.sqrt(Ot.variance(e))},meanAbsoluteDeviation:function(e){var t=Ot.mean(e);return Ot.mean(e.map(function(r){return Math.abs(r-t)}))},zScores:function(e){var t=Ot.mean(e),r=Ot.standardDeviation(e);return e.map(function(n){return(n-t)/r})}};Ot.average=Ot.mean;var Cf=function(e,t=13,r){if(!e?.length)throw new Error(`Empty string: ${e}`);let n=3735928559^t,i=1103547991^t;for(let o=0,a;o<e.length;o++)a=e.charCodeAt(o),n=Math.imul(n^a,2654435761),i=Math.imul(i^a,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(16).slice(-r).padStart(r,"0")};function Uf(){return new Date().toISOString()}var{WARN:b1,LOG:OI,DEBUG:je,VERBOSE:EI,ERROR:yo}=Oe.setup(Oe.INFO);function m1(e,t){je(`[ensureTsPvAndFinalizeApplogs] ENTER - ${e.length} applogs, thread size=${t.size}`);let r=Uf(),n=t;je("[ensureTsPvAndFinalizeApplogs] About to map over applogs");let i=e.map((s,o)=>{je(`[ensureTsPvAndFinalizeApplogs] Processing applog ${o+1}/${e.length}`);let a=v1(s,{ts:r,threadForPv:n});return je(`[ensureTsPvAndFinalizeApplogs] Finalized applog ${o+1}/${e.length}`),a});return je(`[ensureTsPvAndFinalizeApplogs] EXIT - mapped ${i.length} applogs`),i}function v1(e,{ts:t,threadForPv:r}={}){je(`[finalizeApplogForInsert] ENTER - en=${e.en}, at=${e.at}`),je("[finalizeApplogForInsert] About to call withTs");let n=T1(e,t??Uf());je(`[finalizeApplogForInsert] About to call withPvFrom (thread size=${r?.size??"null"})`);let i=A1(n,r);je("[finalizeApplogForInsert] About to call encodeApplogAndGetCid");let s=o1(i).toString();je(`[finalizeApplogForInsert] CID created: ${s}`),e.cid&&e.cid!==s&&b1("[finalizeApplogForInsert] overwriting wrong CID",{log:e,cid:s,logWithPv:i});let o={...i,cid:s};if(je("[finalizeApplogForInsert] About to validate applog"),!Ef(o))throw yo(`Bogus Applog ${JSON.stringify(o)}`,t1(o));return je(`[finalizeApplogForInsert] EXIT - CID=${s}`),Object.freeze(o)}function _1(e){return!!e.ts}function w1(e){return!!e.pv}function T1(e,t){return _1(e)?e:{...e,ts:t}}function A1(e,t){if(je(`[withPvFrom] ENTER - en=${e.en}, at=${e.at}, hasPv=${e.pv!==void 0}`),e.pv!==void 0)return je("[withPvFrom] EXIT early - pv already set"),e;if(t){let{en:r,at:n}=e;je(`[withPvFrom] About to call thread.findLast for en=${r}, at=${n}, thread.size=${t.size}`);let i=t.findLast(o=>o.en==r&&o.at==n);if(je(`[withPvFrom] findLast completed, found=${!!i}`),je("[withPvFrom] About to check equality"),Pf(["en","at","vl","ts","ag"],e,i))throw yo("[withPvFrom] Same as previous:",{log:e,pv:i,thread:t});let s=(e.pv!==void 0?e.pv:i?.cid)??null;return je(`[withPvFrom] EXIT - prevLogCid=${s}`),{...e,pv:s}}else{if(!w1(e))throw yo("[withPvFrom] no thread and no pv:",e);return je("[withPvFrom] EXIT - no thread, returning log with existing pv"),e}}function So(e){let t=()=>(Se(()=>e.length<2&&je(`joinThreads with count=${e.length}`)),ri($f(e.flatMap(i=>{let s=i.applogs;if(!s)throw yo("falsy applogs of thread",i),new Error("falsy applogs of thread");return s}),"cleanup"))),r=Se(()=>t()),n=tt(function(i,s){return tr(i)?{init:Se(()=>t())}:{added:i.added.filter(o=>!this.hasApplog(o,!0)),removed:i.removed?.filter(o=>!!this.parents.some(l=>l===s?!1:l.hasApplog(o,!0)))}});return new xo(Se(()=>`join(~ ${e.map(i=>i.name).join(", ")})`),e,["?"],r,n)}var{WARN:dl,LOG:II,DEBUG:pl,VERBOSE:jr,ERROR:Ji}=Oe.setup(Oe.INFO),xo=class Gs extends pn{constructor(t,r,n,i,s,o=null,a){super(t,r,n,s?xe.array([...i],{deep:!1,name:`${t}.array`}):i),this.name=t,this._initialLogs=i,this._eventMapper=s,this._writeMapper=o,this._readOnly=a,yr(this,{onParentUpdate:tt}),s&&this.subscribeToParents()}static mapWrites(t,r,n){return new Gs(`${r}<${t.nameAndSizeUntracked}>`,t,t.filters,t._applogs,null,n)}static asReadOnly(t){return t.readOnly?t:new Gs(`readOnly(${t.name})`,t,t.filters,t._applogs,null,null,!0)}_parentSubscriptions=null;insert(t){if(this.readOnly)throw Ji("[MappedThread] insert() called on read-only thread:",this.nameAndSizeUntracked);let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insert(r))}insertRaw(t){if(this.readOnly)throw Ji("[MappedThread] insertRaw() called on read-only thread:",this.nameAndSizeUntracked);let r=this._writeMapper?this._writeMapper(t):t;if(!(this._writeMapper&&!r))return this.parents.forEach(n=>n.insertRaw(r))}subscribeToParents(){this._parentSubscriptions=new Map;let t=At(()=>{this.parents.length||dl("MappedThread has no parents",this),jr(`[MappedThread: ${this.name}] subscribing to parents:`,this.parents.map(n=>n.name));let r=new Set([...this._parentSubscriptions.keys()]);for(let n of this.parents){r.delete(n)&&jr(`[MappedThread: ${this.name}] Skipping re-sub to parent`,n.nameAndSizeUntracked),jr(`[MappedThread: ${this.name}] sub to new parent`,n.nameAndSizeUntracked);let s=this.onParentUpdate.bind(this,n),o=n.subscribe(s);this._parentSubscriptions.set(n,o)}for(let n of r)jr(`[MappedThread: ${this.name}] un-subscribing from old parent`,n.nameAndSizeUntracked),this._parentSubscriptions.get(n)(),this._parentSubscriptions.delete(n)})}subscribe(t){return this._parentSubscriptions||this.subscribeToParents(),super.subscribe(t)}triggerRemap(){if(!this._eventMapper)throw Ji("triggerRemap on a thread that is not actually mapping?!",this.nameAndSizeUntracked);pl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap`),this.parents.length!==1&&dl(`MappedThread{${this.nameAndSizeUntracked}} triggerRemap with parentCount=${this.parents.length} - not meant for this`),this.parents.forEach(t=>{this.onParentUpdate(t,{init:Se(()=>Zt(t.applogs))})})}onParentUpdate(t,r){jr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate`,r);let n=this._eventMapper?this._eventMapper(r,t):r;if(this._eventMapper)if(jr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => mapped`,n),tr(n))this._applogs.replace([...n.init]);else{for(let i of n.added)this._applogs.splice(ZA(this._applogs,i,"ts"),0,i);if(n.removed){for(let i of n.removed)if(!this._applogs.remove(i))if(!tr(r)&&r.removed?.includes(i))pl("Ignoring remove event for non-existent because it was part of parent event's removed",i,r);else throw Ji(`MappedThread{${this.name}} toRemove contained log that doesn't exist`,i,{thread:this,event:r,mapResult:n})}}jr(`MappedThread{${this.nameAndSizeUntracked}} parentUpdate => deps?`,Kn(this._applogs)),this.notifySubscribers(n)}get readOnly(){return this._readOnly??!1}},{WARN:SI,LOG:xI,DEBUG:RI,VERBOSE:Ds,ERROR:O1}=Oe.setup(Oe.INFO),mr=We("rollingFilter",function(t,r,n={}){let i=E1(r),s=hl(i),o=xe.array(Se(function(){return s(t.applogs)}),{deep:!1,name:`${t.name} | ${n.name||`rollingFilter.array{${Fr(i)}}`}`}),a=g=>{let C;return tr(g)?C={init:s(g.init)}:C={added:s(g.added),removed:g.removed},Ds(`rollingFilter{${t.nameAndSizeUntracked} | ${n.name?` '${n.name}'}`:""} parentUpdate`,i,g,"=>",C),C},l=new xo(`${t.name} | ${n.name||`rollingFilter{${Fr(i)}}`}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],o,a),c=Qu(()=>Zt(r),g=>{Ds(`rollingFilter<${t.nameAndSizeUntracked}>${n.name?` '${n.name}'`:""} patternUpdate`,i,"=>",g),i=g,s=hl(i),l.triggerRemap()}),d=Dr(o,()=>{Ds(`rollingFilter<${Se(()=>t.name)}>${n.name?` '${n.name}'`:""} unobserve`,i),c(),d()});return l},{equals:_n,argsDebugName:(e,t,r)=>qe({caller:"rollingFilter",thread:e,pattern:t,args:r})}),Mf=We("rollingMapper",function(t,r,n={}){let i=Se(()=>r.call(null,{init:t.applogs},t));if(!tr(i))throw O1("Initial run must return init event");let s=i.init;return new xo(`${t.name} | ${n.name||"rollingMapper"}`,t,[...t.filters,...n.extraFilterName?[n.extraFilterName]:[]],s,r)},{equals:_n,argsDebugName:(e,t,r)=>qe({caller:"rollingMapper",thread:e,args:r})}),PI=We("rollingAcc",function(t,r,n,i={}){let s=tt(n);return s({init:t.applogs},r),t.subscribe(o=>{s(o,r)}),r},{argsDebugName:(e,t,r,n)=>`rollingAcc{${e.nameAndSizeUntracked}${n?.name?` | ${n?.name}`:""}}`}),E1=function(t){let r=Se(function(){return Object.fromEntries(Object.entries(Zt(t)).map(([i,s])=>[Zt(i),Zt(s)]))});if(!Object.entries(r).length)throw new Error("Pattern is empty");return r};function hl(e){return function(r){return r.filter(function(i){for(let s of Object.keys(e)){let o=e[s];if(o===void 0)continue;let a=i[s.startsWith("!")?s.slice(1):s];if(!g1(s,o,a))return!1}return!0})}}var $I=xo.asReadOnly;var{WARN:I1,LOG:S1,DEBUG:Le,VERBOSE:Df,ERROR:Qi}=Oe.setup(Oe.INFO),x1=class extends pn{constructor(e,t=[],r){super(e,null,r,t),yr(this,{})}purge(e){let t=this.applogs.length;return this._applogs=this.applogs.filter(r=>!e.includes(r.cid)),t-this.applogs.length}insert(e){Le(`[WriteableThread.insert] ENTER - ${e.length} applogs for thread "${this.name}"`),Le("[WriteableThread.insert] About to call ensureTsPvAndFinalizeApplogs");let t=m1(e,this);Le(`[WriteableThread.insert] ensureTsPvAndFinalizeApplogs completed, mapped=${t.length} applogs`),Le("[WriteableThread.insert] About to call insertRaw");let r=this.insertRaw(t);return Le("[WriteableThread.insert] insertRaw completed"),r}insertMissing(e,t=!1){let r=e.filter(n=>!this.hasApplog(n,t));return r.length===0?(Df("[insertMissing] no missing applogs"),[]):this.insertRaw(r)??[]}insertRaw(e){Le(`[WriteableThread.insertRaw] ENTER - ${e.length} applogs for thread "${this.name}"`),Le("[WriteableThread.insertRaw] About to deduplicate");let t=$f(e,"safety");if(t.length!==e.length)throw Qi(`[insertRaw] duplicate applogs passed: ${e.length-t.length}`,{appLogsToInsert:e,deduplicated:t});Le("[WriteableThread.insertRaw] Deduplication done"),Le("[WriteableThread.insertRaw] About to validate");let r=e.filter(s=>!Ef(s));if(r.length)throw Qi(`[insertRaw] bogus applogs passed: ${r.length}`,{bogus:r});Le("[WriteableThread.insertRaw] Validation done"),Le("[WriteableThread.insertRaw] About to check for existing");let n=e.filter(s=>this.hasApplog(s,!1));if(n.length)throw Qi(`[insertRaw] already existing applogs passed: ${n.length}`,{existing:n});if(Le("[WriteableThread.insertRaw] Existing check done"),!e.length){I1("[insertRaw] skipping empty insert empty logs array");return}(!this.hasParents&&!(this instanceof da)?S1:Le)("Inserting:",e.length===1?e[0]:e,{ds:this}),Le("[WriteableThread.insertRaw] About to sort applogs"),ri(e);let i=this._applogs.length&&f1(e[0],this._applogs[this._applogs.length-1]);return Le("[WriteableThread.insertRaw] About to push to _applogs array"),this._applogs.push(...e),i&&(Le("[WriteableThread.insertRaw] About to sort _applogs (sortNeeded=true)"),ri(this._applogs)),Le("[WriteableThread.insertRaw] About to notify subscribers"),this.notifySubscribers({added:e,removed:null}),Le("[WriteableThread.insertRaw] Subscribers notified"),Le("[WriteableThread.insertRaw] About to call persist (void - not awaited)"),this.persist(e),Le(`[WriteableThread.insertRaw] EXIT - returning ${e.length} applogs`),e}get readOnly(){return!1}},da=class Zi extends x1{constructor(t,r,n,i){super(t,r,n),this._readOnly=i,yr(this,{_applogs:xe.shallow})}static empty(t){return Zi.fromArray([],t??"empty in-memory",!1)}static fromArray(t,r,n=!1){return new Zi(r??"in-memory",t,[],n)}static fromReadOnlyArray(t,r){return new Zi(r??"in-memory",t,[],!0)}get readOnly(){return this._readOnly}async persist(t){if(Df("[InMem.persist] no persist for",t),this.readOnly)throw Qi("[persist] called for readOnly thread")}},{WARN:NI,LOG:CI,DEBUG:UI,VERBOSE:MI,ERROR:DI}=Oe.setup(Oe.INFO);var{WARN:cS,LOG:lS,DEBUG:fS,VERBOSE:dS,ERROR:pS}=Oe.setup(Oe.INFO);function pa(e){return Cf(e,31,7)}var P1=class{constructor(e,t,r=null){this.logsOfThisNode=e,this.variables=t,this.prevNode=r,yr(this,{threadOfTrail:Ce})}get record(){return this.variables}get threadOfTrail(){return this.prevNode?So([this.logsOfThisNode,this.prevNode.threadOfTrail]):this.logsOfThisNode}get trailLogs(){return this.threadOfTrail.applogs}},Bf=class{constructor(e){this.nodes=e,yr(this,{threadOfAllTrails:Ce,size:Ce,isEmpty:Ce})}get size(){return this.records.length}get isEmpty(){return this.records.length===0}get untrackedSize(){return Se(()=>this.records.length)}get records(){return qt(()=>this.nodes.map(({variables:e})=>e),{name:"QueryResult.records"})}get leafNodeThread(){return So(qt(()=>this.nodes.map(({logsOfThisNode:e})=>e),{name:"QueryResult.leafNodeThread"}))}get leafNodeLogSet(){return qt(()=>this.nodes.map(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogSet"})}get leafNodeLogs(){return qt(()=>this.nodes.flatMap(({logsOfThisNode:e})=>e.applogs),{name:"QueryResult.leafNodeLogs"})}get threadOfAllTrails(){return So(qt(()=>this.nodes.map(e=>e.threadOfTrail),{name:"QueryResult.threadOfAllTrails"}))}get thread(){return this.threadOfAllTrails}get allApplogs(){return this.threadOfAllTrails.applogs}},{WARN:mS,LOG:Ro,DEBUG:rr,VERBOSE:ve,ERROR:qr}=Oe.setup(Oe.INFO,{prefix:"[q]"}),ha=null,$1=We("lastWriteWins",function(t,{inverseToOnlyReturnFirstLogs:r,tolerateAlreadyFiltered:n}={}){if(ve(`lastWriteWins${r?".inversed":""} < ${t.nameAndSizeUntracked} > initializing`),t.filters.includes("lastWriteWins")){if(n)return rr("[lastWriteWins] already filtered, but tolerateAlreadyFiltered=true, so returning"),t;throw qr("thread already filtered lastWriteWins:",t.filters,{name:t.name})}let i,s=Mf(t,function(a,l){let c=tr(a),d,g=[],C=c?null:[];c?(i=new Map,d=a.init):d=a.added;let S;for(let x=r?0:d.length-1;r?x<d.length:x>=0;r?x++:x--){let K=d[x],H=K.en+"|"+K.at;if(S&&(r?S>K.ts:S<K.ts))throw qr("lastWriteWins.mapper logs not sorted:",S,r?">":"<",K.ts,{log:K,i:x,newLogs:d,inverseToOnlyReturnFirstLogs:r});S=K.ts;let F=i.get(H);(!F||(r?F.ts>K.ts:F.ts<K.ts))&&(F&&!c&&C.push(F),g.push(K),i.set(H,K))}return ri(g),ve.isDisabled||ve(`lastWriteWins${r?".inversed":""}<${t.nameAndSizeUntracked}> mapped event`,c?{...Object.fromEntries(Object.entries(a).map(([x,K])=>[x,K?.length])),toAdd:g.length,toRemove:C}:{...a,toAdd:g,toRemove:C}),c?{init:g}:{added:g,removed:C}},{name:`lastWriteWins${r?".inversed":""}`,extraFilterName:"lastWriteWins"});return ve.isDisabled||At(()=>{ve(`lastWriteWins<${t.nameAndSizeUntracked}> filtered down to`,s.applogs.length)}),s},{equals:_n,argsDebugName:e=>qe({caller:"lastWriteWins",thread:e})}),vS=We("withoutDeleted",function(t){if(ve.isEnabled&&ve(`withoutDeleted<${t.nameAndSizeUntracked}>`),t.filters.includes("withoutDeleted"))throw qr("thread already filtered withoutDeleted:",t.filters,{name:t.name});let r=mr(t,{at:["isDeleted","relation/isDeleted","block/isDeleted"],vl:!0},{name:"isDeleted"});ve.isEnabled&&ve(`withoutDeleted<${t.nameAndSizeUntracked}> deletionLogs:`,Se(function(){return[...r.applogs]}));let n=qe({caller:"allDeletedEntities",thread:t}),i=uf(function(){return r.map(o=>o.en)},{name:n});return ve.isEnabled&&At(()=>{ve(`withoutDeleted<${t.nameAndSizeUntracked}> deleted:`,[...i])}),mr(t,{"!en":i},{name:"withoutDeleted",extraFilterName:"withoutDeleted"})},{equals:_n}),Lf=We("query",function e(t,r,n={},i={}){j1();let s=jf(t);rr(`query<${s.nameAndSizeUntracked}>:`,r);let o=Array.isArray(r)?r:[r],a;if(o.length===1)a=null;else{let d=o.slice(0,-1);a=e(s,d,n,i)}let l=o[o.length-1],c=N1(s,a,l,i);return ve.isDisabled||At(()=>ve("query result:",Zt(c))),c},{equals:Eo,argsDebugName:(e,t,r)=>qe({caller:"query",thread:e,args:r?{pattern:t,startVars:r}:t})}),N1=We("queryStep",function(t,r,n,i={}){if(rr(`queryStep<${t.nameAndSizeUntracked}> with`,r?.untrackedSize??"all","nodes, pattern:",n),!Object.entries(n).length)throw new Error("Pattern is empty");function s(a){let[l,c]=fa(n,a?.variables??{});ve("[queryStep.doQuery] patternWithoutVars: ",l);let d=mr(t,l),g=Po(c),C=qt(function(){let x=d.map(K=>({log:K,vars:g(K)}));return ve.isEnabled&&ve("[queryStep.doQuery] step node:",a?.variables," =>",x,"from:",Se(()=>d.applogs)),x.map(({log:K,vars:H})=>{let F=Object.assign({},a?.variables,H);return new P1(lf.fromArray([K],qe({caller:"QueryNode",thread:d,pattern:`${Fr(F)}@${Fr(l)}`})),F,a)})},{name:qe({caller:"doQuery.mapNodes",thread:d,pattern:n})});return ve.isEnabled&&At(()=>ve("[queryStep.doQuery] resultNodes:",[...C])),i.debug&&Ro("[queryStep] step result:",Se(()=>C.map(({variables:S,logsOfThisNode:x})=>({variables:S,thread:x})))),C}let o=qt(function(){return rr(`[queryStep] Running with ${r?.nodes?.length} input nodes:`),r?[...r.nodes.flatMap(s)]:[...s(null)]},{name:qe({caller:"queryStep",thread:t,pattern:n})});return ve.isEnabled&&At(()=>ve("[queryStep] observableResultNodes:",[...o])),new Bf(o)},{equals:Eo,argsDebugName:(e,t,r)=>qe({caller:"queryStep",thread:e,pattern:r})}),_S=We("queryNot",function(t,r,n,i={}){let s=r.nodes;rr(`queryNot<${t.nameAndSizeUntracked}> from: ${s.length} nodes`);let o=Array.isArray(n)?n:[n];for(let a of o){if(!Object.entries(n).length)throw new Error("Pattern is empty");s=s.filter(function({variables:c}){let[d,g]=fa(a,c??{});ve("[queryNot] patternWithoutVars: ",d);let C=mr(t,d);return ve("[queryNot] step node:",c," =>",C.size,"applogs"),ve.isDisabled||ve("[queryNot] step node:",c," => empty?",Se(()=>C.applogs)),i.debug&&Ro("[queryNot] node result:",c,"=>",C.applogs),C.isEmpty})}return new Bf(s)},{equals:Eo,argsDebugName:(e,t,r)=>qe({caller:"queryNot",thread:e,pattern:r})}),wS=We("filterAndMap",function(t,r,n){rr(`filterAndMap<${t.nameAndSizeUntracked}>`,r);let i=mr(t,r);ve.isEnabled&&(ve("[filterAndMap] filtered:",i.untrackedSize),At(()=>ve("[filterAndMap] filtered:",i.applogs)));let s=qe({thread:t,pattern:r,caller:"filterAndMap"}),o=qt(()=>M1(i,n),{name:s});return ve.isDisabled||At(()=>ve("[filterAndMap] mapped:",o)),o},{equals:Be.structural,argsDebugName:(e,t)=>qe({caller:"filterAndMap",thread:e,pattern:t})}),TS=We("queryAndMap",function(t,r,n,i={}){let s=jf(t);rr(`queryAndMap<${s.nameAndSizeUntracked}>`,{patternOrPatterns:r,variables:i,map:n});let o=qe({thread:s,caller:"queryAndMap"}),a=Lf(s,r);ve("[queryAndMap] filtered count:",a.untrackedSize);let l=qt(()=>D1(a,n),{name:o});return ve.isDisabled||At(()=>ve("[queryAndMap] result:",Zt(l))),l},{equals:Be.structural,argsDebugName:(e,t)=>qe({caller:"queryAndMap",thread:e,pattern:t})}),AS=We("queryEntity",function(t,r,n,i){rr(`queryEntity<${t.nameAndSizeUntracked}>`,n,r);let s=mr(t,{en:n,at:B1(r,i)});return ve("queryEntity applogs:",s.applogs),Ce(()=>s.isEmpty?null:Object.fromEntries(s.map(({at:o,vl:a})=>[o.slice(r.length+1),a])))},{equals:af,argsDebugName:(e,t,r)=>qe({caller:"queryEntity",thread:e,args:{name:t,entityID:r}})}),OS=We("agentsOfThread",function(t){rr(`agentsOfThread<${t.nameAndSizeUntracked}>`);let r=xe.map(),n=tt(s=>{for(let o of tr(s)?s.init:s.added){let a=r.get(o.ag)??0;r.set(o.ag,a+1)}for(let o of!tr(s)&&s.removed||[]){let a=r.get(o.ag);if(!a||a<1)throw qr("[agentsOfThread] number is now negative",{log:o,event:s,mapped:r,prev:a});r.set(o.ag,a-1)}Ro(`agentsOfThread<${t.nameAndSizeUntracked}> processed event`,{event:s,mapped:r})});n({init:t.applogs});let i=t.subscribe(n);return un(r,i),r}),C1=We("entityOverlap",function(t,r){return Ro(`entityOverlap<${t.nameAndSizeUntracked}, ${r.nameAndSizeUntracked}>`),Ce(()=>{let n=new Set(t.map(s=>s.en)),i=new Set(r.map(s=>s.en));return[...n].filter(s=>i.has(s))})});var ES=We("entityOverlapCount",function(t,r){return Ce(()=>C1(t,r).get().length)}),U1=We("querySingle",function(t,r,n={}){let i=Lf(t,r,n);return Ce(()=>{if(i.isEmpty)return null;if(i.size>1)throw qr("[querySingle] got",i.size,"results:",i);let s=i.nodes[0].logsOfThisNode;if(s.size!=1)throw qr("[querySingle] single result, but got",s.size,"logs:",s.applogs);return s.applogs[0]})},{equals:Be.structural,argsDebugName:(e,t)=>qe({caller:"querySingle",thread:e,pattern:t})}),IS=We("querySingleAndMap",function(t,r,n,i={}){let s=U1(t,r,i);return Ce(()=>{let o=s.get();if(o)return typeof n=="string"?o[n]:Po(n)(o)})},{equals:Be.structural,argsDebugName:(e,t)=>qe({caller:"querySingleAndMap",thread:e,pattern:t})}),M1=function(t,r){return typeof r=="function"?t.map(r):typeof r=="string"?t.map(n=>n[r]):t.map(Po(r))},D1=function(t,r){return typeof r=="function"?t.records.map(r):typeof r=="string"?t.nodes.map(n=>{if(!Object.hasOwn(n.record,r)){if(n.logsOfThisNode.size!==1)throw qr(`not sure what to map (it's not a var and a result node log count of ${n.logsOfThisNode.size})`);return n.logsOfThisNode.firstLog[r]}return n.record[r]}):t.nodes.map(n=>Po(r)(t))};function Po(e){return t=>Object.entries(e).reduce((r,[n,i])=>(r[i]=t[n],r),{})}function B1(e,t){return t.map(r=>L1(e,r))}function L1(e,t){return`${e}/${t}`}function jf(e,t){return Array.isArray(e)?da.fromArray(e,t||`threadFromArray[${e.length}]`,!0):e}function j1(){if(ha!=null&&performance.now()>=ha)throw new k1(ha)}var k1=class extends Error{constructor(e){super(e)}};var F1=Ne({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){"use strict";t.exports=o;var r=128,n=127,i=~n,s=Math.pow(2,31);function o(a,l,c){if(Number.MAX_SAFE_INTEGER&&a>Number.MAX_SAFE_INTEGER)throw o.bytes=0,new RangeError("Could not encode varint");l=l||[],c=c||0;for(var d=c;a>=s;)l[c++]=a&255|r,a/=128;for(;a&i;)l[c++]=a&255|r,a>>>=7;return l[c]=a|0,o.bytes=c-d+1,l}}}),K1=Ne({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){"use strict";t.exports=i;var r=128,n=127;function i(s,l){var a=0,l=l||0,c=0,d=l,g,C=s.length;do{if(d>=C||c>49)throw i.bytes=0,new RangeError("Could not decode varint");g=s[d++],a+=c<28?(g&n)<<c:(g&n)*Math.pow(2,c),c+=7}while(g>=r);return i.bytes=d-l,a}}}),V1=Ne({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){"use strict";var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),s=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),l=Math.pow(2,49),c=Math.pow(2,56),d=Math.pow(2,63);t.exports=function(g){return g<r?1:g<n?2:g<i?3:g<s?4:g<o?5:g<a?6:g<l?7:g<c?8:g<d?9:10}}}),ga=Ne({"../../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){"use strict";t.exports={encode:F1(),decode:K1(),encodingLength:V1()}}}),Ff=42;function q1(e){if(e.asCID!==e&&e["/"]!==e.bytes)return null;let t=Qr.asCID(e);if(!t)return null;let r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Z(I.tag,Ff),new Z(I.bytes,r)]}function z1(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function G1(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}function W1(e){for(let t of e.keys())if(typeof t!="string"||t.length===0)throw new Error("Non-string Map keys are not supported by the IPLD Data Model and cannot be encoded");return null}var kf={float64:!0,typeEncoders:{Map:W1,Object:q1,undefined:z1,number:G1}},FS={...kf,typeEncoders:{...kf.typeEncoders}};function H1(e){if(e[0]!==0)throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return Qr.decode(e.subarray(1))}var ya={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,rejectDuplicateMapKeys:!0,tags:[]};ya.tags[Ff]=H1;var KS={...ya,tags:ya.tags.slice()};var VS=ft(ga(),1);var vr={Null:e=>e===null?e:void 0,Int:e=>Number.isInteger(e)?e:void 0,Float:e=>typeof e=="number"&&Number.isFinite(e)?e:void 0,String:e=>typeof e=="string"?e:void 0,Bool:e=>typeof e=="boolean"?e:void 0,Bytes:e=>e instanceof Uint8Array?e:void 0,Link:e=>e!==null&&typeof e=="object"&&e.asCID===e?e:void 0,List:e=>Array.isArray(e)?e:void 0,Map:e=>e!==null&&typeof e=="object"&&e.asCID!==e&&!Array.isArray(e)&&!(e instanceof Uint8Array)?e:void 0},ii={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":vr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(vr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=ii["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=ii["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:vr.Int,CarV1HeaderOrV2Pragma:e=>{if(vr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=ii["CarV1HeaderOrV2Pragma > roots (anon)"](e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.roots=a}}break;case"version":{n--;let a=ii.Int(e[s]);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},oi={"CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)":vr.Link,"CarV1HeaderOrV2Pragma > roots (anon)":e=>{if(vr.List(e)!==void 0){for(let t=0;t<e.length;t++){let r=e[t];if(r=oi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](r),r===void 0)return;if(r!==e[t]){let n=e.slice(0,t);for(let i=t;i<e.length;i++){let s=e[i];if(s=oi["CarV1HeaderOrV2Pragma > roots (anon) > valueType (anon)"](s),s===void 0)return;n.push(s)}return n}}return e}},Int:vr.Int,CarV1HeaderOrV2Pragma:e=>{if(vr.Map(e)===void 0)return;let t=Object.entries(e),r=e,n=1;for(let i=0;i<t.length;i++){let[s,o]=t[i];switch(s){case"roots":{let a=oi["CarV1HeaderOrV2Pragma > roots (anon)"](o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.roots=a}}break;case"version":{n--;let a=oi.Int(o);if(a===void 0)return;if(a!==o||r!==e){if(r===e){r={};for(let l=0;l<i;l++)r[t[l][0]]=t[l][1]}r.version=a}}break;default:return}}if(!(n>0))return r}},qS={toTyped:ii.CarV1HeaderOrV2Pragma,toRepresentation:oi.CarV1HeaderOrV2Pragma},zS=Yo(),GS=ft(ga(),1),WS=[new Z(I.map,2),new Z(I.string,"version"),new Z(I.uint,1),new Z(I.string,"roots")],HS=new Z(I.tag,42);var JS=ft(ga(),1);var{WARN:XS,LOG:YS,DEBUG:QS,VERBOSE:ZS,ERROR:ex}=Oe.setup(Oe.INFO);var{WARN:tx,LOG:rx,DEBUG:nx,VERBOSE:ix,ERROR:ox}=Oe.setup(Oe.INFO);var ba=class{app;username;devicename;signer},Kf=class extends ba{constructor(t){super(),Object.assign(this,t)}get did(){return this.signer.did}async sign(t){return await this.signer.sign(t)}get ag(){return pa(this.agentString)}get shortDID(){return this.did?.slice(-8)}get agentString(){return`${this.username}.${this.shortDID}@${this.app}.${this.devicename}`}};export{Kf as BaseAgent};
|
|
62
|
+
/*! Bundled license information:
|
|
63
|
+
|
|
64
|
+
@noble/hashes/utils.js:
|
|
65
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
66
|
+
*/
|
|
62
67
|
/*! Bundled license information:
|
|
63
68
|
|
|
64
69
|
lodash-es/lodash.js:
|
|
@@ -71,8 +76,5 @@ lodash-es/lodash.js:
|
|
|
71
76
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
72
77
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
73
78
|
*)
|
|
74
|
-
|
|
75
|
-
@noble/hashes/utils.js:
|
|
76
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
77
79
|
*/
|
|
78
80
|
//# sourceMappingURL=index.min.js.map
|