@triplit/react 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -1
- package/dist/use-query.d.ts +4 -7
- package/package.json +5 -4
package/dist/index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var jt=Object.create;var rt=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var Pt=Object.getOwnPropertyNames;var Ut=Object.getPrototypeOf,At=Object.prototype.hasOwnProperty;var le=(i,r)=>()=>(r||i((r={exports:{}}).exports,r),r.exports);var Nt=(i,r,c,g)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of Pt(r))!At.call(i,l)&&l!==c&&rt(i,l,{get:()=>r[l],enumerable:!(g=wt(r,l))||g.enumerable});return i};var Fn=(i,r,c)=>(c=i!=null?jt(Ut(i)):{},Nt(r||!i||!i.__esModule?rt(c,"default",{value:i,enumerable:!0}):c,i));var Ue=le(d=>{"use strict";Object.defineProperty(d,"__esModule",{value:!0});d.Type=d.StandardType=d.ExtendedTypeBuilder=d.StandardTypeBuilder=d.TypeBuilder=d.TemplateLiteralGenerator=d.TemplateLiteralFinite=d.TemplateLiteralParser=d.TemplateLiteralParserError=d.TemplateLiteralResolver=d.TemplateLiteralPattern=d.KeyResolver=d.ObjectMap=d.TypeClone=d.TypeExtends=d.TypeExtendsResult=d.ExtendsUndefined=d.TypeGuard=d.TypeGuardUnknownTypeError=d.FormatRegistry=d.TypeRegistry=d.PatternStringExact=d.PatternNumberExact=d.PatternBooleanExact=d.PatternString=d.PatternNumber=d.PatternBoolean=d.Kind=d.Hint=d.Modifier=void 0;d.Modifier=Symbol.for("TypeBox.Modifier");d.Hint=Symbol.for("TypeBox.Hint");d.Kind=Symbol.for("TypeBox.Kind");d.PatternBoolean="(true|false)";d.PatternNumber="(0|[1-9][0-9]*)";d.PatternString=".*";d.PatternBooleanExact=`^${d.PatternBoolean}$`;d.PatternNumberExact=`^${d.PatternNumber}$`;d.PatternStringExact=`^${d.PatternString}$`;var it;(function(i){let r=new Map;function c(){return new Map(r)}i.Entries=c;function g(){return r.clear()}i.Clear=g;function l(a){return r.has(a)}i.Has=l;function y(a,x){r.set(a,x)}i.Set=y;function m(a){return r.get(a)}i.Get=m})(it=d.TypeRegistry||(d.TypeRegistry={}));var St;(function(i){let r=new Map;function c(){return new Map(r)}i.Entries=c;function g(){return r.clear()}i.Clear=g;function l(a){return r.has(a)}i.Has=l;function y(a,x){r.set(a,x)}i.Set=y;function m(a){return r.get(a)}i.Get=m})(St=d.FormatRegistry||(d.FormatRegistry={}));var Dn=class extends Error{constructor(r){super("TypeGuard: Unknown type"),this.schema=r}};d.TypeGuardUnknownTypeError=Dn;var s;(function(i){function r(o){return typeof o=="object"&&o!==null&&!Array.isArray(o)}function c(o){return typeof o=="object"&&o!==null&&Array.isArray(o)}function g(o){try{return new RegExp(o),!0}catch{return!1}}function l(o){if(typeof o!="string")return!1;for(let ee=0;ee<o.length;ee++){let Y=o.charCodeAt(ee);if(Y>=7&&Y<=13||Y===27||Y===127)return!1}return!0}function y(o){return typeof o=="bigint"}function m(o){return typeof o=="string"}function a(o){return typeof o=="number"&&globalThis.Number.isFinite(o)}function x(o){return typeof o=="boolean"}function S(o){return o===void 0||o!==void 0&&y(o)}function N(o){return o===void 0||o!==void 0&&a(o)}function L(o){return o===void 0||o!==void 0&&x(o)}function U(o){return o===void 0||o!==void 0&&m(o)}function $(o){return o===void 0||o!==void 0&&m(o)&&l(o)&&g(o)}function j(o){return o===void 0||o!==void 0&&m(o)&&l(o)}function M(o){return o===void 0||oe(o)}function V(o){return q(o)&&o[d.Kind]==="Any"&&U(o.$id)}i.TAny=V;function z(o){return q(o)&&o[d.Kind]==="Array"&&o.type==="array"&&U(o.$id)&&oe(o.items)&&N(o.minItems)&&N(o.maxItems)&&L(o.uniqueItems)}i.TArray=z;function D(o){return q(o)&&o[d.Kind]==="BigInt"&&o.type==="null"&&o.typeOf==="BigInt"&&U(o.$id)&&S(o.multipleOf)&&S(o.minimum)&&S(o.maximum)&&S(o.exclusiveMinimum)&&S(o.exclusiveMaximum)}i.TBigInt=D;function W(o){return q(o)&&o[d.Kind]==="Boolean"&&o.type==="boolean"&&U(o.$id)}i.TBoolean=W;function Z(o){if(!(q(o)&&o[d.Kind]==="Constructor"&&o.type==="object"&&o.instanceOf==="Constructor"&&U(o.$id)&&c(o.parameters)&&oe(o.returns)))return!1;for(let ee of o.parameters)if(!oe(ee))return!1;return!0}i.TConstructor=Z;function v(o){return q(o)&&o[d.Kind]==="Date"&&o.type==="object"&&o.instanceOf==="Date"&&U(o.$id)&&N(o.minimumTimestamp)&&N(o.maximumTimestamp)&&N(o.exclusiveMinimumTimestamp)&&N(o.exclusiveMaximumTimestamp)}i.TDate=v;function ce(o){if(!(q(o)&&o[d.Kind]==="Function"&&o.type==="object"&&o.instanceOf==="Function"&&U(o.$id)&&c(o.parameters)&&oe(o.returns)))return!1;for(let ee of o.parameters)if(!oe(ee))return!1;return!0}i.TFunction=ce;function ae(o){return q(o)&&o[d.Kind]==="Integer"&&o.type==="integer"&&U(o.$id)&&N(o.multipleOf)&&N(o.minimum)&&N(o.maximum)&&N(o.exclusiveMinimum)&&N(o.exclusiveMaximum)}i.TInteger=ae;function de(o){if(!(q(o)&&o[d.Kind]==="Intersect"&&c(o.allOf)&&U(o.type)&&(L(o.unevaluatedProperties)||M(o.unevaluatedProperties))&&U(o.$id))||"type"in o&&o.type!=="object")return!1;for(let ee of o.allOf)if(!oe(ee))return!1;return!0}i.TIntersect=de;function q(o){return r(o)&&d.Kind in o&&typeof o[d.Kind]=="string"}i.TKind=q;function se(o){return q(o)&&o[d.Kind]==="Literal"&&U(o.$id)&&(m(o.const)||a(o.const)||x(o.const)||y(o.const))}i.TLiteral=se;function ye(o){return q(o)&&o[d.Kind]==="Never"&&r(o.not)&&globalThis.Object.getOwnPropertyNames(o.not).length===0}i.TNever=ye;function fe(o){return q(o)&&o[d.Kind]==="Not"&&c(o.allOf)&&o.allOf.length===2&&r(o.allOf[0])&&oe(o.allOf[0].not)&&oe(o.allOf[1])}i.TNot=fe;function pe(o){return q(o)&&o[d.Kind]==="Null"&&o.type==="null"&&U(o.$id)}i.TNull=pe;function be(o){return q(o)&&o[d.Kind]==="Number"&&o.type==="number"&&U(o.$id)&&N(o.multipleOf)&&N(o.minimum)&&N(o.maximum)&&N(o.exclusiveMinimum)&&N(o.exclusiveMaximum)}i.TNumber=be;function h(o){if(!(q(o)&&o[d.Kind]==="Object"&&o.type==="object"&&U(o.$id)&&r(o.properties)&&(L(o.additionalProperties)||M(o.additionalProperties))&&N(o.minProperties)&&N(o.maxProperties)))return!1;for(let[ee,Y]of Object.entries(o.properties))if(!l(ee)||!oe(Y))return!1;return!0}i.TObject=h;function X(o){return q(o)&&o[d.Kind]==="Promise"&&o.type==="object"&&o.instanceOf==="Promise"&&U(o.$id)&&oe(o.item)}i.TPromise=X;function C(o){if(!(q(o)&&o[d.Kind]==="Record"&&o.type==="object"&&U(o.$id)&&o.additionalProperties===!1&&r(o.patternProperties)))return!1;let ee=Object.keys(o.patternProperties);return!(ee.length!==1||!g(ee[0])||!oe(o.patternProperties[ee[0]]))}i.TRecord=C;function b(o){return q(o)&&o[d.Kind]==="Ref"&&U(o.$id)&&m(o.$ref)}i.TRef=b;function k(o){return q(o)&&o[d.Kind]==="String"&&o.type==="string"&&U(o.$id)&&N(o.minLength)&&N(o.maxLength)&&$(o.pattern)&&j(o.format)}i.TString=k;function T(o){return q(o)&&o[d.Kind]==="Symbol"&&o.type==="null"&&o.typeOf==="Symbol"&&U(o.$id)}i.TSymbol=T;function A(o){return q(o)&&o[d.Kind]==="TemplateLiteral"&&o.type==="string"&&m(o.pattern)&&o.pattern[0]==="^"&&o.pattern[o.pattern.length-1]==="$"}i.TTemplateLiteral=A;function O(o){return q(o)&&o[d.Kind]==="This"&&U(o.$id)&&m(o.$ref)}i.TThis=O;function R(o){if(!(q(o)&&o[d.Kind]==="Tuple"&&o.type==="array"&&U(o.$id)&&a(o.minItems)&&a(o.maxItems)&&o.minItems===o.maxItems))return!1;if(o.items===void 0&&o.additionalItems===void 0&&o.minItems===0)return!0;if(!c(o.items))return!1;for(let ee of o.items)if(!oe(ee))return!1;return!0}i.TTuple=R;function F(o){return q(o)&&o[d.Kind]==="Undefined"&&o.type==="null"&&o.typeOf==="Undefined"&&U(o.$id)}i.TUndefined=F;function n(o){if(!(q(o)&&o[d.Kind]==="Union"&&c(o.anyOf)&&U(o.$id)))return!1;for(let ee of o.anyOf)if(!oe(ee))return!1;return!0}i.TUnion=n;function I(o){return n(o)&&o.anyOf.every(ee=>se(ee)&&typeof ee.const=="string")}i.TUnionLiteral=I;function u(o){return q(o)&&o[d.Kind]==="Uint8Array"&&o.type==="object"&&U(o.$id)&&o.instanceOf==="Uint8Array"&&N(o.minByteLength)&&N(o.maxByteLength)}i.TUint8Array=u;function f(o){return q(o)&&o[d.Kind]==="Unknown"&&U(o.$id)}i.TUnknown=f;function P(o){return q(o)&&o[d.Kind]==="Unsafe"}i.TUnsafe=P;function E(o){return q(o)&&o[d.Kind]==="Void"&&o.type==="null"&&o.typeOf==="Void"&&U(o.$id)}i.TVoid=E;function J(o){return r(o)&&o[d.Modifier]==="ReadonlyOptional"}i.TReadonlyOptional=J;function Q(o){return r(o)&&o[d.Modifier]==="Readonly"}i.TReadonly=Q;function Ie(o){return r(o)&&o[d.Modifier]==="Optional"}i.TOptional=Ie;function oe(o){return typeof o=="object"&&(V(o)||z(o)||W(o)||D(o)||Z(o)||v(o)||ce(o)||ae(o)||de(o)||se(o)||ye(o)||fe(o)||pe(o)||be(o)||h(o)||X(o)||C(o)||b(o)||k(o)||T(o)||A(o)||O(o)||R(o)||F(o)||n(o)||u(o)||f(o)||P(o)||E(o)||q(o)&&it.Has(o[d.Kind]))}i.TSchema=oe})(s=d.TypeGuard||(d.TypeGuard={}));var $t;(function(i){function r(c){return c[d.Kind]==="Undefined"?!0:c[d.Kind]==="Union"?c.anyOf.some(l=>r(l)):!1}i.Check=r})($t=d.ExtendsUndefined||(d.ExtendsUndefined={}));var w;(function(i){i[i.Union=0]="Union",i[i.True=1]="True",i[i.False=2]="False"})(w=d.TypeExtendsResult||(d.TypeExtendsResult={}));var Ee;(function(i){function r(t){return t===w.False?w.False:w.True}function c(t,e){return w.True}function g(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)&&e.anyOf.some(K=>s.TAny(K)||s.TUnknown(K))?w.True:s.TUnion(e)?w.Union:s.TUnknown(e)||s.TAny(e)?w.True:w.Union}function l(t,e){return s.TUnknown(t)?w.False:s.TAny(t)?w.Union:s.TNever(t)?w.True:w.False}function y(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)&&k(e)?w.True:s.TArray(e)?r(ne(t.items,e.items)):w.False}function m(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TBigInt(e)?w.True:w.False}function a(t,e){return s.TLiteral(t)&&typeof t.const=="boolean"||s.TBoolean(t)?w.True:w.False}function x(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TBoolean(e)?w.True:w.False}function S(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):!s.TConstructor(e)||t.parameters.length>e.parameters.length||!t.parameters.every((K,_)=>r(ne(e.parameters[_],K))===w.True)?w.False:r(ne(t.returns,e.returns))}function N(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TDate(e)?w.True:w.False}function L(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):!s.TFunction(e)||t.parameters.length>e.parameters.length||!t.parameters.every((K,_)=>r(ne(e.parameters[_],K))===w.True)?w.False:r(ne(t.returns,e.returns))}function U(t,e){return s.TLiteral(t)&&typeof t.const=="number"||s.TNumber(t)||s.TInteger(t)?w.True:w.False}function $(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TInteger(e)||s.TNumber(e)?w.True:w.False}function j(t,e){return e.allOf.every(K=>ne(t,K)===w.True)?w.True:w.False}function M(t,e){return t.allOf.some(K=>ne(K,e)===w.True)?w.True:w.False}function V(t){return typeof t.const=="string"}function z(t){return typeof t.const=="number"}function D(t){return typeof t.const=="boolean"}function W(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TString(e)?P(t,e):s.TNumber(e)?ae(t,e):s.TInteger(e)?U(t,e):s.TBoolean(e)?a(t,e):s.TLiteral(e)&&e.const===t.const?w.True:w.False}function Z(t,e){return w.False}function v(t,e){return w.True}function ce(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TNull(e)?w.True:w.False}function ae(t,e){return s.TLiteral(t)&&z(t)||s.TNumber(t)||s.TInteger(t)?w.True:w.False}function de(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TInteger(e)||s.TNumber(e)?w.True:w.False}function q(t,e){return globalThis.Object.keys(t.properties).length===e}function se(t){return k(t)}function ye(t){return q(t,0)||q(t,1)&&"description"in t.properties&&s.TUnion(t.properties.description)&&t.properties.description.anyOf.length===2&&(s.TString(t.properties.description.anyOf[0])&&s.TUndefined(t.properties.description.anyOf[1])||s.TString(t.properties.description.anyOf[1])&&s.TUndefined(t.properties.description.anyOf[0]))}function fe(t){return q(t,0)}function pe(t){return q(t,0)}function be(t){return q(t,0)}function h(t){return q(t,0)}function X(t){return k(t)}function C(t){let e=d.Type.Number();return q(t,0)||q(t,1)&&"length"in t.properties&&r(ne(t.properties.length,e))===w.True}function b(t){return q(t,0)}function k(t){let e=d.Type.Number();return q(t,0)||q(t,1)&&"length"in t.properties&&r(ne(t.properties.length,e))===w.True}function T(t){let e=d.Type.Function([d.Type.Any()],d.Type.Any());return q(t,0)||q(t,1)&&"then"in t.properties&&r(ne(t.properties.then,e))===w.True}function A(t,e){return ne(t,e)===w.False||s.TOptional(t)&&!s.TOptional(e)?w.False:w.True}function O(t,e){return s.TUnknown(t)?w.False:s.TAny(t)?w.Union:s.TNever(t)||s.TLiteral(t)&&V(t)&&se(e)||s.TLiteral(t)&&z(t)&&fe(e)||s.TLiteral(t)&&D(t)&&pe(e)||s.TSymbol(t)&&ye(e)||s.TBigInt(t)&&be(e)||s.TString(t)&&se(e)||s.TSymbol(t)&&ye(e)||s.TNumber(t)&&fe(e)||s.TInteger(t)&&fe(e)||s.TBoolean(t)&&pe(e)||s.TUint8Array(t)&&X(e)||s.TDate(t)&&h(e)||s.TConstructor(t)&&b(e)||s.TFunction(t)&&C(e)?w.True:s.TRecord(t)&&s.TString(n(t))?e[d.Hint]==="Record"?w.True:w.False:s.TRecord(t)&&s.TNumber(n(t))&&q(e,0)?w.True:w.False}function R(t,e){if(s.TIntersect(e))return j(t,e);if(s.TUnion(e))return Y(t,e);if(s.TUnknown(e))return ie(t,e);if(s.TAny(e))return c(t,e);if(s.TRecord(e))return u(t,e);if(!s.TObject(e))return w.False;for(let K of globalThis.Object.keys(e.properties))if(!(K in t.properties)||A(t.properties[K],e.properties[K])===w.False)return w.False;return w.True}function F(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)&&T(e)?w.True:s.TPromise(e)?r(ne(t.item,e.item)):w.False}function n(t){if(d.PatternNumberExact in t.patternProperties)return d.Type.Number();if(d.PatternStringExact in t.patternProperties)return d.Type.String();throw Error("TypeExtends: Cannot get record key")}function I(t){if(d.PatternNumberExact in t.patternProperties)return t.patternProperties[d.PatternNumberExact];if(d.PatternStringExact in t.patternProperties)return t.patternProperties[d.PatternStringExact];throw Error("TypeExtends: Cannot get record value")}function u(t,e){let K=n(e),_=I(e);if(s.TLiteral(t)&&V(t)&&s.TNumber(K)&&r(ne(t,_))===w.True)return w.True;if(s.TUint8Array(t)&&s.TNumber(K)||s.TString(t)&&s.TNumber(K)||s.TArray(t)&&s.TNumber(K))return ne(t,_);if(s.TObject(t)){for(let ke of globalThis.Object.keys(t.properties))if(A(_,t.properties[ke])===w.False)return w.False;return w.True}return w.False}function f(t,e){let K=I(t);return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?ne(K,I(e)):w.False}function P(t,e){return s.TLiteral(t)&&typeof t.const=="string"||s.TString(t)?w.True:w.False}function E(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TString(e)?w.True:w.False}function J(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TSymbol(e)?w.True:w.False}function Q(t,e){return s.TUnknown(t)?w.False:s.TAny(t)?w.Union:s.TNever(t)?w.True:w.False}function Ie(t,e){return s.TArray(e)&&t.items!==void 0&&t.items.every(K=>ne(K,e.items)===w.True)}function oe(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)&&k(e)||s.TArray(e)&&Ie(t,e)?w.True:!s.TTuple(e)||t.items===void 0&&e.items!==void 0||t.items!==void 0&&e.items===void 0?w.False:t.items===void 0&&e.items===void 0||t.items.every((K,_)=>ne(K,e.items[_])===w.True)?w.True:w.False}function o(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TUint8Array(e)?w.True:w.False}function ee(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TNever(e)?Z(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TRecord(e)?u(t,e):s.TVoid(e)?Bn(t,e):s.TUndefined(e)?w.True:w.False}function Y(t,e){return e.anyOf.some(K=>ne(t,K)===w.True)?w.True:w.False}function Kn(t,e){return t.anyOf.every(K=>ne(K,e)===w.True)?w.True:w.False}function ie(t,e){return w.True}function Vn(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TAny(e)?c(t,e):s.TString(e)?P(t,e):s.TNumber(e)?ae(t,e):s.TInteger(e)?U(t,e):s.TBoolean(e)?a(t,e):s.TArray(e)?l(t,e):s.TTuple(e)?Q(t,e):s.TObject(e)?O(t,e):s.TUnknown(e)?w.True:w.False}function Bn(t,e){return s.TUndefined(t)||s.TUndefined(t)?w.True:w.False}function Pe(t,e){return s.TIntersect(e)?j(t,e):s.TUnion(e)?Y(t,e):s.TUnknown(e)?ie(t,e):s.TAny(e)?c(t,e):s.TObject(e)?O(t,e):s.TVoid(e)?w.True:w.False}function ne(t,e){if(s.TTemplateLiteral(t))return ne(Le.Resolve(t),e);if(s.TTemplateLiteral(e))return ne(t,Le.Resolve(e));if(s.TAny(t))return g(t,e);if(s.TArray(t))return y(t,e);if(s.TBigInt(t))return m(t,e);if(s.TBoolean(t))return x(t,e);if(s.TConstructor(t))return S(t,e);if(s.TDate(t))return N(t,e);if(s.TFunction(t))return L(t,e);if(s.TInteger(t))return $(t,e);if(s.TIntersect(t))return M(t,e);if(s.TLiteral(t))return W(t,e);if(s.TNever(t))return v(t,e);if(s.TNull(t))return ce(t,e);if(s.TNumber(t))return de(t,e);if(s.TObject(t))return R(t,e);if(s.TRecord(t))return f(t,e);if(s.TString(t))return E(t,e);if(s.TSymbol(t))return J(t,e);if(s.TTuple(t))return oe(t,e);if(s.TPromise(t))return F(t,e);if(s.TUint8Array(t))return o(t,e);if(s.TUndefined(t))return ee(t,e);if(s.TUnion(t))return Kn(t,e);if(s.TUnknown(t))return Vn(t,e);if(s.TVoid(t))return Pe(t,e);throw Error(`TypeExtends: Unknown left type operand '${t[d.Kind]}'`)}function p(t,e){return ne(t,e)}i.Extends=p})(Ee=d.TypeExtends||(d.TypeExtends={}));var H;(function(i){function r(a){return typeof a=="object"&&a!==null}function c(a){return globalThis.Array.isArray(a)}function g(a){return a.map(x=>y(x))}function l(a){let x=globalThis.Object.getOwnPropertyNames(a).reduce((N,L)=>({...N,[L]:y(a[L])}),{}),S=globalThis.Object.getOwnPropertySymbols(a).reduce((N,L)=>({...N,[L]:y(a[L])}),{});return{...x,...S}}function y(a){return c(a)?g(a):r(a)?l(a):a}function m(a,x){return{...y(a),...x}}i.Clone=m})(H=d.TypeClone||(d.TypeClone={}));var Ze;(function(i){function r(m,a){return d.Type.Intersect(m.allOf.map(x=>l(x,a)),{...m})}function c(m,a){return d.Type.Union(m.anyOf.map(x=>l(x,a)),{...m})}function g(m,a){return a(m)}function l(m,a){return s.TIntersect(m)?r(m,a):s.TUnion(m)?c(m,a):s.TObject(m)?g(m,a):m}function y(m,a,x){return{...l(H.Clone(m,{}),a),...x}}i.Map=y})(Ze=d.ObjectMap||(d.ObjectMap={}));var ot;(function(i){function r(a){return s.TIntersect(a)||s.TUnion(a)||s.TObject(a)&&globalThis.Object.getOwnPropertyNames(a.properties).length>0}function c(a){return[...a.allOf.filter(x=>r(x)).reduce((x,S)=>y(S).map(N=>x.add(N))[0],new Set)]}function g(a){let x=a.anyOf.filter(S=>r(S)).map(S=>y(S));return[...x.reduce((S,N)=>N.map(L=>x.every(U=>U.includes(L))?S.add(L):S)[0],new Set)]}function l(a){return globalThis.Object.keys(a.properties)}function y(a){return s.TIntersect(a)?c(a):s.TUnion(a)?g(a):s.TObject(a)?l(a):[]}function m(a){return y(a)}i.Resolve=m})(ot=d.KeyResolver||(d.KeyResolver={}));var ut;(function(i){function r(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function c(l,y){if(s.TTemplateLiteral(l))return l.pattern.slice(1,l.pattern.length-1);if(s.TUnion(l))return`(${l.anyOf.map(a=>c(a,y)).join("|")})`;if(s.TNumber(l))return`${y}${d.PatternNumber}`;if(s.TInteger(l))return`${y}${d.PatternNumber}`;if(s.TBigInt(l))return`${y}${d.PatternNumber}`;if(s.TString(l))return`${y}${d.PatternString}`;if(s.TLiteral(l))return`${y}${r(l.const.toString())}`;if(s.TBoolean(l))return`${y}${d.PatternBoolean}`;throw s.TNever(l)?Error("TemplateLiteralPattern: TemplateLiteral cannot operate on types of TNever"):Error(`TemplateLiteralPattern: Unexpected Kind '${l[d.Kind]}'`)}function g(l){return`^${l.map(y=>c(y,"")).join("")}$`}i.Create=g})(ut=d.TemplateLiteralPattern||(d.TemplateLiteralPattern={}));var Le;(function(i){function r(c){let g=qn.ParseExact(c.pattern);if(!_n.Check(g))return d.Type.String();let l=[...Hn.Generate(g)].map(y=>d.Type.Literal(y));return d.Type.Union(l)}i.Resolve=r})(Le=d.TemplateLiteralResolver||(d.TemplateLiteralResolver={}));var ze=class extends Error{constructor(r){super(r)}};d.TemplateLiteralParserError=ze;var qn;(function(i){function r(j){return j.replace(/\\/g,"")}function c(j,M,V){return j[M]===V&&j.charCodeAt(M-1)!==92}function g(j,M){return c(j,M,"(")}function l(j,M){return c(j,M,")")}function y(j,M){return c(j,M,"|")}function m(j){if(!(g(j,0)&&l(j,j.length-1)))return!1;let M=0;for(let V=0;V<j.length;V++)if(g(j,V)&&(M+=1),l(j,V)&&(M-=1),M===0&&V!==j.length-1)return!1;return!0}function a(j){return j.slice(1,j.length-1)}function x(j){let M=0;for(let V=0;V<j.length;V++)if(g(j,V)&&(M+=1),l(j,V)&&(M-=1),y(j,V)&&M===0)return!0;return!1}function S(j){for(let M=0;M<j.length;M++)if(g(j,M))return!0;return!1}function N(j){let[M,V]=[0,0],z=[];for(let W=0;W<j.length;W++)if(g(j,W)&&(M+=1),l(j,W)&&(M-=1),y(j,W)&&M===0){let Z=j.slice(V,W);Z.length>0&&z.push(U(Z)),V=W+1}let D=j.slice(V);return D.length>0&&z.push(U(D)),z.length===0?{type:"const",const:""}:z.length===1?z[0]:{type:"or",expr:z}}function L(j){function M(D,W){if(!g(D,W))throw new ze("TemplateLiteralParser: Index must point to open parens");let Z=0;for(let v=W;v<D.length;v++)if(g(D,v)&&(Z+=1),l(D,v)&&(Z-=1),Z===0)return[W,v];throw new ze("TemplateLiteralParser: Unclosed group parens in expression")}function V(D,W){for(let Z=W;Z<D.length;Z++)if(g(D,Z))return[W,Z];return[W,D.length]}let z=[];for(let D=0;D<j.length;D++)if(g(j,D)){let[W,Z]=M(j,D),v=j.slice(W,Z+1);z.push(U(v)),D=Z}else{let[W,Z]=V(j,D),v=j.slice(W,Z);v.length>0&&z.push(U(v)),D=Z-1}return z.length===0?{type:"const",const:""}:z.length===1?z[0]:{type:"and",expr:z}}function U(j){return m(j)?U(a(j)):x(j)?N(j):S(j)?L(j):{type:"const",const:r(j)}}i.Parse=U;function $(j){return U(j.slice(1,j.length-1))}i.ParseExact=$})(qn=d.TemplateLiteralParser||(d.TemplateLiteralParser={}));var _n;(function(i){function r(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 c(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 g(y){return y.type==="const"&&y.const===".*"}function l(y){if(c(y))return!0;if(r(y)||g(y))return!1;if(y.type==="and")return y.expr.every(m=>l(m));if(y.type==="or")return y.expr.every(m=>l(m));if(y.type==="const")return!0;throw Error("TemplateLiteralFinite: Unknown expression type")}i.Check=l})(_n=d.TemplateLiteralFinite||(d.TemplateLiteralFinite={}));var Hn;(function(i){function*r(m){if(m.length===1)return yield*m[0];for(let a of m[0])for(let x of r(m.slice(1)))yield`${a}${x}`}function*c(m){return yield*r(m.expr.map(a=>[...y(a)]))}function*g(m){for(let a of m.expr)yield*y(a)}function*l(m){return yield m.const}function*y(m){if(m.type==="and")return yield*c(m);if(m.type==="or")return yield*g(m);if(m.type==="const")return yield*l(m);throw Error("TemplateLiteralGenerator: Unknown expression")}i.Generate=y})(Hn=d.TemplateLiteralGenerator||(d.TemplateLiteralGenerator={}));var Mt=0,fn=class{Create(r){return r}Strict(r){return JSON.parse(JSON.stringify(r))}};d.TypeBuilder=fn;var Qe=class extends fn{Optional(r){return{[d.Modifier]:"Optional",...H.Clone(r,{})}}ReadonlyOptional(r){return{[d.Modifier]:"ReadonlyOptional",...H.Clone(r,{})}}Readonly(r){return{[d.Modifier]:"Readonly",...r}}Any(r={}){return this.Create({...r,[d.Kind]:"Any"})}Array(r,c={}){return this.Create({...c,[d.Kind]:"Array",type:"array",items:H.Clone(r,{})})}Boolean(r={}){return this.Create({...r,[d.Kind]:"Boolean",type:"boolean"})}Composite(r,c){let g=(x,S)=>x.every(N=>!(S in N.properties)||l(N.properties[S])),l=x=>s.TOptional(x)||s.TReadonlyOptional(x),[y,m]=[new Set,new Set];for(let x of r)for(let S of globalThis.Object.getOwnPropertyNames(x.properties))g(r,S)&&m.add(S);for(let x of r)for(let S of globalThis.Object.getOwnPropertyNames(x.properties))m.has(S)||y.add(S);let a={};for(let x of r)for(let[S,N]of Object.entries(x.properties)){let L=H.Clone(N,{});if(m.has(S)||delete L[d.Modifier],S in a){let U=Ee.Extends(a[S],L)!==w.False,$=Ee.Extends(L,a[S])!==w.False;!U&&!$&&(a[S]=d.Type.Never()),!U&&$&&(a[S]=L)}else a[S]=L}return y.size>0?this.Create({...c,[d.Kind]:"Object",[d.Hint]:"Composite",type:"object",properties:a,required:[...y]}):this.Create({...c,[d.Kind]:"Object",[d.Hint]:"Composite",type:"object",properties:a})}Enum(r,c={}){let l=globalThis.Object.keys(r).filter(y=>isNaN(y)).map(y=>r[y]).map(y=>typeof y=="string"?{[d.Kind]:"Literal",type:"string",const:y}:{[d.Kind]:"Literal",type:"number",const:y});return this.Create({...c,[d.Kind]:"Union",anyOf:l})}Extends(r,c,g,l,y={}){switch(Ee.Extends(r,c)){case w.Union:return this.Union([H.Clone(g,y),H.Clone(l,y)]);case w.True:return H.Clone(g,y);case w.False:return H.Clone(l,y)}}Exclude(r,c,g={}){if(s.TTemplateLiteral(r))return this.Exclude(Le.Resolve(r),c,g);if(s.TTemplateLiteral(c))return this.Exclude(r,Le.Resolve(c),g);if(s.TUnion(r)){let l=r.anyOf.filter(y=>Ee.Extends(y,c)===w.False);return l.length===1?H.Clone(l[0],g):this.Union(l,g)}else return Ee.Extends(r,c)!==w.False?this.Never(g):H.Clone(r,g)}Extract(r,c,g={}){if(s.TTemplateLiteral(r))return this.Extract(Le.Resolve(r),c,g);if(s.TTemplateLiteral(c))return this.Extract(r,Le.Resolve(c),g);if(s.TUnion(r)){let l=r.anyOf.filter(y=>Ee.Extends(y,c)!==w.False);return l.length===1?H.Clone(l[0],g):this.Union(l,g)}else return Ee.Extends(r,c)!==w.False?H.Clone(r,g):this.Never(g)}Integer(r={}){return this.Create({...r,[d.Kind]:"Integer",type:"integer"})}Intersect(r,c={}){if(r.length===0)return d.Type.Never();if(r.length===1)return H.Clone(r[0],c);let g=r.every(m=>s.TObject(m)),l=r.map(m=>H.Clone(m,{})),y=s.TSchema(c.unevaluatedProperties)?{unevaluatedProperties:H.Clone(c.unevaluatedProperties,{})}:{};return c.unevaluatedProperties===!1||s.TSchema(c.unevaluatedProperties)||g?this.Create({...c,...y,[d.Kind]:"Intersect",type:"object",allOf:l}):this.Create({...c,...y,[d.Kind]:"Intersect",allOf:l})}KeyOf(r,c={}){if(s.TRecord(r)){let g=Object.getOwnPropertyNames(r.patternProperties)[0];if(g===d.PatternNumberExact)return this.Number(c);if(g===d.PatternStringExact)return this.String(c);throw Error("StandardTypeBuilder: Unable to resolve key type from Record key pattern")}else{let g=ot.Resolve(r);if(g.length===0)return this.Never(c);let l=g.map(y=>this.Literal(y));return this.Union(l,c)}}Literal(r,c={}){return this.Create({...c,[d.Kind]:"Literal",const:r,type:typeof r})}Never(r={}){return this.Create({...r,[d.Kind]:"Never",not:{}})}Not(r,c,g){return this.Create({...g,[d.Kind]:"Not",allOf:[{not:H.Clone(r,{})},H.Clone(c,{})]})}Null(r={}){return this.Create({...r,[d.Kind]:"Null",type:"null"})}Number(r={}){return this.Create({...r,[d.Kind]:"Number",type:"number"})}Object(r,c={}){let g=globalThis.Object.getOwnPropertyNames(r),l=g.filter(x=>s.TOptional(r[x])||s.TReadonlyOptional(r[x])),y=g.filter(x=>!l.includes(x)),m=s.TSchema(c.additionalProperties)?{additionalProperties:H.Clone(c.additionalProperties,{})}:{},a=g.reduce((x,S)=>({...x,[S]:H.Clone(r[S],{})}),{});return y.length>0?this.Create({...c,...m,[d.Kind]:"Object",type:"object",properties:a,required:y}):this.Create({...c,...m,[d.Kind]:"Object",type:"object",properties:a})}Omit(r,c,g={}){let l=s.TUnionLiteral(c)?c.anyOf.map(y=>y.const):s.TLiteral(c)?[c.const]:s.TNever(c)?[]:c;return Ze.Map(H.Clone(r,{}),y=>{y.required&&(y.required=y.required.filter(m=>!l.includes(m)),y.required.length===0&&delete y.required);for(let m of globalThis.Object.keys(y.properties))l.includes(m)&&delete y.properties[m];return this.Create(y)},g)}Partial(r,c={}){function g(l){switch(l[d.Modifier]){case"ReadonlyOptional":l[d.Modifier]="ReadonlyOptional";break;case"Readonly":l[d.Modifier]="ReadonlyOptional";break;case"Optional":l[d.Modifier]="Optional";break;default:l[d.Modifier]="Optional";break}}return Ze.Map(H.Clone(r,{}),l=>(delete l.required,globalThis.Object.keys(l.properties).forEach(y=>g(l.properties[y])),l),c)}Pick(r,c,g={}){let l=s.TUnionLiteral(c)?c.anyOf.map(y=>y.const):s.TLiteral(c)?[c.const]:s.TNever(c)?[]:c;return Ze.Map(H.Clone(r,{}),y=>{y.required&&(y.required=y.required.filter(m=>l.includes(m)),y.required.length===0&&delete y.required);for(let m of globalThis.Object.keys(y.properties))l.includes(m)||delete y.properties[m];return this.Create(y)},g)}Record(r,c,g={}){if(s.TTemplateLiteral(r)){let l=qn.ParseExact(r.pattern);return _n.Check(l)?this.Object([...Hn.Generate(l)].reduce((y,m)=>({...y,[m]:H.Clone(c,{})}),{}),g):this.Create({...g,[d.Kind]:"Record",type:"object",patternProperties:{[r.pattern]:H.Clone(c,{})},additionalProperties:!1})}else if(s.TUnionLiteral(r))if(r.anyOf.every(l=>s.TLiteral(l)&&(typeof l.const=="string"||typeof l.const=="number"))){let l=r.anyOf.reduce((y,m)=>({...y,[m.const]:H.Clone(c,{})}),{});return this.Object(l,{...g,[d.Hint]:"Record"})}else throw Error("TypeBuilder: Record key can only be derived from union literal of number or string");else if(s.TLiteral(r)){if(typeof r.const=="string"||typeof r.const=="number")return this.Object({[r.const]:H.Clone(c,{})},g);throw Error("TypeBuilder: Record key can only be derived from literals of number or string")}else if(s.TInteger(r)||s.TNumber(r)){let l=d.PatternNumberExact;return this.Create({...g,[d.Kind]:"Record",type:"object",patternProperties:{[l]:H.Clone(c,{})},additionalProperties:!1})}else if(s.TString(r)){let l=r.pattern===void 0?d.PatternStringExact:r.pattern;return this.Create({...g,[d.Kind]:"Record",type:"object",patternProperties:{[l]:H.Clone(c,{})},additionalProperties:!1})}else throw Error("StandardTypeBuilder: Invalid Record Key")}Recursive(r,c={}){c.$id===void 0&&(c.$id=`T${Mt++}`);let g=r({[d.Kind]:"This",$ref:`${c.$id}`});return g.$id=c.$id,this.Create({...c,...g})}Ref(r,c={}){if(r.$id===void 0)throw Error("StandardTypeBuilder.Ref: Target type must specify an $id");return this.Create({...c,[d.Kind]:"Ref",$ref:r.$id})}Required(r,c={}){function g(l){switch(l[d.Modifier]){case"ReadonlyOptional":l[d.Modifier]="Readonly";break;case"Readonly":l[d.Modifier]="Readonly";break;case"Optional":delete l[d.Modifier];break;default:delete l[d.Modifier];break}}return Ze.Map(H.Clone(r,{}),l=>(l.required=globalThis.Object.keys(l.properties),globalThis.Object.keys(l.properties).forEach(y=>g(l.properties[y])),l),c)}String(r={}){return this.Create({...r,[d.Kind]:"String",type:"string"})}TemplateLiteral(r,c={}){let g=ut.Create(r);return this.Create({...c,[d.Kind]:"TemplateLiteral",type:"string",pattern:g})}Tuple(r,c={}){let[g,l,y]=[!1,r.length,r.length],m=r.map(x=>H.Clone(x,{})),a=r.length>0?{...c,[d.Kind]:"Tuple",type:"array",items:m,additionalItems:g,minItems:l,maxItems:y}:{...c,[d.Kind]:"Tuple",type:"array",minItems:l,maxItems:y};return this.Create(a)}Union(r,c={}){if(s.TTemplateLiteral(r))return Le.Resolve(r);{let g=r;if(g.length===0)return this.Never(c);if(g.length===1)return this.Create(H.Clone(g[0],c));let l=g.map(y=>H.Clone(y,{}));return this.Create({...c,[d.Kind]:"Union",anyOf:l})}}Unknown(r={}){return this.Create({...r,[d.Kind]:"Unknown"})}Unsafe(r={}){return this.Create({...r,[d.Kind]:r[d.Kind]||"Unsafe"})}};d.StandardTypeBuilder=Qe;var ln=class extends Qe{BigInt(r={}){return this.Create({...r,[d.Kind]:"BigInt",type:"null",typeOf:"BigInt"})}ConstructorParameters(r,c={}){return this.Tuple([...r.parameters],{...c})}Constructor(r,c,g={}){let l=H.Clone(c,{});if(s.TTuple(r)){let y=r.items===void 0?[]:r.items.map(m=>H.Clone(m,{}));return this.Create({...g,[d.Kind]:"Constructor",type:"object",instanceOf:"Constructor",parameters:y,returns:l})}else if(globalThis.Array.isArray(r)){let y=r.map(m=>H.Clone(m,{}));return this.Create({...g,[d.Kind]:"Constructor",type:"object",instanceOf:"Constructor",parameters:y,returns:l})}else throw new Error("ExtendedTypeBuilder.Constructor: Invalid parameters")}Date(r={}){return this.Create({...r,[d.Kind]:"Date",type:"object",instanceOf:"Date"})}Function(r,c,g={}){let l=H.Clone(c,{});if(s.TTuple(r)){let y=r.items===void 0?[]:r.items.map(m=>H.Clone(m,{}));return this.Create({...g,[d.Kind]:"Function",type:"object",instanceOf:"Function",parameters:y,returns:l})}else if(globalThis.Array.isArray(r)){let y=r.map(m=>H.Clone(m,{}));return this.Create({...g,[d.Kind]:"Function",type:"object",instanceOf:"Function",parameters:y,returns:l})}else throw new Error("ExtendedTypeBuilder.Function: Invalid parameters")}InstanceType(r,c={}){return H.Clone(r.returns,c)}Parameters(r,c={}){return this.Tuple(r.parameters,{...c})}Promise(r,c={}){return this.Create({...c,[d.Kind]:"Promise",type:"object",instanceOf:"Promise",item:H.Clone(r,{})})}RegEx(r,c={}){return this.Create({...c,[d.Kind]:"String",type:"string",pattern:r.source})}ReturnType(r,c={}){return H.Clone(r.returns,c)}Symbol(r){return this.Create({...r,[d.Kind]:"Symbol",type:"null",typeOf:"Symbol"})}Undefined(r={}){return this.Create({...r,[d.Kind]:"Undefined",type:"null",typeOf:"Undefined"})}Uint8Array(r={}){return this.Create({...r,[d.Kind]:"Uint8Array",type:"object",instanceOf:"Uint8Array"})}Void(r={}){return this.Create({...r,[d.Kind]:"Void",type:"null",typeOf:"Void"})}};d.ExtendedTypeBuilder=ln;d.StandardType=new Qe;d.Type=new ln});var st=le(Ae=>{"use strict";Object.defineProperty(Ae,"__esModule",{value:!0});Ae.TypeSystem=Ae.TypeSystemDuplicateFormat=Ae.TypeSystemDuplicateTypeKind=void 0;var _e=Ue(),cn=class extends Error{constructor(r){super(`Duplicate type kind '${r}' detected`)}};Ae.TypeSystemDuplicateTypeKind=cn;var an=class extends Error{constructor(r){super(`Duplicate string format '${r}' detected`)}};Ae.TypeSystemDuplicateFormat=an;var Rt;(function(i){i.ExactOptionalPropertyTypes=!1,i.AllowArrayObjects=!1,i.AllowNaN=!1,i.AllowVoidNull=!1;function r(y,m){if(_e.TypeRegistry.Has(y))throw new cn(y);return _e.TypeRegistry.Set(y,m),(a={})=>_e.Type.Unsafe({...a,[_e.Kind]:y})}i.Type=r;function c(y,m){if(_e.FormatRegistry.Has(y))throw new an(y);return _e.FormatRegistry.Set(y,m),y}i.Format=c;function g(y,m){return r(y,m)}i.CreateType=g;function l(y,m){return c(y,m)}i.CreateFormat=l})(Rt=Ae.TypeSystem||(Ae.TypeSystem={}))});var dn=le(Ve=>{"use strict";var kt=Ve&&Ve.__createBinding||(Object.create?function(i,r,c,g){g===void 0&&(g=c);var l=Object.getOwnPropertyDescriptor(r,c);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[c]}}),Object.defineProperty(i,g,l)}:function(i,r,c,g){g===void 0&&(g=c),i[g]=r[c]}),Et=Ve&&Ve.__exportStar||function(i,r){for(var c in i)c!=="default"&&!Object.prototype.hasOwnProperty.call(r,c)&&kt(r,i,c)};Object.defineProperty(Ve,"__esModule",{value:!0});Et(st(),Ve)});var We=le(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});Be.ValueHash=Be.ValueHashError=void 0;var yn=class extends Error{constructor(r){super("Hash: Unable to hash value"),this.value=r}};Be.ValueHashError=yn;var Lt;(function(i){let r;(function(b){b[b.Undefined=0]="Undefined",b[b.Null=1]="Null",b[b.Boolean=2]="Boolean",b[b.Number=3]="Number",b[b.String=4]="String",b[b.Object=5]="Object",b[b.Array=6]="Array",b[b.Date=7]="Date",b[b.Uint8Array=8]="Uint8Array",b[b.Symbol=9]="Symbol",b[b.BigInt=10]="BigInt"})(r||(r={}));let c=globalThis.BigInt("14695981039346656037"),[g,l]=[globalThis.BigInt("1099511628211"),globalThis.BigInt("2")**globalThis.BigInt("64")],y=globalThis.Array.from({length:256}).map((b,k)=>globalThis.BigInt(k)),m=new globalThis.Float64Array(1),a=new globalThis.DataView(m.buffer),x=new globalThis.Uint8Array(m.buffer);function S(b){return b instanceof globalThis.Date}function N(b){return b instanceof globalThis.Uint8Array}function L(b){return globalThis.Array.isArray(b)}function U(b){return typeof b=="boolean"}function $(b){return b===null}function j(b){return typeof b=="number"}function M(b){return typeof b=="symbol"}function V(b){return typeof b=="bigint"}function z(b){return typeof b=="object"&&b!==null&&!L(b)&&!S(b)&&!N(b)}function D(b){return typeof b=="string"}function W(b){return b===void 0}function Z(b){X(r.Array);for(let k of b)h(k)}function v(b){X(r.Boolean),X(b?1:0)}function ce(b){X(r.BigInt),a.setBigInt64(0,b);for(let k of x)X(k)}function ae(b){X(r.Date),h(b.getTime())}function de(b){X(r.Null)}function q(b){X(r.Number),a.setFloat64(0,b);for(let k of x)X(k)}function se(b){X(r.Object);for(let k of globalThis.Object.keys(b).sort())h(k),h(b[k])}function ye(b){X(r.String);for(let k=0;k<b.length;k++)X(b.charCodeAt(k))}function fe(b){X(r.Symbol),h(b.description)}function pe(b){X(r.Uint8Array);for(let k=0;k<b.length;k++)X(b[k])}function be(b){return X(r.Undefined)}function h(b){if(L(b))Z(b);else if(U(b))v(b);else if(V(b))ce(b);else if(S(b))ae(b);else if($(b))de(b);else if(j(b))q(b);else if(z(b))se(b);else if(D(b))ye(b);else if(M(b))fe(b);else if(N(b))pe(b);else if(W(b))be(b);else throw new yn(b)}function X(b){c=c^y[b],c=c*g%l}function C(b){return c=globalThis.BigInt("14695981039346656037"),h(b),c}i.Create=C})(Lt=Be.ValueHash||(Be.ValueHash={}))});var ft=le(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.ValueErrors=xe.ValueErrorsDereferenceError=xe.ValueErrorsUnknownTypeError=xe.ValueErrorIterator=xe.ValueErrorType=void 0;var je=Ue(),pn=dn(),Kt=We(),B;(function(i){i[i.Array=0]="Array",i[i.ArrayMinItems=1]="ArrayMinItems",i[i.ArrayMaxItems=2]="ArrayMaxItems",i[i.ArrayUniqueItems=3]="ArrayUniqueItems",i[i.BigInt=4]="BigInt",i[i.BigIntMultipleOf=5]="BigIntMultipleOf",i[i.BigIntExclusiveMinimum=6]="BigIntExclusiveMinimum",i[i.BigIntExclusiveMaximum=7]="BigIntExclusiveMaximum",i[i.BigIntMinimum=8]="BigIntMinimum",i[i.BigIntMaximum=9]="BigIntMaximum",i[i.Boolean=10]="Boolean",i[i.Date=11]="Date",i[i.DateExclusiveMinimumTimestamp=12]="DateExclusiveMinimumTimestamp",i[i.DateExclusiveMaximumTimestamp=13]="DateExclusiveMaximumTimestamp",i[i.DateMinimumTimestamp=14]="DateMinimumTimestamp",i[i.DateMaximumTimestamp=15]="DateMaximumTimestamp",i[i.Function=16]="Function",i[i.Integer=17]="Integer",i[i.IntegerMultipleOf=18]="IntegerMultipleOf",i[i.IntegerExclusiveMinimum=19]="IntegerExclusiveMinimum",i[i.IntegerExclusiveMaximum=20]="IntegerExclusiveMaximum",i[i.IntegerMinimum=21]="IntegerMinimum",i[i.IntegerMaximum=22]="IntegerMaximum",i[i.Intersect=23]="Intersect",i[i.IntersectUnevaluatedProperties=24]="IntersectUnevaluatedProperties",i[i.Literal=25]="Literal",i[i.Never=26]="Never",i[i.Not=27]="Not",i[i.Null=28]="Null",i[i.Number=29]="Number",i[i.NumberMultipleOf=30]="NumberMultipleOf",i[i.NumberExclusiveMinimum=31]="NumberExclusiveMinimum",i[i.NumberExclusiveMaximum=32]="NumberExclusiveMaximum",i[i.NumberMinumum=33]="NumberMinumum",i[i.NumberMaximum=34]="NumberMaximum",i[i.Object=35]="Object",i[i.ObjectMinProperties=36]="ObjectMinProperties",i[i.ObjectMaxProperties=37]="ObjectMaxProperties",i[i.ObjectAdditionalProperties=38]="ObjectAdditionalProperties",i[i.ObjectRequiredProperties=39]="ObjectRequiredProperties",i[i.Promise=40]="Promise",i[i.RecordKeyNumeric=41]="RecordKeyNumeric",i[i.RecordKeyString=42]="RecordKeyString",i[i.String=43]="String",i[i.StringMinLength=44]="StringMinLength",i[i.StringMaxLength=45]="StringMaxLength",i[i.StringPattern=46]="StringPattern",i[i.StringFormatUnknown=47]="StringFormatUnknown",i[i.StringFormat=48]="StringFormat",i[i.Symbol=49]="Symbol",i[i.TupleZeroLength=50]="TupleZeroLength",i[i.TupleLength=51]="TupleLength",i[i.Undefined=52]="Undefined",i[i.Union=53]="Union",i[i.Uint8Array=54]="Uint8Array",i[i.Uint8ArrayMinByteLength=55]="Uint8ArrayMinByteLength",i[i.Uint8ArrayMaxByteLength=56]="Uint8ArrayMaxByteLength",i[i.Void=57]="Void",i[i.Custom=58]="Custom"})(B=xe.ValueErrorType||(xe.ValueErrorType={}));var Tn=class{constructor(r){this.iterator=r}[Symbol.iterator](){return this.iterator}First(){let r=this.iterator.next();return r.done?void 0:r.value}};xe.ValueErrorIterator=Tn;var bn=class extends Error{constructor(r){super("ValueErrors: Unknown type"),this.schema=r}};xe.ValueErrorsUnknownTypeError=bn;var Je=class extends Error{constructor(r){super(`ValueErrors: Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};xe.ValueErrorsDereferenceError=Je;var Vt;(function(i){function r(n){return typeof n=="bigint"}function c(n){return globalThis.Number.isInteger(n)}function g(n){return typeof n=="string"}function l(n){return n!==void 0}function y(n,I){return pn.TypeSystem.ExactOptionalPropertyTypes?I in n:n[I]!==void 0}function m(n){let I=typeof n=="object"&&n!==null;return pn.TypeSystem.AllowArrayObjects?I:I&&!globalThis.Array.isArray(n)}function a(n){return m(n)&&!(n instanceof globalThis.Date)&&!(n instanceof globalThis.Uint8Array)}function x(n){let I=typeof n=="number";return pn.TypeSystem.AllowNaN?I:I&&globalThis.Number.isFinite(n)}function S(n){let I=n===void 0;return pn.TypeSystem.AllowVoidNull?I||n===null:I}function*N(n,I,u,f){}function*L(n,I,u,f){if(!globalThis.Array.isArray(f))return yield{type:B.Array,schema:n,path:u,value:f,message:"Expected array"};l(n.minItems)&&!(f.length>=n.minItems)&&(yield{type:B.ArrayMinItems,schema:n,path:u,value:f,message:`Expected array length to be greater or equal to ${n.minItems}`}),l(n.maxItems)&&!(f.length<=n.maxItems)&&(yield{type:B.ArrayMinItems,schema:n,path:u,value:f,message:`Expected array length to be less or equal to ${n.maxItems}`}),n.uniqueItems===!0&&!function(){let P=new Set;for(let E of f){let J=Kt.ValueHash.Create(E);if(P.has(J))return!1;P.add(J)}return!0}()&&(yield{type:B.ArrayUniqueItems,schema:n,path:u,value:f,message:"Expected array elements to be unique"});for(let P=0;P<f.length;P++)yield*R(n.items,I,`${u}/${P}`,f[P])}function*U(n,I,u,f){if(!r(f))return yield{type:B.BigInt,schema:n,path:u,value:f,message:"Expected bigint"};l(n.multipleOf)&&f%n.multipleOf!==globalThis.BigInt(0)&&(yield{type:B.BigIntMultipleOf,schema:n,path:u,value:f,message:`Expected bigint to be a multiple of ${n.multipleOf}`}),l(n.exclusiveMinimum)&&!(f>n.exclusiveMinimum)&&(yield{type:B.BigIntExclusiveMinimum,schema:n,path:u,value:f,message:`Expected bigint to be greater than ${n.exclusiveMinimum}`}),l(n.exclusiveMaximum)&&!(f<n.exclusiveMaximum)&&(yield{type:B.BigIntExclusiveMaximum,schema:n,path:u,value:f,message:`Expected bigint to be less than ${n.exclusiveMaximum}`}),l(n.minimum)&&!(f>=n.minimum)&&(yield{type:B.BigIntMinimum,schema:n,path:u,value:f,message:`Expected bigint to be greater or equal to ${n.minimum}`}),l(n.maximum)&&!(f<=n.maximum)&&(yield{type:B.BigIntMaximum,schema:n,path:u,value:f,message:`Expected bigint to be less or equal to ${n.maximum}`})}function*$(n,I,u,f){if(typeof f!="boolean")return yield{type:B.Boolean,schema:n,path:u,value:f,message:"Expected boolean"}}function*j(n,I,u,f){yield*R(n.returns,I,u,f.prototype)}function*M(n,I,u,f){if(!(f instanceof globalThis.Date))return yield{type:B.Date,schema:n,path:u,value:f,message:"Expected Date object"};if(!globalThis.isFinite(f.getTime()))return yield{type:B.Date,schema:n,path:u,value:f,message:"Invalid Date"};l(n.exclusiveMinimumTimestamp)&&!(f.getTime()>n.exclusiveMinimumTimestamp)&&(yield{type:B.DateExclusiveMinimumTimestamp,schema:n,path:u,value:f,message:`Expected Date timestamp to be greater than ${n.exclusiveMinimum}`}),l(n.exclusiveMaximumTimestamp)&&!(f.getTime()<n.exclusiveMaximumTimestamp)&&(yield{type:B.DateExclusiveMaximumTimestamp,schema:n,path:u,value:f,message:`Expected Date timestamp to be less than ${n.exclusiveMaximum}`}),l(n.minimumTimestamp)&&!(f.getTime()>=n.minimumTimestamp)&&(yield{type:B.DateMinimumTimestamp,schema:n,path:u,value:f,message:`Expected Date timestamp to be greater or equal to ${n.minimum}`}),l(n.maximumTimestamp)&&!(f.getTime()<=n.maximumTimestamp)&&(yield{type:B.DateMaximumTimestamp,schema:n,path:u,value:f,message:`Expected Date timestamp to be less or equal to ${n.maximum}`})}function*V(n,I,u,f){if(typeof f!="function")return yield{type:B.Function,schema:n,path:u,value:f,message:"Expected function"}}function*z(n,I,u,f){if(!c(f))return yield{type:B.Integer,schema:n,path:u,value:f,message:"Expected integer"};l(n.multipleOf)&&f%n.multipleOf!==0&&(yield{type:B.IntegerMultipleOf,schema:n,path:u,value:f,message:`Expected integer to be a multiple of ${n.multipleOf}`}),l(n.exclusiveMinimum)&&!(f>n.exclusiveMinimum)&&(yield{type:B.IntegerExclusiveMinimum,schema:n,path:u,value:f,message:`Expected integer to be greater than ${n.exclusiveMinimum}`}),l(n.exclusiveMaximum)&&!(f<n.exclusiveMaximum)&&(yield{type:B.IntegerExclusiveMaximum,schema:n,path:u,value:f,message:`Expected integer to be less than ${n.exclusiveMaximum}`}),l(n.minimum)&&!(f>=n.minimum)&&(yield{type:B.IntegerMinimum,schema:n,path:u,value:f,message:`Expected integer to be greater or equal to ${n.minimum}`}),l(n.maximum)&&!(f<=n.maximum)&&(yield{type:B.IntegerMaximum,schema:n,path:u,value:f,message:`Expected integer to be less or equal to ${n.maximum}`})}function*D(n,I,u,f){for(let P of n.allOf){let E=R(P,I,u,f).next();if(!E.done){yield E.value,yield{type:B.Intersect,schema:n,path:u,value:f,message:"Expected all sub schemas to be valid"};return}}if(n.unevaluatedProperties===!1){let P=je.KeyResolver.Resolve(n),E=globalThis.Object.getOwnPropertyNames(f);for(let J of E)P.includes(J)||(yield{type:B.IntersectUnevaluatedProperties,schema:n,path:`${u}/${J}`,value:f,message:"Unexpected property"})}if(typeof n.unevaluatedProperties=="object"){let P=je.KeyResolver.Resolve(n),E=globalThis.Object.getOwnPropertyNames(f);for(let J of E)if(!P.includes(J)){let Q=R(n.unevaluatedProperties,I,`${u}/${J}`,f[J]).next();if(!Q.done){yield Q.value,yield{type:B.IntersectUnevaluatedProperties,schema:n,path:`${u}/${J}`,value:f,message:"Invalid additional property"};return}}}}function*W(n,I,u,f){if(f!==n.const){let P=typeof n.const=="string"?`'${n.const}'`:n.const;return yield{type:B.Literal,schema:n,path:u,value:f,message:`Expected ${P}`}}}function*Z(n,I,u,f){yield{type:B.Never,schema:n,path:u,value:f,message:"Value cannot be validated"}}function*v(n,I,u,f){R(n.allOf[0].not,I,u,f).next().done===!0&&(yield{type:B.Not,schema:n,path:u,value:f,message:"Value should not validate"}),yield*R(n.allOf[1],I,u,f)}function*ce(n,I,u,f){if(f!==null)return yield{type:B.Null,schema:n,path:u,value:f,message:"Expected null"}}function*ae(n,I,u,f){if(!x(f))return yield{type:B.Number,schema:n,path:u,value:f,message:"Expected number"};l(n.multipleOf)&&f%n.multipleOf!==0&&(yield{type:B.NumberMultipleOf,schema:n,path:u,value:f,message:`Expected number to be a multiple of ${n.multipleOf}`}),l(n.exclusiveMinimum)&&!(f>n.exclusiveMinimum)&&(yield{type:B.NumberExclusiveMinimum,schema:n,path:u,value:f,message:`Expected number to be greater than ${n.exclusiveMinimum}`}),l(n.exclusiveMaximum)&&!(f<n.exclusiveMaximum)&&(yield{type:B.NumberExclusiveMaximum,schema:n,path:u,value:f,message:`Expected number to be less than ${n.exclusiveMaximum}`}),l(n.minimum)&&!(f>=n.minimum)&&(yield{type:B.NumberMaximum,schema:n,path:u,value:f,message:`Expected number to be greater or equal to ${n.minimum}`}),l(n.maximum)&&!(f<=n.maximum)&&(yield{type:B.NumberMinumum,schema:n,path:u,value:f,message:`Expected number to be less or equal to ${n.maximum}`})}function*de(n,I,u,f){if(!m(f))return yield{type:B.Object,schema:n,path:u,value:f,message:"Expected object"};l(n.minProperties)&&!(globalThis.Object.getOwnPropertyNames(f).length>=n.minProperties)&&(yield{type:B.ObjectMinProperties,schema:n,path:u,value:f,message:`Expected object to have at least ${n.minProperties} properties`}),l(n.maxProperties)&&!(globalThis.Object.getOwnPropertyNames(f).length<=n.maxProperties)&&(yield{type:B.ObjectMaxProperties,schema:n,path:u,value:f,message:`Expected object to have less than ${n.minProperties} properties`});let P=globalThis.Array.isArray(n.required)?n.required:[],E=globalThis.Object.getOwnPropertyNames(n.properties),J=globalThis.Object.getOwnPropertyNames(f);for(let Q of E){let Ie=n.properties[Q];n.required&&n.required.includes(Q)?(yield*R(Ie,I,`${u}/${Q}`,f[Q]),je.ExtendsUndefined.Check(n)&&!(Q in f)&&(yield{type:B.ObjectRequiredProperties,schema:Ie,path:`${u}/${Q}`,value:void 0,message:"Expected required property"})):y(f,Q)&&(yield*R(Ie,I,`${u}/${Q}`,f[Q]))}for(let Q of P)J.includes(Q)||(yield{type:B.ObjectRequiredProperties,schema:n.properties[Q],path:`${u}/${Q}`,value:void 0,message:"Expected required property"});if(n.additionalProperties===!1)for(let Q of J)E.includes(Q)||(yield{type:B.ObjectAdditionalProperties,schema:n,path:`${u}/${Q}`,value:f[Q],message:"Unexpected property"});if(typeof n.additionalProperties=="object")for(let Q of J)E.includes(Q)||(yield*R(n.additionalProperties,I,`${u}/${Q}`,f[Q]))}function*q(n,I,u,f){typeof f=="object"&&typeof f.then=="function"||(yield{type:B.Promise,schema:n,path:u,value:f,message:"Expected Promise"})}function*se(n,I,u,f){if(!a(f))return yield{type:B.Object,schema:n,path:u,value:f,message:"Expected record object"};l(n.minProperties)&&!(globalThis.Object.getOwnPropertyNames(f).length>=n.minProperties)&&(yield{type:B.ObjectMinProperties,schema:n,path:u,value:f,message:`Expected object to have at least ${n.minProperties} properties`}),l(n.maxProperties)&&!(globalThis.Object.getOwnPropertyNames(f).length<=n.maxProperties)&&(yield{type:B.ObjectMaxProperties,schema:n,path:u,value:f,message:`Expected object to have less than ${n.minProperties} properties`});let[P,E]=globalThis.Object.entries(n.patternProperties)[0],J=new RegExp(P);if(!globalThis.Object.getOwnPropertyNames(f).every(Q=>J.test(Q))){let Q=P===je.PatternNumberExact;return yield{type:Q?B.RecordKeyNumeric:B.RecordKeyString,schema:n,path:u,value:f,message:Q?"Expected all object property keys to be numeric":"Expected all object property keys to be strings"}}for(let[Q,Ie]of globalThis.Object.entries(f))yield*R(E,I,`${u}/${Q}`,Ie)}function*ye(n,I,u,f){let P=I.findIndex(J=>J.$id===n.$ref);if(P===-1)throw new Je(n);let E=I[P];yield*R(E,I,u,f)}function*fe(n,I,u,f){if(!g(f))return yield{type:B.String,schema:n,path:u,value:f,message:"Expected string"};l(n.minLength)&&!(f.length>=n.minLength)&&(yield{type:B.StringMinLength,schema:n,path:u,value:f,message:`Expected string length greater or equal to ${n.minLength}`}),l(n.maxLength)&&!(f.length<=n.maxLength)&&(yield{type:B.StringMaxLength,schema:n,path:u,value:f,message:`Expected string length less or equal to ${n.maxLength}`}),n.pattern!==void 0&&(new RegExp(n.pattern).test(f)||(yield{type:B.StringPattern,schema:n,path:u,value:f,message:`Expected string to match pattern ${n.pattern}`})),n.format!==void 0&&(je.FormatRegistry.Has(n.format)?je.FormatRegistry.Get(n.format)(f)||(yield{type:B.StringFormat,schema:n,path:u,value:f,message:`Expected string to match format '${n.format}'`}):yield{type:B.StringFormatUnknown,schema:n,path:u,value:f,message:`Unknown string format '${n.format}'`})}function*pe(n,I,u,f){if(typeof f!="symbol")return yield{type:B.Symbol,schema:n,path:u,value:f,message:"Expected symbol"}}function*be(n,I,u,f){if(!g(f))return yield{type:B.String,schema:n,path:u,value:f,message:"Expected string"};new RegExp(n.pattern).test(f)||(yield{type:B.StringPattern,schema:n,path:u,value:f,message:`Expected string to match pattern ${n.pattern}`})}function*h(n,I,u,f){let P=I.findIndex(J=>J.$id===n.$ref);if(P===-1)throw new Je(n);let E=I[P];yield*R(E,I,u,f)}function*X(n,I,u,f){if(!globalThis.Array.isArray(f))return yield{type:B.Array,schema:n,path:u,value:f,message:"Expected Array"};if(n.items===void 0&&f.length!==0)return yield{type:B.TupleZeroLength,schema:n,path:u,value:f,message:"Expected tuple to have 0 elements"};if(f.length!==n.maxItems&&(yield{type:B.TupleLength,schema:n,path:u,value:f,message:`Expected tuple to have ${n.maxItems} elements`}),!!n.items)for(let P=0;P<n.items.length;P++)yield*R(n.items[P],I,`${u}/${P}`,f[P])}function*C(n,I,u,f){f!==void 0&&(yield{type:B.Undefined,schema:n,path:u,value:f,message:"Expected undefined"})}function*b(n,I,u,f){let P=[];for(let E of n.anyOf){let J=[...R(E,I,u,f)];if(J.length===0)return;P.push(...J)}P.length>0&&(yield{type:B.Union,schema:n,path:u,value:f,message:"Expected value of union"});for(let E of P)yield E}function*k(n,I,u,f){if(!(f instanceof globalThis.Uint8Array))return yield{type:B.Uint8Array,schema:n,path:u,value:f,message:"Expected Uint8Array"};l(n.maxByteLength)&&!(f.length<=n.maxByteLength)&&(yield{type:B.Uint8ArrayMaxByteLength,schema:n,path:u,value:f,message:`Expected Uint8Array to have a byte length less or equal to ${n.maxByteLength}`}),l(n.minByteLength)&&!(f.length>=n.minByteLength)&&(yield{type:B.Uint8ArrayMinByteLength,schema:n,path:u,value:f,message:`Expected Uint8Array to have a byte length greater or equal to ${n.maxByteLength}`})}function*T(n,I,u,f){}function*A(n,I,u,f){if(!S(f))return yield{type:B.Void,schema:n,path:u,value:f,message:"Expected void"}}function*O(n,I,u,f){if(!je.TypeRegistry.Get(n[je.Kind])(n,f))return yield{type:B.Custom,schema:n,path:u,value:f,message:`Expected kind ${n[je.Kind]}`}}function*R(n,I,u,f){let P=l(n.$id)?[...I,n]:I,E=n;switch(E[je.Kind]){case"Any":return yield*N(E,P,u,f);case"Array":return yield*L(E,P,u,f);case"BigInt":return yield*U(E,P,u,f);case"Boolean":return yield*$(E,P,u,f);case"Constructor":return yield*j(E,P,u,f);case"Date":return yield*M(E,P,u,f);case"Function":return yield*V(E,P,u,f);case"Integer":return yield*z(E,P,u,f);case"Intersect":return yield*D(E,P,u,f);case"Literal":return yield*W(E,P,u,f);case"Never":return yield*Z(E,P,u,f);case"Not":return yield*v(E,P,u,f);case"Null":return yield*ce(E,P,u,f);case"Number":return yield*ae(E,P,u,f);case"Object":return yield*de(E,P,u,f);case"Promise":return yield*q(E,P,u,f);case"Record":return yield*se(E,P,u,f);case"Ref":return yield*ye(E,P,u,f);case"String":return yield*fe(E,P,u,f);case"Symbol":return yield*pe(E,P,u,f);case"TemplateLiteral":return yield*be(E,P,u,f);case"This":return yield*h(E,P,u,f);case"Tuple":return yield*X(E,P,u,f);case"Undefined":return yield*C(E,P,u,f);case"Union":return yield*b(E,P,u,f);case"Uint8Array":return yield*k(E,P,u,f);case"Unknown":return yield*T(E,P,u,f);case"Void":return yield*A(E,P,u,f);default:if(!je.TypeRegistry.Has(E[je.Kind]))throw new bn(n);return yield*O(E,P,u,f)}}function F(n,I,u){let f=R(n,I,"",u);return new Tn(f)}i.Errors=F})(Vt=xe.ValueErrors||(xe.ValueErrors={}))});var Zn=le(Fe=>{"use strict";var Bt=Fe&&Fe.__createBinding||(Object.create?function(i,r,c,g){g===void 0&&(g=c);var l=Object.getOwnPropertyDescriptor(r,c);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[c]}}),Object.defineProperty(i,g,l)}:function(i,r,c,g){g===void 0&&(g=c),i[g]=r[c]}),Ft=Fe&&Fe.__exportStar||function(i,r){for(var c in i)c!=="default"&&!Object.prototype.hasOwnProperty.call(r,c)&&Bt(r,i,c)};Object.defineProperty(Fe,"__esModule",{value:!0});Ft(ft(),Fe)});var Ye=le(Xe=>{"use strict";Object.defineProperty(Xe,"__esModule",{value:!0});Xe.Is=void 0;var Dt;(function(i){function r(m){return m!==null&&typeof m=="object"&&!globalThis.Array.isArray(m)&&!ArrayBuffer.isView(m)&&!(m instanceof globalThis.Date)}i.Object=r;function c(m){return m instanceof globalThis.Date}i.Date=c;function g(m){return globalThis.Array.isArray(m)&&!ArrayBuffer.isView(m)}i.Array=g;function l(m){return m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="bigint"||typeof m=="number"||typeof m=="boolean"||typeof m=="string"}i.Value=l;function y(m){return ArrayBuffer.isView(m)}i.TypedArray=y})(Dt=Xe.Is||(Xe.Is={}))});var He=le(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.ValueClone=void 0;var Ge=Ye(),qt;(function(i){function r(a){return a.map(x=>m(x))}function c(a){return new globalThis.Date(a.toISOString())}function g(a){return[...globalThis.Object.keys(a),...globalThis.Object.getOwnPropertySymbols(a)].reduce((S,N)=>({...S,[N]:m(a[N])}),{})}function l(a){return a.slice()}function y(a){return a}function m(a){if(Ge.Is.Date(a))return c(a);if(Ge.Is.Object(a))return g(a);if(Ge.Is.Array(a))return r(a);if(Ge.Is.TypedArray(a))return l(a);if(Ge.Is.Value(a))return a;throw new Error("ValueClone: Unable to clone value")}i.Clone=m})(qt=ve.ValueClone||(ve.ValueClone={}))});var On=le(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.ValuePointer=Ne.ValuePointerRootDeleteError=Ne.ValuePointerRootSetError=void 0;var mn=class extends Error{constructor(r,c,g){super("ValuePointer: Cannot set root value"),this.value=r,this.path=c,this.update=g}};Ne.ValuePointerRootSetError=mn;var gn=class extends Error{constructor(r,c){super("ValuePointer: Cannot delete root value"),this.value=r,this.path=c}};Ne.ValuePointerRootDeleteError=gn;var _t;(function(i){function r(a){return a.indexOf("~")===-1?a:a.replace(/~1/g,"/").replace(/~0/g,"~")}function*c(a){if(a==="")return;let[x,S]=[0,0];for(let N=0;N<a.length;N++)a.charAt(N)==="/"?(N===0||(S=N,yield r(a.slice(x,S))),x=N+1):S=N;yield r(a.slice(x))}i.Format=c;function g(a,x,S){if(x==="")throw new mn(a,x,S);let[N,L,U]=[null,a,""];for(let $ of c(x))L[$]===void 0&&(L[$]={}),N=L,L=L[$],U=$;N[U]=S}i.Set=g;function l(a,x){if(x==="")throw new gn(a,x);let[S,N,L]=[null,a,""];for(let U of c(x)){if(N[U]===void 0||N[U]===null)return;S=N,N=N[U],L=U}if(globalThis.Array.isArray(S)){let U=parseInt(L);S.splice(U,1)}else delete S[L]}i.Delete=l;function y(a,x){if(x==="")return!0;let[S,N,L]=[null,a,""];for(let U of c(x)){if(N[U]===void 0)return!1;S=N,N=N[U],L=U}return globalThis.Object.getOwnPropertyNames(S).includes(L)}i.Has=y;function m(a,x){if(x==="")return a;let S=a;for(let N of c(x)){if(S[N]===void 0)return;S=S[N]}return S}i.Get=m})(_t=Ne.ValuePointer||(Ne.ValuePointer={}))});var Wn=le(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.ValueDelta=ue.ValueDeltaUnableToDiffUnknownValue=ue.ValueDeltaObjectWithSymbolKeyError=ue.Edit=ue.Delete=ue.Update=ue.Insert=void 0;var we=Ue(),De=Ye(),zn=He(),Qn=On();ue.Insert=we.Type.Object({type:we.Type.Literal("insert"),path:we.Type.String(),value:we.Type.Unknown()});ue.Update=we.Type.Object({type:we.Type.Literal("update"),path:we.Type.String(),value:we.Type.Unknown()});ue.Delete=we.Type.Object({type:we.Type.Literal("delete"),path:we.Type.String()});ue.Edit=we.Type.Union([ue.Insert,ue.Update,ue.Delete]);var qe=class extends Error{constructor(r){super("ValueDelta: Cannot diff objects with symbol keys"),this.key=r}};ue.ValueDeltaObjectWithSymbolKeyError=qe;var Cn=class extends Error{constructor(r){super("ValueDelta: Unable to create diff edits for unknown value"),this.value=r}};ue.ValueDeltaUnableToDiffUnknownValue=Cn;var Ht;(function(i){function r($,j){return{type:"update",path:$,value:j}}function c($,j){return{type:"insert",path:$,value:j}}function g($){return{type:"delete",path:$}}function*l($,j,M){if(!De.Is.Object(M))return yield r($,M);let V=[...globalThis.Object.keys(j),...globalThis.Object.getOwnPropertySymbols(j)],z=[...globalThis.Object.keys(M),...globalThis.Object.getOwnPropertySymbols(M)];for(let D of V){if(typeof D=="symbol")throw new qe(D);M[D]===void 0&&z.includes(D)&&(yield r(`${$}/${String(D)}`,void 0))}for(let D of z)if(!(j[D]===void 0||M[D]===void 0)){if(typeof D=="symbol")throw new qe(D);yield*x(`${$}/${String(D)}`,j[D],M[D])}for(let D of z){if(typeof D=="symbol")throw new qe(D);j[D]===void 0&&(yield c(`${$}/${String(D)}`,M[D]))}for(let D of V.reverse()){if(typeof D=="symbol")throw new qe(D);M[D]===void 0&&!z.includes(D)&&(yield g(`${$}/${String(D)}`))}}function*y($,j,M){if(!De.Is.Array(M))return yield r($,M);for(let V=0;V<Math.min(j.length,M.length);V++)yield*x(`${$}/${V}`,j[V],M[V]);for(let V=0;V<M.length;V++)V<j.length||(yield c(`${$}/${V}`,M[V]));for(let V=j.length-1;V>=0;V--)V<M.length||(yield g(`${$}/${V}`))}function*m($,j,M){if(!De.Is.TypedArray(M)||j.length!==M.length||globalThis.Object.getPrototypeOf(j).constructor.name!==globalThis.Object.getPrototypeOf(M).constructor.name)return yield r($,M);for(let V=0;V<Math.min(j.length,M.length);V++)yield*x(`${$}/${V}`,j[V],M[V])}function*a($,j,M){j!==M&&(yield r($,M))}function*x($,j,M){if(De.Is.Object(j))return yield*l($,j,M);if(De.Is.Array(j))return yield*y($,j,M);if(De.Is.TypedArray(j))return yield*m($,j,M);if(De.Is.Value(j))return yield*a($,j,M);throw new Cn(j)}function S($,j){return[...x("",$,j)]}i.Diff=S;function N($){return $.length>0&&$[0].path===""&&$[0].type==="update"}function L($){return $.length===0}function U($,j){if(N(j))return zn.ValueClone.Clone(j[0].value);if(L(j))return zn.ValueClone.Clone($);let M=zn.ValueClone.Clone($);for(let V of j)switch(V.type){case"insert":{Qn.ValuePointer.Set(M,V.path,V.value);break}case"update":{Qn.ValuePointer.Set(M,V.path,V.value);break}case"delete":{Qn.ValuePointer.Delete(M,V.path);break}}return M}i.Patch=U})(Ht=ue.ValueDelta||(ue.ValueDelta={}))});var lt=le(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.ValueMutate=Se.ValueMutateInvalidRootMutationError=Se.ValueMutateTypeMismatchError=void 0;var me=Ye(),xn=On(),Jn=He(),In=class extends Error{constructor(){super("ValueMutate: Cannot assign due type mismatch of assignable values")}};Se.ValueMutateTypeMismatchError=In;var jn=class extends Error{constructor(){super("ValueMutate: Only object and array types can be mutated at the root level")}};Se.ValueMutateInvalidRootMutationError=jn;var Zt;(function(i){function r(a,x,S,N){if(!me.Is.Object(S))xn.ValuePointer.Set(a,x,Jn.ValueClone.Clone(N));else{let L=globalThis.Object.keys(S),U=globalThis.Object.keys(N);for(let $ of L)U.includes($)||delete S[$];for(let $ of U)L.includes($)||(S[$]=null);for(let $ of U)y(a,`${x}/${$}`,S[$],N[$])}}function c(a,x,S,N){if(!me.Is.Array(S))xn.ValuePointer.Set(a,x,Jn.ValueClone.Clone(N));else{for(let L=0;L<N.length;L++)y(a,`${x}/${L}`,S[L],N[L]);S.splice(N.length)}}function g(a,x,S,N){if(me.Is.TypedArray(S)&&S.length===N.length)for(let L=0;L<S.length;L++)S[L]=N[L];else xn.ValuePointer.Set(a,x,Jn.ValueClone.Clone(N))}function l(a,x,S,N){S!==N&&xn.ValuePointer.Set(a,x,N)}function y(a,x,S,N){if(me.Is.Array(N))return c(a,x,S,N);if(me.Is.TypedArray(N))return g(a,x,S,N);if(me.Is.Object(N))return r(a,x,S,N);if(me.Is.Value(N))return l(a,x,S,N)}function m(a,x){if(me.Is.TypedArray(a)||me.Is.Value(a)||me.Is.TypedArray(x)||me.Is.Value(x))throw new jn;if(me.Is.Object(a)&&me.Is.Array(x)||me.Is.Array(a)&&me.Is.Object(x))throw new In;y(a,"",a,x)}i.Mutate=m})(Zt=Se.ValueMutate||(Se.ValueMutate={}))});var ct=le(he=>{"use strict";Object.defineProperty(he,"__esModule",{value:!0});he.ValueEqual=void 0;var $e=Ye(),zt;(function(i){function r(a,x){if(!$e.Is.Object(x))return!1;let S=[...globalThis.Object.keys(a),...globalThis.Object.getOwnPropertySymbols(a)],N=[...globalThis.Object.keys(x),...globalThis.Object.getOwnPropertySymbols(x)];return S.length!==N.length?!1:S.every(L=>m(a[L],x[L]))}function c(a,x){return $e.Is.Date(x)&&a.getTime()===x.getTime()}function g(a,x){return!$e.Is.Array(x)||a.length!==x.length?!1:a.every((S,N)=>m(S,x[N]))}function l(a,x){return!$e.Is.TypedArray(x)||a.length!==x.length||globalThis.Object.getPrototypeOf(a).constructor.name!==globalThis.Object.getPrototypeOf(x).constructor.name?!1:a.every((S,N)=>m(S,x[N]))}function y(a,x){return a===x}function m(a,x){if($e.Is.Object(a))return r(a,x);if($e.Is.Date(a))return c(a,x);if($e.Is.TypedArray(a))return l(a,x);if($e.Is.Array(a))return g(a,x);if($e.Is.Value(a))return y(a,x);throw new Error("ValueEquals: Unable to compare value")}i.Equal=m})(zt=he.ValueEqual||(he.ValueEqual={}))});var nn=le(Me=>{"use strict";Object.defineProperty(Me,"__esModule",{value:!0});Me.ValueCheck=Me.ValueCheckDereferenceError=Me.ValueCheckUnknownTypeError=void 0;var ge=Ue(),wn=dn(),Qt=We(),Pn=class extends Error{constructor(r){super(`ValueCheck: ${r[ge.Kind]?`Unknown type '${r[ge.Kind]}'`:"Unknown type"}`),this.schema=r}};Me.ValueCheckUnknownTypeError=Pn;var en=class extends Error{constructor(r){super(`ValueCheck: Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};Me.ValueCheckDereferenceError=en;var Wt;(function(i){function r(n){return typeof n=="bigint"}function c(n){return globalThis.Number.isInteger(n)}function g(n){return typeof n=="string"}function l(n){return n!==void 0}function y(n,I){return wn.TypeSystem.ExactOptionalPropertyTypes?I in n:n[I]!==void 0}function m(n){let I=typeof n=="object"&&n!==null;return wn.TypeSystem.AllowArrayObjects?I:I&&!globalThis.Array.isArray(n)}function a(n){return m(n)&&!(n instanceof globalThis.Date)&&!(n instanceof globalThis.Uint8Array)}function x(n){let I=typeof n=="number";return wn.TypeSystem.AllowNaN?I:I&&globalThis.Number.isFinite(n)}function S(n){let I=n===void 0;return wn.TypeSystem.AllowVoidNull?I||n===null:I}function N(n,I,u){return!0}function L(n,I,u){return!globalThis.Array.isArray(u)||l(n.minItems)&&!(u.length>=n.minItems)||l(n.maxItems)&&!(u.length<=n.maxItems)||n.uniqueItems===!0&&!function(){let f=new Set;for(let P of u){let E=Qt.ValueHash.Create(P);if(f.has(E))return!1;f.add(E)}return!0}()?!1:u.every(f=>R(n.items,I,f))}function U(n,I,u){return!(!r(u)||l(n.multipleOf)&&u%n.multipleOf!==globalThis.BigInt(0)||l(n.exclusiveMinimum)&&!(u>n.exclusiveMinimum)||l(n.exclusiveMaximum)&&!(u<n.exclusiveMaximum)||l(n.minimum)&&!(u>=n.minimum)||l(n.maximum)&&!(u<=n.maximum))}function $(n,I,u){return typeof u=="boolean"}function j(n,I,u){return R(n.returns,I,u.prototype)}function M(n,I,u){return!(!(u instanceof globalThis.Date)||!x(u.getTime())||l(n.exclusiveMinimumTimestamp)&&!(u.getTime()>n.exclusiveMinimumTimestamp)||l(n.exclusiveMaximumTimestamp)&&!(u.getTime()<n.exclusiveMaximumTimestamp)||l(n.minimumTimestamp)&&!(u.getTime()>=n.minimumTimestamp)||l(n.maximumTimestamp)&&!(u.getTime()<=n.maximumTimestamp))}function V(n,I,u){return typeof u=="function"}function z(n,I,u){return!(!c(u)||l(n.multipleOf)&&u%n.multipleOf!==0||l(n.exclusiveMinimum)&&!(u>n.exclusiveMinimum)||l(n.exclusiveMaximum)&&!(u<n.exclusiveMaximum)||l(n.minimum)&&!(u>=n.minimum)||l(n.maximum)&&!(u<=n.maximum))}function D(n,I,u){if(n.allOf.every(f=>R(f,I,u)))if(n.unevaluatedProperties===!1){let f=ge.KeyResolver.Resolve(n);return globalThis.Object.getOwnPropertyNames(u).every(E=>f.includes(E))}else if(ge.TypeGuard.TSchema(n.unevaluatedProperties)){let f=ge.KeyResolver.Resolve(n);return globalThis.Object.getOwnPropertyNames(u).every(E=>f.includes(E)||R(n.unevaluatedProperties,I,u[E]))}else return!0;else return!1}function W(n,I,u){return u===n.const}function Z(n,I,u){return!1}function v(n,I,u){return!R(n.allOf[0].not,I,u)&&R(n.allOf[1],I,u)}function ce(n,I,u){return u===null}function ae(n,I,u){return!(!x(u)||l(n.multipleOf)&&u%n.multipleOf!==0||l(n.exclusiveMinimum)&&!(u>n.exclusiveMinimum)||l(n.exclusiveMaximum)&&!(u<n.exclusiveMaximum)||l(n.minimum)&&!(u>=n.minimum)||l(n.maximum)&&!(u<=n.maximum))}function de(n,I,u){if(!m(u)||l(n.minProperties)&&!(globalThis.Object.getOwnPropertyNames(u).length>=n.minProperties)||l(n.maxProperties)&&!(globalThis.Object.getOwnPropertyNames(u).length<=n.maxProperties))return!1;let f=globalThis.Object.getOwnPropertyNames(n.properties);for(let P of f){let E=n.properties[P];if(n.required&&n.required.includes(P)){if(!R(E,I,u[P]))return!1;if(ge.ExtendsUndefined.Check(E))return P in u}else if(y(u,P)&&!R(E,I,u[P]))return!1}if(n.additionalProperties===!1){let P=globalThis.Object.getOwnPropertyNames(u);return n.required&&n.required.length===f.length&&P.length===f.length?!0:P.every(E=>f.includes(E))}else return typeof n.additionalProperties=="object"?globalThis.Object.getOwnPropertyNames(u).every(E=>f.includes(E)||R(n.additionalProperties,I,u[E])):!0}function q(n,I,u){return typeof u=="object"&&typeof u.then=="function"}function se(n,I,u){if(!a(u)||l(n.minProperties)&&!(globalThis.Object.getOwnPropertyNames(u).length>=n.minProperties)||l(n.maxProperties)&&!(globalThis.Object.getOwnPropertyNames(u).length<=n.maxProperties))return!1;let[f,P]=globalThis.Object.entries(n.patternProperties)[0],E=new RegExp(f);if(!globalThis.Object.getOwnPropertyNames(u).every(J=>E.test(J)))return!1;for(let J of globalThis.Object.values(u))if(!R(P,I,J))return!1;return!0}function ye(n,I,u){let f=I.findIndex(E=>E.$id===n.$ref);if(f===-1)throw new en(n);let P=I[f];return R(P,I,u)}function fe(n,I,u){return!g(u)||l(n.minLength)&&!(u.length>=n.minLength)||l(n.maxLength)&&!(u.length<=n.maxLength)||l(n.pattern)&&!new RegExp(n.pattern).test(u)?!1:l(n.format)?ge.FormatRegistry.Has(n.format)?ge.FormatRegistry.Get(n.format)(u):!1:!0}function pe(n,I,u){return typeof u=="symbol"}function be(n,I,u){return g(u)?new RegExp(n.pattern).test(u):!1}function h(n,I,u){let f=I.findIndex(E=>E.$id===n.$ref);if(f===-1)throw new en(n);let P=I[f];return R(P,I,u)}function X(n,I,u){if(!globalThis.Array.isArray(u)||n.items===void 0&&u.length!==0||u.length!==n.maxItems)return!1;if(!n.items)return!0;for(let f=0;f<n.items.length;f++)if(!R(n.items[f],I,u[f]))return!1;return!0}function C(n,I,u){return u===void 0}function b(n,I,u){return n.anyOf.some(f=>R(f,I,u))}function k(n,I,u){return!(!(u instanceof globalThis.Uint8Array)||l(n.maxByteLength)&&!(u.length<=n.maxByteLength)||l(n.minByteLength)&&!(u.length>=n.minByteLength))}function T(n,I,u){return!0}function A(n,I,u){return S(u)}function O(n,I,u){return ge.TypeRegistry.Has(n[ge.Kind])?ge.TypeRegistry.Get(n[ge.Kind])(n,u):!1}function R(n,I,u){let f=l(n.$id)?[...I,n]:I,P=n;switch(P[ge.Kind]){case"Any":return N(P,f,u);case"Array":return L(P,f,u);case"BigInt":return U(P,f,u);case"Boolean":return $(P,f,u);case"Constructor":return j(P,f,u);case"Date":return M(P,f,u);case"Function":return V(P,f,u);case"Integer":return z(P,f,u);case"Intersect":return D(P,f,u);case"Literal":return W(P,f,u);case"Never":return Z(P,f,u);case"Not":return v(P,f,u);case"Null":return ce(P,f,u);case"Number":return ae(P,f,u);case"Object":return de(P,f,u);case"Promise":return q(P,f,u);case"Record":return se(P,f,u);case"Ref":return ye(P,f,u);case"String":return fe(P,f,u);case"Symbol":return pe(P,f,u);case"TemplateLiteral":return be(P,f,u);case"This":return h(P,f,u);case"Tuple":return X(P,f,u);case"Undefined":return C(P,f,u);case"Union":return b(P,f,u);case"Uint8Array":return k(P,f,u);case"Unknown":return T(P,f,u);case"Void":return A(P,f,u);default:if(!ge.TypeRegistry.Has(P[ge.Kind]))throw new Pn(P);return O(P,f,u)}}function F(n,I,u){return R(n,I,u)}i.Check=F})(Wt=Me.ValueCheck||(Me.ValueCheck={}))});var Xn=le(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.ValueCreate=Oe.ValueCreateDereferenceError=Oe.ValueCreateTempateLiteralTypeError=Oe.ValueCreateIntersectTypeError=Oe.ValueCreateNeverTypeError=Oe.ValueCreateUnknownTypeError=void 0;var Ke=Ue(),Jt=nn(),Un=class extends Error{constructor(r){super("ValueCreate: Unknown type"),this.schema=r}};Oe.ValueCreateUnknownTypeError=Un;var An=class extends Error{constructor(r){super("ValueCreate: Never types cannot be created"),this.schema=r}};Oe.ValueCreateNeverTypeError=An;var Nn=class extends Error{constructor(r){super("ValueCreate: Can only create values for intersected objects and non-varying primitive types. Consider using a default value."),this.schema=r}};Oe.ValueCreateIntersectTypeError=Nn;var Sn=class extends Error{constructor(r){super("ValueCreate: Can only create template literal values from patterns that produce finite sequences. Consider using a default value."),this.schema=r}};Oe.ValueCreateTempateLiteralTypeError=Sn;var tn=class extends Error{constructor(r){super(`ValueCreate: Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};Oe.ValueCreateDereferenceError=tn;var Xt;(function(i){function r(C){return typeof C=="string"}function c(C,b){return"default"in C?C.default:{}}function g(C,b){if(C.uniqueItems===!0&&C.default===void 0)throw new Error("ValueCreate.Array: Arrays with uniqueItems require a default value");return"default"in C?C.default:C.minItems!==void 0?globalThis.Array.from({length:C.minItems}).map(k=>i.Create(C.items,b)):[]}function l(C,b){return"default"in C?C.default:globalThis.BigInt(0)}function y(C,b){return"default"in C?C.default:!1}function m(C,b){if("default"in C)return C.default;{let k=i.Create(C.returns,b);return typeof k=="object"&&!globalThis.Array.isArray(k)?class{constructor(){for(let[T,A]of globalThis.Object.entries(k)){let O=this;O[T]=A}}}:class{}}}function a(C,b){return"default"in C?C.default:C.minimumTimestamp!==void 0?new globalThis.Date(C.minimumTimestamp):new globalThis.Date(0)}function x(C,b){return"default"in C?C.default:()=>i.Create(C.returns,b)}function S(C,b){return"default"in C?C.default:C.minimum!==void 0?C.minimum:0}function N(C,b){if("default"in C)return C.default;{let k=C.type==="object"?C.allOf.reduce((T,A)=>({...T,...h(A,b)}),{}):C.allOf.reduce((T,A)=>h(A,b),void 0);if(!Jt.ValueCheck.Check(C,b,k))throw new Nn(C);return k}}function L(C,b){return"default"in C?C.default:C.const}function U(C,b){throw new An(C)}function $(C,b){return"default"in C?C.default:h(C.allOf[1],b)}function j(C,b){return"default"in C?C.default:null}function M(C,b){return"default"in C?C.default:C.minimum!==void 0?C.minimum:0}function V(C,b){if("default"in C)return C.default;{let k=new Set(C.required);return C.default||globalThis.Object.entries(C.properties).reduce((T,[A,O])=>k.has(A)?{...T,[A]:i.Create(O,b)}:{...T},{})}}function z(C,b){return"default"in C?C.default:globalThis.Promise.resolve(i.Create(C.item,b))}function D(C,b){let[k,T]=globalThis.Object.entries(C.patternProperties)[0];return"default"in C?C.default:k===Ke.PatternStringExact||k===Ke.PatternNumberExact?{}:k.slice(1,k.length-1).split("|").reduce((O,R)=>({...O,[R]:X(T,b)}),{})}function W(C,b){if("default"in C)return C.default;{let k=b.findIndex(A=>A.$id===C.$id);if(k===-1)throw new tn(C);let T=b[k];return h(T,b)}}function Z(C,b){if(C.pattern!==void 0){if("default"in C)return C.default;throw new Error("ValueCreate.String: String types with patterns must specify a default value")}else if(C.format!==void 0){if("default"in C)return C.default;throw new Error("ValueCreate.String: String types with formats must specify a default value")}else return"default"in C?C.default:C.minLength!==void 0?globalThis.Array.from({length:C.minLength}).map(()=>".").join(""):""}function v(C,b){return"default"in C?C.default:"value"in C?globalThis.Symbol.for(C.value):globalThis.Symbol()}function ce(C,b){if("default"in C)return C.default;let k=Ke.TemplateLiteralParser.ParseExact(C.pattern);if(!Ke.TemplateLiteralFinite.Check(k))throw new Sn(C);return Ke.TemplateLiteralGenerator.Generate(k).next().value}function ae(C,b){if("default"in C)return C.default;{let k=b.findIndex(A=>A.$id===C.$id);if(k===-1)throw new tn(C);let T=b[k];return h(T,b)}}function de(C,b){return"default"in C?C.default:C.items===void 0?[]:globalThis.Array.from({length:C.minItems}).map((k,T)=>i.Create(C.items[T],b))}function q(C,b){if("default"in C)return C.default}function se(C,b){if("default"in C)return C.default;if(C.anyOf.length===0)throw new Error("ValueCreate.Union: Cannot create Union with zero variants");return i.Create(C.anyOf[0],b)}function ye(C,b){return"default"in C?C.default:C.minByteLength!==void 0?new globalThis.Uint8Array(C.minByteLength):new globalThis.Uint8Array(0)}function fe(C,b){return"default"in C?C.default:{}}function pe(C,b){if("default"in C)return C.default}function be(C,b){if("default"in C)return C.default;throw new Error("ValueCreate.UserDefined: User defined types must specify a default value")}function h(C,b){let k=r(C.$id)?[...b,C]:b,T=C;switch(T[Ke.Kind]){case"Any":return c(T,k);case"Array":return g(T,k);case"BigInt":return l(T,k);case"Boolean":return y(T,k);case"Constructor":return m(T,k);case"Date":return a(T,k);case"Function":return x(T,k);case"Integer":return S(T,k);case"Intersect":return N(T,k);case"Literal":return L(T,k);case"Never":return U(T,k);case"Not":return $(T,k);case"Null":return j(T,k);case"Number":return M(T,k);case"Object":return V(T,k);case"Promise":return z(T,k);case"Record":return D(T,k);case"Ref":return W(T,k);case"String":return Z(T,k);case"Symbol":return v(T,k);case"TemplateLiteral":return ce(T,k);case"This":return ae(T,k);case"Tuple":return de(T,k);case"Undefined":return q(T,k);case"Union":return se(T,k);case"Uint8Array":return ye(T,k);case"Unknown":return fe(T,k);case"Void":return pe(T,k);default:if(!Ke.TypeRegistry.Has(T[Ke.Kind]))throw new Un(T);return be(T,k)}}i.Visit=h;function X(C,b){return h(C,b)}i.Create=X})(Xt=Oe.ValueCreate||(Oe.ValueCreate={}))});var dt=le(Te=>{"use strict";Object.defineProperty(Te,"__esModule",{value:!0});Te.ValueCast=Te.ValueCastDereferenceError=Te.ValueCastUnknownTypeError=Te.ValueCastRecursiveTypeError=Te.ValueCastNeverTypeError=Te.ValueCastArrayUniqueItemsTypeError=Te.ValueCastReferenceTypeError=void 0;var rn=Ue(),te=Xn(),G=nn(),Ce=He(),Yn=class extends Error{constructor(r){super(`ValueCast: Cannot locate referenced schema with $id '${r.$ref}'`),this.schema=r}};Te.ValueCastReferenceTypeError=Yn;var $n=class extends Error{constructor(r,c){super("ValueCast: Array cast produced invalid data due to uniqueItems constraint"),this.schema=r,this.value=c}};Te.ValueCastArrayUniqueItemsTypeError=$n;var Mn=class extends Error{constructor(r){super("ValueCast: Never types cannot be cast"),this.schema=r}};Te.ValueCastNeverTypeError=Mn;var Gn=class extends Error{constructor(r){super("ValueCast.Recursive: Cannot cast recursive schemas"),this.schema=r}};Te.ValueCastRecursiveTypeError=Gn;var Rn=class extends Error{constructor(r){super("ValueCast: Unknown type"),this.schema=r}};Te.ValueCastUnknownTypeError=Rn;var on=class extends Error{constructor(r){super(`ValueCast: Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};Te.ValueCastDereferenceError=on;var vn;(function(i){function r(l,y,m){if(l[rn.Kind]==="Object"&&typeof m=="object"&&m!==null){let a=l,x=Object.keys(m),S=globalThis.Object.entries(a.properties),[N,L]=[1/S.length,S.length];return S.reduce((U,[$,j])=>{let M=j[rn.Kind]==="Literal"&&j.const===m[$]?L:0,V=G.ValueCheck.Check(j,y,m[$])?N:0,z=x.includes($)?N:0;return U+(M+V+z)},0)}else return G.ValueCheck.Check(l,y,m)?1:0}function c(l,y,m){let[a,x]=[l.anyOf[0],0];for(let S of l.anyOf){let N=r(S,y,m);N>x&&(a=S,x=N)}return a}function g(l,y,m){if(l.default!==void 0)return l.default;{let a=c(l,y,m);return at.Cast(a,y,m)}}i.Create=g})(vn||(vn={}));var at;(function(i){function r(T){return typeof T=="object"&&T!==null&&!globalThis.Array.isArray(T)}function c(T){return typeof T=="object"&&globalThis.Array.isArray(T)}function g(T){return typeof T=="number"&&!isNaN(T)}function l(T){return typeof T=="string"}function y(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function m(T,A,O){if(G.ValueCheck.Check(T,A,O))return Ce.ValueClone.Clone(O);let R=c(O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A),F=g(T.minItems)&&R.length<T.minItems?[...R,...globalThis.Array.from({length:T.minItems-R.length},()=>null)]:R,I=(g(T.maxItems)&&F.length>T.maxItems?F.slice(0,T.maxItems):F).map(f=>b(T.items,A,f));if(T.uniqueItems!==!0)return I;let u=[...new Set(I)];if(!G.ValueCheck.Check(T,A,u))throw new $n(T,u);return u}function a(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function x(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function S(T,A,O){if(G.ValueCheck.Check(T,A,O))return te.ValueCreate.Create(T,A);let R=new Set(T.returns.required||[]),F=function(){};for(let[n,I]of globalThis.Object.entries(T.returns.properties))!R.has(n)&&O.prototype[n]===void 0||(F.prototype[n]=b(I,A,O.prototype[n]));return F}function N(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function L(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function U(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function $(T,A,O){let R=te.ValueCreate.Create(T,A),F=r(R)&&r(O)?{...R,...O}:O;return G.ValueCheck.Check(T,A,F)?F:te.ValueCreate.Create(T,A)}function j(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function M(T,A,O){throw new Mn(T)}function V(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T.allOf[1],A)}function z(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function D(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function W(T,A,O){if(G.ValueCheck.Check(T,A,O))return O;if(O===null||typeof O!="object")return te.ValueCreate.Create(T,A);let R=new Set(T.required||[]),F={};for(let[n,I]of globalThis.Object.entries(T.properties))!R.has(n)&&O[n]===void 0||(F[n]=b(I,A,O[n]));if(typeof T.additionalProperties=="object"){let n=globalThis.Object.getOwnPropertyNames(T.properties);for(let I of globalThis.Object.getOwnPropertyNames(O))n.includes(I)||(F[I]=b(T.additionalProperties,A,O[I]))}return F}function Z(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function v(T,A,O){if(G.ValueCheck.Check(T,A,O))return Ce.ValueClone.Clone(O);if(O===null||typeof O!="object"||globalThis.Array.isArray(O)||O instanceof globalThis.Date)return te.ValueCreate.Create(T,A);let R=globalThis.Object.getOwnPropertyNames(T.patternProperties)[0],F=T.patternProperties[R],n={};for(let[I,u]of globalThis.Object.entries(O))n[I]=b(F,A,u);return n}function ce(T,A,O){let R=A.findIndex(n=>n.$id===T.$ref);if(R===-1)throw new on(T);let F=A[R];return b(F,A,O)}function ae(T,A,O){return G.ValueCheck.Check(T,A,O)?O:te.ValueCreate.Create(T,A)}function de(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function q(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function se(T,A,O){let R=A.findIndex(n=>n.$id===T.$ref);if(R===-1)throw new on(T);let F=A[R];return b(F,A,O)}function ye(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):globalThis.Array.isArray(O)?T.items===void 0?[]:T.items.map((R,F)=>b(R,A,O[F])):te.ValueCreate.Create(T,A)}function fe(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function pe(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):vn.Create(T,A,O)}function be(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function h(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function X(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function C(T,A,O){return G.ValueCheck.Check(T,A,O)?Ce.ValueClone.Clone(O):te.ValueCreate.Create(T,A)}function b(T,A,O){let R=l(T.$id)?[...A,T]:A,F=T;switch(T[rn.Kind]){case"Any":return y(F,R,O);case"Array":return m(F,R,O);case"BigInt":return a(F,R,O);case"Boolean":return x(F,R,O);case"Constructor":return S(F,R,O);case"Date":return N(F,R,O);case"Function":return L(F,R,O);case"Integer":return U(F,R,O);case"Intersect":return $(F,R,O);case"Literal":return j(F,R,O);case"Never":return M(F,R,O);case"Not":return V(F,R,O);case"Null":return z(F,R,O);case"Number":return D(F,R,O);case"Object":return W(F,R,O);case"Promise":return Z(F,R,O);case"Record":return v(F,R,O);case"Ref":return ce(F,R,O);case"String":return ae(F,R,O);case"Symbol":return de(F,R,O);case"TemplateLiteral":return q(F,R,O);case"This":return se(F,R,O);case"Tuple":return ye(F,R,O);case"Undefined":return fe(F,R,O);case"Union":return pe(F,R,O);case"Uint8Array":return be(F,R,O);case"Unknown":return h(F,R,O);case"Void":return X(F,R,O);default:if(!rn.TypeRegistry.Has(F[rn.Kind]))throw new Rn(F);return C(F,R,O)}}i.Visit=b;function k(T,A,O){return b(T,A,Ce.ValueClone.Clone(O))}i.Cast=k})(at=Te.ValueCast||(Te.ValueCast={}))});var yt=le(Re=>{"use strict";Object.defineProperty(Re,"__esModule",{value:!0});Re.ValueConvert=Re.ValueConvertDereferenceError=Re.ValueConvertUnknownTypeError=void 0;var hn=Ue(),et=He(),Yt=nn(),kn=class extends Error{constructor(r){super("ValueConvert: Unknown type"),this.schema=r}};Re.ValueConvertUnknownTypeError=kn;var un=class extends Error{constructor(r){super(`ValueConvert: Unable to dereference schema with $id '${r.$ref}'`),this.schema=r}};Re.ValueConvertDereferenceError=un;var Gt;(function(i){function r(p){return typeof p=="object"&&p!==null&&!globalThis.Array.isArray(p)}function c(p){return typeof p=="object"&&globalThis.Array.isArray(p)}function g(p){return typeof p=="object"&&p instanceof globalThis.Date}function l(p){return typeof p=="symbol"}function y(p){return typeof p=="string"}function m(p){return typeof p=="boolean"}function a(p){return typeof p=="bigint"}function x(p){return typeof p=="number"&&!isNaN(p)}function S(p){return y(p)&&!isNaN(p)&&!isNaN(parseFloat(p))}function N(p){return a(p)||m(p)||x(p)}function L(p){return p===!0||x(p)&&p===1||a(p)&&p===globalThis.BigInt("1")||y(p)&&(p.toLowerCase()==="true"||p==="1")}function U(p){return p===!1||x(p)&&p===0||a(p)&&p===globalThis.BigInt("0")||y(p)&&(p.toLowerCase()==="false"||p==="0")}function $(p){return y(p)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(p)}function j(p){return y(p)&&/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(p)}function M(p){return y(p)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i.test(p)}function V(p){return y(p)&&/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)?$/i.test(p)}function z(p){return y(p)&&/^\d\d\d\d-[0-1]\d-[0-3]\d$/i.test(p)}function D(p,t){let e=de(p);return e===t?e:p}function W(p,t){let e=q(p);return e===t?e:p}function Z(p,t){let e=ce(p);return e===t?e:p}function v(p,t){return typeof p.const=="string"?D(t,p.const):typeof p.const=="number"?W(t,p.const):typeof p.const=="boolean"?Z(t,p.const):et.ValueClone.Clone(t)}function ce(p){return L(p)?!0:U(p)?!1:p}function ae(p){return S(p)?globalThis.BigInt(parseInt(p)):x(p)?globalThis.BigInt(p|0):U(p)?0:L(p)?1:p}function de(p){return N(p)?p.toString():l(p)&&p.description!==void 0?p.description.toString():p}function q(p){return S(p)?parseFloat(p):L(p)?1:U(p)?0:p}function se(p){return S(p)?parseInt(p):x(p)?p|0:L(p)?1:U(p)?0:p}function ye(p){return y(p)&&p.toLowerCase()==="null"?null:p}function fe(p){return y(p)&&p==="undefined"?void 0:p}function pe(p){return g(p)?p:x(p)?new globalThis.Date(p):L(p)?new globalThis.Date(1):U(p)?new globalThis.Date(0):S(p)?new globalThis.Date(parseInt(p)):j(p)?new globalThis.Date(`1970-01-01T${p}.000Z`):$(p)?new globalThis.Date(`1970-01-01T${p}`):V(p)?new globalThis.Date(`${p}.000Z`):M(p)?new globalThis.Date(p):z(p)?new globalThis.Date(`${p}T00:00:00.000Z`):p}function be(p,t,e){return e}function h(p,t,e){return c(e)?e.map(K=>Pe(p.items,t,K)):e}function X(p,t,e){return ae(e)}function C(p,t,e){return ce(e)}function b(p,t,e){return et.ValueClone.Clone(e)}function k(p,t,e){return pe(e)}function T(p,t,e){return e}function A(p,t,e){return se(e)}function O(p,t,e){return e}function R(p,t,e){return v(p,e)}function F(p,t,e){return e}function n(p,t,e){return ye(e)}function I(p,t,e){return q(e)}function u(p,t,e){return r(e)?globalThis.Object.keys(p.properties).reduce((K,_)=>e[_]!==void 0?{...K,[_]:Pe(p.properties[_],t,e[_])}:{...K},e):e}function f(p,t,e){return e}function P(p,t,e){let K=globalThis.Object.getOwnPropertyNames(p.patternProperties)[0],_=p.patternProperties[K],ke={};for(let[xt,It]of globalThis.Object.entries(e))ke[xt]=Pe(_,t,It);return ke}function E(p,t,e){let K=t.findIndex(ke=>ke.$id===p.$ref);if(K===-1)throw new un(p);let _=t[K];return Pe(_,t,e)}function J(p,t,e){return de(e)}function Q(p,t,e){return e}function Ie(p,t,e){return e}function oe(p,t,e){let K=t.findIndex(ke=>ke.$id===p.$ref);if(K===-1)throw new un(p);let _=t[K];return Pe(_,t,e)}function o(p,t,e){return c(e)&&p.items!==void 0?e.map((K,_)=>_<p.items.length?Pe(p.items[_],t,K):K):e}function ee(p,t,e){return fe(e)}function Y(p,t,e){for(let K of p.anyOf){let _=Pe(K,t,e);if(Yt.ValueCheck.Check(K,t,_))return _}return e}function Kn(p,t,e){return e}function ie(p,t,e){return e}function Vn(p,t,e){return e}function Bn(p,t,e){return e}function Pe(p,t,e){let K=y(p.$id)?[...t,p]:t,_=p;switch(p[hn.Kind]){case"Any":return be(_,K,e);case"Array":return h(_,K,e);case"BigInt":return X(_,K,e);case"Boolean":return C(_,K,e);case"Constructor":return b(_,K,e);case"Date":return k(_,K,e);case"Function":return T(_,K,e);case"Integer":return A(_,K,e);case"Intersect":return O(_,K,e);case"Literal":return R(_,K,e);case"Never":return F(_,K,e);case"Null":return n(_,K,e);case"Number":return I(_,K,e);case"Object":return u(_,K,e);case"Promise":return f(_,K,e);case"Record":return P(_,K,e);case"Ref":return E(_,K,e);case"String":return J(_,K,e);case"Symbol":return Q(_,K,e);case"TemplateLiteral":return Ie(_,K,e);case"This":return oe(_,K,e);case"Tuple":return o(_,K,e);case"Undefined":return ee(_,K,e);case"Union":return Y(_,K,e);case"Uint8Array":return Kn(_,K,e);case"Unknown":return ie(_,K,e);case"Void":return Vn(_,K,e);default:if(!hn.TypeRegistry.Has(_[hn.Kind]))throw new kn(_);return Bn(_,K,e)}}i.Visit=Pe;function ne(p,t,e){return Pe(p,t,et.ValueClone.Clone(e))}i.Convert=ne})(Gt=Re.ValueConvert||(Re.ValueConvert={}))});var Tt=le(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.Value=void 0;var vt=Zn(),ht=lt(),er=We(),nr=ct(),tr=dt(),rr=He(),ir=yt(),or=Xn(),ur=nn(),pt=Wn(),sr;(function(i){function r(...U){let[$,j,M]=U.length===3?[U[0],U[1],U[2]]:[U[0],[],U[1]];return tr.ValueCast.Cast($,j,M)}i.Cast=r;function c(...U){let[$,j]=U.length===2?[U[0],U[1]]:[U[0],[]];return or.ValueCreate.Create($,j)}i.Create=c;function g(...U){let[$,j,M]=U.length===3?[U[0],U[1],U[2]]:[U[0],[],U[1]];return ur.ValueCheck.Check($,j,M)}i.Check=g;function l(...U){let[$,j,M]=U.length===3?[U[0],U[1],U[2]]:[U[0],[],U[1]];return ir.ValueConvert.Convert($,j,M)}i.Convert=l;function y(U){return rr.ValueClone.Clone(U)}i.Clone=y;function m(...U){let[$,j,M]=U.length===3?[U[0],U[1],U[2]]:[U[0],[],U[1]];return vt.ValueErrors.Errors($,j,M)}i.Errors=m;function a(U,$){return nr.ValueEqual.Equal(U,$)}i.Equal=a;function x(U,$){return pt.ValueDelta.Diff(U,$)}i.Diff=x;function S(U){return er.ValueHash.Create(U)}i.Hash=S;function N(U,$){return pt.ValueDelta.Patch(U,$)}i.Patch=N;function L(U,$){ht.ValueMutate.Mutate(U,$)}i.Mutate=L})(sr=sn.Value||(sn.Value={}))});var gt=le(re=>{"use strict";var fr=re&&re.__createBinding||(Object.create?function(i,r,c,g){g===void 0&&(g=c);var l=Object.getOwnPropertyDescriptor(r,c);(!l||("get"in l?!r.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return r[c]}}),Object.defineProperty(i,g,l)}:function(i,r,c,g){g===void 0&&(g=c),i[g]=r[c]}),bt=re&&re.__exportStar||function(i,r){for(var c in i)c!=="default"&&!Object.prototype.hasOwnProperty.call(r,c)&&fr(r,i,c)};Object.defineProperty(re,"__esModule",{value:!0});re.Delete=re.Update=re.Insert=re.Edit=re.ValueHash=re.ValueErrorType=re.ValueErrorIterator=void 0;var mt=Zn();Object.defineProperty(re,"ValueErrorIterator",{enumerable:!0,get:function(){return mt.ValueErrorIterator}});Object.defineProperty(re,"ValueErrorType",{enumerable:!0,get:function(){return mt.ValueErrorType}});var lr=We();Object.defineProperty(re,"ValueHash",{enumerable:!0,get:function(){return lr.ValueHash}});var En=Wn();Object.defineProperty(re,"Edit",{enumerable:!0,get:function(){return En.Edit}});Object.defineProperty(re,"Insert",{enumerable:!0,get:function(){return En.Insert}});Object.defineProperty(re,"Update",{enumerable:!0,get:function(){return En.Update}});Object.defineProperty(re,"Delete",{enumerable:!0,get:function(){return En.Delete}});bt(On(),re);bt(Tt(),re)});import{useEffect as cr,useState as tt}from"react";var Ln=Fn(Ue(),1),Ot=Fn(dn(),1),Ct=Fn(gt(),1);var Hr=Ot.TypeSystem.Type("StringEnum",(i,r)=>typeof r=="string"&&i.values.includes(r));var Zr=Ln.Type.Tuple([Ln.Type.Number(),Ln.Type.String()]);function nt(i){return Object.fromEntries(Object.entries(i).map(([r,c])=>typeof c=="object"&&!(c instanceof Array)?[r,nt(c)]:[r,c[0]]))}var ar=i=>`http://localhost:3000/queryTriples?live=true&query=${encodeURIComponent(JSON.stringify(i))}`;function Gr(i,r){let[c,g]=tt(void 0),[l,y]=tt(!1),[m,a]=tt(!1),{selectStatements:x,whereStatements:S}=r,N=ar({collection:r.collection.collectionName,select:x,where:S,clientId:i.clientId});return cr(()=>{y(!0);let L=i.subscribe(r,U=>{y(!1);let $=new Map(Array.from(U.entries()).map(([j,M])=>[j,nt(M)]));g($)});return()=>{L()}},[N]),{fetchingLocal:l,fetchingRemote:m,results:c,error:null}}export{Gr as useQuery};
|
1
|
+
import{useEffect as y,useState as n}from"react";var m=e=>`http://localhost:3000/queryTriples?live=true&query=${encodeURIComponent(JSON.stringify(e))}`;function d(e,t){let[s,l]=n(void 0),[o,r]=n(!1),{selectStatements:c,whereStatements:i}=t,u=m({collection:t.collection.collectionName,select:c,where:i,clientId:e.clientId});return y(()=>{r(!0);let a=e.subscribe(t,f=>{r(!1),l(f)});return()=>{a()}},[u]),{fetchingLocal:o,results:s,error:null}}export{d as useQuery};
|
package/dist/use-query.d.ts
CHANGED
@@ -1,9 +1,6 @@
|
|
1
|
-
import { TriplitClient } from '@triplit/client';
|
2
|
-
|
3
|
-
import { TimestampedObject, UnTimestampedObject } from '@triplit/db/src/schema';
|
4
|
-
export declare function useQuery<CQ extends CollectionQuery<any>>(client: TriplitClient, collectionQuery: CQ): {
|
1
|
+
import { QueryResults, TriplitClient, CollectionQuery } from '@triplit/client';
|
2
|
+
export declare function useQuery<CQ extends CollectionQuery<any>>(client: TriplitClient<any>, collectionQuery: CQ): {
|
5
3
|
fetchingLocal: boolean;
|
6
|
-
|
7
|
-
|
8
|
-
error: any;
|
4
|
+
results: QueryResults<CQ> | undefined;
|
5
|
+
error: null;
|
9
6
|
};
|
package/package.json
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
{
|
2
2
|
"name": "@triplit/react",
|
3
3
|
"packageManager": "yarn@3.4.1",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.5",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
7
7
|
"type": "module",
|
8
8
|
"scripts": {
|
9
|
-
"build": "yarn build:code &&
|
9
|
+
"build": "yarn build:code && yarn build:types",
|
10
10
|
"build:code": "node build.cjs",
|
11
|
-
"build:types": "tsc --emitDeclarationOnly --declaration --outDir dist
|
11
|
+
"build:types": "tsc --noEmit false --emitDeclarationOnly --declaration --outDir dist",
|
12
|
+
"lint": "tsc",
|
12
13
|
"prepack": "node prepack.cjs"
|
13
14
|
},
|
14
15
|
"files": [
|
15
16
|
"/dist"
|
16
17
|
],
|
17
18
|
"dependencies": {
|
18
|
-
"@triplit/client": "^0.0.
|
19
|
+
"@triplit/client": "^0.0.5"
|
19
20
|
},
|
20
21
|
"devDependencies": {
|
21
22
|
"@types/react": "^18.2.0",
|