threenative-animation-mcp 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/app.js +2403 -1764
- package/dist/index.js +26 -18
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {realpathSync}from'fs';import {readdir,readFile,mkdir,writeFile,stat}from'fs/promises';import Gr from'path';import {fileURLToPath}from'url';import ey from'process';import {deflateSync}from'zlib';import {createServer}from'http';var yw=Object.defineProperty;var An=(t,e)=>{for(var r in e)yw(t,r,{get:e[r],enumerable:true});};var Sw=Object.create,oc=Object.defineProperty,xw=Object.getOwnPropertyDescriptor,bw=Object.getOwnPropertyNames,Tw=Object.getPrototypeOf,Rw=Object.prototype.hasOwnProperty,W=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),w0=(t,e)=>{let r={};for(var i in t)oc(r,i,{get:t[i],enumerable:true});return r},Ew=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=bw(e),s=0,o=n.length,a;s<o;s++)a=n[s],!Rw.call(t,a)&&a!==r&&oc(t,a,{get:(c=>e[c]).bind(null,a),enumerable:!(i=xw(e,a))||i.enumerable});return t},ac=(t,e,r)=>(r=t!=null?Sw(Tw(t)):{},Ew(oc(r,"default",{value:t,enumerable:true}),t));var ww=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),M0=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Mw=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Aw=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function A0(t){return typeof t=="string"&&M0.has(t.replace(/#$/,""))}function I0(t,e){if(!("$schema"in t)||typeof t.$schema!="string")return "2020-12";let r=t.$schema.replace(/#$/,"");if(ww.has(r))return "2020-12";if(M0.has(r))return "2019-09";if(Mw.has(r)||Aw.has(r))return "draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${t.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${e}`)}var B={};An(B,{$brand:()=>qh,$input:()=>pm,$output:()=>fm,NEVER:()=>fo,TimePrecision:()=>vm,ZodAny:()=>r_,ZodArray:()=>a_,ZodBase64:()=>zl,ZodBase64URL:()=>$l,ZodBigInt:()=>ls,ZodBigIntFormat:()=>Ll,ZodBoolean:()=>cs,ZodCIDRv4:()=>Nl,ZodCIDRv6:()=>Ol,ZodCUID:()=>El,ZodCUID2:()=>wl,ZodCatch:()=>M_,ZodCodec:()=>jo,ZodCustom:()=>Go,ZodCustomStringFormat:()=>os,ZodDate:()=>Uo,ZodDefault:()=>x_,ZodDiscriminatedUnion:()=>l_,ZodE164:()=>kl,ZodEmail:()=>xl,ZodEmoji:()=>Tl,ZodEnum:()=>rs,ZodError:()=>sI,ZodExactOptional:()=>v_,ZodFile:()=>g_,ZodFirstPartyTypeKind:()=>U_,ZodFunction:()=>k_,ZodGUID:()=>$o,ZodIPv4:()=>Cl,ZodIPv6:()=>Pl,ZodISODate:()=>ml,ZodISODateTime:()=>pl,ZodISODuration:()=>_l,ZodISOTime:()=>gl,ZodIntersection:()=>u_,ZodIssueCode:()=>F_,ZodJWT:()=>Dl,ZodKSUID:()=>Il,ZodLazy:()=>z_,ZodLiteral:()=>m_,ZodMAC:()=>Qg,ZodMap:()=>f_,ZodNaN:()=>I_,ZodNanoID:()=>Rl,ZodNever:()=>s_,ZodNonOptional:()=>jl,ZodNull:()=>n_,ZodNullable:()=>S_,ZodNumber:()=>as,ZodNumberFormat:()=>li,ZodObject:()=>Fo,ZodOptional:()=>Vl,ZodPipe:()=>Vo,ZodPrefault:()=>T_,ZodPreprocess:()=>C_,ZodPromise:()=>$_,ZodReadonly:()=>P_,ZodRealError:()=>Dt,ZodRecord:()=>ns,ZodSet:()=>p_,ZodString:()=>is,ZodStringFormat:()=>He,ZodSuccess:()=>w_,ZodSymbol:()=>e_,ZodTemplateLiteral:()=>O_,ZodTransform:()=>__,ZodTuple:()=>d_,ZodType:()=>Ae,ZodULID:()=>Ml,ZodURL:()=>Lo,ZodUUID:()=>Sn,ZodUndefined:()=>t_,ZodUnion:()=>Bo,ZodUnknown:()=>i_,ZodVoid:()=>o_,ZodXID:()=>Al,ZodXor:()=>c_,_ZodString:()=>Sl,_default:()=>b_,_function:()=>ub,any:()=>Ul,array:()=>$,base64:()=>Ix,base64url:()=>Cx,bigint:()=>Bx,boolean:()=>ie,catch:()=>A_,check:()=>db,cidrv4:()=>Mx,cidrv6:()=>Ax,clone:()=>Et,codec:()=>ob,coerce:()=>Ho,config:()=>Je,core:()=>Pn,cuid:()=>yx,cuid2:()=>Sx,custom:()=>hb,date:()=>Wx,decode:()=>qg,decodeAsync:()=>Kg,describe:()=>fb,discriminatedUnion:()=>ir,e164:()=>Px,email:()=>bl,emoji:()=>_x,encode:()=>Hg,encodeAsync:()=>Wg,endsWith:()=>Wi,enum:()=>_e,exactOptional:()=>y_,file:()=>nb,flattenError:()=>xo,float32:()=>Dx,float64:()=>Lx,formatError:()=>bo,fromJSONSchema:()=>yb,function:()=>ub,getErrorMap:()=>cI,globalRegistry:()=>pt,gt:()=>vn,gte:()=>Mt,guid:()=>dx,hash:()=>kx,hex:()=>$x,hostname:()=>zx,httpUrl:()=>gx,includes:()=>Hi,instanceof:()=>mb,int:()=>vl,int32:()=>Ux,int64:()=>Vx,intersection:()=>cn,invertCodec:()=>ab,ipv4:()=>Rx,ipv6:()=>wx,iso:()=>jt,json:()=>_b,jwt:()=>Nx,keyof:()=>Kx,ksuid:()=>Tx,lazy:()=>sr,length:()=>ai,literal:()=>D,locales:()=>Co,looseObject:()=>de,looseRecord:()=>Yx,lowercase:()=>ji,lt:()=>_n,lte:()=>Vt,mac:()=>Ex,map:()=>Qx,maxLength:()=>oi,maxSize:()=>er,meta:()=>pb,mime:()=>Ki,minLength:()=>Cn,minSize:()=>yn,multipleOf:()=>Qn,nan:()=>sb,nanoid:()=>vx,nativeEnum:()=>tb,negative:()=>sl,never:()=>Fl,nonnegative:()=>al,nonoptional:()=>E_,nonpositive:()=>ol,normalize:()=>Zi,null:()=>xn,nullable:()=>ko,nullish:()=>rb,number:()=>K,object:()=>I,optional:()=>le,overwrite:()=>an,parse:()=>Vg,parseAsync:()=>jg,partialRecord:()=>Jx,pipe:()=>yl,positive:()=>il,prefault:()=>R_,preprocess:()=>Nn,prettifyError:()=>of,promise:()=>lb,property:()=>cl,readonly:()=>N_,record:()=>re,refine:()=>D_,regex:()=>Vi,regexes:()=>Bt,registry:()=>Dc,safeDecode:()=>Xg,safeDecodeAsync:()=>Yg,safeEncode:()=>Zg,safeEncodeAsync:()=>Jg,safeParse:()=>zo,safeParseAsync:()=>Gg,set:()=>eb,setErrorMap:()=>aI,size:()=>si,slugify:()=>Qi,startsWith:()=>qi,strictObject:()=>Zx,string:()=>x,stringFormat:()=>Ox,stringbool:()=>gb,success:()=>ib,superRefine:()=>L_,symbol:()=>Gx,templateLiteral:()=>cb,toJSONSchema:()=>ci,toLowerCase:()=>Ji,toUpperCase:()=>Yi,transform:()=>Bl,treeifyError:()=>sf,trim:()=>Xi,tuple:()=>h_,uint32:()=>Fx,uint64:()=>jx,ulid:()=>xx,undefined:()=>Hx,union:()=>oe,unknown:()=>ce,uppercase:()=>Gi,url:()=>ss,util:()=>J,uuid:()=>hx,uuidv4:()=>fx,uuidv6:()=>px,uuidv7:()=>mx,void:()=>qx,xid:()=>bx,xor:()=>Xx});var Pn={};An(Pn,{$ZodAny:()=>$p,$ZodArray:()=>Fp,$ZodAsyncError:()=>on,$ZodBase64:()=>Ep,$ZodBase64URL:()=>wp,$ZodBigInt:()=>Ic,$ZodBigIntFormat:()=>Pp,$ZodBoolean:()=>wo,$ZodCIDRv4:()=>bp,$ZodCIDRv6:()=>Tp,$ZodCUID:()=>up,$ZodCUID2:()=>dp,$ZodCatch:()=>im,$ZodCheck:()=>We,$ZodCheckBigIntFormat:()=>Ff,$ZodCheckEndsWith:()=>Yf,$ZodCheckGreaterThan:()=>Tc,$ZodCheckIncludes:()=>Xf,$ZodCheckLengthEquals:()=>qf,$ZodCheckLessThan:()=>bc,$ZodCheckLowerCase:()=>Kf,$ZodCheckMaxLength:()=>Gf,$ZodCheckMaxSize:()=>Bf,$ZodCheckMimeType:()=>ep,$ZodCheckMinLength:()=>Hf,$ZodCheckMinSize:()=>Vf,$ZodCheckMultipleOf:()=>Lf,$ZodCheckNumberFormat:()=>Uf,$ZodCheckOverwrite:()=>tp,$ZodCheckProperty:()=>Qf,$ZodCheckRegex:()=>Wf,$ZodCheckSizeEquals:()=>jf,$ZodCheckStartsWith:()=>Jf,$ZodCheckStringFormat:()=>Fi,$ZodCheckUpperCase:()=>Zf,$ZodCodec:()=>Ao,$ZodCustom:()=>hm,$ZodCustomStringFormat:()=>Ip,$ZodDate:()=>Up,$ZodDefault:()=>em,$ZodDiscriminatedUnion:()=>jp,$ZodE164:()=>Mp,$ZodEmail:()=>op,$ZodEmoji:()=>cp,$ZodEncodeError:()=>Kn,$ZodEnum:()=>Kp,$ZodError:()=>So,$ZodExactOptional:()=>Yp,$ZodFile:()=>Xp,$ZodFunction:()=>lm,$ZodGUID:()=>ip,$ZodIPv4:()=>yp,$ZodIPv6:()=>Sp,$ZodISODate:()=>gp,$ZodISODateTime:()=>mp,$ZodISODuration:()=>vp,$ZodISOTime:()=>_p,$ZodIntersection:()=>Gp,$ZodJWT:()=>Ap,$ZodKSUID:()=>pp,$ZodLazy:()=>dm,$ZodLiteral:()=>Zp,$ZodMAC:()=>xp,$ZodMap:()=>qp,$ZodNaN:()=>sm,$ZodNanoID:()=>lp,$ZodNever:()=>Dp,$ZodNonOptional:()=>nm,$ZodNull:()=>zp,$ZodNullable:()=>Qp,$ZodNumber:()=>Ac,$ZodNumberFormat:()=>Cp,$ZodObject:()=>oS,$ZodObjectJIT:()=>Bp,$ZodOptional:()=>Pc,$ZodPipe:()=>Nc,$ZodPrefault:()=>tm,$ZodPreprocess:()=>om,$ZodPromise:()=>um,$ZodReadonly:()=>am,$ZodRealError:()=>kt,$ZodRecord:()=>Hp,$ZodRegistry:()=>kc,$ZodSet:()=>Wp,$ZodString:()=>ii,$ZodStringFormat:()=>Ge,$ZodSuccess:()=>rm,$ZodSymbol:()=>Np,$ZodTemplateLiteral:()=>cm,$ZodTransform:()=>Jp,$ZodTuple:()=>Cc,$ZodType:()=>xe,$ZodULID:()=>hp,$ZodURL:()=>ap,$ZodUUID:()=>sp,$ZodUndefined:()=>Op,$ZodUnion:()=>Mo,$ZodUnknown:()=>kp,$ZodVoid:()=>Lp,$ZodXID:()=>fp,$ZodXor:()=>Vp,$brand:()=>qh,$constructor:()=>z,$input:()=>pm,$output:()=>fm,Doc:()=>Eo,JSONSchema:()=>cx,JSONSchemaGenerator:()=>hl,NEVER:()=>fo,TimePrecision:()=>vm,_any:()=>Um,_array:()=>qm,_base64:()=>el,_base64url:()=>tl,_bigint:()=>Nm,_boolean:()=>Cm,_catch:()=>JA,_check:()=>ax,_cidrv4:()=>Yc,_cidrv6:()=>Qc,_coercedBigint:()=>Om,_coercedBoolean:()=>Pm,_coercedDate:()=>Gm,_coercedNumber:()=>Rm,_coercedString:()=>gm,_cuid:()=>Hc,_cuid2:()=>qc,_custom:()=>Km,_date:()=>jm,_decode:()=>fc,_decodeAsync:()=>mc,_default:()=>KA,_discriminatedUnion:()=>kA,_e164:()=>nl,_email:()=>Lc,_emoji:()=>jc,_encode:()=>hc,_encodeAsync:()=>pc,_endsWith:()=>Wi,_enum:()=>VA,_file:()=>Wm,_float32:()=>wm,_float64:()=>Mm,_gt:()=>vn,_gte:()=>Mt,_guid:()=>Po,_includes:()=>Hi,_int:()=>Em,_int32:()=>Am,_int64:()=>zm,_intersection:()=>DA,_ipv4:()=>Xc,_ipv6:()=>Jc,_isoDate:()=>Sm,_isoDateTime:()=>ym,_isoDuration:()=>bm,_isoTime:()=>xm,_jwt:()=>rl,_ksuid:()=>Zc,_lazy:()=>tI,_length:()=>ai,_literal:()=>GA,_lowercase:()=>ji,_lt:()=>_n,_lte:()=>Vt,_mac:()=>_m,_map:()=>FA,_max:()=>Vt,_maxLength:()=>oi,_maxSize:()=>er,_mime:()=>Ki,_min:()=>Mt,_minLength:()=>Cn,_minSize:()=>yn,_multipleOf:()=>Qn,_nan:()=>Hm,_nanoid:()=>Gc,_nativeEnum:()=>jA,_negative:()=>sl,_never:()=>Bm,_nonnegative:()=>al,_nonoptional:()=>ZA,_nonpositive:()=>ol,_normalize:()=>Zi,_null:()=>Lm,_nullable:()=>WA,_number:()=>Tm,_optional:()=>qA,_overwrite:()=>an,_parse:()=>ki,_parseAsync:()=>Di,_pipe:()=>YA,_positive:()=>il,_promise:()=>nI,_property:()=>cl,_readonly:()=>QA,_record:()=>UA,_refine:()=>Zm,_regex:()=>Vi,_safeDecode:()=>_c,_safeDecodeAsync:()=>yc,_safeEncode:()=>gc,_safeEncodeAsync:()=>vc,_safeParse:()=>Li,_safeParseAsync:()=>Ui,_set:()=>BA,_size:()=>si,_slugify:()=>Qi,_startsWith:()=>qi,_string:()=>mm,_stringFormat:()=>es,_stringbool:()=>Qm,_success:()=>XA,_superRefine:()=>Xm,_symbol:()=>km,_templateLiteral:()=>eI,_toLowerCase:()=>Ji,_toUpperCase:()=>Yi,_transform:()=>HA,_trim:()=>Xi,_tuple:()=>LA,_uint32:()=>Im,_uint64:()=>$m,_ulid:()=>Wc,_undefined:()=>Dm,_union:()=>zA,_unknown:()=>Fm,_uppercase:()=>Gi,_url:()=>No,_uuid:()=>Uc,_uuidv4:()=>Fc,_uuidv6:()=>Bc,_uuidv7:()=>Vc,_void:()=>Vm,_xid:()=>Kc,_xor:()=>$A,clone:()=>Et,config:()=>Je,createStandardJSONSchemaMethod:()=>ts,createToJSONSchemaMethod:()=>eg,decode:()=>nM,decodeAsync:()=>iM,describe:()=>Jm,encode:()=>tM,encodeAsync:()=>rM,extractDefs:()=>nr,finalize:()=>rr,flattenError:()=>xo,formatError:()=>bo,globalConfig:()=>ti,globalRegistry:()=>pt,initializeContext:()=>tr,isValidBase64:()=>Rp,isValidBase64URL:()=>nS,isValidJWT:()=>rS,locales:()=>Co,meta:()=>Ym,parse:()=>uc,parseAsync:()=>dc,prettifyError:()=>of,process:()=>Be,regexes:()=>Bt,registry:()=>Dc,safeDecode:()=>oM,safeDecodeAsync:()=>cM,safeEncode:()=>sM,safeEncodeAsync:()=>aM,safeParse:()=>af,safeParseAsync:()=>cf,toDotPath:()=>$0,toJSONSchema:()=>ci,treeifyError:()=>sf,util:()=>J,version:()=>np});var C0,fo=Object.freeze({status:"aborted"});function z(t,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:false}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let l=o.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let f=u[d];f in a||(a[f]=l[f].bind(a));}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:t});function o(a){var c;let l=r?.Parent?new s:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?true:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var qh=Symbol("zod_brand"),on=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Kn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}};(C0=globalThis).__zod_globalConfig??(C0.__zod_globalConfig={});var ti=globalThis.__zod_globalConfig;function Je(t){return t&&Object.assign(ti,t),ti}var J={};An(J,{BIGINT_FORMAT_RANGES:()=>nf,Class:()=>Kh,NUMBER_FORMAT_RANGES:()=>tf,aborted:()=>Yn,allowsEval:()=>Jh,assert:()=>Ow,assertEqual:()=>Iw,assertIs:()=>Pw,assertNever:()=>Nw,assertNotEqual:()=>Cw,assignProp:()=>Xn,base64ToUint8Array:()=>N0,base64urlToUint8Array:()=>Xw,cached:()=>zi,captureStackTrace:()=>lc,cleanEnum:()=>Zw,cleanRegex:()=>go,clone:()=>Et,cloneDef:()=>$w,createTransparentProxy:()=>Bw,defineLazy:()=>Oe,esc:()=>cc,escapeRegex:()=>Zt,explicitlyAborted:()=>rf,extend:()=>Gw,finalizeIssue:()=>wt,floatSafeRemainder:()=>Zh,getElementAtPath:()=>kw,getEnumValues:()=>mo,getLengthableOrigin:()=>yo,getParsedType:()=>Fw,getSizableOrigin:()=>vo,hexToUint8Array:()=>Yw,isObject:()=>ni,isPlainObject:()=>Jn,issue:()=>$i,joinValues:()=>F,jsonStringifyReplacer:()=>Oi,merge:()=>qw,mergeDefs:()=>In,normalizeParams:()=>Y,nullish:()=>Zn,numKeys:()=>Uw,objectClone:()=>zw,omit:()=>jw,optionalKeys:()=>ef,parsedType:()=>X,partial:()=>Ww,pick:()=>Vw,prefixIssues:()=>$t,primitiveTypes:()=>Qh,promiseAllObject:()=>Dw,propertyKeyTypes:()=>_o,randomString:()=>Lw,required:()=>Kw,safeExtend:()=>Hw,shallowClone:()=>Yh,slugify:()=>Xh,stringifyPrimitive:()=>Z,uint8ArrayToBase64:()=>O0,uint8ArrayToBase64url:()=>Jw,uint8ArrayToHex:()=>Qw,unwrapMessage:()=>po});function Iw(t){return t}function Cw(t){return t}function Pw(t){}function Nw(t){throw new Error("Unexpected value in exhaustive check")}function Ow(t){}function mo(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function F(t,e="|"){return t.map(r=>Z(r)).join(e)}function Oi(t,e){return typeof e=="bigint"?e.toString():e}function zi(t){return {get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}}}}function Zn(t){return t==null}function go(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Zh(t,e){let r=t/e,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var P0=Symbol("evaluating");function Oe(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==P0)return i===void 0&&(i=P0,i=r()),i},set(n){Object.defineProperty(t,e,{value:n});},configurable:true});}function zw(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Xn(t,e,r){Object.defineProperty(t,e,{value:r,writable:true,enumerable:true,configurable:true});}function In(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i);}return Object.defineProperties({},e)}function $w(t){return In(t._zod.def)}function kw(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function Dw(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let s=0;s<e.length;s++)n[e[s]]=i[s];return n})}function Lw(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function cc(t){return JSON.stringify(t)}function Xh(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ni(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Jh=zi(()=>{if(ti.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let t=Function;return new t(""),!0}catch{return false}});function Jn(t){if(ni(t)===false)return false;let e=t.constructor;if(e===void 0||typeof e!="function")return true;let r=e.prototype;return !(ni(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function Yh(t){return Jn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Uw(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Fw=t=>{let e=typeof t;switch(e){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(t)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},_o=new Set(["string","number","symbol"]),Qh=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Zt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Et(t,e,r){let i=new t._zod.constr(e??t._zod.def);return (!e||r?.parent)&&(i._zod.parent=t),i}function Y(t){let e=t;if(!e)return {};if(typeof e=="string")return {error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message;}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Bw(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,s){return e??(e=t()),Reflect.set(e,i,n,s)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function Z(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function ef(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var tf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},nf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Vw(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=In(t._zod.def,{get shape(){let o={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=r.shape[a]);}return Xn(this,"shape",o),o},checks:[]});return Et(t,s)}function jw(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=In(t._zod.def,{get shape(){let o={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a];}return Xn(this,"shape",o),o},checks:[]});return Et(t,s)}function Gw(t,e){if(!Jn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=In(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return Xn(this,"shape",s),s}});return Et(t,n)}function Hw(t,e){if(!Jn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=In(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Xn(this,"shape",i),i}});return Et(t,r)}function qw(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=In(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Xn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Et(t,r)}function Ww(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=In(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l]);}else for(let l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return Xn(this,"shape",c),c},checks:[]});return Et(e,o)}function Kw(t,e,r){let i=In(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};if(r)for(let o in r){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(s[o]=new t({type:"nonoptional",innerType:n[o]}));}else for(let o in n)s[o]=new t({type:"nonoptional",innerType:n[o]});return Xn(this,"shape",s),s}});return Et(e,i)}function Yn(t,e=0){if(t.aborted===true)return true;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==true)return true;return false}function rf(t,e=0){if(t.aborted===true)return true;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===false)return true;return false}function $t(t,e){return e.map(r=>{var i;return (i=r).path??(i.path=[]),r.path.unshift(t),r})}function po(t){return typeof t=="string"?t:t?.message}function wt(t,e,r){let i=t.message?t.message:po(t.inst?._zod.def?.error?.(t))??po(e?.error?.(t))??po(r.customError?.(t))??po(r.localeError?.(t))??"Invalid input",{inst:n,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=o),a}function vo(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function yo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function X(t){let e=typeof t;switch(e){case "number":return Number.isNaN(t)?"nan":"number";case "object":{if(t===null)return "null";if(Array.isArray(t))return "array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function $i(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Zw(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function N0(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function O0(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Xw(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return N0(e+r)}function Jw(t){return O0(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Yw(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function Qw(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Kh=class{constructor(...e){}};var z0=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:false}),Object.defineProperty(t,"issues",{value:e,enumerable:false}),t.message=JSON.stringify(e,Oi,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:false});},So=z("$ZodError",z0),kt=z("$ZodError",z0,{Parent:Error});function xo(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return {formErrors:i,fieldErrors:r}}function bo(t,e=r=>r.message){let r={_errors:[]},i=(n,s=[])=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...s,...o.path]);else {let a=[...s,...o.path];if(a.length===0)r._errors.push(e(o));else {let c=r,l=0;for(;l<a.length;){let u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(o))):c[u]=c[u]||{_errors:[]},c=c[u],l++;}}}};return i(t),r}function sf(t,e=r=>r.message){let r={errors:[]},i=(n,s=[])=>{var o,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else {let l=[...s,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,d=0;for(;d<l.length;){let f=l[d],p=d===l.length-1;typeof f=="string"?(u.properties??(u.properties={}),(o=u.properties)[f]??(o[f]={errors:[]}),u=u.properties[f]):(u.items??(u.items=[]),(a=u.items)[f]??(a[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(e(c)),d++;}}};return i(t),r}function $0(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function of(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${$0(i.path)}`);return e.join(`
|
|
3
|
-
`)}var ki=t=>(e,r,i,n)=>{let s=i?{...i,async:false}:{async:false},o=e._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new on;if(o.issues.length){let a=new(n?.Err??t)(o.issues.map(c=>wt(c,s,Je())));throw lc(a,n?.callee),a}return o.value},uc=ki(kt),Di=t=>async(e,r,i,n)=>{let s=i?{...i,async:true}:{async:true},o=e._zod.run({value:r,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(n?.Err??t)(o.issues.map(c=>wt(c,s,Je())));throw lc(a,n?.callee),a}return o.value},dc=Di(kt),Li=t=>(e,r,i)=>{let n=i?{...i,async:false}:{async:false},s=e._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new on;return s.issues.length?{success:false,error:new(t??So)(s.issues.map(o=>wt(o,n,Je())))}:{success:true,data:s.value}},af=Li(kt),Ui=t=>async(e,r,i)=>{let n=i?{...i,async:true}:{async:true},s=e._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:false,error:new t(s.issues.map(o=>wt(o,n,Je())))}:{success:true,data:s.value}},cf=Ui(kt),hc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return ki(t)(e,r,n)},tM=hc(kt),fc=t=>(e,r,i)=>ki(t)(e,r,i),nM=fc(kt),pc=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Di(t)(e,r,n)},rM=pc(kt),mc=t=>async(e,r,i)=>Di(t)(e,r,i),iM=mc(kt),gc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Li(t)(e,r,n)},sM=gc(kt),_c=t=>(e,r,i)=>Li(t)(e,r,i),oM=_c(kt),vc=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ui(t)(e,r,n)},aM=vc(kt),yc=t=>async(e,r,i)=>Ui(t)(e,r,i),cM=yc(kt);var Bt={};An(Bt,{base64:()=>Rf,base64url:()=>Sc,bigint:()=>Pf,boolean:()=>Of,browserEmail:()=>gM,cidrv4:()=>bf,cidrv6:()=>Tf,cuid:()=>lf,cuid2:()=>uf,date:()=>Mf,datetime:()=>If,domain:()=>yM,duration:()=>mf,e164:()=>wf,email:()=>_f,emoji:()=>vf,extendedDuration:()=>lM,guid:()=>gf,hex:()=>SM,hostname:()=>vM,html5Email:()=>fM,httpProtocol:()=>Ef,idnEmail:()=>mM,integer:()=>Nf,ipv4:()=>yf,ipv6:()=>Sf,ksuid:()=>ff,lowercase:()=>kf,mac:()=>xf,md5_base64:()=>bM,md5_base64url:()=>TM,md5_hex:()=>xM,nanoid:()=>pf,null:()=>zf,number:()=>xc,rfc5322Email:()=>pM,sha1_base64:()=>EM,sha1_base64url:()=>wM,sha1_hex:()=>RM,sha256_base64:()=>AM,sha256_base64url:()=>IM,sha256_hex:()=>MM,sha384_base64:()=>PM,sha384_base64url:()=>NM,sha384_hex:()=>CM,sha512_base64:()=>zM,sha512_base64url:()=>$M,sha512_hex:()=>OM,string:()=>Cf,time:()=>Af,ulid:()=>df,undefined:()=>$f,unicodeEmail:()=>k0,uppercase:()=>Df,uuid:()=>ri,uuid4:()=>uM,uuid6:()=>dM,uuid7:()=>hM,xid:()=>hf});var lf=/^[cC][0-9a-z]{6,}$/,uf=/^[0-9a-z]+$/,df=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,hf=/^[0-9a-vA-V]{20}$/,ff=/^[A-Za-z0-9]{27}$/,pf=/^[a-zA-Z0-9_-]{21}$/,mf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,lM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gf=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ri=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,uM=ri(4),dM=ri(6),hM=ri(7),_f=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,fM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,pM=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,k0=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,mM=k0,gM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_M="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function vf(){return new RegExp(_M,"u")}var yf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Sf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,xf=t=>{let e=Zt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},bf=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Tf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Rf=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sc=/^[A-Za-z0-9_-]*$/,vM=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,yM=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ef=/^https?$/,wf=/^\+[1-9]\d{6,14}$/,D0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Mf=new RegExp(`^${D0}$`);function L0(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Af(t){return new RegExp(`^${L0(t)}$`)}function If(t){let e=L0({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${D0}T(?:${i})$`)}var Cf=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Pf=/^-?\d+n?$/,Nf=/^-?\d+$/,xc=/^-?\d+(?:\.\d+)?$/,Of=/^(?:true|false)$/i,zf=/^null$/i;var $f=/^undefined$/i;var kf=/^[^A-Z]*$/,Df=/^[^a-z]*$/,SM=/^[0-9a-fA-F]*$/;function To(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Ro(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var xM=/^[0-9a-fA-F]{32}$/,bM=To(22,"=="),TM=Ro(22),RM=/^[0-9a-fA-F]{40}$/,EM=To(27,"="),wM=Ro(27),MM=/^[0-9a-fA-F]{64}$/,AM=To(43,"="),IM=Ro(43),CM=/^[0-9a-fA-F]{96}$/,PM=To(64,""),NM=Ro(64),OM=/^[0-9a-fA-F]{128}$/,zM=To(86,"=="),$M=Ro(86);var We=z("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[]);}),F0={number:"number",bigint:"bigint",object:"date"},bc=z("$ZodCheckLessThan",(t,e)=>{We.init(t,e);let r=F0[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Tc=z("$ZodCheckGreaterThan",(t,e)=>{We.init(t,e);let r=F0[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Lf=z("$ZodCheckMultipleOf",(t,e)=>{We.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value);}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Zh(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort});};}),Uf=z("$ZodCheckNumberFormat",(t,e)=>{We.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,s]=tf[e.format];t._zod.onattach.push(o=>{let a=o._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,r&&(a.pattern=Nf);}),t._zod.check=o=>{let a=o.value;if(r){if(!Number.isInteger(a)){o.issues.push({expected:i,format:e.format,code:"invalid_type",continue:false,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort});return}}a<n&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:true,inst:t,continue:!e.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:true,inst:t,continue:!e.abort});};}),Ff=z("$ZodCheckBigIntFormat",(t,e)=>{We.init(t,e);let[r,i]=nf[e.format];t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,s.minimum=r,s.maximum=i;}),t._zod.check=n=>{let s=n.value;s<r&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:true,inst:t,continue:!e.abort}),s>i&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inclusive:true,inst:t,continue:!e.abort});};}),Bf=z("$ZodCheckMaxSize",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:vo(n),code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Vf=z("$ZodCheckMinSize",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:vo(n),code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),jf=z("$ZodCheckSizeEquals",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size;}),t._zod.check=i=>{let n=i.value,s=n.size;if(s===e.size)return;let o=s>e.size;i.issues.push({origin:vo(n),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),Gf=z("$ZodCheckMaxLength",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let o=yo(n);i.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Hf=z("$ZodCheckMinLength",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let o=yo(n);i.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),qf=z("$ZodCheckLengthEquals",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length;}),t._zod.check=i=>{let n=i.value,s=n.length;if(s===e.length)return;let o=yo(n),a=s>e.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),Fi=z("$ZodCheckStringFormat",(t,e)=>{var r,i;We.init(t,e),t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern));}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort});}):(i=t._zod).check??(i.check=()=>{});}),Wf=z("$ZodCheckRegex",(t,e)=>{Fi.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort});};}),Kf=z("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=kf),Fi.init(t,e);}),Zf=z("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=Df),Fi.init(t,e);}),Xf=z("$ZodCheckIncludes",(t,e)=>{We.init(t,e);let r=Zt(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i);}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort});};}),Jf=z("$ZodCheckStartsWith",(t,e)=>{We.init(t,e);let r=new RegExp(`^${Zt(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort});};}),Yf=z("$ZodCheckEndsWith",(t,e)=>{We.init(t,e);let r=new RegExp(`.*${Zt(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort});};});function U0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues));}var Qf=z("$ZodCheckProperty",(t,e)=>{We.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>U0(n,r,e.property));U0(i,r,e.property);};}),ep=z("$ZodCheckMimeType",(t,e)=>{We.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime;}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort});};}),tp=z("$ZodCheckOverwrite",(t,e)=>{We.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value);};});var Eo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
2
|
+
import {realpathSync}from'fs';import {readdir,readFile,mkdir,writeFile,stat}from'fs/promises';import Gr from'path';import {fileURLToPath}from'url';import ty from'process';import {deflateSync}from'zlib';import {createServer}from'http';var xw=Object.defineProperty;var An=(t,e)=>{for(var r in e)xw(t,r,{get:e[r],enumerable:true});};var bw=Object.create,oc=Object.defineProperty,Tw=Object.getOwnPropertyDescriptor,Rw=Object.getOwnPropertyNames,Ew=Object.getPrototypeOf,ww=Object.prototype.hasOwnProperty,W=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),w0=(t,e)=>{let r={};for(var i in t)oc(r,i,{get:t[i],enumerable:true});return r},Mw=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(var n=Rw(e),s=0,o=n.length,a;s<o;s++)a=n[s],!ww.call(t,a)&&a!==r&&oc(t,a,{get:(c=>e[c]).bind(null,a),enumerable:!(i=Tw(e,a))||i.enumerable});return t},ac=(t,e,r)=>(r=t!=null?bw(Ew(t)):{},Mw(oc(r,"default",{value:t,enumerable:true}),t));var Aw=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),M0=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Iw=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Cw=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function A0(t){return typeof t=="string"&&M0.has(t.replace(/#$/,""))}function I0(t,e){if(!("$schema"in t)||typeof t.$schema!="string")return "2020-12";let r=t.$schema.replace(/#$/,"");if(Aw.has(r))return "2020-12";if(M0.has(r))return "2019-09";if(Iw.has(r)||Cw.has(r))return "draft-7";throw new Error(`JSON Schema declares an unsupported dialect ("$schema": "${t.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${e}`)}var B={};An(B,{$brand:()=>Wh,$input:()=>mm,$output:()=>pm,NEVER:()=>fo,TimePrecision:()=>ym,ZodAny:()=>i_,ZodArray:()=>c_,ZodBase64:()=>zl,ZodBase64URL:()=>$l,ZodBigInt:()=>ls,ZodBigIntFormat:()=>kl,ZodBoolean:()=>cs,ZodCIDRv4:()=>Nl,ZodCIDRv6:()=>Ol,ZodCUID:()=>El,ZodCUID2:()=>wl,ZodCatch:()=>A_,ZodCodec:()=>jo,ZodCustom:()=>Go,ZodCustomStringFormat:()=>os,ZodDate:()=>Uo,ZodDefault:()=>b_,ZodDiscriminatedUnion:()=>u_,ZodE164:()=>Dl,ZodEmail:()=>xl,ZodEmoji:()=>Tl,ZodEnum:()=>rs,ZodError:()=>aI,ZodExactOptional:()=>y_,ZodFile:()=>__,ZodFirstPartyTypeKind:()=>F_,ZodFunction:()=>L_,ZodGUID:()=>$o,ZodIPv4:()=>Cl,ZodIPv6:()=>Pl,ZodISODate:()=>ml,ZodISODateTime:()=>pl,ZodISODuration:()=>_l,ZodISOTime:()=>gl,ZodIntersection:()=>d_,ZodIssueCode:()=>B_,ZodJWT:()=>Ll,ZodKSUID:()=>Il,ZodLazy:()=>$_,ZodLiteral:()=>g_,ZodMAC:()=>e_,ZodMap:()=>p_,ZodNaN:()=>C_,ZodNanoID:()=>Rl,ZodNever:()=>o_,ZodNonOptional:()=>jl,ZodNull:()=>r_,ZodNullable:()=>x_,ZodNumber:()=>as,ZodNumberFormat:()=>li,ZodObject:()=>Fo,ZodOptional:()=>Vl,ZodPipe:()=>Vo,ZodPrefault:()=>R_,ZodPreprocess:()=>P_,ZodPromise:()=>D_,ZodReadonly:()=>N_,ZodRealError:()=>Lt,ZodRecord:()=>ns,ZodSet:()=>m_,ZodString:()=>is,ZodStringFormat:()=>Ge,ZodSuccess:()=>M_,ZodSymbol:()=>t_,ZodTemplateLiteral:()=>z_,ZodTransform:()=>v_,ZodTuple:()=>h_,ZodType:()=>Ae,ZodULID:()=>Ml,ZodURL:()=>ko,ZodUUID:()=>Sn,ZodUndefined:()=>n_,ZodUnion:()=>Bo,ZodUnknown:()=>s_,ZodVoid:()=>a_,ZodXID:()=>Al,ZodXor:()=>l_,_ZodString:()=>Sl,_default:()=>T_,_function:()=>ub,any:()=>Ul,array:()=>$,base64:()=>Ix,base64url:()=>Cx,bigint:()=>Bx,boolean:()=>ie,catch:()=>I_,check:()=>db,cidrv4:()=>Mx,cidrv6:()=>Ax,clone:()=>Et,codec:()=>ob,coerce:()=>Ho,config:()=>Je,core:()=>Pn,cuid:()=>yx,cuid2:()=>Sx,custom:()=>hb,date:()=>Wx,decode:()=>Wg,decodeAsync:()=>Zg,describe:()=>fb,discriminatedUnion:()=>ir,e164:()=>Px,email:()=>bl,emoji:()=>_x,encode:()=>qg,encodeAsync:()=>Kg,endsWith:()=>Wi,enum:()=>_e,exactOptional:()=>S_,file:()=>nb,flattenError:()=>xo,float32:()=>Lx,float64:()=>kx,formatError:()=>bo,fromJSONSchema:()=>yb,function:()=>ub,getErrorMap:()=>uI,globalRegistry:()=>pt,gt:()=>vn,gte:()=>Mt,guid:()=>dx,hash:()=>Dx,hex:()=>$x,hostname:()=>zx,httpUrl:()=>gx,includes:()=>Hi,instanceof:()=>mb,int:()=>vl,int32:()=>Ux,int64:()=>Vx,intersection:()=>cn,invertCodec:()=>ab,ipv4:()=>Rx,ipv6:()=>wx,iso:()=>jt,json:()=>_b,jwt:()=>Nx,keyof:()=>Kx,ksuid:()=>Tx,lazy:()=>sr,length:()=>ai,literal:()=>D,locales:()=>Co,looseObject:()=>de,looseRecord:()=>Yx,lowercase:()=>ji,lt:()=>_n,lte:()=>Vt,mac:()=>Ex,map:()=>Qx,maxLength:()=>oi,maxSize:()=>er,meta:()=>pb,mime:()=>Ki,minLength:()=>Cn,minSize:()=>yn,multipleOf:()=>Qn,nan:()=>sb,nanoid:()=>vx,nativeEnum:()=>tb,negative:()=>sl,never:()=>Fl,nonnegative:()=>al,nonoptional:()=>w_,nonpositive:()=>ol,normalize:()=>Zi,null:()=>xn,nullable:()=>Do,nullish:()=>rb,number:()=>K,object:()=>I,optional:()=>le,overwrite:()=>an,parse:()=>jg,parseAsync:()=>Gg,partialRecord:()=>Jx,pipe:()=>yl,positive:()=>il,prefault:()=>E_,preprocess:()=>Nn,prettifyError:()=>af,promise:()=>lb,property:()=>cl,readonly:()=>O_,record:()=>re,refine:()=>k_,regex:()=>Vi,regexes:()=>Bt,registry:()=>Lc,safeDecode:()=>Jg,safeDecodeAsync:()=>Qg,safeEncode:()=>Xg,safeEncodeAsync:()=>Yg,safeParse:()=>zo,safeParseAsync:()=>Hg,set:()=>eb,setErrorMap:()=>lI,size:()=>si,slugify:()=>Qi,startsWith:()=>qi,strictObject:()=>Zx,string:()=>x,stringFormat:()=>Ox,stringbool:()=>gb,success:()=>ib,superRefine:()=>U_,symbol:()=>Gx,templateLiteral:()=>cb,toJSONSchema:()=>ci,toLowerCase:()=>Ji,toUpperCase:()=>Yi,transform:()=>Bl,treeifyError:()=>of,trim:()=>Xi,tuple:()=>f_,uint32:()=>Fx,uint64:()=>jx,ulid:()=>xx,undefined:()=>Hx,union:()=>oe,unknown:()=>ce,uppercase:()=>Gi,url:()=>ss,util:()=>J,uuid:()=>hx,uuidv4:()=>fx,uuidv6:()=>px,uuidv7:()=>mx,void:()=>qx,xid:()=>bx,xor:()=>Xx});var Pn={};An(Pn,{$ZodAny:()=>Dp,$ZodArray:()=>Bp,$ZodAsyncError:()=>on,$ZodBase64:()=>wp,$ZodBase64URL:()=>Mp,$ZodBigInt:()=>Ic,$ZodBigIntFormat:()=>Np,$ZodBoolean:()=>wo,$ZodCIDRv4:()=>Tp,$ZodCIDRv6:()=>Rp,$ZodCUID:()=>dp,$ZodCUID2:()=>hp,$ZodCatch:()=>sm,$ZodCheck:()=>We,$ZodCheckBigIntFormat:()=>Bf,$ZodCheckEndsWith:()=>Qf,$ZodCheckGreaterThan:()=>Tc,$ZodCheckIncludes:()=>Jf,$ZodCheckLengthEquals:()=>Wf,$ZodCheckLessThan:()=>bc,$ZodCheckLowerCase:()=>Zf,$ZodCheckMaxLength:()=>Hf,$ZodCheckMaxSize:()=>Vf,$ZodCheckMimeType:()=>tp,$ZodCheckMinLength:()=>qf,$ZodCheckMinSize:()=>jf,$ZodCheckMultipleOf:()=>Uf,$ZodCheckNumberFormat:()=>Ff,$ZodCheckOverwrite:()=>np,$ZodCheckProperty:()=>ep,$ZodCheckRegex:()=>Kf,$ZodCheckSizeEquals:()=>Gf,$ZodCheckStartsWith:()=>Yf,$ZodCheckStringFormat:()=>Fi,$ZodCheckUpperCase:()=>Xf,$ZodCodec:()=>Ao,$ZodCustom:()=>fm,$ZodCustomStringFormat:()=>Cp,$ZodDate:()=>Fp,$ZodDefault:()=>tm,$ZodDiscriminatedUnion:()=>Gp,$ZodE164:()=>Ap,$ZodEmail:()=>ap,$ZodEmoji:()=>lp,$ZodEncodeError:()=>Kn,$ZodEnum:()=>Zp,$ZodError:()=>So,$ZodExactOptional:()=>Qp,$ZodFile:()=>Jp,$ZodFunction:()=>um,$ZodGUID:()=>sp,$ZodIPv4:()=>Sp,$ZodIPv6:()=>xp,$ZodISODate:()=>_p,$ZodISODateTime:()=>gp,$ZodISODuration:()=>yp,$ZodISOTime:()=>vp,$ZodIntersection:()=>Hp,$ZodJWT:()=>Ip,$ZodKSUID:()=>mp,$ZodLazy:()=>hm,$ZodLiteral:()=>Xp,$ZodMAC:()=>bp,$ZodMap:()=>Wp,$ZodNaN:()=>om,$ZodNanoID:()=>up,$ZodNever:()=>kp,$ZodNonOptional:()=>rm,$ZodNull:()=>$p,$ZodNullable:()=>em,$ZodNumber:()=>Ac,$ZodNumberFormat:()=>Pp,$ZodObject:()=>oS,$ZodObjectJIT:()=>Vp,$ZodOptional:()=>Pc,$ZodPipe:()=>Nc,$ZodPrefault:()=>nm,$ZodPreprocess:()=>am,$ZodPromise:()=>dm,$ZodReadonly:()=>cm,$ZodRealError:()=>Dt,$ZodRecord:()=>qp,$ZodRegistry:()=>Dc,$ZodSet:()=>Kp,$ZodString:()=>ii,$ZodStringFormat:()=>je,$ZodSuccess:()=>im,$ZodSymbol:()=>Op,$ZodTemplateLiteral:()=>lm,$ZodTransform:()=>Yp,$ZodTuple:()=>Cc,$ZodType:()=>Se,$ZodULID:()=>fp,$ZodURL:()=>cp,$ZodUUID:()=>op,$ZodUndefined:()=>zp,$ZodUnion:()=>Mo,$ZodUnknown:()=>Lp,$ZodVoid:()=>Up,$ZodXID:()=>pp,$ZodXor:()=>jp,$brand:()=>Wh,$constructor:()=>z,$input:()=>mm,$output:()=>pm,Doc:()=>Eo,JSONSchema:()=>cx,JSONSchemaGenerator:()=>hl,NEVER:()=>fo,TimePrecision:()=>ym,_any:()=>Fm,_array:()=>Wm,_base64:()=>el,_base64url:()=>tl,_bigint:()=>Om,_boolean:()=>Pm,_catch:()=>QA,_check:()=>ax,_cidrv4:()=>Yc,_cidrv6:()=>Qc,_coercedBigint:()=>zm,_coercedBoolean:()=>Nm,_coercedDate:()=>Hm,_coercedNumber:()=>Em,_coercedString:()=>_m,_cuid:()=>Hc,_cuid2:()=>qc,_custom:()=>Zm,_date:()=>Gm,_decode:()=>fc,_decodeAsync:()=>mc,_default:()=>XA,_discriminatedUnion:()=>kA,_e164:()=>nl,_email:()=>kc,_emoji:()=>jc,_encode:()=>hc,_encodeAsync:()=>pc,_endsWith:()=>Wi,_enum:()=>GA,_file:()=>Km,_float32:()=>Mm,_float64:()=>Am,_gt:()=>vn,_gte:()=>Mt,_guid:()=>Po,_includes:()=>Hi,_int:()=>wm,_int32:()=>Im,_int64:()=>$m,_intersection:()=>UA,_ipv4:()=>Xc,_ipv6:()=>Jc,_isoDate:()=>xm,_isoDateTime:()=>Sm,_isoDuration:()=>Tm,_isoTime:()=>bm,_jwt:()=>rl,_ksuid:()=>Zc,_lazy:()=>rI,_length:()=>ai,_literal:()=>qA,_lowercase:()=>ji,_lt:()=>_n,_lte:()=>Vt,_mac:()=>vm,_map:()=>VA,_max:()=>Vt,_maxLength:()=>oi,_maxSize:()=>er,_mime:()=>Ki,_min:()=>Mt,_minLength:()=>Cn,_minSize:()=>yn,_multipleOf:()=>Qn,_nan:()=>qm,_nanoid:()=>Gc,_nativeEnum:()=>HA,_negative:()=>sl,_never:()=>Vm,_nonnegative:()=>al,_nonoptional:()=>JA,_nonpositive:()=>ol,_normalize:()=>Zi,_null:()=>Um,_nullable:()=>ZA,_number:()=>Rm,_optional:()=>KA,_overwrite:()=>an,_parse:()=>Di,_parseAsync:()=>Li,_pipe:()=>eI,_positive:()=>il,_promise:()=>iI,_property:()=>cl,_readonly:()=>tI,_record:()=>BA,_refine:()=>Xm,_regex:()=>Vi,_safeDecode:()=>_c,_safeDecodeAsync:()=>yc,_safeEncode:()=>gc,_safeEncodeAsync:()=>vc,_safeParse:()=>ki,_safeParseAsync:()=>Ui,_set:()=>jA,_size:()=>si,_slugify:()=>Qi,_startsWith:()=>qi,_string:()=>gm,_stringFormat:()=>es,_stringbool:()=>eg,_success:()=>YA,_superRefine:()=>Jm,_symbol:()=>Lm,_templateLiteral:()=>nI,_toLowerCase:()=>Ji,_toUpperCase:()=>Yi,_transform:()=>WA,_trim:()=>Xi,_tuple:()=>FA,_uint32:()=>Cm,_uint64:()=>Dm,_ulid:()=>Wc,_undefined:()=>km,_union:()=>DA,_unknown:()=>Bm,_uppercase:()=>Gi,_url:()=>No,_uuid:()=>Uc,_uuidv4:()=>Fc,_uuidv6:()=>Bc,_uuidv7:()=>Vc,_void:()=>jm,_xid:()=>Kc,_xor:()=>LA,clone:()=>Et,config:()=>Je,createStandardJSONSchemaMethod:()=>ts,createToJSONSchemaMethod:()=>tg,decode:()=>iM,decodeAsync:()=>oM,describe:()=>Ym,encode:()=>rM,encodeAsync:()=>sM,extractDefs:()=>nr,finalize:()=>rr,flattenError:()=>xo,formatError:()=>bo,globalConfig:()=>ti,globalRegistry:()=>pt,initializeContext:()=>tr,isValidBase64:()=>Ep,isValidBase64URL:()=>nS,isValidJWT:()=>rS,locales:()=>Co,meta:()=>Qm,parse:()=>uc,parseAsync:()=>dc,prettifyError:()=>af,process:()=>Fe,regexes:()=>Bt,registry:()=>Lc,safeDecode:()=>cM,safeDecodeAsync:()=>uM,safeEncode:()=>aM,safeEncodeAsync:()=>lM,safeParse:()=>cf,safeParseAsync:()=>lf,toDotPath:()=>$0,toJSONSchema:()=>ci,treeifyError:()=>of,util:()=>J,version:()=>rp});var C0,fo=Object.freeze({status:"aborted"});function z(t,e,r){function i(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:false}),a._zod.traits.has(t))return;a._zod.traits.add(t),e(a,c);let l=o.prototype,u=Object.keys(l);for(let d=0;d<u.length;d++){let f=u[d];f in a||(a[f]=l[f].bind(a));}}let n=r?.Parent??Object;class s extends n{}Object.defineProperty(s,"name",{value:t});function o(a){var c;let l=r?.Parent?new s:this;i(l,a),(c=l._zod).deferred??(c.deferred=[]);for(let u of l._zod.deferred)u();return l}return Object.defineProperty(o,"init",{value:i}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>r?.Parent&&a instanceof r.Parent?true:a?._zod?.traits?.has(t)}),Object.defineProperty(o,"name",{value:t}),o}var Wh=Symbol("zod_brand"),on=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");}},Kn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError";}};(C0=globalThis).__zod_globalConfig??(C0.__zod_globalConfig={});var ti=globalThis.__zod_globalConfig;function Je(t){return t&&Object.assign(ti,t),ti}var J={};An(J,{BIGINT_FORMAT_RANGES:()=>rf,Class:()=>Zh,NUMBER_FORMAT_RANGES:()=>nf,aborted:()=>Yn,allowsEval:()=>Yh,assert:()=>$w,assertEqual:()=>Pw,assertIs:()=>Ow,assertNever:()=>zw,assertNotEqual:()=>Nw,assignProp:()=>Xn,base64ToUint8Array:()=>N0,base64urlToUint8Array:()=>Yw,cached:()=>zi,captureStackTrace:()=>lc,cleanEnum:()=>Jw,cleanRegex:()=>go,clone:()=>Et,cloneDef:()=>Lw,createTransparentProxy:()=>jw,defineLazy:()=>Oe,esc:()=>cc,escapeRegex:()=>Zt,explicitlyAborted:()=>sf,extend:()=>qw,finalizeIssue:()=>wt,floatSafeRemainder:()=>Xh,getElementAtPath:()=>kw,getEnumValues:()=>mo,getLengthableOrigin:()=>yo,getParsedType:()=>Vw,getSizableOrigin:()=>vo,hexToUint8Array:()=>eM,isObject:()=>ni,isPlainObject:()=>Jn,issue:()=>$i,joinValues:()=>F,jsonStringifyReplacer:()=>Oi,merge:()=>Kw,mergeDefs:()=>In,normalizeParams:()=>Y,nullish:()=>Zn,numKeys:()=>Bw,objectClone:()=>Dw,omit:()=>Hw,optionalKeys:()=>tf,parsedType:()=>X,partial:()=>Zw,pick:()=>Gw,prefixIssues:()=>$t,primitiveTypes:()=>ef,promiseAllObject:()=>Uw,propertyKeyTypes:()=>_o,randomString:()=>Fw,required:()=>Xw,safeExtend:()=>Ww,shallowClone:()=>Qh,slugify:()=>Jh,stringifyPrimitive:()=>Z,uint8ArrayToBase64:()=>O0,uint8ArrayToBase64url:()=>Qw,uint8ArrayToHex:()=>tM,unwrapMessage:()=>po});function Pw(t){return t}function Nw(t){return t}function Ow(t){}function zw(t){throw new Error("Unexpected value in exhaustive check")}function $w(t){}function mo(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function F(t,e="|"){return t.map(r=>Z(r)).join(e)}function Oi(t,e){return typeof e=="bigint"?e.toString():e}function zi(t){return {get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}}}}function Zn(t){return t==null}function go(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Xh(t,e){let r=t/e,i=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-i)<n?0:r-i}var P0=Symbol("evaluating");function Oe(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==P0)return i===void 0&&(i=P0,i=r()),i},set(n){Object.defineProperty(t,e,{value:n});},configurable:true});}function Dw(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Xn(t,e,r){Object.defineProperty(t,e,{value:r,writable:true,enumerable:true,configurable:true});}function In(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i);}return Object.defineProperties({},e)}function Lw(t){return In(t._zod.def)}function kw(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function Uw(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let s=0;s<e.length;s++)n[e[s]]=i[s];return n})}function Fw(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function cc(t){return JSON.stringify(t)}function Jh(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var lc="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function ni(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var Yh=zi(()=>{if(ti.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return false;try{let t=Function;return new t(""),!0}catch{return false}});function Jn(t){if(ni(t)===false)return false;let e=t.constructor;if(e===void 0||typeof e!="function")return true;let r=e.prototype;return !(ni(r)===false||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===false)}function Qh(t){return Jn(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function Bw(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var Vw=t=>{let e=typeof t;switch(e){case "undefined":return "undefined";case "string":return "string";case "number":return Number.isNaN(t)?"nan":"number";case "boolean":return "boolean";case "function":return "function";case "bigint":return "bigint";case "symbol":return "symbol";case "object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},_o=new Set(["string","number","symbol"]),ef=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Zt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Et(t,e,r){let i=new t._zod.constr(e??t._zod.def);return (!e||r?.parent)&&(i._zod.parent=t),i}function Y(t){let e=t;if(!e)return {};if(typeof e=="string")return {error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message;}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function jw(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,s){return e??(e=t()),Reflect.set(e,i,n,s)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function Z(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function tf(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var nf={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},rf={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Gw(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s=In(t._zod.def,{get shape(){let o={};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=r.shape[a]);}return Xn(this,"shape",o),o},checks:[]});return Et(t,s)}function Hw(t,e){let r=t._zod.def,i=r.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=In(t._zod.def,{get shape(){let o={...t._zod.def.shape};for(let a in e){if(!(a in r.shape))throw new Error(`Unrecognized key: "${a}"`);e[a]&&delete o[a];}return Xn(this,"shape",o),o},checks:[]});return Et(t,s)}function qw(t,e){if(!Jn(e))throw new Error("Invalid input to extend: expected a plain object");let r=t._zod.def.checks;if(r&&r.length>0){let s=t._zod.def.shape;for(let o in e)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=In(t._zod.def,{get shape(){let s={...t._zod.def.shape,...e};return Xn(this,"shape",s),s}});return Et(t,n)}function Ww(t,e){if(!Jn(e))throw new Error("Invalid input to safeExtend: expected a plain object");let r=In(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return Xn(this,"shape",i),i}});return Et(t,r)}function Kw(t,e){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=In(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return Xn(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:e._zod.def.checks??[]});return Et(t,r)}function Zw(t,e,r){let n=e._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let o=In(e._zod.def,{get shape(){let a=e._zod.def.shape,c={...a};if(r)for(let l in r){if(!(l in a))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(c[l]=t?new t({type:"optional",innerType:a[l]}):a[l]);}else for(let l in a)c[l]=t?new t({type:"optional",innerType:a[l]}):a[l];return Xn(this,"shape",c),c},checks:[]});return Et(e,o)}function Xw(t,e,r){let i=In(e._zod.def,{get shape(){let n=e._zod.def.shape,s={...n};if(r)for(let o in r){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);r[o]&&(s[o]=new t({type:"nonoptional",innerType:n[o]}));}else for(let o in n)s[o]=new t({type:"nonoptional",innerType:n[o]});return Xn(this,"shape",s),s}});return Et(e,i)}function Yn(t,e=0){if(t.aborted===true)return true;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==true)return true;return false}function sf(t,e=0){if(t.aborted===true)return true;for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue===false)return true;return false}function $t(t,e){return e.map(r=>{var i;return (i=r).path??(i.path=[]),r.path.unshift(t),r})}function po(t){return typeof t=="string"?t:t?.message}function wt(t,e,r){let i=t.message?t.message:po(t.inst?._zod.def?.error?.(t))??po(e?.error?.(t))??po(r.customError?.(t))??po(r.localeError?.(t))??"Invalid input",{inst:n,continue:s,input:o,...a}=t;return a.path??(a.path=[]),a.message=i,e?.reportInput&&(a.input=o),a}function vo(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function yo(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function X(t){let e=typeof t;switch(e){case "number":return Number.isNaN(t)?"nan":"number";case "object":{if(t===null)return "null";if(Array.isArray(t))return "array";let r=t;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return e}function $i(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function Jw(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}function N0(t){let e=atob(t),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}function O0(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return btoa(e)}function Yw(t){let e=t.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-e.length%4)%4);return N0(e+r)}function Qw(t){return O0(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function eM(t){let e=t.replace(/^0x/,"");if(e.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(e.length/2);for(let i=0;i<e.length;i+=2)r[i/2]=Number.parseInt(e.slice(i,i+2),16);return r}function tM(t){return Array.from(t).map(e=>e.toString(16).padStart(2,"0")).join("")}var Zh=class{constructor(...e){}};var z0=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:false}),Object.defineProperty(t,"issues",{value:e,enumerable:false}),t.message=JSON.stringify(e,Oi,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:false});},So=z("$ZodError",z0),Dt=z("$ZodError",z0,{Parent:Error});function xo(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return {formErrors:i,fieldErrors:r}}function bo(t,e=r=>r.message){let r={_errors:[]},i=(n,s=[])=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>i({issues:a},[...s,...o.path]));else if(o.code==="invalid_key")i({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")i({issues:o.issues},[...s,...o.path]);else {let a=[...s,...o.path];if(a.length===0)r._errors.push(e(o));else {let c=r,l=0;for(;l<a.length;){let u=a[l];l===a.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(e(o))):c[u]=c[u]||{_errors:[]},c=c[u],l++;}}}};return i(t),r}function of(t,e=r=>r.message){let r={errors:[]},i=(n,s=[])=>{var o,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(l=>i({issues:l},[...s,...c.path]));else if(c.code==="invalid_key")i({issues:c.issues},[...s,...c.path]);else if(c.code==="invalid_element")i({issues:c.issues},[...s,...c.path]);else {let l=[...s,...c.path];if(l.length===0){r.errors.push(e(c));continue}let u=r,d=0;for(;d<l.length;){let f=l[d],p=d===l.length-1;typeof f=="string"?(u.properties??(u.properties={}),(o=u.properties)[f]??(o[f]={errors:[]}),u=u.properties[f]):(u.items??(u.items=[]),(a=u.items)[f]??(a[f]={errors:[]}),u=u.items[f]),p&&u.errors.push(e(c)),d++;}}};return i(t),r}function $0(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function af(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${$0(i.path)}`);return e.join(`
|
|
3
|
+
`)}var Di=t=>(e,r,i,n)=>{let s=i?{...i,async:false}:{async:false},o=e._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new on;if(o.issues.length){let a=new(n?.Err??t)(o.issues.map(c=>wt(c,s,Je())));throw lc(a,n?.callee),a}return o.value},uc=Di(Dt),Li=t=>async(e,r,i,n)=>{let s=i?{...i,async:true}:{async:true},o=e._zod.run({value:r,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){let a=new(n?.Err??t)(o.issues.map(c=>wt(c,s,Je())));throw lc(a,n?.callee),a}return o.value},dc=Li(Dt),ki=t=>(e,r,i)=>{let n=i?{...i,async:false}:{async:false},s=e._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new on;return s.issues.length?{success:false,error:new(t??So)(s.issues.map(o=>wt(o,n,Je())))}:{success:true,data:s.value}},cf=ki(Dt),Ui=t=>async(e,r,i)=>{let n=i?{...i,async:true}:{async:true},s=e._zod.run({value:r,issues:[]},n);return s instanceof Promise&&(s=await s),s.issues.length?{success:false,error:new t(s.issues.map(o=>wt(o,n,Je())))}:{success:true,data:s.value}},lf=Ui(Dt),hc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Di(t)(e,r,n)},rM=hc(Dt),fc=t=>(e,r,i)=>Di(t)(e,r,i),iM=fc(Dt),pc=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Li(t)(e,r,n)},sM=pc(Dt),mc=t=>async(e,r,i)=>Li(t)(e,r,i),oM=mc(Dt),gc=t=>(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return ki(t)(e,r,n)},aM=gc(Dt),_c=t=>(e,r,i)=>ki(t)(e,r,i),cM=_c(Dt),vc=t=>async(e,r,i)=>{let n=i?{...i,direction:"backward"}:{direction:"backward"};return Ui(t)(e,r,n)},lM=vc(Dt),yc=t=>async(e,r,i)=>Ui(t)(e,r,i),uM=yc(Dt);var Bt={};An(Bt,{base64:()=>Ef,base64url:()=>Sc,bigint:()=>Nf,boolean:()=>zf,browserEmail:()=>vM,cidrv4:()=>Tf,cidrv6:()=>Rf,cuid:()=>uf,cuid2:()=>df,date:()=>Af,datetime:()=>Cf,domain:()=>xM,duration:()=>gf,e164:()=>Mf,email:()=>vf,emoji:()=>yf,extendedDuration:()=>dM,guid:()=>_f,hex:()=>bM,hostname:()=>SM,html5Email:()=>mM,httpProtocol:()=>wf,idnEmail:()=>_M,integer:()=>Of,ipv4:()=>Sf,ipv6:()=>xf,ksuid:()=>pf,lowercase:()=>Lf,mac:()=>bf,md5_base64:()=>RM,md5_base64url:()=>EM,md5_hex:()=>TM,nanoid:()=>mf,null:()=>$f,number:()=>xc,rfc5322Email:()=>gM,sha1_base64:()=>MM,sha1_base64url:()=>AM,sha1_hex:()=>wM,sha256_base64:()=>CM,sha256_base64url:()=>PM,sha256_hex:()=>IM,sha384_base64:()=>OM,sha384_base64url:()=>zM,sha384_hex:()=>NM,sha512_base64:()=>DM,sha512_base64url:()=>LM,sha512_hex:()=>$M,string:()=>Pf,time:()=>If,ulid:()=>hf,undefined:()=>Df,unicodeEmail:()=>D0,uppercase:()=>kf,uuid:()=>ri,uuid4:()=>hM,uuid6:()=>fM,uuid7:()=>pM,xid:()=>ff});var uf=/^[cC][0-9a-z]{6,}$/,df=/^[0-9a-z]+$/,hf=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ff=/^[0-9a-vA-V]{20}$/,pf=/^[A-Za-z0-9]{27}$/,mf=/^[a-zA-Z0-9_-]{21}$/,gf=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dM=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,_f=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,ri=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,hM=ri(4),fM=ri(6),pM=ri(7),vf=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,mM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,gM=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,D0=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,_M=D0,vM=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yM="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function yf(){return new RegExp(yM,"u")}var Sf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,xf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,bf=t=>{let e=Zt(t??":");return new RegExp(`^(?:[0-9A-F]{2}${e}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${e}){5}[0-9a-f]{2}$`)},Tf=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Rf=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ef=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Sc=/^[A-Za-z0-9_-]*$/,SM=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,xM=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,wf=/^https?$/,Mf=/^\+[1-9]\d{6,14}$/,L0="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Af=new RegExp(`^${L0}$`);function k0(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function If(t){return new RegExp(`^${k0(t)}$`)}function Cf(t){let e=k0({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${L0}T(?:${i})$`)}var Pf=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},Nf=/^-?\d+n?$/,Of=/^-?\d+$/,xc=/^-?\d+(?:\.\d+)?$/,zf=/^(?:true|false)$/i,$f=/^null$/i;var Df=/^undefined$/i;var Lf=/^[^A-Z]*$/,kf=/^[^a-z]*$/,bM=/^[0-9a-fA-F]*$/;function To(t,e){return new RegExp(`^[A-Za-z0-9+/]{${t}}${e}$`)}function Ro(t){return new RegExp(`^[A-Za-z0-9_-]{${t}}$`)}var TM=/^[0-9a-fA-F]{32}$/,RM=To(22,"=="),EM=Ro(22),wM=/^[0-9a-fA-F]{40}$/,MM=To(27,"="),AM=Ro(27),IM=/^[0-9a-fA-F]{64}$/,CM=To(43,"="),PM=Ro(43),NM=/^[0-9a-fA-F]{96}$/,OM=To(64,""),zM=Ro(64),$M=/^[0-9a-fA-F]{128}$/,DM=To(86,"=="),LM=Ro(86);var We=z("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[]);}),F0={number:"number",bigint:"bigint",object:"date"},bc=z("$ZodCheckLessThan",(t,e)=>{We.init(t,e);let r=F0[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,s=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<s&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Tc=z("$ZodCheckGreaterThan",(t,e)=>{We.init(t,e);let r=F0[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,s=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>s&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value);}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:typeof e.value=="object"?e.value.getTime():e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort});};}),Uf=z("$ZodCheckMultipleOf",(t,e)=>{We.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value);}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Xh(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort});};}),Ff=z("$ZodCheckNumberFormat",(t,e)=>{We.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,s]=nf[e.format];t._zod.onattach.push(o=>{let a=o._zod.bag;a.format=e.format,a.minimum=n,a.maximum=s,r&&(a.pattern=Of);}),t._zod.check=o=>{let a=o.value;if(r){if(!Number.isInteger(a)){o.issues.push({expected:i,format:e.format,code:"invalid_type",continue:false,input:a,inst:t});return}if(!Number.isSafeInteger(a)){a>0?o.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort}):o.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,inclusive:true,continue:!e.abort});return}}a<n&&o.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:true,inst:t,continue:!e.abort}),a>s&&o.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:true,inst:t,continue:!e.abort});};}),Bf=z("$ZodCheckBigIntFormat",(t,e)=>{We.init(t,e);let[r,i]=rf[e.format];t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,s.minimum=r,s.maximum=i;}),t._zod.check=n=>{let s=n.value;s<r&&n.issues.push({origin:"bigint",input:s,code:"too_small",minimum:r,inclusive:true,inst:t,continue:!e.abort}),s>i&&n.issues.push({origin:"bigint",input:s,code:"too_big",maximum:i,inclusive:true,inst:t,continue:!e.abort});};}),Vf=z("$ZodCheckMaxSize",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:vo(n),code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),jf=z("$ZodCheckMinSize",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:vo(n),code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Gf=z("$ZodCheckSizeEquals",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size;}),t._zod.check=i=>{let n=i.value,s=n.size;if(s===e.size)return;let o=s>e.size;i.issues.push({origin:vo(n),...o?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),Hf=z("$ZodCheckMaxLength",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum);}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let o=yo(n);i.issues.push({origin:o,code:"too_big",maximum:e.maximum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),qf=z("$ZodCheckMinLength",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum);}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let o=yo(n);i.issues.push({origin:o,code:"too_small",minimum:e.minimum,inclusive:true,input:n,inst:t,continue:!e.abort});};}),Wf=z("$ZodCheckLengthEquals",(t,e)=>{var r;We.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return !Zn(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length;}),t._zod.check=i=>{let n=i.value,s=n.length;if(s===e.length)return;let o=yo(n),a=s>e.length;i.issues.push({origin:o,...a?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:true,exact:true,input:i.value,inst:t,continue:!e.abort});};}),Fi=z("$ZodCheckStringFormat",(t,e)=>{var r,i;We.init(t,e),t._zod.onattach.push(n=>{let s=n._zod.bag;s.format=e.format,e.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(e.pattern));}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort});}):(i=t._zod).check??(i.check=()=>{});}),Kf=z("$ZodCheckRegex",(t,e)=>{Fi.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort});};}),Zf=z("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=Lf),Fi.init(t,e);}),Xf=z("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=kf),Fi.init(t,e);}),Jf=z("$ZodCheckIncludes",(t,e)=>{We.init(t,e);let r=Zt(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(i);}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort});};}),Yf=z("$ZodCheckStartsWith",(t,e)=>{We.init(t,e);let r=new RegExp(`^${Zt(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort});};}),Qf=z("$ZodCheckEndsWith",(t,e)=>{We.init(t,e);let r=new RegExp(`.*${Zt(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r);}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort});};});function U0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues));}var ep=z("$ZodCheckProperty",(t,e)=>{We.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>U0(n,r,e.property));U0(i,r,e.property);};}),tp=z("$ZodCheckMimeType",(t,e)=>{We.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime;}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort});};}),np=z("$ZodCheckOverwrite",(t,e)=>{We.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value);};});var Eo=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e);}indented(e){this.indent+=1,e(this),this.indent-=1;}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
|
|
4
4
|
`).filter(o=>o),n=Math.min(...i.map(o=>o.length-o.trimStart().length)),s=i.map(o=>o.slice(n)).map(o=>" ".repeat(this.indent*2)+o);for(let o of s)this.content.push(o);}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(s=>` ${s}`)];return new e(...r,n.join(`
|
|
5
|
-
`))}};var np={major:4,minor:4,patch:3};var xe=z("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=np;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let s of n._zod.onattach)s(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse;});else {let n=(o,a,c)=>{let l=Yn(o),u;for(let d of a){if(d._zod.def.when){if(rf(o)||!d._zod.def.when(o))continue}else if(l)continue;let f=o.issues.length,p=d._zod.check(o);if(p instanceof Promise&&c?.async===false)throw new on;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,o.issues.length!==f&&(l||(l=Yn(o,f)));});else {if(o.issues.length===f)continue;l||(l=Yn(o,f));}}return u?u.then(()=>o):o},s=(o,a,c)=>{if(Yn(o))return o.aborted=true,o;let l=n(a,i,c);if(l instanceof Promise){if(c.async===false)throw new on;return l.then(u=>t._zod.parse(u,c))}return t._zod.parse(l,c)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){let l=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:true});return l instanceof Promise?l.then(u=>s(u,o,a)):s(l,o,a)}let c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===false)throw new on;return c.then(l=>n(l,i,a))}return n(c,i,a)};}Oe(t,"~standard",()=>({validate:n=>{try{let s=af(t,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return cf(t,n).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}));}),ii=z("$ZodString",(t,e)=>{xe.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Cf(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r};}),Ge=z("$ZodStringFormat",(t,e)=>{Fi.init(t,e),ii.init(t,e);}),ip=z("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=gf),Ge.init(t,e);}),sp=z("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ri(i));}else e.pattern??(e.pattern=ri());Ge.init(t,e);}),op=z("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=_f),Ge.init(t,e);}),ap=z("$ZodURL",(t,e)=>{Ge.init(t,e),t._zod.check=r=>{try{let i=r.value.trim();if(!e.normalize&&e.protocol?.source===Ef.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});}};}),cp=z("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=vf()),Ge.init(t,e);}),lp=z("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=pf),Ge.init(t,e);}),up=z("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=lf),Ge.init(t,e);}),dp=z("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=uf),Ge.init(t,e);}),hp=z("$ZodULID",(t,e)=>{e.pattern??(e.pattern=df),Ge.init(t,e);}),fp=z("$ZodXID",(t,e)=>{e.pattern??(e.pattern=hf),Ge.init(t,e);}),pp=z("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=ff),Ge.init(t,e);}),mp=z("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=If(e)),Ge.init(t,e);}),gp=z("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Mf),Ge.init(t,e);}),_p=z("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=Af(e)),Ge.init(t,e);}),vp=z("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=mf),Ge.init(t,e);}),yp=z("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=yf),Ge.init(t,e),t._zod.bag.format="ipv4";}),Sp=z("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=Sf),Ge.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`);}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort});}};}),xp=z("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=xf(e.delimiter)),Ge.init(t,e),t._zod.bag.format="mac";}),bp=z("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=bf),Ge.init(t,e);}),Tp=z("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Tf),Ge.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,s]=i;if(!s)throw new Error;let o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${n}]`);}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort});}};});function Rp(t){if(t==="")return true;if(/\s/.test(t)||t.length%4!==0)return false;try{return atob(t),!0}catch{return false}}var Ep=z("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Rf),Ge.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Rp(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort});};});function nS(t){if(!Sc.test(t))return false;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Rp(r)}var wp=z("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Sc),Ge.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{nS(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort});};}),Mp=z("$ZodE164",(t,e)=>{e.pattern??(e.pattern=wf),Ge.init(t,e);});function rS(t,e=null){try{let r=t.split(".");if(r.length!==3)return !1;let[i]=r;if(!i)return !1;let n=JSON.parse(atob(i));return !("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return false}}var Ap=z("$ZodJWT",(t,e)=>{Ge.init(t,e),t._zod.check=r=>{rS(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort});};}),Ip=z("$ZodCustomStringFormat",(t,e)=>{Ge.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort});};}),Ac=z("$ZodNumber",(t,e)=>{xe.init(t,e),t._zod.pattern=t._zod.bag.pattern??xc,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value);}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...s?{received:s}:{}}),r};}),Cp=z("$ZodNumberFormat",(t,e)=>{Uf.init(t,e),Ac.init(t,e);}),wo=z("$ZodBoolean",(t,e)=>{xe.init(t,e),t._zod.pattern=Of,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value;}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r};}),Ic=z("$ZodBigInt",(t,e)=>{xe.init(t,e),t._zod.pattern=Pf,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r};}),Pp=z("$ZodBigIntFormat",(t,e)=>{Ff.init(t,e),Ic.init(t,e);}),Np=z("$ZodSymbol",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r};}),Op=z("$ZodUndefined",(t,e)=>{xe.init(t,e),t._zod.pattern=$f,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r};}),zp=z("$ZodNull",(t,e)=>{xe.init(t,e),t._zod.pattern=zf,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r};}),$p=z("$ZodAny",(t,e)=>{xe.init(t,e),t._zod.parse=r=>r;}),kp=z("$ZodUnknown",(t,e)=>{xe.init(t,e),t._zod.parse=r=>r;}),Dp=z("$ZodNever",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r);}),Lp=z("$ZodVoid",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r};}),Up=z("$ZodDate",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value);}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:t}),r};});function V0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues)),e.value[r]=t.value;}var Fp=z("$ZodArray",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let s=[];for(let o=0;o<n.length;o++){let a=n[o],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?s.push(c.then(l=>V0(l,r,o))):V0(c,r,o);}return s.length?Promise.all(s).then(()=>r):r};});function Mc(t,e,r,i,n,s){let o=r in i;if(t.issues.length){if(n&&s&&!o)return;e.issues.push(...$t(r,t.issues));}if(!o&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?o&&(e.value[r]=void 0):e.value[r]=t.value;}function iS(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=ef(t.shape);return {...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function sS(t,e,r,i,n,s){let o=[],a=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(let f in e){if(f==="__proto__"||a.has(f))continue;if(l==="never"){o.push(f);continue}let p=c.run({value:e[f],issues:[]},i);p instanceof Promise?t.push(p.then(g=>Mc(g,r,f,e,u,d))):Mc(p,r,f,e,u,d);}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var oS=z("$ZodObject",(t,e)=>{if(xe.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}});}let i=zi(()=>iS(e));Oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d);}}return c});let n=ni,s=e.catchall,o;t._zod.parse=(a,c)=>{o??(o=i.value);let l=a.value;if(!n(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let u=[],d=o.shape;for(let f of o.keys){let p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",S=p._zod.run({value:l[f],issues:[]},c);S instanceof Promise?u.push(S.then(h=>Mc(h,a,f,l,g,m))):Mc(S,a,f,l,g,m);}return s?sS(u,l,a,c,i.value,t):u.length?Promise.all(u).then(()=>a):a};}),Bp=z("$ZodObjectJIT",(t,e)=>{oS.init(t,e);let r=t._zod.parse,i=zi(()=>iS(e)),n=f=>{let p=new Eo(["shape","payload","ctx"]),g=i.value,m=_=>{let y=cc(_);return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};p.write("const input = payload.value;");let S=Object.create(null),h=0;for(let _ of g.keys)S[_]=`key_${h++}`;p.write("const newResult = {};");for(let _ of g.keys){let y=S[_],R=cc(_),T=f[_],b=T?._zod?.optin==="optional",E=T?._zod?.optout==="optional";p.write(`const ${y} = ${m(_)};`),b&&E?p.write(`
|
|
5
|
+
`))}};var rp={major:4,minor:4,patch:3};var Se=z("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=rp;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let s of n._zod.onattach)s(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse;});else {let n=(o,a,c)=>{let l=Yn(o),u;for(let d of a){if(d._zod.def.when){if(sf(o)||!d._zod.def.when(o))continue}else if(l)continue;let f=o.issues.length,p=d._zod.check(o);if(p instanceof Promise&&c?.async===false)throw new on;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,o.issues.length!==f&&(l||(l=Yn(o,f)));});else {if(o.issues.length===f)continue;l||(l=Yn(o,f));}}return u?u.then(()=>o):o},s=(o,a,c)=>{if(Yn(o))return o.aborted=true,o;let l=n(a,i,c);if(l instanceof Promise){if(c.async===false)throw new on;return l.then(u=>t._zod.parse(u,c))}return t._zod.parse(l,c)};t._zod.run=(o,a)=>{if(a.skipChecks)return t._zod.parse(o,a);if(a.direction==="backward"){let l=t._zod.parse({value:o.value,issues:[]},{...a,skipChecks:true});return l instanceof Promise?l.then(u=>s(u,o,a)):s(l,o,a)}let c=t._zod.parse(o,a);if(c instanceof Promise){if(a.async===false)throw new on;return c.then(l=>n(l,i,a))}return n(c,i,a)};}Oe(t,"~standard",()=>({validate:n=>{try{let s=cf(t,n);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return lf(t,n).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}));}),ii=z("$ZodString",(t,e)=>{Se.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??Pf(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value);}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r};}),je=z("$ZodStringFormat",(t,e)=>{Fi.init(t,e),ii.init(t,e);}),sp=z("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=_f),je.init(t,e);}),op=z("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=ri(i));}else e.pattern??(e.pattern=ri());je.init(t,e);}),ap=z("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=vf),je.init(t,e);}),cp=z("$ZodURL",(t,e)=>{je.init(t,e),t._zod.check=r=>{try{let i=r.value.trim();if(!e.normalize&&e.protocol?.source===wf.source&&!/^https?:\/\//i.test(i)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:t,continue:!e.abort});return}let n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:e.hostname.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort});}};}),lp=z("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=yf()),je.init(t,e);}),up=z("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=mf),je.init(t,e);}),dp=z("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=uf),je.init(t,e);}),hp=z("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=df),je.init(t,e);}),fp=z("$ZodULID",(t,e)=>{e.pattern??(e.pattern=hf),je.init(t,e);}),pp=z("$ZodXID",(t,e)=>{e.pattern??(e.pattern=ff),je.init(t,e);}),mp=z("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=pf),je.init(t,e);}),gp=z("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=Cf(e)),je.init(t,e);}),_p=z("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=Af),je.init(t,e);}),vp=z("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=If(e)),je.init(t,e);}),yp=z("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=gf),je.init(t,e);}),Sp=z("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=Sf),je.init(t,e),t._zod.bag.format="ipv4";}),xp=z("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=xf),je.init(t,e),t._zod.bag.format="ipv6",t._zod.check=r=>{try{new URL(`http://[${r.value}]`);}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort});}};}),bp=z("$ZodMAC",(t,e)=>{e.pattern??(e.pattern=bf(e.delimiter)),je.init(t,e),t._zod.bag.format="mac";}),Tp=z("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Tf),je.init(t,e);}),Rp=z("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=Rf),je.init(t,e),t._zod.check=r=>{let i=r.value.split("/");try{if(i.length!==2)throw new Error;let[n,s]=i;if(!s)throw new Error;let o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${n}]`);}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort});}};});function Ep(t){if(t==="")return true;if(/\s/.test(t)||t.length%4!==0)return false;try{return atob(t),!0}catch{return false}}var wp=z("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=Ef),je.init(t,e),t._zod.bag.contentEncoding="base64",t._zod.check=r=>{Ep(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort});};});function nS(t){if(!Sc.test(t))return false;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return Ep(r)}var Mp=z("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Sc),je.init(t,e),t._zod.bag.contentEncoding="base64url",t._zod.check=r=>{nS(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort});};}),Ap=z("$ZodE164",(t,e)=>{e.pattern??(e.pattern=Mf),je.init(t,e);});function rS(t,e=null){try{let r=t.split(".");if(r.length!==3)return !1;let[i]=r;if(!i)return !1;let n=JSON.parse(atob(i));return !("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return false}}var Ip=z("$ZodJWT",(t,e)=>{je.init(t,e),t._zod.check=r=>{rS(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort});};}),Cp=z("$ZodCustomStringFormat",(t,e)=>{je.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort});};}),Ac=z("$ZodNumber",(t,e)=>{Se.init(t,e),t._zod.pattern=t._zod.bag.pattern??xc,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value);}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...s?{received:s}:{}}),r};}),Pp=z("$ZodNumberFormat",(t,e)=>{Ff.init(t,e),Ac.init(t,e);}),wo=z("$ZodBoolean",(t,e)=>{Se.init(t,e),t._zod.pattern=zf,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value;}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r};}),Ic=z("$ZodBigInt",(t,e)=>{Se.init(t,e),t._zod.pattern=Nf,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value);}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r};}),Np=z("$ZodBigIntFormat",(t,e)=>{Bf.init(t,e),Ic.init(t,e);}),Op=z("$ZodSymbol",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r};}),zp=z("$ZodUndefined",(t,e)=>{Se.init(t,e),t._zod.pattern=Df,t._zod.values=new Set([void 0]),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r};}),$p=z("$ZodNull",(t,e)=>{Se.init(t,e),t._zod.pattern=$f,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r};}),Dp=z("$ZodAny",(t,e)=>{Se.init(t,e),t._zod.parse=r=>r;}),Lp=z("$ZodUnknown",(t,e)=>{Se.init(t,e),t._zod.parse=r=>r;}),kp=z("$ZodNever",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r);}),Up=z("$ZodVoid",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r};}),Fp=z("$ZodDate",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value);}catch{}let n=r.value,s=n instanceof Date;return s&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...s?{received:"Invalid Date"}:{},inst:t}),r};});function V0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues)),e.value[r]=t.value;}var Bp=z("$ZodArray",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let s=[];for(let o=0;o<n.length;o++){let a=n[o],c=e.element._zod.run({value:a,issues:[]},i);c instanceof Promise?s.push(c.then(l=>V0(l,r,o))):V0(c,r,o);}return s.length?Promise.all(s).then(()=>r):r};});function Mc(t,e,r,i,n,s){let o=r in i;if(t.issues.length){if(n&&s&&!o)return;e.issues.push(...$t(r,t.issues));}if(!o&&!n){t.issues.length||e.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}t.value===void 0?o&&(e.value[r]=void 0):e.value[r]=t.value;}function iS(t){let e=Object.keys(t.shape);for(let i of e)if(!t.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);let r=tf(t.shape);return {...t,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(r)}}function sS(t,e,r,i,n,s){let o=[],a=n.keySet,c=n.catchall._zod,l=c.def.type,u=c.optin==="optional",d=c.optout==="optional";for(let f in e){if(f==="__proto__"||a.has(f))continue;if(l==="never"){o.push(f);continue}let p=c.run({value:e[f],issues:[]},i);p instanceof Promise?t.push(p.then(g=>Mc(g,r,f,e,u,d))):Mc(p,r,f,e,u,d);}return o.length&&r.issues.push({code:"unrecognized_keys",keys:o,input:e,inst:s}),t.length?Promise.all(t).then(()=>r):r}var oS=z("$ZodObject",(t,e)=>{if(Se.init(t,e),!Object.getOwnPropertyDescriptor(e,"shape")?.get){let a=e.shape;Object.defineProperty(e,"shape",{get:()=>{let c={...a};return Object.defineProperty(e,"shape",{value:c}),c}});}let i=zi(()=>iS(e));Oe(t._zod,"propValues",()=>{let a=e.shape,c={};for(let l in a){let u=a[l]._zod;if(u.values){c[l]??(c[l]=new Set);for(let d of u.values)c[l].add(d);}}return c});let n=ni,s=e.catchall,o;t._zod.parse=(a,c)=>{o??(o=i.value);let l=a.value;if(!n(l))return a.issues.push({expected:"object",code:"invalid_type",input:l,inst:t}),a;a.value={};let u=[],d=o.shape;for(let f of o.keys){let p=d[f],g=p._zod.optin==="optional",m=p._zod.optout==="optional",S=p._zod.run({value:l[f],issues:[]},c);S instanceof Promise?u.push(S.then(h=>Mc(h,a,f,l,g,m))):Mc(S,a,f,l,g,m);}return s?sS(u,l,a,c,i.value,t):u.length?Promise.all(u).then(()=>a):a};}),Vp=z("$ZodObjectJIT",(t,e)=>{oS.init(t,e);let r=t._zod.parse,i=zi(()=>iS(e)),n=f=>{let p=new Eo(["shape","payload","ctx"]),g=i.value,m=_=>{let y=cc(_);return `shape[${y}]._zod.run({ value: input[${y}], issues: [] }, ctx)`};p.write("const input = payload.value;");let S=Object.create(null),h=0;for(let _ of g.keys)S[_]=`key_${h++}`;p.write("const newResult = {};");for(let _ of g.keys){let y=S[_],R=cc(_),T=f[_],b=T?._zod?.optin==="optional",E=T?._zod?.optout==="optional";p.write(`const ${y} = ${m(_)};`),b&&E?p.write(`
|
|
6
6
|
if (${y}.issues.length) {
|
|
7
7
|
if (${R} in input) {
|
|
8
8
|
payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|
@@ -61,19 +61,19 @@ import {realpathSync}from'fs';import {readdir,readFile,mkdir,writeFile,stat}from
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
`);}p.write("payload.value = newResult;"),p.write("return payload;");let v=p.compile();return (_,y)=>v(f,_,y)},s,o=ni,a=!ti.jitless,l=a&&Jh.value,u=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=i.value);let g=f.value;return o(g)?a&&l&&p?.async===false&&p.jitless!==true?(s||(s=n(e.shape)),f=s(f,p),u?sS([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)};});function j0(t,e,r,i){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let n=t.filter(s=>!Yn(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>wt(o,i,Je())))}),e)}var Mo=z("$ZodUnion",(t,e)=>{xe.init(t,e),Oe(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Oe(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Oe(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Oe(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>go(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let s=false,o=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)o.push(c),s=true;else {if(c.issues.length===0)return c;o.push(c);}}return s?Promise.all(o).then(a=>j0(a,i,t,n)):j0(o,i,t,n)};});function G0(t,e,r,i){let n=t.filter(s=>s.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>wt(o,i,Je())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:false}),e)}var Vp=z("$ZodXor",(t,e)=>{Mo.init(t,e),e.inclusive=false;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let s=false,o=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(o.push(c),s=true):o.push(c);}return s?Promise.all(o).then(a=>G0(a,i,t,n)):G0(o,i,t,n)};}),jp=z("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=false,Mo.init(t,e);let r=t._zod.parse;Oe(t._zod,"propValues",()=>{let n={};for(let s of e.options){let o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(o)){n[a]||(n[a]=new Set);for(let l of c)n[a].add(l);}}return n});let i=zi(()=>{let n=e.options,s=new Map;for(let o of n){let a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,o);}}return s});t._zod.parse=(n,s)=>{let o=n.value;if(!ni(o))return n.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),n;let a=i.value.get(o?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:o,path:[e.discriminator],inst:t}),n)};}),Gp=z("$ZodIntersection",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,s=e.left._zod.run({value:n,issues:[]},i),o=e.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,l])=>H0(r,c,l)):H0(r,s,o)};});function rp(t,e){if(t===e)return {valid:true,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return {valid:true,data:t};if(Jn(t)&&Jn(e)){let r=Object.keys(e),i=Object.keys(t).filter(s=>r.indexOf(s)!==-1),n={...t,...e};for(let s of i){let o=rp(t[s],e[s]);if(!o.valid)return {valid:false,mergeErrorPath:[s,...o.mergeErrorPath]};n[s]=o.data;}return {valid:true,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],s=e[i],o=rp(n,s);if(!o.valid)return {valid:false,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function H0(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=true;}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=true;else t.issues.push(a);let s=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&t.issues.push({...n,keys:s}),Yn(t))return t;let o=rp(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var Cc=z("$ZodTuple",(t,e)=>{xe.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let o=[],a=q0(r,"optin"),c=q0(r,"optout");if(!e.rest){if(s.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:true,input:s,inst:t,origin:"array"}),i;s.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:t,origin:"array"});}let l=new Array(r.length);for(let u=0;u<r.length;u++){let d=r[u]._zod.run({value:s[u],issues:[]},n);d instanceof Promise?o.push(d.then(f=>{l[u]=f;})):l[u]=d;}if(e.rest){let u=r.length-1,d=s.slice(r.length);for(let f of d){u++;let p=e.rest._zod.run({value:f,issues:[]},n);p instanceof Promise?o.push(p.then(g=>W0(g,i,u))):W0(p,i,u);}}return o.length?Promise.all(o).then(()=>K0(l,i,r,s,c)):K0(l,i,r,s,c)};});function q0(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function W0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues)),e.value[r]=t.value;}function K0(t,e,r,i,n){for(let s=0;s<r.length;s++){let o=t[s],a=s<i.length;if(o.issues.length){if(!a&&s>=n){e.value.length=s;break}e.issues.push(...$t(s,o.issues));}e.value[s]=o.value;}for(let s=e.value.length-1;s>=i.length&&(r[s]._zod.optout==="optional"&&e.value[s]===void 0);s--)e.value.length=s;return e}var Hp=z("$ZodRecord",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Jn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let s=[],o=e.keyType._zod.values;if(o){r.value={};let a=new Set;for(let l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>wt(p,i,Je())),input:l,path:[l],inst:t});continue}let d=u.value,f=e.valueType._zod.run({value:n[l],issues:[]},i);f instanceof Promise?s.push(f.then(p=>{p.issues.length&&r.issues.push(...$t(l,p.issues)),r.value[d]=p.value;})):(f.issues.length&&r.issues.push(...$t(l,f.issues)),r.value[d]=f.value);}let c;for(let l in n)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c});}else {r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&xc.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d);}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>wt(d,i,Je())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...$t(a,d.issues)),r.value[c.value]=d.value;})):(u.issues.length&&r.issues.push(...$t(a,u.issues)),r.value[c.value]=u.value);}}return s.length?Promise.all(s).then(()=>r):r};}),qp=z("$ZodMap",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let s=[];r.value=new Map;for(let[o,a]of n){let c=e.keyType._zod.run({value:o,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?s.push(Promise.all([c,l]).then(([u,d])=>{Z0(u,d,r,o,n,t,i);})):Z0(c,l,r,o,n,t,i);}return s.length?Promise.all(s).then(()=>r):r};});function Z0(t,e,r,i,n,s,o){t.issues.length&&(_o.has(typeof i)?r.issues.push(...$t(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:t.issues.map(a=>wt(a,o,Je()))})),e.issues.length&&(_o.has(typeof i)?r.issues.push(...$t(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:i,issues:e.issues.map(a=>wt(a,o,Je()))})),r.value.set(t.value,e.value);}var Wp=z("$ZodSet",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let o of n){let a=e.valueType._zod.run({value:o,issues:[]},i);a instanceof Promise?s.push(a.then(c=>X0(c,r))):X0(a,r);}return s.length?Promise.all(s).then(()=>r):r};});function X0(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value);}var Kp=z("$ZodEnum",(t,e)=>{xe.init(t,e);let r=mo(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>_o.has(typeof n)).map(n=>typeof n=="string"?Zt(n):n.toString()).join("|")})$`),t._zod.parse=(n,s)=>{let o=n.value;return i.has(o)||n.issues.push({code:"invalid_value",values:r,input:o,inst:t}),n};}),Zp=z("$ZodLiteral",(t,e)=>{if(xe.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Zt(i):i?Zt(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),i};}),Xp=z("$ZodFile",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r};}),Jp=z("$ZodTransform",(t,e)=>{xe.init(t,e),t._zod.optin="optional",t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return (n instanceof Promise?n:Promise.resolve(n)).then(o=>(r.value=o,r.fallback=true,r));if(n instanceof Promise)throw new on;return r.value=n,r.fallback=true,r};});function J0(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Pc=z("$ZodOptional",(t,e)=>{xe.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${go(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,s=e.innerType._zod.run(r,i);return s instanceof Promise?s.then(o=>J0(o,n)):J0(s,n)}return r.value===void 0?r:e.innerType._zod.run(r,i)};}),Yp=z("$ZodExactOptional",(t,e)=>{Pc.init(t,e),Oe(t._zod,"values",()=>e.innerType._zod.values),Oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i);}),Qp=z("$ZodNullable",(t,e)=>{xe.init(t,e),Oe(t._zod,"optin",()=>e.innerType._zod.optin),Oe(t._zod,"optout",()=>e.innerType._zod.optout),Oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${go(r.source)}|null)$`):void 0}),Oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i);}),em=z("$ZodDefault",(t,e)=>{xe.init(t,e),t._zod.optin="optional",Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Y0(s,e)):Y0(n,e)};});function Y0(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var tm=z("$ZodPrefault",(t,e)=>{xe.init(t,e),t._zod.optin="optional",Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i));}),nm=z("$ZodNonOptional",(t,e)=>{xe.init(t,e),Oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Q0(s,t)):Q0(n,t)};});function Q0(t,e){return !t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var rm=z("$ZodSuccess",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.issues.length===0,r)):(r.value=n.issues.length===0,r)};}),im=z("$ZodCatch",(t,e)=>{xe.init(t,e),t._zod.optin="optional",Oe(t._zod,"optout",()=>e.innerType._zod.optout),Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(o=>wt(o,i,Je()))},input:r.value}),r.issues=[],r.fallback=true),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(s=>wt(s,i,Je()))},input:r.value}),r.issues=[],r.fallback=true),r)};}),sm=z("$ZodNaN",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r);}),Nc=z("$ZodPipe",(t,e)=>{xe.init(t,e),Oe(t._zod,"values",()=>e.in._zod.values),Oe(t._zod,"optin",()=>e.in._zod.optin),Oe(t._zod,"optout",()=>e.out._zod.optout),Oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let s=e.out._zod.run(r,i);return s instanceof Promise?s.then(o=>Rc(o,e.in,i)):Rc(s,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(s=>Rc(s,e.out,i)):Rc(n,e.out,i)};});function Rc(t,e,r){return t.issues.length?(t.aborted=true,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Ao=z("$ZodCodec",(t,e)=>{xe.init(t,e),Oe(t._zod,"values",()=>e.in._zod.values),Oe(t._zod,"optin",()=>e.in._zod.optin),Oe(t._zod,"optout",()=>e.out._zod.optout),Oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let s=e.in._zod.run(r,i);return s instanceof Promise?s.then(o=>Ec(o,e,i)):Ec(s,e,i)}else {let s=e.out._zod.run(r,i);return s instanceof Promise?s.then(o=>Ec(o,e,i)):Ec(s,e,i)}};});function Ec(t,e,r){if(t.issues.length)return t.aborted=true,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(s=>wc(t,s,e.out,r)):wc(t,n,e.out,r)}else {let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(s=>wc(t,s,e.in,r)):wc(t,n,e.in,r)}}function wc(t,e,r,i){return t.issues.length?(t.aborted=true,t):r._zod.run({value:e,issues:t.issues},i)}var om=z("$ZodPreprocess",(t,e)=>{Nc.init(t,e);}),am=z("$ZodReadonly",(t,e)=>{xe.init(t,e),Oe(t._zod,"propValues",()=>e.innerType._zod.propValues),Oe(t._zod,"values",()=>e.innerType._zod.values),Oe(t._zod,"optin",()=>e.innerType?._zod?.optin),Oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(eS):eS(n)};});function eS(t){return t.value=Object.freeze(t.value),t}var cm=z("$ZodTemplateLiteral",(t,e)=>{xe.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let s=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(s,o));}else if(i===null||Qh.has(typeof i))r.push(Zt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i);}),lm=z("$ZodFunction",(t,e)=>(xe.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?uc(t._def.input,i):i,s=Reflect.apply(r,this,n);return t._def.output?uc(t._def.output,s):s}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await dc(t._def.input,i):i,s=await Reflect.apply(r,this,n);return t._def.output?await dc(t._def.output,s):s}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Cc({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),um=z("$ZodPromise",(t,e)=>{xe.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i));}),dm=z("$ZodLazy",(t,e)=>{xe.init(t,e),Oe(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Oe(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Oe(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Oe(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Oe(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i);}),hm=z("$ZodCustom",(t,e)=>{We.init(t,e),xe.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(s=>tS(s,r,i,t));tS(n,r,i,t);};});function tS(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push($i(n));}}var Co={};An(Co,{ar:()=>aS,az:()=>cS,be:()=>uS,bg:()=>dS,ca:()=>hS,cs:()=>fS,da:()=>pS,de:()=>mS,el:()=>gS,en:()=>Oc,eo:()=>_S,es:()=>vS,fa:()=>yS,fi:()=>SS,fr:()=>xS,frCA:()=>bS,he:()=>TS,hr:()=>RS,hu:()=>ES,hy:()=>MS,id:()=>AS,is:()=>IS,it:()=>CS,ja:()=>PS,ka:()=>NS,kh:()=>OS,km:()=>zc,ko:()=>zS,lt:()=>kS,mk:()=>DS,ms:()=>LS,nl:()=>US,no:()=>FS,ota:()=>BS,pl:()=>jS,ps:()=>VS,pt:()=>GS,ro:()=>HS,ru:()=>WS,sl:()=>KS,sv:()=>ZS,ta:()=>XS,th:()=>JS,tr:()=>YS,ua:()=>QS,uk:()=>$c,ur:()=>ex,uz:()=>tx,vi:()=>nx,yo:()=>sx,zhCN:()=>rx,zhTW:()=>ix});var DM=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case "invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Z(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${r[s.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case "not_multiple_of":return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case "unrecognized_keys":return `\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${F(n.keys,"\u060C ")}`;case "invalid_key":return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case "invalid_union":return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case "invalid_element":return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function aS(){return {localeError:DM()}}var LM=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${a}`}case "invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[s.format]??n.format}`}case "not_multiple_of":return `Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case "unrecognized_keys":return `Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case "invalid_union":return "Yanl\u0131\u015F d\u0259y\u0259r";case "invalid_element":return `${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return "Yanl\u0131\u015F d\u0259y\u0259r"}}};function cS(){return {localeError:LM()}}function lS(t,e,r,i){let n=Math.abs(t),s=n%10,o=n%100;return o>=11&&o<=19?i:s===1?e:s>=2&&s<=4?r:i}var UM=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Z(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=lS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.maximum.toString()} ${c}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=lS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.minimum.toString()} ${c}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case "invalid_element":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function uS(){return {localeError:UM()}}var FM=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${Z(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;if(s.format==="starts_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case "invalid_element":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function dS(){return {localeError:FM()}}var BM=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${a}`}case "invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${Z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${F(n.values," o ")}`;case "too_big":{let s=n.inclusive?"com a m\xE0xim":"menys de",o=e(n.origin);return o?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${s} ${n.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(n.origin);return o?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${s} ${n.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${r[s.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case "unrecognized_keys":return `Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Clau inv\xE0lida a ${n.origin}`;case "invalid_union":return "Entrada inv\xE0lida";case "invalid_element":return `Element inv\xE0lid a ${n.origin}`;default:return "Entrada inv\xE0lida"}}};function hS(){return {localeError:BM()}}var VM=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${a}`}case "invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${r[s.format]??n.format}`}case "not_multiple_of":return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case "unrecognized_keys":return `Nezn\xE1m\xE9 kl\xED\u010De: ${F(n.keys,", ")}`;case "invalid_key":return `Neplatn\xFD kl\xED\u010D v ${n.origin}`;case "invalid_union":return "Neplatn\xFD vstup";case "invalid_element":return `Neplatn\xE1 hodnota v ${n.origin}`;default:return "Neplatn\xFD vstup"}}};function fS(){return {localeError:VM()}}var jM=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${s}, fik ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${Z(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`For stor: forventede ${a??"value"} ${o.verb} ${s} ${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`For lille: forventede ${a} ${o.verb} ${s} ${n.minimum.toString()} ${o.unit}`:`For lille: forventede ${a} havde ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??n.format}`}case "not_multiple_of":return `Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8gle i ${n.origin}`;case "invalid_union":return "Ugyldigt input: matcher ingen af de tilladte typer";case "invalid_element":return `Ugyldig v\xE6rdi i ${n.origin}`;default:return "Ugyldigt input"}}};function pS(){return {localeError:jM()}}var GM=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${a}`}case "invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ist`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ist`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${r[s.format]??n.format}`}case "not_multiple_of":return `Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case "unrecognized_keys":return `${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case "invalid_union":return "Ung\xFCltige Eingabe";case "invalid_element":return `Ung\xFCltiger Wert in ${n.origin}`;default:return "Ung\xFCltige Eingabe"}}};function mS(){return {localeError:GM()}}var HM=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(n){return t[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${s}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case "invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${Z(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${n.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${n.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${s.prefix}"`:s.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${s.suffix}"`:s.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${s.includes}"`:s.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${s.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[s.format]??n.format}`}case "not_multiple_of":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case "unrecognized_keys":return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case "invalid_union":return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case "invalid_element":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function gS(){return {localeError:HM()}}var qM=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return `Invalid input: expected ${s}, received ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${Z(n.values[0])}`:`Invalid option: expected one of ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${o.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${n.divisor}`;case "unrecognized_keys":return `Unrecognized key${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Invalid key in ${n.origin}`;case "invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case "invalid_element":return `Invalid value in ${n.origin}`;default:return "Invalid input"}}};function Oc(){return {localeError:qM()}}var WM=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${a}`}case "invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${s}${n.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${r[s.format]??n.format}`}case "not_multiple_of":return `Nevalida nombro: devas esti oblo de ${n.divisor}`;case "unrecognized_keys":return `Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Nevalida \u015Dlosilo en ${n.origin}`;case "invalid_union":return "Nevalida enigo";case "invalid_element":return `Nevalida valoro en ${n.origin}`;default:return "Nevalida enigo"}}};function _S(){return {localeError:WM()}}var KM=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${Z(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${s}${n.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${r[s.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return "Entrada inv\xE1lida"}}};function vS(){return {localeError:KM()}}var ZM=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case "invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Z(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${F(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[s.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case "not_multiple_of":return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case "unrecognized_keys":return `\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${F(n.keys,", ")}`;case "invalid_key":return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case "invalid_union":return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case "invalid_element":return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function yS(){return {localeError:ZM()}}var XM=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${a}`}case "invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${s}${n.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${s}${n.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${r[s.format]??n.format}`}case "not_multiple_of":return `Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case "unrecognized_keys":return `${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${F(n.keys,", ")}`;case "invalid_key":return "Virheellinen avain tietueessa";case "invalid_union":return "Virheellinen unioni";case "invalid_element":return "Virheellinen arvo joukossa";default:return "Virheellinen sy\xF6te"}}};function SS(){return {localeError:XM()}}var JM=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${a} re\xE7u`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${Z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${F(n.values,"|")} attendue`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Trop grand : ${i[n.origin]??"valeur"} doit ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Trop petit : ${i[n.origin]??"valeur"} doit ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : ${i[n.origin]??"valeur"} doit \xEAtre ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${r[s.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${F(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};function xS(){return {localeError:JM()}}var YM=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${a}`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${Z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"\u2264":"<",o=e(n.origin);return o?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${s}${n.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"\u2265":">",o=e(n.origin);return o?`Trop petit : attendu que ${n.origin} ait ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${n.origin} soit ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${r[s.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${F(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};function bS(){return {localeError:YM()}}var QM=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,s=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case "invalid_type":{let u=l.expected,d=c[u??""]??i(u),f=X(l.input),p=c[f]??t[f]?.label??f;return /^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case "invalid_value":{if(l.values.length===1)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Z(l.values[0])}`;let u=l.values.map(p=>Z(p));if(l.values.length===2)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case "too_big":{let u=o(l.origin),d=n(l.origin??"value");if(l.origin==="string")return `${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?"<=":"<",p=s(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()}`}case "too_small":{let u=o(l.origin),d=n(l.origin??"value");if(l.origin==="string")return `${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let S=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let m=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?">=":">",p=s(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()}`}case "invalid_format":{let u=l;if(u.format==="starts_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,g=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return `${f} \u05DC\u05D0 ${g}`}case "not_multiple_of":return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case "unrecognized_keys":return `\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${F(l.keys,", ")}`;case "invalid_key":return "\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case "invalid_union":return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case "invalid_element":return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function TS(){return {localeError:QM()}}var eA=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${s}, a primljeno je ${a}`}case "invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${Z(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${s}${n.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Premalo: o\u010Dekivano da ${a} ima ${s}${n.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${s.prefix}"`:s.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${s.suffix}"`:s.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${s.includes}"`:s.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${s.pattern}`:`Neispravna ${r[s.format]??n.format}`}case "not_multiple_of":return `Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case "unrecognized_keys":return `Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${F(n.keys,", ")}`;case "invalid_key":return `Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case "invalid_union":return "Neispravan unos";case "invalid_element":return `Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return "Neispravan unos"}}};function RS(){return {localeError:eA()}}var tA=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${a}`}case "invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${n.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${s}${n.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[s.format]??n.format}`}case "not_multiple_of":return `\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case "unrecognized_keys":return `Ismeretlen kulcs${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\xC9rv\xE9nytelen kulcs ${n.origin}`;case "invalid_union":return "\xC9rv\xE9nytelen bemenet";case "invalid_element":return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return "\xC9rv\xE9nytelen bemenet"}}};function ES(){return {localeError:tA()}}function wS(t,e,r){return Math.abs(t)===1?e:r}function Bi(t){if(!t)return "";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var nA=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case "invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Z(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=wS(a,o.unit.one,o.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.maximum.toString()} ${c}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=wS(a,o.unit.one,o.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.minimum.toString()} ${c}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin)} \u056C\u056B\u0576\u056B ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[s.format]??n.format}`}case "not_multiple_of":return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case "unrecognized_keys":return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${F(n.keys,", ")}`;case "invalid_key":return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Bi(n.origin)}-\u0578\u0582\u0574`;case "invalid_union":return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case "invalid_element":return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Bi(n.origin)}-\u0578\u0582\u0574`;default:return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function MS(){return {localeError:nA()}}var rA=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${s}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${Z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: diharapkan ${n.origin} memiliki ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${r[s.format]??n.format} tidak valid`}case "not_multiple_of":return `Angka tidak valid: harus kelipatan dari ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Kunci tidak valid di ${n.origin}`;case "invalid_union":return "Input tidak valid";case "invalid_element":return `Nilai tidak valid di ${n.origin}`;default:return "Input tidak valid"}}};function AS(){return {localeError:rA()}}var iA=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${s}`}case "invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${Z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${s}${n.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${s}${n.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${r[s.format]??n.format}`}case "not_multiple_of":return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case "unrecognized_keys":return `\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${F(n.keys,", ")}`;case "invalid_key":return `Rangur lykill \xED ${n.origin}`;case "invalid_union":return "Rangt gildi";case "invalid_element":return `Rangt gildi \xED ${n.origin}`;default:return "Rangt gildi"}}};function IS(){return {localeError:iA()}}var sA=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${s}, ricevuto ${a}`}case "invalid_value":return n.values.length===1?`Input non valido: atteso ${Z(n.values[0])}`:`Opzione non valida: atteso uno tra ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Troppo grande: ${n.origin??"valore"} deve avere ${s}${n.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Troppo piccolo: ${n.origin} deve avere ${s}${n.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${n.origin} deve essere ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Input non valido: ${r[s.format]??n.format}`}case "not_multiple_of":return `Numero non valido: deve essere un multiplo di ${n.divisor}`;case "unrecognized_keys":return `Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${F(n.keys,", ")}`;case "invalid_key":return `Chiave non valida in ${n.origin}`;case "invalid_union":return "Input non valido";case "invalid_element":return `Valore non valido in ${n.origin}`;default:return "Input non valido"}}};function CS(){return {localeError:sA()}}var oA=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case "invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${F(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "too_big":{let s=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(n.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "too_small":{let s=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(n.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[s.format]??n.format}`}case "not_multiple_of":return `\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "unrecognized_keys":return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${F(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case "invalid_union":return "\u7121\u52B9\u306A\u5165\u529B";case "invalid_element":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return "\u7121\u52B9\u306A\u5165\u529B"}}};function PS(){return {localeError:oA()}}var aA=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case "invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${Z(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${F(n.values,"|")}-\u10D3\u10D0\u10DC`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case "unrecognized_keys":return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case "invalid_union":return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case "invalid_element":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function NS(){return {localeError:aA()}}var cA=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case "invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Z(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case "unrecognized_keys":return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${F(n.keys,", ")}`;case "invalid_key":return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case "invalid_union":return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case "invalid_element":return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function zc(){return {localeError:cA()}}function OS(){return zc()}var lA=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case "invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${F(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "too_big":{let s=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${s}${o}`}case "too_small":{let s=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${s}${o}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[s.format]??n.format}`}case "not_multiple_of":return `\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "unrecognized_keys":return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${F(n.keys,", ")}`;case "invalid_key":return `\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case "invalid_union":return "\uC798\uBABB\uB41C \uC785\uB825";case "invalid_element":return `\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return "\uC798\uBABB\uB41C \uC785\uB825"}}};function zS(){return {localeError:lA()}}var Io=t=>t.charAt(0).toUpperCase()+t.slice(1);function $S(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var uA=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,s,o,a){let c=t[n]??null;return c===null?c:{unit:c.unit[s],verb:c.verb[a][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${s}`}case "invalid_value":return n.values.length===1?`Privalo b\u016Bti ${Z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${F(n.values,"|")} pasirinkim\u0173`;case "too_big":{let s=i[n.origin]??n.origin,o=e(n.origin,$S(Number(n.maximum)),n.inclusive??false,"smaller");if(o?.verb)return `${Io(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.maximum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return `${Io(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${o?.unit}`}case "too_small":{let s=i[n.origin]??n.origin,o=e(n.origin,$S(Number(n.minimum)),n.inclusive??false,"bigger");if(o?.verb)return `${Io(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.minimum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return `${Io(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${o?.unit}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${r[s.format]??n.format}`}case "not_multiple_of":return `Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case "unrecognized_keys":return `Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${F(n.keys,", ")}`;case "invalid_key":return "Rastas klaidingas raktas";case "invalid_union":return "Klaidinga \u012Fvestis";case "invalid_element":{let s=i[n.origin]??n.origin;return `${Io(s??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return "Klaidinga \u012Fvestis"}}};function kS(){return {localeError:uA()}}var dA=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${Z(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case "invalid_union":return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case "invalid_element":return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function DS(){return {localeError:dA()}}var hA=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${s}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${Z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: dijangka ${n.origin??"nilai"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: dijangka ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${r[s.format]??n.format} tidak sah`}case "not_multiple_of":return `Nombor tidak sah: perlu gandaan ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali: ${F(n.keys,", ")}`;case "invalid_key":return `Kunci tidak sah dalam ${n.origin}`;case "invalid_union":return "Input tidak sah";case "invalid_element":return `Nilai tidak sah dalam ${n.origin}`;default:return "Input tidak sah"}}};function LS(){return {localeError:hA()}}var fA=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${s}, ontving ${a}`}case "invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${Z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return o?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} is`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return o?`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} is`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${r[s.format]??n.format}`}case "not_multiple_of":return `Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case "unrecognized_keys":return `Onbekende key${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Ongeldige key in ${n.origin}`;case "invalid_union":return "Ongeldige invoer";case "invalid_element":return `Ongeldige waarde in ${n.origin}`;default:return "Ongeldige invoer"}}};function US(){return {localeError:fA()}}var pA=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${s}, fikk ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${Z(n.values[0])}`:`Ugyldig valg: forventet en av ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??n.format}`}case "not_multiple_of":return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8kkel i ${n.origin}`;case "invalid_union":return "Ugyldig input";case "invalid_element":return `Ugyldig verdi i ${n.origin}`;default:return "Ugyldig input"}}};function FS(){return {localeError:pA()}}var mA=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${Z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} olmal\u0131yd\u0131.`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} olmal\u0131yd\u0131.`}case "invalid_format":{let s=n;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[s.format]??n.format}`}case "not_multiple_of":return `F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case "invalid_union":return "Giren tan\u0131namad\u0131.";case "invalid_element":return `${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return "K\u0131ymet tan\u0131namad\u0131."}}};function BS(){return {localeError:mA()}}var gA=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case "invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${F(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0648\u064A`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0648\u064A`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[s.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case "not_multiple_of":return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case "unrecognized_keys":return `\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case "invalid_union":return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case "invalid_element":return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function VS(){return {localeError:gA()}}var _A=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${a}`}case "invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[s.format]??n.format}`}case "not_multiple_of":return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case "unrecognized_keys":return `Nierozpoznane klucze${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Nieprawid\u0142owy klucz w ${n.origin}`;case "invalid_union":return "Nieprawid\u0142owe dane wej\u015Bciowe";case "invalid_element":return `Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return "Nieprawid\u0142owe dane wej\u015Bciowe"}}};function jS(){return {localeError:_A()}}var vA=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${Z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Muito pequeno: esperado que ${n.origin} tivesse ${s}${n.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${r[s.format]??n.format} inv\xE1lido`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Chave inv\xE1lida em ${n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido em ${n.origin}`;default:return "Campo inv\xE1lido"}}};function GS(){return {localeError:vA()}}var yA=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(n){return t[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return `Intrare invalid\u0103: a\u0219teptat ${s}, primit ${a}`}case "invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Z(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Prea mic: a\u0219teptat ca ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${s.prefix}"`:s.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${s.suffix}"`:s.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${s.includes}"`:s.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${s.pattern}`:`Format invalid: ${r[s.format]??n.format}`}case "not_multiple_of":return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case "unrecognized_keys":return `Chei nerecunoscute: ${F(n.keys,", ")}`;case "invalid_key":return `Cheie invalid\u0103 \xEEn ${n.origin}`;case "invalid_union":return "Intrare invalid\u0103";case "invalid_element":return `Valoare invalid\u0103 \xEEn ${n.origin}`;default:return "Intrare invalid\u0103"}}};function HS(){return {localeError:yA()}}function qS(t,e,r,i){let n=Math.abs(t),s=n%10,o=n%100;return o>=11&&o<=19?i:s===1?e:s>=2&&s<=4?r:i}var SA=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Z(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=qS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.maximum.toString()} ${c}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=qS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.minimum.toString()} ${c}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case "invalid_element":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function WS(){return {localeError:SA()}}var xA=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${a}`}case "invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${s}${n.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${s}${n.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${r[s.format]??n.format}`}case "not_multiple_of":return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case "unrecognized_keys":return `Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${F(n.keys,", ")}`;case "invalid_key":return `Neveljaven klju\u010D v ${n.origin}`;case "invalid_union":return "Neveljaven vnos";case "invalid_element":return `Neveljavna vrednost v ${n.origin}`;default:return "Neveljaven vnos"}}};function KS(){return {localeError:xA()}}var bA=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${a}`}case "invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${r[s.format]??n.format}`}case "not_multiple_of":return `Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case "invalid_union":return "Ogiltig input";case "invalid_element":return `Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return "Ogiltig input"}}};function ZS(){return {localeError:bA()}}var TA=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case "invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Z(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${F(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case "unrecognized_keys":return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case "invalid_union":return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case "invalid_element":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function XS(){return {localeError:TA()}}var RA=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case "invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Z(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case "unrecognized_keys":return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${F(n.keys,", ")}`;case "invalid_key":return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case "invalid_union":return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case "invalid_element":return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function JS(){return {localeError:RA()}}var EA=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[s.format]??n.format}`}case "not_multiple_of":return `Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case "invalid_union":return "Ge\xE7ersiz de\u011Fer";case "invalid_element":return `${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return "Ge\xE7ersiz de\u011Fer"}}};function YS(){return {localeError:EA()}}var wA=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Z(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case "invalid_element":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function $c(){return {localeError:wA()}}function QS(){return $c()}var MA=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case "invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${F(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${s}${n.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${s}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case "unrecognized_keys":return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${F(n.keys,"\u060C ")}`;case "invalid_key":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case "invalid_union":return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case "invalid_element":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function ex(){return {localeError:MA()}}var AA=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${a}`}case "invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Z(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[s.format]??n.format}`}case "not_multiple_of":return `Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case "unrecognized_keys":return `Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} dagi kalit noto\u2018g\u2018ri`;case "invalid_union":return "Noto\u2018g\u2018ri kirish";case "invalid_element":return `${n.origin} da noto\u2018g\u2018ri qiymat`;default:return "Noto\u2018g\u2018ri kirish"}}};function tx(){return {localeError:AA()}}var IA=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case "invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${r[s.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case "not_multiple_of":return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case "unrecognized_keys":return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${F(n.keys,", ")}`;case "invalid_key":return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case "invalid_union":return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case "invalid_element":return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function nx(){return {localeError:IA()}}var CA=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case "invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${r[s.format]??n.format}`}case "not_multiple_of":return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case "unrecognized_keys":return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case "invalid_union":return "\u65E0\u6548\u8F93\u5165";case "invalid_element":return `${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return "\u65E0\u6548\u8F93\u5165"}}};function rx(){return {localeError:CA()}}var PA=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${a}`}case "invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case "unrecognized_keys":return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${F(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case "invalid_union":return "\u7121\u6548\u7684\u8F38\u5165\u503C";case "invalid_element":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return "\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function ix(){return {localeError:PA()}}var NA=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case "invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${o.verb} ${s}${n.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.maximum}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${o.verb} ${s}${n.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.minimum}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${r[s.format]??n.format}`}case "not_multiple_of":return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case "unrecognized_keys":return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${F(n.keys,", ")}`;case "invalid_key":return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case "invalid_union":return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case "invalid_element":return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function sx(){return {localeError:NA()}}var ox,fm=Symbol("ZodOutput"),pm=Symbol("ZodInput"),kc=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Dc(){return new kc}(ox=globalThis).__zod_globalRegistry??(ox.__zod_globalRegistry=Dc());var pt=globalThis.__zod_globalRegistry;function mm(t,e){return new t({type:"string",...Y(e)})}function gm(t,e){return new t({type:"string",coerce:true,...Y(e)})}function Lc(t,e){return new t({type:"string",format:"email",check:"string_format",abort:false,...Y(e)})}function Po(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:false,...Y(e)})}function Uc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,...Y(e)})}function Fc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Y(e)})}function Bc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Y(e)})}function Vc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Y(e)})}function No(t,e){return new t({type:"string",format:"url",check:"string_format",abort:false,...Y(e)})}function jc(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:false,...Y(e)})}function Gc(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:false,...Y(e)})}function Hc(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:false,...Y(e)})}function qc(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:false,...Y(e)})}function Wc(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:false,...Y(e)})}function Kc(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:false,...Y(e)})}function Zc(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:false,...Y(e)})}function Xc(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:false,...Y(e)})}function Jc(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:false,...Y(e)})}function _m(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:false,...Y(e)})}function Yc(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:false,...Y(e)})}function Qc(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:false,...Y(e)})}function el(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:false,...Y(e)})}function tl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:false,...Y(e)})}function nl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:false,...Y(e)})}function rl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:false,...Y(e)})}var vm={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function ym(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Y(e)})}function Sm(t,e){return new t({type:"string",format:"date",check:"string_format",...Y(e)})}function xm(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Y(e)})}function bm(t,e){return new t({type:"string",format:"duration",check:"string_format",...Y(e)})}function Tm(t,e){return new t({type:"number",checks:[],...Y(e)})}function Rm(t,e){return new t({type:"number",coerce:true,checks:[],...Y(e)})}function Em(t,e){return new t({type:"number",check:"number_format",abort:false,format:"safeint",...Y(e)})}function wm(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float32",...Y(e)})}function Mm(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float64",...Y(e)})}function Am(t,e){return new t({type:"number",check:"number_format",abort:false,format:"int32",...Y(e)})}function Im(t,e){return new t({type:"number",check:"number_format",abort:false,format:"uint32",...Y(e)})}function Cm(t,e){return new t({type:"boolean",...Y(e)})}function Pm(t,e){return new t({type:"boolean",coerce:true,...Y(e)})}function Nm(t,e){return new t({type:"bigint",...Y(e)})}function Om(t,e){return new t({type:"bigint",coerce:true,...Y(e)})}function zm(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"int64",...Y(e)})}function $m(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...Y(e)})}function km(t,e){return new t({type:"symbol",...Y(e)})}function Dm(t,e){return new t({type:"undefined",...Y(e)})}function Lm(t,e){return new t({type:"null",...Y(e)})}function Um(t){return new t({type:"any"})}function Fm(t){return new t({type:"unknown"})}function Bm(t,e){return new t({type:"never",...Y(e)})}function Vm(t,e){return new t({type:"void",...Y(e)})}function jm(t,e){return new t({type:"date",...Y(e)})}function Gm(t,e){return new t({type:"date",coerce:true,...Y(e)})}function Hm(t,e){return new t({type:"nan",...Y(e)})}function _n(t,e){return new bc({check:"less_than",...Y(e),value:t,inclusive:false})}function Vt(t,e){return new bc({check:"less_than",...Y(e),value:t,inclusive:true})}function vn(t,e){return new Tc({check:"greater_than",...Y(e),value:t,inclusive:false})}function Mt(t,e){return new Tc({check:"greater_than",...Y(e),value:t,inclusive:true})}function il(t){return vn(0,t)}function sl(t){return _n(0,t)}function ol(t){return Vt(0,t)}function al(t){return Mt(0,t)}function Qn(t,e){return new Lf({check:"multiple_of",...Y(e),value:t})}function er(t,e){return new Bf({check:"max_size",...Y(e),maximum:t})}function yn(t,e){return new Vf({check:"min_size",...Y(e),minimum:t})}function si(t,e){return new jf({check:"size_equals",...Y(e),size:t})}function oi(t,e){return new Gf({check:"max_length",...Y(e),maximum:t})}function Cn(t,e){return new Hf({check:"min_length",...Y(e),minimum:t})}function ai(t,e){return new qf({check:"length_equals",...Y(e),length:t})}function Vi(t,e){return new Wf({check:"string_format",format:"regex",...Y(e),pattern:t})}function ji(t){return new Kf({check:"string_format",format:"lowercase",...Y(t)})}function Gi(t){return new Zf({check:"string_format",format:"uppercase",...Y(t)})}function Hi(t,e){return new Xf({check:"string_format",format:"includes",...Y(e),includes:t})}function qi(t,e){return new Jf({check:"string_format",format:"starts_with",...Y(e),prefix:t})}function Wi(t,e){return new Yf({check:"string_format",format:"ends_with",...Y(e),suffix:t})}function cl(t,e,r){return new Qf({check:"property",property:t,schema:e,...Y(r)})}function Ki(t,e){return new ep({check:"mime_type",mime:t,...Y(e)})}function an(t){return new tp({check:"overwrite",tx:t})}function Zi(t){return an(e=>e.normalize(t))}function Xi(){return an(t=>t.trim())}function Ji(){return an(t=>t.toLowerCase())}function Yi(){return an(t=>t.toUpperCase())}function Qi(){return an(t=>Xh(t))}function qm(t,e,r){return new t({type:"array",element:e,...Y(r)})}function zA(t,e,r){return new t({type:"union",options:e,...Y(r)})}function $A(t,e,r){return new t({type:"union",options:e,inclusive:false,...Y(r)})}function kA(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...Y(i)})}function DA(t,e,r){return new t({type:"intersection",left:e,right:r})}function LA(t,e,r,i){let n=r instanceof xe,s=n?i:r,o=n?r:null;return new t({type:"tuple",items:e,rest:o,...Y(s)})}function UA(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...Y(i)})}function FA(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...Y(i)})}function BA(t,e,r){return new t({type:"set",valueType:e,...Y(r)})}function VA(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...Y(r)})}function jA(t,e,r){return new t({type:"enum",entries:e,...Y(r)})}function GA(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Y(r)})}function Wm(t,e){return new t({type:"file",...Y(e)})}function HA(t,e){return new t({type:"transform",transform:e})}function qA(t,e){return new t({type:"optional",innerType:e})}function WA(t,e){return new t({type:"nullable",innerType:e})}function KA(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Yh(r)}})}function ZA(t,e,r){return new t({type:"nonoptional",innerType:e,...Y(r)})}function XA(t,e){return new t({type:"success",innerType:e})}function JA(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function YA(t,e,r){return new t({type:"pipe",in:e,out:r})}function QA(t,e){return new t({type:"readonly",innerType:e})}function eI(t,e,r){return new t({type:"template_literal",parts:e,...Y(r)})}function tI(t,e){return new t({type:"lazy",getter:e})}function nI(t,e){return new t({type:"promise",innerType:e})}function Km(t,e,r){let i=Y(r);return i.abort??(i.abort=true),new t({type:"custom",check:"custom",fn:e,...i})}function Zm(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Y(r)})}function Xm(t,e){let r=ax(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push($i(n,i.value,r._zod.def));else {let s=n;s.fatal&&(s.continue=false),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push($i(s));}},t(i.value,i)),e);return r}function ax(t,e){let r=new We({check:"custom",...Y(e)});return r._zod.check=t,r}function Jm(t){let e=new We({check:"describe"});return e._zod.onattach=[r=>{let i=pt.get(r)??{};pt.add(r,{...i,description:t});}],e._zod.check=()=>{},e}function Ym(t){let e=new We({check:"meta"});return e._zod.onattach=[r=>{let i=pt.get(r)??{};pt.add(r,{...i,...t});}],e._zod.check=()=>{},e}function Qm(t,e){let r=Y(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let s=new Set(i),o=new Set(n),a=t.Codec??Ao,c=t.Boolean??wo,l=t.String??ii,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((p,g)=>{let m=p;return r.case!=="sensitive"&&(m=m.toLowerCase()),s.has(m)?true:o.has(m)?false:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...o],input:g.value,inst:f,continue:false}),{})}),reverseTransform:((p,g)=>p===true?i[0]||"true":n[0]||"false"),error:r.error});return f}function es(t,e,r,i={}){let n=Y(i),s={...Y(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(s.pattern=r),new t(s)}function tr(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??pt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Be(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let a=t._zod.toJSONSchema?.();if(a)o.schema=a;else {let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,u);else {let f=o.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,f,u);}let d=t._zod.parent;d&&(o.ref||(o.ref=d),Be(d,e,u),e.seen.get(d).isParent=true);}let c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&At(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function nr(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let o of t.seen.entries()){let a=t.metadataRegistry.get(o[0])?.id;if(a){let c=i.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0]);}}let n=o=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(o[0])?.id,f=t.external.uri??(g=>g);if(d)return {ref:f(d)};let p=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(o[1]===r)return {ref:"#"};let l=`#/${a}/`,u=o[1].schema.id??`__schema${t.counter++}`;return {defId:u,ref:l+u}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:c,defId:l}=n(o);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c;};if(t.cycles==="throw")for(let o of t.seen.entries()){let a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
64
|
+
`);}p.write("payload.value = newResult;"),p.write("return payload;");let v=p.compile();return (_,y)=>v(f,_,y)},s,o=ni,a=!ti.jitless,l=a&&Yh.value,u=e.catchall,d;t._zod.parse=(f,p)=>{d??(d=i.value);let g=f.value;return o(g)?a&&l&&p?.async===false&&p.jitless!==true?(s||(s=n(e.shape)),f=s(f,p),u?sS([],g,f,p,d,t):f):r(f,p):(f.issues.push({expected:"object",code:"invalid_type",input:g,inst:t}),f)};});function j0(t,e,r,i){for(let s of t)if(s.issues.length===0)return e.value=s.value,e;let n=t.filter(s=>!Yn(s));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>wt(o,i,Je())))}),e)}var Mo=z("$ZodUnion",(t,e)=>{Se.init(t,e),Oe(t._zod,"optin",()=>e.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Oe(t._zod,"optout",()=>e.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Oe(t._zod,"values",()=>{if(e.options.every(i=>i._zod.values))return new Set(e.options.flatMap(i=>Array.from(i._zod.values)))}),Oe(t._zod,"pattern",()=>{if(e.options.every(i=>i._zod.pattern)){let i=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>go(n.source)).join("|")})$`)}});let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let s=false,o=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);if(c instanceof Promise)o.push(c),s=true;else {if(c.issues.length===0)return c;o.push(c);}}return s?Promise.all(o).then(a=>j0(a,i,t,n)):j0(o,i,t,n)};});function G0(t,e,r,i){let n=t.filter(s=>s.issues.length===0);return n.length===1?(e.value=n[0].value,e):(n.length===0?e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(s=>s.issues.map(o=>wt(o,i,Je())))}):e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:[],inclusive:false}),e)}var jp=z("$ZodXor",(t,e)=>{Mo.init(t,e),e.inclusive=false;let r=e.options.length===1?e.options[0]._zod.run:null;t._zod.parse=(i,n)=>{if(r)return r(i,n);let s=false,o=[];for(let a of e.options){let c=a._zod.run({value:i.value,issues:[]},n);c instanceof Promise?(o.push(c),s=true):o.push(c);}return s?Promise.all(o).then(a=>G0(a,i,t,n)):G0(o,i,t,n)};}),Gp=z("$ZodDiscriminatedUnion",(t,e)=>{e.inclusive=false,Mo.init(t,e);let r=t._zod.parse;Oe(t._zod,"propValues",()=>{let n={};for(let s of e.options){let o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(s)}"`);for(let[a,c]of Object.entries(o)){n[a]||(n[a]=new Set);for(let l of c)n[a].add(l);}}return n});let i=zi(()=>{let n=e.options,s=new Map;for(let o of n){let a=o._zod.propValues?.[e.discriminator];if(!a||a.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let c of a){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,o);}}return s});t._zod.parse=(n,s)=>{let o=n.value;if(!ni(o))return n.issues.push({code:"invalid_type",expected:"object",input:o,inst:t}),n;let a=i.value.get(o?.[e.discriminator]);return a?a._zod.run(n,s):e.unionFallback||s.direction==="backward"?r(n,s):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,options:Array.from(i.value.keys()),input:o,path:[e.discriminator],inst:t}),n)};}),Hp=z("$ZodIntersection",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,s=e.left._zod.run({value:n,issues:[]},i),o=e.right._zod.run({value:n,issues:[]},i);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,l])=>H0(r,c,l)):H0(r,s,o)};});function ip(t,e){if(t===e)return {valid:true,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return {valid:true,data:t};if(Jn(t)&&Jn(e)){let r=Object.keys(e),i=Object.keys(t).filter(s=>r.indexOf(s)!==-1),n={...t,...e};for(let s of i){let o=ip(t[s],e[s]);if(!o.valid)return {valid:false,mergeErrorPath:[s,...o.mergeErrorPath]};n[s]=o.data;}return {valid:true,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return {valid:false,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],s=e[i],o=ip(n,s);if(!o.valid)return {valid:false,mergeErrorPath:[i,...o.mergeErrorPath]};r.push(o.data);}return {valid:true,data:r}}return {valid:false,mergeErrorPath:[]}}function H0(t,e,r){let i=new Map,n;for(let a of e.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).l=true;}else t.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys)i.has(c)||i.set(c,{}),i.get(c).r=true;else t.issues.push(a);let s=[...i].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&n&&t.issues.push({...n,keys:s}),Yn(t))return t;let o=ip(e.value,r.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return t.value=o.data,t}var Cc=z("$ZodTuple",(t,e)=>{Se.init(t,e);let r=e.items;t._zod.parse=(i,n)=>{let s=i.value;if(!Array.isArray(s))return i.issues.push({input:s,inst:t,expected:"tuple",code:"invalid_type"}),i;i.value=[];let o=[],a=q0(r,"optin"),c=q0(r,"optout");if(!e.rest){if(s.length<a)return i.issues.push({code:"too_small",minimum:a,inclusive:true,input:s,inst:t,origin:"array"}),i;s.length>r.length&&i.issues.push({code:"too_big",maximum:r.length,inclusive:true,input:s,inst:t,origin:"array"});}let l=new Array(r.length);for(let u=0;u<r.length;u++){let d=r[u]._zod.run({value:s[u],issues:[]},n);d instanceof Promise?o.push(d.then(f=>{l[u]=f;})):l[u]=d;}if(e.rest){let u=r.length-1,d=s.slice(r.length);for(let f of d){u++;let p=e.rest._zod.run({value:f,issues:[]},n);p instanceof Promise?o.push(p.then(g=>W0(g,i,u))):W0(p,i,u);}}return o.length?Promise.all(o).then(()=>K0(l,i,r,s,c)):K0(l,i,r,s,c)};});function q0(t,e){for(let r=t.length-1;r>=0;r--)if(t[r]._zod[e]!=="optional")return r+1;return 0}function W0(t,e,r){t.issues.length&&e.issues.push(...$t(r,t.issues)),e.value[r]=t.value;}function K0(t,e,r,i,n){for(let s=0;s<r.length;s++){let o=t[s],a=s<i.length;if(o.issues.length){if(!a&&s>=n){e.value.length=s;break}e.issues.push(...$t(s,o.issues));}e.value[s]=o.value;}for(let s=e.value.length-1;s>=i.length&&(r[s]._zod.optout==="optional"&&e.value[s]===void 0);s--)e.value.length=s;return e}var qp=z("$ZodRecord",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Jn(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let s=[],o=e.keyType._zod.values;if(o){r.value={};let a=new Set;for(let l of o)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){a.add(typeof l=="number"?l.toString():l);let u=e.keyType._zod.run({value:l,issues:[]},i);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(u.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>wt(p,i,Je())),input:l,path:[l],inst:t});continue}let d=u.value,f=e.valueType._zod.run({value:n[l],issues:[]},i);f instanceof Promise?s.push(f.then(p=>{p.issues.length&&r.issues.push(...$t(l,p.issues)),r.value[d]=p.value;})):(f.issues.length&&r.issues.push(...$t(l,f.issues)),r.value[d]=f.value);}let c;for(let l in n)a.has(l)||(c=c??[],c.push(l));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:c});}else {r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__"||!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=e.keyType._zod.run({value:a,issues:[]},i);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&xc.test(a)&&c.issues.length){let d=e.keyType._zod.run({value:Number(a),issues:[]},i);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(c=d);}if(c.issues.length){e.mode==="loose"?r.value[a]=n[a]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(d=>wt(d,i,Je())),input:a,path:[a],inst:t});continue}let u=e.valueType._zod.run({value:n[a],issues:[]},i);u instanceof Promise?s.push(u.then(d=>{d.issues.length&&r.issues.push(...$t(a,d.issues)),r.value[c.value]=d.value;})):(u.issues.length&&r.issues.push(...$t(a,u.issues)),r.value[c.value]=u.value);}}return s.length?Promise.all(s).then(()=>r):r};}),Wp=z("$ZodMap",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let s=[];r.value=new Map;for(let[o,a]of n){let c=e.keyType._zod.run({value:o,issues:[]},i),l=e.valueType._zod.run({value:a,issues:[]},i);c instanceof Promise||l instanceof Promise?s.push(Promise.all([c,l]).then(([u,d])=>{Z0(u,d,r,o,n,t,i);})):Z0(c,l,r,o,n,t,i);}return s.length?Promise.all(s).then(()=>r):r};});function Z0(t,e,r,i,n,s,o){t.issues.length&&(_o.has(typeof i)?r.issues.push(...$t(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:s,issues:t.issues.map(a=>wt(a,o,Je()))})),e.issues.length&&(_o.has(typeof i)?r.issues.push(...$t(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:s,key:i,issues:e.issues.map(a=>wt(a,o,Je()))})),r.value.set(t.value,e.value);}var Kp=z("$ZodSet",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let s=[];r.value=new Set;for(let o of n){let a=e.valueType._zod.run({value:o,issues:[]},i);a instanceof Promise?s.push(a.then(c=>X0(c,r))):X0(a,r);}return s.length?Promise.all(s).then(()=>r):r};});function X0(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value);}var Zp=z("$ZodEnum",(t,e)=>{Se.init(t,e);let r=mo(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>_o.has(typeof n)).map(n=>typeof n=="string"?Zt(n):n.toString()).join("|")})$`),t._zod.parse=(n,s)=>{let o=n.value;return i.has(o)||n.issues.push({code:"invalid_value",values:r,input:o,inst:t}),n};}),Xp=z("$ZodLiteral",(t,e)=>{if(Se.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(e.values);t._zod.values=r,t._zod.pattern=new RegExp(`^(${e.values.map(i=>typeof i=="string"?Zt(i):i?Zt(i.toString()):String(i)).join("|")})$`),t._zod.parse=(i,n)=>{let s=i.value;return r.has(s)||i.issues.push({code:"invalid_value",values:e.values,input:s,inst:t}),i};}),Jp=z("$ZodFile",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r};}),Yp=z("$ZodTransform",(t,e)=>{Se.init(t,e),t._zod.optin="optional",t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn(t.constructor.name);let n=e.transform(r.value,r);if(i.async)return (n instanceof Promise?n:Promise.resolve(n)).then(o=>(r.value=o,r.fallback=true,r));if(n instanceof Promise)throw new on;return r.value=n,r.fallback=true,r};});function J0(t,e){return e===void 0&&(t.issues.length||t.fallback)?{issues:[],value:void 0}:t}var Pc=z("$ZodOptional",(t,e)=>{Se.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${go(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=r.value,s=e.innerType._zod.run(r,i);return s instanceof Promise?s.then(o=>J0(o,n)):J0(s,n)}return r.value===void 0?r:e.innerType._zod.run(r,i)};}),Qp=z("$ZodExactOptional",(t,e)=>{Pc.init(t,e),Oe(t._zod,"values",()=>e.innerType._zod.values),Oe(t._zod,"pattern",()=>e.innerType._zod.pattern),t._zod.parse=(r,i)=>e.innerType._zod.run(r,i);}),em=z("$ZodNullable",(t,e)=>{Se.init(t,e),Oe(t._zod,"optin",()=>e.innerType._zod.optin),Oe(t._zod,"optout",()=>e.innerType._zod.optout),Oe(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${go(r.source)}|null)$`):void 0}),Oe(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i);}),tm=z("$ZodDefault",(t,e)=>{Se.init(t,e),t._zod.optin="optional",Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Y0(s,e)):Y0(n,e)};});function Y0(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var nm=z("$ZodPrefault",(t,e)=>{Se.init(t,e),t._zod.optin="optional",Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i));}),rm=z("$ZodNonOptional",(t,e)=>{Se.init(t,e),Oe(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>Q0(s,t)):Q0(n,t)};});function Q0(t,e){return !t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var im=z("$ZodSuccess",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn("ZodSuccess");let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.issues.length===0,r)):(r.value=n.issues.length===0,r)};}),sm=z("$ZodCatch",(t,e)=>{Se.init(t,e),t._zod.optin="optional",Oe(t._zod,"optout",()=>e.innerType._zod.optout),Oe(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(s=>(r.value=s.value,s.issues.length&&(r.value=e.catchValue({...r,error:{issues:s.issues.map(o=>wt(o,i,Je()))},input:r.value}),r.issues=[],r.fallback=true),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(s=>wt(s,i,Je()))},input:r.value}),r.issues=[],r.fallback=true),r)};}),om=z("$ZodNaN",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r);}),Nc=z("$ZodPipe",(t,e)=>{Se.init(t,e),Oe(t._zod,"values",()=>e.in._zod.values),Oe(t._zod,"optin",()=>e.in._zod.optin),Oe(t._zod,"optout",()=>e.out._zod.optout),Oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if(i.direction==="backward"){let s=e.out._zod.run(r,i);return s instanceof Promise?s.then(o=>Rc(o,e.in,i)):Rc(s,e.in,i)}let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(s=>Rc(s,e.out,i)):Rc(n,e.out,i)};});function Rc(t,e,r){return t.issues.length?(t.aborted=true,t):e._zod.run({value:t.value,issues:t.issues,fallback:t.fallback},r)}var Ao=z("$ZodCodec",(t,e)=>{Se.init(t,e),Oe(t._zod,"values",()=>e.in._zod.values),Oe(t._zod,"optin",()=>e.in._zod.optin),Oe(t._zod,"optout",()=>e.out._zod.optout),Oe(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{if((i.direction||"forward")==="forward"){let s=e.in._zod.run(r,i);return s instanceof Promise?s.then(o=>Ec(o,e,i)):Ec(s,e,i)}else {let s=e.out._zod.run(r,i);return s instanceof Promise?s.then(o=>Ec(o,e,i)):Ec(s,e,i)}};});function Ec(t,e,r){if(t.issues.length)return t.aborted=true,t;if((r.direction||"forward")==="forward"){let n=e.transform(t.value,t);return n instanceof Promise?n.then(s=>wc(t,s,e.out,r)):wc(t,n,e.out,r)}else {let n=e.reverseTransform(t.value,t);return n instanceof Promise?n.then(s=>wc(t,s,e.in,r)):wc(t,n,e.in,r)}}function wc(t,e,r,i){return t.issues.length?(t.aborted=true,t):r._zod.run({value:e,issues:t.issues},i)}var am=z("$ZodPreprocess",(t,e)=>{Nc.init(t,e);}),cm=z("$ZodReadonly",(t,e)=>{Se.init(t,e),Oe(t._zod,"propValues",()=>e.innerType._zod.propValues),Oe(t._zod,"values",()=>e.innerType._zod.values),Oe(t._zod,"optin",()=>e.innerType?._zod?.optin),Oe(t._zod,"optout",()=>e.innerType?._zod?.optout),t._zod.parse=(r,i)=>{if(i.direction==="backward")return e.innerType._zod.run(r,i);let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(eS):eS(n)};});function eS(t){return t.value=Object.freeze(t.value),t}var lm=z("$ZodTemplateLiteral",(t,e)=>{Se.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let s=n.startsWith("^")?1:0,o=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(s,o));}else if(i===null||ef.has(typeof i))r.push(Zt(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"string",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i);}),um=z("$ZodFunction",(t,e)=>(Se.init(t,e),t._def=e,t._zod.def=e,t.implement=r=>{if(typeof r!="function")throw new Error("implement() must be called with a function");return function(...i){let n=t._def.input?uc(t._def.input,i):i,s=Reflect.apply(r,this,n);return t._def.output?uc(t._def.output,s):s}},t.implementAsync=r=>{if(typeof r!="function")throw new Error("implementAsync() must be called with a function");return async function(...i){let n=t._def.input?await dc(t._def.input,i):i,s=await Reflect.apply(r,this,n);return t._def.output?await dc(t._def.output,s):s}},t._zod.parse=(r,i)=>typeof r.value!="function"?(r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:t}),r):(t._def.output&&t._def.output._zod.def.type==="promise"?r.value=t.implementAsync(r.value):r.value=t.implement(r.value),r),t.input=(...r)=>{let i=t.constructor;return Array.isArray(r[0])?new i({type:"function",input:new Cc({type:"tuple",items:r[0],rest:r[1]}),output:t._def.output}):new i({type:"function",input:r[0],output:t._def.output})},t.output=r=>{let i=t.constructor;return new i({type:"function",input:t._def.input,output:r})},t)),dm=z("$ZodPromise",(t,e)=>{Se.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i));}),hm=z("$ZodLazy",(t,e)=>{Se.init(t,e),Oe(t._zod,"innerType",()=>{let r=e;return r._cachedInner||(r._cachedInner=e.getter()),r._cachedInner}),Oe(t._zod,"pattern",()=>t._zod.innerType?._zod?.pattern),Oe(t._zod,"propValues",()=>t._zod.innerType?._zod?.propValues),Oe(t._zod,"optin",()=>t._zod.innerType?._zod?.optin??void 0),Oe(t._zod,"optout",()=>t._zod.innerType?._zod?.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i);}),fm=z("$ZodCustom",(t,e)=>{We.init(t,e),Se.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(s=>tS(s,r,i,t));tS(n,r,i,t);};});function tS(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push($i(n));}}var Co={};An(Co,{ar:()=>aS,az:()=>cS,be:()=>uS,bg:()=>dS,ca:()=>hS,cs:()=>fS,da:()=>pS,de:()=>mS,el:()=>gS,en:()=>Oc,eo:()=>_S,es:()=>vS,fa:()=>yS,fi:()=>SS,fr:()=>xS,frCA:()=>bS,he:()=>TS,hr:()=>RS,hu:()=>ES,hy:()=>MS,id:()=>AS,is:()=>IS,it:()=>CS,ja:()=>PS,ka:()=>NS,kh:()=>OS,km:()=>zc,ko:()=>zS,lt:()=>DS,mk:()=>LS,ms:()=>kS,nl:()=>US,no:()=>FS,ota:()=>BS,pl:()=>jS,ps:()=>VS,pt:()=>GS,ro:()=>HS,ru:()=>WS,sl:()=>KS,sv:()=>ZS,ta:()=>XS,th:()=>JS,tr:()=>YS,ua:()=>QS,uk:()=>$c,ur:()=>ex,uz:()=>tx,vi:()=>nx,yo:()=>sx,zhCN:()=>rx,zhTW:()=>ix});var UM=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`:`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${s}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case "invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Z(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()} ${o.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:s.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${s.suffix}"`:s.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${s.includes}"`:s.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${s.pattern}`:`${r[s.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case "not_multiple_of":return `\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case "unrecognized_keys":return `\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${F(n.keys,"\u060C ")}`;case "invalid_key":return `\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case "invalid_union":return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case "invalid_element":return `\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return "\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function aS(){return {localeError:UM()}}var FM=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`:`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${s}, daxil olan ${a}`}case "invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Z(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()} ${o.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${s.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:s.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${s.suffix}" il\u0259 bitm\u0259lidir`:s.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${s.includes}" daxil olmal\u0131d\u0131r`:s.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${s.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${r[s.format]??n.format}`}case "not_multiple_of":return `Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case "unrecognized_keys":return `Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case "invalid_union":return "Yanl\u0131\u015F d\u0259y\u0259r";case "invalid_element":return `${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return "Yanl\u0131\u015F d\u0259y\u0259r"}}};function cS(){return {localeError:FM()}}function lS(t,e,r,i){let n=Math.abs(t),s=n%10,o=n%100;return o>=11&&o<=19?i:s===1?e:s>=2&&s<=4?r:i}var BM=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},i={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${s}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Z(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=lS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.maximum.toString()} ${c}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=lS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${o.verb} ${s}${n.minimum.toString()} ${c}`}return `\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case "invalid_element":return `\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return "\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function uS(){return {localeError:BM()}}var VM=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${Z(n.values[0])}`:`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;if(s.format==="starts_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${s.prefix}"`;if(s.format==="ends_with")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${s.suffix}"`;if(s.format==="includes")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${s.includes}"`;if(s.format==="regex")return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${s.pattern}`;let o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";return s.format==="emoji"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="datetime"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="date"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),s.format==="time"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E"),s.format==="duration"&&(o="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430"),`${o} ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case "invalid_element":return `\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};function dS(){return {localeError:VM()}}var jM=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus inv\xE0lid: s'esperava ${s}, s'ha rebut ${a}`}case "invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${Z(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${F(n.values," o ")}`;case "too_big":{let s=n.inclusive?"com a m\xE0xim":"menys de",o=e(n.origin);return o?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${s} ${n.maximum.toString()} ${o.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"com a m\xEDnim":"m\xE9s de",o=e(n.origin);return o?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${s} ${n.minimum.toString()} ${o.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${s.prefix}"`:s.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${s.suffix}"`:s.format==="includes"?`Format inv\xE0lid: ha d'incloure "${s.includes}"`:s.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${s.pattern}`:`Format inv\xE0lid per a ${r[s.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case "unrecognized_keys":return `Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Clau inv\xE0lida a ${n.origin}`;case "invalid_union":return "Entrada inv\xE0lida";case "invalid_element":return `Element inv\xE0lid a ${n.origin}`;default:return "Entrada inv\xE0lida"}}};function hS(){return {localeError:jM()}}var GM=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},i={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`:`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${s}, obdr\u017Eeno ${a}`}case "invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Z(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.maximum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${s}${n.minimum.toString()} ${o.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${s.prefix}"`:s.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${s.suffix}"`:s.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${s.includes}"`:s.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${s.pattern}`:`Neplatn\xFD form\xE1t ${r[s.format]??n.format}`}case "not_multiple_of":return `Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case "unrecognized_keys":return `Nezn\xE1m\xE9 kl\xED\u010De: ${F(n.keys,", ")}`;case "invalid_key":return `Neplatn\xFD kl\xED\u010D v ${n.origin}`;case "invalid_union":return "Neplatn\xFD vstup";case "invalid_element":return `Neplatn\xE1 hodnota v ${n.origin}`;default:return "Neplatn\xFD vstup"}}};function fS(){return {localeError:GM()}}var HM=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${s}, fik ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig v\xE6rdi: forventede ${Z(n.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`For stor: forventede ${a??"value"} ${o.verb} ${s} ${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`For lille: forventede ${a} ${o.verb} ${s} ${n.minimum.toString()} ${o.unit}`:`For lille: forventede ${a} havde ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??n.format}`}case "not_multiple_of":return `Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8gle i ${n.origin}`;case "invalid_union":return "Ugyldigt input: matcher ingen af de tilladte typer";case "invalid_element":return `Ugyldig v\xE6rdi i ${n.origin}`;default:return "Ugyldigt input"}}};function pS(){return {localeError:HM()}}var qM=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},i={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ung\xFCltige Eingabe: erwartet ${s}, erhalten ${a}`}case "invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Z(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ${o.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${s}${n.maximum.toString()} ist`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ${o.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${s}${n.minimum.toString()} ist`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ung\xFCltiger String: muss mit "${s.prefix}" beginnen`:s.format==="ends_with"?`Ung\xFCltiger String: muss mit "${s.suffix}" enden`:s.format==="includes"?`Ung\xFCltiger String: muss "${s.includes}" enthalten`:s.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${s.pattern} entsprechen`:`Ung\xFCltig: ${r[s.format]??n.format}`}case "not_multiple_of":return `Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case "unrecognized_keys":return `${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case "invalid_union":return "Ung\xFCltige Eingabe";case "invalid_element":return `Ung\xFCltiger Wert in ${n.origin}`;default:return "Ung\xFCltige Eingabe"}}};function mS(){return {localeError:qM()}}var WM=()=>{let t={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function e(n){return t[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${s}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case "invalid_value":return n.values.length===1?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${Z(n.values[0])}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${n.maximum.toString()} ${o.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${s}${n.minimum.toString()} ${o.unit}`:`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${s.prefix}"`:s.format==="ends_with"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${s.suffix}"`:s.format==="includes"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${s.includes}"`:s.format==="regex"?`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${s.pattern}`:`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[s.format]??n.format}`}case "not_multiple_of":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case "unrecognized_keys":return `\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case "invalid_union":return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case "invalid_element":return `\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return "\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};function gS(){return {localeError:WM()}}var KM=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return `Invalid input: expected ${s}, received ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${Z(n.values[0])}`:`Invalid option: expected one of ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Too big: expected ${n.origin??"value"} to have ${s}${n.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Too small: expected ${n.origin} to have ${s}${n.minimum.toString()} ${o.unit}`:`Too small: expected ${n.origin} to be ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Invalid string: must start with "${s.prefix}"`:s.format==="ends_with"?`Invalid string: must end with "${s.suffix}"`:s.format==="includes"?`Invalid string: must include "${s.includes}"`:s.format==="regex"?`Invalid string: must match pattern ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case "not_multiple_of":return `Invalid number: must be a multiple of ${n.divisor}`;case "unrecognized_keys":return `Unrecognized key${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Invalid key in ${n.origin}`;case "invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(o=>`'${o}'`).join(" | ")}`:"Invalid input";case "invalid_element":return `Invalid value in ${n.origin}`;default:return "Invalid input"}}};function Oc(){return {localeError:KM()}}var ZM=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},i={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`:`Nevalida enigo: atendi\u011Dis ${s}, ricevi\u011Dis ${a}`}case "invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Z(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${s}${n.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${s.prefix}"`:s.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${s.suffix}"`:s.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${s.includes}"`:s.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${s.pattern}`:`Nevalida ${r[s.format]??n.format}`}case "not_multiple_of":return `Nevalida nombro: devas esti oblo de ${n.divisor}`;case "unrecognized_keys":return `Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Nevalida \u015Dlosilo en ${n.origin}`;case "invalid_union":return "Nevalida enigo";case "invalid_element":return `Nevalida valoro en ${n.origin}`;default:return "Nevalida enigo"}}};function _S(){return {localeError:ZM()}}var XM=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inv\xE1lida: se esperaba ${s}, recibido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${Z(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${s}${n.minimum.toString()} ${o.unit}`:`Demasiado peque\xF1o: se esperaba que ${a} fuera ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${s.prefix}"`:s.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${s.suffix}"`:s.format==="includes"?`Cadena inv\xE1lida: debe incluir "${s.includes}"`:s.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${s.pattern}`:`Inv\xE1lido ${r[s.format]??n.format}`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Llave inv\xE1lida en ${i[n.origin]??n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido en ${i[n.origin]??n.origin}`;default:return "Entrada inv\xE1lida"}}};function vS(){return {localeError:XM()}}var JM=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`:`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${s} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case "invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Z(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${F(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:s.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${s.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:s.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${s.includes}" \u0628\u0627\u0634\u062F`:s.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${s.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${r[s.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case "not_multiple_of":return `\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case "unrecognized_keys":return `\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${F(n.keys,", ")}`;case "invalid_key":return `\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case "invalid_union":return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case "invalid_element":return `\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return "\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function yS(){return {localeError:JM()}}var YM=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${s}, oli ${a}`}case "invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Z(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Liian suuri: ${o.subject} t\xE4ytyy olla ${s}${n.maximum.toString()} ${o.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Liian pieni: ${o.subject} t\xE4ytyy olla ${s}${n.minimum.toString()} ${o.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${s.prefix}"`:s.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${s.suffix}"`:s.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${s.includes}"`:s.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${s.pattern}`:`Virheellinen ${r[s.format]??n.format}`}case "not_multiple_of":return `Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case "unrecognized_keys":return `${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${F(n.keys,", ")}`;case "invalid_key":return "Virheellinen avain tietueessa";case "invalid_union":return "Virheellinen unioni";case "invalid_element":return "Virheellinen arvo joukossa";default:return "Virheellinen sy\xF6te"}}};function SS(){return {localeError:YM()}}var QM=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`:`Entr\xE9e invalide : ${s} attendu, ${a} re\xE7u`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${Z(n.values[0])} attendu`:`Option invalide : une valeur parmi ${F(n.values,"|")} attendue`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Trop grand : ${i[n.origin]??"valeur"} doit ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${i[n.origin]??"valeur"} doit \xEAtre ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Trop petit : ${i[n.origin]??"valeur"} doit ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : ${i[n.origin]??"valeur"} doit \xEAtre ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${s.pattern}`:`${r[s.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${F(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};function xS(){return {localeError:QM()}}var eA=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`:`Entr\xE9e invalide : attendu ${s}, re\xE7u ${a}`}case "invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${Z(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"\u2264":"<",o=e(n.origin);return o?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${s}${n.maximum.toString()} ${o.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"\u2265":">",o=e(n.origin);return o?`Trop petit : attendu que ${n.origin} ait ${s}${n.minimum.toString()} ${o.unit}`:`Trop petit : attendu que ${n.origin} soit ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${s.prefix}"`:s.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${s.suffix}"`:s.format==="includes"?`Cha\xEEne invalide : doit inclure "${s.includes}"`:s.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${s.pattern}`:`${r[s.format]??n.format} invalide`}case "not_multiple_of":return `Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case "unrecognized_keys":return `Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${F(n.keys,", ")}`;case "invalid_key":return `Cl\xE9 invalide dans ${n.origin}`;case "invalid_union":return "Entr\xE9e invalide";case "invalid_element":return `Valeur invalide dans ${n.origin}`;default:return "Entr\xE9e invalide"}}};function bS(){return {localeError:eA()}}var tA=()=>{let t={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},e={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=l=>l?t[l]:void 0,i=l=>{let u=r(l);return u?u.label:l??t.unknown.label},n=l=>`\u05D4${i(l)}`,s=l=>(r(l)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",o=l=>l?e[l]??null:null,a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return l=>{switch(l.code){case "invalid_type":{let u=l.expected,d=c[u??""]??i(u),f=X(l.input),p=c[f]??t[f]?.label??f;return /^[A-Z]/.test(l.expected)?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${l.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${d}, \u05D4\u05EA\u05E7\u05D1\u05DC ${p}`}case "invalid_value":{if(l.values.length===1)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${Z(l.values[0])}`;let u=l.values.map(p=>Z(p));if(l.values.length===2)return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u[0]} \u05D0\u05D5 ${u[1]}`;let d=u[u.length-1];return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${u.slice(0,-1).join(", ")} \u05D0\u05D5 ${d}`}case "too_big":{let u=o(l.origin),d=n(l.origin??"value");if(l.origin==="string")return `${u?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.maximum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${l.maximum}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",m=l.inclusive?`${l.maximum} ${u?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${l.maximum} ${u?.unit??""}`;return `\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?"<=":"<",p=s(l.origin??"value");return u?.unit?`${u.longLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()} ${u.unit}`:`${u?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.maximum.toString()}`}case "too_small":{let u=o(l.origin),d=n(l.origin??"value");if(l.origin==="string")return `${u?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${l.minimum.toString()} ${u?.unit??""} ${l.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(l.origin==="number"){let g=l.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${l.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${l.minimum}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${g}`}if(l.origin==="array"||l.origin==="set"){let g=l.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(l.minimum===1&&l.inclusive){let S=(l.origin==="set","\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3");return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let m=l.inclusive?`${l.minimum} ${u?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${l.minimum} ${u?.unit??""}`;return `\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${d} ${g} \u05DC\u05D4\u05DB\u05D9\u05DC ${m}`.trim()}let f=l.inclusive?">=":">",p=s(l.origin??"value");return u?.unit?`${u.shortLabel} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()} ${u.unit}`:`${u?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${d} ${p} ${f}${l.minimum.toString()}`}case "invalid_format":{let u=l;if(u.format==="starts_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${u.prefix}"`;if(u.format==="ends_with")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${u.suffix}"`;if(u.format==="includes")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${u.includes}"`;if(u.format==="regex")return `\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${u.pattern}`;let d=a[u.format],f=d?.label??u.format,g=(d?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return `${f} \u05DC\u05D0 ${g}`}case "not_multiple_of":return `\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${l.divisor}`;case "unrecognized_keys":return `\u05DE\u05E4\u05EA\u05D7${l.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${l.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${F(l.keys,", ")}`;case "invalid_key":return "\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case "invalid_union":return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case "invalid_element":return `\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(l.origin??"array")}`;default:return "\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function TS(){return {localeError:tA()}}var nA=()=>{let t={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function e(n){return t[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},i={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`:`Neispravan unos: o\u010Dekuje se ${s}, a primljeno je ${a}`}case "invalid_value":return n.values.length===1?`Neispravna vrijednost: o\u010Dekivano ${Z(n.values[0])}`:`Neispravna opcija: o\u010Dekivano jedno od ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${s}${n.maximum.toString()} ${o.unit??"elemenata"}`:`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=i[n.origin]??n.origin;return o?`Premalo: o\u010Dekivano da ${a} ima ${s}${n.minimum.toString()} ${o.unit}`:`Premalo: o\u010Dekivano da ${a} bude ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neispravan tekst: mora zapo\u010Dinjati s "${s.prefix}"`:s.format==="ends_with"?`Neispravan tekst: mora zavr\u0161avati s "${s.suffix}"`:s.format==="includes"?`Neispravan tekst: mora sadr\u017Eavati "${s.includes}"`:s.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${s.pattern}`:`Neispravna ${r[s.format]??n.format}`}case "not_multiple_of":return `Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case "unrecognized_keys":return `Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${F(n.keys,", ")}`;case "invalid_key":return `Neispravan klju\u010D u ${i[n.origin]??n.origin}`;case "invalid_union":return "Neispravan unos";case "invalid_element":return `Neispravna vrijednost u ${i[n.origin]??n.origin}`;default:return "Neispravan unos"}}};function RS(){return {localeError:nA()}}var rA=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},i={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`:`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${s}, a kapott \xE9rt\xE9k ${a}`}case "invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Z(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${s}${n.maximum.toString()} ${o.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${s}${n.minimum.toString()} ${o.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\xC9rv\xE9nytelen string: "${s.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:s.format==="ends_with"?`\xC9rv\xE9nytelen string: "${s.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:s.format==="includes"?`\xC9rv\xE9nytelen string: "${s.includes}" \xE9rt\xE9ket kell tartalmaznia`:s.format==="regex"?`\xC9rv\xE9nytelen string: ${s.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${r[s.format]??n.format}`}case "not_multiple_of":return `\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case "unrecognized_keys":return `Ismeretlen kulcs${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\xC9rv\xE9nytelen kulcs ${n.origin}`;case "invalid_union":return "\xC9rv\xE9nytelen bemenet";case "invalid_element":return `\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return "\xC9rv\xE9nytelen bemenet"}}};function ES(){return {localeError:rA()}}function wS(t,e,r){return Math.abs(t)===1?e:r}function Bi(t){if(!t)return "";let e=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=t[t.length-1];return t+(e.includes(r)?"\u0576":"\u0568")}var iA=()=>{let t={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function e(n){return t[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},i={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`:`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${s}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case "invalid_value":return n.values.length===1?`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${Z(n.values[1])}`:`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=wS(a,o.unit.one,o.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.maximum.toString()} ${c}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=wS(a,o.unit.one,o.unit.many);return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${s}${n.minimum.toString()} ${c}`}return `\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${Bi(n.origin)} \u056C\u056B\u0576\u056B ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${s.prefix}"-\u0578\u057E`:s.format==="ends_with"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${s.suffix}"-\u0578\u057E`:s.format==="includes"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${s.includes}"`:s.format==="regex"?`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${s.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`:`\u054D\u056D\u0561\u056C ${r[s.format]??n.format}`}case "not_multiple_of":return `\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case "unrecognized_keys":return `\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${F(n.keys,", ")}`;case "invalid_key":return `\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${Bi(n.origin)}-\u0578\u0582\u0574`;case "invalid_union":return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case "invalid_element":return `\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${Bi(n.origin)}-\u0578\u0582\u0574`;default:return "\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};function MS(){return {localeError:iA()}}var sA=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${s}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${Z(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: diharapkan ${n.origin} memiliki ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`String tidak valid: harus dimulai dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak valid: harus berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak valid: harus menyertakan "${s.includes}"`:s.format==="regex"?`String tidak valid: harus sesuai pola ${s.pattern}`:`${r[s.format]??n.format} tidak valid`}case "not_multiple_of":return `Angka tidak valid: harus kelipatan dari ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Kunci tidak valid di ${n.origin}`;case "invalid_union":return "Input tidak valid";case "invalid_element":return `Nilai tidak valid di ${n.origin}`;default:return "Input tidak valid"}}};function AS(){return {localeError:sA()}}var oA=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(n){return t[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},i={nan:"NaN",number:"n\xFAmer",array:"fylki"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`:`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${s}`}case "invalid_value":return n.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${Z(n.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${s}${n.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${s}${n.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${s.prefix}"`:s.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${s.suffix}"`:s.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${s.includes}"`:s.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${s.pattern}`:`Rangt ${r[s.format]??n.format}`}case "not_multiple_of":return `R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case "unrecognized_keys":return `\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${F(n.keys,", ")}`;case "invalid_key":return `Rangur lykill \xED ${n.origin}`;case "invalid_union":return "Rangt gildi";case "invalid_element":return `Rangt gildi \xED ${n.origin}`;default:return "Rangt gildi"}}};function IS(){return {localeError:oA()}}var aA=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${s}, ricevuto ${a}`}case "invalid_value":return n.values.length===1?`Input non valido: atteso ${Z(n.values[0])}`:`Opzione non valida: atteso uno tra ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Troppo grande: ${n.origin??"valore"} deve avere ${s}${n.maximum.toString()} ${o.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Troppo piccolo: ${n.origin} deve avere ${s}${n.minimum.toString()} ${o.unit}`:`Troppo piccolo: ${n.origin} deve essere ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Stringa non valida: deve iniziare con "${s.prefix}"`:s.format==="ends_with"?`Stringa non valida: deve terminare con "${s.suffix}"`:s.format==="includes"?`Stringa non valida: deve includere "${s.includes}"`:s.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${s.pattern}`:`Input non valido: ${r[s.format]??n.format}`}case "not_multiple_of":return `Numero non valido: deve essere un multiplo di ${n.divisor}`;case "unrecognized_keys":return `Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${F(n.keys,", ")}`;case "invalid_key":return `Chiave non valida in ${n.origin}`;case "invalid_union":return "Input non valido";case "invalid_element":return `Valore non valido in ${n.origin}`;default:return "Input non valido"}}};function CS(){return {localeError:aA()}}var cA=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},i={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u5165\u529B: ${s}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case "invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Z(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${F(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "too_big":{let s=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",o=e(n.origin);return o?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o.unit??"\u8981\u7D20"}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "too_small":{let s=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",o=e(n.origin);return o?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o.unit}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${s.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:s.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${s.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${r[s.format]??n.format}`}case "not_multiple_of":return `\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case "unrecognized_keys":return `\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${F(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case "invalid_union":return "\u7121\u52B9\u306A\u5165\u529B";case "invalid_element":return `${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return "\u7121\u52B9\u306A\u5165\u529B"}}};function PS(){return {localeError:cA()}}var lA=()=>{let t={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function e(n){return t[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},i={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${s}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case "invalid_value":return n.values.length===1?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${Z(n.values[0])}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${F(n.values,"|")}-\u10D3\u10D0\u10DC`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.prefix}"-\u10D8\u10D7`:s.format==="ends_with"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${s.suffix}"-\u10D8\u10D7`:s.format==="includes"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${s.includes}"-\u10E1`:s.format==="regex"?`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${s.pattern}`:`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case "unrecognized_keys":return `\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case "invalid_union":return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case "invalid_element":return `\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return "\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};function NS(){return {localeError:lA()}}var uA=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},i={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`:`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${s} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case "invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Z(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()} ${o.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()} ${o.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${s.prefix}"`:s.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${s.suffix}"`:s.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${s.includes}"`:s.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${s.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case "unrecognized_keys":return `\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${F(n.keys,", ")}`;case "invalid_key":return `\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case "invalid_union":return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case "invalid_element":return `\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return "\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function zc(){return {localeError:uA()}}function OS(){return zc()}var dA=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${s}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case "invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Z(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${F(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "too_big":{let s=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",o=s==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${s}${o}`}case "too_small":{let s=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",o=s==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=e(n.origin),c=a?.unit??"\uC694\uC18C";return a?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${s}${o}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${s}${o}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:s.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${s.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:s.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${s.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${r[s.format]??n.format}`}case "not_multiple_of":return `\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case "unrecognized_keys":return `\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${F(n.keys,", ")}`;case "invalid_key":return `\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case "invalid_union":return "\uC798\uBABB\uB41C \uC785\uB825";case "invalid_element":return `\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return "\uC798\uBABB\uB41C \uC785\uB825"}}};function zS(){return {localeError:dA()}}var Io=t=>t.charAt(0).toUpperCase()+t.slice(1);function $S(t){let e=Math.abs(t),r=e%10,i=e%100;return i>=11&&i<=19||r===0?"many":r===1?"one":"few"}var hA=()=>{let t={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function e(n,s,o,a){let c=t[n]??null;return c===null?c:{unit:c.unit[s],verb:c.verb[a][o?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},i={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tik\u0117tasi - ${s}`}case "invalid_value":return n.values.length===1?`Privalo b\u016Bti ${Z(n.values[0])}`:`Privalo b\u016Bti vienas i\u0161 ${F(n.values,"|")} pasirinkim\u0173`;case "too_big":{let s=i[n.origin]??n.origin,o=e(n.origin,$S(Number(n.maximum)),n.inclusive??false,"smaller");if(o?.verb)return `${Io(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.maximum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return `${Io(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${o?.unit}`}case "too_small":{let s=i[n.origin]??n.origin,o=e(n.origin,$S(Number(n.minimum)),n.inclusive??false,"bigger");if(o?.verb)return `${Io(s??n.origin??"reik\u0161m\u0117")} ${o.verb} ${n.minimum.toString()} ${o.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return `${Io(s??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${o?.unit}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Eilut\u0117 privalo prasid\u0117ti "${s.prefix}"`:s.format==="ends_with"?`Eilut\u0117 privalo pasibaigti "${s.suffix}"`:s.format==="includes"?`Eilut\u0117 privalo \u012Ftraukti "${s.includes}"`:s.format==="regex"?`Eilut\u0117 privalo atitikti ${s.pattern}`:`Neteisingas ${r[s.format]??n.format}`}case "not_multiple_of":return `Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case "unrecognized_keys":return `Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${F(n.keys,", ")}`;case "invalid_key":return "Rastas klaidingas raktas";case "invalid_union":return "Klaidinga \u012Fvestis";case "invalid_element":{let s=i[n.origin]??n.origin;return `${Io(s??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return "Klaidinga \u012Fvestis"}}};function DS(){return {localeError:hA()}}var fA=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},i={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`:`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${s}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`Invalid input: expected ${Z(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${s}${n.minimum.toString()} ${o.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${s.pattern}`:`Invalid ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case "invalid_union":return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case "invalid_element":return `\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return "\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function LS(){return {localeError:fA()}}var pA=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${s}, diterima ${a}`}case "invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${Z(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Terlalu besar: dijangka ${n.origin??"nilai"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Terlalu kecil: dijangka ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`String tidak sah: mesti bermula dengan "${s.prefix}"`:s.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${s.suffix}"`:s.format==="includes"?`String tidak sah: mesti mengandungi "${s.includes}"`:s.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${s.pattern}`:`${r[s.format]??n.format} tidak sah`}case "not_multiple_of":return `Nombor tidak sah: perlu gandaan ${n.divisor}`;case "unrecognized_keys":return `Kunci tidak dikenali: ${F(n.keys,", ")}`;case "invalid_key":return `Kunci tidak sah dalam ${n.origin}`;case "invalid_union":return "Input tidak sah";case "invalid_element":return `Nilai tidak sah dalam ${n.origin}`;default:return "Input tidak sah"}}};function kS(){return {localeError:pA()}}var mA=()=>{let t={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function e(n){return t[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},i={nan:"NaN",number:"getal"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${s}, ontving ${a}`}case "invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${Z(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return o?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} ${o.unit??"elementen"} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${s}${n.maximum.toString()} is`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return o?`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Te ${a}: verwacht dat ${n.origin} ${s}${n.minimum.toString()} is`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ongeldige tekst: moet met "${s.prefix}" beginnen`:s.format==="ends_with"?`Ongeldige tekst: moet op "${s.suffix}" eindigen`:s.format==="includes"?`Ongeldige tekst: moet "${s.includes}" bevatten`:s.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${s.pattern}`:`Ongeldig: ${r[s.format]??n.format}`}case "not_multiple_of":return `Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case "unrecognized_keys":return `Onbekende key${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Ongeldige key in ${n.origin}`;case "invalid_union":return "Ongeldige invoer";case "invalid_element":return `Ongeldige waarde in ${n.origin}`;default:return "Ongeldige invoer"}}};function US(){return {localeError:mA()}}var gA=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${s}, fikk ${a}`}case "invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${Z(n.values[0])}`:`Ugyldig valg: forventet en av ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()} ${o.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()} ${o.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${r[s.format]??n.format}`}case "not_multiple_of":return `Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ugyldig n\xF8kkel i ${n.origin}`;case "invalid_union":return "Ugyldig input";case "invalid_element":return `Ugyldig verdi i ${n.origin}`;default:return "Ugyldig input"}}};function FS(){return {localeError:gA()}}var _A=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},i={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`:`F\xE2sit giren: umulan ${s}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${Z(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} ${o.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${s}${n.maximum.toString()} olmal\u0131yd\u0131.`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} ${o.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${s}${n.minimum.toString()} olmal\u0131yd\u0131.`}case "invalid_format":{let s=n;return s.format==="starts_with"?`F\xE2sit metin: "${s.prefix}" ile ba\u015Flamal\u0131.`:s.format==="ends_with"?`F\xE2sit metin: "${s.suffix}" ile bitmeli.`:s.format==="includes"?`F\xE2sit metin: "${s.includes}" ihtiv\xE2 etmeli.`:s.format==="regex"?`F\xE2sit metin: ${s.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${r[s.format]??n.format}`}case "not_multiple_of":return `F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case "invalid_union":return "Giren tan\u0131namad\u0131.";case "invalid_element":return `${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return "K\u0131ymet tan\u0131namad\u0131."}}};function BS(){return {localeError:_A()}}var vA=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},i={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`:`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${s} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case "invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Z(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${F(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${s}${n.maximum.toString()} \u0648\u064A`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} ${o.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${s}${n.minimum.toString()} \u0648\u064A`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:s.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${s.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:s.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${s.includes}" \u0648\u0644\u0631\u064A`:s.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${s.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${r[s.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case "not_multiple_of":return `\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case "unrecognized_keys":return `\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${F(n.keys,", ")}`;case "invalid_key":return `\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case "invalid_union":return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case "invalid_element":return `\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return "\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function VS(){return {localeError:vA()}}var yA=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},i={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${s}, otrzymano ${a}`}case "invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Z(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.maximum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${s}${n.minimum.toString()} ${o.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${s.prefix}"`:s.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${s.suffix}"`:s.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${s.includes}"`:s.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${s.pattern}`:`Nieprawid\u0142ow(y/a/e) ${r[s.format]??n.format}`}case "not_multiple_of":return `Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case "unrecognized_keys":return `Nierozpoznane klucze${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Nieprawid\u0142owy klucz w ${n.origin}`;case "invalid_union":return "Nieprawid\u0142owe dane wej\u015Bciowe";case "invalid_element":return `Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return "Nieprawid\u0142owe dane wej\u015Bciowe"}}};function jS(){return {localeError:yA()}}var SA=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},i={nan:"NaN",number:"n\xFAmero",null:"nulo"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inv\xE1lido: esperado ${s}, recebido ${a}`}case "invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${Z(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${s}${n.maximum.toString()} ${o.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Muito pequeno: esperado que ${n.origin} tivesse ${s}${n.minimum.toString()} ${o.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${s.prefix}"`:s.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${s.suffix}"`:s.format==="includes"?`Texto inv\xE1lido: deve incluir "${s.includes}"`:s.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${s.pattern}`:`${r[s.format]??n.format} inv\xE1lido`}case "not_multiple_of":return `N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case "unrecognized_keys":return `Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${F(n.keys,", ")}`;case "invalid_key":return `Chave inv\xE1lida em ${n.origin}`;case "invalid_union":return "Entrada inv\xE1lida";case "invalid_element":return `Valor inv\xE1lido em ${n.origin}`;default:return "Campo inv\xE1lido"}}};function GS(){return {localeError:SA()}}var xA=()=>{let t={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function e(n){return t[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},i={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return `Intrare invalid\u0103: a\u0219teptat ${s}, primit ${a}`}case "invalid_value":return n.values.length===1?`Intrare invalid\u0103: a\u0219teptat ${Z(n.values[0])}`:`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"elemente"}`:`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Prea mic: a\u0219teptat ca ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${s.prefix}"`:s.format==="ends_with"?`\u0218ir invalid: trebuie s\u0103 se termine cu "${s.suffix}"`:s.format==="includes"?`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${s.includes}"`:s.format==="regex"?`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${s.pattern}`:`Format invalid: ${r[s.format]??n.format}`}case "not_multiple_of":return `Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case "unrecognized_keys":return `Chei nerecunoscute: ${F(n.keys,", ")}`;case "invalid_key":return `Cheie invalid\u0103 \xEEn ${n.origin}`;case "invalid_union":return "Intrare invalid\u0103";case "invalid_element":return `Valoare invalid\u0103 \xEEn ${n.origin}`;default:return "Intrare invalid\u0103"}}};function HS(){return {localeError:xA()}}function qS(t,e,r,i){let n=Math.abs(t),s=n%10,o=n%100;return o>=11&&o<=19?i:s===1?e:s>=2&&s<=4?r:i}var bA=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${s}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Z(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);if(o){let a=Number(n.maximum),c=qS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.maximum.toString()} ${c}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);if(o){let a=Number(n.minimum),c=qS(a,o.unit.one,o.unit.few,o.unit.many);return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${s}${n.minimum.toString()} ${c}`}return `\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case "invalid_element":return `\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function WS(){return {localeError:bA()}}var TA=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},i={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pri\u010Dakovano ${s}, prejeto ${a}`}case "invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Z(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${s}${n.maximum.toString()} ${o.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${s}${n.minimum.toString()} ${o.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${s.prefix}"`:s.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${s.suffix}"`:s.format==="includes"?`Neveljaven niz: mora vsebovati "${s.includes}"`:s.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${s.pattern}`:`Neveljaven ${r[s.format]??n.format}`}case "not_multiple_of":return `Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case "unrecognized_keys":return `Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${F(n.keys,", ")}`;case "invalid_key":return `Neveljaven klju\u010D v ${n.origin}`;case "invalid_union":return "Neveljaven vnos";case "invalid_element":return `Neveljavna vrednost v ${n.origin}`;default:return "Neveljaven vnos"}}};function KS(){return {localeError:TA()}}var RA=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},i={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: f\xF6rv\xE4ntat ${s}, fick ${a}`}case "invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Z(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()} ${o.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()} ${o.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${s.prefix}"`:s.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${s.suffix}"`:s.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${s.includes}"`:s.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${s.pattern}"`:`Ogiltig(t) ${r[s.format]??n.format}`}case "not_multiple_of":return `Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case "unrecognized_keys":return `${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${F(n.keys,", ")}`;case "invalid_key":return `Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case "invalid_union":return "Ogiltig input";case "invalid_element":return `Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return "Ogiltig input"}}};function ZS(){return {localeError:RA()}}var EA=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},i={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${s}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case "invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Z(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${F(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} ${o.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${s}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} ${o.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${s}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${s.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:s.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${s.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case "unrecognized_keys":return `\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case "invalid_union":return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case "invalid_element":return `${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return "\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function XS(){return {localeError:EA()}}var wA=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},i={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`:`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${s} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case "invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Z(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()} ${o.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",o=e(n.origin);return o?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()} ${o.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${s} ${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${s.prefix}"`:s.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${s.suffix}"`:s.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${s.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:s.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${s.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[s.format]??n.format}`}case "not_multiple_of":return `\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case "unrecognized_keys":return `\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${F(n.keys,", ")}`;case "invalid_key":return `\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case "invalid_union":return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case "invalid_element":return `\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return "\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function JS(){return {localeError:wA()}}var MA=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`:`Ge\xE7ersiz de\u011Fer: beklenen ${s}, al\u0131nan ${a}`}case "invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Z(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Ge\xE7ersiz metin: "${s.prefix}" ile ba\u015Flamal\u0131`:s.format==="ends_with"?`Ge\xE7ersiz metin: "${s.suffix}" ile bitmeli`:s.format==="includes"?`Ge\xE7ersiz metin: "${s.includes}" i\xE7ermeli`:s.format==="regex"?`Ge\xE7ersiz metin: ${s.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[s.format]??n.format}`}case "not_multiple_of":return `Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case "unrecognized_keys":return `Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case "invalid_union":return "Ge\xE7ersiz de\u011Fer";case "invalid_element":return `${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return "Ge\xE7ersiz de\u011Fer"}}};function YS(){return {localeError:MA()}}var AA=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},i={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${s}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case "invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Z(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${s.prefix}"`:s.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${s.suffix}"`:s.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${s.includes}"`:s.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${s.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case "unrecognized_keys":return `\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${F(n.keys,", ")}`;case "invalid_key":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case "invalid_union":return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case "invalid_element":return `\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return "\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function $c(){return {localeError:AA()}}function QS(){return $c()}var IA=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},i={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`:`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${s} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case "invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Z(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${F(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${s}${n.maximum.toString()} ${o.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${s}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${s}${n.minimum.toString()} ${o.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${s}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${s.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:s.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${s.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case "unrecognized_keys":return `\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${F(n.keys,"\u060C ")}`;case "invalid_key":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case "invalid_union":return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case "invalid_element":return `${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return "\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function ex(){return {localeError:IA()}}var CA=()=>{let t={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function e(n){return t[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},i={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto\u2018g\u2018ri kirish: kutilgan ${s}, qabul qilingan ${a}`}case "invalid_value":return n.values.length===1?`Noto\u2018g\u2018ri kirish: kutilgan ${Z(n.values[0])}`:`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()} ${o.unit} ${o.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()} ${o.unit} ${o.verb}`:`Juda kichik: kutilgan ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Noto\u2018g\u2018ri satr: "${s.prefix}" bilan boshlanishi kerak`:s.format==="ends_with"?`Noto\u2018g\u2018ri satr: "${s.suffix}" bilan tugashi kerak`:s.format==="includes"?`Noto\u2018g\u2018ri satr: "${s.includes}" ni o\u2018z ichiga olishi kerak`:s.format==="regex"?`Noto\u2018g\u2018ri satr: ${s.pattern} shabloniga mos kelishi kerak`:`Noto\u2018g\u2018ri ${r[s.format]??n.format}`}case "not_multiple_of":return `Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case "unrecognized_keys":return `Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} dagi kalit noto\u2018g\u2018ri`;case "invalid_union":return "Noto\u2018g\u2018ri kirish";case "invalid_element":return `${n.origin} da noto\u2018g\u2018ri qiymat`;default:return "Noto\u2018g\u2018ri kirish"}}};function tx(){return {localeError:CA()}}var PA=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},i={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`:`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${s}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case "invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Z(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o.verb} ${s}${n.maximum.toString()} ${o.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o.verb} ${s}${n.minimum.toString()} ${o.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${s.prefix}"`:s.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${s.suffix}"`:s.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${s.includes}"`:s.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${s.pattern}`:`${r[s.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case "not_multiple_of":return `S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case "unrecognized_keys":return `Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${F(n.keys,", ")}`;case "invalid_key":return `Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case "invalid_union":return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case "invalid_element":return `Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return "\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function nx(){return {localeError:PA()}}var NA=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},i={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`:`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${s}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case "invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Z(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()} ${o.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()} ${o.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.prefix}" \u5F00\u5934`:s.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${s.suffix}" \u7ED3\u5C3E`:s.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${s.pattern}`:`\u65E0\u6548${r[s.format]??n.format}`}case "not_multiple_of":return `\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case "unrecognized_keys":return `\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${F(n.keys,", ")}`;case "invalid_key":return `${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case "invalid_union":return "\u65E0\u6548\u8F93\u5165";case "invalid_element":return `${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return "\u65E0\u6548\u8F93\u5165"}}};function rx(){return {localeError:NA()}}var OA=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},i={nan:"NaN"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`:`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${s}\uFF0C\u4F46\u6536\u5230 ${a}`}case "invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Z(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()} ${o.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${s}${n.maximum.toString()}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()} ${o.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${s}${n.minimum.toString()}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.prefix}" \u958B\u982D`:s.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${s.suffix}" \u7D50\u5C3E`:s.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${s.includes}"`:s.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${s.pattern}`:`\u7121\u6548\u7684 ${r[s.format]??n.format}`}case "not_multiple_of":return `\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case "unrecognized_keys":return `\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${F(n.keys,"\u3001")}`;case "invalid_key":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case "invalid_union":return "\u7121\u6548\u7684\u8F38\u5165\u503C";case "invalid_element":return `${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return "\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function ix(){return {localeError:OA()}}var zA=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},i={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return n=>{switch(n.code){case "invalid_type":{let s=i[n.expected]??n.expected,o=X(n.input),a=i[o]??o;return /^[A-Z]/.test(n.expected)?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`:`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${s}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case "invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${Z(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${F(n.values,"|")}`;case "too_big":{let s=n.inclusive?"<=":"<",o=e(n.origin);return o?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${o.verb} ${s}${n.maximum} ${o.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.maximum}`}case "too_small":{let s=n.inclusive?">=":">",o=e(n.origin);return o?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${o.verb} ${s}${n.minimum} ${o.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${s}${n.minimum}`}case "invalid_format":{let s=n;return s.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${s.prefix}"`:s.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${s.suffix}"`:s.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${s.includes}"`:s.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${s.pattern}`:`A\u1E63\xEC\u1E63e: ${r[s.format]??n.format}`}case "not_multiple_of":return `N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case "unrecognized_keys":return `B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${F(n.keys,", ")}`;case "invalid_key":return `B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case "invalid_union":return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case "invalid_element":return `Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return "\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function sx(){return {localeError:zA()}}var ox,pm=Symbol("ZodOutput"),mm=Symbol("ZodInput"),Dc=class{constructor(){this._map=new WeakMap,this._idmap=new Map;}add(e,...r){let i=r[0];return this._map.set(e,i),i&&typeof i=="object"&&"id"in i&&this._idmap.set(i.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Lc(){return new Dc}(ox=globalThis).__zod_globalRegistry??(ox.__zod_globalRegistry=Lc());var pt=globalThis.__zod_globalRegistry;function gm(t,e){return new t({type:"string",...Y(e)})}function _m(t,e){return new t({type:"string",coerce:true,...Y(e)})}function kc(t,e){return new t({type:"string",format:"email",check:"string_format",abort:false,...Y(e)})}function Po(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:false,...Y(e)})}function Uc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,...Y(e)})}function Fc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v4",...Y(e)})}function Bc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v6",...Y(e)})}function Vc(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:false,version:"v7",...Y(e)})}function No(t,e){return new t({type:"string",format:"url",check:"string_format",abort:false,...Y(e)})}function jc(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:false,...Y(e)})}function Gc(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:false,...Y(e)})}function Hc(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:false,...Y(e)})}function qc(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:false,...Y(e)})}function Wc(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:false,...Y(e)})}function Kc(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:false,...Y(e)})}function Zc(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:false,...Y(e)})}function Xc(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:false,...Y(e)})}function Jc(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:false,...Y(e)})}function vm(t,e){return new t({type:"string",format:"mac",check:"string_format",abort:false,...Y(e)})}function Yc(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:false,...Y(e)})}function Qc(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:false,...Y(e)})}function el(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:false,...Y(e)})}function tl(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:false,...Y(e)})}function nl(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:false,...Y(e)})}function rl(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:false,...Y(e)})}var ym={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Sm(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:false,local:false,precision:null,...Y(e)})}function xm(t,e){return new t({type:"string",format:"date",check:"string_format",...Y(e)})}function bm(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Y(e)})}function Tm(t,e){return new t({type:"string",format:"duration",check:"string_format",...Y(e)})}function Rm(t,e){return new t({type:"number",checks:[],...Y(e)})}function Em(t,e){return new t({type:"number",coerce:true,checks:[],...Y(e)})}function wm(t,e){return new t({type:"number",check:"number_format",abort:false,format:"safeint",...Y(e)})}function Mm(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float32",...Y(e)})}function Am(t,e){return new t({type:"number",check:"number_format",abort:false,format:"float64",...Y(e)})}function Im(t,e){return new t({type:"number",check:"number_format",abort:false,format:"int32",...Y(e)})}function Cm(t,e){return new t({type:"number",check:"number_format",abort:false,format:"uint32",...Y(e)})}function Pm(t,e){return new t({type:"boolean",...Y(e)})}function Nm(t,e){return new t({type:"boolean",coerce:true,...Y(e)})}function Om(t,e){return new t({type:"bigint",...Y(e)})}function zm(t,e){return new t({type:"bigint",coerce:true,...Y(e)})}function $m(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"int64",...Y(e)})}function Dm(t,e){return new t({type:"bigint",check:"bigint_format",abort:false,format:"uint64",...Y(e)})}function Lm(t,e){return new t({type:"symbol",...Y(e)})}function km(t,e){return new t({type:"undefined",...Y(e)})}function Um(t,e){return new t({type:"null",...Y(e)})}function Fm(t){return new t({type:"any"})}function Bm(t){return new t({type:"unknown"})}function Vm(t,e){return new t({type:"never",...Y(e)})}function jm(t,e){return new t({type:"void",...Y(e)})}function Gm(t,e){return new t({type:"date",...Y(e)})}function Hm(t,e){return new t({type:"date",coerce:true,...Y(e)})}function qm(t,e){return new t({type:"nan",...Y(e)})}function _n(t,e){return new bc({check:"less_than",...Y(e),value:t,inclusive:false})}function Vt(t,e){return new bc({check:"less_than",...Y(e),value:t,inclusive:true})}function vn(t,e){return new Tc({check:"greater_than",...Y(e),value:t,inclusive:false})}function Mt(t,e){return new Tc({check:"greater_than",...Y(e),value:t,inclusive:true})}function il(t){return vn(0,t)}function sl(t){return _n(0,t)}function ol(t){return Vt(0,t)}function al(t){return Mt(0,t)}function Qn(t,e){return new Uf({check:"multiple_of",...Y(e),value:t})}function er(t,e){return new Vf({check:"max_size",...Y(e),maximum:t})}function yn(t,e){return new jf({check:"min_size",...Y(e),minimum:t})}function si(t,e){return new Gf({check:"size_equals",...Y(e),size:t})}function oi(t,e){return new Hf({check:"max_length",...Y(e),maximum:t})}function Cn(t,e){return new qf({check:"min_length",...Y(e),minimum:t})}function ai(t,e){return new Wf({check:"length_equals",...Y(e),length:t})}function Vi(t,e){return new Kf({check:"string_format",format:"regex",...Y(e),pattern:t})}function ji(t){return new Zf({check:"string_format",format:"lowercase",...Y(t)})}function Gi(t){return new Xf({check:"string_format",format:"uppercase",...Y(t)})}function Hi(t,e){return new Jf({check:"string_format",format:"includes",...Y(e),includes:t})}function qi(t,e){return new Yf({check:"string_format",format:"starts_with",...Y(e),prefix:t})}function Wi(t,e){return new Qf({check:"string_format",format:"ends_with",...Y(e),suffix:t})}function cl(t,e,r){return new ep({check:"property",property:t,schema:e,...Y(r)})}function Ki(t,e){return new tp({check:"mime_type",mime:t,...Y(e)})}function an(t){return new np({check:"overwrite",tx:t})}function Zi(t){return an(e=>e.normalize(t))}function Xi(){return an(t=>t.trim())}function Ji(){return an(t=>t.toLowerCase())}function Yi(){return an(t=>t.toUpperCase())}function Qi(){return an(t=>Jh(t))}function Wm(t,e,r){return new t({type:"array",element:e,...Y(r)})}function DA(t,e,r){return new t({type:"union",options:e,...Y(r)})}function LA(t,e,r){return new t({type:"union",options:e,inclusive:false,...Y(r)})}function kA(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...Y(i)})}function UA(t,e,r){return new t({type:"intersection",left:e,right:r})}function FA(t,e,r,i){let n=r instanceof Se,s=n?i:r,o=n?r:null;return new t({type:"tuple",items:e,rest:o,...Y(s)})}function BA(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...Y(i)})}function VA(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...Y(i)})}function jA(t,e,r){return new t({type:"set",valueType:e,...Y(r)})}function GA(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...Y(r)})}function HA(t,e,r){return new t({type:"enum",entries:e,...Y(r)})}function qA(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Y(r)})}function Km(t,e){return new t({type:"file",...Y(e)})}function WA(t,e){return new t({type:"transform",transform:e})}function KA(t,e){return new t({type:"optional",innerType:e})}function ZA(t,e){return new t({type:"nullable",innerType:e})}function XA(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():Qh(r)}})}function JA(t,e,r){return new t({type:"nonoptional",innerType:e,...Y(r)})}function YA(t,e){return new t({type:"success",innerType:e})}function QA(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function eI(t,e,r){return new t({type:"pipe",in:e,out:r})}function tI(t,e){return new t({type:"readonly",innerType:e})}function nI(t,e,r){return new t({type:"template_literal",parts:e,...Y(r)})}function rI(t,e){return new t({type:"lazy",getter:e})}function iI(t,e){return new t({type:"promise",innerType:e})}function Zm(t,e,r){let i=Y(r);return i.abort??(i.abort=true),new t({type:"custom",check:"custom",fn:e,...i})}function Xm(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Y(r)})}function Jm(t,e){let r=ax(i=>(i.addIssue=n=>{if(typeof n=="string")i.issues.push($i(n,i.value,r._zod.def));else {let s=n;s.fatal&&(s.continue=false),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),i.issues.push($i(s));}},t(i.value,i)),e);return r}function ax(t,e){let r=new We({check:"custom",...Y(e)});return r._zod.check=t,r}function Ym(t){let e=new We({check:"describe"});return e._zod.onattach=[r=>{let i=pt.get(r)??{};pt.add(r,{...i,description:t});}],e._zod.check=()=>{},e}function Qm(t){let e=new We({check:"meta"});return e._zod.onattach=[r=>{let i=pt.get(r)??{};pt.add(r,{...i,...t});}],e._zod.check=()=>{},e}function eg(t,e){let r=Y(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(p=>typeof p=="string"?p.toLowerCase():p),n=n.map(p=>typeof p=="string"?p.toLowerCase():p));let s=new Set(i),o=new Set(n),a=t.Codec??Ao,c=t.Boolean??wo,l=t.String??ii,u=new l({type:"string",error:r.error}),d=new c({type:"boolean",error:r.error}),f=new a({type:"pipe",in:u,out:d,transform:((p,g)=>{let m=p;return r.case!=="sensitive"&&(m=m.toLowerCase()),s.has(m)?true:o.has(m)?false:(g.issues.push({code:"invalid_value",expected:"stringbool",values:[...s,...o],input:g.value,inst:f,continue:false}),{})}),reverseTransform:((p,g)=>p===true?i[0]||"true":n[0]||"false"),error:r.error});return f}function es(t,e,r,i={}){let n=Y(i),s={...Y(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:a=>r.test(a),...n};return r instanceof RegExp&&(s.pattern=r),new t(s)}function tr(t){let e=t?.target??"draft-2020-12";return e==="draft-4"&&(e="draft-04"),e==="draft-7"&&(e="draft-07"),{processors:t.processors??{},metadataRegistry:t?.metadata??pt,target:e,unrepresentable:t?.unrepresentable??"throw",override:t?.override??(()=>{}),io:t?.io??"output",counter:0,seen:new Map,cycles:t?.cycles??"ref",reused:t?.reused??"inline",external:t?.external??void 0}}function Fe(t,e,r={path:[],schemaPath:[]}){var i;let n=t._zod.def,s=e.seen.get(t);if(s)return s.count++,r.schemaPath.includes(t)&&(s.cycle=r.path),s.schema;let o={schema:{},count:1,cycle:void 0,path:r.path};e.seen.set(t,o);let a=t._zod.toJSONSchema?.();if(a)o.schema=a;else {let u={...r,schemaPath:[...r.schemaPath,t],path:r.path};if(t._zod.processJSONSchema)t._zod.processJSONSchema(e,o.schema,u);else {let f=o.schema,p=e.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(t,e,f,u);}let d=t._zod.parent;d&&(o.ref||(o.ref=d),Fe(d,e,u),e.seen.get(d).isParent=true);}let c=e.metadataRegistry.get(t);return c&&Object.assign(o.schema,c),e.io==="input"&&At(t)&&(delete o.schema.examples,delete o.schema.default),e.io==="input"&&"_prefault"in o.schema&&((i=o.schema).default??(i.default=o.schema._prefault)),delete o.schema._prefault,e.seen.get(t).schema}function nr(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=new Map;for(let o of t.seen.entries()){let a=t.metadataRegistry.get(o[0])?.id;if(a){let c=i.get(a);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);i.set(a,o[0]);}}let n=o=>{let a=t.target==="draft-2020-12"?"$defs":"definitions";if(t.external){let d=t.external.registry.get(o[0])?.id,f=t.external.uri??(g=>g);if(d)return {ref:f(d)};let p=o[1].defId??o[1].schema.id??`schema${t.counter++}`;return o[1].defId=p,{defId:p,ref:`${f("__shared")}#/${a}/${p}`}}if(o[1]===r)return {ref:"#"};let l=`#/${a}/`,u=o[1].schema.id??`__schema${t.counter++}`;return {defId:u,ref:l+u}},s=o=>{if(o[1].schema.$ref)return;let a=o[1],{ref:c,defId:l}=n(o);a.def={...a.schema},l&&(a.defId=l);let u=a.schema;for(let d in u)delete u[d];u.$ref=c;};if(t.cycles==="throw")for(let o of t.seen.entries()){let a=o[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
65
65
|
|
|
66
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function rr(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let p=t.seen.get(d),g=p.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,u),a._zod.parent===d)for(let S in l)S==="$ref"||S==="allOf"||S in u||delete l[S];if(g.$ref&&p.def)for(let S in l)S==="$ref"||S==="allOf"||S in p.def&&JSON.stringify(l[S])===JSON.stringify(p.def[S])&&delete l[S];}let f=a._zod.parent;if(f&&f!==d){i(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g];}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]});};for(let a of [...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a);}Object.assign(n,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&n.id===s&&delete n.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def);}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:ts(e,"input",t.processors),output:ts(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function At(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return false;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return true;if(i.type==="array")return At(i.element,r);if(i.type==="set")return At(i.valueType,r);if(i.type==="lazy")return At(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return At(i.innerType,r);if(i.type==="intersection")return At(i.left,r)||At(i.right,r);if(i.type==="record"||i.type==="map")return At(i.keyType,r)||At(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?true:At(i.in,r)||At(i.out,r);if(i.type==="object"){for(let n in i.shape)if(At(i.shape[n],r))return true;return false}if(i.type==="union"){for(let n of i.options)if(At(n,r))return true;return false}if(i.type==="tuple"){for(let n of i.items)if(At(n,r))return true;return !!(i.rest&&At(i.rest,r))}return false}var eg=(t,e={})=>r=>{let i=tr({...r,processors:e});return Be(t,i),nr(i,t),rr(i,t)},ts=(t,e,r={})=>i=>{let{libraryOptions:n,target:s}=i??{},o=tr({...n??{},target:s,io:e,processors:r});return Be(t,o),nr(o,t),rr(o,t)};var rI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},tg=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof o=="number"&&(n.maxLength=o),a&&(n.format=rI[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]);}},ng=(t,e,r,i)=>{let n=r,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(o??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(n.minimum=u,n.exclusiveMinimum=true):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),f?p?(n.maximum=l,n.exclusiveMaximum=true):n.exclusiveMaximum=l:typeof o=="number"&&(n.maximum=o),typeof c=="number"&&(n.multipleOf=c);},rg=(t,e,r,i)=>{r.type="boolean";},ig=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},sg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},og=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},ag=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},cg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},lg=(t,e,r,i)=>{r.not={};},ug=(t,e,r,i)=>{},dg=(t,e,r,i)=>{},hg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},fg=(t,e,r,i)=>{let n=t._zod.def,s=mo(n.entries);s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),r.enum=s;},pg=(t,e,r,i)=>{let n=t._zod.def,s=[];for(let o of n.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o));}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o;}else s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),s.every(o=>typeof o=="boolean")&&(r.type="boolean"),s.every(o=>o===null)&&(r.type="null"),r.enum=s;},mg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},gg=(t,e,r,i)=>{let n=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source;},_g=(t,e,r,i)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:c}=t._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,s);},vg=(t,e,r,i)=>{r.type="boolean";},yg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},Sg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},xg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},bg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Tg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Rg=(t,e,r,i)=>{let n=r,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(n.minItems=o),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Be(s.element,e,{...i,path:[...i.path,"items"]});},Eg=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="object",n.properties={};let o=s.shape;for(let l in o)n.properties[l]=Be(o[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{let u=s.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=false:s.catchall?s.catchall&&(n.additionalProperties=Be(s.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=false);},ul=(t,e,r,i)=>{let n=t._zod.def,s=n.inclusive===false,o=n.options.map((a,c)=>Be(a,e,{...i,path:[...i.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=o:r.anyOf=o;},wg=(t,e,r,i)=>{let n=t._zod.def,s=Be(n.left,e,{...i,path:[...i.path,"allOf",0]}),o=Be(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];r.allOf=c;},Mg=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,p)=>Be(f,e,{...i,path:[...i.path,o,p]})),l=s.rest?Be(s.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d);},Ag=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="object";let o=s.keyType,c=o._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let u=Be(s.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=u;}else (e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=Be(s.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=Be(s.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u);}},Ig=(t,e,r,i)=>{let n=t._zod.def,s=Be(n.innerType,e,i),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=n.innerType,r.nullable=true):r.anyOf=[s,{type:"null"}];},Cg=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},Pg=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue));},Ng=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)));},Og=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;let o;try{o=n.catchValue(void 0);}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o;},zg=(t,e,r,i)=>{let n=t._zod.def,s=n.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?n.out:n.in:n.out;Be(o,e,i);let a=e.seen.get(t);a.ref=o;},$g=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,r.readOnly=true;},kg=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},dl=(t,e,r,i)=>{let n=t._zod.def;Be(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},Dg=(t,e,r,i)=>{let n=t._zod.innerType;Be(n,e,i);let s=e.seen.get(t);s.ref=n;},ll={string:tg,number:ng,boolean:rg,bigint:ig,symbol:sg,null:og,undefined:ag,void:cg,never:lg,any:ug,unknown:dg,date:hg,enum:fg,literal:pg,nan:mg,template_literal:gg,file:_g,success:vg,custom:yg,function:Sg,transform:xg,map:bg,set:Tg,array:Rg,object:Eg,union:ul,intersection:wg,tuple:Mg,record:Ag,nullable:Ig,nonoptional:Cg,default:Pg,prefault:Ng,catch:Og,pipe:zg,readonly:$g,promise:kg,optional:dl,lazy:Dg};function ci(t,e){if("_idmap"in t){let i=t,n=tr({...e,processors:ll}),s={};for(let c of i._idmap.entries()){let[l,u]=c;Be(u,n);}let o={},a={registry:i,uri:e?.uri,defs:s};n.external=a;for(let c of i._idmap.entries()){let[l,u]=c;nr(n,u),o[l]=rr(n,u);}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:s};}return {schemas:o}}let r=tr({...e,processors:ll});return Be(t,r),nr(r,t),rr(r,t)}var hl=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e;}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=tr({processors:ll,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}});}process(e,r={path:[],schemaPath:[]}){return Be(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),nr(this.ctx,e);let i=rr(this.ctx,e),{"~standard":n,...s}=i;return s}};var cx={};var Oo={};An(Oo,{ZodAny:()=>r_,ZodArray:()=>a_,ZodBase64:()=>zl,ZodBase64URL:()=>$l,ZodBigInt:()=>ls,ZodBigIntFormat:()=>Ll,ZodBoolean:()=>cs,ZodCIDRv4:()=>Nl,ZodCIDRv6:()=>Ol,ZodCUID:()=>El,ZodCUID2:()=>wl,ZodCatch:()=>M_,ZodCodec:()=>jo,ZodCustom:()=>Go,ZodCustomStringFormat:()=>os,ZodDate:()=>Uo,ZodDefault:()=>x_,ZodDiscriminatedUnion:()=>l_,ZodE164:()=>kl,ZodEmail:()=>xl,ZodEmoji:()=>Tl,ZodEnum:()=>rs,ZodExactOptional:()=>v_,ZodFile:()=>g_,ZodFunction:()=>k_,ZodGUID:()=>$o,ZodIPv4:()=>Cl,ZodIPv6:()=>Pl,ZodIntersection:()=>u_,ZodJWT:()=>Dl,ZodKSUID:()=>Il,ZodLazy:()=>z_,ZodLiteral:()=>m_,ZodMAC:()=>Qg,ZodMap:()=>f_,ZodNaN:()=>I_,ZodNanoID:()=>Rl,ZodNever:()=>s_,ZodNonOptional:()=>jl,ZodNull:()=>n_,ZodNullable:()=>S_,ZodNumber:()=>as,ZodNumberFormat:()=>li,ZodObject:()=>Fo,ZodOptional:()=>Vl,ZodPipe:()=>Vo,ZodPrefault:()=>T_,ZodPreprocess:()=>C_,ZodPromise:()=>$_,ZodReadonly:()=>P_,ZodRecord:()=>ns,ZodSet:()=>p_,ZodString:()=>is,ZodStringFormat:()=>He,ZodSuccess:()=>w_,ZodSymbol:()=>e_,ZodTemplateLiteral:()=>O_,ZodTransform:()=>__,ZodTuple:()=>d_,ZodType:()=>Ae,ZodULID:()=>Ml,ZodURL:()=>Lo,ZodUUID:()=>Sn,ZodUndefined:()=>t_,ZodUnion:()=>Bo,ZodUnknown:()=>i_,ZodVoid:()=>o_,ZodXID:()=>Al,ZodXor:()=>c_,_ZodString:()=>Sl,_default:()=>b_,_function:()=>ub,any:()=>Ul,array:()=>$,base64:()=>Ix,base64url:()=>Cx,bigint:()=>Bx,boolean:()=>ie,catch:()=>A_,check:()=>db,cidrv4:()=>Mx,cidrv6:()=>Ax,codec:()=>ob,cuid:()=>yx,cuid2:()=>Sx,custom:()=>hb,date:()=>Wx,describe:()=>fb,discriminatedUnion:()=>ir,e164:()=>Px,email:()=>bl,emoji:()=>_x,enum:()=>_e,exactOptional:()=>y_,file:()=>nb,float32:()=>Dx,float64:()=>Lx,function:()=>ub,guid:()=>dx,hash:()=>kx,hex:()=>$x,hostname:()=>zx,httpUrl:()=>gx,instanceof:()=>mb,int:()=>vl,int32:()=>Ux,int64:()=>Vx,intersection:()=>cn,invertCodec:()=>ab,ipv4:()=>Rx,ipv6:()=>wx,json:()=>_b,jwt:()=>Nx,keyof:()=>Kx,ksuid:()=>Tx,lazy:()=>sr,literal:()=>D,looseObject:()=>de,looseRecord:()=>Yx,mac:()=>Ex,map:()=>Qx,meta:()=>pb,nan:()=>sb,nanoid:()=>vx,nativeEnum:()=>tb,never:()=>Fl,nonoptional:()=>E_,null:()=>xn,nullable:()=>ko,nullish:()=>rb,number:()=>K,object:()=>I,optional:()=>le,partialRecord:()=>Jx,pipe:()=>yl,prefault:()=>R_,preprocess:()=>Nn,promise:()=>lb,readonly:()=>N_,record:()=>re,refine:()=>D_,set:()=>eb,strictObject:()=>Zx,string:()=>x,stringFormat:()=>Ox,stringbool:()=>gb,success:()=>ib,superRefine:()=>L_,symbol:()=>Gx,templateLiteral:()=>cb,transform:()=>Bl,tuple:()=>h_,uint32:()=>Fx,uint64:()=>jx,ulid:()=>xx,undefined:()=>Hx,union:()=>oe,unknown:()=>ce,url:()=>ss,uuid:()=>hx,uuidv4:()=>fx,uuidv6:()=>px,uuidv7:()=>mx,void:()=>qx,xid:()=>bx,xor:()=>Xx});var fl={};An(fl,{endsWith:()=>Wi,gt:()=>vn,gte:()=>Mt,includes:()=>Hi,length:()=>ai,lowercase:()=>ji,lt:()=>_n,lte:()=>Vt,maxLength:()=>oi,maxSize:()=>er,mime:()=>Ki,minLength:()=>Cn,minSize:()=>yn,multipleOf:()=>Qn,negative:()=>sl,nonnegative:()=>al,nonpositive:()=>ol,normalize:()=>Zi,overwrite:()=>an,positive:()=>il,property:()=>cl,regex:()=>Vi,size:()=>si,slugify:()=>Qi,startsWith:()=>qi,toLowerCase:()=>Ji,toUpperCase:()=>Yi,trim:()=>Xi,uppercase:()=>Gi});var jt={};An(jt,{ZodISODate:()=>ml,ZodISODateTime:()=>pl,ZodISODuration:()=>_l,ZodISOTime:()=>gl,date:()=>Ug,datetime:()=>Lg,duration:()=>Bg,time:()=>Fg});var pl=z("ZodISODateTime",(t,e)=>{mp.init(t,e),He.init(t,e);});function Lg(t){return ym(pl,t)}var ml=z("ZodISODate",(t,e)=>{gp.init(t,e),He.init(t,e);});function Ug(t){return Sm(ml,t)}var gl=z("ZodISOTime",(t,e)=>{_p.init(t,e),He.init(t,e);});function Fg(t){return xm(gl,t)}var _l=z("ZodISODuration",(t,e)=>{vp.init(t,e),He.init(t,e);});function Bg(t){return bm(_l,t)}var lx=(t,e)=>{So.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>bo(t,r)},flatten:{value:r=>xo(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Oi,2);}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Oi,2);}},isEmpty:{get(){return t.issues.length===0}}});},sI=z("ZodError",lx),Dt=z("ZodError",lx,{Parent:Error});var Vg=ki(Dt),jg=Di(Dt),zo=Li(Dt),Gg=Ui(Dt),Hg=hc(Dt),qg=fc(Dt),Wg=pc(Dt),Kg=mc(Dt),Zg=gc(Dt),Xg=_c(Dt),Jg=vc(Dt),Yg=yc(Dt);var ux=new WeakMap;function Do(t,e,r){let i=Object.getPrototypeOf(t),n=ux.get(i);if(n||(n=new Set,ux.set(i,n)),!n.has(e)){n.add(e);for(let s in r){let o=r[s];Object.defineProperty(i,s,{configurable:true,enumerable:false,get(){let a=o.bind(this);return Object.defineProperty(this,s,{configurable:true,writable:true,enumerable:true,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:true,writable:true,enumerable:true,value:a});}});}}}var Ae=z("ZodType",(t,e)=>(xe.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ts(t,"input"),output:ts(t,"output")}}),t.toJSONSchema=eg(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,i)=>Vg(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>zo(t,r,i),t.parseAsync=async(r,i)=>jg(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Gg(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>Hg(t,r,i),t.decode=(r,i)=>qg(t,r,i),t.encodeAsync=async(r,i)=>Wg(t,r,i),t.decodeAsync=async(r,i)=>Kg(t,r,i),t.safeEncode=(r,i)=>Zg(t,r,i),t.safeDecode=(r,i)=>Xg(t,r,i),t.safeEncodeAsync=async(r,i)=>Jg(t,r,i),t.safeDecodeAsync=async(r,i)=>Yg(t,r,i),Do(t,"ZodType",{check(...r){let i=this.def;return this.clone(J.mergeDefs(i,{checks:[...i.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:true})},with(...r){return this.check(...r)},clone(r,i){return Et(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(D_(r,i))},superRefine(r,i){return this.check(L_(r,i))},overwrite(r){return this.check(an(r))},optional(){return le(this)},exactOptional(){return y_(this)},nullable(){return ko(this)},nullish(){return le(ko(this))},nonoptional(r){return E_(this,r)},array(){return $(this)},or(r){return oe([this,r])},and(r){return cn(this,r)},transform(r){return yl(this,Bl(r))},default(r){return b_(this,r)},prefault(r){return R_(this,r)},catch(r){return A_(this,r)},pipe(r){return yl(this,r)},readonly(){return N_(this)},describe(r){let i=this.clone();return pt.add(i,{description:r}),i},meta(...r){if(r.length===0)return pt.get(this);let i=this.clone();return pt.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return pt.get(t)?.description},configurable:true}),t)),Sl=z("_ZodString",(t,e)=>{ii.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>tg(t,i,n);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Do(t,"_ZodString",{regex(...i){return this.check(Vi(...i))},includes(...i){return this.check(Hi(...i))},startsWith(...i){return this.check(qi(...i))},endsWith(...i){return this.check(Wi(...i))},min(...i){return this.check(Cn(...i))},max(...i){return this.check(oi(...i))},length(...i){return this.check(ai(...i))},nonempty(...i){return this.check(Cn(1,...i))},lowercase(i){return this.check(ji(i))},uppercase(i){return this.check(Gi(i))},trim(){return this.check(Xi())},normalize(...i){return this.check(Zi(...i))},toLowerCase(){return this.check(Ji())},toUpperCase(){return this.check(Yi())},slugify(){return this.check(Qi())}});}),is=z("ZodString",(t,e)=>{ii.init(t,e),Sl.init(t,e),t.email=r=>t.check(Lc(xl,r)),t.url=r=>t.check(No(Lo,r)),t.jwt=r=>t.check(rl(Dl,r)),t.emoji=r=>t.check(jc(Tl,r)),t.guid=r=>t.check(Po($o,r)),t.uuid=r=>t.check(Uc(Sn,r)),t.uuidv4=r=>t.check(Fc(Sn,r)),t.uuidv6=r=>t.check(Bc(Sn,r)),t.uuidv7=r=>t.check(Vc(Sn,r)),t.nanoid=r=>t.check(Gc(Rl,r)),t.guid=r=>t.check(Po($o,r)),t.cuid=r=>t.check(Hc(El,r)),t.cuid2=r=>t.check(qc(wl,r)),t.ulid=r=>t.check(Wc(Ml,r)),t.base64=r=>t.check(el(zl,r)),t.base64url=r=>t.check(tl($l,r)),t.xid=r=>t.check(Kc(Al,r)),t.ksuid=r=>t.check(Zc(Il,r)),t.ipv4=r=>t.check(Xc(Cl,r)),t.ipv6=r=>t.check(Jc(Pl,r)),t.cidrv4=r=>t.check(Yc(Nl,r)),t.cidrv6=r=>t.check(Qc(Ol,r)),t.e164=r=>t.check(nl(kl,r)),t.datetime=r=>t.check(Lg(r)),t.date=r=>t.check(Ug(r)),t.time=r=>t.check(Fg(r)),t.duration=r=>t.check(Bg(r));});function x(t){return mm(is,t)}var He=z("ZodStringFormat",(t,e)=>{Ge.init(t,e),Sl.init(t,e);}),xl=z("ZodEmail",(t,e)=>{op.init(t,e),He.init(t,e);});function bl(t){return Lc(xl,t)}var $o=z("ZodGUID",(t,e)=>{ip.init(t,e),He.init(t,e);});function dx(t){return Po($o,t)}var Sn=z("ZodUUID",(t,e)=>{sp.init(t,e),He.init(t,e);});function hx(t){return Uc(Sn,t)}function fx(t){return Fc(Sn,t)}function px(t){return Bc(Sn,t)}function mx(t){return Vc(Sn,t)}var Lo=z("ZodURL",(t,e)=>{ap.init(t,e),He.init(t,e);});function ss(t){return No(Lo,t)}function gx(t){return No(Lo,{protocol:Bt.httpProtocol,hostname:Bt.domain,...J.normalizeParams(t)})}var Tl=z("ZodEmoji",(t,e)=>{cp.init(t,e),He.init(t,e);});function _x(t){return jc(Tl,t)}var Rl=z("ZodNanoID",(t,e)=>{lp.init(t,e),He.init(t,e);});function vx(t){return Gc(Rl,t)}var El=z("ZodCUID",(t,e)=>{up.init(t,e),He.init(t,e);});function yx(t){return Hc(El,t)}var wl=z("ZodCUID2",(t,e)=>{dp.init(t,e),He.init(t,e);});function Sx(t){return qc(wl,t)}var Ml=z("ZodULID",(t,e)=>{hp.init(t,e),He.init(t,e);});function xx(t){return Wc(Ml,t)}var Al=z("ZodXID",(t,e)=>{fp.init(t,e),He.init(t,e);});function bx(t){return Kc(Al,t)}var Il=z("ZodKSUID",(t,e)=>{pp.init(t,e),He.init(t,e);});function Tx(t){return Zc(Il,t)}var Cl=z("ZodIPv4",(t,e)=>{yp.init(t,e),He.init(t,e);});function Rx(t){return Xc(Cl,t)}var Qg=z("ZodMAC",(t,e)=>{xp.init(t,e),He.init(t,e);});function Ex(t){return _m(Qg,t)}var Pl=z("ZodIPv6",(t,e)=>{Sp.init(t,e),He.init(t,e);});function wx(t){return Jc(Pl,t)}var Nl=z("ZodCIDRv4",(t,e)=>{bp.init(t,e),He.init(t,e);});function Mx(t){return Yc(Nl,t)}var Ol=z("ZodCIDRv6",(t,e)=>{Tp.init(t,e),He.init(t,e);});function Ax(t){return Qc(Ol,t)}var zl=z("ZodBase64",(t,e)=>{Ep.init(t,e),He.init(t,e);});function Ix(t){return el(zl,t)}var $l=z("ZodBase64URL",(t,e)=>{wp.init(t,e),He.init(t,e);});function Cx(t){return tl($l,t)}var kl=z("ZodE164",(t,e)=>{Mp.init(t,e),He.init(t,e);});function Px(t){return nl(kl,t)}var Dl=z("ZodJWT",(t,e)=>{Ap.init(t,e),He.init(t,e);});function Nx(t){return rl(Dl,t)}var os=z("ZodCustomStringFormat",(t,e)=>{Ip.init(t,e),He.init(t,e);});function Ox(t,e,r={}){return es(os,t,e,r)}function zx(t){return es(os,"hostname",Bt.hostname,t)}function $x(t){return es(os,"hex",Bt.hex,t)}function kx(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=Bt[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return es(os,i,n,e)}var as=z("ZodNumber",(t,e)=>{Ac.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>ng(t,i,n),Do(t,"ZodNumber",{gt(i,n){return this.check(vn(i,n))},gte(i,n){return this.check(Mt(i,n))},min(i,n){return this.check(Mt(i,n))},lt(i,n){return this.check(_n(i,n))},lte(i,n){return this.check(Vt(i,n))},max(i,n){return this.check(Vt(i,n))},int(i){return this.check(vl(i))},safe(i){return this.check(vl(i))},positive(i){return this.check(vn(0,i))},nonnegative(i){return this.check(Mt(0,i))},negative(i){return this.check(_n(0,i))},nonpositive(i){return this.check(Vt(0,i))},multipleOf(i,n){return this.check(Qn(i,n))},step(i,n){return this.check(Qn(i,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=true,t.format=r.format??null;});function K(t){return Tm(as,t)}var li=z("ZodNumberFormat",(t,e)=>{Cp.init(t,e),as.init(t,e);});function vl(t){return Em(li,t)}function Dx(t){return wm(li,t)}function Lx(t){return Mm(li,t)}function Ux(t){return Am(li,t)}function Fx(t){return Im(li,t)}var cs=z("ZodBoolean",(t,e)=>{wo.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>rg(t,r,i);});function ie(t){return Cm(cs,t)}var ls=z("ZodBigInt",(t,e)=>{Ic.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>ig(t,i),t.gte=(i,n)=>t.check(Mt(i,n)),t.min=(i,n)=>t.check(Mt(i,n)),t.gt=(i,n)=>t.check(vn(i,n)),t.gte=(i,n)=>t.check(Mt(i,n)),t.min=(i,n)=>t.check(Mt(i,n)),t.lt=(i,n)=>t.check(_n(i,n)),t.lte=(i,n)=>t.check(Vt(i,n)),t.max=(i,n)=>t.check(Vt(i,n)),t.positive=i=>t.check(vn(BigInt(0),i)),t.negative=i=>t.check(_n(BigInt(0),i)),t.nonpositive=i=>t.check(Vt(BigInt(0),i)),t.nonnegative=i=>t.check(Mt(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Qn(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null;});function Bx(t){return Nm(ls,t)}var Ll=z("ZodBigIntFormat",(t,e)=>{Pp.init(t,e),ls.init(t,e);});function Vx(t){return zm(Ll,t)}function jx(t){return $m(Ll,t)}var e_=z("ZodSymbol",(t,e)=>{Np.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>sg(t,r);});function Gx(t){return km(e_,t)}var t_=z("ZodUndefined",(t,e)=>{Op.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ag(t,r);});function Hx(t){return Dm(t_,t)}var n_=z("ZodNull",(t,e)=>{zp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>og(t,r,i);});function xn(t){return Lm(n_,t)}var r_=z("ZodAny",(t,e)=>{$p.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ug();});function Ul(){return Um(r_)}var i_=z("ZodUnknown",(t,e)=>{kp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dg();});function ce(){return Fm(i_)}var s_=z("ZodNever",(t,e)=>{Dp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lg(t,r,i);});function Fl(t){return Bm(s_,t)}var o_=z("ZodVoid",(t,e)=>{Lp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cg(t,r);});function qx(t){return Vm(o_,t)}var Uo=z("ZodDate",(t,e)=>{Up.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>hg(t,i),t.min=(i,n)=>t.check(Mt(i,n)),t.max=(i,n)=>t.check(Vt(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null;});function Wx(t){return jm(Uo,t)}var a_=z("ZodArray",(t,e)=>{Fp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rg(t,r,i,n),t.element=e.element,Do(t,"ZodArray",{min(r,i){return this.check(Cn(r,i))},nonempty(r){return this.check(Cn(1,r))},max(r,i){return this.check(oi(r,i))},length(r,i){return this.check(ai(r,i))},unwrap(){return this.element}});});function $(t,e){return qm(a_,t,e)}function Kx(t){let e=t._zod.def.shape;return _e(Object.keys(e))}var Fo=z("ZodObject",(t,e)=>{Bp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eg(t,r,i,n),J.defineLazy(t,"shape",()=>e.shape),Do(t,"ZodObject",{keyof(){return _e(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ce()})},loose(){return this.clone({...this._zod.def,catchall:ce()})},strict(){return this.clone({...this._zod.def,catchall:Fl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return J.extend(this,r)},safeExtend(r){return J.safeExtend(this,r)},merge(r){return J.merge(this,r)},pick(r){return J.pick(this,r)},omit(r){return J.omit(this,r)},partial(...r){return J.partial(Vl,this,r[0])},required(...r){return J.required(jl,this,r[0])}});});function I(t,e){let r={type:"object",shape:t??{},...J.normalizeParams(e)};return new Fo(r)}function Zx(t,e){return new Fo({type:"object",shape:t,catchall:Fl(),...J.normalizeParams(e)})}function de(t,e){return new Fo({type:"object",shape:t,catchall:ce(),...J.normalizeParams(e)})}var Bo=z("ZodUnion",(t,e)=>{Mo.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ul(t,r,i,n),t.options=e.options;});function oe(t,e){return new Bo({type:"union",options:t,...J.normalizeParams(e)})}var c_=z("ZodXor",(t,e)=>{Bo.init(t,e),Vp.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ul(t,r,i,n),t.options=e.options;});function Xx(t,e){return new c_({type:"union",options:t,inclusive:false,...J.normalizeParams(e)})}var l_=z("ZodDiscriminatedUnion",(t,e)=>{Bo.init(t,e),jp.init(t,e);});function ir(t,e,r){return new l_({type:"union",options:e,discriminator:t,...J.normalizeParams(r)})}var u_=z("ZodIntersection",(t,e)=>{Gp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wg(t,r,i,n);});function cn(t,e){return new u_({type:"intersection",left:t,right:e})}var d_=z("ZodTuple",(t,e)=>{Cc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mg(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r});});function h_(t,e,r){let i=e instanceof xe,n=i?r:e,s=i?e:null;return new d_({type:"tuple",items:t,rest:s,...J.normalizeParams(n)})}var ns=z("ZodRecord",(t,e)=>{Hp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ag(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType;});function re(t,e,r){return !e||!e._zod?new ns({type:"record",keyType:x(),valueType:t,...J.normalizeParams(e)}):new ns({type:"record",keyType:t,valueType:e,...J.normalizeParams(r)})}function Jx(t,e,r){let i=Et(t);return i._zod.values=void 0,new ns({type:"record",keyType:i,valueType:e,...J.normalizeParams(r)})}function Yx(t,e,r){return new ns({type:"record",keyType:t,valueType:e,mode:"loose",...J.normalizeParams(r)})}var f_=z("ZodMap",(t,e)=>{qp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bg(t,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(yn(...r)),t.nonempty=r=>t.check(yn(1,r)),t.max=(...r)=>t.check(er(...r)),t.size=(...r)=>t.check(si(...r));});function Qx(t,e,r){return new f_({type:"map",keyType:t,valueType:e,...J.normalizeParams(r)})}var p_=z("ZodSet",(t,e)=>{Wp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tg(t,r),t.min=(...r)=>t.check(yn(...r)),t.nonempty=r=>t.check(yn(1,r)),t.max=(...r)=>t.check(er(...r)),t.size=(...r)=>t.check(si(...r));});function eb(t,e){return new p_({type:"set",valueType:t,...J.normalizeParams(e)})}var rs=z("ZodEnum",(t,e)=>{Kp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>fg(t,i,n),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let s={};for(let o of i)if(r.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new rs({...e,checks:[],...J.normalizeParams(n),entries:s})},t.exclude=(i,n)=>{let s={...e.entries};for(let o of i)if(r.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new rs({...e,checks:[],...J.normalizeParams(n),entries:s})};});function _e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new rs({type:"enum",entries:r,...J.normalizeParams(e)})}function tb(t,e){return new rs({type:"enum",entries:t,...J.normalizeParams(e)})}var m_=z("ZodLiteral",(t,e)=>{Zp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>pg(t,r,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}});});function D(t,e){return new m_({type:"literal",values:Array.isArray(t)?t:[t],...J.normalizeParams(e)})}var g_=z("ZodFile",(t,e)=>{Xp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_g(t,r,i),t.min=(r,i)=>t.check(yn(r,i)),t.max=(r,i)=>t.check(er(r,i)),t.mime=(r,i)=>t.check(Ki(Array.isArray(r)?r:[r],i));});function nb(t){return Wm(g_,t)}var __=z("ZodTransform",(t,e)=>{Jp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xg(t,r),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(J.issue(s,r.value,e));else {let o=s;o.fatal&&(o.continue=false),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(J.issue(o));}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=true,r)):(r.value=n,r.fallback=true,r)};});function Bl(t){return new __({type:"transform",transform:t})}var Vl=z("ZodOptional",(t,e)=>{Pc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dl(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function le(t){return new Vl({type:"optional",innerType:t})}var v_=z("ZodExactOptional",(t,e)=>{Yp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dl(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function y_(t){return new v_({type:"optional",innerType:t})}var S_=z("ZodNullable",(t,e)=>{Qp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ig(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function ko(t){return new S_({type:"nullable",innerType:t})}function rb(t){return le(ko(t))}var x_=z("ZodDefault",(t,e)=>{em.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap;});function b_(t,e){return new x_({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():J.shallowClone(e)}})}var T_=z("ZodPrefault",(t,e)=>{tm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ng(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function R_(t,e){return new T_({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():J.shallowClone(e)}})}var jl=z("ZodNonOptional",(t,e)=>{nm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function E_(t,e){return new jl({type:"nonoptional",innerType:t,...J.normalizeParams(e)})}var w_=z("ZodSuccess",(t,e)=>{rm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vg(t,r,i),t.unwrap=()=>t._zod.def.innerType;});function ib(t){return new w_({type:"success",innerType:t})}var M_=z("ZodCatch",(t,e)=>{im.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Og(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap;});function A_(t,e){return new M_({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var I_=z("ZodNaN",(t,e)=>{sm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mg(t,r);});function sb(t){return Hm(I_,t)}var Vo=z("ZodPipe",(t,e)=>{Nc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zg(t,r,i,n),t.in=e.in,t.out=e.out;});function yl(t,e){return new Vo({type:"pipe",in:t,out:e})}var jo=z("ZodCodec",(t,e)=>{Vo.init(t,e),Ao.init(t,e);});function ob(t,e,r){return new jo({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function ab(t){let e=t._zod.def;return new jo({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var C_=z("ZodPreprocess",(t,e)=>{Vo.init(t,e),om.init(t,e);}),P_=z("ZodReadonly",(t,e)=>{am.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$g(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function N_(t){return new P_({type:"readonly",innerType:t})}var O_=z("ZodTemplateLiteral",(t,e)=>{cm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gg(t,r,i);});function cb(t,e){return new O_({type:"template_literal",parts:t,...J.normalizeParams(e)})}var z_=z("ZodLazy",(t,e)=>{dm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Dg(t,r,i,n),t.unwrap=()=>t._zod.def.getter();});function sr(t){return new z_({type:"lazy",getter:t})}var $_=z("ZodPromise",(t,e)=>{um.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function lb(t){return new $_({type:"promise",innerType:t})}var k_=z("ZodFunction",(t,e)=>{lm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sg(t,r);});function ub(t){return new k_({type:"function",input:Array.isArray(t?.input)?h_(t?.input):t?.input??$(ce()),output:t?.output??ce()})}var Go=z("ZodCustom",(t,e)=>{hm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yg(t,r);});function db(t){let e=new We({check:"custom"});return e._zod.check=t,e}function hb(t,e){return Km(Go,t??(()=>true),e)}function D_(t,e={}){return Zm(Go,t,e)}function L_(t,e){return Xm(t,e)}var fb=Jm,pb=Ym;function mb(t,e={}){let r=new Go({type:"custom",check:"custom",fn:i=>i instanceof t,abort:true,...J.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]});},r}var gb=(...t)=>Qm({Codec:jo,Boolean:cs,String:is},...t);function _b(t){let e=sr(()=>oe([x(t),K(),ie(),xn(),$(e),re(x(),e)]));return e}function Nn(t,e){return new C_({type:"pipe",in:Bl(t),out:e})}var F_={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function aI(t){Je({customError:t});}function cI(){return Je().customError}var U_;U_||(U_={});var se={...Oo,...fl,iso:jt},lI=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function uI(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function dI(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function vb(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return se.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return se.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let s=dI(n,e),o=yt(s,e);return e.refs.set(n,o),e.processing.delete(n),o}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===true&&n.length===1&&n[0]===null)return se.null();if(n.length===0)return se.never();if(n.length===1)return se.literal(n[0]);if(n.every(o=>typeof o=="string"))return se.enum(n);let s=n.map(o=>se.literal(o));return s.length<2?s[0]:se.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return se.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(s=>{let o={...t,type:s};return vb(o,e)});return n.length===0?se.never():n.length===1?n[0]:se.union(n)}if(!r)return se.any();let i;switch(r){case "string":{let n=se.string();if(t.format){let s=t.format;s==="email"?n=n.check(se.email()):s==="uri"||s==="uri-reference"?n=n.check(se.url()):s==="uuid"||s==="guid"?n=n.check(se.uuid()):s==="date-time"?n=n.check(se.iso.datetime()):s==="date"?n=n.check(se.iso.date()):s==="time"?n=n.check(se.iso.time()):s==="duration"?n=n.check(se.iso.duration()):s==="ipv4"?n=n.check(se.ipv4()):s==="ipv6"?n=n.check(se.ipv6()):s==="mac"?n=n.check(se.mac()):s==="cidr"?n=n.check(se.cidrv4()):s==="cidr-v6"?n=n.check(se.cidrv6()):s==="base64"?n=n.check(se.base64()):s==="base64url"?n=n.check(se.base64url()):s==="e164"?n=n.check(se.e164()):s==="jwt"?n=n.check(se.jwt()):s==="emoji"?n=n.check(se.emoji()):s==="nanoid"?n=n.check(se.nanoid()):s==="cuid"?n=n.check(se.cuid()):s==="cuid2"?n=n.check(se.cuid2()):s==="ulid"?n=n.check(se.ulid()):s==="xid"?n=n.check(se.xid()):s==="ksuid"&&(n=n.check(se.ksuid()));}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case "number":case "integer":{let n=r==="integer"?se.number().int():se.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===true&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===true&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case "boolean":{i=se.boolean();break}case "null":{i=se.null();break}case "object":{let n={},s=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(s)){let u=yt(l,e);n[c]=o.has(c)?u:u.optional();}if(t.propertyNames){let c=yt(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?yt(t.additionalProperties,e):se.any();if(Object.keys(n).length===0){i=se.record(c,l);break}let u=se.object(n).passthrough(),d=se.looseRecord(c,l);i=se.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=yt(c[f],e),g=se.string().regex(new RegExp(f));u.push(se.looseRecord(g,p));}let d=[];if(Object.keys(n).length>0&&d.push(se.object(n).passthrough()),d.push(...u),d.length===0)i=se.object({}).passthrough();else if(d.length===1)i=d[0];else {let f=se.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)f=se.intersection(f,d[p]);i=f;}break}let a=se.object(n);t.additionalProperties===false?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(yt(t.additionalProperties,e)):i=a.passthrough();break}case "array":{let n=t.prefixItems,s=t.items;if(n&&Array.isArray(n)){let o=n.map(c=>yt(c,e)),a=s&&typeof s=="object"&&!Array.isArray(s)?yt(s,e):void 0;a?i=se.tuple(o).rest(a):i=se.tuple(o),typeof t.minItems=="number"&&(i=i.check(se.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(se.maxLength(t.maxItems)));}else if(Array.isArray(s)){let o=s.map(c=>yt(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?yt(t.additionalItems,e):void 0;a?i=se.tuple(o).rest(a):i=se.tuple(o),typeof t.minItems=="number"&&(i=i.check(se.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(se.maxLength(t.maxItems)));}else if(s!==void 0){let o=yt(s,e),a=se.array(o);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a;}else i=se.array(se.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function yt(t,e){if(typeof t=="boolean")return t?se.any():se.never();let r=vb(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>yt(l,e)),c=se.union(a);r=i?se.intersection(r,c):c;}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>yt(l,e)),c=se.xor(a);r=i?se.intersection(r,c):c;}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:se.any();else {let a=i?r:yt(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)a=se.intersection(a,yt(t.allOf[l],e));r=a;}t.nullable===true&&e.version==="openapi-3.0"&&(r=se.nullable(r)),t.readOnly===true&&(r=se.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of s)a in t&&(n[a]=t[a]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let a of o)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))lI.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function yb(t,e){if(typeof t=="boolean")return t?se.any():se.never();let r;try{r=JSON.parse(JSON.stringify(t));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=uI(r,e?.defaultTarget),n=r.$defs||r.definitions||{},s={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??pt};return yt(r,s)}var Ho={};An(Ho,{bigint:()=>mI,boolean:()=>pI,date:()=>gI,number:()=>fI,string:()=>hI});function hI(t){return gm(is,t)}function fI(t){return Rm(as,t)}function pI(t){return Pm(cs,t)}function mI(t){return Om(ls,t)}function gI(t){return Gm(Uo,t)}Je(Oc());var di="2025-11-25";var Gl=[di,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Hl="io.modelcontextprotocol/related-task",zn="io.modelcontextprotocol/protocolVersion",us="io.modelcontextprotocol/clientInfo",bn="io.modelcontextprotocol/serverInfo",$n="io.modelcontextprotocol/clientCapabilities",hi="io.modelcontextprotocol/subscriptionId",ar="io.modelcontextprotocol/logLevel";var fi="2.0";var or=sr(()=>oe([x(),K(),ie(),xn(),re(x(),or),$(or)])),Ye=re(x(),or),V_=$(or),qo=oe([x(),K().int()]),Wo=x(),ql=I({ttl:K().optional()}),Wl=I({taskId:x()}),Ko=de({progressToken:qo.optional(),[Hl]:Wl.optional()}),dt=I({_meta:Ko.optional()}),pi=dt.extend({task:ql.optional()}),Qe=I({method:x(),params:dt.loose().optional()}),St=I({_meta:Ko.optional()}),xt=I({method:x(),params:St.loose().optional()}),Zo=de({get[bn](){return fs.optional().catch(void 0)}}),et=de({_meta:Zo.optional()}),cr=oe([x(),K().int()]),Xo=I({jsonrpc:D(fi),id:cr,...Qe.shape}).strict(),Jo=I({jsonrpc:D(fi),...xt.shape}).strict(),ds=I({jsonrpc:D(fi),id:cr,result:et}).strict(),hs=I({jsonrpc:D(fi),id:cr.optional(),error:I({code:K().int(),message:x(),data:ce().optional()})}).strict(),Yo=oe([Xo,Jo,ds,hs]),j_=oe([ds,hs]),Qo=et.strict(),Kl=St.extend({requestId:cr.optional(),reason:x().optional()}),ea=xt.extend({method:D("notifications/cancelled"),params:Kl}),Zl=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),lr=I({icons:$(Zl).optional()}),On=I({name:x(),title:x().optional()}),fs=On.extend({...On.shape,...lr.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),vI=cn(I({applyDefaults:ie().optional()}),Ye),yI=Nn(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,cn(I({form:vI.optional(),url:Ye.optional()}),Ye.optional())),Xl=de({list:Ye.optional(),cancel:Ye.optional(),requests:de({sampling:de({createMessage:Ye.optional()}).optional(),elicitation:de({create:Ye.optional()}).optional()}).optional()}),Jl=de({list:Ye.optional(),cancel:Ye.optional(),requests:de({tools:de({call:Ye.optional()}).optional()}).optional()}),Yl=I({experimental:re(x(),Ye).optional(),sampling:I({context:Ye.optional(),tools:Ye.optional()}).optional(),elicitation:yI.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:Xl.optional(),extensions:re(x(),Ye).optional()}),Ql=dt.extend({protocolVersion:x(),capabilities:Yl,clientInfo:fs}),eu=Qe.extend({method:D("initialize"),params:Ql}),ta=I({experimental:re(x(),Ye).optional(),logging:Ye.optional(),completions:Ye.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:Jl.optional(),extensions:re(x(),Ye).optional()}),tu=et.extend({protocolVersion:x(),capabilities:ta,serverInfo:fs,instructions:x().optional()}),nu=xt.extend({method:D("notifications/initialized"),params:St.optional()}),ru=Qe.extend({method:D("server/discover"),params:dt.optional()}),iu=et.extend({supportedVersions:$(x()),capabilities:ta,instructions:x().optional()}),na=Qe.extend({method:D("ping"),params:dt.optional()}),su=I({progress:K(),total:le(K()),message:le(x())}),ou=I({...St.shape,...su.shape,progressToken:qo}),ra=xt.extend({method:D("notifications/progress"),params:ou}),au=dt.extend({cursor:Wo.optional()}),ur=Qe.extend({params:au.optional()}),dr=et.extend({nextCursor:Wo.optional()}),ia=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),sa=ia.extend({text:x()}),G_=x().refine(t=>{try{return atob(t),!0}catch{return false}},{message:"Invalid Base64 string"}),oa=ia.extend({blob:G_}),hr=_e(["user","assistant"]),kn=I({audience:$(hr).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),aa=I({...On.shape,...lr.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:kn.optional(),_meta:le(de({}))}),cu=I({...On.shape,...lr.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:kn.optional(),_meta:le(de({}))}),lu=ur.extend({method:D("resources/list")}),uu=dr.extend({resources:$(aa)}),du=ur.extend({method:D("resources/templates/list")}),hu=dr.extend({resourceTemplates:$(cu)}),ps=dt.extend({uri:x()}),fu=ps,pu=Qe.extend({method:D("resources/read"),params:fu}),mu=et.extend({contents:$(oe([sa,oa]))}),gu=xt.extend({method:D("notifications/resources/list_changed"),params:St.optional()}),_u=ps,vu=Qe.extend({method:D("resources/subscribe"),params:_u}),yu=ps,Su=Qe.extend({method:D("resources/unsubscribe"),params:yu}),ca=I({toolsListChanged:ie().optional(),promptsListChanged:ie().optional(),resourcesListChanged:ie().optional(),resourceSubscriptions:$(x()).optional()}),xu=dt.extend({notifications:ca}),bu=Qe.extend({method:D("subscriptions/listen"),params:xu}),Tu=St.extend({notifications:ca}),Ru=xt.extend({method:D("notifications/subscriptions/acknowledged"),params:Tu}),Eu=Zo.extend({[hi]:cr}),wu=et.extend({_meta:Eu}),Mu=St.extend({uri:x()}),Au=xt.extend({method:D("notifications/resources/updated"),params:Mu}),Iu=I({name:x(),description:le(x()),required:le(ie())}),Cu=I({...On.shape,...lr.shape,description:le(x()),arguments:le($(Iu)),_meta:le(de({}))}),Pu=ur.extend({method:D("prompts/list")}),Nu=dr.extend({prompts:$(Cu)}),Ou=dt.extend({name:x(),arguments:re(x(),x()).optional()}),zu=Qe.extend({method:D("prompts/get"),params:Ou}),ms=I({type:D("text"),text:x(),annotations:kn.optional(),_meta:re(x(),ce()).optional()}),gs=I({type:D("image"),data:G_,mimeType:x(),annotations:kn.optional(),_meta:re(x(),ce()).optional()}),_s=I({type:D("audio"),data:G_,mimeType:x(),annotations:kn.optional(),_meta:re(x(),ce()).optional()}),$u=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),ku=I({type:D("resource"),resource:oe([sa,oa]),annotations:kn.optional(),_meta:re(x(),ce()).optional()}),Du=aa.extend({type:D("resource_link")}),vs=oe([ms,gs,_s,Du,ku]),Lu=I({role:hr,content:vs}),Uu=et.extend({description:x().optional(),messages:$(Lu)}),Fu=xt.extend({method:D("notifications/prompts/list_changed"),params:St.optional()}),Bu=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),Vu=I({taskSupport:_e(["required","optional","forbidden"]).optional()}),la=I({...On.shape,...lr.shape,description:x().optional(),inputSchema:I({type:D("object"),properties:re(x(),or).optional(),required:$(x()).optional()}).catchall(ce()),outputSchema:de({$schema:x().optional()}).optional(),annotations:Bu.optional(),execution:Vu.optional(),_meta:re(x(),ce()).optional()}),ju=ur.extend({method:D("tools/list")}),Gu=dr.extend({tools:$(la)}),ua=et.extend({content:$(vs).default([]),structuredContent:ce().optional(),isError:ie().optional()}),H_=ua.or(et.extend({toolResult:ce()})),Hu=pi.extend({name:x(),arguments:re(x(),ce()).optional()}),qu=Qe.extend({method:D("tools/call"),params:Hu}),Wu=xt.extend({method:D("notifications/tools/list_changed"),params:St.optional()}),q_=I({autoRefresh:ie().default(true),debounceMs:K().int().nonnegative().default(300)}),fr=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),Ku=dt.extend({level:fr}),Zu=Qe.extend({method:D("logging/setLevel"),params:Ku}),Xu=St.extend({level:fr,logger:x().optional(),data:ce()}),Ju=xt.extend({method:D("notifications/message"),params:Xu}),Yu=I({name:x().optional()}),Qu=I({hints:$(Yu).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),ed=I({mode:_e(["auto","required","none"]).optional()}),td=I({type:D("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:$(vs),structuredContent:ce().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),nd=ir("type",[ms,gs,_s]),ui=ir("type",[ms,gs,_s,$u,td]),rd=I({role:hr,content:oe([ui,$(ui)]),_meta:re(x(),ce()).optional()}),id=pi.extend({messages:$(rd),modelPreferences:Qu.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:Ye.optional(),tools:$(la).optional(),toolChoice:ed.optional()}),sd=Qe.extend({method:D("sampling/createMessage"),params:id}),od=et.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens"]).or(x())),role:hr,content:nd}),ad=et.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:hr,content:oe([ui,$(ui)])}),da=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),ys=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),Ss=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),ha=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),fa=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),pa=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),cd=oe([ha,fa]),ma=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),ga=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),ld=oe([ma,ga]),ud=oe([pa,cd,ld]),_a=oe([ud,da,ys,Ss]),xs=pi.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),_a),required:$(x()).optional()}).catchall(ce())}),dd=pi.extend({mode:D("url"),message:x(),elicitationId:x(),url:x().url()}),hd=oe([xs,dd]),fd=Qe.extend({method:D("elicitation/create"),params:hd}),pd=St.extend({elicitationId:x()}),md=xt.extend({method:D("notifications/elicitation/complete"),params:pd}),gd=et.extend({action:_e(["accept","decline","cancel"]),content:Nn(t=>t===null?void 0:t,re(x(),oe([x(),K(),ie(),$(x())])).optional())}),_d=I({type:D("ref/resource"),uri:x()}),vd=I({type:D("ref/prompt"),name:x()}),yd=dt.extend({ref:oe([vd,_d]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()}),Sd=Qe.extend({method:D("completion/complete"),params:yd}),xd=et.extend({completion:de({values:$(x()).max(100),total:le(K().int()),hasMore:le(ie())})}),bd=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Td=Qe.extend({method:D("roots/list"),params:dt.optional()}),Rd=et.extend({roots:$(bd)}),Ed=xt.extend({method:D("notifications/roots/list_changed"),params:St.optional()}),W_=de({ttl:K().optional(),pollInterval:K().optional()}),wd=_e(["working","input_required","completed","failed","cancelled"]),pr=I({taskId:x(),status:wd,ttl:oe([K(),xn()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:le(K()),statusMessage:le(x())}),K_=et.extend({task:pr}),Md=St.merge(pr),Z_=xt.extend({method:D("notifications/tasks/status"),params:Md}),X_=Qe.extend({method:D("tasks/get"),params:dt.extend({taskId:x()})}),J_=et.merge(pr),Y_=Qe.extend({method:D("tasks/result"),params:dt.extend({taskId:x()})}),Q_=et.loose(),ev=ur.extend({method:D("tasks/list")}),tv=dr.extend({tasks:$(pr)}),nv=Qe.extend({method:D("tasks/cancel"),params:dt.extend({taskId:x()})}),rv=et.merge(pr),iv=oe([na,eu,ru,Sd,Zu,zu,Pu,lu,du,pu,vu,Su,bu,qu,ju]),sv=oe([ea,ra,nu,Ed]),ov=oe([Qo,od,ad,gd,Rd]),av=oe([na,sd,fd,Td]),cv=oe([ea,ra,Ju,Au,gu,Wu,Fu,Ru,md]),lv=oe([Qo,tu,iu,xd,Uu,Nu,uu,hu,mu,ua,Gu,wu]),ut=ss().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:F_.custom,message:"URL must be parseable",fatal:true}),fo}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),uv=de({resource:x().url(),authorization_servers:$(ut).optional(),jwks_uri:x().url().optional(),scopes_supported:$(x()).optional(),bearer_methods_supported:$(x()).optional(),resource_signing_alg_values_supported:$(x()).optional(),resource_name:x().optional(),resource_documentation:x().optional(),resource_policy_uri:x().url().optional(),resource_tos_uri:x().url().optional(),tls_client_certificate_bound_access_tokens:ie().optional(),authorization_details_types_supported:$(x()).optional(),dpop_signing_alg_values_supported:$(x()).optional(),dpop_bound_access_tokens_required:ie().optional()}),Ad=de({issuer:x(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:$(x()).optional(),response_types_supported:$(x()),response_modes_supported:$(x()).optional(),grant_types_supported:$(x()).optional(),token_endpoint_auth_methods_supported:$(x()).optional(),token_endpoint_auth_signing_alg_values_supported:$(x()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:$(x()).optional(),revocation_endpoint_auth_signing_alg_values_supported:$(x()).optional(),introspection_endpoint:x().optional(),introspection_endpoint_auth_methods_supported:$(x()).optional(),introspection_endpoint_auth_signing_alg_values_supported:$(x()).optional(),code_challenge_methods_supported:$(x()).optional(),client_id_metadata_document_supported:ie().optional(),authorization_response_iss_parameter_supported:ie().optional().catch(void 0)}),Id=de({issuer:x(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:$(x()).optional(),response_types_supported:$(x()),response_modes_supported:$(x()).optional(),grant_types_supported:$(x()).optional(),acr_values_supported:$(x()).optional(),subject_types_supported:$(x()),id_token_signing_alg_values_supported:$(x()),id_token_encryption_alg_values_supported:$(x()).optional(),id_token_encryption_enc_values_supported:$(x()).optional(),userinfo_signing_alg_values_supported:$(x()).optional(),userinfo_encryption_alg_values_supported:$(x()).optional(),userinfo_encryption_enc_values_supported:$(x()).optional(),request_object_signing_alg_values_supported:$(x()).optional(),request_object_encryption_alg_values_supported:$(x()).optional(),request_object_encryption_enc_values_supported:$(x()).optional(),token_endpoint_auth_methods_supported:$(x()).optional(),token_endpoint_auth_signing_alg_values_supported:$(x()).optional(),display_values_supported:$(x()).optional(),claim_types_supported:$(x()).optional(),claims_supported:$(x()).optional(),service_documentation:x().optional(),claims_locales_supported:$(x()).optional(),ui_locales_supported:$(x()).optional(),claims_parameter_supported:ie().optional(),request_parameter_supported:ie().optional(),request_uri_parameter_supported:ie().optional(),require_request_uri_registration:ie().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:ie().optional(),authorization_response_iss_parameter_supported:ie().optional().catch(void 0)}),dv=I({...Id.shape,...Ad.pick({code_challenge_methods_supported:true}).shape}),hv=I({access_token:x(),id_token:x().optional(),token_type:x(),expires_in:Ho.number().optional(),scope:x().optional(),refresh_token:x().optional()}).strip(),fv=I({issued_token_type:D("urn:ietf:params:oauth:token-type:id-jag"),access_token:x(),token_type:x().optional(),expires_in:K().optional(),scope:x().optional()}).strip(),pv=I({error:x(),error_description:x().optional(),error_uri:x().optional()}),B_=ut.optional().or(D("").transform(()=>{})),Cd=I({redirect_uris:$(ut),token_endpoint_auth_method:x().optional(),grant_types:$(x()).optional(),response_types:$(x()).optional(),application_type:x().optional(),client_name:x().optional(),client_uri:ut.optional(),logo_uri:B_,scope:x().optional(),contacts:$(x()).optional(),tos_uri:B_,policy_uri:x().optional(),jwks_uri:ut.optional(),jwks:Ul().optional(),software_id:x().optional(),software_version:x().optional(),software_statement:x().optional()}).strip(),Pd=I({client_id:x(),client_secret:x().optional(),client_id_issued_at:K().optional(),client_secret_expires_at:K().optional()}).strip(),mv=Cd.merge(Pd),gv=I({error:x(),error_description:x().optional()}).strip(),_v=I({token:x(),token_type_hint:x().optional()}).strip();var xv=Symbol.for("mcp.sdk.errorBrands");function Ev(t,e){let r=new Set,i=e;for(;typeof i=="function";){let n=i.mcpBrand;Object.prototype.hasOwnProperty.call(i,"mcpBrand")&&typeof n=="string"&&r.add(n),i=Object.getPrototypeOf(i);}r.size!==0&&Object.defineProperty(t,xv,{value:r,enumerable:false,configurable:true});}function Ts(t,e){try{if(typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(t,"mcpBrand")&&typeof t.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(e,xv)){let r=e[xv];if(r&&typeof r.has=="function"&&r.has(t.mcpBrand))return !0}}catch{}return Function.prototype[Symbol.hasInstance].call(t,e)}var Ce=(function(t){return t.NotConnected="NOT_CONNECTED",t.AlreadyConnected="ALREADY_CONNECTED",t.NotInitialized="NOT_INITIALIZED",t.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",t.RequestTimeout="REQUEST_TIMEOUT",t.ConnectionClosed="CONNECTION_CLOSED",t.SendFailed="SEND_FAILED",t.InvalidResult="INVALID_RESULT",t.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",t.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",t.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",t.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",t.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",t.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",t.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",t.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",t.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",t.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",t.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",t})({}),Te=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"});}static[Symbol.hasInstance](t){return Ts(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ts(this,t)}constructor(t,e,r){super(e),this.code=t,this.data=r,this.name="SdkError",Ev(this,new.target);}};function Ib(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function bI(t,e,r){return t==="elicitation"&&e==="form"&&r.form===void 0&&r.url===void 0}function Vb(t){switch(t.method){case "elicitation/create":return t.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case "sampling/createMessage":{let e=t.params;return e!==void 0&&(e.tools!==void 0||e.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case "roots/list":return {roots:{}};default:return}}function Ud(t,e){let r={};for(let[i,n]of Object.entries(t)){if(n===void 0)continue;let s=e===void 0?void 0:e[i];if(s===void 0){r[i]=n;continue}if(Ib(n)&&Ib(s)){let o={};for(let[a,c]of Object.entries(n))c!==void 0&&s[a]===void 0&&!bI(i,a,s)&&(o[a]=c);Object.keys(o).length>0&&(r[i]=o);}}return Object.keys(r).length>0?r:void 0}var jb="2026-07-28",gr=[jb];function Es(t){return t>=jb}function Gb(t){return t.filter(e=>!Es(e))}function wv(t){return t.filter(e=>Es(e))}function Hb(t){let e=t.structuredContent;return e===void 0||!(typeof e!="object"||e===null||Array.isArray(e))||(t.content?.some(r=>r.type==="text")??false)?t:{...t,content:[...t.content??[],{type:"text",text:JSON.stringify(e)}]}}var qb=["task","inputRequests","requestState"];function Mv(t){return t===null||typeof t!="object"||Array.isArray(t)||t.content!==void 0||qb.some(e=>e in t)?t:{...t,content:[]}}function TI(){let t=sr(()=>oe([x(),K(),ie(),xn(),re(x(),t),$(t)])),e=re(x(),t),r=oe([x(),K().int()]),i=x(),n=I({ttl:K().optional()}),s=I({taskId:x()}),o=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=I({_meta:o.optional()}),c=a.extend({task:n.optional()}),l=I({method:x(),params:a.loose().optional()}),u=I({_meta:o.optional()}),d=I({method:x(),params:u.loose().optional()}),f=de({_meta:o.optional()}),p=oe([x(),K().int()]),g=f.strict(),m=u.extend({requestId:p.optional(),reason:x().optional()}),S=d.extend({method:D("notifications/cancelled"),params:m}),h=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),v=I({icons:$(h).optional()}),_=I({name:x(),title:x().optional()}),y=_.extend({..._.shape,...v.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),R=cn(I({applyDefaults:ie().optional()}),e),T=Nn(vt=>vt&&typeof vt=="object"&&!Array.isArray(vt)&&Object.keys(vt).length===0?{form:{}}:vt,cn(I({form:R.optional(),url:e.optional()}),e.optional())),b=de({list:e.optional(),cancel:e.optional(),requests:de({sampling:de({createMessage:e.optional()}).optional(),elicitation:de({create:e.optional()}).optional()}).optional()}),E=de({list:e.optional(),cancel:e.optional(),requests:de({tools:de({call:e.optional()}).optional()}).optional()}),M=I({experimental:re(x(),e).optional(),sampling:I({context:e.optional(),tools:e.optional()}).optional(),elicitation:T.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:b.optional(),extensions:re(x(),e).optional()}),N=a.extend({protocolVersion:x(),capabilities:M,clientInfo:y}),O=l.extend({method:D("initialize"),params:N}),k=I({experimental:re(x(),e).optional(),logging:e.optional(),completions:e.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:E.optional(),extensions:re(x(),e).optional()}),j=f.extend({protocolVersion:x(),capabilities:k,serverInfo:y,instructions:x().optional()}),G=d.extend({method:D("notifications/initialized"),params:u.optional()}),Q=l.extend({method:D("ping"),params:a.optional()}),Se=I({progress:K(),total:le(K()),message:le(x())}),ye=I({...u.shape,...Se.shape,progressToken:r}),Fe=d.extend({method:D("notifications/progress"),params:ye}),ve=a.extend({cursor:i.optional()}),P=l.extend({params:ve.optional()}),U=f.extend({nextCursor:i.optional()}),q=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),w=q.extend({text:x()}),C=x().refine(vt=>{try{return atob(vt),!0}catch{return false}},{message:"Invalid Base64 string"}),L=q.extend({blob:C}),ee=_e(["user","assistant"]),ue=I({audience:$(ee).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),Ee=I({..._.shape,...v.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:ue.optional(),_meta:le(de({}))}),pe=I({..._.shape,...v.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:ue.optional(),_meta:le(de({}))}),Ie=P.extend({method:D("resources/list")}),je=U.extend({resources:$(Ee)}),A=P.extend({method:D("resources/templates/list")}),V=U.extend({resourceTemplates:$(pe)}),H=a.extend({uri:x()}),me=H,ge=l.extend({method:D("resources/read"),params:me}),we=f.extend({contents:$(oe([w,L]))}),nt=d.extend({method:D("notifications/resources/list_changed"),params:u.optional()}),at=H,gt=l.extend({method:D("resources/subscribe"),params:at}),it=H,Xe=l.extend({method:D("resources/unsubscribe"),params:it}),Wt=u.extend({uri:x()}),lt=d.extend({method:D("notifications/resources/updated"),params:Wt}),wn=I({name:x(),description:le(x()),required:le(ie())}),rn=I({..._.shape,...v.shape,description:le(x()),arguments:le($(wn)),_meta:le(de({}))}),Mn=P.extend({method:D("prompts/list")}),jn=U.extend({prompts:$(rn)}),Gn=a.extend({name:x(),arguments:re(x(),x()).optional()}),Hr=l.extend({method:D("prompts/get"),params:Gn}),qr=I({type:D("text"),text:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Wr=I({type:D("image"),data:C,mimeType:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Kr=I({type:D("audio"),data:C,mimeType:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Us=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),Hn=I({type:D("resource"),resource:oe([w,L]),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Fs=Ee.extend({type:D("resource_link")}),Kt=oe([qr,Wr,Kr,Fs,Hn]),bi=I({role:ee,content:Kt}),Ti=f.extend({description:x().optional(),messages:$(bi)}),Zr=d.extend({method:D("notifications/prompts/list_changed"),params:u.optional()}),Bs=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),Ri=I({taskSupport:_e(["required","optional","forbidden"]).optional()}),Xr=I({..._.shape,...v.shape,description:x().optional(),inputSchema:I({type:D("object"),properties:re(x(),t).optional(),required:$(x()).optional()}).catchall(ce()),outputSchema:I({type:D("object"),properties:re(x(),t).optional(),required:$(x()).optional()}).catchall(ce()).optional(),annotations:Bs.optional(),execution:Ri.optional(),_meta:re(x(),ce()).optional()}),Ei=P.extend({method:D("tools/list")}),wi=U.extend({tools:$(Xr)}),Mi=f.extend({content:$(Kt),structuredContent:re(x(),ce()).optional(),isError:ie().optional()}),_t=c.extend({name:x(),arguments:re(x(),ce()).optional()}),Vs=l.extend({method:D("tools/call"),params:_t}),ja=d.extend({method:D("notifications/tools/list_changed"),params:u.optional()}),Ai=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),js=a.extend({level:Ai}),Gs=l.extend({method:D("logging/setLevel"),params:js}),Hs=u.extend({level:Ai,logger:x().optional(),data:ce()}),qs=d.extend({method:D("notifications/message"),params:Hs}),Ws=I({name:x().optional()}),Ks=I({hints:$(Ws).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),Zs=I({mode:_e(["auto","required","none"]).optional()}),Ga=I({type:D("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:$(Kt),structuredContent:I({}).loose().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),Xs=ir("type",[qr,Wr,Kr]),qn=ir("type",[qr,Wr,Kr,Us,Ga]),Js=I({role:ee,content:oe([qn,$(qn)]),_meta:re(x(),ce()).optional()}),Ys=c.extend({messages:$(Js),modelPreferences:Ks.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:e.optional(),tools:$(Xr).optional(),toolChoice:Zs.optional()}),Qs=l.extend({method:D("sampling/createMessage"),params:Ys}),eo=f.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens"]).or(x())),role:ee,content:Xs}),to=f.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:ee,content:oe([qn,$(qn)])}),no=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),ro=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),io=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),so=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),oo=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),ao=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),co=oe([so,oo]),Jr=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),Yr=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),Ha=oe([Jr,Yr]),qa=oe([ao,co,Ha]),Ut=oe([qa,no,ro,io]),Ft=c.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),Ut),required:$(x()).optional()}).catchall(ce())}),lo=c.extend({mode:D("url"),message:x(),elicitationId:x(),url:x().url()}),sn=oe([Ft,lo]),Wa=l.extend({method:D("elicitation/create"),params:sn}),Ka=u.extend({elicitationId:x()}),Za=d.extend({method:D("notifications/elicitation/complete"),params:Ka}),Xa=f.extend({action:_e(["accept","decline","cancel"]),content:Nn(vt=>vt===null?void 0:vt,re(x(),oe([x(),K(),ie(),$(x())])).optional())}),Ja=I({type:D("ref/resource"),uri:x()}),Ya=I({type:D("ref/prompt"),name:x()}),Qa=a.extend({ref:oe([Ya,Ja]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()}),uo=l.extend({method:D("completion/complete"),params:Qa}),ec=f.extend({completion:de({values:$(x()).max(100),total:le(K().int()),hasMore:le(ie())})}),tc=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Ii=l.extend({method:D("roots/list"),params:a.optional()}),ho=f.extend({roots:$(tc)}),nc=d.extend({method:D("notifications/roots/list_changed"),params:u.optional()}),rc=de({ttl:K().optional(),pollInterval:K().optional()}),ic=_e(["working","input_required","completed","failed","cancelled"]),Wn=I({taskId:x(),status:ic,ttl:oe([K(),xn()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:le(K()),statusMessage:le(x())}),Ot=f.extend({task:Wn}),sc=u.merge(Wn),Qr=d.extend({method:D("notifications/tasks/status"),params:sc}),Ci=l.extend({method:D("tasks/get"),params:a.extend({taskId:x()})}),Pi=f.merge(Wn),Ni=l.extend({method:D("tasks/result"),params:a.extend({taskId:x()})}),Hh=f.loose(),zt=P.extend({method:D("tasks/list")}),rt=U.extend({tasks:$(Wn)}),ei=l.extend({method:D("tasks/cancel"),params:a.extend({taskId:x()})});return {JSONValueSchema:t,JSONObjectSchema:e,ProgressTokenSchema:r,CursorSchema:i,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:o,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:g,CancelledNotificationParamsSchema:m,CancelledNotificationSchema:S,IconSchema:h,IconsSchema:v,BaseMetadataSchema:_,ImplementationSchema:y,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:M,InitializeRequestParamsSchema:N,InitializeRequestSchema:O,ServerCapabilitiesSchema:k,InitializeResultSchema:j,InitializedNotificationSchema:G,PingRequestSchema:Q,ProgressSchema:Se,ProgressNotificationParamsSchema:ye,ProgressNotificationSchema:Fe,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:P,PaginatedResultSchema:U,ResourceContentsSchema:q,TextResourceContentsSchema:w,BlobResourceContentsSchema:L,RoleSchema:ee,AnnotationsSchema:ue,ResourceSchema:Ee,ResourceTemplateSchema:pe,ListResourcesRequestSchema:Ie,ListResourcesResultSchema:je,ListResourceTemplatesRequestSchema:A,ListResourceTemplatesResultSchema:V,ResourceRequestParamsSchema:H,ReadResourceRequestParamsSchema:me,ReadResourceRequestSchema:ge,ReadResourceResultSchema:we,ResourceListChangedNotificationSchema:nt,SubscribeRequestParamsSchema:at,SubscribeRequestSchema:gt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:Xe,ResourceUpdatedNotificationParamsSchema:Wt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:wn,PromptSchema:rn,ListPromptsRequestSchema:Mn,ListPromptsResultSchema:jn,GetPromptRequestParamsSchema:Gn,GetPromptRequestSchema:Hr,TextContentSchema:qr,ImageContentSchema:Wr,AudioContentSchema:Kr,ToolUseContentSchema:Us,EmbeddedResourceSchema:Hn,ResourceLinkSchema:Fs,ContentBlockSchema:Kt,PromptMessageSchema:bi,GetPromptResultSchema:Ti,PromptListChangedNotificationSchema:Zr,ToolAnnotationsSchema:Bs,ToolExecutionSchema:Ri,ToolSchema:Xr,ListToolsRequestSchema:Ei,ListToolsResultSchema:wi,CallToolResultSchema:Mi,CallToolRequestParamsSchema:_t,CallToolRequestSchema:Vs,ToolListChangedNotificationSchema:ja,LoggingLevelSchema:Ai,SetLevelRequestParamsSchema:js,SetLevelRequestSchema:Gs,LoggingMessageNotificationParamsSchema:Hs,LoggingMessageNotificationSchema:qs,ModelHintSchema:Ws,ModelPreferencesSchema:Ks,ToolChoiceSchema:Zs,ToolResultContentSchema:Ga,SamplingContentSchema:Xs,SamplingMessageContentBlockSchema:qn,SamplingMessageSchema:Js,CreateMessageRequestParamsSchema:Ys,CreateMessageRequestSchema:Qs,CreateMessageResultSchema:eo,CreateMessageResultWithToolsSchema:to,BooleanSchemaSchema:no,StringSchemaSchema:ro,NumberSchemaSchema:io,UntitledSingleSelectEnumSchemaSchema:so,TitledSingleSelectEnumSchemaSchema:oo,LegacyTitledEnumSchemaSchema:ao,SingleSelectEnumSchemaSchema:co,UntitledMultiSelectEnumSchemaSchema:Jr,TitledMultiSelectEnumSchemaSchema:Yr,MultiSelectEnumSchemaSchema:Ha,EnumSchemaSchema:qa,PrimitiveSchemaDefinitionSchema:Ut,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:lo,ElicitRequestParamsSchema:sn,ElicitRequestSchema:Wa,ElicitationCompleteNotificationParamsSchema:Ka,ElicitationCompleteNotificationSchema:Za,ElicitResultSchema:Xa,ResourceTemplateReferenceSchema:Ja,PromptReferenceSchema:Ya,CompleteRequestParamsSchema:Qa,CompleteRequestSchema:uo,CompleteResultSchema:ec,RootSchema:tc,ListRootsRequestSchema:Ii,ListRootsResultSchema:ho,RootsListChangedNotificationSchema:nc,TaskCreationParamsSchema:rc,TaskStatusSchema:ic,TaskSchema:Wn,CreateTaskResultSchema:Ot,TaskStatusNotificationParamsSchema:sc,TaskStatusNotificationSchema:Qr,GetTaskRequestSchema:Ci,GetTaskResultSchema:Pi,GetTaskPayloadRequestSchema:Ni,GetTaskPayloadResultSchema:Hh,ListTasksRequestSchema:zt,ListTasksResultSchema:rt,CancelTaskRequestSchema:ei,CancelTaskResultSchema:f.merge(Wn),ClientRequestSchema:oe([Q,O,uo,Gs,Hr,Mn,Ie,A,ge,gt,Xe,Vs,Ei,Ci,Ni,zt,ei]),ClientNotificationSchema:oe([S,Fe,G,nc,Qr]),ClientResultSchema:oe([g,eo,to,Xa,ho,Pi,rt,Ot]),ServerRequestSchema:oe([Q,Qs,Wa,Ii,Ci,Ni,zt,ei]),ServerNotificationSchema:oe([S,Fe,qs,lt,nt,ja,Zr,Qr,Za]),ServerResultSchema:oe([g,j,ec,Ti,jn,je,V,we,Mi,wi,Pi,rt,Ot]),CallToolResultWireSchema:ce().superRefine((vt,vw)=>{if(!(typeof vt!="object"||vt===null||Array.isArray(vt)||vt.content!==void 0)){for(let E0 of qb)if(E0 in vt){vw.addIssue({code:"custom",message:`content is required when the body carries '${E0}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Mv).pipe(Mi)}}var RI;function Wb(){return RI??=TI()}function Kb(t){return t.type!=="object"}var EI=new Set(["const","enum","default","examples"]),wI=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Cb(t){return t!==void 0&&!(typeof t=="string"&&t.startsWith("#"))}function MI(t){let e=typeof t.$schema=="string"?t.$schema:void 0;if(Cb(t.$id))return {...e!==void 0&&{$schema:e},type:"object",properties:{result:t},required:["result"]};let r=A0(t.$schema)&&t.$recursiveAnchor!==true,i=(n,s)=>{if(Array.isArray(n))return n.map(c=>i(c,false));if(n===null||typeof n!="object"||!s&&Cb(n.$id))return n;let o={},a=false;for(let[c,l]of Object.entries(n))s?o[c]=i(l,false):(c==="$ref"||c==="$dynamicRef")&&typeof l=="string"?o[c]=l==="#"?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l:c==="$recursiveRef"&&l==="#"&&r?a=true:EI.has(c)?o[c]=l:wI.has(c)?o[c]=i(l,true):o[c]=i(l,false);return a&&("$ref"in o?o.allOf=[...Array.isArray(o.allOf)?o.allOf:[],{$ref:"#/properties/result"}]:o.$ref="#/properties/result"),o};return {...e!==void 0&&{$schema:e},type:"object",properties:{result:i(t,false)},required:["result"]}}var Zb={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Xb={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},AI={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Nd;function Av(){if(Nd)return Nd;let t=Wb();return Nd={requestSchemas:{ping:t.PingRequestSchema,initialize:t.InitializeRequestSchema,"completion/complete":t.CompleteRequestSchema,"logging/setLevel":t.SetLevelRequestSchema,"prompts/get":t.GetPromptRequestSchema,"prompts/list":t.ListPromptsRequestSchema,"resources/list":t.ListResourcesRequestSchema,"resources/templates/list":t.ListResourceTemplatesRequestSchema,"resources/read":t.ReadResourceRequestSchema,"resources/subscribe":t.SubscribeRequestSchema,"resources/unsubscribe":t.UnsubscribeRequestSchema,"tools/call":t.CallToolRequestSchema,"tools/list":t.ListToolsRequestSchema,"tasks/get":t.GetTaskRequestSchema,"tasks/result":t.GetTaskPayloadRequestSchema,"tasks/list":t.ListTasksRequestSchema,"tasks/cancel":t.CancelTaskRequestSchema,"sampling/createMessage":t.CreateMessageRequestSchema,"elicitation/create":t.ElicitRequestSchema,"roots/list":t.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":t.CancelledNotificationSchema,"notifications/progress":t.ProgressNotificationSchema,"notifications/initialized":t.InitializedNotificationSchema,"notifications/roots/list_changed":t.RootsListChangedNotificationSchema,"notifications/tasks/status":t.TaskStatusNotificationSchema,"notifications/message":t.LoggingMessageNotificationSchema,"notifications/resources/updated":t.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":t.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":t.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":t.PromptListChangedNotificationSchema,"notifications/elicitation/complete":t.ElicitationCompleteNotificationSchema},resultSchemas:{ping:t.EmptyResultSchema,initialize:t.InitializeResultSchema,"completion/complete":t.CompleteResultSchema,"logging/setLevel":t.EmptyResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"resources/subscribe":t.EmptyResultSchema,"resources/unsubscribe":t.EmptyResultSchema,"tools/call":t.CallToolResultWireSchema,"tools/list":t.ListToolsResultSchema,"sampling/createMessage":t.CreateMessageResultWithToolsSchema,"elicitation/create":t.ElicitResultSchema,"roots/list":t.ListRootsResultSchema}},Nd}function Jb(t){return Object.prototype.hasOwnProperty.call(Zb,t)}function Yb(t){return Object.prototype.hasOwnProperty.call(Xb,t)}function II(t){return Object.prototype.hasOwnProperty.call(AI,t)}function CI(t){return II(t)?Av().resultSchemas[t]:void 0}function PI(t){return Jb(t)?Av().requestSchemas[t]:void 0}function NI(t){return Yb(t)?Av().notificationSchemas[t]:void 0}function bv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Od(t,e){if(t===void 0)return {ok:false,reason:"not-in-era"};let r=t.safeParse(e);return r.success?{ok:true,value:r.data}:{ok:false,reason:"invalid",message:String(r.error)}}var Pb={ok:false,reason:"not-in-era"};function Nb(t){return bv(t)&&bv(t.outputSchema)&&Kb(t.outputSchema)}var Iv={era:"2025-11-25",hasRequestMethod:Jb,hasNotificationMethod:Yb,validateRequest:(t,e)=>Od(PI(t),e),validateResult:(t,e)=>Od(CI(t),e),validateNotification:(t,e)=>Od(NI(t),e),hasInputRequestMethod:()=>false,validateInputRequest:()=>Pb,validateInputResponse:()=>Pb,samplingResultVariant:((t,e)=>{let r=Wb();return Od(t?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,e)}),outboundEnvelope:t=>{},validateEnvelopeMeta:t=>[],projectCallToolResult(t,e){let r=Hb(t),i=r.structuredContent;if(i===void 0)return r;let n=typeof i!="object"||i===null||Array.isArray(i),s=e!==void 0&&Kb(e);return !n&&!s?r:{...r,structuredContent:{result:i}}},decodeResult(t,e){if(bv(e)&&"resultType"in e){let r={...e};return delete r.resultType,{kind:"complete",result:r}}return {kind:"complete",result:e}},encodeResult(t,e){if(t!=="tools/list")return e;let r=e.tools;return !Array.isArray(r)||!r.some(i=>Nb(i))?e:{...e,tools:r.map(i=>Nb(i)?{...i,outputSchema:MI(i.outputSchema)}:i)}},encodeErrorCode:t=>t===-32002?-32602:t,checkInboundEnvelope:t=>{}};function OI(){let t=sr(()=>oe([x(),K(),ie(),xn(),re(x(),t),$(t)])),e=re(x(),t),r=oe([x(),K().int()]),i=x(),n=oe([x(),K().int()]),s=_e(["user","assistant"]),o=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),a=x().refine(rt=>{try{return atob(rt),!0}catch{return false}},{message:"Invalid Base64 string"}),c=I({ttl:K().optional()}),l=I({taskId:x()}),u=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=I({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=I({_meta:u.optional()}),g=I({method:x(),params:p.loose().optional()}),m=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),S=I({icons:$(m).optional()}),h=I({name:x(),title:x().optional()}),v=h.extend({...h.shape,...S.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),_=cn(I({applyDefaults:ie().optional()}),e),y=Nn(rt=>rt&&typeof rt=="object"&&!Array.isArray(rt)&&Object.keys(rt).length===0?{form:{}}:rt,cn(I({form:_.optional(),url:e.optional()}),e.optional())),R=de({list:e.optional(),cancel:e.optional(),requests:de({sampling:de({createMessage:e.optional()}).optional(),elicitation:de({create:e.optional()}).optional()}).optional()}),T=de({list:e.optional(),cancel:e.optional(),requests:de({tools:de({call:e.optional()}).optional()}).optional()}),b=I({experimental:re(x(),e).optional(),sampling:I({context:e.optional(),tools:e.optional()}).optional(),elicitation:y.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:R.optional(),extensions:re(x(),e).optional()}),E=I({experimental:re(x(),e).optional(),logging:e.optional(),completions:e.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:T.optional(),extensions:re(x(),e).optional()}),M=I({progress:K(),total:le(K()),message:le(x())}),N=I({...p.shape,...M.shape,progressToken:r}),O=g.extend({method:D("notifications/progress"),params:N}),k=p.extend({level:o,logger:x().optional(),data:ce()}),j=g.extend({method:D("notifications/message"),params:k}),G=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),Q=G.extend({text:x()}),Se=G.extend({blob:a}),ye=I({audience:$(s).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),Fe=I({...h.shape,...S.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:ye.optional(),_meta:le(de({}))}),ve=I({...h.shape,...S.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:ye.optional(),_meta:le(de({}))}),P=g.extend({method:D("notifications/resources/list_changed"),params:p.optional()}),U=p.extend({uri:x()}),q=g.extend({method:D("notifications/resources/updated"),params:U}),w=I({name:x(),description:le(x()),required:le(ie())}),C=I({...h.shape,...S.shape,description:le(x()),arguments:le($(w)),_meta:le(de({}))}),L=g.extend({method:D("notifications/prompts/list_changed"),params:p.optional()}),ee=I({type:D("text"),text:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),ue=I({type:D("image"),data:a,mimeType:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),Ee=I({type:D("audio"),data:a,mimeType:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),pe=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),Ie=I({type:D("resource"),resource:oe([Q,Se]),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),je=Fe.extend({type:D("resource_link")}),A=oe([ee,ue,Ee,je,Ie]),V=I({role:s,content:A}),H=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),me=g.extend({method:D("notifications/tools/list_changed"),params:p.optional()}),ge=I({name:x().optional()}),we=I({hints:$(ge).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),nt=I({mode:_e(["auto","required","none"]).optional()}),at=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),gt=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),it=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),Xe=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),Wt=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),lt=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),wn=oe([Xe,Wt]),rn=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),Mn=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),jn=oe([rn,Mn]),Gn=oe([lt,wn,jn]),Hr=oe([Gn,at,gt,it]),qr=f.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),Hr),required:$(x()).optional()}).catchall(ce())}),Wr=I({type:D("ref/resource"),uri:x()}),Kr=I({type:D("ref/prompt"),name:x()}),Us=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Hn=b.shape,Fs=I({experimental:Hn.experimental,sampling:Hn.sampling,elicitation:Hn.elicitation,roots:Hn.roots,extensions:Hn.extensions}),Kt=E.shape,bi=I({experimental:Kt.experimental,logging:Kt.logging,completions:Kt.completions,prompts:Kt.prompts,resources:Kt.resources,tools:Kt.tools,extensions:Kt.extensions}),Ti=de({progressToken:r.optional(),[zn]:x(),[us]:v.optional(),[$n]:Fs,[ar]:o.optional()}),Zr=I({...h.shape,...S.shape,description:x().optional(),inputSchema:de({$schema:x().optional(),type:D("object")}),outputSchema:de({$schema:x().optional()}).optional(),annotations:H.optional(),_meta:re(x(),ce()).optional()}),Bs=I({type:D("tool_result"),toolUseId:x(),content:$(A),structuredContent:ce().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),Ri=oe([ee,ue,Ee,pe,Bs]),Xr=I({role:s,content:oe([Ri,$(Ri)]),_meta:re(x(),ce()).optional()}),Ei=x(),wi=de({[bn]:v.optional().catch(void 0)}),Mi=wi.optional();function _t(rt){return de({_meta:Mi,resultType:Ei.default("complete"),...rt})}let Vs=_t({}),ja=_t({nextCursor:i.optional()}),Ai=_t({content:$(A),structuredContent:ce().optional(),isError:ie().optional()}),js=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),tools:$(Zr),nextCursor:i.optional()}),Gs=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),prompts:$(C),nextCursor:i.optional()}),Hs=_t({description:x().optional(),messages:$(V)}),qs=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resources:$(Fe),nextCursor:i.optional()}),Ws=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resourceTemplates:$(ve),nextCursor:i.optional()}),Ks=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),contents:$(oe([Q,Se]))}),Zs=_t({completion:I({values:$(x()).max(100),total:K().int().optional(),hasMore:ie().optional()}).loose()}),Ga=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"])}),Xs=_t({ttlMs:K().int().min(0).catch(0),cacheScope:_e(["public","private"]).catch("private"),supportedVersions:$(x()),capabilities:bi,instructions:x().optional()}),qn=I({messages:$(Xr),modelPreferences:we.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:e.optional(),tools:$(Zr).optional(),toolChoice:nt.optional()}),Js=I({method:D("sampling/createMessage"),params:qn}),Ys=I({method:D("roots/list"),params:I({_meta:re(x(),ce()).optional()}).optional()}),Qs=I({...Xr.shape,model:x(),stopReason:x().optional()}),eo=I({roots:$(Us)}),to=I({action:_e(["accept","decline","cancel"]),content:re(x(),oe([x(),K(),ie(),$(x())])).optional()}),no=I({mode:D("url"),message:x(),url:x().url()}),ro=oe([qr,no]),io=I({method:D("elicitation/create"),params:ro}),so=oe([Js,Ys,io]),oo=oe([Qs,eo,to]),ao=re(x(),so),co=re(x(),oo),Jr=_t({inputRequests:ao.optional(),requestState:x().optional()}),Yr={inputResponses:co.optional(),requestState:x().optional()},Ha=I({_meta:Ti,...Yr}),qa=de({progressToken:r.optional()});function Ut(rt,ei){return I({method:D(rt),params:I({_meta:Ti,...ei})})}function Ft(rt,ei){return I({method:D(rt),params:I({_meta:qa.optional(),...ei}).optional()})}let lo={name:x(),arguments:re(x(),ce()).optional(),...Yr},sn={cursor:i.optional()},Wa=Ut("tools/call",lo),Ka=Ut("tools/list",sn),Za=Ut("prompts/list",sn),Xa=Ut("prompts/get",{name:x(),arguments:re(x(),x()).optional(),...Yr}),Ja=Ut("resources/list",sn),Ya=Ut("resources/templates/list",sn),Qa=Ut("resources/read",{uri:x(),...Yr}),uo={ref:oe([Kr,Wr]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()},ec=Ut("completion/complete",uo),tc=Ut("server/discover",{}),Ii=I({toolsListChanged:ie().optional(),promptsListChanged:ie().optional(),resourcesListChanged:ie().optional(),resourceSubscriptions:$(x()).optional()}),ho={notifications:Ii},nc=Ut("subscriptions/listen",ho),rc=wi.extend({"io.modelcontextprotocol/subscriptionId":n}),ic=de({_meta:rc,resultType:Ei.default("complete")}),Wn={"tools/call":Ft("tools/call",lo),"tools/list":Ft("tools/list",sn),"prompts/get":Ft("prompts/get",{name:x(),arguments:re(x(),x()).optional()}),"prompts/list":Ft("prompts/list",sn),"resources/list":Ft("resources/list",sn),"resources/templates/list":Ft("resources/templates/list",sn),"resources/read":Ft("resources/read",{uri:x()}),"completion/complete":Ft("completion/complete",uo),"server/discover":Ft("server/discover",{}),"subscriptions/listen":Ft("subscriptions/listen",ho)};function Ot(rt){return de({_meta:Mi,...rt})}let sc={"tools/call":Ot({content:$(A),structuredContent:ce().optional(),isError:ie().optional()}),"tools/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),tools:$(Zr),nextCursor:i.optional()}),"prompts/get":Ot({description:x().optional(),messages:$(V)}),"prompts/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),prompts:$(C),nextCursor:i.optional()}),"resources/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resources:$(Fe),nextCursor:i.optional()}),"resources/templates/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resourceTemplates:$(ve),nextCursor:i.optional()}),"resources/read":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),contents:$(oe([Q,Se]))}),"completion/complete":Ot({completion:I({values:$(x()).max(100),total:K().int().optional(),hasMore:ie().optional()}).loose()}),"server/discover":Ot({ttlMs:K().int().min(0).catch(0),cacheScope:_e(["public","private"]).catch("private"),supportedVersions:$(x()),capabilities:bi,instructions:x().optional()}),"subscriptions/listen":Ot({})},Qr=de({"io.modelcontextprotocol/subscriptionId":n.optional()}),Ci=I({method:D("notifications/subscriptions/acknowledged"),params:I({_meta:Qr.optional(),notifications:Ii})}),Pi=I({_meta:Qr.optional(),requestId:n,reason:x().optional()}),Ni=I({method:D("notifications/cancelled"),params:Pi}),Hh={"notifications/cancelled":Ni,"notifications/progress":O,"notifications/message":j,"notifications/resources/updated":q,"notifications/resources/list_changed":P,"notifications/tools/list_changed":me,"notifications/prompts/list_changed":L,"notifications/subscriptions/acknowledged":Ci},zt=rt=>I({jsonrpc:D("2.0"),id:oe([x(),K().int()]),result:rt}).strict();return {JSONValueSchema:t,JSONObjectSchema:e,ProgressTokenSchema:r,CursorSchema:i,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:g,IconSchema:m,IconsSchema:S,BaseMetadataSchema:h,ImplementationSchema:v,ClientTasksCapabilitySchema:R,ServerTasksCapabilitySchema:T,ClientCapabilitiesSchema:b,ServerCapabilitiesSchema:E,ProgressSchema:M,ProgressNotificationParamsSchema:N,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:k,LoggingMessageNotificationSchema:j,ResourceContentsSchema:G,TextResourceContentsSchema:Q,BlobResourceContentsSchema:Se,AnnotationsSchema:ye,ResourceSchema:Fe,ResourceTemplateSchema:ve,ResourceListChangedNotificationSchema:P,ResourceUpdatedNotificationParamsSchema:U,ResourceUpdatedNotificationSchema:q,PromptArgumentSchema:w,PromptSchema:C,PromptListChangedNotificationSchema:L,TextContentSchema:ee,ImageContentSchema:ue,AudioContentSchema:Ee,ToolUseContentSchema:pe,EmbeddedResourceSchema:Ie,ResourceLinkSchema:je,ContentBlockSchema:A,PromptMessageSchema:V,ToolAnnotationsSchema:H,ToolListChangedNotificationSchema:me,ModelHintSchema:ge,ModelPreferencesSchema:we,ToolChoiceSchema:nt,BooleanSchemaSchema:at,StringSchemaSchema:gt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:Xe,TitledSingleSelectEnumSchemaSchema:Wt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:wn,UntitledMultiSelectEnumSchemaSchema:rn,TitledMultiSelectEnumSchemaSchema:Mn,MultiSelectEnumSchemaSchema:jn,EnumSchemaSchema:Gn,PrimitiveSchemaDefinitionSchema:Hr,ElicitRequestFormParamsSchema:qr,ResourceTemplateReferenceSchema:Wr,PromptReferenceSchema:Kr,RootSchema:Us,ClientCapabilities2026Schema:Fs,ServerCapabilities2026Schema:bi,RequestMetaEnvelopeSchema:Ti,ToolSchema:Zr,ToolResultContentSchema:Bs,SamplingMessageContentBlockSchema:Ri,SamplingMessageSchema:Xr,ResultTypeSchema:Ei,ResultMetaSchema:wi,ResultSchema:Vs,PaginatedResultSchema:ja,CallToolResultSchema:Ai,ListToolsResultSchema:js,ListPromptsResultSchema:Gs,GetPromptResultSchema:Hs,ListResourcesResultSchema:qs,ListResourceTemplatesResultSchema:Ws,ReadResourceResultSchema:Ks,CompleteResultSchema:Zs,CacheableResultSchema:Ga,DiscoverResultSchema:Xs,CreateMessageRequestParamsSchema:qn,CreateMessageRequestSchema:Js,ListRootsRequestSchema:Ys,CreateMessageResultSchema:Qs,ListRootsResultSchema:eo,ElicitResultSchema:to,ElicitRequestURLParamsSchema:no,ElicitRequestParamsSchema:ro,ElicitRequestSchema:io,InputRequestSchema:so,InputResponseSchema:oo,InputRequestsSchema:ao,InputResponsesSchema:co,InputRequiredResultSchema:Jr,InputResponseRequestParamsSchema:Ha,CallToolRequestSchema:Wa,ListToolsRequestSchema:Ka,ListPromptsRequestSchema:Za,GetPromptRequestSchema:Xa,ListResourcesRequestSchema:Ja,ListResourceTemplatesRequestSchema:Ya,ReadResourceRequestSchema:Qa,CompleteRequestSchema:ec,DiscoverRequestSchema:tc,SubscriptionFilterSchema:Ii,SubscriptionsListenRequestSchema:nc,SubscriptionsListenResultMetaSchema:rc,SubscriptionsListenResultSchema:ic,dispatchRequestSchemas:Wn,dispatchResultSchemas:sc,NotificationMetaSchema:Qr,SubscriptionsAcknowledgedNotificationSchema:Ci,CancelledNotificationParamsSchema:Pi,CancelledNotificationSchema:Ni,notificationSchemas2026:Hh,JSONRPCResultResponseSchema:zt(Vs),CallToolResultResponseSchema:zt(oe([Ai,Jr])),ListToolsResultResponseSchema:zt(js),ListPromptsResultResponseSchema:zt(Gs),GetPromptResultResponseSchema:zt(oe([Hs,Jr])),ListResourcesResultResponseSchema:zt(qs),ListResourceTemplatesResultResponseSchema:zt(Ws),ReadResourceResultResponseSchema:zt(oe([Ks,Jr])),CompleteResultResponseSchema:zt(Zs),DiscoverResultResponseSchema:zt(Xs)}}var zI;function gi(){return zI??=OI()}var $I=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function kI(t){return $I.includes(t)}var bs=Symbol("modelcontextprotocol.resultCacheHintFallback");function Fd(t,e){if(e===void 0)return t;let r=t[bs];if(r===void 0)return {...t,[bs]:e};let i={},n=r.ttlMs??e.ttlMs;n!==void 0&&(i.ttlMs=n);let s=r.cacheScope??e.cacheScope;return s!==void 0&&(i.cacheScope=s),{...t,[bs]:i}}function DI(t){return t[bs]}function Cv(t){return typeof t=="number"&&Number.isSafeInteger(t)&&t>=0}function Pv(t){return t==="public"||t==="private"}function Nv(t,e){if(t.ttlMs!==void 0&&!Cv(t.ttlMs))throw new RangeError(`Invalid cache hint for ${e}: ttlMs must be a non-negative safe integer (got ${String(t.ttlMs)})`);if(t.cacheScope!==void 0&&!Pv(t.cacheScope))throw new RangeError(`Invalid cache hint for ${e}: cacheScope must be 'public' or 'private' (got ${String(t.cacheScope)})`)}var te=(function(t){return t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.ResourceNotFound=-32002]="ResourceNotFound",t[t.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",t[t.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired",t})({}),he=class Qb extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"});}static[Symbol.hasInstance](e){return Ts(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ts(this,e)}constructor(e,r,i){super(r),this.code=e,this.data=i,this.name="ProtocolError",Ev(this,new.target);}static fromError(e,r,i){if(e===te.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new eT(n.elicitations,r)}if(e===te.UnsupportedProtocolVersion&&i){let n=i;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new ws({supported:n.supported,requested:n.requested},r)}if(e===te.InvalidParams||e===te.ResourceNotFound){let n=i;if(typeof n?.uri=="string"&&(e===te.ResourceNotFound||Object.keys(n).length===1))return new Bd(n.uri,r)}if(e===te.MissingRequiredClientCapability&&i){let n=i;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Vd({requiredCapabilities:n.requiredCapabilities},r)}return new Qb(e,r,i)}},Bd=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"});}constructor(t,e=`Resource not found: ${t}`){super(te.InvalidParams,e,{uri:t});}get uri(){return this.data.uri}},eT=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"});}constructor(t,e=`URL elicitation${t.length>1?"s":""} required`){super(te.UrlElicitationRequired,e,{elicitations:t});}get elicitations(){return this.data?.elicitations??[]}},ws=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"});}constructor(t,e=`Unsupported protocol version: ${t.requested}`){super(te.UnsupportedProtocolVersion,e,t);}get supported(){return this.data.supported}get requested(){return this.data.requested}},Vd=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"});}constructor(t,e=`Missing required client capabilities: ${Object.keys(t.requiredCapabilities).join(", ")}`){super(te.MissingRequiredClientCapability,e,t);}get requiredCapabilities(){return this.data.requiredCapabilities}},LI=0,UI="private",FI=["tools/call","prompts/get","resources/read"];function BI(t,e){let r=e.resultType;if(r===void 0)return {...e,resultType:"complete"};if(r==="complete"||FI.includes(t))return e;throw new he(te.InternalError,`Handler for ${t} returned resultType '${String(r)}', but results of ${t} only support 'complete' on protocol revision 2026-07-28`)}function VI(t,e){let r=DI(e);if(e.resultType!=="complete"||!kI(t))return r===void 0?e:WI(e);let i=e,n=Cv(i.ttlMs)?i.ttlMs:HI(r),s=Pv(i.cacheScope)?i.cacheScope:qI(r),o={...i,ttlMs:n,cacheScope:s};return delete o[bs],o}function jI(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function GI(t,e){if(e===void 0)return t;let r=t._meta;return r===void 0?{...t,_meta:{[bn]:e}}:!jI(r)||r[bn]!==void 0?t:{...t,_meta:{...r,[bn]:e}}}function HI(t){return t!==void 0&&Cv(t.ttlMs)?t.ttlMs:LI}function qI(t){return t!==void 0&&Pv(t.cacheScope)?t.cacheScope:UI}function WI(t){let e={...t};return delete e[bs],e}var KI=["elicitation/create","sampling/createMessage","roots/list"],zd;function tT(){if(zd)return zd;let t=gi();return zd={request:{"elicitation/create":I({method:D("elicitation/create"),params:t.ElicitRequestParamsSchema}),"sampling/createMessage":I({method:D("sampling/createMessage"),params:t.CreateMessageRequestParamsSchema}),"roots/list":I({method:D("roots/list"),params:de({}).optional()})},response:{"elicitation/create":t.ElicitResultSchema,"sampling/createMessage":t.CreateMessageResultSchema,"roots/list":t.ListRootsResultSchema}},zd}function nT(t){return KI.includes(t)}function vv(t){return nT(t)?tT().request[t]:void 0}function ZI(t){return nT(t)?tT().response[t]:void 0}var Ov={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},rT={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function iT(t){return Object.prototype.hasOwnProperty.call(Ov,t)}function sT(t){return Object.prototype.hasOwnProperty.call(rT,t)}function XI(t){return Object.prototype.hasOwnProperty.call(Ov,t)}function JI(t){return iT(t)?gi().dispatchRequestSchemas[t]:void 0}function YI(t){return XI(t)?gi().dispatchResultSchemas[t]:void 0}function QI(t){return sT(t)?gi().notificationSchemas2026[t]:void 0}function Sa(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function va(t,e){if(t===void 0)return {ok:false,reason:"not-in-era"};let r=t.safeParse(e);return r.success?{ok:true,value:r.data}:{ok:false,reason:"invalid",message:String(r.error)}}var e1={ok:false,reason:"not-in-era"},t1=[zn,$n];function n1(t,e){let r=e,i=false,n=()=>(i||(r={...r},i=true),r),s=e.tools;t==="tools/list"&&Array.isArray(s)&&s.some(a=>Sa(a)&&"execution"in a)&&(n().tools=s.map(a=>{if(!Sa(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c}));let o=e.capabilities;if(Sa(o)&&"tasks"in o){let a={...o};delete a.tasks,n().capabilities=a;}return r}var zv={era:"2026-07-28",hasRequestMethod:iT,hasNotificationMethod:sT,hasInputRequestMethod:t=>vv(t)!==void 0,validateRequest:(t,e)=>va(JI(t),e),validateResult:(t,e)=>va(YI(t),e),validateNotification:(t,e)=>va(QI(t),e),validateInputRequest:(t,e)=>va(vv(t),e),validateInputResponse:(t,e)=>va(ZI(t),e),samplingResultVariant:()=>e1,outboundEnvelope(t){return {[zn]:t.protocolVersion,[us]:t.clientInfo,[$n]:t.clientCapabilities,...t.logLevel!==void 0&&{[ar]:t.logLevel}}},validateEnvelopeMeta(t){let e=[];for(let i of t1)i in t||e.push({key:i,problem:"missing"});let r=gi().RequestMetaEnvelopeSchema.safeParse(t);if(!r.success)for(let i of r.error.issues){let n=i.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&e.some(o=>o.key===s&&o.problem==="missing")||e.push({key:s,problem:i.message});}return e},projectCallToolResult:t=>Hb(t),inputRequestSchema:vv,decodeResult(t,e){if(!Sa(e))return {kind:"invalid",error:new Te(Ce.InvalidResult,`Invalid result for ${t}: not an object`,{method:t})};let r=e.resultType;if(r===void 0)return {kind:"invalid",error:new Te(Ce.InvalidResult,`Invalid result for ${t}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:t,violation:"missing-resultType"})};if(typeof r!="string")return {kind:"invalid",error:new Te(Ce.InvalidResult,`Invalid result for ${t}: non-string resultType`,{method:t,resultType:r})};if(r==="input_required"){let o=e.inputRequests,a=Sa(o)?o:{},c=e.requestState;return Object.keys(a).length===0&&typeof c!="string"?{kind:"invalid",error:new Te(Ce.InvalidResult,`Invalid result for ${t}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:t,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:a,...typeof c=="string"&&{requestState:c}}}if(r!=="complete")return {kind:"invalid",error:new Te(Ce.UnsupportedResultType,`Unsupported result type '${r}' for ${t}`,{resultType:r,method:t})};let i=r1(),n=Object.hasOwn(i,t)?i[t]:void 0;if(n!==void 0){let o=n.safeParse(e);if(!o.success)return {kind:"invalid",error:new Te(Ce.InvalidResult,`Invalid result for ${t}: ${o.error}`,{method:t})}}let s={...e};return delete s.resultType,{kind:"complete",result:s}},encodeResult(t,e,r){return GI(VI(t,BI(t,n1(t,e))),r)},encodeErrorCode:t=>t===-32002?-32602:t,checkInboundEnvelope(t){if(t.envelope===void 0)return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let e=gi().RequestMetaEnvelopeSchema.safeParse(t.envelope);if(!e.success)return `Invalid _meta envelope for protocol revision 2026-07-28: ${e.error.issues.map(r=>r.message).join("; ")}`}},$d;function r1(){if($d)return $d;let t=gi();return $d={"tools/call":t.CallToolResultSchema,"tools/list":t.ListToolsResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"completion/complete":t.CompleteResultSchema,"server/discover":t.DiscoverResultSchema},$d}var Ra="2026-07-28";function mr(t){return t!==void 0&&Es(t)?zv:Iv}function Ob(t){return t.revision!==void 0?mr(t.revision).era:t.era==="modern"?zv.era:Iv.era}function yv(t){return oT.some(e=>e.hasRequestMethod(t))}function Sv(t){return oT.some(e=>e.hasNotificationMethod(t))}var oT=[Iv,zv];function zb(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function _i(t){if(!zb(t))return;let e=t._meta;return zb(e)?e:void 0}function jd(t){let e=_i(t);return e!==void 0&&zn in e}function Gd(t){let e=_i(t)?.[zn];return typeof e=="string"?e:void 0}function Hd(t){return mr(Ra).validateEnvelopeMeta(t)}var i1=w0({AnnotationsSchema:()=>kn,AudioContentSchema:()=>_s,BaseMetadataSchema:()=>On,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>oa,BooleanSchemaSchema:()=>da,CallToolRequestParamsSchema:()=>Hu,CallToolRequestSchema:()=>qu,CallToolResultSchema:()=>ua,CancelTaskRequestSchema:()=>nv,CancelTaskResultSchema:()=>rv,CancelledNotificationParamsSchema:()=>Kl,CancelledNotificationSchema:()=>ea,ClientCapabilitiesSchema:()=>Yl,ClientNotificationSchema:()=>sv,ClientRequestSchema:()=>iv,ClientResultSchema:()=>ov,ClientTasksCapabilitySchema:()=>Xl,CompatibilityCallToolResultSchema:()=>H_,CompleteRequestParamsSchema:()=>yd,CompleteRequestSchema:()=>Sd,CompleteResultSchema:()=>xd,ContentBlockSchema:()=>vs,CreateMessageRequestParamsSchema:()=>id,CreateMessageRequestSchema:()=>sd,CreateMessageResultSchema:()=>od,CreateMessageResultWithToolsSchema:()=>ad,CreateTaskResultSchema:()=>K_,CursorSchema:()=>Wo,DiscoverRequestSchema:()=>ru,DiscoverResultSchema:()=>iu,ElicitRequestFormParamsSchema:()=>xs,ElicitRequestParamsSchema:()=>hd,ElicitRequestSchema:()=>fd,ElicitRequestURLParamsSchema:()=>dd,ElicitResultSchema:()=>gd,ElicitationCompleteNotificationParamsSchema:()=>pd,ElicitationCompleteNotificationSchema:()=>md,EmbeddedResourceSchema:()=>ku,EmptyResultSchema:()=>Qo,EnumSchemaSchema:()=>ud,GetPromptRequestParamsSchema:()=>Ou,GetPromptRequestSchema:()=>zu,GetPromptResultSchema:()=>Uu,GetTaskPayloadRequestSchema:()=>Y_,GetTaskPayloadResultSchema:()=>Q_,GetTaskRequestSchema:()=>X_,GetTaskResultSchema:()=>J_,IconSchema:()=>Zl,IconsSchema:()=>lr,ImageContentSchema:()=>gs,ImplementationSchema:()=>fs,InitializeRequestParamsSchema:()=>Ql,InitializeRequestSchema:()=>eu,InitializeResultSchema:()=>tu,InitializedNotificationSchema:()=>nu,JSONArraySchema:()=>V_,JSONObjectSchema:()=>Ye,JSONRPCErrorResponseSchema:()=>hs,JSONRPCMessageSchema:()=>Yo,JSONRPCNotificationSchema:()=>Jo,JSONRPCRequestSchema:()=>Xo,JSONRPCResponseSchema:()=>j_,JSONRPCResultResponseSchema:()=>ds,JSONValueSchema:()=>or,LegacyTitledEnumSchemaSchema:()=>pa,ListChangedOptionsBaseSchema:()=>q_,ListPromptsRequestSchema:()=>Pu,ListPromptsResultSchema:()=>Nu,ListResourceTemplatesRequestSchema:()=>du,ListResourceTemplatesResultSchema:()=>hu,ListResourcesRequestSchema:()=>lu,ListResourcesResultSchema:()=>uu,ListRootsRequestSchema:()=>Td,ListRootsResultSchema:()=>Rd,ListTasksRequestSchema:()=>ev,ListTasksResultSchema:()=>tv,ListToolsRequestSchema:()=>ju,ListToolsResultSchema:()=>Gu,LoggingLevelSchema:()=>fr,LoggingMessageNotificationParamsSchema:()=>Xu,LoggingMessageNotificationSchema:()=>Ju,ModelHintSchema:()=>Yu,ModelPreferencesSchema:()=>Qu,MultiSelectEnumSchemaSchema:()=>ld,NotificationSchema:()=>xt,NotificationsParamsSchema:()=>St,NumberSchemaSchema:()=>Ss,PaginatedRequestParamsSchema:()=>au,PaginatedRequestSchema:()=>ur,PaginatedResultSchema:()=>dr,PingRequestSchema:()=>na,PrimitiveSchemaDefinitionSchema:()=>_a,ProgressNotificationParamsSchema:()=>ou,ProgressNotificationSchema:()=>ra,ProgressSchema:()=>su,ProgressTokenSchema:()=>qo,PromptArgumentSchema:()=>Iu,PromptListChangedNotificationSchema:()=>Fu,PromptMessageSchema:()=>Lu,PromptReferenceSchema:()=>vd,PromptSchema:()=>Cu,ReadResourceRequestParamsSchema:()=>fu,ReadResourceRequestSchema:()=>pu,ReadResourceResultSchema:()=>mu,RelatedTaskMetadataSchema:()=>Wl,RequestIdSchema:()=>cr,RequestMetaSchema:()=>Ko,RequestSchema:()=>Qe,ResourceContentsSchema:()=>ia,ResourceLinkSchema:()=>Du,ResourceListChangedNotificationSchema:()=>gu,ResourceRequestParamsSchema:()=>ps,ResourceSchema:()=>aa,ResourceTemplateReferenceSchema:()=>_d,ResourceTemplateSchema:()=>cu,ResourceUpdatedNotificationParamsSchema:()=>Mu,ResourceUpdatedNotificationSchema:()=>Au,ResultMetaObjectSchema:()=>Zo,ResultSchema:()=>et,RoleSchema:()=>hr,RootSchema:()=>bd,RootsListChangedNotificationSchema:()=>Ed,SamplingContentSchema:()=>nd,SamplingMessageContentBlockSchema:()=>ui,SamplingMessageSchema:()=>rd,ServerCapabilitiesSchema:()=>ta,ServerNotificationSchema:()=>cv,ServerRequestSchema:()=>av,ServerResultSchema:()=>lv,ServerTasksCapabilitySchema:()=>Jl,SetLevelRequestParamsSchema:()=>Ku,SetLevelRequestSchema:()=>Zu,SingleSelectEnumSchemaSchema:()=>cd,StringSchemaSchema:()=>ys,SubscribeRequestParamsSchema:()=>_u,SubscribeRequestSchema:()=>vu,SubscriptionFilterSchema:()=>ca,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Tu,SubscriptionsAcknowledgedNotificationSchema:()=>Ru,SubscriptionsListenRequestParamsSchema:()=>xu,SubscriptionsListenRequestSchema:()=>bu,SubscriptionsListenResultMetaSchema:()=>Eu,SubscriptionsListenResultSchema:()=>wu,TaskAugmentedRequestParamsSchema:()=>pi,TaskCreationParamsSchema:()=>W_,TaskMetadataSchema:()=>ql,TaskSchema:()=>pr,TaskStatusNotificationParamsSchema:()=>Md,TaskStatusNotificationSchema:()=>Z_,TaskStatusSchema:()=>wd,TextContentSchema:()=>ms,TextResourceContentsSchema:()=>sa,TitledMultiSelectEnumSchemaSchema:()=>ga,TitledSingleSelectEnumSchemaSchema:()=>fa,ToolAnnotationsSchema:()=>Bu,ToolChoiceSchema:()=>ed,ToolExecutionSchema:()=>Vu,ToolListChangedNotificationSchema:()=>Wu,ToolResultContentSchema:()=>td,ToolSchema:()=>la,ToolUseContentSchema:()=>$u,UnsubscribeRequestParamsSchema:()=>yu,UnsubscribeRequestSchema:()=>Su,UntitledMultiSelectEnumSchemaSchema:()=>ma,UntitledSingleSelectEnumSchemaSchema:()=>ha});var Xt=t=>Xo.safeParse(t).success,_r=t=>Jo.safeParse(t).success,ba=t=>ds.safeParse(t).success,qd=t=>hs.safeParse(t).success;var Dn=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)&&t.resultType==="input_required";function $v(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function kv(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var $b="x-mcp-header",s1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,o1=new Set(["string","integer","boolean","number"]);function Dv(t){let e=[],r=new Map,i=(s,o,a)=>{if(s===null||typeof s!="object")return;let c=s;if($b in c){if(!a||o.length===0)return `${kd(o)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let u=c[$b];if(typeof u!="string"||u.length===0)return `${kd(o)}: x-mcp-header MUST be a non-empty string`;if(!s1.test(u))return `${kd(o)}: x-mcp-header '${u}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let d=typeof c.type=="string"?c.type:void 0;if(d===void 0||!o1.has(d))return `${kd(o)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${d??"<none>"}`;let f=u.toLowerCase(),p=r.get(f);if(p!==void 0)return `x-mcp-header '${u}' is not case-insensitively unique (also declared as '${p}')`;r.set(f,u),e.push({path:o,headerName:u,type:d});}let l=c.properties;if(l!==null&&typeof l=="object")for(let[u,d]of Object.entries(l)){let f=i(d,[...o,u],a);if(f!==void 0)return f}for(let u of a1){let d=c[u];if(d===void 0)continue;let f=Array.isArray(d)?d:d!==null&&typeof d=="object"&&c1.has(u)?Object.values(d):[d];for(let p of f){let g=i(p,[...o,`<${u}>`],false);if(g!==void 0)return g}}},n=i(t,[],true);return n===void 0?{valid:true,declarations:e}:{valid:false,reason:n}}var a1=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],c1=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function kd(t){return t.length===0?"<root>":t.join(".")}var Ld=-32020;[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[te.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[Ld,te.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[te.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[te.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[te.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[Ld],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[te.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[Ld],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}];({[te.ParseError]:400,[te.InvalidRequest]:400,[te.MethodNotFound]:404,[te.UnsupportedProtocolVersion]:400,[te.MissingRequiredClientCapability]:400});function Dd(t,e,r,i,n){return {kind:"reject",rung:t,cell:e,httpStatus:r,code:i.code,message:i.message,...i.data!==void 0&&{data:i.data},settled:n}}function Lv(t){if(!jd(t))return false;let e=Gd(t);if(e===void 0||!Es(e))return false;let r=_i(t);return r!==void 0&&Hd(r).length===0}function Uv(t,e){switch(t.reason){case "http-method":return Dd("http-method","modern-only-method-not-allowed",405,new he(-32e3,"Method not allowed."),true);case "batch":return Dd("jsonrpc-shape","modern-only-batch-not-supported",400,new he(te.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),true);case "response":return Dd("jsonrpc-shape","modern-only-response-post",400,new he(te.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),true);case "notification":return;case "initialize":case "no-claim":{let r=t.requestedVersion;return Dd("era-classification","modern-only-missing-envelope",400,r===void 0?new he(te.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...e]}):new ws({supported:[...e],requested:r}),true)}}}function Wd(t,e){return zo(t,e)}function ya(t){return new Set(t.flatMap(e=>Object.keys(e.shape)))}function Rs(t){if(t==null)return false;let e=typeof t;return e!=="object"&&e!=="function"||!("~standard"in t)?false:typeof t["~standard"]?.validate=="function"}var kb=false,Tv="draft-2020-12";function vr(t,e="input"){let r=t["~standard"],i;if(r.jsonSchema)i=r.jsonSchema[e]({target:Tv});else if(r.vendor==="zod"){if(!("_zod"in t))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");kb||(kb=true,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),i=ci(t,{target:Tv,io:e});}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(e==="output")return i.type!==void 0?i:aT(i)?{type:"object",...i}:i;if(i.type!==void 0&&i.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(i.type)}). Wrap your schema in z.object({...}) or equivalent.`);return {type:"object",...i}}function aT(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return true;for(let e of ["oneOf","anyOf","allOf"]){let r=t[e];if(Array.isArray(r)&&r.length>0)return r.every(i=>i!==null&&typeof i=="object"&&(i.type==="object"||aT(i)))}return false}function u1(t){return t.path?.length?`${t.path.map(e=>String(typeof e=="object"?e.key:e)).join(".")}: ${t.message}`:t.message}async function mi(t,e){let r=await t["~standard"].validate(e);return r.issues&&r.issues.length>0?{success:false,error:r.issues.map(i=>u1(i)).join(", ")}:{success:true,data:r.value}}function d1(t){let e=ci(t,{target:Tv,io:"input"});return typeof e.pattern=="string"?e.pattern:void 0}var h1=/\\\.\\d\{(\d+)\}/;function f1(t){let e=h1.exec(t),r=[void 0,-1,0];return e&&r.push(Number(e[1])),[false,true].flatMap(i=>[false,true].flatMap(n=>r.map(s=>jt.datetime({local:i,offset:n,precision:s}))))}function p1(t,e){let r;switch(t){case "email":r=[bl()];break;case "uri":r=[ss()];break;case "date":r=[jt.date()];break;case "date-time":r=f1(e);break}return new Set(r.map(i=>d1(i)).filter(i=>i!==void 0))}function m1(t,e,r){return r!=="zod"?true:p1(t,e).has(e)}function cT(t){let e=vr(t,"input"),r=e.properties||{},i=e.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:i.includes(n)}))}function Ta(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function g1(t){try{return vr(t,"input")}catch(e){let r=e instanceof Error?e.message:String(e);throw new he(te.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var _1=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Fv(t){return _1.has(t)||t.startsWith("x-")}var v1=new Set(["$schema",...Object.keys(xs.shape.requestedSchema.shape)]),Db={string:ya([ys,ha,fa,pa]),number:ya([Ss]),integer:ya([Ss]),boolean:ya([da]),array:ya([ma,ga])},y1=new Set(ys.shape.format.unwrap().options);function S1(t,e,r,i){if(!Ta(t))return t;let n=typeof t.type=="string"&&Object.hasOwn(Db,t.type)?Db[t.type]:void 0;if(n===void 0)return t;let s={};for(let[o,a]of Object.entries(t))n.has(o)||Fv(o)?s[o]=a:o==="pattern"&&t.type==="string"&&typeof t.format=="string"?y1.has(t.format)?(typeof a!="string"||!m1(t.format,a,r))&&i.push(`${e}.${o}`):s[o]=a:i.push(`${e}.${o}`);return s}function x1(t,e){let r={},i=[];for(let[n,s]of Object.entries(t))n==="properties"&&Ta(s)?r[n]=Object.fromEntries(Object.entries(s).map(([o,a])=>[o,S1(a,`properties.${o}`,e,i)])):v1.has(n)?r[n]=s:Fv(n)||i.push(n);if(i.length>0)throw new he(te.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);return r}function b1(t,e){if(!Ta(t.properties))return e;let r=Object.entries(t.properties).filter(([,i])=>!Wd(_a,i).success).map(([i])=>`properties.${i}`);return r.length>0?r.join(", "):e}function Rv(t,e,r=""){return Array.isArray(t)&&Array.isArray(e)?t.flatMap((i,n)=>Rv(i,e[n],`${r}[${n}]`)):!Ta(t)||!Ta(e)?[]:Object.entries(t).flatMap(([i,n])=>{let s=r?`${r}.${i}`:i;return Object.prototype.hasOwnProperty.call(e,i)?Rv(n,e[i],s):Fv(i)?[]:[s]})}function T1(t){if(!Rs(t.requestedSchema))return {...t,mode:"form",requestedSchema:t.requestedSchema};let e=t.requestedSchema["~standard"].vendor,r=x1(g1(t.requestedSchema),e),i=Wd(xs.shape.requestedSchema,r);if(!i.success)throw new he(te.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${b1(r,i.error.message)}`);let n=Rv(r,i.data);if(n.length>0)throw new he(te.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(i.data.required??[]).filter(o=>!Object.prototype.hasOwnProperty.call(i.data.properties,o));if(s.length>0)throw new he(te.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return {...t,mode:"form",requestedSchema:i.data}}function R1(t){let e=t.inputRequests!==void 0&&Object.keys(t.inputRequests).length>0,r=typeof t.requestState=="string";if(!e&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return {resultType:"input_required",...t.inputRequests!==void 0&&{inputRequests:t.inputRequests},...t.requestState!==void 0&&{requestState:t.requestState}}}Object.assign(R1,{elicit(t){try{return {method:"elicitation/create",params:T1(t)}}catch(e){throw e instanceof he?new TypeError(e.message,{cause:e}):e}},elicitUrl(t){return {method:"elicitation/create",params:{...t,mode:"url"}}},createMessage(t){return {method:"sampling/createMessage",params:t}},listRoots(){return {method:"roots/list"}}});var lT=250;function uT(t,e){return `Multi-round-trip request '${t}' still required input after ${e} rounds (inputRequired.maxRounds)`}function dT(t,e){return new Promise((r,i)=>{if(e?.aborted){i(e.reason instanceof Te?e.reason:new Te(Ce.RequestTimeout,String(e.reason)));return}let n=setTimeout(()=>{e?.removeEventListener("abort",s),r();},t),s=()=>{clearTimeout(n),i(e?.reason instanceof Te?e.reason:new Te(Ce.RequestTimeout,String(e?.reason)));};e?.addEventListener("abort",s,{once:true});})}function hT(t){let e=new AbortController,r=()=>e.abort(t?.reason);return t?.addEventListener("abort",r,{once:true}),t?.aborted&&e.abort(t.reason),{signal:e.signal,abort:i=>e.abort(i),dispose:()=>t?.removeEventListener("abort",r)}}var w1=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],M1={IdJagTokenExchangeResponseSchema:fv,OAuthClientInformationFullSchema:mv,OAuthClientInformationSchema:Pd,OAuthClientMetadataSchema:Cd,OAuthClientRegistrationErrorSchema:gv,OAuthErrorResponseSchema:pv,OAuthMetadataSchema:Ad,OAuthProtectedResourceMetadataSchema:uv,OAuthTokenRevocationRequestSchema:_v,OAuthTokensSchema:hv,OpenIdProviderDiscoveryMetadataSchema:dv,OpenIdProviderMetadataSchema:Id},fT={},pT={};function mT(t,e){let r=t.slice(0,-6);fT[r]=e,pT[r]=i=>e.safeParse(i).success;}for(let t of w1)mT(t,i1[t]);for(let[t,e]of Object.entries(M1))mT(t,e);Object.freeze(fT);Object.freeze(pT);function C1(t){switch(t){case "initialize":case "notifications/initialized":return mr(void 0);case "server/discover":return mr(Ra);default:return}}var gT=6e4,P1=[zn,us,$n,ar],N1=["inputResponses","requestState"];function Lb(t,e){let r=t.params;if(!xa(r))return {message:t,lifted:{}};let i=r._meta,n=xa(i)?P1.filter(c=>c in i):[],s=e==="request"?N1.filter(c=>c in r):[];if(n.length===0&&s.length===0)return {message:t,lifted:{}};let o={},a={...r};if(n.length>0&&xa(i)){let c={},l={...i};for(let u of n)c[u]=i[u],delete l[u];o.envelope=c,Object.keys(l).length>0?a._meta=l:delete a._meta;}for(let c of s)c==="inputResponses"&&(o.inputResponses=a[c]),c==="requestState"&&(o.requestState=a[c]),delete a[c];return {message:{...t,params:a},lifted:o}}function Ub(t,e){let r=t.validateResult(e,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return {"~standard":{version:1,vendor:"mcp-wire-codec",validate(i){let n=t.validateResult(e,i);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${e}`}]}}}}}function Ea(t){return ()=>t}var O1=Ea(void 0);function Bv(t,e){return {...t,mcpReq:{...t.mcpReq,requestState:Ea(e)}}}var _T;function Vv(t,e){_T(t,e);}var jv=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{_T=(t,e)=>{t._negotiatedProtocolVersion=e;};}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(t){this._options=t,this._supportedProtocolVersions=t?.supportedProtocolVersions??Gl,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e);}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e);}),this.setRequestHandler("ping",e=>({}));}_shouldDropInbound(t){}_outboundMetaEnvelope(){}_envelopeOutbound(t){let e=this._outboundMetaEnvelope();if(e===void 0)return t;let r=t.params??{};return {...t,params:{...r,_meta:{...e,...r._meta}}}}_resolveNonCompleteResult(t,e){return Promise.reject(new Te(Ce.UnsupportedResultType,`Unsupported result type '${t.kind}' for ${e.request.method}`,{resultType:t.kind,method:e.request.method}))}_getRequestHandler(t){return this._requestHandlers.get(t)}async _oncancel(t){t.params.requestId&&this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason);}_setupTimeout(t,e,r,i,n=false){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,e),startTime:Date.now(),timeout:e,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i});}_resetTimeout(t){let e=this._timeoutInfo.get(t);if(!e)return false;let r=Date.now()-e.startTime;if(e.maxTotalTimeout&&r>=e.maxTotalTimeout)throw this._timeoutInfo.delete(t),new Te(Ce.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:e.maxTotalTimeout,totalElapsed:r});return clearTimeout(e.timeoutId),e.timeoutId=setTimeout(e.onTimeout,e.timeout),true}_cleanupTimeout(t){let e=this._timeoutInfo.get(t);e&&(clearTimeout(e.timeoutId),this._timeoutInfo.delete(t));}async connect(t){this._transport=t;let e=this.transport?.onclose;this._transport.onclose=()=>{try{e?.();}finally{this._onclose();}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n);};let i=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{i?.(n,s),ba(n)||qd(n)?this._onresponse(n):Xt(n)?this._onrequest(n,s):_r(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`));},t.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start();}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();let e=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new Te(Ce.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.();}finally{for(let i of t.values())i(r);for(let i of e.values())i.abort(r);}}_onerror(t){this.onerror?.(t);}_onnotification(t,e){let{message:r}=Lb(t,"notification"),i=this._negotiatedWireCodec();if(e?.classification===void 0&&this._shouldDropInbound(t)==="drop")return;if(e?.classification!==void 0){let o=Ob(e.classification);if(o!==i.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${o} but this instance serves ${i.era}`));return}}if(Sv(r.method)&&!i.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,i)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)));}_onrequest(t,e){let{message:r,lifted:i}=Lb(t,"request"),n=this._negotiatedWireCodec();if(e?.classification===void 0&&this._shouldDropInbound(t)==="drop"){this._onerror(new Error(`Dropped inbound request '${t.method}': not servable on this connection's protocol era`));return}let s=this._transport,o=(m,S,h)=>{let v={jsonrpc:"2.0",id:r.id,error:{code:m,message:S,...h!==void 0&&{data:h}}};s?.send(v).catch(_=>this._onerror(new Error(`Failed to send an error response: ${_}`)));};if(e?.classification!==void 0){let m=Ob(e.classification);if(m!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${m} but this instance serves ${n.era}`));let S=e.classification.revision??m;o(te.UnsupportedProtocolVersion,`Unsupported protocol version: ${S}`,{supported:this._supportedProtocolVersions,requested:S});return}}if(yv(r.method)&&!n.hasRequestMethod(r.method)){o(te.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){o(te.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(i);if(c!==void 0){o(te.InvalidParams,c);return}let l=(m,S)=>this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,{...S,relatedRequestId:r.id}),u=(m,S,h)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(m.method),m,S,{...h,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let f=i.inputResponses===void 0?void 0:z1(i.inputResponses),p={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...i.envelope!==void 0&&{envelope:i.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:i.requestState===void 0?O1:Ea(i.requestState),signal:d.signal,send:((m,S,h)=>{let v=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(v,m.method),Rs(S))return u(m,S,h);let _=Ub(v,m.method);if(_===void 0)throw new TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(m,_,S)}),notify:l},http:e?.authInfo?{authInfo:e.authInfo}:void 0},g=this.buildContext(p,e);Promise.resolve().then(()=>a(r,g)).then(async m=>{if(d.signal.aborted)return;let S;try{S=n.encodeResult(r.method,m,this._outboundServerInfo());}catch(v){this._onerror(new Error(`Failed to encode result for ${r.method}: ${v}`)),o(te.InternalError,"Internal error");return}let h={result:S,jsonrpc:"2.0",id:r.id};await s?.send(h);},async m=>{if(d.signal.aborted)return;let S=Number.isSafeInteger(m.code)?m.code:te.InternalError,h={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(S),message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};await s?.send(h);}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===d&&this._requestHandlerAbortControllers.delete(r.id);});}_onprogress(t){let{progressToken:e,...r}=t.params,i=Number(e),n=this._progressHandlers.get(i);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(i),o=this._timeoutInfo.get(i);if(o&&s&&o.resetTimeoutOnProgress)try{this._resetTimeout(i);}catch(a){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(a);return}n(r);}_onresponse(t){let e=Number(t.id),r=this._responseHandlers.get(e);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(e),this._cleanupTimeout(e),this._progressHandlers.delete(e),ba(t)?r(t):r(he.fromError(t.error.code,t.error.message,t.error.data));}get transport(){return this._transport}async close(){await this._transport?.close();}request(t,e,r){let i=this._resolveOutboundCodec(t.method);if(this._assertOutboundRequestInEra(i,t.method),Rs(e))return this._requestWithSchemaViaCodec(i,t,e,r);let n=Ub(i,t.method);if(n===void 0)throw new TypeError(`'${t.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(i,t,n,e)}_negotiatedWireCodec(){return mr(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(t){if(this._negotiatedProtocolVersion===void 0){let e=C1(t);if(e)return e}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(t,e){if(yv(e)&&!t.hasRequestMethod(e))throw new Te(Ce.MethodNotSupportedByProtocolVersion,`Method '${e}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:e,era:t.era})}_requestWithSchema(t,e,r){let i=this._resolveOutboundCodec(t.method);return this._assertOutboundRequestInEra(i,t.method),this._requestWithSchemaViaCodec(i,t,e,r)}_requestWithSchemaViaCodec(t,e,r,i){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o,headers:a}=i??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=T=>{f(T);};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===true)try{this.assertCapabilityForMethod(e.method);}catch(T){p(T);return}if(i?.signal?.aborted){let T=i.signal.reason;throw T instanceof Te?T:new Te(Ce.RequestTimeout,String(T))}let g=t.era===Ra&&this._transport.hasPerRequestStream===true?new AbortController:void 0,m=this._requestMessageId++;u=m;let S={...e,jsonrpc:"2.0",id:m};i?.onprogress&&(this._progressHandlers.set(m,i.onprogress),S.params={...e.params,_meta:{...e.params?._meta,progressToken:m}});let h=this._envelopeOutbound(S),v=false,_=T=>{v||(this._progressHandlers.delete(m),g===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(T)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o}).catch(b=>this._onerror(new Error(`Failed to send cancellation: ${b}`))):g.abort(),f(T instanceof Te?T:new Te(Ce.RequestTimeout,String(T))));};this._responseHandlers.set(m,T=>{if(i?.signal?.aborted)return;if(v=true,T instanceof Error)return f(T);let b;try{b=t.decodeResult(e.method,T.result);}catch(M){return f(M instanceof Error?M:new Error(String(M)))}if(b.kind==="invalid")return f(b.error);if(b.kind==="input_required"){if(i?.allowInputRequired===true)return d($1(b));let M={codec:t,request:e,resultSchema:r,options:i,flowStartedAt:c,retry:(N,O)=>this._requestWithSchemaViaCodec(t,N===void 0?{method:e.method}:{method:e.method,params:N},r,O)};return d(this._resolveNonCompleteResult(b,M))}let E=b.result;mi(r,E).then(M=>{M.success?d(M.data):f(new Te(Ce.InvalidResult,`Invalid result for ${e.method}: ${M.error}`));},f);}),l=()=>_(i?.signal?.reason),i?.signal?.addEventListener("abort",l,{once:true});let y=i?.timeout??gT,R=()=>_(new Te(Ce.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,i?.maxTotalTimeout,R,i?.resetTimeoutOnProgress??false),this._transport.send(h,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o,headers:a,requestSignal:g?.signal}).catch(T=>{this._progressHandlers.delete(m),f(T);});}).finally(()=>{l&&i?.signal?.removeEventListener("abort",l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u));})}async notification(t,e){return this._notificationViaCodec(this._resolveOutboundCodec(t.method),t,e)}async _notificationViaCodec(t,e,r){if(!this._transport)throw new Te(Ce.NotConnected,"Not connected");if(Sv(e.method)&&!t.hasNotificationMethod(e.method))throw new Te(Ce.MethodNotSupportedByProtocolVersion,`Notification '${e.method}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:e.method,era:t.era});this.assertNotificationCapability(e.method);let i=this._envelopeOutbound({jsonrpc:"2.0",...e});if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(e.method),this._transport&&this._transport?.send(i,r).catch(n=>this._onerror(n));});return}await this._transport.send(i,r);}setRequestHandler(t,e,r){this.assertRequestHandlerCapability(t);let i;if(typeof e=="function"){if(!yv(t))throw new TypeError(`'${t}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);i=(n,s)=>{let o=this._negotiatedWireCodec(),a=o.validateRequest(t,n);if(!a.ok&&a.reason==="not-in-era"&&(a=o.validateInputRequest(t,n)),!a.ok)throw a.reason==="not-in-era"?new he(te.InternalError,`No wire schema for ${t} in the resolved era`):new Error(a.message);return Promise.resolve(e(a.value,s))};}else if(r)i=async(n,s)=>{let o=await mi(e.params,{...n.params});if(!o.success)throw new he(te.InvalidParams,`Invalid params for ${t}: ${o.error}`);return r(o.data,s)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(t,this._wrapHandler(t,i));}_wrapHandler(t,e){return e}_outboundServerInfo(){}removeRequestHandler(t){this._requestHandlers.delete(t);}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,e,r){if(typeof e=="function"){if(!Sv(t))throw new TypeError(`'${t}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(t,(i,n)=>{let s=n.validateNotification(t,i);if(!s.ok)throw s.reason==="not-in-era"?new he(te.InternalError,`No wire schema for ${t} in the resolved era`):new Error(s.message);return Promise.resolve(e(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(t,async i=>{let n=await mi(e.params,{...i.params});if(!n.success)throw new he(te.InvalidParams,`Invalid params for notification ${t}: ${n.error}`);await r(n.data,i);});}removeNotificationHandler(t){this._notificationHandlers.delete(t);}};function xa(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Gv(t,e){let r={...t};for(let i in e){let n=i,s=e[n];if(s===void 0)continue;let o=r[n];r[n]=xa(o)&&xa(s)?{...o,...s}:s;}return r}function Fb(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function z1(t){let e={},r=[];if(!Fb(t))return {accepted:e,droppedKeys:r};for(let[i,n]of Object.entries(t)){if(!Fb(n)||"method"in n||"result"in n){r.push(i);continue}e[i]=n;}return {accepted:e,droppedKeys:r}}function $1(t){return {resultType:"input_required",inputRequests:t.inputRequests,...t.requestState!==void 0&&{requestState:t.requestState}}}var k1=W((t=>{var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;t.parse=n;function n(a){if(!a)throw new TypeError("argument string is required");var c=typeof a=="object"?s(a):a;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var l=c.indexOf(";"),u=l!==-1?c.slice(0,l).trim():c.trim();if(!i.test(u))throw new TypeError("invalid media type");var d=new o(u.toLowerCase());if(l!==-1){var f,p,g;for(e.lastIndex=l;p=e.exec(c);){if(p.index!==l)throw new TypeError("invalid parameter format");l+=p[0].length,f=p[1].toLowerCase(),g=p[2],g.charCodeAt(0)===34&&(g=g.slice(1,-1),g.indexOf("\\")!==-1&&(g=g.replace(r,"$1"))),d.parameters[f]=g;}if(l!==c.length)throw new TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader=="function"?c=a.getHeader("content-type"):typeof a.headers=="object"&&(c=a.headers&&a.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function o(a){this.parameters=Object.create(null),this.type=a;}}));ac(k1());var vT=10*1024*1024,Hv=class{_buffer;_maxBufferSize;constructor(t){this._maxBufferSize=t?.maxBufferSize??vT;}append(t){if((this._buffer?.length??0)+t.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t;}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf(`
|
|
67
|
-
`);if(t===-1)return null;let e=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{return yT(e)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0;}};function yT(t){return Yo.parse(JSON.parse(t))}function
|
|
68
|
-
`}var D1=/^[A-Za-z0-9._-]{1,128}$/;function L1(t){let e=[];if(t.length===0)return {isValid:false,warnings:["Tool name cannot be empty"]};if(t.length>128)return {isValid:false,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!D1.test(t)){let r=[...t].filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,s)=>s.indexOf(i)===n);return e.push(`Tool name contains invalid characters: ${r.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:false,warnings:e}}return {isValid:true,warnings:e}}function U1(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.");}}function Wv(t){let e=L1(t);return U1(t,e.warnings),e.isValid}function F1(t){return typeof t=="object"&&t!==null&&"_zod"in t}function B1(t){return typeof t=="object"&&t!==null&&!("_zod"in t)&&"_def"in t&&typeof t._def?.typeName=="string"}function V1(t){if(typeof t!="object"||t===null||Rs(t))return false;let e=Object.getPrototypeOf(t);return e!==Object.prototype&&e!==null?false:Object.values(t).every(r=>F1(r))}function Kd(t){if(t!==void 0){if(V1(t))return I(t);if(typeof t=="object"&&t!==null&&!Rs(t)&&Object.values(t).some(e=>B1(e)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Rs(t))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return t}}var Xd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;var e=class{};t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends e{constructor(h){if(super(),!t.IDENTIFIER.test(h))throw new Error("CodeGen: name must be a valid identifier");this.str=h;}toString(){return this.str}emptyStr(){return false}get names(){return {[this.str]:1}}};t.Name=r;var i=class extends e{constructor(h){super(),this._items=typeof h=="string"?[h]:h;}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;let h=this._items[0];return h===""||h==='""'}get str(){var h;return (h=this._str)!==null&&h!==void 0?h:this._str=this._items.reduce((v,_)=>`${v}${_}`,"")}get names(){var h;return (h=this._names)!==null&&h!==void 0?h:this._names=this._items.reduce((v,_)=>(_ instanceof r&&(v[_.str]=(v[_.str]||0)+1),v),{})}};t._Code=i,t.nil=new i("");function n(h,...v){let _=[h[0]],y=0;for(;y<v.length;)a(_,v[y]),_.push(h[++y]);return new i(_)}t._=n;let s=new i("+");function o(h,...v){let _=[p(h[0])],y=0;for(;y<v.length;)_.push(s),a(_,v[y]),_.push(s,p(h[++y]));return c(_),new i(_)}t.str=o;function a(h,v){v instanceof i?h.push(...v._items):v instanceof r?h.push(v):h.push(d(v));}t.addCodeArg=a;function c(h){let v=1;for(;v<h.length-1;){if(h[v]===s){let _=l(h[v-1],h[v+1]);if(_!==void 0){h.splice(v-1,3,_);continue}h[v++]="+";}v++;}}function l(h,v){if(v==='""')return h;if(h==='""')return v;if(typeof h=="string")return v instanceof r||h[h.length-1]!=='"'?void 0:typeof v!="string"?`${h.slice(0,-1)}${v}"`:v[0]==='"'?h.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(h instanceof r))return `"${h}${v.slice(1)}`}function u(h,v){return v.emptyStr()?h:h.emptyStr()?v:o`${h}${v}`}t.strConcat=u;function d(h){return typeof h=="number"||typeof h=="boolean"||h===null?h:p(Array.isArray(h)?h.join(","):h)}function f(h){return new i(p(h))}t.stringify=f;function p(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=p;function g(h){return typeof h=="string"&&t.IDENTIFIER.test(h)?new i(`.${h}`):n`[${h}]`}t.getProperty=g;function m(h){if(typeof h=="string"&&t.IDENTIFIER.test(h))return new i(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}t.getEsmExportName=m;function S(h){return new i(h.toString())}t.regexpCode=S;})),ST=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let e=Xd();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value;}},i;((function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed";}))(i||(t.UsedValueState=i={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};var n=class{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l;}toName(c){return c instanceof e.Name?c:this.name(c)}name(c){return new e.Name(this._newName(c))}_newName(c){let l=this._names[c]||this._nameGroup(c);return `${c}${l.index++}`}_nameGroup(c){var l,u;if(!((u=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||u===void 0)&&u.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};t.Scope=n;var s=class extends e.Name{constructor(c,l){super(l),this.prefix=c;}setValue(c,{property:l,itemIndex:u}){this.value=c,this.scopePath=(0, e._)`.${new e.Name(l)}[${u}]`;}};t.ValueScopeName=s;let o=(0, e._)`\n`;var a=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?o:e.nil};}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,l){var u;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:f}=d,p=(u=l.key)!==null&&u!==void 0?u:l.ref,g=this._values[f];if(g){let h=g.get(p);if(h)return h}else g=this._values[f]=new Map;g.set(p,d);let m=this._scope[f]||(this._scope[f]=[]),S=m.length;return m[S]=l.ref,d.setValue(l,{property:f,itemIndex:S}),d}getValue(c,l){let u=this._values[c];if(u)return u.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,u=>{if(u.scopePath===void 0)throw new Error(`CodeGen: name "${u}" has no value`);return (0, e._)`${c}${u.scopePath}`})}scopeCode(c=this._values,l,u){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},l,u)}_reduceValues(c,l,u={},d){let f=e.nil;for(let p in c){let g=c[p];if(!g)continue;let m=u[p]=u[p]||new Map;g.forEach(S=>{if(m.has(S))return;m.set(S,i.Started);let h=l(S);if(h){let v=this.opts.es5?t.varKinds.var:t.varKinds.const;f=(0, e._)`${f}${v} ${S} = ${h};${this.opts._n}`;}else if(h=d?.(S))f=(0, e._)`${f}${h}${this.opts._n}`;else throw new r(S);m.set(S,i.Completed);});}return f}};t.ValueScope=a;})),Re=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let e=Xd(),r=ST();var i=Xd();Object.defineProperty(t,"_",{enumerable:true,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return i.Name}});var n=ST();Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return n.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(w,C){return this}},o=class extends s{constructor(w,C,L){super(),this.varKind=w,this.name=C,this.rhs=L;}render({es5:w,_n:C}){let L=w?r.varKinds.var:this.varKind,ee=this.rhs===void 0?"":` = ${this.rhs}`;return `${L} ${this.name}${ee};`+C}optimizeNames(w,C){if(w[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,w,C)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(w,C,L){super(),this.lhs=w,this.rhs=C,this.sideEffects=L;}render({_n:w}){return `${this.lhs} = ${this.rhs};`+w}optimizeNames(w,C){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,w,C),this}get names(){return j(this.lhs instanceof e.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(w,C,L,ee){super(w,L,ee),this.op=C;}render({_n:w}){return `${this.lhs} ${this.op}= ${this.rhs};`+w}},l=class extends s{constructor(w){super(),this.label=w,this.names={};}render({_n:w}){return `${this.label}:`+w}},u=class extends s{constructor(w){super(),this.label=w,this.names={};}render({_n:w}){return `break${this.label?` ${this.label}`:""};`+w}},d=class extends s{constructor(w){super(),this.error=w;}render({_n:w}){return `throw ${this.error};`+w}get names(){return this.error.names}},f=class extends s{constructor(w){super(),this.code=w;}render({_n:w}){return `${this.code};`+w}optimizeNodes(){return `${this.code}`?this:void 0}optimizeNames(w,C){return this.code=G(this.code,w,C),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}},p=class extends s{constructor(w=[]){super(),this.nodes=w;}render(w){return this.nodes.reduce((C,L)=>C+L.render(w),"")}optimizeNodes(){let{nodes:w}=this,C=w.length;for(;C--;){let L=w[C].optimizeNodes();Array.isArray(L)?w.splice(C,1,...L):L?w[C]=L:w.splice(C,1);}return w.length>0?this:void 0}optimizeNames(w,C){let{nodes:L}=this,ee=L.length;for(;ee--;){let ue=L[ee];ue.optimizeNames(w,C)||(Q(w,ue.names),L.splice(ee,1));}return L.length>0?this:void 0}get names(){return this.nodes.reduce((w,C)=>k(w,C.names),{})}},g=class extends p{render(w){return "{"+w._n+super.render(w)+"}"+w._n}},m=class extends p{},S=class extends g{};S.kind="else";var h=class Zd extends g{constructor(C,L){super(L),this.condition=C;}render(C){let L=`if(${this.condition})`+super.render(C);return this.else&&(L+="else "+this.else.render(C)),L}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===true)return this.nodes;let L=this.else;if(L){let ee=L.optimizeNodes();L=this.else=Array.isArray(ee)?new S(ee):ee;}if(L)return C===false?L instanceof Zd?L:L.nodes:this.nodes.length?this:new Zd(Se(C),L instanceof Zd?[L]:L.nodes);if(!(C===false||!this.nodes.length))return this}optimizeNames(C,L){var ee;if(this.else=(ee=this.else)===null||ee===void 0?void 0:ee.optimizeNames(C,L),!!(super.optimizeNames(C,L)||this.else))return this.condition=G(this.condition,C,L),this}get names(){let C=super.names;return j(C,this.condition),this.else&&k(C,this.else.names),C}};h.kind="if";var v=class extends g{};v.kind="for";var _=class extends v{constructor(w){super(),this.iteration=w;}render(w){return `for(${this.iteration})`+super.render(w)}optimizeNames(w,C){if(super.optimizeNames(w,C))return this.iteration=G(this.iteration,w,C),this}get names(){return k(super.names,this.iteration.names)}},y=class extends v{constructor(w,C,L,ee){super(),this.varKind=w,this.name=C,this.from=L,this.to=ee;}render(w){let C=w.es5?r.varKinds.var:this.varKind,{name:L,from:ee,to:ue}=this;return `for(${C} ${L}=${ee}; ${L}<${ue}; ${L}++)`+super.render(w)}get names(){return j(j(super.names,this.from),this.to)}},R=class extends v{constructor(w,C,L,ee){super(),this.loop=w,this.varKind=C,this.name=L,this.iterable=ee;}render(w){return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,C){if(super.optimizeNames(w,C))return this.iterable=G(this.iterable,w,C),this}get names(){return k(super.names,this.iterable.names)}},T=class extends g{constructor(w,C,L){super(),this.name=w,this.args=C,this.async=L;}render(w){return `${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}};T.kind="func";var b=class extends p{render(w){return "return "+super.render(w)}};b.kind="return";var E=class extends g{render(w){let C="try"+super.render(w);return this.catch&&(C+=this.catch.render(w)),this.finally&&(C+=this.finally.render(w)),C}optimizeNodes(){var w,C;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(w,C){var L,ee;return super.optimizeNames(w,C),(L=this.catch)===null||L===void 0||L.optimizeNames(w,C),(ee=this.finally)===null||ee===void 0||ee.optimizeNames(w,C),this}get names(){let w=super.names;return this.catch&&k(w,this.catch.names),this.finally&&k(w,this.finally.names),w}},M=class extends g{constructor(w){super(),this.error=w;}render(w){return `catch(${this.error})`+super.render(w)}};M.kind="catch";var N=class extends g{render(w){return "finally"+super.render(w)}};N.kind="finally";var O=class{constructor(w,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
69
|
-
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new m];}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,C){let L=this._extScope.value(w,C);return (this._values[L.prefix]||(this._values[L.prefix]=new Set)).add(L),L}getScopeValue(w,C){return this._extScope.getValue(w,C)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,C,L,ee){let ue=this._scope.toName(C);return L!==void 0&&ee&&(this._constants[ue.str]=L),this._leafNode(new o(w,ue,L)),ue}const(w,C,L){return this._def(r.varKinds.const,w,C,L)}let(w,C,L){return this._def(r.varKinds.let,w,C,L)}var(w,C,L){return this._def(r.varKinds.var,w,C,L)}assign(w,C,L){return this._leafNode(new a(w,C,L))}add(w,C){return this._leafNode(new c(w,t.operators.ADD,C))}code(w){return typeof w=="function"?w():w!==e.nil&&this._leafNode(new f(w)),this}object(...w){let C=["{"];for(let[L,ee]of w)C.length>1&&C.push(","),C.push(L),(L!==ee||this.opts.es5)&&(C.push(":"),(0, e.addCodeArg)(C,ee));return C.push("}"),new e._Code(C)}if(w,C,L){if(this._blockNode(new h(w)),C&&L)this.code(C).else().code(L).endIf();else if(C)this.code(C).endIf();else if(L)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new h(w))}else(){return this._elseNode(new S)}endIf(){return this._endBlockNode(h,S)}_for(w,C){return this._blockNode(w),C&&this.code(C).endFor(),this}for(w,C){return this._for(new _(w),C)}forRange(w,C,L,ee,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){let Ee=this._scope.toName(w);return this._for(new y(ue,Ee,C,L),()=>ee(Ee))}forOf(w,C,L,ee=r.varKinds.const){let ue=this._scope.toName(w);if(this.opts.es5){let Ee=C instanceof e.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0, e._)`${Ee}.length`,pe=>{this.var(ue,(0, e._)`${Ee}[${pe}]`),L(ue);})}return this._for(new R("of",ee,ue,C),()=>L(ue))}forIn(w,C,L,ee=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0, e._)`Object.keys(${C})`,L);let ue=this._scope.toName(w);return this._for(new R("in",ee,ue,C),()=>L(ue))}endFor(){return this._endBlockNode(v)}label(w){return this._leafNode(new l(w))}break(w){return this._leafNode(new u(w))}return(w){let C=new b;if(this._blockNode(C),this.code(w),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(w,C,L){if(!C&&!L)throw new Error('CodeGen: "try" without "catch" and "finally"');let ee=new E;if(this._blockNode(ee),this.code(w),C){let ue=this.name("e");this._currNode=ee.catch=new M(ue),C(ue);}return L&&(this._currNode=ee.finally=new N,this.code(L)),this._endBlockNode(M,N)}throw(w){return this._leafNode(new d(w))}block(w,C){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(C),this}endBlock(w){let C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");let L=this._nodes.length-C;if(L<0||w!==void 0&&L!==w)throw new Error(`CodeGen: wrong number of nodes: ${L} vs ${w} expected`);return this._nodes.length=C,this}func(w,C=e.nil,L,ee){return this._blockNode(new T(w,C,L)),ee&&this.code(ee).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants);}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w);}_endBlockNode(w,C){let L=this._currNode;if(L instanceof w||C&&L instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${w.kind}/${C.kind}`:w.kind}"`)}_elseNode(w){let C=this._currNode;if(!(C instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=w,this}get _root(){return this._nodes[0]}get _currNode(){let w=this._nodes;return w[w.length-1]}set _currNode(w){let C=this._nodes;C[C.length-1]=w;}};t.CodeGen=O;function k(w,C){for(let L in C)w[L]=(w[L]||0)+(C[L]||0);return w}function j(w,C){return C instanceof e._CodeOrName?k(w,C.names):w}function G(w,C,L){if(w instanceof e.Name)return ee(w);if(!ue(w))return w;return new e._Code(w._items.reduce((Ee,pe)=>(pe instanceof e.Name&&(pe=ee(pe)),pe instanceof e._Code?Ee.push(...pe._items):Ee.push(pe),Ee),[]));function ee(Ee){let pe=L[Ee.str];return pe===void 0||C[Ee.str]!==1?Ee:(delete C[Ee.str],pe)}function ue(Ee){return Ee instanceof e._Code&&Ee._items.some(pe=>pe instanceof e.Name&&C[pe.str]===1&&L[pe.str]!==void 0)}}function Q(w,C){for(let L in C)w[L]=(w[L]||0)-(C[L]||0);}function Se(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0, e._)`!${q(w)}`}t.not=Se;let ye=U(t.operators.AND);function Fe(...w){return w.reduce(ye)}t.and=Fe;let ve=U(t.operators.OR);function P(...w){return w.reduce(ve)}t.or=P;function U(w){return (C,L)=>C===e.nil?L:L===e.nil?C:(0, e._)`${q(C)} ${w} ${q(L)}`}function q(w){return w instanceof e.Name?w:(0, e._)`(${w})`}})),ze=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let e=Re(),r=Xd();function i(T){let b={};for(let E of T)b[E]=true;return b}t.toHash=i;function n(T,b){return typeof b=="boolean"?b:Object.keys(b).length===0?true:(s(T,b),!o(b,T.self.RULES.all))}t.alwaysValidSchema=n;function s(T,b=T.schema){let{opts:E,self:M}=T;if(!E.strictSchema||typeof b=="boolean")return;let N=M.RULES.keywords;for(let O in b)N[O]||R(T,`unknown keyword: "${O}"`);}t.checkUnknownRules=s;function o(T,b){if(typeof T=="boolean")return !T;for(let E in T)if(b[E])return true;return false}t.schemaHasRules=o;function a(T,b){if(typeof T=="boolean")return !T;for(let E in T)if(E!=="$ref"&&b.all[E])return true;return false}t.schemaHasRulesButRef=a;function c({topSchemaRef:T,schemaPath:b},E,M,N){if(!N){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return (0, e._)`${E}`}return (0, e._)`${T}${b}${(0, e.getProperty)(M)}`}t.schemaRefOrVal=c;function l(T){return f(decodeURIComponent(T))}t.unescapeFragment=l;function u(T){return encodeURIComponent(d(T))}t.escapeFragment=u;function d(T){return typeof T=="number"?`${T}`:T.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=d;function f(T){return T.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=f;function p(T,b){if(Array.isArray(T))for(let E of T)b(E);else b(T);}t.eachItem=p;function g({mergeNames:T,mergeToName:b,mergeValues:E,resultToName:M}){return (N,O,k,j)=>{let G=k===void 0?O:k instanceof e.Name?(O instanceof e.Name?T(N,O,k):b(N,O,k),k):O instanceof e.Name?(b(N,k,O),O):E(O,k);return j===e.Name&&!(G instanceof e.Name)?M(N,G):G}}t.mergeEvaluated={props:g({mergeNames:(T,b,E)=>T.if((0, e._)`${E} !== true && ${b} !== undefined`,()=>{T.if((0, e._)`${b} === true`,()=>T.assign(E,true),()=>T.assign(E,(0, e._)`${E} || {}`).code((0, e._)`Object.assign(${E}, ${b})`));}),mergeToName:(T,b,E)=>T.if((0, e._)`${E} !== true`,()=>{b===true?T.assign(E,true):(T.assign(E,(0, e._)`${E} || {}`),S(T,E,b));}),mergeValues:(T,b)=>T===true?true:{...T,...b},resultToName:m}),items:g({mergeNames:(T,b,E)=>T.if((0, e._)`${E} !== true && ${b} !== undefined`,()=>T.assign(E,(0, e._)`${b} === true ? true : ${E} > ${b} ? ${E} : ${b}`)),mergeToName:(T,b,E)=>T.if((0, e._)`${E} !== true`,()=>T.assign(E,b===true?true:(0, e._)`${E} > ${b} ? ${E} : ${b}`)),mergeValues:(T,b)=>T===true?true:Math.max(T,b),resultToName:(T,b)=>T.var("items",b)})};function m(T,b){if(b===true)return T.var("props",true);let E=T.var("props",(0, e._)`{}`);return b!==void 0&&S(T,E,b),E}t.evaluatedPropsToName=m;function S(T,b,E){Object.keys(E).forEach(M=>T.assign((0, e._)`${b}${(0, e.getProperty)(M)}`,true));}t.setEvaluated=S;let h={};function v(T,b){return T.scopeValue("func",{ref:b,code:h[b.code]||(h[b.code]=new r._Code(b.code))})}t.useFunc=v;var _;(function(T){T[T.Num=0]="Num",T[T.Str=1]="Str";})(_||(t.Type=_={}));function y(T,b,E){if(T instanceof e.Name){let M=b===_.Num;return E?M?(0, e._)`"[" + ${T} + "]"`:(0, e._)`"['" + ${T} + "']"`:M?(0, e._)`"/" + ${T}`:(0, e._)`"/" + ${T}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0, e.getProperty)(T).toString():"/"+d(T)}t.getErrorPath=y;function R(T,b,E=T.opts.strictSchema){if(E){if(b=`strict mode: ${b}`,E===true)throw new Error(b);T.self.logger.warn(b);}}t.checkStrictMode=R;})),ln=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r;})),Yd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let e=Re(),r=ze(),i=ln();t.keywordError={message:({keyword:S})=>(0, e.str)`must pass "${S}" keyword validation`},t.keyword$DataError={message:({keyword:S,schemaType:h})=>h?(0, e.str)`"${S}" keyword must be ${h} ($data)`:(0, e.str)`"${S}" keyword is invalid ($data)`};function n(S,h=t.keywordError,v,_){let{it:y}=S,{gen:R,compositeRule:T,allErrors:b}=y,E=d(S,h,v);_??(T||b)?c(R,E):l(y,(0, e._)`[${E}]`);}t.reportError=n;function s(S,h=t.keywordError,v){let{it:_}=S,{gen:y,compositeRule:R,allErrors:T}=_;c(y,d(S,h,v)),R||T||l(_,i.default.vErrors);}t.reportExtraError=s;function o(S,h){S.assign(i.default.errors,h),S.if((0, e._)`${i.default.vErrors} !== null`,()=>S.if(h,()=>S.assign((0, e._)`${i.default.vErrors}.length`,h),()=>S.assign(i.default.vErrors,null)));}t.resetErrorsCount=o;function a({gen:S,keyword:h,schemaValue:v,data:_,errsCount:y,it:R}){if(y===void 0)throw new Error("ajv implementation error");let T=S.name("err");S.forRange("i",y,i.default.errors,b=>{S.const(T,(0, e._)`${i.default.vErrors}[${b}]`),S.if((0, e._)`${T}.instancePath === undefined`,()=>S.assign((0, e._)`${T}.instancePath`,(0, e.strConcat)(i.default.instancePath,R.errorPath))),S.assign((0, e._)`${T}.schemaPath`,(0, e.str)`${R.errSchemaPath}/${h}`),R.opts.verbose&&(S.assign((0, e._)`${T}.schema`,v),S.assign((0, e._)`${T}.data`,_));});}t.extendErrors=a;function c(S,h){let v=S.const("err",h);S.if((0, e._)`${i.default.vErrors} === null`,()=>S.assign(i.default.vErrors,(0, e._)`[${v}]`),(0, e._)`${i.default.vErrors}.push(${v})`),S.code((0, e._)`${i.default.errors}++`);}function l(S,h){let{gen:v,validateName:_,schemaEnv:y}=S;y.$async?v.throw((0, e._)`new ${S.ValidationError}(${h})`):(v.assign((0, e._)`${_}.errors`,h),v.return(false));}let u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(S,h,v){let{createErrors:_}=S.it;return _===false?(0, e._)`{}`:f(S,h,v)}function f(S,h,v={}){let{gen:_,it:y}=S,R=[p(y,v),g(S,v)];return m(S,h,R),_.object(...R)}function p({errorPath:S},{instancePath:h}){let v=h?(0, e.str)`${S}${(0, r.getErrorPath)(h,r.Type.Str)}`:S;return [i.default.instancePath,(0, e.strConcat)(i.default.instancePath,v)]}function g({keyword:S,it:{errSchemaPath:h}},{schemaPath:v,parentSchema:_}){let y=_?h:(0, e.str)`${h}/${S}`;return v&&(y=(0, e.str)`${y}${(0, r.getErrorPath)(v,r.Type.Str)}`),[u.schemaPath,y]}function m(S,{params:h,message:v},_){let{keyword:y,data:R,schemaValue:T,it:b}=S,{opts:E,propertyName:M,topSchemaRef:N,schemaPath:O}=b;_.push([u.keyword,y],[u.params,typeof h=="function"?h(S):h||(0, e._)`{}`]),E.messages&&_.push([u.message,typeof v=="function"?v(S):v]),E.verbose&&_.push([u.schema,T],[u.parentSchema,(0, e._)`${N}${O}`],[i.default.data,R]),M&&_.push([u.propertyName,M]);}})),j1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let e=Yd(),r=Re(),i=ln(),n={message:"boolean schema is false"};function s(c){let{gen:l,schema:u,validateName:d}=c;u===false?a(c,false):typeof u=="object"&&u.$async===true?l.return(i.default.data):(l.assign((0, r._)`${d}.errors`,null),l.return(true));}t.topBoolOrEmptySchema=s;function o(c,l){let{gen:u,schema:d}=c;d===false?(u.var(l,false),a(c)):u.var(l,true);}t.boolOrEmptySchema=o;function a(c,l){let{gen:u,data:d}=c,f={gen:u,keyword:"false schema",data:d,schema:false,schemaCode:false,schemaValue:false,params:{},it:c};(0, e.reportError)(f,n,void 0,l);}})),xT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getRules=t.isJSONType=void 0;let e=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&e.has(n)}t.isJSONType=r;function i(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return {types:{...n,integer:true,boolean:true,null:true},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=i;})),bT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){let a=s.RULES.types[o];return a&&a!==true&&r(n,a)}t.schemaHasRulesForType=e;function r(n,s){return s.rules.some(o=>i(n,o))}t.shouldUseGroup=r;function i(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(a=>n[a]!==void 0))}t.shouldUseRule=i;})),Jd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let e=xT(),r=bT(),i=Yd(),n=Re(),s=ze();var o;(function(_){_[_.Correct=0]="Correct",_[_.Wrong=1]="Wrong";})(o||(t.DataType=o={}));function a(_){let y=c(_.type);if(y.includes("null")){if(_.nullable===false)throw new Error("type: null contradicts nullable: false")}else {if(!y.length&&_.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');_.nullable===true&&y.push("null");}return y}t.getSchemaTypes=a;function c(_){let y=Array.isArray(_)?_:_?[_]:[];if(y.every(e.isJSONType))return y;throw new Error("type must be JSONType or JSONType[]: "+y.join(","))}t.getJSONTypes=c;function l(_,y){let{gen:R,data:T,opts:b}=_,E=d(y,b.coerceTypes),M=y.length>0&&!(E.length===0&&y.length===1&&(0, r.schemaHasRulesForType)(_,y[0]));if(M){let N=m(y,T,b.strictNumbers,o.Wrong);R.if(N,()=>{E.length?f(_,y,E):h(_);});}return M}t.coerceAndCheckDataType=l;let u=new Set(["string","number","integer","boolean","null"]);function d(_,y){return y?_.filter(R=>u.has(R)||y==="array"&&R==="array"):[]}function f(_,y,R){let{gen:T,data:b,opts:E}=_,M=T.let("dataType",(0, n._)`typeof ${b}`),N=T.let("coerced",(0, n._)`undefined`);E.coerceTypes==="array"&&T.if((0, n._)`${M} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>T.assign(b,(0, n._)`${b}[0]`).assign(M,(0, n._)`typeof ${b}`).if(m(y,b,E.strictNumbers),()=>T.assign(N,b))),T.if((0, n._)`${N} !== undefined`);for(let k of R)(u.has(k)||k==="array"&&E.coerceTypes==="array")&&O(k);T.else(),h(_),T.endIf(),T.if((0, n._)`${N} !== undefined`,()=>{T.assign(b,N),p(_,N);});function O(k){switch(k){case "string":T.elseIf((0, n._)`${M} == "number" || ${M} == "boolean"`).assign(N,(0, n._)`"" + ${b}`).elseIf((0, n._)`${b} === null`).assign(N,(0, n._)`""`);return;case "number":T.elseIf((0, n._)`${M} == "boolean" || ${b} === null
|
|
66
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let o of t.seen.entries()){let a=o[1];if(e===o[0]){s(o);continue}if(t.external){let l=t.external.registry.get(o[0])?.id;if(e!==o[0]&&l){s(o);continue}}if(t.metadataRegistry.get(o[0])?.id){s(o);continue}if(a.cycle){s(o);continue}if(a.count>1&&t.reused==="ref"){s(o);continue}}}function rr(t,e){let r=t.seen.get(e);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=a=>{let c=t.seen.get(a);if(c.ref===null)return;let l=c.def??c.schema,u={...l},d=c.ref;if(c.ref=null,d){i(d);let p=t.seen.get(d),g=p.schema;if(g.$ref&&(t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,u),a._zod.parent===d)for(let S in l)S==="$ref"||S==="allOf"||S in u||delete l[S];if(g.$ref&&p.def)for(let S in l)S==="$ref"||S==="allOf"||S in p.def&&JSON.stringify(l[S])===JSON.stringify(p.def[S])&&delete l[S];}let f=a._zod.parent;if(f&&f!==d){i(f);let p=t.seen.get(f);if(p?.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(let g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g];}t.override({zodSchema:a,jsonSchema:l,path:c.path??[]});};for(let a of [...t.seen.entries()].reverse())i(a[0]);let n={};if(t.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":t.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":t.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":t.target,t.external?.uri){let a=t.external.registry.get(e)?.id;if(!a)throw new Error("Schema is missing an `id` property");n.$id=t.external.uri(a);}Object.assign(n,r.def??r.schema);let s=t.metadataRegistry.get(e)?.id;s!==void 0&&n.id===s&&delete n.id;let o=t.external?.defs??{};for(let a of t.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def);}t.external||Object.keys(o).length>0&&(t.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...e["~standard"],jsonSchema:{input:ts(e,"input",t.processors),output:ts(e,"output",t.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function At(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return false;r.seen.add(t);let i=t._zod.def;if(i.type==="transform")return true;if(i.type==="array")return At(i.element,r);if(i.type==="set")return At(i.valueType,r);if(i.type==="lazy")return At(i.getter(),r);if(i.type==="promise"||i.type==="optional"||i.type==="nonoptional"||i.type==="nullable"||i.type==="readonly"||i.type==="default"||i.type==="prefault")return At(i.innerType,r);if(i.type==="intersection")return At(i.left,r)||At(i.right,r);if(i.type==="record"||i.type==="map")return At(i.keyType,r)||At(i.valueType,r);if(i.type==="pipe")return t._zod.traits.has("$ZodCodec")?true:At(i.in,r)||At(i.out,r);if(i.type==="object"){for(let n in i.shape)if(At(i.shape[n],r))return true;return false}if(i.type==="union"){for(let n of i.options)if(At(n,r))return true;return false}if(i.type==="tuple"){for(let n of i.items)if(At(n,r))return true;return !!(i.rest&&At(i.rest,r))}return false}var tg=(t,e={})=>r=>{let i=tr({...r,processors:e});return Fe(t,i),nr(i,t),rr(i,t)},ts=(t,e,r={})=>i=>{let{libraryOptions:n,target:s}=i??{},o=tr({...n??{},target:s,io:e,processors:r});return Fe(t,o),nr(o,t),rr(o,t)};var sI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ng=(t,e,r,i)=>{let n=r;n.type="string";let{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:l}=t._zod.bag;if(typeof s=="number"&&(n.minLength=s),typeof o=="number"&&(n.maxLength=o),a&&(n.format=sI[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),l&&(n.contentEncoding=l),c&&c.size>0){let u=[...c];u.length===1?n.pattern=u[0].source:u.length>1&&(n.allOf=[...u.map(d=>({...e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))]);}},rg=(t,e,r,i)=>{let n=r,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=t._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),f=typeof l=="number"&&l<=(o??Number.POSITIVE_INFINITY),p=e.target==="draft-04"||e.target==="openapi-3.0";d?p?(n.minimum=u,n.exclusiveMinimum=true):n.exclusiveMinimum=u:typeof s=="number"&&(n.minimum=s),f?p?(n.maximum=l,n.exclusiveMaximum=true):n.exclusiveMaximum=l:typeof o=="number"&&(n.maximum=o),typeof c=="number"&&(n.multipleOf=c);},ig=(t,e,r,i)=>{r.type="boolean";},sg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},og=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},ag=(t,e,r,i)=>{e.target==="openapi-3.0"?(r.type="string",r.nullable=true,r.enum=[null]):r.type="null";},cg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},lg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},ug=(t,e,r,i)=>{r.not={};},dg=(t,e,r,i)=>{},hg=(t,e,r,i)=>{},fg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},pg=(t,e,r,i)=>{let n=t._zod.def,s=mo(n.entries);s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),r.enum=s;},mg=(t,e,r,i)=>{let n=t._zod.def,s=[];for(let o of n.values)if(o===void 0){if(e.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(e.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o));}else s.push(o);if(s.length!==0)if(s.length===1){let o=s[0];r.type=o===null?"null":typeof o,e.target==="draft-04"||e.target==="openapi-3.0"?r.enum=[o]:r.const=o;}else s.every(o=>typeof o=="number")&&(r.type="number"),s.every(o=>typeof o=="string")&&(r.type="string"),s.every(o=>typeof o=="boolean")&&(r.type="boolean"),s.every(o=>o===null)&&(r.type="null"),r.enum=s;},gg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},_g=(t,e,r,i)=>{let n=r,s=t._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");n.type="string",n.pattern=s.source;},vg=(t,e,r,i)=>{let n=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:a,mime:c}=t._zod.bag;o!==void 0&&(s.minLength=o),a!==void 0&&(s.maxLength=a),c?c.length===1?(s.contentMediaType=c[0],Object.assign(n,s)):(Object.assign(n,s),n.anyOf=c.map(l=>({contentMediaType:l}))):Object.assign(n,s);},yg=(t,e,r,i)=>{r.type="boolean";},Sg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},xg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},bg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},Tg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},Rg=(t,e,r,i)=>{if(e.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Eg=(t,e,r,i)=>{let n=r,s=t._zod.def,{minimum:o,maximum:a}=t._zod.bag;typeof o=="number"&&(n.minItems=o),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=Fe(s.element,e,{...i,path:[...i.path,"items"]});},wg=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="object",n.properties={};let o=s.shape;for(let l in o)n.properties[l]=Fe(o[l],e,{...i,path:[...i.path,"properties",l]});let a=new Set(Object.keys(o)),c=new Set([...a].filter(l=>{let u=s.shape[l]._zod;return e.io==="input"?u.optin===void 0:u.optout===void 0}));c.size>0&&(n.required=Array.from(c)),s.catchall?._zod.def.type==="never"?n.additionalProperties=false:s.catchall?s.catchall&&(n.additionalProperties=Fe(s.catchall,e,{...i,path:[...i.path,"additionalProperties"]})):e.io==="output"&&(n.additionalProperties=false);},ul=(t,e,r,i)=>{let n=t._zod.def,s=n.inclusive===false,o=n.options.map((a,c)=>Fe(a,e,{...i,path:[...i.path,s?"oneOf":"anyOf",c]}));s?r.oneOf=o:r.anyOf=o;},Mg=(t,e,r,i)=>{let n=t._zod.def,s=Fe(n.left,e,{...i,path:[...i.path,"allOf",0]}),o=Fe(n.right,e,{...i,path:[...i.path,"allOf",1]}),a=l=>"allOf"in l&&Object.keys(l).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];r.allOf=c;},Ag=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="array";let o=e.target==="draft-2020-12"?"prefixItems":"items",a=e.target==="draft-2020-12"||e.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((f,p)=>Fe(f,e,{...i,path:[...i.path,o,p]})),l=s.rest?Fe(s.rest,e,{...i,path:[...i.path,a,...e.target==="openapi-3.0"?[s.items.length]:[]]}):null;e.target==="draft-2020-12"?(n.prefixItems=c,l&&(n.items=l)):e.target==="openapi-3.0"?(n.items={anyOf:c},l&&n.items.anyOf.push(l),n.minItems=c.length,l||(n.maxItems=c.length)):(n.items=c,l&&(n.additionalItems=l));let{minimum:u,maximum:d}=t._zod.bag;typeof u=="number"&&(n.minItems=u),typeof d=="number"&&(n.maxItems=d);},Ig=(t,e,r,i)=>{let n=r,s=t._zod.def;n.type="object";let o=s.keyType,c=o._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){let u=Fe(s.valueType,e,{...i,path:[...i.path,"patternProperties","*"]});n.patternProperties={};for(let d of c)n.patternProperties[d.source]=u;}else (e.target==="draft-07"||e.target==="draft-2020-12")&&(n.propertyNames=Fe(s.keyType,e,{...i,path:[...i.path,"propertyNames"]})),n.additionalProperties=Fe(s.valueType,e,{...i,path:[...i.path,"additionalProperties"]});let l=o._zod.values;if(l){let u=[...l].filter(d=>typeof d=="string"||typeof d=="number");u.length>0&&(n.required=u);}},Cg=(t,e,r,i)=>{let n=t._zod.def,s=Fe(n.innerType,e,i),o=e.seen.get(t);e.target==="openapi-3.0"?(o.ref=n.innerType,r.nullable=true):r.anyOf=[s,{type:"null"}];},Pg=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},Ng=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue));},Og=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,e.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(n.defaultValue)));},zg=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;let o;try{o=n.catchValue(void 0);}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=o;},$g=(t,e,r,i)=>{let n=t._zod.def,s=n.in._zod.traits.has("$ZodTransform"),o=e.io==="input"?s?n.out:n.in:n.out;Fe(o,e,i);let a=e.seen.get(t);a.ref=o;},Dg=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType,r.readOnly=true;},Lg=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},dl=(t,e,r,i)=>{let n=t._zod.def;Fe(n.innerType,e,i);let s=e.seen.get(t);s.ref=n.innerType;},kg=(t,e,r,i)=>{let n=t._zod.innerType;Fe(n,e,i);let s=e.seen.get(t);s.ref=n;},ll={string:ng,number:rg,boolean:ig,bigint:sg,symbol:og,null:ag,undefined:cg,void:lg,never:ug,any:dg,unknown:hg,date:fg,enum:pg,literal:mg,nan:gg,template_literal:_g,file:vg,success:yg,custom:Sg,function:xg,transform:bg,map:Tg,set:Rg,array:Eg,object:wg,union:ul,intersection:Mg,tuple:Ag,record:Ig,nullable:Cg,nonoptional:Pg,default:Ng,prefault:Og,catch:zg,pipe:$g,readonly:Dg,promise:Lg,optional:dl,lazy:kg};function ci(t,e){if("_idmap"in t){let i=t,n=tr({...e,processors:ll}),s={};for(let c of i._idmap.entries()){let[l,u]=c;Fe(u,n);}let o={},a={registry:i,uri:e?.uri,defs:s};n.external=a;for(let c of i._idmap.entries()){let[l,u]=c;nr(n,u),o[l]=rr(n,u);}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:s};}return {schemas:o}}let r=tr({...e,processors:ll});return Fe(t,r),nr(r,t),rr(r,t)}var hl=class{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e;}get seen(){return this.ctx.seen}constructor(e){let r=e?.target??"draft-2020-12";r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),this.ctx=tr({processors:ll,target:r,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}});}process(e,r={path:[],schemaPath:[]}){return Fe(e,this.ctx,r)}emit(e,r){r&&(r.cycles&&(this.ctx.cycles=r.cycles),r.reused&&(this.ctx.reused=r.reused),r.external&&(this.ctx.external=r.external)),nr(this.ctx,e);let i=rr(this.ctx,e),{"~standard":n,...s}=i;return s}};var cx={};var Oo={};An(Oo,{ZodAny:()=>i_,ZodArray:()=>c_,ZodBase64:()=>zl,ZodBase64URL:()=>$l,ZodBigInt:()=>ls,ZodBigIntFormat:()=>kl,ZodBoolean:()=>cs,ZodCIDRv4:()=>Nl,ZodCIDRv6:()=>Ol,ZodCUID:()=>El,ZodCUID2:()=>wl,ZodCatch:()=>A_,ZodCodec:()=>jo,ZodCustom:()=>Go,ZodCustomStringFormat:()=>os,ZodDate:()=>Uo,ZodDefault:()=>b_,ZodDiscriminatedUnion:()=>u_,ZodE164:()=>Dl,ZodEmail:()=>xl,ZodEmoji:()=>Tl,ZodEnum:()=>rs,ZodExactOptional:()=>y_,ZodFile:()=>__,ZodFunction:()=>L_,ZodGUID:()=>$o,ZodIPv4:()=>Cl,ZodIPv6:()=>Pl,ZodIntersection:()=>d_,ZodJWT:()=>Ll,ZodKSUID:()=>Il,ZodLazy:()=>$_,ZodLiteral:()=>g_,ZodMAC:()=>e_,ZodMap:()=>p_,ZodNaN:()=>C_,ZodNanoID:()=>Rl,ZodNever:()=>o_,ZodNonOptional:()=>jl,ZodNull:()=>r_,ZodNullable:()=>x_,ZodNumber:()=>as,ZodNumberFormat:()=>li,ZodObject:()=>Fo,ZodOptional:()=>Vl,ZodPipe:()=>Vo,ZodPrefault:()=>R_,ZodPreprocess:()=>P_,ZodPromise:()=>D_,ZodReadonly:()=>N_,ZodRecord:()=>ns,ZodSet:()=>m_,ZodString:()=>is,ZodStringFormat:()=>Ge,ZodSuccess:()=>M_,ZodSymbol:()=>t_,ZodTemplateLiteral:()=>z_,ZodTransform:()=>v_,ZodTuple:()=>h_,ZodType:()=>Ae,ZodULID:()=>Ml,ZodURL:()=>ko,ZodUUID:()=>Sn,ZodUndefined:()=>n_,ZodUnion:()=>Bo,ZodUnknown:()=>s_,ZodVoid:()=>a_,ZodXID:()=>Al,ZodXor:()=>l_,_ZodString:()=>Sl,_default:()=>T_,_function:()=>ub,any:()=>Ul,array:()=>$,base64:()=>Ix,base64url:()=>Cx,bigint:()=>Bx,boolean:()=>ie,catch:()=>I_,check:()=>db,cidrv4:()=>Mx,cidrv6:()=>Ax,codec:()=>ob,cuid:()=>yx,cuid2:()=>Sx,custom:()=>hb,date:()=>Wx,describe:()=>fb,discriminatedUnion:()=>ir,e164:()=>Px,email:()=>bl,emoji:()=>_x,enum:()=>_e,exactOptional:()=>S_,file:()=>nb,float32:()=>Lx,float64:()=>kx,function:()=>ub,guid:()=>dx,hash:()=>Dx,hex:()=>$x,hostname:()=>zx,httpUrl:()=>gx,instanceof:()=>mb,int:()=>vl,int32:()=>Ux,int64:()=>Vx,intersection:()=>cn,invertCodec:()=>ab,ipv4:()=>Rx,ipv6:()=>wx,json:()=>_b,jwt:()=>Nx,keyof:()=>Kx,ksuid:()=>Tx,lazy:()=>sr,literal:()=>D,looseObject:()=>de,looseRecord:()=>Yx,mac:()=>Ex,map:()=>Qx,meta:()=>pb,nan:()=>sb,nanoid:()=>vx,nativeEnum:()=>tb,never:()=>Fl,nonoptional:()=>w_,null:()=>xn,nullable:()=>Do,nullish:()=>rb,number:()=>K,object:()=>I,optional:()=>le,partialRecord:()=>Jx,pipe:()=>yl,prefault:()=>E_,preprocess:()=>Nn,promise:()=>lb,readonly:()=>O_,record:()=>re,refine:()=>k_,set:()=>eb,strictObject:()=>Zx,string:()=>x,stringFormat:()=>Ox,stringbool:()=>gb,success:()=>ib,superRefine:()=>U_,symbol:()=>Gx,templateLiteral:()=>cb,transform:()=>Bl,tuple:()=>f_,uint32:()=>Fx,uint64:()=>jx,ulid:()=>xx,undefined:()=>Hx,union:()=>oe,unknown:()=>ce,url:()=>ss,uuid:()=>hx,uuidv4:()=>fx,uuidv6:()=>px,uuidv7:()=>mx,void:()=>qx,xid:()=>bx,xor:()=>Xx});var fl={};An(fl,{endsWith:()=>Wi,gt:()=>vn,gte:()=>Mt,includes:()=>Hi,length:()=>ai,lowercase:()=>ji,lt:()=>_n,lte:()=>Vt,maxLength:()=>oi,maxSize:()=>er,mime:()=>Ki,minLength:()=>Cn,minSize:()=>yn,multipleOf:()=>Qn,negative:()=>sl,nonnegative:()=>al,nonpositive:()=>ol,normalize:()=>Zi,overwrite:()=>an,positive:()=>il,property:()=>cl,regex:()=>Vi,size:()=>si,slugify:()=>Qi,startsWith:()=>qi,toLowerCase:()=>Ji,toUpperCase:()=>Yi,trim:()=>Xi,uppercase:()=>Gi});var jt={};An(jt,{ZodISODate:()=>ml,ZodISODateTime:()=>pl,ZodISODuration:()=>_l,ZodISOTime:()=>gl,date:()=>Fg,datetime:()=>Ug,duration:()=>Vg,time:()=>Bg});var pl=z("ZodISODateTime",(t,e)=>{gp.init(t,e),Ge.init(t,e);});function Ug(t){return Sm(pl,t)}var ml=z("ZodISODate",(t,e)=>{_p.init(t,e),Ge.init(t,e);});function Fg(t){return xm(ml,t)}var gl=z("ZodISOTime",(t,e)=>{vp.init(t,e),Ge.init(t,e);});function Bg(t){return bm(gl,t)}var _l=z("ZodISODuration",(t,e)=>{yp.init(t,e),Ge.init(t,e);});function Vg(t){return Tm(_l,t)}var lx=(t,e)=>{So.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>bo(t,r)},flatten:{value:r=>xo(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,Oi,2);}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,Oi,2);}},isEmpty:{get(){return t.issues.length===0}}});},aI=z("ZodError",lx),Lt=z("ZodError",lx,{Parent:Error});var jg=Di(Lt),Gg=Li(Lt),zo=ki(Lt),Hg=Ui(Lt),qg=hc(Lt),Wg=fc(Lt),Kg=pc(Lt),Zg=mc(Lt),Xg=gc(Lt),Jg=_c(Lt),Yg=vc(Lt),Qg=yc(Lt);var ux=new WeakMap;function Lo(t,e,r){let i=Object.getPrototypeOf(t),n=ux.get(i);if(n||(n=new Set,ux.set(i,n)),!n.has(e)){n.add(e);for(let s in r){let o=r[s];Object.defineProperty(i,s,{configurable:true,enumerable:false,get(){let a=o.bind(this);return Object.defineProperty(this,s,{configurable:true,writable:true,enumerable:true,value:a}),a},set(a){Object.defineProperty(this,s,{configurable:true,writable:true,enumerable:true,value:a});}});}}}var Ae=z("ZodType",(t,e)=>(Se.init(t,e),Object.assign(t["~standard"],{jsonSchema:{input:ts(t,"input"),output:ts(t,"output")}}),t.toJSONSchema=tg(t,{}),t.def=e,t.type=e.type,Object.defineProperty(t,"_def",{value:e}),t.parse=(r,i)=>jg(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>zo(t,r,i),t.parseAsync=async(r,i)=>Gg(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>Hg(t,r,i),t.spa=t.safeParseAsync,t.encode=(r,i)=>qg(t,r,i),t.decode=(r,i)=>Wg(t,r,i),t.encodeAsync=async(r,i)=>Kg(t,r,i),t.decodeAsync=async(r,i)=>Zg(t,r,i),t.safeEncode=(r,i)=>Xg(t,r,i),t.safeDecode=(r,i)=>Jg(t,r,i),t.safeEncodeAsync=async(r,i)=>Yg(t,r,i),t.safeDecodeAsync=async(r,i)=>Qg(t,r,i),Lo(t,"ZodType",{check(...r){let i=this.def;return this.clone(J.mergeDefs(i,{checks:[...i.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:true})},with(...r){return this.check(...r)},clone(r,i){return Et(this,r,i)},brand(){return this},register(r,i){return r.add(this,i),this},refine(r,i){return this.check(k_(r,i))},superRefine(r,i){return this.check(U_(r,i))},overwrite(r){return this.check(an(r))},optional(){return le(this)},exactOptional(){return S_(this)},nullable(){return Do(this)},nullish(){return le(Do(this))},nonoptional(r){return w_(this,r)},array(){return $(this)},or(r){return oe([this,r])},and(r){return cn(this,r)},transform(r){return yl(this,Bl(r))},default(r){return T_(this,r)},prefault(r){return E_(this,r)},catch(r){return I_(this,r)},pipe(r){return yl(this,r)},readonly(){return O_(this)},describe(r){let i=this.clone();return pt.add(i,{description:r}),i},meta(...r){if(r.length===0)return pt.get(this);let i=this.clone();return pt.add(i,r[0]),i},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(t,"description",{get(){return pt.get(t)?.description},configurable:true}),t)),Sl=z("_ZodString",(t,e)=>{ii.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>ng(t,i,n);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,Lo(t,"_ZodString",{regex(...i){return this.check(Vi(...i))},includes(...i){return this.check(Hi(...i))},startsWith(...i){return this.check(qi(...i))},endsWith(...i){return this.check(Wi(...i))},min(...i){return this.check(Cn(...i))},max(...i){return this.check(oi(...i))},length(...i){return this.check(ai(...i))},nonempty(...i){return this.check(Cn(1,...i))},lowercase(i){return this.check(ji(i))},uppercase(i){return this.check(Gi(i))},trim(){return this.check(Xi())},normalize(...i){return this.check(Zi(...i))},toLowerCase(){return this.check(Ji())},toUpperCase(){return this.check(Yi())},slugify(){return this.check(Qi())}});}),is=z("ZodString",(t,e)=>{ii.init(t,e),Sl.init(t,e),t.email=r=>t.check(kc(xl,r)),t.url=r=>t.check(No(ko,r)),t.jwt=r=>t.check(rl(Ll,r)),t.emoji=r=>t.check(jc(Tl,r)),t.guid=r=>t.check(Po($o,r)),t.uuid=r=>t.check(Uc(Sn,r)),t.uuidv4=r=>t.check(Fc(Sn,r)),t.uuidv6=r=>t.check(Bc(Sn,r)),t.uuidv7=r=>t.check(Vc(Sn,r)),t.nanoid=r=>t.check(Gc(Rl,r)),t.guid=r=>t.check(Po($o,r)),t.cuid=r=>t.check(Hc(El,r)),t.cuid2=r=>t.check(qc(wl,r)),t.ulid=r=>t.check(Wc(Ml,r)),t.base64=r=>t.check(el(zl,r)),t.base64url=r=>t.check(tl($l,r)),t.xid=r=>t.check(Kc(Al,r)),t.ksuid=r=>t.check(Zc(Il,r)),t.ipv4=r=>t.check(Xc(Cl,r)),t.ipv6=r=>t.check(Jc(Pl,r)),t.cidrv4=r=>t.check(Yc(Nl,r)),t.cidrv6=r=>t.check(Qc(Ol,r)),t.e164=r=>t.check(nl(Dl,r)),t.datetime=r=>t.check(Ug(r)),t.date=r=>t.check(Fg(r)),t.time=r=>t.check(Bg(r)),t.duration=r=>t.check(Vg(r));});function x(t){return gm(is,t)}var Ge=z("ZodStringFormat",(t,e)=>{je.init(t,e),Sl.init(t,e);}),xl=z("ZodEmail",(t,e)=>{ap.init(t,e),Ge.init(t,e);});function bl(t){return kc(xl,t)}var $o=z("ZodGUID",(t,e)=>{sp.init(t,e),Ge.init(t,e);});function dx(t){return Po($o,t)}var Sn=z("ZodUUID",(t,e)=>{op.init(t,e),Ge.init(t,e);});function hx(t){return Uc(Sn,t)}function fx(t){return Fc(Sn,t)}function px(t){return Bc(Sn,t)}function mx(t){return Vc(Sn,t)}var ko=z("ZodURL",(t,e)=>{cp.init(t,e),Ge.init(t,e);});function ss(t){return No(ko,t)}function gx(t){return No(ko,{protocol:Bt.httpProtocol,hostname:Bt.domain,...J.normalizeParams(t)})}var Tl=z("ZodEmoji",(t,e)=>{lp.init(t,e),Ge.init(t,e);});function _x(t){return jc(Tl,t)}var Rl=z("ZodNanoID",(t,e)=>{up.init(t,e),Ge.init(t,e);});function vx(t){return Gc(Rl,t)}var El=z("ZodCUID",(t,e)=>{dp.init(t,e),Ge.init(t,e);});function yx(t){return Hc(El,t)}var wl=z("ZodCUID2",(t,e)=>{hp.init(t,e),Ge.init(t,e);});function Sx(t){return qc(wl,t)}var Ml=z("ZodULID",(t,e)=>{fp.init(t,e),Ge.init(t,e);});function xx(t){return Wc(Ml,t)}var Al=z("ZodXID",(t,e)=>{pp.init(t,e),Ge.init(t,e);});function bx(t){return Kc(Al,t)}var Il=z("ZodKSUID",(t,e)=>{mp.init(t,e),Ge.init(t,e);});function Tx(t){return Zc(Il,t)}var Cl=z("ZodIPv4",(t,e)=>{Sp.init(t,e),Ge.init(t,e);});function Rx(t){return Xc(Cl,t)}var e_=z("ZodMAC",(t,e)=>{bp.init(t,e),Ge.init(t,e);});function Ex(t){return vm(e_,t)}var Pl=z("ZodIPv6",(t,e)=>{xp.init(t,e),Ge.init(t,e);});function wx(t){return Jc(Pl,t)}var Nl=z("ZodCIDRv4",(t,e)=>{Tp.init(t,e),Ge.init(t,e);});function Mx(t){return Yc(Nl,t)}var Ol=z("ZodCIDRv6",(t,e)=>{Rp.init(t,e),Ge.init(t,e);});function Ax(t){return Qc(Ol,t)}var zl=z("ZodBase64",(t,e)=>{wp.init(t,e),Ge.init(t,e);});function Ix(t){return el(zl,t)}var $l=z("ZodBase64URL",(t,e)=>{Mp.init(t,e),Ge.init(t,e);});function Cx(t){return tl($l,t)}var Dl=z("ZodE164",(t,e)=>{Ap.init(t,e),Ge.init(t,e);});function Px(t){return nl(Dl,t)}var Ll=z("ZodJWT",(t,e)=>{Ip.init(t,e),Ge.init(t,e);});function Nx(t){return rl(Ll,t)}var os=z("ZodCustomStringFormat",(t,e)=>{Cp.init(t,e),Ge.init(t,e);});function Ox(t,e,r={}){return es(os,t,e,r)}function zx(t){return es(os,"hostname",Bt.hostname,t)}function $x(t){return es(os,"hex",Bt.hex,t)}function Dx(t,e){let r=e?.enc??"hex",i=`${t}_${r}`,n=Bt[i];if(!n)throw new Error(`Unrecognized hash format: ${i}`);return es(os,i,n,e)}var as=z("ZodNumber",(t,e)=>{Ac.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>rg(t,i,n),Lo(t,"ZodNumber",{gt(i,n){return this.check(vn(i,n))},gte(i,n){return this.check(Mt(i,n))},min(i,n){return this.check(Mt(i,n))},lt(i,n){return this.check(_n(i,n))},lte(i,n){return this.check(Vt(i,n))},max(i,n){return this.check(Vt(i,n))},int(i){return this.check(vl(i))},safe(i){return this.check(vl(i))},positive(i){return this.check(vn(0,i))},nonnegative(i){return this.check(Mt(0,i))},negative(i){return this.check(_n(0,i))},nonpositive(i){return this.check(Vt(0,i))},multipleOf(i,n){return this.check(Qn(i,n))},step(i,n){return this.check(Qn(i,n))},finite(){return this}});let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=true,t.format=r.format??null;});function K(t){return Rm(as,t)}var li=z("ZodNumberFormat",(t,e)=>{Pp.init(t,e),as.init(t,e);});function vl(t){return wm(li,t)}function Lx(t){return Mm(li,t)}function kx(t){return Am(li,t)}function Ux(t){return Im(li,t)}function Fx(t){return Cm(li,t)}var cs=z("ZodBoolean",(t,e)=>{wo.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ig(t,r,i);});function ie(t){return Pm(cs,t)}var ls=z("ZodBigInt",(t,e)=>{Ic.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>sg(t,i),t.gte=(i,n)=>t.check(Mt(i,n)),t.min=(i,n)=>t.check(Mt(i,n)),t.gt=(i,n)=>t.check(vn(i,n)),t.gte=(i,n)=>t.check(Mt(i,n)),t.min=(i,n)=>t.check(Mt(i,n)),t.lt=(i,n)=>t.check(_n(i,n)),t.lte=(i,n)=>t.check(Vt(i,n)),t.max=(i,n)=>t.check(Vt(i,n)),t.positive=i=>t.check(vn(BigInt(0),i)),t.negative=i=>t.check(_n(BigInt(0),i)),t.nonpositive=i=>t.check(Vt(BigInt(0),i)),t.nonnegative=i=>t.check(Mt(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(Qn(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null;});function Bx(t){return Om(ls,t)}var kl=z("ZodBigIntFormat",(t,e)=>{Np.init(t,e),ls.init(t,e);});function Vx(t){return $m(kl,t)}function jx(t){return Dm(kl,t)}var t_=z("ZodSymbol",(t,e)=>{Op.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>og(t,r);});function Gx(t){return Lm(t_,t)}var n_=z("ZodUndefined",(t,e)=>{zp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>cg(t,r);});function Hx(t){return km(n_,t)}var r_=z("ZodNull",(t,e)=>{$p.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ag(t,r,i);});function xn(t){return Um(r_,t)}var i_=z("ZodAny",(t,e)=>{Dp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dg();});function Ul(){return Fm(i_)}var s_=z("ZodUnknown",(t,e)=>{Lp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>hg();});function ce(){return Bm(s_)}var o_=z("ZodNever",(t,e)=>{kp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ug(t,r,i);});function Fl(t){return Vm(o_,t)}var a_=z("ZodVoid",(t,e)=>{Up.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>lg(t,r);});function qx(t){return jm(a_,t)}var Uo=z("ZodDate",(t,e)=>{Fp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>fg(t,i),t.min=(i,n)=>t.check(Mt(i,n)),t.max=(i,n)=>t.check(Vt(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null;});function Wx(t){return Gm(Uo,t)}var c_=z("ZodArray",(t,e)=>{Bp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Eg(t,r,i,n),t.element=e.element,Lo(t,"ZodArray",{min(r,i){return this.check(Cn(r,i))},nonempty(r){return this.check(Cn(1,r))},max(r,i){return this.check(oi(r,i))},length(r,i){return this.check(ai(r,i))},unwrap(){return this.element}});});function $(t,e){return Wm(c_,t,e)}function Kx(t){let e=t._zod.def.shape;return _e(Object.keys(e))}var Fo=z("ZodObject",(t,e)=>{Vp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>wg(t,r,i,n),J.defineLazy(t,"shape",()=>e.shape),Lo(t,"ZodObject",{keyof(){return _e(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:ce()})},loose(){return this.clone({...this._zod.def,catchall:ce()})},strict(){return this.clone({...this._zod.def,catchall:Fl()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return J.extend(this,r)},safeExtend(r){return J.safeExtend(this,r)},merge(r){return J.merge(this,r)},pick(r){return J.pick(this,r)},omit(r){return J.omit(this,r)},partial(...r){return J.partial(Vl,this,r[0])},required(...r){return J.required(jl,this,r[0])}});});function I(t,e){let r={type:"object",shape:t??{},...J.normalizeParams(e)};return new Fo(r)}function Zx(t,e){return new Fo({type:"object",shape:t,catchall:Fl(),...J.normalizeParams(e)})}function de(t,e){return new Fo({type:"object",shape:t,catchall:ce(),...J.normalizeParams(e)})}var Bo=z("ZodUnion",(t,e)=>{Mo.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ul(t,r,i,n),t.options=e.options;});function oe(t,e){return new Bo({type:"union",options:t,...J.normalizeParams(e)})}var l_=z("ZodXor",(t,e)=>{Bo.init(t,e),jp.init(t,e),t._zod.processJSONSchema=(r,i,n)=>ul(t,r,i,n),t.options=e.options;});function Xx(t,e){return new l_({type:"union",options:t,inclusive:false,...J.normalizeParams(e)})}var u_=z("ZodDiscriminatedUnion",(t,e)=>{Bo.init(t,e),Gp.init(t,e);});function ir(t,e,r){return new u_({type:"union",options:e,discriminator:t,...J.normalizeParams(r)})}var d_=z("ZodIntersection",(t,e)=>{Hp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Mg(t,r,i,n);});function cn(t,e){return new d_({type:"intersection",left:t,right:e})}var h_=z("ZodTuple",(t,e)=>{Cc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ag(t,r,i,n),t.rest=r=>t.clone({...t._zod.def,rest:r});});function f_(t,e,r){let i=e instanceof Se,n=i?r:e,s=i?e:null;return new h_({type:"tuple",items:t,rest:s,...J.normalizeParams(n)})}var ns=z("ZodRecord",(t,e)=>{qp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ig(t,r,i,n),t.keyType=e.keyType,t.valueType=e.valueType;});function re(t,e,r){return !e||!e._zod?new ns({type:"record",keyType:x(),valueType:t,...J.normalizeParams(e)}):new ns({type:"record",keyType:t,valueType:e,...J.normalizeParams(r)})}function Jx(t,e,r){let i=Et(t);return i._zod.values=void 0,new ns({type:"record",keyType:i,valueType:e,...J.normalizeParams(r)})}function Yx(t,e,r){return new ns({type:"record",keyType:t,valueType:e,mode:"loose",...J.normalizeParams(r)})}var p_=z("ZodMap",(t,e)=>{Wp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Tg(t,r),t.keyType=e.keyType,t.valueType=e.valueType,t.min=(...r)=>t.check(yn(...r)),t.nonempty=r=>t.check(yn(1,r)),t.max=(...r)=>t.check(er(...r)),t.size=(...r)=>t.check(si(...r));});function Qx(t,e,r){return new p_({type:"map",keyType:t,valueType:e,...J.normalizeParams(r)})}var m_=z("ZodSet",(t,e)=>{Kp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Rg(t,r),t.min=(...r)=>t.check(yn(...r)),t.nonempty=r=>t.check(yn(1,r)),t.max=(...r)=>t.check(er(...r)),t.size=(...r)=>t.check(si(...r));});function eb(t,e){return new m_({type:"set",valueType:t,...J.normalizeParams(e)})}var rs=z("ZodEnum",(t,e)=>{Zp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(i,n,s)=>pg(t,i,n),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let s={};for(let o of i)if(r.has(o))s[o]=e.entries[o];else throw new Error(`Key ${o} not found in enum`);return new rs({...e,checks:[],...J.normalizeParams(n),entries:s})},t.exclude=(i,n)=>{let s={...e.entries};for(let o of i)if(r.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new rs({...e,checks:[],...J.normalizeParams(n),entries:s})};});function _e(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new rs({type:"enum",entries:r,...J.normalizeParams(e)})}function tb(t,e){return new rs({type:"enum",entries:t,...J.normalizeParams(e)})}var g_=z("ZodLiteral",(t,e)=>{Xp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>mg(t,r,i),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}});});function D(t,e){return new g_({type:"literal",values:Array.isArray(t)?t:[t],...J.normalizeParams(e)})}var __=z("ZodFile",(t,e)=>{Jp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>vg(t,r,i),t.min=(r,i)=>t.check(yn(r,i)),t.max=(r,i)=>t.check(er(r,i)),t.mime=(r,i)=>t.check(Ki(Array.isArray(r)?r:[r],i));});function nb(t){return Km(__,t)}var v_=z("ZodTransform",(t,e)=>{Yp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>bg(t,r),t._zod.parse=(r,i)=>{if(i.direction==="backward")throw new Kn(t.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(J.issue(s,r.value,e));else {let o=s;o.fatal&&(o.continue=false),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),r.issues.push(J.issue(o));}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(s=>(r.value=s,r.fallback=true,r)):(r.value=n,r.fallback=true,r)};});function Bl(t){return new v_({type:"transform",transform:t})}var Vl=z("ZodOptional",(t,e)=>{Pc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dl(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function le(t){return new Vl({type:"optional",innerType:t})}var y_=z("ZodExactOptional",(t,e)=>{Qp.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>dl(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function S_(t){return new y_({type:"optional",innerType:t})}var x_=z("ZodNullable",(t,e)=>{em.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Cg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function Do(t){return new x_({type:"nullable",innerType:t})}function rb(t){return le(Do(t))}var b_=z("ZodDefault",(t,e)=>{tm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Ng(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap;});function T_(t,e){return new b_({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():J.shallowClone(e)}})}var R_=z("ZodPrefault",(t,e)=>{nm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Og(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function E_(t,e){return new R_({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():J.shallowClone(e)}})}var jl=z("ZodNonOptional",(t,e)=>{rm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Pg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function w_(t,e){return new jl({type:"nonoptional",innerType:t,...J.normalizeParams(e)})}var M_=z("ZodSuccess",(t,e)=>{im.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>yg(t,r,i),t.unwrap=()=>t._zod.def.innerType;});function ib(t){return new M_({type:"success",innerType:t})}var A_=z("ZodCatch",(t,e)=>{sm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>zg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap;});function I_(t,e){return new A_({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var C_=z("ZodNaN",(t,e)=>{om.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>gg(t,r);});function sb(t){return qm(C_,t)}var Vo=z("ZodPipe",(t,e)=>{Nc.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>$g(t,r,i,n),t.in=e.in,t.out=e.out;});function yl(t,e){return new Vo({type:"pipe",in:t,out:e})}var jo=z("ZodCodec",(t,e)=>{Vo.init(t,e),Ao.init(t,e);});function ob(t,e,r){return new jo({type:"pipe",in:t,out:e,transform:r.decode,reverseTransform:r.encode})}function ab(t){let e=t._zod.def;return new jo({type:"pipe",in:e.out,out:e.in,transform:e.reverseTransform,reverseTransform:e.transform})}var P_=z("ZodPreprocess",(t,e)=>{Vo.init(t,e),am.init(t,e);}),N_=z("ZodReadonly",(t,e)=>{cm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Dg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function O_(t){return new N_({type:"readonly",innerType:t})}var z_=z("ZodTemplateLiteral",(t,e)=>{lm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>_g(t,r,i);});function cb(t,e){return new z_({type:"template_literal",parts:t,...J.normalizeParams(e)})}var $_=z("ZodLazy",(t,e)=>{hm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>kg(t,r,i,n),t.unwrap=()=>t._zod.def.getter();});function sr(t){return new $_({type:"lazy",getter:t})}var D_=z("ZodPromise",(t,e)=>{dm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Lg(t,r,i,n),t.unwrap=()=>t._zod.def.innerType;});function lb(t){return new D_({type:"promise",innerType:t})}var L_=z("ZodFunction",(t,e)=>{um.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>xg(t,r);});function ub(t){return new L_({type:"function",input:Array.isArray(t?.input)?f_(t?.input):t?.input??$(ce()),output:t?.output??ce()})}var Go=z("ZodCustom",(t,e)=>{fm.init(t,e),Ae.init(t,e),t._zod.processJSONSchema=(r,i,n)=>Sg(t,r);});function db(t){let e=new We({check:"custom"});return e._zod.check=t,e}function hb(t,e){return Zm(Go,t??(()=>true),e)}function k_(t,e={}){return Xm(Go,t,e)}function U_(t,e){return Jm(t,e)}var fb=Ym,pb=Qm;function mb(t,e={}){let r=new Go({type:"custom",check:"custom",fn:i=>i instanceof t,abort:true,...J.normalizeParams(e)});return r._zod.bag.Class=t,r._zod.check=i=>{i.value instanceof t||i.issues.push({code:"invalid_type",expected:t.name,input:i.value,inst:r,path:[...r._zod.def.path??[]]});},r}var gb=(...t)=>eg({Codec:jo,Boolean:cs,String:is},...t);function _b(t){let e=sr(()=>oe([x(t),K(),ie(),xn(),$(e),re(x(),e)]));return e}function Nn(t,e){return new P_({type:"pipe",in:Bl(t),out:e})}var B_={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function lI(t){Je({customError:t});}function uI(){return Je().customError}var F_;F_||(F_={});var se={...Oo,...fl,iso:jt},dI=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function hI(t,e){let r=t.$schema;return r==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":r==="http://json-schema.org/draft-07/schema#"?"draft-7":r==="http://json-schema.org/draft-04/schema#"?"draft-4":e??"draft-2020-12"}function fI(t,e){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");let r=t.slice(1).split("/").filter(Boolean);if(r.length===0)return e.rootSchema;let i=e.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===i){let n=r[1];if(!n||!e.defs[n])throw new Error(`Reference not found: ${t}`);return e.defs[n]}throw new Error(`Reference not found: ${t}`)}function vb(t,e){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return se.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){let n=t.$ref;if(e.refs.has(n))return e.refs.get(n);if(e.processing.has(n))return se.lazy(()=>{if(!e.refs.has(n))throw new Error(`Circular reference not resolved: ${n}`);return e.refs.get(n)});e.processing.add(n);let s=fI(n,e),o=yt(s,e);return e.refs.set(n,o),e.processing.delete(n),o}if(t.enum!==void 0){let n=t.enum;if(e.version==="openapi-3.0"&&t.nullable===true&&n.length===1&&n[0]===null)return se.null();if(n.length===0)return se.never();if(n.length===1)return se.literal(n[0]);if(n.every(o=>typeof o=="string"))return se.enum(n);let s=n.map(o=>se.literal(o));return s.length<2?s[0]:se.union([s[0],s[1],...s.slice(2)])}if(t.const!==void 0)return se.literal(t.const);let r=t.type;if(Array.isArray(r)){let n=r.map(s=>{let o={...t,type:s};return vb(o,e)});return n.length===0?se.never():n.length===1?n[0]:se.union(n)}if(!r)return se.any();let i;switch(r){case "string":{let n=se.string();if(t.format){let s=t.format;s==="email"?n=n.check(se.email()):s==="uri"||s==="uri-reference"?n=n.check(se.url()):s==="uuid"||s==="guid"?n=n.check(se.uuid()):s==="date-time"?n=n.check(se.iso.datetime()):s==="date"?n=n.check(se.iso.date()):s==="time"?n=n.check(se.iso.time()):s==="duration"?n=n.check(se.iso.duration()):s==="ipv4"?n=n.check(se.ipv4()):s==="ipv6"?n=n.check(se.ipv6()):s==="mac"?n=n.check(se.mac()):s==="cidr"?n=n.check(se.cidrv4()):s==="cidr-v6"?n=n.check(se.cidrv6()):s==="base64"?n=n.check(se.base64()):s==="base64url"?n=n.check(se.base64url()):s==="e164"?n=n.check(se.e164()):s==="jwt"?n=n.check(se.jwt()):s==="emoji"?n=n.check(se.emoji()):s==="nanoid"?n=n.check(se.nanoid()):s==="cuid"?n=n.check(se.cuid()):s==="cuid2"?n=n.check(se.cuid2()):s==="ulid"?n=n.check(se.ulid()):s==="xid"?n=n.check(se.xid()):s==="ksuid"&&(n=n.check(se.ksuid()));}typeof t.minLength=="number"&&(n=n.min(t.minLength)),typeof t.maxLength=="number"&&(n=n.max(t.maxLength)),t.pattern&&(n=n.regex(new RegExp(t.pattern))),i=n;break}case "number":case "integer":{let n=r==="integer"?se.number().int():se.number();typeof t.minimum=="number"&&(n=n.min(t.minimum)),typeof t.maximum=="number"&&(n=n.max(t.maximum)),typeof t.exclusiveMinimum=="number"?n=n.gt(t.exclusiveMinimum):t.exclusiveMinimum===true&&typeof t.minimum=="number"&&(n=n.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?n=n.lt(t.exclusiveMaximum):t.exclusiveMaximum===true&&typeof t.maximum=="number"&&(n=n.lt(t.maximum)),typeof t.multipleOf=="number"&&(n=n.multipleOf(t.multipleOf)),i=n;break}case "boolean":{i=se.boolean();break}case "null":{i=se.null();break}case "object":{let n={},s=t.properties||{},o=new Set(t.required||[]);for(let[c,l]of Object.entries(s)){let u=yt(l,e);n[c]=o.has(c)?u:u.optional();}if(t.propertyNames){let c=yt(t.propertyNames,e),l=t.additionalProperties&&typeof t.additionalProperties=="object"?yt(t.additionalProperties,e):se.any();if(Object.keys(n).length===0){i=se.record(c,l);break}let u=se.object(n).passthrough(),d=se.looseRecord(c,l);i=se.intersection(u,d);break}if(t.patternProperties){let c=t.patternProperties,l=Object.keys(c),u=[];for(let f of l){let p=yt(c[f],e),g=se.string().regex(new RegExp(f));u.push(se.looseRecord(g,p));}let d=[];if(Object.keys(n).length>0&&d.push(se.object(n).passthrough()),d.push(...u),d.length===0)i=se.object({}).passthrough();else if(d.length===1)i=d[0];else {let f=se.intersection(d[0],d[1]);for(let p=2;p<d.length;p++)f=se.intersection(f,d[p]);i=f;}break}let a=se.object(n);t.additionalProperties===false?i=a.strict():typeof t.additionalProperties=="object"?i=a.catchall(yt(t.additionalProperties,e)):i=a.passthrough();break}case "array":{let n=t.prefixItems,s=t.items;if(n&&Array.isArray(n)){let o=n.map(c=>yt(c,e)),a=s&&typeof s=="object"&&!Array.isArray(s)?yt(s,e):void 0;a?i=se.tuple(o).rest(a):i=se.tuple(o),typeof t.minItems=="number"&&(i=i.check(se.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(se.maxLength(t.maxItems)));}else if(Array.isArray(s)){let o=s.map(c=>yt(c,e)),a=t.additionalItems&&typeof t.additionalItems=="object"?yt(t.additionalItems,e):void 0;a?i=se.tuple(o).rest(a):i=se.tuple(o),typeof t.minItems=="number"&&(i=i.check(se.minLength(t.minItems))),typeof t.maxItems=="number"&&(i=i.check(se.maxLength(t.maxItems)));}else if(s!==void 0){let o=yt(s,e),a=se.array(o);typeof t.minItems=="number"&&(a=a.min(t.minItems)),typeof t.maxItems=="number"&&(a=a.max(t.maxItems)),i=a;}else i=se.array(se.any());break}default:throw new Error(`Unsupported type: ${r}`)}return i}function yt(t,e){if(typeof t=="boolean")return t?se.any():se.never();let r=vb(t,e),i=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){let a=t.anyOf.map(l=>yt(l,e)),c=se.union(a);r=i?se.intersection(r,c):c;}if(t.oneOf&&Array.isArray(t.oneOf)){let a=t.oneOf.map(l=>yt(l,e)),c=se.xor(a);r=i?se.intersection(r,c):c;}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)r=i?r:se.any();else {let a=i?r:yt(t.allOf[0],e),c=i?0:1;for(let l=c;l<t.allOf.length;l++)a=se.intersection(a,yt(t.allOf[l],e));r=a;}t.nullable===true&&e.version==="openapi-3.0"&&(r=se.nullable(r)),t.readOnly===true&&(r=se.readonly(r)),t.default!==void 0&&(r=r.default(t.default));let n={},s=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of s)a in t&&(n[a]=t[a]);let o=["contentEncoding","contentMediaType","contentSchema"];for(let a of o)a in t&&(n[a]=t[a]);for(let a of Object.keys(t))dI.has(a)||(n[a]=t[a]);return Object.keys(n).length>0&&e.registry.add(r,n),t.description&&(r=r.describe(t.description)),r}function yb(t,e){if(typeof t=="boolean")return t?se.any():se.never();let r;try{r=JSON.parse(JSON.stringify(t));}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let i=hI(r,e?.defaultTarget),n=r.$defs||r.definitions||{},s={version:i,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:e?.registry??pt};return yt(r,s)}var Ho={};An(Ho,{bigint:()=>_I,boolean:()=>gI,date:()=>vI,number:()=>mI,string:()=>pI});function pI(t){return _m(is,t)}function mI(t){return Em(as,t)}function gI(t){return Nm(cs,t)}function _I(t){return zm(ls,t)}function vI(t){return Hm(Uo,t)}Je(Oc());var di="2025-11-25";var Gl=[di,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Hl="io.modelcontextprotocol/related-task",zn="io.modelcontextprotocol/protocolVersion",us="io.modelcontextprotocol/clientInfo",bn="io.modelcontextprotocol/serverInfo",$n="io.modelcontextprotocol/clientCapabilities",hi="io.modelcontextprotocol/subscriptionId",ar="io.modelcontextprotocol/logLevel";var fi="2.0";var or=sr(()=>oe([x(),K(),ie(),xn(),re(x(),or),$(or)])),Ye=re(x(),or),j_=$(or),qo=oe([x(),K().int()]),Wo=x(),ql=I({ttl:K().optional()}),Wl=I({taskId:x()}),Ko=de({progressToken:qo.optional(),[Hl]:Wl.optional()}),dt=I({_meta:Ko.optional()}),pi=dt.extend({task:ql.optional()}),Qe=I({method:x(),params:dt.loose().optional()}),St=I({_meta:Ko.optional()}),xt=I({method:x(),params:St.loose().optional()}),Zo=de({get[bn](){return fs.optional().catch(void 0)}}),et=de({_meta:Zo.optional()}),cr=oe([x(),K().int()]),Xo=I({jsonrpc:D(fi),id:cr,...Qe.shape}).strict(),Jo=I({jsonrpc:D(fi),...xt.shape}).strict(),ds=I({jsonrpc:D(fi),id:cr,result:et}).strict(),hs=I({jsonrpc:D(fi),id:cr.optional(),error:I({code:K().int(),message:x(),data:ce().optional()})}).strict(),Yo=oe([Xo,Jo,ds,hs]),G_=oe([ds,hs]),Qo=et.strict(),Kl=St.extend({requestId:cr.optional(),reason:x().optional()}),ea=xt.extend({method:D("notifications/cancelled"),params:Kl}),Zl=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),lr=I({icons:$(Zl).optional()}),On=I({name:x(),title:x().optional()}),fs=On.extend({...On.shape,...lr.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),SI=cn(I({applyDefaults:ie().optional()}),Ye),xI=Nn(t=>t&&typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length===0?{form:{}}:t,cn(I({form:SI.optional(),url:Ye.optional()}),Ye.optional())),Xl=de({list:Ye.optional(),cancel:Ye.optional(),requests:de({sampling:de({createMessage:Ye.optional()}).optional(),elicitation:de({create:Ye.optional()}).optional()}).optional()}),Jl=de({list:Ye.optional(),cancel:Ye.optional(),requests:de({tools:de({call:Ye.optional()}).optional()}).optional()}),Yl=I({experimental:re(x(),Ye).optional(),sampling:I({context:Ye.optional(),tools:Ye.optional()}).optional(),elicitation:xI.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:Xl.optional(),extensions:re(x(),Ye).optional()}),Ql=dt.extend({protocolVersion:x(),capabilities:Yl,clientInfo:fs}),eu=Qe.extend({method:D("initialize"),params:Ql}),ta=I({experimental:re(x(),Ye).optional(),logging:Ye.optional(),completions:Ye.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:Jl.optional(),extensions:re(x(),Ye).optional()}),tu=et.extend({protocolVersion:x(),capabilities:ta,serverInfo:fs,instructions:x().optional()}),nu=xt.extend({method:D("notifications/initialized"),params:St.optional()}),ru=Qe.extend({method:D("server/discover"),params:dt.optional()}),iu=et.extend({supportedVersions:$(x()),capabilities:ta,instructions:x().optional()}),na=Qe.extend({method:D("ping"),params:dt.optional()}),su=I({progress:K(),total:le(K()),message:le(x())}),ou=I({...St.shape,...su.shape,progressToken:qo}),ra=xt.extend({method:D("notifications/progress"),params:ou}),au=dt.extend({cursor:Wo.optional()}),ur=Qe.extend({params:au.optional()}),dr=et.extend({nextCursor:Wo.optional()}),ia=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),sa=ia.extend({text:x()}),H_=x().refine(t=>{try{return atob(t),!0}catch{return false}},{message:"Invalid Base64 string"}),oa=ia.extend({blob:H_}),hr=_e(["user","assistant"]),Dn=I({audience:$(hr).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),aa=I({...On.shape,...lr.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:Dn.optional(),_meta:le(de({}))}),cu=I({...On.shape,...lr.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:Dn.optional(),_meta:le(de({}))}),lu=ur.extend({method:D("resources/list")}),uu=dr.extend({resources:$(aa)}),du=ur.extend({method:D("resources/templates/list")}),hu=dr.extend({resourceTemplates:$(cu)}),ps=dt.extend({uri:x()}),fu=ps,pu=Qe.extend({method:D("resources/read"),params:fu}),mu=et.extend({contents:$(oe([sa,oa]))}),gu=xt.extend({method:D("notifications/resources/list_changed"),params:St.optional()}),_u=ps,vu=Qe.extend({method:D("resources/subscribe"),params:_u}),yu=ps,Su=Qe.extend({method:D("resources/unsubscribe"),params:yu}),ca=I({toolsListChanged:ie().optional(),promptsListChanged:ie().optional(),resourcesListChanged:ie().optional(),resourceSubscriptions:$(x()).optional()}),xu=dt.extend({notifications:ca}),bu=Qe.extend({method:D("subscriptions/listen"),params:xu}),Tu=St.extend({notifications:ca}),Ru=xt.extend({method:D("notifications/subscriptions/acknowledged"),params:Tu}),Eu=Zo.extend({[hi]:cr}),wu=et.extend({_meta:Eu}),Mu=St.extend({uri:x()}),Au=xt.extend({method:D("notifications/resources/updated"),params:Mu}),Iu=I({name:x(),description:le(x()),required:le(ie())}),Cu=I({...On.shape,...lr.shape,description:le(x()),arguments:le($(Iu)),_meta:le(de({}))}),Pu=ur.extend({method:D("prompts/list")}),Nu=dr.extend({prompts:$(Cu)}),Ou=dt.extend({name:x(),arguments:re(x(),x()).optional()}),zu=Qe.extend({method:D("prompts/get"),params:Ou}),ms=I({type:D("text"),text:x(),annotations:Dn.optional(),_meta:re(x(),ce()).optional()}),gs=I({type:D("image"),data:H_,mimeType:x(),annotations:Dn.optional(),_meta:re(x(),ce()).optional()}),_s=I({type:D("audio"),data:H_,mimeType:x(),annotations:Dn.optional(),_meta:re(x(),ce()).optional()}),$u=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),Du=I({type:D("resource"),resource:oe([sa,oa]),annotations:Dn.optional(),_meta:re(x(),ce()).optional()}),Lu=aa.extend({type:D("resource_link")}),vs=oe([ms,gs,_s,Lu,Du]),ku=I({role:hr,content:vs}),Uu=et.extend({description:x().optional(),messages:$(ku)}),Fu=xt.extend({method:D("notifications/prompts/list_changed"),params:St.optional()}),Bu=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),Vu=I({taskSupport:_e(["required","optional","forbidden"]).optional()}),la=I({...On.shape,...lr.shape,description:x().optional(),inputSchema:I({type:D("object"),properties:re(x(),or).optional(),required:$(x()).optional()}).catchall(ce()),outputSchema:de({$schema:x().optional()}).optional(),annotations:Bu.optional(),execution:Vu.optional(),_meta:re(x(),ce()).optional()}),ju=ur.extend({method:D("tools/list")}),Gu=dr.extend({tools:$(la)}),ua=et.extend({content:$(vs).default([]),structuredContent:ce().optional(),isError:ie().optional()}),q_=ua.or(et.extend({toolResult:ce()})),Hu=pi.extend({name:x(),arguments:re(x(),ce()).optional()}),qu=Qe.extend({method:D("tools/call"),params:Hu}),Wu=xt.extend({method:D("notifications/tools/list_changed"),params:St.optional()}),W_=I({autoRefresh:ie().default(true),debounceMs:K().int().nonnegative().default(300)}),fr=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),Ku=dt.extend({level:fr}),Zu=Qe.extend({method:D("logging/setLevel"),params:Ku}),Xu=St.extend({level:fr,logger:x().optional(),data:ce()}),Ju=xt.extend({method:D("notifications/message"),params:Xu}),Yu=I({name:x().optional()}),Qu=I({hints:$(Yu).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),ed=I({mode:_e(["auto","required","none"]).optional()}),td=I({type:D("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:$(vs),structuredContent:ce().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),nd=ir("type",[ms,gs,_s]),ui=ir("type",[ms,gs,_s,$u,td]),rd=I({role:hr,content:oe([ui,$(ui)]),_meta:re(x(),ce()).optional()}),id=pi.extend({messages:$(rd),modelPreferences:Qu.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:Ye.optional(),tools:$(la).optional(),toolChoice:ed.optional()}),sd=Qe.extend({method:D("sampling/createMessage"),params:id}),od=et.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens"]).or(x())),role:hr,content:nd}),ad=et.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:hr,content:oe([ui,$(ui)])}),da=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),ys=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),Ss=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),ha=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),fa=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),pa=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),cd=oe([ha,fa]),ma=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),ga=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),ld=oe([ma,ga]),ud=oe([pa,cd,ld]),_a=oe([ud,da,ys,Ss]),xs=pi.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),_a),required:$(x()).optional()}).catchall(ce())}),dd=pi.extend({mode:D("url"),message:x(),elicitationId:x(),url:x().url()}),hd=oe([xs,dd]),fd=Qe.extend({method:D("elicitation/create"),params:hd}),pd=St.extend({elicitationId:x()}),md=xt.extend({method:D("notifications/elicitation/complete"),params:pd}),gd=et.extend({action:_e(["accept","decline","cancel"]),content:Nn(t=>t===null?void 0:t,re(x(),oe([x(),K(),ie(),$(x())])).optional())}),_d=I({type:D("ref/resource"),uri:x()}),vd=I({type:D("ref/prompt"),name:x()}),yd=dt.extend({ref:oe([vd,_d]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()}),Sd=Qe.extend({method:D("completion/complete"),params:yd}),xd=et.extend({completion:de({values:$(x()).max(100),total:le(K().int()),hasMore:le(ie())})}),bd=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Td=Qe.extend({method:D("roots/list"),params:dt.optional()}),Rd=et.extend({roots:$(bd)}),Ed=xt.extend({method:D("notifications/roots/list_changed"),params:St.optional()}),K_=de({ttl:K().optional(),pollInterval:K().optional()}),wd=_e(["working","input_required","completed","failed","cancelled"]),pr=I({taskId:x(),status:wd,ttl:oe([K(),xn()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:le(K()),statusMessage:le(x())}),Z_=et.extend({task:pr}),Md=St.merge(pr),X_=xt.extend({method:D("notifications/tasks/status"),params:Md}),J_=Qe.extend({method:D("tasks/get"),params:dt.extend({taskId:x()})}),Y_=et.merge(pr),Q_=Qe.extend({method:D("tasks/result"),params:dt.extend({taskId:x()})}),ev=et.loose(),tv=ur.extend({method:D("tasks/list")}),nv=dr.extend({tasks:$(pr)}),rv=Qe.extend({method:D("tasks/cancel"),params:dt.extend({taskId:x()})}),iv=et.merge(pr),sv=oe([na,eu,ru,Sd,Zu,zu,Pu,lu,du,pu,vu,Su,bu,qu,ju]),ov=oe([ea,ra,nu,Ed]),av=oe([Qo,od,ad,gd,Rd]),cv=oe([na,sd,fd,Td]),lv=oe([ea,ra,Ju,Au,gu,Wu,Fu,Ru,md]),uv=oe([Qo,tu,iu,xd,Uu,Nu,uu,hu,mu,ua,Gu,wu]),ut=ss().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:B_.custom,message:"URL must be parseable",fatal:true}),fo}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),dv=de({resource:x().url(),authorization_servers:$(ut).optional(),jwks_uri:x().url().optional(),scopes_supported:$(x()).optional(),bearer_methods_supported:$(x()).optional(),resource_signing_alg_values_supported:$(x()).optional(),resource_name:x().optional(),resource_documentation:x().optional(),resource_policy_uri:x().url().optional(),resource_tos_uri:x().url().optional(),tls_client_certificate_bound_access_tokens:ie().optional(),authorization_details_types_supported:$(x()).optional(),dpop_signing_alg_values_supported:$(x()).optional(),dpop_bound_access_tokens_required:ie().optional()}),Ad=de({issuer:x(),authorization_endpoint:ut,token_endpoint:ut,registration_endpoint:ut.optional(),scopes_supported:$(x()).optional(),response_types_supported:$(x()),response_modes_supported:$(x()).optional(),grant_types_supported:$(x()).optional(),token_endpoint_auth_methods_supported:$(x()).optional(),token_endpoint_auth_signing_alg_values_supported:$(x()).optional(),service_documentation:ut.optional(),revocation_endpoint:ut.optional(),revocation_endpoint_auth_methods_supported:$(x()).optional(),revocation_endpoint_auth_signing_alg_values_supported:$(x()).optional(),introspection_endpoint:x().optional(),introspection_endpoint_auth_methods_supported:$(x()).optional(),introspection_endpoint_auth_signing_alg_values_supported:$(x()).optional(),code_challenge_methods_supported:$(x()).optional(),client_id_metadata_document_supported:ie().optional(),authorization_response_iss_parameter_supported:ie().optional().catch(void 0)}),Id=de({issuer:x(),authorization_endpoint:ut,token_endpoint:ut,userinfo_endpoint:ut.optional(),jwks_uri:ut,registration_endpoint:ut.optional(),scopes_supported:$(x()).optional(),response_types_supported:$(x()),response_modes_supported:$(x()).optional(),grant_types_supported:$(x()).optional(),acr_values_supported:$(x()).optional(),subject_types_supported:$(x()),id_token_signing_alg_values_supported:$(x()),id_token_encryption_alg_values_supported:$(x()).optional(),id_token_encryption_enc_values_supported:$(x()).optional(),userinfo_signing_alg_values_supported:$(x()).optional(),userinfo_encryption_alg_values_supported:$(x()).optional(),userinfo_encryption_enc_values_supported:$(x()).optional(),request_object_signing_alg_values_supported:$(x()).optional(),request_object_encryption_alg_values_supported:$(x()).optional(),request_object_encryption_enc_values_supported:$(x()).optional(),token_endpoint_auth_methods_supported:$(x()).optional(),token_endpoint_auth_signing_alg_values_supported:$(x()).optional(),display_values_supported:$(x()).optional(),claim_types_supported:$(x()).optional(),claims_supported:$(x()).optional(),service_documentation:x().optional(),claims_locales_supported:$(x()).optional(),ui_locales_supported:$(x()).optional(),claims_parameter_supported:ie().optional(),request_parameter_supported:ie().optional(),request_uri_parameter_supported:ie().optional(),require_request_uri_registration:ie().optional(),op_policy_uri:ut.optional(),op_tos_uri:ut.optional(),client_id_metadata_document_supported:ie().optional(),authorization_response_iss_parameter_supported:ie().optional().catch(void 0)}),hv=I({...Id.shape,...Ad.pick({code_challenge_methods_supported:true}).shape}),fv=I({access_token:x(),id_token:x().optional(),token_type:x(),expires_in:Ho.number().optional(),scope:x().optional(),refresh_token:x().optional()}).strip(),pv=I({issued_token_type:D("urn:ietf:params:oauth:token-type:id-jag"),access_token:x(),token_type:x().optional(),expires_in:K().optional(),scope:x().optional()}).strip(),mv=I({error:x(),error_description:x().optional(),error_uri:x().optional()}),V_=ut.optional().or(D("").transform(()=>{})),Cd=I({redirect_uris:$(ut),token_endpoint_auth_method:x().optional(),grant_types:$(x()).optional(),response_types:$(x()).optional(),application_type:x().optional(),client_name:x().optional(),client_uri:ut.optional(),logo_uri:V_,scope:x().optional(),contacts:$(x()).optional(),tos_uri:V_,policy_uri:x().optional(),jwks_uri:ut.optional(),jwks:Ul().optional(),software_id:x().optional(),software_version:x().optional(),software_statement:x().optional()}).strip(),Pd=I({client_id:x(),client_secret:x().optional(),client_id_issued_at:K().optional(),client_secret_expires_at:K().optional()}).strip(),gv=Cd.merge(Pd),_v=I({error:x(),error_description:x().optional()}).strip(),vv=I({token:x(),token_type_hint:x().optional()}).strip();var bv=Symbol.for("mcp.sdk.errorBrands");function wv(t,e){let r=new Set,i=e;for(;typeof i=="function";){let n=i.mcpBrand;Object.prototype.hasOwnProperty.call(i,"mcpBrand")&&typeof n=="string"&&r.add(n),i=Object.getPrototypeOf(i);}r.size!==0&&Object.defineProperty(t,bv,{value:r,enumerable:false,configurable:true});}function Ts(t,e){try{if(typeof e=="object"&&e!==null&&Object.prototype.hasOwnProperty.call(t,"mcpBrand")&&typeof t.mcpBrand=="string"&&Object.prototype.hasOwnProperty.call(e,bv)){let r=e[bv];if(r&&typeof r.has=="function"&&r.has(t.mcpBrand))return !0}}catch{}return Function.prototype[Symbol.hasInstance].call(t,e)}var Pe=(function(t){return t.NotConnected="NOT_CONNECTED",t.AlreadyConnected="ALREADY_CONNECTED",t.NotInitialized="NOT_INITIALIZED",t.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",t.RequestTimeout="REQUEST_TIMEOUT",t.ConnectionClosed="CONNECTION_CLOSED",t.SendFailed="SEND_FAILED",t.InvalidResult="INVALID_RESULT",t.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",t.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",t.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",t.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",t.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",t.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",t.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",t.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",t.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",t.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",t.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",t})({}),be=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"});}static[Symbol.hasInstance](t){return Ts(this,t)}static isInstance(t){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ts(this,t)}constructor(t,e,r){super(e),this.code=t,this.data=r,this.name="SdkError",wv(this,new.target);}};function Ib(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function RI(t,e,r){return t==="elicitation"&&e==="form"&&r.form===void 0&&r.url===void 0}function Vb(t){switch(t.method){case "elicitation/create":return t.params?.mode==="url"?{elicitation:{url:{}}}:{elicitation:{form:{}}};case "sampling/createMessage":{let e=t.params;return e!==void 0&&(e.tools!==void 0||e.toolChoice!==void 0)?{sampling:{tools:{}}}:{sampling:{}}}case "roots/list":return {roots:{}};default:return}}function Ud(t,e){let r={};for(let[i,n]of Object.entries(t)){if(n===void 0)continue;let s=e===void 0?void 0:e[i];if(s===void 0){r[i]=n;continue}if(Ib(n)&&Ib(s)){let o={};for(let[a,c]of Object.entries(n))c!==void 0&&s[a]===void 0&&!RI(i,a,s)&&(o[a]=c);Object.keys(o).length>0&&(r[i]=o);}}return Object.keys(r).length>0?r:void 0}var jb="2026-07-28",gr=[jb];function Es(t){return t>=jb}function Gb(t){return t.filter(e=>!Es(e))}function Mv(t){return t.filter(e=>Es(e))}function Hb(t){let e=t.structuredContent;return e===void 0||!(typeof e!="object"||e===null||Array.isArray(e))||(t.content?.some(r=>r.type==="text")??false)?t:{...t,content:[...t.content??[],{type:"text",text:JSON.stringify(e)}]}}var qb=["task","inputRequests","requestState"];function Av(t){return t===null||typeof t!="object"||Array.isArray(t)||t.content!==void 0||qb.some(e=>e in t)?t:{...t,content:[]}}function EI(){let t=sr(()=>oe([x(),K(),ie(),xn(),re(x(),t),$(t)])),e=re(x(),t),r=oe([x(),K().int()]),i=x(),n=I({ttl:K().optional()}),s=I({taskId:x()}),o=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=I({_meta:o.optional()}),c=a.extend({task:n.optional()}),l=I({method:x(),params:a.loose().optional()}),u=I({_meta:o.optional()}),d=I({method:x(),params:u.loose().optional()}),f=de({_meta:o.optional()}),p=oe([x(),K().int()]),g=f.strict(),m=u.extend({requestId:p.optional(),reason:x().optional()}),S=d.extend({method:D("notifications/cancelled"),params:m}),h=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),v=I({icons:$(h).optional()}),_=I({name:x(),title:x().optional()}),y=_.extend({..._.shape,...v.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),R=cn(I({applyDefaults:ie().optional()}),e),T=Nn(vt=>vt&&typeof vt=="object"&&!Array.isArray(vt)&&Object.keys(vt).length===0?{form:{}}:vt,cn(I({form:R.optional(),url:e.optional()}),e.optional())),b=de({list:e.optional(),cancel:e.optional(),requests:de({sampling:de({createMessage:e.optional()}).optional(),elicitation:de({create:e.optional()}).optional()}).optional()}),E=de({list:e.optional(),cancel:e.optional(),requests:de({tools:de({call:e.optional()}).optional()}).optional()}),M=I({experimental:re(x(),e).optional(),sampling:I({context:e.optional(),tools:e.optional()}).optional(),elicitation:T.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:b.optional(),extensions:re(x(),e).optional()}),N=a.extend({protocolVersion:x(),capabilities:M,clientInfo:y}),O=l.extend({method:D("initialize"),params:N}),k=I({experimental:re(x(),e).optional(),logging:e.optional(),completions:e.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:E.optional(),extensions:re(x(),e).optional()}),j=f.extend({protocolVersion:x(),capabilities:k,serverInfo:y,instructions:x().optional()}),G=d.extend({method:D("notifications/initialized"),params:u.optional()}),ne=l.extend({method:D("ping"),params:a.optional()}),Me=I({progress:K(),total:le(K()),message:le(x())}),ye=I({...u.shape,...Me.shape,progressToken:r}),Ue=d.extend({method:D("notifications/progress"),params:ye}),ve=a.extend({cursor:i.optional()}),P=l.extend({params:ve.optional()}),U=f.extend({nextCursor:i.optional()}),q=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),w=q.extend({text:x()}),C=x().refine(vt=>{try{return atob(vt),!0}catch{return false}},{message:"Invalid Base64 string"}),L=q.extend({blob:C}),Q=_e(["user","assistant"]),ue=I({audience:$(Q).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),Re=I({..._.shape,...v.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:ue.optional(),_meta:le(de({}))}),pe=I({..._.shape,...v.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:ue.optional(),_meta:le(de({}))}),Ie=P.extend({method:D("resources/list")}),Ve=U.extend({resources:$(Re)}),A=P.extend({method:D("resources/templates/list")}),V=U.extend({resourceTemplates:$(pe)}),H=a.extend({uri:x()}),me=H,ge=l.extend({method:D("resources/read"),params:me}),Ee=f.extend({contents:$(oe([w,L]))}),nt=d.extend({method:D("notifications/resources/list_changed"),params:u.optional()}),at=H,gt=l.extend({method:D("resources/subscribe"),params:at}),it=H,Xe=l.extend({method:D("resources/unsubscribe"),params:it}),Wt=u.extend({uri:x()}),lt=d.extend({method:D("notifications/resources/updated"),params:Wt}),wn=I({name:x(),description:le(x()),required:le(ie())}),rn=I({..._.shape,...v.shape,description:le(x()),arguments:le($(wn)),_meta:le(de({}))}),Mn=P.extend({method:D("prompts/list")}),jn=U.extend({prompts:$(rn)}),Gn=a.extend({name:x(),arguments:re(x(),x()).optional()}),Hr=l.extend({method:D("prompts/get"),params:Gn}),qr=I({type:D("text"),text:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Wr=I({type:D("image"),data:C,mimeType:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Kr=I({type:D("audio"),data:C,mimeType:x(),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Us=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),Hn=I({type:D("resource"),resource:oe([w,L]),annotations:ue.optional(),_meta:re(x(),ce()).optional()}),Fs=Re.extend({type:D("resource_link")}),Kt=oe([qr,Wr,Kr,Fs,Hn]),bi=I({role:Q,content:Kt}),Ti=f.extend({description:x().optional(),messages:$(bi)}),Zr=d.extend({method:D("notifications/prompts/list_changed"),params:u.optional()}),Bs=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),Ri=I({taskSupport:_e(["required","optional","forbidden"]).optional()}),Xr=I({..._.shape,...v.shape,description:x().optional(),inputSchema:I({type:D("object"),properties:re(x(),t).optional(),required:$(x()).optional()}).catchall(ce()),outputSchema:I({type:D("object"),properties:re(x(),t).optional(),required:$(x()).optional()}).catchall(ce()).optional(),annotations:Bs.optional(),execution:Ri.optional(),_meta:re(x(),ce()).optional()}),Ei=P.extend({method:D("tools/list")}),wi=U.extend({tools:$(Xr)}),Mi=f.extend({content:$(Kt),structuredContent:re(x(),ce()).optional(),isError:ie().optional()}),_t=c.extend({name:x(),arguments:re(x(),ce()).optional()}),Vs=l.extend({method:D("tools/call"),params:_t}),ja=d.extend({method:D("notifications/tools/list_changed"),params:u.optional()}),Ai=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),js=a.extend({level:Ai}),Gs=l.extend({method:D("logging/setLevel"),params:js}),Hs=u.extend({level:Ai,logger:x().optional(),data:ce()}),qs=d.extend({method:D("notifications/message"),params:Hs}),Ws=I({name:x().optional()}),Ks=I({hints:$(Ws).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),Zs=I({mode:_e(["auto","required","none"]).optional()}),Ga=I({type:D("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:$(Kt),structuredContent:I({}).loose().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),Xs=ir("type",[qr,Wr,Kr]),qn=ir("type",[qr,Wr,Kr,Us,Ga]),Js=I({role:Q,content:oe([qn,$(qn)]),_meta:re(x(),ce()).optional()}),Ys=c.extend({messages:$(Js),modelPreferences:Ks.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:e.optional(),tools:$(Xr).optional(),toolChoice:Zs.optional()}),Qs=l.extend({method:D("sampling/createMessage"),params:Ys}),eo=f.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens"]).or(x())),role:Q,content:Xs}),to=f.extend({model:x(),stopReason:le(_e(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:Q,content:oe([qn,$(qn)])}),no=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),ro=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),io=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),so=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),oo=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),ao=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),co=oe([so,oo]),Jr=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),Yr=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),Ha=oe([Jr,Yr]),qa=oe([ao,co,Ha]),Ut=oe([qa,no,ro,io]),Ft=c.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),Ut),required:$(x()).optional()}).catchall(ce())}),lo=c.extend({mode:D("url"),message:x(),elicitationId:x(),url:x().url()}),sn=oe([Ft,lo]),Wa=l.extend({method:D("elicitation/create"),params:sn}),Ka=u.extend({elicitationId:x()}),Za=d.extend({method:D("notifications/elicitation/complete"),params:Ka}),Xa=f.extend({action:_e(["accept","decline","cancel"]),content:Nn(vt=>vt===null?void 0:vt,re(x(),oe([x(),K(),ie(),$(x())])).optional())}),Ja=I({type:D("ref/resource"),uri:x()}),Ya=I({type:D("ref/prompt"),name:x()}),Qa=a.extend({ref:oe([Ya,Ja]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()}),uo=l.extend({method:D("completion/complete"),params:Qa}),ec=f.extend({completion:de({values:$(x()).max(100),total:le(K().int()),hasMore:le(ie())})}),tc=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Ii=l.extend({method:D("roots/list"),params:a.optional()}),ho=f.extend({roots:$(tc)}),nc=d.extend({method:D("notifications/roots/list_changed"),params:u.optional()}),rc=de({ttl:K().optional(),pollInterval:K().optional()}),ic=_e(["working","input_required","completed","failed","cancelled"]),Wn=I({taskId:x(),status:ic,ttl:oe([K(),xn()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:le(K()),statusMessage:le(x())}),Ot=f.extend({task:Wn}),sc=u.merge(Wn),Qr=d.extend({method:D("notifications/tasks/status"),params:sc}),Ci=l.extend({method:D("tasks/get"),params:a.extend({taskId:x()})}),Pi=f.merge(Wn),Ni=l.extend({method:D("tasks/result"),params:a.extend({taskId:x()})}),qh=f.loose(),zt=P.extend({method:D("tasks/list")}),rt=U.extend({tasks:$(Wn)}),ei=l.extend({method:D("tasks/cancel"),params:a.extend({taskId:x()})});return {JSONValueSchema:t,JSONObjectSchema:e,ProgressTokenSchema:r,CursorSchema:i,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:o,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:g,CancelledNotificationParamsSchema:m,CancelledNotificationSchema:S,IconSchema:h,IconsSchema:v,BaseMetadataSchema:_,ImplementationSchema:y,ClientTasksCapabilitySchema:b,ServerTasksCapabilitySchema:E,ClientCapabilitiesSchema:M,InitializeRequestParamsSchema:N,InitializeRequestSchema:O,ServerCapabilitiesSchema:k,InitializeResultSchema:j,InitializedNotificationSchema:G,PingRequestSchema:ne,ProgressSchema:Me,ProgressNotificationParamsSchema:ye,ProgressNotificationSchema:Ue,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:P,PaginatedResultSchema:U,ResourceContentsSchema:q,TextResourceContentsSchema:w,BlobResourceContentsSchema:L,RoleSchema:Q,AnnotationsSchema:ue,ResourceSchema:Re,ResourceTemplateSchema:pe,ListResourcesRequestSchema:Ie,ListResourcesResultSchema:Ve,ListResourceTemplatesRequestSchema:A,ListResourceTemplatesResultSchema:V,ResourceRequestParamsSchema:H,ReadResourceRequestParamsSchema:me,ReadResourceRequestSchema:ge,ReadResourceResultSchema:Ee,ResourceListChangedNotificationSchema:nt,SubscribeRequestParamsSchema:at,SubscribeRequestSchema:gt,UnsubscribeRequestParamsSchema:it,UnsubscribeRequestSchema:Xe,ResourceUpdatedNotificationParamsSchema:Wt,ResourceUpdatedNotificationSchema:lt,PromptArgumentSchema:wn,PromptSchema:rn,ListPromptsRequestSchema:Mn,ListPromptsResultSchema:jn,GetPromptRequestParamsSchema:Gn,GetPromptRequestSchema:Hr,TextContentSchema:qr,ImageContentSchema:Wr,AudioContentSchema:Kr,ToolUseContentSchema:Us,EmbeddedResourceSchema:Hn,ResourceLinkSchema:Fs,ContentBlockSchema:Kt,PromptMessageSchema:bi,GetPromptResultSchema:Ti,PromptListChangedNotificationSchema:Zr,ToolAnnotationsSchema:Bs,ToolExecutionSchema:Ri,ToolSchema:Xr,ListToolsRequestSchema:Ei,ListToolsResultSchema:wi,CallToolResultSchema:Mi,CallToolRequestParamsSchema:_t,CallToolRequestSchema:Vs,ToolListChangedNotificationSchema:ja,LoggingLevelSchema:Ai,SetLevelRequestParamsSchema:js,SetLevelRequestSchema:Gs,LoggingMessageNotificationParamsSchema:Hs,LoggingMessageNotificationSchema:qs,ModelHintSchema:Ws,ModelPreferencesSchema:Ks,ToolChoiceSchema:Zs,ToolResultContentSchema:Ga,SamplingContentSchema:Xs,SamplingMessageContentBlockSchema:qn,SamplingMessageSchema:Js,CreateMessageRequestParamsSchema:Ys,CreateMessageRequestSchema:Qs,CreateMessageResultSchema:eo,CreateMessageResultWithToolsSchema:to,BooleanSchemaSchema:no,StringSchemaSchema:ro,NumberSchemaSchema:io,UntitledSingleSelectEnumSchemaSchema:so,TitledSingleSelectEnumSchemaSchema:oo,LegacyTitledEnumSchemaSchema:ao,SingleSelectEnumSchemaSchema:co,UntitledMultiSelectEnumSchemaSchema:Jr,TitledMultiSelectEnumSchemaSchema:Yr,MultiSelectEnumSchemaSchema:Ha,EnumSchemaSchema:qa,PrimitiveSchemaDefinitionSchema:Ut,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:lo,ElicitRequestParamsSchema:sn,ElicitRequestSchema:Wa,ElicitationCompleteNotificationParamsSchema:Ka,ElicitationCompleteNotificationSchema:Za,ElicitResultSchema:Xa,ResourceTemplateReferenceSchema:Ja,PromptReferenceSchema:Ya,CompleteRequestParamsSchema:Qa,CompleteRequestSchema:uo,CompleteResultSchema:ec,RootSchema:tc,ListRootsRequestSchema:Ii,ListRootsResultSchema:ho,RootsListChangedNotificationSchema:nc,TaskCreationParamsSchema:rc,TaskStatusSchema:ic,TaskSchema:Wn,CreateTaskResultSchema:Ot,TaskStatusNotificationParamsSchema:sc,TaskStatusNotificationSchema:Qr,GetTaskRequestSchema:Ci,GetTaskResultSchema:Pi,GetTaskPayloadRequestSchema:Ni,GetTaskPayloadResultSchema:qh,ListTasksRequestSchema:zt,ListTasksResultSchema:rt,CancelTaskRequestSchema:ei,CancelTaskResultSchema:f.merge(Wn),ClientRequestSchema:oe([ne,O,uo,Gs,Hr,Mn,Ie,A,ge,gt,Xe,Vs,Ei,Ci,Ni,zt,ei]),ClientNotificationSchema:oe([S,Ue,G,nc,Qr]),ClientResultSchema:oe([g,eo,to,Xa,ho,Pi,rt,Ot]),ServerRequestSchema:oe([ne,Qs,Wa,Ii,Ci,Ni,zt,ei]),ServerNotificationSchema:oe([S,Ue,qs,lt,nt,ja,Zr,Qr,Za]),ServerResultSchema:oe([g,j,ec,Ti,jn,Ve,V,Ee,Mi,wi,Pi,rt,Ot]),CallToolResultWireSchema:ce().superRefine((vt,Sw)=>{if(!(typeof vt!="object"||vt===null||Array.isArray(vt)||vt.content!==void 0)){for(let E0 of qb)if(E0 in vt){Sw.addIssue({code:"custom",message:`content is required when the body carries '${E0}' \u2014 another result family cannot default into an empty tools/call success`});return}}}).transform(Av).pipe(Mi)}}var wI;function Wb(){return wI??=EI()}function Kb(t){return t.type!=="object"}var MI=new Set(["const","enum","default","examples"]),AI=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function Cb(t){return t!==void 0&&!(typeof t=="string"&&t.startsWith("#"))}function II(t){let e=typeof t.$schema=="string"?t.$schema:void 0;if(Cb(t.$id))return {...e!==void 0&&{$schema:e},type:"object",properties:{result:t},required:["result"]};let r=A0(t.$schema)&&t.$recursiveAnchor!==true,i=(n,s)=>{if(Array.isArray(n))return n.map(c=>i(c,false));if(n===null||typeof n!="object"||!s&&Cb(n.$id))return n;let o={},a=false;for(let[c,l]of Object.entries(n))s?o[c]=i(l,false):(c==="$ref"||c==="$dynamicRef")&&typeof l=="string"?o[c]=l==="#"?"#/properties/result":l.startsWith("#/")?`#/properties/result${l.slice(1)}`:l:c==="$recursiveRef"&&l==="#"&&r?a=true:MI.has(c)?o[c]=l:AI.has(c)?o[c]=i(l,true):o[c]=i(l,false);return a&&("$ref"in o?o.allOf=[...Array.isArray(o.allOf)?o.allOf:[],{$ref:"#/properties/result"}]:o.$ref="#/properties/result"),o};return {...e!==void 0&&{$schema:e},type:"object",properties:{result:i(t,false)},required:["result"]}}var Zb={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Xb={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},CI={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Nd;function Iv(){if(Nd)return Nd;let t=Wb();return Nd={requestSchemas:{ping:t.PingRequestSchema,initialize:t.InitializeRequestSchema,"completion/complete":t.CompleteRequestSchema,"logging/setLevel":t.SetLevelRequestSchema,"prompts/get":t.GetPromptRequestSchema,"prompts/list":t.ListPromptsRequestSchema,"resources/list":t.ListResourcesRequestSchema,"resources/templates/list":t.ListResourceTemplatesRequestSchema,"resources/read":t.ReadResourceRequestSchema,"resources/subscribe":t.SubscribeRequestSchema,"resources/unsubscribe":t.UnsubscribeRequestSchema,"tools/call":t.CallToolRequestSchema,"tools/list":t.ListToolsRequestSchema,"tasks/get":t.GetTaskRequestSchema,"tasks/result":t.GetTaskPayloadRequestSchema,"tasks/list":t.ListTasksRequestSchema,"tasks/cancel":t.CancelTaskRequestSchema,"sampling/createMessage":t.CreateMessageRequestSchema,"elicitation/create":t.ElicitRequestSchema,"roots/list":t.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":t.CancelledNotificationSchema,"notifications/progress":t.ProgressNotificationSchema,"notifications/initialized":t.InitializedNotificationSchema,"notifications/roots/list_changed":t.RootsListChangedNotificationSchema,"notifications/tasks/status":t.TaskStatusNotificationSchema,"notifications/message":t.LoggingMessageNotificationSchema,"notifications/resources/updated":t.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":t.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":t.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":t.PromptListChangedNotificationSchema,"notifications/elicitation/complete":t.ElicitationCompleteNotificationSchema},resultSchemas:{ping:t.EmptyResultSchema,initialize:t.InitializeResultSchema,"completion/complete":t.CompleteResultSchema,"logging/setLevel":t.EmptyResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"resources/subscribe":t.EmptyResultSchema,"resources/unsubscribe":t.EmptyResultSchema,"tools/call":t.CallToolResultWireSchema,"tools/list":t.ListToolsResultSchema,"sampling/createMessage":t.CreateMessageResultWithToolsSchema,"elicitation/create":t.ElicitResultSchema,"roots/list":t.ListRootsResultSchema}},Nd}function Jb(t){return Object.prototype.hasOwnProperty.call(Zb,t)}function Yb(t){return Object.prototype.hasOwnProperty.call(Xb,t)}function PI(t){return Object.prototype.hasOwnProperty.call(CI,t)}function NI(t){return PI(t)?Iv().resultSchemas[t]:void 0}function OI(t){return Jb(t)?Iv().requestSchemas[t]:void 0}function zI(t){return Yb(t)?Iv().notificationSchemas[t]:void 0}function Tv(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Od(t,e){if(t===void 0)return {ok:false,reason:"not-in-era"};let r=t.safeParse(e);return r.success?{ok:true,value:r.data}:{ok:false,reason:"invalid",message:String(r.error)}}var Pb={ok:false,reason:"not-in-era"};function Nb(t){return Tv(t)&&Tv(t.outputSchema)&&Kb(t.outputSchema)}var Cv={era:"2025-11-25",hasRequestMethod:Jb,hasNotificationMethod:Yb,validateRequest:(t,e)=>Od(OI(t),e),validateResult:(t,e)=>Od(NI(t),e),validateNotification:(t,e)=>Od(zI(t),e),hasInputRequestMethod:()=>false,validateInputRequest:()=>Pb,validateInputResponse:()=>Pb,samplingResultVariant:((t,e)=>{let r=Wb();return Od(t?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,e)}),outboundEnvelope:t=>{},validateEnvelopeMeta:t=>[],projectCallToolResult(t,e){let r=Hb(t),i=r.structuredContent;if(i===void 0)return r;let n=typeof i!="object"||i===null||Array.isArray(i),s=e!==void 0&&Kb(e);return !n&&!s?r:{...r,structuredContent:{result:i}}},decodeResult(t,e){if(Tv(e)&&"resultType"in e){let r={...e};return delete r.resultType,{kind:"complete",result:r}}return {kind:"complete",result:e}},encodeResult(t,e){if(t!=="tools/list")return e;let r=e.tools;return !Array.isArray(r)||!r.some(i=>Nb(i))?e:{...e,tools:r.map(i=>Nb(i)?{...i,outputSchema:II(i.outputSchema)}:i)}},encodeErrorCode:t=>t===-32002?-32602:t,checkInboundEnvelope:t=>{}};function $I(){let t=sr(()=>oe([x(),K(),ie(),xn(),re(x(),t),$(t)])),e=re(x(),t),r=oe([x(),K().int()]),i=x(),n=oe([x(),K().int()]),s=_e(["user","assistant"]),o=_e(["debug","info","notice","warning","error","critical","alert","emergency"]),a=x().refine(rt=>{try{return atob(rt),!0}catch{return false}},{message:"Invalid Base64 string"}),c=I({ttl:K().optional()}),l=I({taskId:x()}),u=de({progressToken:r.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=I({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=I({_meta:u.optional()}),g=I({method:x(),params:p.loose().optional()}),m=I({src:x(),mimeType:x().optional(),sizes:$(x()).optional(),theme:_e(["light","dark"]).optional()}),S=I({icons:$(m).optional()}),h=I({name:x(),title:x().optional()}),v=h.extend({...h.shape,...S.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),_=cn(I({applyDefaults:ie().optional()}),e),y=Nn(rt=>rt&&typeof rt=="object"&&!Array.isArray(rt)&&Object.keys(rt).length===0?{form:{}}:rt,cn(I({form:_.optional(),url:e.optional()}),e.optional())),R=de({list:e.optional(),cancel:e.optional(),requests:de({sampling:de({createMessage:e.optional()}).optional(),elicitation:de({create:e.optional()}).optional()}).optional()}),T=de({list:e.optional(),cancel:e.optional(),requests:de({tools:de({call:e.optional()}).optional()}).optional()}),b=I({experimental:re(x(),e).optional(),sampling:I({context:e.optional(),tools:e.optional()}).optional(),elicitation:y.optional(),roots:I({listChanged:ie().optional()}).optional(),tasks:R.optional(),extensions:re(x(),e).optional()}),E=I({experimental:re(x(),e).optional(),logging:e.optional(),completions:e.optional(),prompts:I({listChanged:ie().optional()}).optional(),resources:I({subscribe:ie().optional(),listChanged:ie().optional()}).optional(),tools:I({listChanged:ie().optional()}).optional(),tasks:T.optional(),extensions:re(x(),e).optional()}),M=I({progress:K(),total:le(K()),message:le(x())}),N=I({...p.shape,...M.shape,progressToken:r}),O=g.extend({method:D("notifications/progress"),params:N}),k=p.extend({level:o,logger:x().optional(),data:ce()}),j=g.extend({method:D("notifications/message"),params:k}),G=I({uri:x(),mimeType:le(x()),_meta:re(x(),ce()).optional()}),ne=G.extend({text:x()}),Me=G.extend({blob:a}),ye=I({audience:$(s).optional(),priority:K().min(0).max(1).optional(),lastModified:jt.datetime({offset:true}).optional()}),Ue=I({...h.shape,...S.shape,uri:x(),description:le(x()),mimeType:le(x()),size:le(K()),annotations:ye.optional(),_meta:le(de({}))}),ve=I({...h.shape,...S.shape,uriTemplate:x(),description:le(x()),mimeType:le(x()),annotations:ye.optional(),_meta:le(de({}))}),P=g.extend({method:D("notifications/resources/list_changed"),params:p.optional()}),U=p.extend({uri:x()}),q=g.extend({method:D("notifications/resources/updated"),params:U}),w=I({name:x(),description:le(x()),required:le(ie())}),C=I({...h.shape,...S.shape,description:le(x()),arguments:le($(w)),_meta:le(de({}))}),L=g.extend({method:D("notifications/prompts/list_changed"),params:p.optional()}),Q=I({type:D("text"),text:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),ue=I({type:D("image"),data:a,mimeType:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),Re=I({type:D("audio"),data:a,mimeType:x(),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),pe=I({type:D("tool_use"),name:x(),id:x(),input:re(x(),ce()),_meta:re(x(),ce()).optional()}),Ie=I({type:D("resource"),resource:oe([ne,Me]),annotations:ye.optional(),_meta:re(x(),ce()).optional()}),Ve=Ue.extend({type:D("resource_link")}),A=oe([Q,ue,Re,Ve,Ie]),V=I({role:s,content:A}),H=I({title:x().optional(),readOnlyHint:ie().optional(),destructiveHint:ie().optional(),idempotentHint:ie().optional(),openWorldHint:ie().optional()}),me=g.extend({method:D("notifications/tools/list_changed"),params:p.optional()}),ge=I({name:x().optional()}),Ee=I({hints:$(ge).optional(),costPriority:K().min(0).max(1).optional(),speedPriority:K().min(0).max(1).optional(),intelligencePriority:K().min(0).max(1).optional()}),nt=I({mode:_e(["auto","required","none"]).optional()}),at=I({type:D("boolean"),title:x().optional(),description:x().optional(),default:ie().optional()}),gt=I({type:D("string"),title:x().optional(),description:x().optional(),minLength:K().optional(),maxLength:K().optional(),format:_e(["email","uri","date","date-time"]).optional(),default:x().optional()}),it=I({type:_e(["number","integer"]),title:x().optional(),description:x().optional(),minimum:K().optional(),maximum:K().optional(),default:K().optional()}),Xe=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),default:x().optional()}),Wt=I({type:D("string"),title:x().optional(),description:x().optional(),oneOf:$(I({const:x(),title:x()})),default:x().optional()}),lt=I({type:D("string"),title:x().optional(),description:x().optional(),enum:$(x()),enumNames:$(x()).optional(),default:x().optional()}),wn=oe([Xe,Wt]),rn=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({type:D("string"),enum:$(x())}),default:$(x()).optional()}),Mn=I({type:D("array"),title:x().optional(),description:x().optional(),minItems:K().optional(),maxItems:K().optional(),items:I({anyOf:$(I({const:x(),title:x()}))}),default:$(x()).optional()}),jn=oe([rn,Mn]),Gn=oe([lt,wn,jn]),Hr=oe([Gn,at,gt,it]),qr=f.extend({mode:D("form").optional(),message:x(),requestedSchema:I({type:D("object"),properties:re(x(),Hr),required:$(x()).optional()}).catchall(ce())}),Wr=I({type:D("ref/resource"),uri:x()}),Kr=I({type:D("ref/prompt"),name:x()}),Us=I({uri:x().startsWith("file://"),name:x().optional(),_meta:re(x(),ce()).optional()}),Hn=b.shape,Fs=I({experimental:Hn.experimental,sampling:Hn.sampling,elicitation:Hn.elicitation,roots:Hn.roots,extensions:Hn.extensions}),Kt=E.shape,bi=I({experimental:Kt.experimental,logging:Kt.logging,completions:Kt.completions,prompts:Kt.prompts,resources:Kt.resources,tools:Kt.tools,extensions:Kt.extensions}),Ti=de({progressToken:r.optional(),[zn]:x(),[us]:v.optional(),[$n]:Fs,[ar]:o.optional()}),Zr=I({...h.shape,...S.shape,description:x().optional(),inputSchema:de({$schema:x().optional(),type:D("object")}),outputSchema:de({$schema:x().optional()}).optional(),annotations:H.optional(),_meta:re(x(),ce()).optional()}),Bs=I({type:D("tool_result"),toolUseId:x(),content:$(A),structuredContent:ce().optional(),isError:ie().optional(),_meta:re(x(),ce()).optional()}),Ri=oe([Q,ue,Re,pe,Bs]),Xr=I({role:s,content:oe([Ri,$(Ri)]),_meta:re(x(),ce()).optional()}),Ei=x(),wi=de({[bn]:v.optional().catch(void 0)}),Mi=wi.optional();function _t(rt){return de({_meta:Mi,resultType:Ei.default("complete"),...rt})}let Vs=_t({}),ja=_t({nextCursor:i.optional()}),Ai=_t({content:$(A),structuredContent:ce().optional(),isError:ie().optional()}),js=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),tools:$(Zr),nextCursor:i.optional()}),Gs=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),prompts:$(C),nextCursor:i.optional()}),Hs=_t({description:x().optional(),messages:$(V)}),qs=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resources:$(Ue),nextCursor:i.optional()}),Ws=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resourceTemplates:$(ve),nextCursor:i.optional()}),Ks=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),contents:$(oe([ne,Me]))}),Zs=_t({completion:I({values:$(x()).max(100),total:K().int().optional(),hasMore:ie().optional()}).loose()}),Ga=_t({ttlMs:K().int().min(0),cacheScope:_e(["public","private"])}),Xs=_t({ttlMs:K().int().min(0).catch(0),cacheScope:_e(["public","private"]).catch("private"),supportedVersions:$(x()),capabilities:bi,instructions:x().optional()}),qn=I({messages:$(Xr),modelPreferences:Ee.optional(),systemPrompt:x().optional(),includeContext:_e(["none","thisServer","allServers"]).optional(),temperature:K().optional(),maxTokens:K().int(),stopSequences:$(x()).optional(),metadata:e.optional(),tools:$(Zr).optional(),toolChoice:nt.optional()}),Js=I({method:D("sampling/createMessage"),params:qn}),Ys=I({method:D("roots/list"),params:I({_meta:re(x(),ce()).optional()}).optional()}),Qs=I({...Xr.shape,model:x(),stopReason:x().optional()}),eo=I({roots:$(Us)}),to=I({action:_e(["accept","decline","cancel"]),content:re(x(),oe([x(),K(),ie(),$(x())])).optional()}),no=I({mode:D("url"),message:x(),url:x().url()}),ro=oe([qr,no]),io=I({method:D("elicitation/create"),params:ro}),so=oe([Js,Ys,io]),oo=oe([Qs,eo,to]),ao=re(x(),so),co=re(x(),oo),Jr=_t({inputRequests:ao.optional(),requestState:x().optional()}),Yr={inputResponses:co.optional(),requestState:x().optional()},Ha=I({_meta:Ti,...Yr}),qa=de({progressToken:r.optional()});function Ut(rt,ei){return I({method:D(rt),params:I({_meta:Ti,...ei})})}function Ft(rt,ei){return I({method:D(rt),params:I({_meta:qa.optional(),...ei}).optional()})}let lo={name:x(),arguments:re(x(),ce()).optional(),...Yr},sn={cursor:i.optional()},Wa=Ut("tools/call",lo),Ka=Ut("tools/list",sn),Za=Ut("prompts/list",sn),Xa=Ut("prompts/get",{name:x(),arguments:re(x(),x()).optional(),...Yr}),Ja=Ut("resources/list",sn),Ya=Ut("resources/templates/list",sn),Qa=Ut("resources/read",{uri:x(),...Yr}),uo={ref:oe([Kr,Wr]),argument:I({name:x(),value:x()}),context:I({arguments:re(x(),x()).optional()}).optional()},ec=Ut("completion/complete",uo),tc=Ut("server/discover",{}),Ii=I({toolsListChanged:ie().optional(),promptsListChanged:ie().optional(),resourcesListChanged:ie().optional(),resourceSubscriptions:$(x()).optional()}),ho={notifications:Ii},nc=Ut("subscriptions/listen",ho),rc=wi.extend({"io.modelcontextprotocol/subscriptionId":n}),ic=de({_meta:rc,resultType:Ei.default("complete")}),Wn={"tools/call":Ft("tools/call",lo),"tools/list":Ft("tools/list",sn),"prompts/get":Ft("prompts/get",{name:x(),arguments:re(x(),x()).optional()}),"prompts/list":Ft("prompts/list",sn),"resources/list":Ft("resources/list",sn),"resources/templates/list":Ft("resources/templates/list",sn),"resources/read":Ft("resources/read",{uri:x()}),"completion/complete":Ft("completion/complete",uo),"server/discover":Ft("server/discover",{}),"subscriptions/listen":Ft("subscriptions/listen",ho)};function Ot(rt){return de({_meta:Mi,...rt})}let sc={"tools/call":Ot({content:$(A),structuredContent:ce().optional(),isError:ie().optional()}),"tools/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),tools:$(Zr),nextCursor:i.optional()}),"prompts/get":Ot({description:x().optional(),messages:$(V)}),"prompts/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),prompts:$(C),nextCursor:i.optional()}),"resources/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resources:$(Ue),nextCursor:i.optional()}),"resources/templates/list":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),resourceTemplates:$(ve),nextCursor:i.optional()}),"resources/read":Ot({ttlMs:K().int().min(0),cacheScope:_e(["public","private"]),contents:$(oe([ne,Me]))}),"completion/complete":Ot({completion:I({values:$(x()).max(100),total:K().int().optional(),hasMore:ie().optional()}).loose()}),"server/discover":Ot({ttlMs:K().int().min(0).catch(0),cacheScope:_e(["public","private"]).catch("private"),supportedVersions:$(x()),capabilities:bi,instructions:x().optional()}),"subscriptions/listen":Ot({})},Qr=de({"io.modelcontextprotocol/subscriptionId":n.optional()}),Ci=I({method:D("notifications/subscriptions/acknowledged"),params:I({_meta:Qr.optional(),notifications:Ii})}),Pi=I({_meta:Qr.optional(),requestId:n,reason:x().optional()}),Ni=I({method:D("notifications/cancelled"),params:Pi}),qh={"notifications/cancelled":Ni,"notifications/progress":O,"notifications/message":j,"notifications/resources/updated":q,"notifications/resources/list_changed":P,"notifications/tools/list_changed":me,"notifications/prompts/list_changed":L,"notifications/subscriptions/acknowledged":Ci},zt=rt=>I({jsonrpc:D("2.0"),id:oe([x(),K().int()]),result:rt}).strict();return {JSONValueSchema:t,JSONObjectSchema:e,ProgressTokenSchema:r,CursorSchema:i,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:g,IconSchema:m,IconsSchema:S,BaseMetadataSchema:h,ImplementationSchema:v,ClientTasksCapabilitySchema:R,ServerTasksCapabilitySchema:T,ClientCapabilitiesSchema:b,ServerCapabilitiesSchema:E,ProgressSchema:M,ProgressNotificationParamsSchema:N,ProgressNotificationSchema:O,LoggingMessageNotificationParamsSchema:k,LoggingMessageNotificationSchema:j,ResourceContentsSchema:G,TextResourceContentsSchema:ne,BlobResourceContentsSchema:Me,AnnotationsSchema:ye,ResourceSchema:Ue,ResourceTemplateSchema:ve,ResourceListChangedNotificationSchema:P,ResourceUpdatedNotificationParamsSchema:U,ResourceUpdatedNotificationSchema:q,PromptArgumentSchema:w,PromptSchema:C,PromptListChangedNotificationSchema:L,TextContentSchema:Q,ImageContentSchema:ue,AudioContentSchema:Re,ToolUseContentSchema:pe,EmbeddedResourceSchema:Ie,ResourceLinkSchema:Ve,ContentBlockSchema:A,PromptMessageSchema:V,ToolAnnotationsSchema:H,ToolListChangedNotificationSchema:me,ModelHintSchema:ge,ModelPreferencesSchema:Ee,ToolChoiceSchema:nt,BooleanSchemaSchema:at,StringSchemaSchema:gt,NumberSchemaSchema:it,UntitledSingleSelectEnumSchemaSchema:Xe,TitledSingleSelectEnumSchemaSchema:Wt,LegacyTitledEnumSchemaSchema:lt,SingleSelectEnumSchemaSchema:wn,UntitledMultiSelectEnumSchemaSchema:rn,TitledMultiSelectEnumSchemaSchema:Mn,MultiSelectEnumSchemaSchema:jn,EnumSchemaSchema:Gn,PrimitiveSchemaDefinitionSchema:Hr,ElicitRequestFormParamsSchema:qr,ResourceTemplateReferenceSchema:Wr,PromptReferenceSchema:Kr,RootSchema:Us,ClientCapabilities2026Schema:Fs,ServerCapabilities2026Schema:bi,RequestMetaEnvelopeSchema:Ti,ToolSchema:Zr,ToolResultContentSchema:Bs,SamplingMessageContentBlockSchema:Ri,SamplingMessageSchema:Xr,ResultTypeSchema:Ei,ResultMetaSchema:wi,ResultSchema:Vs,PaginatedResultSchema:ja,CallToolResultSchema:Ai,ListToolsResultSchema:js,ListPromptsResultSchema:Gs,GetPromptResultSchema:Hs,ListResourcesResultSchema:qs,ListResourceTemplatesResultSchema:Ws,ReadResourceResultSchema:Ks,CompleteResultSchema:Zs,CacheableResultSchema:Ga,DiscoverResultSchema:Xs,CreateMessageRequestParamsSchema:qn,CreateMessageRequestSchema:Js,ListRootsRequestSchema:Ys,CreateMessageResultSchema:Qs,ListRootsResultSchema:eo,ElicitResultSchema:to,ElicitRequestURLParamsSchema:no,ElicitRequestParamsSchema:ro,ElicitRequestSchema:io,InputRequestSchema:so,InputResponseSchema:oo,InputRequestsSchema:ao,InputResponsesSchema:co,InputRequiredResultSchema:Jr,InputResponseRequestParamsSchema:Ha,CallToolRequestSchema:Wa,ListToolsRequestSchema:Ka,ListPromptsRequestSchema:Za,GetPromptRequestSchema:Xa,ListResourcesRequestSchema:Ja,ListResourceTemplatesRequestSchema:Ya,ReadResourceRequestSchema:Qa,CompleteRequestSchema:ec,DiscoverRequestSchema:tc,SubscriptionFilterSchema:Ii,SubscriptionsListenRequestSchema:nc,SubscriptionsListenResultMetaSchema:rc,SubscriptionsListenResultSchema:ic,dispatchRequestSchemas:Wn,dispatchResultSchemas:sc,NotificationMetaSchema:Qr,SubscriptionsAcknowledgedNotificationSchema:Ci,CancelledNotificationParamsSchema:Pi,CancelledNotificationSchema:Ni,notificationSchemas2026:qh,JSONRPCResultResponseSchema:zt(Vs),CallToolResultResponseSchema:zt(oe([Ai,Jr])),ListToolsResultResponseSchema:zt(js),ListPromptsResultResponseSchema:zt(Gs),GetPromptResultResponseSchema:zt(oe([Hs,Jr])),ListResourcesResultResponseSchema:zt(qs),ListResourceTemplatesResultResponseSchema:zt(Ws),ReadResourceResultResponseSchema:zt(oe([Ks,Jr])),CompleteResultResponseSchema:zt(Zs),DiscoverResultResponseSchema:zt(Xs)}}var DI;function gi(){return DI??=$I()}var LI=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function kI(t){return LI.includes(t)}var bs=Symbol("modelcontextprotocol.resultCacheHintFallback");function Fd(t,e){if(e===void 0)return t;let r=t[bs];if(r===void 0)return {...t,[bs]:e};let i={},n=r.ttlMs??e.ttlMs;n!==void 0&&(i.ttlMs=n);let s=r.cacheScope??e.cacheScope;return s!==void 0&&(i.cacheScope=s),{...t,[bs]:i}}function UI(t){return t[bs]}function Pv(t){return typeof t=="number"&&Number.isSafeInteger(t)&&t>=0}function Nv(t){return t==="public"||t==="private"}function Ov(t,e){if(t.ttlMs!==void 0&&!Pv(t.ttlMs))throw new RangeError(`Invalid cache hint for ${e}: ttlMs must be a non-negative safe integer (got ${String(t.ttlMs)})`);if(t.cacheScope!==void 0&&!Nv(t.cacheScope))throw new RangeError(`Invalid cache hint for ${e}: cacheScope must be 'public' or 'private' (got ${String(t.cacheScope)})`)}var ee=(function(t){return t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError",t[t.ResourceNotFound=-32002]="ResourceNotFound",t[t.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",t[t.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",t[t.UrlElicitationRequired=-32042]="UrlElicitationRequired",t})({}),he=class Qb extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"});}static[Symbol.hasInstance](e){return Ts(this,e)}static isInstance(e){if(typeof this!="function")throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Ts(this,e)}constructor(e,r,i){super(r),this.code=e,this.data=i,this.name="ProtocolError",wv(this,new.target);}static fromError(e,r,i){if(e===ee.UrlElicitationRequired&&i){let n=i;if(n.elicitations)return new eT(n.elicitations,r)}if(e===ee.UnsupportedProtocolVersion&&i){let n=i;if(Array.isArray(n.supported)&&typeof n.requested=="string")return new ws({supported:n.supported,requested:n.requested},r)}if(e===ee.InvalidParams||e===ee.ResourceNotFound){let n=i;if(typeof n?.uri=="string"&&(e===ee.ResourceNotFound||Object.keys(n).length===1))return new Bd(n.uri,r)}if(e===ee.MissingRequiredClientCapability&&i){let n=i;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities=="object"&&!Array.isArray(n.requiredCapabilities))return new Vd({requiredCapabilities:n.requiredCapabilities},r)}return new Qb(e,r,i)}},Bd=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"});}constructor(t,e=`Resource not found: ${t}`){super(ee.InvalidParams,e,{uri:t});}get uri(){return this.data.uri}},eT=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"});}constructor(t,e=`URL elicitation${t.length>1?"s":""} required`){super(ee.UrlElicitationRequired,e,{elicitations:t});}get elicitations(){return this.data?.elicitations??[]}},ws=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"});}constructor(t,e=`Unsupported protocol version: ${t.requested}`){super(ee.UnsupportedProtocolVersion,e,t);}get supported(){return this.data.supported}get requested(){return this.data.requested}},Vd=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"});}constructor(t,e=`Missing required client capabilities: ${Object.keys(t.requiredCapabilities).join(", ")}`){super(ee.MissingRequiredClientCapability,e,t);}get requiredCapabilities(){return this.data.requiredCapabilities}},FI=0,BI="private",VI=["tools/call","prompts/get","resources/read"];function jI(t,e){let r=e.resultType;if(r===void 0)return {...e,resultType:"complete"};if(r==="complete"||VI.includes(t))return e;throw new he(ee.InternalError,`Handler for ${t} returned resultType '${String(r)}', but results of ${t} only support 'complete' on protocol revision 2026-07-28`)}function GI(t,e){let r=UI(e);if(e.resultType!=="complete"||!kI(t))return r===void 0?e:ZI(e);let i=e,n=Pv(i.ttlMs)?i.ttlMs:WI(r),s=Nv(i.cacheScope)?i.cacheScope:KI(r),o={...i,ttlMs:n,cacheScope:s};return delete o[bs],o}function HI(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function qI(t,e){if(e===void 0)return t;let r=t._meta;return r===void 0?{...t,_meta:{[bn]:e}}:!HI(r)||r[bn]!==void 0?t:{...t,_meta:{...r,[bn]:e}}}function WI(t){return t!==void 0&&Pv(t.ttlMs)?t.ttlMs:FI}function KI(t){return t!==void 0&&Nv(t.cacheScope)?t.cacheScope:BI}function ZI(t){let e={...t};return delete e[bs],e}var XI=["elicitation/create","sampling/createMessage","roots/list"],zd;function tT(){if(zd)return zd;let t=gi();return zd={request:{"elicitation/create":I({method:D("elicitation/create"),params:t.ElicitRequestParamsSchema}),"sampling/createMessage":I({method:D("sampling/createMessage"),params:t.CreateMessageRequestParamsSchema}),"roots/list":I({method:D("roots/list"),params:de({}).optional()})},response:{"elicitation/create":t.ElicitResultSchema,"sampling/createMessage":t.CreateMessageResultSchema,"roots/list":t.ListRootsResultSchema}},zd}function nT(t){return XI.includes(t)}function yv(t){return nT(t)?tT().request[t]:void 0}function JI(t){return nT(t)?tT().response[t]:void 0}var zv={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},rT={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function iT(t){return Object.prototype.hasOwnProperty.call(zv,t)}function sT(t){return Object.prototype.hasOwnProperty.call(rT,t)}function YI(t){return Object.prototype.hasOwnProperty.call(zv,t)}function QI(t){return iT(t)?gi().dispatchRequestSchemas[t]:void 0}function e1(t){return YI(t)?gi().dispatchResultSchemas[t]:void 0}function t1(t){return sT(t)?gi().notificationSchemas2026[t]:void 0}function Sa(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function va(t,e){if(t===void 0)return {ok:false,reason:"not-in-era"};let r=t.safeParse(e);return r.success?{ok:true,value:r.data}:{ok:false,reason:"invalid",message:String(r.error)}}var n1={ok:false,reason:"not-in-era"},r1=[zn,$n];function i1(t,e){let r=e,i=false,n=()=>(i||(r={...r},i=true),r),s=e.tools;t==="tools/list"&&Array.isArray(s)&&s.some(a=>Sa(a)&&"execution"in a)&&(n().tools=s.map(a=>{if(!Sa(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c}));let o=e.capabilities;if(Sa(o)&&"tasks"in o){let a={...o};delete a.tasks,n().capabilities=a;}return r}var $v={era:"2026-07-28",hasRequestMethod:iT,hasNotificationMethod:sT,hasInputRequestMethod:t=>yv(t)!==void 0,validateRequest:(t,e)=>va(QI(t),e),validateResult:(t,e)=>va(e1(t),e),validateNotification:(t,e)=>va(t1(t),e),validateInputRequest:(t,e)=>va(yv(t),e),validateInputResponse:(t,e)=>va(JI(t),e),samplingResultVariant:()=>n1,outboundEnvelope(t){return {[zn]:t.protocolVersion,[us]:t.clientInfo,[$n]:t.clientCapabilities,...t.logLevel!==void 0&&{[ar]:t.logLevel}}},validateEnvelopeMeta(t){let e=[];for(let i of r1)i in t||e.push({key:i,problem:"missing"});let r=gi().RequestMetaEnvelopeSchema.safeParse(t);if(!r.success)for(let i of r.error.issues){let n=i.path.map(String),s=n.length>0?n.join("."):"_meta";n.length===1&&e.some(o=>o.key===s&&o.problem==="missing")||e.push({key:s,problem:i.message});}return e},projectCallToolResult:t=>Hb(t),inputRequestSchema:yv,decodeResult(t,e){if(!Sa(e))return {kind:"invalid",error:new be(Pe.InvalidResult,`Invalid result for ${t}: not an object`,{method:t})};let r=e.resultType;if(r===void 0)return {kind:"invalid",error:new be(Pe.InvalidResult,`Invalid result for ${t}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:t,violation:"missing-resultType"})};if(typeof r!="string")return {kind:"invalid",error:new be(Pe.InvalidResult,`Invalid result for ${t}: non-string resultType`,{method:t,resultType:r})};if(r==="input_required"){let o=e.inputRequests,a=Sa(o)?o:{},c=e.requestState;return Object.keys(a).length===0&&typeof c!="string"?{kind:"invalid",error:new be(Pe.InvalidResult,`Invalid result for ${t}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:t,violation:"input-required-missing-both"})}:{kind:"input_required",inputRequests:a,...typeof c=="string"&&{requestState:c}}}if(r!=="complete")return {kind:"invalid",error:new be(Pe.UnsupportedResultType,`Unsupported result type '${r}' for ${t}`,{resultType:r,method:t})};let i=s1(),n=Object.hasOwn(i,t)?i[t]:void 0;if(n!==void 0){let o=n.safeParse(e);if(!o.success)return {kind:"invalid",error:new be(Pe.InvalidResult,`Invalid result for ${t}: ${o.error}`,{method:t})}}let s={...e};return delete s.resultType,{kind:"complete",result:s}},encodeResult(t,e,r){return qI(GI(t,jI(t,i1(t,e))),r)},encodeErrorCode:t=>t===-32002?-32602:t,checkInboundEnvelope(t){if(t.envelope===void 0)return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let e=gi().RequestMetaEnvelopeSchema.safeParse(t.envelope);if(!e.success)return `Invalid _meta envelope for protocol revision 2026-07-28: ${e.error.issues.map(r=>r.message).join("; ")}`}},$d;function s1(){if($d)return $d;let t=gi();return $d={"tools/call":t.CallToolResultSchema,"tools/list":t.ListToolsResultSchema,"prompts/get":t.GetPromptResultSchema,"prompts/list":t.ListPromptsResultSchema,"resources/list":t.ListResourcesResultSchema,"resources/templates/list":t.ListResourceTemplatesResultSchema,"resources/read":t.ReadResourceResultSchema,"completion/complete":t.CompleteResultSchema,"server/discover":t.DiscoverResultSchema},$d}var Ra="2026-07-28";function mr(t){return t!==void 0&&Es(t)?$v:Cv}function Ob(t){return t.revision!==void 0?mr(t.revision).era:t.era==="modern"?$v.era:Cv.era}function Sv(t){return oT.some(e=>e.hasRequestMethod(t))}function xv(t){return oT.some(e=>e.hasNotificationMethod(t))}var oT=[Cv,$v];function zb(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function _i(t){if(!zb(t))return;let e=t._meta;return zb(e)?e:void 0}function jd(t){let e=_i(t);return e!==void 0&&zn in e}function Gd(t){let e=_i(t)?.[zn];return typeof e=="string"?e:void 0}function Hd(t){return mr(Ra).validateEnvelopeMeta(t)}var o1=w0({AnnotationsSchema:()=>Dn,AudioContentSchema:()=>_s,BaseMetadataSchema:()=>On,BaseRequestParamsSchema:()=>dt,BlobResourceContentsSchema:()=>oa,BooleanSchemaSchema:()=>da,CallToolRequestParamsSchema:()=>Hu,CallToolRequestSchema:()=>qu,CallToolResultSchema:()=>ua,CancelTaskRequestSchema:()=>rv,CancelTaskResultSchema:()=>iv,CancelledNotificationParamsSchema:()=>Kl,CancelledNotificationSchema:()=>ea,ClientCapabilitiesSchema:()=>Yl,ClientNotificationSchema:()=>ov,ClientRequestSchema:()=>sv,ClientResultSchema:()=>av,ClientTasksCapabilitySchema:()=>Xl,CompatibilityCallToolResultSchema:()=>q_,CompleteRequestParamsSchema:()=>yd,CompleteRequestSchema:()=>Sd,CompleteResultSchema:()=>xd,ContentBlockSchema:()=>vs,CreateMessageRequestParamsSchema:()=>id,CreateMessageRequestSchema:()=>sd,CreateMessageResultSchema:()=>od,CreateMessageResultWithToolsSchema:()=>ad,CreateTaskResultSchema:()=>Z_,CursorSchema:()=>Wo,DiscoverRequestSchema:()=>ru,DiscoverResultSchema:()=>iu,ElicitRequestFormParamsSchema:()=>xs,ElicitRequestParamsSchema:()=>hd,ElicitRequestSchema:()=>fd,ElicitRequestURLParamsSchema:()=>dd,ElicitResultSchema:()=>gd,ElicitationCompleteNotificationParamsSchema:()=>pd,ElicitationCompleteNotificationSchema:()=>md,EmbeddedResourceSchema:()=>Du,EmptyResultSchema:()=>Qo,EnumSchemaSchema:()=>ud,GetPromptRequestParamsSchema:()=>Ou,GetPromptRequestSchema:()=>zu,GetPromptResultSchema:()=>Uu,GetTaskPayloadRequestSchema:()=>Q_,GetTaskPayloadResultSchema:()=>ev,GetTaskRequestSchema:()=>J_,GetTaskResultSchema:()=>Y_,IconSchema:()=>Zl,IconsSchema:()=>lr,ImageContentSchema:()=>gs,ImplementationSchema:()=>fs,InitializeRequestParamsSchema:()=>Ql,InitializeRequestSchema:()=>eu,InitializeResultSchema:()=>tu,InitializedNotificationSchema:()=>nu,JSONArraySchema:()=>j_,JSONObjectSchema:()=>Ye,JSONRPCErrorResponseSchema:()=>hs,JSONRPCMessageSchema:()=>Yo,JSONRPCNotificationSchema:()=>Jo,JSONRPCRequestSchema:()=>Xo,JSONRPCResponseSchema:()=>G_,JSONRPCResultResponseSchema:()=>ds,JSONValueSchema:()=>or,LegacyTitledEnumSchemaSchema:()=>pa,ListChangedOptionsBaseSchema:()=>W_,ListPromptsRequestSchema:()=>Pu,ListPromptsResultSchema:()=>Nu,ListResourceTemplatesRequestSchema:()=>du,ListResourceTemplatesResultSchema:()=>hu,ListResourcesRequestSchema:()=>lu,ListResourcesResultSchema:()=>uu,ListRootsRequestSchema:()=>Td,ListRootsResultSchema:()=>Rd,ListTasksRequestSchema:()=>tv,ListTasksResultSchema:()=>nv,ListToolsRequestSchema:()=>ju,ListToolsResultSchema:()=>Gu,LoggingLevelSchema:()=>fr,LoggingMessageNotificationParamsSchema:()=>Xu,LoggingMessageNotificationSchema:()=>Ju,ModelHintSchema:()=>Yu,ModelPreferencesSchema:()=>Qu,MultiSelectEnumSchemaSchema:()=>ld,NotificationSchema:()=>xt,NotificationsParamsSchema:()=>St,NumberSchemaSchema:()=>Ss,PaginatedRequestParamsSchema:()=>au,PaginatedRequestSchema:()=>ur,PaginatedResultSchema:()=>dr,PingRequestSchema:()=>na,PrimitiveSchemaDefinitionSchema:()=>_a,ProgressNotificationParamsSchema:()=>ou,ProgressNotificationSchema:()=>ra,ProgressSchema:()=>su,ProgressTokenSchema:()=>qo,PromptArgumentSchema:()=>Iu,PromptListChangedNotificationSchema:()=>Fu,PromptMessageSchema:()=>ku,PromptReferenceSchema:()=>vd,PromptSchema:()=>Cu,ReadResourceRequestParamsSchema:()=>fu,ReadResourceRequestSchema:()=>pu,ReadResourceResultSchema:()=>mu,RelatedTaskMetadataSchema:()=>Wl,RequestIdSchema:()=>cr,RequestMetaSchema:()=>Ko,RequestSchema:()=>Qe,ResourceContentsSchema:()=>ia,ResourceLinkSchema:()=>Lu,ResourceListChangedNotificationSchema:()=>gu,ResourceRequestParamsSchema:()=>ps,ResourceSchema:()=>aa,ResourceTemplateReferenceSchema:()=>_d,ResourceTemplateSchema:()=>cu,ResourceUpdatedNotificationParamsSchema:()=>Mu,ResourceUpdatedNotificationSchema:()=>Au,ResultMetaObjectSchema:()=>Zo,ResultSchema:()=>et,RoleSchema:()=>hr,RootSchema:()=>bd,RootsListChangedNotificationSchema:()=>Ed,SamplingContentSchema:()=>nd,SamplingMessageContentBlockSchema:()=>ui,SamplingMessageSchema:()=>rd,ServerCapabilitiesSchema:()=>ta,ServerNotificationSchema:()=>lv,ServerRequestSchema:()=>cv,ServerResultSchema:()=>uv,ServerTasksCapabilitySchema:()=>Jl,SetLevelRequestParamsSchema:()=>Ku,SetLevelRequestSchema:()=>Zu,SingleSelectEnumSchemaSchema:()=>cd,StringSchemaSchema:()=>ys,SubscribeRequestParamsSchema:()=>_u,SubscribeRequestSchema:()=>vu,SubscriptionFilterSchema:()=>ca,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Tu,SubscriptionsAcknowledgedNotificationSchema:()=>Ru,SubscriptionsListenRequestParamsSchema:()=>xu,SubscriptionsListenRequestSchema:()=>bu,SubscriptionsListenResultMetaSchema:()=>Eu,SubscriptionsListenResultSchema:()=>wu,TaskAugmentedRequestParamsSchema:()=>pi,TaskCreationParamsSchema:()=>K_,TaskMetadataSchema:()=>ql,TaskSchema:()=>pr,TaskStatusNotificationParamsSchema:()=>Md,TaskStatusNotificationSchema:()=>X_,TaskStatusSchema:()=>wd,TextContentSchema:()=>ms,TextResourceContentsSchema:()=>sa,TitledMultiSelectEnumSchemaSchema:()=>ga,TitledSingleSelectEnumSchemaSchema:()=>fa,ToolAnnotationsSchema:()=>Bu,ToolChoiceSchema:()=>ed,ToolExecutionSchema:()=>Vu,ToolListChangedNotificationSchema:()=>Wu,ToolResultContentSchema:()=>td,ToolSchema:()=>la,ToolUseContentSchema:()=>$u,UnsubscribeRequestParamsSchema:()=>yu,UnsubscribeRequestSchema:()=>Su,UntitledMultiSelectEnumSchemaSchema:()=>ma,UntitledSingleSelectEnumSchemaSchema:()=>ha});var Xt=t=>Xo.safeParse(t).success,_r=t=>Jo.safeParse(t).success,ba=t=>ds.safeParse(t).success,qd=t=>hs.safeParse(t).success;var Ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t)&&t.resultType==="input_required";function Dv(t){if(t.params.ref.type!=="ref/prompt")throw new TypeError(`Expected CompleteRequestPrompt, but got ${t.params.ref.type}`)}function Lv(t){if(t.params.ref.type!=="ref/resource")throw new TypeError(`Expected CompleteRequestResourceTemplate, but got ${t.params.ref.type}`)}var $b="x-mcp-header",a1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,c1=new Set(["string","integer","boolean","number"]);function kv(t){let e=[],r=new Map,i=(s,o,a)=>{if(s===null||typeof s!="object")return;let c=s;if($b in c){if(!a||o.length===0)return `${Dd(o)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let u=c[$b];if(typeof u!="string"||u.length===0)return `${Dd(o)}: x-mcp-header MUST be a non-empty string`;if(!a1.test(u))return `${Dd(o)}: x-mcp-header '${u}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let d=typeof c.type=="string"?c.type:void 0;if(d===void 0||!c1.has(d))return `${Dd(o)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${d??"<none>"}`;let f=u.toLowerCase(),p=r.get(f);if(p!==void 0)return `x-mcp-header '${u}' is not case-insensitively unique (also declared as '${p}')`;r.set(f,u),e.push({path:o,headerName:u,type:d});}let l=c.properties;if(l!==null&&typeof l=="object")for(let[u,d]of Object.entries(l)){let f=i(d,[...o,u],a);if(f!==void 0)return f}for(let u of l1){let d=c[u];if(d===void 0)continue;let f=Array.isArray(d)?d:d!==null&&typeof d=="object"&&u1.has(u)?Object.values(d):[d];for(let p of f){let g=i(p,[...o,`<${u}>`],false);if(g!==void 0)return g}}},n=i(t,[],true);return n===void 0?{valid:true,declarations:e}:{valid:false,reason:n}}var l1=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],u1=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Dd(t){return t.length===0?"<root>":t.join(".")}var kd=-32020;[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32e3],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[ee.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[kd,ee.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[ee.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[ee.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[ee.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[kd],conformance:["http-header-validation"],rationale:"SEP-2243 standard `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[ee.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[kd],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}];({[ee.ParseError]:400,[ee.InvalidRequest]:400,[ee.MethodNotFound]:404,[ee.UnsupportedProtocolVersion]:400,[ee.MissingRequiredClientCapability]:400});function Ld(t,e,r,i,n){return {kind:"reject",rung:t,cell:e,httpStatus:r,code:i.code,message:i.message,...i.data!==void 0&&{data:i.data},settled:n}}function Uv(t){if(!jd(t))return false;let e=Gd(t);if(e===void 0||!Es(e))return false;let r=_i(t);return r!==void 0&&Hd(r).length===0}function Fv(t,e){switch(t.reason){case "http-method":return Ld("http-method","modern-only-method-not-allowed",405,new he(-32e3,"Method not allowed."),true);case "batch":return Ld("jsonrpc-shape","modern-only-batch-not-supported",400,new he(ee.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),true);case "response":return Ld("jsonrpc-shape","modern-only-response-post",400,new he(ee.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),true);case "notification":return;case "initialize":case "no-claim":{let r=t.requestedVersion;return Ld("era-classification","modern-only-missing-envelope",400,r===void 0?new he(ee.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...e]}):new ws({supported:[...e],requested:r}),true)}}}function Wd(t,e){return zo(t,e)}function ya(t){return new Set(t.flatMap(e=>Object.keys(e.shape)))}function Rs(t){if(t==null)return false;let e=typeof t;return e!=="object"&&e!=="function"||!("~standard"in t)?false:typeof t["~standard"]?.validate=="function"}var Db=false,Rv="draft-2020-12";function vr(t,e="input"){let r=t["~standard"],i;if(r.jsonSchema)i=r.jsonSchema[e]({target:Rv});else if(r.vendor==="zod"){if(!("_zod"in t))throw new Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");Db||(Db=true,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),i=ci(t,{target:Rv,io:e});}else throw new Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(e==="output")return i.type!==void 0?i:aT(i)?{type:"object",...i}:i;if(i.type!==void 0&&i.type!=="object")throw new Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(i.type)}). Wrap your schema in z.object({...}) or equivalent.`);return {type:"object",...i}}function aT(t){if("properties"in t||"patternProperties"in t||"additionalProperties"in t||"required"in t)return true;for(let e of ["oneOf","anyOf","allOf"]){let r=t[e];if(Array.isArray(r)&&r.length>0)return r.every(i=>i!==null&&typeof i=="object"&&(i.type==="object"||aT(i)))}return false}function h1(t){return t.path?.length?`${t.path.map(e=>String(typeof e=="object"?e.key:e)).join(".")}: ${t.message}`:t.message}async function mi(t,e){let r=await t["~standard"].validate(e);return r.issues&&r.issues.length>0?{success:false,error:r.issues.map(i=>h1(i)).join(", ")}:{success:true,data:r.value}}function f1(t){let e=ci(t,{target:Rv,io:"input"});return typeof e.pattern=="string"?e.pattern:void 0}var p1=/\\\.\\d\{(\d+)\}/;function m1(t){let e=p1.exec(t),r=[void 0,-1,0];return e&&r.push(Number(e[1])),[false,true].flatMap(i=>[false,true].flatMap(n=>r.map(s=>jt.datetime({local:i,offset:n,precision:s}))))}function g1(t,e){let r;switch(t){case "email":r=[bl()];break;case "uri":r=[ss()];break;case "date":r=[jt.date()];break;case "date-time":r=m1(e);break}return new Set(r.map(i=>f1(i)).filter(i=>i!==void 0))}function _1(t,e,r){return r!=="zod"?true:g1(t,e).has(e)}function cT(t){let e=vr(t,"input"),r=e.properties||{},i=e.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:i.includes(n)}))}function Ta(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function v1(t){try{return vr(t,"input")}catch(e){let r=e instanceof Error?e.message:String(e);throw new he(ee.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var y1=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function Bv(t){return y1.has(t)||t.startsWith("x-")}var S1=new Set(["$schema",...Object.keys(xs.shape.requestedSchema.shape)]),Lb={string:ya([ys,ha,fa,pa]),number:ya([Ss]),integer:ya([Ss]),boolean:ya([da]),array:ya([ma,ga])},x1=new Set(ys.shape.format.unwrap().options);function b1(t,e,r,i){if(!Ta(t))return t;let n=typeof t.type=="string"&&Object.hasOwn(Lb,t.type)?Lb[t.type]:void 0;if(n===void 0)return t;let s={};for(let[o,a]of Object.entries(t))n.has(o)||Bv(o)?s[o]=a:o==="pattern"&&t.type==="string"&&typeof t.format=="string"?x1.has(t.format)?(typeof a!="string"||!_1(t.format,a,r))&&i.push(`${e}.${o}`):s[o]=a:i.push(`${e}.${o}`);return s}function T1(t,e){let r={},i=[];for(let[n,s]of Object.entries(t))n==="properties"&&Ta(s)?r[n]=Object.fromEntries(Object.entries(s).map(([o,a])=>[o,b1(a,`properties.${o}`,e,i)])):S1.has(n)?r[n]=s:Bv(n)||i.push(n);if(i.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(", ")}`);return r}function R1(t,e){if(!Ta(t.properties))return e;let r=Object.entries(t.properties).filter(([,i])=>!Wd(_a,i).success).map(([i])=>`properties.${i}`);return r.length>0?r.join(", "):e}function Ev(t,e,r=""){return Array.isArray(t)&&Array.isArray(e)?t.flatMap((i,n)=>Ev(i,e[n],`${r}[${n}]`)):!Ta(t)||!Ta(e)?[]:Object.entries(t).flatMap(([i,n])=>{let s=r?`${r}.${i}`:i;return Object.prototype.hasOwnProperty.call(e,i)?Ev(n,e[i],s):Bv(i)?[]:[s]})}function E1(t){if(!Rs(t.requestedSchema))return {...t,mode:"form",requestedSchema:t.requestedSchema};let e=t.requestedSchema["~standard"].vendor,r=T1(v1(t.requestedSchema),e),i=Wd(xs.shape.requestedSchema,r);if(!i.success)throw new he(ee.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${R1(r,i.error.message)}`);let n=Ev(r,i.data);if(n.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(i.data.required??[]).filter(o=>!Object.prototype.hasOwnProperty.call(i.data.properties,o));if(s.length>0)throw new he(ee.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return {...t,mode:"form",requestedSchema:i.data}}function w1(t){let e=t.inputRequests!==void 0&&Object.keys(t.inputRequests).length>0,r=typeof t.requestState=="string";if(!e&&!r)throw new TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return {resultType:"input_required",...t.inputRequests!==void 0&&{inputRequests:t.inputRequests},...t.requestState!==void 0&&{requestState:t.requestState}}}Object.assign(w1,{elicit(t){try{return {method:"elicitation/create",params:E1(t)}}catch(e){throw e instanceof he?new TypeError(e.message,{cause:e}):e}},elicitUrl(t){return {method:"elicitation/create",params:{...t,mode:"url"}}},createMessage(t){return {method:"sampling/createMessage",params:t}},listRoots(){return {method:"roots/list"}}});var lT=250;function uT(t,e){return `Multi-round-trip request '${t}' still required input after ${e} rounds (inputRequired.maxRounds)`}function dT(t,e){return new Promise((r,i)=>{if(e?.aborted){i(e.reason instanceof be?e.reason:new be(Pe.RequestTimeout,String(e.reason)));return}let n=setTimeout(()=>{e?.removeEventListener("abort",s),r();},t),s=()=>{clearTimeout(n),i(e?.reason instanceof be?e.reason:new be(Pe.RequestTimeout,String(e?.reason)));};e?.addEventListener("abort",s,{once:true});})}function hT(t){let e=new AbortController,r=()=>e.abort(t?.reason);return t?.addEventListener("abort",r,{once:true}),t?.aborted&&e.abort(t.reason),{signal:e.signal,abort:i=>e.abort(i),dispose:()=>t?.removeEventListener("abort",r)}}var A1=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],I1={IdJagTokenExchangeResponseSchema:pv,OAuthClientInformationFullSchema:gv,OAuthClientInformationSchema:Pd,OAuthClientMetadataSchema:Cd,OAuthClientRegistrationErrorSchema:_v,OAuthErrorResponseSchema:mv,OAuthMetadataSchema:Ad,OAuthProtectedResourceMetadataSchema:dv,OAuthTokenRevocationRequestSchema:vv,OAuthTokensSchema:fv,OpenIdProviderDiscoveryMetadataSchema:hv,OpenIdProviderMetadataSchema:Id},fT={},pT={};function mT(t,e){let r=t.slice(0,-6);fT[r]=e,pT[r]=i=>e.safeParse(i).success;}for(let t of A1)mT(t,o1[t]);for(let[t,e]of Object.entries(I1))mT(t,e);Object.freeze(fT);Object.freeze(pT);function N1(t){switch(t){case "initialize":case "notifications/initialized":return mr(void 0);case "server/discover":return mr(Ra);default:return}}var gT=6e4,O1=[zn,us,$n,ar],z1=["inputResponses","requestState"];function kb(t,e){let r=t.params;if(!xa(r))return {message:t,lifted:{}};let i=r._meta,n=xa(i)?O1.filter(c=>c in i):[],s=e==="request"?z1.filter(c=>c in r):[];if(n.length===0&&s.length===0)return {message:t,lifted:{}};let o={},a={...r};if(n.length>0&&xa(i)){let c={},l={...i};for(let u of n)c[u]=i[u],delete l[u];o.envelope=c,Object.keys(l).length>0?a._meta=l:delete a._meta;}for(let c of s)c==="inputResponses"&&(o.inputResponses=a[c]),c==="requestState"&&(o.requestState=a[c]),delete a[c];return {message:{...t,params:a},lifted:o}}function Ub(t,e){let r=t.validateResult(e,void 0);if(!(!r.ok&&r.reason==="not-in-era"))return {"~standard":{version:1,vendor:"mcp-wire-codec",validate(i){let n=t.validateResult(e,i);return n.ok?{value:n.value}:{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${e}`}]}}}}}function Ea(t){return ()=>t}var $1=Ea(void 0);function Vv(t,e){return {...t,mcpReq:{...t.mcpReq,requestState:Ea(e)}}}var _T;function jv(t,e){_T(t,e);}var Gv=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{_T=(t,e)=>{t._negotiatedProtocolVersion=e;};}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(t){this._options=t,this._supportedProtocolVersions=t?.supportedProtocolVersions??Gl,this.setNotificationHandler("notifications/cancelled",e=>{this._oncancel(e);}),this.setNotificationHandler("notifications/progress",e=>{this._onprogress(e);}),this.setRequestHandler("ping",e=>({}));}_shouldDropInbound(t){}_outboundMetaEnvelope(){}_envelopeOutbound(t){let e=this._outboundMetaEnvelope();if(e===void 0)return t;let r=t.params??{};return {...t,params:{...r,_meta:{...e,...r._meta}}}}_resolveNonCompleteResult(t,e){return Promise.reject(new be(Pe.UnsupportedResultType,`Unsupported result type '${t.kind}' for ${e.request.method}`,{resultType:t.kind,method:e.request.method}))}_getRequestHandler(t){return this._requestHandlers.get(t)}async _oncancel(t){t.params.requestId&&this._requestHandlerAbortControllers.get(t.params.requestId)?.abort(t.params.reason);}_setupTimeout(t,e,r,i,n=false){this._timeoutInfo.set(t,{timeoutId:setTimeout(i,e),startTime:Date.now(),timeout:e,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i});}_resetTimeout(t){let e=this._timeoutInfo.get(t);if(!e)return false;let r=Date.now()-e.startTime;if(e.maxTotalTimeout&&r>=e.maxTotalTimeout)throw this._timeoutInfo.delete(t),new be(Pe.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:e.maxTotalTimeout,totalElapsed:r});return clearTimeout(e.timeoutId),e.timeoutId=setTimeout(e.onTimeout,e.timeout),true}_cleanupTimeout(t){let e=this._timeoutInfo.get(t);e&&(clearTimeout(e.timeoutId),this._timeoutInfo.delete(t));}async connect(t){this._transport=t;let e=this.transport?.onclose;this._transport.onclose=()=>{try{e?.();}finally{this._onclose();}};let r=this.transport?.onerror;this._transport.onerror=n=>{r?.(n),this._onerror(n);};let i=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{i?.(n,s),ba(n)||qd(n)?this._onresponse(n):Xt(n)?this._onrequest(n,s):_r(n)?this._onnotification(n,s):this._onerror(new Error(`Unknown message type: ${JSON.stringify(n)}`));},t.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start();}_onclose(){let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let i of this._timeoutInfo.values())clearTimeout(i.timeoutId);this._timeoutInfo.clear();let e=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new be(Pe.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.();}finally{for(let i of t.values())i(r);for(let i of e.values())i.abort(r);}}_onerror(t){this.onerror?.(t);}_onnotification(t,e){let{message:r}=kb(t,"notification"),i=this._negotiatedWireCodec();if(e?.classification===void 0&&this._shouldDropInbound(t)==="drop")return;if(e?.classification!==void 0){let o=Ob(e.classification);if(o!==i.era){this._onerror(new Error(`Era mismatch on inbound notification '${r.method}': classified as ${o} but this instance serves ${i.era}`));return}}if(xv(r.method)&&!i.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;n===void 0&&s===void 0||Promise.resolve().then(()=>n===void 0?s(r):n(r,i)).catch(o=>this._onerror(new Error(`Uncaught error in notification handler: ${o}`)));}_onrequest(t,e){let{message:r,lifted:i}=kb(t,"request"),n=this._negotiatedWireCodec();if(e?.classification===void 0&&this._shouldDropInbound(t)==="drop"){this._onerror(new Error(`Dropped inbound request '${t.method}': not servable on this connection's protocol era`));return}let s=this._transport,o=(m,S,h)=>{let v={jsonrpc:"2.0",id:r.id,error:{code:m,message:S,...h!==void 0&&{data:h}}};s?.send(v).catch(_=>this._onerror(new Error(`Failed to send an error response: ${_}`)));};if(e?.classification!==void 0){let m=Ob(e.classification);if(m!==n.era){this._onerror(new Error(`Era mismatch on inbound request '${r.method}': classified as ${m} but this instance serves ${n.era}`));let S=e.classification.revision??m;o(ee.UnsupportedProtocolVersion,`Unsupported protocol version: ${S}`,{supported:this._supportedProtocolVersions,requested:S});return}}if(Sv(r.method)&&!n.hasRequestMethod(r.method)){o(ee.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){o(ee.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(i);if(c!==void 0){o(ee.InvalidParams,c);return}let l=(m,S)=>this._notificationViaCodec(this._resolveOutboundCodec(m.method),m,{...S,relatedRequestId:r.id}),u=(m,S,h)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(m.method),m,S,{...h,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let f=i.inputResponses===void 0?void 0:D1(i.inputResponses),p={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...i.envelope!==void 0&&{envelope:i.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:i.requestState===void 0?$1:Ea(i.requestState),signal:d.signal,send:((m,S,h)=>{let v=this._resolveOutboundCodec(m.method);if(this._assertOutboundRequestInEra(v,m.method),Rs(S))return u(m,S,h);let _=Ub(v,m.method);if(_===void 0)throw new TypeError(`'${m.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(m,_,S)}),notify:l},http:e?.authInfo?{authInfo:e.authInfo}:void 0},g=this.buildContext(p,e);Promise.resolve().then(()=>a(r,g)).then(async m=>{if(d.signal.aborted)return;let S;try{S=n.encodeResult(r.method,m,this._outboundServerInfo());}catch(v){this._onerror(new Error(`Failed to encode result for ${r.method}: ${v}`)),o(ee.InternalError,"Internal error");return}let h={result:S,jsonrpc:"2.0",id:r.id};await s?.send(h);},async m=>{if(d.signal.aborted)return;let S=Number.isSafeInteger(m.code)?m.code:ee.InternalError,h={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(S),message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};await s?.send(h);}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.get(r.id)===d&&this._requestHandlerAbortControllers.delete(r.id);});}_onprogress(t){let{progressToken:e,...r}=t.params,i=Number(e),n=this._progressHandlers.get(i);if(!n){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}let s=this._responseHandlers.get(i),o=this._timeoutInfo.get(i);if(o&&s&&o.resetTimeoutOnProgress)try{this._resetTimeout(i);}catch(a){this._responseHandlers.delete(i),this._progressHandlers.delete(i),this._cleanupTimeout(i),s(a);return}n(r);}_onresponse(t){let e=Number(t.id),r=this._responseHandlers.get(e);if(r===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(e),this._cleanupTimeout(e),this._progressHandlers.delete(e),ba(t)?r(t):r(he.fromError(t.error.code,t.error.message,t.error.data));}get transport(){return this._transport}async close(){await this._transport?.close();}request(t,e,r){let i=this._resolveOutboundCodec(t.method);if(this._assertOutboundRequestInEra(i,t.method),Rs(e))return this._requestWithSchemaViaCodec(i,t,e,r);let n=Ub(i,t.method);if(n===void 0)throw new TypeError(`'${t.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(i,t,n,e)}_negotiatedWireCodec(){return mr(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(t){if(this._negotiatedProtocolVersion===void 0){let e=N1(t);if(e)return e}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(t,e){if(Sv(e)&&!t.hasRequestMethod(e))throw new be(Pe.MethodNotSupportedByProtocolVersion,`Method '${e}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:e,era:t.era})}_requestWithSchema(t,e,r){let i=this._resolveOutboundCodec(t.method);return this._assertOutboundRequestInEra(i,t.method),this._requestWithSchemaViaCodec(i,t,e,r)}_requestWithSchemaViaCodec(t,e,r,i){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o,headers:a}=i??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=T=>{f(T);};if(!this._transport){p(new Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===true)try{this.assertCapabilityForMethod(e.method);}catch(T){p(T);return}if(i?.signal?.aborted){let T=i.signal.reason;throw T instanceof be?T:new be(Pe.RequestTimeout,String(T))}let g=t.era===Ra&&this._transport.hasPerRequestStream===true?new AbortController:void 0,m=this._requestMessageId++;u=m;let S={...e,jsonrpc:"2.0",id:m};i?.onprogress&&(this._progressHandlers.set(m,i.onprogress),S.params={...e.params,_meta:{...e.params?._meta,progressToken:m}});let h=this._envelopeOutbound(S),v=false,_=T=>{v||(this._progressHandlers.delete(m),g===void 0?this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(T)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o}).catch(b=>this._onerror(new Error(`Failed to send cancellation: ${b}`))):g.abort(),f(T instanceof be?T:new be(Pe.RequestTimeout,String(T))));};this._responseHandlers.set(m,T=>{if(i?.signal?.aborted)return;if(v=true,T instanceof Error)return f(T);let b;try{b=t.decodeResult(e.method,T.result);}catch(M){return f(M instanceof Error?M:new Error(String(M)))}if(b.kind==="invalid")return f(b.error);if(b.kind==="input_required"){if(i?.allowInputRequired===true)return d(L1(b));let M={codec:t,request:e,resultSchema:r,options:i,flowStartedAt:c,retry:(N,O)=>this._requestWithSchemaViaCodec(t,N===void 0?{method:e.method}:{method:e.method,params:N},r,O)};return d(this._resolveNonCompleteResult(b,M))}let E=b.result;mi(r,E).then(M=>{M.success?d(M.data):f(new be(Pe.InvalidResult,`Invalid result for ${e.method}: ${M.error}`));},f);}),l=()=>_(i?.signal?.reason),i?.signal?.addEventListener("abort",l,{once:true});let y=i?.timeout??gT,R=()=>_(new be(Pe.RequestTimeout,"Request timed out",{timeout:y}));this._setupTimeout(m,y,i?.maxTotalTimeout,R,i?.resetTimeoutOnProgress??false),this._transport.send(h,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:o,headers:a,requestSignal:g?.signal}).catch(T=>{this._progressHandlers.delete(m),f(T);});}).finally(()=>{l&&i?.signal?.removeEventListener("abort",l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u));})}async notification(t,e){return this._notificationViaCodec(this._resolveOutboundCodec(t.method),t,e)}async _notificationViaCodec(t,e,r){if(!this._transport)throw new be(Pe.NotConnected,"Not connected");if(xv(e.method)&&!t.hasNotificationMethod(e.method))throw new be(Pe.MethodNotSupportedByProtocolVersion,`Notification '${e.method}' is not supported by the negotiated protocol version (wire era ${t.era})`,{method:e.method,era:t.era});this.assertNotificationCapability(e.method);let i=this._envelopeOutbound({jsonrpc:"2.0",...e});if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(e.method),this._transport&&this._transport?.send(i,r).catch(n=>this._onerror(n));});return}await this._transport.send(i,r);}setRequestHandler(t,e,r){this.assertRequestHandlerCapability(t);let i;if(typeof e=="function"){if(!Sv(t))throw new TypeError(`'${t}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);i=(n,s)=>{let o=this._negotiatedWireCodec(),a=o.validateRequest(t,n);if(!a.ok&&a.reason==="not-in-era"&&(a=o.validateInputRequest(t,n)),!a.ok)throw a.reason==="not-in-era"?new he(ee.InternalError,`No wire schema for ${t} in the resolved era`):new Error(a.message);return Promise.resolve(e(a.value,s))};}else if(r)i=async(n,s)=>{let o=await mi(e.params,{...n.params});if(!o.success)throw new he(ee.InvalidParams,`Invalid params for ${t}: ${o.error}`);return r(o.data,s)};else throw new TypeError("setRequestHandler: handler is required");this._requestHandlers.set(t,this._wrapHandler(t,i));}_wrapHandler(t,e){return e}_outboundServerInfo(){}removeRequestHandler(t){this._requestHandlers.delete(t);}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,e,r){if(typeof e=="function"){if(!xv(t))throw new TypeError(`'${t}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(t,(i,n)=>{let s=n.validateNotification(t,i);if(!s.ok)throw s.reason==="not-in-era"?new he(ee.InternalError,`No wire schema for ${t} in the resolved era`):new Error(s.message);return Promise.resolve(e(s.value))});return}if(!r)throw new TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(t,async i=>{let n=await mi(e.params,{...i.params});if(!n.success)throw new he(ee.InvalidParams,`Invalid params for notification ${t}: ${n.error}`);await r(n.data,i);});}removeNotificationHandler(t){this._notificationHandlers.delete(t);}};function xa(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function Hv(t,e){let r={...t};for(let i in e){let n=i,s=e[n];if(s===void 0)continue;let o=r[n];r[n]=xa(o)&&xa(s)?{...o,...s}:s;}return r}function Fb(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function D1(t){let e={},r=[];if(!Fb(t))return {accepted:e,droppedKeys:r};for(let[i,n]of Object.entries(t)){if(!Fb(n)||"method"in n||"result"in n){r.push(i);continue}e[i]=n;}return {accepted:e,droppedKeys:r}}function L1(t){return {resultType:"input_required",inputRequests:t.inputRequests,...t.requestState!==void 0&&{requestState:t.requestState}}}var k1=W((t=>{var e=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,i=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;t.parse=n;function n(a){if(!a)throw new TypeError("argument string is required");var c=typeof a=="object"?s(a):a;if(typeof c!="string")throw new TypeError("argument string is required to be a string");var l=c.indexOf(";"),u=l!==-1?c.slice(0,l).trim():c.trim();if(!i.test(u))throw new TypeError("invalid media type");var d=new o(u.toLowerCase());if(l!==-1){var f,p,g;for(e.lastIndex=l;p=e.exec(c);){if(p.index!==l)throw new TypeError("invalid parameter format");l+=p[0].length,f=p[1].toLowerCase(),g=p[2],g.charCodeAt(0)===34&&(g=g.slice(1,-1),g.indexOf("\\")!==-1&&(g=g.replace(r,"$1"))),d.parameters[f]=g;}if(l!==c.length)throw new TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader=="function"?c=a.getHeader("content-type"):typeof a.headers=="object"&&(c=a.headers&&a.headers["content-type"]),typeof c!="string")throw new TypeError("content-type header is missing from object");return c}function o(a){this.parameters=Object.create(null),this.type=a;}}));ac(k1());var vT=10*1024*1024,qv=class{_buffer;_maxBufferSize;constructor(t){this._maxBufferSize=t?.maxBufferSize??vT;}append(t){if((this._buffer?.length??0)+t.length>this._maxBufferSize)throw this.clear(),new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,t]):t;}readMessage(){for(;this._buffer;){let t=this._buffer.indexOf(`
|
|
67
|
+
`);if(t===-1)return null;let e=this._buffer.toString("utf8",0,t).replace(/\r$/,"");this._buffer=this._buffer.subarray(t+1);try{return yT(e)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0;}};function yT(t){return Yo.parse(JSON.parse(t))}function Wv(t){return JSON.stringify(t)+`
|
|
68
|
+
`}var U1=/^[A-Za-z0-9._-]{1,128}$/;function F1(t){let e=[];if(t.length===0)return {isValid:false,warnings:["Tool name cannot be empty"]};if(t.length>128)return {isValid:false,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${t.length})`]};if(t.includes(" ")&&e.push("Tool name contains spaces, which may cause parsing issues"),t.includes(",")&&e.push("Tool name contains commas, which may cause parsing issues"),(t.startsWith("-")||t.endsWith("-"))&&e.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts"),(t.startsWith(".")||t.endsWith("."))&&e.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts"),!U1.test(t)){let r=[...t].filter(i=>!/[A-Za-z0-9._-]/.test(i)).filter((i,n,s)=>s.indexOf(i)===n);return e.push(`Tool name contains invalid characters: ${r.map(i=>`"${i}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:false,warnings:e}}return {isValid:true,warnings:e}}function B1(t,e){if(e.length>0){console.warn(`Tool name validation warning for "${t}":`);for(let r of e)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.");}}function Kv(t){let e=F1(t);return B1(t,e.warnings),e.isValid}function V1(t){return typeof t=="object"&&t!==null&&"_zod"in t}function j1(t){return typeof t=="object"&&t!==null&&!("_zod"in t)&&"_def"in t&&typeof t._def?.typeName=="string"}function G1(t){if(typeof t!="object"||t===null||Rs(t))return false;let e=Object.getPrototypeOf(t);return e!==Object.prototype&&e!==null?false:Object.values(t).every(r=>V1(r))}function Kd(t){if(t!==void 0){if(G1(t))return I(t);if(typeof t=="object"&&t!==null&&!Rs(t)&&Object.values(t).some(e=>j1(e)))throw new TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!Rs(t))throw new TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return t}}var Xd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;var e=class{};t._CodeOrName=e,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends e{constructor(h){if(super(),!t.IDENTIFIER.test(h))throw new Error("CodeGen: name must be a valid identifier");this.str=h;}toString(){return this.str}emptyStr(){return false}get names(){return {[this.str]:1}}};t.Name=r;var i=class extends e{constructor(h){super(),this._items=typeof h=="string"?[h]:h;}toString(){return this.str}emptyStr(){if(this._items.length>1)return false;let h=this._items[0];return h===""||h==='""'}get str(){var h;return (h=this._str)!==null&&h!==void 0?h:this._str=this._items.reduce((v,_)=>`${v}${_}`,"")}get names(){var h;return (h=this._names)!==null&&h!==void 0?h:this._names=this._items.reduce((v,_)=>(_ instanceof r&&(v[_.str]=(v[_.str]||0)+1),v),{})}};t._Code=i,t.nil=new i("");function n(h,...v){let _=[h[0]],y=0;for(;y<v.length;)a(_,v[y]),_.push(h[++y]);return new i(_)}t._=n;let s=new i("+");function o(h,...v){let _=[p(h[0])],y=0;for(;y<v.length;)_.push(s),a(_,v[y]),_.push(s,p(h[++y]));return c(_),new i(_)}t.str=o;function a(h,v){v instanceof i?h.push(...v._items):v instanceof r?h.push(v):h.push(d(v));}t.addCodeArg=a;function c(h){let v=1;for(;v<h.length-1;){if(h[v]===s){let _=l(h[v-1],h[v+1]);if(_!==void 0){h.splice(v-1,3,_);continue}h[v++]="+";}v++;}}function l(h,v){if(v==='""')return h;if(h==='""')return v;if(typeof h=="string")return v instanceof r||h[h.length-1]!=='"'?void 0:typeof v!="string"?`${h.slice(0,-1)}${v}"`:v[0]==='"'?h.slice(0,-1)+v.slice(1):void 0;if(typeof v=="string"&&v[0]==='"'&&!(h instanceof r))return `"${h}${v.slice(1)}`}function u(h,v){return v.emptyStr()?h:h.emptyStr()?v:o`${h}${v}`}t.strConcat=u;function d(h){return typeof h=="number"||typeof h=="boolean"||h===null?h:p(Array.isArray(h)?h.join(","):h)}function f(h){return new i(p(h))}t.stringify=f;function p(h){return JSON.stringify(h).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.safeStringify=p;function g(h){return typeof h=="string"&&t.IDENTIFIER.test(h)?new i(`.${h}`):n`[${h}]`}t.getProperty=g;function m(h){if(typeof h=="string"&&t.IDENTIFIER.test(h))return new i(`${h}`);throw new Error(`CodeGen: invalid export name: ${h}, use explicit $id name mapping`)}t.getEsmExportName=m;function S(h){return new i(h.toString())}t.regexpCode=S;})),ST=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let e=Xd();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`),this.value=c.value;}},i;((function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed";}))(i||(t.UsedValueState=i={})),t.varKinds={const:new e.Name("const"),let:new e.Name("let"),var:new e.Name("var")};var n=class{constructor({prefixes:c,parent:l}={}){this._names={},this._prefixes=c,this._parent=l;}toName(c){return c instanceof e.Name?c:this.name(c)}name(c){return new e.Name(this._newName(c))}_newName(c){let l=this._names[c]||this._nameGroup(c);return `${c}${l.index++}`}_nameGroup(c){var l,u;if(!((u=(l=this._parent)===null||l===void 0?void 0:l._prefixes)===null||u===void 0)&&u.has(c)||this._prefixes&&!this._prefixes.has(c))throw new Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};t.Scope=n;var s=class extends e.Name{constructor(c,l){super(l),this.prefix=c;}setValue(c,{property:l,itemIndex:u}){this.value=c,this.scopePath=(0, e._)`.${new e.Name(l)}[${u}]`;}};t.ValueScopeName=s;let o=(0, e._)`\n`;var a=class extends n{constructor(c){super(c),this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?o:e.nil};}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,l){var u;if(l.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:f}=d,p=(u=l.key)!==null&&u!==void 0?u:l.ref,g=this._values[f];if(g){let h=g.get(p);if(h)return h}else g=this._values[f]=new Map;g.set(p,d);let m=this._scope[f]||(this._scope[f]=[]),S=m.length;return m[S]=l.ref,d.setValue(l,{property:f,itemIndex:S}),d}getValue(c,l){let u=this._values[c];if(u)return u.get(l)}scopeRefs(c,l=this._values){return this._reduceValues(l,u=>{if(u.scopePath===void 0)throw new Error(`CodeGen: name "${u}" has no value`);return (0, e._)`${c}${u.scopePath}`})}scopeCode(c=this._values,l,u){return this._reduceValues(c,d=>{if(d.value===void 0)throw new Error(`CodeGen: name "${d}" has no value`);return d.value.code},l,u)}_reduceValues(c,l,u={},d){let f=e.nil;for(let p in c){let g=c[p];if(!g)continue;let m=u[p]=u[p]||new Map;g.forEach(S=>{if(m.has(S))return;m.set(S,i.Started);let h=l(S);if(h){let v=this.opts.es5?t.varKinds.var:t.varKinds.const;f=(0, e._)`${f}${v} ${S} = ${h};${this.opts._n}`;}else if(h=d?.(S))f=(0, e._)`${f}${h}${this.opts._n}`;else throw new r(S);m.set(S,i.Completed);});}return f}};t.ValueScope=a;})),Te=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let e=Xd(),r=ST();var i=Xd();Object.defineProperty(t,"_",{enumerable:true,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:true,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:true,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:true,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return i.Name}});var n=ST();Object.defineProperty(t,"Scope",{enumerable:true,get:function(){return n.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:true,get:function(){return n.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:true,get:function(){return n.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:true,get:function(){return n.varKinds}}),t.operators={GT:new e._Code(">"),GTE:new e._Code(">="),LT:new e._Code("<"),LTE:new e._Code("<="),EQ:new e._Code("==="),NEQ:new e._Code("!=="),NOT:new e._Code("!"),OR:new e._Code("||"),AND:new e._Code("&&"),ADD:new e._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(w,C){return this}},o=class extends s{constructor(w,C,L){super(),this.varKind=w,this.name=C,this.rhs=L;}render({es5:w,_n:C}){let L=w?r.varKinds.var:this.varKind,Q=this.rhs===void 0?"":` = ${this.rhs}`;return `${L} ${this.name}${Q};`+C}optimizeNames(w,C){if(w[this.name.str])return this.rhs&&(this.rhs=G(this.rhs,w,C)),this}get names(){return this.rhs instanceof e._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(w,C,L){super(),this.lhs=w,this.rhs=C,this.sideEffects=L;}render({_n:w}){return `${this.lhs} = ${this.rhs};`+w}optimizeNames(w,C){if(!(this.lhs instanceof e.Name&&!w[this.lhs.str]&&!this.sideEffects))return this.rhs=G(this.rhs,w,C),this}get names(){return j(this.lhs instanceof e.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(w,C,L,Q){super(w,L,Q),this.op=C;}render({_n:w}){return `${this.lhs} ${this.op}= ${this.rhs};`+w}},l=class extends s{constructor(w){super(),this.label=w,this.names={};}render({_n:w}){return `${this.label}:`+w}},u=class extends s{constructor(w){super(),this.label=w,this.names={};}render({_n:w}){return `break${this.label?` ${this.label}`:""};`+w}},d=class extends s{constructor(w){super(),this.error=w;}render({_n:w}){return `throw ${this.error};`+w}get names(){return this.error.names}},f=class extends s{constructor(w){super(),this.code=w;}render({_n:w}){return `${this.code};`+w}optimizeNodes(){return `${this.code}`?this:void 0}optimizeNames(w,C){return this.code=G(this.code,w,C),this}get names(){return this.code instanceof e._CodeOrName?this.code.names:{}}},p=class extends s{constructor(w=[]){super(),this.nodes=w;}render(w){return this.nodes.reduce((C,L)=>C+L.render(w),"")}optimizeNodes(){let{nodes:w}=this,C=w.length;for(;C--;){let L=w[C].optimizeNodes();Array.isArray(L)?w.splice(C,1,...L):L?w[C]=L:w.splice(C,1);}return w.length>0?this:void 0}optimizeNames(w,C){let{nodes:L}=this,Q=L.length;for(;Q--;){let ue=L[Q];ue.optimizeNames(w,C)||(ne(w,ue.names),L.splice(Q,1));}return L.length>0?this:void 0}get names(){return this.nodes.reduce((w,C)=>k(w,C.names),{})}},g=class extends p{render(w){return "{"+w._n+super.render(w)+"}"+w._n}},m=class extends p{},S=class extends g{};S.kind="else";var h=class Zd extends g{constructor(C,L){super(L),this.condition=C;}render(C){let L=`if(${this.condition})`+super.render(C);return this.else&&(L+="else "+this.else.render(C)),L}optimizeNodes(){super.optimizeNodes();let C=this.condition;if(C===true)return this.nodes;let L=this.else;if(L){let Q=L.optimizeNodes();L=this.else=Array.isArray(Q)?new S(Q):Q;}if(L)return C===false?L instanceof Zd?L:L.nodes:this.nodes.length?this:new Zd(Me(C),L instanceof Zd?[L]:L.nodes);if(!(C===false||!this.nodes.length))return this}optimizeNames(C,L){var Q;if(this.else=(Q=this.else)===null||Q===void 0?void 0:Q.optimizeNames(C,L),!!(super.optimizeNames(C,L)||this.else))return this.condition=G(this.condition,C,L),this}get names(){let C=super.names;return j(C,this.condition),this.else&&k(C,this.else.names),C}};h.kind="if";var v=class extends g{};v.kind="for";var _=class extends v{constructor(w){super(),this.iteration=w;}render(w){return `for(${this.iteration})`+super.render(w)}optimizeNames(w,C){if(super.optimizeNames(w,C))return this.iteration=G(this.iteration,w,C),this}get names(){return k(super.names,this.iteration.names)}},y=class extends v{constructor(w,C,L,Q){super(),this.varKind=w,this.name=C,this.from=L,this.to=Q;}render(w){let C=w.es5?r.varKinds.var:this.varKind,{name:L,from:Q,to:ue}=this;return `for(${C} ${L}=${Q}; ${L}<${ue}; ${L}++)`+super.render(w)}get names(){return j(j(super.names,this.from),this.to)}},R=class extends v{constructor(w,C,L,Q){super(),this.loop=w,this.varKind=C,this.name=L,this.iterable=Q;}render(w){return `for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(w)}optimizeNames(w,C){if(super.optimizeNames(w,C))return this.iterable=G(this.iterable,w,C),this}get names(){return k(super.names,this.iterable.names)}},T=class extends g{constructor(w,C,L){super(),this.name=w,this.args=C,this.async=L;}render(w){return `${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(w)}};T.kind="func";var b=class extends p{render(w){return "return "+super.render(w)}};b.kind="return";var E=class extends g{render(w){let C="try"+super.render(w);return this.catch&&(C+=this.catch.render(w)),this.finally&&(C+=this.finally.render(w)),C}optimizeNodes(){var w,C;return super.optimizeNodes(),(w=this.catch)===null||w===void 0||w.optimizeNodes(),(C=this.finally)===null||C===void 0||C.optimizeNodes(),this}optimizeNames(w,C){var L,Q;return super.optimizeNames(w,C),(L=this.catch)===null||L===void 0||L.optimizeNames(w,C),(Q=this.finally)===null||Q===void 0||Q.optimizeNames(w,C),this}get names(){let w=super.names;return this.catch&&k(w,this.catch.names),this.finally&&k(w,this.finally.names),w}},M=class extends g{constructor(w){super(),this.error=w;}render(w){return `catch(${this.error})`+super.render(w)}};M.kind="catch";var N=class extends g{render(w){return "finally"+super.render(w)}};N.kind="finally";var O=class{constructor(w,C={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...C,_n:C.lines?`
|
|
69
|
+
`:""},this._extScope=w,this._scope=new r.Scope({parent:w}),this._nodes=[new m];}toString(){return this._root.render(this.opts)}name(w){return this._scope.name(w)}scopeName(w){return this._extScope.name(w)}scopeValue(w,C){let L=this._extScope.value(w,C);return (this._values[L.prefix]||(this._values[L.prefix]=new Set)).add(L),L}getScopeValue(w,C){return this._extScope.getValue(w,C)}scopeRefs(w){return this._extScope.scopeRefs(w,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(w,C,L,Q){let ue=this._scope.toName(C);return L!==void 0&&Q&&(this._constants[ue.str]=L),this._leafNode(new o(w,ue,L)),ue}const(w,C,L){return this._def(r.varKinds.const,w,C,L)}let(w,C,L){return this._def(r.varKinds.let,w,C,L)}var(w,C,L){return this._def(r.varKinds.var,w,C,L)}assign(w,C,L){return this._leafNode(new a(w,C,L))}add(w,C){return this._leafNode(new c(w,t.operators.ADD,C))}code(w){return typeof w=="function"?w():w!==e.nil&&this._leafNode(new f(w)),this}object(...w){let C=["{"];for(let[L,Q]of w)C.length>1&&C.push(","),C.push(L),(L!==Q||this.opts.es5)&&(C.push(":"),(0, e.addCodeArg)(C,Q));return C.push("}"),new e._Code(C)}if(w,C,L){if(this._blockNode(new h(w)),C&&L)this.code(C).else().code(L).endIf();else if(C)this.code(C).endIf();else if(L)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(w){return this._elseNode(new h(w))}else(){return this._elseNode(new S)}endIf(){return this._endBlockNode(h,S)}_for(w,C){return this._blockNode(w),C&&this.code(C).endFor(),this}for(w,C){return this._for(new _(w),C)}forRange(w,C,L,Q,ue=this.opts.es5?r.varKinds.var:r.varKinds.let){let Re=this._scope.toName(w);return this._for(new y(ue,Re,C,L),()=>Q(Re))}forOf(w,C,L,Q=r.varKinds.const){let ue=this._scope.toName(w);if(this.opts.es5){let Re=C instanceof e.Name?C:this.var("_arr",C);return this.forRange("_i",0,(0, e._)`${Re}.length`,pe=>{this.var(ue,(0, e._)`${Re}[${pe}]`),L(ue);})}return this._for(new R("of",Q,ue,C),()=>L(ue))}forIn(w,C,L,Q=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(w,(0, e._)`Object.keys(${C})`,L);let ue=this._scope.toName(w);return this._for(new R("in",Q,ue,C),()=>L(ue))}endFor(){return this._endBlockNode(v)}label(w){return this._leafNode(new l(w))}break(w){return this._leafNode(new u(w))}return(w){let C=new b;if(this._blockNode(C),this.code(w),C.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(b)}try(w,C,L){if(!C&&!L)throw new Error('CodeGen: "try" without "catch" and "finally"');let Q=new E;if(this._blockNode(Q),this.code(w),C){let ue=this.name("e");this._currNode=Q.catch=new M(ue),C(ue);}return L&&(this._currNode=Q.finally=new N,this.code(L)),this._endBlockNode(M,N)}throw(w){return this._leafNode(new d(w))}block(w,C){return this._blockStarts.push(this._nodes.length),w&&this.code(w).endBlock(C),this}endBlock(w){let C=this._blockStarts.pop();if(C===void 0)throw new Error("CodeGen: not in self-balancing block");let L=this._nodes.length-C;if(L<0||w!==void 0&&L!==w)throw new Error(`CodeGen: wrong number of nodes: ${L} vs ${w} expected`);return this._nodes.length=C,this}func(w,C=e.nil,L,Q){return this._blockNode(new T(w,C,L)),Q&&this.code(Q).endFunc(),this}endFunc(){return this._endBlockNode(T)}optimize(w=1){for(;w-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants);}_leafNode(w){return this._currNode.nodes.push(w),this}_blockNode(w){this._currNode.nodes.push(w),this._nodes.push(w);}_endBlockNode(w,C){let L=this._currNode;if(L instanceof w||C&&L instanceof C)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${C?`${w.kind}/${C.kind}`:w.kind}"`)}_elseNode(w){let C=this._currNode;if(!(C instanceof h))throw new Error('CodeGen: "else" without "if"');return this._currNode=C.else=w,this}get _root(){return this._nodes[0]}get _currNode(){let w=this._nodes;return w[w.length-1]}set _currNode(w){let C=this._nodes;C[C.length-1]=w;}};t.CodeGen=O;function k(w,C){for(let L in C)w[L]=(w[L]||0)+(C[L]||0);return w}function j(w,C){return C instanceof e._CodeOrName?k(w,C.names):w}function G(w,C,L){if(w instanceof e.Name)return Q(w);if(!ue(w))return w;return new e._Code(w._items.reduce((Re,pe)=>(pe instanceof e.Name&&(pe=Q(pe)),pe instanceof e._Code?Re.push(...pe._items):Re.push(pe),Re),[]));function Q(Re){let pe=L[Re.str];return pe===void 0||C[Re.str]!==1?Re:(delete C[Re.str],pe)}function ue(Re){return Re instanceof e._Code&&Re._items.some(pe=>pe instanceof e.Name&&C[pe.str]===1&&L[pe.str]!==void 0)}}function ne(w,C){for(let L in C)w[L]=(w[L]||0)-(C[L]||0);}function Me(w){return typeof w=="boolean"||typeof w=="number"||w===null?!w:(0, e._)`!${q(w)}`}t.not=Me;let ye=U(t.operators.AND);function Ue(...w){return w.reduce(ye)}t.and=Ue;let ve=U(t.operators.OR);function P(...w){return w.reduce(ve)}t.or=P;function U(w){return (C,L)=>C===e.nil?L:L===e.nil?C:(0, e._)`${q(C)} ${w} ${q(L)}`}function q(w){return w instanceof e.Name?w:(0, e._)`(${w})`}})),ze=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let e=Te(),r=Xd();function i(T){let b={};for(let E of T)b[E]=true;return b}t.toHash=i;function n(T,b){return typeof b=="boolean"?b:Object.keys(b).length===0?true:(s(T,b),!o(b,T.self.RULES.all))}t.alwaysValidSchema=n;function s(T,b=T.schema){let{opts:E,self:M}=T;if(!E.strictSchema||typeof b=="boolean")return;let N=M.RULES.keywords;for(let O in b)N[O]||R(T,`unknown keyword: "${O}"`);}t.checkUnknownRules=s;function o(T,b){if(typeof T=="boolean")return !T;for(let E in T)if(b[E])return true;return false}t.schemaHasRules=o;function a(T,b){if(typeof T=="boolean")return !T;for(let E in T)if(E!=="$ref"&&b.all[E])return true;return false}t.schemaHasRulesButRef=a;function c({topSchemaRef:T,schemaPath:b},E,M,N){if(!N){if(typeof E=="number"||typeof E=="boolean")return E;if(typeof E=="string")return (0, e._)`${E}`}return (0, e._)`${T}${b}${(0, e.getProperty)(M)}`}t.schemaRefOrVal=c;function l(T){return f(decodeURIComponent(T))}t.unescapeFragment=l;function u(T){return encodeURIComponent(d(T))}t.escapeFragment=u;function d(T){return typeof T=="number"?`${T}`:T.replace(/~/g,"~0").replace(/\//g,"~1")}t.escapeJsonPointer=d;function f(T){return T.replace(/~1/g,"/").replace(/~0/g,"~")}t.unescapeJsonPointer=f;function p(T,b){if(Array.isArray(T))for(let E of T)b(E);else b(T);}t.eachItem=p;function g({mergeNames:T,mergeToName:b,mergeValues:E,resultToName:M}){return (N,O,k,j)=>{let G=k===void 0?O:k instanceof e.Name?(O instanceof e.Name?T(N,O,k):b(N,O,k),k):O instanceof e.Name?(b(N,k,O),O):E(O,k);return j===e.Name&&!(G instanceof e.Name)?M(N,G):G}}t.mergeEvaluated={props:g({mergeNames:(T,b,E)=>T.if((0, e._)`${E} !== true && ${b} !== undefined`,()=>{T.if((0, e._)`${b} === true`,()=>T.assign(E,true),()=>T.assign(E,(0, e._)`${E} || {}`).code((0, e._)`Object.assign(${E}, ${b})`));}),mergeToName:(T,b,E)=>T.if((0, e._)`${E} !== true`,()=>{b===true?T.assign(E,true):(T.assign(E,(0, e._)`${E} || {}`),S(T,E,b));}),mergeValues:(T,b)=>T===true?true:{...T,...b},resultToName:m}),items:g({mergeNames:(T,b,E)=>T.if((0, e._)`${E} !== true && ${b} !== undefined`,()=>T.assign(E,(0, e._)`${b} === true ? true : ${E} > ${b} ? ${E} : ${b}`)),mergeToName:(T,b,E)=>T.if((0, e._)`${E} !== true`,()=>T.assign(E,b===true?true:(0, e._)`${E} > ${b} ? ${E} : ${b}`)),mergeValues:(T,b)=>T===true?true:Math.max(T,b),resultToName:(T,b)=>T.var("items",b)})};function m(T,b){if(b===true)return T.var("props",true);let E=T.var("props",(0, e._)`{}`);return b!==void 0&&S(T,E,b),E}t.evaluatedPropsToName=m;function S(T,b,E){Object.keys(E).forEach(M=>T.assign((0, e._)`${b}${(0, e.getProperty)(M)}`,true));}t.setEvaluated=S;let h={};function v(T,b){return T.scopeValue("func",{ref:b,code:h[b.code]||(h[b.code]=new r._Code(b.code))})}t.useFunc=v;var _;(function(T){T[T.Num=0]="Num",T[T.Str=1]="Str";})(_||(t.Type=_={}));function y(T,b,E){if(T instanceof e.Name){let M=b===_.Num;return E?M?(0, e._)`"[" + ${T} + "]"`:(0, e._)`"['" + ${T} + "']"`:M?(0, e._)`"/" + ${T}`:(0, e._)`"/" + ${T}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return E?(0, e.getProperty)(T).toString():"/"+d(T)}t.getErrorPath=y;function R(T,b,E=T.opts.strictSchema){if(E){if(b=`strict mode: ${b}`,E===true)throw new Error(b);T.self.logger.warn(b);}}t.checkStrictMode=R;})),ln=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r={data:new e.Name("data"),valCxt:new e.Name("valCxt"),instancePath:new e.Name("instancePath"),parentData:new e.Name("parentData"),parentDataProperty:new e.Name("parentDataProperty"),rootData:new e.Name("rootData"),dynamicAnchors:new e.Name("dynamicAnchors"),vErrors:new e.Name("vErrors"),errors:new e.Name("errors"),this:new e.Name("this"),self:new e.Name("self"),scope:new e.Name("scope"),json:new e.Name("json"),jsonPos:new e.Name("jsonPos"),jsonLen:new e.Name("jsonLen"),jsonPart:new e.Name("jsonPart")};t.default=r;})),Yd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let e=Te(),r=ze(),i=ln();t.keywordError={message:({keyword:S})=>(0, e.str)`must pass "${S}" keyword validation`},t.keyword$DataError={message:({keyword:S,schemaType:h})=>h?(0, e.str)`"${S}" keyword must be ${h} ($data)`:(0, e.str)`"${S}" keyword is invalid ($data)`};function n(S,h=t.keywordError,v,_){let{it:y}=S,{gen:R,compositeRule:T,allErrors:b}=y,E=d(S,h,v);_??(T||b)?c(R,E):l(y,(0, e._)`[${E}]`);}t.reportError=n;function s(S,h=t.keywordError,v){let{it:_}=S,{gen:y,compositeRule:R,allErrors:T}=_;c(y,d(S,h,v)),R||T||l(_,i.default.vErrors);}t.reportExtraError=s;function o(S,h){S.assign(i.default.errors,h),S.if((0, e._)`${i.default.vErrors} !== null`,()=>S.if(h,()=>S.assign((0, e._)`${i.default.vErrors}.length`,h),()=>S.assign(i.default.vErrors,null)));}t.resetErrorsCount=o;function a({gen:S,keyword:h,schemaValue:v,data:_,errsCount:y,it:R}){if(y===void 0)throw new Error("ajv implementation error");let T=S.name("err");S.forRange("i",y,i.default.errors,b=>{S.const(T,(0, e._)`${i.default.vErrors}[${b}]`),S.if((0, e._)`${T}.instancePath === undefined`,()=>S.assign((0, e._)`${T}.instancePath`,(0, e.strConcat)(i.default.instancePath,R.errorPath))),S.assign((0, e._)`${T}.schemaPath`,(0, e.str)`${R.errSchemaPath}/${h}`),R.opts.verbose&&(S.assign((0, e._)`${T}.schema`,v),S.assign((0, e._)`${T}.data`,_));});}t.extendErrors=a;function c(S,h){let v=S.const("err",h);S.if((0, e._)`${i.default.vErrors} === null`,()=>S.assign(i.default.vErrors,(0, e._)`[${v}]`),(0, e._)`${i.default.vErrors}.push(${v})`),S.code((0, e._)`${i.default.errors}++`);}function l(S,h){let{gen:v,validateName:_,schemaEnv:y}=S;y.$async?v.throw((0, e._)`new ${S.ValidationError}(${h})`):(v.assign((0, e._)`${_}.errors`,h),v.return(false));}let u={keyword:new e.Name("keyword"),schemaPath:new e.Name("schemaPath"),params:new e.Name("params"),propertyName:new e.Name("propertyName"),message:new e.Name("message"),schema:new e.Name("schema"),parentSchema:new e.Name("parentSchema")};function d(S,h,v){let{createErrors:_}=S.it;return _===false?(0, e._)`{}`:f(S,h,v)}function f(S,h,v={}){let{gen:_,it:y}=S,R=[p(y,v),g(S,v)];return m(S,h,R),_.object(...R)}function p({errorPath:S},{instancePath:h}){let v=h?(0, e.str)`${S}${(0, r.getErrorPath)(h,r.Type.Str)}`:S;return [i.default.instancePath,(0, e.strConcat)(i.default.instancePath,v)]}function g({keyword:S,it:{errSchemaPath:h}},{schemaPath:v,parentSchema:_}){let y=_?h:(0, e.str)`${h}/${S}`;return v&&(y=(0, e.str)`${y}${(0, r.getErrorPath)(v,r.Type.Str)}`),[u.schemaPath,y]}function m(S,{params:h,message:v},_){let{keyword:y,data:R,schemaValue:T,it:b}=S,{opts:E,propertyName:M,topSchemaRef:N,schemaPath:O}=b;_.push([u.keyword,y],[u.params,typeof h=="function"?h(S):h||(0, e._)`{}`]),E.messages&&_.push([u.message,typeof v=="function"?v(S):v]),E.verbose&&_.push([u.schema,T],[u.parentSchema,(0, e._)`${N}${O}`],[i.default.data,R]),M&&_.push([u.propertyName,M]);}})),H1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let e=Yd(),r=Te(),i=ln(),n={message:"boolean schema is false"};function s(c){let{gen:l,schema:u,validateName:d}=c;u===false?a(c,false):typeof u=="object"&&u.$async===true?l.return(i.default.data):(l.assign((0, r._)`${d}.errors`,null),l.return(true));}t.topBoolOrEmptySchema=s;function o(c,l){let{gen:u,schema:d}=c;d===false?(u.var(l,false),a(c)):u.var(l,true);}t.boolOrEmptySchema=o;function a(c,l){let{gen:u,data:d}=c,f={gen:u,keyword:"false schema",data:d,schema:false,schemaCode:false,schemaValue:false,params:{},it:c};(0, e.reportError)(f,n,void 0,l);}})),xT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getRules=t.isJSONType=void 0;let e=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&e.has(n)}t.isJSONType=r;function i(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return {types:{...n,integer:true,boolean:true,null:true},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}t.getRules=i;})),bT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0;function e({schema:n,self:s},o){let a=s.RULES.types[o];return a&&a!==true&&r(n,a)}t.schemaHasRulesForType=e;function r(n,s){return s.rules.some(o=>i(n,o))}t.shouldUseGroup=r;function i(n,s){var o;return n[s.keyword]!==void 0||((o=s.definition.implements)===null||o===void 0?void 0:o.some(a=>n[a]!==void 0))}t.shouldUseRule=i;})),Jd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let e=xT(),r=bT(),i=Yd(),n=Te(),s=ze();var o;(function(_){_[_.Correct=0]="Correct",_[_.Wrong=1]="Wrong";})(o||(t.DataType=o={}));function a(_){let y=c(_.type);if(y.includes("null")){if(_.nullable===false)throw new Error("type: null contradicts nullable: false")}else {if(!y.length&&_.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');_.nullable===true&&y.push("null");}return y}t.getSchemaTypes=a;function c(_){let y=Array.isArray(_)?_:_?[_]:[];if(y.every(e.isJSONType))return y;throw new Error("type must be JSONType or JSONType[]: "+y.join(","))}t.getJSONTypes=c;function l(_,y){let{gen:R,data:T,opts:b}=_,E=d(y,b.coerceTypes),M=y.length>0&&!(E.length===0&&y.length===1&&(0, r.schemaHasRulesForType)(_,y[0]));if(M){let N=m(y,T,b.strictNumbers,o.Wrong);R.if(N,()=>{E.length?f(_,y,E):h(_);});}return M}t.coerceAndCheckDataType=l;let u=new Set(["string","number","integer","boolean","null"]);function d(_,y){return y?_.filter(R=>u.has(R)||y==="array"&&R==="array"):[]}function f(_,y,R){let{gen:T,data:b,opts:E}=_,M=T.let("dataType",(0, n._)`typeof ${b}`),N=T.let("coerced",(0, n._)`undefined`);E.coerceTypes==="array"&&T.if((0, n._)`${M} == 'object' && Array.isArray(${b}) && ${b}.length == 1`,()=>T.assign(b,(0, n._)`${b}[0]`).assign(M,(0, n._)`typeof ${b}`).if(m(y,b,E.strictNumbers),()=>T.assign(N,b))),T.if((0, n._)`${N} !== undefined`);for(let k of R)(u.has(k)||k==="array"&&E.coerceTypes==="array")&&O(k);T.else(),h(_),T.endIf(),T.if((0, n._)`${N} !== undefined`,()=>{T.assign(b,N),p(_,N);});function O(k){switch(k){case "string":T.elseIf((0, n._)`${M} == "number" || ${M} == "boolean"`).assign(N,(0, n._)`"" + ${b}`).elseIf((0, n._)`${b} === null`).assign(N,(0, n._)`""`);return;case "number":T.elseIf((0, n._)`${M} == "boolean" || ${b} === null
|
|
70
70
|
|| (${M} == "string" && ${b} && ${b} == +${b})`).assign(N,(0, n._)`+${b}`);return;case "integer":T.elseIf((0, n._)`${M} === "boolean" || ${b} === null
|
|
71
71
|
|| (${M} === "string" && ${b} && ${b} == +${b} && !(${b} % 1))`).assign(N,(0, n._)`+${b}`);return;case "boolean":T.elseIf((0, n._)`${b} === "false" || ${b} === 0 || ${b} === null`).assign(N,false).elseIf((0, n._)`${b} === "true" || ${b} === 1`).assign(N,true);return;case "null":T.elseIf((0, n._)`${b} === "" || ${b} === 0 || ${b} === false`),T.assign(N,null);return;case "array":T.elseIf((0, n._)`${M} === "string" || ${M} === "number"
|
|
72
|
-
|| ${M} === "boolean" || ${b} === null`).assign(N,(0, n._)`[${b}]`);}}}function p({gen:_,parentData:y,parentDataProperty:R},T){_.if((0, n._)`${y} !== undefined`,()=>_.assign((0, n._)`${y}[${R}]`,T));}function g(_,y,R,T=o.Correct){let b=T===o.Correct?n.operators.EQ:n.operators.NEQ,E;switch(_){case "null":return (0, n._)`${y} ${b} null`;case "array":E=(0, n._)`Array.isArray(${y})`;break;case "object":E=(0, n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case "integer":E=M((0, n._)`!(${y} % 1) && !isNaN(${y})`);break;case "number":E=M();break;default:return (0, n._)`typeof ${y} ${b} ${_}`}return T===o.Correct?E:(0, n.not)(E);function M(N=n.nil){return (0, n.and)((0, n._)`typeof ${y} == "number"`,N,R?(0, n._)`isFinite(${y})`:n.nil)}}t.checkDataType=g;function m(_,y,R,T){if(_.length===1)return g(_[0],y,R,T);let b,E=(0, s.toHash)(_);if(E.array&&E.object){let M=(0, n._)`typeof ${y} != "object"`;b=E.null?M:(0, n._)`!${y} || ${M}`,delete E.null,delete E.array,delete E.object;}else b=n.nil;E.number&&delete E.integer;for(let M in E)b=(0, n.and)(b,g(M,y,R,T));return b}t.checkDataTypes=m;let S={message:({schema:_})=>`must be ${_}`,params:({schema:_,schemaValue:y})=>typeof _=="string"?(0, n._)`{type: ${_}}`:(0, n._)`{type: ${y}}`};function h(_){let y=v(_);(0, i.reportError)(y,S);}t.reportTypeError=h;function v(_){let{gen:y,data:R,schema:T}=_,b=(0, s.schemaRefOrVal)(_,T,"type");return {gen:y,keyword:"type",data:R,schema:T.type,schemaCode:b,schemaValue:b,parentSchema:T,params:{},it:_}}})),G1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.assignDefaults=void 0;let e=Re(),r=ze();function i(s,o){let{properties:a,items:c}=s.schema;if(o==="object"&&a)for(let l in a)n(s,l,a[l].default);else o==="array"&&Array.isArray(c)&&c.forEach((l,u)=>n(s,u,l.default));}t.assignDefaults=i;function n(s,o,a){let{gen:c,compositeRule:l,data:u,opts:d}=s;if(a===void 0)return;let f=(0, e._)`${u}${(0, e.getProperty)(o)}`;if(l){(0, r.checkStrictMode)(s,`default is ignored for: ${f}`);return}let p=(0, e._)`${f} === undefined`;d.useDefaults==="empty"&&(p=(0, e._)`${p} || ${f} === null || ${f} === ""`),c.if(p,(0, e._)`${f} = ${(0, e.stringify)(a)}`);}})),un=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let e=Re(),r=ze(),i=ln(),n=ze();function s(_,y){let{gen:R,data:T,it:b}=_;R.if(d(R,T,y,b.opts.ownProperties),()=>{_.setParams({missingProperty:(0, e._)`${y}`},true),_.error();});}t.checkReportMissingProp=s;function o({gen:_,data:y,it:{opts:R}},T,b){return (0, e.or)(...T.map(E=>(0, e.and)(d(_,y,E,R.ownProperties),(0, e._)`${b} = ${E}`)))}t.checkMissingProp=o;function a(_,y){_.setParams({missingProperty:y},true),_.error();}t.reportMissingProp=a;function c(_){return _.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0, e._)`Object.prototype.hasOwnProperty`})}t.hasPropFunc=c;function l(_,y,R){return (0, e._)`${c(_)}.call(${y}, ${R})`}t.isOwnProperty=l;function u(_,y,R,T){let b=(0, e._)`${y}${(0, e.getProperty)(R)} !== undefined`;return T?(0, e._)`${b} && ${l(_,y,R)}`:b}t.propertyInData=u;function d(_,y,R,T){let b=(0, e._)`${y}${(0, e.getProperty)(R)} === undefined`;return T?(0, e.or)(b,(0, e.not)(l(_,y,R))):b}t.noPropertyInData=d;function f(_){return _?Object.keys(_).filter(y=>y!=="__proto__"):[]}t.allSchemaProperties=f;function p(_,y){return f(y).filter(R=>!(0, r.alwaysValidSchema)(_,y[R]))}t.schemaProperties=p;function g({schemaCode:_,data:y,it:{gen:R,topSchemaRef:T,schemaPath:b,errorPath:E},it:M},N,O,k){let j=k?(0, e._)`${_}, ${y}, ${T}${b}`:y,G=[[i.default.instancePath,(0, e.strConcat)(i.default.instancePath,E)],[i.default.parentData,M.parentData],[i.default.parentDataProperty,M.parentDataProperty],[i.default.rootData,i.default.rootData]];M.opts.dynamicRef&&G.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let Q=(0, e._)`${j}, ${R.object(...G)}`;return O!==e.nil?(0, e._)`${N}.call(${O}, ${Q})`:(0, e._)`${N}(${Q})`}t.callValidateCode=g;let m=(0, e._)`new RegExp`;function S({gen:_,it:{opts:y}},R){let T=y.unicodeRegExp?"u":"",{regExp:b}=y.code,E=b(R,T);return _.scopeValue("pattern",{key:E.toString(),ref:E,code:(0, e._)`${b.code==="new RegExp"?m:(0, n.useFunc)(_,b)}(${R}, ${T})`})}t.usePattern=S;function h(_){let{gen:y,data:R,keyword:T,it:b}=_,E=y.name("valid");if(b.allErrors){let N=y.let("valid",true);return M(()=>y.assign(N,false)),N}return y.var(E,true),M(()=>y.break()),E;function M(N){let O=y.const("len",(0, e._)`${R}.length`);y.forRange("i",0,O,k=>{_.subschema({keyword:T,dataProp:k,dataPropType:r.Type.Num},E),y.if((0, e.not)(E),N);});}}t.validateArray=h;function v(_){let{gen:y,schema:R,keyword:T,it:b}=_;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(N=>(0, r.alwaysValidSchema)(b,N))&&!b.opts.unevaluated)return;let E=y.let("valid",false),M=y.name("_valid");y.block(()=>R.forEach((N,O)=>{let k=_.subschema({keyword:T,schemaProp:O,compositeRule:true},M);y.assign(E,(0, e._)`${E} || ${M}`),_.mergeValidEvaluated(k,M)||y.if((0, e.not)(E));})),_.result(E,()=>_.reset(),()=>_.error(true));}t.validateUnion=v;})),H1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let e=Re(),r=ln(),i=un(),n=Yd();function s(p,g){let{gen:m,keyword:S,schema:h,parentSchema:v,it:_}=p,y=g.macro.call(_.self,h,v,_),R=u(m,S,y);_.opts.validateSchema!==false&&_.self.validateSchema(y,true);let T=m.name("valid");p.subschema({schema:y,schemaPath:e.nil,errSchemaPath:`${_.errSchemaPath}/${S}`,topSchemaRef:R,compositeRule:true},T),p.pass(T,()=>p.error(true));}t.macroKeywordCode=s;function o(p,g){var m;let{gen:S,keyword:h,schema:v,parentSchema:_,$data:y,it:R}=p;l(R,g);let T=u(S,h,!y&&g.compile?g.compile.call(R.self,v,_,R):g.validate),b=S.let("valid");p.block$data(b,E),p.ok((m=g.valid)!==null&&m!==void 0?m:b);function E(){if(g.errors===false)O(),g.modifying&&a(p),k(()=>p.error());else {let j=g.async?M():N();g.modifying&&a(p),k(()=>c(p,j));}}function M(){let j=S.let("ruleErrs",null);return S.try(()=>O((0, e._)`await `),G=>S.assign(b,false).if((0, e._)`${G} instanceof ${R.ValidationError}`,()=>S.assign(j,(0, e._)`${G}.errors`),()=>S.throw(G))),j}function N(){let j=(0, e._)`${T}.errors`;return S.assign(j,null),O(e.nil),j}function O(j=g.async?(0, e._)`await `:e.nil){let G=R.opts.passContext?r.default.this:r.default.self,Q=!("compile"in g&&!y||g.schema===false);S.assign(b,(0, e._)`${j}${(0, i.callValidateCode)(p,T,G,Q)}`,g.modifying);}function k(j){var G;S.if((0, e.not)((G=g.valid)!==null&&G!==void 0?G:b),j);}}t.funcKeywordCode=o;function a(p){let{gen:g,data:m,it:S}=p;g.if(S.parentData,()=>g.assign(m,(0, e._)`${S.parentData}[${S.parentDataProperty}]`));}function c(p,g){let{gen:m}=p;m.if((0, e._)`Array.isArray(${g})`,()=>{m.assign(r.default.vErrors,(0, e._)`${r.default.vErrors} === null ? ${g} : ${r.default.vErrors}.concat(${g})`).assign(r.default.errors,(0, e._)`${r.default.vErrors}.length`),(0, n.extendErrors)(p);},()=>p.error());}function l({schemaEnv:p},g){if(g.async&&!p.$async)throw new Error("async keyword in sync schema")}function u(p,g,m){if(m===void 0)throw new Error(`keyword "${g}" failed to compile`);return p.scopeValue("keyword",typeof m=="function"?{ref:m}:{ref:m,code:(0, e.stringify)(m)})}function d(p,g,m=false){return !g.length||g.some(S=>S==="array"?Array.isArray(p):S==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==S||m&&typeof p>"u")}t.validSchemaType=d;function f({schema:p,opts:g,self:m,errSchemaPath:S},h,v){if(Array.isArray(h.keyword)?!h.keyword.includes(v):h.keyword!==v)throw new Error("ajv implementation error");let _=h.dependencies;if(_?.some(y=>!Object.prototype.hasOwnProperty.call(p,y)))throw new Error(`parent schema must have dependencies of ${v}: ${_.join(",")}`);if(h.validateSchema&&!h.validateSchema(p[v])){let y=`keyword "${v}" value is invalid at path "${S}": `+m.errorsText(h.validateSchema.errors);if(g.validateSchema==="log")m.logger.error(y);else throw new Error(y)}}t.validateKeywordUsage=f;})),q1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let e=Re(),r=ze();function i(o,{keyword:a,schemaProp:c,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:f}){if(a!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let p=o.schema[a];return c===void 0?{schema:p,schemaPath:(0, e._)`${o.schemaPath}${(0, e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:p[c],schemaPath:(0, e._)`${o.schemaPath}${(0, e.getProperty)(a)}${(0, e.getProperty)(c)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0, r.escapeFragment)(c)}`}}if(l!==void 0){if(u===void 0||d===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return {schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}t.getSubschema=i;function n(o,a,{dataProp:c,dataPropType:l,data:u,dataTypes:d,propertyName:f}){if(u!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:p}=a;if(c!==void 0){let{errorPath:m,dataPathArr:S,opts:h}=a;g(p.let("data",(0, e._)`${a.data}${(0, e.getProperty)(c)}`,true)),o.errorPath=(0, e.str)`${m}${(0, r.getErrorPath)(c,l,h.jsPropertySyntax)}`,o.parentDataProperty=(0, e._)`${c}`,o.dataPathArr=[...S,o.parentDataProperty];}u!==void 0&&(g(u instanceof e.Name?u:p.let("data",u,true)),f!==void 0&&(o.propertyName=f)),d&&(o.dataTypes=d);function g(m){o.data=m,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,m];}}t.extendSubschemaData=n;function s(o,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(o.compositeRule=l),u!==void 0&&(o.createErrors=u),d!==void 0&&(o.allErrors=d),o.jtdDiscriminator=a,o.jtdMetadata=c;}t.extendSubschemaMode=s;})),TT=W(((t,e)=>{e.exports=function r(i,n){if(i===n)return true;if(i&&n&&typeof i=="object"&&typeof n=="object"){if(i.constructor!==n.constructor)return false;var s,o,a;if(Array.isArray(i)){if(s=i.length,s!=n.length)return false;for(o=s;o--!==0;)if(!r(i[o],n[o]))return false;return true}if(i.constructor===RegExp)return i.source===n.source&&i.flags===n.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===n.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===n.toString();if(a=Object.keys(i),s=a.length,s!==Object.keys(n).length)return false;for(o=s;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return false;for(o=s;o--!==0;){var c=a[o];if(!r(i[c],n[c]))return false}return true}return i!==i&&n!==n};})),W1=W(((t,e)=>{var r=e.exports=function(s,o,a){typeof o=="function"&&(a=o,o={}),a=o.cb||a;var c=typeof a=="function"?a:a.pre||function(){},l=a.post||function(){};i(o,c,l,s,"",s);};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true},r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true},r.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true},r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function i(s,o,a,c,l,u,d,f,p,g){if(c&&typeof c=="object"&&!Array.isArray(c)){o(c,l,u,d,f,p,g);for(var m in c){var S=c[m];if(Array.isArray(S)){if(m in r.arrayKeywords)for(var h=0;h<S.length;h++)i(s,o,a,S[h],l+"/"+m+"/"+h,u,l,m,c,h);}else if(m in r.propsKeywords){if(S&&typeof S=="object")for(var v in S)i(s,o,a,S[v],l+"/"+m+"/"+n(v),u,l,m,c,v);}else (m in r.keywords||s.allKeys&&!(m in r.skipKeywords))&&i(s,o,a,S,l+"/"+m,u,l,m,c);}a(c,l,u,d,f,p,g);}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}})),Qd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let e=ze(),r=TT(),i=W1(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,h=true){return typeof S=="boolean"?true:h===true?!a(S):h?c(S)<=h:false}t.inlineRef=s;let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(S){for(let h in S){if(o.has(h))return true;let v=S[h];if(Array.isArray(v)&&v.some(a)||typeof v=="object"&&a(v))return true}return false}function c(S){let h=0;for(let v in S){if(v==="$ref")return 1/0;if(h++,!n.has(v)&&(typeof S[v]=="object"&&(0, e.eachItem)(S[v],_=>h+=c(_)),h===1/0))return 1/0}return h}function l(S,h="",v){return v!==false&&(h=f(h)),u(S,S.parse(h))}t.getFullPath=l;function u(S,h){return S.serialize(h).split("#")[0]+"#"}t._getFullPath=u;let d=/#\/?$/;function f(S){return S?S.replace(d,""):""}t.normalizeId=f;function p(S,h,v){return v=f(v),S.resolve(h,v)}t.resolveUrl=p;let g=/^[a-z_][-a-z0-9._]*$/i;function m(S,h){if(typeof S=="boolean")return {};let{schemaId:v,uriResolver:_}=this.opts,y=f(S[v]||h),R={"":y},T=l(_,y,false),b={},E=new Set;return i(S,{allKeys:true},(O,k,j,G)=>{if(G===void 0)return;let Q=T+k,Se=R[G];typeof O[v]=="string"&&(Se=ye.call(this,O[v])),Fe.call(this,O.$anchor),Fe.call(this,O.$dynamicAnchor),R[k]=Se;function ye(ve){let P=this.opts.uriResolver.resolve;if(ve=f(Se?P(Se,ve):ve),E.has(ve))throw N(ve);E.add(ve);let U=this.refs[ve];return typeof U=="string"&&(U=this.refs[U]),typeof U=="object"?M(O,U.schema,ve):ve!==f(Q)&&(ve[0]==="#"?(M(O,b[ve],ve),b[ve]=O):this.refs[ve]=Q),ve}function Fe(ve){if(typeof ve=="string"){if(!g.test(ve))throw new Error(`invalid anchor "${ve}"`);ye.call(this,`#${ve}`);}}}),b;function M(O,k,j){if(k!==void 0&&!r(O,k))throw N(j)}function N(O){return new Error(`reference "${O}" resolves to more than one schema`)}}t.getSchemaRefs=m;})),Ms=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let e=j1(),r=Jd(),i=bT(),n=Jd(),s=G1(),o=H1(),a=q1(),c=Re(),l=ln(),u=Qd(),d=ze(),f=Yd();function p(A){if(T(A)&&(E(A),R(A))){h(A);return}g(A,()=>(0, e.topBoolOrEmptySchema)(A));}t.validateFunctionCode=p;function g({gen:A,validateName:V,schema:H,schemaEnv:me,opts:ge},we){ge.code.es5?A.func(V,(0, c._)`${l.default.data}, ${l.default.valCxt}`,me.$async,()=>{A.code((0, c._)`"use strict"; ${_(H,ge)}`),S(A,ge),A.code(we);}):A.func(V,(0, c._)`${l.default.data}, ${m(ge)}`,me.$async,()=>A.code(_(H,ge)).code(we));}function m(A){return (0, c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${A.dynamicRef?(0, c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function S(A,V){A.if(l.default.valCxt,()=>{A.var(l.default.instancePath,(0, c._)`${l.default.valCxt}.${l.default.instancePath}`),A.var(l.default.parentData,(0, c._)`${l.default.valCxt}.${l.default.parentData}`),A.var(l.default.parentDataProperty,(0, c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),A.var(l.default.rootData,(0, c._)`${l.default.valCxt}.${l.default.rootData}`),V.dynamicRef&&A.var(l.default.dynamicAnchors,(0, c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);},()=>{A.var(l.default.instancePath,(0, c._)`""`),A.var(l.default.parentData,(0, c._)`undefined`),A.var(l.default.parentDataProperty,(0, c._)`undefined`),A.var(l.default.rootData,l.default.data),V.dynamicRef&&A.var(l.default.dynamicAnchors,(0, c._)`{}`);});}function h(A){let{schema:V,opts:H,gen:me}=A;g(A,()=>{H.$comment&&V.$comment&&G(A),O(A),me.let(l.default.vErrors,null),me.let(l.default.errors,0),H.unevaluated&&v(A),M(A),Q(A);});}function v(A){let{gen:V,validateName:H}=A;A.evaluated=V.const("evaluated",(0, c._)`${H}.evaluated`),V.if((0, c._)`${A.evaluated}.dynamicProps`,()=>V.assign((0, c._)`${A.evaluated}.props`,(0, c._)`undefined`)),V.if((0, c._)`${A.evaluated}.dynamicItems`,()=>V.assign((0, c._)`${A.evaluated}.items`,(0, c._)`undefined`));}function _(A,V){let H=typeof A=="object"&&A[V.schemaId];return H&&(V.code.source||V.code.process)?(0, c._)`/*# sourceURL=${H} */`:c.nil}function y(A,V){if(T(A)&&(E(A),R(A))){b(A,V);return}(0, e.boolOrEmptySchema)(A,V);}function R({schema:A,self:V}){if(typeof A=="boolean")return !A;for(let H in A)if(V.RULES.all[H])return true;return false}function T(A){return typeof A.schema!="boolean"}function b(A,V){let{schema:H,gen:me,opts:ge}=A;ge.$comment&&H.$comment&&G(A),k(A),j(A);let we=me.const("_errs",l.default.errors);M(A,we),me.var(V,(0, c._)`${we} === ${l.default.errors}`);}function E(A){(0, d.checkUnknownRules)(A),N(A);}function M(A,V){if(A.opts.jtd)return ye(A,[],false,V);let H=(0, r.getSchemaTypes)(A.schema);ye(A,H,!(0, r.coerceAndCheckDataType)(A,H),V);}function N(A){let{schema:V,errSchemaPath:H,opts:me,self:ge}=A;V.$ref&&me.ignoreKeywordsWithRef&&(0, d.schemaHasRulesButRef)(V,ge.RULES)&&ge.logger.warn(`$ref: keywords ignored in schema at path "${H}"`);}function O(A){let{schema:V,opts:H}=A;V.default!==void 0&&H.useDefaults&&H.strictSchema&&(0, d.checkStrictMode)(A,"default is ignored in the schema root");}function k(A){let V=A.schema[A.opts.schemaId];V&&(A.baseId=(0, u.resolveUrl)(A.opts.uriResolver,A.baseId,V));}function j(A){if(A.schema.$async&&!A.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:A,schemaEnv:V,schema:H,errSchemaPath:me,opts:ge}){let we=H.$comment;if(ge.$comment===true)A.code((0, c._)`${l.default.self}.logger.log(${we})`);else if(typeof ge.$comment=="function"){let nt=(0, c.str)`${me}/$comment`,at=A.scopeValue("root",{ref:V.root});A.code((0, c._)`${l.default.self}.opts.$comment(${we}, ${nt}, ${at}.schema)`);}}function Q(A){let{gen:V,schemaEnv:H,validateName:me,ValidationError:ge,opts:we}=A;H.$async?V.if((0, c._)`${l.default.errors} === 0`,()=>V.return(l.default.data),()=>V.throw((0, c._)`new ${ge}(${l.default.vErrors})`)):(V.assign((0, c._)`${me}.errors`,l.default.vErrors),we.unevaluated&&Se(A),V.return((0, c._)`${l.default.errors} === 0`));}function Se({gen:A,evaluated:V,props:H,items:me}){H instanceof c.Name&&A.assign((0, c._)`${V}.props`,H),me instanceof c.Name&&A.assign((0, c._)`${V}.items`,me);}function ye(A,V,H,me){let{gen:ge,schema:we,data:nt,allErrors:at,opts:gt,self:it}=A,{RULES:Xe}=it;if(we.$ref&&(gt.ignoreKeywordsWithRef||!(0, d.schemaHasRulesButRef)(we,Xe))){ge.block(()=>Ee(A,"$ref",Xe.all.$ref.definition));return}gt.jtd||ve(A,V),ge.block(()=>{for(let lt of Xe.rules)Wt(lt);Wt(Xe.post);});function Wt(lt){(0, i.shouldUseGroup)(we,lt)&&(lt.type?(ge.if((0, n.checkDataType)(lt.type,nt,gt.strictNumbers)),Fe(A,lt),V.length===1&&V[0]===lt.type&&H&&(ge.else(),(0, n.reportTypeError)(A)),ge.endIf()):Fe(A,lt),at||ge.if((0, c._)`${l.default.errors} === ${me||0}`));}}function Fe(A,V){let{gen:H,schema:me,opts:{useDefaults:ge}}=A;ge&&(0, s.assignDefaults)(A,V.type),H.block(()=>{for(let we of V.rules)(0, i.shouldUseRule)(me,we)&&Ee(A,we.keyword,we.definition,V.type);});}function ve(A,V){A.schemaEnv.meta||!A.opts.strictTypes||(P(A,V),A.opts.allowUnionTypes||U(A,V),q(A,A.dataTypes));}function P(A,V){if(V.length){if(!A.dataTypes.length){A.dataTypes=V;return}V.forEach(H=>{C(A.dataTypes,H)||ee(A,`type "${H}" not allowed by context "${A.dataTypes.join(",")}"`);}),L(A,V);}}function U(A,V){V.length>1&&!(V.length===2&&V.includes("null"))&&ee(A,"use allowUnionTypes to allow union type keyword");}function q(A,V){let H=A.self.RULES.all;for(let me in H){let ge=H[me];if(typeof ge=="object"&&(0, i.shouldUseRule)(A.schema,ge)){let{type:we}=ge.definition;we.length&&!we.some(nt=>w(V,nt))&&ee(A,`missing type "${we.join(",")}" for keyword "${me}"`);}}}function w(A,V){return A.includes(V)||V==="number"&&A.includes("integer")}function C(A,V){return A.includes(V)||V==="integer"&&A.includes("number")}function L(A,V){let H=[];for(let me of A.dataTypes)C(V,me)?H.push(me):V.includes("integer")&&me==="number"&&H.push("integer");A.dataTypes=H;}function ee(A,V){let H=A.schemaEnv.baseId+A.errSchemaPath;V+=` at "${H}" (strictTypes)`,(0, d.checkStrictMode)(A,V,A.opts.strictTypes);}var ue=class{constructor(A,V,H){if((0, o.validateKeywordUsage)(A,V,H),this.gen=A.gen,this.allErrors=A.allErrors,this.keyword=H,this.data=A.data,this.schema=A.schema[H],this.$data=V.$data&&A.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0, d.schemaRefOrVal)(A,this.schema,H,this.$data),this.schemaType=V.schemaType,this.parentSchema=A.schema,this.params={},this.it=A,this.def=V,this.$data)this.schemaCode=A.gen.const("vSchema",je(this.$data,A));else if(this.schemaCode=this.schemaValue,!(0, o.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${H} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==false)&&(this.errsCount=A.gen.const("_errs",l.default.errors));}result(A,V,H){this.failResult((0, c.not)(A),V,H);}failResult(A,V,H){this.gen.if(A),H?H():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else();}pass(A,V){this.failResult((0, c.not)(A),void 0,V);}fail(A){if(A===void 0){this.error(),this.allErrors||this.gen.if(false);return}this.gen.if(A),this.error(),this.allErrors?this.gen.endIf():this.gen.else();}fail$data(A){if(!this.$data)return this.fail(A);let{schemaCode:V}=this;this.fail((0, c._)`${V} !== undefined && (${(0, c.or)(this.invalid$data(),A)})`);}error(A,V,H){if(V){this.setParams(V),this._error(A,H),this.setParams({});return}this._error(A,H);}_error(A,V){(A?f.reportExtraError:f.reportError)(this,this.def.error,V);}$dataError(){(0, f.reportError)(this,this.def.$dataError||f.keyword$DataError);}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0, f.resetErrorsCount)(this.gen,this.errsCount);}ok(A){this.allErrors||this.gen.if(A);}setParams(A,V){V?Object.assign(this.params,A):this.params=A;}block$data(A,V,H=c.nil){this.gen.block(()=>{this.check$data(A,H),V();});}check$data(A=c.nil,V=c.nil){if(!this.$data)return;let{gen:H,schemaCode:me,schemaType:ge,def:we}=this;H.if((0, c.or)((0, c._)`${me} === undefined`,V)),A!==c.nil&&H.assign(A,true),(ge.length||we.validateSchema)&&(H.elseIf(this.invalid$data()),this.$dataError(),A!==c.nil&&H.assign(A,false)),H.else();}invalid$data(){let{gen:A,schemaCode:V,schemaType:H,def:me,it:ge}=this;return (0, c.or)(we(),nt());function we(){if(H.length){if(!(V instanceof c.Name))throw new Error("ajv implementation error");let at=Array.isArray(H)?H:[H];return (0, c._)`${(0, n.checkDataTypes)(at,V,ge.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function nt(){if(me.validateSchema){let at=A.scopeValue("validate$data",{ref:me.validateSchema});return (0, c._)`!${at}(${V})`}return c.nil}}subschema(A,V){let H=(0, a.getSubschema)(this.it,A);(0, a.extendSubschemaData)(H,this.it,A),(0, a.extendSubschemaMode)(H,A);let me={...this.it,...H,items:void 0,props:void 0};return y(me,V),me}mergeEvaluated(A,V){let{it:H,gen:me}=this;H.opts.unevaluated&&(H.props!==true&&A.props!==void 0&&(H.props=d.mergeEvaluated.props(me,A.props,H.props,V)),H.items!==true&&A.items!==void 0&&(H.items=d.mergeEvaluated.items(me,A.items,H.items,V)));}mergeValidEvaluated(A,V){let{it:H,gen:me}=this;if(H.opts.unevaluated&&(H.props!==true||H.items!==true))return me.if(V,()=>this.mergeEvaluated(A,c.Name)),true}};t.KeywordCxt=ue;function Ee(A,V,H,me){let ge=new ue(A,H,V);"code"in H?H.code(ge,me):ge.$data&&H.validate?(0, o.funcKeywordCode)(ge,H):"macro"in H?(0, o.macroKeywordCode)(ge,H):(H.compile||H.validate)&&(0, o.funcKeywordCode)(ge,H);}let pe=/^\/(?:[^~]|~0|~1)*$/,Ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function je(A,{dataLevel:V,dataNames:H,dataPathArr:me}){let ge,we;if(A==="")return l.default.rootData;if(A[0]==="/"){if(!pe.test(A))throw new Error(`Invalid JSON-pointer: ${A}`);ge=A,we=l.default.rootData;}else {let it=Ie.exec(A);if(!it)throw new Error(`Invalid JSON-pointer: ${A}`);let Xe=+it[1];if(ge=it[2],ge==="#"){if(Xe>=V)throw new Error(gt("property/index",Xe));return me[V-Xe]}if(Xe>V)throw new Error(gt("data",Xe));if(we=H[V-Xe],!ge)return we}let nt=we,at=ge.split("/");for(let it of at)it&&(we=(0, c._)`${we}${(0, c.getProperty)((0, d.unescapeJsonPointer)(it))}`,nt=(0, c._)`${nt} && ${we}`);return nt;function gt(it,Xe){return `Cannot access ${it} ${Xe} levels up, current level is ${V}`}}t.getData=je;})),wa=W((t=>{Object.defineProperty(t,"__esModule",{value:true});var e=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=true;}};t.default=e;})),As=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Qd();var r=class extends Error{constructor(i,n,s,o){super(o||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0, e.resolveUrl)(i,n,s),this.missingSchema=(0, e.normalizeId)((0, e.getFullPath)(i,this.missingRef));}};t.default=r;})),eh=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let e=Re(),r=wa(),i=ln(),n=Qd(),s=ze(),o=Ms();var a=class{constructor(h){var v;this.refs={},this.dynamicAnchors={};let _;typeof h.schema=="object"&&(_=h.schema),this.schema=h.schema,this.schemaId=h.schemaId,this.root=h.root||this,this.baseId=(v=h.baseId)!==null&&v!==void 0?v:(0, n.normalizeId)(_?.[h.schemaId||"$id"]),this.schemaPath=h.schemaPath,this.localRefs=h.localRefs,this.meta=h.meta,this.$async=_?.$async,this.refs={};}};t.SchemaEnv=a;function c(h){let v=d.call(this,h);if(v)return v;let _=(0, n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:y,lines:R}=this.opts.code,{ownProperties:T}=this.opts,b=new e.CodeGen(this.scope,{es5:y,lines:R,ownProperties:T}),E;h.$async&&(E=b.scopeValue("Error",{ref:r.default,code:(0, e._)`require("ajv/dist/runtime/validation_error").default`}));let M=b.scopeName("validate");h.validateName=M;let N={gen:b,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===true?{ref:h.schema,code:(0, e.stringify)(h.schema)}:{ref:h.schema}),validateName:M,ValidationError:E,schema:h.schema,schemaEnv:h,rootId:_,baseId:h.baseId||_,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0, e._)`""`,opts:this.opts,self:this},O;try{this._compilations.add(h),(0,o.validateFunctionCode)(N),b.optimize(this.opts.code.optimize);let k=b.toString();O=`${b.scopeRefs(i.default.scope)}return ${k}`,this.opts.code.process&&(O=this.opts.code.process(O,h));let j=new Function(`${i.default.self}`,`${i.default.scope}`,O)(this,this.scope.get());if(this.scope.value(M,{ref:j}),j.errors=null,j.schema=h.schema,j.schemaEnv=h,h.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:M,validateCode:k,scopeValues:b._values}),this.opts.unevaluated){let{props:G,items:Q}=N;j.evaluated={props:G instanceof e.Name?void 0:G,items:Q instanceof e.Name?void 0:Q,dynamicProps:G instanceof e.Name,dynamicItems:Q instanceof e.Name},j.source&&(j.source.evaluated=(0,e.stringify)(j.evaluated));}return h.validate=j,h}catch(k){throw delete h.validate,delete h.validateName,O&&this.logger.error("Error compiling schema, function code:",O),k}finally{this._compilations.delete(h);}}t.compileSchema=c;function l(h,v,_){var y;_=(0, n.resolveUrl)(this.opts.uriResolver,v,_);let R=h.refs[_];if(R)return R;let T=p.call(this,h,_);if(T===void 0){let b=(y=h.localRefs)===null||y===void 0?void 0:y[_],{schemaId:E}=this.opts;b&&(T=new a({schema:b,schemaId:E,root:h,baseId:v}));}if(T!==void 0)return h.refs[_]=u.call(this,T)}t.resolveRef=l;function u(h){return (0, n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function d(h){for(let v of this._compilations)if(f(v,h))return v}t.getCompilingSchema=d;function f(h,v){return h.schema===v.schema&&h.root===v.root&&h.baseId===v.baseId}function p(h,v){let _;for(;typeof(_=this.refs[v])=="string";)v=_;return _||this.schemas[v]||g.call(this,h,v)}function g(h,v){let _=this.opts.uriResolver.parse(v),y=(0, n._getFullPath)(this.opts.uriResolver,_),R=(0, n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&y===R)return S.call(this,_,h);let T=(0, n.normalizeId)(y),b=this.refs[T]||this.schemas[T];if(typeof b=="string"){let E=g.call(this,h,b);return typeof E?.schema!="object"?void 0:S.call(this,_,E)}if(typeof b?.schema=="object"){if(b.validate||c.call(this,b),T===(0, n.normalizeId)(v)){let{schema:E}=b,{schemaId:M}=this.opts,N=E[M];return N&&(R=(0, n.resolveUrl)(this.opts.uriResolver,R,N)),new a({schema:E,schemaId:M,root:h,baseId:R})}return S.call(this,_,b)}}t.resolveSchema=g;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(h,{baseId:v,schema:_,root:y}){var R;if(((R=h.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(let E of h.fragment.slice(1).split("/")){if(typeof _=="boolean")return;let M=_[(0, s.unescapeFragment)(E)];if(M===void 0)return;_=M;let N=typeof _=="object"&&_[this.opts.schemaId];!m.has(E)&&N&&(v=(0, n.resolveUrl)(this.opts.uriResolver,v,N));}let T;if(typeof _!="boolean"&&_.$ref&&!(0, s.schemaHasRulesButRef)(_,this.RULES)){let E=(0, n.resolveUrl)(this.opts.uriResolver,v,_.$ref);T=g.call(this,y,E);}let{schemaId:b}=this.opts;if(T=T||new a({schema:_,schemaId:b,root:y,baseId:v}),T.schema!==T.root.schema)return T}})),K1=W(((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:false};})),RT=W(((t,e)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(g){let m="",S=0,h=0;for(h=0;h<g.length;h++)if(S=g[h].charCodeAt(0),S!==48){if(!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return "";m+=g[h];break}for(h+=1;h<g.length;h++){if(S=g[h].charCodeAt(0),!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return "";m+=g[h];}return m}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(g){return g.length=0,true}function a(g,m,S){if(g.length){let h=n(g);if(h!=="")m.push(h);else return S.error=true,false;g.length=0;}return true}function c(g){let m=0,S={error:false,address:"",zone:""},h=[],v=[],_=false,y=false,R=a;for(let T=0;T<g.length;T++){let b=g[T];if(!(b==="["||b==="]"))if(b===":"){if(_===true&&(y=true),!R(v,h,S))break;if(++m>7){S.error=true;break}T>0&&g[T-1]===":"&&(_=true),h.push(":");continue}else if(b==="%"){if(!R(v,h,S))break;R=o;}else {v.push(b);continue}}return v.length&&(R===o?S.zone=v.join(""):y?h.push(v.join("")):h.push(n(v))),S.address=h.join(""),S}function l(g){if(u(g,":")<2)return {host:g,isIPV6:false};let m=c(g);if(m.error)return {host:g,isIPV6:false};{let S=m.address,h=m.address;return m.zone&&(S+="%"+m.zone,h+="%25"+m.zone),{host:S,isIPV6:true,escapedHost:h}}}function u(g,m){let S=0;for(let h=0;h<g.length;h++)g[h]===m&&S++;return S}function d(g){let m=g,S=[],h=-1,v=0;for(;v=m.length;){if(v===1){if(m===".")break;if(m==="/"){S.push("/");break}else {S.push(m);break}}else if(v===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){S.push("/");break}}else if(v===3&&m==="/.."){S.length!==0&&S.pop(),S.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),S.length!==0&&S.pop();continue}}if((h=m.indexOf("/",1))===-1){S.push(m);break}else S.push(m.slice(0,h)),m=m.slice(h);}return S.join("")}function f(g,m){let S=m!==true?escape:unescape;return g.scheme!==void 0&&(g.scheme=S(g.scheme)),g.userinfo!==void 0&&(g.userinfo=S(g.userinfo)),g.host!==void 0&&(g.host=S(g.host)),g.path!==void 0&&(g.path=S(g.path)),g.query!==void 0&&(g.query=S(g.query)),g.fragment!==void 0&&(g.fragment=S(g.fragment)),g}function p(g){let m=[];if(g.userinfo!==void 0&&(m.push(g.userinfo),m.push("@")),g.host!==void 0){let S=unescape(g.host);if(!i(S)){let h=l(S);h.isIPV6===true?S=`[${h.escapedHost}]`:S=g.host;}m.push(S);}return (typeof g.port=="number"||typeof g.port=="string")&&(m.push(":"),m.push(String(g.port))),m.length?m.join(""):void 0}e.exports={nonSimpleDomain:s,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:i,isUUID:r,normalizeIPv6:l,stringArrayToHexStripped:n};})),Z1=W(((t,e)=>{let{isUUID:r}=RT(),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(b){return n.indexOf(b)!==-1}function o(b){return b.secure===true?true:b.secure===false?false:b.scheme?b.scheme.length===3&&(b.scheme[0]==="w"||b.scheme[0]==="W")&&(b.scheme[1]==="s"||b.scheme[1]==="S")&&(b.scheme[2]==="s"||b.scheme[2]==="S"):false}function a(b){return b.host||(b.error=b.error||"HTTP URIs must have a host."),b}function c(b){let E=String(b.scheme).toLowerCase()==="https";return (b.port===(E?443:80)||b.port==="")&&(b.port=void 0),b.path||(b.path="/"),b}function l(b){return b.secure=o(b),b.resourceName=(b.path||"/")+(b.query?"?"+b.query:""),b.path=void 0,b.query=void 0,b}function u(b){if((b.port===(o(b)?443:80)||b.port==="")&&(b.port=void 0),typeof b.secure=="boolean"&&(b.scheme=b.secure?"wss":"ws",b.secure=void 0),b.resourceName){let[E,M]=b.resourceName.split("?");b.path=E&&E!=="/"?E:void 0,b.query=M,b.resourceName=void 0;}return b.fragment=void 0,b}function d(b,E){if(!b.path)return b.error="URN can not be parsed",b;let M=b.path.match(i);if(M){let N=E.scheme||b.scheme||"urn";b.nid=M[1].toLowerCase(),b.nss=M[2];let O=T(`${N}:${E.nid||b.nid}`);b.path=void 0,O&&(b=O.parse(b,E));}else b.error=b.error||"URN can not be parsed.";return b}function f(b,E){if(b.nid===void 0)throw new Error("URN without nid cannot be serialized");let M=E.scheme||b.scheme||"urn",N=b.nid.toLowerCase(),O=T(`${M}:${E.nid||N}`);O&&(b=O.serialize(b,E));let k=b,j=b.nss;return k.path=`${N||E.nid}:${j}`,E.skipEscape=true,k}function p(b,E){let M=b;return M.uuid=M.nss,M.nss=void 0,!E.tolerant&&(!M.uuid||!r(M.uuid))&&(M.error=M.error||"UUID is not valid."),M}function g(b){let E=b;return E.nss=(b.uuid||"").toLowerCase(),E}let m={scheme:"http",domainHost:true,parse:a,serialize:c},S={scheme:"https",domainHost:m.domainHost,parse:a,serialize:c},h={scheme:"ws",domainHost:true,parse:l,serialize:u},v={scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},R={http:m,https:S,ws:h,wss:v,urn:{scheme:"urn",parse:d,serialize:f,skipNormalize:true},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:g,skipNormalize:true}};Object.setPrototypeOf(R,null);function T(b){return b&&(R[b]||R[b.toLowerCase()])||void 0}e.exports={wsIsSecure:o,SCHEMES:R,isValidSchemeName:s,getSchemeHandler:T};})),X1=W(((t,e)=>{let{normalizeIPv6:r,removeDotSegments:i,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:o,nonSimpleDomain:a}=RT(),{SCHEMES:c,getSchemeHandler:l}=Z1();function u(v,_){return typeof v=="string"?v=g(S(v,_),_):typeof v=="object"&&(v=S(g(v,_),_)),v}function d(v,_,y){let R=y?Object.assign({scheme:"null"},y):{scheme:"null"},T=f(S(v,R),S(_,R),R,true);return R.skipEscape=true,g(T,R)}function f(v,_,y,R){let T={};return R||(v=S(g(v,y),y),_=S(g(_,y),y)),y=y||{},!y.tolerant&&_.scheme?(T.scheme=_.scheme,T.userinfo=_.userinfo,T.host=_.host,T.port=_.port,T.path=i(_.path||""),T.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(T.userinfo=_.userinfo,T.host=_.host,T.port=_.port,T.path=i(_.path||""),T.query=_.query):(_.path?(_.path[0]==="/"?T.path=i(_.path):((v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)&&!v.path?T.path="/"+_.path:v.path?T.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+_.path:T.path=_.path,T.path=i(T.path)),T.query=_.query):(T.path=v.path,_.query!==void 0?T.query=_.query:T.query=v.query),T.userinfo=v.userinfo,T.host=v.host,T.port=v.port),T.scheme=v.scheme),T.fragment=_.fragment,T}function p(v,_,y){return typeof v=="string"?(v=unescape(v),v=g(s(S(v,y),true),{...y,skipEscape:true})):typeof v=="object"&&(v=g(s(v,true),{...y,skipEscape:true})),typeof _=="string"?(_=unescape(_),_=g(s(S(_,y),true),{...y,skipEscape:true})):typeof _=="object"&&(_=g(s(_,true),{...y,skipEscape:true})),v.toLowerCase()===_.toLowerCase()}function g(v,_){let y={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},R=Object.assign({},_),T=[],b=l(R.scheme||y.scheme);b&&b.serialize&&b.serialize(y,R),y.path!==void 0&&(R.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),R.reference!=="suffix"&&y.scheme&&T.push(y.scheme,":");let E=n(y);if(E!==void 0&&(R.reference!=="suffix"&&T.push("//"),T.push(E),y.path&&y.path[0]!=="/"&&T.push("/")),y.path!==void 0){let M=y.path;!R.absolutePath&&(!b||!b.absolutePath)&&(M=i(M)),E===void 0&&M[0]==="/"&&M[1]==="/"&&(M="/%2F"+M.slice(2)),T.push(M);}return y.query!==void 0&&T.push("?",y.query),y.fragment!==void 0&&T.push("#",y.fragment),T.join("")}let m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(v,_){let y=Object.assign({},_),R={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=false;y.reference==="suffix"&&(y.scheme?v=y.scheme+":"+v:v="//"+v);let b=v.match(m);if(b){if(R.scheme=b[1],R.userinfo=b[3],R.host=b[4],R.port=parseInt(b[5],10),R.path=b[6]||"",R.query=b[7],R.fragment=b[8],isNaN(R.port)&&(R.port=b[5]),R.host)if(o(R.host)===false){let M=r(R.host);R.host=M.host.toLowerCase(),T=M.isIPV6;}else T=true;R.scheme===void 0&&R.userinfo===void 0&&R.host===void 0&&R.port===void 0&&R.query===void 0&&!R.path?R.reference="same-document":R.scheme===void 0?R.reference="relative":R.fragment===void 0?R.reference="absolute":R.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==R.reference&&(R.error=R.error||"URI is not a "+y.reference+" reference.");let E=l(y.scheme||R.scheme);if(!y.unicodeSupport&&(!E||!E.unicodeSupport)&&R.host&&(y.domainHost||E&&E.domainHost)&&T===false&&a(R.host))try{R.host=URL.domainToASCII(R.host.toLowerCase());}catch(M){R.error=R.error||"Host's domain name can not be converted to ASCII: "+M;}(!E||E&&!E.skipNormalize)&&(v.indexOf("%")!==-1&&(R.scheme!==void 0&&(R.scheme=unescape(R.scheme)),R.host!==void 0&&(R.host=unescape(R.host))),R.path&&(R.path=escape(unescape(R.path))),R.fragment&&(R.fragment=encodeURI(decodeURIComponent(R.fragment)))),E&&E.parse&&E.parse(R,y);}else R.error=R.error||"URI can not be parsed.";return R}let h={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:g,parse:S};e.exports=h,e.exports.default=h,e.exports.fastUri=h;})),J1=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=X1();e.code='require("ajv/dist/runtime/uri").default',t.default=e;})),Zv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return e.KeywordCxt}});var r=Re();Object.defineProperty(t,"_",{enumerable:true,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return r.CodeGen}});let i=wa(),n=As(),s=xT(),o=eh(),a=Re(),c=Qd(),l=Jd(),u=ze(),d=K1(),f=J1(),p=(P,U)=>new RegExp(P,U);p.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),S={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function _(P){var U,q,w,C,L,ee,ue,Ee,pe,Ie,je,A,V,H,me,ge,we,nt,at,gt,it,Xe,Wt,lt,wn;let rn=P.strict,Mn=(U=P.code)===null||U===void 0?void 0:U.optimize,jn=Mn===true||Mn===void 0?1:Mn||0,Gn=(w=(q=P.code)===null||q===void 0?void 0:q.regExp)!==null&&w!==void 0?w:p,Hr=(C=P.uriResolver)!==null&&C!==void 0?C:f.default;return {strictSchema:(ee=(L=P.strictSchema)!==null&&L!==void 0?L:rn)!==null&&ee!==void 0?ee:true,strictNumbers:(Ee=(ue=P.strictNumbers)!==null&&ue!==void 0?ue:rn)!==null&&Ee!==void 0?Ee:true,strictTypes:(Ie=(pe=P.strictTypes)!==null&&pe!==void 0?pe:rn)!==null&&Ie!==void 0?Ie:"log",strictTuples:(A=(je=P.strictTuples)!==null&&je!==void 0?je:rn)!==null&&A!==void 0?A:"log",strictRequired:(H=(V=P.strictRequired)!==null&&V!==void 0?V:rn)!==null&&H!==void 0?H:false,code:P.code?{...P.code,optimize:jn,regExp:Gn}:{optimize:jn,regExp:Gn},loopRequired:(me=P.loopRequired)!==null&&me!==void 0?me:v,loopEnum:(ge=P.loopEnum)!==null&&ge!==void 0?ge:v,meta:(we=P.meta)!==null&&we!==void 0?we:true,messages:(nt=P.messages)!==null&&nt!==void 0?nt:true,inlineRefs:(at=P.inlineRefs)!==null&&at!==void 0?at:true,schemaId:(gt=P.schemaId)!==null&>!==void 0?gt:"$id",addUsedSchema:(it=P.addUsedSchema)!==null&&it!==void 0?it:true,validateSchema:(Xe=P.validateSchema)!==null&&Xe!==void 0?Xe:true,validateFormats:(Wt=P.validateFormats)!==null&&Wt!==void 0?Wt:true,unicodeRegExp:(lt=P.unicodeRegExp)!==null&<!==void 0?lt:true,int32range:(wn=P.int32range)!==null&&wn!==void 0?wn:true,uriResolver:Hr}}var y=class{constructor(P={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,P=this.opts={...P,..._(P)};let{es5:U,lines:q}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:U,lines:q}),this.logger=k(P.logger);let w=P.validateFormats;P.validateFormats=false,this.RULES=(0, s.getRules)(),R.call(this,S,P,"NOT SUPPORTED"),R.call(this,h,P,"DEPRECATED","warn"),this._metaOpts=N.call(this),P.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),P.keywords&&M.call(this,P.keywords),typeof P.meta=="object"&&this.addMetaSchema(P.meta),b.call(this),P.validateFormats=w;}_addVocabularies(){this.addKeyword("$async");}_addDefaultMetaSchema(){let{$data:P,meta:U,schemaId:q}=this.opts,w=d;q==="id"&&(w={...d},w.id=w.$id,delete w.$id),U&&P&&this.addMetaSchema(w,w[q],false);}defaultMeta(){let{meta:P,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof P=="object"?P[U]||P:void 0}validate(P,U){let q;if(typeof P=="string"){if(q=this.getSchema(P),!q)throw new Error(`no schema with key or ref "${P}"`)}else q=this.compile(P);let w=q(U);return "$async"in q||(this.errors=q.errors),w}compile(P,U){let q=this._addSchema(P,U);return q.validate||this._compileSchemaEnv(q)}compileAsync(P,U){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:q}=this.opts;return w.call(this,P,U);async function w(pe,Ie){await C.call(this,pe.$schema);let je=this._addSchema(pe,Ie);return je.validate||L.call(this,je)}async function C(pe){pe&&!this.getSchema(pe)&&await w.call(this,{$ref:pe},true);}async function L(pe){try{return this._compileSchemaEnv(pe)}catch(Ie){if(!(Ie instanceof n.default))throw Ie;return ee.call(this,Ie),await ue.call(this,Ie.missingSchema),L.call(this,pe)}}function ee({missingSchema:pe,missingRef:Ie}){if(this.refs[pe])throw new Error(`AnySchema ${pe} is loaded but ${Ie} cannot be resolved`)}async function ue(pe){let Ie=await Ee.call(this,pe);this.refs[pe]||await C.call(this,Ie.$schema),this.refs[pe]||this.addSchema(Ie,pe,U);}async function Ee(pe){let Ie=this._loading[pe];if(Ie)return Ie;try{return await(this._loading[pe]=q(pe))}finally{delete this._loading[pe];}}}addSchema(P,U,q,w=this.opts.validateSchema){if(Array.isArray(P)){for(let L of P)this.addSchema(L,void 0,q,w);return this}let C;if(typeof P=="object"){let{schemaId:L}=this.opts;if(C=P[L],C!==void 0&&typeof C!="string")throw new Error(`schema ${L} must be string`)}return U=(0, c.normalizeId)(U||C),this._checkUnique(U),this.schemas[U]=this._addSchema(P,q,U,w,true),this}addMetaSchema(P,U,q=this.opts.validateSchema){return this.addSchema(P,U,true,q),this}validateSchema(P,U){if(typeof P=="boolean")return true;let q;if(q=P.$schema,q!==void 0&&typeof q!="string")throw new Error("$schema must be a string");if(q=q||this.opts.defaultMeta||this.defaultMeta(),!q)return this.logger.warn("meta-schema not available"),this.errors=null,true;let w=this.validate(q,P);if(!w&&U){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return w}getSchema(P){let U;for(;typeof(U=T.call(this,P))=="string";)P=U;if(U===void 0){let{schemaId:q}=this.opts,w=new o.SchemaEnv({schema:{},schemaId:q});if(U=o.resolveSchema.call(this,w,P),!U)return;this.refs[P]=U;}return U.validate||this._compileSchemaEnv(U)}removeSchema(P){if(P instanceof RegExp)return this._removeAllSchemas(this.schemas,P),this._removeAllSchemas(this.refs,P),this;switch(typeof P){case "undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case "string":{let U=T.call(this,P);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[P],delete this.refs[P],this}case "object":{let U=P;this._cache.delete(U);let q=P[this.opts.schemaId];return q&&(q=(0, c.normalizeId)(q),delete this.schemas[q],delete this.refs[q]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(P){for(let U of P)this.addKeyword(U);return this}addKeyword(P,U){let q;if(typeof P=="string")q=P,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=q);else if(typeof P=="object"&&U===void 0){if(U=P,q=U.keyword,Array.isArray(q)&&!q.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,q,U),!U)return (0, u.eachItem)(q,C=>Q.call(this,C)),this;ye.call(this,U);let w={...U,type:(0, l.getJSONTypes)(U.type),schemaType:(0, l.getJSONTypes)(U.schemaType)};return (0, u.eachItem)(q,w.type.length===0?C=>Q.call(this,C,w):C=>w.type.forEach(L=>Q.call(this,C,w,L))),this}getKeyword(P){let U=this.RULES.all[P];return typeof U=="object"?U.definition:!!U}removeKeyword(P){let{RULES:U}=this;delete U.keywords[P],delete U.all[P];for(let q of U.rules){let w=q.rules.findIndex(C=>C.keyword===P);w>=0&&q.rules.splice(w,1);}return this}addFormat(P,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[P]=U,this}errorsText(P=this.errors,{separator:U=", ",dataVar:q="data"}={}){return !P||P.length===0?"No errors":P.map(w=>`${q}${w.instancePath} ${w.message}`).reduce((w,C)=>w+U+C)}$dataMetaSchema(P,U){let q=this.RULES.all;P=JSON.parse(JSON.stringify(P));for(let w of U){let C=w.split("/").slice(1),L=P;for(let ee of C)L=L[ee];for(let ee in q){let ue=q[ee];if(typeof ue!="object")continue;let{$data:Ee}=ue.definition,pe=L[ee];Ee&&pe&&(L[ee]=ve(pe));}}return P}_removeAllSchemas(P,U){for(let q in P){let w=P[q];(!U||U.test(q))&&(typeof w=="string"?delete P[q]:w&&!w.meta&&(this._cache.delete(w.schema),delete P[q]));}}_addSchema(P,U,q,w=this.opts.validateSchema,C=this.opts.addUsedSchema){let L,{schemaId:ee}=this.opts;if(typeof P=="object")L=P[ee];else {if(this.opts.jtd)throw new Error("schema must be object");if(typeof P!="boolean")throw new Error("schema must be object or boolean")}let ue=this._cache.get(P);if(ue!==void 0)return ue;q=(0, c.normalizeId)(L||q);let Ee=c.getSchemaRefs.call(this,P,q);return ue=new o.SchemaEnv({schema:P,schemaId:ee,meta:U,baseId:q,localRefs:Ee}),this._cache.set(ue.schema,ue),C&&!q.startsWith("#")&&(q&&this._checkUnique(q),this.refs[q]=ue),w&&this.validateSchema(P,true),ue}_checkUnique(P){if(this.schemas[P]||this.refs[P])throw new Error(`schema with key or id "${P}" already exists`)}_compileSchemaEnv(P){if(P.meta?this._compileMetaSchema(P):o.compileSchema.call(this,P),!P.validate)throw new Error("ajv implementation error");return P.validate}_compileMetaSchema(P){let U=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,P);}finally{this.opts=U;}}};y.ValidationError=i.default,y.MissingRefError=n.default,t.default=y;function R(P,U,q,w="error"){for(let C in P){let L=C;L in U&&this.logger[w](`${q}: option ${C}. ${P[L]}`);}}function T(P){return P=(0, c.normalizeId)(P),this.schemas[P]||this.refs[P]}function b(){let P=this.opts.schemas;if(P)if(Array.isArray(P))this.addSchema(P);else for(let U in P)this.addSchema(P[U],U);}function E(){for(let P in this.opts.formats){let U=this.opts.formats[P];U&&this.addFormat(P,U);}}function M(P){if(Array.isArray(P)){this.addVocabulary(P);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let U in P){let q=P[U];q.keyword||(q.keyword=U),this.addKeyword(q);}}function N(){let P={...this.opts};for(let U of g)delete P[U];return P}let O={log(){},warn(){},error(){}};function k(P){if(P===false)return O;if(P===void 0)return console;if(P.log&&P.warn&&P.error)return P;throw new Error("logger must implement log, warn and error methods")}let j=/^[a-z_$][a-z0-9_$:-]*$/i;function G(P,U){let{RULES:q}=this;if((0, u.eachItem)(P,w=>{if(q.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!j.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!U&&U.$data&&!("code"in U||"validate"in U))throw new Error('$data keyword must have "code" or "validate" function')}function Q(P,U,q){var w;let C=U?.post;if(q&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:L}=this,ee=C?L.post:L.rules.find(({type:Ee})=>Ee===q);if(ee||(ee={type:q,rules:[]},L.rules.push(ee)),L.keywords[P]=true,!U)return;let ue={keyword:P,definition:{...U,type:(0, l.getJSONTypes)(U.type),schemaType:(0, l.getJSONTypes)(U.schemaType)}};U.before?Se.call(this,ee,ue,U.before):ee.rules.push(ue),L.all[P]=ue,(w=U.implements)===null||w===void 0||w.forEach(Ee=>this.addKeyword(Ee));}function Se(P,U,q){let w=P.rules.findIndex(C=>C.keyword===q);w>=0?P.rules.splice(w,0,U):(P.rules.push(U),this.logger.warn(`rule ${q} is not defined`));}function ye(P){let{metaSchema:U}=P;U!==void 0&&(P.$data&&this.opts.$data&&(U=ve(U)),P.validateSchema=this.compile(U,true));}let Fe={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ve(P){return {anyOf:[P,Fe]}}})),Y1=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e;})),Xv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.callRef=t.getValidate=void 0;let e=As(),r=un(),i=Re(),n=ln(),s=eh(),o=ze(),a={keyword:"$ref",schemaType:"string",code(u){let{gen:d,schema:f,it:p}=u,{baseId:g,schemaEnv:m,validateName:S,opts:h,self:v}=p,{root:_}=m;if((f==="#"||f==="#/")&&g===_.baseId)return R();let y=s.resolveRef.call(v,_,g,f);if(y===void 0)throw new e.default(p.opts.uriResolver,g,f);if(y instanceof s.SchemaEnv)return T(y);return b(y);function R(){if(m===_)return l(u,S,m,m.$async);let E=d.scopeValue("root",{ref:_});return l(u,(0, i._)`${E}.validate`,_,_.$async)}function T(E){l(u,c(u,E),E,E.$async);}function b(E){let M=d.scopeValue("schema",h.code.source===true?{ref:E,code:(0, i.stringify)(E)}:{ref:E}),N=d.name("valid"),O=u.subschema({schema:E,dataTypes:[],schemaPath:i.nil,topSchemaRef:M,errSchemaPath:f},N);u.mergeEvaluated(O),u.ok(N);}}};function c(u,d){let{gen:f}=u;return d.validate?f.scopeValue("validate",{ref:d.validate}):(0, i._)`${f.scopeValue("wrapper",{ref:d})}.validate`}t.getValidate=c;function l(u,d,f,p){let{gen:g,it:m}=u,{allErrors:S,schemaEnv:h,opts:v}=m,_=v.passContext?n.default.this:i.nil;p?y():R();function y(){if(!h.$async)throw new Error("async schema referenced by sync schema");let E=g.let("valid");g.try(()=>{g.code((0, i._)`await ${(0, r.callValidateCode)(u,d,_)}`),b(d),S||g.assign(E,true);},M=>{g.if((0, i._)`!(${M} instanceof ${m.ValidationError})`,()=>g.throw(M)),T(M),S||g.assign(E,false);}),u.ok(E);}function R(){u.result((0, r.callValidateCode)(u,d,_),()=>b(d),()=>T(d));}function T(E){let M=(0, i._)`${E}.errors`;g.assign(n.default.vErrors,(0, i._)`${n.default.vErrors} === null ? ${M} : ${n.default.vErrors}.concat(${M})`),g.assign(n.default.errors,(0, i._)`${n.default.vErrors}.length`);}function b(E){var M;if(!m.opts.unevaluated)return;let N=(M=f?.validate)===null||M===void 0?void 0:M.evaluated;if(m.props!==true)if(N&&!N.dynamicProps)N.props!==void 0&&(m.props=o.mergeEvaluated.props(g,N.props,m.props));else {let O=g.var("props",(0, i._)`${E}.evaluated.props`);m.props=o.mergeEvaluated.props(g,O,m.props,i.Name);}if(m.items!==true)if(N&&!N.dynamicItems)N.items!==void 0&&(m.items=o.mergeEvaluated.items(g,N.items,m.items));else {let O=g.var("items",(0, i._)`${E}.evaluated.items`);m.items=o.mergeEvaluated.items(g,O,m.items,i.Name);}}}t.callRef=l,t.default=a;})),ET=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Y1(),r=Xv(),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=i;})),Q1=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=e.operators,i={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(i),type:"number",schemaType:"number",$data:true,error:{message:({keyword:s,schemaCode:o})=>(0, e.str)`must be ${i[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0, e._)`{comparison: ${i[s].okStr}, limit: ${o}}`},code(s){let{keyword:o,data:a,schemaCode:c}=s;s.fail$data((0, e._)`${a} ${i[o].fail} ${c} || isNaN(${a})`);}};t.default=n;})),eC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:{message:({schemaCode:i})=>(0, e.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0, e._)`{multipleOf: ${i}}`},code(i){let{gen:n,data:s,schemaCode:o,it:a}=i,c=a.opts.multipleOfPrecision,l=n.let("res"),u=c?(0, e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0, e._)`${l} !== parseInt(${l})`;i.fail$data((0, e._)`(${o} === 0 || (${l} = ${s}/${o}, ${u}))`);}};t.default=r;})),tC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});function e(r){let i=r.length,n=0,s=0,o;for(;s<i;)n++,o=r.charCodeAt(s++),o>=55296&&o<=56319&&s<i&&(o=r.charCodeAt(s),(o&64512)===56320&&s++);return n}t.default=e,e.code='require("ajv/dist/runtime/ucs2length").default';})),nC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i=tC(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:{message({keyword:s,schemaCode:o}){let a=s==="maxLength"?"more":"fewer";return (0, e.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0, e._)`{limit: ${s}}`},code(s){let{keyword:o,data:a,schemaCode:c,it:l}=s,u=o==="maxLength"?e.operators.GT:e.operators.LT,d=l.opts.unicode===false?(0, e._)`${a}.length`:(0, e._)`${(0, r.useFunc)(s.gen,i.default)}(${a})`;s.fail$data((0, e._)`${d} ${u} ${c}`);}};t.default=n;})),rC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=ze(),i=Re(),n={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:{message:({schemaCode:s})=>(0, i.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0, i._)`{pattern: ${s}}`},code(s){let{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:d}=s,f=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:p}=d.opts.code,g=p.code==="new RegExp"?(0, i._)`new RegExp`:(0, r.useFunc)(o,p),m=o.let("valid");o.try(()=>o.assign(m,(0, i._)`${g}(${u}, ${f}).test(${a})`),()=>o.assign(m,false)),s.fail$data((0, i._)`!${m}`);}else {let p=(0, e.usePattern)(s,l);s.fail$data((0, i._)`!${p}.test(${a})`);}}};t.default=n;})),iC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:{message({keyword:i,schemaCode:n}){let s=i==="maxProperties"?"more":"fewer";return (0, e.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:i})=>(0, e._)`{limit: ${i}}`},code(i){let{keyword:n,data:s,schemaCode:o}=i,a=n==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0, e._)`Object.keys(${s}).length ${a} ${o}`);}};t.default=r;})),sC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Re(),i=ze(),n={keyword:"required",type:"object",schemaType:"array",$data:true,error:{message:({params:{missingProperty:s}})=>(0, r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0, r._)`{missingProperty: ${s}}`},code(s){let{gen:o,schema:a,schemaCode:c,data:l,$data:u,it:d}=s,{opts:f}=d;if(!u&&a.length===0)return;let p=a.length>=f.loopRequired;if(d.allErrors?g():m(),f.strictRequired){let v=s.parentSchema.properties,{definedProperties:_}=s.it;for(let y of a)if(v?.[y]===void 0&&!_.has(y)){let R=`required property "${y}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0, i.checkStrictMode)(d,R,d.opts.strictRequired);}}function g(){if(p||u)s.block$data(r.nil,S);else for(let v of a)(0, e.checkReportMissingProp)(s,v);}function m(){let v=o.let("missing");if(p||u){let _=o.let("valid",true);s.block$data(_,()=>h(v,_)),s.ok(_);}else o.if((0, e.checkMissingProp)(s,a,v)),(0, e.reportMissingProp)(s,v),o.else();}function S(){o.forOf("prop",c,v=>{s.setParams({missingProperty:v}),o.if((0, e.noPropertyInData)(o,l,v,f.ownProperties),()=>s.error());});}function h(v,_){s.setParams({missingProperty:v}),o.forOf(v,c,()=>{o.assign(_,(0, e.propertyInData)(o,l,v,f.ownProperties)),o.if((0, r.not)(_),()=>{s.error(),o.break();});},r.nil);}}};t.default=n;})),oC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:{message({keyword:i,schemaCode:n}){let s=i==="maxItems"?"more":"fewer";return (0, e.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:i})=>(0, e._)`{limit: ${i}}`},code(i){let{keyword:n,data:s,schemaCode:o}=i,a=n==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0, e._)`${s}.length ${a} ${o}`);}};t.default=r;})),Jv=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=TT();e.code='require("ajv/dist/runtime/equal").default',t.default=e;})),aC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Jd(),r=Re(),i=ze(),n=Jv(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:{message:({params:{i:o,j:a}})=>(0, r.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0, r._)`{i: ${o}, j: ${a}}`},code(o){let{gen:a,data:c,$data:l,schema:u,parentSchema:d,schemaCode:f,it:p}=o;if(!l&&!u)return;let g=a.let("valid"),m=d.items?(0, e.getSchemaTypes)(d.items):[];o.block$data(g,S,(0, r._)`${f} === false`),o.ok(g);function S(){let y=a.let("i",(0, r._)`${c}.length`),R=a.let("j");o.setParams({i:y,j:R}),a.assign(g,true),a.if((0, r._)`${y} > 1`,()=>(h()?v:_)(y,R));}function h(){return m.length>0&&!m.some(y=>y==="object"||y==="array")}function v(y,R){let T=a.name("item"),b=(0, e.checkDataTypes)(m,T,p.opts.strictNumbers,e.DataType.Wrong),E=a.const("indices",(0, r._)`{}`);a.for((0, r._)`;${y}--;`,()=>{a.let(T,(0, r._)`${c}[${y}]`),a.if(b,(0, r._)`continue`),m.length>1&&a.if((0, r._)`typeof ${T} == "string"`,(0, r._)`${T} += "_"`),a.if((0, r._)`typeof ${E}[${T}] == "number"`,()=>{a.assign(R,(0, r._)`${E}[${T}]`),o.error(),a.assign(g,false).break();}).code((0, r._)`${E}[${T}] = ${y}`);});}function _(y,R){let T=(0, i.useFunc)(a,n.default),b=a.name("outer");a.label(b).for((0, r._)`;${y}--;`,()=>a.for((0, r._)`${R} = ${y}; ${R}--;`,()=>a.if((0, r._)`${T}(${c}[${y}], ${c}[${R}])`,()=>{o.error(),a.assign(g,false).break(b);})));}}};t.default=s;})),cC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i=Jv(),n={keyword:"const",$data:true,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0, e._)`{allowedValue: ${s}}`},code(s){let{gen:o,data:a,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0, e._)`!${(0, r.useFunc)(o,i.default)}(${a}, ${l})`):s.fail((0, e._)`${u} !== ${a}`);}};t.default=n;})),lC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i=Jv(),n={keyword:"enum",schemaType:"array",$data:true,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0, e._)`{allowedValues: ${s}}`},code(s){let{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:d}=s;if(!c&&l.length===0)throw new Error("enum must have non-empty array");let f=l.length>=d.opts.loopEnum,p,g=()=>p??(p=(0, r.useFunc)(o,i.default)),m;if(f||c)m=o.let("valid"),s.block$data(m,S);else {if(!Array.isArray(l))throw new Error("ajv implementation error");let v=o.const("vSchema",u);m=(0, e.or)(...l.map((_,y)=>h(v,y)));}s.pass(m);function S(){o.assign(m,false),o.forOf("v",u,v=>o.if((0, e._)`${g()}(${a}, ${v})`,()=>o.assign(m,true).break()));}function h(v,_){let y=l[_];return typeof y=="object"&&y!==null?(0, e._)`${g()}(${a}, ${v}[${_}])`:(0, e._)`${a} === ${y}`}}};t.default=n;})),wT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Q1(),r=eC(),i=nC(),n=rC(),s=iC(),o=sC(),a=oC(),c=aC(),l=cC(),u=lC(),d=[e.default,r.default,i.default,n.default,s.default,o.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];t.default=d;})),MT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateAdditionalItems=void 0;let e=Re(),r=ze(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0, e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0, e._)`{limit: ${s}}`},code(s){let{parentSchema:o,it:a}=s,{items:c}=o;if(!Array.isArray(c)){(0, r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c);}};function n(s,o){let{gen:a,schema:c,data:l,keyword:u,it:d}=s;d.items=true;let f=a.const("len",(0, e._)`${l}.length`);if(c===false)s.setParams({len:o.length}),s.pass((0, e._)`${f} <= ${o.length}`);else if(typeof c=="object"&&!(0, r.alwaysValidSchema)(d,c)){let g=a.var("valid",(0, e._)`${f} <= ${o.length}`);a.if((0, e.not)(g),()=>p(g)),s.ok(g);}function p(g){a.forRange("i",o.length,f,m=>{s.subschema({keyword:u,dataProp:m,dataPropType:r.Type.Num},g),d.allErrors||a.if((0, e.not)(g),()=>a.break());});}}t.validateAdditionalItems=n,t.default=i;})),AT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateTuple=void 0;let e=Re(),r=ze(),i=un(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){let{schema:a,it:c}=o;if(Array.isArray(a))return s(o,"additionalItems",a);c.items=true,!(0, r.alwaysValidSchema)(c,a)&&o.ok((0, i.validateArray)(o));}};function s(o,a,c=o.schema){let{gen:l,parentSchema:u,data:d,keyword:f,it:p}=o;S(u),p.opts.unevaluated&&c.length&&p.items!==true&&(p.items=r.mergeEvaluated.items(l,c.length,p.items));let g=l.name("valid"),m=l.const("len",(0, e._)`${d}.length`);c.forEach((h,v)=>{(0, r.alwaysValidSchema)(p,h)||(l.if((0, e._)`${m} > ${v}`,()=>o.subschema({keyword:f,schemaProp:v,dataProp:v},g)),o.ok(g));});function S(h){let{opts:v,errSchemaPath:_}=p,y=c.length,R=y===h.minItems&&(y===h.maxItems||h[a]===false);if(v.strictTuples&&!R){let T=`"${f}" is ${y}-tuple, but minItems or maxItems/${a} are not specified or different at path "${_}"`;(0, r.checkStrictMode)(p,T,v.strictTuples);}}}t.validateTuple=s,t.default=n;})),uC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=AT(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:i=>(0, e.validateTuple)(i,"items")};t.default=r;})),dC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i=un(),n=MT(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0, e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0, e._)`{limit: ${o}}`},code(o){let{schema:a,parentSchema:c,it:l}=o,{prefixItems:u}=c;l.items=true,!(0, r.alwaysValidSchema)(l,a)&&(u?(0, n.validateAdditionalItems)(o,u):o.ok((0, i.validateArray)(o)));}};t.default=s;})),hC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:{message:({params:{min:n,max:s}})=>s===void 0?(0, e.str)`must contain at least ${n} valid item(s)`:(0, e.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0, e._)`{minContains: ${n}}`:(0, e._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:o,parentSchema:a,data:c,it:l}=n,u,d,{minContains:f,maxContains:p}=a;l.opts.next?(u=f===void 0?1:f,d=p):u=1;let g=s.const("len",(0, e._)`${c}.length`);if(n.setParams({min:u,max:d}),d===void 0&&u===0){(0, r.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&u>d){(0, r.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0, r.alwaysValidSchema)(l,o)){let _=(0, e._)`${g} >= ${u}`;d!==void 0&&(_=(0, e._)`${_} && ${g} <= ${d}`),n.pass(_);return}l.items=true;let m=s.name("valid");d===void 0&&u===1?h(m,()=>s.if(m,()=>s.break())):u===0?(s.let(m,true),d!==void 0&&s.if((0, e._)`${c}.length > 0`,S)):(s.let(m,false),S()),n.result(m,()=>n.reset());function S(){let _=s.name("_valid"),y=s.let("count",0);h(_,()=>s.if(_,()=>v(y)));}function h(_,y){s.forRange("i",0,g,R=>{n.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:true},_),y();});}function v(_){s.code((0, e._)`${_}++`),d===void 0?s.if((0, e._)`${_} >= ${u}`,()=>s.assign(m,true).break()):(s.if((0, e._)`${_} > ${d}`,()=>s.assign(m,false).break()),u===1?s.assign(m,true):s.if((0, e._)`${_} >= ${u}`,()=>s.assign(m,true)));}}};t.default=i;})),Yv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let e=Re(),r=ze(),i=un();t.error={message:({params:{property:c,depsCount:l,deps:u}})=>{let d=l===1?"property":"properties";return (0, e.str)`must have ${d} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:d}})=>(0, e._)`{property: ${c},
|
|
72
|
+
|| ${M} === "boolean" || ${b} === null`).assign(N,(0, n._)`[${b}]`);}}}function p({gen:_,parentData:y,parentDataProperty:R},T){_.if((0, n._)`${y} !== undefined`,()=>_.assign((0, n._)`${y}[${R}]`,T));}function g(_,y,R,T=o.Correct){let b=T===o.Correct?n.operators.EQ:n.operators.NEQ,E;switch(_){case "null":return (0, n._)`${y} ${b} null`;case "array":E=(0, n._)`Array.isArray(${y})`;break;case "object":E=(0, n._)`${y} && typeof ${y} == "object" && !Array.isArray(${y})`;break;case "integer":E=M((0, n._)`!(${y} % 1) && !isNaN(${y})`);break;case "number":E=M();break;default:return (0, n._)`typeof ${y} ${b} ${_}`}return T===o.Correct?E:(0, n.not)(E);function M(N=n.nil){return (0, n.and)((0, n._)`typeof ${y} == "number"`,N,R?(0, n._)`isFinite(${y})`:n.nil)}}t.checkDataType=g;function m(_,y,R,T){if(_.length===1)return g(_[0],y,R,T);let b,E=(0, s.toHash)(_);if(E.array&&E.object){let M=(0, n._)`typeof ${y} != "object"`;b=E.null?M:(0, n._)`!${y} || ${M}`,delete E.null,delete E.array,delete E.object;}else b=n.nil;E.number&&delete E.integer;for(let M in E)b=(0, n.and)(b,g(M,y,R,T));return b}t.checkDataTypes=m;let S={message:({schema:_})=>`must be ${_}`,params:({schema:_,schemaValue:y})=>typeof _=="string"?(0, n._)`{type: ${_}}`:(0, n._)`{type: ${y}}`};function h(_){let y=v(_);(0, i.reportError)(y,S);}t.reportTypeError=h;function v(_){let{gen:y,data:R,schema:T}=_,b=(0, s.schemaRefOrVal)(_,T,"type");return {gen:y,keyword:"type",data:R,schema:T.type,schemaCode:b,schemaValue:b,parentSchema:T,params:{},it:_}}})),q1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.assignDefaults=void 0;let e=Te(),r=ze();function i(s,o){let{properties:a,items:c}=s.schema;if(o==="object"&&a)for(let l in a)n(s,l,a[l].default);else o==="array"&&Array.isArray(c)&&c.forEach((l,u)=>n(s,u,l.default));}t.assignDefaults=i;function n(s,o,a){let{gen:c,compositeRule:l,data:u,opts:d}=s;if(a===void 0)return;let f=(0, e._)`${u}${(0, e.getProperty)(o)}`;if(l){(0, r.checkStrictMode)(s,`default is ignored for: ${f}`);return}let p=(0, e._)`${f} === undefined`;d.useDefaults==="empty"&&(p=(0, e._)`${p} || ${f} === null || ${f} === ""`),c.if(p,(0, e._)`${f} = ${(0, e.stringify)(a)}`);}})),un=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let e=Te(),r=ze(),i=ln(),n=ze();function s(_,y){let{gen:R,data:T,it:b}=_;R.if(d(R,T,y,b.opts.ownProperties),()=>{_.setParams({missingProperty:(0, e._)`${y}`},true),_.error();});}t.checkReportMissingProp=s;function o({gen:_,data:y,it:{opts:R}},T,b){return (0, e.or)(...T.map(E=>(0, e.and)(d(_,y,E,R.ownProperties),(0, e._)`${b} = ${E}`)))}t.checkMissingProp=o;function a(_,y){_.setParams({missingProperty:y},true),_.error();}t.reportMissingProp=a;function c(_){return _.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0, e._)`Object.prototype.hasOwnProperty`})}t.hasPropFunc=c;function l(_,y,R){return (0, e._)`${c(_)}.call(${y}, ${R})`}t.isOwnProperty=l;function u(_,y,R,T){let b=(0, e._)`${y}${(0, e.getProperty)(R)} !== undefined`;return T?(0, e._)`${b} && ${l(_,y,R)}`:b}t.propertyInData=u;function d(_,y,R,T){let b=(0, e._)`${y}${(0, e.getProperty)(R)} === undefined`;return T?(0, e.or)(b,(0, e.not)(l(_,y,R))):b}t.noPropertyInData=d;function f(_){return _?Object.keys(_).filter(y=>y!=="__proto__"):[]}t.allSchemaProperties=f;function p(_,y){return f(y).filter(R=>!(0, r.alwaysValidSchema)(_,y[R]))}t.schemaProperties=p;function g({schemaCode:_,data:y,it:{gen:R,topSchemaRef:T,schemaPath:b,errorPath:E},it:M},N,O,k){let j=k?(0, e._)`${_}, ${y}, ${T}${b}`:y,G=[[i.default.instancePath,(0, e.strConcat)(i.default.instancePath,E)],[i.default.parentData,M.parentData],[i.default.parentDataProperty,M.parentDataProperty],[i.default.rootData,i.default.rootData]];M.opts.dynamicRef&&G.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);let ne=(0, e._)`${j}, ${R.object(...G)}`;return O!==e.nil?(0, e._)`${N}.call(${O}, ${ne})`:(0, e._)`${N}(${ne})`}t.callValidateCode=g;let m=(0, e._)`new RegExp`;function S({gen:_,it:{opts:y}},R){let T=y.unicodeRegExp?"u":"",{regExp:b}=y.code,E=b(R,T);return _.scopeValue("pattern",{key:E.toString(),ref:E,code:(0, e._)`${b.code==="new RegExp"?m:(0, n.useFunc)(_,b)}(${R}, ${T})`})}t.usePattern=S;function h(_){let{gen:y,data:R,keyword:T,it:b}=_,E=y.name("valid");if(b.allErrors){let N=y.let("valid",true);return M(()=>y.assign(N,false)),N}return y.var(E,true),M(()=>y.break()),E;function M(N){let O=y.const("len",(0, e._)`${R}.length`);y.forRange("i",0,O,k=>{_.subschema({keyword:T,dataProp:k,dataPropType:r.Type.Num},E),y.if((0, e.not)(E),N);});}}t.validateArray=h;function v(_){let{gen:y,schema:R,keyword:T,it:b}=_;if(!Array.isArray(R))throw new Error("ajv implementation error");if(R.some(N=>(0, r.alwaysValidSchema)(b,N))&&!b.opts.unevaluated)return;let E=y.let("valid",false),M=y.name("_valid");y.block(()=>R.forEach((N,O)=>{let k=_.subschema({keyword:T,schemaProp:O,compositeRule:true},M);y.assign(E,(0, e._)`${E} || ${M}`),_.mergeValidEvaluated(k,M)||y.if((0, e.not)(E));})),_.result(E,()=>_.reset(),()=>_.error(true));}t.validateUnion=v;})),W1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let e=Te(),r=ln(),i=un(),n=Yd();function s(p,g){let{gen:m,keyword:S,schema:h,parentSchema:v,it:_}=p,y=g.macro.call(_.self,h,v,_),R=u(m,S,y);_.opts.validateSchema!==false&&_.self.validateSchema(y,true);let T=m.name("valid");p.subschema({schema:y,schemaPath:e.nil,errSchemaPath:`${_.errSchemaPath}/${S}`,topSchemaRef:R,compositeRule:true},T),p.pass(T,()=>p.error(true));}t.macroKeywordCode=s;function o(p,g){var m;let{gen:S,keyword:h,schema:v,parentSchema:_,$data:y,it:R}=p;l(R,g);let T=u(S,h,!y&&g.compile?g.compile.call(R.self,v,_,R):g.validate),b=S.let("valid");p.block$data(b,E),p.ok((m=g.valid)!==null&&m!==void 0?m:b);function E(){if(g.errors===false)O(),g.modifying&&a(p),k(()=>p.error());else {let j=g.async?M():N();g.modifying&&a(p),k(()=>c(p,j));}}function M(){let j=S.let("ruleErrs",null);return S.try(()=>O((0, e._)`await `),G=>S.assign(b,false).if((0, e._)`${G} instanceof ${R.ValidationError}`,()=>S.assign(j,(0, e._)`${G}.errors`),()=>S.throw(G))),j}function N(){let j=(0, e._)`${T}.errors`;return S.assign(j,null),O(e.nil),j}function O(j=g.async?(0, e._)`await `:e.nil){let G=R.opts.passContext?r.default.this:r.default.self,ne=!("compile"in g&&!y||g.schema===false);S.assign(b,(0, e._)`${j}${(0, i.callValidateCode)(p,T,G,ne)}`,g.modifying);}function k(j){var G;S.if((0, e.not)((G=g.valid)!==null&&G!==void 0?G:b),j);}}t.funcKeywordCode=o;function a(p){let{gen:g,data:m,it:S}=p;g.if(S.parentData,()=>g.assign(m,(0, e._)`${S.parentData}[${S.parentDataProperty}]`));}function c(p,g){let{gen:m}=p;m.if((0, e._)`Array.isArray(${g})`,()=>{m.assign(r.default.vErrors,(0, e._)`${r.default.vErrors} === null ? ${g} : ${r.default.vErrors}.concat(${g})`).assign(r.default.errors,(0, e._)`${r.default.vErrors}.length`),(0, n.extendErrors)(p);},()=>p.error());}function l({schemaEnv:p},g){if(g.async&&!p.$async)throw new Error("async keyword in sync schema")}function u(p,g,m){if(m===void 0)throw new Error(`keyword "${g}" failed to compile`);return p.scopeValue("keyword",typeof m=="function"?{ref:m}:{ref:m,code:(0, e.stringify)(m)})}function d(p,g,m=false){return !g.length||g.some(S=>S==="array"?Array.isArray(p):S==="object"?p&&typeof p=="object"&&!Array.isArray(p):typeof p==S||m&&typeof p>"u")}t.validSchemaType=d;function f({schema:p,opts:g,self:m,errSchemaPath:S},h,v){if(Array.isArray(h.keyword)?!h.keyword.includes(v):h.keyword!==v)throw new Error("ajv implementation error");let _=h.dependencies;if(_?.some(y=>!Object.prototype.hasOwnProperty.call(p,y)))throw new Error(`parent schema must have dependencies of ${v}: ${_.join(",")}`);if(h.validateSchema&&!h.validateSchema(p[v])){let y=`keyword "${v}" value is invalid at path "${S}": `+m.errorsText(h.validateSchema.errors);if(g.validateSchema==="log")m.logger.error(y);else throw new Error(y)}}t.validateKeywordUsage=f;})),K1=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let e=Te(),r=ze();function i(o,{keyword:a,schemaProp:c,schema:l,schemaPath:u,errSchemaPath:d,topSchemaRef:f}){if(a!==void 0&&l!==void 0)throw new Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let p=o.schema[a];return c===void 0?{schema:p,schemaPath:(0, e._)`${o.schemaPath}${(0, e.getProperty)(a)}`,errSchemaPath:`${o.errSchemaPath}/${a}`}:{schema:p[c],schemaPath:(0, e._)`${o.schemaPath}${(0, e.getProperty)(a)}${(0, e.getProperty)(c)}`,errSchemaPath:`${o.errSchemaPath}/${a}/${(0, r.escapeFragment)(c)}`}}if(l!==void 0){if(u===void 0||d===void 0||f===void 0)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return {schema:l,schemaPath:u,topSchemaRef:f,errSchemaPath:d}}throw new Error('either "keyword" or "schema" must be passed')}t.getSubschema=i;function n(o,a,{dataProp:c,dataPropType:l,data:u,dataTypes:d,propertyName:f}){if(u!==void 0&&c!==void 0)throw new Error('both "data" and "dataProp" passed, only one allowed');let{gen:p}=a;if(c!==void 0){let{errorPath:m,dataPathArr:S,opts:h}=a;g(p.let("data",(0, e._)`${a.data}${(0, e.getProperty)(c)}`,true)),o.errorPath=(0, e.str)`${m}${(0, r.getErrorPath)(c,l,h.jsPropertySyntax)}`,o.parentDataProperty=(0, e._)`${c}`,o.dataPathArr=[...S,o.parentDataProperty];}u!==void 0&&(g(u instanceof e.Name?u:p.let("data",u,true)),f!==void 0&&(o.propertyName=f)),d&&(o.dataTypes=d);function g(m){o.data=m,o.dataLevel=a.dataLevel+1,o.dataTypes=[],a.definedProperties=new Set,o.parentData=a.data,o.dataNames=[...a.dataNames,m];}}t.extendSubschemaData=n;function s(o,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:l,createErrors:u,allErrors:d}){l!==void 0&&(o.compositeRule=l),u!==void 0&&(o.createErrors=u),d!==void 0&&(o.allErrors=d),o.jtdDiscriminator=a,o.jtdMetadata=c;}t.extendSubschemaMode=s;})),TT=W(((t,e)=>{e.exports=function r(i,n){if(i===n)return true;if(i&&n&&typeof i=="object"&&typeof n=="object"){if(i.constructor!==n.constructor)return false;var s,o,a;if(Array.isArray(i)){if(s=i.length,s!=n.length)return false;for(o=s;o--!==0;)if(!r(i[o],n[o]))return false;return true}if(i.constructor===RegExp)return i.source===n.source&&i.flags===n.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===n.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===n.toString();if(a=Object.keys(i),s=a.length,s!==Object.keys(n).length)return false;for(o=s;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return false;for(o=s;o--!==0;){var c=a[o];if(!r(i[c],n[c]))return false}return true}return i!==i&&n!==n};})),Z1=W(((t,e)=>{var r=e.exports=function(s,o,a){typeof o=="function"&&(a=o,o={}),a=o.cb||a;var c=typeof a=="function"?a:a.pre||function(){},l=a.post||function(){};i(o,c,l,s,"",s);};r.keywords={additionalItems:true,items:true,contains:true,additionalProperties:true,propertyNames:true,not:true,if:true,then:true,else:true},r.arrayKeywords={items:true,allOf:true,anyOf:true,oneOf:true},r.propsKeywords={$defs:true,definitions:true,properties:true,patternProperties:true,dependencies:true},r.skipKeywords={default:true,enum:true,const:true,required:true,maximum:true,minimum:true,exclusiveMaximum:true,exclusiveMinimum:true,multipleOf:true,maxLength:true,minLength:true,pattern:true,format:true,maxItems:true,minItems:true,uniqueItems:true,maxProperties:true,minProperties:true};function i(s,o,a,c,l,u,d,f,p,g){if(c&&typeof c=="object"&&!Array.isArray(c)){o(c,l,u,d,f,p,g);for(var m in c){var S=c[m];if(Array.isArray(S)){if(m in r.arrayKeywords)for(var h=0;h<S.length;h++)i(s,o,a,S[h],l+"/"+m+"/"+h,u,l,m,c,h);}else if(m in r.propsKeywords){if(S&&typeof S=="object")for(var v in S)i(s,o,a,S[v],l+"/"+m+"/"+n(v),u,l,m,c,v);}else (m in r.keywords||s.allKeys&&!(m in r.skipKeywords))&&i(s,o,a,S,l+"/"+m,u,l,m,c);}a(c,l,u,d,f,p,g);}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}})),Qd=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let e=ze(),r=TT(),i=Z1(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(S,h=true){return typeof S=="boolean"?true:h===true?!a(S):h?c(S)<=h:false}t.inlineRef=s;let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(S){for(let h in S){if(o.has(h))return true;let v=S[h];if(Array.isArray(v)&&v.some(a)||typeof v=="object"&&a(v))return true}return false}function c(S){let h=0;for(let v in S){if(v==="$ref")return 1/0;if(h++,!n.has(v)&&(typeof S[v]=="object"&&(0, e.eachItem)(S[v],_=>h+=c(_)),h===1/0))return 1/0}return h}function l(S,h="",v){return v!==false&&(h=f(h)),u(S,S.parse(h))}t.getFullPath=l;function u(S,h){return S.serialize(h).split("#")[0]+"#"}t._getFullPath=u;let d=/#\/?$/;function f(S){return S?S.replace(d,""):""}t.normalizeId=f;function p(S,h,v){return v=f(v),S.resolve(h,v)}t.resolveUrl=p;let g=/^[a-z_][-a-z0-9._]*$/i;function m(S,h){if(typeof S=="boolean")return {};let{schemaId:v,uriResolver:_}=this.opts,y=f(S[v]||h),R={"":y},T=l(_,y,false),b={},E=new Set;return i(S,{allKeys:true},(O,k,j,G)=>{if(G===void 0)return;let ne=T+k,Me=R[G];typeof O[v]=="string"&&(Me=ye.call(this,O[v])),Ue.call(this,O.$anchor),Ue.call(this,O.$dynamicAnchor),R[k]=Me;function ye(ve){let P=this.opts.uriResolver.resolve;if(ve=f(Me?P(Me,ve):ve),E.has(ve))throw N(ve);E.add(ve);let U=this.refs[ve];return typeof U=="string"&&(U=this.refs[U]),typeof U=="object"?M(O,U.schema,ve):ve!==f(ne)&&(ve[0]==="#"?(M(O,b[ve],ve),b[ve]=O):this.refs[ve]=ne),ve}function Ue(ve){if(typeof ve=="string"){if(!g.test(ve))throw new Error(`invalid anchor "${ve}"`);ye.call(this,`#${ve}`);}}}),b;function M(O,k,j){if(k!==void 0&&!r(O,k))throw N(j)}function N(O){return new Error(`reference "${O}" resolves to more than one schema`)}}t.getSchemaRefs=m;})),Ms=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let e=H1(),r=Jd(),i=bT(),n=Jd(),s=q1(),o=W1(),a=K1(),c=Te(),l=ln(),u=Qd(),d=ze(),f=Yd();function p(A){if(T(A)&&(E(A),R(A))){h(A);return}g(A,()=>(0, e.topBoolOrEmptySchema)(A));}t.validateFunctionCode=p;function g({gen:A,validateName:V,schema:H,schemaEnv:me,opts:ge},Ee){ge.code.es5?A.func(V,(0, c._)`${l.default.data}, ${l.default.valCxt}`,me.$async,()=>{A.code((0, c._)`"use strict"; ${_(H,ge)}`),S(A,ge),A.code(Ee);}):A.func(V,(0, c._)`${l.default.data}, ${m(ge)}`,me.$async,()=>A.code(_(H,ge)).code(Ee));}function m(A){return (0, c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${A.dynamicRef?(0, c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function S(A,V){A.if(l.default.valCxt,()=>{A.var(l.default.instancePath,(0, c._)`${l.default.valCxt}.${l.default.instancePath}`),A.var(l.default.parentData,(0, c._)`${l.default.valCxt}.${l.default.parentData}`),A.var(l.default.parentDataProperty,(0, c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),A.var(l.default.rootData,(0, c._)`${l.default.valCxt}.${l.default.rootData}`),V.dynamicRef&&A.var(l.default.dynamicAnchors,(0, c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`);},()=>{A.var(l.default.instancePath,(0, c._)`""`),A.var(l.default.parentData,(0, c._)`undefined`),A.var(l.default.parentDataProperty,(0, c._)`undefined`),A.var(l.default.rootData,l.default.data),V.dynamicRef&&A.var(l.default.dynamicAnchors,(0, c._)`{}`);});}function h(A){let{schema:V,opts:H,gen:me}=A;g(A,()=>{H.$comment&&V.$comment&&G(A),O(A),me.let(l.default.vErrors,null),me.let(l.default.errors,0),H.unevaluated&&v(A),M(A),ne(A);});}function v(A){let{gen:V,validateName:H}=A;A.evaluated=V.const("evaluated",(0, c._)`${H}.evaluated`),V.if((0, c._)`${A.evaluated}.dynamicProps`,()=>V.assign((0, c._)`${A.evaluated}.props`,(0, c._)`undefined`)),V.if((0, c._)`${A.evaluated}.dynamicItems`,()=>V.assign((0, c._)`${A.evaluated}.items`,(0, c._)`undefined`));}function _(A,V){let H=typeof A=="object"&&A[V.schemaId];return H&&(V.code.source||V.code.process)?(0, c._)`/*# sourceURL=${H} */`:c.nil}function y(A,V){if(T(A)&&(E(A),R(A))){b(A,V);return}(0, e.boolOrEmptySchema)(A,V);}function R({schema:A,self:V}){if(typeof A=="boolean")return !A;for(let H in A)if(V.RULES.all[H])return true;return false}function T(A){return typeof A.schema!="boolean"}function b(A,V){let{schema:H,gen:me,opts:ge}=A;ge.$comment&&H.$comment&&G(A),k(A),j(A);let Ee=me.const("_errs",l.default.errors);M(A,Ee),me.var(V,(0, c._)`${Ee} === ${l.default.errors}`);}function E(A){(0, d.checkUnknownRules)(A),N(A);}function M(A,V){if(A.opts.jtd)return ye(A,[],false,V);let H=(0, r.getSchemaTypes)(A.schema);ye(A,H,!(0, r.coerceAndCheckDataType)(A,H),V);}function N(A){let{schema:V,errSchemaPath:H,opts:me,self:ge}=A;V.$ref&&me.ignoreKeywordsWithRef&&(0, d.schemaHasRulesButRef)(V,ge.RULES)&&ge.logger.warn(`$ref: keywords ignored in schema at path "${H}"`);}function O(A){let{schema:V,opts:H}=A;V.default!==void 0&&H.useDefaults&&H.strictSchema&&(0, d.checkStrictMode)(A,"default is ignored in the schema root");}function k(A){let V=A.schema[A.opts.schemaId];V&&(A.baseId=(0, u.resolveUrl)(A.opts.uriResolver,A.baseId,V));}function j(A){if(A.schema.$async&&!A.schemaEnv.$async)throw new Error("async schema in sync schema")}function G({gen:A,schemaEnv:V,schema:H,errSchemaPath:me,opts:ge}){let Ee=H.$comment;if(ge.$comment===true)A.code((0, c._)`${l.default.self}.logger.log(${Ee})`);else if(typeof ge.$comment=="function"){let nt=(0, c.str)`${me}/$comment`,at=A.scopeValue("root",{ref:V.root});A.code((0, c._)`${l.default.self}.opts.$comment(${Ee}, ${nt}, ${at}.schema)`);}}function ne(A){let{gen:V,schemaEnv:H,validateName:me,ValidationError:ge,opts:Ee}=A;H.$async?V.if((0, c._)`${l.default.errors} === 0`,()=>V.return(l.default.data),()=>V.throw((0, c._)`new ${ge}(${l.default.vErrors})`)):(V.assign((0, c._)`${me}.errors`,l.default.vErrors),Ee.unevaluated&&Me(A),V.return((0, c._)`${l.default.errors} === 0`));}function Me({gen:A,evaluated:V,props:H,items:me}){H instanceof c.Name&&A.assign((0, c._)`${V}.props`,H),me instanceof c.Name&&A.assign((0, c._)`${V}.items`,me);}function ye(A,V,H,me){let{gen:ge,schema:Ee,data:nt,allErrors:at,opts:gt,self:it}=A,{RULES:Xe}=it;if(Ee.$ref&&(gt.ignoreKeywordsWithRef||!(0, d.schemaHasRulesButRef)(Ee,Xe))){ge.block(()=>Re(A,"$ref",Xe.all.$ref.definition));return}gt.jtd||ve(A,V),ge.block(()=>{for(let lt of Xe.rules)Wt(lt);Wt(Xe.post);});function Wt(lt){(0, i.shouldUseGroup)(Ee,lt)&&(lt.type?(ge.if((0, n.checkDataType)(lt.type,nt,gt.strictNumbers)),Ue(A,lt),V.length===1&&V[0]===lt.type&&H&&(ge.else(),(0, n.reportTypeError)(A)),ge.endIf()):Ue(A,lt),at||ge.if((0, c._)`${l.default.errors} === ${me||0}`));}}function Ue(A,V){let{gen:H,schema:me,opts:{useDefaults:ge}}=A;ge&&(0, s.assignDefaults)(A,V.type),H.block(()=>{for(let Ee of V.rules)(0, i.shouldUseRule)(me,Ee)&&Re(A,Ee.keyword,Ee.definition,V.type);});}function ve(A,V){A.schemaEnv.meta||!A.opts.strictTypes||(P(A,V),A.opts.allowUnionTypes||U(A,V),q(A,A.dataTypes));}function P(A,V){if(V.length){if(!A.dataTypes.length){A.dataTypes=V;return}V.forEach(H=>{C(A.dataTypes,H)||Q(A,`type "${H}" not allowed by context "${A.dataTypes.join(",")}"`);}),L(A,V);}}function U(A,V){V.length>1&&!(V.length===2&&V.includes("null"))&&Q(A,"use allowUnionTypes to allow union type keyword");}function q(A,V){let H=A.self.RULES.all;for(let me in H){let ge=H[me];if(typeof ge=="object"&&(0, i.shouldUseRule)(A.schema,ge)){let{type:Ee}=ge.definition;Ee.length&&!Ee.some(nt=>w(V,nt))&&Q(A,`missing type "${Ee.join(",")}" for keyword "${me}"`);}}}function w(A,V){return A.includes(V)||V==="number"&&A.includes("integer")}function C(A,V){return A.includes(V)||V==="integer"&&A.includes("number")}function L(A,V){let H=[];for(let me of A.dataTypes)C(V,me)?H.push(me):V.includes("integer")&&me==="number"&&H.push("integer");A.dataTypes=H;}function Q(A,V){let H=A.schemaEnv.baseId+A.errSchemaPath;V+=` at "${H}" (strictTypes)`,(0, d.checkStrictMode)(A,V,A.opts.strictTypes);}var ue=class{constructor(A,V,H){if((0, o.validateKeywordUsage)(A,V,H),this.gen=A.gen,this.allErrors=A.allErrors,this.keyword=H,this.data=A.data,this.schema=A.schema[H],this.$data=V.$data&&A.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0, d.schemaRefOrVal)(A,this.schema,H,this.$data),this.schemaType=V.schemaType,this.parentSchema=A.schema,this.params={},this.it=A,this.def=V,this.$data)this.schemaCode=A.gen.const("vSchema",Ve(this.$data,A));else if(this.schemaCode=this.schemaValue,!(0, o.validSchemaType)(this.schema,V.schemaType,V.allowUndefined))throw new Error(`${H} value must be ${JSON.stringify(V.schemaType)}`);("code"in V?V.trackErrors:V.errors!==false)&&(this.errsCount=A.gen.const("_errs",l.default.errors));}result(A,V,H){this.failResult((0, c.not)(A),V,H);}failResult(A,V,H){this.gen.if(A),H?H():this.error(),V?(this.gen.else(),V(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else();}pass(A,V){this.failResult((0, c.not)(A),void 0,V);}fail(A){if(A===void 0){this.error(),this.allErrors||this.gen.if(false);return}this.gen.if(A),this.error(),this.allErrors?this.gen.endIf():this.gen.else();}fail$data(A){if(!this.$data)return this.fail(A);let{schemaCode:V}=this;this.fail((0, c._)`${V} !== undefined && (${(0, c.or)(this.invalid$data(),A)})`);}error(A,V,H){if(V){this.setParams(V),this._error(A,H),this.setParams({});return}this._error(A,H);}_error(A,V){(A?f.reportExtraError:f.reportError)(this,this.def.error,V);}$dataError(){(0, f.reportError)(this,this.def.$dataError||f.keyword$DataError);}reset(){if(this.errsCount===void 0)throw new Error('add "trackErrors" to keyword definition');(0, f.resetErrorsCount)(this.gen,this.errsCount);}ok(A){this.allErrors||this.gen.if(A);}setParams(A,V){V?Object.assign(this.params,A):this.params=A;}block$data(A,V,H=c.nil){this.gen.block(()=>{this.check$data(A,H),V();});}check$data(A=c.nil,V=c.nil){if(!this.$data)return;let{gen:H,schemaCode:me,schemaType:ge,def:Ee}=this;H.if((0, c.or)((0, c._)`${me} === undefined`,V)),A!==c.nil&&H.assign(A,true),(ge.length||Ee.validateSchema)&&(H.elseIf(this.invalid$data()),this.$dataError(),A!==c.nil&&H.assign(A,false)),H.else();}invalid$data(){let{gen:A,schemaCode:V,schemaType:H,def:me,it:ge}=this;return (0, c.or)(Ee(),nt());function Ee(){if(H.length){if(!(V instanceof c.Name))throw new Error("ajv implementation error");let at=Array.isArray(H)?H:[H];return (0, c._)`${(0, n.checkDataTypes)(at,V,ge.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function nt(){if(me.validateSchema){let at=A.scopeValue("validate$data",{ref:me.validateSchema});return (0, c._)`!${at}(${V})`}return c.nil}}subschema(A,V){let H=(0, a.getSubschema)(this.it,A);(0, a.extendSubschemaData)(H,this.it,A),(0, a.extendSubschemaMode)(H,A);let me={...this.it,...H,items:void 0,props:void 0};return y(me,V),me}mergeEvaluated(A,V){let{it:H,gen:me}=this;H.opts.unevaluated&&(H.props!==true&&A.props!==void 0&&(H.props=d.mergeEvaluated.props(me,A.props,H.props,V)),H.items!==true&&A.items!==void 0&&(H.items=d.mergeEvaluated.items(me,A.items,H.items,V)));}mergeValidEvaluated(A,V){let{it:H,gen:me}=this;if(H.opts.unevaluated&&(H.props!==true||H.items!==true))return me.if(V,()=>this.mergeEvaluated(A,c.Name)),true}};t.KeywordCxt=ue;function Re(A,V,H,me){let ge=new ue(A,H,V);"code"in H?H.code(ge,me):ge.$data&&H.validate?(0, o.funcKeywordCode)(ge,H):"macro"in H?(0, o.macroKeywordCode)(ge,H):(H.compile||H.validate)&&(0, o.funcKeywordCode)(ge,H);}let pe=/^\/(?:[^~]|~0|~1)*$/,Ie=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Ve(A,{dataLevel:V,dataNames:H,dataPathArr:me}){let ge,Ee;if(A==="")return l.default.rootData;if(A[0]==="/"){if(!pe.test(A))throw new Error(`Invalid JSON-pointer: ${A}`);ge=A,Ee=l.default.rootData;}else {let it=Ie.exec(A);if(!it)throw new Error(`Invalid JSON-pointer: ${A}`);let Xe=+it[1];if(ge=it[2],ge==="#"){if(Xe>=V)throw new Error(gt("property/index",Xe));return me[V-Xe]}if(Xe>V)throw new Error(gt("data",Xe));if(Ee=H[V-Xe],!ge)return Ee}let nt=Ee,at=ge.split("/");for(let it of at)it&&(Ee=(0, c._)`${Ee}${(0, c.getProperty)((0, d.unescapeJsonPointer)(it))}`,nt=(0, c._)`${nt} && ${Ee}`);return nt;function gt(it,Xe){return `Cannot access ${it} ${Xe} levels up, current level is ${V}`}}t.getData=Ve;})),wa=W((t=>{Object.defineProperty(t,"__esModule",{value:true});var e=class extends Error{constructor(r){super("validation failed"),this.errors=r,this.ajv=this.validation=true;}};t.default=e;})),As=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Qd();var r=class extends Error{constructor(i,n,s,o){super(o||`can't resolve reference ${s} from id ${n}`),this.missingRef=(0, e.resolveUrl)(i,n,s),this.missingSchema=(0, e.normalizeId)((0, e.getFullPath)(i,this.missingRef));}};t.default=r;})),eh=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let e=Te(),r=wa(),i=ln(),n=Qd(),s=ze(),o=Ms();var a=class{constructor(h){var v;this.refs={},this.dynamicAnchors={};let _;typeof h.schema=="object"&&(_=h.schema),this.schema=h.schema,this.schemaId=h.schemaId,this.root=h.root||this,this.baseId=(v=h.baseId)!==null&&v!==void 0?v:(0, n.normalizeId)(_?.[h.schemaId||"$id"]),this.schemaPath=h.schemaPath,this.localRefs=h.localRefs,this.meta=h.meta,this.$async=_?.$async,this.refs={};}};t.SchemaEnv=a;function c(h){let v=d.call(this,h);if(v)return v;let _=(0, n.getFullPath)(this.opts.uriResolver,h.root.baseId),{es5:y,lines:R}=this.opts.code,{ownProperties:T}=this.opts,b=new e.CodeGen(this.scope,{es5:y,lines:R,ownProperties:T}),E;h.$async&&(E=b.scopeValue("Error",{ref:r.default,code:(0, e._)`require("ajv/dist/runtime/validation_error").default`}));let M=b.scopeName("validate");h.validateName=M;let N={gen:b,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[e.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:b.scopeValue("schema",this.opts.code.source===true?{ref:h.schema,code:(0, e.stringify)(h.schema)}:{ref:h.schema}),validateName:M,ValidationError:E,schema:h.schema,schemaEnv:h,rootId:_,baseId:h.baseId||_,schemaPath:e.nil,errSchemaPath:h.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0, e._)`""`,opts:this.opts,self:this},O;try{this._compilations.add(h),(0,o.validateFunctionCode)(N),b.optimize(this.opts.code.optimize);let k=b.toString();O=`${b.scopeRefs(i.default.scope)}return ${k}`,this.opts.code.process&&(O=this.opts.code.process(O,h));let j=new Function(`${i.default.self}`,`${i.default.scope}`,O)(this,this.scope.get());if(this.scope.value(M,{ref:j}),j.errors=null,j.schema=h.schema,j.schemaEnv=h,h.$async&&(j.$async=!0),this.opts.code.source===!0&&(j.source={validateName:M,validateCode:k,scopeValues:b._values}),this.opts.unevaluated){let{props:G,items:ne}=N;j.evaluated={props:G instanceof e.Name?void 0:G,items:ne instanceof e.Name?void 0:ne,dynamicProps:G instanceof e.Name,dynamicItems:ne instanceof e.Name},j.source&&(j.source.evaluated=(0,e.stringify)(j.evaluated));}return h.validate=j,h}catch(k){throw delete h.validate,delete h.validateName,O&&this.logger.error("Error compiling schema, function code:",O),k}finally{this._compilations.delete(h);}}t.compileSchema=c;function l(h,v,_){var y;_=(0, n.resolveUrl)(this.opts.uriResolver,v,_);let R=h.refs[_];if(R)return R;let T=p.call(this,h,_);if(T===void 0){let b=(y=h.localRefs)===null||y===void 0?void 0:y[_],{schemaId:E}=this.opts;b&&(T=new a({schema:b,schemaId:E,root:h,baseId:v}));}if(T!==void 0)return h.refs[_]=u.call(this,T)}t.resolveRef=l;function u(h){return (0, n.inlineRef)(h.schema,this.opts.inlineRefs)?h.schema:h.validate?h:c.call(this,h)}function d(h){for(let v of this._compilations)if(f(v,h))return v}t.getCompilingSchema=d;function f(h,v){return h.schema===v.schema&&h.root===v.root&&h.baseId===v.baseId}function p(h,v){let _;for(;typeof(_=this.refs[v])=="string";)v=_;return _||this.schemas[v]||g.call(this,h,v)}function g(h,v){let _=this.opts.uriResolver.parse(v),y=(0, n._getFullPath)(this.opts.uriResolver,_),R=(0, n.getFullPath)(this.opts.uriResolver,h.baseId,void 0);if(Object.keys(h.schema).length>0&&y===R)return S.call(this,_,h);let T=(0, n.normalizeId)(y),b=this.refs[T]||this.schemas[T];if(typeof b=="string"){let E=g.call(this,h,b);return typeof E?.schema!="object"?void 0:S.call(this,_,E)}if(typeof b?.schema=="object"){if(b.validate||c.call(this,b),T===(0, n.normalizeId)(v)){let{schema:E}=b,{schemaId:M}=this.opts,N=E[M];return N&&(R=(0, n.resolveUrl)(this.opts.uriResolver,R,N)),new a({schema:E,schemaId:M,root:h,baseId:R})}return S.call(this,_,b)}}t.resolveSchema=g;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function S(h,{baseId:v,schema:_,root:y}){var R;if(((R=h.fragment)===null||R===void 0?void 0:R[0])!=="/")return;for(let E of h.fragment.slice(1).split("/")){if(typeof _=="boolean")return;let M=_[(0, s.unescapeFragment)(E)];if(M===void 0)return;_=M;let N=typeof _=="object"&&_[this.opts.schemaId];!m.has(E)&&N&&(v=(0, n.resolveUrl)(this.opts.uriResolver,v,N));}let T;if(typeof _!="boolean"&&_.$ref&&!(0, s.schemaHasRulesButRef)(_,this.RULES)){let E=(0, n.resolveUrl)(this.opts.uriResolver,v,_.$ref);T=g.call(this,y,E);}let{schemaId:b}=this.opts;if(T=T||new a({schema:_,schemaId:b,root:y,baseId:v}),T.schema!==T.root.schema)return T}})),X1=W(((t,e)=>{e.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:false};})),RT=W(((t,e)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),i=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(g){let m="",S=0,h=0;for(h=0;h<g.length;h++)if(S=g[h].charCodeAt(0),S!==48){if(!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return "";m+=g[h];break}for(h+=1;h<g.length;h++){if(S=g[h].charCodeAt(0),!(S>=48&&S<=57||S>=65&&S<=70||S>=97&&S<=102))return "";m+=g[h];}return m}let s=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(g){return g.length=0,true}function a(g,m,S){if(g.length){let h=n(g);if(h!=="")m.push(h);else return S.error=true,false;g.length=0;}return true}function c(g){let m=0,S={error:false,address:"",zone:""},h=[],v=[],_=false,y=false,R=a;for(let T=0;T<g.length;T++){let b=g[T];if(!(b==="["||b==="]"))if(b===":"){if(_===true&&(y=true),!R(v,h,S))break;if(++m>7){S.error=true;break}T>0&&g[T-1]===":"&&(_=true),h.push(":");continue}else if(b==="%"){if(!R(v,h,S))break;R=o;}else {v.push(b);continue}}return v.length&&(R===o?S.zone=v.join(""):y?h.push(v.join("")):h.push(n(v))),S.address=h.join(""),S}function l(g){if(u(g,":")<2)return {host:g,isIPV6:false};let m=c(g);if(m.error)return {host:g,isIPV6:false};{let S=m.address,h=m.address;return m.zone&&(S+="%"+m.zone,h+="%25"+m.zone),{host:S,isIPV6:true,escapedHost:h}}}function u(g,m){let S=0;for(let h=0;h<g.length;h++)g[h]===m&&S++;return S}function d(g){let m=g,S=[],h=-1,v=0;for(;v=m.length;){if(v===1){if(m===".")break;if(m==="/"){S.push("/");break}else {S.push(m);break}}else if(v===2){if(m[0]==="."){if(m[1]===".")break;if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&(m[1]==="."||m[1]==="/")){S.push("/");break}}else if(v===3&&m==="/.."){S.length!==0&&S.pop(),S.push("/");break}if(m[0]==="."){if(m[1]==="."){if(m[2]==="/"){m=m.slice(3);continue}}else if(m[1]==="/"){m=m.slice(2);continue}}else if(m[0]==="/"&&m[1]==="."){if(m[2]==="/"){m=m.slice(2);continue}else if(m[2]==="."&&m[3]==="/"){m=m.slice(3),S.length!==0&&S.pop();continue}}if((h=m.indexOf("/",1))===-1){S.push(m);break}else S.push(m.slice(0,h)),m=m.slice(h);}return S.join("")}function f(g,m){let S=m!==true?escape:unescape;return g.scheme!==void 0&&(g.scheme=S(g.scheme)),g.userinfo!==void 0&&(g.userinfo=S(g.userinfo)),g.host!==void 0&&(g.host=S(g.host)),g.path!==void 0&&(g.path=S(g.path)),g.query!==void 0&&(g.query=S(g.query)),g.fragment!==void 0&&(g.fragment=S(g.fragment)),g}function p(g){let m=[];if(g.userinfo!==void 0&&(m.push(g.userinfo),m.push("@")),g.host!==void 0){let S=unescape(g.host);if(!i(S)){let h=l(S);h.isIPV6===true?S=`[${h.escapedHost}]`:S=g.host;}m.push(S);}return (typeof g.port=="number"||typeof g.port=="string")&&(m.push(":"),m.push(String(g.port))),m.length?m.join(""):void 0}e.exports={nonSimpleDomain:s,recomposeAuthority:p,normalizeComponentEncoding:f,removeDotSegments:d,isIPv4:i,isUUID:r,normalizeIPv6:l,stringArrayToHexStripped:n};})),J1=W(((t,e)=>{let{isUUID:r}=RT(),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(b){return n.indexOf(b)!==-1}function o(b){return b.secure===true?true:b.secure===false?false:b.scheme?b.scheme.length===3&&(b.scheme[0]==="w"||b.scheme[0]==="W")&&(b.scheme[1]==="s"||b.scheme[1]==="S")&&(b.scheme[2]==="s"||b.scheme[2]==="S"):false}function a(b){return b.host||(b.error=b.error||"HTTP URIs must have a host."),b}function c(b){let E=String(b.scheme).toLowerCase()==="https";return (b.port===(E?443:80)||b.port==="")&&(b.port=void 0),b.path||(b.path="/"),b}function l(b){return b.secure=o(b),b.resourceName=(b.path||"/")+(b.query?"?"+b.query:""),b.path=void 0,b.query=void 0,b}function u(b){if((b.port===(o(b)?443:80)||b.port==="")&&(b.port=void 0),typeof b.secure=="boolean"&&(b.scheme=b.secure?"wss":"ws",b.secure=void 0),b.resourceName){let[E,M]=b.resourceName.split("?");b.path=E&&E!=="/"?E:void 0,b.query=M,b.resourceName=void 0;}return b.fragment=void 0,b}function d(b,E){if(!b.path)return b.error="URN can not be parsed",b;let M=b.path.match(i);if(M){let N=E.scheme||b.scheme||"urn";b.nid=M[1].toLowerCase(),b.nss=M[2];let O=T(`${N}:${E.nid||b.nid}`);b.path=void 0,O&&(b=O.parse(b,E));}else b.error=b.error||"URN can not be parsed.";return b}function f(b,E){if(b.nid===void 0)throw new Error("URN without nid cannot be serialized");let M=E.scheme||b.scheme||"urn",N=b.nid.toLowerCase(),O=T(`${M}:${E.nid||N}`);O&&(b=O.serialize(b,E));let k=b,j=b.nss;return k.path=`${N||E.nid}:${j}`,E.skipEscape=true,k}function p(b,E){let M=b;return M.uuid=M.nss,M.nss=void 0,!E.tolerant&&(!M.uuid||!r(M.uuid))&&(M.error=M.error||"UUID is not valid."),M}function g(b){let E=b;return E.nss=(b.uuid||"").toLowerCase(),E}let m={scheme:"http",domainHost:true,parse:a,serialize:c},S={scheme:"https",domainHost:m.domainHost,parse:a,serialize:c},h={scheme:"ws",domainHost:true,parse:l,serialize:u},v={scheme:"wss",domainHost:h.domainHost,parse:h.parse,serialize:h.serialize},R={http:m,https:S,ws:h,wss:v,urn:{scheme:"urn",parse:d,serialize:f,skipNormalize:true},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:g,skipNormalize:true}};Object.setPrototypeOf(R,null);function T(b){return b&&(R[b]||R[b.toLowerCase()])||void 0}e.exports={wsIsSecure:o,SCHEMES:R,isValidSchemeName:s,getSchemeHandler:T};})),Y1=W(((t,e)=>{let{normalizeIPv6:r,removeDotSegments:i,recomposeAuthority:n,normalizeComponentEncoding:s,isIPv4:o,nonSimpleDomain:a}=RT(),{SCHEMES:c,getSchemeHandler:l}=J1();function u(v,_){return typeof v=="string"?v=g(S(v,_),_):typeof v=="object"&&(v=S(g(v,_),_)),v}function d(v,_,y){let R=y?Object.assign({scheme:"null"},y):{scheme:"null"},T=f(S(v,R),S(_,R),R,true);return R.skipEscape=true,g(T,R)}function f(v,_,y,R){let T={};return R||(v=S(g(v,y),y),_=S(g(_,y),y)),y=y||{},!y.tolerant&&_.scheme?(T.scheme=_.scheme,T.userinfo=_.userinfo,T.host=_.host,T.port=_.port,T.path=i(_.path||""),T.query=_.query):(_.userinfo!==void 0||_.host!==void 0||_.port!==void 0?(T.userinfo=_.userinfo,T.host=_.host,T.port=_.port,T.path=i(_.path||""),T.query=_.query):(_.path?(_.path[0]==="/"?T.path=i(_.path):((v.userinfo!==void 0||v.host!==void 0||v.port!==void 0)&&!v.path?T.path="/"+_.path:v.path?T.path=v.path.slice(0,v.path.lastIndexOf("/")+1)+_.path:T.path=_.path,T.path=i(T.path)),T.query=_.query):(T.path=v.path,_.query!==void 0?T.query=_.query:T.query=v.query),T.userinfo=v.userinfo,T.host=v.host,T.port=v.port),T.scheme=v.scheme),T.fragment=_.fragment,T}function p(v,_,y){return typeof v=="string"?(v=unescape(v),v=g(s(S(v,y),true),{...y,skipEscape:true})):typeof v=="object"&&(v=g(s(v,true),{...y,skipEscape:true})),typeof _=="string"?(_=unescape(_),_=g(s(S(_,y),true),{...y,skipEscape:true})):typeof _=="object"&&(_=g(s(_,true),{...y,skipEscape:true})),v.toLowerCase()===_.toLowerCase()}function g(v,_){let y={host:v.host,scheme:v.scheme,userinfo:v.userinfo,port:v.port,path:v.path,query:v.query,nid:v.nid,nss:v.nss,uuid:v.uuid,fragment:v.fragment,reference:v.reference,resourceName:v.resourceName,secure:v.secure,error:""},R=Object.assign({},_),T=[],b=l(R.scheme||y.scheme);b&&b.serialize&&b.serialize(y,R),y.path!==void 0&&(R.skipEscape?y.path=unescape(y.path):(y.path=escape(y.path),y.scheme!==void 0&&(y.path=y.path.split("%3A").join(":")))),R.reference!=="suffix"&&y.scheme&&T.push(y.scheme,":");let E=n(y);if(E!==void 0&&(R.reference!=="suffix"&&T.push("//"),T.push(E),y.path&&y.path[0]!=="/"&&T.push("/")),y.path!==void 0){let M=y.path;!R.absolutePath&&(!b||!b.absolutePath)&&(M=i(M)),E===void 0&&M[0]==="/"&&M[1]==="/"&&(M="/%2F"+M.slice(2)),T.push(M);}return y.query!==void 0&&T.push("?",y.query),y.fragment!==void 0&&T.push("#",y.fragment),T.join("")}let m=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function S(v,_){let y=Object.assign({},_),R={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},T=false;y.reference==="suffix"&&(y.scheme?v=y.scheme+":"+v:v="//"+v);let b=v.match(m);if(b){if(R.scheme=b[1],R.userinfo=b[3],R.host=b[4],R.port=parseInt(b[5],10),R.path=b[6]||"",R.query=b[7],R.fragment=b[8],isNaN(R.port)&&(R.port=b[5]),R.host)if(o(R.host)===false){let M=r(R.host);R.host=M.host.toLowerCase(),T=M.isIPV6;}else T=true;R.scheme===void 0&&R.userinfo===void 0&&R.host===void 0&&R.port===void 0&&R.query===void 0&&!R.path?R.reference="same-document":R.scheme===void 0?R.reference="relative":R.fragment===void 0?R.reference="absolute":R.reference="uri",y.reference&&y.reference!=="suffix"&&y.reference!==R.reference&&(R.error=R.error||"URI is not a "+y.reference+" reference.");let E=l(y.scheme||R.scheme);if(!y.unicodeSupport&&(!E||!E.unicodeSupport)&&R.host&&(y.domainHost||E&&E.domainHost)&&T===false&&a(R.host))try{R.host=URL.domainToASCII(R.host.toLowerCase());}catch(M){R.error=R.error||"Host's domain name can not be converted to ASCII: "+M;}(!E||E&&!E.skipNormalize)&&(v.indexOf("%")!==-1&&(R.scheme!==void 0&&(R.scheme=unescape(R.scheme)),R.host!==void 0&&(R.host=unescape(R.host))),R.path&&(R.path=escape(unescape(R.path))),R.fragment&&(R.fragment=encodeURI(decodeURIComponent(R.fragment)))),E&&E.parse&&E.parse(R,y);}else R.error=R.error||"URI can not be parsed.";return R}let h={SCHEMES:c,normalize:u,resolve:d,resolveComponent:f,equal:p,serialize:g,parse:S};e.exports=h,e.exports.default=h,e.exports.fastUri=h;})),Q1=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Y1();e.code='require("ajv/dist/runtime/uri").default',t.default=e;})),Xv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var e=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return e.KeywordCxt}});var r=Te();Object.defineProperty(t,"_",{enumerable:true,get:function(){return r._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return r.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return r.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return r.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return r.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return r.CodeGen}});let i=wa(),n=As(),s=xT(),o=eh(),a=Te(),c=Qd(),l=Jd(),u=ze(),d=X1(),f=Q1(),p=(P,U)=>new RegExp(P,U);p.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),S={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},h={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},v=200;function _(P){var U,q,w,C,L,Q,ue,Re,pe,Ie,Ve,A,V,H,me,ge,Ee,nt,at,gt,it,Xe,Wt,lt,wn;let rn=P.strict,Mn=(U=P.code)===null||U===void 0?void 0:U.optimize,jn=Mn===true||Mn===void 0?1:Mn||0,Gn=(w=(q=P.code)===null||q===void 0?void 0:q.regExp)!==null&&w!==void 0?w:p,Hr=(C=P.uriResolver)!==null&&C!==void 0?C:f.default;return {strictSchema:(Q=(L=P.strictSchema)!==null&&L!==void 0?L:rn)!==null&&Q!==void 0?Q:true,strictNumbers:(Re=(ue=P.strictNumbers)!==null&&ue!==void 0?ue:rn)!==null&&Re!==void 0?Re:true,strictTypes:(Ie=(pe=P.strictTypes)!==null&&pe!==void 0?pe:rn)!==null&&Ie!==void 0?Ie:"log",strictTuples:(A=(Ve=P.strictTuples)!==null&&Ve!==void 0?Ve:rn)!==null&&A!==void 0?A:"log",strictRequired:(H=(V=P.strictRequired)!==null&&V!==void 0?V:rn)!==null&&H!==void 0?H:false,code:P.code?{...P.code,optimize:jn,regExp:Gn}:{optimize:jn,regExp:Gn},loopRequired:(me=P.loopRequired)!==null&&me!==void 0?me:v,loopEnum:(ge=P.loopEnum)!==null&&ge!==void 0?ge:v,meta:(Ee=P.meta)!==null&&Ee!==void 0?Ee:true,messages:(nt=P.messages)!==null&&nt!==void 0?nt:true,inlineRefs:(at=P.inlineRefs)!==null&&at!==void 0?at:true,schemaId:(gt=P.schemaId)!==null&>!==void 0?gt:"$id",addUsedSchema:(it=P.addUsedSchema)!==null&&it!==void 0?it:true,validateSchema:(Xe=P.validateSchema)!==null&&Xe!==void 0?Xe:true,validateFormats:(Wt=P.validateFormats)!==null&&Wt!==void 0?Wt:true,unicodeRegExp:(lt=P.unicodeRegExp)!==null&<!==void 0?lt:true,int32range:(wn=P.int32range)!==null&&wn!==void 0?wn:true,uriResolver:Hr}}var y=class{constructor(P={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,P=this.opts={...P,..._(P)};let{es5:U,lines:q}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:m,es5:U,lines:q}),this.logger=k(P.logger);let w=P.validateFormats;P.validateFormats=false,this.RULES=(0, s.getRules)(),R.call(this,S,P,"NOT SUPPORTED"),R.call(this,h,P,"DEPRECATED","warn"),this._metaOpts=N.call(this),P.formats&&E.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),P.keywords&&M.call(this,P.keywords),typeof P.meta=="object"&&this.addMetaSchema(P.meta),b.call(this),P.validateFormats=w;}_addVocabularies(){this.addKeyword("$async");}_addDefaultMetaSchema(){let{$data:P,meta:U,schemaId:q}=this.opts,w=d;q==="id"&&(w={...d},w.id=w.$id,delete w.$id),U&&P&&this.addMetaSchema(w,w[q],false);}defaultMeta(){let{meta:P,schemaId:U}=this.opts;return this.opts.defaultMeta=typeof P=="object"?P[U]||P:void 0}validate(P,U){let q;if(typeof P=="string"){if(q=this.getSchema(P),!q)throw new Error(`no schema with key or ref "${P}"`)}else q=this.compile(P);let w=q(U);return "$async"in q||(this.errors=q.errors),w}compile(P,U){let q=this._addSchema(P,U);return q.validate||this._compileSchemaEnv(q)}compileAsync(P,U){if(typeof this.opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");let{loadSchema:q}=this.opts;return w.call(this,P,U);async function w(pe,Ie){await C.call(this,pe.$schema);let Ve=this._addSchema(pe,Ie);return Ve.validate||L.call(this,Ve)}async function C(pe){pe&&!this.getSchema(pe)&&await w.call(this,{$ref:pe},true);}async function L(pe){try{return this._compileSchemaEnv(pe)}catch(Ie){if(!(Ie instanceof n.default))throw Ie;return Q.call(this,Ie),await ue.call(this,Ie.missingSchema),L.call(this,pe)}}function Q({missingSchema:pe,missingRef:Ie}){if(this.refs[pe])throw new Error(`AnySchema ${pe} is loaded but ${Ie} cannot be resolved`)}async function ue(pe){let Ie=await Re.call(this,pe);this.refs[pe]||await C.call(this,Ie.$schema),this.refs[pe]||this.addSchema(Ie,pe,U);}async function Re(pe){let Ie=this._loading[pe];if(Ie)return Ie;try{return await(this._loading[pe]=q(pe))}finally{delete this._loading[pe];}}}addSchema(P,U,q,w=this.opts.validateSchema){if(Array.isArray(P)){for(let L of P)this.addSchema(L,void 0,q,w);return this}let C;if(typeof P=="object"){let{schemaId:L}=this.opts;if(C=P[L],C!==void 0&&typeof C!="string")throw new Error(`schema ${L} must be string`)}return U=(0, c.normalizeId)(U||C),this._checkUnique(U),this.schemas[U]=this._addSchema(P,q,U,w,true),this}addMetaSchema(P,U,q=this.opts.validateSchema){return this.addSchema(P,U,true,q),this}validateSchema(P,U){if(typeof P=="boolean")return true;let q;if(q=P.$schema,q!==void 0&&typeof q!="string")throw new Error("$schema must be a string");if(q=q||this.opts.defaultMeta||this.defaultMeta(),!q)return this.logger.warn("meta-schema not available"),this.errors=null,true;let w=this.validate(q,P);if(!w&&U){let C="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(C);else throw new Error(C)}return w}getSchema(P){let U;for(;typeof(U=T.call(this,P))=="string";)P=U;if(U===void 0){let{schemaId:q}=this.opts,w=new o.SchemaEnv({schema:{},schemaId:q});if(U=o.resolveSchema.call(this,w,P),!U)return;this.refs[P]=U;}return U.validate||this._compileSchemaEnv(U)}removeSchema(P){if(P instanceof RegExp)return this._removeAllSchemas(this.schemas,P),this._removeAllSchemas(this.refs,P),this;switch(typeof P){case "undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case "string":{let U=T.call(this,P);return typeof U=="object"&&this._cache.delete(U.schema),delete this.schemas[P],delete this.refs[P],this}case "object":{let U=P;this._cache.delete(U);let q=P[this.opts.schemaId];return q&&(q=(0, c.normalizeId)(q),delete this.schemas[q],delete this.refs[q]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(P){for(let U of P)this.addKeyword(U);return this}addKeyword(P,U){let q;if(typeof P=="string")q=P,typeof U=="object"&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),U.keyword=q);else if(typeof P=="object"&&U===void 0){if(U=P,q=U.keyword,Array.isArray(q)&&!q.length)throw new Error("addKeywords: keyword must be string or non-empty array")}else throw new Error("invalid addKeywords parameters");if(G.call(this,q,U),!U)return (0, u.eachItem)(q,C=>ne.call(this,C)),this;ye.call(this,U);let w={...U,type:(0, l.getJSONTypes)(U.type),schemaType:(0, l.getJSONTypes)(U.schemaType)};return (0, u.eachItem)(q,w.type.length===0?C=>ne.call(this,C,w):C=>w.type.forEach(L=>ne.call(this,C,w,L))),this}getKeyword(P){let U=this.RULES.all[P];return typeof U=="object"?U.definition:!!U}removeKeyword(P){let{RULES:U}=this;delete U.keywords[P],delete U.all[P];for(let q of U.rules){let w=q.rules.findIndex(C=>C.keyword===P);w>=0&&q.rules.splice(w,1);}return this}addFormat(P,U){return typeof U=="string"&&(U=new RegExp(U)),this.formats[P]=U,this}errorsText(P=this.errors,{separator:U=", ",dataVar:q="data"}={}){return !P||P.length===0?"No errors":P.map(w=>`${q}${w.instancePath} ${w.message}`).reduce((w,C)=>w+U+C)}$dataMetaSchema(P,U){let q=this.RULES.all;P=JSON.parse(JSON.stringify(P));for(let w of U){let C=w.split("/").slice(1),L=P;for(let Q of C)L=L[Q];for(let Q in q){let ue=q[Q];if(typeof ue!="object")continue;let{$data:Re}=ue.definition,pe=L[Q];Re&&pe&&(L[Q]=ve(pe));}}return P}_removeAllSchemas(P,U){for(let q in P){let w=P[q];(!U||U.test(q))&&(typeof w=="string"?delete P[q]:w&&!w.meta&&(this._cache.delete(w.schema),delete P[q]));}}_addSchema(P,U,q,w=this.opts.validateSchema,C=this.opts.addUsedSchema){let L,{schemaId:Q}=this.opts;if(typeof P=="object")L=P[Q];else {if(this.opts.jtd)throw new Error("schema must be object");if(typeof P!="boolean")throw new Error("schema must be object or boolean")}let ue=this._cache.get(P);if(ue!==void 0)return ue;q=(0, c.normalizeId)(L||q);let Re=c.getSchemaRefs.call(this,P,q);return ue=new o.SchemaEnv({schema:P,schemaId:Q,meta:U,baseId:q,localRefs:Re}),this._cache.set(ue.schema,ue),C&&!q.startsWith("#")&&(q&&this._checkUnique(q),this.refs[q]=ue),w&&this.validateSchema(P,true),ue}_checkUnique(P){if(this.schemas[P]||this.refs[P])throw new Error(`schema with key or id "${P}" already exists`)}_compileSchemaEnv(P){if(P.meta?this._compileMetaSchema(P):o.compileSchema.call(this,P),!P.validate)throw new Error("ajv implementation error");return P.validate}_compileMetaSchema(P){let U=this.opts;this.opts=this._metaOpts;try{o.compileSchema.call(this,P);}finally{this.opts=U;}}};y.ValidationError=i.default,y.MissingRefError=n.default,t.default=y;function R(P,U,q,w="error"){for(let C in P){let L=C;L in U&&this.logger[w](`${q}: option ${C}. ${P[L]}`);}}function T(P){return P=(0, c.normalizeId)(P),this.schemas[P]||this.refs[P]}function b(){let P=this.opts.schemas;if(P)if(Array.isArray(P))this.addSchema(P);else for(let U in P)this.addSchema(P[U],U);}function E(){for(let P in this.opts.formats){let U=this.opts.formats[P];U&&this.addFormat(P,U);}}function M(P){if(Array.isArray(P)){this.addVocabulary(P);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let U in P){let q=P[U];q.keyword||(q.keyword=U),this.addKeyword(q);}}function N(){let P={...this.opts};for(let U of g)delete P[U];return P}let O={log(){},warn(){},error(){}};function k(P){if(P===false)return O;if(P===void 0)return console;if(P.log&&P.warn&&P.error)return P;throw new Error("logger must implement log, warn and error methods")}let j=/^[a-z_$][a-z0-9_$:-]*$/i;function G(P,U){let{RULES:q}=this;if((0, u.eachItem)(P,w=>{if(q.keywords[w])throw new Error(`Keyword ${w} is already defined`);if(!j.test(w))throw new Error(`Keyword ${w} has invalid name`)}),!!U&&U.$data&&!("code"in U||"validate"in U))throw new Error('$data keyword must have "code" or "validate" function')}function ne(P,U,q){var w;let C=U?.post;if(q&&C)throw new Error('keyword with "post" flag cannot have "type"');let{RULES:L}=this,Q=C?L.post:L.rules.find(({type:Re})=>Re===q);if(Q||(Q={type:q,rules:[]},L.rules.push(Q)),L.keywords[P]=true,!U)return;let ue={keyword:P,definition:{...U,type:(0, l.getJSONTypes)(U.type),schemaType:(0, l.getJSONTypes)(U.schemaType)}};U.before?Me.call(this,Q,ue,U.before):Q.rules.push(ue),L.all[P]=ue,(w=U.implements)===null||w===void 0||w.forEach(Re=>this.addKeyword(Re));}function Me(P,U,q){let w=P.rules.findIndex(C=>C.keyword===q);w>=0?P.rules.splice(w,0,U):(P.rules.push(U),this.logger.warn(`rule ${q} is not defined`));}function ye(P){let{metaSchema:U}=P;U!==void 0&&(P.$data&&this.opts.$data&&(U=ve(U)),P.validateSchema=this.compile(U,true));}let Ue={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function ve(P){return {anyOf:[P,Ue]}}})),eC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=e;})),Jv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.callRef=t.getValidate=void 0;let e=As(),r=un(),i=Te(),n=ln(),s=eh(),o=ze(),a={keyword:"$ref",schemaType:"string",code(u){let{gen:d,schema:f,it:p}=u,{baseId:g,schemaEnv:m,validateName:S,opts:h,self:v}=p,{root:_}=m;if((f==="#"||f==="#/")&&g===_.baseId)return R();let y=s.resolveRef.call(v,_,g,f);if(y===void 0)throw new e.default(p.opts.uriResolver,g,f);if(y instanceof s.SchemaEnv)return T(y);return b(y);function R(){if(m===_)return l(u,S,m,m.$async);let E=d.scopeValue("root",{ref:_});return l(u,(0, i._)`${E}.validate`,_,_.$async)}function T(E){l(u,c(u,E),E,E.$async);}function b(E){let M=d.scopeValue("schema",h.code.source===true?{ref:E,code:(0, i.stringify)(E)}:{ref:E}),N=d.name("valid"),O=u.subschema({schema:E,dataTypes:[],schemaPath:i.nil,topSchemaRef:M,errSchemaPath:f},N);u.mergeEvaluated(O),u.ok(N);}}};function c(u,d){let{gen:f}=u;return d.validate?f.scopeValue("validate",{ref:d.validate}):(0, i._)`${f.scopeValue("wrapper",{ref:d})}.validate`}t.getValidate=c;function l(u,d,f,p){let{gen:g,it:m}=u,{allErrors:S,schemaEnv:h,opts:v}=m,_=v.passContext?n.default.this:i.nil;p?y():R();function y(){if(!h.$async)throw new Error("async schema referenced by sync schema");let E=g.let("valid");g.try(()=>{g.code((0, i._)`await ${(0, r.callValidateCode)(u,d,_)}`),b(d),S||g.assign(E,true);},M=>{g.if((0, i._)`!(${M} instanceof ${m.ValidationError})`,()=>g.throw(M)),T(M),S||g.assign(E,false);}),u.ok(E);}function R(){u.result((0, r.callValidateCode)(u,d,_),()=>b(d),()=>T(d));}function T(E){let M=(0, i._)`${E}.errors`;g.assign(n.default.vErrors,(0, i._)`${n.default.vErrors} === null ? ${M} : ${n.default.vErrors}.concat(${M})`),g.assign(n.default.errors,(0, i._)`${n.default.vErrors}.length`);}function b(E){var M;if(!m.opts.unevaluated)return;let N=(M=f?.validate)===null||M===void 0?void 0:M.evaluated;if(m.props!==true)if(N&&!N.dynamicProps)N.props!==void 0&&(m.props=o.mergeEvaluated.props(g,N.props,m.props));else {let O=g.var("props",(0, i._)`${E}.evaluated.props`);m.props=o.mergeEvaluated.props(g,O,m.props,i.Name);}if(m.items!==true)if(N&&!N.dynamicItems)N.items!==void 0&&(m.items=o.mergeEvaluated.items(g,N.items,m.items));else {let O=g.var("items",(0, i._)`${E}.evaluated.items`);m.items=o.mergeEvaluated.items(g,O,m.items,i.Name);}}}t.callRef=l,t.default=a;})),ET=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=eC(),r=Jv(),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",e.default,r.default];t.default=i;})),tC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=e.operators,i={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(i),type:"number",schemaType:"number",$data:true,error:{message:({keyword:s,schemaCode:o})=>(0, e.str)`must be ${i[s].okStr} ${o}`,params:({keyword:s,schemaCode:o})=>(0, e._)`{comparison: ${i[s].okStr}, limit: ${o}}`},code(s){let{keyword:o,data:a,schemaCode:c}=s;s.fail$data((0, e._)`${a} ${i[o].fail} ${c} || isNaN(${a})`);}};t.default=n;})),nC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:true,error:{message:({schemaCode:i})=>(0, e.str)`must be multiple of ${i}`,params:({schemaCode:i})=>(0, e._)`{multipleOf: ${i}}`},code(i){let{gen:n,data:s,schemaCode:o,it:a}=i,c=a.opts.multipleOfPrecision,l=n.let("res"),u=c?(0, e._)`Math.abs(Math.round(${l}) - ${l}) > 1e-${c}`:(0, e._)`${l} !== parseInt(${l})`;i.fail$data((0, e._)`(${o} === 0 || (${l} = ${s}/${o}, ${u}))`);}};t.default=r;})),rC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});function e(r){let i=r.length,n=0,s=0,o;for(;s<i;)n++,o=r.charCodeAt(s++),o>=55296&&o<=56319&&s<i&&(o=r.charCodeAt(s),(o&64512)===56320&&s++);return n}t.default=e,e.code='require("ajv/dist/runtime/ucs2length").default';})),iC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i=rC(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:true,error:{message({keyword:s,schemaCode:o}){let a=s==="maxLength"?"more":"fewer";return (0, e.str)`must NOT have ${a} than ${o} characters`},params:({schemaCode:s})=>(0, e._)`{limit: ${s}}`},code(s){let{keyword:o,data:a,schemaCode:c,it:l}=s,u=o==="maxLength"?e.operators.GT:e.operators.LT,d=l.opts.unicode===false?(0, e._)`${a}.length`:(0, e._)`${(0, r.useFunc)(s.gen,i.default)}(${a})`;s.fail$data((0, e._)`${d} ${u} ${c}`);}};t.default=n;})),sC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=ze(),i=Te(),n={keyword:"pattern",type:"string",schemaType:"string",$data:true,error:{message:({schemaCode:s})=>(0, i.str)`must match pattern "${s}"`,params:({schemaCode:s})=>(0, i._)`{pattern: ${s}}`},code(s){let{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:d}=s,f=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:p}=d.opts.code,g=p.code==="new RegExp"?(0, i._)`new RegExp`:(0, r.useFunc)(o,p),m=o.let("valid");o.try(()=>o.assign(m,(0, i._)`${g}(${u}, ${f}).test(${a})`),()=>o.assign(m,false)),s.fail$data((0, i._)`!${m}`);}else {let p=(0, e.usePattern)(s,l);s.fail$data((0, i._)`!${p}.test(${a})`);}}};t.default=n;})),oC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:true,error:{message({keyword:i,schemaCode:n}){let s=i==="maxProperties"?"more":"fewer";return (0, e.str)`must NOT have ${s} than ${n} properties`},params:({schemaCode:i})=>(0, e._)`{limit: ${i}}`},code(i){let{keyword:n,data:s,schemaCode:o}=i,a=n==="maxProperties"?e.operators.GT:e.operators.LT;i.fail$data((0, e._)`Object.keys(${s}).length ${a} ${o}`);}};t.default=r;})),aC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Te(),i=ze(),n={keyword:"required",type:"object",schemaType:"array",$data:true,error:{message:({params:{missingProperty:s}})=>(0, r.str)`must have required property '${s}'`,params:({params:{missingProperty:s}})=>(0, r._)`{missingProperty: ${s}}`},code(s){let{gen:o,schema:a,schemaCode:c,data:l,$data:u,it:d}=s,{opts:f}=d;if(!u&&a.length===0)return;let p=a.length>=f.loopRequired;if(d.allErrors?g():m(),f.strictRequired){let v=s.parentSchema.properties,{definedProperties:_}=s.it;for(let y of a)if(v?.[y]===void 0&&!_.has(y)){let R=`required property "${y}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0, i.checkStrictMode)(d,R,d.opts.strictRequired);}}function g(){if(p||u)s.block$data(r.nil,S);else for(let v of a)(0, e.checkReportMissingProp)(s,v);}function m(){let v=o.let("missing");if(p||u){let _=o.let("valid",true);s.block$data(_,()=>h(v,_)),s.ok(_);}else o.if((0, e.checkMissingProp)(s,a,v)),(0, e.reportMissingProp)(s,v),o.else();}function S(){o.forOf("prop",c,v=>{s.setParams({missingProperty:v}),o.if((0, e.noPropertyInData)(o,l,v,f.ownProperties),()=>s.error());});}function h(v,_){s.setParams({missingProperty:v}),o.forOf(v,c,()=>{o.assign(_,(0, e.propertyInData)(o,l,v,f.ownProperties)),o.if((0, r.not)(_),()=>{s.error(),o.break();});},r.nil);}}};t.default=n;})),cC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:true,error:{message({keyword:i,schemaCode:n}){let s=i==="maxItems"?"more":"fewer";return (0, e.str)`must NOT have ${s} than ${n} items`},params:({schemaCode:i})=>(0, e._)`{limit: ${i}}`},code(i){let{keyword:n,data:s,schemaCode:o}=i,a=n==="maxItems"?e.operators.GT:e.operators.LT;i.fail$data((0, e._)`${s}.length ${a} ${o}`);}};t.default=r;})),Yv=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=TT();e.code='require("ajv/dist/runtime/equal").default',t.default=e;})),lC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Jd(),r=Te(),i=ze(),n=Yv(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:true,error:{message:({params:{i:o,j:a}})=>(0, r.str)`must NOT have duplicate items (items ## ${a} and ${o} are identical)`,params:({params:{i:o,j:a}})=>(0, r._)`{i: ${o}, j: ${a}}`},code(o){let{gen:a,data:c,$data:l,schema:u,parentSchema:d,schemaCode:f,it:p}=o;if(!l&&!u)return;let g=a.let("valid"),m=d.items?(0, e.getSchemaTypes)(d.items):[];o.block$data(g,S,(0, r._)`${f} === false`),o.ok(g);function S(){let y=a.let("i",(0, r._)`${c}.length`),R=a.let("j");o.setParams({i:y,j:R}),a.assign(g,true),a.if((0, r._)`${y} > 1`,()=>(h()?v:_)(y,R));}function h(){return m.length>0&&!m.some(y=>y==="object"||y==="array")}function v(y,R){let T=a.name("item"),b=(0, e.checkDataTypes)(m,T,p.opts.strictNumbers,e.DataType.Wrong),E=a.const("indices",(0, r._)`{}`);a.for((0, r._)`;${y}--;`,()=>{a.let(T,(0, r._)`${c}[${y}]`),a.if(b,(0, r._)`continue`),m.length>1&&a.if((0, r._)`typeof ${T} == "string"`,(0, r._)`${T} += "_"`),a.if((0, r._)`typeof ${E}[${T}] == "number"`,()=>{a.assign(R,(0, r._)`${E}[${T}]`),o.error(),a.assign(g,false).break();}).code((0, r._)`${E}[${T}] = ${y}`);});}function _(y,R){let T=(0, i.useFunc)(a,n.default),b=a.name("outer");a.label(b).for((0, r._)`;${y}--;`,()=>a.for((0, r._)`${R} = ${y}; ${R}--;`,()=>a.if((0, r._)`${T}(${c}[${y}], ${c}[${R}])`,()=>{o.error(),a.assign(g,false).break(b);})));}}};t.default=s;})),uC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i=Yv(),n={keyword:"const",$data:true,error:{message:"must be equal to constant",params:({schemaCode:s})=>(0, e._)`{allowedValue: ${s}}`},code(s){let{gen:o,data:a,$data:c,schemaCode:l,schema:u}=s;c||u&&typeof u=="object"?s.fail$data((0, e._)`!${(0, r.useFunc)(o,i.default)}(${a}, ${l})`):s.fail((0, e._)`${u} !== ${a}`);}};t.default=n;})),dC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i=Yv(),n={keyword:"enum",schemaType:"array",$data:true,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>(0, e._)`{allowedValues: ${s}}`},code(s){let{gen:o,data:a,$data:c,schema:l,schemaCode:u,it:d}=s;if(!c&&l.length===0)throw new Error("enum must have non-empty array");let f=l.length>=d.opts.loopEnum,p,g=()=>p??(p=(0, r.useFunc)(o,i.default)),m;if(f||c)m=o.let("valid"),s.block$data(m,S);else {if(!Array.isArray(l))throw new Error("ajv implementation error");let v=o.const("vSchema",u);m=(0, e.or)(...l.map((_,y)=>h(v,y)));}s.pass(m);function S(){o.assign(m,false),o.forOf("v",u,v=>o.if((0, e._)`${g()}(${a}, ${v})`,()=>o.assign(m,true).break()));}function h(v,_){let y=l[_];return typeof y=="object"&&y!==null?(0, e._)`${g()}(${a}, ${v}[${_}])`:(0, e._)`${a} === ${y}`}}};t.default=n;})),wT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=tC(),r=nC(),i=iC(),n=sC(),s=oC(),o=aC(),a=cC(),c=lC(),l=uC(),u=dC(),d=[e.default,r.default,i.default,n.default,s.default,o.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},l.default,u.default];t.default=d;})),MT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateAdditionalItems=void 0;let e=Te(),r=ze(),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>(0, e.str)`must NOT have more than ${s} items`,params:({params:{len:s}})=>(0, e._)`{limit: ${s}}`},code(s){let{parentSchema:o,it:a}=s,{items:c}=o;if(!Array.isArray(c)){(0, r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c);}};function n(s,o){let{gen:a,schema:c,data:l,keyword:u,it:d}=s;d.items=true;let f=a.const("len",(0, e._)`${l}.length`);if(c===false)s.setParams({len:o.length}),s.pass((0, e._)`${f} <= ${o.length}`);else if(typeof c=="object"&&!(0, r.alwaysValidSchema)(d,c)){let g=a.var("valid",(0, e._)`${f} <= ${o.length}`);a.if((0, e.not)(g),()=>p(g)),s.ok(g);}function p(g){a.forRange("i",o.length,f,m=>{s.subschema({keyword:u,dataProp:m,dataPropType:r.Type.Num},g),d.allErrors||a.if((0, e.not)(g),()=>a.break());});}}t.validateAdditionalItems=n,t.default=i;})),AT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateTuple=void 0;let e=Te(),r=ze(),i=un(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(o){let{schema:a,it:c}=o;if(Array.isArray(a))return s(o,"additionalItems",a);c.items=true,!(0, r.alwaysValidSchema)(c,a)&&o.ok((0, i.validateArray)(o));}};function s(o,a,c=o.schema){let{gen:l,parentSchema:u,data:d,keyword:f,it:p}=o;S(u),p.opts.unevaluated&&c.length&&p.items!==true&&(p.items=r.mergeEvaluated.items(l,c.length,p.items));let g=l.name("valid"),m=l.const("len",(0, e._)`${d}.length`);c.forEach((h,v)=>{(0, r.alwaysValidSchema)(p,h)||(l.if((0, e._)`${m} > ${v}`,()=>o.subschema({keyword:f,schemaProp:v,dataProp:v},g)),o.ok(g));});function S(h){let{opts:v,errSchemaPath:_}=p,y=c.length,R=y===h.minItems&&(y===h.maxItems||h[a]===false);if(v.strictTuples&&!R){let T=`"${f}" is ${y}-tuple, but minItems or maxItems/${a} are not specified or different at path "${_}"`;(0, r.checkStrictMode)(p,T,v.strictTuples);}}}t.validateTuple=s,t.default=n;})),hC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=AT(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:i=>(0, e.validateTuple)(i,"items")};t.default=r;})),fC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i=un(),n=MT(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:o}})=>(0, e.str)`must NOT have more than ${o} items`,params:({params:{len:o}})=>(0, e._)`{limit: ${o}}`},code(o){let{schema:a,parentSchema:c,it:l}=o,{prefixItems:u}=c;l.items=true,!(0, r.alwaysValidSchema)(l,a)&&(u?(0, n.validateAdditionalItems)(o,u):o.ok((0, i.validateArray)(o)));}};t.default=s;})),pC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:true,error:{message:({params:{min:n,max:s}})=>s===void 0?(0, e.str)`must contain at least ${n} valid item(s)`:(0, e.str)`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?(0, e._)`{minContains: ${n}}`:(0, e._)`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:o,parentSchema:a,data:c,it:l}=n,u,d,{minContains:f,maxContains:p}=a;l.opts.next?(u=f===void 0?1:f,d=p):u=1;let g=s.const("len",(0, e._)`${c}.length`);if(n.setParams({min:u,max:d}),d===void 0&&u===0){(0, r.checkStrictMode)(l,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&u>d){(0, r.checkStrictMode)(l,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0, r.alwaysValidSchema)(l,o)){let _=(0, e._)`${g} >= ${u}`;d!==void 0&&(_=(0, e._)`${_} && ${g} <= ${d}`),n.pass(_);return}l.items=true;let m=s.name("valid");d===void 0&&u===1?h(m,()=>s.if(m,()=>s.break())):u===0?(s.let(m,true),d!==void 0&&s.if((0, e._)`${c}.length > 0`,S)):(s.let(m,false),S()),n.result(m,()=>n.reset());function S(){let _=s.name("_valid"),y=s.let("count",0);h(_,()=>s.if(_,()=>v(y)));}function h(_,y){s.forRange("i",0,g,R=>{n.subschema({keyword:"contains",dataProp:R,dataPropType:r.Type.Num,compositeRule:true},_),y();});}function v(_){s.code((0, e._)`${_}++`),d===void 0?s.if((0, e._)`${_} >= ${u}`,()=>s.assign(m,true).break()):(s.if((0, e._)`${_} > ${d}`,()=>s.assign(m,false).break()),u===1?s.assign(m,true):s.if((0, e._)`${_} >= ${u}`,()=>s.assign(m,true)));}}};t.default=i;})),Qv=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let e=Te(),r=ze(),i=un();t.error={message:({params:{property:c,depsCount:l,deps:u}})=>{let d=l===1?"property":"properties";return (0, e.str)`must have ${d} ${u} when property ${c} is present`},params:({params:{property:c,depsCount:l,deps:u,missingProperty:d}})=>(0, e._)`{property: ${c},
|
|
73
73
|
missingProperty: ${d},
|
|
74
74
|
depsCount: ${l},
|
|
75
|
-
deps: ${u}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){let[l,u]=s(c);o(c,l),a(c,u);}};function s({schema:c}){let l={},u={};for(let d in c){if(d==="__proto__")continue;let f=Array.isArray(c[d])?l:u;f[d]=c[d];}return [l,u]}function o(c,l=c.schema){let{gen:u,data:d,it:f}=c;if(Object.keys(l).length===0)return;let p=u.let("missing");for(let g in l){let m=l[g];if(m.length===0)continue;let S=(0, i.propertyInData)(u,d,g,f.opts.ownProperties);c.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),f.allErrors?u.if(S,()=>{for(let h of m)(0, i.checkReportMissingProp)(c,h);}):(u.if((0, e._)`${S} && (${(0, i.checkMissingProp)(c,m,p)})`),(0, i.reportMissingProp)(c,p),u.else());}}t.validatePropertyDeps=o;function a(c,l=c.schema){let{gen:u,data:d,keyword:f,it:p}=c,g=u.name("valid");for(let m in l)(0, r.alwaysValidSchema)(p,l[m])||(u.if((0, i.propertyInData)(u,d,m,p.opts.ownProperties),()=>{let S=c.subschema({keyword:f,schemaProp:m},g);c.mergeValidEvaluated(S,g);},()=>u.var(g,true)),c.ok(g));}t.validateSchemaDeps=a,t.default=n;})),fC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0, e._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:o,data:a,it:c}=n;if((0, r.alwaysValidSchema)(c,o))return;let l=s.name("valid");s.forIn("key",a,u=>{n.setParams({propertyName:u}),n.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:true},l),s.if((0, e.not)(l),()=>{n.error(true),c.allErrors||s.break();});}),n.ok(l);}};t.default=i;})),IT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Re(),i=ln(),n=ze(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:{message:"must NOT have additional properties",params:({params:o})=>(0, r._)`{additionalProperty: ${o.additionalProperty}}`},code(o){let{gen:a,schema:c,parentSchema:l,data:u,errsCount:d,it:f}=o;if(!d)throw new Error("ajv implementation error");let{allErrors:p,opts:g}=f;if(f.props=true,g.removeAdditional!=="all"&&(0, n.alwaysValidSchema)(f,c))return;let m=(0, e.allSchemaProperties)(l.properties),S=(0, e.allSchemaProperties)(l.patternProperties);h(),o.ok((0, r._)`${d} === ${i.default.errors}`);function h(){a.forIn("key",u,T=>{!m.length&&!S.length?y(T):a.if(v(T),()=>y(T));});}function v(T){let b;if(m.length>8){let E=(0, n.schemaRefOrVal)(f,l.properties,"properties");b=(0, e.isOwnProperty)(a,E,T);}else m.length?b=(0, r.or)(...m.map(E=>(0, r._)`${T} === ${E}`)):b=r.nil;return S.length&&(b=(0, r.or)(b,...S.map(E=>(0, r._)`${(0, e.usePattern)(o,E)}.test(${T})`))),(0, r.not)(b)}function _(T){a.code((0, r._)`delete ${u}[${T}]`);}function y(T){if(g.removeAdditional==="all"||g.removeAdditional&&c===false){_(T);return}if(c===false){o.setParams({additionalProperty:T}),o.error(),p||a.break();return}if(typeof c=="object"&&!(0, n.alwaysValidSchema)(f,c)){let b=a.name("valid");g.removeAdditional==="failing"?(R(T,b,false),a.if((0, r.not)(b),()=>{o.reset(),_(T);})):(R(T,b),p||a.if((0, r.not)(b),()=>a.break()));}}function R(T,b,E){let M={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};E===false&&Object.assign(M,{compositeRule:true,createErrors:false,allErrors:false}),o.subschema(M,b);}}};t.default=s;})),pC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Ms(),r=un(),i=ze(),n=IT(),s={keyword:"properties",type:"object",schemaType:"object",code(o){let{gen:a,schema:c,parentSchema:l,data:u,it:d}=o;d.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(d,n.default,"additionalProperties"));let f=(0, r.allSchemaProperties)(c);for(let h of f)d.definedProperties.add(h);d.opts.unevaluated&&f.length&&d.props!==true&&(d.props=i.mergeEvaluated.props(a,(0, i.toHash)(f),d.props));let p=f.filter(h=>!(0, i.alwaysValidSchema)(d,c[h]));if(p.length===0)return;let g=a.name("valid");for(let h of p)m(h)?S(h):(a.if((0, r.propertyInData)(a,u,h,d.opts.ownProperties)),S(h),d.allErrors||a.else().var(g,true),a.endIf()),o.it.definedProperties.add(h),o.ok(g);function m(h){return d.opts.useDefaults&&!d.compositeRule&&c[h].default!==void 0}function S(h){o.subschema({keyword:"properties",schemaProp:h,dataProp:h},g);}}};t.default=s;})),mC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Re(),i=ze(),n=ze(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){let{gen:a,schema:c,data:l,parentSchema:u,it:d}=o,{opts:f}=d,p=(0, e.allSchemaProperties)(c),g=p.filter(R=>(0, i.alwaysValidSchema)(d,c[R]));if(p.length===0||g.length===p.length&&(!d.opts.unevaluated||d.props===true))return;let m=f.strictSchema&&!f.allowMatchingProperties&&u.properties,S=a.name("valid");d.props!==true&&!(d.props instanceof r.Name)&&(d.props=(0, n.evaluatedPropsToName)(a,d.props));let{props:h}=d;v();function v(){for(let R of p)m&&_(R),d.allErrors?y(R):(a.var(S,true),y(R),a.if(S));}function _(R){for(let T in m)new RegExp(R).test(T)&&(0, i.checkStrictMode)(d,`property ${T} matches pattern ${R} (use allowMatchingProperties)`);}function y(R){a.forIn("key",l,T=>{a.if((0, r._)`${(0, e.usePattern)(o,R)}.test(${T})`,()=>{let b=g.includes(R);b||o.subschema({keyword:"patternProperties",schemaProp:R,dataProp:T,dataPropType:n.Type.Str},S),d.opts.unevaluated&&h!==true?a.assign((0, r._)`${h}[${T}]`,true):!b&&!d.allErrors&&a.if((0, r.not)(S),()=>a.break());});});}}};t.default=s;})),gC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(i){let{gen:n,schema:s,it:o}=i;if((0, e.alwaysValidSchema)(o,s)){i.fail();return}let a=n.name("valid");i.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},a),i.failResult(a,()=>i.reset(),()=>i.error());},error:{message:"must NOT be valid"}};t.default=r;})),_C=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e={keyword:"anyOf",schemaType:"array",trackErrors:true,code:un().validateUnion,error:{message:"must match a schema in anyOf"}};t.default=e;})),vC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i={keyword:"oneOf",schemaType:"array",trackErrors:true,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0, e._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:o,parentSchema:a,it:c}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let l=o,u=s.let("valid",false),d=s.let("passing",null),f=s.name("_valid");n.setParams({passing:d}),s.block(p),n.result(u,()=>n.reset(),()=>n.error(true));function p(){l.forEach((g,m)=>{let S;(0, r.alwaysValidSchema)(c,g)?s.var(f,true):S=n.subschema({keyword:"oneOf",schemaProp:m,compositeRule:true},f),m>0&&s.if((0, e._)`${f} && ${u}`).assign(u,false).assign(d,(0, e._)`[${d}, ${m}]`).else(),s.if(f,()=>{s.assign(u,true),s.assign(d,m),S&&n.mergeEvaluated(S,e.Name);});});}}};t.default=i;})),yC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:"allOf",schemaType:"array",code(i){let{gen:n,schema:s,it:o}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");let a=n.name("valid");s.forEach((c,l)=>{if((0, e.alwaysValidSchema)(o,c))return;let u=i.subschema({keyword:"allOf",schemaProp:l},a);i.ok(a),i.mergeEvaluated(u);});}};t.default=r;})),SC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:{message:({params:s})=>(0, e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0, e._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:o,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0, r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let l=n(c,"then"),u=n(c,"else");if(!l&&!u)return;let d=o.let("valid",true),f=o.name("_valid");if(p(),s.reset(),l&&u){let m=o.let("ifClause");s.setParams({ifClause:m}),o.if(f,g("then",m),g("else",m));}else l?o.if(f,g("then")):o.if((0, e.not)(f),g("else"));s.pass(d,()=>s.error(true));function p(){let m=s.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},f);s.mergeEvaluated(m);}function g(m,S){return ()=>{let h=s.subschema({keyword:m},f);o.assign(d,f),s.mergeValidEvaluated(h,d),S?o.assign(S,(0, e._)`${m}`):s.setParams({ifClause:m});}}}};function n(s,o){let a=s.schema[o];return a!==void 0&&!(0, r.alwaysValidSchema)(s,a)}t.default=i;})),xC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:i,parentSchema:n,it:s}){n.if===void 0&&(0, e.checkStrictMode)(s,`"${i}" without "if" is ignored`);}};t.default=r;})),CT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=MT(),r=uC(),i=AT(),n=dC(),s=hC(),o=Yv(),a=fC(),c=IT(),l=pC(),u=mC(),d=gC(),f=_C(),p=vC(),g=yC(),m=SC(),S=xC();function h(v=false){let _=[d.default,f.default,p.default,g.default,m.default,S.default,a.default,c.default,o.default,l.default,u.default];return v?_.push(r.default,n.default):_.push(e.default,i.default),_.push(s.default),_}t.default=h;})),bC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:{message:({schemaCode:i})=>(0, e.str)`must match format "${i}"`,params:({schemaCode:i})=>(0, e._)`{format: ${i}}`},code(i,n){let{gen:s,data:o,$data:a,schema:c,schemaCode:l,it:u}=i,{opts:d,errSchemaPath:f,schemaEnv:p,self:g}=u;if(!d.validateFormats)return;a?m():S();function m(){let h=s.scopeValue("formats",{ref:g.formats,code:d.code.formats}),v=s.const("fDef",(0, e._)`${h}[${l}]`),_=s.let("fType"),y=s.let("format");s.if((0, e._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>s.assign(_,(0, e._)`${v}.type || "string"`).assign(y,(0, e._)`${v}.validate`),()=>s.assign(_,(0, e._)`"string"`).assign(y,v)),i.fail$data((0, e.or)(R(),T()));function R(){return d.strictSchema===false?e.nil:(0, e._)`${l} && !${y}`}function T(){let b=p.$async?(0, e._)`(${v}.async ? await ${y}(${o}) : ${y}(${o}))`:(0, e._)`${y}(${o})`,E=(0, e._)`(typeof ${y} == "function" ? ${b} : ${y}.test(${o}))`;return (0, e._)`${y} && ${y} !== true && ${_} === ${n} && !${E}`}}function S(){let h=g.formats[c];if(!h){R();return}if(h===true)return;let[v,_,y]=T(h);v===n&&i.pass(b());function R(){if(d.strictSchema===false){g.logger.warn(E());return}throw new Error(E());function E(){return `unknown format "${c}" ignored in schema at path "${f}"`}}function T(E){let M=E instanceof RegExp?(0, e.regexpCode)(E):d.code.formats?(0, e._)`${d.code.formats}${(0, e.getProperty)(c)}`:void 0,N=s.scopeValue("formats",{key:c,ref:E,code:M});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0, e._)`${N}.validate`]:["string",E,N]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return (0, e._)`await ${y}(${o})`}return typeof _=="function"?(0, e._)`${y}(${o})`:(0, e._)`${y}.test(${o})`}}}};t.default=r;})),PT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=[bC().default];t.default=e;})),NT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];})),OT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ET(),r=wT(),i=CT(),n=PT(),s=NT(),o=[e.default,r.default,(0, i.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];t.default=o;})),TC=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping";})(e||(t.DiscrError=e={}));})),Qv=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=TC(),i=eh(),n=As(),s=ze(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0, e._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){let{gen:c,data:l,schema:u,parentSchema:d,it:f}=a,{oneOf:p}=d;if(!f.opts.discriminator)throw new Error("discriminator: requires discriminator option");let g=u.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!p)throw new Error("discriminator: requires oneOf keyword");let m=c.let("valid",false),S=c.const("tag",(0, e._)`${l}${(0, e.getProperty)(g)}`);c.if((0, e._)`typeof ${S} == "string"`,()=>h(),()=>a.error(false,{discrError:r.DiscrError.Tag,tag:S,tagName:g})),a.ok(m);function h(){let y=_();c.if(false);for(let R in y)c.elseIf((0, e._)`${S} === ${R}`),c.assign(m,v(y[R]));c.else(),a.error(false,{discrError:r.DiscrError.Mapping,tag:S,tagName:g}),c.endIf();}function v(y){let R=c.name("valid"),T=a.subschema({keyword:"oneOf",schemaProp:y},R);return a.mergeEvaluated(T,e.Name),R}function _(){var y;let R={},T=E(d),b=true;for(let O=0;O<p.length;O++){let k=p[O];if(k?.$ref&&!(0, s.schemaHasRulesButRef)(k,f.self.RULES)){let G=k.$ref;if(k=i.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,G),k instanceof i.SchemaEnv&&(k=k.schema),k===void 0)throw new n.default(f.opts.uriResolver,f.baseId,G)}let j=(y=k?.properties)===null||y===void 0?void 0:y[g];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);b=b&&(T||E(k)),M(j,O);}if(!b)throw new Error(`discriminator: "${g}" must be required`);return R;function E({required:O}){return Array.isArray(O)&&O.includes(g)}function M(O,k){if(O.const)N(O.const,k);else if(O.enum)for(let j of O.enum)N(j,k);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function N(O,k){if(typeof O!="string"||O in R)throw new Error(`discriminator: "${g}" values must be unique strings`);R[O]=k;}}}};t.default=o;})),RC=W(((t,e)=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:true,readOnly:{type:"boolean",default:false},examples:{type:"array",items:true},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:true},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:true,enum:{type:"array",items:true,minItems:1,uniqueItems:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:true};})),zT=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let r=Zv(),i=OT(),n=Qv(),s=RC(),o=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(n.default);}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let p=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(p,a,false),this.refs["http://json-schema.org/schema"]=a;}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:true}),t.default=c;var l=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return l.KeywordCxt}});var u=Re();Object.defineProperty(t,"_",{enumerable:true,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return u.CodeGen}});var d=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return d.default}});var f=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return f.default}});})),$T=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.dynamicAnchor=void 0;let e=Re(),r=ln(),i=eh(),n=Xv(),s={keyword:"$dynamicAnchor",schemaType:"string",code:c=>o(c,c.schema)};function o(c,l){let{gen:u,it:d}=c;d.schemaEnv.root.dynamicAnchors[l]=true;let f=(0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(l)}`,p=d.errSchemaPath==="#"?d.validateName:a(c);u.if((0, e._)`!${f}`,()=>u.assign(f,p));}t.dynamicAnchor=o;function a(c){let{schemaEnv:l,schema:u,self:d}=c.it,{root:f,baseId:p,localRefs:g,meta:m}=l.root,{schemaId:S}=d.opts,h=new i.SchemaEnv({schema:u,schemaId:S,root:f,baseId:p,localRefs:g,meta:m});return i.compileSchema.call(d,h),(0, n.getValidate)(c,h)}t.default=s;})),kT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.dynamicRef=void 0;let e=Re(),r=ln(),i=Xv(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,a){let{gen:c,keyword:l,it:u}=o;if(a[0]!=="#")throw new Error(`"${l}" only supports hash fragment reference`);let d=a.slice(1);if(u.allErrors)f();else {let g=c.let("valid",false);f(g),o.ok(g);}function f(g){if(u.schemaEnv.root.dynamicAnchors[d]){let m=c.let("_v",(0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(d)}`);c.if(m,p(m,g),p(u.validateName,g));}else p(u.validateName,g)();}function p(g,m){return m?()=>c.block(()=>{(0, i.callRef)(o,g),c.let(m,true);}):()=>(0, i.callRef)(o,g)}}t.dynamicRef=s,t.default=n;})),EC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=$T(),r=ze(),i={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0, e.dynamicAnchor)(n,""):(0, r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored");}};t.default=i;})),wC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=kT(),r={keyword:"$recursiveRef",schemaType:"string",code:i=>(0, e.dynamicRef)(i,i.schema)};t.default=r;})),DT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=$T(),r=kT(),i=EC(),n=wC(),s=[e.default,r.default,i.default,n.default];t.default=s;})),MC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Yv(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:i=>(0, e.validatePropertyDeps)(i)};t.default=r;})),AC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Yv(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:i=>(0, e.validateSchemaDeps)(i)};t.default=r;})),IC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:i,parentSchema:n,it:s}){n.contains===void 0&&(0, e.checkStrictMode)(s,`"${i}" without "contains" is ignored`);}};t.default=r;})),LT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=MC(),r=AC(),i=IC(),n=[e.default,r.default,i.default];t.default=n;})),CC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i=ln(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:true,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0, e._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:o,schema:a,data:c,errsCount:l,it:u}=s;if(!l)throw new Error("ajv implementation error");let{allErrors:d,props:f}=u;f instanceof e.Name?o.if((0, e._)`${f} !== true`,()=>o.forIn("key",c,S=>o.if(g(f,S),()=>p(S)))):f!==true&&o.forIn("key",c,S=>f===void 0?p(S):o.if(m(f,S),()=>p(S))),u.props=true,s.ok((0, e._)`${l} === ${i.default.errors}`);function p(S){if(a===false){s.setParams({unevaluatedProperty:S}),s.error(),d||o.break();return}if(!(0, r.alwaysValidSchema)(u,a)){let h=o.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:S,dataPropType:r.Type.Str},h),d||o.if((0, e.not)(h),()=>o.break());}}function g(S,h){return (0, e._)`!${S} || !${S}[${h}]`}function m(S,h){let v=[];for(let _ in S)S[_]===true&&v.push((0, e._)`${h} !== ${_}`);return (0, e.and)(...v)}}};t.default=n;})),PC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Re(),r=ze(),i={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0, e.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0, e._)`{limit: ${n}}`},code(n){let{gen:s,schema:o,data:a,it:c}=n,l=c.items||0;if(l===true)return;let u=s.const("len",(0, e._)`${a}.length`);if(o===false)n.setParams({len:l}),n.fail((0, e._)`${u} > ${l}`);else if(typeof o=="object"&&!(0, r.alwaysValidSchema)(c,o)){let f=s.var("valid",(0, e._)`${u} <= ${l}`);s.if((0, e.not)(f),()=>d(f,l)),n.ok(f);}c.items=true;function d(f,p){s.forRange("i",p,u,g=>{n.subschema({keyword:"unevaluatedItems",dataProp:g,dataPropType:r.Type.Num},f),c.allErrors||s.if((0, e.not)(f),()=>s.break());});}}};t.default=i;})),UT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=CC(),r=PC(),i=[e.default,r.default];t.default=i;})),NC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":true,"https://json-schema.org/draft/2019-09/vocab/applicator":true,"https://json-schema.org/draft/2019-09/vocab/validation":true,"https://json-schema.org/draft/2019-09/vocab/meta-data":true,"https://json-schema.org/draft/2019-09/vocab/format":false,"https://json-schema.org/draft/2019-09/vocab/content":true},$recursiveAnchor:true,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}};})),OC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":true},$recursiveAnchor:true,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}};})),zC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":true},$recursiveAnchor:true,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}};})),$C=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":true},$recursiveAnchor:true,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:false},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}};})),kC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":true},$recursiveAnchor:true,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}};})),DC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":true},$recursiveAnchor:true,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:true,deprecated:{type:"boolean",default:false},readOnly:{type:"boolean",default:false},writeOnly:{type:"boolean",default:false},examples:{type:"array",items:true}}};})),LC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":true},$recursiveAnchor:true,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:true,enum:{type:"array",items:true},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:true}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}}};})),UC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=NC(),r=OC(),i=zC(),n=$C(),s=kC(),o=DC(),a=LC(),c=["/properties"];function l(u){return [e,r,i,n,d(this,s),o,d(this,a)].forEach(f=>this.addMetaSchema(f,void 0,false)),this;function d(f,p){return u?f.$dataMetaSchema(p,c):p}}t.default=l;})),FC=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;let r=Zv(),i=OT(),n=DT(),s=LT(),o=UT(),a=Qv(),c=UC(),l="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(m={}){super({...m,dynamicRef:true,next:true,unevaluated:true});}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),i.default.forEach(m=>this.addVocabulary(m)),this.addVocabulary(s.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(a.default);}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:S}=this.opts;S&&(c.default.call(this,m),this.refs["http://json-schema.org/schema"]=l);}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};t.Ajv2019=u,e.exports=t=u,e.exports.Ajv2019=u,Object.defineProperty(t,"__esModule",{value:true}),t.default=u;var d=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return d.KeywordCxt}});var f=Re();Object.defineProperty(t,"_",{enumerable:true,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return f.CodeGen}});var p=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return p.default}});var g=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return g.default}});})),BC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ET(),r=wT(),i=CT(),n=DT(),s=LT(),o=UT(),a=PT(),c=NT(),l=[n.default,e.default,r.default,(0, i.default)(true),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,o.default];t.default=l;})),VC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:true,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:true,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:true},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:true}}};})),jC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":true},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}};})),GC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}};})),HC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":true},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}};})),qC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":true},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}};})),WC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}};})),KC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:true,deprecated:{type:"boolean",default:false},readOnly:{type:"boolean",default:false},writeOnly:{type:"boolean",default:false},examples:{type:"array",items:true}}};})),ZC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":true},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:true}]},const:true,enum:{type:"array",items:true},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}}};})),XC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=VC(),r=jC(),i=GC(),n=HC(),s=qC(),o=WC(),a=KC(),c=ZC(),l=["/properties"];function u(d){return [e,r,i,n,s,f(this,o),a,f(this,c)].forEach(p=>this.addMetaSchema(p,void 0,false)),this;function f(p,g){return d?p.$dataMetaSchema(g,l):g}}t.default=u;})),JC=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;let r=Zv(),i=BC(),n=Qv(),s=XC(),o="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(f={}){super({...f,dynamicRef:true,next:true,unevaluated:true});}_addVocabularies(){super._addVocabularies(),i.default.forEach(f=>this.addVocabulary(f)),this.opts.discriminator&&this.addKeyword(n.default);}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:f,meta:p}=this.opts;p&&(s.default.call(this,f),this.refs["http://json-schema.org/schema"]=o);}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:true}),t.default=a;var c=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return c.KeywordCxt}});var l=Re();Object.defineProperty(t,"_",{enumerable:true,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return l.CodeGen}});var u=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return u.default}});var d=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return d.default}});})),YC=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(O,k){return {validate:O,compare:k}}t.fullFormats={date:e(s,o),time:e(c(true),l),"date-time":e(f(true),p),"iso-time":e(c(),u),"iso-date-time":e(f(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_,int32:{type:"number",validate:T},int64:{type:"number",validate:b},float:{type:"number",validate:E},double:{type:"number",validate:E},password:true,binary:true},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\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,p),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}let i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let k=i.exec(O);if(!k)return false;let j=+k[1],G=+k[2],Q=+k[3];return G>=1&&G<=12&&Q>=1&&Q<=(G===2&&r(j)?29:n[G])}function o(O,k){if(O&&k)return O>k?1:O<k?-1:0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(O){return function(j){let G=a.exec(j);if(!G)return false;let Q=+G[1],Se=+G[2],ye=+G[3],Fe=G[4],ve=G[5]==="-"?-1:1,P=+(G[6]||0),U=+(G[7]||0);if(P>23||U>59||O&&!Fe)return false;if(Q<=23&&Se<=59&&ye<60)return true;let q=Se-U*ve,w=Q-P*ve-(q<0?1:0);return (w===23||w===-1)&&(q===59||q===-1)&&ye<61}}function l(O,k){if(!(O&&k))return;let j=new Date("2020-01-01T"+O).valueOf(),G=new Date("2020-01-01T"+k).valueOf();if(j&&G)return j-G}function u(O,k){if(!(O&&k))return;let j=a.exec(O),G=a.exec(k);if(j&&G)return O=j[1]+j[2]+j[3],k=G[1]+G[2]+G[3],O>k?1:O<k?-1:0}let d=/t|\s/i;function f(O){let k=c(O);return function(G){let Q=G.split(d);return Q.length===2&&s(Q[0])&&k(Q[1])}}function p(O,k){if(!(O&&k))return;let j=new Date(O).valueOf(),G=new Date(k).valueOf();if(j&&G)return j-G}function g(O,k){if(!(O&&k))return;let[j,G]=O.split(d),[Q,Se]=k.split(d),ye=o(j,Q);if(ye!==void 0)return ye||l(G,Se)}let m=/\/|:/,S=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function h(O){return m.test(O)&&S.test(O)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _(O){return v.lastIndex=0,v.test(O)}let y=-2147483648,R=2**31-1;function T(O){return Number.isInteger(O)&&O<=R&&O>=y}function b(O){return Number.isInteger(O)}function E(){return true}let M=/[^\\]\\Z/;function N(O){if(M.test(O))return false;try{return new RegExp(O),!0}catch{return false}}})),QC=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.formatLimitDefinition=void 0;let e=zT(),r=Re(),i=r.operators,n={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:a,schemaCode:c})=>(0, r.str)`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0, r._)`{comparison: ${n[a].okStr}, limit: ${c}}`};t.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:true,error:s,code(a){let{gen:c,data:l,schemaCode:u,keyword:d,it:f}=a,{opts:p,self:g}=f;if(!p.validateFormats)return;let m=new e.KeywordCxt(f,g.RULES.all.format.definition,"format");m.$data?S():h();function S(){let _=c.scopeValue("formats",{ref:g.formats,code:p.code.formats}),y=c.const("fmt",(0, r._)`${_}[${m.schemaCode}]`);a.fail$data((0, r.or)((0, r._)`typeof ${y} != "object"`,(0, r._)`${y} instanceof RegExp`,(0, r._)`typeof ${y}.compare != "function"`,v(y)));}function h(){let _=m.schema,y=g.formats[_];if(!y||y===true)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${d}": format "${_}" does not define "compare" function`);let R=c.scopeValue("formats",{key:_,ref:y,code:p.code.formats?(0, r._)`${p.code.formats}${(0, r.getProperty)(_)}`:void 0});a.fail$data(v(R));}function v(_){return (0, r._)`${_}.compare(${l}, ${u}) ${n[d].fail} 0`}},dependencies:["format"]};let o=a=>(a.addKeyword(t.formatLimitDefinition),a);t.default=o;})),eP=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true});let r=YC(),i=QC(),n=Re(),s=new n.Name("fullFormats"),o=new n.Name("fastFormats"),a=(l,u={keywords:true})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,s),l;let[d,f]=u.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s];return c(l,u.formats||r.formatNames,d,f),u.keywords&&(0, i.default)(l),l};a.get=(l,u="full")=>{let d=(u==="fast"?r.fastFormats:r.fullFormats)[l];if(!d)throw new Error(`Unknown format "${l}"`);return d};function c(l,u,d,f){var p,g;(p=(g=l.opts.code).formats)!==null&&p!==void 0||(g.formats=(0, n._)`require("ajv-formats/dist/formats").${f}`);for(let m of u)l.addFormat(m,d[m]);}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:true}),t.default=a;})),FT=zT(),tP=FC(),nP=JC(),rP=ac(eP()),iP=rP.default;function Kv(t){let e=new t({strict:false,validateFormats:true,validateSchema:false,allErrors:true});return iP(e),e}var th=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(t){this._userAjv=t!==void 0,this._ajv=t;}get ajv(){return this._ajv??=Kv(nP.Ajv2020)}_engineFor(t){if(this._userAjv)return this.ajv;let e=I0(t,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return e==="2020-12"?this.ajv:e==="2019-09"?this._ajv2019??=Kv(tP.Ajv2019):this._ajvDraft7??=Kv(FT.Ajv)}getValidator(t){let e=this._engineFor(t),r="$id"in t&&typeof t.$id=="string"?e.getSchema(t.$id)??e.compile(t):e.compile(t);return i=>r(i)?{valid:true,data:i,errorMessage:void 0}:{valid:false,data:void 0,errorMessage:e.errorsText(r.errors)}}};FT.Ajv;var ZT=Symbol.for("mcp.completable");function ny(t){return !!t&&typeof t=="object"&&ZT in t}function oP(t){return t[ZT]?.complete}function aP(t,e){switch(e.kind){case "tools_list_changed":return t.toolsListChanged===true;case "prompts_list_changed":return t.promptsListChanged===true;case "resources_list_changed":return t.resourcesListChanged===true;case "resource_updated":return t.resourceSubscriptions!==void 0&&t.resourceSubscriptions.includes(e.uri)}}function cP(t,e){let r={},i=n=>e===void 0||n===true;return t.toolsListChanged===true&&i(e?.tools?.listChanged)&&(r.toolsListChanged=true),t.promptsListChanged===true&&i(e?.prompts?.listChanged)&&(r.promptsListChanged=true),t.resourcesListChanged===true&&i(e?.resources?.listChanged)&&(r.resourcesListChanged=true),t.resourceSubscriptions!==void 0&&t.resourceSubscriptions.length>0&&i(e?.resources?.subscribe)&&(r.resourceSubscriptions=[...t.resourceSubscriptions]),r}var nh=1024;function BT(t,e){return {method:t.method,params:{...t.params,_meta:{...t.params?._meta,[hi]:e}}}}function lP(t){let e=mr(Ra).validateRequest("subscriptions/listen",t);return e.ok?e.value.params?.notifications:void 0}var uP=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),XT=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(t=nh,e,r){this._maxSubscriptions=t,this._serverCapabilities=e,this._serverInfo=r;}setServerCapabilities(t,e){this._serverCapabilities=t,e!==void 0&&(this._serverInfo=e);}has(t){return this._subs.has(t)}serve(t){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return {jsonrpc:"2.0",id:t.id,error:{code:-32603,message:"Subscription limit reached"}};let e=lP(t);if(e===void 0)return {jsonrpc:"2.0",id:t.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=cP(e,this._serverCapabilities);return this._subs.set(t.id,r),BT({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},t.id)}cancel(t){return this._subs.delete(t)}routeOutbound(t){if(!uP.has(t.method))return "passthrough";let e=t.params?.uri,r=typeof e=="string"?e:void 0,i=dP(t.method,r),n=[];for(let[s,o]of this._subs)aP(o,i)&&n.push(BT({method:t.method,params:t.params??{}},s));return n}teardownAll(){let t=[];for(let e of this._subs.keys())t.push({jsonrpc:"2.0",id:e,result:{resultType:"complete",_meta:{[hi]:e,...this._serverInfo!==void 0&&{[bn]:this._serverInfo}}}});return this._subs.clear(),t}};function dP(t,e){switch(t){case "notifications/tools/list_changed":return {kind:"tools_list_changed"};case "notifications/prompts/list_changed":return {kind:"prompts_list_changed"};case "notifications/resources/list_changed":return {kind:"resources_list_changed"};default:return {kind:"resource_updated",uri:e??""}}}var hP=8,fP=6e5;function pP(t){if(t?.maxRounds!==void 0&&(!Number.isInteger(t.maxRounds)||t.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${t.maxRounds})`);if(t?.roundTimeoutMs!==void 0&&(!Number.isFinite(t.roundTimeoutMs)||t.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${t.roundTimeoutMs})`);return {maxRounds:t?.maxRounds??hP,roundTimeoutMs:t?.roundTimeoutMs??fP,legacyShim:t?.legacyShim??true}}function JT(t,e,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new he(te.InternalError,`Handler for ${t} returned an invalid input request '${e}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let i=r,n=Vb(i);if(n===void 0)throw new he(te.InternalError,`Handler for ${t} returned an input request '${e}' of kind '${i.method}', which is not an embedded request the 2026-07-28 revision defines`);return {embedded:i,required:n}}function mP(){let t=globalThis.crypto;if(t?.randomUUID!==void 0)return t.randomUUID();let e=new Uint8Array(16);t.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=[...e].map(i=>i.toString(16).padStart(2,"0")).join("");return `${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function ty(t,e){if(t==="tools/call")return {content:[{type:"text",text:e}],isError:true};throw new he(te.InternalError,e)}var gP=class{constructor(t){this._host=t;}async fulfill(t,e,r,i,n){let{maxRounds:s,roundTimeoutMs:o}=this._host,a=i.mcpReq.signal,c=n,l=0;for(;;){if(l+=1,l>s)return ty(t,uT(t,s));let u=c.inputRequests,d=u!=null&&Object.keys(u).length>0,f=typeof c.requestState=="string"?c.requestState:void 0;if(!d&&f===void 0)throw new he(te.InternalError,`Handler for ${t} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let p;if(d){let S=this._host.resolvedClientCapabilities(i),h=[];for(let[_,y]of Object.entries(u)){let{embedded:R,required:T}=JT(t,_,y);if(R.method!=="roots/list"&&R.params===void 0)throw new he(te.InternalError,`Handler for ${t} returned an input request '${_}' of kind '${R.method}' without params`);if(Ud(T,S)!==void 0)return ty(t,`Cannot request input '${_}' (${R.method}): the client on this 2025-era connection did not declare the required capability${S===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);h.push([_,R]);}let v=hT(a);try{let _={relatedRequestId:i.mcpReq.id,timeout:o,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:v.signal},y=await Promise.all(h.map(async([R,T])=>{try{return [R,await this._dispatchLeg(T,_)]}catch(b){throw v.abort(b),b}}));p=Object.fromEntries(y);}catch(_){if(a.aborted)throw _;return ty(t,`Fulfilling input required by '${t}' failed: ${_ instanceof Error?_.message:String(_)}`)}finally{v.dispose();}}else await dT(lT,a);let g={...i,mcpReq:{...i.mcpReq,inputResponses:p,droppedInputResponseKeys:void 0,requestState:Ea(f)}};if(f!==void 0){let S=await this._host.verifyRequestState(f,g,t);S!==void 0&&(g=Bv(g,S));}let m=await e(r,g);if(!Dn(m))return m;c=m;}}async _dispatchLeg(t,e){switch(t.method){case "elicitation/create":{let r=t.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:mP()}),await this._host.sendElicitation(r,e)}case "sampling/createMessage":return await this._host.sendSampling(t.params,e);case "roots/list":return await this._host.listRoots(t.params,e)}}},_P=new Set(["tools/call","prompts/get","resources/read"]),YT,QT;function ry(t,e){YT(t,e);}function iy(t){return QT(t)}var eR=class extends jv{_clientCapabilities;_clientVersion;static{YT=(t,e)=>{let r=e.filter(i=>!t._supportedProtocolVersions.includes(i));r.length>0&&(t._supportedProtocolVersions=[...t._supportedProtocolVersions,...r]),t.setRequestHandler("server/discover",()=>t._ondiscover());},QT=t=>t._serverInfo;}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new gP({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:t=>this._inputRequestCapabilityView(t),verifyRequestState:(t,e,r)=>this._verifyRequestState(t,e,r),sendElicitation:(t,e)=>this._sendElicitationLeg(t,e,{validateAcceptedContent:false}),sendSampling:(t,e)=>this.createMessage(t,e),listRoots:(t,e)=>this.listRoots(t,e)})}oninitialized;constructor(t,e){if(super(e),this._serverInfo=t,this._capabilities=e?.capabilities?{...e.capabilities}:{},this._instructions=e?.instructions,this._jsonSchemaValidator=e?.jsonSchemaValidator??new th,this._requestStateVerify=e?.requestState?.verify,this._inputRequiredServing=pP(e?.inputRequired),e?.cacheHints!==void 0){for(let[r,i]of Object.entries(e.cacheHints))i!==void 0&&Nv(i,`cacheHints['${r}']`);this._cacheHints=e.cacheHints;}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),wv(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler();}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(t,e)=>{let r=e.sessionId||e.http?.req?.headers.get("mcp-session-id")||void 0,{level:i}=t.params,n=Wd(fr,i);return n.success&&this._loggingLevels.set(r,n.data),{}});}buildContext(t,e){let r=t.http||e?.request||e?.closeSSEStream||e?.closeStandaloneSSEStream;return {...t,mcpReq:{...t.mcpReq,log:(i,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let o;if(this._servedModernEra()){if(o=t.mcpReq.envelope?.[ar],o===void 0)return Promise.resolve()}else o=this._loggingLevels.get(t.sessionId)??this._loggingLevels.get(void 0);return o!==void 0&&this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o)?Promise.resolve():t.mcpReq.notify({method:"notifications/message",params:{level:i,data:n,logger:s}})},elicitInput:(i,n)=>this.elicitInput(i,n),requestSampling:(i,n)=>this.createMessage(i,n)},http:r?{...t.http,req:e?.request,closeSSE:e?.closeSSEStream,closeStandaloneSSE:e?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(fr.options.map((t,e)=>[t,e]));isMessageIgnored=(t,e)=>{let r=this._loggingLevels.get(e);return r?this.LOG_LEVEL_SEVERITY.get(t)<this.LOG_LEVEL_SEVERITY.get(r):false};registerCapabilities(t){if(this.transport)throw new Te(Ce.AlreadyConnected,"Cannot register capabilities after connecting to transport");let e=!!this._capabilities.logging;this._capabilities=Gv(this._capabilities,t),!e&&this._capabilities.logging&&this._registerLoggingHandler();}_wrapHandler(t,e){if(t!=="tools/call"){let r=this._cacheHints?.[t],i=_P.has(t);return r===void 0&&!i?async(n,s)=>{let o=await e(n,s);if(Dn(o))throw new he(te.InternalError,`Handler for ${t} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return o}:async(n,s)=>{let o=i?await this._invokeInputRequiredCapableHandler(t,e,n,s):await e(n,s);if(Dn(o)){if(!i)throw new he(te.InternalError,`Handler for ${t} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return o}return r===void 0?o:Fd(o,r)}}return async(r,i)=>{let n=mr(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new he(s.reason==="not-in-era"?te.InternalError:te.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let o=await this._invokeInputRequiredCapableHandler("tools/call",e,r,i);if(Dn(o))return o;let a=Mv(o),c=n.validateResult("tools/call",a);if(!c.ok)throw new he(c.reason==="not-in-era"?te.InternalError:te.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Es(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(t,e,r,i){let n=this._servedModernEra(),s=i.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new he(te.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let o=i;if(typeof s=="string"){let d=await this._verifyRequestState(s,i,t);d!==void 0&&(o=Bv(i,d));}let a;try{a=await e(r,o);}catch(d){throw d instanceof he&&d.code===te.UrlElicitationRequired&&n?new he(te.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):d}if(!Dn(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new he(te.InternalError,`Handler for ${t} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??di}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(t,e,r,o,a)}let c=a.inputRequests,l=c!=null&&Object.keys(c).length>0,u=typeof a.requestState=="string";if(!l&&!u)throw new he(te.InternalError,`Handler for ${t} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(l){let d=this._inputRequestCapabilityView(i);for(let[f,p]of Object.entries(c)){let{embedded:g,required:m}=JT(t,f,p),S=Ud(m,d);if(S!==void 0)throw new Vd({requiredCapabilities:S},`Cannot request input '${f}' (${g.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(t,e,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(t,e)}catch(i){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${i instanceof Error?i.message:String(i)}`)),new he(te.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(t){return this._servedModernEra()?t.mcpReq.envelope?.[$n]:this._clientCapabilities}_assertPushApiInServedEra(t){if(this._servedModernEra())throw new Te(Ce.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${t}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:t,era:"2026-07-28"})}assertCapabilityForMethod(t){switch(t){case "sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new Te(Ce.CapabilityNotSupported,`Client does not support sampling (required for ${t})`);break;case "elicitation/create":if(!this._clientCapabilities?.elicitation)throw new Te(Ce.CapabilityNotSupported,`Client does not support elicitation (required for ${t})`);break;case "roots/list":if(!this._clientCapabilities?.roots)throw new Te(Ce.CapabilityNotSupported,`Client does not support listing roots (required for ${t})`);break;}}assertNotificationCapability(t){switch(t){case "notifications/message":if(!this._capabilities.logging)throw new Te(Ce.CapabilityNotSupported,`Server does not support logging (required for ${t})`);break;case "notifications/resources/updated":case "notifications/resources/list_changed":if(!this._capabilities.resources)throw new Te(Ce.CapabilityNotSupported,`Server does not support notifying about resources (required for ${t})`);break;case "notifications/tools/list_changed":if(!this._capabilities.tools)throw new Te(Ce.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${t})`);break;case "notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new Te(Ce.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${t})`);break;case "notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new Te(Ce.CapabilityNotSupported,`Client does not support URL elicitation (required for ${t})`);break;}}assertRequestHandlerCapability(t){switch(t){case "completion/complete":if(!this._capabilities.completions)throw new Te(Ce.CapabilityNotSupported,`Server does not support completions (required for ${t})`);break;case "logging/setLevel":if(!this._capabilities.logging)throw new Te(Ce.CapabilityNotSupported,`Server does not support logging (required for ${t})`);break;case "prompts/get":case "prompts/list":if(!this._capabilities.prompts)throw new Te(Ce.CapabilityNotSupported,`Server does not support prompts (required for ${t})`);break;case "resources/list":case "resources/templates/list":case "resources/read":if(!this._capabilities.resources)throw new Te(Ce.CapabilityNotSupported,`Server does not support resources (required for ${t})`);break;case "tools/call":case "tools/list":if(!this._capabilities.tools)throw new Te(Ce.CapabilityNotSupported,`Server does not support tools (required for ${t})`);break;}}async _oninitialize(t){let e=t.params.protocolVersion;this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo;let r=Gb(this._supportedProtocolVersions),i=r.includes(e)?e:r[0]??di;return this._negotiatedProtocolVersion=i,this.transport?.setProtocolVersion?.(i),{protocolVersion:i,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return {supportedVersions:wv(this._supportedProtocolVersions),capabilities:yP(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(t,e){return this._wireCodec().projectCallToolResult(t,e)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(t,e){if(this._assertPushApiInServedEra("sampling/createMessage"),(t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new Te(Ce.CapabilityNotSupported,"Client does not support sampling tools capability.");if(t.messages.length>0){let s=t.messages.at(-1),o=Array.isArray(s.content)?s.content:[s.content],a=o.some(d=>d.type==="tool_result"),c=t.messages.length>1?t.messages.at(-2):void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(a){if(o.some(d=>d.type!=="tool_result"))throw new he(te.InvalidParams,"The last message must contain only tool_result content if any is present");if(!u)throw new he(te.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(p=>p.type==="tool_use").map(p=>p.id)),f=new Set(o.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==f.size||![...d].every(p=>f.has(p)))throw new he(te.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(t.tools||t.toolChoice),i=await this.request({method:"sampling/createMessage",params:t},e),n=this._wireCodec().samplingResultVariant(r,i);if(!n.ok)throw new Te(Ce.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(t,e){switch(this._assertPushApiInServedEra("elicitation/create"),t.mode??"form"){case "url":if(!this._clientCapabilities?.elicitation?.url)throw new Te(Ce.CapabilityNotSupported,"Client does not support url elicitation.");break;case "form":if(!this._clientCapabilities?.elicitation?.form)throw new Te(Ce.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(t,e)}async _sendElicitationLeg(t,e,r){let i=t.mode??"form",n=r?.validateAcceptedContent??true;switch(i){case "url":{let s=t;return this.request({method:"elicitation/create",params:s},e)}case "form":{let s=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:s},e);if(n&&o.action==="accept"&&o.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(o.content);if(!a.valid)throw new he(te.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){throw a instanceof he?a:new he(te.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,e){if(!this._clientCapabilities?.elicitation?.url)throw new Te(Ce.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return ()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},e)}async listRoots(t,e){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:t},e)}async sendLoggingMessage(t,e){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,e))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function yP(t){return {...t}}var Aa=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(t){let e=this._registeredTools[t];if(!(e===void 0||!e.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,t))return this._toolInputSchemaJson[t];if(e.inputSchema===void 0)return jT;try{let r=vr(e.inputSchema,"input");return this._toolInputSchemaJson[t]=r,r}catch{return}}}constructor(t,e){this.server=new eR(t,e),e?.capabilities?.tools&&this.setToolRequestHandlers(),e?.capabilities?.resources&&this.setResourceRequestHandlers(),e?.capabilities?.prompts&&this.setPromptRequestHandlers();}async connect(t){return await this.server.connect(t)}async close(){await this.server.close();}_toolHandlersInitialized=false;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??true}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,e])=>{let r={name:t,title:e.title,description:e.description,inputSchema:e.inputSchema?vr(e.inputSchema,"input"):jT,annotations:e.annotations,icons:e.icons,execution:e.execution,_meta:e._meta};return e.outputSchema&&(r.outputSchema=vr(e.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(t,e)=>{let r=this._registeredTools[t.params.name];if(!r)throw new he(te.InvalidParams,`Tool ${t.params.name} not found`);if(!r.enabled)throw new he(te.InvalidParams,`Tool ${t.params.name} disabled`);try{let i=await this.validateToolInput(r,t.params.arguments,t.params.name),n=await this.executeToolHandler(r,i,e);return await this.validateToolOutput(r,n,t.params.name),Dn(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(i){if(i instanceof he&&i.code===te.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=true);}createToolError(t){return {content:[{type:"text",text:t}],isError:true}}async validateToolInput(t,e,r){if(!t.inputSchema)return;let i=await mi(t.inputSchema,e??{});if(!i.success)throw new he(te.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${i.error}`);return i.data}async validateToolOutput(t,e,r){if(!t.outputSchema||Dn(e)||e.isError)return;if(e.structuredContent===void 0)throw new he(te.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let i=await mi(t.outputSchema,e.structuredContent);if(!i.success)throw new he(te.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${i.error}`)}async executeToolHandler(t,e,r){return t.executor(e,r)}_completionHandlerInitialized=false;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async t=>{switch(t.params.ref.type){case "ref/prompt":return $v(t),this.handlePromptCompletion(t,t.params.ref);case "ref/resource":return kv(t),this.handleResourceCompletion(t,t.params.ref);default:throw new he(te.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=true);}async handlePromptCompletion(t,e){let r=this._registeredPrompts[e.name];if(!r)throw new he(te.InvalidParams,`Prompt ${e.name} not found`);if(!r.enabled)throw new he(te.InvalidParams,`Prompt ${e.name} disabled`);if(!r.argsSchema)return Ma;let i=KT(WT(r.argsSchema)?.[t.params.argument.name]);if(!ny(i))return Ma;let n=oP(i);return n?qT(await n(t.params.argument.value,t.params.context)):Ma}async handleResourceCompletion(t,e){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===e.uri);if(!r){if(this._registeredResources[e.uri])return Ma;throw new he(te.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(t.params.argument.name);return i?qT(await i(t.params.argument.value,t.params.context)):Ma}_resourceHandlersInitialized=false;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??true}}),this.server.setRequestHandler("resources/list",async(t,e)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),i=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(e);for(let o of s.resources)i.push({...n.metadata,...o});}return {resources:[...r,...i]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,e])=>({name:t,uriTemplate:e.resourceTemplate.uriTemplate.toString(),...e.metadata}))})),this.server.setRequestHandler("resources/read",async(t,e)=>{let r;try{r=new URL(t.params.uri);}catch{throw new he(te.InvalidParams,`Resource URI ${t.params.uri} is invalid`,{uri:t.params.uri,reason:"invalid_uri"})}let i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new he(te.InvalidParams,`Resource ${r} disabled`);return Fd(await i.readCallback(r,e),i.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return Fd(await n.readCallback(r,s,e),n.cacheHint)}throw new Bd(t.params.uri)}),this._resourceHandlersInitialized=true);}_promptHandlersInitialized=false;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??true}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,e])=>({name:t,title:e.title,description:e.description,arguments:e.argsSchema?cT(e.argsSchema):void 0,icons:e.icons,_meta:e._meta}))})),this.server.setRequestHandler("prompts/get",async(t,e)=>{let r=this._registeredPrompts[t.params.name];if(!r)throw new he(te.InvalidParams,`Prompt ${t.params.name} not found`);if(!r.enabled)throw new he(te.InvalidParams,`Prompt ${t.params.name} disabled`);return r.handler(t.params.arguments,e)}),this._promptHandlersInitialized=true);}registerResource(t,e,r,i){let n=r.cacheHint,s=r;if(n!==void 0){Nv(n,`resource ${t}`);let o={...r};delete o.cacheHint,s=o;}if(typeof e=="string"){if(this._registeredResources[e])throw new Error(`Resource ${e} is already registered`);let o=this._createRegisteredResource(t,r.title,e,s,i);return n!==void 0&&(o.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else {if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,r.title,e,s,i);return n!==void 0&&(o.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,e,r,i,n){let s={name:t,title:e,metadata:i,readCallback:n,enabled:true,disable:()=>s.update({enabled:false}),enable:()=>s.update({enabled:true}),remove:()=>s.update({uri:null}),update:o=>{o.uri!==void 0&&o.uri!==r&&(delete this._registeredResources[r],o.uri&&(this._registeredResources[o.uri]=s)),o.name!==void 0&&(s.name=o.name),o.title!==void 0&&(s.title=o.title),o.metadata!==void 0&&(s.metadata=o.metadata),o.callback!==void 0&&(s.readCallback=o.callback),o.enabled!==void 0&&(s.enabled=o.enabled),this.sendResourceListChanged();}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(t,e,r,i,n){let s={resourceTemplate:r,title:e,metadata:i,readCallback:n,enabled:true,disable:()=>s.update({enabled:false}),enable:()=>s.update({enabled:true}),remove:()=>s.update({name:null}),update:a=>{a.name!==void 0&&a.name!==t&&(delete this._registeredResourceTemplates[t],a.name&&(this._registeredResourceTemplates[a.name]=s)),a.title!==void 0&&(s.title=a.title),a.template!==void 0&&(s.resourceTemplate=a.template),a.metadata!==void 0&&(s.metadata=a.metadata),a.callback!==void 0&&(s.readCallback=a.callback),a.enabled!==void 0&&(s.enabled=a.enabled),this.sendResourceListChanged();}};this._registeredResourceTemplates[t]=s;let o=r.uriTemplate.variableNames;return Array.isArray(o)&&o.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,e,r,i,n,s,o){let a=i,c=n,l={title:e,description:r,argsSchema:i,icons:s,_meta:o,handler:HT(t,i,n),enabled:true,disable:()=>l.update({enabled:false}),enable:()=>l.update({enabled:true}),remove:()=>l.update({name:null}),update:u=>{u.name!==void 0&&u.name!==t&&(delete this._registeredPrompts[t],u.name&&(this._registeredPrompts[u.name]=l)),u.title!==void 0&&(l.title=u.title),u.description!==void 0&&(l.description=u.description),u.icons!==void 0&&(l.icons=u.icons),u._meta!==void 0&&(l._meta=u._meta);let d=false;u.argsSchema!==void 0&&(l.argsSchema=u.argsSchema,a=u.argsSchema,d=true),u.callback!==void 0&&(c=u.callback,d=true),d&&(l.handler=HT(t,a,c)),u.enabled!==void 0&&(l.enabled=u.enabled),this.sendPromptListChanged();}};if(this._registeredPrompts[t]=l,i){let u=WT(i);u&&Object.values(u).some(d=>ny(KT(d)))&&this.setCompletionRequestHandler();}return l}_createRegisteredTool(t,e,r,i,n,s,o,a,c,l){if(Wv(t),i!==void 0)try{let f=vr(i,"input");this._toolInputSchemaJson[t]=f;let p=Dv(f);p.valid||console.warn(`[mcp-sdk] tool '${t}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${p.reason}`);}catch{}let u=l,d={title:e,description:r,inputSchema:i,outputSchema:n,outputSchemaJson:GT(n),annotations:s,icons:o,execution:a,_meta:c,handler:l,executor:VT(i,l),enabled:true,disable:()=>d.update({enabled:false}),enable:()=>d.update({enabled:true}),remove:()=>d.update({name:null}),update:f=>{f.name!==void 0&&f.name!==t&&(typeof f.name=="string"&&Wv(f.name),delete this._registeredTools[t],delete this._toolInputSchemaJson[t],f.name&&(delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=d,t=f.name)),f.title!==void 0&&(d.title=f.title),f.description!==void 0&&(d.description=f.description);let p=false;f.paramsSchema!==void 0&&(d.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[t],p=true),f.callback!==void 0&&(d.handler=f.callback,u=f.callback,p=true),p&&(d.executor=VT(d.inputSchema,u)),f.outputSchema!==void 0&&(d.outputSchema=f.outputSchema,d.outputSchemaJson=GT(f.outputSchema)),f.annotations!==void 0&&(d.annotations=f.annotations),f.icons!==void 0&&(d.icons=f.icons),f._meta!==void 0&&(d._meta=f._meta),f.enabled!==void 0&&(d.enabled=f.enabled),this.sendToolListChanged();}};return this._registeredTools[t]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}registerTool(t,e,r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:i,description:n,inputSchema:s,outputSchema:o,annotations:a,icons:c,_meta:l}=e;return this._createRegisteredTool(t,i,n,Kd(s),Kd(o),a,c,void 0,l,r)}registerPrompt(t,e,r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:i,description:n,argsSchema:s,icons:o,_meta:a}=e,c=this._createRegisteredPrompt(t,i,n,Kd(s),r,o,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,e){return this.server.sendLoggingMessage(t,e)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged();}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged();}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged();}};function VT(t,e){if(t){let i=e;return async(n,s)=>i(n,s)}let r=e;return async(i,n)=>r(n)}var jT={type:"object",properties:{}};function GT(t){if(t!==void 0)try{return vr(t,"output")}catch{return}}function HT(t,e,r){if(e){let i=r;return async(n,s)=>{let o=await mi(e,n);if(!o.success)throw new he(te.InvalidParams,`Invalid arguments for prompt ${t}: ${o.error}`);return i(o.data,s)}}else {let i=r;return async(n,s)=>i(s)}}function qT(t){return {completion:{values:t.map(String).slice(0,100),total:t.length,hasMore:t.length>100}}}var Ma={completion:{values:[],hasMore:false}};function WT(t){let e=t;if(e.shape&&typeof e.shape=="object")return e.shape}function SP(t){return t?.type==="optional"}function KT(t){return SP(t)?t.def?.innerType??t:t}var xP=class{_readBuffer;_started=false;_closed=false;constructor(t=ey.stdin,e=ey.stdout,r){this._stdin=t,this._stdout=e,this._readBuffer=new Hv({maxBufferSize:r?.maxBufferSize});}onclose;onerror;onmessage;_ondata=t=>{try{this._readBuffer.append(t),this.processReadBuffer();}catch(e){this.onerror?.(e),this.close().catch(()=>{});}};_onerror=t=>{this.onerror?.(t);};_onstdouterror=t=>{this.onerror?.(t),this.close().catch(()=>{});};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=true,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror);}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t);}catch(t){this.onerror?.(t);}}async close(){this._closed||(this._closed=true,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.());}send(t){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((e,r)=>{let i=qv(t),n=false,s=a=>{n||(n=true,this._stdout.off("error",s),this._stdout.off("drain",o),r(a));},o=()=>{n||(n=true,this._stdout.off("error",s),this._stdout.off("drain",o),e());};if(this._stdout.once("error",s),this._stdout.write(i)){if(n)return;n=true,this._stdout.off("error",s),e();}else n||this._stdout.once("drain",o);})}},tR=3e3,bP=class{onclose;onerror;onmessage;_closed=false;_pendingRequests=new Set;_drainWaiters=[];constructor(t,e,r){this._wire=t,this._onInstanceClose=e,this._outboundIntercept=r;}async start(){}async send(t,e){if(ba(t)||qd(t)){let{id:r}=t;r!==void 0&&this._settle(r);}if(!this._closed&&this._outboundIntercept?.(t)!=="handled")return this._wire.send(t,e)}setProtocolVersion=t=>{this._wire.setProtocolVersion?.(t);};deliver(t,e){if(!this._closed){if(Xt(t))this._pendingRequests.add(t.id);else if(_r(t)&&t.method==="notifications/cancelled"){let r=t.params?.requestId;r!==void 0&&this._settle(r);}this.onmessage?.(t,e);}}async whenRequestsAnswered(t){return this._closed||this._pendingRequests.size===0?true:await new Promise(e=>{let r=()=>{clearTimeout(i),e(true);},i=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),e(false);},t);this._drainWaiters.push(r);})}async close(){if(!this._closed){this._closed=true,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose();}finally{this.onclose?.();}}}_settle(t){this._pendingRequests.delete(t),this._pendingRequests.size===0&&this._releaseDrainWaiters();}_releaseDrainWaiters(){let t=this._drainWaiters;this._drainWaiters=[];for(let e of t)e();}};function TP(t){let e=t.params;if(t.method==="initialize"&&!Lv(e)){let s=e!==null&&typeof e=="object"&&typeof e.protocolVersion=="string"?e.protocolVersion:void 0;return {kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!jd(e))return {kind:"legacy",reason:"no-claim"};let r=_i(e),i=(r===void 0?[]:Hd(r))[0];if(i!==void 0)return {kind:"invalid-envelope",issue:i};let n=Gd(e);return n===void 0||!gr.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function nR(t,e={}){let r=e.legacy??"serve",i=e.transport??new xP,n={phase:"opening"},s,o=false,a=()=>o||n.phase==="closed",c=E=>{try{e.onerror?.(E);}catch{}},l=(E,M,N,O)=>i.send({jsonrpc:"2.0",id:E,error:{code:M,message:N,...O!==void 0&&{data:O}}}).catch(k=>c(dn(k))),u=new XT(e.maxSubscriptions??nh),d=E=>{if(!_r(E))return;let M=u.routeOutbound(E);if(M!=="passthrough"){for(let N of M)i.send({jsonrpc:"2.0",...N}).catch(O=>c(dn(O)));return "handled"}},f=async E=>{if(Xt(E)&&E.method==="subscriptions/listen"){let M=_i(E.params),N=jd(E.params)?(M===void 0?[]:Hd(M))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},O=Gd(E.params),k;if(N!==void 0)k={jsonrpc:"2.0",id:E.id,error:{code:-32602,message:`Invalid _meta envelope: ${N.key}: ${N.problem}`}};else if(O===void 0||!gr.includes(O)){let j=new ws({supported:[...gr],requested:O??"unknown"});k={jsonrpc:"2.0",id:E.id,error:{code:j.code,message:j.message,data:j.data}};}else k=u.serve(E);return await i.send("error"in k?k:{jsonrpc:"2.0",method:k.method,params:k.params}).catch(j=>c(dn(j))),true}if(_r(E)&&E.method==="notifications/cancelled"){let M=E.params?.requestId;if(M!==void 0&&u.cancel(M))return true}return false},p=(E,M,N)=>{let O=Uv({reason:M,...N!==void 0&&{requestedVersion:N}},gr);return O===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${O.cell}): ${O.message}`)),l(E.id,O.code,O.message,O.data))},g=E=>{o||E===s||T();},m=async(E,M)=>{let N=await t({era:E}),O=N instanceof Aa?N.server:N;E==="modern"&&(Vv(O,M),ry(O,gr),u.setServerCapabilities(O.getCapabilities(),iy(O)));let k=new bP(i,()=>g(k),E==="modern"?d:void 0);return await N.connect(k),{product:N,channel:k}},S=E=>E.product.close().catch(M=>c(dn(M))),h=async E=>{s=E.channel;try{await E.channel.whenRequestsAnswered(tR)||c(new Error(`Discarded the probe instance with requests still unanswered after ${tR}ms; continuing with the fallback`)),await E.product.close();}catch(M){c(dn(M));}finally{s=void 0;}},v=async E=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&Xt(E)&&E.method==="initialize"&&!Lv(E.params)){await p(E,"initialize",E.params!==null&&typeof E.params=="object"&&typeof E.params.protocolVersion=="string"?E.params.protocolVersion:void 0);return}if(n.era==="modern"&&await f(E))return;n.instance.channel.deliver(E);return}if(!Xt(E)&&!_r(E)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let M=TP(E);switch(M.kind){case "invalid-envelope":{let N=`Invalid _meta envelope for protocol revision 2026-07-28: ${M.issue.key}: ${M.issue.problem}`;Xt(E)?await l(E.id,te.InvalidParams,N,{envelope:M.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${N}`));return}case "unsupported-revision":if(Xt(E)){let N=new ws({supported:[...gr],requested:M.requested});c(N),await l(E.id,N.code,N.message,N.data);}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${M.requested}`));return;case "modern":if(Xt(E)&&E.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver(E,{classification:M.classification});return}let N=await m("modern",M.revision);if(a()){await S(N);return}n={phase:"probe",instance:N},N.channel.deliver(E,{classification:M.classification});return}if(n.phase==="probe"){if(_r(E)){n.instance.channel.deliver(E,{classification:M.classification});return}n={phase:"pinned",era:"modern",instance:n.instance};}else {let N=await m("modern",M.revision);if(a()){await S(N);return}n={phase:"pinned",era:"modern",instance:N};}if(await f(E))return;n.instance.channel.deliver(E,{classification:M.classification});return;case "legacy":{if(r==="reject"){Xt(E)&&await p(E,M.reason,M.requestedVersion);return}if(n.phase==="probe"){if(await h(n.instance),a())return;n={phase:"opening"};}let N=await m("legacy");if(a()){await S(N);return}n={phase:"pinned",era:"legacy",instance:N},n.instance.channel.deliver(E);return}}},_=[],y=false,R=async()=>{if(!y){y=true;try{for(;_.length>0;){let E=_.shift();try{await v(E);}catch(M){Xt(E)&&await l(E.id,te.InternalError,"Internal server error"),c(dn(M));}}}finally{y=false;}}},T=async()=>{if(o||n.phase==="closed")return;o=true;let E=n;n={phase:"closed"};for(let M of u.teardownAll())await i.send(M).catch(N=>c(dn(N)));(E.phase==="probe"||E.phase==="pinned")&&await E.instance.product.close().catch(M=>c(dn(M))),await i.close().catch(M=>c(dn(M)));};i.onmessage=E=>{_.push(E),R();},i.onerror=E=>{c(E),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.(E);},i.onclose=()=>{if(o||n.phase==="closed")return;o=true;let E=n;n={phase:"closed"},(E.phase==="probe"||E.phase==="pinned")&&E.instance.product.close().catch(M=>c(dn(M)));};let b=i.start().catch(E=>{throw c(dn(E)),E});return b.catch(()=>{}),{close:async()=>{await b.catch(()=>{}),await T();}}}function dn(t){return t instanceof Error?t:new Error(String(t))}var rR=class{_listeners={};addEventListener(t,e){let r=this._listeners;return r[t]===void 0&&(r[t]=[]),r[t].indexOf(e)===-1&&r[t].push(e),this}removeEventListener(t,e){let r=this._listeners[t];if(r!==void 0){let i=r.indexOf(e);i!==-1&&r.splice(i,1);}return this}dispatchEvent(t){let e=this._listeners[t.type];if(e!==void 0){let r=e.slice(0);for(let i=0,n=r.length;i<n;i++)r[i].call(this,t);}return this}dispose(){for(let t in this._listeners)delete this._listeners[t];}},Sr=class{_disposed=false;_name;_parent;_child;_attributes;constructor(t,e,r,i={}){if(this._name=t,this._parent=e,this._child=r,this._attributes=i,!e.isOnGraph(r))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(t){return this._child=t,this}getAttributes(){return this._attributes}dispose(){this._disposed||(this._parent._destroyRef(this),this._disposed=true);}isDisposed(){return this._disposed}},sy=class extends rR{_emptySet=new Set;_edges=new Set;_parentEdges=new Map;_childEdges=new Map;listEdges(){return Array.from(this._edges)}listParentEdges(t){return Array.from(this._childEdges.get(t)||this._emptySet)}listParents(t){let e=new Set;for(let r of this.listParentEdges(t))e.add(r.getParent());return Array.from(e)}listChildEdges(t){return Array.from(this._parentEdges.get(t)||this._emptySet)}listChildren(t){let e=new Set;for(let r of this.listChildEdges(t))e.add(r.getChild());return Array.from(e)}disconnectParents(t,e){for(let r of this.listParentEdges(t))(!e||e(r.getParent()))&&r.dispose();return this}_createEdge(t,e,r,i){let n=new Sr(t,e,r,i);this._edges.add(n);let s=n.getParent();this._parentEdges.has(s)||this._parentEdges.set(s,new Set),this._parentEdges.get(s).add(n);let o=n.getChild();return this._childEdges.has(o)||this._childEdges.set(o,new Set),this._childEdges.get(o).add(n),n}_destroyEdge(t){return this._edges.delete(t),this._parentEdges.get(t.getParent()).delete(t),this._childEdges.get(t.getChild()).delete(t),this}},mt=class{list=[];constructor(t){if(t)for(let e of t)this.list.push(e);}add(t){this.list.push(t);}remove(t){let e=this.list.indexOf(t);e>=0&&this.list.splice(e,1);}removeChild(t){let e=[];for(let r of this.list)r.getChild()===t&&e.push(r);for(let r of e)this.remove(r);return e}listRefsByChild(t){let e=[];for(let r of this.list)r.getChild()===t&&e.push(r);return e}values(){return this.list}},Ve=class{set=new Set;map=new Map;constructor(t){if(t)for(let e of t)this.add(e);}add(t){let e=t.getChild();this.removeChild(e),this.set.add(t),this.map.set(e,t);}remove(t){this.set.delete(t),this.map.delete(t.getChild());}removeChild(t){let e=this.map.get(t)||null;return e&&this.remove(e),e}getRefByChild(t){return this.map.get(t)||null}values(){return Array.from(this.set)}},st=class{map={};constructor(t){t&&Object.assign(this.map,t);}set(t,e){this.map[t]=e;}delete(t){delete this.map[t];}get(t){return this.map[t]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}},De=Symbol("attributes"),yr=Symbol("immutableKeys"),iR=class sR extends rR{_disposed=false;graph;[De];[yr];constructor(e){super(),this.graph=e,this[yr]=new Set,this[De]=this._createAttributes();}getDefaults(){return {}}_createAttributes(){let e=this.getDefaults(),r={};for(let i in e){let n=e[i];if(n instanceof sR){let s=this.graph._createEdge(i,this,n);this[yr].add(i),r[i]=s;}else r[i]=n;}return r}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=true,this.dispatchEvent({type:"dispose"}));}detach(){return this.graph.disconnectParents(this),this}swap(e,r){for(let i in this[De]){let n=this[De][i];if(n instanceof Sr){let s=n;s.getChild()===e&&this.setRef(i,r,s.getAttributes());}else if(n instanceof mt)for(let s of n.listRefsByChild(e)){let o=s.getAttributes();this.removeRef(i,e),this.addRef(i,r,o);}else if(n instanceof Ve){let s=n.getRefByChild(e);if(s){let o=s.getAttributes();this.removeRef(i,e),this.addRef(i,r,o);}}else if(n instanceof st)for(let s of n.keys()){let o=n.get(s);o.getChild()===e&&this.setRefMap(i,s,r,o.getAttributes());}}return this}get(e){return this[De][e]}set(e,r){return this[De][e]=r,this.dispatchEvent({type:"change",attribute:e})}getRef(e){let r=this[De][e];return r?r.getChild():null}setRef(e,r,i){if(this[yr].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);let n=this[De][e];if(n&&n.dispose(),!r)return this;let s=this.graph._createEdge(e,this,r,i);return this[De][e]=s,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this.assertRefList(e).values().map(r=>r.getChild())}addRef(e,r,i){let n=this.graph._createEdge(e,this,r,i);return this.assertRefList(e).add(n),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,r){let i=this.assertRefList(e);if(i instanceof mt)for(let n of i.listRefsByChild(r))n.dispose();else {let n=i.getRefByChild(r);n&&n.dispose();}return this}assertRefList(e){let r=this[De][e];if(r instanceof mt||r instanceof Ve)return r;throw new Error(`Expected RefList or RefSet for attribute "${e}"`)}listRefMapKeys(e){return this.assertRefMap(e).keys()}listRefMapValues(e){return this.assertRefMap(e).values().map(r=>r.getChild())}getRefMap(e,r){let i=this.assertRefMap(e).get(r);return i?i.getChild():null}setRefMap(e,r,i,n){let s=this.assertRefMap(e),o=s.get(r);if(o&&o.dispose(),!i)return this;n=Object.assign(n||{},{key:r});let a=this.graph._createEdge(e,this,i,{...n,key:r});return s.set(r,a),this.dispatchEvent({type:"change",attribute:e,key:r})}assertRefMap(e){let r=this[De][e];if(r instanceof st)return r;throw new Error(`Expected RefMap for attribute "${e}"`)}dispatchEvent(e){return super.dispatchEvent({...e,target:this}),this.graph.dispatchEvent({...e,target:this,type:`node:${e.type}`}),this}_destroyRef(e){let r=e.getName();if(this[De][r]===e)this[De][r]=null,this[yr].has(r)&&e.getChild().dispose();else if(this[De][r]instanceof mt)this[De][r].remove(e);else if(this[De][r]instanceof Ve)this[De][r].remove(e);else if(this[De][r]instanceof st){let i=this[De][r];for(let n of i.keys())i.get(n)===e&&i.delete(n);}else return;this.graph._destroyEdge(e),this.dispatchEvent({type:"change",attribute:r});}};var hR="v4.4.2",br="@glb.bin",ne=(function(t){return t.ACCESSOR="Accessor",t.ANIMATION="Animation",t.ANIMATION_CHANNEL="AnimationChannel",t.ANIMATION_SAMPLER="AnimationSampler",t.BUFFER="Buffer",t.CAMERA="Camera",t.MATERIAL="Material",t.MESH="Mesh",t.PRIMITIVE="Primitive",t.PRIMITIVE_TARGET="PrimitiveTarget",t.NODE="Node",t.ROOT="Root",t.SCENE="Scene",t.SKIN="Skin",t.TEXTURE="Texture",t.TEXTURE_INFO="TextureInfo",t})({});var RP=(function(t){return t.ARRAY_BUFFER="ARRAY_BUFFER",t.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",t.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",t.OTHER="OTHER",t.SPARSE="SPARSE",t})({}),hn=(function(t){return t[t.R=4096]="R",t[t.G=256]="G",t[t.B=16]="B",t[t.A=1]="A",t})({});var EP=class extends Float32Array{constructor(){throw super(),new Error("Unsupported typed array instantiation.")}},uh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5131:typeof Float16Array<"u"?Float16Array:EP,5126:Float32Array,5130:Float64Array},Me=class{static createBufferFromDataURI(t){if(typeof Buffer>"u"){let e=atob(t.split(",")[1]),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}else {let e=t.split(",")[1],r=t.indexOf("base64")>=0;return Buffer.from(e,r?"base64":"utf8")}}static encodeText(t){return new TextEncoder().encode(t)}static decodeText(t){return new TextDecoder().decode(t)}static concat(t){let e=0;for(let n of t)e+=n.byteLength;let r=new Uint8Array(e),i=0;for(let n of t)r.set(n,i),i+=n.byteLength;return r}static pad(t,e=0){let r=this.padNumber(t.byteLength);if(r===t.byteLength)return t;let i=new Uint8Array(r);if(i.set(t),e!==0)for(let n=t.byteLength;n<r;n++)i[n]=e;return i}static padNumber(t){return Math.ceil(t/4)*4}static equals(t,e){if(t===e)return true;if(t.byteLength!==e.byteLength)return false;let r=t.byteLength;for(;r--;)if(t[r]!==e[r])return false;return true}static toView(t,e=0,r=1/0){return new Uint8Array(t.buffer,t.byteOffset+e,Math.min(t.byteLength,r))}static assertView(t){if(t&&!ArrayBuffer.isView(t))throw new Error(`Method requires Uint8Array parameter; received "${typeof t}".`);return t}};var wP=class{match(t){return t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255}getSize(t){let e=new DataView(t.buffer,t.byteOffset+4),r,i;for(;e.byteLength;){if(r=e.getUint16(0,false),AP(e,r),i=e.getUint8(r+1),i===192||i===193||i===194)return [e.getUint16(r+7,false),e.getUint16(r+5,false)];e=new DataView(t.buffer,e.byteOffset+r+2);}throw new TypeError("Invalid JPG, no size found")}getChannels(t){return 3}},MP=class fR{static PNG_FRIED_CHUNK_NAME="CgBI";match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){let r=new DataView(e.buffer,e.byteOffset);return Me.decodeText(e.slice(12,16))===fR.PNG_FRIED_CHUNK_NAME?[r.getUint32(32,false),r.getUint32(36,false)]:[r.getUint32(16,false),r.getUint32(20,false)]}getChannels(e){return 4}},Tn=class{static impls={"image/jpeg":new wP,"image/png":new MP};static registerFormat(t,e){this.impls[t]=e;}static getMimeType(t){for(let e in this.impls)if(this.impls[e].match(t))return e;return null}static getSize(t,e){return this.impls[e]?this.impls[e].getSize(t):null}static getChannels(t,e){return this.impls[e]?this.impls[e].getChannels(t):null}static getVRAMByteLength(t,e){if(!this.impls[e])return null;if(this.impls[e].getVRAMByteLength)return this.impls[e].getVRAMByteLength(t);let r=0,i=4,n=this.getSize(t,e);if(!n)return null;for(;n[0]>1||n[1]>1;)r+=n[0]*n[1]*i,n[0]=Math.max(Math.floor(n[0]/2),1),n[1]=Math.max(Math.floor(n[1]/2),1);return r+=1*i,r}static mimeTypeToExtension(t){return t==="image/jpeg"?"jpg":t.split("/").pop()}static extensionToMimeType(t){return t==="jpg"?"image/jpeg":t?`image/${t}`:""}};function AP(t,e){if(e>t.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return t}var yi=class{static basename(t){let e=t.split(/[\\/]/).pop();return e.substring(0,e.lastIndexOf("."))}static extension(t){if(t.startsWith("data:image/")){let e=t.match(/data:(image\/\w+)/)[1];return Tn.mimeTypeToExtension(e)}else {if(t.startsWith("data:model/gltf+json"))return "gltf";if(t.startsWith("data:model/gltf-binary"))return "glb";if(t.startsWith("data:application/"))return "bin"}return t.split(/[\\/]/).pop().split(/[.]/).pop()}},ay=typeof Float32Array<"u"?Float32Array:Array;function IP(){var t=new ay(3);return ay!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function oy(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function CP(t,e,r){var i=e[0],n=e[1],s=e[2],o=r[3]*i+r[7]*n+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*i+r[4]*n+r[8]*s+r[12])/o,t[1]=(r[1]*i+r[5]*n+r[9]*s+r[13])/o,t[2]=(r[2]*i+r[6]*n+r[10]*s+r[14])/o,t}(function(){var t=IP();return function(e,r,i,n,s,o){var a,c;for(r||(r=3),i||(i=0),n?c=Math.min(n*r+i,e.length):c=e.length,a=i;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,o),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}})();function pR(t){let e=mR(),r=t.propertyType==="Node"?[t]:t.listChildren();for(let i of r)i.traverse(n=>{let s=n.getMesh();if(!s)return;let o=PP(s,n.getWorldMatrix());o.min.every(isFinite)&&o.max.every(isFinite)&&(cy(o.min,e),cy(o.max,e));});return e}function PP(t,e){let r=mR();for(let i of t.listPrimitives()){let n=i.getAttribute("POSITION"),s=i.getIndices();if(!n)continue;let o=[0,0,0],a=[0,0,0];for(let c=0,l=s?s.getCount():n.getCount();c<l;c++){let u=s?s.getScalar(c):c;o=n.getElement(u,o),a=CP(a,o,e),cy(a,r);}}return r}function cy(t,e){for(let r=0;r<3;r++)e.min[r]=Math.min(t[r],e.min[r]),e.max[r]=Math.max(t[r],e.max[r]);}function mR(){return {min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}var oR="https://null.example",Ln=class{static DEFAULT_INIT={};static PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;static dirname(t){let e=t.lastIndexOf("/");return e===-1?"./":t.substring(0,e+1)}static basename(t){return yi.basename(new URL(t,oR).pathname)}static extension(t){return yi.extension(new URL(t,oR).pathname)}static resolve(t,e){if(!this.isRelativePath(e))return e;let r=t.split("/"),i=e.split("/");r.pop();for(let n=0;n<i.length;n++)i[n]!=="."&&(i[n]===".."?r.pop():r.push(i[n]));return r.join("/")}static isAbsoluteURL(t){return this.PROTOCOL_REGEXP.test(t)}static isRelativePath(t){return !/^(?:[a-zA-Z]+:)?\//.test(t)}};function aR(t){return Object.prototype.toString.call(t)==="[object Object]"}function vi(t){if(aR(t)===false)return false;let e=t.constructor;if(e===void 0)return true;let r=e.prototype;return !(aR(r)===false||Object.hasOwn(r,"isPrototypeOf")===false)}var NP=(function(t){return t[t.SILENT=4]="SILENT",t[t.ERROR=3]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=1]="INFO",t[t.DEBUG=0]="DEBUG",t})({}),dh=class gR{verbosity;static Verbosity=NP;static DEFAULT_INSTANCE=new gR(1);constructor(e){this.verbosity=e;}debug(e){this.verbosity<=0&&console.debug(e);}info(e){this.verbosity<=1&&console.info(e);}warn(e){this.verbosity<=2&&console.warn(e);}error(e){this.verbosity<=3&&console.error(e);}};function OP(t){var e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],S=t[15],h=e*o-r*s,v=e*a-i*s,_=r*a-i*o,y=l*g-u*p,R=l*m-d*p,T=u*m-d*g,b=e*T-r*R+i*y,E=s*T-o*R+a*y,M=l*_-u*v+d*h,N=p*_-g*v+m*h;return c*b-n*E+S*M-f*N}function zP(t,e,r){var i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=e[9],p=e[10],g=e[11],m=e[12],S=e[13],h=e[14],v=e[15],_=r[0],y=r[1],R=r[2],T=r[3];return t[0]=_*i+y*a+R*d+T*m,t[1]=_*n+y*c+R*f+T*S,t[2]=_*s+y*l+R*p+T*h,t[3]=_*o+y*u+R*g+T*v,_=r[4],y=r[5],R=r[6],T=r[7],t[4]=_*i+y*a+R*d+T*m,t[5]=_*n+y*c+R*f+T*S,t[6]=_*s+y*l+R*p+T*h,t[7]=_*o+y*u+R*g+T*v,_=r[8],y=r[9],R=r[10],T=r[11],t[8]=_*i+y*a+R*d+T*m,t[9]=_*n+y*c+R*f+T*S,t[10]=_*s+y*l+R*p+T*h,t[11]=_*o+y*u+R*g+T*v,_=r[12],y=r[13],R=r[14],T=r[15],t[12]=_*i+y*a+R*d+T*m,t[13]=_*n+y*c+R*f+T*S,t[14]=_*s+y*l+R*p+T*h,t[15]=_*o+y*u+R*g+T*v,t}function $P(t,e){var r=e[0],i=e[1],n=e[2],s=e[4],o=e[5],a=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(r*r+i*i+n*n),t[1]=Math.sqrt(s*s+o*o+a*a),t[2]=Math.sqrt(c*c+l*l+u*u),t}function kP(t,e){var r=new ay(3);$P(r,e);var i=1/r[0],n=1/r[1],s=1/r[2],o=e[0]*i,a=e[1]*n,c=e[2]*s,l=e[4]*i,u=e[5]*n,d=e[6]*s,f=e[8]*i,p=e[9]*n,g=e[10]*s,m=o+u+g,S=0;return m>0?(S=Math.sqrt(m+1)*2,t[3]=.25*S,t[0]=(d-p)/S,t[1]=(f-c)/S,t[2]=(a-l)/S):o>u&&o>g?(S=Math.sqrt(1+o-u-g)*2,t[3]=(d-p)/S,t[0]=.25*S,t[1]=(a+l)/S,t[2]=(f+c)/S):u>g?(S=Math.sqrt(1+u-o-g)*2,t[3]=(f-c)/S,t[0]=(a+l)/S,t[1]=.25*S,t[2]=(d+p)/S):(S=Math.sqrt(1+g-o-u)*2,t[3]=(a-l)/S,t[0]=(f+c)/S,t[1]=(d+p)/S,t[2]=.25*S),t}var Ke=class Ia{static identity(e){return e}static eq(e,r,i=1e-5){if(e.length!==r.length)return false;for(let n=0;n<e.length;n++)if(Math.abs(e[n]-r[n])>i)return false;return true}static clamp(e,r,i){return e<r?r:e>i?i:e}static decodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return Math.round(Ia.clamp(e,0,1)*65535);case 5121:return Math.round(Ia.clamp(e,0,1)*255);case 5122:return Math.round(Ia.clamp(e,-1,1)*32767);case 5120:return Math.round(Ia.clamp(e,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(e,r,i,n){let s=oy([e[0],e[1],e[2]]),o=oy([e[4],e[5],e[6]]),a=oy([e[8],e[9],e[10]]);OP(e)<0&&(s=-s),r[0]=e[12],r[1]=e[13],r[2]=e[14];let c=e.slice(),l=1/s,u=1/o,d=1/a;c[0]*=l,c[1]*=l,c[2]*=l,c[4]*=u,c[5]*=u,c[6]*=u,c[8]*=d,c[9]*=d,c[10]*=d,kP(i,c),n[0]=s,n[1]=o,n[2]=a;}static compose(e,r,i,n){let s=n,o=r[0],a=r[1],c=r[2],l=r[3],u=o+o,d=a+a,f=c+c,p=o*u,g=o*d,m=o*f,S=a*d,h=a*f,v=c*f,_=l*u,y=l*d,R=l*f,T=i[0],b=i[1],E=i[2];return s[0]=(1-(S+v))*T,s[1]=(g+R)*T,s[2]=(m-y)*T,s[3]=0,s[4]=(g-R)*b,s[5]=(1-(p+v))*b,s[6]=(h+_)*b,s[7]=0,s[8]=(m+y)*E,s[9]=(h-_)*E,s[10]=(1-(p+S))*E,s[11]=0,s[12]=e[0],s[13]=e[1],s[14]=e[2],s[15]=1,s}};function DP(t,e){if(!!t!=!!e)return false;let r=t.getChild(),i=e.getChild();return r===i||r.equals(i)}function LP(t,e){if(!!t!=!!e)return false;let r=t.values(),i=e.values();if(r.length!==i.length)return false;for(let n=0;n<r.length;n++){let s=r[n],o=i[n];if(s.getChild()!==o.getChild()&&!s.getChild().equals(o.getChild()))return false}return true}function UP(t,e){if(!!t!=!!e)return false;let r=t.keys(),i=e.keys();if(r.length!==i.length)return false;for(let n of r){let s=t.get(n),o=e.get(n);if(!!s!=!!o)return false;let a=s.getChild(),c=o.getChild();if(a!==c&&!a.equals(c))return false}return true}function _R(t,e){if(t===e)return true;if(!!t!=!!e||!t||!e||t.length!==e.length)return false;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return false;return true}function vR(t,e){if(t===e)return true;if(!!t!=!!e)return false;if(!vi(t)||!vi(e))return t===e;let r=t,i=e,n=0,s=0,o;for(o in r)n++;for(o in i)s++;if(n!==s)return false;for(o in r){let a=r[o],c=i[o];if(ch(a)&&ch(c)){if(!_R(a,c))return false}else if(vi(a)&&vi(c)){if(!vR(a,c))return false}else if(a!==c)return false}return true}function ch(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var FP="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",BP=999,VP=6,cR=new Set,jP=function(){let t="";for(let e=0;e<VP;e++)t+=FP.charAt(Math.floor(Math.random()*42));return t},GP=function(){for(let t=0;t<BP;t++){let e=jP();if(!cR.has(e))return cR.add(e),e}return ""},Tr=t=>t,HP=new Set,dy=class extends iR{constructor(t,e=""){super(t),this[De].name=e,this.init(),this.dispatchEvent({type:"create"});}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(t,e){return Array.isArray(e)&&(e=e.slice()),super.set(t,e)}getName(){return this.get("name")}setName(t){return this.set("name",t)}getExtras(){return this.get("extras")}setExtras(t){return this.set("extras",t)}clone(){let t=this.constructor;return new t(this.graph).copy(this,Tr)}copy(t,e=Tr){for(let r in this[De]){let i=this[De][r];if(i instanceof Sr)this[yr].has(r)||i.dispose();else if(i instanceof mt||i instanceof Ve)for(let n of i.values())n.dispose();else if(i instanceof st)for(let n of i.values())n.dispose();}for(let r in t[De]){let i=this[De][r],n=t[De][r];if(n instanceof Sr)this[yr].has(r)?i.getChild().copy(e(n.getChild()),e):this.setRef(r,e(n.getChild()),n.getAttributes());else if(n instanceof Ve||n instanceof mt)for(let s of n.values())this.addRef(r,e(s.getChild()),s.getAttributes());else if(n instanceof st)for(let s of n.keys()){let o=n.get(s);this.setRefMap(r,s,e(o.getChild()),o.getAttributes());}else vi(n)?this[De][r]=JSON.parse(JSON.stringify(n)):Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)?this[De][r]=n.slice():this[De][r]=n;}return this}equals(t,e=HP){if(this===t)return true;if(this.propertyType!==t.propertyType)return false;for(let r in this[De]){if(e.has(r))continue;let i=this[De][r],n=t[De][r];if(i instanceof Sr||n instanceof Sr){if(!DP(i,n))return false}else if(i instanceof Ve||n instanceof Ve||i instanceof mt||n instanceof mt){if(!LP(i,n))return false}else if(i instanceof st||n instanceof st){if(!UP(i,n))return false}else if(vi(i)||vi(n)){if(!vR(i,n))return false}else if(ch(i)||ch(n)){if(!_R(i,n))return false}else if(i!==n)return false}return true}detach(){return this.graph.disconnectParents(this,t=>t.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}},It=class extends dy{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new st})}getExtension(t){return this.getRefMap("extensions",t)}setExtension(t,e){return e&&e._validateParent(this),this.setRefMap("extensions",t,e)}listExtensions(){return this.listRefMapValues("extensions")}},fe=class ot extends It{static Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};static ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,FLOAT16:5131,FLOAT64:5130};init(){this.propertyType="Accessor";}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:ot.Type.SCALAR,componentType:ot.ComponentType.FLOAT,normalized:false,sparse:false,buffer:null})}static getElementSize(e){switch(e){case ot.Type.SCALAR:return 1;case ot.Type.VEC2:return 2;case ot.Type.VEC3:return 3;case ot.Type.VEC4:return 4;case ot.Type.MAT2:return 4;case ot.Type.MAT3:return 9;case ot.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case ot.ComponentType.BYTE:case ot.ComponentType.UNSIGNED_BYTE:return 1;case ot.ComponentType.SHORT:case ot.ComponentType.UNSIGNED_SHORT:return 2;case ot.ComponentType.UNSIGNED_INT:case ot.ComponentType.FLOAT:return 4;case ot.ComponentType.FLOAT16:return 2;case ot.ComponentType.FLOAT64:return 8;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){let r=this.getNormalized(),i=this.getElementSize(),n=this.getComponentType();if(this.getMin(e),r)for(let s=0;s<i;s++)e[s]=Ke.decodeNormalizedInt(e[s],n);return e}getMin(e){let r=this.getArray(),i=this.getCount(),n=this.getElementSize();for(let s=0;s<n;s++)e[s]=1/0;for(let s=0;s<i*n;s+=n)for(let o=0;o<n;o++){let a=r[s+o];Number.isFinite(a)&&(e[o]=Math.min(e[o],a));}return e}getMaxNormalized(e){let r=this.getNormalized(),i=this.getElementSize(),n=this.getComponentType();if(this.getMax(e),r)for(let s=0;s<i;s++)e[s]=Ke.decodeNormalizedInt(e[s],n);return e}getMax(e){let r=this.get("array"),i=this.getCount(),n=this.getElementSize();for(let s=0;s<n;s++)e[s]=-1/0;for(let s=0;s<i*n;s+=n)for(let o=0;o<n;o++){let a=r[s+o];Number.isFinite(a)&&(e[o]=Math.max(e[o],a));}return e}getCount(){let e=this.get("array");return e?e.length/this.getElementSize():0}getType(){return this.get("type")}setType(e){return this.set("type",e)}getElementSize(){return ot.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getScalar(e){let r=this.getElementSize(),i=this.getComponentType(),n=this.getArray();return this.getNormalized()?Ke.decodeNormalizedInt(n[e*r],i):n[e*r]}setScalar(e,r){let i=this.getElementSize(),n=this.getComponentType(),s=this.getArray();return this.getNormalized()?s[e*i]=Ke.encodeNormalizedInt(r,n):s[e*i]=r,this}getElement(e,r){let i=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType(),o=this.getArray();for(let a=0;a<n;a++)i?r[a]=Ke.decodeNormalizedInt(o[e*n+a],s):r[a]=o[e*n+a];return r}setElement(e,r){let i=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType(),o=this.getArray();for(let a=0;a<n;a++)i?o[e*n+a]=Ke.encodeNormalizedInt(r[a],s):o[e*n+a]=r[a];return this}getSparse(){return this.get("sparse")}setSparse(e){return this.set("sparse",e)}getBuffer(){return this.getRef("buffer")}setBuffer(e){return this.setRef("buffer",e)}getArray(){return this.get("array")}setArray(e){return this.set("componentType",e?qP(e):ot.ComponentType.FLOAT),this.set("array",e),this}getByteLength(){let e=this.get("array");return e?e.byteLength:0}};function qP(t){switch(t.constructor){case Float32Array:return fe.ComponentType.FLOAT;case Uint32Array:return fe.ComponentType.UNSIGNED_INT;case Uint16Array:return fe.ComponentType.UNSIGNED_SHORT;case Uint8Array:return fe.ComponentType.UNSIGNED_BYTE;case Int16Array:return fe.ComponentType.SHORT;case Int8Array:return fe.ComponentType.BYTE;case Float64Array:return fe.ComponentType.FLOAT64}if(typeof Float16Array<"u"&&t.constructor===Float16Array)return fe.ComponentType.FLOAT16;throw new Error("Unknown accessor componentType.")}var yR=class extends It{init(){this.propertyType="Animation";}getDefaults(){return Object.assign(super.getDefaults(),{channels:new Ve,samplers:new Ve})}addChannel(t){return this.addRef("channels",t)}removeChannel(t){return this.removeRef("channels",t)}listChannels(){return this.listRefs("channels")}addSampler(t){return this.addRef("samplers",t)}removeSampler(t){return this.removeRef("samplers",t)}listSamplers(){return this.listRefs("samplers")}},hy=class extends It{static TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};init(){this.propertyType="AnimationChannel";}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(t){return this.set("targetPath",t)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(t){return this.setRef("targetNode",t)}getSampler(){return this.getRef("sampler")}setSampler(t){return this.setRef("sampler",t)}},hh=class SR extends It{static Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};init(){this.propertyType="AnimationSampler";}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:SR.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(e){return this.set("interpolation",e)}getInput(){return this.getRef("input")}setInput(e){return this.setRef("input",e,{usage:"OTHER"})}getOutput(){return this.getRef("output")}setOutput(e){return this.setRef("output",e,{usage:"OTHER"})}},xR=class extends It{init(){this.propertyType="Buffer";}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(t){return this.set("uri",t)}},fh=class bR extends It{static Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};init(){this.propertyType="Camera";}getDefaults(){return Object.assign(super.getDefaults(),{type:bR.Type.PERSPECTIVE,znear:.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(e){return this.set("type",e)}getZNear(){return this.get("znear")}setZNear(e){return this.set("znear",e)}getZFar(){return this.get("zfar")}setZFar(e){return this.set("zfar",e)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(e){return this.set("aspectRatio",e)}getYFov(){return this.get("yfov")}setYFov(e){return this.set("yfov",e)}getXMag(){return this.get("xmag")}setXMag(e){return this.set("xmag",e)}getYMag(){return this.get("ymag")}setYMag(e){return this.set("ymag",e)}},Pe=class extends dy{static EXTENSION_NAME;_validateParent(t){if(!this.parentTypes.includes(t.propertyType))throw new Error(`Parent "${t.propertyType}" invalid for child "${this.propertyType}".`)}},qe=class ly extends It{static WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};static MagFilter={NEAREST:9728,LINEAR:9729};static MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};init(){this.propertyType="TextureInfo";}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:ly.WrapMode.REPEAT,wrapT:ly.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}getMagFilter(){return this.get("magFilter")}setMagFilter(e){return this.set("magFilter",e)}getMinFilter(){return this.get("minFilter")}setMinFilter(e){return this.set("minFilter",e)}getWrapS(){return this.get("wrapS")}setWrapS(e){return this.set("wrapS",e)}getWrapT(){return this.get("wrapT")}setWrapT(e){return this.set("wrapT",e)}},{R:rh,G:ih,B:sh,A:WP}=hn,lh=class TR extends It{static AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};init(){this.propertyType="Material";}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:TR.AlphaMode.OPAQUE,alphaCutoff:.5,doubleSided:false,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new qe(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new qe(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new qe(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new qe(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new qe(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(e){return this.set("doubleSided",e)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(e){let r=this.get("baseColorFactor").slice();return r[3]=e,this.set("baseColorFactor",r)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(e){return this.set("alphaMode",e)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(e){return this.set("alphaCutoff",e)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(e){return this.set("baseColorFactor",e)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(e){return this.setRef("baseColorTexture",e,{channels:rh|ih|sh|WP,isColor:true})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(e){return this.set("emissiveFactor",e)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(e){return this.setRef("emissiveTexture",e,{channels:rh|ih|sh,isColor:true})}getNormalScale(){return this.get("normalScale")}setNormalScale(e){return this.set("normalScale",e)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(e){return this.setRef("normalTexture",e,{channels:rh|ih|sh})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(e){return this.set("occlusionStrength",e)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(e){return this.setRef("occlusionTexture",e,{channels:rh})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(e){return this.set("roughnessFactor",e)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(e){return this.set("metallicFactor",e)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(e){return this.setRef("metallicRoughnessTexture",e,{channels:ih|sh})}},RR=class extends It{init(){this.propertyType="Mesh";}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new Ve})}addPrimitive(t){return this.addRef("primitives",t)}removePrimitive(t){return this.removeRef("primitives",t)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(t){return this.set("weights",t)}},ER=class extends It{init(){this.propertyType="Node";}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new Ve})}copy(t,e=Tr){if(e===Tr)throw new Error("Node cannot be copied.");return super.copy(t,e)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(t){return this.set("translation",t)}setRotation(t){return this.set("rotation",t)}setScale(t){return this.set("scale",t)}getMatrix(){return Ke.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(t){let e=this.get("translation").slice(),r=this.get("rotation").slice(),i=this.get("scale").slice();return Ke.decompose(t,e,r,i),this.set("translation",e).set("rotation",r).set("scale",i)}getWorldTranslation(){let t=[0,0,0];return Ke.decompose(this.getWorldMatrix(),t,[0,0,0,1],[1,1,1]),t}getWorldRotation(){let t=[0,0,0,1];return Ke.decompose(this.getWorldMatrix(),[0,0,0],t,[1,1,1]),t}getWorldScale(){let t=[1,1,1];return Ke.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],t),t}getWorldMatrix(){let t=[];for(let i=this;i!=null;i=i.getParentNode())t.push(i);let e,r=t.pop().getMatrix();for(;e=t.pop();)zP(r,r,e.getMatrix());return r}addChild(t){let e=t.getParentNode();e&&e.removeChild(t);for(let r of t.listParents())r.propertyType==="Scene"&&r.removeChild(t);return this.addRef("children",t)}removeChild(t){return this.removeRef("children",t)}listChildren(){return this.listRefs("children")}getParentNode(){for(let t of this.listParents())if(t.propertyType==="Node")return t;return null}getMesh(){return this.getRef("mesh")}setMesh(t){return this.setRef("mesh",t)}getCamera(){return this.getRef("camera")}setCamera(t){return this.setRef("camera",t)}getSkin(){return this.getRef("skin")}setSkin(t){return this.setRef("skin",t)}getWeights(){return this.get("weights")}setWeights(t){return this.set("weights",t)}traverse(t){t(this);for(let e of this.listChildren())e.traverse(t);return this}},Ca=class wR extends It{static Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};init(){this.propertyType="Primitive";}getDefaults(){return Object.assign(super.getDefaults(),{mode:wR.Mode.TRIANGLES,material:null,indices:null,attributes:new st,targets:new Ve})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:"ELEMENT_ARRAY_BUFFER"})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:"ARRAY_BUFFER"})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}},KP=class extends dy{init(){this.propertyType="PrimitiveTarget";}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new st})}getAttribute(t){return this.getRefMap("attributes",t)}setAttribute(t,e){return this.setRefMap("attributes",t,e,{usage:"ARRAY_BUFFER"})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}},MR=class extends It{init(){this.propertyType="Scene";}getDefaults(){return Object.assign(super.getDefaults(),{children:new Ve})}copy(t,e=Tr){if(e===Tr)throw new Error("Scene cannot be copied.");return super.copy(t,e)}addChild(t){let e=t.getParentNode();return e&&e.removeChild(t),this.addRef("children",t)}removeChild(t){return this.removeRef("children",t)}listChildren(){return this.listRefs("children")}traverse(t){for(let e of this.listChildren())e.traverse(t);return this}},AR=class extends It{init(){this.propertyType="Skin";}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new Ve})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(t){return this.setRef("skeleton",t)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(t){return this.setRef("inverseBindMatrices",t,{usage:"INVERSE_BIND_MATRICES"})}addJoint(t){return this.addRef("joints",t)}removeJoint(t){return this.removeRef("joints",t)}listJoints(){return this.listRefs("joints")}},IR=class extends It{init(){this.propertyType="Texture";}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||Tn.extensionToMimeType(yi.extension(this.get("uri")))}setMimeType(t){return this.set("mimeType",t)}getURI(){return this.get("uri")}setURI(t){this.set("uri",t);let e=Tn.extensionToMimeType(yi.extension(t));return e&&this.set("mimeType",e),this}getImage(){return this.get("image")}setImage(t){return this.set("image",Me.assertView(t))}getSize(){let t=this.get("image");return t?Tn.getSize(t,this.getMimeType()):null}},fy=class extends It{_extensions=new Set;init(){this.propertyType="Root";}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${hR}`,version:"2.0"},defaultScene:null,accessors:new Ve,animations:new Ve,buffers:new Ve,cameras:new Ve,materials:new Ve,meshes:new Ve,nodes:new Ve,scenes:new Ve,skins:new Ve,textures:new Ve})}constructor(t){super(t),t.addEventListener("node:create",e=>{this._addChildOfRoot(e.target);});}clone(){throw new Error("Root cannot be cloned.")}copy(t,e=Tr){if(e===Tr)throw new Error("Root cannot be copied.");this.set("asset",{...t.get("asset")}),this.setName(t.getName()),this.setExtras({...t.getExtras()}),this.setDefaultScene(t.getDefaultScene()?e(t.getDefaultScene()):null);for(let r of t.listRefMapKeys("extensions")){let i=t.getExtension(r);this.setExtension(r,e(i));}return this}_addChildOfRoot(t){return t instanceof MR?this.addRef("scenes",t):t instanceof ER?this.addRef("nodes",t):t instanceof fh?this.addRef("cameras",t):t instanceof AR?this.addRef("skins",t):t instanceof RR?this.addRef("meshes",t):t instanceof lh?this.addRef("materials",t):t instanceof IR?this.addRef("textures",t):t instanceof yR?this.addRef("animations",t):t instanceof fe?this.addRef("accessors",t):t instanceof xR&&this.addRef("buffers",t),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter(t=>t.isRequired())}_enableExtension(t){return this._extensions.add(t),this}_disableExtension(t){return this._extensions.delete(t),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(t){return this.setRef("defaultScene",t)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}},ZP=class uy{_graph=new sy;_root=new fy(this._graph);_logger=dh.DEFAULT_INSTANCE;static _GRAPH_DOCUMENTS=new WeakMap;static fromGraph(e){return uy._GRAPH_DOCUMENTS.get(e)||null}constructor(){uy._GRAPH_DOCUMENTS.set(this._graph,this);}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(e){return this._logger=e,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(e){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...e){let r=e.map(i=>i.name);for(let i of e)await i(this,{stack:r});return this}hasExtension(e){return this.getRoot().listExtensionsUsed().some(r=>r.extensionName===e)}createExtension(e){let r=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(i=>i.extensionName===r)||new e(this)}disposeExtension(e){let r=this.getRoot().listExtensionsUsed().find(i=>i.extensionName===e);r&&r.dispose();}createScene(e=""){return new MR(this._graph,e)}createNode(e=""){return new ER(this._graph,e)}createCamera(e=""){return new fh(this._graph,e)}createSkin(e=""){return new AR(this._graph,e)}createMesh(e=""){return new RR(this._graph,e)}createPrimitive(){return new Ca(this._graph)}createPrimitiveTarget(e=""){return new KP(this._graph,e)}createMaterial(e=""){return new lh(this._graph,e)}createTexture(e=""){return new IR(this._graph,e)}createAnimation(e=""){return new yR(this._graph,e)}createAnimationChannel(e=""){return new hy(this._graph,e)}createAnimationSampler(e=""){return new hh(this._graph,e)}createAccessor(e="",r=null){return r||(r=this.getRoot().listBuffers()[0]),new fe(this._graph,e).setBuffer(r)}createBuffer(e=""){return new xR(this._graph,e)}},Le=class{static EXTENSION_NAME;extensionName="";prereadTypes=[];prewriteTypes=[];readDependencies=[];writeDependencies=[];document;required=false;properties=new Set;_listener;constructor(t){this.document=t,t.getRoot()._enableExtension(this),this._listener=r=>{let i=r,n=i.target;n instanceof Pe&&n.extensionName===this.extensionName&&(i.type==="node:create"&&this._addExtensionProperty(n),i.type==="node:dispose"&&this._removeExtensionProperty(n));};let e=t.getGraph();e.addEventListener("node:create",this._listener),e.addEventListener("node:dispose",this._listener);}dispose(){this.document.getRoot()._disableExtension(this);let t=this.document.getGraph();t.removeEventListener("node:create",this._listener),t.removeEventListener("node:dispose",this._listener);for(let e of this.properties)e.dispose();}static register(){}isRequired(){return this.required}setRequired(t){return this.required=t,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(t){return this.properties.add(t),this}_removeExtensionProperty(t){return this.properties.delete(t),this}install(t,e){return this}preread(t,e){return this}prewrite(t,e){return this}},XP=class{jsonDoc;buffers=[];bufferViews=[];bufferViewBuffers=[];accessors=[];textures=[];textureInfos=new Map;materials=[];meshes=[];cameras=[];nodes=[];skins=[];animations=[];scenes=[];constructor(t){this.jsonDoc=t;}setTextureInfo(t,e){this.textureInfos.set(t,e),e.texCoord!==void 0&&t.setTexCoord(e.texCoord),e.extras!==void 0&&t.setExtras(e.extras);let r=this.jsonDoc.json.textures[e.index];if(r.sampler===void 0)return;let i=this.jsonDoc.json.samplers[r.sampler];i.magFilter!==void 0&&t.setMagFilter(i.magFilter),i.minFilter!==void 0&&t.setMinFilter(i.minFilter),i.wrapS!==void 0&&t.setWrapS(i.wrapS),i.wrapT!==void 0&&t.setWrapT(i.wrapT);}},lR={logger:dh.DEFAULT_INSTANCE,extensions:[],dependencies:{}},JP=new Set(["Buffer","Texture","Material","Mesh","Primitive","Node","Scene"]),YP=class{static read(t,e=lR){let r={...lR,...e},{json:i}=t,n=new ZP().setLogger(r.logger);this.validate(t,r);let s=new XP(t),o=i.asset,a=n.getRoot().getAsset();o.copyright&&(a.copyright=o.copyright),o.extras&&(a.extras=o.extras),i.extras!==void 0&&n.getRoot().setExtras({...i.extras});let c=i.extensionsUsed||[],l=i.extensionsRequired||[];r.extensions.sort((h,v)=>h.EXTENSION_NAME>v.EXTENSION_NAME?1:-1);for(let h of r.extensions)if(c.includes(h.EXTENSION_NAME)){let v=n.createExtension(h).setRequired(l.includes(h.EXTENSION_NAME)),_=v.prereadTypes.filter(y=>!JP.has(y));_.length&&r.logger.warn(`Preread hooks for some types (${_.join()}), requested by extension ${v.extensionName}, are unsupported. Please file an issue or a PR.`);for(let y of v.readDependencies)v.install(y,r.dependencies[y]);}let u=i.buffers||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Buffer")).forEach(h=>h.preread(s,"Buffer")),s.buffers=u.map(h=>{let v=n.createBuffer(h.name);return h.extras&&v.setExtras(h.extras),h.uri&&h.uri.indexOf("__")!==0&&v.setURI(h.uri),v}),s.bufferViewBuffers=(i.bufferViews||[]).map((h,v)=>{if(!s.bufferViews[v]){let _=t.json.buffers[h.buffer],y=_.uri?t.resources[_.uri]:t.resources[br],R=h.byteOffset||0;s.bufferViews[v]=Me.toView(y,R,h.byteLength);}return s.buffers[h.buffer]});let d=i.accessors||[];s.accessors=d.map(h=>{let v=s.bufferViewBuffers[h.bufferView],_=n.createAccessor(h.name,v).setType(h.type);return h.extras&&_.setExtras(h.extras),h.normalized!==void 0&&_.setNormalized(h.normalized),h.bufferView===void 0||_.setArray(ah(h,s)),_});let f=i.images||[],p=i.textures||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Texture")).forEach(h=>h.preread(s,"Texture")),s.textures=f.map(h=>{let v=n.createTexture(h.name);if(h.extras&&v.setExtras(h.extras),h.bufferView!==void 0){let _=i.bufferViews[h.bufferView],y=t.json.buffers[_.buffer],R=y.uri?t.resources[y.uri]:t.resources[br],T=_.byteOffset||0,b=_.byteLength,E=R.slice(T,T+b);v.setImage(E);}else h.uri!==void 0&&(v.setImage(t.resources[h.uri]),h.uri.indexOf("__")!==0&&v.setURI(h.uri));if(h.mimeType!==void 0)v.setMimeType(h.mimeType);else if(h.uri){let _=yi.extension(h.uri);v.setMimeType(Tn.extensionToMimeType(_));}return v}),n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Material")).forEach(h=>h.preread(s,"Material")),s.materials=(i.materials||[]).map(h=>{let v=n.createMaterial(h.name);h.extras&&v.setExtras(h.extras),h.alphaMode!==void 0&&v.setAlphaMode(h.alphaMode),h.alphaCutoff!==void 0&&v.setAlphaCutoff(h.alphaCutoff),h.doubleSided!==void 0&&v.setDoubleSided(h.doubleSided);let _=h.pbrMetallicRoughness||{};if(_.baseColorFactor!==void 0&&v.setBaseColorFactor(_.baseColorFactor),h.emissiveFactor!==void 0&&v.setEmissiveFactor(h.emissiveFactor),_.metallicFactor!==void 0&&v.setMetallicFactor(_.metallicFactor),_.roughnessFactor!==void 0&&v.setRoughnessFactor(_.roughnessFactor),_.baseColorTexture!==void 0){let y=_.baseColorTexture,R=s.textures[p[y.index].source];v.setBaseColorTexture(R),s.setTextureInfo(v.getBaseColorTextureInfo(),y);}if(h.emissiveTexture!==void 0){let y=h.emissiveTexture,R=s.textures[p[y.index].source];v.setEmissiveTexture(R),s.setTextureInfo(v.getEmissiveTextureInfo(),y);}if(h.normalTexture!==void 0){let y=h.normalTexture,R=s.textures[p[y.index].source];v.setNormalTexture(R),s.setTextureInfo(v.getNormalTextureInfo(),y),h.normalTexture.scale!==void 0&&v.setNormalScale(h.normalTexture.scale);}if(h.occlusionTexture!==void 0){let y=h.occlusionTexture,R=s.textures[p[y.index].source];v.setOcclusionTexture(R),s.setTextureInfo(v.getOcclusionTextureInfo(),y),h.occlusionTexture.strength!==void 0&&v.setOcclusionStrength(h.occlusionTexture.strength);}if(_.metallicRoughnessTexture!==void 0){let y=_.metallicRoughnessTexture,R=s.textures[p[y.index].source];v.setMetallicRoughnessTexture(R),s.setTextureInfo(v.getMetallicRoughnessTextureInfo(),y);}return v}),n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Mesh")).forEach(h=>h.preread(s,"Mesh"));let g=i.meshes||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Primitive")).forEach(h=>h.preread(s,"Primitive")),s.meshes=g.map(h=>{let v=n.createMesh(h.name);return h.extras&&v.setExtras(h.extras),h.weights!==void 0&&v.setWeights(h.weights),(h.primitives||[]).forEach(_=>{let y=n.createPrimitive();_.extras&&y.setExtras(_.extras),_.material!==void 0&&y.setMaterial(s.materials[_.material]),_.mode!==void 0&&y.setMode(_.mode);for(let[T,b]of Object.entries(_.attributes||{}))y.setAttribute(T,s.accessors[b]);_.indices!==void 0&&y.setIndices(s.accessors[_.indices]);let R=h.extras&&h.extras.targetNames||[];(_.targets||[]).forEach((T,b)=>{let E=R[b]||b.toString(),M=n.createPrimitiveTarget(E);for(let[N,O]of Object.entries(T))M.setAttribute(N,s.accessors[O]);y.addTarget(M);}),v.addPrimitive(y);}),v}),s.cameras=(i.cameras||[]).map(h=>{let v=n.createCamera(h.name).setType(h.type);if(h.extras&&v.setExtras(h.extras),h.type===fh.Type.PERSPECTIVE){let _=h.perspective;v.setYFov(_.yfov),v.setZNear(_.znear),_.zfar!==void 0&&v.setZFar(_.zfar),_.aspectRatio!==void 0&&v.setAspectRatio(_.aspectRatio);}else {let _=h.orthographic;v.setZNear(_.znear).setZFar(_.zfar).setXMag(_.xmag).setYMag(_.ymag);}return v});let m=i.nodes||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Node")).forEach(h=>h.preread(s,"Node")),s.nodes=m.map(h=>{let v=n.createNode(h.name);if(h.extras&&v.setExtras(h.extras),h.translation!==void 0&&v.setTranslation(h.translation),h.rotation!==void 0&&v.setRotation(h.rotation),h.scale!==void 0&&v.setScale(h.scale),h.matrix!==void 0){let _=[0,0,0],y=[0,0,0,1],R=[1,1,1];Ke.decompose(h.matrix,_,y,R),v.setTranslation(_),v.setRotation(y),v.setScale(R);}return h.weights!==void 0&&v.setWeights(h.weights),v}),s.skins=(i.skins||[]).map(h=>{let v=n.createSkin(h.name);h.extras&&v.setExtras(h.extras),h.inverseBindMatrices!==void 0&&v.setInverseBindMatrices(s.accessors[h.inverseBindMatrices]),h.skeleton!==void 0&&v.setSkeleton(s.nodes[h.skeleton]);for(let _ of h.joints)v.addJoint(s.nodes[_]);return v}),m.map((h,v)=>{let _=s.nodes[v];(h.children||[]).forEach(y=>_.addChild(s.nodes[y])),h.mesh!==void 0&&_.setMesh(s.meshes[h.mesh]),h.camera!==void 0&&_.setCamera(s.cameras[h.camera]),h.skin!==void 0&&_.setSkin(s.skins[h.skin]);}),s.animations=(i.animations||[]).map(h=>{let v=n.createAnimation(h.name);h.extras&&v.setExtras(h.extras);let _=(h.samplers||[]).map(y=>{let R=n.createAnimationSampler().setInput(s.accessors[y.input]).setOutput(s.accessors[y.output]).setInterpolation(y.interpolation||hh.Interpolation.LINEAR);return y.extras&&R.setExtras(y.extras),v.addSampler(R),R});return (h.channels||[]).forEach(y=>{let R=n.createAnimationChannel().setSampler(_[y.sampler]).setTargetPath(y.target.path);y.target.node!==void 0&&R.setTargetNode(s.nodes[y.target.node]),y.extras&&R.setExtras(y.extras),v.addChannel(R);}),v});let S=i.scenes||[];return n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Scene")).forEach(h=>h.preread(s,"Scene")),s.scenes=S.map(h=>{let v=n.createScene(h.name);return h.extras&&v.setExtras(h.extras),(h.nodes||[]).map(_=>s.nodes[_]).forEach(_=>v.addChild(_)),v}),i.scene!==void 0&&n.getRoot().setDefaultScene(s.scenes[i.scene]),n.getRoot().listExtensionsUsed().forEach(h=>h.read(s)),d.forEach((h,v)=>{let _=s.accessors[v],y=!!h.sparse,R=!h.bufferView&&!_.getArray();(y||R)&&_.setSparse(true).setArray(eN(h,s));}),n}static validate(t,e){let r=t.json;if(r.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${r.asset.version}".`);if(r.extensionsRequired){for(let i of r.extensionsRequired)if(!e.extensions.find(n=>n.EXTENSION_NAME===i))throw new Error(`Missing required extension, "${i}".`)}if(r.extensionsUsed)for(let i of r.extensionsUsed)e.extensions.find(n=>n.EXTENSION_NAME===i)||e.logger.warn(`Missing optional extension, "${i}".`);}};function QP(t,e){let r=e.jsonDoc,i=e.bufferViews[t.bufferView],n=r.json.bufferViews[t.bufferView],s=uh[t.componentType],o=fe.getElementSize(t.type),a=s.BYTES_PER_ELEMENT,c=t.byteOffset||0,l=new s(t.count*o),u=new DataView(i.buffer,i.byteOffset,i.byteLength),d=n.byteStride;for(let f=0;f<t.count;f++)for(let p=0;p<o;p++){let g=c+f*d+p*a,m;switch(t.componentType){case fe.ComponentType.FLOAT:m=u.getFloat32(g,true);break;case fe.ComponentType.UNSIGNED_INT:m=u.getUint32(g,true);break;case fe.ComponentType.UNSIGNED_SHORT:m=u.getUint16(g,true);break;case fe.ComponentType.UNSIGNED_BYTE:m=u.getUint8(g);break;case fe.ComponentType.SHORT:m=u.getInt16(g,true);break;case fe.ComponentType.BYTE:m=u.getInt8(g);break;case fe.ComponentType.FLOAT16:m=u.getFloat16(g,true);break;case fe.ComponentType.FLOAT64:m=u.getFloat64(g,true);break;default:throw new Error(`Unexpected componentType "${t.componentType}".`)}l[f*o+p]=m;}return l}function ah(t,e){let r=e.jsonDoc,i=e.bufferViews[t.bufferView],n=r.json.bufferViews[t.bufferView],s=uh[t.componentType],o=fe.getElementSize(t.type),a=s.BYTES_PER_ELEMENT,c=o*a;if(n.byteStride!==void 0&&n.byteStride!==c)return QP(t,e);let l=i.byteOffset+(t.byteOffset||0),u=t.count*o*a;return new s(i.buffer.slice(l,l+u))}function eN(t,e){let r=uh[t.componentType],i=fe.getElementSize(t.type),n;t.bufferView!==void 0?n=ah(t,e):n=new r(t.count*i);let s=t.sparse;if(!s)return n;let o=s.count,a={...t,...s.indices,count:o,type:"SCALAR"},c={...t,...s.values,count:o},l=ah(a,e),u=ah(c,e);for(let d=0;d<a.count;d++)for(let f=0;f<i;f++)n[l[d]*i+f]=u[d*i+f];return n}var CR=(function(t){return t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t})(CR||{}),xr=class{_doc;jsonDoc;options;static BufferViewTarget=CR;static BufferViewUsage=RP;static USAGE_TO_TARGET={ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963};accessorIndexMap=new Map;animationIndexMap=new Map;bufferIndexMap=new Map;cameraIndexMap=new Map;skinIndexMap=new Map;materialIndexMap=new Map;meshIndexMap=new Map;nodeIndexMap=new Map;imageIndexMap=new Map;textureDefIndexMap=new Map;textureInfoDefMap=new Map;samplerDefIndexMap=new Map;sceneIndexMap=new Map;imageBufferViews=[];otherBufferViews=new Map;otherBufferViewsIndexMap=new Map;extensionData={};bufferURIGenerator;imageURIGenerator;logger;_accessorUsageMap=new Map;accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]);accessorParents=new Map;constructor(t,e,r){this._doc=t,this.jsonDoc=e,this.options=r;let i=t.getRoot(),n=i.listBuffers().length,s=i.listTextures().length;this.bufferURIGenerator=new uR(n>1,()=>r.basename||"buffer"),this.imageURIGenerator=new uR(s>1,o=>tN(t,o)||r.basename||"texture"),this.logger=t.getLogger();}createTextureInfoDef(t,e){let r={magFilter:e.getMagFilter()||void 0,minFilter:e.getMinFilter()||void 0,wrapS:e.getWrapS(),wrapT:e.getWrapT()},i=JSON.stringify(r);this.samplerDefIndexMap.has(i)||(this.samplerDefIndexMap.set(i,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(r));let n={source:this.imageIndexMap.get(t),sampler:this.samplerDefIndexMap.get(i)},s=JSON.stringify(n);this.textureDefIndexMap.has(s)||(this.textureDefIndexMap.set(s,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(n));let o={index:this.textureDefIndexMap.get(s)};return e.getTexCoord()!==0&&(o.texCoord=e.getTexCoord()),Object.keys(e.getExtras()).length>0&&(o.extras=e.getExtras()),this.textureInfoDefMap.set(e,o),o}createPropertyDef(t){let e={};return t.getName()&&(e.name=t.getName()),Object.keys(t.getExtras()).length>0&&(e.extras=t.getExtras()),e}createAccessorDef(t){let e=this.createPropertyDef(t);return e.type=t.getType(),e.componentType=t.getComponentType(),e.count=t.getCount(),this._doc.getGraph().listParentEdges(t).some(r=>r.getName()==="attributes"&&r.getAttributes().key==="POSITION"||r.getName()==="input")&&(e.max=t.getMax([]).map(Math.fround),e.min=t.getMin([]).map(Math.fround)),t.getNormalized()&&(e.normalized=t.getNormalized()),e}createImageData(t,e,r){if(this.options.format==="GLB")this.imageBufferViews.push(e),t.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:e.byteLength});else {let i=Tn.mimeTypeToExtension(r.getMimeType());t.uri=this.imageURIGenerator.createURI(r,i),this.assignResourceURI(t.uri,e,false);}}assignResourceURI(t,e,r){let i=this.jsonDoc.resources;if(!(t in i)){i[t]=e;return}if(e===i[t]){this.logger.warn(`Duplicate resource URI, "${t}".`);return}let n=`Resource URI "${t}" already assigned to different data.`;if(!r){this.logger.warn(n);return}throw new Error(n)}getAccessorUsage(t){let e=this._accessorUsageMap.get(t);if(e)return e;if(t.getSparse())return "SPARSE";for(let r of this._doc.getGraph().listParentEdges(t)){let{usage:i}=r.getAttributes();if(i)return i;r.getParent().propertyType!=="Root"&&this.logger.warn(`Missing attribute ".usage" on edge, "${r.getName()}".`);}return "OTHER"}addAccessorToUsageGroup(t,e){let r=this._accessorUsageMap.get(t);if(r&&r!==e)throw new Error(`Accessor with usage "${r}" cannot be reused as "${e}".`);return this._accessorUsageMap.set(t,e),this}},uR=class{multiple;basename;counter={};constructor(t,e){this.multiple=t,this.basename=e;}createURI(t,e){if(t.getURI())return t.getURI();if(this.multiple){let r=this.basename(t);return this.counter[r]=this.counter[r]||1,`${r}_${this.counter[r]++}.${e}`}else return `${this.basename(t)}.${e}`}};function tN(t,e){let r=t.getGraph().listParentEdges(e).find(i=>i.getParent()!==t.getRoot());return r?r.getName().replace(/texture$/i,""):""}var{BufferViewUsage:oh}=xr,{UNSIGNED_INT:nN,UNSIGNED_SHORT:rN,UNSIGNED_BYTE:iN}=fe.ComponentType,sN=new Set(["Accessor","Buffer","Material","Mesh"]),oN=class{static write(t,e){let r=t.getGraph(),i=t.getRoot(),n={asset:{generator:`glTF-Transform ${hR}`,...i.getAsset()},extras:{...i.getExtras()}},s={json:n,resources:{}},o=new xr(t,s,e),a=e.logger||dh.DEFAULT_INSTANCE,c=new Set(e.extensions.map(m=>m.EXTENSION_NAME)),l=t.getRoot().listExtensionsUsed().filter(m=>c.has(m.extensionName)).sort((m,S)=>m.extensionName>S.extensionName?1:-1),u=t.getRoot().listExtensionsRequired().filter(m=>c.has(m.extensionName)).sort((m,S)=>m.extensionName>S.extensionName?1:-1);l.length<t.getRoot().listExtensionsUsed().length&&a.warn("Some extensions were not registered for I/O, and will not be written.");for(let m of l){let S=m.prewriteTypes.filter(h=>!sN.has(h));S.length&&a.warn(`Prewrite hooks for some types (${S.join()}), requested by extension ${m.extensionName}, are unsupported. Please file an issue or a PR.`);for(let h of m.writeDependencies)m.install(h,e.dependencies[h]);}function d(m,S,h,v){let _=[],y=0;for(let T of m){let b=o.createAccessorDef(T);b.bufferView=n.bufferViews.length;let E=T.getArray(),M=Me.pad(Me.toView(E));b.byteOffset=y,y+=M.byteLength,_.push(M),o.accessorIndexMap.set(T,n.accessors.length),n.accessors.push(b);}let R={buffer:S,byteOffset:h,byteLength:Me.concat(_).byteLength};return v&&(R.target=v),n.bufferViews.push(R),{buffers:_,byteLength:y}}function f(m,S,h){let v=m[0].getCount(),_=0;for(let E of m){let M=o.createAccessorDef(E);M.bufferView=n.bufferViews.length,M.byteOffset=_;let N=E.getElementSize(),O=E.getComponentSize();_+=Me.padNumber(N*O),o.accessorIndexMap.set(E,n.accessors.length),n.accessors.push(M);}let y=v*_,R=new ArrayBuffer(y),T=new DataView(R);for(let E=0;E<v;E++){let M=0;for(let N of m){let O=N.getElementSize(),k=N.getComponentSize(),j=N.getComponentType(),G=N.getArray();for(let Q=0;Q<O;Q++){let Se=E*_+M+Q*k,ye=G[E*O+Q];switch(j){case fe.ComponentType.FLOAT:T.setFloat32(Se,ye,true);break;case fe.ComponentType.BYTE:T.setInt8(Se,ye);break;case fe.ComponentType.SHORT:T.setInt16(Se,ye,true);break;case fe.ComponentType.UNSIGNED_BYTE:T.setUint8(Se,ye);break;case fe.ComponentType.UNSIGNED_SHORT:T.setUint16(Se,ye,true);break;case fe.ComponentType.UNSIGNED_INT:T.setUint32(Se,ye,true);break;case fe.ComponentType.FLOAT16:T.setFloat16(Se,ye,true);break;case fe.ComponentType.FLOAT64:T.setFloat64(Se,ye,true);break;default:throw new Error("Unexpected component type: "+j)}}M+=Me.padNumber(O*k);}}let b={buffer:S,byteOffset:h,byteLength:y,byteStride:_,target:xr.BufferViewTarget.ARRAY_BUFFER};return n.bufferViews.push(b),{byteLength:y,buffers:[new Uint8Array(R)]}}function p(m,S,h){let v=[],_=0,y=new Map,R=-1/0,T=false;for(let j of m){let G=o.createAccessorDef(j);n.accessors.push(G),o.accessorIndexMap.set(j,n.accessors.length-1);let Q=[],Se=[],ye=[],Fe=new Array(j.getElementSize()).fill(0);for(let q=0,w=j.getCount();q<w;q++)if(j.getElement(q,ye),!Ke.eq(ye,Fe,0)){R=Math.max(q,R),Q.push(q);for(let C=0;C<ye.length;C++)Se.push(ye[C]);}let ve=Q.length,P={accessorDef:G,count:ve};if(y.set(j,P),ve===0)continue;ve>j.getCount()/2&&(T=true);let U=uh[j.getComponentType()];P.indices=Q,P.values=new U(Se);}if(!Number.isFinite(R))return {buffers:v,byteLength:_};T&&a.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");let b=R<255?Uint8Array:R<65535?Uint16Array:Uint32Array,E=R<255?iN:R<65535?rN:nN,M={buffer:S,byteOffset:h+_,byteLength:0};for(let j of m){let G=y.get(j);if(G.count===0)continue;G.indicesByteOffset=M.byteLength;let Q=Me.pad(Me.toView(new b(G.indices)));v.push(Q),_+=Q.byteLength,M.byteLength+=Q.byteLength;}n.bufferViews.push(M);let N=n.bufferViews.length-1,O={buffer:S,byteOffset:h+_,byteLength:0};for(let j of m){let G=y.get(j);if(G.count===0)continue;G.valuesByteOffset=O.byteLength;let Q=Me.pad(Me.toView(G.values));v.push(Q),_+=Q.byteLength,O.byteLength+=Q.byteLength;}n.bufferViews.push(O);let k=n.bufferViews.length-1;for(let j of m){let G=y.get(j);G.count!==0&&(G.accessorDef.sparse={count:G.count,indices:{bufferView:N,byteOffset:G.indicesByteOffset,componentType:E},values:{bufferView:k,byteOffset:G.valuesByteOffset}});}return {buffers:v,byteLength:_}}if(n.accessors=[],n.bufferViews=[],n.samplers=[],n.textures=[],n.images=i.listTextures().map((m,S)=>{let h=o.createPropertyDef(m);m.getMimeType()&&(h.mimeType=m.getMimeType());let v=m.getImage();return v&&o.createImageData(h,v,m),o.imageIndexMap.set(m,S),h}),l.filter(m=>m.prewriteTypes.includes("Accessor")).forEach(m=>m.prewrite(o,"Accessor")),i.listAccessors().forEach(m=>{let S=o.accessorUsageGroupedByParent,h=o.accessorParents;if(o.accessorIndexMap.has(m))return;let v=o.getAccessorUsage(m);if(o.addAccessorToUsageGroup(m,v),S.has(v)){let _=r.listParents(m).find(y=>y.propertyType!=="Root");h.set(m,_);}}),l.filter(m=>m.prewriteTypes.includes("Buffer")).forEach(m=>m.prewrite(o,"Buffer")),(i.listAccessors().length>0||o.otherBufferViews.size>0||i.listTextures().length>0&&e.format==="GLB")&&i.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");n.buffers=[],i.listBuffers().forEach((m,S)=>{let h=o.createPropertyDef(m),v=o.accessorUsageGroupedByParent,_=m.listParents().filter(N=>N instanceof fe),y=new Set(_.map(N=>o.accessorParents.get(N))),R=new Map(Array.from(y).map((N,O)=>[N,O])),T={};for(let N of _){if(o.accessorIndexMap.has(N))continue;let O=o.getAccessorUsage(N),k=O;if(v.has(O)){let j=o.accessorParents.get(N);k+=`:${R.get(j)}`;}T[k]||={usage:O,accessors:[]},T[k].accessors.push(N);}let b=[],E=n.buffers.length,M=0;for(let{usage:N,accessors:O}of Object.values(T))if(N===oh.ARRAY_BUFFER&&e.vertexLayout==="interleaved"){let k=f(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}else if(N===oh.ARRAY_BUFFER)for(let k of O){let j=f([k],E,M);M+=j.byteLength;for(let G of j.buffers)b.push(G);}else if(N===oh.SPARSE){let k=p(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}else if(N===oh.ELEMENT_ARRAY_BUFFER){let k=xr.BufferViewTarget.ELEMENT_ARRAY_BUFFER,j=d(O,E,M,k);M+=j.byteLength;for(let G of j.buffers)b.push(G);}else {let k=d(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}if(o.imageBufferViews.length&&S===0){for(let N=0;N<o.imageBufferViews.length;N++)if(n.bufferViews[n.images[N].bufferView].byteOffset=M,M+=o.imageBufferViews[N].byteLength,b.push(o.imageBufferViews[N]),M%8){let O=8-M%8;M+=O,b.push(new Uint8Array(O));}}if(o.otherBufferViews.has(m))for(let N of o.otherBufferViews.get(m))n.bufferViews.push({buffer:E,byteOffset:M,byteLength:N.byteLength}),o.otherBufferViewsIndexMap.set(N,n.bufferViews.length-1),M+=N.byteLength,b.push(N);if(M){let N;e.format==="GLB"?N=br:(N=o.bufferURIGenerator.createURI(m,"bin"),h.uri=N),h.byteLength=M,o.assignResourceURI(N,Me.concat(b),true);}n.buffers.push(h),o.bufferIndexMap.set(m,S);}),i.listAccessors().find(m=>!m.getBuffer())&&a.warn("Skipped writing one or more Accessors: no Buffer assigned."),l.filter(m=>m.prewriteTypes.includes("Material")).forEach(m=>m.prewrite(o,"Material")),n.materials=i.listMaterials().map((m,S)=>{let h=o.createPropertyDef(m);if(m.getAlphaMode()!==lh.AlphaMode.OPAQUE&&(h.alphaMode=m.getAlphaMode()),m.getAlphaMode()===lh.AlphaMode.MASK&&(h.alphaCutoff=m.getAlphaCutoff()),m.getDoubleSided()&&(h.doubleSided=true),h.pbrMetallicRoughness={},Ke.eq(m.getBaseColorFactor(),[1,1,1,1])||(h.pbrMetallicRoughness.baseColorFactor=m.getBaseColorFactor()),Ke.eq(m.getEmissiveFactor(),[0,0,0])||(h.emissiveFactor=m.getEmissiveFactor()),m.getRoughnessFactor()!==1&&(h.pbrMetallicRoughness.roughnessFactor=m.getRoughnessFactor()),m.getMetallicFactor()!==1&&(h.pbrMetallicRoughness.metallicFactor=m.getMetallicFactor()),m.getBaseColorTexture()){let v=m.getBaseColorTexture(),_=m.getBaseColorTextureInfo();h.pbrMetallicRoughness.baseColorTexture=o.createTextureInfoDef(v,_);}if(m.getEmissiveTexture()){let v=m.getEmissiveTexture(),_=m.getEmissiveTextureInfo();h.emissiveTexture=o.createTextureInfoDef(v,_);}if(m.getNormalTexture()){let v=m.getNormalTexture(),_=m.getNormalTextureInfo(),y=o.createTextureInfoDef(v,_);m.getNormalScale()!==1&&(y.scale=m.getNormalScale()),h.normalTexture=y;}if(m.getOcclusionTexture()){let v=m.getOcclusionTexture(),_=m.getOcclusionTextureInfo(),y=o.createTextureInfoDef(v,_);m.getOcclusionStrength()!==1&&(y.strength=m.getOcclusionStrength()),h.occlusionTexture=y;}if(m.getMetallicRoughnessTexture()){let v=m.getMetallicRoughnessTexture(),_=m.getMetallicRoughnessTextureInfo();h.pbrMetallicRoughness.metallicRoughnessTexture=o.createTextureInfoDef(v,_);}return o.materialIndexMap.set(m,S),h}),l.filter(m=>m.prewriteTypes.includes("Mesh")).forEach(m=>m.prewrite(o,"Mesh")),n.meshes=i.listMeshes().map((m,S)=>{let h=o.createPropertyDef(m),v=null;return h.primitives=m.listPrimitives().map(_=>{let y={attributes:{}};y.mode=_.getMode();let R=_.getMaterial();R&&(y.material=o.materialIndexMap.get(R)),Object.keys(_.getExtras()).length&&(y.extras=_.getExtras());let T=_.getIndices();T&&(y.indices=o.accessorIndexMap.get(T));for(let b of _.listSemantics())y.attributes[b]=o.accessorIndexMap.get(_.getAttribute(b));for(let b of _.listTargets()){let E={};for(let M of b.listSemantics())E[M]=o.accessorIndexMap.get(b.getAttribute(M));y.targets=y.targets||[],y.targets.push(E);}return _.listTargets().length&&!v&&(v=_.listTargets().map(b=>b.getName())),y}),m.getWeights().length&&(h.weights=m.getWeights()),v&&(h.extras=h.extras||{},h.extras.targetNames=v),o.meshIndexMap.set(m,S),h}),n.cameras=i.listCameras().map((m,S)=>{let h=o.createPropertyDef(m);if(h.type=m.getType(),h.type===fh.Type.PERSPECTIVE){h.perspective={znear:m.getZNear(),zfar:m.getZFar(),yfov:m.getYFov()};let v=m.getAspectRatio();v!==null&&(h.perspective.aspectRatio=v);}else h.orthographic={znear:m.getZNear(),zfar:m.getZFar(),xmag:m.getXMag(),ymag:m.getYMag()};return o.cameraIndexMap.set(m,S),h}),n.nodes=i.listNodes().map((m,S)=>{let h=o.createPropertyDef(m);return Ke.eq(m.getTranslation(),[0,0,0])||(h.translation=m.getTranslation()),Ke.eq(m.getRotation(),[0,0,0,1])||(h.rotation=m.getRotation()),Ke.eq(m.getScale(),[1,1,1])||(h.scale=m.getScale()),m.getWeights().length&&(h.weights=m.getWeights()),o.nodeIndexMap.set(m,S),h}),n.skins=i.listSkins().map((m,S)=>{let h=o.createPropertyDef(m),v=m.getInverseBindMatrices();v&&(h.inverseBindMatrices=o.accessorIndexMap.get(v));let _=m.getSkeleton();return _&&(h.skeleton=o.nodeIndexMap.get(_)),h.joints=m.listJoints().map(y=>o.nodeIndexMap.get(y)),o.skinIndexMap.set(m,S),h}),i.listNodes().forEach((m,S)=>{let h=n.nodes[S],v=m.getMesh();v&&(h.mesh=o.meshIndexMap.get(v));let _=m.getCamera();_&&(h.camera=o.cameraIndexMap.get(_));let y=m.getSkin();y&&(h.skin=o.skinIndexMap.get(y)),m.listChildren().length>0&&(h.children=m.listChildren().map(R=>o.nodeIndexMap.get(R)));}),n.animations=i.listAnimations().map((m,S)=>{let h=o.createPropertyDef(m),v=new Map;return h.samplers=m.listSamplers().map((_,y)=>{let R=o.createPropertyDef(_);return R.input=o.accessorIndexMap.get(_.getInput()),R.output=o.accessorIndexMap.get(_.getOutput()),R.interpolation=_.getInterpolation(),v.set(_,y),R}),h.channels=m.listChannels().map(_=>{let y=o.createPropertyDef(_);return y.sampler=v.get(_.getSampler()),y.target={node:o.nodeIndexMap.get(_.getTargetNode()),path:_.getTargetPath()},y}),o.animationIndexMap.set(m,S),h}),n.scenes=i.listScenes().map((m,S)=>{let h=o.createPropertyDef(m);return h.nodes=m.listChildren().map(v=>o.nodeIndexMap.get(v)),o.sceneIndexMap.set(m,S),h});let g=i.getDefaultScene();return g&&(n.scene=i.listScenes().indexOf(g)),n.extensionsUsed=l.map(m=>m.extensionName),n.extensionsRequired=u.map(m=>m.extensionName),l.forEach(m=>m.write(o)),aN(n),s}};function aN(t){let e=[];for(let r in t){let i=t[r];(Array.isArray(i)&&i.length===0||i===null||i===""||i&&typeof i=="object"&&Object.keys(i).length===0)&&e.push(r);}for(let r of e)delete t[r];}var cN=class{_logger=dh.DEFAULT_INSTANCE;_extensions=new Set;_dependencies={};_vertexLayout="interleaved";_strictResources=true;lastReadBytes=0;lastWriteBytes=0;setLogger(t){return this._logger=t,this}registerExtensions(t){for(let e of t)this._extensions.add(e),e.register();return this}registerDependencies(t){return Object.assign(this._dependencies,t),this}setVertexLayout(t){return this._vertexLayout=t,this}setStrictResources(t){return this._strictResources=t,this}async read(t){return await this.readJSON(await this.readAsJSON(t))}async readAsJSON(t){let e=await this.readURI(t,"view");this.lastReadBytes=e.byteLength;let r=dR(e)?this._binaryToJSON(e):{json:JSON.parse(Me.decodeText(e)),resources:{}};return await this._readResourcesExternal(r,this.dirname(t)),this._readResourcesInternal(r),r}async readJSON(t){return t=this._copyJSON(t),this._readResourcesInternal(t),YP.read(t,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(t){let e=this._binaryToJSON(Me.assertView(t));this._readResourcesInternal(e);let r=e.json;if(r.buffers&&r.buffers.some(i=>lN(e,i)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(r.images&&r.images.some(i=>uN(e,i)))throw new Error("Cannot resolve external images with binaryToJSON().");return e}async readBinary(t){return this.readJSON(await this.binaryToJSON(Me.assertView(t)))}async writeJSON(t,e={}){if(e.format==="GLB"&&t.getRoot().listBuffers().length>1)throw new Error("GLB must have 0\u20131 buffers.");return oN.write(t,{format:e.format||"GLTF",basename:e.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:{...this._dependencies},extensions:Array.from(this._extensions)})}async writeBinary(t){let{json:e,resources:r}=await this.writeJSON(t,{format:"GLB"}),i=new Uint32Array([1179937895,2,12]),n=JSON.stringify(e),s=Me.pad(Me.encodeText(n),32),o=Me.toView(new Uint32Array([s.byteLength,1313821514])),a=Me.concat([o,s]);i[i.length-1]+=a.byteLength;let c=Object.values(r)[0];if(!c||!c.byteLength)return Me.concat([Me.toView(i),a]);let l=Me.pad(c,0),u=Me.toView(new Uint32Array([l.byteLength,5130562])),d=Me.concat([u,l]);return i[i.length-1]+=d.byteLength,Me.concat([Me.toView(i),a,d])}async _readResourcesExternal(t,e){let r=t.json.images||[],i=t.json.buffers||[],n=[...r,...i].map(async s=>{let o=s.uri;if(!o||o.match(/data:/))return Promise.resolve();try{t.resources[o]=await this.readURI(this.resolve(e,o),"view"),this.lastReadBytes+=t.resources[o].byteLength;}catch(a){if(!this._strictResources&&r.includes(s))this._logger.warn(`Failed to load image URI, "${o}". ${a}`),t.resources[o]=null;else throw a}});await Promise.all(n);}_readResourcesInternal(t){function e(r){if(r.uri){if(r.uri in t.resources){Me.assertView(t.resources[r.uri]);return}if(r.uri.match(/data:/)){let i=`__${GP()}.${yi.extension(r.uri)}`;t.resources[i]=Me.createBufferFromDataURI(r.uri),r.uri=i;}}}(t.json.images||[]).forEach(r=>{if(r.bufferView===void 0&&r.uri===void 0)throw new Error("Missing resource URI or buffer view.");e(r);}),(t.json.buffers||[]).forEach(e);}_copyJSON(t){let{images:e,buffers:r}=t.json;return t={json:{...t.json},resources:{...t.resources}},e&&(t.json.images=e.map(i=>({...i}))),r&&(t.json.buffers=r.map(i=>({...i}))),t}_binaryToJSON(t){if(!dR(t))throw new Error("Invalid glTF 2.0 binary.");let e=new Uint32Array(t.buffer,t.byteOffset+12,2);if(e[1]!==1313821514)throw new Error("Missing required GLB JSON chunk.");let r=20,i=e[0],n=Me.decodeText(Me.toView(t,r,i)),s=JSON.parse(n),o=r+i;if(t.byteLength<=o)return {json:s,resources:{}};let a=new Uint32Array(t.buffer,t.byteOffset+o,2);if(a[1]!==5130562)return {json:s,resources:{}};let c=a[0],l=Me.toView(t,o+8,c);return {json:s,resources:{[br]:l}}}};function lN(t,e){return e.uri!==void 0&&!(e.uri in t.resources)}function uN(t,e){return e.uri!==void 0&&!(e.uri in t.resources)&&e.bufferView===void 0}function dR(t){if(t.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return false;let e=new Uint32Array(t.buffer,t.byteOffset,3);return e[0]===1179937895&&e[1]===2}var Jt=class extends cN{_fetch;_fetchConfig;_init;_fetchEnabled=false;constructor(t=null,e=Ln.DEFAULT_INIT){super(),this._fetch=t,this._fetchConfig=e,this._init=this.init();}async init(){return this._init?this._init:Promise.all([import('fs'),import('path')]).then(([t,e])=>{this._fs=t.promises,this._path=e;})}setAllowNetwork(t){if(t&&!this._fetch)throw new Error("NodeIO requires a Fetch API implementation for HTTP requests.");return this._fetchEnabled=t,this}async readURI(t,e){if(await this.init(),Ln.isAbsoluteURL(t)){if(!this._fetchEnabled||!this._fetch)throw new Error("Network request blocked. Allow HTTP requests explicitly, if needed.");let r=await this._fetch(t,this._fetchConfig);switch(e){case "view":return new Uint8Array(await r.arrayBuffer());case "text":return r.text()}}else switch(e){case "view":return this._fs.readFile(t);case "text":return this._fs.readFile(t,"utf8")}}resolve(t,e){return Ln.isAbsoluteURL(t)||Ln.isAbsoluteURL(e)?Ln.resolve(t,e):this._path.resolve(t,decodeURIComponent(e))}dirname(t){return Ln.isAbsoluteURL(t)?Ln.dirname(t):this._path.dirname(t)}async write(t,e){await this.init(),await(t.match(/\.glb$/)?this._writeGLB(t,e):this._writeGLTF(t,e));}async _writeGLTF(t,e){this.lastWriteBytes=0;let{json:r,resources:i}=await this.writeJSON(e,{format:"GLTF",basename:yi.basename(t)}),{_fs:n,_path:s}=this,o=s.dirname(t),a=JSON.stringify(r,null,2);await n.writeFile(t,a),this.lastWriteBytes+=a.length;for(let c of dN(Object.keys(i),10))await Promise.all(c.map(async l=>{if(Ln.isAbsoluteURL(l)){if(Ln.extension(l)==="bin")throw new Error(`Cannot write buffer to path "${l}".`);return}let u=s.join(o,decodeURIComponent(l));await n.mkdir(s.dirname(u),{recursive:true}),await n.writeFile(u,i[l]),this.lastWriteBytes+=i[l].byteLength;}));}async _writeGLB(t,e){let r=await this.writeBinary(e);await this._fs.writeFile(t,r),this.lastWriteBytes=r.byteLength;}};function dN(t,e){let r=[];for(let i=0,n=t.length;i<n;i+=e){let s=[];for(let o=0;o<e&&i+o<n;o++)s.push(t[i+o]);r.push(s);}return r}function hN(){return {vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}var Si=class{constructor(e,r,i,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,i),this._littleEndian=n,this._offset=0;}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),i=e+2**32*r;return this._offset+=8,i}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let i=this._offset,n=0;for(;this._dataView.getUint8(this._offset)!==r&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,n)}};var Ct=[171,75,84,88,32,50,48,187,13,10,26,10];function PR(t){return new TextDecoder().decode(t)}function ph(t){let e=new Uint8Array(t.buffer,t.byteOffset,Ct.length);if(e[0]!==Ct[0]||e[1]!==Ct[1]||e[2]!==Ct[2]||e[3]!==Ct[3]||e[4]!==Ct[4]||e[5]!==Ct[5]||e[6]!==Ct[6]||e[7]!==Ct[7]||e[8]!==Ct[8]||e[9]!==Ct[9]||e[10]!==Ct[10]||e[11]!==Ct[11])throw new Error("Missing KTX 2.0 identifier.");let r=hN(),i=17*Uint32Array.BYTES_PER_ELEMENT,n=new Si(t,Ct.length,i,true);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32(),r.levelCount=n._nextUint32(),r.supercompressionScheme=n._nextUint32();let s=n._nextUint32(),o=n._nextUint32(),a=n._nextUint32(),c=n._nextUint32(),l=n._nextUint64(),u=n._nextUint64(),d=Math.max(r.levelCount,1)*3*8,f=new Si(t,Ct.length+i,d,true);for(let Ie=0,je=Math.max(r.levelCount,1);Ie<je;Ie++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});let p=new Si(t,s,o,true);p._skip(4);let g=p._nextUint16(),m=p._nextUint16(),S=p._nextUint16(),h=p._nextUint16(),v=p._nextUint8(),_=p._nextUint8(),y=p._nextUint8(),R=p._nextUint8(),T=[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],b=[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],M={vendorId:g,descriptorType:m,versionNumber:S,colorModel:v,colorPrimaries:_,transferFunction:y,flags:R,texelBlockDimension:T,bytesPlane:b,samples:[]},k=(h/4-6)/4;for(let Ie=0;Ie<k;Ie++){let je={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};je.channelType&64?(je.sampleLower=p._nextInt32(),je.sampleUpper=p._nextInt32()):(je.sampleLower=p._nextUint32(),je.sampleUpper=p._nextUint32()),M.samples[Ie]=je;}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(M);let j=new Si(t,a,c,true);for(;j._offset<c;){let Ie=j._nextUint32(),je=j._scan(Ie),A=PR(je);if(r.keyValue[A]=j._nextUint8Array(Ie-je.byteLength-1),A.match(/^ktx/i)){let H=PR(r.keyValue[A]);r.keyValue[A]=H.substring(0,H.lastIndexOf("\0"));}let V=Ie%4?4-Ie%4:0;j._skip(V);}if(u<=0)return r;let G=new Si(t,l,u,true),Q=G._nextUint16(),Se=G._nextUint16(),ye=G._nextUint32(),Fe=G._nextUint32(),ve=G._nextUint32(),P=G._nextUint32(),U=[];for(let Ie=0,je=Math.max(r.levelCount,1);Ie<je;Ie++)U.push({imageFlags:G._nextUint32(),rgbSliceByteOffset:G._nextUint32(),rgbSliceByteLength:G._nextUint32(),alphaSliceByteOffset:G._nextUint32(),alphaSliceByteLength:G._nextUint32()});let q=l+G._offset,w=q+ye,C=w+Fe,L=C+ve,ee=new Uint8Array(t.buffer,t.byteOffset+q,ye),ue=new Uint8Array(t.buffer,t.byteOffset+w,Fe),Ee=new Uint8Array(t.buffer,t.byteOffset+C,ve),pe=new Uint8Array(t.buffer,t.byteOffset+L,P);return r.globalData={endpointCount:Q,selectorCount:Se,imageDescs:U,endpointsData:ee,selectorsData:ue,tablesData:Ee,extendedData:pe},r}var Rr="EXT_mesh_gpu_instancing",Fn="EXT_mesh_features",Lt="EXT_meshopt_compression",be="EXT_structural_metadata",mh="EXT_texture_webp",gh="EXT_texture_avif",vN="KHR_accessor_float16",yN="KHR_accessor_float64",tt="KHR_draco_mesh_compression",Un="KHR_lights_punctual",Er="KHR_materials_anisotropy",wr="KHR_materials_clearcoat",Mr="KHR_materials_diffuse_transmission",Ar="KHR_materials_dispersion",Ir="KHR_materials_emissive_strength",Cr="KHR_materials_ior",Pr="KHR_materials_iridescence",Nr="KHR_materials_pbrSpecularGlossiness",Or="KHR_materials_sheen",zr="KHR_materials_specular",$r="KHR_materials_transmission",Is="KHR_materials_unlit",kr="KHR_materials_volume",Gt="KHR_materials_variants",NR="KHR_mesh_primitive_restart",OR="KHR_mesh_quantization",Dr="KHR_node_visibility",_h="KHR_texture_basisu",Lr="KHR_texture_transform",fn="KHR_xmp_json_ld",SN=class extends Pe{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="FeatureID",this.parentTypes=["Features"];}getDefaults(){return Object.assign(super.getDefaults(),{nullFeatureId:null,label:"",attribute:null,texture:null,propertyTable:null})}getFeatureCount(){return this.get("featureCount")}setFeatureCount(t){return this.set("featureCount",t)}getNullFeatureID(){return this.get("nullFeatureId")}setNullFeatureID(t){return this.set("nullFeatureId",t)}getLabel(){return this.get("label")}setLabel(t){return this.set("label",t)}getAttribute(){return this.get("attribute")}setAttribute(t){return this.set("attribute",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getPropertyTable(){return this.getRef("propertyTable")}setPropertyTable(t){return this.setRef("propertyTable",t)}},xN=class extends Pe{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="FeatureIDTexture",this.parentTypes=["FeatureID"];}getDefaults(){let t=new qe(this.graph,"textureInfo");return t.setMinFilter(qe.MagFilter.NEAREST),t.setMagFilter(qe.MagFilter.NEAREST),Object.assign(super.getDefaults(),{channels:[0],texture:null,textureInfo:t})}getChannels(){return this.get("channels")}setChannels(t){return this.set("channels",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getTextureInfo(){return this.getRef("texture")?this.getRef("textureInfo"):null}},bN=class extends Pe{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="Features",this.parentTypes=[ne.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{featureIds:new Ve([])})}listFeatureIDs(){return this.listRefs("featureIds")}addFeatureID(t){return this.addRef("featureIds",t)}removeFeatureID(t){return this.removeRef("featureIds",t)}},Pa=Fn,TN=class extends Le{extensionName=Fn;static EXTENSION_NAME=Fn;createFeatures(){return new bN(this.document.getGraph())}createFeatureID(){return new SN(this.document.getGraph())}createFeatureIDTexture(){return new xN(this.document.getGraph())}read(t){return (t.jsonDoc.json.meshes||[]).forEach((e,r)=>{(e.primitives||[]).forEach((i,n)=>{this._readPrimitive(t,r,i,n);});}),this}_readPrimitive(t,e,r,i){if(!r.extensions||!r.extensions[Pa])return;let n=this.createFeatures(),s=r.extensions[Pa];for(let o of s.featureIds){let a=RN(this.document,this,t,o);n.addFeatureID(a);}t.meshes[e].listPrimitives()[i].setExtension(Pa,n);}write(t){let e=t.jsonDoc.json.meshes;if(!e)return this;for(let r of this.document.getRoot().listMeshes()){let i=e[t.meshIndexMap.get(r)];r.listPrimitives().forEach((n,s)=>{let o=i.primitives[s];this._writePrimitive(t,n,o);});}return this}_writePrimitive(t,e,r){let i=e.getExtension(Pa);if(!i)return;let n={featureIds:[]};i.listFeatureIDs().forEach(s=>{n.featureIds.push(wN(this.document,t,s));}),r.extensions=r.extensions||{},r.extensions[Pa]=n;}};function RN(t,e,r,i){let n=e.createFeatureID().setFeatureCount(i.featureCount);i.nullFeatureId!==void 0&&n.setNullFeatureID(i.nullFeatureId),i.label!==void 0&&n.setLabel(i.label),i.attribute!==void 0&&n.setAttribute(i.attribute);let s=i.texture;if(s!==void 0){let o=EN(e,r,s);n.setTexture(o);}if(i.propertyTable!==void 0){let o=t.getRoot().getExtension(be).listPropertyTables();n.setPropertyTable(o[i.propertyTable]);}return n}function EN(t,e,r){let i=t.createFeatureIDTexture(),{json:n}=e.jsonDoc;if(r.channels&&i.setChannels(r.channels),r.index!==void 0){let s=n.textures[r.index].source;i.setTexture(e.textures[s]),e.setTextureInfo(i.getTextureInfo(),r);}return i}function wN(t,e,r){let i=t.getRoot(),n={featureCount:r.getFeatureCount()};if(r.getNullFeatureID()!=null&&(n.nullFeatureId=r.getNullFeatureID()),r.getLabel()&&(n.label=r.getLabel()),r.getAttribute()!=null&&(n.attribute=r.getAttribute()),r.getTexture()){let s=r.getTexture(),o=s.getTexture(),a=s.getTextureInfo();n.texture=e.createTextureInfoDef(o,a);let c=s.getChannels();Ke.eq(c,[0])||(n.texture.channels=c);}if(r.getPropertyTable()){let s=i.getExtension(be),o=r.getPropertyTable();n.propertyTable=s.listPropertyTables().indexOf(o);}return n}var gy="INSTANCE_ATTRIBUTE",MN=class extends Pe{static EXTENSION_NAME=Rr;init(){this.extensionName=Rr,this.propertyType="InstancedMesh",this.parentTypes=[ne.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new st})}getAttribute(t){return this.getRefMap("attributes",t)}setAttribute(t,e){return this.setRefMap("attributes",t,e,{usage:gy})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}},AN=class extends Le{static EXTENSION_NAME=Rr;extensionName=Rr;prewriteTypes=[ne.ACCESSOR];createInstancedMesh(){return new MN(this.document.getGraph())}read(t){return (t.jsonDoc.json.nodes||[]).forEach((e,r)=>{if(!e.extensions||!e.extensions.EXT_mesh_gpu_instancing)return;let i=e.extensions[Rr],n=this.createInstancedMesh();for(let s in i.attributes)n.setAttribute(s,t.accessors[i.attributes[s]]);t.nodes[r].setExtension(Rr,n);}),this}prewrite(t){t.accessorUsageGroupedByParent.add(gy);for(let e of this.properties)for(let r of e.listAttributes())t.addAccessorToUsageGroup(r,gy);return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listNodes().forEach(r=>{let i=r.getExtension(Rr);if(i){let n=t.nodeIndexMap.get(r),s=e.json.nodes[n],o={attributes:{}};i.listSemantics().forEach(a=>{let c=i.getAttribute(a);o.attributes[a]=t.accessorIndexMap.get(c);}),s.extensions=s.extensions||{},s.extensions[Rr]=o;}}),this}},IN=(function(t){return t.QUANTIZE="quantize",t.FILTER="filter",t})({});function CN(t){return !t.extensions||!t.extensions.EXT_meshopt_compression?false:!!t.extensions[Lt].fallback}var{BYTE:PN,SHORT:zR,FLOAT:NN}=fe.ComponentType,{encodeNormalizedInt:$R,decodeNormalizedInt:_y}=Ke;function ON(t,e,r,i){let{filter:n,bits:s}=i,o={array:t.getArray(),byteStride:t.getElementSize()*t.getComponentSize(),componentType:t.getComponentType(),normalized:t.getNormalized()};if(r!=="ATTRIBUTES")return o;if(n!=="NONE"){let a=t.getNormalized()?zN(t):new Float32Array(o.array);switch(n){case "EXPONENTIAL":o.byteStride=t.getElementSize()*4,o.componentType=NN,o.normalized=false,o.array=e.encodeFilterExp(a,t.getCount(),o.byteStride,s);break;case "OCTAHEDRAL":o.byteStride=s>8?8:4,o.componentType=s>8?zR:PN,o.normalized=true,a=t.getElementSize()===3?kN(a):a,o.array=e.encodeFilterOct(a,t.getCount(),o.byteStride,s);break;case "QUATERNION":o.byteStride=8,o.componentType=zR,o.normalized=true,o.array=e.encodeFilterQuat(a,t.getCount(),o.byteStride,s);break;default:throw new Error("Invalid filter.")}o.min=t.getMin([]),o.max=t.getMax([]),t.getNormalized()&&(o.min=o.min.map(c=>_y(c,t.getComponentType())),o.max=o.max.map(c=>_y(c,t.getComponentType()))),o.normalized&&(o.min=o.min.map(c=>$R(c,o.componentType)),o.max=o.max.map(c=>$R(c,o.componentType)));}else o.byteStride%4&&(o.array=$N(o.array,t.getElementSize()),o.byteStride=o.array.byteLength/t.getCount());return o}function zN(t){let e=t.getComponentType(),r=t.getArray(),i=new Float32Array(r.length);for(let n=0;n<r.length;n++)i[n]=_y(r[n],e);return i}function $N(t,e){let r=Me.padNumber(t.BYTES_PER_ELEMENT*e)/t.BYTES_PER_ELEMENT,i=t.length/e,n=new t.constructor(i*r);for(let s=0;s*e<t.length;s++)for(let o=0;o<e;o++)n[s*r+o]=t[s*e+o];return n}function kN(t){let e=new Float32Array(t.length*4/3);for(let r=0,i=t.length/3;r<i;r++)e[r*4]=t[r*3],e[r*4+1]=t[r*3+1],e[r*4+2]=t[r*3+2];return e}function DN(t,e){return e===xr.BufferViewUsage.ELEMENT_ARRAY_BUFFER?t.listParents().some(r=>r instanceof Ca&&r.getMode()===Ca.Mode.TRIANGLES)?"TRIANGLES":"INDICES":"ATTRIBUTES"}function LN(t,e){let r=e.getGraph().listParentEdges(t).filter(i=>!(i.getParent()instanceof fy));for(let i of r){let n=i.getName(),s=i.getAttributes().key||"",o=i.getParent().propertyType===ne.PRIMITIVE_TARGET;if(n==="indices")return {filter:"NONE"};if(n==="attributes"){if(s==="POSITION")return {filter:"NONE"};if(s==="TEXCOORD_0")return {filter:"NONE"};if(s.startsWith("JOINTS_"))return {filter:"NONE"};if(s.startsWith("WEIGHTS_"))return {filter:"NONE"};if(s==="NORMAL"||s==="TANGENT")return o?{filter:"NONE"}:{filter:"OCTAHEDRAL",bits:8}}if(n==="output"){let a=YR(t);return a==="rotation"?{filter:"QUATERNION",bits:16}:a==="translation"?{filter:"EXPONENTIAL",bits:12}:a==="scale"?{filter:"EXPONENTIAL",bits:12}:{filter:"NONE"}}if(n==="input")return {filter:"NONE"};if(n==="inverseBindMatrices")return {filter:"NONE"}}return {filter:"NONE"}}function YR(t){for(let e of t.listParents())if(e instanceof hh){for(let r of e.listParents())if(r instanceof hy)return r.getTargetPath()}return null}var kR={method:"quantize"},UN=class extends Le{extensionName=Lt;prereadTypes=[ne.BUFFER,ne.PRIMITIVE];prewriteTypes=[ne.BUFFER,ne.ACCESSOR];readDependencies=["meshopt.decoder"];writeDependencies=["meshopt.encoder"];static EXTENSION_NAME=Lt;static EncoderMethod=IN;_decoder=null;_decoderFallbackBufferMap=new Map;_encoder=null;_encoderOptions=kR;_encoderFallbackBuffer=null;_encoderBufferViews={};_encoderBufferViewData={};_encoderBufferViewAccessors={};install(t,e){return t==="meshopt.decoder"&&(this._decoder=e),t==="meshopt.encoder"&&(this._encoder=e),this}setEncoderOptions(t){return this._encoderOptions={...kR,...t},this}preread(t,e){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${Lt}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${Lt}]: Missing WASM support.`)}return e===ne.BUFFER?this._prereadBuffers(t):e===ne.PRIMITIVE&&this._prereadPrimitives(t),this}_prereadBuffers(t){let e=t.jsonDoc;(e.json.bufferViews||[]).forEach((r,i)=>{if(!r.extensions||!r.extensions.EXT_meshopt_compression)return;let n=r.extensions[Lt],s=n.byteOffset||0,o=n.byteLength||0,a=n.count,c=n.byteStride,l=new Uint8Array(a*c),u=e.json.buffers[n.buffer],d=u.uri?e.resources[u.uri]:e.resources[br],f=Me.toView(d,s,o);this._decoder.decodeGltfBuffer(l,a,c,f,n.mode,n.filter),t.bufferViews[i]=l;});}_prereadPrimitives(t){let e=t.jsonDoc;(e.json.bufferViews||[]).forEach(r=>{if(!r.extensions||!r.extensions.EXT_meshopt_compression)return;let i=r.extensions[Lt],n=t.buffers[i.buffer],s=t.buffers[r.buffer],o=e.json.buffers[r.buffer];CN(o)&&this._decoderFallbackBufferMap.set(s,n);});}read(t){if(!this.isRequired())return this;for(let[e,r]of this._decoderFallbackBufferMap){for(let i of e.listParents())i instanceof fe&&i.swap(e,r);e.dispose();}return this}prewrite(t,e){return e===ne.ACCESSOR?this._prewriteAccessors(t):e===ne.BUFFER&&this._prewriteBuffers(t),this}_prewriteAccessors(t){let e=t.jsonDoc.json,r=this._encoder,i=this._encoderOptions,n=this.document.getGraph(),s=this.document.createBuffer(),o=this.document.getRoot().listBuffers().indexOf(s),a=1,c=new Map,l=u=>{for(let d of n.listParents(u)){if(d.propertyType===ne.ROOT)continue;let f=c.get(u);return f===void 0&&c.set(u,f=a++),f}return -1};this._encoderFallbackBuffer=s,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(let u of this.document.getRoot().listAccessors()){if(YR(u)==="weights"||u.getSparse())continue;let d=t.getAccessorUsage(u),f=t.accessorUsageGroupedByParent.has(d)?l(u):null,p=DN(u,d),g=i.method==="filter"?LN(u,this.document):{filter:"NONE"},m=ON(u,r,p,g),{array:S,byteStride:h}=m,v=u.getBuffer();if(!v)throw new Error(`${Lt}: Missing buffer for accessor.`);let _=this.document.getRoot().listBuffers().indexOf(v),y=[d,f,p,g.filter,h,_].join(":"),R=this._encoderBufferViews[y],T=this._encoderBufferViewData[y],b=this._encoderBufferViewAccessors[y];(!R||!T)&&(b=this._encoderBufferViewAccessors[y]=[],T=this._encoderBufferViewData[y]=[],R=this._encoderBufferViews[y]={buffer:o,target:xr.USAGE_TO_TARGET[d],byteOffset:0,byteLength:0,byteStride:d===xr.BufferViewUsage.ARRAY_BUFFER?h:void 0,extensions:{[Lt]:{buffer:_,byteOffset:0,byteLength:0,mode:p,filter:g.filter!=="NONE"?g.filter:void 0,byteStride:h,count:0}}});let E=t.createAccessorDef(u);E.componentType=m.componentType,E.normalized=m.normalized,E.byteOffset=R.byteLength,E.min&&m.min&&(E.min=m.min),E.max&&m.max&&(E.max=m.max),t.accessorIndexMap.set(u,e.accessors.length),e.accessors.push(E),b.push(E),T.push(new Uint8Array(S.buffer,S.byteOffset,S.byteLength)),R.byteLength+=S.byteLength,R.extensions.EXT_meshopt_compression.count+=u.getCount();}}_prewriteBuffers(t){let e=this._encoder;for(let r in this._encoderBufferViews){let i=this._encoderBufferViews[r],n=this._encoderBufferViewData[r],s=this.document.getRoot().listBuffers()[i.extensions[Lt].buffer],o=t.otherBufferViews.get(s)||[],{count:a,byteStride:c,mode:l}=i.extensions[Lt],u=Me.concat(n),d=e.encodeGltfBuffer(u,a,c,l),f=Me.pad(d);i.extensions[Lt].byteLength=d.byteLength,n.length=0,n.push(f),o.push(f),t.otherBufferViews.set(s,o);}}write(t){let e=0;for(let s in this._encoderBufferViews){let o=this._encoderBufferViews[s],a=this._encoderBufferViewData[s][0],c=t.otherBufferViewsIndexMap.get(a),l=this._encoderBufferViewAccessors[s];for(let p of l)p.bufferView=c;let u=t.jsonDoc.json.bufferViews[c],d=u.byteOffset||0;Object.assign(u,o),u.byteOffset=e;let f=u.extensions[Lt];f.byteOffset=d,e+=Me.padNumber(o.byteLength);}let r=this._encoderFallbackBuffer,i=t.bufferIndexMap.get(r),n=t.jsonDoc.json.buffers[i];return n.byteLength=e,n.extensions={[Lt]:{fallback:true}},r.dispose(),this}},FN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="StructuralMetadata",this.parentTypes=[ne.ROOT];}getDefaults(){return Object.assign(super.getDefaults(),{schema:null,schemaUri:"",propertyTables:new mt,propertyTextures:new mt,propertyAttributes:new mt})}getSchema(){return this.getRef("schema")}setSchema(t){return this.setRef("schema",t)}getSchemaUri(){return this.get("schemaUri")}setSchemaUri(t){return this.set("schemaUri",t)}listPropertyTables(){return this.listRefs("propertyTables")}addPropertyTable(t){return this.addRef("propertyTables",t)}removePropertyTable(t){return this.removeRef("propertyTables",t)}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(t){return this.addRef("propertyTextures",t)}removePropertyTexture(t){return this.removeRef("propertyTextures",t)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(t){return this.addRef("propertyAttributes",t)}removePropertyAttribute(t){return this.removeRef("propertyAttributes",t)}},BN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="Schema",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",version:"",classes:new st,enums:new st})}getId(){return this.get("id")}setId(t){return this.set("id",t)}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getVersion(){return this.get("version")}setVersion(t){return this.set("version",t)}setClass(t,e){return this.setRefMap("classes",t,e)}getClass(t){return this.getRefMap("classes",t)}listClassKeys(){return this.listRefMapKeys("classes")}listClassValues(){return this.listRefMapValues("classes")}setEnum(t,e){return this.setRefMap("enums",t,e)}getEnum(t){return this.getRefMap("enums",t)}listEnumKeys(){return this.listRefMapKeys("enums")}listEnumValues(){return this.listRefMapValues("enums")}},VN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="Class",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",properties:new st})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},jN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="ClassProperty",this.parentTypes=["Class"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",componentType:null,enumType:null,array:null,count:null,normalized:null,offset:null,scale:null,max:null,min:null,required:null,noData:null,default:null})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getType(){return this.get("type")}setType(t){return this.set("type",t)}getComponentType(){return this.get("componentType")}setComponentType(t){return this.set("componentType",t)}getEnumType(){return this.get("enumType")}setEnumType(t){return this.set("enumType",t)}getArray(){return this.get("array")}setArray(t){return this.set("array",t)}getCount(){return this.get("count")}setCount(t){return this.set("count",t)}getNormalized(){return this.get("normalized")}setNormalized(t){return this.set("normalized",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}getRequired(){return this.get("required")}setRequired(t){return this.set("required",t)}getNoData(){return this.get("noData")}setNoData(t){return this.set("noData",t)}getDefault(){return this.get("default")}setDefault(t){return this.set("default",t)}},GN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="Enum",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",valueType:"UINT16",values:new mt})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getValueType(){return this.get("valueType")}setValueType(t){return this.set("valueType",t)}listValues(){return this.listRefs("values")}addEnumValue(t){return this.addRef("values",t)}removeEnumValue(t){return this.removeRef("values",t)}},HN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="EnumValue",this.parentTypes=["Enum"];}getDefaults(){return Object.assign(super.getDefaults(),{description:null})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getValue(){return this.get("value")}setValue(t){return this.set("value",t)}},qN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyTable",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}getCount(){return this.get("count")}setCount(t){return this.set("count",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},WN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyTableProperty",this.parentTypes=["PropertyTable"];}getDefaults(){return Object.assign(super.getDefaults(),{arrayOffsets:null,stringOffsets:null,arrayOffsetType:null,stringOffsetType:null,offset:null,scale:null,max:null,min:null})}getValues(){return this.get("values")}setValues(t){return this.set("values",t)}getArrayOffsets(){return this.get("arrayOffsets")}setArrayOffsets(t){return this.set("arrayOffsets",t)}getStringOffsets(){return this.get("stringOffsets")}setStringOffsets(t){return this.set("stringOffsets",t)}getArrayOffsetType(){return this.get("arrayOffsetType")}setArrayOffsetType(t){return this.set("arrayOffsetType",t)}getStringOffsetType(){return this.get("stringOffsetType")}setStringOffsetType(t){return this.set("stringOffsetType",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},KN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyTexture",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},ZN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyTextureProperty",this.parentTypes=["PropertyTexture"];}getDefaults(){let t=new qe(this.graph,"textureInfo");return t.setMinFilter(qe.MagFilter.NEAREST),t.setMagFilter(qe.MagFilter.NEAREST),Object.assign(super.getDefaults(),{channels:[0],texture:null,textureInfo:t,offset:null,scale:null,max:null,min:null})}getChannels(){return this.get("channels")}setChannels(t){return this.set("channels",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getTextureInfo(){return this.getRef("texture")?this.getRef("textureInfo"):null}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},XN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyAttribute",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},JN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="PropertyAttributeProperty",this.parentTypes=["PropertyAttribute"];}getDefaults(){return Object.assign(super.getDefaults(),{offset:null,scale:null,max:null,min:null})}getAttribute(){return this.get("attribute")}setAttribute(t){return this.set("attribute",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},YN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="NodeStructuralMetadata",this.parentTypes=[ne.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{class:"",properties:{}})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}getProperties(){return this.get("properties")}setProperties(t){return this.set("properties",t)}},QN=class extends Pe{static EXTENSION_NAME=be;init(){this.extensionName=be,this.propertyType="MeshPrimitiveStructuralMetadata",this.parentTypes=[ne.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{propertyTextures:new mt,propertyAttributes:new mt})}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(t){return this.addRef("propertyTextures",t)}removePropertyTexture(t){return this.removeRef("propertyTextures",t)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(t){return this.addRef("propertyAttributes",t)}removePropertyAttribute(t){return this.removeRef("propertyAttributes",t)}},eO=class extends Le{extensionName=be;static EXTENSION_NAME=be;prewriteTypes=[ne.BUFFER];prereadTypes=[ne.SCENE];createStructuralMetadata(){return new FN(this.document.getGraph())}createSchema(){return new BN(this.document.getGraph())}createClass(){return new VN(this.document.getGraph())}createClassProperty(){return new jN(this.document.getGraph())}createEnum(){return new GN(this.document.getGraph())}createEnumValue(){return new HN(this.document.getGraph())}createPropertyTable(){return new qN(this.document.getGraph())}createPropertyTableProperty(){return new WN(this.document.getGraph())}createPropertyTexture(){return new KN(this.document.getGraph())}createPropertyTextureProperty(){return new ZN(this.document.getGraph())}createPropertyAttribute(){return new XN(this.document.getGraph())}createPropertyAttributeProperty(){return new JN(this.document.getGraph())}createNodeStructuralMetadata(){return new YN(this.document.getGraph())}createMeshPrimitiveStructuralMetadata(){return new QN(this.document.getGraph())}read(t){return this}preread(t){let e=this.document.getRoot(),{json:r}=t.jsonDoc,i=r.extensions[be],n=tO(this,t,i);return e.setExtension(be,n),(r.meshes||[]).forEach((s,o)=>{let a=t.meshes[o].listPrimitives();(s.primitives||[]).forEach((c,l)=>{let u=a[l];this._readPrimitive(n,u,c);});}),(r.nodes||[]).forEach((s,o)=>{this._readNode(t.nodes[o],s);}),this}_readPrimitive(t,e,r){if(!r.extensions||!r.extensions.EXT_structural_metadata)return;let i=this.createMeshPrimitiveStructuralMetadata(),n=r.extensions[be],s=t.listPropertyTextures(),o=n.propertyTextures||[];for(let l of o){let u=s[l];i.addPropertyTexture(u);}let a=t.listPropertyAttributes(),c=n.propertyAttributes||[];for(let l of c){let u=a[l];i.addPropertyAttribute(u);}e.setExtension(be,i);}_readNode(t,e){if(!e.extensions||!e.extensions.EXT_structural_metadata)return;let r=e.extensions[be],i=this.createNodeStructuralMetadata().setClass(r.class).setProperties(r.properties);t.setExtension(be,i);}write(t){let e=this.document.getRoot(),r=e.getExtension(be);if(!r)return this;let i=t.jsonDoc.json,n=fO(t,r);i.extensions=i.extensions||{},i.extensions[be]=n;let s=e.listMeshes(),o=i.meshes;if(o)for(let l of s){let u=o[t.meshIndexMap.get(l)];l.listPrimitives().forEach((d,f)=>{let p=u.primitives[f];this._writePrimitive(r,d,p);});}let a=e.listNodes(),c=i.nodes;if(c)for(let l of a){let u=t.nodeIndexMap.get(l);this._writeNode(l,c[u]);}return this}_writePrimitive(t,e,r){let i=e.getExtension(be);if(!i)return;let n=t.listPropertyTextures(),s=t.listPropertyAttributes(),o,a,c=i.listPropertyTextures();if(c.length>0){o=[];for(let d of c){let f=n.indexOf(d);if(f>=0)o.push(f);else throw new Error(`${be}: Invalid property texture in mesh primitive`)}}let l=i.listPropertyAttributes();if(l.length>0){a=[];for(let d of l){let f=s.indexOf(d);if(f>=0)a.push(f);else throw new Error(`${be}: Invalid property attribute in mesh primitive`)}}let u={propertyTextures:o,propertyAttributes:a};r.extensions=r.extensions||{},r.extensions[be]=u;}_writeNode(t,e){let r=t.getExtension("EXT_structural_metadata");r&&(e.extensions=e.extensions||{},e.extensions[be]={class:r.getClass(),properties:r.getProperties()});}prewrite(t,e){return e===ne.BUFFER&&this._prewriteBuffers(t),this}_prewriteBuffers(t){let e=this.document,r=e.getRoot().getExtension(be);t.jsonDoc.json.bufferViews||=[];for(let i of r.listPropertyTables())for(let n of i.listPropertyValues()){let s=EO(e,t);s.push(n.getValues());let o=n.getArrayOffsets();o&&s.push(o);let a=n.getStringOffsets();a&&s.push(a);}}};function tO(t,e,r){let i=t.createStructuralMetadata();if(r.schema!==void 0){let a=nO(t,r.schema);i.setSchema(a);}else if(r.schemaUri){let a=r.schemaUri;i.setSchemaUri(a);}let n=r.propertyTextures||[];for(let a of n){let c=aO(t,e,a);i.addPropertyTexture(c);}let s=r.propertyTables||[];for(let a of s){let c=lO(t,e,a);i.addPropertyTable(c);}let o=r.propertyAttributes||[];for(let a of o){let c=dO(t,a);i.addPropertyAttribute(c);}return i}function nO(t,e){let r=t.createSchema().setId(e.id);e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.version!==void 0&&r.setVersion(e.version);let i=e.classes||{};for(let s of Object.keys(i)){let o=i[s];r.setClass(s,rO(t,o));}let n=e.enums||{};for(let s of Object.keys(n))r.setEnum(s,sO(t,n[s]));return r}function rO(t,e){let r=t.createClass();e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description);let i=e.properties||{};for(let n of Object.keys(i)){let s=iO(t,i[n]);r.setProperty(n,s);}return r}function iO(t,e){let r=t.createClassProperty().setType(e.type);return e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.componentType!==void 0&&r.setComponentType(e.componentType),e.enumType!==void 0&&r.setEnumType(e.enumType),e.array!==void 0&&r.setArray(e.array),e.count!==void 0&&r.setCount(e.count),e.normalized!==void 0&&r.setNormalized(e.normalized),e.offset!==void 0&&r.setOffset(e.offset),e.scale!==void 0&&r.setScale(e.scale),e.max!==void 0&&r.setMax(e.max),e.min!==void 0&&r.setMin(e.min),e.required!==void 0&&r.setRequired(e.required),e.noData!==void 0&&r.setNoData(e.noData),e.default!==void 0&&r.setDefault(e.default),r}function sO(t,e){let r=t.createEnum();e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.valueType!==void 0&&r.setValueType(e.valueType);let i=e.values||{};for(let n of i)r.addEnumValue(oO(t,n));return r}function oO(t,e){let r=t.createEnumValue();return e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.value!==void 0&&r.setValue(e.value),r}function aO(t,e,r){let i=t.createPropertyTexture();i.setClass(r.class),r.name!==void 0&&i.setName(r.name);let n=r.properties||{};for(let s of Object.keys(n)){let o=cO(t,e,n[s]);i.setProperty(s,o);}return i}function cO(t,e,r){let i=t.createPropertyTextureProperty(),n=e.jsonDoc.json.textures||[];r.channels&&i.setChannels(r.channels);let s=n[r.index].source;if(s!==void 0){let o=e.textures[s];i.setTexture(o);let a=i.getTextureInfo();a&&e.setTextureInfo(a,r);}return r.offset!==void 0&&i.setOffset(r.offset),r.scale!==void 0&&i.setScale(r.scale),r.max!==void 0&&i.setMax(r.max),r.min!==void 0&&i.setMin(r.min),i}function lO(t,e,r){let i=t.createPropertyTable().setClass(r.class).setCount(r.count);r.name!==void 0&&i.setName(r.name);let n=r.properties||{};for(let s of Object.keys(n)){let o=uO(t,e,n[s]);i.setProperty(s,o);}return i}function uO(t,e,r){let i=t.createPropertyTableProperty(),n=py(e,r.values);if(i.setValues(n),r.arrayOffsets!==void 0){let s=py(e,r.arrayOffsets);i.setArrayOffsets(s);}if(r.stringOffsets!==void 0){let s=py(e,r.stringOffsets);i.setStringOffsets(s);}return r.arrayOffsetType!==void 0&&i.setArrayOffsetType(r.arrayOffsetType),r.stringOffsetType!==void 0&&i.setStringOffsetType(r.stringOffsetType),r.offset!==void 0&&i.setOffset(r.offset),r.scale!==void 0&&i.setScale(r.scale),r.max!==void 0&&i.setMax(r.max),r.min!==void 0&&i.setMin(r.min),i}function dO(t,e){let r=t.createPropertyAttribute();r.setClass(e.class),e.name!==void 0&&r.setName(e.name);let i=e.properties||{};for(let n of Object.keys(i)){let s=hO(t,i[n]);r.setProperty(n,s);}return r}function hO(t,e){let r=t.createPropertyAttributeProperty();return r.setAttribute(e.attribute),e.offset!==void 0&&r.setOffset(e.offset),e.scale!==void 0&&r.setScale(e.scale),e.max!==void 0&&r.setMax(e.max),e.min!==void 0&&r.setMin(e.min),r}function fO(t,e){let r={},i=e.getSchema();i&&(r.schema=pO(i));let n=e.getSchemaUri();n&&(r.schemaUri=n);let s=e.listPropertyTables();if(s.length>0){let c=[];for(let l of s){let u=yO(t,l);c.push(u);}r.propertyTables=c;}let o=e.listPropertyTextures();if(o.length>0){let c=[];for(let l of o){let u=TO(t,l);c.push(u);}r.propertyTextures=c;}let a=e.listPropertyAttributes();if(a.length>0){let c=[];for(let l of a){let u=xO(l);c.push(u);}r.propertyAttributes=c;}return r}function pO(t){let e={id:t.getId()},r=t.listClassKeys();if(r.length>0){e.classes={};for(let n of r){let s=mO(t.getClass(n));e.classes[n]=s;}}let i=t.listEnumKeys();if(i.length>0){e.enums={};for(let n of i){let s=_O(t.getEnum(n));e.enums[n]=s;}}return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getVersion()&&(e.version=t.getVersion()),e}function mO(t){let e={},r=t.listPropertyKeys();if(r.length>0){e.properties={};for(let i of r){let n=t.getProperty(i);e.properties[i]=gO(n);}}return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),e}function gO(t){let e={type:t.getType()};return t.getArray()&&(e.array=t.getArray()),t.getNormalized()&&(e.normalized=t.getNormalized()),t.getRequired()&&(e.required=t.getRequired()),t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getComponentType()!=null&&(e.componentType=t.getComponentType()),t.getEnumType()!=null&&(e.enumType=t.getEnumType()),t.getCount()!=null&&(e.count=t.getCount()),t.getOffset()!=null&&(e.offset=t.getOffset()),t.getScale()!=null&&(e.scale=t.getScale()),t.getMax()!=null&&(e.max=t.getMax()),t.getMin()!=null&&(e.min=t.getMin()),t.getNoData()!=null&&(e.noData=t.getNoData()),t.getDefault()!=null&&(e.default=t.getDefault()),e}function _O(t){let e={values:t.listValues().map(vO)};return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getValueType()!=="UINT16"&&(e.valueType=t.getValueType()),e}function vO(t){let e={name:t.getName(),value:t.getValue()};return t.getDescription()&&(e.description=t.getDescription()),e}function yO(t,e){let r={class:e.getClass(),count:e.getCount()};e.getName()&&(r.name=e.getName());let i=e.listPropertyKeys();if(i.length>0){r.properties={};for(let n of i){let s=SO(t,e.getProperty(n));r.properties[n]=s;}}return r}function SO(t,e){let r=e.getValues(),i={values:t.otherBufferViewsIndexMap.get(r)};if(e.getArrayOffsets()){let n=e.getArrayOffsets();i.arrayOffsets=t.otherBufferViewsIndexMap.get(n);}if(e.getStringOffsets()){let n=e.getStringOffsets();i.stringOffsets=t.otherBufferViewsIndexMap.get(n);}return e.getArrayOffsetType()!=null&&(i.arrayOffsetType=e.getArrayOffsetType()),e.getStringOffsetType()!=null&&(i.stringOffsetType=e.getStringOffsetType()),e.getOffset()!=null&&(i.offset=e.getOffset()),e.getScale()!=null&&(i.scale=e.getScale()),e.getMax()!=null&&(i.max=e.getMax()),e.getMin()!=null&&(i.min=e.getMin()),i}function xO(t){let e={class:t.getClass()};t.getName()&&(e.name=t.getName());let r=t.listPropertyKeys();if(r.length>0){e.properties={};for(let i of r){let n=bO(t.getProperty(i));e.properties[i]=n;}}return e}function bO(t){let e={attribute:t.getAttribute()};return t.getOffset()!=null&&(e.offset=t.getOffset()),t.getScale()!=null&&(e.scale=t.getScale()),t.getMax()!=null&&(e.max=t.getMax()),t.getMin()!=null&&(e.min=t.getMin()),e}function TO(t,e){let r={class:e.getClass()};e.getName()&&(r.name=e.getName());let i=e.listPropertyKeys();if(i.length>0){r.properties={};for(let n of i){let s=RO(t,e.getProperty(n));r.properties[n]=s;}}return r}function RO(t,e){let r=e.getTexture(),i=e.getTextureInfo(),n=e.getChannels(),s=t.createTextureInfoDef(r,i);return Ke.eq(n,[0])||(s.channels=n),e.getOffset()!=null&&(s.offset=e.getOffset()),e.getScale()!=null&&(s.scale=e.getScale()),e.getMax()!=null&&(s.max=e.getMax()),e.getMin()!=null&&(s.min=e.getMin()),s}function py(t,e){let r=t.jsonDoc,i=r.json.buffers||[],n=(r.json.bufferViews||[])[e],s=i[n.buffer],o=s.uri?r.resources[s.uri]:r.resources[br],a=n.byteOffset||0,c=n.byteLength;return o.slice(a,a+c)}function EO(t,e){let r=t.getRoot().listBuffers()[0],i=e.otherBufferViews.get(r);return i||(i=[],e.otherBufferViews.set(r,i)),i}var wO=class{match(t){return t.length>=12&&Me.decodeText(t.slice(4,12))==="ftypavif"}getSize(t){if(!this.match(t))return null;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),r=DR(e,0);if(!r)return null;let i=r.end;for(;r=DR(e,i);)if(r.type==="meta")i=r.start+4;else if(r.type==="iprp"||r.type==="ipco")i=r.start;else {if(r.type==="ispe")return [e.getUint32(r.start+4),e.getUint32(r.start+8)];if(r.type==="mdat")break;i=r.end;}return null}getChannels(t){return 4}},MO=class extends Le{extensionName=gh;prereadTypes=[ne.TEXTURE];static EXTENSION_NAME=gh;static register(){Tn.registerFormat("image/avif",new wO);}preread(t){return (t.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions.EXT_texture_avif&&(e.source=e.extensions[gh].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/avif"){let i=t.imageIndexMap.get(r);(e.json.textures||[]).forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[gh]={source:n.source},delete n.source);});}}),this}};function DR(t,e){if(t.byteLength<4+e)return null;let r=t.getUint32(e);return t.byteLength<r+e||r<8?null:{type:Me.decodeText(new Uint8Array(t.buffer,t.byteOffset+e+4,4)),start:e+8,end:e+r}}var AO=class{match(t){return t.length>=12&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80}getSize(t){let e=Me.decodeText(t.slice(0,4)),r=Me.decodeText(t.slice(8,12));if(e!=="RIFF"||r!=="WEBP")return null;let i=new DataView(t.buffer,t.byteOffset),n=12;for(;n<i.byteLength;){let s=Me.decodeText(new Uint8Array([i.getUint8(n),i.getUint8(n+1),i.getUint8(n+2),i.getUint8(n+3)])),o=i.getUint32(n+4,true);if(s==="VP8 ")return [i.getInt16(n+14,true)&16383,i.getInt16(n+16,true)&16383];if(s==="VP8L"){let a=i.getUint8(n+9),c=i.getUint8(n+10),l=i.getUint8(n+11),u=i.getUint8(n+12);return [1+((c&63)<<8|a),1+((u&15)<<10|l<<2|(c&192)>>6)]}n+=8+o+o%2;}return null}getChannels(t){return 4}},IO=class extends Le{extensionName=mh;prereadTypes=[ne.TEXTURE];static EXTENSION_NAME=mh;static register(){Tn.registerFormat("image/webp",new AO);}preread(t){return (t.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions.EXT_texture_webp&&(e.source=e.extensions[mh].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/webp"){let i=t.imageIndexMap.get(r);(e.json.textures||[]).forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[mh]={source:n.source},delete n.source);});}}),this}},LR=vN,CO=class extends Le{extensionName=LR;static EXTENSION_NAME=LR;read(t){return this}write(t){return this}},UR=yN,PO=class extends Le{extensionName=UR;static EXTENSION_NAME=UR;read(t){return this}write(t){return this}},ct,QR,eE;function NO(t,e){let r=new ct.DecoderBuffer;try{if(r.Init(e,e.length),t.GetEncodedGeometryType(r)!==ct.TRIANGULAR_MESH)throw new Error(`[${tt}] Unknown geometry type.`);let i=new ct.Mesh;if(!t.DecodeBufferToMesh(r,i).ok()||i.ptr===0)throw new Error(`[${tt}] Decoding failure.`);return i}finally{ct.destroy(r);}}function OO(t,e){let r=e.num_faces()*3,i,n;if(e.num_points()<=65534){let s=r*Uint16Array.BYTES_PER_ELEMENT;i=ct._malloc(s),t.GetTrianglesUInt16Array(e,s,i),n=new Uint16Array(ct.HEAPU16.buffer,i,r).slice();}else {let s=r*Uint32Array.BYTES_PER_ELEMENT;i=ct._malloc(s),t.GetTrianglesUInt32Array(e,s,i),n=new Uint32Array(ct.HEAPU32.buffer,i,r).slice();}return ct._free(i),n}function zO(t,e,r,i){let n=eE[i.componentType],s=QR[i.componentType],o=r.num_components(),a=e.num_points()*o,c=a*s.BYTES_PER_ELEMENT,l=ct._malloc(c);t.GetAttributeDataArrayForAllPoints(e,r,n,c,l);let u=new s(ct.HEAPF32.buffer,l,a).slice();return ct._free(l),u}function $O(t){ct=t,QR={[fe.ComponentType.FLOAT]:Float32Array,[fe.ComponentType.UNSIGNED_INT]:Uint32Array,[fe.ComponentType.UNSIGNED_SHORT]:Uint16Array,[fe.ComponentType.UNSIGNED_BYTE]:Uint8Array,[fe.ComponentType.SHORT]:Int16Array,[fe.ComponentType.BYTE]:Int8Array},eE={[fe.ComponentType.FLOAT]:ct.DT_FLOAT32,[fe.ComponentType.UNSIGNED_INT]:ct.DT_UINT32,[fe.ComponentType.UNSIGNED_SHORT]:ct.DT_UINT16,[fe.ComponentType.UNSIGNED_BYTE]:ct.DT_UINT8,[fe.ComponentType.SHORT]:ct.DT_INT16,[fe.ComponentType.BYTE]:ct.DT_INT8};}var Yt,kO=(function(t){return t[t.EDGEBREAKER=1]="EDGEBREAKER",t[t.SEQUENTIAL=0]="SEQUENTIAL",t})({}),tE={POSITION:14,NORMAL:10,COLOR:8,TEX_COORD:12,GENERIC:12},FR={decodeSpeed:5,encodeSpeed:5,method:1,quantizationBits:tE,quantizationVolume:"mesh"};function DO(t){Yt=t;}function LO(t,e=FR){let r={...FR,...e};r.quantizationBits={...tE,...e.quantizationBits};let i=new Yt.MeshBuilder,n=new Yt.Mesh,s=new Yt.ExpertEncoder(n),o={},a=new Yt.DracoInt8Array,c=t.listTargets().length>0,l=false;for(let m of t.listSemantics()){let S=t.getAttribute(m);if(S.getSparse()){l=true;continue}let h=UO(m),v=FO(i,S.getComponentType(),n,Yt[h],S.getCount(),S.getElementSize(),S.getArray());if(v===-1)throw new Error(`Error compressing "${m}" attribute.`);if(o[m]=v,r.quantizationVolume==="mesh"||m!=="POSITION")s.SetAttributeQuantization(v,r.quantizationBits[h]);else if(typeof r.quantizationVolume=="object"){let{quantizationVolume:_}=r,y=Math.max(_.max[0]-_.min[0],_.max[1]-_.min[1],_.max[2]-_.min[2]);s.SetAttributeExplicitQuantization(v,r.quantizationBits[h],S.getElementSize(),_.min,y);}else throw new Error("Invalid quantization volume state.")}let u=t.getIndices();if(!u)throw new vy("Primitive must have indices.");i.AddFacesToMesh(n,u.getCount()/3,u.getArray()),s.SetSpeedOptions(r.encodeSpeed,r.decodeSpeed),s.SetTrackEncodedProperties(true),r.method===0||c||l?s.SetEncodingMethod(Yt.MESH_SEQUENTIAL_ENCODING):s.SetEncodingMethod(Yt.MESH_EDGEBREAKER_ENCODING);let d=s.EncodeToDracoBuffer(!(c||l),a);if(d<=0)throw new vy("Error applying Draco compression.");let f=new Uint8Array(d);for(let m=0;m<d;++m)f[m]=a.GetValue(m);let p=s.GetNumberOfEncodedPoints(),g=s.GetNumberOfEncodedFaces()*3;return Yt.destroy(a),Yt.destroy(n),Yt.destroy(i),Yt.destroy(s),{numVertices:p,numIndices:g,data:f,attributeIDs:o}}function UO(t){return t==="POSITION"?"POSITION":t==="NORMAL"?"NORMAL":t.startsWith("COLOR_")?"COLOR":t.startsWith("TEXCOORD_")?"TEX_COORD":"GENERIC"}function FO(t,e,r,i,n,s,o){switch(e){case fe.ComponentType.UNSIGNED_BYTE:return t.AddUInt8Attribute(r,i,n,s,o);case fe.ComponentType.BYTE:return t.AddInt8Attribute(r,i,n,s,o);case fe.ComponentType.UNSIGNED_SHORT:return t.AddUInt16Attribute(r,i,n,s,o);case fe.ComponentType.SHORT:return t.AddInt16Attribute(r,i,n,s,o);case fe.ComponentType.UNSIGNED_INT:return t.AddUInt32Attribute(r,i,n,s,o);case fe.ComponentType.FLOAT:return t.AddFloatAttribute(r,i,n,s,o);default:throw new Error(`Unexpected component type, "${e}".`)}}var vy=class extends Error{},BO=class extends Le{extensionName=tt;prereadTypes=[ne.PRIMITIVE];prewriteTypes=[ne.ACCESSOR];readDependencies=["draco3d.decoder"];writeDependencies=["draco3d.encoder"];static EXTENSION_NAME=tt;static EncoderMethod=kO;_decoderModule=null;_encoderModule=null;_encoderOptions={};install(t,e){return t==="draco3d.decoder"&&(this._decoderModule=e,$O(this._decoderModule)),t==="draco3d.encoder"&&(this._encoderModule=e,DO(this._encoderModule)),this}setEncoderOptions(t){return this._encoderOptions=t,this}preread(t){if(!this._decoderModule)throw new Error(`[${tt}] Please install extension dependency, "draco3d.decoder".`);let e=this.document.getLogger(),r=t.jsonDoc,i=new Map;try{let n=r.json.meshes||[];for(let s of n)for(let o of s.primitives){if(!o.extensions||!o.extensions.KHR_draco_mesh_compression)continue;let a=o.extensions[tt],[c,l]=i.get(a.bufferView)||[];if(!l||!c){let u=r.json.bufferViews[a.bufferView],d=r.json.buffers[u.buffer],f=d.uri?r.resources[d.uri]:r.resources[br],p=u.byteOffset||0,g=u.byteLength,m=Me.toView(f,p,g);c=new this._decoderModule.Decoder,l=NO(c,m),i.set(a.bufferView,[c,l]),e.debug(`[${tt}] Decompressed ${m.byteLength} bytes.`);}for(let u in a.attributes){let d=t.jsonDoc.json.accessors[o.attributes[u]],f=c.GetAttributeByUniqueId(l,a.attributes[u]),p=zO(c,l,f,d);t.accessors[o.attributes[u]].setArray(p);}o.indices!==void 0&&t.accessors[o.indices].setArray(OO(c,l));}}finally{for(let[n,s]of Array.from(i.values()))this._decoderModule.destroy(n),this._decoderModule.destroy(s);}return this}read(t){return this}prewrite(t,e){if(!this._encoderModule)throw new Error(`[${tt}] Please install extension dependency, "draco3d.encoder".`);let r=this.document.getLogger();r.debug(`[${tt}] Compression options: ${JSON.stringify(this._encoderOptions)}`);let i=VO(this.document),n=new Map,s="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?r.warn(`[${tt}]: quantizationVolume=scene requires exactly 1 scene.`):s=pR(this.document.getRoot().listScenes().pop()));for(let o of Array.from(i.keys())){let a=i.get(o);if(!a)throw new Error("Unexpected primitive.");if(n.has(a)){n.set(a,n.get(a));continue}let c=o.getIndices(),l=t.jsonDoc.json.accessors,u;try{u=LO(o,{...this._encoderOptions,quantizationVolume:s});}catch(p){if(p instanceof vy){r.warn(`[${tt}]: ${p.message} Skipping primitive compression.`);continue}throw p}n.set(a,u);let d=t.createAccessorDef(c);d.count=u.numIndices,t.accessorIndexMap.set(c,l.length),l.push(d),u.numVertices>65534&&fe.getComponentSize(d.componentType)<=2?d.componentType=fe.ComponentType.UNSIGNED_INT:u.numVertices>254&&fe.getComponentSize(d.componentType)<=1&&(d.componentType=fe.ComponentType.UNSIGNED_SHORT);for(let p of o.listSemantics()){let g=o.getAttribute(p);if(u.attributeIDs[p]===void 0)continue;let m=t.createAccessorDef(g);m.count=u.numVertices,t.accessorIndexMap.set(g,l.length),l.push(m);}let f=o.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];t.otherBufferViews.has(f)||t.otherBufferViews.set(f,[]),t.otherBufferViews.get(f).push(u.data);}return r.debug(`[${tt}] Compressed ${i.size} primitives.`),t.extensionData[tt]={primitiveHashMap:i,primitiveEncodingMap:n},this}write(t){let e=t.extensionData[tt];for(let r of this.document.getRoot().listMeshes()){let i=t.jsonDoc.json.meshes[t.meshIndexMap.get(r)];for(let n=0;n<r.listPrimitives().length;n++){let s=r.listPrimitives()[n],o=i.primitives[n],a=e.primitiveHashMap.get(s);if(!a)continue;let c=e.primitiveEncodingMap.get(a);c&&(o.extensions=o.extensions||{},o.extensions[tt]={bufferView:t.otherBufferViewsIndexMap.get(c.data),attributes:c.attributeIDs});}}if(!e.primitiveHashMap.size){let r=t.jsonDoc.json;r.extensionsUsed=(r.extensionsUsed||[]).filter(i=>i!==tt),r.extensionsRequired=(r.extensionsRequired||[]).filter(i=>i!==tt);}return this}};function VO(t){let e=t.getLogger(),r=new Set,i=new Set,n=0,s=0;for(let d of t.getRoot().listMeshes())for(let f of d.listPrimitives())f.getIndices()?f.getMode()!==Ca.Mode.TRIANGLES?(i.add(f),s++):r.add(f):(i.add(f),n++);n>0&&e.warn(`[${tt}] Skipping Draco compression of ${n} non-indexed primitives.`),s>0&&e.warn(`[${tt}] Skipping Draco compression of ${s} non-TRIANGLES primitives.`);let o=t.getRoot().listAccessors(),a=new Map;for(let d=0;d<o.length;d++)a.set(o[d],d);let c=new Map,l=new Set,u=new Map;for(let d of Array.from(r)){let f=BR(d,a);if(l.has(f)){u.set(d,f);continue}if(c.has(d.getIndices())){let p=d.getIndices(),g=p.clone();a.set(g,t.getRoot().listAccessors().length-1),d.swap(p,g);}for(let p of d.listAttributes())if(c.has(p)){let g=p.clone();a.set(g,t.getRoot().listAccessors().length-1),d.swap(p,g);}f=BR(d,a),l.add(f),u.set(d,f),c.set(d.getIndices(),f);for(let p of d.listAttributes())c.set(p,f);}for(let d of Array.from(c.keys())){let f=new Set(d.listParents().map(p=>p.propertyType));if(f.size!==2||!f.has(ne.PRIMITIVE)||!f.has(ne.ROOT))throw new Error(`[${tt}] Compressed accessors must only be used as indices or vertex attributes.`)}for(let d of Array.from(r)){let f=u.get(d),p=d.getIndices();if(c.get(p)!==f||d.listAttributes().some(g=>c.get(g)!==f))throw new Error(`[${tt}] Draco primitives must share all, or no, accessors.`)}for(let d of Array.from(i)){let f=d.getIndices();if(c.has(f)||d.listAttributes().some(p=>c.has(p)))throw new Error(`[${tt}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return u}function BR(t,e){let r=[],i=t.getIndices();r.push(e.get(i));for(let n of t.listAttributes())r.push(e.get(n));return r.sort().join("|")}var VR=class nE extends Pe{static EXTENSION_NAME=Un;static Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};init(){this.extensionName=Un,this.propertyType="Light",this.parentTypes=[ne.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:nE.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getIntensity(){return this.get("intensity")}setIntensity(e){return this.set("intensity",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getRange(){return this.get("range")}setRange(e){return this.set("range",e)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(e){return this.set("innerConeAngle",e)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(e){return this.set("outerConeAngle",e)}},jO=class extends Le{extensionName=Un;static EXTENSION_NAME=Un;createLight(t=""){return new VR(this.document.getGraph(),t)}read(t){let e=t.jsonDoc;if(!e.json.extensions||!e.json.extensions.KHR_lights_punctual)return this;let r=(e.json.extensions.KHR_lights_punctual.lights||[]).map(i=>{let n=this.createLight().setName(i.name||"").setType(i.type);return i.extras&&n.setExtras(i.extras),i.color!==void 0&&n.setColor(i.color),i.intensity!==void 0&&n.setIntensity(i.intensity),i.range!==void 0&&n.setRange(i.range),i.spot?.innerConeAngle!==void 0&&n.setInnerConeAngle(i.spot.innerConeAngle),i.spot?.outerConeAngle!==void 0&&n.setOuterConeAngle(i.spot.outerConeAngle),n});return e.json.nodes.forEach((i,n)=>{if(!i.extensions||!i.extensions.KHR_lights_punctual)return;let s=i.extensions[Un];t.nodes[n].setExtension(Un,r[s.light]);}),this}write(t){let e=t.jsonDoc;if(this.properties.size===0)return this;let r=[],i=new Map;for(let n of this.properties){let s=n,o=t.createPropertyDef(n);o.type=s.getType(),Ke.eq(s.getColor(),[1,1,1])||(o.color=s.getColor()),s.getIntensity()!==1&&(o.intensity=s.getIntensity()),s.getRange()!=null&&(o.range=s.getRange()),s.getName()&&(o.name=s.getName()),s.getType()===VR.Type.SPOT&&(o.spot={innerConeAngle:s.getInnerConeAngle(),outerConeAngle:s.getOuterConeAngle()}),r.push(o),i.set(s,r.length-1);}return this.document.getRoot().listNodes().forEach(n=>{let s=n.getExtension(Un);if(s){let o=t.nodeIndexMap.get(n),a=e.json.nodes[o];a.extensions=a.extensions||{},a.extensions[Un]={light:i.get(s)};}}),e.json.extensions=e.json.extensions||{},e.json.extensions[Un]={lights:r},this}},{R:GO,G:HO,B:qO}=hn,WO=class extends Pe{static EXTENSION_NAME=Er;init(){this.extensionName=Er,this.propertyType="Anisotropy",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new qe(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(t){return this.set("anisotropyStrength",t)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(t){return this.set("anisotropyRotation",t)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(t){return this.setRef("anisotropyTexture",t,{channels:GO|HO|qO})}},KO=class extends Le{static EXTENSION_NAME=Er;extensionName=Er;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createAnisotropy(){return new WO(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_anisotropy){let o=this.createAnisotropy();t.materials[s].setExtension(Er,o);let a=n.extensions[Er];if(a.extras&&o.setExtras(a.extras),a.anisotropyStrength!==void 0&&o.setAnisotropyStrength(a.anisotropyStrength),a.anisotropyRotation!==void 0&&o.setAnisotropyRotation(a.anisotropyRotation),a.anisotropyTexture!==void 0){let c=a.anisotropyTexture,l=t.textures[i[c.index].source];o.setAnisotropyTexture(l),t.setTextureInfo(o.getAnisotropyTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Er);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Er]=o,i.getAnisotropyStrength()>0&&(o.anisotropyStrength=i.getAnisotropyStrength()),i.getAnisotropyRotation()!==0&&(o.anisotropyRotation=i.getAnisotropyRotation()),i.getAnisotropyTexture()){let a=i.getAnisotropyTexture(),c=i.getAnisotropyTextureInfo();o.anisotropyTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:jR,G:GR,B:ZO}=hn,XO=class extends Pe{static EXTENSION_NAME=wr;init(){this.extensionName=wr,this.propertyType="Clearcoat",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new qe(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new qe(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new qe(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(t){return this.set("clearcoatFactor",t)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(t){return this.setRef("clearcoatTexture",t,{channels:jR})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(t){return this.set("clearcoatRoughnessFactor",t)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(t){return this.setRef("clearcoatRoughnessTexture",t,{channels:GR})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(t){return this.set("clearcoatNormalScale",t)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(t){return this.setRef("clearcoatNormalTexture",t,{channels:jR|GR|ZO})}},JO=class extends Le{static EXTENSION_NAME=wr;extensionName=wr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createClearcoat(){return new XO(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_clearcoat){let o=this.createClearcoat();t.materials[s].setExtension(wr,o);let a=n.extensions[wr];if(a.extras&&o.setExtras(a.extras),a.clearcoatFactor!==void 0&&o.setClearcoatFactor(a.clearcoatFactor),a.clearcoatRoughnessFactor!==void 0&&o.setClearcoatRoughnessFactor(a.clearcoatRoughnessFactor),a.clearcoatTexture!==void 0){let c=a.clearcoatTexture,l=t.textures[i[c.index].source];o.setClearcoatTexture(l),t.setTextureInfo(o.getClearcoatTextureInfo(),c);}if(a.clearcoatRoughnessTexture!==void 0){let c=a.clearcoatRoughnessTexture,l=t.textures[i[c.index].source];o.setClearcoatRoughnessTexture(l),t.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),c);}if(a.clearcoatNormalTexture!==void 0){let c=a.clearcoatNormalTexture,l=t.textures[i[c.index].source];o.setClearcoatNormalTexture(l),t.setTextureInfo(o.getClearcoatNormalTextureInfo(),c),c.scale!==void 0&&o.setClearcoatNormalScale(c.scale);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(wr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[wr]=o,o.clearcoatFactor=i.getClearcoatFactor(),o.clearcoatRoughnessFactor=i.getClearcoatRoughnessFactor(),i.getClearcoatTexture()){let a=i.getClearcoatTexture(),c=i.getClearcoatTextureInfo();o.clearcoatTexture=t.createTextureInfoDef(a,c);}if(i.getClearcoatRoughnessTexture()){let a=i.getClearcoatRoughnessTexture(),c=i.getClearcoatRoughnessTextureInfo();o.clearcoatRoughnessTexture=t.createTextureInfoDef(a,c);}if(i.getClearcoatNormalTexture()){let a=i.getClearcoatNormalTexture(),c=i.getClearcoatNormalTextureInfo();o.clearcoatNormalTexture=t.createTextureInfoDef(a,c),i.getClearcoatNormalScale()!==1&&(o.clearcoatNormalTexture.scale=i.getClearcoatNormalScale());}}}),this}},{R:YO,G:QO,B:ez,A:tz}=hn,nz=class extends Pe{static EXTENSION_NAME=Mr;init(){this.extensionName=Mr,this.propertyType="DiffuseTransmission",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new qe(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new qe(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(t){return this.set("diffuseTransmissionFactor",t)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(t){return this.setRef("diffuseTransmissionTexture",t,{channels:tz})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(t){return this.set("diffuseTransmissionColorFactor",t)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(t){return this.setRef("diffuseTransmissionColorTexture",t,{channels:YO|QO|ez})}},rz=class extends Le{extensionName=Mr;static EXTENSION_NAME=Mr;createDiffuseTransmission(){return new nz(this.document.getGraph())}read(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_diffuse_transmission){let o=this.createDiffuseTransmission();t.materials[s].setExtension(Mr,o);let a=n.extensions[Mr];if(a.extras&&o.setExtras(a.extras),a.diffuseTransmissionFactor!==void 0&&o.setDiffuseTransmissionFactor(a.diffuseTransmissionFactor),a.diffuseTransmissionColorFactor!==void 0&&o.setDiffuseTransmissionColorFactor(a.diffuseTransmissionColorFactor),a.diffuseTransmissionTexture!==void 0){let c=a.diffuseTransmissionTexture,l=t.textures[i[c.index].source];o.setDiffuseTransmissionTexture(l),t.setTextureInfo(o.getDiffuseTransmissionTextureInfo(),c);}if(a.diffuseTransmissionColorTexture!==void 0){let c=a.diffuseTransmissionColorTexture,l=t.textures[i[c.index].source];o.setDiffuseTransmissionColorTexture(l),t.setTextureInfo(o.getDiffuseTransmissionColorTextureInfo(),c);}}}),this}write(t){let e=t.jsonDoc;for(let r of this.document.getRoot().listMaterials()){let i=r.getExtension(Mr);if(!i)continue;let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Mr]=o,o.diffuseTransmissionFactor=i.getDiffuseTransmissionFactor(),o.diffuseTransmissionColorFactor=i.getDiffuseTransmissionColorFactor(),i.getDiffuseTransmissionTexture()){let a=i.getDiffuseTransmissionTexture(),c=i.getDiffuseTransmissionTextureInfo();o.diffuseTransmissionTexture=t.createTextureInfoDef(a,c);}if(i.getDiffuseTransmissionColorTexture()){let a=i.getDiffuseTransmissionColorTexture(),c=i.getDiffuseTransmissionColorTextureInfo();o.diffuseTransmissionColorTexture=t.createTextureInfoDef(a,c);}}return this}},iz=class extends Pe{static EXTENSION_NAME=Ar;init(){this.extensionName=Ar,this.propertyType="Dispersion",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(t){return this.set("dispersion",t)}},sz=class extends Le{static EXTENSION_NAME=Ar;extensionName=Ar;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createDispersion(){return new iz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_dispersion){let i=this.createDispersion();t.materials[r].setExtension(Ar,i);let n=e.extensions[Ar];n.extras&&i.setExtras(n.extras),n.dispersion!==void 0&&i.setDispersion(n.dispersion);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Ar);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Ar]=o,o.dispersion=i.getDispersion();}}),this}},oz=class extends Pe{static EXTENSION_NAME=Ir;init(){this.extensionName=Ir,this.propertyType="EmissiveStrength",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(t){return this.set("emissiveStrength",t)}},az=class extends Le{static EXTENSION_NAME=Ir;extensionName=Ir;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createEmissiveStrength(){return new oz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_emissive_strength){let i=this.createEmissiveStrength();t.materials[r].setExtension(Ir,i);let n=e.extensions[Ir];n.extras&&i.setExtras(n.extras),n.emissiveStrength!==void 0&&i.setEmissiveStrength(n.emissiveStrength);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Ir);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Ir]=o,o.emissiveStrength=i.getEmissiveStrength();}}),this}},cz=class extends Pe{static EXTENSION_NAME=Cr;init(){this.extensionName=Cr,this.propertyType="IOR",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(t){return this.set("ior",t)}},lz=class extends Le{static EXTENSION_NAME=Cr;extensionName=Cr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createIOR(){return new cz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_ior){let i=this.createIOR();t.materials[r].setExtension(Cr,i);let n=e.extensions[Cr];n.extras&&i.setExtras(n.extras),n.ior!==void 0&&i.setIOR(n.ior);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Cr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Cr]=o,o.ior=i.getIOR();}}),this}},{R:uz,G:dz}=hn,hz=class extends Pe{static EXTENSION_NAME=Pr;init(){this.extensionName=Pr,this.propertyType="Iridescence",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new qe(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new qe(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(t){return this.set("iridescenceFactor",t)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(t){return this.setRef("iridescenceTexture",t,{channels:uz})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(t){return this.set("iridescenceIOR",t)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(t){return this.set("iridescenceThicknessMinimum",t)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(t){return this.set("iridescenceThicknessMaximum",t)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(t){return this.setRef("iridescenceThicknessTexture",t,{channels:dz})}},fz=class extends Le{static EXTENSION_NAME=Pr;extensionName=Pr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createIridescence(){return new hz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_iridescence){let o=this.createIridescence();t.materials[s].setExtension(Pr,o);let a=n.extensions[Pr];if(a.extras&&o.setExtras(a.extras),a.iridescenceFactor!==void 0&&o.setIridescenceFactor(a.iridescenceFactor),a.iridescenceIor!==void 0&&o.setIridescenceIOR(a.iridescenceIor),a.iridescenceThicknessMinimum!==void 0&&o.setIridescenceThicknessMinimum(a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&o.setIridescenceThicknessMaximum(a.iridescenceThicknessMaximum),a.iridescenceTexture!==void 0){let c=a.iridescenceTexture,l=t.textures[i[c.index].source];o.setIridescenceTexture(l),t.setTextureInfo(o.getIridescenceTextureInfo(),c);}if(a.iridescenceThicknessTexture!==void 0){let c=a.iridescenceThicknessTexture,l=t.textures[i[c.index].source];o.setIridescenceThicknessTexture(l),t.setTextureInfo(o.getIridescenceThicknessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Pr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Pr]=o,i.getIridescenceFactor()>0&&(o.iridescenceFactor=i.getIridescenceFactor()),i.getIridescenceIOR()!==1.3&&(o.iridescenceIor=i.getIridescenceIOR()),i.getIridescenceThicknessMinimum()!==100&&(o.iridescenceThicknessMinimum=i.getIridescenceThicknessMinimum()),i.getIridescenceThicknessMaximum()!==400&&(o.iridescenceThicknessMaximum=i.getIridescenceThicknessMaximum()),i.getIridescenceTexture()){let a=i.getIridescenceTexture(),c=i.getIridescenceTextureInfo();o.iridescenceTexture=t.createTextureInfoDef(a,c);}if(i.getIridescenceThicknessTexture()){let a=i.getIridescenceThicknessTexture(),c=i.getIridescenceThicknessTextureInfo();o.iridescenceThicknessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:HR,G:qR,B:WR,A:KR}=hn,pz=class extends Pe{static EXTENSION_NAME=Nr;init(){this.extensionName=Nr,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new qe(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new qe(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(t){return this.set("diffuseFactor",t)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(t){return this.setRef("diffuseTexture",t,{channels:HR|qR|WR|KR,isColor:true})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(t){return this.set("specularFactor",t)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(t){return this.set("glossinessFactor",t)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(t){return this.setRef("specularGlossinessTexture",t,{channels:HR|qR|WR|KR})}},mz=class extends Le{static EXTENSION_NAME=Nr;extensionName=Nr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createPBRSpecularGlossiness(){return new pz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_pbrSpecularGlossiness){let o=this.createPBRSpecularGlossiness();t.materials[s].setExtension(Nr,o);let a=n.extensions[Nr];if(a.extras&&o.setExtras(a.extras),a.diffuseFactor!==void 0&&o.setDiffuseFactor(a.diffuseFactor),a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.glossinessFactor!==void 0&&o.setGlossinessFactor(a.glossinessFactor),a.diffuseTexture!==void 0){let c=a.diffuseTexture,l=t.textures[i[c.index].source];o.setDiffuseTexture(l),t.setTextureInfo(o.getDiffuseTextureInfo(),c);}if(a.specularGlossinessTexture!==void 0){let c=a.specularGlossinessTexture,l=t.textures[i[c.index].source];o.setSpecularGlossinessTexture(l),t.setTextureInfo(o.getSpecularGlossinessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Nr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Nr]=o,o.diffuseFactor=i.getDiffuseFactor(),o.specularFactor=i.getSpecularFactor(),o.glossinessFactor=i.getGlossinessFactor(),i.getDiffuseTexture()){let a=i.getDiffuseTexture(),c=i.getDiffuseTextureInfo();o.diffuseTexture=t.createTextureInfoDef(a,c);}if(i.getSpecularGlossinessTexture()){let a=i.getSpecularGlossinessTexture(),c=i.getSpecularGlossinessTextureInfo();o.specularGlossinessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:gz,G:_z,B:vz,A:yz}=hn,Sz=class extends Pe{static EXTENSION_NAME=Or;init(){this.extensionName=Or,this.propertyType="Sheen",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new qe(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new qe(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(t){return this.set("sheenColorFactor",t)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(t){return this.setRef("sheenColorTexture",t,{channels:gz|_z|vz,isColor:true})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(t){return this.set("sheenRoughnessFactor",t)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(t){return this.setRef("sheenRoughnessTexture",t,{channels:yz})}},xz=class extends Le{static EXTENSION_NAME=Or;extensionName=Or;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createSheen(){return new Sz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_sheen){let o=this.createSheen();t.materials[s].setExtension(Or,o);let a=n.extensions[Or];if(a.extras&&o.setExtras(a.extras),a.sheenColorFactor!==void 0&&o.setSheenColorFactor(a.sheenColorFactor),a.sheenRoughnessFactor!==void 0&&o.setSheenRoughnessFactor(a.sheenRoughnessFactor),a.sheenColorTexture!==void 0){let c=a.sheenColorTexture,l=t.textures[i[c.index].source];o.setSheenColorTexture(l),t.setTextureInfo(o.getSheenColorTextureInfo(),c);}if(a.sheenRoughnessTexture!==void 0){let c=a.sheenRoughnessTexture,l=t.textures[i[c.index].source];o.setSheenRoughnessTexture(l),t.setTextureInfo(o.getSheenRoughnessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Or);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Or]=o,o.sheenColorFactor=i.getSheenColorFactor(),o.sheenRoughnessFactor=i.getSheenRoughnessFactor(),i.getSheenColorTexture()){let a=i.getSheenColorTexture(),c=i.getSheenColorTextureInfo();o.sheenColorTexture=t.createTextureInfoDef(a,c);}if(i.getSheenRoughnessTexture()){let a=i.getSheenRoughnessTexture(),c=i.getSheenRoughnessTextureInfo();o.sheenRoughnessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:bz,G:Tz,B:Rz,A:Ez}=hn,wz=class extends Pe{static EXTENSION_NAME=zr;init(){this.extensionName=zr,this.propertyType="Specular",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new qe(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new qe(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(t){return this.set("specularFactor",t)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(t){return this.set("specularColorFactor",t)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(t){return this.setRef("specularTexture",t,{channels:Ez})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(t){return this.setRef("specularColorTexture",t,{channels:bz|Tz|Rz,isColor:true})}},Mz=class extends Le{static EXTENSION_NAME=zr;extensionName=zr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createSpecular(){return new wz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_specular){let o=this.createSpecular();t.materials[s].setExtension(zr,o);let a=n.extensions[zr];if(a.extras&&o.setExtras(a.extras),a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.specularColorFactor!==void 0&&o.setSpecularColorFactor(a.specularColorFactor),a.specularTexture!==void 0){let c=a.specularTexture,l=t.textures[i[c.index].source];o.setSpecularTexture(l),t.setTextureInfo(o.getSpecularTextureInfo(),c);}if(a.specularColorTexture!==void 0){let c=a.specularColorTexture,l=t.textures[i[c.index].source];o.setSpecularColorTexture(l),t.setTextureInfo(o.getSpecularColorTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(zr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[zr]=o,i.getSpecularFactor()!==1&&(o.specularFactor=i.getSpecularFactor()),Ke.eq(i.getSpecularColorFactor(),[1,1,1])||(o.specularColorFactor=i.getSpecularColorFactor()),i.getSpecularTexture()){let a=i.getSpecularTexture(),c=i.getSpecularTextureInfo();o.specularTexture=t.createTextureInfoDef(a,c);}if(i.getSpecularColorTexture()){let a=i.getSpecularColorTexture(),c=i.getSpecularColorTextureInfo();o.specularColorTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:Az}=hn,Iz=class extends Pe{static EXTENSION_NAME=$r;init(){this.extensionName=$r,this.propertyType="Transmission",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new qe(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(t){return this.set("transmissionFactor",t)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(t){return this.setRef("transmissionTexture",t,{channels:Az})}},Cz=class extends Le{static EXTENSION_NAME=$r;extensionName=$r;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createTransmission(){return new Iz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_transmission){let o=this.createTransmission();t.materials[s].setExtension($r,o);let a=n.extensions[$r];if(a.extras&&o.setExtras(a.extras),a.transmissionFactor!==void 0&&o.setTransmissionFactor(a.transmissionFactor),a.transmissionTexture!==void 0){let c=a.transmissionTexture,l=t.textures[i[c.index].source];o.setTransmissionTexture(l),t.setTextureInfo(o.getTransmissionTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension($r);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[$r]=o,o.transmissionFactor=i.getTransmissionFactor(),i.getTransmissionTexture()){let a=i.getTransmissionTexture(),c=i.getTransmissionTextureInfo();o.transmissionTexture=t.createTextureInfoDef(a,c);}}}),this}},Pz=class extends Pe{static EXTENSION_NAME=Is;init(){this.extensionName=Is,this.propertyType="Unlit",this.parentTypes=[ne.MATERIAL];}},Nz=class extends Le{static EXTENSION_NAME=Is;extensionName=Is;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createUnlit(){return new Pz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{e.extensions&&e.extensions.KHR_materials_unlit&&t.materials[r].setExtension(Is,this.createUnlit());}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{if(r.getExtension("KHR_materials_unlit")){let i=t.materialIndexMap.get(r),n=e.json.materials[i];n.extensions=n.extensions||{},n.extensions[Is]={};}}),this}},Oz=class extends Pe{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="Mapping",this.parentTypes=["MappingList"];}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new Ve})}getMaterial(){return this.getRef("material")}setMaterial(t){return this.setRef("material",t)}addVariant(t){return this.addRef("variants",t)}removeVariant(t){return this.removeRef("variants",t)}listVariants(){return this.listRefs("variants")}},zz=class extends Pe{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="MappingList",this.parentTypes=[ne.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new Ve})}addMapping(t){return this.addRef("mappings",t)}removeMapping(t){return this.removeRef("mappings",t)}listMappings(){return this.listRefs("mappings")}},ZR=class extends Pe{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="Variant",this.parentTypes=["MappingList"];}},$z=class extends Le{extensionName=Gt;static EXTENSION_NAME=Gt;createMappingList(){return new zz(this.document.getGraph())}createVariant(t=""){return new ZR(this.document.getGraph(),t)}createMapping(){return new Oz(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(t=>t instanceof ZR)}read(t){let e=t.jsonDoc;if(!e.json.extensions||!e.json.extensions.KHR_materials_variants)return this;let r=(e.json.extensions.KHR_materials_variants.variants||[]).map(i=>this.createVariant().setName(i.name||""));return (e.json.meshes||[]).forEach((i,n)=>{let s=t.meshes[n];(i.primitives||[]).forEach((o,a)=>{if(!o.extensions||!o.extensions.KHR_materials_variants)return;let c=this.createMappingList(),l=o.extensions[Gt];for(let u of l.mappings){let d=this.createMapping();u.material!==void 0&&d.setMaterial(t.materials[u.material]);for(let f of u.variants||[])d.addVariant(r[f]);c.addMapping(d);}s.listPrimitives()[a].setExtension(Gt,c);});}),this}write(t){let e=t.jsonDoc,r=this.listVariants();if(!r.length)return this;let i=[],n=new Map;for(let s of r)n.set(s,i.length),i.push(t.createPropertyDef(s));for(let s of this.document.getRoot().listMeshes()){let o=t.meshIndexMap.get(s);s.listPrimitives().forEach((a,c)=>{let l=a.getExtension(Gt);if(!l)return;let u=t.jsonDoc.json.meshes[o].primitives[c],d=l.listMappings().map(f=>{let p=t.createPropertyDef(f),g=f.getMaterial();return g&&(p.material=t.materialIndexMap.get(g)),p.variants=f.listVariants().map(m=>n.get(m)),p});u.extensions=u.extensions||{},u.extensions[Gt]={mappings:d};});}return e.json.extensions=e.json.extensions||{},e.json.extensions[Gt]={variants:i},this}},{G:kz}=hn,Dz=class extends Pe{static EXTENSION_NAME=kr;init(){this.extensionName=kr,this.propertyType="Volume",this.parentTypes=[ne.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new qe(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(t){return this.set("thicknessFactor",t)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(t){return this.setRef("thicknessTexture",t,{channels:kz})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(t){return this.set("attenuationDistance",t)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(t){return this.set("attenuationColor",t)}},Lz=class extends Le{static EXTENSION_NAME=kr;extensionName=kr;prereadTypes=[ne.MESH];prewriteTypes=[ne.MESH];createVolume(){return new Dz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_volume){let o=this.createVolume();t.materials[s].setExtension(kr,o);let a=n.extensions[kr];if(a.extras&&o.setExtras(a.extras),a.thicknessFactor!==void 0&&o.setThicknessFactor(a.thicknessFactor),a.attenuationDistance!==void 0&&o.setAttenuationDistance(a.attenuationDistance),a.attenuationColor!==void 0&&o.setAttenuationColor(a.attenuationColor),a.thicknessTexture!==void 0){let c=a.thicknessTexture,l=t.textures[i[c.index].source];o.setThicknessTexture(l),t.setTextureInfo(o.getThicknessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(kr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[kr]=o,i.getThicknessFactor()>0&&(o.thicknessFactor=i.getThicknessFactor()),Number.isFinite(i.getAttenuationDistance())&&(o.attenuationDistance=i.getAttenuationDistance()),Ke.eq(i.getAttenuationColor(),[1,1,1])||(o.attenuationColor=i.getAttenuationColor()),i.getThicknessTexture()){let a=i.getThicknessTexture(),c=i.getThicknessTextureInfo();o.thicknessTexture=t.createTextureInfoDef(a,c);}}}),this}},Uz=class extends Le{extensionName=NR;static EXTENSION_NAME=NR;read(t){return this}write(t){return this}},Fz=class extends Le{extensionName=OR;static EXTENSION_NAME=OR;read(t){return this}write(t){return this}},Bz=class extends Pe{static EXTENSION_NAME=Dr;init(){this.extensionName=Dr,this.propertyType="Visibility",this.parentTypes=[ne.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{visible:true})}getVisible(){return this.get("visible")}setVisible(t){return this.set("visible",t)}},Vz=class extends Le{static EXTENSION_NAME=Dr;extensionName=Dr;createVisibility(){return new Bz(this.document.getGraph())}read(t){return (t.jsonDoc.json.nodes||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_node_visibility){let i=this.createVisibility();t.nodes[r].setExtension(Dr,i);let n=e.extensions[Dr];n.visible!==void 0&&i.setVisible(n.visible);}}),this}write(t){let e=t.jsonDoc;for(let r of this.document.getRoot().listNodes()){let i=r.getExtension(Dr);if(!i)continue;let n=t.nodeIndexMap.get(r),s=e.json.nodes[n];s.extensions=s.extensions||{},s.extensions[Dr]={visible:i.getVisible()};}return this}};function jz(t){return t.vkFormat>0&&t.vkFormat<=123}function XR(t){let e=t.vkFormat===1000066e3&&t.dataFormatDescriptor[0].colorModel===167;return t.vkFormat===0||e}var Gz=class{match(t){return t[0]===171&&t[1]===75&&t[2]===84&&t[3]===88&&t[4]===32&&t[5]===50&&t[6]===48&&t[7]===187&&t[8]===13&&t[9]===10&&t[10]===26&&t[11]===10}getSize(t){let e=ph(t);return [e.pixelWidth,e.pixelHeight]}getChannels(t){let e=ph(t),r=e.dataFormatDescriptor[0];if(jz(e))return r.samples.length;if(XR(e))switch(r.colorModel){case 163:return r.samples.length===2&&(r.samples[1].channelType&15)===15?4:3;case 166:return (r.samples[0].channelType&15)===3?4:3;default:throw new Error(`Unexpected KTX2 colorModel, "${r.colorModel}".`)}throw new Error(`Unexpected KTX2 vkFormat, "${e.vkFormat}".`)}getVRAMByteLength(t){let e=ph(t),r=0;if(XR(e)){let i=this.getChannels(t)>3;for(let n=0;n<e.levels.length;n++){let s=e.levels[n];if(s.uncompressedByteLength)r+=s.uncompressedByteLength;else {let o=Math.max(1,Math.floor(e.pixelWidth/Math.pow(2,n))),a=Math.max(1,Math.floor(e.pixelHeight/Math.pow(2,n))),c=i?16:8;r+=o/4*(a/4)*c;}}}else for(let i of e.levels)e.supercompressionScheme===0?r+=i.levelData.byteLength:r+=i.uncompressedByteLength;return r}},Hz=class extends Le{static EXTENSION_NAME=_h;extensionName=_h;prereadTypes=[ne.TEXTURE];static register(){Tn.registerFormat("image/ktx2",new Gz);}preread(t){return t.jsonDoc.json.textures&&t.jsonDoc.json.textures.forEach(e=>{e.extensions&&e.extensions.KHR_texture_basisu&&(e.source=e.extensions[_h].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/ktx2"){let i=t.imageIndexMap.get(r);e.json.textures.forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[_h]={source:n.source},delete n.source);});}}),this}},qz=class extends Pe{static EXTENSION_NAME=Lr;init(){this.extensionName=Lr,this.propertyType="Transform",this.parentTypes=[ne.TEXTURE_INFO];}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getRotation(){return this.get("rotation")}setRotation(t){return this.set("rotation",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getTexCoord(){return this.get("texCoord")}setTexCoord(t){return this.set("texCoord",t)}},Wz=class extends Le{extensionName=Lr;static EXTENSION_NAME=Lr;createTransform(){return new qz(this.document.getGraph())}read(t){for(let[e,r]of Array.from(t.textureInfos.entries())){if(!r.extensions||!r.extensions.KHR_texture_transform)continue;let i=this.createTransform(),n=r.extensions[Lr];n.offset!==void 0&&i.setOffset(n.offset),n.rotation!==void 0&&i.setRotation(n.rotation),n.scale!==void 0&&i.setScale(n.scale),n.texCoord!==void 0&&i.setTexCoord(n.texCoord),e.setExtension(Lr,i);}return this}write(t){let e=Array.from(t.textureInfoDefMap.entries());for(let[r,i]of e){let n=r.getExtension(Lr);if(!n)continue;i.extensions=i.extensions||{};let s={},o=Ke.eq;o(n.getOffset(),[0,0])||(s.offset=n.getOffset()),n.getRotation()!==0&&(s.rotation=n.getRotation()),o(n.getScale(),[1,1])||(s.scale=n.getScale()),n.getTexCoord()!=null&&(s.texCoord=n.getTexCoord()),i.extensions[Lr]=s;}return this}},Kz=[ne.ROOT,ne.SCENE,ne.NODE,ne.MESH,ne.MATERIAL,ne.TEXTURE,ne.ANIMATION],Zz=class extends Pe{static EXTENSION_NAME=fn;init(){this.extensionName=fn,this.propertyType="Packet",this.parentTypes=Kz;}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(t){return this.set("context",{...t})}listProperties(){return Object.keys(this.get("properties"))}getProperty(t){let e=this.get("properties");return t in e?e[t]:null}setProperty(t,e){this._assertContext(t);let r={...this.get("properties")};return e?r[t]=e:delete r[t],this.set("properties",r)}toJSONLD(){return {"@context":my(this.get("context")),...my(this.get("properties"))}}fromJSONLD(t){t=my(t);let e=t["@context"];return e&&this.set("context",e),delete t["@context"],this.set("properties",t)}_assertContext(t){if(!(t.split(":")[0]in this.get("context")))throw new Error(`${fn}: Missing context for term, "${t}".`)}};function my(t){return JSON.parse(JSON.stringify(t))}var Xz=class extends Le{extensionName=fn;static EXTENSION_NAME=fn;createPacket(){return new Zz(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(t){let e=t.jsonDoc.json.extensions?.[fn];if(!e||!e.packets)return this;let r=t.jsonDoc.json,i=this.document.getRoot(),n=e.packets.map(a=>this.createPacket().fromJSONLD(a)),s=[[r.asset],r.scenes,r.nodes,r.meshes,r.materials,r.images,r.animations],o=[[i],i.listScenes(),i.listNodes(),i.listMeshes(),i.listMaterials(),i.listTextures(),i.listAnimations()];for(let a=0;a<s.length;a++){let c=s[a]||[];for(let l=0;l<c.length;l++){let u=c[l];if(u.extensions&&u.extensions.KHR_xmp_json_ld){let d=u.extensions[fn];o[a][l].setExtension(fn,n[d.packet]);}}}return this}write(t){let{json:e}=t.jsonDoc,r=[];for(let i of this.properties){r.push(i.toJSONLD());for(let n of i.listParents()){let s;switch(n.propertyType){case ne.ROOT:s=e.asset;break;case ne.SCENE:s=e.scenes[t.sceneIndexMap.get(n)];break;case ne.NODE:s=e.nodes[t.nodeIndexMap.get(n)];break;case ne.MESH:s=e.meshes[t.meshIndexMap.get(n)];break;case ne.MATERIAL:s=e.materials[t.materialIndexMap.get(n)];break;case ne.TEXTURE:s=e.images[t.imageIndexMap.get(n)];break;case ne.ANIMATION:s=e.animations[t.animationIndexMap.get(n)];break;default:s=null,this.document.getLogger().warn(`[${fn}]: Unsupported parent property, "${n.propertyType}"`);break}s&&(s.extensions=s.extensions||{},s.extensions[fn]={packet:r.length-1});}}return r.length>0&&(e.extensions=e.extensions||{},e.extensions[fn]={packets:r}),this}},Jz=[CO,PO,BO,jO,KO,JO,rz,sz,az,lz,fz,mz,Mz,xz,Cz,Nz,$z,Lz,Uz,Fz,Vz,Hz,Wz,Xz],Qt=[AN,TN,UN,eO,MO,IO,...Jz];function rE(t,e,r){if(r.getRoot().listSkins().length>0)throw new Error("The attached GLB is rigged; attach a prop, or bake it into the host first.");if(r.getRoot().listAnimations().length>0)throw new Error("The attached GLB has its own clips; a prop is posed by its bone, not by clips.");if(r.getRoot().listCameras().length>0)throw new Error("The attached GLB carries a camera; attach a prop, not a scene.");let i=t.createNode(e),s=r.getRoot().listScenes()[0]?.listChildren()??r.getRoot().listNodes();for(let o of s)i.addChild(iE(t,o));return i}function Yz(t){return t.getRoot().listBuffers()[0]??t.createBuffer()}function Qz(t){let e=t.getElementSize(),i=t.getArray()?.constructor??Float32Array,n=new i(t.getCount()*e),s=[];for(let o=0;o<t.getCount();o+=1)t.getElement(o,s),n.set(s,o*e);return n}function yy(t,e){if(e.getArray()===null&&!e.getSparse())throw new Error(`Accessor '${e.getName()}' carries no data.`);return t.createAccessor(e.getName()).setType(e.getType()).setArray(Qz(e)).setNormalized(e.getNormalized()).setBuffer(Yz(t))}function e$(t,e){let r=t.createTexture(e.getName()).setMimeType(e.getMimeType()),i=e.getImage();return i!==null&&r.setImage(new Uint8Array(i)),r}function t$(t,e,r,i,n){let s=e===null?null:e$(t,e);n(s),!(r===null||i===null)&&i.setMagFilter(r.getMagFilter()).setMinFilter(r.getMinFilter()).setWrapS(r.getWrapS()).setWrapT(r.getWrapT());}function n$(t,e){let r=t.createMaterial(e.getName()).setAlpha(e.getAlpha()).setAlphaCutoff(e.getAlphaCutoff()).setAlphaMode(e.getAlphaMode()).setBaseColorFactor([...e.getBaseColorFactor()]).setDoubleSided(e.getDoubleSided()).setEmissiveFactor([...e.getEmissiveFactor()]).setMetallicFactor(e.getMetallicFactor()).setNormalScale(e.getNormalScale()).setOcclusionStrength(e.getOcclusionStrength()).setRoughnessFactor(e.getRoughnessFactor()),i=[[e.getBaseColorTexture(),e.getBaseColorTextureInfo(),()=>r.getBaseColorTextureInfo(),n=>r.setBaseColorTexture(n)],[e.getEmissiveTexture(),e.getEmissiveTextureInfo(),()=>r.getEmissiveTextureInfo(),n=>r.setEmissiveTexture(n)],[e.getMetallicRoughnessTexture(),e.getMetallicRoughnessTextureInfo(),()=>r.getMetallicRoughnessTextureInfo(),n=>r.setMetallicRoughnessTexture(n)],[e.getNormalTexture(),e.getNormalTextureInfo(),()=>r.getNormalTextureInfo(),n=>r.setNormalTexture(n)],[e.getOcclusionTexture(),e.getOcclusionTextureInfo(),()=>r.getOcclusionTextureInfo(),n=>r.setOcclusionTexture(n)]];for(let[n,s,o,a]of i)t$(t,n,s,o(),a);return r}function r$(t,e){let r=t.createPrimitive().setMode(e.getMode());for(let s of e.listSemantics()){let o=e.getAttribute(s);o!==null&&r.setAttribute(s,yy(t,o));}let i=e.getIndices();i!==null&&r.setIndices(yy(t,i));let n=e.getMaterial();n!==null&&r.setMaterial(n$(t,n));for(let s of e.listTargets()){let o=t.createPrimitiveTarget();for(let a of s.listSemantics()){let c=s.getAttribute(a);c!==null&&o.setAttribute(a,yy(t,c));}r.addTarget(o);}return r}function i$(t,e){let r=t.createMesh(e.getName());for(let i of e.listPrimitives())r.addPrimitive(r$(t,i));return r}function iE(t,e){let r=t.createNode(e.getName()).setTranslation([...e.getTranslation()]).setRotation([...e.getRotation()]).setScale([...e.getScale()]),i=e.getMesh();i!==null&&r.setMesh(i$(t,i));for(let n of e.listChildren())r.addChild(iE(t,n));return r}var sE=t=>({attachment:"attached",keyframes:[t]});function oE(t){if(t.version===3)return t;if(t.version===2)return {anchor:t.anchor,animations:Object.fromEntries(Object.entries(t.animations).map(([e,r])=>[e,sE(r)])),attached:t.attached,...t.default===void 0?{}:{default:sE(t.default)},host:t.host,version:3}}function aE(t,e){let r=[...t?.keyframes??[]].filter(i=>Math.abs(i.time-e.time)>5e-4);return r.push(e),r.sort((i,n)=>i.time-n.time),{attachment:t?.attachment??"attached",keyframes:r}}var by="$default",Na=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function xy(t,e,r){if(!Array.isArray(t)||t.length!==e||!t.every(i=>Number.isFinite(i)))throw new Error(`${r} must be ${e} finite numbers.`);return t}function a$(t){if(!Na(t))throw new Error("A key op needs a transform object.");return {position:xy(t.position,3,"transform.position"),rotation:xy(t.rotation,3,"transform.rotation"),scale:xy(t.scale,3,"transform.scale")}}function c$(t){if(!Na(t))throw new Error("An attach op needs an anchor object.");let{id:e,label:r,node:i,source:n}=t;if(typeof e!="string"||typeof r!="string"||typeof i!="string")throw new Error("An anchor needs a string id, label and node.");if(n!=="detected"&&n!=="estimated")throw new Error("An anchor source is 'detected' or 'estimated'.");return {id:e,label:r,node:i,source:n}}function l$(t){if(t!==void 0){if(t!=="attached"&&t!=="detached")throw new Error("A key op attachment is 'attached' or 'detached'.");return t}}function u$(t){if(!Na(t))throw new Error("A modify op needs an edit object.");let e=(r,i)=>{if(typeof r!="number"||!Number.isFinite(r))throw new Error(`A ${t.kind} edit needs a finite ${i}.`);return r};switch(t.kind){case "trim":{let r=e(t.start,"start"),i=e(t.end,"end");if(r<0||i<=r)throw new Error("trim needs 0 <= start < end.");return {end:i,kind:"trim",start:r}}case "retime":{let r=e(t.speed,"speed");if(r<=0)throw new Error("retime needs a speed above zero.");return {kind:"retime",speed:r}}case "loop-point":{let r=e(t.time,"time");if(r<0)throw new Error("A loop point cannot be before the clip starts.");return {kind:"loop-point",time:r}}case "resample":{let r=e(t.fps,"fps");if(r<=0)throw new Error("resample needs an fps above zero.");return {fps:r,kind:"resample"}}case "mirror":return {kind:"mirror"};case "foot-lock":{let r=e(t.contact,"contact"),i=t.feet;if(!Array.isArray(i)||!i.every(n=>typeof n=="string"))throw new Error("foot-lock names its feet as strings.");return {contact:r,feet:i,kind:"foot-lock"}}default:throw new Error(`Unknown clip edit '${String(t.kind)}'.`)}}function d$(t){if(!Na(t))throw new Error("Every op must be an object.");if(t.op==="attach"){if(typeof t.attached!="string"||t.attached.length===0)throw new Error("An attach op names the attached GLB.");return {anchor:c$(t.anchor),attached:t.attached,op:"attach"}}if(t.op==="modify"){if(typeof t.clip!="string"||t.clip.length===0)throw new Error("A modify op names its clip.");return {clip:t.clip,edit:u$(t.edit),op:"modify"}}if(t.op==="key"){if(typeof t.clip!="string"||t.clip.length===0)throw new Error("A key op names its clip.");if(typeof t.time!="number"||!Number.isFinite(t.time)||t.time<0)throw new Error("A key op needs a finite time of zero or more.");let e=l$(t.attachment);return {clip:t.clip,op:"key",time:t.time,transform:a$(t.transform),...e===void 0?{}:{attachment:e}}}throw new Error(`Unknown animation op '${String(t.op)}'.`)}function h$(t){if(t===void 0)throw new Error("Unsupported animation recipe version.");let e=[{anchor:t.anchor,attached:t.attached,op:"attach"}],r=[];t.default!==void 0&&r.push([by,t.default]);for(let i of Object.keys(t.animations).sort((n,s)=>n.localeCompare(s)))r.push([i,t.animations[i]]);for(let[i,n]of r)for(let s of [...n.keyframes].sort((o,a)=>o.time-a.time))e.push({attachment:n.attachment,clip:i,op:"key",time:s.time,transform:s.transform});return {host:t.host,ops:e,version:4}}function Ty(t){if(!Na(t))throw new Error("An animation log must be a JSON object.");if(typeof t.host!="string"||t.host.length===0)throw new Error("An animation log names its host GLB.");if(t.version===4){if(!Array.isArray(t.ops)||t.ops.length===0)throw new Error("An animation log needs at least one op.");return {host:t.host,ops:t.ops.map(e=>d$(e)),version:4}}if(t.version===3||t.version===2)return h$(oE(t));throw new Error(`Unsupported animation log version '${String(t.version)}'.`)}function cE(t){let e,r,i={};for(let n of t.ops){if(n.op==="attach"){e=n.anchor,r=n.attached;continue}if(n.op==="modify")continue;let s=aE(i[n.clip],{time:n.time,transform:n.transform});i[n.clip]=n.attachment===void 0?s:{attachment:n.attachment,keyframes:s.keyframes};}if(e===void 0||r===void 0)throw new Error("An animation log starts with an attach op naming the prop and its bone.");return {anchor:e,attached:r,host:t.host,poses:i}}function Ry(t,e){return {host:t.host,ops:[...t.ops,e],version:4}}function Ey(t){let e=Gr.parse(Gr.resolve(t));return Gr.join(e.dir,`${e.name}.anim.json`)}async function lE(t){let e;try{e=await readFile(t,"utf8");}catch(r){throw new Error(`Cannot read animation log ${t}: ${r instanceof Error?r.message:String(r)}`)}return Ty(JSON.parse(e))}async function wy(t,e){await writeFile(t,`${JSON.stringify(e,null,2)}
|
|
76
|
-
`,"utf8");}var My=t=>t*Math.PI/180;function p$(t){let[e,r,i]=[My(t[0]),My(t[1]),My(t[2])],[n,s,o]=[Math.cos(e/2),Math.cos(r/2),Math.cos(i/2)],[a,c,l]=[Math.sin(e/2),Math.sin(r/2),Math.sin(i/2)];return [a*s*o+n*c*l,n*c*o-a*s*l,n*s*l+a*c*o,n*s*o-a*c*l]}function m$(t){return t.getRoot().listBuffers()[0]??t.createBuffer()}function uE(t,e,r,i){return t.createAccessor(e).setArray(r).setType(i).setBuffer(m$(t))}function dE(t){return {rotation:p$(t.rotation),scale:t.scale,translation:t.position}}function g$(t,e,r,i,n,s){let o=uE(t,`${e.getName()}.${i}.time`,new Float32Array(n),"SCALAR"),a=uE(t,`${e.getName()}.${i}`,s,i==="rotation"?"VEC4":"VEC3"),c=t.createAnimationSampler().setInput(o).setOutput(a).setInterpolation("LINEAR");e.addSampler(c),e.addChannel(t.createAnimationChannel().setTargetNode(r).setTargetPath(i).setSampler(c));}function _$(t,e,r,i){let n=[...i.keyframes].sort((c,l)=>c.time-l.time),s=n.map(c=>c.time),o=n.map(c=>dE(c.transform)),a=[["rotation",4],["scale",3],["translation",3]];for(let[c,l]of a){let u=new Float32Array(o.length*l);o.forEach((d,f)=>u.set(d[c],f*l)),g$(t,e,r,c,s,u);}}async function Ay(t,e){let r=cE(e),n=await new Jt().registerExtensions(Qt).read(r.attached),s=t.getRoot().listNodes().find(f=>f.getName()===r.anchor.node);if(s===void 0)throw new Error(`The host has no bone named '${r.anchor.node}' to attach to.`);let o=Gr.parse(r.attached).name,a=rE(t,`attach-${o}`,n);s.addChild(a);let l=[...r.poses[by]?.keyframes??[]].sort((f,p)=>f.time-p.time)[0];if(l!==void 0){let f=dE(l.transform);a.setTranslation(f.translation).setRotation(f.rotation).setScale(f.scale);}let u=[],d=[];for(let f of t.getRoot().listAnimations()){let p=f.getName(),g=r.poses[p];if(!(g===void 0||g.keyframes.length===0)){if(g.attachment==="detached"){d.push(p);continue}u.push(p),_$(t,f,a,g);}}return {anchor:s.getName(),attached:r.attached,clips:u,detached:d,node:a.getName()}}async function hE(t,e){let r=await new Jt().registerExtensions(Qt).read(t.host),i=await Ay(r,t);return await mkdir(Gr.dirname(Gr.resolve(e)),{recursive:true}),await new Jt().registerExtensions(Qt).write(e,r),{...i,file:Gr.resolve(e)}}var yh=[{id:"right-hand",label:"Right hand",patterns:[/righthand/u,/handright/u,/rhand/u]},{id:"left-hand",label:"Left hand",patterns:[/lefthand/u,/handleft/u,/lhand/u]},{id:"head",label:"Head",patterns:[/head/u]},{id:"hips",label:"Hips / root",patterns:[/hips/u,/pelvis/u,/^root$/u]},{id:"right-foot",label:"Right foot",patterns:[/rightfoot/u,/footright/u,/rfoot/u]},{id:"left-foot",label:"Left foot",patterns:[/leftfoot/u,/footleft/u,/lfoot/u]}];function Iy(t){return t.toLowerCase().replaceAll(/[^a-z0-9]/gu,"")}function v$(t,e){return e.filter(r=>t.patterns.some(i=>i.test(Iy(r)))).sort((r,i)=>Iy(r).length-Iy(i).length)[0]}function Sh(t){return yh.flatMap(e=>{let r=v$(e,t);return r===void 0?[]:[{id:e.id,label:e.label,node:r,source:"detected"}]})}var S$=.01,x$=()=>new Jt().registerExtensions(Qt);function b$(t){let r=t.getRoot().listSkins().flatMap(n=>n.listJoints())[0];return r!==void 0?r.getName():t.getRoot().listNodes().find(n=>/hips|pelvis|root/iu.test(n.getName()))?.getName()??null}function T$(t){let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of t)i<e&&(e=i),i>r&&(r=i);return {max:r,min:e}}function R$(t,e){let r=new Map;if(e===null)return r;for(let i of t.getRoot().listAnimations()){let n=0;for(let s of i.listChannels()){if(s.getTargetNode()?.getName()!==e||s.getTargetPath()!=="translation")continue;let o=s.getSampler()?.getOutput()?.getArray();if(o==null||o.length<6)continue;let a=[o[0]??0,o[2]??0];for(let c=0;c+2<o.length;c+=3){let l=(o[c]??0)-a[0],u=(o[c+2]??0)-(a[1]??0);n=Math.max(n,Math.hypot(l,u));}}r.set(i.getName(),n);}return r}async function Cy(t){let e=(await stat(t)).size,r=await x$().read(t),i=r.getRoot(),n=[],s=i.listSkins(),o=s.flatMap(f=>f.listJoints().map(p=>p.getName())),a=i.listNodes().map(f=>f.getName()),c=o.length>0?o:a.filter(f=>f.length>0);s.length===0&&n.push("No skin: the model is not rigged."),i.listAnimations().length===0&&n.push("No animation clip: nothing to verify.");let l=b$(r),u=R$(r,l),d=i.listAnimations().map(f=>{let p=0;for(let m of f.listSamplers()){let S=m.getInput()?.getArray();S!==void 0&&(p=Math.max(p,T$(S).max));}let g=Math.round((u.get(f.getName())??0)*1e4)/1e4;return {channels:f.listChannels().length,duration:Math.round(p*1e4)/1e4,horizontalTravel:g,inPlace:g<=S$,name:f.getName()}}).sort((f,p)=>f.name.localeCompare(p.name));return {bones:c,bytes:e,clips:d,extensionsUsed:[...i.listExtensionsUsed().map(f=>f.extensionName)].sort((f,p)=>f.localeCompare(p)),file:t,generator:i.getAsset().generator??"",inPlace:d.every(f=>f.inPlace),landmarks:Sh(c),meshes:i.listMeshes().length,rootBone:l,skins:s.length,warnings:n}}var p0="",tn="srgb",Yy="srgb-linear",Qy="linear",wh="srgb";var $a=2e3,e0=2001;var fE={};function kE(t){let e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){let r=t[1];r&&r.isStackTrace?t[0]+=" "+r.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.';}return t}function Rt(...t){t=kE(t);let e="THREE."+t.shift();{let r=t[0];r&&r.isStackTrace?console.warn(r.getError(e)):console.warn(e,...t);}}function zs(...t){let e=t.join(" ");e in fE||(fE[e]=true,Rt(...t));}function ke(t,e,r){return Math.max(e,Math.min(r,t))}function A$(t,e){return (t%e+e)%e}function Py(t,e,r){return (1-r)*t+r*e}var mn=class t{static{t.prototype.isVector2=true;}constructor(e=0,r=0){this.x=e,this.y=r;}get width(){return this.x}set width(e){this.x=e;}get height(){return this.y}set height(e){this.y=e;}set(e,r){return this.x=e,this.y=r,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this}addScaledVector(e,r){return this.x+=e.x*r,this.y+=e.y*r,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let r=this.x,i=this.y,n=e.elements;return this.x=n[0]*r+n[3]*i+n[6],this.y=n[1]*r+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,r){return this.x=ke(this.x,e.x,r.x),this.y=ke(this.y,e.y,r.y),this}clampScalar(e,r){return this.x=ke(this.x,e,r),this.y=ke(this.y,e,r),this}clampLength(e,r){let i=this.length();return this.divideScalar(i||1).multiplyScalar(ke(i,e,r))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let r=Math.sqrt(this.lengthSq()*e.lengthSq());if(r===0)return Math.PI/2;let i=this.dot(e)/r;return Math.acos(ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let r=this.x-e.x,i=this.y-e.y;return r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this}lerpVectors(e,r,i){return this.x=e.x+(r.x-e.x)*i,this.y=e.y+(r.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,r=0){return this.x=e[r],this.y=e[r+1],this}toArray(e=[],r=0){return e[r]=this.x,e[r+1]=this.y,e}fromBufferAttribute(e,r){return this.x=e.getX(r),this.y=e.getY(r),this}rotateAround(e,r){let i=Math.cos(r),n=Math.sin(r),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*n+e.x,this.y=s*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y;}},Pt=class{constructor(e=0,r=0,i=0,n=1){this.isQuaternion=true,this._x=e,this._y=r,this._z=i,this._w=n;}static slerpFlat(e,r,i,n,s,o,a){let c=i[n+0],l=i[n+1],u=i[n+2],d=i[n+3],f=s[o+0],p=s[o+1],g=s[o+2],m=s[o+3];if(d!==m||c!==f||l!==p||u!==g){let S=c*f+l*p+u*g+d*m;S<0&&(f=-f,p=-p,g=-g,m=-m,S=-S);let h=1-a;if(S<.9995){let v=Math.acos(S),_=Math.sin(v);h=Math.sin(h*v)/_,a=Math.sin(a*v)/_,c=c*h+f*a,l=l*h+p*a,u=u*h+g*a,d=d*h+m*a;}else {c=c*h+f*a,l=l*h+p*a,u=u*h+g*a,d=d*h+m*a;let v=1/Math.sqrt(c*c+l*l+u*u+d*d);c*=v,l*=v,u*=v,d*=v;}}e[r]=c,e[r+1]=l,e[r+2]=u,e[r+3]=d;}static multiplyQuaternionsFlat(e,r,i,n,s,o){let a=i[n],c=i[n+1],l=i[n+2],u=i[n+3],d=s[o],f=s[o+1],p=s[o+2],g=s[o+3];return e[r]=a*g+u*d+c*p-l*f,e[r+1]=c*g+u*f+l*d-a*p,e[r+2]=l*g+u*p+a*f-c*d,e[r+3]=u*g-a*d-c*f-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback();}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback();}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback();}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback();}set(e,r,i,n){return this._x=e,this._y=r,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,r=true){let i=e._x,n=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(i/2),u=a(n/2),d=a(s/2),f=c(i/2),p=c(n/2),g=c(s/2);switch(o){case "XYZ":this._x=f*u*d+l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d-f*p*g;break;case "YXZ":this._x=f*u*d+l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d+f*p*g;break;case "ZXY":this._x=f*u*d-l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d-f*p*g;break;case "ZYX":this._x=f*u*d-l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d+f*p*g;break;case "YZX":this._x=f*u*d+l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d-f*p*g;break;case "XZY":this._x=f*u*d-l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d+f*p*g;break;default:Rt("Quaternion: .setFromEuler() encountered an unknown order: "+o);}return r===true&&this._onChangeCallback(),this}setFromAxisAngle(e,r){let i=r/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let r=e.elements,i=r[0],n=r[4],s=r[8],o=r[1],a=r[5],c=r[9],l=r[2],u=r[6],d=r[10],f=i+a+d;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-c)*p,this._y=(s-l)*p,this._z=(o-n)*p;}else if(i>a&&i>d){let p=2*Math.sqrt(1+i-a-d);this._w=(u-c)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(s+l)/p;}else if(a>d){let p=2*Math.sqrt(1+a-i-d);this._w=(s-l)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(c+u)/p;}else {let p=2*Math.sqrt(1+d-i-a);this._w=(o-n)/p,this._x=(s+l)/p,this._y=(c+u)/p,this._z=.25*p;}return this._onChangeCallback(),this}setFromUnitVectors(e,r){let i=e.dot(r)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*r.z-e.z*r.y,this._y=e.z*r.x-e.x*r.z,this._z=e.x*r.y-e.y*r.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(ke(this.dot(e),-1,1)))}rotateTowards(e,r){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,r/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,r){let i=e._x,n=e._y,s=e._z,o=e._w,a=r._x,c=r._y,l=r._z,u=r._w;return this._x=i*u+o*a+n*l-s*c,this._y=n*u+o*c+s*a-i*l,this._z=s*u+o*l+i*c-n*a,this._w=o*u-i*a-n*c-s*l,this._onChangeCallback(),this}slerp(e,r){let i=e._x,n=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(i=-i,n=-n,s=-s,o=-o,a=-a);let c=1-r;if(a<.9995){let l=Math.acos(a),u=Math.sin(l);c=Math.sin(c*l)/u,r=Math.sin(r*l)/u,this._x=this._x*c+i*r,this._y=this._y*c+n*r,this._z=this._z*c+s*r,this._w=this._w*c+o*r,this._onChangeCallback();}else this._x=this._x*c+i*r,this._y=this._y*c+n*r,this._z=this._z*c+s*r,this._w=this._w*c+o*r,this.normalize();return this}slerpQuaternions(e,r,i){return this.copy(e).slerp(r,i)}random(){let e=2*Math.PI*Math.random(),r=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),s*Math.sin(r),s*Math.cos(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,r=0){return this._x=e[r],this._y=e[r+1],this._z=e[r+2],this._w=e[r+3],this._onChangeCallback(),this}toArray(e=[],r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,e}fromBufferAttribute(e,r){return this._x=e.getX(r),this._y=e.getY(r),this._z=e.getZ(r),this._w=e.getW(r),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w;}},Ue=class t{static{t.prototype.isVector3=true;}constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.z=i;}set(e,r,i){return i===void 0&&(i=this.z),this.x=e,this.y=r,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this.z=e.z+r.z,this}addScaledVector(e,r){return this.x+=e.x*r,this.y+=e.y*r,this.z+=e.z*r,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this.z=e.z-r.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,r){return this.x=e.x*r.x,this.y=e.y*r.y,this.z=e.z*r.z,this}applyEuler(e){return this.applyQuaternion(pE.setFromEuler(e))}applyAxisAngle(e,r){return this.applyQuaternion(pE.setFromAxisAngle(e,r))}applyMatrix3(e){let r=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*r+s[3]*i+s[6]*n,this.y=s[1]*r+s[4]*i+s[7]*n,this.z=s[2]*r+s[5]*i+s[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let r=this.x,i=this.y,n=this.z,s=e.elements,o=1/(s[3]*r+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*r+s[4]*i+s[8]*n+s[12])*o,this.y=(s[1]*r+s[5]*i+s[9]*n+s[13])*o,this.z=(s[2]*r+s[6]*i+s[10]*n+s[14])*o,this}applyQuaternion(e){let r=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*n-a*i),u=2*(a*r-s*n),d=2*(s*i-o*r);return this.x=r+c*l+o*d-a*u,this.y=i+c*u+a*l-s*d,this.z=n+c*d+s*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let r=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*r+s[4]*i+s[8]*n,this.y=s[1]*r+s[5]*i+s[9]*n,this.z=s[2]*r+s[6]*i+s[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,r){return this.x=ke(this.x,e.x,r.x),this.y=ke(this.y,e.y,r.y),this.z=ke(this.z,e.z,r.z),this}clampScalar(e,r){return this.x=ke(this.x,e,r),this.y=ke(this.y,e,r),this.z=ke(this.z,e,r),this}clampLength(e,r){let i=this.length();return this.divideScalar(i||1).multiplyScalar(ke(i,e,r))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this.z+=(e.z-this.z)*r,this}lerpVectors(e,r,i){return this.x=e.x+(r.x-e.x)*i,this.y=e.y+(r.y-e.y)*i,this.z=e.z+(r.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,r){let i=e.x,n=e.y,s=e.z,o=r.x,a=r.y,c=r.z;return this.x=n*c-s*a,this.y=s*o-i*c,this.z=i*a-n*o,this}projectOnVector(e){let r=e.lengthSq();if(r===0)return this.set(0,0,0);let i=e.dot(this)/r;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Ny.copy(this).projectOnVector(e),this.sub(Ny)}reflect(e){return this.sub(Ny.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let r=Math.sqrt(this.lengthSq()*e.lengthSq());if(r===0)return Math.PI/2;let i=this.dot(e)/r;return Math.acos(ke(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let r=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return r*r+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,r,i){let n=Math.sin(r)*e;return this.x=n*Math.sin(i),this.y=Math.cos(r)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,r,i){return this.x=e*Math.sin(r),this.y=i,this.z=e*Math.cos(r),this}setFromMatrixPosition(e){let r=e.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this}setFromMatrixScale(e){let r=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=r,this.y=i,this.z=n,this}setFromMatrixColumn(e,r){return this.fromArray(e.elements,r*4)}setFromMatrix3Column(e,r){return this.fromArray(e.elements,r*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,r=0){return this.x=e[r],this.y=e[r+1],this.z=e[r+2],this}toArray(e=[],r=0){return e[r]=this.x,e[r+1]=this.y,e[r+2]=this.z,e}fromBufferAttribute(e,r){return this.x=e.getX(r),this.y=e.getY(r),this.z=e.getZ(r),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,r=Math.random()*2-1,i=Math.sqrt(1-r*r);return this.x=i*Math.cos(e),this.y=r,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z;}},Ny=new Ue,pE=new Pt,Ne=class t{static{t.prototype.isMatrix3=true;}constructor(e,r,i,n,s,o,a,c,l){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,r,i,n,s,o,a,c,l);}set(e,r,i,n,s,o,a,c,l){let u=this.elements;return u[0]=e,u[1]=n,u[2]=a,u[3]=r,u[4]=s,u[5]=c,u[6]=i,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let r=this.elements,i=e.elements;return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],this}extractBasis(e,r,i){return e.setFromMatrix3Column(this,0),r.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let r=e.elements;return this.set(r[0],r[4],r[8],r[1],r[5],r[9],r[2],r[6],r[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,r){let i=e.elements,n=r.elements,s=this.elements,o=i[0],a=i[3],c=i[6],l=i[1],u=i[4],d=i[7],f=i[2],p=i[5],g=i[8],m=n[0],S=n[3],h=n[6],v=n[1],_=n[4],y=n[7],R=n[2],T=n[5],b=n[8];return s[0]=o*m+a*v+c*R,s[3]=o*S+a*_+c*T,s[6]=o*h+a*y+c*b,s[1]=l*m+u*v+d*R,s[4]=l*S+u*_+d*T,s[7]=l*h+u*y+d*b,s[2]=f*m+p*v+g*R,s[5]=f*S+p*_+g*T,s[8]=f*h+p*y+g*b,this}multiplyScalar(e){let r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=e,r[4]*=e,r[7]*=e,r[2]*=e,r[5]*=e,r[8]*=e,this}determinant(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return r*o*u-r*a*l-i*s*u+i*a*c+n*s*l-n*o*c}invert(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],d=u*o-a*l,f=a*c-u*s,p=l*s-o*c,g=r*d+i*f+n*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/g;return e[0]=d*m,e[1]=(n*l-u*i)*m,e[2]=(a*i-n*o)*m,e[3]=f*m,e[4]=(u*r-n*c)*m,e[5]=(n*s-a*r)*m,e[6]=p*m,e[7]=(i*c-l*r)*m,e[8]=(o*r-i*s)*m,this}transpose(){let e,r=this.elements;return e=r[1],r[1]=r[3],r[3]=e,e=r[2],r[2]=r[6],r[6]=e,e=r[5],r[5]=r[7],r[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let r=this.elements;return e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8],this}setUvTransform(e,r,i,n,s,o,a){let c=Math.cos(s),l=Math.sin(s);return this.set(i*c,i*l,-i*(c*o+l*a)+o+e,-n*l,n*c,-n*(-l*o+c*a)+a+r,0,0,1),this}scale(e,r){return zs("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(Oy.makeScale(e,r)),this}rotate(e){return zs("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(Oy.makeRotation(-e)),this}translate(e,r){return zs("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(Oy.makeTranslation(e,r)),this}makeTranslation(e,r){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,r,0,0,1),this}makeRotation(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,-i,0,i,r,0,0,0,1),this}makeScale(e,r){return this.set(e,0,0,0,r,0,0,0,1),this}equals(e){let r=this.elements,i=e.elements;for(let n=0;n<9;n++)if(r[n]!==i[n])return false;return true}fromArray(e,r=0){for(let i=0;i<9;i++)this.elements[i]=e[i+r];return this}toArray(e=[],r=0){let i=this.elements;return e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},Oy=new Ne,mE=new Ne().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),gE=new Ne().set(3.2409699,-1.5373832,-0.4986108,-0.9692436,1.8759675,.0415551,.0556301,-0.203977,1.0569715);function I$(){let t={enabled:true,workingColorSpace:Yy,spaces:{},convert:function(n,s,o){return this.enabled===false||s===o||!s||!o||(this.spaces[s].transfer===wh&&(n.r=Vn(n.r),n.g=Vn(n.g),n.b=Vn(n.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(n.applyMatrix3(this.spaces[s].toXYZ),n.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wh&&(n.r=$s(n.r),n.g=$s(n.g),n.b=$s(n.b))),n},workingToColorSpace:function(n,s){return this.convert(n,this.workingColorSpace,s)},colorSpaceToWorking:function(n,s){return this.convert(n,s,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===p0?Qy:this.spaces[n].transfer},getToneMappingMode:function(n){return this.spaces[n].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(n,s=this.workingColorSpace){return n.fromArray(this.spaces[s].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n);},_getMatrix:function(n,s,o){return n.copy(this.spaces[s].toXYZ).multiply(this.spaces[o].fromXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(n,s){return zs("ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(n,s)},toWorkingColorSpace:function(n,s){return zs("ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(n,s)}},e=[.64,.33,.3,.6,.15,.06],r=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Yy]:{primaries:e,whitePoint:i,transfer:Qy,toXYZ:mE,fromXYZ:gE,luminanceCoefficients:r,workingColorSpaceConfig:{unpackColorSpace:tn},outputColorSpaceConfig:{drawingBufferColorSpace:tn}},[tn]:{primaries:e,whitePoint:i,transfer:wh,toXYZ:mE,fromXYZ:gE,luminanceCoefficients:r,outputColorSpaceConfig:{drawingBufferColorSpace:tn}}}),t}var en=I$();function Vn(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function $s(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}(class t{static{t.prototype.isVector4=true;}constructor(e=0,r=0,i=0,n=1){this.x=e,this.y=r,this.z=i,this.w=n;}get width(){return this.z}set width(e){this.z=e;}get height(){return this.w}set height(e){this.w=e;}set(e,r,i,n){return this.x=e,this.y=r,this.z=i,this.w=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;case 3:this.w=r;break;default:throw new Error("THREE.Vector4: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("THREE.Vector4: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this.z=e.z+r.z,this.w=e.w+r.w,this}addScaledVector(e,r){return this.x+=e.x*r,this.y+=e.y*r,this.z+=e.z*r,this.w+=e.w*r,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this.z=e.z-r.z,this.w=e.w-r.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){let r=this.x,i=this.y,n=this.z,s=this.w,o=e.elements;return this.x=o[0]*r+o[4]*i+o[8]*n+o[12]*s,this.y=o[1]*r+o[5]*i+o[9]*n+o[13]*s,this.z=o[2]*r+o[6]*i+o[10]*n+o[14]*s,this.w=o[3]*r+o[7]*i+o[11]*n+o[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);let r=Math.sqrt(1-e.w*e.w);return r<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/r,this.y=e.y/r,this.z=e.z/r),this}setAxisAngleFromRotationMatrix(e){let r,i,n,s,c=e.elements,l=c[0],u=c[4],d=c[8],f=c[1],p=c[5],g=c[9],m=c[2],S=c[6],h=c[10];if(Math.abs(u-f)<.01&&Math.abs(d-m)<.01&&Math.abs(g-S)<.01){if(Math.abs(u+f)<.1&&Math.abs(d+m)<.1&&Math.abs(g+S)<.1&&Math.abs(l+p+h-3)<.1)return this.set(1,0,0,0),this;r=Math.PI;let _=(l+1)/2,y=(p+1)/2,R=(h+1)/2,T=(u+f)/4,b=(d+m)/4,E=(g+S)/4;return _>y&&_>R?_<.01?(i=0,n=.707106781,s=.707106781):(i=Math.sqrt(_),n=T/i,s=b/i):y>R?y<.01?(i=.707106781,n=0,s=.707106781):(n=Math.sqrt(y),i=T/n,s=E/n):R<.01?(i=.707106781,n=.707106781,s=0):(s=Math.sqrt(R),i=b/s,n=E/s),this.set(i,n,s,r),this}let v=Math.sqrt((S-g)*(S-g)+(d-m)*(d-m)+(f-u)*(f-u));return Math.abs(v)<.001&&(v=1),this.x=(S-g)/v,this.y=(d-m)/v,this.z=(f-u)/v,this.w=Math.acos((l+p+h-1)/2),this}setFromMatrixPosition(e){let r=e.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this.w=r[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,r){return this.x=ke(this.x,e.x,r.x),this.y=ke(this.y,e.y,r.y),this.z=ke(this.z,e.z,r.z),this.w=ke(this.w,e.w,r.w),this}clampScalar(e,r){return this.x=ke(this.x,e,r),this.y=ke(this.y,e,r),this.z=ke(this.z,e,r),this.w=ke(this.w,e,r),this}clampLength(e,r){let i=this.length();return this.divideScalar(i||1).multiplyScalar(ke(i,e,r))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this.z+=(e.z-this.z)*r,this.w+=(e.w-this.w)*r,this}lerpVectors(e,r,i){return this.x=e.x+(r.x-e.x)*i,this.y=e.y+(r.y-e.y)*i,this.z=e.z+(r.z-e.z)*i,this.w=e.w+(r.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,r=0){return this.x=e[r],this.y=e[r+1],this.z=e[r+2],this.w=e[r+3],this}toArray(e=[],r=0){return e[r]=this.x,e[r+1]=this.y,e[r+2]=this.z,e[r+3]=this.w,e}fromBufferAttribute(e,r){return this.x=e.getX(r),this.y=e.getY(r),this.z=e.getZ(r),this.w=e.getW(r),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w;}});var nn=class t{static{t.prototype.isMatrix4=true;}constructor(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S);}set(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S){let h=this.elements;return h[0]=e,h[4]=r,h[8]=i,h[12]=n,h[1]=s,h[5]=o,h[9]=a,h[13]=c,h[2]=l,h[6]=u,h[10]=d,h[14]=f,h[3]=p,h[7]=g,h[11]=m,h[15]=S,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new t().fromArray(this.elements)}copy(e){let r=this.elements,i=e.elements;return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],this}copyPosition(e){let r=this.elements,i=e.elements;return r[12]=i[12],r[13]=i[13],r[14]=i[14],this}setFromMatrix3(e){let r=e.elements;return this.set(r[0],r[3],r[6],0,r[1],r[4],r[7],0,r[2],r[5],r[8],0,0,0,0,1),this}extractBasis(e,r,i){return this.determinantAffine()===0?(e.set(1,0,0),r.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),r.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,r,i){return this.set(e.x,r.x,i.x,0,e.y,r.y,i.y,0,e.z,r.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let r=this.elements,i=e.elements,n=1/Ps.setFromMatrixColumn(e,0).length(),s=1/Ps.setFromMatrixColumn(e,1).length(),o=1/Ps.setFromMatrixColumn(e,2).length();return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=0,r[4]=i[4]*s,r[5]=i[5]*s,r[6]=i[6]*s,r[7]=0,r[8]=i[8]*o,r[9]=i[9]*o,r[10]=i[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromEuler(e){let r=this.elements,i=e.x,n=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),c=Math.cos(n),l=Math.sin(n),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){let f=o*u,p=o*d,g=a*u,m=a*d;r[0]=c*u,r[4]=-c*d,r[8]=l,r[1]=p+g*l,r[5]=f-m*l,r[9]=-a*c,r[2]=m-f*l,r[6]=g+p*l,r[10]=o*c;}else if(e.order==="YXZ"){let f=c*u,p=c*d,g=l*u,m=l*d;r[0]=f+m*a,r[4]=g*a-p,r[8]=o*l,r[1]=o*d,r[5]=o*u,r[9]=-a,r[2]=p*a-g,r[6]=m+f*a,r[10]=o*c;}else if(e.order==="ZXY"){let f=c*u,p=c*d,g=l*u,m=l*d;r[0]=f-m*a,r[4]=-o*d,r[8]=g+p*a,r[1]=p+g*a,r[5]=o*u,r[9]=m-f*a,r[2]=-o*l,r[6]=a,r[10]=o*c;}else if(e.order==="ZYX"){let f=o*u,p=o*d,g=a*u,m=a*d;r[0]=c*u,r[4]=g*l-p,r[8]=f*l+m,r[1]=c*d,r[5]=m*l+f,r[9]=p*l-g,r[2]=-l,r[6]=a*c,r[10]=o*c;}else if(e.order==="YZX"){let f=o*c,p=o*l,g=a*c,m=a*l;r[0]=c*u,r[4]=m-f*d,r[8]=g*d+p,r[1]=d,r[5]=o*u,r[9]=-a*u,r[2]=-l*u,r[6]=p*d+g,r[10]=f-m*d;}else if(e.order==="XZY"){let f=o*c,p=o*l,g=a*c,m=a*l;r[0]=c*u,r[4]=-d,r[8]=l*u,r[1]=f*d+m,r[5]=o*u,r[9]=p*d-g,r[2]=g*d-p,r[6]=a*u,r[10]=m*d+f;}return r[3]=0,r[7]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromQuaternion(e){return this.compose(N$,e,O$)}lookAt(e,r,i){let n=this.elements;return Ht.subVectors(e,r),Ht.lengthSq()===0&&(Ht.z=1),Ht.normalize(),Ur.crossVectors(i,Ht),Ur.lengthSq()===0&&(Math.abs(i.z)===1?Ht.x+=1e-4:Ht.z+=1e-4,Ht.normalize(),Ur.crossVectors(i,Ht)),Ur.normalize(),xh.crossVectors(Ht,Ur),n[0]=Ur.x,n[4]=xh.x,n[8]=Ht.x,n[1]=Ur.y,n[5]=xh.y,n[9]=Ht.y,n[2]=Ur.z,n[6]=xh.z,n[10]=Ht.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,r){let i=e.elements,n=r.elements,s=this.elements,o=i[0],a=i[4],c=i[8],l=i[12],u=i[1],d=i[5],f=i[9],p=i[13],g=i[2],m=i[6],S=i[10],h=i[14],v=i[3],_=i[7],y=i[11],R=i[15],T=n[0],b=n[4],E=n[8],M=n[12],N=n[1],O=n[5],k=n[9],j=n[13],G=n[2],Q=n[6],Se=n[10],ye=n[14],Fe=n[3],ve=n[7],P=n[11],U=n[15];return s[0]=o*T+a*N+c*G+l*Fe,s[4]=o*b+a*O+c*Q+l*ve,s[8]=o*E+a*k+c*Se+l*P,s[12]=o*M+a*j+c*ye+l*U,s[1]=u*T+d*N+f*G+p*Fe,s[5]=u*b+d*O+f*Q+p*ve,s[9]=u*E+d*k+f*Se+p*P,s[13]=u*M+d*j+f*ye+p*U,s[2]=g*T+m*N+S*G+h*Fe,s[6]=g*b+m*O+S*Q+h*ve,s[10]=g*E+m*k+S*Se+h*P,s[14]=g*M+m*j+S*ye+h*U,s[3]=v*T+_*N+y*G+R*Fe,s[7]=v*b+_*O+y*Q+R*ve,s[11]=v*E+_*k+y*Se+R*P,s[15]=v*M+_*j+y*ye+R*U,this}multiplyScalar(e){let r=this.elements;return r[0]*=e,r[4]*=e,r[8]*=e,r[12]*=e,r[1]*=e,r[5]*=e,r[9]*=e,r[13]*=e,r[2]*=e,r[6]*=e,r[10]*=e,r[14]*=e,r[3]*=e,r[7]*=e,r[11]*=e,r[15]*=e,this}determinant(){let e=this.elements,r=e[0],i=e[4],n=e[8],s=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],d=e[6],f=e[10],p=e[14],g=e[3],m=e[7],S=e[11],h=e[15],v=c*p-l*f,_=a*p-l*d,y=a*f-c*d,R=o*p-l*u,T=o*f-c*u,b=o*d-a*u;return r*(m*v-S*_+h*y)-i*(g*v-S*R+h*T)+n*(g*_-m*R+h*b)-s*(g*y-m*T+S*b)}determinantAffine(){let e=this.elements,r=e[0],i=e[4],n=e[8],s=e[1],o=e[5],a=e[9],c=e[2],l=e[6],u=e[10];return r*(o*u-a*l)-i*(s*u-a*c)+n*(s*l-o*c)}transpose(){let e=this.elements,r;return r=e[1],e[1]=e[4],e[4]=r,r=e[2],e[2]=e[8],e[8]=r,r=e[6],e[6]=e[9],e[9]=r,r=e[3],e[3]=e[12],e[12]=r,r=e[7],e[7]=e[13],e[13]=r,r=e[11],e[11]=e[14],e[14]=r,this}setPosition(e,r,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=r,n[14]=i),this}invert(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],S=e[14],h=e[15],v=r*a-i*o,_=r*c-n*o,y=r*l-s*o,R=i*c-n*a,T=i*l-s*a,b=n*l-s*c,E=u*m-d*g,M=u*S-f*g,N=u*h-p*g,O=d*S-f*m,k=d*h-p*m,j=f*h-p*S,G=v*j-_*k+y*O+R*N-T*M+b*E;if(G===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let Q=1/G;return e[0]=(a*j-c*k+l*O)*Q,e[1]=(n*k-i*j-s*O)*Q,e[2]=(m*b-S*T+h*R)*Q,e[3]=(f*T-d*b-p*R)*Q,e[4]=(c*N-o*j-l*M)*Q,e[5]=(r*j-n*N+s*M)*Q,e[6]=(S*y-g*b-h*_)*Q,e[7]=(u*b-f*y+p*_)*Q,e[8]=(o*k-a*N+l*E)*Q,e[9]=(i*N-r*k-s*E)*Q,e[10]=(g*T-m*y+h*v)*Q,e[11]=(d*y-u*T-p*v)*Q,e[12]=(a*M-o*O-c*E)*Q,e[13]=(r*O-i*M+n*E)*Q,e[14]=(m*_-g*R-S*v)*Q,e[15]=(u*R-d*_+f*v)*Q,this}scale(e){let r=this.elements,i=e.x,n=e.y,s=e.z;return r[0]*=i,r[4]*=n,r[8]*=s,r[1]*=i,r[5]*=n,r[9]*=s,r[2]*=i,r[6]*=n,r[10]*=s,r[3]*=i,r[7]*=n,r[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(r,i,n))}makeTranslation(e,r,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,r,0,0,1,i,0,0,0,1),this}makeRotationX(e){let r=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,r,-i,0,0,i,r,0,0,0,0,1),this}makeRotationY(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,0,i,0,0,1,0,0,-i,0,r,0,0,0,0,1),this}makeRotationZ(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,r){let i=Math.cos(r),n=Math.sin(r),s=1-i,o=e.x,a=e.y,c=e.z,l=s*o,u=s*a;return this.set(l*o+i,l*a-n*c,l*c+n*a,0,l*a+n*c,u*a+i,u*c-n*o,0,l*c-n*a,u*c+n*o,s*c*c+i,0,0,0,0,1),this}makeScale(e,r,i){return this.set(e,0,0,0,0,r,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,r,i,n,s,o){return this.set(1,i,s,0,e,1,o,0,r,n,1,0,0,0,0,1),this}compose(e,r,i){let n=this.elements,s=r._x,o=r._y,a=r._z,c=r._w,l=s+s,u=o+o,d=a+a,f=s*l,p=s*u,g=s*d,m=o*u,S=o*d,h=a*d,v=c*l,_=c*u,y=c*d,R=i.x,T=i.y,b=i.z;return n[0]=(1-(m+h))*R,n[1]=(p+y)*R,n[2]=(g-_)*R,n[3]=0,n[4]=(p-y)*T,n[5]=(1-(f+h))*T,n[6]=(S+v)*T,n[7]=0,n[8]=(g+_)*b,n[9]=(S-v)*b,n[10]=(1-(f+m))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,r,i){let n=this.elements;e.x=n[12],e.y=n[13],e.z=n[14];let s=this.determinantAffine();if(s===0)return i.set(1,1,1),r.identity(),this;let o=Ps.set(n[0],n[1],n[2]).length(),a=Ps.set(n[4],n[5],n[6]).length(),c=Ps.set(n[8],n[9],n[10]).length();s<0&&(o=-o),pn.copy(this);let l=1/o,u=1/a,d=1/c;return pn.elements[0]*=l,pn.elements[1]*=l,pn.elements[2]*=l,pn.elements[4]*=u,pn.elements[5]*=u,pn.elements[6]*=u,pn.elements[8]*=d,pn.elements[9]*=d,pn.elements[10]*=d,r.setFromRotationMatrix(pn),i.x=o,i.y=a,i.z=c,this}makePerspective(e,r,i,n,s,o,a=$a,c=false){let l=this.elements,u=2*s/(r-e),d=2*s/(i-n),f=(r+e)/(r-e),p=(i+n)/(i-n),g,m;if(c)g=s/(o-s),m=o*s/(o-s);else if(a===$a)g=-(o+s)/(o-s),m=-2*o*s/(o-s);else if(a===e0)g=-o/(o-s),m=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,r,i,n,s,o,a=$a,c=false){let l=this.elements,u=2/(r-e),d=2/(i-n),f=-(r+e)/(r-e),p=-(i+n)/(i-n),g,m;if(c)g=1/(o-s),m=o/(o-s);else if(a===$a)g=-2/(o-s),m=-(o+s)/(o-s);else if(a===e0)g=-1/(o-s),m=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=0,l[12]=f,l[1]=0,l[5]=d,l[9]=0,l[13]=p,l[2]=0,l[6]=0,l[10]=g,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let r=this.elements,i=e.elements;for(let n=0;n<16;n++)if(r[n]!==i[n])return false;return true}fromArray(e,r=0){for(let i=0;i<16;i++)this.elements[i]=e[i+r];return this}toArray(e=[],r=0){let i=this.elements;return e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15],e}},Ps=new Ue,pn=new nn,N$=new Ue(0,0,0),O$=new Ue(1,1,1),Ur=new Ue,xh=new Ue,Ht=new Ue;new nn;new nn;var DE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fr={h:0,s:0,l:0},Th={h:0,s:0,l:0};function Dy(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*6*(2/3-r):t}var ft=class{constructor(e,r,i){return this.isColor=true,this.r=1,this.g=1,this.b=1,this.set(e,r,i)}set(e,r,i){if(r===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n);}else this.setRGB(e,r,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,r=tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,en.colorSpaceToWorking(this,r),this}setRGB(e,r,i,n=en.workingColorSpace){return this.r=e,this.g=r,this.b=i,en.colorSpaceToWorking(this,n),this}setHSL(e,r,i,n=en.workingColorSpace){if(e=A$(e,1),r=ke(r,0,1),i=ke(i,0,1),r===0)this.r=this.g=this.b=i;else {let s=i<=.5?i*(1+r):i+r-i*r,o=2*i-s;this.r=Dy(o,s,e+1/3),this.g=Dy(o,s,e),this.b=Dy(o,s,e-1/3);}return en.colorSpaceToWorking(this,n),this}setStyle(e,r=tn){function i(s){s!==void 0&&parseFloat(s)<1&&Rt("Color: Alpha component of "+e+" will be ignored.");}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let s,o=n[1],a=n[2];switch(o){case "rgb":case "rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,r);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,r);break;case "hsl":case "hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,r);break;default:Rt("Color: Unknown color model "+e);}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let s=n[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,r);if(o===6)return this.setHex(parseInt(s,16),r);Rt("Color: Invalid hex color "+e);}else if(e&&e.length>0)return this.setColorName(e,r);return this}setColorName(e,r=tn){let i=DE[e.toLowerCase()];return i!==void 0?this.setHex(i,r):Rt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Vn(e.r),this.g=Vn(e.g),this.b=Vn(e.b),this}copyLinearToSRGB(e){return this.r=$s(e.r),this.g=$s(e.g),this.b=$s(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tn){return en.workingToColorSpace(Tt.copy(this),e),Math.round(ke(Tt.r*255,0,255))*65536+Math.round(ke(Tt.g*255,0,255))*256+Math.round(ke(Tt.b*255,0,255))}getHexString(e=tn){return ("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,r=en.workingColorSpace){en.workingToColorSpace(Tt.copy(this),r);let i=Tt.r,n=Tt.g,s=Tt.b,o=Math.max(i,n,s),a=Math.min(i,n,s),c,l,u=(a+o)/2;if(a===o)c=0,l=0;else {let d=o-a;switch(l=u<=.5?d/(o+a):d/(2-o-a),o){case i:c=(n-s)/d+(n<s?6:0);break;case n:c=(s-i)/d+2;break;case s:c=(i-n)/d+4;break}c/=6;}return e.h=c,e.s=l,e.l=u,e}getRGB(e,r=en.workingColorSpace){return en.workingToColorSpace(Tt.copy(this),r),e.r=Tt.r,e.g=Tt.g,e.b=Tt.b,e}getStyle(e=tn){en.workingToColorSpace(Tt.copy(this),e);let r=Tt.r,i=Tt.g,n=Tt.b;return e!==tn?`color(${e} ${r.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(r*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,r,i){return this.getHSL(Fr),this.setHSL(Fr.h+e,Fr.s+r,Fr.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,r){return this.r=e.r+r.r,this.g=e.g+r.g,this.b=e.b+r.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,r){return this.r+=(e.r-this.r)*r,this.g+=(e.g-this.g)*r,this.b+=(e.b-this.b)*r,this}lerpColors(e,r,i){return this.r=e.r+(r.r-e.r)*i,this.g=e.g+(r.g-e.g)*i,this.b=e.b+(r.b-e.b)*i,this}lerpHSL(e,r){this.getHSL(Fr),e.getHSL(Th);let i=Py(Fr.h,Th.h,r),n=Py(Fr.s,Th.s,r),s=Py(Fr.l,Th.l,r);return this.setHSL(i,n,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let r=this.r,i=this.g,n=this.b,s=e.elements;return this.r=s[0]*r+s[3]*i+s[6]*n,this.g=s[1]*r+s[4]*i+s[7]*n,this.b=s[2]*r+s[5]*i+s[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,r=0){return this.r=e[r],this.g=e[r+1],this.b=e[r+2],this}toArray(e=[],r=0){return e[r]=this.r,e[r+1]=this.g,e[r+2]=this.b,e}fromBufferAttribute(e,r){return this.r=e.getX(r),this.g=e.getY(r),this.b=e.getZ(r),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b;}},Tt=new ft;ft.NAMES=DE;function LE(t){let e={};for(let r in t){e[r]={};for(let i in t[r]){let n=t[r][i];if(RE(n))n.isRenderTargetTexture?(Rt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[r][i]=null):e[r][i]=n.clone();else if(Array.isArray(n))if(RE(n[0])){let s=[];for(let o=0,a=n.length;o<a;o++)s[o]=n[o].clone();e[r][i]=s;}else e[r][i]=n.slice();else e[r][i]=n;}}return e}function Nt(t){let e={};for(let r=0;r<t.length;r++){let i=LE(t[r]);for(let n in i)e[n]=i[n];}return e}function RE(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}var g0="\\[\\]\\.:\\/",_0="[^"+g0+"]",U$="[^"+g0.replace("\\.","")+"]";/((?:WC+[\/:])*)/.source.replace("WC",_0);/(WCOD+)?/.source.replace("WCOD",U$);/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_0);/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_0);(class t{static{t.prototype.isMatrix2=true;}constructor(e,r,i,n){this.elements=[1,0,0,1],e!==void 0&&this.set(e,r,i,n);}identity(){return this.set(1,0,0,1),this}fromArray(e,r=0){for(let i=0;i<4;i++)this.elements[i]=e[i+r];return this}set(e,r,i,n){let s=this.elements;return s[0]=e,s[2]=r,s[1]=i,s[3]=n,this}});typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"185"}}));typeof window<"u"&&(window.__THREE__?Rt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="185");var g2=`#define STANDARD
|
|
75
|
+
deps: ${u}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(c){let[l,u]=s(c);o(c,l),a(c,u);}};function s({schema:c}){let l={},u={};for(let d in c){if(d==="__proto__")continue;let f=Array.isArray(c[d])?l:u;f[d]=c[d];}return [l,u]}function o(c,l=c.schema){let{gen:u,data:d,it:f}=c;if(Object.keys(l).length===0)return;let p=u.let("missing");for(let g in l){let m=l[g];if(m.length===0)continue;let S=(0, i.propertyInData)(u,d,g,f.opts.ownProperties);c.setParams({property:g,depsCount:m.length,deps:m.join(", ")}),f.allErrors?u.if(S,()=>{for(let h of m)(0, i.checkReportMissingProp)(c,h);}):(u.if((0, e._)`${S} && (${(0, i.checkMissingProp)(c,m,p)})`),(0, i.reportMissingProp)(c,p),u.else());}}t.validatePropertyDeps=o;function a(c,l=c.schema){let{gen:u,data:d,keyword:f,it:p}=c,g=u.name("valid");for(let m in l)(0, r.alwaysValidSchema)(p,l[m])||(u.if((0, i.propertyInData)(u,d,m,p.opts.ownProperties),()=>{let S=c.subschema({keyword:f,schemaProp:m},g);c.mergeValidEvaluated(S,g);},()=>u.var(g,true)),c.ok(g));}t.validateSchemaDeps=a,t.default=n;})),mC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>(0, e._)`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:o,data:a,it:c}=n;if((0, r.alwaysValidSchema)(c,o))return;let l=s.name("valid");s.forIn("key",a,u=>{n.setParams({propertyName:u}),n.subschema({keyword:"propertyNames",data:u,dataTypes:["string"],propertyName:u,compositeRule:true},l),s.if((0, e.not)(l),()=>{n.error(true),c.allErrors||s.break();});}),n.ok(l);}};t.default=i;})),IT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Te(),i=ln(),n=ze(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:true,trackErrors:true,error:{message:"must NOT have additional properties",params:({params:o})=>(0, r._)`{additionalProperty: ${o.additionalProperty}}`},code(o){let{gen:a,schema:c,parentSchema:l,data:u,errsCount:d,it:f}=o;if(!d)throw new Error("ajv implementation error");let{allErrors:p,opts:g}=f;if(f.props=true,g.removeAdditional!=="all"&&(0, n.alwaysValidSchema)(f,c))return;let m=(0, e.allSchemaProperties)(l.properties),S=(0, e.allSchemaProperties)(l.patternProperties);h(),o.ok((0, r._)`${d} === ${i.default.errors}`);function h(){a.forIn("key",u,T=>{!m.length&&!S.length?y(T):a.if(v(T),()=>y(T));});}function v(T){let b;if(m.length>8){let E=(0, n.schemaRefOrVal)(f,l.properties,"properties");b=(0, e.isOwnProperty)(a,E,T);}else m.length?b=(0, r.or)(...m.map(E=>(0, r._)`${T} === ${E}`)):b=r.nil;return S.length&&(b=(0, r.or)(b,...S.map(E=>(0, r._)`${(0, e.usePattern)(o,E)}.test(${T})`))),(0, r.not)(b)}function _(T){a.code((0, r._)`delete ${u}[${T}]`);}function y(T){if(g.removeAdditional==="all"||g.removeAdditional&&c===false){_(T);return}if(c===false){o.setParams({additionalProperty:T}),o.error(),p||a.break();return}if(typeof c=="object"&&!(0, n.alwaysValidSchema)(f,c)){let b=a.name("valid");g.removeAdditional==="failing"?(R(T,b,false),a.if((0, r.not)(b),()=>{o.reset(),_(T);})):(R(T,b),p||a.if((0, r.not)(b),()=>a.break()));}}function R(T,b,E){let M={keyword:"additionalProperties",dataProp:T,dataPropType:n.Type.Str};E===false&&Object.assign(M,{compositeRule:true,createErrors:false,allErrors:false}),o.subschema(M,b);}}};t.default=s;})),gC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Ms(),r=un(),i=ze(),n=IT(),s={keyword:"properties",type:"object",schemaType:"object",code(o){let{gen:a,schema:c,parentSchema:l,data:u,it:d}=o;d.opts.removeAdditional==="all"&&l.additionalProperties===void 0&&n.default.code(new e.KeywordCxt(d,n.default,"additionalProperties"));let f=(0, r.allSchemaProperties)(c);for(let h of f)d.definedProperties.add(h);d.opts.unevaluated&&f.length&&d.props!==true&&(d.props=i.mergeEvaluated.props(a,(0, i.toHash)(f),d.props));let p=f.filter(h=>!(0, i.alwaysValidSchema)(d,c[h]));if(p.length===0)return;let g=a.name("valid");for(let h of p)m(h)?S(h):(a.if((0, r.propertyInData)(a,u,h,d.opts.ownProperties)),S(h),d.allErrors||a.else().var(g,true),a.endIf()),o.it.definedProperties.add(h),o.ok(g);function m(h){return d.opts.useDefaults&&!d.compositeRule&&c[h].default!==void 0}function S(h){o.subschema({keyword:"properties",schemaProp:h,dataProp:h},g);}}};t.default=s;})),_C=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=un(),r=Te(),i=ze(),n=ze(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(o){let{gen:a,schema:c,data:l,parentSchema:u,it:d}=o,{opts:f}=d,p=(0, e.allSchemaProperties)(c),g=p.filter(R=>(0, i.alwaysValidSchema)(d,c[R]));if(p.length===0||g.length===p.length&&(!d.opts.unevaluated||d.props===true))return;let m=f.strictSchema&&!f.allowMatchingProperties&&u.properties,S=a.name("valid");d.props!==true&&!(d.props instanceof r.Name)&&(d.props=(0, n.evaluatedPropsToName)(a,d.props));let{props:h}=d;v();function v(){for(let R of p)m&&_(R),d.allErrors?y(R):(a.var(S,true),y(R),a.if(S));}function _(R){for(let T in m)new RegExp(R).test(T)&&(0, i.checkStrictMode)(d,`property ${T} matches pattern ${R} (use allowMatchingProperties)`);}function y(R){a.forIn("key",l,T=>{a.if((0, r._)`${(0, e.usePattern)(o,R)}.test(${T})`,()=>{let b=g.includes(R);b||o.subschema({keyword:"patternProperties",schemaProp:R,dataProp:T,dataPropType:n.Type.Str},S),d.opts.unevaluated&&h!==true?a.assign((0, r._)`${h}[${T}]`,true):!b&&!d.allErrors&&a.if((0, r.not)(S),()=>a.break());});});}}};t.default=s;})),vC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:true,code(i){let{gen:n,schema:s,it:o}=i;if((0, e.alwaysValidSchema)(o,s)){i.fail();return}let a=n.name("valid");i.subschema({keyword:"not",compositeRule:true,createErrors:false,allErrors:false},a),i.failResult(a,()=>i.reset(),()=>i.error());},error:{message:"must NOT be valid"}};t.default=r;})),yC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e={keyword:"anyOf",schemaType:"array",trackErrors:true,code:un().validateUnion,error:{message:"must match a schema in anyOf"}};t.default=e;})),SC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i={keyword:"oneOf",schemaType:"array",trackErrors:true,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>(0, e._)`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:o,parentSchema:a,it:c}=n;if(!Array.isArray(o))throw new Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let l=o,u=s.let("valid",false),d=s.let("passing",null),f=s.name("_valid");n.setParams({passing:d}),s.block(p),n.result(u,()=>n.reset(),()=>n.error(true));function p(){l.forEach((g,m)=>{let S;(0, r.alwaysValidSchema)(c,g)?s.var(f,true):S=n.subschema({keyword:"oneOf",schemaProp:m,compositeRule:true},f),m>0&&s.if((0, e._)`${f} && ${u}`).assign(u,false).assign(d,(0, e._)`[${d}, ${m}]`).else(),s.if(f,()=>{s.assign(u,true),s.assign(d,m),S&&n.mergeEvaluated(S,e.Name);});});}}};t.default=i;})),xC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:"allOf",schemaType:"array",code(i){let{gen:n,schema:s,it:o}=i;if(!Array.isArray(s))throw new Error("ajv implementation error");let a=n.name("valid");s.forEach((c,l)=>{if((0, e.alwaysValidSchema)(o,c))return;let u=i.subschema({keyword:"allOf",schemaProp:l},a);i.ok(a),i.mergeEvaluated(u);});}};t.default=r;})),bC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i={keyword:"if",schemaType:["object","boolean"],trackErrors:true,error:{message:({params:s})=>(0, e.str)`must match "${s.ifClause}" schema`,params:({params:s})=>(0, e._)`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:o,parentSchema:a,it:c}=s;a.then===void 0&&a.else===void 0&&(0, r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let l=n(c,"then"),u=n(c,"else");if(!l&&!u)return;let d=o.let("valid",true),f=o.name("_valid");if(p(),s.reset(),l&&u){let m=o.let("ifClause");s.setParams({ifClause:m}),o.if(f,g("then",m),g("else",m));}else l?o.if(f,g("then")):o.if((0, e.not)(f),g("else"));s.pass(d,()=>s.error(true));function p(){let m=s.subschema({keyword:"if",compositeRule:true,createErrors:false,allErrors:false},f);s.mergeEvaluated(m);}function g(m,S){return ()=>{let h=s.subschema({keyword:m},f);o.assign(d,f),s.mergeValidEvaluated(h,d),S?o.assign(S,(0, e._)`${m}`):s.setParams({ifClause:m});}}}};function n(s,o){let a=s.schema[o];return a!==void 0&&!(0, r.alwaysValidSchema)(s,a)}t.default=i;})),TC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:i,parentSchema:n,it:s}){n.if===void 0&&(0, e.checkStrictMode)(s,`"${i}" without "if" is ignored`);}};t.default=r;})),CT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=MT(),r=hC(),i=AT(),n=fC(),s=pC(),o=Qv(),a=mC(),c=IT(),l=gC(),u=_C(),d=vC(),f=yC(),p=SC(),g=xC(),m=bC(),S=TC();function h(v=false){let _=[d.default,f.default,p.default,g.default,m.default,S.default,a.default,c.default,o.default,l.default,u.default];return v?_.push(r.default,n.default):_.push(e.default,i.default),_.push(s.default),_}t.default=h;})),RC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:true,error:{message:({schemaCode:i})=>(0, e.str)`must match format "${i}"`,params:({schemaCode:i})=>(0, e._)`{format: ${i}}`},code(i,n){let{gen:s,data:o,$data:a,schema:c,schemaCode:l,it:u}=i,{opts:d,errSchemaPath:f,schemaEnv:p,self:g}=u;if(!d.validateFormats)return;a?m():S();function m(){let h=s.scopeValue("formats",{ref:g.formats,code:d.code.formats}),v=s.const("fDef",(0, e._)`${h}[${l}]`),_=s.let("fType"),y=s.let("format");s.if((0, e._)`typeof ${v} == "object" && !(${v} instanceof RegExp)`,()=>s.assign(_,(0, e._)`${v}.type || "string"`).assign(y,(0, e._)`${v}.validate`),()=>s.assign(_,(0, e._)`"string"`).assign(y,v)),i.fail$data((0, e.or)(R(),T()));function R(){return d.strictSchema===false?e.nil:(0, e._)`${l} && !${y}`}function T(){let b=p.$async?(0, e._)`(${v}.async ? await ${y}(${o}) : ${y}(${o}))`:(0, e._)`${y}(${o})`,E=(0, e._)`(typeof ${y} == "function" ? ${b} : ${y}.test(${o}))`;return (0, e._)`${y} && ${y} !== true && ${_} === ${n} && !${E}`}}function S(){let h=g.formats[c];if(!h){R();return}if(h===true)return;let[v,_,y]=T(h);v===n&&i.pass(b());function R(){if(d.strictSchema===false){g.logger.warn(E());return}throw new Error(E());function E(){return `unknown format "${c}" ignored in schema at path "${f}"`}}function T(E){let M=E instanceof RegExp?(0, e.regexpCode)(E):d.code.formats?(0, e._)`${d.code.formats}${(0, e.getProperty)(c)}`:void 0,N=s.scopeValue("formats",{key:c,ref:E,code:M});return typeof E=="object"&&!(E instanceof RegExp)?[E.type||"string",E.validate,(0, e._)`${N}.validate`]:["string",E,N]}function b(){if(typeof h=="object"&&!(h instanceof RegExp)&&h.async){if(!p.$async)throw new Error("async format in sync schema");return (0, e._)`await ${y}(${o})`}return typeof _=="function"?(0, e._)`${y}(${o})`:(0, e._)`${y}.test(${o})`}}}};t.default=r;})),PT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=[RC().default];t.default=e;})),NT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"];})),OT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ET(),r=wT(),i=CT(),n=PT(),s=NT(),o=[e.default,r.default,(0, i.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];t.default=o;})),EC=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.DiscrError=void 0;var e;(function(r){r.Tag="tag",r.Mapping="mapping";})(e||(t.DiscrError=e={}));})),ey=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=EC(),i=eh(),n=As(),s=ze(),o={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:l}})=>(0, e._)`{error: ${a}, tag: ${l}, tagValue: ${c}}`},code(a){let{gen:c,data:l,schema:u,parentSchema:d,it:f}=a,{oneOf:p}=d;if(!f.opts.discriminator)throw new Error("discriminator: requires discriminator option");let g=u.propertyName;if(typeof g!="string")throw new Error("discriminator: requires propertyName");if(u.mapping)throw new Error("discriminator: mapping is not supported");if(!p)throw new Error("discriminator: requires oneOf keyword");let m=c.let("valid",false),S=c.const("tag",(0, e._)`${l}${(0, e.getProperty)(g)}`);c.if((0, e._)`typeof ${S} == "string"`,()=>h(),()=>a.error(false,{discrError:r.DiscrError.Tag,tag:S,tagName:g})),a.ok(m);function h(){let y=_();c.if(false);for(let R in y)c.elseIf((0, e._)`${S} === ${R}`),c.assign(m,v(y[R]));c.else(),a.error(false,{discrError:r.DiscrError.Mapping,tag:S,tagName:g}),c.endIf();}function v(y){let R=c.name("valid"),T=a.subschema({keyword:"oneOf",schemaProp:y},R);return a.mergeEvaluated(T,e.Name),R}function _(){var y;let R={},T=E(d),b=true;for(let O=0;O<p.length;O++){let k=p[O];if(k?.$ref&&!(0, s.schemaHasRulesButRef)(k,f.self.RULES)){let G=k.$ref;if(k=i.resolveRef.call(f.self,f.schemaEnv.root,f.baseId,G),k instanceof i.SchemaEnv&&(k=k.schema),k===void 0)throw new n.default(f.opts.uriResolver,f.baseId,G)}let j=(y=k?.properties)===null||y===void 0?void 0:y[g];if(typeof j!="object")throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${g}"`);b=b&&(T||E(k)),M(j,O);}if(!b)throw new Error(`discriminator: "${g}" must be required`);return R;function E({required:O}){return Array.isArray(O)&&O.includes(g)}function M(O,k){if(O.const)N(O.const,k);else if(O.enum)for(let j of O.enum)N(j,k);else throw new Error(`discriminator: "properties/${g}" must have "const" or "enum"`)}function N(O,k){if(typeof O!="string"||O in R)throw new Error(`discriminator: "${g}" values must be unique strings`);R[O]=k;}}}};t.default=o;})),wC=W(((t,e)=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:true,readOnly:{type:"boolean",default:false},examples:{type:"array",items:true},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:true},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:true,enum:{type:"array",items:true,minItems:1,uniqueItems:true},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:true}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:true};})),zT=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let r=Xv(),i=OT(),n=ey(),s=wC(),o=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(p=>this.addVocabulary(p)),this.opts.discriminator&&this.addKeyword(n.default);}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let p=this.opts.$data?this.$dataMetaSchema(s,o):s;this.addMetaSchema(p,a,false),this.refs["http://json-schema.org/schema"]=a;}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:true}),t.default=c;var l=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return l.KeywordCxt}});var u=Te();Object.defineProperty(t,"_",{enumerable:true,get:function(){return u._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return u.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return u.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return u.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return u.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return u.CodeGen}});var d=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return d.default}});var f=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return f.default}});})),$T=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.dynamicAnchor=void 0;let e=Te(),r=ln(),i=eh(),n=Jv(),s={keyword:"$dynamicAnchor",schemaType:"string",code:c=>o(c,c.schema)};function o(c,l){let{gen:u,it:d}=c;d.schemaEnv.root.dynamicAnchors[l]=true;let f=(0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(l)}`,p=d.errSchemaPath==="#"?d.validateName:a(c);u.if((0, e._)`!${f}`,()=>u.assign(f,p));}t.dynamicAnchor=o;function a(c){let{schemaEnv:l,schema:u,self:d}=c.it,{root:f,baseId:p,localRefs:g,meta:m}=l.root,{schemaId:S}=d.opts,h=new i.SchemaEnv({schema:u,schemaId:S,root:f,baseId:p,localRefs:g,meta:m});return i.compileSchema.call(d,h),(0, n.getValidate)(c,h)}t.default=s;})),DT=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.dynamicRef=void 0;let e=Te(),r=ln(),i=Jv(),n={keyword:"$dynamicRef",schemaType:"string",code:o=>s(o,o.schema)};function s(o,a){let{gen:c,keyword:l,it:u}=o;if(a[0]!=="#")throw new Error(`"${l}" only supports hash fragment reference`);let d=a.slice(1);if(u.allErrors)f();else {let g=c.let("valid",false);f(g),o.ok(g);}function f(g){if(u.schemaEnv.root.dynamicAnchors[d]){let m=c.let("_v",(0, e._)`${r.default.dynamicAnchors}${(0, e.getProperty)(d)}`);c.if(m,p(m,g),p(u.validateName,g));}else p(u.validateName,g)();}function p(g,m){return m?()=>c.block(()=>{(0, i.callRef)(o,g),c.let(m,true);}):()=>(0, i.callRef)(o,g)}}t.dynamicRef=s,t.default=n;})),MC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=$T(),r=ze(),i={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){n.schema?(0, e.dynamicAnchor)(n,""):(0, r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored");}};t.default=i;})),AC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=DT(),r={keyword:"$recursiveRef",schemaType:"string",code:i=>(0, e.dynamicRef)(i,i.schema)};t.default=r;})),LT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=$T(),r=DT(),i=MC(),n=AC(),s=[e.default,r.default,i.default,n.default];t.default=s;})),IC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Qv(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:e.error,code:i=>(0, e.validatePropertyDeps)(i)};t.default=r;})),CC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Qv(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:i=>(0, e.validateSchemaDeps)(i)};t.default=r;})),PC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ze(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:i,parentSchema:n,it:s}){n.contains===void 0&&(0, e.checkStrictMode)(s,`"${i}" without "contains" is ignored`);}};t.default=r;})),kT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=IC(),r=CC(),i=PC(),n=[e.default,r.default,i.default];t.default=n;})),NC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i=ln(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:true,error:{message:"must NOT have unevaluated properties",params:({params:s})=>(0, e._)`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:o,schema:a,data:c,errsCount:l,it:u}=s;if(!l)throw new Error("ajv implementation error");let{allErrors:d,props:f}=u;f instanceof e.Name?o.if((0, e._)`${f} !== true`,()=>o.forIn("key",c,S=>o.if(g(f,S),()=>p(S)))):f!==true&&o.forIn("key",c,S=>f===void 0?p(S):o.if(m(f,S),()=>p(S))),u.props=true,s.ok((0, e._)`${l} === ${i.default.errors}`);function p(S){if(a===false){s.setParams({unevaluatedProperty:S}),s.error(),d||o.break();return}if(!(0, r.alwaysValidSchema)(u,a)){let h=o.name("valid");s.subschema({keyword:"unevaluatedProperties",dataProp:S,dataPropType:r.Type.Str},h),d||o.if((0, e.not)(h),()=>o.break());}}function g(S,h){return (0, e._)`!${S} || !${S}[${h}]`}function m(S,h){let v=[];for(let _ in S)S[_]===true&&v.push((0, e._)`${h} !== ${_}`);return (0, e.and)(...v)}}};t.default=n;})),OC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=Te(),r=ze(),i={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>(0, e.str)`must NOT have more than ${n} items`,params:({params:{len:n}})=>(0, e._)`{limit: ${n}}`},code(n){let{gen:s,schema:o,data:a,it:c}=n,l=c.items||0;if(l===true)return;let u=s.const("len",(0, e._)`${a}.length`);if(o===false)n.setParams({len:l}),n.fail((0, e._)`${u} > ${l}`);else if(typeof o=="object"&&!(0, r.alwaysValidSchema)(c,o)){let f=s.var("valid",(0, e._)`${u} <= ${l}`);s.if((0, e.not)(f),()=>d(f,l)),n.ok(f);}c.items=true;function d(f,p){s.forRange("i",p,u,g=>{n.subschema({keyword:"unevaluatedItems",dataProp:g,dataPropType:r.Type.Num},f),c.allErrors||s.if((0, e.not)(f),()=>s.break());});}}};t.default=i;})),UT=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=NC(),r=OC(),i=[e.default,r.default];t.default=i;})),zC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":true,"https://json-schema.org/draft/2019-09/vocab/applicator":true,"https://json-schema.org/draft/2019-09/vocab/validation":true,"https://json-schema.org/draft/2019-09/vocab/meta-data":true,"https://json-schema.org/draft/2019-09/vocab/format":false,"https://json-schema.org/draft/2019-09/vocab/content":true},$recursiveAnchor:true,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}};})),$C=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":true},$recursiveAnchor:true,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}};})),DC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":true},$recursiveAnchor:true,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}};})),LC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":true},$recursiveAnchor:true,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:false},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}};})),kC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":true},$recursiveAnchor:true,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}};})),UC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":true},$recursiveAnchor:true,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:true,deprecated:{type:"boolean",default:false},readOnly:{type:"boolean",default:false},writeOnly:{type:"boolean",default:false},examples:{type:"array",items:true}}};})),FC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":true},$recursiveAnchor:true,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:true,enum:{type:"array",items:true},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:true}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}}};})),BC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=zC(),r=$C(),i=DC(),n=LC(),s=kC(),o=UC(),a=FC(),c=["/properties"];function l(u){return [e,r,i,n,d(this,s),o,d(this,a)].forEach(f=>this.addMetaSchema(f,void 0,false)),this;function d(f,p){return u?f.$dataMetaSchema(p,c):p}}t.default=l;})),VC=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2019=void 0;let r=Xv(),i=OT(),n=LT(),s=kT(),o=UT(),a=ey(),c=BC(),l="https://json-schema.org/draft/2019-09/schema";var u=class extends r.default{constructor(m={}){super({...m,dynamicRef:true,next:true,unevaluated:true});}_addVocabularies(){super._addVocabularies(),this.addVocabulary(n.default),i.default.forEach(m=>this.addVocabulary(m)),this.addVocabulary(s.default),this.addVocabulary(o.default),this.opts.discriminator&&this.addKeyword(a.default);}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:S}=this.opts;S&&(c.default.call(this,m),this.refs["http://json-schema.org/schema"]=l);}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}};t.Ajv2019=u,e.exports=t=u,e.exports.Ajv2019=u,Object.defineProperty(t,"__esModule",{value:true}),t.default=u;var d=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return d.KeywordCxt}});var f=Te();Object.defineProperty(t,"_",{enumerable:true,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return f.CodeGen}});var p=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return p.default}});var g=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return g.default}});})),jC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=ET(),r=wT(),i=CT(),n=LT(),s=kT(),o=UT(),a=PT(),c=NT(),l=[n.default,e.default,r.default,(0, i.default)(true),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,o.default];t.default=l;})),GC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":true,"https://json-schema.org/draft/2020-12/vocab/applicator":true,"https://json-schema.org/draft/2020-12/vocab/unevaluated":true,"https://json-schema.org/draft/2020-12/vocab/validation":true,"https://json-schema.org/draft/2020-12/vocab/meta-data":true,"https://json-schema.org/draft/2020-12/vocab/format-annotation":true,"https://json-schema.org/draft/2020-12/vocab/content":true},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:true,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:true,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:true},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:true}}};})),HC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":true},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}};})),qC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":true},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}};})),WC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":true},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}};})),KC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":true},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}};})),ZC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":true},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}};})),XC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":true},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:true,deprecated:{type:"boolean",default:false},readOnly:{type:"boolean",default:false},writeOnly:{type:"boolean",default:false},examples:{type:"array",items:true}}};})),JC=W(((t,e)=>{e.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":true},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:true}]},const:true,enum:{type:"array",items:true},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:false},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:true,default:[]}}};})),YC=W((t=>{Object.defineProperty(t,"__esModule",{value:true});let e=GC(),r=HC(),i=qC(),n=WC(),s=KC(),o=ZC(),a=XC(),c=JC(),l=["/properties"];function u(d){return [e,r,i,n,s,f(this,o),a,f(this,c)].forEach(p=>this.addMetaSchema(p,void 0,false)),this;function f(p,g){return d?p.$dataMetaSchema(g,l):g}}t.default=u;})),QC=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv2020=void 0;let r=Xv(),i=jC(),n=ey(),s=YC(),o="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(f={}){super({...f,dynamicRef:true,next:true,unevaluated:true});}_addVocabularies(){super._addVocabularies(),i.default.forEach(f=>this.addVocabulary(f)),this.opts.discriminator&&this.addKeyword(n.default);}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:f,meta:p}=this.opts;p&&(s.default.call(this,f),this.refs["http://json-schema.org/schema"]=o);}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(o)?o:void 0)}};t.Ajv2020=a,e.exports=t=a,e.exports.Ajv2020=a,Object.defineProperty(t,"__esModule",{value:true}),t.default=a;var c=Ms();Object.defineProperty(t,"KeywordCxt",{enumerable:true,get:function(){return c.KeywordCxt}});var l=Te();Object.defineProperty(t,"_",{enumerable:true,get:function(){return l._}}),Object.defineProperty(t,"str",{enumerable:true,get:function(){return l.str}}),Object.defineProperty(t,"stringify",{enumerable:true,get:function(){return l.stringify}}),Object.defineProperty(t,"nil",{enumerable:true,get:function(){return l.nil}}),Object.defineProperty(t,"Name",{enumerable:true,get:function(){return l.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:true,get:function(){return l.CodeGen}});var u=wa();Object.defineProperty(t,"ValidationError",{enumerable:true,get:function(){return u.default}});var d=As();Object.defineProperty(t,"MissingRefError",{enumerable:true,get:function(){return d.default}});})),eP=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.formatNames=t.fastFormats=t.fullFormats=void 0;function e(O,k){return {validate:O,compare:k}}t.fullFormats={date:e(s,o),time:e(c(true),l),"date-time":e(f(true),p),"iso-time":e(c(),u),"iso-date-time":e(f(),g),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:h,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:N,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:_,int32:{type:"number",validate:T},int64:{type:"number",validate:b},float:{type:"number",validate:E},double:{type:"number",validate:E},password:true,binary:true},t.fastFormats={...t.fullFormats,date:e(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":e(/^\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,p),"iso-time":e(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":e(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,g),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);function r(O){return O%4===0&&(O%100!==0||O%400===0)}let i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(O){let k=i.exec(O);if(!k)return false;let j=+k[1],G=+k[2],ne=+k[3];return G>=1&&G<=12&&ne>=1&&ne<=(G===2&&r(j)?29:n[G])}function o(O,k){if(O&&k)return O>k?1:O<k?-1:0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(O){return function(j){let G=a.exec(j);if(!G)return false;let ne=+G[1],Me=+G[2],ye=+G[3],Ue=G[4],ve=G[5]==="-"?-1:1,P=+(G[6]||0),U=+(G[7]||0);if(P>23||U>59||O&&!Ue)return false;if(ne<=23&&Me<=59&&ye<60)return true;let q=Me-U*ve,w=ne-P*ve-(q<0?1:0);return (w===23||w===-1)&&(q===59||q===-1)&&ye<61}}function l(O,k){if(!(O&&k))return;let j=new Date("2020-01-01T"+O).valueOf(),G=new Date("2020-01-01T"+k).valueOf();if(j&&G)return j-G}function u(O,k){if(!(O&&k))return;let j=a.exec(O),G=a.exec(k);if(j&&G)return O=j[1]+j[2]+j[3],k=G[1]+G[2]+G[3],O>k?1:O<k?-1:0}let d=/t|\s/i;function f(O){let k=c(O);return function(G){let ne=G.split(d);return ne.length===2&&s(ne[0])&&k(ne[1])}}function p(O,k){if(!(O&&k))return;let j=new Date(O).valueOf(),G=new Date(k).valueOf();if(j&&G)return j-G}function g(O,k){if(!(O&&k))return;let[j,G]=O.split(d),[ne,Me]=k.split(d),ye=o(j,ne);if(ye!==void 0)return ye||l(G,Me)}let m=/\/|:/,S=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function h(O){return m.test(O)&&S.test(O)}let v=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function _(O){return v.lastIndex=0,v.test(O)}let y=-2147483648,R=2**31-1;function T(O){return Number.isInteger(O)&&O<=R&&O>=y}function b(O){return Number.isInteger(O)}function E(){return true}let M=/[^\\]\\Z/;function N(O){if(M.test(O))return false;try{return new RegExp(O),!0}catch{return false}}})),tP=W((t=>{Object.defineProperty(t,"__esModule",{value:true}),t.formatLimitDefinition=void 0;let e=zT(),r=Te(),i=r.operators,n={formatMaximum:{okStr:"<=",ok:i.LTE,fail:i.GT},formatMinimum:{okStr:">=",ok:i.GTE,fail:i.LT},formatExclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},formatExclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:a,schemaCode:c})=>(0, r.str)`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>(0, r._)`{comparison: ${n[a].okStr}, limit: ${c}}`};t.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:true,error:s,code(a){let{gen:c,data:l,schemaCode:u,keyword:d,it:f}=a,{opts:p,self:g}=f;if(!p.validateFormats)return;let m=new e.KeywordCxt(f,g.RULES.all.format.definition,"format");m.$data?S():h();function S(){let _=c.scopeValue("formats",{ref:g.formats,code:p.code.formats}),y=c.const("fmt",(0, r._)`${_}[${m.schemaCode}]`);a.fail$data((0, r.or)((0, r._)`typeof ${y} != "object"`,(0, r._)`${y} instanceof RegExp`,(0, r._)`typeof ${y}.compare != "function"`,v(y)));}function h(){let _=m.schema,y=g.formats[_];if(!y||y===true)return;if(typeof y!="object"||y instanceof RegExp||typeof y.compare!="function")throw new Error(`"${d}": format "${_}" does not define "compare" function`);let R=c.scopeValue("formats",{key:_,ref:y,code:p.code.formats?(0, r._)`${p.code.formats}${(0, r.getProperty)(_)}`:void 0});a.fail$data(v(R));}function v(_){return (0, r._)`${_}.compare(${l}, ${u}) ${n[d].fail} 0`}},dependencies:["format"]};let o=a=>(a.addKeyword(t.formatLimitDefinition),a);t.default=o;})),nP=W(((t,e)=>{Object.defineProperty(t,"__esModule",{value:true});let r=eP(),i=tP(),n=Te(),s=new n.Name("fullFormats"),o=new n.Name("fastFormats"),a=(l,u={keywords:true})=>{if(Array.isArray(u))return c(l,u,r.fullFormats,s),l;let[d,f]=u.mode==="fast"?[r.fastFormats,o]:[r.fullFormats,s];return c(l,u.formats||r.formatNames,d,f),u.keywords&&(0, i.default)(l),l};a.get=(l,u="full")=>{let d=(u==="fast"?r.fastFormats:r.fullFormats)[l];if(!d)throw new Error(`Unknown format "${l}"`);return d};function c(l,u,d,f){var p,g;(p=(g=l.opts.code).formats)!==null&&p!==void 0||(g.formats=(0, n._)`require("ajv-formats/dist/formats").${f}`);for(let m of u)l.addFormat(m,d[m]);}e.exports=t=a,Object.defineProperty(t,"__esModule",{value:true}),t.default=a;})),FT=zT(),rP=VC(),iP=QC(),sP=ac(nP()),oP=sP.default;function Zv(t){let e=new t({strict:false,validateFormats:true,validateSchema:false,allErrors:true});return oP(e),e}var th=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(t){this._userAjv=t!==void 0,this._ajv=t;}get ajv(){return this._ajv??=Zv(iP.Ajv2020)}_engineFor(t){if(this._userAjv)return this.ajv;let e=I0(t,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");return e==="2020-12"?this.ajv:e==="2019-09"?this._ajv2019??=Zv(rP.Ajv2019):this._ajvDraft7??=Zv(FT.Ajv)}getValidator(t){let e=this._engineFor(t),r="$id"in t&&typeof t.$id=="string"?e.getSchema(t.$id)??e.compile(t):e.compile(t);return i=>r(i)?{valid:true,data:i,errorMessage:void 0}:{valid:false,data:void 0,errorMessage:e.errorsText(r.errors)}}};FT.Ajv;var ZT=Symbol.for("mcp.completable");function ry(t){return !!t&&typeof t=="object"&&ZT in t}function cP(t){return t[ZT]?.complete}function lP(t,e){switch(e.kind){case "tools_list_changed":return t.toolsListChanged===true;case "prompts_list_changed":return t.promptsListChanged===true;case "resources_list_changed":return t.resourcesListChanged===true;case "resource_updated":return t.resourceSubscriptions!==void 0&&t.resourceSubscriptions.includes(e.uri)}}function uP(t,e){let r={},i=n=>e===void 0||n===true;return t.toolsListChanged===true&&i(e?.tools?.listChanged)&&(r.toolsListChanged=true),t.promptsListChanged===true&&i(e?.prompts?.listChanged)&&(r.promptsListChanged=true),t.resourcesListChanged===true&&i(e?.resources?.listChanged)&&(r.resourcesListChanged=true),t.resourceSubscriptions!==void 0&&t.resourceSubscriptions.length>0&&i(e?.resources?.subscribe)&&(r.resourceSubscriptions=[...t.resourceSubscriptions]),r}var nh=1024;function BT(t,e){return {method:t.method,params:{...t.params,_meta:{...t.params?._meta,[hi]:e}}}}function dP(t){let e=mr(Ra).validateRequest("subscriptions/listen",t);return e.ok?e.value.params?.notifications:void 0}var hP=new Set(["notifications/tools/list_changed","notifications/prompts/list_changed","notifications/resources/list_changed","notifications/resources/updated"]),XT=class{_subs=new Map;_serverCapabilities;_serverInfo;constructor(t=nh,e,r){this._maxSubscriptions=t,this._serverCapabilities=e,this._serverInfo=r;}setServerCapabilities(t,e){this._serverCapabilities=t,e!==void 0&&(this._serverInfo=e);}has(t){return this._subs.has(t)}serve(t){if(this._serverCapabilities===void 0)throw new Error("StdioListenRouter.serve() called before setServerCapabilities(); refusing to honor a filter without capabilities");if(this._subs.size>=this._maxSubscriptions)return {jsonrpc:"2.0",id:t.id,error:{code:-32603,message:"Subscription limit reached"}};let e=dP(t);if(e===void 0)return {jsonrpc:"2.0",id:t.id,error:{code:-32602,message:"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter"}};let r=uP(e,this._serverCapabilities);return this._subs.set(t.id,r),BT({method:"notifications/subscriptions/acknowledged",params:{notifications:r}},t.id)}cancel(t){return this._subs.delete(t)}routeOutbound(t){if(!hP.has(t.method))return "passthrough";let e=t.params?.uri,r=typeof e=="string"?e:void 0,i=fP(t.method,r),n=[];for(let[s,o]of this._subs)lP(o,i)&&n.push(BT({method:t.method,params:t.params??{}},s));return n}teardownAll(){let t=[];for(let e of this._subs.keys())t.push({jsonrpc:"2.0",id:e,result:{resultType:"complete",_meta:{[hi]:e,...this._serverInfo!==void 0&&{[bn]:this._serverInfo}}}});return this._subs.clear(),t}};function fP(t,e){switch(t){case "notifications/tools/list_changed":return {kind:"tools_list_changed"};case "notifications/prompts/list_changed":return {kind:"prompts_list_changed"};case "notifications/resources/list_changed":return {kind:"resources_list_changed"};default:return {kind:"resource_updated",uri:e??""}}}var pP=8,mP=6e5;function gP(t){if(t?.maxRounds!==void 0&&(!Number.isInteger(t.maxRounds)||t.maxRounds<1))throw new RangeError(`inputRequired.maxRounds must be a positive integer (got ${t.maxRounds})`);if(t?.roundTimeoutMs!==void 0&&(!Number.isFinite(t.roundTimeoutMs)||t.roundTimeoutMs<=0))throw new RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${t.roundTimeoutMs})`);return {maxRounds:t?.maxRounds??pP,roundTimeoutMs:t?.roundTimeoutMs??mP,legacyShim:t?.legacyShim??true}}function JT(t,e,r){if(r===null||typeof r!="object"||typeof r.method!="string")throw new he(ee.InternalError,`Handler for ${t} returned an invalid input request '${e}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let i=r,n=Vb(i);if(n===void 0)throw new he(ee.InternalError,`Handler for ${t} returned an input request '${e}' of kind '${i.method}', which is not an embedded request the 2026-07-28 revision defines`);return {embedded:i,required:n}}function _P(){let t=globalThis.crypto;if(t?.randomUUID!==void 0)return t.randomUUID();let e=new Uint8Array(16);t.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=[...e].map(i=>i.toString(16).padStart(2,"0")).join("");return `${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function ny(t,e){if(t==="tools/call")return {content:[{type:"text",text:e}],isError:true};throw new he(ee.InternalError,e)}var vP=class{constructor(t){this._host=t;}async fulfill(t,e,r,i,n){let{maxRounds:s,roundTimeoutMs:o}=this._host,a=i.mcpReq.signal,c=n,l=0;for(;;){if(l+=1,l>s)return ny(t,uT(t,s));let u=c.inputRequests,d=u!=null&&Object.keys(u).length>0,f=typeof c.requestState=="string"?c.requestState:void 0;if(!d&&f===void 0)throw new he(ee.InternalError,`Handler for ${t} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let p;if(d){let S=this._host.resolvedClientCapabilities(i),h=[];for(let[_,y]of Object.entries(u)){let{embedded:R,required:T}=JT(t,_,y);if(R.method!=="roots/list"&&R.params===void 0)throw new he(ee.InternalError,`Handler for ${t} returned an input request '${_}' of kind '${R.method}' without params`);if(Ud(T,S)!==void 0)return ny(t,`Cannot request input '${_}' (${R.method}): the client on this 2025-era connection did not declare the required capability${S===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);h.push([_,R]);}let v=hT(a);try{let _={relatedRequestId:i.mcpReq.id,timeout:o,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:v.signal},y=await Promise.all(h.map(async([R,T])=>{try{return [R,await this._dispatchLeg(T,_)]}catch(b){throw v.abort(b),b}}));p=Object.fromEntries(y);}catch(_){if(a.aborted)throw _;return ny(t,`Fulfilling input required by '${t}' failed: ${_ instanceof Error?_.message:String(_)}`)}finally{v.dispose();}}else await dT(lT,a);let g={...i,mcpReq:{...i.mcpReq,inputResponses:p,droppedInputResponseKeys:void 0,requestState:Ea(f)}};if(f!==void 0){let S=await this._host.verifyRequestState(f,g,t);S!==void 0&&(g=Vv(g,S));}let m=await e(r,g);if(!Ln(m))return m;c=m;}}async _dispatchLeg(t,e){switch(t.method){case "elicitation/create":{let r=t.params;return r.mode==="url"&&r.elicitationId===void 0&&(r={...r,elicitationId:_P()}),await this._host.sendElicitation(r,e)}case "sampling/createMessage":return await this._host.sendSampling(t.params,e);case "roots/list":return await this._host.listRoots(t.params,e)}}},yP=new Set(["tools/call","prompts/get","resources/read"]),YT,QT;function iy(t,e){YT(t,e);}function sy(t){return QT(t)}var eR=class extends Gv{_clientCapabilities;_clientVersion;static{YT=(t,e)=>{let r=e.filter(i=>!t._supportedProtocolVersions.includes(i));r.length>0&&(t._supportedProtocolVersions=[...t._supportedProtocolVersions,...r]),t.setRequestHandler("server/discover",()=>t._ondiscover());},QT=t=>t._serverInfo;}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_legacyInputRequiredShim(){return this._legacyShim??=new vP({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:t=>this._inputRequestCapabilityView(t),verifyRequestState:(t,e,r)=>this._verifyRequestState(t,e,r),sendElicitation:(t,e)=>this._sendElicitationLeg(t,e,{validateAcceptedContent:false}),sendSampling:(t,e)=>this.createMessage(t,e),listRoots:(t,e)=>this.listRoots(t,e)})}oninitialized;constructor(t,e){if(super(e),this._serverInfo=t,this._capabilities=e?.capabilities?{...e.capabilities}:{},this._instructions=e?.instructions,this._jsonSchemaValidator=e?.jsonSchemaValidator??new th,this._requestStateVerify=e?.requestState?.verify,this._inputRequiredServing=gP(e?.inputRequired),e?.cacheHints!==void 0){for(let[r,i]of Object.entries(e.cacheHints))i!==void 0&&Ov(i,`cacheHints['${r}']`);this._cacheHints=e.cacheHints;}this.setRequestHandler("initialize",r=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Mv(this._supportedProtocolVersions).length>0&&this.setRequestHandler("server/discover",()=>this._ondiscover()),this._capabilities.logging&&this._registerLoggingHandler();}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(t,e)=>{let r=e.sessionId||e.http?.req?.headers.get("mcp-session-id")||void 0,{level:i}=t.params,n=Wd(fr,i);return n.success&&this._loggingLevels.set(r,n.data),{}});}buildContext(t,e){let r=t.http||e?.request||e?.closeSSEStream||e?.closeStandaloneSSEStream;return {...t,mcpReq:{...t.mcpReq,log:(i,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let o;if(this._servedModernEra()){if(o=t.mcpReq.envelope?.[ar],o===void 0)return Promise.resolve()}else o=this._loggingLevels.get(t.sessionId)??this._loggingLevels.get(void 0);return o!==void 0&&this.LOG_LEVEL_SEVERITY.get(i)<this.LOG_LEVEL_SEVERITY.get(o)?Promise.resolve():t.mcpReq.notify({method:"notifications/message",params:{level:i,data:n,logger:s}})},elicitInput:(i,n)=>this.elicitInput(i,n),requestSampling:(i,n)=>this.createMessage(i,n)},http:r?{...t.http,req:e?.request,closeSSE:e?.closeSSEStream,closeStandaloneSSE:e?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(fr.options.map((t,e)=>[t,e]));isMessageIgnored=(t,e)=>{let r=this._loggingLevels.get(e);return r?this.LOG_LEVEL_SEVERITY.get(t)<this.LOG_LEVEL_SEVERITY.get(r):false};registerCapabilities(t){if(this.transport)throw new be(Pe.AlreadyConnected,"Cannot register capabilities after connecting to transport");let e=!!this._capabilities.logging;this._capabilities=Hv(this._capabilities,t),!e&&this._capabilities.logging&&this._registerLoggingHandler();}_wrapHandler(t,e){if(t!=="tools/call"){let r=this._cacheHints?.[t],i=yP.has(t);return r===void 0&&!i?async(n,s)=>{let o=await e(n,s);if(Ln(o))throw new he(ee.InternalError,`Handler for ${t} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return o}:async(n,s)=>{let o=i?await this._invokeInputRequiredCapableHandler(t,e,n,s):await e(n,s);if(Ln(o)){if(!i)throw new he(ee.InternalError,`Handler for ${t} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return o}return r===void 0?o:Fd(o,r)}}return async(r,i)=>{let n=mr(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new he(s.reason==="not-in-era"?ee.InternalError:ee.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let o=await this._invokeInputRequiredCapableHandler("tools/call",e,r,i);if(Ln(o))return o;let a=Av(o),c=n.validateResult("tools/call",a);if(!c.ok)throw new he(c.reason==="not-in-era"?ee.InternalError:ee.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Es(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(t,e,r,i){let n=this._servedModernEra(),s=i.mcpReq.requestState();if(s!==void 0&&typeof s!="string")throw new he(ee.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let o=i;if(typeof s=="string"){let d=await this._verifyRequestState(s,i,t);d!==void 0&&(o=Vv(i,d));}let a;try{a=await e(r,o);}catch(d){throw d instanceof he&&d.code===ee.UrlElicitationRequired&&n?new he(ee.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`):d}if(!Ln(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new he(ee.InternalError,`Handler for ${t} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??di}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(t,e,r,o,a)}let c=a.inputRequests,l=c!=null&&Object.keys(c).length>0,u=typeof a.requestState=="string";if(!l&&!u)throw new he(ee.InternalError,`Handler for ${t} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(l){let d=this._inputRequestCapabilityView(i);for(let[f,p]of Object.entries(c)){let{embedded:g,required:m}=JT(t,f,p),S=Ud(m,d);if(S!==void 0)throw new Vd({requiredCapabilities:S},`Cannot request input '${f}' (${g.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(t,e,r){if(this._requestStateVerify!==void 0)try{return await this._requestStateVerify(t,e)}catch(i){throw this.onerror?.(new Error(`requestState verification rejected ${r}: ${i instanceof Error?i.message:String(i)}`)),new he(ee.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(t){return this._servedModernEra()?t.mcpReq.envelope?.[$n]:this._clientCapabilities}_assertPushApiInServedEra(t){if(this._servedModernEra())throw new be(Pe.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${t}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:t,era:"2026-07-28"})}assertCapabilityForMethod(t){switch(t){case "sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new be(Pe.CapabilityNotSupported,`Client does not support sampling (required for ${t})`);break;case "elicitation/create":if(!this._clientCapabilities?.elicitation)throw new be(Pe.CapabilityNotSupported,`Client does not support elicitation (required for ${t})`);break;case "roots/list":if(!this._clientCapabilities?.roots)throw new be(Pe.CapabilityNotSupported,`Client does not support listing roots (required for ${t})`);break;}}assertNotificationCapability(t){switch(t){case "notifications/message":if(!this._capabilities.logging)throw new be(Pe.CapabilityNotSupported,`Server does not support logging (required for ${t})`);break;case "notifications/resources/updated":case "notifications/resources/list_changed":if(!this._capabilities.resources)throw new be(Pe.CapabilityNotSupported,`Server does not support notifying about resources (required for ${t})`);break;case "notifications/tools/list_changed":if(!this._capabilities.tools)throw new be(Pe.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${t})`);break;case "notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new be(Pe.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${t})`);break;case "notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new be(Pe.CapabilityNotSupported,`Client does not support URL elicitation (required for ${t})`);break;}}assertRequestHandlerCapability(t){switch(t){case "completion/complete":if(!this._capabilities.completions)throw new be(Pe.CapabilityNotSupported,`Server does not support completions (required for ${t})`);break;case "logging/setLevel":if(!this._capabilities.logging)throw new be(Pe.CapabilityNotSupported,`Server does not support logging (required for ${t})`);break;case "prompts/get":case "prompts/list":if(!this._capabilities.prompts)throw new be(Pe.CapabilityNotSupported,`Server does not support prompts (required for ${t})`);break;case "resources/list":case "resources/templates/list":case "resources/read":if(!this._capabilities.resources)throw new be(Pe.CapabilityNotSupported,`Server does not support resources (required for ${t})`);break;case "tools/call":case "tools/list":if(!this._capabilities.tools)throw new be(Pe.CapabilityNotSupported,`Server does not support tools (required for ${t})`);break;}}async _oninitialize(t){let e=t.params.protocolVersion;this._clientCapabilities=t.params.capabilities,this._clientVersion=t.params.clientInfo;let r=Gb(this._supportedProtocolVersions),i=r.includes(e)?e:r[0]??di;return this._negotiatedProtocolVersion=i,this.transport?.setProtocolVersion?.(i),{protocolVersion:i,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return {supportedVersions:Mv(this._supportedProtocolVersions),capabilities:xP(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(t,e){return this._wireCodec().projectCallToolResult(t,e)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(t,e){if(this._assertPushApiInServedEra("sampling/createMessage"),(t.tools||t.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new be(Pe.CapabilityNotSupported,"Client does not support sampling tools capability.");if(t.messages.length>0){let s=t.messages.at(-1),o=Array.isArray(s.content)?s.content:[s.content],a=o.some(d=>d.type==="tool_result"),c=t.messages.length>1?t.messages.at(-2):void 0,l=c?Array.isArray(c.content)?c.content:[c.content]:[],u=l.some(d=>d.type==="tool_use");if(a){if(o.some(d=>d.type!=="tool_result"))throw new he(ee.InvalidParams,"The last message must contain only tool_result content if any is present");if(!u)throw new he(ee.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(u){let d=new Set(l.filter(p=>p.type==="tool_use").map(p=>p.id)),f=new Set(o.filter(p=>p.type==="tool_result").map(p=>p.toolUseId));if(d.size!==f.size||![...d].every(p=>f.has(p)))throw new he(ee.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=!!(t.tools||t.toolChoice),i=await this.request({method:"sampling/createMessage",params:t},e),n=this._wireCodec().samplingResultVariant(r,i);if(!n.ok)throw new be(Pe.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(t,e){switch(this._assertPushApiInServedEra("elicitation/create"),t.mode??"form"){case "url":if(!this._clientCapabilities?.elicitation?.url)throw new be(Pe.CapabilityNotSupported,"Client does not support url elicitation.");break;case "form":if(!this._clientCapabilities?.elicitation?.form)throw new be(Pe.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(t,e)}async _sendElicitationLeg(t,e,r){let i=t.mode??"form",n=r?.validateAcceptedContent??true;switch(i){case "url":{let s=t;return this.request({method:"elicitation/create",params:s},e)}case "form":{let s=t.mode==="form"?t:{...t,mode:"form"},o=await this.request({method:"elicitation/create",params:s},e);if(n&&o.action==="accept"&&o.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(o.content);if(!a.valid)throw new he(ee.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){throw a instanceof he?a:new he(ee.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return o}}}createElicitationCompletionNotifier(t,e){if(!this._clientCapabilities?.elicitation?.url)throw new be(Pe.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return ()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:t}},e)}async listRoots(t,e){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:t},e)}async sendLoggingMessage(t,e){if(this._capabilities.logging&&!this.isMessageIgnored(t.level,e))return this.notification({method:"notifications/message",params:t})}async sendResourceUpdated(t){return this.notification({method:"notifications/resources/updated",params:t})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function xP(t){return {...t}}var Aa=class{server;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(t){let e=this._registeredTools[t];if(!(e===void 0||!e.enabled)){if(Object.hasOwn(this._toolInputSchemaJson,t))return this._toolInputSchemaJson[t];if(e.inputSchema===void 0)return jT;try{let r=vr(e.inputSchema,"input");return this._toolInputSchemaJson[t]=r,r}catch{return}}}constructor(t,e){this.server=new eR(t,e),e?.capabilities?.tools&&this.setToolRequestHandlers(),e?.capabilities?.resources&&this.setResourceRequestHandlers(),e?.capabilities?.prompts&&this.setPromptRequestHandlers();}async connect(t){return await this.server.connect(t)}async close(){await this.server.close();}_toolHandlersInitialized=false;setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??true}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,t])=>t.enabled).map(([t,e])=>{let r={name:t,title:e.title,description:e.description,inputSchema:e.inputSchema?vr(e.inputSchema,"input"):jT,annotations:e.annotations,icons:e.icons,execution:e.execution,_meta:e._meta};return e.outputSchema&&(r.outputSchema=vr(e.outputSchema,"output")),r})})),this.server.setRequestHandler("tools/call",async(t,e)=>{let r=this._registeredTools[t.params.name];if(!r)throw new he(ee.InvalidParams,`Tool ${t.params.name} not found`);if(!r.enabled)throw new he(ee.InvalidParams,`Tool ${t.params.name} disabled`);try{let i=await this.validateToolInput(r,t.params.arguments,t.params.name),n=await this.executeToolHandler(r,i,e);return await this.validateToolOutput(r,n,t.params.name),Ln(n)?n:this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(i){if(i instanceof he&&i.code===ee.UrlElicitationRequired)throw i;return this.createToolError(i instanceof Error?i.message:String(i))}}),this._toolHandlersInitialized=true);}createToolError(t){return {content:[{type:"text",text:t}],isError:true}}async validateToolInput(t,e,r){if(!t.inputSchema)return;let i=await mi(t.inputSchema,e??{});if(!i.success)throw new he(ee.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${i.error}`);return i.data}async validateToolOutput(t,e,r){if(!t.outputSchema||Ln(e)||e.isError)return;if(e.structuredContent===void 0)throw new he(ee.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let i=await mi(t.outputSchema,e.structuredContent);if(!i.success)throw new he(ee.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${i.error}`)}async executeToolHandler(t,e,r){return t.executor(e,r)}_completionHandlerInitialized=false;setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async t=>{switch(t.params.ref.type){case "ref/prompt":return Dv(t),this.handlePromptCompletion(t,t.params.ref);case "ref/resource":return Lv(t),this.handleResourceCompletion(t,t.params.ref);default:throw new he(ee.InvalidParams,`Invalid completion reference: ${t.params.ref}`)}}),this._completionHandlerInitialized=true);}async handlePromptCompletion(t,e){let r=this._registeredPrompts[e.name];if(!r)throw new he(ee.InvalidParams,`Prompt ${e.name} not found`);if(!r.enabled)throw new he(ee.InvalidParams,`Prompt ${e.name} disabled`);if(!r.argsSchema)return Ma;let i=KT(WT(r.argsSchema)?.[t.params.argument.name]);if(!ry(i))return Ma;let n=cP(i);return n?qT(await n(t.params.argument.value,t.params.context)):Ma}async handleResourceCompletion(t,e){let r=Object.values(this._registeredResourceTemplates).find(n=>n.resourceTemplate.uriTemplate.toString()===e.uri);if(!r){if(this._registeredResources[e.uri])return Ma;throw new he(ee.InvalidParams,`Resource template ${t.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(t.params.argument.name);return i?qT(await i(t.params.argument.value,t.params.context)):Ma}_resourceHandlersInitialized=false;setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??true}}),this.server.setRequestHandler("resources/list",async(t,e)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),i=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(e);for(let o of s.resources)i.push({...n.metadata,...o});}return {resources:[...r,...i]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([t,e])=>({name:t,uriTemplate:e.resourceTemplate.uriTemplate.toString(),...e.metadata}))})),this.server.setRequestHandler("resources/read",async(t,e)=>{let r;try{r=new URL(t.params.uri);}catch{throw new he(ee.InvalidParams,`Resource URI ${t.params.uri} is invalid`,{uri:t.params.uri,reason:"invalid_uri"})}let i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new he(ee.InvalidParams,`Resource ${r} disabled`);return Fd(await i.readCallback(r,e),i.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s)return Fd(await n.readCallback(r,s,e),n.cacheHint)}throw new Bd(t.params.uri)}),this._resourceHandlersInitialized=true);}_promptHandlersInitialized=false;setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??true}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,t])=>t.enabled).map(([t,e])=>({name:t,title:e.title,description:e.description,arguments:e.argsSchema?cT(e.argsSchema):void 0,icons:e.icons,_meta:e._meta}))})),this.server.setRequestHandler("prompts/get",async(t,e)=>{let r=this._registeredPrompts[t.params.name];if(!r)throw new he(ee.InvalidParams,`Prompt ${t.params.name} not found`);if(!r.enabled)throw new he(ee.InvalidParams,`Prompt ${t.params.name} disabled`);return r.handler(t.params.arguments,e)}),this._promptHandlersInitialized=true);}registerResource(t,e,r,i){let n=r.cacheHint,s=r;if(n!==void 0){Ov(n,`resource ${t}`);let o={...r};delete o.cacheHint,s=o;}if(typeof e=="string"){if(this._registeredResources[e])throw new Error(`Resource ${e} is already registered`);let o=this._createRegisteredResource(t,r.title,e,s,i);return n!==void 0&&(o.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}else {if(this._registeredResourceTemplates[t])throw new Error(`Resource template ${t} is already registered`);let o=this._createRegisteredResourceTemplate(t,r.title,e,s,i);return n!==void 0&&(o.cacheHint=n),this.setResourceRequestHandlers(),this.sendResourceListChanged(),o}}_createRegisteredResource(t,e,r,i,n){let s={name:t,title:e,metadata:i,readCallback:n,enabled:true,disable:()=>s.update({enabled:false}),enable:()=>s.update({enabled:true}),remove:()=>s.update({uri:null}),update:o=>{o.uri!==void 0&&o.uri!==r&&(delete this._registeredResources[r],o.uri&&(this._registeredResources[o.uri]=s)),o.name!==void 0&&(s.name=o.name),o.title!==void 0&&(s.title=o.title),o.metadata!==void 0&&(s.metadata=o.metadata),o.callback!==void 0&&(s.readCallback=o.callback),o.enabled!==void 0&&(s.enabled=o.enabled),this.sendResourceListChanged();}};return this._registeredResources[r]=s,s}_createRegisteredResourceTemplate(t,e,r,i,n){let s={resourceTemplate:r,title:e,metadata:i,readCallback:n,enabled:true,disable:()=>s.update({enabled:false}),enable:()=>s.update({enabled:true}),remove:()=>s.update({name:null}),update:a=>{a.name!==void 0&&a.name!==t&&(delete this._registeredResourceTemplates[t],a.name&&(this._registeredResourceTemplates[a.name]=s)),a.title!==void 0&&(s.title=a.title),a.template!==void 0&&(s.resourceTemplate=a.template),a.metadata!==void 0&&(s.metadata=a.metadata),a.callback!==void 0&&(s.readCallback=a.callback),a.enabled!==void 0&&(s.enabled=a.enabled),this.sendResourceListChanged();}};this._registeredResourceTemplates[t]=s;let o=r.uriTemplate.variableNames;return Array.isArray(o)&&o.some(a=>!!r.completeCallback(a))&&this.setCompletionRequestHandler(),s}_createRegisteredPrompt(t,e,r,i,n,s,o){let a=i,c=n,l={title:e,description:r,argsSchema:i,icons:s,_meta:o,handler:HT(t,i,n),enabled:true,disable:()=>l.update({enabled:false}),enable:()=>l.update({enabled:true}),remove:()=>l.update({name:null}),update:u=>{u.name!==void 0&&u.name!==t&&(delete this._registeredPrompts[t],u.name&&(this._registeredPrompts[u.name]=l)),u.title!==void 0&&(l.title=u.title),u.description!==void 0&&(l.description=u.description),u.icons!==void 0&&(l.icons=u.icons),u._meta!==void 0&&(l._meta=u._meta);let d=false;u.argsSchema!==void 0&&(l.argsSchema=u.argsSchema,a=u.argsSchema,d=true),u.callback!==void 0&&(c=u.callback,d=true),d&&(l.handler=HT(t,a,c)),u.enabled!==void 0&&(l.enabled=u.enabled),this.sendPromptListChanged();}};if(this._registeredPrompts[t]=l,i){let u=WT(i);u&&Object.values(u).some(d=>ry(KT(d)))&&this.setCompletionRequestHandler();}return l}_createRegisteredTool(t,e,r,i,n,s,o,a,c,l){if(Kv(t),i!==void 0)try{let f=vr(i,"input");this._toolInputSchemaJson[t]=f;let p=kv(f);p.valid||console.warn(`[mcp-sdk] tool '${t}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${p.reason}`);}catch{}let u=l,d={title:e,description:r,inputSchema:i,outputSchema:n,outputSchemaJson:GT(n),annotations:s,icons:o,execution:a,_meta:c,handler:l,executor:VT(i,l),enabled:true,disable:()=>d.update({enabled:false}),enable:()=>d.update({enabled:true}),remove:()=>d.update({name:null}),update:f=>{f.name!==void 0&&f.name!==t&&(typeof f.name=="string"&&Kv(f.name),delete this._registeredTools[t],delete this._toolInputSchemaJson[t],f.name&&(delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=d,t=f.name)),f.title!==void 0&&(d.title=f.title),f.description!==void 0&&(d.description=f.description);let p=false;f.paramsSchema!==void 0&&(d.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[t],p=true),f.callback!==void 0&&(d.handler=f.callback,u=f.callback,p=true),p&&(d.executor=VT(d.inputSchema,u)),f.outputSchema!==void 0&&(d.outputSchema=f.outputSchema,d.outputSchemaJson=GT(f.outputSchema)),f.annotations!==void 0&&(d.annotations=f.annotations),f.icons!==void 0&&(d.icons=f.icons),f._meta!==void 0&&(d._meta=f._meta),f.enabled!==void 0&&(d.enabled=f.enabled),this.sendToolListChanged();}};return this._registeredTools[t]=d,this.setToolRequestHandlers(),this.sendToolListChanged(),d}registerTool(t,e,r){if(this._registeredTools[t])throw new Error(`Tool ${t} is already registered`);let{title:i,description:n,inputSchema:s,outputSchema:o,annotations:a,icons:c,_meta:l}=e;return this._createRegisteredTool(t,i,n,Kd(s),Kd(o),a,c,void 0,l,r)}registerPrompt(t,e,r){if(this._registeredPrompts[t])throw new Error(`Prompt ${t} is already registered`);let{title:i,description:n,argsSchema:s,icons:o,_meta:a}=e,c=this._createRegisteredPrompt(t,i,n,Kd(s),r,o,a);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),c}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(t,e){return this.server.sendLoggingMessage(t,e)}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged();}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged();}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged();}};function VT(t,e){if(t){let i=e;return async(n,s)=>i(n,s)}let r=e;return async(i,n)=>r(n)}var jT={type:"object",properties:{}};function GT(t){if(t!==void 0)try{return vr(t,"output")}catch{return}}function HT(t,e,r){if(e){let i=r;return async(n,s)=>{let o=await mi(e,n);if(!o.success)throw new he(ee.InvalidParams,`Invalid arguments for prompt ${t}: ${o.error}`);return i(o.data,s)}}else {let i=r;return async(n,s)=>i(s)}}function qT(t){return {completion:{values:t.map(String).slice(0,100),total:t.length,hasMore:t.length>100}}}var Ma={completion:{values:[],hasMore:false}};function WT(t){let e=t;if(e.shape&&typeof e.shape=="object")return e.shape}function bP(t){return t?.type==="optional"}function KT(t){return bP(t)?t.def?.innerType??t:t}var TP=class{_readBuffer;_started=false;_closed=false;constructor(t=ty.stdin,e=ty.stdout,r){this._stdin=t,this._stdout=e,this._readBuffer=new qv({maxBufferSize:r?.maxBufferSize});}onclose;onerror;onmessage;_ondata=t=>{try{this._readBuffer.append(t),this.processReadBuffer();}catch(e){this.onerror?.(e),this.close().catch(()=>{});}};_onerror=t=>{this.onerror?.(t);};_onstdouterror=t=>{this.onerror?.(t),this.close().catch(()=>{});};async start(){if(this._started)throw new Error("StdioServerTransport already started! If using Server class, note that connect() calls start() automatically.");this._started=true,this._stdin.on("data",this._ondata),this._stdin.on("error",this._onerror),this._stdout.on("error",this._onstdouterror);}processReadBuffer(){for(;;)try{let t=this._readBuffer.readMessage();if(t===null)break;this.onmessage?.(t);}catch(t){this.onerror?.(t);}}async close(){this._closed||(this._closed=true,this._stdin.off("data",this._ondata),this._stdin.off("error",this._onerror),this._stdout.off("error",this._onstdouterror),this._stdin.listenerCount("data")===0&&this._stdin.pause(),this._readBuffer.clear(),this.onclose?.());}send(t){return this._closed?Promise.reject(new Error("StdioServerTransport is closed")):new Promise((e,r)=>{let i=Wv(t),n=false,s=a=>{n||(n=true,this._stdout.off("error",s),this._stdout.off("drain",o),r(a));},o=()=>{n||(n=true,this._stdout.off("error",s),this._stdout.off("drain",o),e());};if(this._stdout.once("error",s),this._stdout.write(i)){if(n)return;n=true,this._stdout.off("error",s),e();}else n||this._stdout.once("drain",o);})}},tR=3e3,RP=class{onclose;onerror;onmessage;_closed=false;_pendingRequests=new Set;_drainWaiters=[];constructor(t,e,r){this._wire=t,this._onInstanceClose=e,this._outboundIntercept=r;}async start(){}async send(t,e){if(ba(t)||qd(t)){let{id:r}=t;r!==void 0&&this._settle(r);}if(!this._closed&&this._outboundIntercept?.(t)!=="handled")return this._wire.send(t,e)}setProtocolVersion=t=>{this._wire.setProtocolVersion?.(t);};deliver(t,e){if(!this._closed){if(Xt(t))this._pendingRequests.add(t.id);else if(_r(t)&&t.method==="notifications/cancelled"){let r=t.params?.requestId;r!==void 0&&this._settle(r);}this.onmessage?.(t,e);}}async whenRequestsAnswered(t){return this._closed||this._pendingRequests.size===0?true:await new Promise(e=>{let r=()=>{clearTimeout(i),e(true);},i=setTimeout(()=>{this._drainWaiters=this._drainWaiters.filter(n=>n!==r),e(false);},t);this._drainWaiters.push(r);})}async close(){if(!this._closed){this._closed=true,this._pendingRequests.clear(),this._releaseDrainWaiters();try{this._onInstanceClose();}finally{this.onclose?.();}}}_settle(t){this._pendingRequests.delete(t),this._pendingRequests.size===0&&this._releaseDrainWaiters();}_releaseDrainWaiters(){let t=this._drainWaiters;this._drainWaiters=[];for(let e of t)e();}};function EP(t){let e=t.params;if(t.method==="initialize"&&!Uv(e)){let s=e!==null&&typeof e=="object"&&typeof e.protocolVersion=="string"?e.protocolVersion:void 0;return {kind:"legacy",reason:"initialize",...s!==void 0&&{requestedVersion:s}}}if(!jd(e))return {kind:"legacy",reason:"no-claim"};let r=_i(e),i=(r===void 0?[]:Hd(r))[0];if(i!==void 0)return {kind:"invalid-envelope",issue:i};let n=Gd(e);return n===void 0||!gr.includes(n)?{kind:"unsupported-revision",requested:n??"unknown"}:{kind:"modern",revision:n,classification:{era:"modern",revision:n}}}function nR(t,e={}){let r=e.legacy??"serve",i=e.transport??new TP,n={phase:"opening"},s,o=false,a=()=>o||n.phase==="closed",c=E=>{try{e.onerror?.(E);}catch{}},l=(E,M,N,O)=>i.send({jsonrpc:"2.0",id:E,error:{code:M,message:N,...O!==void 0&&{data:O}}}).catch(k=>c(dn(k))),u=new XT(e.maxSubscriptions??nh),d=E=>{if(!_r(E))return;let M=u.routeOutbound(E);if(M!=="passthrough"){for(let N of M)i.send({jsonrpc:"2.0",...N}).catch(O=>c(dn(O)));return "handled"}},f=async E=>{if(Xt(E)&&E.method==="subscriptions/listen"){let M=_i(E.params),N=jd(E.params)?(M===void 0?[]:Hd(M))[0]:{key:"_meta",problem:"the per-request envelope is required on protocol revision 2026-07-28"},O=Gd(E.params),k;if(N!==void 0)k={jsonrpc:"2.0",id:E.id,error:{code:-32602,message:`Invalid _meta envelope: ${N.key}: ${N.problem}`}};else if(O===void 0||!gr.includes(O)){let j=new ws({supported:[...gr],requested:O??"unknown"});k={jsonrpc:"2.0",id:E.id,error:{code:j.code,message:j.message,data:j.data}};}else k=u.serve(E);return await i.send("error"in k?k:{jsonrpc:"2.0",method:k.method,params:k.params}).catch(j=>c(dn(j))),true}if(_r(E)&&E.method==="notifications/cancelled"){let M=E.params?.requestId;if(M!==void 0&&u.cancel(M))return true}return false},p=(E,M,N)=>{let O=Fv({reason:M,...N!==void 0&&{requestedVersion:N}},gr);return O===void 0?Promise.resolve():(c(new Error(`Rejected 2025-era request on a modern-only stdio connection (${O.cell}): ${O.message}`)),l(E.id,O.code,O.message,O.data))},g=E=>{o||E===s||T();},m=async(E,M)=>{let N=await t({era:E}),O=N instanceof Aa?N.server:N;E==="modern"&&(jv(O,M),iy(O,gr),u.setServerCapabilities(O.getCapabilities(),sy(O)));let k=new RP(i,()=>g(k),E==="modern"?d:void 0);return await N.connect(k),{product:N,channel:k}},S=E=>E.product.close().catch(M=>c(dn(M))),h=async E=>{s=E.channel;try{await E.channel.whenRequestsAnswered(tR)||c(new Error(`Discarded the probe instance with requests still unanswered after ${tR}ms; continuing with the fallback`)),await E.product.close();}catch(M){c(dn(M));}finally{s=void 0;}},v=async E=>{if(n.phase==="closed")return;if(n.phase==="pinned"){if(n.era==="modern"&&Xt(E)&&E.method==="initialize"&&!Uv(E.params)){await p(E,"initialize",E.params!==null&&typeof E.params=="object"&&typeof E.params.protocolVersion=="string"?E.params.protocolVersion:void 0);return}if(n.era==="modern"&&await f(E))return;n.instance.channel.deliver(E);return}if(!Xt(E)&&!_r(E)){c(new Error("Discarded a JSON-RPC response received before the connection negotiated an era"));return}let M=EP(E);switch(M.kind){case "invalid-envelope":{let N=`Invalid _meta envelope for protocol revision 2026-07-28: ${M.issue.key}: ${M.issue.problem}`;Xt(E)?await l(E.id,ee.InvalidParams,N,{envelope:M.issue}):c(new Error(`Discarded a notification with a malformed envelope: ${N}`));return}case "unsupported-revision":if(Xt(E)){let N=new ws({supported:[...gr],requested:M.requested});c(N),await l(E.id,N.code,N.message,N.data);}else c(new Error(`Discarded a notification claiming unsupported protocol revision ${M.requested}`));return;case "modern":if(Xt(E)&&E.method==="server/discover"){if(n.phase==="probe"){n.instance.channel.deliver(E,{classification:M.classification});return}let N=await m("modern",M.revision);if(a()){await S(N);return}n={phase:"probe",instance:N},N.channel.deliver(E,{classification:M.classification});return}if(n.phase==="probe"){if(_r(E)){n.instance.channel.deliver(E,{classification:M.classification});return}n={phase:"pinned",era:"modern",instance:n.instance};}else {let N=await m("modern",M.revision);if(a()){await S(N);return}n={phase:"pinned",era:"modern",instance:N};}if(await f(E))return;n.instance.channel.deliver(E,{classification:M.classification});return;case "legacy":{if(r==="reject"){Xt(E)&&await p(E,M.reason,M.requestedVersion);return}if(n.phase==="probe"){if(await h(n.instance),a())return;n={phase:"opening"};}let N=await m("legacy");if(a()){await S(N);return}n={phase:"pinned",era:"legacy",instance:N},n.instance.channel.deliver(E);return}}},_=[],y=false,R=async()=>{if(!y){y=true;try{for(;_.length>0;){let E=_.shift();try{await v(E);}catch(M){Xt(E)&&await l(E.id,ee.InternalError,"Internal server error"),c(dn(M));}}}finally{y=false;}}},T=async()=>{if(o||n.phase==="closed")return;o=true;let E=n;n={phase:"closed"};for(let M of u.teardownAll())await i.send(M).catch(N=>c(dn(N)));(E.phase==="probe"||E.phase==="pinned")&&await E.instance.product.close().catch(M=>c(dn(M))),await i.close().catch(M=>c(dn(M)));};i.onmessage=E=>{_.push(E),R();},i.onerror=E=>{c(E),(n.phase==="probe"||n.phase==="pinned")&&n.instance.channel.onerror?.(E);},i.onclose=()=>{if(o||n.phase==="closed")return;o=true;let E=n;n={phase:"closed"},(E.phase==="probe"||E.phase==="pinned")&&E.instance.product.close().catch(M=>c(dn(M)));};let b=i.start().catch(E=>{throw c(dn(E)),E});return b.catch(()=>{}),{close:async()=>{await b.catch(()=>{}),await T();}}}function dn(t){return t instanceof Error?t:new Error(String(t))}var rR=class{_listeners={};addEventListener(t,e){let r=this._listeners;return r[t]===void 0&&(r[t]=[]),r[t].indexOf(e)===-1&&r[t].push(e),this}removeEventListener(t,e){let r=this._listeners[t];if(r!==void 0){let i=r.indexOf(e);i!==-1&&r.splice(i,1);}return this}dispatchEvent(t){let e=this._listeners[t.type];if(e!==void 0){let r=e.slice(0);for(let i=0,n=r.length;i<n;i++)r[i].call(this,t);}return this}dispose(){for(let t in this._listeners)delete this._listeners[t];}},Sr=class{_disposed=false;_name;_parent;_child;_attributes;constructor(t,e,r,i={}){if(this._name=t,this._parent=e,this._child=r,this._attributes=i,!e.isOnGraph(r))throw new Error("Cannot connect disconnected graphs.")}getName(){return this._name}getParent(){return this._parent}getChild(){return this._child}setChild(t){return this._child=t,this}getAttributes(){return this._attributes}dispose(){this._disposed||(this._parent._destroyRef(this),this._disposed=true);}isDisposed(){return this._disposed}},oy=class extends rR{_emptySet=new Set;_edges=new Set;_parentEdges=new Map;_childEdges=new Map;listEdges(){return Array.from(this._edges)}listParentEdges(t){return Array.from(this._childEdges.get(t)||this._emptySet)}listParents(t){let e=new Set;for(let r of this.listParentEdges(t))e.add(r.getParent());return Array.from(e)}listChildEdges(t){return Array.from(this._parentEdges.get(t)||this._emptySet)}listChildren(t){let e=new Set;for(let r of this.listChildEdges(t))e.add(r.getChild());return Array.from(e)}disconnectParents(t,e){for(let r of this.listParentEdges(t))(!e||e(r.getParent()))&&r.dispose();return this}_createEdge(t,e,r,i){let n=new Sr(t,e,r,i);this._edges.add(n);let s=n.getParent();this._parentEdges.has(s)||this._parentEdges.set(s,new Set),this._parentEdges.get(s).add(n);let o=n.getChild();return this._childEdges.has(o)||this._childEdges.set(o,new Set),this._childEdges.get(o).add(n),n}_destroyEdge(t){return this._edges.delete(t),this._parentEdges.get(t.getParent()).delete(t),this._childEdges.get(t.getChild()).delete(t),this}},mt=class{list=[];constructor(t){if(t)for(let e of t)this.list.push(e);}add(t){this.list.push(t);}remove(t){let e=this.list.indexOf(t);e>=0&&this.list.splice(e,1);}removeChild(t){let e=[];for(let r of this.list)r.getChild()===t&&e.push(r);for(let r of e)this.remove(r);return e}listRefsByChild(t){let e=[];for(let r of this.list)r.getChild()===t&&e.push(r);return e}values(){return this.list}},Be=class{set=new Set;map=new Map;constructor(t){if(t)for(let e of t)this.add(e);}add(t){let e=t.getChild();this.removeChild(e),this.set.add(t),this.map.set(e,t);}remove(t){this.set.delete(t),this.map.delete(t.getChild());}removeChild(t){let e=this.map.get(t)||null;return e&&this.remove(e),e}getRefByChild(t){return this.map.get(t)||null}values(){return Array.from(this.set)}},st=class{map={};constructor(t){t&&Object.assign(this.map,t);}set(t,e){this.map[t]=e;}delete(t){delete this.map[t];}get(t){return this.map[t]||null}keys(){return Object.keys(this.map)}values(){return Object.values(this.map)}},Le=Symbol("attributes"),yr=Symbol("immutableKeys"),iR=class sR extends rR{_disposed=false;graph;[Le];[yr];constructor(e){super(),this.graph=e,this[yr]=new Set,this[Le]=this._createAttributes();}getDefaults(){return {}}_createAttributes(){let e=this.getDefaults(),r={};for(let i in e){let n=e[i];if(n instanceof sR){let s=this.graph._createEdge(i,this,n);this[yr].add(i),r[i]=s;}else r[i]=n;}return r}isOnGraph(e){return this.graph===e.graph}isDisposed(){return this._disposed}dispose(){this._disposed||(this.graph.listChildEdges(this).forEach(e=>e.dispose()),this.graph.disconnectParents(this),this._disposed=true,this.dispatchEvent({type:"dispose"}));}detach(){return this.graph.disconnectParents(this),this}swap(e,r){for(let i in this[Le]){let n=this[Le][i];if(n instanceof Sr){let s=n;s.getChild()===e&&this.setRef(i,r,s.getAttributes());}else if(n instanceof mt)for(let s of n.listRefsByChild(e)){let o=s.getAttributes();this.removeRef(i,e),this.addRef(i,r,o);}else if(n instanceof Be){let s=n.getRefByChild(e);if(s){let o=s.getAttributes();this.removeRef(i,e),this.addRef(i,r,o);}}else if(n instanceof st)for(let s of n.keys()){let o=n.get(s);o.getChild()===e&&this.setRefMap(i,s,r,o.getAttributes());}}return this}get(e){return this[Le][e]}set(e,r){return this[Le][e]=r,this.dispatchEvent({type:"change",attribute:e})}getRef(e){let r=this[Le][e];return r?r.getChild():null}setRef(e,r,i){if(this[yr].has(e))throw new Error(`Cannot overwrite immutable attribute, "${e}".`);let n=this[Le][e];if(n&&n.dispose(),!r)return this;let s=this.graph._createEdge(e,this,r,i);return this[Le][e]=s,this.dispatchEvent({type:"change",attribute:e})}listRefs(e){return this.assertRefList(e).values().map(r=>r.getChild())}addRef(e,r,i){let n=this.graph._createEdge(e,this,r,i);return this.assertRefList(e).add(n),this.dispatchEvent({type:"change",attribute:e})}removeRef(e,r){let i=this.assertRefList(e);if(i instanceof mt)for(let n of i.listRefsByChild(r))n.dispose();else {let n=i.getRefByChild(r);n&&n.dispose();}return this}assertRefList(e){let r=this[Le][e];if(r instanceof mt||r instanceof Be)return r;throw new Error(`Expected RefList or RefSet for attribute "${e}"`)}listRefMapKeys(e){return this.assertRefMap(e).keys()}listRefMapValues(e){return this.assertRefMap(e).values().map(r=>r.getChild())}getRefMap(e,r){let i=this.assertRefMap(e).get(r);return i?i.getChild():null}setRefMap(e,r,i,n){let s=this.assertRefMap(e),o=s.get(r);if(o&&o.dispose(),!i)return this;n=Object.assign(n||{},{key:r});let a=this.graph._createEdge(e,this,i,{...n,key:r});return s.set(r,a),this.dispatchEvent({type:"change",attribute:e,key:r})}assertRefMap(e){let r=this[Le][e];if(r instanceof st)return r;throw new Error(`Expected RefMap for attribute "${e}"`)}dispatchEvent(e){return super.dispatchEvent({...e,target:this}),this.graph.dispatchEvent({...e,target:this,type:`node:${e.type}`}),this}_destroyRef(e){let r=e.getName();if(this[Le][r]===e)this[Le][r]=null,this[yr].has(r)&&e.getChild().dispose();else if(this[Le][r]instanceof mt)this[Le][r].remove(e);else if(this[Le][r]instanceof Be)this[Le][r].remove(e);else if(this[Le][r]instanceof st){let i=this[Le][r];for(let n of i.keys())i.get(n)===e&&i.delete(n);}else return;this.graph._destroyEdge(e),this.dispatchEvent({type:"change",attribute:r});}};var hR="v4.4.2",br="@glb.bin",te=(function(t){return t.ACCESSOR="Accessor",t.ANIMATION="Animation",t.ANIMATION_CHANNEL="AnimationChannel",t.ANIMATION_SAMPLER="AnimationSampler",t.BUFFER="Buffer",t.CAMERA="Camera",t.MATERIAL="Material",t.MESH="Mesh",t.PRIMITIVE="Primitive",t.PRIMITIVE_TARGET="PrimitiveTarget",t.NODE="Node",t.ROOT="Root",t.SCENE="Scene",t.SKIN="Skin",t.TEXTURE="Texture",t.TEXTURE_INFO="TextureInfo",t})({});var wP=(function(t){return t.ARRAY_BUFFER="ARRAY_BUFFER",t.ELEMENT_ARRAY_BUFFER="ELEMENT_ARRAY_BUFFER",t.INVERSE_BIND_MATRICES="INVERSE_BIND_MATRICES",t.OTHER="OTHER",t.SPARSE="SPARSE",t})({}),hn=(function(t){return t[t.R=4096]="R",t[t.G=256]="G",t[t.B=16]="B",t[t.A=1]="A",t})({});var MP=class extends Float32Array{constructor(){throw super(),new Error("Unsupported typed array instantiation.")}},uh={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5131:typeof Float16Array<"u"?Float16Array:MP,5126:Float32Array,5130:Float64Array},we=class{static createBufferFromDataURI(t){if(typeof Buffer>"u"){let e=atob(t.split(",")[1]),r=new Uint8Array(e.length);for(let i=0;i<e.length;i++)r[i]=e.charCodeAt(i);return r}else {let e=t.split(",")[1],r=t.indexOf("base64")>=0;return Buffer.from(e,r?"base64":"utf8")}}static encodeText(t){return new TextEncoder().encode(t)}static decodeText(t){return new TextDecoder().decode(t)}static concat(t){let e=0;for(let n of t)e+=n.byteLength;let r=new Uint8Array(e),i=0;for(let n of t)r.set(n,i),i+=n.byteLength;return r}static pad(t,e=0){let r=this.padNumber(t.byteLength);if(r===t.byteLength)return t;let i=new Uint8Array(r);if(i.set(t),e!==0)for(let n=t.byteLength;n<r;n++)i[n]=e;return i}static padNumber(t){return Math.ceil(t/4)*4}static equals(t,e){if(t===e)return true;if(t.byteLength!==e.byteLength)return false;let r=t.byteLength;for(;r--;)if(t[r]!==e[r])return false;return true}static toView(t,e=0,r=1/0){return new Uint8Array(t.buffer,t.byteOffset+e,Math.min(t.byteLength,r))}static assertView(t){if(t&&!ArrayBuffer.isView(t))throw new Error(`Method requires Uint8Array parameter; received "${typeof t}".`);return t}};var AP=class{match(t){return t.length>=3&&t[0]===255&&t[1]===216&&t[2]===255}getSize(t){let e=new DataView(t.buffer,t.byteOffset+4),r,i;for(;e.byteLength;){if(r=e.getUint16(0,false),CP(e,r),i=e.getUint8(r+1),i===192||i===193||i===194)return [e.getUint16(r+7,false),e.getUint16(r+5,false)];e=new DataView(t.buffer,e.byteOffset+r+2);}throw new TypeError("Invalid JPG, no size found")}getChannels(t){return 3}},IP=class fR{static PNG_FRIED_CHUNK_NAME="CgBI";match(e){return e.length>=8&&e[0]===137&&e[1]===80&&e[2]===78&&e[3]===71&&e[4]===13&&e[5]===10&&e[6]===26&&e[7]===10}getSize(e){let r=new DataView(e.buffer,e.byteOffset);return we.decodeText(e.slice(12,16))===fR.PNG_FRIED_CHUNK_NAME?[r.getUint32(32,false),r.getUint32(36,false)]:[r.getUint32(16,false),r.getUint32(20,false)]}getChannels(e){return 4}},Tn=class{static impls={"image/jpeg":new AP,"image/png":new IP};static registerFormat(t,e){this.impls[t]=e;}static getMimeType(t){for(let e in this.impls)if(this.impls[e].match(t))return e;return null}static getSize(t,e){return this.impls[e]?this.impls[e].getSize(t):null}static getChannels(t,e){return this.impls[e]?this.impls[e].getChannels(t):null}static getVRAMByteLength(t,e){if(!this.impls[e])return null;if(this.impls[e].getVRAMByteLength)return this.impls[e].getVRAMByteLength(t);let r=0,i=4,n=this.getSize(t,e);if(!n)return null;for(;n[0]>1||n[1]>1;)r+=n[0]*n[1]*i,n[0]=Math.max(Math.floor(n[0]/2),1),n[1]=Math.max(Math.floor(n[1]/2),1);return r+=1*i,r}static mimeTypeToExtension(t){return t==="image/jpeg"?"jpg":t.split("/").pop()}static extensionToMimeType(t){return t==="jpg"?"image/jpeg":t?`image/${t}`:""}};function CP(t,e){if(e>t.byteLength)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(t.getUint8(e)!==255)throw new TypeError("Invalid JPG, marker table corrupted");return t}var yi=class{static basename(t){let e=t.split(/[\\/]/).pop();return e.substring(0,e.lastIndexOf("."))}static extension(t){if(t.startsWith("data:image/")){let e=t.match(/data:(image\/\w+)/)[1];return Tn.mimeTypeToExtension(e)}else {if(t.startsWith("data:model/gltf+json"))return "gltf";if(t.startsWith("data:model/gltf-binary"))return "glb";if(t.startsWith("data:application/"))return "bin"}return t.split(/[\\/]/).pop().split(/[.]/).pop()}},cy=typeof Float32Array<"u"?Float32Array:Array;function PP(){var t=new cy(3);return cy!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function ay(t){var e=t[0],r=t[1],i=t[2];return Math.sqrt(e*e+r*r+i*i)}function NP(t,e,r){var i=e[0],n=e[1],s=e[2],o=r[3]*i+r[7]*n+r[11]*s+r[15];return o=o||1,t[0]=(r[0]*i+r[4]*n+r[8]*s+r[12])/o,t[1]=(r[1]*i+r[5]*n+r[9]*s+r[13])/o,t[2]=(r[2]*i+r[6]*n+r[10]*s+r[14])/o,t}(function(){var t=PP();return function(e,r,i,n,s,o){var a,c;for(r||(r=3),i||(i=0),n?c=Math.min(n*r+i,e.length):c=e.length,a=i;a<c;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,o),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}})();function pR(t){let e=mR(),r=t.propertyType==="Node"?[t]:t.listChildren();for(let i of r)i.traverse(n=>{let s=n.getMesh();if(!s)return;let o=OP(s,n.getWorldMatrix());o.min.every(isFinite)&&o.max.every(isFinite)&&(ly(o.min,e),ly(o.max,e));});return e}function OP(t,e){let r=mR();for(let i of t.listPrimitives()){let n=i.getAttribute("POSITION"),s=i.getIndices();if(!n)continue;let o=[0,0,0],a=[0,0,0];for(let c=0,l=s?s.getCount():n.getCount();c<l;c++){let u=s?s.getScalar(c):c;o=n.getElement(u,o),a=NP(a,o,e),ly(a,r);}}return r}function ly(t,e){for(let r=0;r<3;r++)e.min[r]=Math.min(t[r],e.min[r]),e.max[r]=Math.max(t[r],e.max[r]);}function mR(){return {min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]}}var oR="https://null.example",kn=class{static DEFAULT_INIT={};static PROTOCOL_REGEXP=/^[a-zA-Z]+:\/\//;static dirname(t){let e=t.lastIndexOf("/");return e===-1?"./":t.substring(0,e+1)}static basename(t){return yi.basename(new URL(t,oR).pathname)}static extension(t){return yi.extension(new URL(t,oR).pathname)}static resolve(t,e){if(!this.isRelativePath(e))return e;let r=t.split("/"),i=e.split("/");r.pop();for(let n=0;n<i.length;n++)i[n]!=="."&&(i[n]===".."?r.pop():r.push(i[n]));return r.join("/")}static isAbsoluteURL(t){return this.PROTOCOL_REGEXP.test(t)}static isRelativePath(t){return !/^(?:[a-zA-Z]+:)?\//.test(t)}};function aR(t){return Object.prototype.toString.call(t)==="[object Object]"}function vi(t){if(aR(t)===false)return false;let e=t.constructor;if(e===void 0)return true;let r=e.prototype;return !(aR(r)===false||Object.hasOwn(r,"isPrototypeOf")===false)}var zP=(function(t){return t[t.SILENT=4]="SILENT",t[t.ERROR=3]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=1]="INFO",t[t.DEBUG=0]="DEBUG",t})({}),dh=class gR{verbosity;static Verbosity=zP;static DEFAULT_INSTANCE=new gR(1);constructor(e){this.verbosity=e;}debug(e){this.verbosity<=0&&console.debug(e);}info(e){this.verbosity<=1&&console.info(e);}warn(e){this.verbosity<=2&&console.warn(e);}error(e){this.verbosity<=3&&console.error(e);}};function $P(t){var e=t[0],r=t[1],i=t[2],n=t[3],s=t[4],o=t[5],a=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],g=t[13],m=t[14],S=t[15],h=e*o-r*s,v=e*a-i*s,_=r*a-i*o,y=l*g-u*p,R=l*m-d*p,T=u*m-d*g,b=e*T-r*R+i*y,E=s*T-o*R+a*y,M=l*_-u*v+d*h,N=p*_-g*v+m*h;return c*b-n*E+S*M-f*N}function DP(t,e,r){var i=e[0],n=e[1],s=e[2],o=e[3],a=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=e[9],p=e[10],g=e[11],m=e[12],S=e[13],h=e[14],v=e[15],_=r[0],y=r[1],R=r[2],T=r[3];return t[0]=_*i+y*a+R*d+T*m,t[1]=_*n+y*c+R*f+T*S,t[2]=_*s+y*l+R*p+T*h,t[3]=_*o+y*u+R*g+T*v,_=r[4],y=r[5],R=r[6],T=r[7],t[4]=_*i+y*a+R*d+T*m,t[5]=_*n+y*c+R*f+T*S,t[6]=_*s+y*l+R*p+T*h,t[7]=_*o+y*u+R*g+T*v,_=r[8],y=r[9],R=r[10],T=r[11],t[8]=_*i+y*a+R*d+T*m,t[9]=_*n+y*c+R*f+T*S,t[10]=_*s+y*l+R*p+T*h,t[11]=_*o+y*u+R*g+T*v,_=r[12],y=r[13],R=r[14],T=r[15],t[12]=_*i+y*a+R*d+T*m,t[13]=_*n+y*c+R*f+T*S,t[14]=_*s+y*l+R*p+T*h,t[15]=_*o+y*u+R*g+T*v,t}function LP(t,e){var r=e[0],i=e[1],n=e[2],s=e[4],o=e[5],a=e[6],c=e[8],l=e[9],u=e[10];return t[0]=Math.sqrt(r*r+i*i+n*n),t[1]=Math.sqrt(s*s+o*o+a*a),t[2]=Math.sqrt(c*c+l*l+u*u),t}function kP(t,e){var r=new cy(3);LP(r,e);var i=1/r[0],n=1/r[1],s=1/r[2],o=e[0]*i,a=e[1]*n,c=e[2]*s,l=e[4]*i,u=e[5]*n,d=e[6]*s,f=e[8]*i,p=e[9]*n,g=e[10]*s,m=o+u+g,S=0;return m>0?(S=Math.sqrt(m+1)*2,t[3]=.25*S,t[0]=(d-p)/S,t[1]=(f-c)/S,t[2]=(a-l)/S):o>u&&o>g?(S=Math.sqrt(1+o-u-g)*2,t[3]=(d-p)/S,t[0]=.25*S,t[1]=(a+l)/S,t[2]=(f+c)/S):u>g?(S=Math.sqrt(1+u-o-g)*2,t[3]=(f-c)/S,t[0]=(a+l)/S,t[1]=.25*S,t[2]=(d+p)/S):(S=Math.sqrt(1+g-o-u)*2,t[3]=(a-l)/S,t[0]=(f+c)/S,t[1]=(d+p)/S,t[2]=.25*S),t}var Ke=class Ia{static identity(e){return e}static eq(e,r,i=1e-5){if(e.length!==r.length)return false;for(let n=0;n<e.length;n++)if(Math.abs(e[n]-r[n])>i)return false;return true}static clamp(e,r,i){return e<r?r:e>i?i:e}static decodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return e/65535;case 5121:return e/255;case 5122:return Math.max(e/32767,-1);case 5120:return Math.max(e/127,-1);default:throw new Error("Invalid component type.")}}static encodeNormalizedInt(e,r){switch(r){case 5126:return e;case 5123:return Math.round(Ia.clamp(e,0,1)*65535);case 5121:return Math.round(Ia.clamp(e,0,1)*255);case 5122:return Math.round(Ia.clamp(e,-1,1)*32767);case 5120:return Math.round(Ia.clamp(e,-1,1)*127);default:throw new Error("Invalid component type.")}}static decompose(e,r,i,n){let s=ay([e[0],e[1],e[2]]),o=ay([e[4],e[5],e[6]]),a=ay([e[8],e[9],e[10]]);$P(e)<0&&(s=-s),r[0]=e[12],r[1]=e[13],r[2]=e[14];let c=e.slice(),l=1/s,u=1/o,d=1/a;c[0]*=l,c[1]*=l,c[2]*=l,c[4]*=u,c[5]*=u,c[6]*=u,c[8]*=d,c[9]*=d,c[10]*=d,kP(i,c),n[0]=s,n[1]=o,n[2]=a;}static compose(e,r,i,n){let s=n,o=r[0],a=r[1],c=r[2],l=r[3],u=o+o,d=a+a,f=c+c,p=o*u,g=o*d,m=o*f,S=a*d,h=a*f,v=c*f,_=l*u,y=l*d,R=l*f,T=i[0],b=i[1],E=i[2];return s[0]=(1-(S+v))*T,s[1]=(g+R)*T,s[2]=(m-y)*T,s[3]=0,s[4]=(g-R)*b,s[5]=(1-(p+v))*b,s[6]=(h+_)*b,s[7]=0,s[8]=(m+y)*E,s[9]=(h-_)*E,s[10]=(1-(p+S))*E,s[11]=0,s[12]=e[0],s[13]=e[1],s[14]=e[2],s[15]=1,s}};function UP(t,e){if(!!t!=!!e)return false;let r=t.getChild(),i=e.getChild();return r===i||r.equals(i)}function FP(t,e){if(!!t!=!!e)return false;let r=t.values(),i=e.values();if(r.length!==i.length)return false;for(let n=0;n<r.length;n++){let s=r[n],o=i[n];if(s.getChild()!==o.getChild()&&!s.getChild().equals(o.getChild()))return false}return true}function BP(t,e){if(!!t!=!!e)return false;let r=t.keys(),i=e.keys();if(r.length!==i.length)return false;for(let n of r){let s=t.get(n),o=e.get(n);if(!!s!=!!o)return false;let a=s.getChild(),c=o.getChild();if(a!==c&&!a.equals(c))return false}return true}function _R(t,e){if(t===e)return true;if(!!t!=!!e||!t||!e||t.length!==e.length)return false;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return false;return true}function vR(t,e){if(t===e)return true;if(!!t!=!!e)return false;if(!vi(t)||!vi(e))return t===e;let r=t,i=e,n=0,s=0,o;for(o in r)n++;for(o in i)s++;if(n!==s)return false;for(o in r){let a=r[o],c=i[o];if(ch(a)&&ch(c)){if(!_R(a,c))return false}else if(vi(a)&&vi(c)){if(!vR(a,c))return false}else if(a!==c)return false}return true}function ch(t){return Array.isArray(t)||ArrayBuffer.isView(t)}var VP="23456789abdegjkmnpqrvwxyzABDEGJKMNPQRVWXYZ",jP=999,GP=6,cR=new Set,HP=function(){let t="";for(let e=0;e<GP;e++)t+=VP.charAt(Math.floor(Math.random()*42));return t},qP=function(){for(let t=0;t<jP;t++){let e=HP();if(!cR.has(e))return cR.add(e),e}return ""},Tr=t=>t,WP=new Set,hy=class extends iR{constructor(t,e=""){super(t),this[Le].name=e,this.init(),this.dispatchEvent({type:"create"});}getGraph(){return this.graph}getDefaults(){return Object.assign(super.getDefaults(),{name:"",extras:{}})}set(t,e){return Array.isArray(e)&&(e=e.slice()),super.set(t,e)}getName(){return this.get("name")}setName(t){return this.set("name",t)}getExtras(){return this.get("extras")}setExtras(t){return this.set("extras",t)}clone(){let t=this.constructor;return new t(this.graph).copy(this,Tr)}copy(t,e=Tr){for(let r in this[Le]){let i=this[Le][r];if(i instanceof Sr)this[yr].has(r)||i.dispose();else if(i instanceof mt||i instanceof Be)for(let n of i.values())n.dispose();else if(i instanceof st)for(let n of i.values())n.dispose();}for(let r in t[Le]){let i=this[Le][r],n=t[Le][r];if(n instanceof Sr)this[yr].has(r)?i.getChild().copy(e(n.getChild()),e):this.setRef(r,e(n.getChild()),n.getAttributes());else if(n instanceof Be||n instanceof mt)for(let s of n.values())this.addRef(r,e(s.getChild()),s.getAttributes());else if(n instanceof st)for(let s of n.keys()){let o=n.get(s);this.setRefMap(r,s,e(o.getChild()),o.getAttributes());}else vi(n)?this[Le][r]=JSON.parse(JSON.stringify(n)):Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)?this[Le][r]=n.slice():this[Le][r]=n;}return this}equals(t,e=WP){if(this===t)return true;if(this.propertyType!==t.propertyType)return false;for(let r in this[Le]){if(e.has(r))continue;let i=this[Le][r],n=t[Le][r];if(i instanceof Sr||n instanceof Sr){if(!UP(i,n))return false}else if(i instanceof Be||n instanceof Be||i instanceof mt||n instanceof mt){if(!FP(i,n))return false}else if(i instanceof st||n instanceof st){if(!BP(i,n))return false}else if(vi(i)||vi(n)){if(!vR(i,n))return false}else if(ch(i)||ch(n)){if(!_R(i,n))return false}else if(i!==n)return false}return true}detach(){return this.graph.disconnectParents(this,t=>t.propertyType!=="Root"),this}listParents(){return this.graph.listParents(this)}},It=class extends hy{getDefaults(){return Object.assign(super.getDefaults(),{extensions:new st})}getExtension(t){return this.getRefMap("extensions",t)}setExtension(t,e){return e&&e._validateParent(this),this.setRefMap("extensions",t,e)}listExtensions(){return this.listRefMapValues("extensions")}},fe=class ot extends It{static Type={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};static ComponentType={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126,FLOAT16:5131,FLOAT64:5130};init(){this.propertyType="Accessor";}getDefaults(){return Object.assign(super.getDefaults(),{array:null,type:ot.Type.SCALAR,componentType:ot.ComponentType.FLOAT,normalized:false,sparse:false,buffer:null})}static getElementSize(e){switch(e){case ot.Type.SCALAR:return 1;case ot.Type.VEC2:return 2;case ot.Type.VEC3:return 3;case ot.Type.VEC4:return 4;case ot.Type.MAT2:return 4;case ot.Type.MAT3:return 9;case ot.Type.MAT4:return 16;default:throw new Error("Unexpected type: "+e)}}static getComponentSize(e){switch(e){case ot.ComponentType.BYTE:case ot.ComponentType.UNSIGNED_BYTE:return 1;case ot.ComponentType.SHORT:case ot.ComponentType.UNSIGNED_SHORT:return 2;case ot.ComponentType.UNSIGNED_INT:case ot.ComponentType.FLOAT:return 4;case ot.ComponentType.FLOAT16:return 2;case ot.ComponentType.FLOAT64:return 8;default:throw new Error("Unexpected component type: "+e)}}getMinNormalized(e){let r=this.getNormalized(),i=this.getElementSize(),n=this.getComponentType();if(this.getMin(e),r)for(let s=0;s<i;s++)e[s]=Ke.decodeNormalizedInt(e[s],n);return e}getMin(e){let r=this.getArray(),i=this.getCount(),n=this.getElementSize();for(let s=0;s<n;s++)e[s]=1/0;for(let s=0;s<i*n;s+=n)for(let o=0;o<n;o++){let a=r[s+o];Number.isFinite(a)&&(e[o]=Math.min(e[o],a));}return e}getMaxNormalized(e){let r=this.getNormalized(),i=this.getElementSize(),n=this.getComponentType();if(this.getMax(e),r)for(let s=0;s<i;s++)e[s]=Ke.decodeNormalizedInt(e[s],n);return e}getMax(e){let r=this.get("array"),i=this.getCount(),n=this.getElementSize();for(let s=0;s<n;s++)e[s]=-1/0;for(let s=0;s<i*n;s+=n)for(let o=0;o<n;o++){let a=r[s+o];Number.isFinite(a)&&(e[o]=Math.max(e[o],a));}return e}getCount(){let e=this.get("array");return e?e.length/this.getElementSize():0}getType(){return this.get("type")}setType(e){return this.set("type",e)}getElementSize(){return ot.getElementSize(this.get("type"))}getComponentSize(){return this.get("array").BYTES_PER_ELEMENT}getComponentType(){return this.get("componentType")}getNormalized(){return this.get("normalized")}setNormalized(e){return this.set("normalized",e)}getScalar(e){let r=this.getElementSize(),i=this.getComponentType(),n=this.getArray();return this.getNormalized()?Ke.decodeNormalizedInt(n[e*r],i):n[e*r]}setScalar(e,r){let i=this.getElementSize(),n=this.getComponentType(),s=this.getArray();return this.getNormalized()?s[e*i]=Ke.encodeNormalizedInt(r,n):s[e*i]=r,this}getElement(e,r){let i=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType(),o=this.getArray();for(let a=0;a<n;a++)i?r[a]=Ke.decodeNormalizedInt(o[e*n+a],s):r[a]=o[e*n+a];return r}setElement(e,r){let i=this.getNormalized(),n=this.getElementSize(),s=this.getComponentType(),o=this.getArray();for(let a=0;a<n;a++)i?o[e*n+a]=Ke.encodeNormalizedInt(r[a],s):o[e*n+a]=r[a];return this}getSparse(){return this.get("sparse")}setSparse(e){return this.set("sparse",e)}getBuffer(){return this.getRef("buffer")}setBuffer(e){return this.setRef("buffer",e)}getArray(){return this.get("array")}setArray(e){return this.set("componentType",e?KP(e):ot.ComponentType.FLOAT),this.set("array",e),this}getByteLength(){let e=this.get("array");return e?e.byteLength:0}};function KP(t){switch(t.constructor){case Float32Array:return fe.ComponentType.FLOAT;case Uint32Array:return fe.ComponentType.UNSIGNED_INT;case Uint16Array:return fe.ComponentType.UNSIGNED_SHORT;case Uint8Array:return fe.ComponentType.UNSIGNED_BYTE;case Int16Array:return fe.ComponentType.SHORT;case Int8Array:return fe.ComponentType.BYTE;case Float64Array:return fe.ComponentType.FLOAT64}if(typeof Float16Array<"u"&&t.constructor===Float16Array)return fe.ComponentType.FLOAT16;throw new Error("Unknown accessor componentType.")}var yR=class extends It{init(){this.propertyType="Animation";}getDefaults(){return Object.assign(super.getDefaults(),{channels:new Be,samplers:new Be})}addChannel(t){return this.addRef("channels",t)}removeChannel(t){return this.removeRef("channels",t)}listChannels(){return this.listRefs("channels")}addSampler(t){return this.addRef("samplers",t)}removeSampler(t){return this.removeRef("samplers",t)}listSamplers(){return this.listRefs("samplers")}},fy=class extends It{static TargetPath={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};init(){this.propertyType="AnimationChannel";}getDefaults(){return Object.assign(super.getDefaults(),{targetPath:null,targetNode:null,sampler:null})}getTargetPath(){return this.get("targetPath")}setTargetPath(t){return this.set("targetPath",t)}getTargetNode(){return this.getRef("targetNode")}setTargetNode(t){return this.setRef("targetNode",t)}getSampler(){return this.getRef("sampler")}setSampler(t){return this.setRef("sampler",t)}},hh=class SR extends It{static Interpolation={LINEAR:"LINEAR",STEP:"STEP",CUBICSPLINE:"CUBICSPLINE"};init(){this.propertyType="AnimationSampler";}getDefaultAttributes(){return Object.assign(super.getDefaults(),{interpolation:SR.Interpolation.LINEAR,input:null,output:null})}getInterpolation(){return this.get("interpolation")}setInterpolation(e){return this.set("interpolation",e)}getInput(){return this.getRef("input")}setInput(e){return this.setRef("input",e,{usage:"OTHER"})}getOutput(){return this.getRef("output")}setOutput(e){return this.setRef("output",e,{usage:"OTHER"})}},xR=class extends It{init(){this.propertyType="Buffer";}getDefaults(){return Object.assign(super.getDefaults(),{uri:""})}getURI(){return this.get("uri")}setURI(t){return this.set("uri",t)}},fh=class bR extends It{static Type={PERSPECTIVE:"perspective",ORTHOGRAPHIC:"orthographic"};init(){this.propertyType="Camera";}getDefaults(){return Object.assign(super.getDefaults(),{type:bR.Type.PERSPECTIVE,znear:.1,zfar:100,aspectRatio:null,yfov:Math.PI*2*50/360,xmag:1,ymag:1})}getType(){return this.get("type")}setType(e){return this.set("type",e)}getZNear(){return this.get("znear")}setZNear(e){return this.set("znear",e)}getZFar(){return this.get("zfar")}setZFar(e){return this.set("zfar",e)}getAspectRatio(){return this.get("aspectRatio")}setAspectRatio(e){return this.set("aspectRatio",e)}getYFov(){return this.get("yfov")}setYFov(e){return this.set("yfov",e)}getXMag(){return this.get("xmag")}setXMag(e){return this.set("xmag",e)}getYMag(){return this.get("ymag")}setYMag(e){return this.set("ymag",e)}},Ne=class extends hy{static EXTENSION_NAME;_validateParent(t){if(!this.parentTypes.includes(t.propertyType))throw new Error(`Parent "${t.propertyType}" invalid for child "${this.propertyType}".`)}},He=class uy extends It{static WrapMode={CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,REPEAT:10497};static MagFilter={NEAREST:9728,LINEAR:9729};static MinFilter={NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987};init(){this.propertyType="TextureInfo";}getDefaults(){return Object.assign(super.getDefaults(),{texCoord:0,magFilter:null,minFilter:null,wrapS:uy.WrapMode.REPEAT,wrapT:uy.WrapMode.REPEAT})}getTexCoord(){return this.get("texCoord")}setTexCoord(e){return this.set("texCoord",e)}getMagFilter(){return this.get("magFilter")}setMagFilter(e){return this.set("magFilter",e)}getMinFilter(){return this.get("minFilter")}setMinFilter(e){return this.set("minFilter",e)}getWrapS(){return this.get("wrapS")}setWrapS(e){return this.set("wrapS",e)}getWrapT(){return this.get("wrapT")}setWrapT(e){return this.set("wrapT",e)}},{R:rh,G:ih,B:sh,A:ZP}=hn,lh=class TR extends It{static AlphaMode={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};init(){this.propertyType="Material";}getDefaults(){return Object.assign(super.getDefaults(),{alphaMode:TR.AlphaMode.OPAQUE,alphaCutoff:.5,doubleSided:false,baseColorFactor:[1,1,1,1],baseColorTexture:null,baseColorTextureInfo:new He(this.graph,"baseColorTextureInfo"),emissiveFactor:[0,0,0],emissiveTexture:null,emissiveTextureInfo:new He(this.graph,"emissiveTextureInfo"),normalScale:1,normalTexture:null,normalTextureInfo:new He(this.graph,"normalTextureInfo"),occlusionStrength:1,occlusionTexture:null,occlusionTextureInfo:new He(this.graph,"occlusionTextureInfo"),roughnessFactor:1,metallicFactor:1,metallicRoughnessTexture:null,metallicRoughnessTextureInfo:new He(this.graph,"metallicRoughnessTextureInfo")})}getDoubleSided(){return this.get("doubleSided")}setDoubleSided(e){return this.set("doubleSided",e)}getAlpha(){return this.get("baseColorFactor")[3]}setAlpha(e){let r=this.get("baseColorFactor").slice();return r[3]=e,this.set("baseColorFactor",r)}getAlphaMode(){return this.get("alphaMode")}setAlphaMode(e){return this.set("alphaMode",e)}getAlphaCutoff(){return this.get("alphaCutoff")}setAlphaCutoff(e){return this.set("alphaCutoff",e)}getBaseColorFactor(){return this.get("baseColorFactor")}setBaseColorFactor(e){return this.set("baseColorFactor",e)}getBaseColorTexture(){return this.getRef("baseColorTexture")}getBaseColorTextureInfo(){return this.getRef("baseColorTexture")?this.getRef("baseColorTextureInfo"):null}setBaseColorTexture(e){return this.setRef("baseColorTexture",e,{channels:rh|ih|sh|ZP,isColor:true})}getEmissiveFactor(){return this.get("emissiveFactor")}setEmissiveFactor(e){return this.set("emissiveFactor",e)}getEmissiveTexture(){return this.getRef("emissiveTexture")}getEmissiveTextureInfo(){return this.getRef("emissiveTexture")?this.getRef("emissiveTextureInfo"):null}setEmissiveTexture(e){return this.setRef("emissiveTexture",e,{channels:rh|ih|sh,isColor:true})}getNormalScale(){return this.get("normalScale")}setNormalScale(e){return this.set("normalScale",e)}getNormalTexture(){return this.getRef("normalTexture")}getNormalTextureInfo(){return this.getRef("normalTexture")?this.getRef("normalTextureInfo"):null}setNormalTexture(e){return this.setRef("normalTexture",e,{channels:rh|ih|sh})}getOcclusionStrength(){return this.get("occlusionStrength")}setOcclusionStrength(e){return this.set("occlusionStrength",e)}getOcclusionTexture(){return this.getRef("occlusionTexture")}getOcclusionTextureInfo(){return this.getRef("occlusionTexture")?this.getRef("occlusionTextureInfo"):null}setOcclusionTexture(e){return this.setRef("occlusionTexture",e,{channels:rh})}getRoughnessFactor(){return this.get("roughnessFactor")}setRoughnessFactor(e){return this.set("roughnessFactor",e)}getMetallicFactor(){return this.get("metallicFactor")}setMetallicFactor(e){return this.set("metallicFactor",e)}getMetallicRoughnessTexture(){return this.getRef("metallicRoughnessTexture")}getMetallicRoughnessTextureInfo(){return this.getRef("metallicRoughnessTexture")?this.getRef("metallicRoughnessTextureInfo"):null}setMetallicRoughnessTexture(e){return this.setRef("metallicRoughnessTexture",e,{channels:ih|sh})}},RR=class extends It{init(){this.propertyType="Mesh";}getDefaults(){return Object.assign(super.getDefaults(),{weights:[],primitives:new Be})}addPrimitive(t){return this.addRef("primitives",t)}removePrimitive(t){return this.removeRef("primitives",t)}listPrimitives(){return this.listRefs("primitives")}getWeights(){return this.get("weights")}setWeights(t){return this.set("weights",t)}},ER=class extends It{init(){this.propertyType="Node";}getDefaults(){return Object.assign(super.getDefaults(),{translation:[0,0,0],rotation:[0,0,0,1],scale:[1,1,1],weights:[],camera:null,mesh:null,skin:null,children:new Be})}copy(t,e=Tr){if(e===Tr)throw new Error("Node cannot be copied.");return super.copy(t,e)}getTranslation(){return this.get("translation")}getRotation(){return this.get("rotation")}getScale(){return this.get("scale")}setTranslation(t){return this.set("translation",t)}setRotation(t){return this.set("rotation",t)}setScale(t){return this.set("scale",t)}getMatrix(){return Ke.compose(this.get("translation"),this.get("rotation"),this.get("scale"),[])}setMatrix(t){let e=this.get("translation").slice(),r=this.get("rotation").slice(),i=this.get("scale").slice();return Ke.decompose(t,e,r,i),this.set("translation",e).set("rotation",r).set("scale",i)}getWorldTranslation(){let t=[0,0,0];return Ke.decompose(this.getWorldMatrix(),t,[0,0,0,1],[1,1,1]),t}getWorldRotation(){let t=[0,0,0,1];return Ke.decompose(this.getWorldMatrix(),[0,0,0],t,[1,1,1]),t}getWorldScale(){let t=[1,1,1];return Ke.decompose(this.getWorldMatrix(),[0,0,0],[0,0,0,1],t),t}getWorldMatrix(){let t=[];for(let i=this;i!=null;i=i.getParentNode())t.push(i);let e,r=t.pop().getMatrix();for(;e=t.pop();)DP(r,r,e.getMatrix());return r}addChild(t){let e=t.getParentNode();e&&e.removeChild(t);for(let r of t.listParents())r.propertyType==="Scene"&&r.removeChild(t);return this.addRef("children",t)}removeChild(t){return this.removeRef("children",t)}listChildren(){return this.listRefs("children")}getParentNode(){for(let t of this.listParents())if(t.propertyType==="Node")return t;return null}getMesh(){return this.getRef("mesh")}setMesh(t){return this.setRef("mesh",t)}getCamera(){return this.getRef("camera")}setCamera(t){return this.setRef("camera",t)}getSkin(){return this.getRef("skin")}setSkin(t){return this.setRef("skin",t)}getWeights(){return this.get("weights")}setWeights(t){return this.set("weights",t)}traverse(t){t(this);for(let e of this.listChildren())e.traverse(t);return this}},Ca=class wR extends It{static Mode={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};init(){this.propertyType="Primitive";}getDefaults(){return Object.assign(super.getDefaults(),{mode:wR.Mode.TRIANGLES,material:null,indices:null,attributes:new st,targets:new Be})}getIndices(){return this.getRef("indices")}setIndices(e){return this.setRef("indices",e,{usage:"ELEMENT_ARRAY_BUFFER"})}getAttribute(e){return this.getRefMap("attributes",e)}setAttribute(e,r){return this.setRefMap("attributes",e,r,{usage:"ARRAY_BUFFER"})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}getMaterial(){return this.getRef("material")}setMaterial(e){return this.setRef("material",e)}getMode(){return this.get("mode")}setMode(e){return this.set("mode",e)}listTargets(){return this.listRefs("targets")}addTarget(e){return this.addRef("targets",e)}removeTarget(e){return this.removeRef("targets",e)}},XP=class extends hy{init(){this.propertyType="PrimitiveTarget";}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new st})}getAttribute(t){return this.getRefMap("attributes",t)}setAttribute(t,e){return this.setRefMap("attributes",t,e,{usage:"ARRAY_BUFFER"})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}},MR=class extends It{init(){this.propertyType="Scene";}getDefaults(){return Object.assign(super.getDefaults(),{children:new Be})}copy(t,e=Tr){if(e===Tr)throw new Error("Scene cannot be copied.");return super.copy(t,e)}addChild(t){let e=t.getParentNode();return e&&e.removeChild(t),this.addRef("children",t)}removeChild(t){return this.removeRef("children",t)}listChildren(){return this.listRefs("children")}traverse(t){for(let e of this.listChildren())e.traverse(t);return this}},AR=class extends It{init(){this.propertyType="Skin";}getDefaults(){return Object.assign(super.getDefaults(),{skeleton:null,inverseBindMatrices:null,joints:new Be})}getSkeleton(){return this.getRef("skeleton")}setSkeleton(t){return this.setRef("skeleton",t)}getInverseBindMatrices(){return this.getRef("inverseBindMatrices")}setInverseBindMatrices(t){return this.setRef("inverseBindMatrices",t,{usage:"INVERSE_BIND_MATRICES"})}addJoint(t){return this.addRef("joints",t)}removeJoint(t){return this.removeRef("joints",t)}listJoints(){return this.listRefs("joints")}},IR=class extends It{init(){this.propertyType="Texture";}getDefaults(){return Object.assign(super.getDefaults(),{image:null,mimeType:"",uri:""})}getMimeType(){return this.get("mimeType")||Tn.extensionToMimeType(yi.extension(this.get("uri")))}setMimeType(t){return this.set("mimeType",t)}getURI(){return this.get("uri")}setURI(t){this.set("uri",t);let e=Tn.extensionToMimeType(yi.extension(t));return e&&this.set("mimeType",e),this}getImage(){return this.get("image")}setImage(t){return this.set("image",we.assertView(t))}getSize(){let t=this.get("image");return t?Tn.getSize(t,this.getMimeType()):null}},py=class extends It{_extensions=new Set;init(){this.propertyType="Root";}getDefaults(){return Object.assign(super.getDefaults(),{asset:{generator:`glTF-Transform ${hR}`,version:"2.0"},defaultScene:null,accessors:new Be,animations:new Be,buffers:new Be,cameras:new Be,materials:new Be,meshes:new Be,nodes:new Be,scenes:new Be,skins:new Be,textures:new Be})}constructor(t){super(t),t.addEventListener("node:create",e=>{this._addChildOfRoot(e.target);});}clone(){throw new Error("Root cannot be cloned.")}copy(t,e=Tr){if(e===Tr)throw new Error("Root cannot be copied.");this.set("asset",{...t.get("asset")}),this.setName(t.getName()),this.setExtras({...t.getExtras()}),this.setDefaultScene(t.getDefaultScene()?e(t.getDefaultScene()):null);for(let r of t.listRefMapKeys("extensions")){let i=t.getExtension(r);this.setExtension(r,e(i));}return this}_addChildOfRoot(t){return t instanceof MR?this.addRef("scenes",t):t instanceof ER?this.addRef("nodes",t):t instanceof fh?this.addRef("cameras",t):t instanceof AR?this.addRef("skins",t):t instanceof RR?this.addRef("meshes",t):t instanceof lh?this.addRef("materials",t):t instanceof IR?this.addRef("textures",t):t instanceof yR?this.addRef("animations",t):t instanceof fe?this.addRef("accessors",t):t instanceof xR&&this.addRef("buffers",t),this}getAsset(){return this.get("asset")}listExtensionsUsed(){return Array.from(this._extensions)}listExtensionsRequired(){return this.listExtensionsUsed().filter(t=>t.isRequired())}_enableExtension(t){return this._extensions.add(t),this}_disableExtension(t){return this._extensions.delete(t),this}listScenes(){return this.listRefs("scenes")}setDefaultScene(t){return this.setRef("defaultScene",t)}getDefaultScene(){return this.getRef("defaultScene")}listNodes(){return this.listRefs("nodes")}listCameras(){return this.listRefs("cameras")}listSkins(){return this.listRefs("skins")}listMeshes(){return this.listRefs("meshes")}listMaterials(){return this.listRefs("materials")}listTextures(){return this.listRefs("textures")}listAnimations(){return this.listRefs("animations")}listAccessors(){return this.listRefs("accessors")}listBuffers(){return this.listRefs("buffers")}},JP=class dy{_graph=new oy;_root=new py(this._graph);_logger=dh.DEFAULT_INSTANCE;static _GRAPH_DOCUMENTS=new WeakMap;static fromGraph(e){return dy._GRAPH_DOCUMENTS.get(e)||null}constructor(){dy._GRAPH_DOCUMENTS.set(this._graph,this);}getRoot(){return this._root}getGraph(){return this._graph}getLogger(){return this._logger}setLogger(e){return this._logger=e,this}clone(){throw new Error("Use 'cloneDocument(source)' from '@gltf-transform/functions'.")}merge(e){throw new Error("Use 'mergeDocuments(target, source)' from '@gltf-transform/functions'.")}async transform(...e){let r=e.map(i=>i.name);for(let i of e)await i(this,{stack:r});return this}hasExtension(e){return this.getRoot().listExtensionsUsed().some(r=>r.extensionName===e)}createExtension(e){let r=e.EXTENSION_NAME;return this.getRoot().listExtensionsUsed().find(i=>i.extensionName===r)||new e(this)}disposeExtension(e){let r=this.getRoot().listExtensionsUsed().find(i=>i.extensionName===e);r&&r.dispose();}createScene(e=""){return new MR(this._graph,e)}createNode(e=""){return new ER(this._graph,e)}createCamera(e=""){return new fh(this._graph,e)}createSkin(e=""){return new AR(this._graph,e)}createMesh(e=""){return new RR(this._graph,e)}createPrimitive(){return new Ca(this._graph)}createPrimitiveTarget(e=""){return new XP(this._graph,e)}createMaterial(e=""){return new lh(this._graph,e)}createTexture(e=""){return new IR(this._graph,e)}createAnimation(e=""){return new yR(this._graph,e)}createAnimationChannel(e=""){return new fy(this._graph,e)}createAnimationSampler(e=""){return new hh(this._graph,e)}createAccessor(e="",r=null){return r||(r=this.getRoot().listBuffers()[0]),new fe(this._graph,e).setBuffer(r)}createBuffer(e=""){return new xR(this._graph,e)}},ke=class{static EXTENSION_NAME;extensionName="";prereadTypes=[];prewriteTypes=[];readDependencies=[];writeDependencies=[];document;required=false;properties=new Set;_listener;constructor(t){this.document=t,t.getRoot()._enableExtension(this),this._listener=r=>{let i=r,n=i.target;n instanceof Ne&&n.extensionName===this.extensionName&&(i.type==="node:create"&&this._addExtensionProperty(n),i.type==="node:dispose"&&this._removeExtensionProperty(n));};let e=t.getGraph();e.addEventListener("node:create",this._listener),e.addEventListener("node:dispose",this._listener);}dispose(){this.document.getRoot()._disableExtension(this);let t=this.document.getGraph();t.removeEventListener("node:create",this._listener),t.removeEventListener("node:dispose",this._listener);for(let e of this.properties)e.dispose();}static register(){}isRequired(){return this.required}setRequired(t){return this.required=t,this}listProperties(){return Array.from(this.properties)}_addExtensionProperty(t){return this.properties.add(t),this}_removeExtensionProperty(t){return this.properties.delete(t),this}install(t,e){return this}preread(t,e){return this}prewrite(t,e){return this}},YP=class{jsonDoc;buffers=[];bufferViews=[];bufferViewBuffers=[];accessors=[];textures=[];textureInfos=new Map;materials=[];meshes=[];cameras=[];nodes=[];skins=[];animations=[];scenes=[];constructor(t){this.jsonDoc=t;}setTextureInfo(t,e){this.textureInfos.set(t,e),e.texCoord!==void 0&&t.setTexCoord(e.texCoord),e.extras!==void 0&&t.setExtras(e.extras);let r=this.jsonDoc.json.textures[e.index];if(r.sampler===void 0)return;let i=this.jsonDoc.json.samplers[r.sampler];i.magFilter!==void 0&&t.setMagFilter(i.magFilter),i.minFilter!==void 0&&t.setMinFilter(i.minFilter),i.wrapS!==void 0&&t.setWrapS(i.wrapS),i.wrapT!==void 0&&t.setWrapT(i.wrapT);}},lR={logger:dh.DEFAULT_INSTANCE,extensions:[],dependencies:{}},QP=new Set(["Buffer","Texture","Material","Mesh","Primitive","Node","Scene"]),eN=class{static read(t,e=lR){let r={...lR,...e},{json:i}=t,n=new JP().setLogger(r.logger);this.validate(t,r);let s=new YP(t),o=i.asset,a=n.getRoot().getAsset();o.copyright&&(a.copyright=o.copyright),o.extras&&(a.extras=o.extras),i.extras!==void 0&&n.getRoot().setExtras({...i.extras});let c=i.extensionsUsed||[],l=i.extensionsRequired||[];r.extensions.sort((h,v)=>h.EXTENSION_NAME>v.EXTENSION_NAME?1:-1);for(let h of r.extensions)if(c.includes(h.EXTENSION_NAME)){let v=n.createExtension(h).setRequired(l.includes(h.EXTENSION_NAME)),_=v.prereadTypes.filter(y=>!QP.has(y));_.length&&r.logger.warn(`Preread hooks for some types (${_.join()}), requested by extension ${v.extensionName}, are unsupported. Please file an issue or a PR.`);for(let y of v.readDependencies)v.install(y,r.dependencies[y]);}let u=i.buffers||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Buffer")).forEach(h=>h.preread(s,"Buffer")),s.buffers=u.map(h=>{let v=n.createBuffer(h.name);return h.extras&&v.setExtras(h.extras),h.uri&&h.uri.indexOf("__")!==0&&v.setURI(h.uri),v}),s.bufferViewBuffers=(i.bufferViews||[]).map((h,v)=>{if(!s.bufferViews[v]){let _=t.json.buffers[h.buffer],y=_.uri?t.resources[_.uri]:t.resources[br],R=h.byteOffset||0;s.bufferViews[v]=we.toView(y,R,h.byteLength);}return s.buffers[h.buffer]});let d=i.accessors||[];s.accessors=d.map(h=>{let v=s.bufferViewBuffers[h.bufferView],_=n.createAccessor(h.name,v).setType(h.type);return h.extras&&_.setExtras(h.extras),h.normalized!==void 0&&_.setNormalized(h.normalized),h.bufferView===void 0||_.setArray(ah(h,s)),_});let f=i.images||[],p=i.textures||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Texture")).forEach(h=>h.preread(s,"Texture")),s.textures=f.map(h=>{let v=n.createTexture(h.name);if(h.extras&&v.setExtras(h.extras),h.bufferView!==void 0){let _=i.bufferViews[h.bufferView],y=t.json.buffers[_.buffer],R=y.uri?t.resources[y.uri]:t.resources[br],T=_.byteOffset||0,b=_.byteLength,E=R.slice(T,T+b);v.setImage(E);}else h.uri!==void 0&&(v.setImage(t.resources[h.uri]),h.uri.indexOf("__")!==0&&v.setURI(h.uri));if(h.mimeType!==void 0)v.setMimeType(h.mimeType);else if(h.uri){let _=yi.extension(h.uri);v.setMimeType(Tn.extensionToMimeType(_));}return v}),n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Material")).forEach(h=>h.preread(s,"Material")),s.materials=(i.materials||[]).map(h=>{let v=n.createMaterial(h.name);h.extras&&v.setExtras(h.extras),h.alphaMode!==void 0&&v.setAlphaMode(h.alphaMode),h.alphaCutoff!==void 0&&v.setAlphaCutoff(h.alphaCutoff),h.doubleSided!==void 0&&v.setDoubleSided(h.doubleSided);let _=h.pbrMetallicRoughness||{};if(_.baseColorFactor!==void 0&&v.setBaseColorFactor(_.baseColorFactor),h.emissiveFactor!==void 0&&v.setEmissiveFactor(h.emissiveFactor),_.metallicFactor!==void 0&&v.setMetallicFactor(_.metallicFactor),_.roughnessFactor!==void 0&&v.setRoughnessFactor(_.roughnessFactor),_.baseColorTexture!==void 0){let y=_.baseColorTexture,R=s.textures[p[y.index].source];v.setBaseColorTexture(R),s.setTextureInfo(v.getBaseColorTextureInfo(),y);}if(h.emissiveTexture!==void 0){let y=h.emissiveTexture,R=s.textures[p[y.index].source];v.setEmissiveTexture(R),s.setTextureInfo(v.getEmissiveTextureInfo(),y);}if(h.normalTexture!==void 0){let y=h.normalTexture,R=s.textures[p[y.index].source];v.setNormalTexture(R),s.setTextureInfo(v.getNormalTextureInfo(),y),h.normalTexture.scale!==void 0&&v.setNormalScale(h.normalTexture.scale);}if(h.occlusionTexture!==void 0){let y=h.occlusionTexture,R=s.textures[p[y.index].source];v.setOcclusionTexture(R),s.setTextureInfo(v.getOcclusionTextureInfo(),y),h.occlusionTexture.strength!==void 0&&v.setOcclusionStrength(h.occlusionTexture.strength);}if(_.metallicRoughnessTexture!==void 0){let y=_.metallicRoughnessTexture,R=s.textures[p[y.index].source];v.setMetallicRoughnessTexture(R),s.setTextureInfo(v.getMetallicRoughnessTextureInfo(),y);}return v}),n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Mesh")).forEach(h=>h.preread(s,"Mesh"));let g=i.meshes||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Primitive")).forEach(h=>h.preread(s,"Primitive")),s.meshes=g.map(h=>{let v=n.createMesh(h.name);return h.extras&&v.setExtras(h.extras),h.weights!==void 0&&v.setWeights(h.weights),(h.primitives||[]).forEach(_=>{let y=n.createPrimitive();_.extras&&y.setExtras(_.extras),_.material!==void 0&&y.setMaterial(s.materials[_.material]),_.mode!==void 0&&y.setMode(_.mode);for(let[T,b]of Object.entries(_.attributes||{}))y.setAttribute(T,s.accessors[b]);_.indices!==void 0&&y.setIndices(s.accessors[_.indices]);let R=h.extras&&h.extras.targetNames||[];(_.targets||[]).forEach((T,b)=>{let E=R[b]||b.toString(),M=n.createPrimitiveTarget(E);for(let[N,O]of Object.entries(T))M.setAttribute(N,s.accessors[O]);y.addTarget(M);}),v.addPrimitive(y);}),v}),s.cameras=(i.cameras||[]).map(h=>{let v=n.createCamera(h.name).setType(h.type);if(h.extras&&v.setExtras(h.extras),h.type===fh.Type.PERSPECTIVE){let _=h.perspective;v.setYFov(_.yfov),v.setZNear(_.znear),_.zfar!==void 0&&v.setZFar(_.zfar),_.aspectRatio!==void 0&&v.setAspectRatio(_.aspectRatio);}else {let _=h.orthographic;v.setZNear(_.znear).setZFar(_.zfar).setXMag(_.xmag).setYMag(_.ymag);}return v});let m=i.nodes||[];n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Node")).forEach(h=>h.preread(s,"Node")),s.nodes=m.map(h=>{let v=n.createNode(h.name);if(h.extras&&v.setExtras(h.extras),h.translation!==void 0&&v.setTranslation(h.translation),h.rotation!==void 0&&v.setRotation(h.rotation),h.scale!==void 0&&v.setScale(h.scale),h.matrix!==void 0){let _=[0,0,0],y=[0,0,0,1],R=[1,1,1];Ke.decompose(h.matrix,_,y,R),v.setTranslation(_),v.setRotation(y),v.setScale(R);}return h.weights!==void 0&&v.setWeights(h.weights),v}),s.skins=(i.skins||[]).map(h=>{let v=n.createSkin(h.name);h.extras&&v.setExtras(h.extras),h.inverseBindMatrices!==void 0&&v.setInverseBindMatrices(s.accessors[h.inverseBindMatrices]),h.skeleton!==void 0&&v.setSkeleton(s.nodes[h.skeleton]);for(let _ of h.joints)v.addJoint(s.nodes[_]);return v}),m.map((h,v)=>{let _=s.nodes[v];(h.children||[]).forEach(y=>_.addChild(s.nodes[y])),h.mesh!==void 0&&_.setMesh(s.meshes[h.mesh]),h.camera!==void 0&&_.setCamera(s.cameras[h.camera]),h.skin!==void 0&&_.setSkin(s.skins[h.skin]);}),s.animations=(i.animations||[]).map(h=>{let v=n.createAnimation(h.name);h.extras&&v.setExtras(h.extras);let _=(h.samplers||[]).map(y=>{let R=n.createAnimationSampler().setInput(s.accessors[y.input]).setOutput(s.accessors[y.output]).setInterpolation(y.interpolation||hh.Interpolation.LINEAR);return y.extras&&R.setExtras(y.extras),v.addSampler(R),R});return (h.channels||[]).forEach(y=>{let R=n.createAnimationChannel().setSampler(_[y.sampler]).setTargetPath(y.target.path);y.target.node!==void 0&&R.setTargetNode(s.nodes[y.target.node]),y.extras&&R.setExtras(y.extras),v.addChannel(R);}),v});let S=i.scenes||[];return n.getRoot().listExtensionsUsed().filter(h=>h.prereadTypes.includes("Scene")).forEach(h=>h.preread(s,"Scene")),s.scenes=S.map(h=>{let v=n.createScene(h.name);return h.extras&&v.setExtras(h.extras),(h.nodes||[]).map(_=>s.nodes[_]).forEach(_=>v.addChild(_)),v}),i.scene!==void 0&&n.getRoot().setDefaultScene(s.scenes[i.scene]),n.getRoot().listExtensionsUsed().forEach(h=>h.read(s)),d.forEach((h,v)=>{let _=s.accessors[v],y=!!h.sparse,R=!h.bufferView&&!_.getArray();(y||R)&&_.setSparse(true).setArray(nN(h,s));}),n}static validate(t,e){let r=t.json;if(r.asset.version!=="2.0")throw new Error(`Unsupported glTF version, "${r.asset.version}".`);if(r.extensionsRequired){for(let i of r.extensionsRequired)if(!e.extensions.find(n=>n.EXTENSION_NAME===i))throw new Error(`Missing required extension, "${i}".`)}if(r.extensionsUsed)for(let i of r.extensionsUsed)e.extensions.find(n=>n.EXTENSION_NAME===i)||e.logger.warn(`Missing optional extension, "${i}".`);}};function tN(t,e){let r=e.jsonDoc,i=e.bufferViews[t.bufferView],n=r.json.bufferViews[t.bufferView],s=uh[t.componentType],o=fe.getElementSize(t.type),a=s.BYTES_PER_ELEMENT,c=t.byteOffset||0,l=new s(t.count*o),u=new DataView(i.buffer,i.byteOffset,i.byteLength),d=n.byteStride;for(let f=0;f<t.count;f++)for(let p=0;p<o;p++){let g=c+f*d+p*a,m;switch(t.componentType){case fe.ComponentType.FLOAT:m=u.getFloat32(g,true);break;case fe.ComponentType.UNSIGNED_INT:m=u.getUint32(g,true);break;case fe.ComponentType.UNSIGNED_SHORT:m=u.getUint16(g,true);break;case fe.ComponentType.UNSIGNED_BYTE:m=u.getUint8(g);break;case fe.ComponentType.SHORT:m=u.getInt16(g,true);break;case fe.ComponentType.BYTE:m=u.getInt8(g);break;case fe.ComponentType.FLOAT16:m=u.getFloat16(g,true);break;case fe.ComponentType.FLOAT64:m=u.getFloat64(g,true);break;default:throw new Error(`Unexpected componentType "${t.componentType}".`)}l[f*o+p]=m;}return l}function ah(t,e){let r=e.jsonDoc,i=e.bufferViews[t.bufferView],n=r.json.bufferViews[t.bufferView],s=uh[t.componentType],o=fe.getElementSize(t.type),a=s.BYTES_PER_ELEMENT,c=o*a;if(n.byteStride!==void 0&&n.byteStride!==c)return tN(t,e);let l=i.byteOffset+(t.byteOffset||0),u=t.count*o*a;return new s(i.buffer.slice(l,l+u))}function nN(t,e){let r=uh[t.componentType],i=fe.getElementSize(t.type),n;t.bufferView!==void 0?n=ah(t,e):n=new r(t.count*i);let s=t.sparse;if(!s)return n;let o=s.count,a={...t,...s.indices,count:o,type:"SCALAR"},c={...t,...s.values,count:o},l=ah(a,e),u=ah(c,e);for(let d=0;d<a.count;d++)for(let f=0;f<i;f++)n[l[d]*i+f]=u[d*i+f];return n}var CR=(function(t){return t[t.ARRAY_BUFFER=34962]="ARRAY_BUFFER",t[t.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",t})(CR||{}),xr=class{_doc;jsonDoc;options;static BufferViewTarget=CR;static BufferViewUsage=wP;static USAGE_TO_TARGET={ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963};accessorIndexMap=new Map;animationIndexMap=new Map;bufferIndexMap=new Map;cameraIndexMap=new Map;skinIndexMap=new Map;materialIndexMap=new Map;meshIndexMap=new Map;nodeIndexMap=new Map;imageIndexMap=new Map;textureDefIndexMap=new Map;textureInfoDefMap=new Map;samplerDefIndexMap=new Map;sceneIndexMap=new Map;imageBufferViews=[];otherBufferViews=new Map;otherBufferViewsIndexMap=new Map;extensionData={};bufferURIGenerator;imageURIGenerator;logger;_accessorUsageMap=new Map;accessorUsageGroupedByParent=new Set(["ARRAY_BUFFER"]);accessorParents=new Map;constructor(t,e,r){this._doc=t,this.jsonDoc=e,this.options=r;let i=t.getRoot(),n=i.listBuffers().length,s=i.listTextures().length;this.bufferURIGenerator=new uR(n>1,()=>r.basename||"buffer"),this.imageURIGenerator=new uR(s>1,o=>rN(t,o)||r.basename||"texture"),this.logger=t.getLogger();}createTextureInfoDef(t,e){let r={magFilter:e.getMagFilter()||void 0,minFilter:e.getMinFilter()||void 0,wrapS:e.getWrapS(),wrapT:e.getWrapT()},i=JSON.stringify(r);this.samplerDefIndexMap.has(i)||(this.samplerDefIndexMap.set(i,this.jsonDoc.json.samplers.length),this.jsonDoc.json.samplers.push(r));let n={source:this.imageIndexMap.get(t),sampler:this.samplerDefIndexMap.get(i)},s=JSON.stringify(n);this.textureDefIndexMap.has(s)||(this.textureDefIndexMap.set(s,this.jsonDoc.json.textures.length),this.jsonDoc.json.textures.push(n));let o={index:this.textureDefIndexMap.get(s)};return e.getTexCoord()!==0&&(o.texCoord=e.getTexCoord()),Object.keys(e.getExtras()).length>0&&(o.extras=e.getExtras()),this.textureInfoDefMap.set(e,o),o}createPropertyDef(t){let e={};return t.getName()&&(e.name=t.getName()),Object.keys(t.getExtras()).length>0&&(e.extras=t.getExtras()),e}createAccessorDef(t){let e=this.createPropertyDef(t);return e.type=t.getType(),e.componentType=t.getComponentType(),e.count=t.getCount(),this._doc.getGraph().listParentEdges(t).some(r=>r.getName()==="attributes"&&r.getAttributes().key==="POSITION"||r.getName()==="input")&&(e.max=t.getMax([]).map(Math.fround),e.min=t.getMin([]).map(Math.fround)),t.getNormalized()&&(e.normalized=t.getNormalized()),e}createImageData(t,e,r){if(this.options.format==="GLB")this.imageBufferViews.push(e),t.bufferView=this.jsonDoc.json.bufferViews.length,this.jsonDoc.json.bufferViews.push({buffer:0,byteOffset:-1,byteLength:e.byteLength});else {let i=Tn.mimeTypeToExtension(r.getMimeType());t.uri=this.imageURIGenerator.createURI(r,i),this.assignResourceURI(t.uri,e,false);}}assignResourceURI(t,e,r){let i=this.jsonDoc.resources;if(!(t in i)){i[t]=e;return}if(e===i[t]){this.logger.warn(`Duplicate resource URI, "${t}".`);return}let n=`Resource URI "${t}" already assigned to different data.`;if(!r){this.logger.warn(n);return}throw new Error(n)}getAccessorUsage(t){let e=this._accessorUsageMap.get(t);if(e)return e;if(t.getSparse())return "SPARSE";for(let r of this._doc.getGraph().listParentEdges(t)){let{usage:i}=r.getAttributes();if(i)return i;r.getParent().propertyType!=="Root"&&this.logger.warn(`Missing attribute ".usage" on edge, "${r.getName()}".`);}return "OTHER"}addAccessorToUsageGroup(t,e){let r=this._accessorUsageMap.get(t);if(r&&r!==e)throw new Error(`Accessor with usage "${r}" cannot be reused as "${e}".`);return this._accessorUsageMap.set(t,e),this}},uR=class{multiple;basename;counter={};constructor(t,e){this.multiple=t,this.basename=e;}createURI(t,e){if(t.getURI())return t.getURI();if(this.multiple){let r=this.basename(t);return this.counter[r]=this.counter[r]||1,`${r}_${this.counter[r]++}.${e}`}else return `${this.basename(t)}.${e}`}};function rN(t,e){let r=t.getGraph().listParentEdges(e).find(i=>i.getParent()!==t.getRoot());return r?r.getName().replace(/texture$/i,""):""}var{BufferViewUsage:oh}=xr,{UNSIGNED_INT:iN,UNSIGNED_SHORT:sN,UNSIGNED_BYTE:oN}=fe.ComponentType,aN=new Set(["Accessor","Buffer","Material","Mesh"]),cN=class{static write(t,e){let r=t.getGraph(),i=t.getRoot(),n={asset:{generator:`glTF-Transform ${hR}`,...i.getAsset()},extras:{...i.getExtras()}},s={json:n,resources:{}},o=new xr(t,s,e),a=e.logger||dh.DEFAULT_INSTANCE,c=new Set(e.extensions.map(m=>m.EXTENSION_NAME)),l=t.getRoot().listExtensionsUsed().filter(m=>c.has(m.extensionName)).sort((m,S)=>m.extensionName>S.extensionName?1:-1),u=t.getRoot().listExtensionsRequired().filter(m=>c.has(m.extensionName)).sort((m,S)=>m.extensionName>S.extensionName?1:-1);l.length<t.getRoot().listExtensionsUsed().length&&a.warn("Some extensions were not registered for I/O, and will not be written.");for(let m of l){let S=m.prewriteTypes.filter(h=>!aN.has(h));S.length&&a.warn(`Prewrite hooks for some types (${S.join()}), requested by extension ${m.extensionName}, are unsupported. Please file an issue or a PR.`);for(let h of m.writeDependencies)m.install(h,e.dependencies[h]);}function d(m,S,h,v){let _=[],y=0;for(let T of m){let b=o.createAccessorDef(T);b.bufferView=n.bufferViews.length;let E=T.getArray(),M=we.pad(we.toView(E));b.byteOffset=y,y+=M.byteLength,_.push(M),o.accessorIndexMap.set(T,n.accessors.length),n.accessors.push(b);}let R={buffer:S,byteOffset:h,byteLength:we.concat(_).byteLength};return v&&(R.target=v),n.bufferViews.push(R),{buffers:_,byteLength:y}}function f(m,S,h){let v=m[0].getCount(),_=0;for(let E of m){let M=o.createAccessorDef(E);M.bufferView=n.bufferViews.length,M.byteOffset=_;let N=E.getElementSize(),O=E.getComponentSize();_+=we.padNumber(N*O),o.accessorIndexMap.set(E,n.accessors.length),n.accessors.push(M);}let y=v*_,R=new ArrayBuffer(y),T=new DataView(R);for(let E=0;E<v;E++){let M=0;for(let N of m){let O=N.getElementSize(),k=N.getComponentSize(),j=N.getComponentType(),G=N.getArray();for(let ne=0;ne<O;ne++){let Me=E*_+M+ne*k,ye=G[E*O+ne];switch(j){case fe.ComponentType.FLOAT:T.setFloat32(Me,ye,true);break;case fe.ComponentType.BYTE:T.setInt8(Me,ye);break;case fe.ComponentType.SHORT:T.setInt16(Me,ye,true);break;case fe.ComponentType.UNSIGNED_BYTE:T.setUint8(Me,ye);break;case fe.ComponentType.UNSIGNED_SHORT:T.setUint16(Me,ye,true);break;case fe.ComponentType.UNSIGNED_INT:T.setUint32(Me,ye,true);break;case fe.ComponentType.FLOAT16:T.setFloat16(Me,ye,true);break;case fe.ComponentType.FLOAT64:T.setFloat64(Me,ye,true);break;default:throw new Error("Unexpected component type: "+j)}}M+=we.padNumber(O*k);}}let b={buffer:S,byteOffset:h,byteLength:y,byteStride:_,target:xr.BufferViewTarget.ARRAY_BUFFER};return n.bufferViews.push(b),{byteLength:y,buffers:[new Uint8Array(R)]}}function p(m,S,h){let v=[],_=0,y=new Map,R=-1/0,T=false;for(let j of m){let G=o.createAccessorDef(j);n.accessors.push(G),o.accessorIndexMap.set(j,n.accessors.length-1);let ne=[],Me=[],ye=[],Ue=new Array(j.getElementSize()).fill(0);for(let q=0,w=j.getCount();q<w;q++)if(j.getElement(q,ye),!Ke.eq(ye,Ue,0)){R=Math.max(q,R),ne.push(q);for(let C=0;C<ye.length;C++)Me.push(ye[C]);}let ve=ne.length,P={accessorDef:G,count:ve};if(y.set(j,P),ve===0)continue;ve>j.getCount()/2&&(T=true);let U=uh[j.getComponentType()];P.indices=ne,P.values=new U(Me);}if(!Number.isFinite(R))return {buffers:v,byteLength:_};T&&a.warn("Some sparse accessors have >50% non-zero elements, which may increase file size.");let b=R<255?Uint8Array:R<65535?Uint16Array:Uint32Array,E=R<255?oN:R<65535?sN:iN,M={buffer:S,byteOffset:h+_,byteLength:0};for(let j of m){let G=y.get(j);if(G.count===0)continue;G.indicesByteOffset=M.byteLength;let ne=we.pad(we.toView(new b(G.indices)));v.push(ne),_+=ne.byteLength,M.byteLength+=ne.byteLength;}n.bufferViews.push(M);let N=n.bufferViews.length-1,O={buffer:S,byteOffset:h+_,byteLength:0};for(let j of m){let G=y.get(j);if(G.count===0)continue;G.valuesByteOffset=O.byteLength;let ne=we.pad(we.toView(G.values));v.push(ne),_+=ne.byteLength,O.byteLength+=ne.byteLength;}n.bufferViews.push(O);let k=n.bufferViews.length-1;for(let j of m){let G=y.get(j);G.count!==0&&(G.accessorDef.sparse={count:G.count,indices:{bufferView:N,byteOffset:G.indicesByteOffset,componentType:E},values:{bufferView:k,byteOffset:G.valuesByteOffset}});}return {buffers:v,byteLength:_}}if(n.accessors=[],n.bufferViews=[],n.samplers=[],n.textures=[],n.images=i.listTextures().map((m,S)=>{let h=o.createPropertyDef(m);m.getMimeType()&&(h.mimeType=m.getMimeType());let v=m.getImage();return v&&o.createImageData(h,v,m),o.imageIndexMap.set(m,S),h}),l.filter(m=>m.prewriteTypes.includes("Accessor")).forEach(m=>m.prewrite(o,"Accessor")),i.listAccessors().forEach(m=>{let S=o.accessorUsageGroupedByParent,h=o.accessorParents;if(o.accessorIndexMap.has(m))return;let v=o.getAccessorUsage(m);if(o.addAccessorToUsageGroup(m,v),S.has(v)){let _=r.listParents(m).find(y=>y.propertyType!=="Root");h.set(m,_);}}),l.filter(m=>m.prewriteTypes.includes("Buffer")).forEach(m=>m.prewrite(o,"Buffer")),(i.listAccessors().length>0||o.otherBufferViews.size>0||i.listTextures().length>0&&e.format==="GLB")&&i.listBuffers().length===0)throw new Error("Buffer required for Document resources, but none was found.");n.buffers=[],i.listBuffers().forEach((m,S)=>{let h=o.createPropertyDef(m),v=o.accessorUsageGroupedByParent,_=m.listParents().filter(N=>N instanceof fe),y=new Set(_.map(N=>o.accessorParents.get(N))),R=new Map(Array.from(y).map((N,O)=>[N,O])),T={};for(let N of _){if(o.accessorIndexMap.has(N))continue;let O=o.getAccessorUsage(N),k=O;if(v.has(O)){let j=o.accessorParents.get(N);k+=`:${R.get(j)}`;}T[k]||={usage:O,accessors:[]},T[k].accessors.push(N);}let b=[],E=n.buffers.length,M=0;for(let{usage:N,accessors:O}of Object.values(T))if(N===oh.ARRAY_BUFFER&&e.vertexLayout==="interleaved"){let k=f(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}else if(N===oh.ARRAY_BUFFER)for(let k of O){let j=f([k],E,M);M+=j.byteLength;for(let G of j.buffers)b.push(G);}else if(N===oh.SPARSE){let k=p(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}else if(N===oh.ELEMENT_ARRAY_BUFFER){let k=xr.BufferViewTarget.ELEMENT_ARRAY_BUFFER,j=d(O,E,M,k);M+=j.byteLength;for(let G of j.buffers)b.push(G);}else {let k=d(O,E,M);M+=k.byteLength;for(let j of k.buffers)b.push(j);}if(o.imageBufferViews.length&&S===0){for(let N=0;N<o.imageBufferViews.length;N++)if(n.bufferViews[n.images[N].bufferView].byteOffset=M,M+=o.imageBufferViews[N].byteLength,b.push(o.imageBufferViews[N]),M%8){let O=8-M%8;M+=O,b.push(new Uint8Array(O));}}if(o.otherBufferViews.has(m))for(let N of o.otherBufferViews.get(m))n.bufferViews.push({buffer:E,byteOffset:M,byteLength:N.byteLength}),o.otherBufferViewsIndexMap.set(N,n.bufferViews.length-1),M+=N.byteLength,b.push(N);if(M){let N;e.format==="GLB"?N=br:(N=o.bufferURIGenerator.createURI(m,"bin"),h.uri=N),h.byteLength=M,o.assignResourceURI(N,we.concat(b),true);}n.buffers.push(h),o.bufferIndexMap.set(m,S);}),i.listAccessors().find(m=>!m.getBuffer())&&a.warn("Skipped writing one or more Accessors: no Buffer assigned."),l.filter(m=>m.prewriteTypes.includes("Material")).forEach(m=>m.prewrite(o,"Material")),n.materials=i.listMaterials().map((m,S)=>{let h=o.createPropertyDef(m);if(m.getAlphaMode()!==lh.AlphaMode.OPAQUE&&(h.alphaMode=m.getAlphaMode()),m.getAlphaMode()===lh.AlphaMode.MASK&&(h.alphaCutoff=m.getAlphaCutoff()),m.getDoubleSided()&&(h.doubleSided=true),h.pbrMetallicRoughness={},Ke.eq(m.getBaseColorFactor(),[1,1,1,1])||(h.pbrMetallicRoughness.baseColorFactor=m.getBaseColorFactor()),Ke.eq(m.getEmissiveFactor(),[0,0,0])||(h.emissiveFactor=m.getEmissiveFactor()),m.getRoughnessFactor()!==1&&(h.pbrMetallicRoughness.roughnessFactor=m.getRoughnessFactor()),m.getMetallicFactor()!==1&&(h.pbrMetallicRoughness.metallicFactor=m.getMetallicFactor()),m.getBaseColorTexture()){let v=m.getBaseColorTexture(),_=m.getBaseColorTextureInfo();h.pbrMetallicRoughness.baseColorTexture=o.createTextureInfoDef(v,_);}if(m.getEmissiveTexture()){let v=m.getEmissiveTexture(),_=m.getEmissiveTextureInfo();h.emissiveTexture=o.createTextureInfoDef(v,_);}if(m.getNormalTexture()){let v=m.getNormalTexture(),_=m.getNormalTextureInfo(),y=o.createTextureInfoDef(v,_);m.getNormalScale()!==1&&(y.scale=m.getNormalScale()),h.normalTexture=y;}if(m.getOcclusionTexture()){let v=m.getOcclusionTexture(),_=m.getOcclusionTextureInfo(),y=o.createTextureInfoDef(v,_);m.getOcclusionStrength()!==1&&(y.strength=m.getOcclusionStrength()),h.occlusionTexture=y;}if(m.getMetallicRoughnessTexture()){let v=m.getMetallicRoughnessTexture(),_=m.getMetallicRoughnessTextureInfo();h.pbrMetallicRoughness.metallicRoughnessTexture=o.createTextureInfoDef(v,_);}return o.materialIndexMap.set(m,S),h}),l.filter(m=>m.prewriteTypes.includes("Mesh")).forEach(m=>m.prewrite(o,"Mesh")),n.meshes=i.listMeshes().map((m,S)=>{let h=o.createPropertyDef(m),v=null;return h.primitives=m.listPrimitives().map(_=>{let y={attributes:{}};y.mode=_.getMode();let R=_.getMaterial();R&&(y.material=o.materialIndexMap.get(R)),Object.keys(_.getExtras()).length&&(y.extras=_.getExtras());let T=_.getIndices();T&&(y.indices=o.accessorIndexMap.get(T));for(let b of _.listSemantics())y.attributes[b]=o.accessorIndexMap.get(_.getAttribute(b));for(let b of _.listTargets()){let E={};for(let M of b.listSemantics())E[M]=o.accessorIndexMap.get(b.getAttribute(M));y.targets=y.targets||[],y.targets.push(E);}return _.listTargets().length&&!v&&(v=_.listTargets().map(b=>b.getName())),y}),m.getWeights().length&&(h.weights=m.getWeights()),v&&(h.extras=h.extras||{},h.extras.targetNames=v),o.meshIndexMap.set(m,S),h}),n.cameras=i.listCameras().map((m,S)=>{let h=o.createPropertyDef(m);if(h.type=m.getType(),h.type===fh.Type.PERSPECTIVE){h.perspective={znear:m.getZNear(),zfar:m.getZFar(),yfov:m.getYFov()};let v=m.getAspectRatio();v!==null&&(h.perspective.aspectRatio=v);}else h.orthographic={znear:m.getZNear(),zfar:m.getZFar(),xmag:m.getXMag(),ymag:m.getYMag()};return o.cameraIndexMap.set(m,S),h}),n.nodes=i.listNodes().map((m,S)=>{let h=o.createPropertyDef(m);return Ke.eq(m.getTranslation(),[0,0,0])||(h.translation=m.getTranslation()),Ke.eq(m.getRotation(),[0,0,0,1])||(h.rotation=m.getRotation()),Ke.eq(m.getScale(),[1,1,1])||(h.scale=m.getScale()),m.getWeights().length&&(h.weights=m.getWeights()),o.nodeIndexMap.set(m,S),h}),n.skins=i.listSkins().map((m,S)=>{let h=o.createPropertyDef(m),v=m.getInverseBindMatrices();v&&(h.inverseBindMatrices=o.accessorIndexMap.get(v));let _=m.getSkeleton();return _&&(h.skeleton=o.nodeIndexMap.get(_)),h.joints=m.listJoints().map(y=>o.nodeIndexMap.get(y)),o.skinIndexMap.set(m,S),h}),i.listNodes().forEach((m,S)=>{let h=n.nodes[S],v=m.getMesh();v&&(h.mesh=o.meshIndexMap.get(v));let _=m.getCamera();_&&(h.camera=o.cameraIndexMap.get(_));let y=m.getSkin();y&&(h.skin=o.skinIndexMap.get(y)),m.listChildren().length>0&&(h.children=m.listChildren().map(R=>o.nodeIndexMap.get(R)));}),n.animations=i.listAnimations().map((m,S)=>{let h=o.createPropertyDef(m),v=new Map;return h.samplers=m.listSamplers().map((_,y)=>{let R=o.createPropertyDef(_);return R.input=o.accessorIndexMap.get(_.getInput()),R.output=o.accessorIndexMap.get(_.getOutput()),R.interpolation=_.getInterpolation(),v.set(_,y),R}),h.channels=m.listChannels().map(_=>{let y=o.createPropertyDef(_);return y.sampler=v.get(_.getSampler()),y.target={node:o.nodeIndexMap.get(_.getTargetNode()),path:_.getTargetPath()},y}),o.animationIndexMap.set(m,S),h}),n.scenes=i.listScenes().map((m,S)=>{let h=o.createPropertyDef(m);return h.nodes=m.listChildren().map(v=>o.nodeIndexMap.get(v)),o.sceneIndexMap.set(m,S),h});let g=i.getDefaultScene();return g&&(n.scene=i.listScenes().indexOf(g)),n.extensionsUsed=l.map(m=>m.extensionName),n.extensionsRequired=u.map(m=>m.extensionName),l.forEach(m=>m.write(o)),lN(n),s}};function lN(t){let e=[];for(let r in t){let i=t[r];(Array.isArray(i)&&i.length===0||i===null||i===""||i&&typeof i=="object"&&Object.keys(i).length===0)&&e.push(r);}for(let r of e)delete t[r];}var uN=class{_logger=dh.DEFAULT_INSTANCE;_extensions=new Set;_dependencies={};_vertexLayout="interleaved";_strictResources=true;lastReadBytes=0;lastWriteBytes=0;setLogger(t){return this._logger=t,this}registerExtensions(t){for(let e of t)this._extensions.add(e),e.register();return this}registerDependencies(t){return Object.assign(this._dependencies,t),this}setVertexLayout(t){return this._vertexLayout=t,this}setStrictResources(t){return this._strictResources=t,this}async read(t){return await this.readJSON(await this.readAsJSON(t))}async readAsJSON(t){let e=await this.readURI(t,"view");this.lastReadBytes=e.byteLength;let r=dR(e)?this._binaryToJSON(e):{json:JSON.parse(we.decodeText(e)),resources:{}};return await this._readResourcesExternal(r,this.dirname(t)),this._readResourcesInternal(r),r}async readJSON(t){return t=this._copyJSON(t),this._readResourcesInternal(t),eN.read(t,{extensions:Array.from(this._extensions),dependencies:this._dependencies,logger:this._logger})}async binaryToJSON(t){let e=this._binaryToJSON(we.assertView(t));this._readResourcesInternal(e);let r=e.json;if(r.buffers&&r.buffers.some(i=>dN(e,i)))throw new Error("Cannot resolve external buffers with binaryToJSON().");if(r.images&&r.images.some(i=>hN(e,i)))throw new Error("Cannot resolve external images with binaryToJSON().");return e}async readBinary(t){return this.readJSON(await this.binaryToJSON(we.assertView(t)))}async writeJSON(t,e={}){if(e.format==="GLB"&&t.getRoot().listBuffers().length>1)throw new Error("GLB must have 0\u20131 buffers.");return cN.write(t,{format:e.format||"GLTF",basename:e.basename||"",logger:this._logger,vertexLayout:this._vertexLayout,dependencies:{...this._dependencies},extensions:Array.from(this._extensions)})}async writeBinary(t){let{json:e,resources:r}=await this.writeJSON(t,{format:"GLB"}),i=new Uint32Array([1179937895,2,12]),n=JSON.stringify(e),s=we.pad(we.encodeText(n),32),o=we.toView(new Uint32Array([s.byteLength,1313821514])),a=we.concat([o,s]);i[i.length-1]+=a.byteLength;let c=Object.values(r)[0];if(!c||!c.byteLength)return we.concat([we.toView(i),a]);let l=we.pad(c,0),u=we.toView(new Uint32Array([l.byteLength,5130562])),d=we.concat([u,l]);return i[i.length-1]+=d.byteLength,we.concat([we.toView(i),a,d])}async _readResourcesExternal(t,e){let r=t.json.images||[],i=t.json.buffers||[],n=[...r,...i].map(async s=>{let o=s.uri;if(!o||o.match(/data:/))return Promise.resolve();try{t.resources[o]=await this.readURI(this.resolve(e,o),"view"),this.lastReadBytes+=t.resources[o].byteLength;}catch(a){if(!this._strictResources&&r.includes(s))this._logger.warn(`Failed to load image URI, "${o}". ${a}`),t.resources[o]=null;else throw a}});await Promise.all(n);}_readResourcesInternal(t){function e(r){if(r.uri){if(r.uri in t.resources){we.assertView(t.resources[r.uri]);return}if(r.uri.match(/data:/)){let i=`__${qP()}.${yi.extension(r.uri)}`;t.resources[i]=we.createBufferFromDataURI(r.uri),r.uri=i;}}}(t.json.images||[]).forEach(r=>{if(r.bufferView===void 0&&r.uri===void 0)throw new Error("Missing resource URI or buffer view.");e(r);}),(t.json.buffers||[]).forEach(e);}_copyJSON(t){let{images:e,buffers:r}=t.json;return t={json:{...t.json},resources:{...t.resources}},e&&(t.json.images=e.map(i=>({...i}))),r&&(t.json.buffers=r.map(i=>({...i}))),t}_binaryToJSON(t){if(!dR(t))throw new Error("Invalid glTF 2.0 binary.");let e=new Uint32Array(t.buffer,t.byteOffset+12,2);if(e[1]!==1313821514)throw new Error("Missing required GLB JSON chunk.");let r=20,i=e[0],n=we.decodeText(we.toView(t,r,i)),s=JSON.parse(n),o=r+i;if(t.byteLength<=o)return {json:s,resources:{}};let a=new Uint32Array(t.buffer,t.byteOffset+o,2);if(a[1]!==5130562)return {json:s,resources:{}};let c=a[0],l=we.toView(t,o+8,c);return {json:s,resources:{[br]:l}}}};function dN(t,e){return e.uri!==void 0&&!(e.uri in t.resources)}function hN(t,e){return e.uri!==void 0&&!(e.uri in t.resources)&&e.bufferView===void 0}function dR(t){if(t.byteLength<3*Uint32Array.BYTES_PER_ELEMENT)return false;let e=new Uint32Array(t.buffer,t.byteOffset,3);return e[0]===1179937895&&e[1]===2}var Jt=class extends uN{_fetch;_fetchConfig;_init;_fetchEnabled=false;constructor(t=null,e=kn.DEFAULT_INIT){super(),this._fetch=t,this._fetchConfig=e,this._init=this.init();}async init(){return this._init?this._init:Promise.all([import('fs'),import('path')]).then(([t,e])=>{this._fs=t.promises,this._path=e;})}setAllowNetwork(t){if(t&&!this._fetch)throw new Error("NodeIO requires a Fetch API implementation for HTTP requests.");return this._fetchEnabled=t,this}async readURI(t,e){if(await this.init(),kn.isAbsoluteURL(t)){if(!this._fetchEnabled||!this._fetch)throw new Error("Network request blocked. Allow HTTP requests explicitly, if needed.");let r=await this._fetch(t,this._fetchConfig);switch(e){case "view":return new Uint8Array(await r.arrayBuffer());case "text":return r.text()}}else switch(e){case "view":return this._fs.readFile(t);case "text":return this._fs.readFile(t,"utf8")}}resolve(t,e){return kn.isAbsoluteURL(t)||kn.isAbsoluteURL(e)?kn.resolve(t,e):this._path.resolve(t,decodeURIComponent(e))}dirname(t){return kn.isAbsoluteURL(t)?kn.dirname(t):this._path.dirname(t)}async write(t,e){await this.init(),await(t.match(/\.glb$/)?this._writeGLB(t,e):this._writeGLTF(t,e));}async _writeGLTF(t,e){this.lastWriteBytes=0;let{json:r,resources:i}=await this.writeJSON(e,{format:"GLTF",basename:yi.basename(t)}),{_fs:n,_path:s}=this,o=s.dirname(t),a=JSON.stringify(r,null,2);await n.writeFile(t,a),this.lastWriteBytes+=a.length;for(let c of fN(Object.keys(i),10))await Promise.all(c.map(async l=>{if(kn.isAbsoluteURL(l)){if(kn.extension(l)==="bin")throw new Error(`Cannot write buffer to path "${l}".`);return}let u=s.join(o,decodeURIComponent(l));await n.mkdir(s.dirname(u),{recursive:true}),await n.writeFile(u,i[l]),this.lastWriteBytes+=i[l].byteLength;}));}async _writeGLB(t,e){let r=await this.writeBinary(e);await this._fs.writeFile(t,r),this.lastWriteBytes=r.byteLength;}};function fN(t,e){let r=[];for(let i=0,n=t.length;i<n;i+=e){let s=[];for(let o=0;o<e&&i+o<n;o++)s.push(t[i+o]);r.push(s);}return r}function pN(){return {vkFormat:0,typeSize:1,pixelWidth:0,pixelHeight:0,pixelDepth:0,layerCount:0,faceCount:1,levelCount:0,supercompressionScheme:0,levels:[],dataFormatDescriptor:[{vendorId:0,descriptorType:0,versionNumber:2,colorModel:0,colorPrimaries:1,transferFunction:2,flags:0,texelBlockDimension:[0,0,0,0],bytesPlane:[0,0,0,0,0,0,0,0],samples:[]}],keyValue:{},globalData:null}}var Si=class{constructor(e,r,i,n){this._dataView=void 0,this._littleEndian=void 0,this._offset=void 0,this._dataView=new DataView(e.buffer,e.byteOffset+r,i),this._littleEndian=n,this._offset=0;}_nextUint8(){let e=this._dataView.getUint8(this._offset);return this._offset+=1,e}_nextUint16(){let e=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,e}_nextUint32(){let e=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint64(){let e=this._dataView.getUint32(this._offset,this._littleEndian),r=this._dataView.getUint32(this._offset+4,this._littleEndian),i=e+2**32*r;return this._offset+=8,i}_nextInt32(){let e=this._dataView.getInt32(this._offset,this._littleEndian);return this._offset+=4,e}_nextUint8Array(e){let r=new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+this._offset,e);return this._offset+=e,r}_skip(e){return this._offset+=e,this}_scan(e,r=0){let i=this._offset,n=0;for(;this._dataView.getUint8(this._offset)!==r&&n<e;)n++,this._offset++;return n<e&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+i,n)}};var Ct=[171,75,84,88,32,50,48,187,13,10,26,10];function PR(t){return new TextDecoder().decode(t)}function ph(t){let e=new Uint8Array(t.buffer,t.byteOffset,Ct.length);if(e[0]!==Ct[0]||e[1]!==Ct[1]||e[2]!==Ct[2]||e[3]!==Ct[3]||e[4]!==Ct[4]||e[5]!==Ct[5]||e[6]!==Ct[6]||e[7]!==Ct[7]||e[8]!==Ct[8]||e[9]!==Ct[9]||e[10]!==Ct[10]||e[11]!==Ct[11])throw new Error("Missing KTX 2.0 identifier.");let r=pN(),i=17*Uint32Array.BYTES_PER_ELEMENT,n=new Si(t,Ct.length,i,true);r.vkFormat=n._nextUint32(),r.typeSize=n._nextUint32(),r.pixelWidth=n._nextUint32(),r.pixelHeight=n._nextUint32(),r.pixelDepth=n._nextUint32(),r.layerCount=n._nextUint32(),r.faceCount=n._nextUint32(),r.levelCount=n._nextUint32(),r.supercompressionScheme=n._nextUint32();let s=n._nextUint32(),o=n._nextUint32(),a=n._nextUint32(),c=n._nextUint32(),l=n._nextUint64(),u=n._nextUint64(),d=Math.max(r.levelCount,1)*3*8,f=new Si(t,Ct.length+i,d,true);for(let Ie=0,Ve=Math.max(r.levelCount,1);Ie<Ve;Ie++)r.levels.push({levelData:new Uint8Array(t.buffer,t.byteOffset+f._nextUint64(),f._nextUint64()),uncompressedByteLength:f._nextUint64()});let p=new Si(t,s,o,true);p._skip(4);let g=p._nextUint16(),m=p._nextUint16(),S=p._nextUint16(),h=p._nextUint16(),v=p._nextUint8(),_=p._nextUint8(),y=p._nextUint8(),R=p._nextUint8(),T=[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],b=[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],M={vendorId:g,descriptorType:m,versionNumber:S,colorModel:v,colorPrimaries:_,transferFunction:y,flags:R,texelBlockDimension:T,bytesPlane:b,samples:[]},k=(h/4-6)/4;for(let Ie=0;Ie<k;Ie++){let Ve={bitOffset:p._nextUint16(),bitLength:p._nextUint8(),channelType:p._nextUint8(),samplePosition:[p._nextUint8(),p._nextUint8(),p._nextUint8(),p._nextUint8()],sampleLower:Number.NEGATIVE_INFINITY,sampleUpper:Number.POSITIVE_INFINITY};Ve.channelType&64?(Ve.sampleLower=p._nextInt32(),Ve.sampleUpper=p._nextInt32()):(Ve.sampleLower=p._nextUint32(),Ve.sampleUpper=p._nextUint32()),M.samples[Ie]=Ve;}r.dataFormatDescriptor.length=0,r.dataFormatDescriptor.push(M);let j=new Si(t,a,c,true);for(;j._offset<c;){let Ie=j._nextUint32(),Ve=j._scan(Ie),A=PR(Ve);if(r.keyValue[A]=j._nextUint8Array(Ie-Ve.byteLength-1),A.match(/^ktx/i)){let H=PR(r.keyValue[A]);r.keyValue[A]=H.substring(0,H.lastIndexOf("\0"));}let V=Ie%4?4-Ie%4:0;j._skip(V);}if(u<=0)return r;let G=new Si(t,l,u,true),ne=G._nextUint16(),Me=G._nextUint16(),ye=G._nextUint32(),Ue=G._nextUint32(),ve=G._nextUint32(),P=G._nextUint32(),U=[];for(let Ie=0,Ve=Math.max(r.levelCount,1);Ie<Ve;Ie++)U.push({imageFlags:G._nextUint32(),rgbSliceByteOffset:G._nextUint32(),rgbSliceByteLength:G._nextUint32(),alphaSliceByteOffset:G._nextUint32(),alphaSliceByteLength:G._nextUint32()});let q=l+G._offset,w=q+ye,C=w+Ue,L=C+ve,Q=new Uint8Array(t.buffer,t.byteOffset+q,ye),ue=new Uint8Array(t.buffer,t.byteOffset+w,Ue),Re=new Uint8Array(t.buffer,t.byteOffset+C,ve),pe=new Uint8Array(t.buffer,t.byteOffset+L,P);return r.globalData={endpointCount:ne,selectorCount:Me,imageDescs:U,endpointsData:Q,selectorsData:ue,tablesData:Re,extendedData:pe},r}var Rr="EXT_mesh_gpu_instancing",Fn="EXT_mesh_features",kt="EXT_meshopt_compression",xe="EXT_structural_metadata",mh="EXT_texture_webp",gh="EXT_texture_avif",SN="KHR_accessor_float16",xN="KHR_accessor_float64",tt="KHR_draco_mesh_compression",Un="KHR_lights_punctual",Er="KHR_materials_anisotropy",wr="KHR_materials_clearcoat",Mr="KHR_materials_diffuse_transmission",Ar="KHR_materials_dispersion",Ir="KHR_materials_emissive_strength",Cr="KHR_materials_ior",Pr="KHR_materials_iridescence",Nr="KHR_materials_pbrSpecularGlossiness",Or="KHR_materials_sheen",zr="KHR_materials_specular",$r="KHR_materials_transmission",Is="KHR_materials_unlit",Dr="KHR_materials_volume",Gt="KHR_materials_variants",NR="KHR_mesh_primitive_restart",OR="KHR_mesh_quantization",Lr="KHR_node_visibility",_h="KHR_texture_basisu",kr="KHR_texture_transform",fn="KHR_xmp_json_ld",bN=class extends Ne{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="FeatureID",this.parentTypes=["Features"];}getDefaults(){return Object.assign(super.getDefaults(),{nullFeatureId:null,label:"",attribute:null,texture:null,propertyTable:null})}getFeatureCount(){return this.get("featureCount")}setFeatureCount(t){return this.set("featureCount",t)}getNullFeatureID(){return this.get("nullFeatureId")}setNullFeatureID(t){return this.set("nullFeatureId",t)}getLabel(){return this.get("label")}setLabel(t){return this.set("label",t)}getAttribute(){return this.get("attribute")}setAttribute(t){return this.set("attribute",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getPropertyTable(){return this.getRef("propertyTable")}setPropertyTable(t){return this.setRef("propertyTable",t)}},TN=class extends Ne{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="FeatureIDTexture",this.parentTypes=["FeatureID"];}getDefaults(){let t=new He(this.graph,"textureInfo");return t.setMinFilter(He.MagFilter.NEAREST),t.setMagFilter(He.MagFilter.NEAREST),Object.assign(super.getDefaults(),{channels:[0],texture:null,textureInfo:t})}getChannels(){return this.get("channels")}setChannels(t){return this.set("channels",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getTextureInfo(){return this.getRef("texture")?this.getRef("textureInfo"):null}},RN=class extends Ne{static EXTENSION_NAME=Fn;init(){this.extensionName=Fn,this.propertyType="Features",this.parentTypes=[te.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{featureIds:new Be([])})}listFeatureIDs(){return this.listRefs("featureIds")}addFeatureID(t){return this.addRef("featureIds",t)}removeFeatureID(t){return this.removeRef("featureIds",t)}},Pa=Fn,EN=class extends ke{extensionName=Fn;static EXTENSION_NAME=Fn;createFeatures(){return new RN(this.document.getGraph())}createFeatureID(){return new bN(this.document.getGraph())}createFeatureIDTexture(){return new TN(this.document.getGraph())}read(t){return (t.jsonDoc.json.meshes||[]).forEach((e,r)=>{(e.primitives||[]).forEach((i,n)=>{this._readPrimitive(t,r,i,n);});}),this}_readPrimitive(t,e,r,i){if(!r.extensions||!r.extensions[Pa])return;let n=this.createFeatures(),s=r.extensions[Pa];for(let o of s.featureIds){let a=wN(this.document,this,t,o);n.addFeatureID(a);}t.meshes[e].listPrimitives()[i].setExtension(Pa,n);}write(t){let e=t.jsonDoc.json.meshes;if(!e)return this;for(let r of this.document.getRoot().listMeshes()){let i=e[t.meshIndexMap.get(r)];r.listPrimitives().forEach((n,s)=>{let o=i.primitives[s];this._writePrimitive(t,n,o);});}return this}_writePrimitive(t,e,r){let i=e.getExtension(Pa);if(!i)return;let n={featureIds:[]};i.listFeatureIDs().forEach(s=>{n.featureIds.push(AN(this.document,t,s));}),r.extensions=r.extensions||{},r.extensions[Pa]=n;}};function wN(t,e,r,i){let n=e.createFeatureID().setFeatureCount(i.featureCount);i.nullFeatureId!==void 0&&n.setNullFeatureID(i.nullFeatureId),i.label!==void 0&&n.setLabel(i.label),i.attribute!==void 0&&n.setAttribute(i.attribute);let s=i.texture;if(s!==void 0){let o=MN(e,r,s);n.setTexture(o);}if(i.propertyTable!==void 0){let o=t.getRoot().getExtension(xe).listPropertyTables();n.setPropertyTable(o[i.propertyTable]);}return n}function MN(t,e,r){let i=t.createFeatureIDTexture(),{json:n}=e.jsonDoc;if(r.channels&&i.setChannels(r.channels),r.index!==void 0){let s=n.textures[r.index].source;i.setTexture(e.textures[s]),e.setTextureInfo(i.getTextureInfo(),r);}return i}function AN(t,e,r){let i=t.getRoot(),n={featureCount:r.getFeatureCount()};if(r.getNullFeatureID()!=null&&(n.nullFeatureId=r.getNullFeatureID()),r.getLabel()&&(n.label=r.getLabel()),r.getAttribute()!=null&&(n.attribute=r.getAttribute()),r.getTexture()){let s=r.getTexture(),o=s.getTexture(),a=s.getTextureInfo();n.texture=e.createTextureInfoDef(o,a);let c=s.getChannels();Ke.eq(c,[0])||(n.texture.channels=c);}if(r.getPropertyTable()){let s=i.getExtension(xe),o=r.getPropertyTable();n.propertyTable=s.listPropertyTables().indexOf(o);}return n}var _y="INSTANCE_ATTRIBUTE",IN=class extends Ne{static EXTENSION_NAME=Rr;init(){this.extensionName=Rr,this.propertyType="InstancedMesh",this.parentTypes=[te.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{attributes:new st})}getAttribute(t){return this.getRefMap("attributes",t)}setAttribute(t,e){return this.setRefMap("attributes",t,e,{usage:_y})}listAttributes(){return this.listRefMapValues("attributes")}listSemantics(){return this.listRefMapKeys("attributes")}},CN=class extends ke{static EXTENSION_NAME=Rr;extensionName=Rr;prewriteTypes=[te.ACCESSOR];createInstancedMesh(){return new IN(this.document.getGraph())}read(t){return (t.jsonDoc.json.nodes||[]).forEach((e,r)=>{if(!e.extensions||!e.extensions.EXT_mesh_gpu_instancing)return;let i=e.extensions[Rr],n=this.createInstancedMesh();for(let s in i.attributes)n.setAttribute(s,t.accessors[i.attributes[s]]);t.nodes[r].setExtension(Rr,n);}),this}prewrite(t){t.accessorUsageGroupedByParent.add(_y);for(let e of this.properties)for(let r of e.listAttributes())t.addAccessorToUsageGroup(r,_y);return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listNodes().forEach(r=>{let i=r.getExtension(Rr);if(i){let n=t.nodeIndexMap.get(r),s=e.json.nodes[n],o={attributes:{}};i.listSemantics().forEach(a=>{let c=i.getAttribute(a);o.attributes[a]=t.accessorIndexMap.get(c);}),s.extensions=s.extensions||{},s.extensions[Rr]=o;}}),this}},PN=(function(t){return t.QUANTIZE="quantize",t.FILTER="filter",t})({});function NN(t){return !t.extensions||!t.extensions.EXT_meshopt_compression?false:!!t.extensions[kt].fallback}var{BYTE:ON,SHORT:zR,FLOAT:zN}=fe.ComponentType,{encodeNormalizedInt:$R,decodeNormalizedInt:vy}=Ke;function $N(t,e,r,i){let{filter:n,bits:s}=i,o={array:t.getArray(),byteStride:t.getElementSize()*t.getComponentSize(),componentType:t.getComponentType(),normalized:t.getNormalized()};if(r!=="ATTRIBUTES")return o;if(n!=="NONE"){let a=t.getNormalized()?DN(t):new Float32Array(o.array);switch(n){case "EXPONENTIAL":o.byteStride=t.getElementSize()*4,o.componentType=zN,o.normalized=false,o.array=e.encodeFilterExp(a,t.getCount(),o.byteStride,s);break;case "OCTAHEDRAL":o.byteStride=s>8?8:4,o.componentType=s>8?zR:ON,o.normalized=true,a=t.getElementSize()===3?kN(a):a,o.array=e.encodeFilterOct(a,t.getCount(),o.byteStride,s);break;case "QUATERNION":o.byteStride=8,o.componentType=zR,o.normalized=true,o.array=e.encodeFilterQuat(a,t.getCount(),o.byteStride,s);break;default:throw new Error("Invalid filter.")}o.min=t.getMin([]),o.max=t.getMax([]),t.getNormalized()&&(o.min=o.min.map(c=>vy(c,t.getComponentType())),o.max=o.max.map(c=>vy(c,t.getComponentType()))),o.normalized&&(o.min=o.min.map(c=>$R(c,o.componentType)),o.max=o.max.map(c=>$R(c,o.componentType)));}else o.byteStride%4&&(o.array=LN(o.array,t.getElementSize()),o.byteStride=o.array.byteLength/t.getCount());return o}function DN(t){let e=t.getComponentType(),r=t.getArray(),i=new Float32Array(r.length);for(let n=0;n<r.length;n++)i[n]=vy(r[n],e);return i}function LN(t,e){let r=we.padNumber(t.BYTES_PER_ELEMENT*e)/t.BYTES_PER_ELEMENT,i=t.length/e,n=new t.constructor(i*r);for(let s=0;s*e<t.length;s++)for(let o=0;o<e;o++)n[s*r+o]=t[s*e+o];return n}function kN(t){let e=new Float32Array(t.length*4/3);for(let r=0,i=t.length/3;r<i;r++)e[r*4]=t[r*3],e[r*4+1]=t[r*3+1],e[r*4+2]=t[r*3+2];return e}function UN(t,e){return e===xr.BufferViewUsage.ELEMENT_ARRAY_BUFFER?t.listParents().some(r=>r instanceof Ca&&r.getMode()===Ca.Mode.TRIANGLES)?"TRIANGLES":"INDICES":"ATTRIBUTES"}function FN(t,e){let r=e.getGraph().listParentEdges(t).filter(i=>!(i.getParent()instanceof py));for(let i of r){let n=i.getName(),s=i.getAttributes().key||"",o=i.getParent().propertyType===te.PRIMITIVE_TARGET;if(n==="indices")return {filter:"NONE"};if(n==="attributes"){if(s==="POSITION")return {filter:"NONE"};if(s==="TEXCOORD_0")return {filter:"NONE"};if(s.startsWith("JOINTS_"))return {filter:"NONE"};if(s.startsWith("WEIGHTS_"))return {filter:"NONE"};if(s==="NORMAL"||s==="TANGENT")return o?{filter:"NONE"}:{filter:"OCTAHEDRAL",bits:8}}if(n==="output"){let a=YR(t);return a==="rotation"?{filter:"QUATERNION",bits:16}:a==="translation"?{filter:"EXPONENTIAL",bits:12}:a==="scale"?{filter:"EXPONENTIAL",bits:12}:{filter:"NONE"}}if(n==="input")return {filter:"NONE"};if(n==="inverseBindMatrices")return {filter:"NONE"}}return {filter:"NONE"}}function YR(t){for(let e of t.listParents())if(e instanceof hh){for(let r of e.listParents())if(r instanceof fy)return r.getTargetPath()}return null}var DR={method:"quantize"},BN=class extends ke{extensionName=kt;prereadTypes=[te.BUFFER,te.PRIMITIVE];prewriteTypes=[te.BUFFER,te.ACCESSOR];readDependencies=["meshopt.decoder"];writeDependencies=["meshopt.encoder"];static EXTENSION_NAME=kt;static EncoderMethod=PN;_decoder=null;_decoderFallbackBufferMap=new Map;_encoder=null;_encoderOptions=DR;_encoderFallbackBuffer=null;_encoderBufferViews={};_encoderBufferViewData={};_encoderBufferViewAccessors={};install(t,e){return t==="meshopt.decoder"&&(this._decoder=e),t==="meshopt.encoder"&&(this._encoder=e),this}setEncoderOptions(t){return this._encoderOptions={...DR,...t},this}preread(t,e){if(!this._decoder){if(!this.isRequired())return this;throw new Error(`[${kt}] Please install extension dependency, "meshopt.decoder".`)}if(!this._decoder.supported){if(!this.isRequired())return this;throw new Error(`[${kt}]: Missing WASM support.`)}return e===te.BUFFER?this._prereadBuffers(t):e===te.PRIMITIVE&&this._prereadPrimitives(t),this}_prereadBuffers(t){let e=t.jsonDoc;(e.json.bufferViews||[]).forEach((r,i)=>{if(!r.extensions||!r.extensions.EXT_meshopt_compression)return;let n=r.extensions[kt],s=n.byteOffset||0,o=n.byteLength||0,a=n.count,c=n.byteStride,l=new Uint8Array(a*c),u=e.json.buffers[n.buffer],d=u.uri?e.resources[u.uri]:e.resources[br],f=we.toView(d,s,o);this._decoder.decodeGltfBuffer(l,a,c,f,n.mode,n.filter),t.bufferViews[i]=l;});}_prereadPrimitives(t){let e=t.jsonDoc;(e.json.bufferViews||[]).forEach(r=>{if(!r.extensions||!r.extensions.EXT_meshopt_compression)return;let i=r.extensions[kt],n=t.buffers[i.buffer],s=t.buffers[r.buffer],o=e.json.buffers[r.buffer];NN(o)&&this._decoderFallbackBufferMap.set(s,n);});}read(t){if(!this.isRequired())return this;for(let[e,r]of this._decoderFallbackBufferMap){for(let i of e.listParents())i instanceof fe&&i.swap(e,r);e.dispose();}return this}prewrite(t,e){return e===te.ACCESSOR?this._prewriteAccessors(t):e===te.BUFFER&&this._prewriteBuffers(t),this}_prewriteAccessors(t){let e=t.jsonDoc.json,r=this._encoder,i=this._encoderOptions,n=this.document.getGraph(),s=this.document.createBuffer(),o=this.document.getRoot().listBuffers().indexOf(s),a=1,c=new Map,l=u=>{for(let d of n.listParents(u)){if(d.propertyType===te.ROOT)continue;let f=c.get(u);return f===void 0&&c.set(u,f=a++),f}return -1};this._encoderFallbackBuffer=s,this._encoderBufferViews={},this._encoderBufferViewData={},this._encoderBufferViewAccessors={};for(let u of this.document.getRoot().listAccessors()){if(YR(u)==="weights"||u.getSparse())continue;let d=t.getAccessorUsage(u),f=t.accessorUsageGroupedByParent.has(d)?l(u):null,p=UN(u,d),g=i.method==="filter"?FN(u,this.document):{filter:"NONE"},m=$N(u,r,p,g),{array:S,byteStride:h}=m,v=u.getBuffer();if(!v)throw new Error(`${kt}: Missing buffer for accessor.`);let _=this.document.getRoot().listBuffers().indexOf(v),y=[d,f,p,g.filter,h,_].join(":"),R=this._encoderBufferViews[y],T=this._encoderBufferViewData[y],b=this._encoderBufferViewAccessors[y];(!R||!T)&&(b=this._encoderBufferViewAccessors[y]=[],T=this._encoderBufferViewData[y]=[],R=this._encoderBufferViews[y]={buffer:o,target:xr.USAGE_TO_TARGET[d],byteOffset:0,byteLength:0,byteStride:d===xr.BufferViewUsage.ARRAY_BUFFER?h:void 0,extensions:{[kt]:{buffer:_,byteOffset:0,byteLength:0,mode:p,filter:g.filter!=="NONE"?g.filter:void 0,byteStride:h,count:0}}});let E=t.createAccessorDef(u);E.componentType=m.componentType,E.normalized=m.normalized,E.byteOffset=R.byteLength,E.min&&m.min&&(E.min=m.min),E.max&&m.max&&(E.max=m.max),t.accessorIndexMap.set(u,e.accessors.length),e.accessors.push(E),b.push(E),T.push(new Uint8Array(S.buffer,S.byteOffset,S.byteLength)),R.byteLength+=S.byteLength,R.extensions.EXT_meshopt_compression.count+=u.getCount();}}_prewriteBuffers(t){let e=this._encoder;for(let r in this._encoderBufferViews){let i=this._encoderBufferViews[r],n=this._encoderBufferViewData[r],s=this.document.getRoot().listBuffers()[i.extensions[kt].buffer],o=t.otherBufferViews.get(s)||[],{count:a,byteStride:c,mode:l}=i.extensions[kt],u=we.concat(n),d=e.encodeGltfBuffer(u,a,c,l),f=we.pad(d);i.extensions[kt].byteLength=d.byteLength,n.length=0,n.push(f),o.push(f),t.otherBufferViews.set(s,o);}}write(t){let e=0;for(let s in this._encoderBufferViews){let o=this._encoderBufferViews[s],a=this._encoderBufferViewData[s][0],c=t.otherBufferViewsIndexMap.get(a),l=this._encoderBufferViewAccessors[s];for(let p of l)p.bufferView=c;let u=t.jsonDoc.json.bufferViews[c],d=u.byteOffset||0;Object.assign(u,o),u.byteOffset=e;let f=u.extensions[kt];f.byteOffset=d,e+=we.padNumber(o.byteLength);}let r=this._encoderFallbackBuffer,i=t.bufferIndexMap.get(r),n=t.jsonDoc.json.buffers[i];return n.byteLength=e,n.extensions={[kt]:{fallback:true}},r.dispose(),this}},VN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="StructuralMetadata",this.parentTypes=[te.ROOT];}getDefaults(){return Object.assign(super.getDefaults(),{schema:null,schemaUri:"",propertyTables:new mt,propertyTextures:new mt,propertyAttributes:new mt})}getSchema(){return this.getRef("schema")}setSchema(t){return this.setRef("schema",t)}getSchemaUri(){return this.get("schemaUri")}setSchemaUri(t){return this.set("schemaUri",t)}listPropertyTables(){return this.listRefs("propertyTables")}addPropertyTable(t){return this.addRef("propertyTables",t)}removePropertyTable(t){return this.removeRef("propertyTables",t)}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(t){return this.addRef("propertyTextures",t)}removePropertyTexture(t){return this.removeRef("propertyTextures",t)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(t){return this.addRef("propertyAttributes",t)}removePropertyAttribute(t){return this.removeRef("propertyAttributes",t)}},jN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="Schema",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",version:"",classes:new st,enums:new st})}getId(){return this.get("id")}setId(t){return this.set("id",t)}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getVersion(){return this.get("version")}setVersion(t){return this.set("version",t)}setClass(t,e){return this.setRefMap("classes",t,e)}getClass(t){return this.getRefMap("classes",t)}listClassKeys(){return this.listRefMapKeys("classes")}listClassValues(){return this.listRefMapValues("classes")}setEnum(t,e){return this.setRefMap("enums",t,e)}getEnum(t){return this.getRefMap("enums",t)}listEnumKeys(){return this.listRefMapKeys("enums")}listEnumValues(){return this.listRefMapValues("enums")}},GN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="Class",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",properties:new st})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},HN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="ClassProperty",this.parentTypes=["Class"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",componentType:null,enumType:null,array:null,count:null,normalized:null,offset:null,scale:null,max:null,min:null,required:null,noData:null,default:null})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getType(){return this.get("type")}setType(t){return this.set("type",t)}getComponentType(){return this.get("componentType")}setComponentType(t){return this.set("componentType",t)}getEnumType(){return this.get("enumType")}setEnumType(t){return this.set("enumType",t)}getArray(){return this.get("array")}setArray(t){return this.set("array",t)}getCount(){return this.get("count")}setCount(t){return this.set("count",t)}getNormalized(){return this.get("normalized")}setNormalized(t){return this.set("normalized",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}getRequired(){return this.get("required")}setRequired(t){return this.set("required",t)}getNoData(){return this.get("noData")}setNoData(t){return this.set("noData",t)}getDefault(){return this.get("default")}setDefault(t){return this.set("default",t)}},qN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="Enum",this.parentTypes=["Schema"];}getDefaults(){return Object.assign(super.getDefaults(),{description:"",valueType:"UINT16",values:new mt})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getValueType(){return this.get("valueType")}setValueType(t){return this.set("valueType",t)}listValues(){return this.listRefs("values")}addEnumValue(t){return this.addRef("values",t)}removeEnumValue(t){return this.removeRef("values",t)}},WN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="EnumValue",this.parentTypes=["Enum"];}getDefaults(){return Object.assign(super.getDefaults(),{description:null})}getDescription(){return this.get("description")}setDescription(t){return this.set("description",t)}getValue(){return this.get("value")}setValue(t){return this.set("value",t)}},KN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyTable",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}getCount(){return this.get("count")}setCount(t){return this.set("count",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},ZN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyTableProperty",this.parentTypes=["PropertyTable"];}getDefaults(){return Object.assign(super.getDefaults(),{arrayOffsets:null,stringOffsets:null,arrayOffsetType:null,stringOffsetType:null,offset:null,scale:null,max:null,min:null})}getValues(){return this.get("values")}setValues(t){return this.set("values",t)}getArrayOffsets(){return this.get("arrayOffsets")}setArrayOffsets(t){return this.set("arrayOffsets",t)}getStringOffsets(){return this.get("stringOffsets")}setStringOffsets(t){return this.set("stringOffsets",t)}getArrayOffsetType(){return this.get("arrayOffsetType")}setArrayOffsetType(t){return this.set("arrayOffsetType",t)}getStringOffsetType(){return this.get("stringOffsetType")}setStringOffsetType(t){return this.set("stringOffsetType",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},XN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyTexture",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},JN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyTextureProperty",this.parentTypes=["PropertyTexture"];}getDefaults(){let t=new He(this.graph,"textureInfo");return t.setMinFilter(He.MagFilter.NEAREST),t.setMagFilter(He.MagFilter.NEAREST),Object.assign(super.getDefaults(),{channels:[0],texture:null,textureInfo:t,offset:null,scale:null,max:null,min:null})}getChannels(){return this.get("channels")}setChannels(t){return this.set("channels",t)}getTexture(){return this.getRef("texture")}setTexture(t){return this.setRef("texture",t)}getTextureInfo(){return this.getRef("texture")?this.getRef("textureInfo"):null}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},YN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyAttribute",this.parentTypes=["StructuralMetadata"];}getDefaults(){return Object.assign(super.getDefaults(),{properties:new st})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}setProperty(t,e){return this.setRefMap("properties",t,e)}getProperty(t){return this.getRefMap("properties",t)}listPropertyKeys(){return this.listRefMapKeys("properties")}listPropertyValues(){return this.listRefMapValues("properties")}},QN=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="PropertyAttributeProperty",this.parentTypes=["PropertyAttribute"];}getDefaults(){return Object.assign(super.getDefaults(),{offset:null,scale:null,max:null,min:null})}getAttribute(){return this.get("attribute")}setAttribute(t){return this.set("attribute",t)}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getMax(){return this.get("max")}setMax(t){return this.set("max",t)}getMin(){return this.get("min")}setMin(t){return this.set("min",t)}},eO=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="NodeStructuralMetadata",this.parentTypes=[te.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{class:"",properties:{}})}getClass(){return this.get("class")}setClass(t){return this.set("class",t)}getProperties(){return this.get("properties")}setProperties(t){return this.set("properties",t)}},tO=class extends Ne{static EXTENSION_NAME=xe;init(){this.extensionName=xe,this.propertyType="MeshPrimitiveStructuralMetadata",this.parentTypes=[te.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{propertyTextures:new mt,propertyAttributes:new mt})}listPropertyTextures(){return this.listRefs("propertyTextures")}addPropertyTexture(t){return this.addRef("propertyTextures",t)}removePropertyTexture(t){return this.removeRef("propertyTextures",t)}listPropertyAttributes(){return this.listRefs("propertyAttributes")}addPropertyAttribute(t){return this.addRef("propertyAttributes",t)}removePropertyAttribute(t){return this.removeRef("propertyAttributes",t)}},nO=class extends ke{extensionName=xe;static EXTENSION_NAME=xe;prewriteTypes=[te.BUFFER];prereadTypes=[te.SCENE];createStructuralMetadata(){return new VN(this.document.getGraph())}createSchema(){return new jN(this.document.getGraph())}createClass(){return new GN(this.document.getGraph())}createClassProperty(){return new HN(this.document.getGraph())}createEnum(){return new qN(this.document.getGraph())}createEnumValue(){return new WN(this.document.getGraph())}createPropertyTable(){return new KN(this.document.getGraph())}createPropertyTableProperty(){return new ZN(this.document.getGraph())}createPropertyTexture(){return new XN(this.document.getGraph())}createPropertyTextureProperty(){return new JN(this.document.getGraph())}createPropertyAttribute(){return new YN(this.document.getGraph())}createPropertyAttributeProperty(){return new QN(this.document.getGraph())}createNodeStructuralMetadata(){return new eO(this.document.getGraph())}createMeshPrimitiveStructuralMetadata(){return new tO(this.document.getGraph())}read(t){return this}preread(t){let e=this.document.getRoot(),{json:r}=t.jsonDoc,i=r.extensions[xe],n=rO(this,t,i);return e.setExtension(xe,n),(r.meshes||[]).forEach((s,o)=>{let a=t.meshes[o].listPrimitives();(s.primitives||[]).forEach((c,l)=>{let u=a[l];this._readPrimitive(n,u,c);});}),(r.nodes||[]).forEach((s,o)=>{this._readNode(t.nodes[o],s);}),this}_readPrimitive(t,e,r){if(!r.extensions||!r.extensions.EXT_structural_metadata)return;let i=this.createMeshPrimitiveStructuralMetadata(),n=r.extensions[xe],s=t.listPropertyTextures(),o=n.propertyTextures||[];for(let l of o){let u=s[l];i.addPropertyTexture(u);}let a=t.listPropertyAttributes(),c=n.propertyAttributes||[];for(let l of c){let u=a[l];i.addPropertyAttribute(u);}e.setExtension(xe,i);}_readNode(t,e){if(!e.extensions||!e.extensions.EXT_structural_metadata)return;let r=e.extensions[xe],i=this.createNodeStructuralMetadata().setClass(r.class).setProperties(r.properties);t.setExtension(xe,i);}write(t){let e=this.document.getRoot(),r=e.getExtension(xe);if(!r)return this;let i=t.jsonDoc.json,n=mO(t,r);i.extensions=i.extensions||{},i.extensions[xe]=n;let s=e.listMeshes(),o=i.meshes;if(o)for(let l of s){let u=o[t.meshIndexMap.get(l)];l.listPrimitives().forEach((d,f)=>{let p=u.primitives[f];this._writePrimitive(r,d,p);});}let a=e.listNodes(),c=i.nodes;if(c)for(let l of a){let u=t.nodeIndexMap.get(l);this._writeNode(l,c[u]);}return this}_writePrimitive(t,e,r){let i=e.getExtension(xe);if(!i)return;let n=t.listPropertyTextures(),s=t.listPropertyAttributes(),o,a,c=i.listPropertyTextures();if(c.length>0){o=[];for(let d of c){let f=n.indexOf(d);if(f>=0)o.push(f);else throw new Error(`${xe}: Invalid property texture in mesh primitive`)}}let l=i.listPropertyAttributes();if(l.length>0){a=[];for(let d of l){let f=s.indexOf(d);if(f>=0)a.push(f);else throw new Error(`${xe}: Invalid property attribute in mesh primitive`)}}let u={propertyTextures:o,propertyAttributes:a};r.extensions=r.extensions||{},r.extensions[xe]=u;}_writeNode(t,e){let r=t.getExtension("EXT_structural_metadata");r&&(e.extensions=e.extensions||{},e.extensions[xe]={class:r.getClass(),properties:r.getProperties()});}prewrite(t,e){return e===te.BUFFER&&this._prewriteBuffers(t),this}_prewriteBuffers(t){let e=this.document,r=e.getRoot().getExtension(xe);t.jsonDoc.json.bufferViews||=[];for(let i of r.listPropertyTables())for(let n of i.listPropertyValues()){let s=MO(e,t);s.push(n.getValues());let o=n.getArrayOffsets();o&&s.push(o);let a=n.getStringOffsets();a&&s.push(a);}}};function rO(t,e,r){let i=t.createStructuralMetadata();if(r.schema!==void 0){let a=iO(t,r.schema);i.setSchema(a);}else if(r.schemaUri){let a=r.schemaUri;i.setSchemaUri(a);}let n=r.propertyTextures||[];for(let a of n){let c=lO(t,e,a);i.addPropertyTexture(c);}let s=r.propertyTables||[];for(let a of s){let c=dO(t,e,a);i.addPropertyTable(c);}let o=r.propertyAttributes||[];for(let a of o){let c=fO(t,a);i.addPropertyAttribute(c);}return i}function iO(t,e){let r=t.createSchema().setId(e.id);e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.version!==void 0&&r.setVersion(e.version);let i=e.classes||{};for(let s of Object.keys(i)){let o=i[s];r.setClass(s,sO(t,o));}let n=e.enums||{};for(let s of Object.keys(n))r.setEnum(s,aO(t,n[s]));return r}function sO(t,e){let r=t.createClass();e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description);let i=e.properties||{};for(let n of Object.keys(i)){let s=oO(t,i[n]);r.setProperty(n,s);}return r}function oO(t,e){let r=t.createClassProperty().setType(e.type);return e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.componentType!==void 0&&r.setComponentType(e.componentType),e.enumType!==void 0&&r.setEnumType(e.enumType),e.array!==void 0&&r.setArray(e.array),e.count!==void 0&&r.setCount(e.count),e.normalized!==void 0&&r.setNormalized(e.normalized),e.offset!==void 0&&r.setOffset(e.offset),e.scale!==void 0&&r.setScale(e.scale),e.max!==void 0&&r.setMax(e.max),e.min!==void 0&&r.setMin(e.min),e.required!==void 0&&r.setRequired(e.required),e.noData!==void 0&&r.setNoData(e.noData),e.default!==void 0&&r.setDefault(e.default),r}function aO(t,e){let r=t.createEnum();e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.valueType!==void 0&&r.setValueType(e.valueType);let i=e.values||{};for(let n of i)r.addEnumValue(cO(t,n));return r}function cO(t,e){let r=t.createEnumValue();return e.name!==void 0&&r.setName(e.name),e.description!==void 0&&r.setDescription(e.description),e.value!==void 0&&r.setValue(e.value),r}function lO(t,e,r){let i=t.createPropertyTexture();i.setClass(r.class),r.name!==void 0&&i.setName(r.name);let n=r.properties||{};for(let s of Object.keys(n)){let o=uO(t,e,n[s]);i.setProperty(s,o);}return i}function uO(t,e,r){let i=t.createPropertyTextureProperty(),n=e.jsonDoc.json.textures||[];r.channels&&i.setChannels(r.channels);let s=n[r.index].source;if(s!==void 0){let o=e.textures[s];i.setTexture(o);let a=i.getTextureInfo();a&&e.setTextureInfo(a,r);}return r.offset!==void 0&&i.setOffset(r.offset),r.scale!==void 0&&i.setScale(r.scale),r.max!==void 0&&i.setMax(r.max),r.min!==void 0&&i.setMin(r.min),i}function dO(t,e,r){let i=t.createPropertyTable().setClass(r.class).setCount(r.count);r.name!==void 0&&i.setName(r.name);let n=r.properties||{};for(let s of Object.keys(n)){let o=hO(t,e,n[s]);i.setProperty(s,o);}return i}function hO(t,e,r){let i=t.createPropertyTableProperty(),n=my(e,r.values);if(i.setValues(n),r.arrayOffsets!==void 0){let s=my(e,r.arrayOffsets);i.setArrayOffsets(s);}if(r.stringOffsets!==void 0){let s=my(e,r.stringOffsets);i.setStringOffsets(s);}return r.arrayOffsetType!==void 0&&i.setArrayOffsetType(r.arrayOffsetType),r.stringOffsetType!==void 0&&i.setStringOffsetType(r.stringOffsetType),r.offset!==void 0&&i.setOffset(r.offset),r.scale!==void 0&&i.setScale(r.scale),r.max!==void 0&&i.setMax(r.max),r.min!==void 0&&i.setMin(r.min),i}function fO(t,e){let r=t.createPropertyAttribute();r.setClass(e.class),e.name!==void 0&&r.setName(e.name);let i=e.properties||{};for(let n of Object.keys(i)){let s=pO(t,i[n]);r.setProperty(n,s);}return r}function pO(t,e){let r=t.createPropertyAttributeProperty();return r.setAttribute(e.attribute),e.offset!==void 0&&r.setOffset(e.offset),e.scale!==void 0&&r.setScale(e.scale),e.max!==void 0&&r.setMax(e.max),e.min!==void 0&&r.setMin(e.min),r}function mO(t,e){let r={},i=e.getSchema();i&&(r.schema=gO(i));let n=e.getSchemaUri();n&&(r.schemaUri=n);let s=e.listPropertyTables();if(s.length>0){let c=[];for(let l of s){let u=xO(t,l);c.push(u);}r.propertyTables=c;}let o=e.listPropertyTextures();if(o.length>0){let c=[];for(let l of o){let u=EO(t,l);c.push(u);}r.propertyTextures=c;}let a=e.listPropertyAttributes();if(a.length>0){let c=[];for(let l of a){let u=TO(l);c.push(u);}r.propertyAttributes=c;}return r}function gO(t){let e={id:t.getId()},r=t.listClassKeys();if(r.length>0){e.classes={};for(let n of r){let s=_O(t.getClass(n));e.classes[n]=s;}}let i=t.listEnumKeys();if(i.length>0){e.enums={};for(let n of i){let s=yO(t.getEnum(n));e.enums[n]=s;}}return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getVersion()&&(e.version=t.getVersion()),e}function _O(t){let e={},r=t.listPropertyKeys();if(r.length>0){e.properties={};for(let i of r){let n=t.getProperty(i);e.properties[i]=vO(n);}}return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),e}function vO(t){let e={type:t.getType()};return t.getArray()&&(e.array=t.getArray()),t.getNormalized()&&(e.normalized=t.getNormalized()),t.getRequired()&&(e.required=t.getRequired()),t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getComponentType()!=null&&(e.componentType=t.getComponentType()),t.getEnumType()!=null&&(e.enumType=t.getEnumType()),t.getCount()!=null&&(e.count=t.getCount()),t.getOffset()!=null&&(e.offset=t.getOffset()),t.getScale()!=null&&(e.scale=t.getScale()),t.getMax()!=null&&(e.max=t.getMax()),t.getMin()!=null&&(e.min=t.getMin()),t.getNoData()!=null&&(e.noData=t.getNoData()),t.getDefault()!=null&&(e.default=t.getDefault()),e}function yO(t){let e={values:t.listValues().map(SO)};return t.getName()&&(e.name=t.getName()),t.getDescription()&&(e.description=t.getDescription()),t.getValueType()!=="UINT16"&&(e.valueType=t.getValueType()),e}function SO(t){let e={name:t.getName(),value:t.getValue()};return t.getDescription()&&(e.description=t.getDescription()),e}function xO(t,e){let r={class:e.getClass(),count:e.getCount()};e.getName()&&(r.name=e.getName());let i=e.listPropertyKeys();if(i.length>0){r.properties={};for(let n of i){let s=bO(t,e.getProperty(n));r.properties[n]=s;}}return r}function bO(t,e){let r=e.getValues(),i={values:t.otherBufferViewsIndexMap.get(r)};if(e.getArrayOffsets()){let n=e.getArrayOffsets();i.arrayOffsets=t.otherBufferViewsIndexMap.get(n);}if(e.getStringOffsets()){let n=e.getStringOffsets();i.stringOffsets=t.otherBufferViewsIndexMap.get(n);}return e.getArrayOffsetType()!=null&&(i.arrayOffsetType=e.getArrayOffsetType()),e.getStringOffsetType()!=null&&(i.stringOffsetType=e.getStringOffsetType()),e.getOffset()!=null&&(i.offset=e.getOffset()),e.getScale()!=null&&(i.scale=e.getScale()),e.getMax()!=null&&(i.max=e.getMax()),e.getMin()!=null&&(i.min=e.getMin()),i}function TO(t){let e={class:t.getClass()};t.getName()&&(e.name=t.getName());let r=t.listPropertyKeys();if(r.length>0){e.properties={};for(let i of r){let n=RO(t.getProperty(i));e.properties[i]=n;}}return e}function RO(t){let e={attribute:t.getAttribute()};return t.getOffset()!=null&&(e.offset=t.getOffset()),t.getScale()!=null&&(e.scale=t.getScale()),t.getMax()!=null&&(e.max=t.getMax()),t.getMin()!=null&&(e.min=t.getMin()),e}function EO(t,e){let r={class:e.getClass()};e.getName()&&(r.name=e.getName());let i=e.listPropertyKeys();if(i.length>0){r.properties={};for(let n of i){let s=wO(t,e.getProperty(n));r.properties[n]=s;}}return r}function wO(t,e){let r=e.getTexture(),i=e.getTextureInfo(),n=e.getChannels(),s=t.createTextureInfoDef(r,i);return Ke.eq(n,[0])||(s.channels=n),e.getOffset()!=null&&(s.offset=e.getOffset()),e.getScale()!=null&&(s.scale=e.getScale()),e.getMax()!=null&&(s.max=e.getMax()),e.getMin()!=null&&(s.min=e.getMin()),s}function my(t,e){let r=t.jsonDoc,i=r.json.buffers||[],n=(r.json.bufferViews||[])[e],s=i[n.buffer],o=s.uri?r.resources[s.uri]:r.resources[br],a=n.byteOffset||0,c=n.byteLength;return o.slice(a,a+c)}function MO(t,e){let r=t.getRoot().listBuffers()[0],i=e.otherBufferViews.get(r);return i||(i=[],e.otherBufferViews.set(r,i)),i}var AO=class{match(t){return t.length>=12&&we.decodeText(t.slice(4,12))==="ftypavif"}getSize(t){if(!this.match(t))return null;let e=new DataView(t.buffer,t.byteOffset,t.byteLength),r=LR(e,0);if(!r)return null;let i=r.end;for(;r=LR(e,i);)if(r.type==="meta")i=r.start+4;else if(r.type==="iprp"||r.type==="ipco")i=r.start;else {if(r.type==="ispe")return [e.getUint32(r.start+4),e.getUint32(r.start+8)];if(r.type==="mdat")break;i=r.end;}return null}getChannels(t){return 4}},IO=class extends ke{extensionName=gh;prereadTypes=[te.TEXTURE];static EXTENSION_NAME=gh;static register(){Tn.registerFormat("image/avif",new AO);}preread(t){return (t.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions.EXT_texture_avif&&(e.source=e.extensions[gh].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/avif"){let i=t.imageIndexMap.get(r);(e.json.textures||[]).forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[gh]={source:n.source},delete n.source);});}}),this}};function LR(t,e){if(t.byteLength<4+e)return null;let r=t.getUint32(e);return t.byteLength<r+e||r<8?null:{type:we.decodeText(new Uint8Array(t.buffer,t.byteOffset+e+4,4)),start:e+8,end:e+r}}var CO=class{match(t){return t.length>=12&&t[8]===87&&t[9]===69&&t[10]===66&&t[11]===80}getSize(t){let e=we.decodeText(t.slice(0,4)),r=we.decodeText(t.slice(8,12));if(e!=="RIFF"||r!=="WEBP")return null;let i=new DataView(t.buffer,t.byteOffset),n=12;for(;n<i.byteLength;){let s=we.decodeText(new Uint8Array([i.getUint8(n),i.getUint8(n+1),i.getUint8(n+2),i.getUint8(n+3)])),o=i.getUint32(n+4,true);if(s==="VP8 ")return [i.getInt16(n+14,true)&16383,i.getInt16(n+16,true)&16383];if(s==="VP8L"){let a=i.getUint8(n+9),c=i.getUint8(n+10),l=i.getUint8(n+11),u=i.getUint8(n+12);return [1+((c&63)<<8|a),1+((u&15)<<10|l<<2|(c&192)>>6)]}n+=8+o+o%2;}return null}getChannels(t){return 4}},PO=class extends ke{extensionName=mh;prereadTypes=[te.TEXTURE];static EXTENSION_NAME=mh;static register(){Tn.registerFormat("image/webp",new CO);}preread(t){return (t.jsonDoc.json.textures||[]).forEach(e=>{e.extensions&&e.extensions.EXT_texture_webp&&(e.source=e.extensions[mh].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/webp"){let i=t.imageIndexMap.get(r);(e.json.textures||[]).forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[mh]={source:n.source},delete n.source);});}}),this}},kR=SN,NO=class extends ke{extensionName=kR;static EXTENSION_NAME=kR;read(t){return this}write(t){return this}},UR=xN,OO=class extends ke{extensionName=UR;static EXTENSION_NAME=UR;read(t){return this}write(t){return this}},ct,QR,eE;function zO(t,e){let r=new ct.DecoderBuffer;try{if(r.Init(e,e.length),t.GetEncodedGeometryType(r)!==ct.TRIANGULAR_MESH)throw new Error(`[${tt}] Unknown geometry type.`);let i=new ct.Mesh;if(!t.DecodeBufferToMesh(r,i).ok()||i.ptr===0)throw new Error(`[${tt}] Decoding failure.`);return i}finally{ct.destroy(r);}}function $O(t,e){let r=e.num_faces()*3,i,n;if(e.num_points()<=65534){let s=r*Uint16Array.BYTES_PER_ELEMENT;i=ct._malloc(s),t.GetTrianglesUInt16Array(e,s,i),n=new Uint16Array(ct.HEAPU16.buffer,i,r).slice();}else {let s=r*Uint32Array.BYTES_PER_ELEMENT;i=ct._malloc(s),t.GetTrianglesUInt32Array(e,s,i),n=new Uint32Array(ct.HEAPU32.buffer,i,r).slice();}return ct._free(i),n}function DO(t,e,r,i){let n=eE[i.componentType],s=QR[i.componentType],o=r.num_components(),a=e.num_points()*o,c=a*s.BYTES_PER_ELEMENT,l=ct._malloc(c);t.GetAttributeDataArrayForAllPoints(e,r,n,c,l);let u=new s(ct.HEAPF32.buffer,l,a).slice();return ct._free(l),u}function LO(t){ct=t,QR={[fe.ComponentType.FLOAT]:Float32Array,[fe.ComponentType.UNSIGNED_INT]:Uint32Array,[fe.ComponentType.UNSIGNED_SHORT]:Uint16Array,[fe.ComponentType.UNSIGNED_BYTE]:Uint8Array,[fe.ComponentType.SHORT]:Int16Array,[fe.ComponentType.BYTE]:Int8Array},eE={[fe.ComponentType.FLOAT]:ct.DT_FLOAT32,[fe.ComponentType.UNSIGNED_INT]:ct.DT_UINT32,[fe.ComponentType.UNSIGNED_SHORT]:ct.DT_UINT16,[fe.ComponentType.UNSIGNED_BYTE]:ct.DT_UINT8,[fe.ComponentType.SHORT]:ct.DT_INT16,[fe.ComponentType.BYTE]:ct.DT_INT8};}var Yt,kO=(function(t){return t[t.EDGEBREAKER=1]="EDGEBREAKER",t[t.SEQUENTIAL=0]="SEQUENTIAL",t})({}),tE={POSITION:14,NORMAL:10,COLOR:8,TEX_COORD:12,GENERIC:12},FR={decodeSpeed:5,encodeSpeed:5,method:1,quantizationBits:tE,quantizationVolume:"mesh"};function UO(t){Yt=t;}function FO(t,e=FR){let r={...FR,...e};r.quantizationBits={...tE,...e.quantizationBits};let i=new Yt.MeshBuilder,n=new Yt.Mesh,s=new Yt.ExpertEncoder(n),o={},a=new Yt.DracoInt8Array,c=t.listTargets().length>0,l=false;for(let m of t.listSemantics()){let S=t.getAttribute(m);if(S.getSparse()){l=true;continue}let h=BO(m),v=VO(i,S.getComponentType(),n,Yt[h],S.getCount(),S.getElementSize(),S.getArray());if(v===-1)throw new Error(`Error compressing "${m}" attribute.`);if(o[m]=v,r.quantizationVolume==="mesh"||m!=="POSITION")s.SetAttributeQuantization(v,r.quantizationBits[h]);else if(typeof r.quantizationVolume=="object"){let{quantizationVolume:_}=r,y=Math.max(_.max[0]-_.min[0],_.max[1]-_.min[1],_.max[2]-_.min[2]);s.SetAttributeExplicitQuantization(v,r.quantizationBits[h],S.getElementSize(),_.min,y);}else throw new Error("Invalid quantization volume state.")}let u=t.getIndices();if(!u)throw new yy("Primitive must have indices.");i.AddFacesToMesh(n,u.getCount()/3,u.getArray()),s.SetSpeedOptions(r.encodeSpeed,r.decodeSpeed),s.SetTrackEncodedProperties(true),r.method===0||c||l?s.SetEncodingMethod(Yt.MESH_SEQUENTIAL_ENCODING):s.SetEncodingMethod(Yt.MESH_EDGEBREAKER_ENCODING);let d=s.EncodeToDracoBuffer(!(c||l),a);if(d<=0)throw new yy("Error applying Draco compression.");let f=new Uint8Array(d);for(let m=0;m<d;++m)f[m]=a.GetValue(m);let p=s.GetNumberOfEncodedPoints(),g=s.GetNumberOfEncodedFaces()*3;return Yt.destroy(a),Yt.destroy(n),Yt.destroy(i),Yt.destroy(s),{numVertices:p,numIndices:g,data:f,attributeIDs:o}}function BO(t){return t==="POSITION"?"POSITION":t==="NORMAL"?"NORMAL":t.startsWith("COLOR_")?"COLOR":t.startsWith("TEXCOORD_")?"TEX_COORD":"GENERIC"}function VO(t,e,r,i,n,s,o){switch(e){case fe.ComponentType.UNSIGNED_BYTE:return t.AddUInt8Attribute(r,i,n,s,o);case fe.ComponentType.BYTE:return t.AddInt8Attribute(r,i,n,s,o);case fe.ComponentType.UNSIGNED_SHORT:return t.AddUInt16Attribute(r,i,n,s,o);case fe.ComponentType.SHORT:return t.AddInt16Attribute(r,i,n,s,o);case fe.ComponentType.UNSIGNED_INT:return t.AddUInt32Attribute(r,i,n,s,o);case fe.ComponentType.FLOAT:return t.AddFloatAttribute(r,i,n,s,o);default:throw new Error(`Unexpected component type, "${e}".`)}}var yy=class extends Error{},jO=class extends ke{extensionName=tt;prereadTypes=[te.PRIMITIVE];prewriteTypes=[te.ACCESSOR];readDependencies=["draco3d.decoder"];writeDependencies=["draco3d.encoder"];static EXTENSION_NAME=tt;static EncoderMethod=kO;_decoderModule=null;_encoderModule=null;_encoderOptions={};install(t,e){return t==="draco3d.decoder"&&(this._decoderModule=e,LO(this._decoderModule)),t==="draco3d.encoder"&&(this._encoderModule=e,UO(this._encoderModule)),this}setEncoderOptions(t){return this._encoderOptions=t,this}preread(t){if(!this._decoderModule)throw new Error(`[${tt}] Please install extension dependency, "draco3d.decoder".`);let e=this.document.getLogger(),r=t.jsonDoc,i=new Map;try{let n=r.json.meshes||[];for(let s of n)for(let o of s.primitives){if(!o.extensions||!o.extensions.KHR_draco_mesh_compression)continue;let a=o.extensions[tt],[c,l]=i.get(a.bufferView)||[];if(!l||!c){let u=r.json.bufferViews[a.bufferView],d=r.json.buffers[u.buffer],f=d.uri?r.resources[d.uri]:r.resources[br],p=u.byteOffset||0,g=u.byteLength,m=we.toView(f,p,g);c=new this._decoderModule.Decoder,l=zO(c,m),i.set(a.bufferView,[c,l]),e.debug(`[${tt}] Decompressed ${m.byteLength} bytes.`);}for(let u in a.attributes){let d=t.jsonDoc.json.accessors[o.attributes[u]],f=c.GetAttributeByUniqueId(l,a.attributes[u]),p=DO(c,l,f,d);t.accessors[o.attributes[u]].setArray(p);}o.indices!==void 0&&t.accessors[o.indices].setArray($O(c,l));}}finally{for(let[n,s]of Array.from(i.values()))this._decoderModule.destroy(n),this._decoderModule.destroy(s);}return this}read(t){return this}prewrite(t,e){if(!this._encoderModule)throw new Error(`[${tt}] Please install extension dependency, "draco3d.encoder".`);let r=this.document.getLogger();r.debug(`[${tt}] Compression options: ${JSON.stringify(this._encoderOptions)}`);let i=GO(this.document),n=new Map,s="mesh";this._encoderOptions.quantizationVolume==="scene"&&(this.document.getRoot().listScenes().length!==1?r.warn(`[${tt}]: quantizationVolume=scene requires exactly 1 scene.`):s=pR(this.document.getRoot().listScenes().pop()));for(let o of Array.from(i.keys())){let a=i.get(o);if(!a)throw new Error("Unexpected primitive.");if(n.has(a)){n.set(a,n.get(a));continue}let c=o.getIndices(),l=t.jsonDoc.json.accessors,u;try{u=FO(o,{...this._encoderOptions,quantizationVolume:s});}catch(p){if(p instanceof yy){r.warn(`[${tt}]: ${p.message} Skipping primitive compression.`);continue}throw p}n.set(a,u);let d=t.createAccessorDef(c);d.count=u.numIndices,t.accessorIndexMap.set(c,l.length),l.push(d),u.numVertices>65534&&fe.getComponentSize(d.componentType)<=2?d.componentType=fe.ComponentType.UNSIGNED_INT:u.numVertices>254&&fe.getComponentSize(d.componentType)<=1&&(d.componentType=fe.ComponentType.UNSIGNED_SHORT);for(let p of o.listSemantics()){let g=o.getAttribute(p);if(u.attributeIDs[p]===void 0)continue;let m=t.createAccessorDef(g);m.count=u.numVertices,t.accessorIndexMap.set(g,l.length),l.push(m);}let f=o.getAttribute("POSITION").getBuffer()||this.document.getRoot().listBuffers()[0];t.otherBufferViews.has(f)||t.otherBufferViews.set(f,[]),t.otherBufferViews.get(f).push(u.data);}return r.debug(`[${tt}] Compressed ${i.size} primitives.`),t.extensionData[tt]={primitiveHashMap:i,primitiveEncodingMap:n},this}write(t){let e=t.extensionData[tt];for(let r of this.document.getRoot().listMeshes()){let i=t.jsonDoc.json.meshes[t.meshIndexMap.get(r)];for(let n=0;n<r.listPrimitives().length;n++){let s=r.listPrimitives()[n],o=i.primitives[n],a=e.primitiveHashMap.get(s);if(!a)continue;let c=e.primitiveEncodingMap.get(a);c&&(o.extensions=o.extensions||{},o.extensions[tt]={bufferView:t.otherBufferViewsIndexMap.get(c.data),attributes:c.attributeIDs});}}if(!e.primitiveHashMap.size){let r=t.jsonDoc.json;r.extensionsUsed=(r.extensionsUsed||[]).filter(i=>i!==tt),r.extensionsRequired=(r.extensionsRequired||[]).filter(i=>i!==tt);}return this}};function GO(t){let e=t.getLogger(),r=new Set,i=new Set,n=0,s=0;for(let d of t.getRoot().listMeshes())for(let f of d.listPrimitives())f.getIndices()?f.getMode()!==Ca.Mode.TRIANGLES?(i.add(f),s++):r.add(f):(i.add(f),n++);n>0&&e.warn(`[${tt}] Skipping Draco compression of ${n} non-indexed primitives.`),s>0&&e.warn(`[${tt}] Skipping Draco compression of ${s} non-TRIANGLES primitives.`);let o=t.getRoot().listAccessors(),a=new Map;for(let d=0;d<o.length;d++)a.set(o[d],d);let c=new Map,l=new Set,u=new Map;for(let d of Array.from(r)){let f=BR(d,a);if(l.has(f)){u.set(d,f);continue}if(c.has(d.getIndices())){let p=d.getIndices(),g=p.clone();a.set(g,t.getRoot().listAccessors().length-1),d.swap(p,g);}for(let p of d.listAttributes())if(c.has(p)){let g=p.clone();a.set(g,t.getRoot().listAccessors().length-1),d.swap(p,g);}f=BR(d,a),l.add(f),u.set(d,f),c.set(d.getIndices(),f);for(let p of d.listAttributes())c.set(p,f);}for(let d of Array.from(c.keys())){let f=new Set(d.listParents().map(p=>p.propertyType));if(f.size!==2||!f.has(te.PRIMITIVE)||!f.has(te.ROOT))throw new Error(`[${tt}] Compressed accessors must only be used as indices or vertex attributes.`)}for(let d of Array.from(r)){let f=u.get(d),p=d.getIndices();if(c.get(p)!==f||d.listAttributes().some(g=>c.get(g)!==f))throw new Error(`[${tt}] Draco primitives must share all, or no, accessors.`)}for(let d of Array.from(i)){let f=d.getIndices();if(c.has(f)||d.listAttributes().some(p=>c.has(p)))throw new Error(`[${tt}] Accessor cannot be shared by compressed and uncompressed primitives.`)}return u}function BR(t,e){let r=[],i=t.getIndices();r.push(e.get(i));for(let n of t.listAttributes())r.push(e.get(n));return r.sort().join("|")}var VR=class nE extends Ne{static EXTENSION_NAME=Un;static Type={POINT:"point",SPOT:"spot",DIRECTIONAL:"directional"};init(){this.extensionName=Un,this.propertyType="Light",this.parentTypes=[te.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{color:[1,1,1],intensity:1,type:nE.Type.POINT,range:null,innerConeAngle:0,outerConeAngle:Math.PI/4})}getColor(){return this.get("color")}setColor(e){return this.set("color",e)}getIntensity(){return this.get("intensity")}setIntensity(e){return this.set("intensity",e)}getType(){return this.get("type")}setType(e){return this.set("type",e)}getRange(){return this.get("range")}setRange(e){return this.set("range",e)}getInnerConeAngle(){return this.get("innerConeAngle")}setInnerConeAngle(e){return this.set("innerConeAngle",e)}getOuterConeAngle(){return this.get("outerConeAngle")}setOuterConeAngle(e){return this.set("outerConeAngle",e)}},HO=class extends ke{extensionName=Un;static EXTENSION_NAME=Un;createLight(t=""){return new VR(this.document.getGraph(),t)}read(t){let e=t.jsonDoc;if(!e.json.extensions||!e.json.extensions.KHR_lights_punctual)return this;let r=(e.json.extensions.KHR_lights_punctual.lights||[]).map(i=>{let n=this.createLight().setName(i.name||"").setType(i.type);return i.extras&&n.setExtras(i.extras),i.color!==void 0&&n.setColor(i.color),i.intensity!==void 0&&n.setIntensity(i.intensity),i.range!==void 0&&n.setRange(i.range),i.spot?.innerConeAngle!==void 0&&n.setInnerConeAngle(i.spot.innerConeAngle),i.spot?.outerConeAngle!==void 0&&n.setOuterConeAngle(i.spot.outerConeAngle),n});return e.json.nodes.forEach((i,n)=>{if(!i.extensions||!i.extensions.KHR_lights_punctual)return;let s=i.extensions[Un];t.nodes[n].setExtension(Un,r[s.light]);}),this}write(t){let e=t.jsonDoc;if(this.properties.size===0)return this;let r=[],i=new Map;for(let n of this.properties){let s=n,o=t.createPropertyDef(n);o.type=s.getType(),Ke.eq(s.getColor(),[1,1,1])||(o.color=s.getColor()),s.getIntensity()!==1&&(o.intensity=s.getIntensity()),s.getRange()!=null&&(o.range=s.getRange()),s.getName()&&(o.name=s.getName()),s.getType()===VR.Type.SPOT&&(o.spot={innerConeAngle:s.getInnerConeAngle(),outerConeAngle:s.getOuterConeAngle()}),r.push(o),i.set(s,r.length-1);}return this.document.getRoot().listNodes().forEach(n=>{let s=n.getExtension(Un);if(s){let o=t.nodeIndexMap.get(n),a=e.json.nodes[o];a.extensions=a.extensions||{},a.extensions[Un]={light:i.get(s)};}}),e.json.extensions=e.json.extensions||{},e.json.extensions[Un]={lights:r},this}},{R:qO,G:WO,B:KO}=hn,ZO=class extends Ne{static EXTENSION_NAME=Er;init(){this.extensionName=Er,this.propertyType="Anisotropy",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{anisotropyStrength:0,anisotropyRotation:0,anisotropyTexture:null,anisotropyTextureInfo:new He(this.graph,"anisotropyTextureInfo")})}getAnisotropyStrength(){return this.get("anisotropyStrength")}setAnisotropyStrength(t){return this.set("anisotropyStrength",t)}getAnisotropyRotation(){return this.get("anisotropyRotation")}setAnisotropyRotation(t){return this.set("anisotropyRotation",t)}getAnisotropyTexture(){return this.getRef("anisotropyTexture")}getAnisotropyTextureInfo(){return this.getRef("anisotropyTexture")?this.getRef("anisotropyTextureInfo"):null}setAnisotropyTexture(t){return this.setRef("anisotropyTexture",t,{channels:qO|WO|KO})}},XO=class extends ke{static EXTENSION_NAME=Er;extensionName=Er;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createAnisotropy(){return new ZO(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_anisotropy){let o=this.createAnisotropy();t.materials[s].setExtension(Er,o);let a=n.extensions[Er];if(a.extras&&o.setExtras(a.extras),a.anisotropyStrength!==void 0&&o.setAnisotropyStrength(a.anisotropyStrength),a.anisotropyRotation!==void 0&&o.setAnisotropyRotation(a.anisotropyRotation),a.anisotropyTexture!==void 0){let c=a.anisotropyTexture,l=t.textures[i[c.index].source];o.setAnisotropyTexture(l),t.setTextureInfo(o.getAnisotropyTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Er);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Er]=o,i.getAnisotropyStrength()>0&&(o.anisotropyStrength=i.getAnisotropyStrength()),i.getAnisotropyRotation()!==0&&(o.anisotropyRotation=i.getAnisotropyRotation()),i.getAnisotropyTexture()){let a=i.getAnisotropyTexture(),c=i.getAnisotropyTextureInfo();o.anisotropyTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:jR,G:GR,B:JO}=hn,YO=class extends Ne{static EXTENSION_NAME=wr;init(){this.extensionName=wr,this.propertyType="Clearcoat",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{clearcoatFactor:0,clearcoatTexture:null,clearcoatTextureInfo:new He(this.graph,"clearcoatTextureInfo"),clearcoatRoughnessFactor:0,clearcoatRoughnessTexture:null,clearcoatRoughnessTextureInfo:new He(this.graph,"clearcoatRoughnessTextureInfo"),clearcoatNormalScale:1,clearcoatNormalTexture:null,clearcoatNormalTextureInfo:new He(this.graph,"clearcoatNormalTextureInfo")})}getClearcoatFactor(){return this.get("clearcoatFactor")}setClearcoatFactor(t){return this.set("clearcoatFactor",t)}getClearcoatTexture(){return this.getRef("clearcoatTexture")}getClearcoatTextureInfo(){return this.getRef("clearcoatTexture")?this.getRef("clearcoatTextureInfo"):null}setClearcoatTexture(t){return this.setRef("clearcoatTexture",t,{channels:jR})}getClearcoatRoughnessFactor(){return this.get("clearcoatRoughnessFactor")}setClearcoatRoughnessFactor(t){return this.set("clearcoatRoughnessFactor",t)}getClearcoatRoughnessTexture(){return this.getRef("clearcoatRoughnessTexture")}getClearcoatRoughnessTextureInfo(){return this.getRef("clearcoatRoughnessTexture")?this.getRef("clearcoatRoughnessTextureInfo"):null}setClearcoatRoughnessTexture(t){return this.setRef("clearcoatRoughnessTexture",t,{channels:GR})}getClearcoatNormalScale(){return this.get("clearcoatNormalScale")}setClearcoatNormalScale(t){return this.set("clearcoatNormalScale",t)}getClearcoatNormalTexture(){return this.getRef("clearcoatNormalTexture")}getClearcoatNormalTextureInfo(){return this.getRef("clearcoatNormalTexture")?this.getRef("clearcoatNormalTextureInfo"):null}setClearcoatNormalTexture(t){return this.setRef("clearcoatNormalTexture",t,{channels:jR|GR|JO})}},QO=class extends ke{static EXTENSION_NAME=wr;extensionName=wr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createClearcoat(){return new YO(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_clearcoat){let o=this.createClearcoat();t.materials[s].setExtension(wr,o);let a=n.extensions[wr];if(a.extras&&o.setExtras(a.extras),a.clearcoatFactor!==void 0&&o.setClearcoatFactor(a.clearcoatFactor),a.clearcoatRoughnessFactor!==void 0&&o.setClearcoatRoughnessFactor(a.clearcoatRoughnessFactor),a.clearcoatTexture!==void 0){let c=a.clearcoatTexture,l=t.textures[i[c.index].source];o.setClearcoatTexture(l),t.setTextureInfo(o.getClearcoatTextureInfo(),c);}if(a.clearcoatRoughnessTexture!==void 0){let c=a.clearcoatRoughnessTexture,l=t.textures[i[c.index].source];o.setClearcoatRoughnessTexture(l),t.setTextureInfo(o.getClearcoatRoughnessTextureInfo(),c);}if(a.clearcoatNormalTexture!==void 0){let c=a.clearcoatNormalTexture,l=t.textures[i[c.index].source];o.setClearcoatNormalTexture(l),t.setTextureInfo(o.getClearcoatNormalTextureInfo(),c),c.scale!==void 0&&o.setClearcoatNormalScale(c.scale);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(wr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[wr]=o,o.clearcoatFactor=i.getClearcoatFactor(),o.clearcoatRoughnessFactor=i.getClearcoatRoughnessFactor(),i.getClearcoatTexture()){let a=i.getClearcoatTexture(),c=i.getClearcoatTextureInfo();o.clearcoatTexture=t.createTextureInfoDef(a,c);}if(i.getClearcoatRoughnessTexture()){let a=i.getClearcoatRoughnessTexture(),c=i.getClearcoatRoughnessTextureInfo();o.clearcoatRoughnessTexture=t.createTextureInfoDef(a,c);}if(i.getClearcoatNormalTexture()){let a=i.getClearcoatNormalTexture(),c=i.getClearcoatNormalTextureInfo();o.clearcoatNormalTexture=t.createTextureInfoDef(a,c),i.getClearcoatNormalScale()!==1&&(o.clearcoatNormalTexture.scale=i.getClearcoatNormalScale());}}}),this}},{R:ez,G:tz,B:nz,A:rz}=hn,iz=class extends Ne{static EXTENSION_NAME=Mr;init(){this.extensionName=Mr,this.propertyType="DiffuseTransmission",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{diffuseTransmissionFactor:0,diffuseTransmissionTexture:null,diffuseTransmissionTextureInfo:new He(this.graph,"diffuseTransmissionTextureInfo"),diffuseTransmissionColorFactor:[1,1,1],diffuseTransmissionColorTexture:null,diffuseTransmissionColorTextureInfo:new He(this.graph,"diffuseTransmissionColorTextureInfo")})}getDiffuseTransmissionFactor(){return this.get("diffuseTransmissionFactor")}setDiffuseTransmissionFactor(t){return this.set("diffuseTransmissionFactor",t)}getDiffuseTransmissionTexture(){return this.getRef("diffuseTransmissionTexture")}getDiffuseTransmissionTextureInfo(){return this.getRef("diffuseTransmissionTexture")?this.getRef("diffuseTransmissionTextureInfo"):null}setDiffuseTransmissionTexture(t){return this.setRef("diffuseTransmissionTexture",t,{channels:rz})}getDiffuseTransmissionColorFactor(){return this.get("diffuseTransmissionColorFactor")}setDiffuseTransmissionColorFactor(t){return this.set("diffuseTransmissionColorFactor",t)}getDiffuseTransmissionColorTexture(){return this.getRef("diffuseTransmissionColorTexture")}getDiffuseTransmissionColorTextureInfo(){return this.getRef("diffuseTransmissionColorTexture")?this.getRef("diffuseTransmissionColorTextureInfo"):null}setDiffuseTransmissionColorTexture(t){return this.setRef("diffuseTransmissionColorTexture",t,{channels:ez|tz|nz})}},sz=class extends ke{extensionName=Mr;static EXTENSION_NAME=Mr;createDiffuseTransmission(){return new iz(this.document.getGraph())}read(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_diffuse_transmission){let o=this.createDiffuseTransmission();t.materials[s].setExtension(Mr,o);let a=n.extensions[Mr];if(a.extras&&o.setExtras(a.extras),a.diffuseTransmissionFactor!==void 0&&o.setDiffuseTransmissionFactor(a.diffuseTransmissionFactor),a.diffuseTransmissionColorFactor!==void 0&&o.setDiffuseTransmissionColorFactor(a.diffuseTransmissionColorFactor),a.diffuseTransmissionTexture!==void 0){let c=a.diffuseTransmissionTexture,l=t.textures[i[c.index].source];o.setDiffuseTransmissionTexture(l),t.setTextureInfo(o.getDiffuseTransmissionTextureInfo(),c);}if(a.diffuseTransmissionColorTexture!==void 0){let c=a.diffuseTransmissionColorTexture,l=t.textures[i[c.index].source];o.setDiffuseTransmissionColorTexture(l),t.setTextureInfo(o.getDiffuseTransmissionColorTextureInfo(),c);}}}),this}write(t){let e=t.jsonDoc;for(let r of this.document.getRoot().listMaterials()){let i=r.getExtension(Mr);if(!i)continue;let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Mr]=o,o.diffuseTransmissionFactor=i.getDiffuseTransmissionFactor(),o.diffuseTransmissionColorFactor=i.getDiffuseTransmissionColorFactor(),i.getDiffuseTransmissionTexture()){let a=i.getDiffuseTransmissionTexture(),c=i.getDiffuseTransmissionTextureInfo();o.diffuseTransmissionTexture=t.createTextureInfoDef(a,c);}if(i.getDiffuseTransmissionColorTexture()){let a=i.getDiffuseTransmissionColorTexture(),c=i.getDiffuseTransmissionColorTextureInfo();o.diffuseTransmissionColorTexture=t.createTextureInfoDef(a,c);}}return this}},oz=class extends Ne{static EXTENSION_NAME=Ar;init(){this.extensionName=Ar,this.propertyType="Dispersion",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{dispersion:0})}getDispersion(){return this.get("dispersion")}setDispersion(t){return this.set("dispersion",t)}},az=class extends ke{static EXTENSION_NAME=Ar;extensionName=Ar;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createDispersion(){return new oz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_dispersion){let i=this.createDispersion();t.materials[r].setExtension(Ar,i);let n=e.extensions[Ar];n.extras&&i.setExtras(n.extras),n.dispersion!==void 0&&i.setDispersion(n.dispersion);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Ar);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Ar]=o,o.dispersion=i.getDispersion();}}),this}},cz=class extends Ne{static EXTENSION_NAME=Ir;init(){this.extensionName=Ir,this.propertyType="EmissiveStrength",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{emissiveStrength:1})}getEmissiveStrength(){return this.get("emissiveStrength")}setEmissiveStrength(t){return this.set("emissiveStrength",t)}},lz=class extends ke{static EXTENSION_NAME=Ir;extensionName=Ir;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createEmissiveStrength(){return new cz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_emissive_strength){let i=this.createEmissiveStrength();t.materials[r].setExtension(Ir,i);let n=e.extensions[Ir];n.extras&&i.setExtras(n.extras),n.emissiveStrength!==void 0&&i.setEmissiveStrength(n.emissiveStrength);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Ir);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Ir]=o,o.emissiveStrength=i.getEmissiveStrength();}}),this}},uz=class extends Ne{static EXTENSION_NAME=Cr;init(){this.extensionName=Cr,this.propertyType="IOR",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{ior:1.5})}getIOR(){return this.get("ior")}setIOR(t){return this.set("ior",t)}},dz=class extends ke{static EXTENSION_NAME=Cr;extensionName=Cr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createIOR(){return new uz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_materials_ior){let i=this.createIOR();t.materials[r].setExtension(Cr,i);let n=e.extensions[Cr];n.extras&&i.setExtras(n.extras),n.ior!==void 0&&i.setIOR(n.ior);}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Cr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);s.extensions=s.extensions||{},s.extensions[Cr]=o,o.ior=i.getIOR();}}),this}},{R:hz,G:fz}=hn,pz=class extends Ne{static EXTENSION_NAME=Pr;init(){this.extensionName=Pr,this.propertyType="Iridescence",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{iridescenceFactor:0,iridescenceTexture:null,iridescenceTextureInfo:new He(this.graph,"iridescenceTextureInfo"),iridescenceIOR:1.3,iridescenceThicknessMinimum:100,iridescenceThicknessMaximum:400,iridescenceThicknessTexture:null,iridescenceThicknessTextureInfo:new He(this.graph,"iridescenceThicknessTextureInfo")})}getIridescenceFactor(){return this.get("iridescenceFactor")}setIridescenceFactor(t){return this.set("iridescenceFactor",t)}getIridescenceTexture(){return this.getRef("iridescenceTexture")}getIridescenceTextureInfo(){return this.getRef("iridescenceTexture")?this.getRef("iridescenceTextureInfo"):null}setIridescenceTexture(t){return this.setRef("iridescenceTexture",t,{channels:hz})}getIridescenceIOR(){return this.get("iridescenceIOR")}setIridescenceIOR(t){return this.set("iridescenceIOR",t)}getIridescenceThicknessMinimum(){return this.get("iridescenceThicknessMinimum")}setIridescenceThicknessMinimum(t){return this.set("iridescenceThicknessMinimum",t)}getIridescenceThicknessMaximum(){return this.get("iridescenceThicknessMaximum")}setIridescenceThicknessMaximum(t){return this.set("iridescenceThicknessMaximum",t)}getIridescenceThicknessTexture(){return this.getRef("iridescenceThicknessTexture")}getIridescenceThicknessTextureInfo(){return this.getRef("iridescenceThicknessTexture")?this.getRef("iridescenceThicknessTextureInfo"):null}setIridescenceThicknessTexture(t){return this.setRef("iridescenceThicknessTexture",t,{channels:fz})}},mz=class extends ke{static EXTENSION_NAME=Pr;extensionName=Pr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createIridescence(){return new pz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_iridescence){let o=this.createIridescence();t.materials[s].setExtension(Pr,o);let a=n.extensions[Pr];if(a.extras&&o.setExtras(a.extras),a.iridescenceFactor!==void 0&&o.setIridescenceFactor(a.iridescenceFactor),a.iridescenceIor!==void 0&&o.setIridescenceIOR(a.iridescenceIor),a.iridescenceThicknessMinimum!==void 0&&o.setIridescenceThicknessMinimum(a.iridescenceThicknessMinimum),a.iridescenceThicknessMaximum!==void 0&&o.setIridescenceThicknessMaximum(a.iridescenceThicknessMaximum),a.iridescenceTexture!==void 0){let c=a.iridescenceTexture,l=t.textures[i[c.index].source];o.setIridescenceTexture(l),t.setTextureInfo(o.getIridescenceTextureInfo(),c);}if(a.iridescenceThicknessTexture!==void 0){let c=a.iridescenceThicknessTexture,l=t.textures[i[c.index].source];o.setIridescenceThicknessTexture(l),t.setTextureInfo(o.getIridescenceThicknessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Pr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Pr]=o,i.getIridescenceFactor()>0&&(o.iridescenceFactor=i.getIridescenceFactor()),i.getIridescenceIOR()!==1.3&&(o.iridescenceIor=i.getIridescenceIOR()),i.getIridescenceThicknessMinimum()!==100&&(o.iridescenceThicknessMinimum=i.getIridescenceThicknessMinimum()),i.getIridescenceThicknessMaximum()!==400&&(o.iridescenceThicknessMaximum=i.getIridescenceThicknessMaximum()),i.getIridescenceTexture()){let a=i.getIridescenceTexture(),c=i.getIridescenceTextureInfo();o.iridescenceTexture=t.createTextureInfoDef(a,c);}if(i.getIridescenceThicknessTexture()){let a=i.getIridescenceThicknessTexture(),c=i.getIridescenceThicknessTextureInfo();o.iridescenceThicknessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:HR,G:qR,B:WR,A:KR}=hn,gz=class extends Ne{static EXTENSION_NAME=Nr;init(){this.extensionName=Nr,this.propertyType="PBRSpecularGlossiness",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{diffuseFactor:[1,1,1,1],diffuseTexture:null,diffuseTextureInfo:new He(this.graph,"diffuseTextureInfo"),specularFactor:[1,1,1],glossinessFactor:1,specularGlossinessTexture:null,specularGlossinessTextureInfo:new He(this.graph,"specularGlossinessTextureInfo")})}getDiffuseFactor(){return this.get("diffuseFactor")}setDiffuseFactor(t){return this.set("diffuseFactor",t)}getDiffuseTexture(){return this.getRef("diffuseTexture")}getDiffuseTextureInfo(){return this.getRef("diffuseTexture")?this.getRef("diffuseTextureInfo"):null}setDiffuseTexture(t){return this.setRef("diffuseTexture",t,{channels:HR|qR|WR|KR,isColor:true})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(t){return this.set("specularFactor",t)}getGlossinessFactor(){return this.get("glossinessFactor")}setGlossinessFactor(t){return this.set("glossinessFactor",t)}getSpecularGlossinessTexture(){return this.getRef("specularGlossinessTexture")}getSpecularGlossinessTextureInfo(){return this.getRef("specularGlossinessTexture")?this.getRef("specularGlossinessTextureInfo"):null}setSpecularGlossinessTexture(t){return this.setRef("specularGlossinessTexture",t,{channels:HR|qR|WR|KR})}},_z=class extends ke{static EXTENSION_NAME=Nr;extensionName=Nr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createPBRSpecularGlossiness(){return new gz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_pbrSpecularGlossiness){let o=this.createPBRSpecularGlossiness();t.materials[s].setExtension(Nr,o);let a=n.extensions[Nr];if(a.extras&&o.setExtras(a.extras),a.diffuseFactor!==void 0&&o.setDiffuseFactor(a.diffuseFactor),a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.glossinessFactor!==void 0&&o.setGlossinessFactor(a.glossinessFactor),a.diffuseTexture!==void 0){let c=a.diffuseTexture,l=t.textures[i[c.index].source];o.setDiffuseTexture(l),t.setTextureInfo(o.getDiffuseTextureInfo(),c);}if(a.specularGlossinessTexture!==void 0){let c=a.specularGlossinessTexture,l=t.textures[i[c.index].source];o.setSpecularGlossinessTexture(l),t.setTextureInfo(o.getSpecularGlossinessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Nr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Nr]=o,o.diffuseFactor=i.getDiffuseFactor(),o.specularFactor=i.getSpecularFactor(),o.glossinessFactor=i.getGlossinessFactor(),i.getDiffuseTexture()){let a=i.getDiffuseTexture(),c=i.getDiffuseTextureInfo();o.diffuseTexture=t.createTextureInfoDef(a,c);}if(i.getSpecularGlossinessTexture()){let a=i.getSpecularGlossinessTexture(),c=i.getSpecularGlossinessTextureInfo();o.specularGlossinessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:vz,G:yz,B:Sz,A:xz}=hn,bz=class extends Ne{static EXTENSION_NAME=Or;init(){this.extensionName=Or,this.propertyType="Sheen",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{sheenColorFactor:[0,0,0],sheenColorTexture:null,sheenColorTextureInfo:new He(this.graph,"sheenColorTextureInfo"),sheenRoughnessFactor:0,sheenRoughnessTexture:null,sheenRoughnessTextureInfo:new He(this.graph,"sheenRoughnessTextureInfo")})}getSheenColorFactor(){return this.get("sheenColorFactor")}setSheenColorFactor(t){return this.set("sheenColorFactor",t)}getSheenColorTexture(){return this.getRef("sheenColorTexture")}getSheenColorTextureInfo(){return this.getRef("sheenColorTexture")?this.getRef("sheenColorTextureInfo"):null}setSheenColorTexture(t){return this.setRef("sheenColorTexture",t,{channels:vz|yz|Sz,isColor:true})}getSheenRoughnessFactor(){return this.get("sheenRoughnessFactor")}setSheenRoughnessFactor(t){return this.set("sheenRoughnessFactor",t)}getSheenRoughnessTexture(){return this.getRef("sheenRoughnessTexture")}getSheenRoughnessTextureInfo(){return this.getRef("sheenRoughnessTexture")?this.getRef("sheenRoughnessTextureInfo"):null}setSheenRoughnessTexture(t){return this.setRef("sheenRoughnessTexture",t,{channels:xz})}},Tz=class extends ke{static EXTENSION_NAME=Or;extensionName=Or;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createSheen(){return new bz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_sheen){let o=this.createSheen();t.materials[s].setExtension(Or,o);let a=n.extensions[Or];if(a.extras&&o.setExtras(a.extras),a.sheenColorFactor!==void 0&&o.setSheenColorFactor(a.sheenColorFactor),a.sheenRoughnessFactor!==void 0&&o.setSheenRoughnessFactor(a.sheenRoughnessFactor),a.sheenColorTexture!==void 0){let c=a.sheenColorTexture,l=t.textures[i[c.index].source];o.setSheenColorTexture(l),t.setTextureInfo(o.getSheenColorTextureInfo(),c);}if(a.sheenRoughnessTexture!==void 0){let c=a.sheenRoughnessTexture,l=t.textures[i[c.index].source];o.setSheenRoughnessTexture(l),t.setTextureInfo(o.getSheenRoughnessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Or);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Or]=o,o.sheenColorFactor=i.getSheenColorFactor(),o.sheenRoughnessFactor=i.getSheenRoughnessFactor(),i.getSheenColorTexture()){let a=i.getSheenColorTexture(),c=i.getSheenColorTextureInfo();o.sheenColorTexture=t.createTextureInfoDef(a,c);}if(i.getSheenRoughnessTexture()){let a=i.getSheenRoughnessTexture(),c=i.getSheenRoughnessTextureInfo();o.sheenRoughnessTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:Rz,G:Ez,B:wz,A:Mz}=hn,Az=class extends Ne{static EXTENSION_NAME=zr;init(){this.extensionName=zr,this.propertyType="Specular",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{specularFactor:1,specularTexture:null,specularTextureInfo:new He(this.graph,"specularTextureInfo"),specularColorFactor:[1,1,1],specularColorTexture:null,specularColorTextureInfo:new He(this.graph,"specularColorTextureInfo")})}getSpecularFactor(){return this.get("specularFactor")}setSpecularFactor(t){return this.set("specularFactor",t)}getSpecularColorFactor(){return this.get("specularColorFactor")}setSpecularColorFactor(t){return this.set("specularColorFactor",t)}getSpecularTexture(){return this.getRef("specularTexture")}getSpecularTextureInfo(){return this.getRef("specularTexture")?this.getRef("specularTextureInfo"):null}setSpecularTexture(t){return this.setRef("specularTexture",t,{channels:Mz})}getSpecularColorTexture(){return this.getRef("specularColorTexture")}getSpecularColorTextureInfo(){return this.getRef("specularColorTexture")?this.getRef("specularColorTextureInfo"):null}setSpecularColorTexture(t){return this.setRef("specularColorTexture",t,{channels:Rz|Ez|wz,isColor:true})}},Iz=class extends ke{static EXTENSION_NAME=zr;extensionName=zr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createSpecular(){return new Az(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_specular){let o=this.createSpecular();t.materials[s].setExtension(zr,o);let a=n.extensions[zr];if(a.extras&&o.setExtras(a.extras),a.specularFactor!==void 0&&o.setSpecularFactor(a.specularFactor),a.specularColorFactor!==void 0&&o.setSpecularColorFactor(a.specularColorFactor),a.specularTexture!==void 0){let c=a.specularTexture,l=t.textures[i[c.index].source];o.setSpecularTexture(l),t.setTextureInfo(o.getSpecularTextureInfo(),c);}if(a.specularColorTexture!==void 0){let c=a.specularColorTexture,l=t.textures[i[c.index].source];o.setSpecularColorTexture(l),t.setTextureInfo(o.getSpecularColorTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(zr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[zr]=o,i.getSpecularFactor()!==1&&(o.specularFactor=i.getSpecularFactor()),Ke.eq(i.getSpecularColorFactor(),[1,1,1])||(o.specularColorFactor=i.getSpecularColorFactor()),i.getSpecularTexture()){let a=i.getSpecularTexture(),c=i.getSpecularTextureInfo();o.specularTexture=t.createTextureInfoDef(a,c);}if(i.getSpecularColorTexture()){let a=i.getSpecularColorTexture(),c=i.getSpecularColorTextureInfo();o.specularColorTexture=t.createTextureInfoDef(a,c);}}}),this}},{R:Cz}=hn,Pz=class extends Ne{static EXTENSION_NAME=$r;init(){this.extensionName=$r,this.propertyType="Transmission",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{transmissionFactor:0,transmissionTexture:null,transmissionTextureInfo:new He(this.graph,"transmissionTextureInfo")})}getTransmissionFactor(){return this.get("transmissionFactor")}setTransmissionFactor(t){return this.set("transmissionFactor",t)}getTransmissionTexture(){return this.getRef("transmissionTexture")}getTransmissionTextureInfo(){return this.getRef("transmissionTexture")?this.getRef("transmissionTextureInfo"):null}setTransmissionTexture(t){return this.setRef("transmissionTexture",t,{channels:Cz})}},Nz=class extends ke{static EXTENSION_NAME=$r;extensionName=$r;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createTransmission(){return new Pz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_transmission){let o=this.createTransmission();t.materials[s].setExtension($r,o);let a=n.extensions[$r];if(a.extras&&o.setExtras(a.extras),a.transmissionFactor!==void 0&&o.setTransmissionFactor(a.transmissionFactor),a.transmissionTexture!==void 0){let c=a.transmissionTexture,l=t.textures[i[c.index].source];o.setTransmissionTexture(l),t.setTextureInfo(o.getTransmissionTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension($r);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[$r]=o,o.transmissionFactor=i.getTransmissionFactor(),i.getTransmissionTexture()){let a=i.getTransmissionTexture(),c=i.getTransmissionTextureInfo();o.transmissionTexture=t.createTextureInfoDef(a,c);}}}),this}},Oz=class extends Ne{static EXTENSION_NAME=Is;init(){this.extensionName=Is,this.propertyType="Unlit",this.parentTypes=[te.MATERIAL];}},zz=class extends ke{static EXTENSION_NAME=Is;extensionName=Is;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createUnlit(){return new Oz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){return (t.jsonDoc.json.materials||[]).forEach((e,r)=>{e.extensions&&e.extensions.KHR_materials_unlit&&t.materials[r].setExtension(Is,this.createUnlit());}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{if(r.getExtension("KHR_materials_unlit")){let i=t.materialIndexMap.get(r),n=e.json.materials[i];n.extensions=n.extensions||{},n.extensions[Is]={};}}),this}},$z=class extends Ne{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="Mapping",this.parentTypes=["MappingList"];}getDefaults(){return Object.assign(super.getDefaults(),{material:null,variants:new Be})}getMaterial(){return this.getRef("material")}setMaterial(t){return this.setRef("material",t)}addVariant(t){return this.addRef("variants",t)}removeVariant(t){return this.removeRef("variants",t)}listVariants(){return this.listRefs("variants")}},Dz=class extends Ne{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="MappingList",this.parentTypes=[te.PRIMITIVE];}getDefaults(){return Object.assign(super.getDefaults(),{mappings:new Be})}addMapping(t){return this.addRef("mappings",t)}removeMapping(t){return this.removeRef("mappings",t)}listMappings(){return this.listRefs("mappings")}},ZR=class extends Ne{static EXTENSION_NAME=Gt;init(){this.extensionName=Gt,this.propertyType="Variant",this.parentTypes=["MappingList"];}},Lz=class extends ke{extensionName=Gt;static EXTENSION_NAME=Gt;createMappingList(){return new Dz(this.document.getGraph())}createVariant(t=""){return new ZR(this.document.getGraph(),t)}createMapping(){return new $z(this.document.getGraph())}listVariants(){return Array.from(this.properties).filter(t=>t instanceof ZR)}read(t){let e=t.jsonDoc;if(!e.json.extensions||!e.json.extensions.KHR_materials_variants)return this;let r=(e.json.extensions.KHR_materials_variants.variants||[]).map(i=>this.createVariant().setName(i.name||""));return (e.json.meshes||[]).forEach((i,n)=>{let s=t.meshes[n];(i.primitives||[]).forEach((o,a)=>{if(!o.extensions||!o.extensions.KHR_materials_variants)return;let c=this.createMappingList(),l=o.extensions[Gt];for(let u of l.mappings){let d=this.createMapping();u.material!==void 0&&d.setMaterial(t.materials[u.material]);for(let f of u.variants||[])d.addVariant(r[f]);c.addMapping(d);}s.listPrimitives()[a].setExtension(Gt,c);});}),this}write(t){let e=t.jsonDoc,r=this.listVariants();if(!r.length)return this;let i=[],n=new Map;for(let s of r)n.set(s,i.length),i.push(t.createPropertyDef(s));for(let s of this.document.getRoot().listMeshes()){let o=t.meshIndexMap.get(s);s.listPrimitives().forEach((a,c)=>{let l=a.getExtension(Gt);if(!l)return;let u=t.jsonDoc.json.meshes[o].primitives[c],d=l.listMappings().map(f=>{let p=t.createPropertyDef(f),g=f.getMaterial();return g&&(p.material=t.materialIndexMap.get(g)),p.variants=f.listVariants().map(m=>n.get(m)),p});u.extensions=u.extensions||{},u.extensions[Gt]={mappings:d};});}return e.json.extensions=e.json.extensions||{},e.json.extensions[Gt]={variants:i},this}},{G:kz}=hn,Uz=class extends Ne{static EXTENSION_NAME=Dr;init(){this.extensionName=Dr,this.propertyType="Volume",this.parentTypes=[te.MATERIAL];}getDefaults(){return Object.assign(super.getDefaults(),{thicknessFactor:0,thicknessTexture:null,thicknessTextureInfo:new He(this.graph,"thicknessTexture"),attenuationDistance:1/0,attenuationColor:[1,1,1]})}getThicknessFactor(){return this.get("thicknessFactor")}setThicknessFactor(t){return this.set("thicknessFactor",t)}getThicknessTexture(){return this.getRef("thicknessTexture")}getThicknessTextureInfo(){return this.getRef("thicknessTexture")?this.getRef("thicknessTextureInfo"):null}setThicknessTexture(t){return this.setRef("thicknessTexture",t,{channels:kz})}getAttenuationDistance(){return this.get("attenuationDistance")}setAttenuationDistance(t){return this.set("attenuationDistance",t)}getAttenuationColor(){return this.get("attenuationColor")}setAttenuationColor(t){return this.set("attenuationColor",t)}},Fz=class extends ke{static EXTENSION_NAME=Dr;extensionName=Dr;prereadTypes=[te.MESH];prewriteTypes=[te.MESH];createVolume(){return new Uz(this.document.getGraph())}read(t){return this}write(t){return this}preread(t){let e=t.jsonDoc,r=e.json.materials||[],i=e.json.textures||[];return r.forEach((n,s)=>{if(n.extensions&&n.extensions.KHR_materials_volume){let o=this.createVolume();t.materials[s].setExtension(Dr,o);let a=n.extensions[Dr];if(a.extras&&o.setExtras(a.extras),a.thicknessFactor!==void 0&&o.setThicknessFactor(a.thicknessFactor),a.attenuationDistance!==void 0&&o.setAttenuationDistance(a.attenuationDistance),a.attenuationColor!==void 0&&o.setAttenuationColor(a.attenuationColor),a.thicknessTexture!==void 0){let c=a.thicknessTexture,l=t.textures[i[c.index].source];o.setThicknessTexture(l),t.setTextureInfo(o.getThicknessTextureInfo(),c);}}}),this}prewrite(t){let e=t.jsonDoc;return this.document.getRoot().listMaterials().forEach(r=>{let i=r.getExtension(Dr);if(i){let n=t.materialIndexMap.get(r),s=e.json.materials[n],o=t.createPropertyDef(i);if(s.extensions=s.extensions||{},s.extensions[Dr]=o,i.getThicknessFactor()>0&&(o.thicknessFactor=i.getThicknessFactor()),Number.isFinite(i.getAttenuationDistance())&&(o.attenuationDistance=i.getAttenuationDistance()),Ke.eq(i.getAttenuationColor(),[1,1,1])||(o.attenuationColor=i.getAttenuationColor()),i.getThicknessTexture()){let a=i.getThicknessTexture(),c=i.getThicknessTextureInfo();o.thicknessTexture=t.createTextureInfoDef(a,c);}}}),this}},Bz=class extends ke{extensionName=NR;static EXTENSION_NAME=NR;read(t){return this}write(t){return this}},Vz=class extends ke{extensionName=OR;static EXTENSION_NAME=OR;read(t){return this}write(t){return this}},jz=class extends Ne{static EXTENSION_NAME=Lr;init(){this.extensionName=Lr,this.propertyType="Visibility",this.parentTypes=[te.NODE];}getDefaults(){return Object.assign(super.getDefaults(),{visible:true})}getVisible(){return this.get("visible")}setVisible(t){return this.set("visible",t)}},Gz=class extends ke{static EXTENSION_NAME=Lr;extensionName=Lr;createVisibility(){return new jz(this.document.getGraph())}read(t){return (t.jsonDoc.json.nodes||[]).forEach((e,r)=>{if(e.extensions&&e.extensions.KHR_node_visibility){let i=this.createVisibility();t.nodes[r].setExtension(Lr,i);let n=e.extensions[Lr];n.visible!==void 0&&i.setVisible(n.visible);}}),this}write(t){let e=t.jsonDoc;for(let r of this.document.getRoot().listNodes()){let i=r.getExtension(Lr);if(!i)continue;let n=t.nodeIndexMap.get(r),s=e.json.nodes[n];s.extensions=s.extensions||{},s.extensions[Lr]={visible:i.getVisible()};}return this}};function Hz(t){return t.vkFormat>0&&t.vkFormat<=123}function XR(t){let e=t.vkFormat===1000066e3&&t.dataFormatDescriptor[0].colorModel===167;return t.vkFormat===0||e}var qz=class{match(t){return t[0]===171&&t[1]===75&&t[2]===84&&t[3]===88&&t[4]===32&&t[5]===50&&t[6]===48&&t[7]===187&&t[8]===13&&t[9]===10&&t[10]===26&&t[11]===10}getSize(t){let e=ph(t);return [e.pixelWidth,e.pixelHeight]}getChannels(t){let e=ph(t),r=e.dataFormatDescriptor[0];if(Hz(e))return r.samples.length;if(XR(e))switch(r.colorModel){case 163:return r.samples.length===2&&(r.samples[1].channelType&15)===15?4:3;case 166:return (r.samples[0].channelType&15)===3?4:3;default:throw new Error(`Unexpected KTX2 colorModel, "${r.colorModel}".`)}throw new Error(`Unexpected KTX2 vkFormat, "${e.vkFormat}".`)}getVRAMByteLength(t){let e=ph(t),r=0;if(XR(e)){let i=this.getChannels(t)>3;for(let n=0;n<e.levels.length;n++){let s=e.levels[n];if(s.uncompressedByteLength)r+=s.uncompressedByteLength;else {let o=Math.max(1,Math.floor(e.pixelWidth/Math.pow(2,n))),a=Math.max(1,Math.floor(e.pixelHeight/Math.pow(2,n))),c=i?16:8;r+=o/4*(a/4)*c;}}}else for(let i of e.levels)e.supercompressionScheme===0?r+=i.levelData.byteLength:r+=i.uncompressedByteLength;return r}},Wz=class extends ke{static EXTENSION_NAME=_h;extensionName=_h;prereadTypes=[te.TEXTURE];static register(){Tn.registerFormat("image/ktx2",new qz);}preread(t){return t.jsonDoc.json.textures&&t.jsonDoc.json.textures.forEach(e=>{e.extensions&&e.extensions.KHR_texture_basisu&&(e.source=e.extensions[_h].source);}),this}read(t){return this}write(t){let e=t.jsonDoc;return this.document.getRoot().listTextures().forEach(r=>{if(r.getMimeType()==="image/ktx2"){let i=t.imageIndexMap.get(r);e.json.textures.forEach(n=>{n.source===i&&(n.extensions=n.extensions||{},n.extensions[_h]={source:n.source},delete n.source);});}}),this}},Kz=class extends Ne{static EXTENSION_NAME=kr;init(){this.extensionName=kr,this.propertyType="Transform",this.parentTypes=[te.TEXTURE_INFO];}getDefaults(){return Object.assign(super.getDefaults(),{offset:[0,0],rotation:0,scale:[1,1],texCoord:null})}getOffset(){return this.get("offset")}setOffset(t){return this.set("offset",t)}getRotation(){return this.get("rotation")}setRotation(t){return this.set("rotation",t)}getScale(){return this.get("scale")}setScale(t){return this.set("scale",t)}getTexCoord(){return this.get("texCoord")}setTexCoord(t){return this.set("texCoord",t)}},Zz=class extends ke{extensionName=kr;static EXTENSION_NAME=kr;createTransform(){return new Kz(this.document.getGraph())}read(t){for(let[e,r]of Array.from(t.textureInfos.entries())){if(!r.extensions||!r.extensions.KHR_texture_transform)continue;let i=this.createTransform(),n=r.extensions[kr];n.offset!==void 0&&i.setOffset(n.offset),n.rotation!==void 0&&i.setRotation(n.rotation),n.scale!==void 0&&i.setScale(n.scale),n.texCoord!==void 0&&i.setTexCoord(n.texCoord),e.setExtension(kr,i);}return this}write(t){let e=Array.from(t.textureInfoDefMap.entries());for(let[r,i]of e){let n=r.getExtension(kr);if(!n)continue;i.extensions=i.extensions||{};let s={},o=Ke.eq;o(n.getOffset(),[0,0])||(s.offset=n.getOffset()),n.getRotation()!==0&&(s.rotation=n.getRotation()),o(n.getScale(),[1,1])||(s.scale=n.getScale()),n.getTexCoord()!=null&&(s.texCoord=n.getTexCoord()),i.extensions[kr]=s;}return this}},Xz=[te.ROOT,te.SCENE,te.NODE,te.MESH,te.MATERIAL,te.TEXTURE,te.ANIMATION],Jz=class extends Ne{static EXTENSION_NAME=fn;init(){this.extensionName=fn,this.propertyType="Packet",this.parentTypes=Xz;}getDefaults(){return Object.assign(super.getDefaults(),{context:{},properties:{}})}getContext(){return this.get("context")}setContext(t){return this.set("context",{...t})}listProperties(){return Object.keys(this.get("properties"))}getProperty(t){let e=this.get("properties");return t in e?e[t]:null}setProperty(t,e){this._assertContext(t);let r={...this.get("properties")};return e?r[t]=e:delete r[t],this.set("properties",r)}toJSONLD(){return {"@context":gy(this.get("context")),...gy(this.get("properties"))}}fromJSONLD(t){t=gy(t);let e=t["@context"];return e&&this.set("context",e),delete t["@context"],this.set("properties",t)}_assertContext(t){if(!(t.split(":")[0]in this.get("context")))throw new Error(`${fn}: Missing context for term, "${t}".`)}};function gy(t){return JSON.parse(JSON.stringify(t))}var Yz=class extends ke{extensionName=fn;static EXTENSION_NAME=fn;createPacket(){return new Jz(this.document.getGraph())}listPackets(){return Array.from(this.properties)}read(t){let e=t.jsonDoc.json.extensions?.[fn];if(!e||!e.packets)return this;let r=t.jsonDoc.json,i=this.document.getRoot(),n=e.packets.map(a=>this.createPacket().fromJSONLD(a)),s=[[r.asset],r.scenes,r.nodes,r.meshes,r.materials,r.images,r.animations],o=[[i],i.listScenes(),i.listNodes(),i.listMeshes(),i.listMaterials(),i.listTextures(),i.listAnimations()];for(let a=0;a<s.length;a++){let c=s[a]||[];for(let l=0;l<c.length;l++){let u=c[l];if(u.extensions&&u.extensions.KHR_xmp_json_ld){let d=u.extensions[fn];o[a][l].setExtension(fn,n[d.packet]);}}}return this}write(t){let{json:e}=t.jsonDoc,r=[];for(let i of this.properties){r.push(i.toJSONLD());for(let n of i.listParents()){let s;switch(n.propertyType){case te.ROOT:s=e.asset;break;case te.SCENE:s=e.scenes[t.sceneIndexMap.get(n)];break;case te.NODE:s=e.nodes[t.nodeIndexMap.get(n)];break;case te.MESH:s=e.meshes[t.meshIndexMap.get(n)];break;case te.MATERIAL:s=e.materials[t.materialIndexMap.get(n)];break;case te.TEXTURE:s=e.images[t.imageIndexMap.get(n)];break;case te.ANIMATION:s=e.animations[t.animationIndexMap.get(n)];break;default:s=null,this.document.getLogger().warn(`[${fn}]: Unsupported parent property, "${n.propertyType}"`);break}s&&(s.extensions=s.extensions||{},s.extensions[fn]={packet:r.length-1});}}return r.length>0&&(e.extensions=e.extensions||{},e.extensions[fn]={packets:r}),this}},Qz=[NO,OO,jO,HO,XO,QO,sz,az,lz,dz,mz,_z,Iz,Tz,Nz,zz,Lz,Fz,Bz,Vz,Gz,Wz,Zz,Yz],Qt=[CN,EN,BN,nO,IO,PO,...Qz];function rE(t,e,r){if(r.getRoot().listSkins().length>0)throw new Error("The attached GLB is rigged; attach a prop, or bake it into the host first.");if(r.getRoot().listAnimations().length>0)throw new Error("The attached GLB has its own clips; a prop is posed by its bone, not by clips.");if(r.getRoot().listCameras().length>0)throw new Error("The attached GLB carries a camera; attach a prop, not a scene.");let i=t.createNode(e),s=r.getRoot().listScenes()[0]?.listChildren()??r.getRoot().listNodes();for(let o of s)i.addChild(iE(t,o));return i}function e$(t){return t.getRoot().listBuffers()[0]??t.createBuffer()}function t$(t){let e=t.getElementSize(),i=t.getArray()?.constructor??Float32Array,n=new i(t.getCount()*e),s=[];for(let o=0;o<t.getCount();o+=1)t.getElement(o,s),n.set(s,o*e);return n}function Sy(t,e){if(e.getArray()===null&&!e.getSparse())throw new Error(`Accessor '${e.getName()}' carries no data.`);return t.createAccessor(e.getName()).setType(e.getType()).setArray(t$(e)).setNormalized(e.getNormalized()).setBuffer(e$(t))}function n$(t,e){let r=t.createTexture(e.getName()).setMimeType(e.getMimeType()),i=e.getImage();return i!==null&&r.setImage(new Uint8Array(i)),r}function r$(t,e,r,i,n){let s=e===null?null:n$(t,e);n(s),!(r===null||i===null)&&i.setMagFilter(r.getMagFilter()).setMinFilter(r.getMinFilter()).setWrapS(r.getWrapS()).setWrapT(r.getWrapT());}function i$(t,e){let r=t.createMaterial(e.getName()).setAlpha(e.getAlpha()).setAlphaCutoff(e.getAlphaCutoff()).setAlphaMode(e.getAlphaMode()).setBaseColorFactor([...e.getBaseColorFactor()]).setDoubleSided(e.getDoubleSided()).setEmissiveFactor([...e.getEmissiveFactor()]).setMetallicFactor(e.getMetallicFactor()).setNormalScale(e.getNormalScale()).setOcclusionStrength(e.getOcclusionStrength()).setRoughnessFactor(e.getRoughnessFactor()),i=[[e.getBaseColorTexture(),e.getBaseColorTextureInfo(),()=>r.getBaseColorTextureInfo(),n=>r.setBaseColorTexture(n)],[e.getEmissiveTexture(),e.getEmissiveTextureInfo(),()=>r.getEmissiveTextureInfo(),n=>r.setEmissiveTexture(n)],[e.getMetallicRoughnessTexture(),e.getMetallicRoughnessTextureInfo(),()=>r.getMetallicRoughnessTextureInfo(),n=>r.setMetallicRoughnessTexture(n)],[e.getNormalTexture(),e.getNormalTextureInfo(),()=>r.getNormalTextureInfo(),n=>r.setNormalTexture(n)],[e.getOcclusionTexture(),e.getOcclusionTextureInfo(),()=>r.getOcclusionTextureInfo(),n=>r.setOcclusionTexture(n)]];for(let[n,s,o,a]of i)r$(t,n,s,o(),a);return r}function s$(t,e){let r=t.createPrimitive().setMode(e.getMode());for(let s of e.listSemantics()){let o=e.getAttribute(s);o!==null&&r.setAttribute(s,Sy(t,o));}let i=e.getIndices();i!==null&&r.setIndices(Sy(t,i));let n=e.getMaterial();n!==null&&r.setMaterial(i$(t,n));for(let s of e.listTargets()){let o=t.createPrimitiveTarget();for(let a of s.listSemantics()){let c=s.getAttribute(a);c!==null&&o.setAttribute(a,Sy(t,c));}r.addTarget(o);}return r}function o$(t,e){let r=t.createMesh(e.getName());for(let i of e.listPrimitives())r.addPrimitive(s$(t,i));return r}function iE(t,e){let r=t.createNode(e.getName()).setTranslation([...e.getTranslation()]).setRotation([...e.getRotation()]).setScale([...e.getScale()]),i=e.getMesh();i!==null&&r.setMesh(o$(t,i));for(let n of e.listChildren())r.addChild(iE(t,n));return r}var sE=t=>({attachment:"attached",keyframes:[t]});function oE(t){if(t.version===3)return t;if(t.version===2)return {anchor:t.anchor,animations:Object.fromEntries(Object.entries(t.animations).map(([e,r])=>[e,sE(r)])),attached:t.attached,...t.default===void 0?{}:{default:sE(t.default)},host:t.host,version:3}}function aE(t,e){let r=[...t?.keyframes??[]].filter(i=>Math.abs(i.time-e.time)>5e-4);return r.push(e),r.sort((i,n)=>i.time-n.time),{attachment:t?.attachment??"attached",keyframes:r}}var Ty="$default",Na=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function by(t,e,r){if(!Array.isArray(t)||t.length!==e||!t.every(i=>Number.isFinite(i)))throw new Error(`${r} must be ${e} finite numbers.`);return t}function l$(t){if(!Na(t))throw new Error("A key op needs a transform object.");return {position:by(t.position,3,"transform.position"),rotation:by(t.rotation,3,"transform.rotation"),scale:by(t.scale,3,"transform.scale")}}function u$(t){if(!Na(t))throw new Error("An attach op needs an anchor object.");let{id:e,label:r,node:i,source:n}=t;if(typeof e!="string"||typeof r!="string"||typeof i!="string")throw new Error("An anchor needs a string id, label and node.");if(n!=="detected"&&n!=="estimated")throw new Error("An anchor source is 'detected' or 'estimated'.");return {id:e,label:r,node:i,source:n}}function d$(t){if(t!==void 0){if(t!=="attached"&&t!=="detached")throw new Error("A key op attachment is 'attached' or 'detached'.");return t}}function h$(t){if(!Na(t))throw new Error("A modify op needs an edit object.");let e=(r,i)=>{if(typeof r!="number"||!Number.isFinite(r))throw new Error(`A ${t.kind} edit needs a finite ${i}.`);return r};switch(t.kind){case "trim":{let r=e(t.start,"start"),i=e(t.end,"end");if(r<0||i<=r)throw new Error("trim needs 0 <= start < end.");return {end:i,kind:"trim",start:r}}case "retime":{let r=e(t.speed,"speed");if(r<=0)throw new Error("retime needs a speed above zero.");return {kind:"retime",speed:r}}case "loop-point":{let r=e(t.time,"time");if(r<0)throw new Error("A loop point cannot be before the clip starts.");return {kind:"loop-point",time:r}}case "resample":{let r=e(t.fps,"fps");if(r<=0)throw new Error("resample needs an fps above zero.");return {fps:r,kind:"resample"}}case "mirror":return {kind:"mirror"};case "foot-lock":{let r=e(t.contact,"contact"),i=t.feet;if(!Array.isArray(i)||!i.every(n=>typeof n=="string"))throw new Error("foot-lock names its feet as strings.");return {contact:r,feet:i,kind:"foot-lock"}}default:throw new Error(`Unknown clip edit '${String(t.kind)}'.`)}}function f$(t){if(!Na(t))throw new Error("Every op must be an object.");if(t.op==="attach"){if(typeof t.attached!="string"||t.attached.length===0)throw new Error("An attach op names the attached GLB.");return {anchor:u$(t.anchor),attached:t.attached,op:"attach"}}if(t.op==="modify"){if(typeof t.clip!="string"||t.clip.length===0)throw new Error("A modify op names its clip.");return {clip:t.clip,edit:h$(t.edit),op:"modify"}}if(t.op==="key"){if(typeof t.clip!="string"||t.clip.length===0)throw new Error("A key op names its clip.");if(typeof t.time!="number"||!Number.isFinite(t.time)||t.time<0)throw new Error("A key op needs a finite time of zero or more.");let e=d$(t.attachment);return {clip:t.clip,op:"key",time:t.time,transform:l$(t.transform),...e===void 0?{}:{attachment:e}}}throw new Error(`Unknown animation op '${String(t.op)}'.`)}function p$(t){if(t===void 0)throw new Error("Unsupported animation recipe version.");let e=[{anchor:t.anchor,attached:t.attached,op:"attach"}],r=[];t.default!==void 0&&r.push([Ty,t.default]);for(let i of Object.keys(t.animations).sort((n,s)=>n.localeCompare(s)))r.push([i,t.animations[i]]);for(let[i,n]of r)for(let s of [...n.keyframes].sort((o,a)=>o.time-a.time))e.push({attachment:n.attachment,clip:i,op:"key",time:s.time,transform:s.transform});return {host:t.host,ops:e,version:4}}function Ry(t){if(!Na(t))throw new Error("An animation log must be a JSON object.");if(typeof t.host!="string"||t.host.length===0)throw new Error("An animation log names its host GLB.");if(t.version===4){if(!Array.isArray(t.ops)||t.ops.length===0)throw new Error("An animation log needs at least one op.");return {host:t.host,ops:t.ops.map(e=>f$(e)),version:4}}if(t.version===3||t.version===2)return p$(oE(t));throw new Error(`Unsupported animation log version '${String(t.version)}'.`)}function cE(t){let e,r,i={};for(let n of t.ops){if(n.op==="attach"){e=n.anchor,r=n.attached;continue}if(n.op==="modify")continue;let s=aE(i[n.clip],{time:n.time,transform:n.transform});i[n.clip]=n.attachment===void 0?s:{attachment:n.attachment,keyframes:s.keyframes};}if(e===void 0||r===void 0)throw new Error("An animation log starts with an attach op naming the prop and its bone.");return {anchor:e,attached:r,host:t.host,poses:i}}function Ey(t,e){return {host:t.host,ops:[...t.ops,e],version:4}}function wy(t){let e=Gr.parse(Gr.resolve(t));return Gr.join(e.dir,`${e.name}.anim.json`)}async function lE(t){let e;try{e=await readFile(t,"utf8");}catch(r){throw new Error(`Cannot read animation log ${t}: ${r instanceof Error?r.message:String(r)}`)}return Ry(JSON.parse(e))}async function My(t,e){await writeFile(t,`${JSON.stringify(e,null,2)}
|
|
76
|
+
`,"utf8");}var Ay=t=>t*Math.PI/180;function g$(t){let[e,r,i]=[Ay(t[0]),Ay(t[1]),Ay(t[2])],[n,s,o]=[Math.cos(e/2),Math.cos(r/2),Math.cos(i/2)],[a,c,l]=[Math.sin(e/2),Math.sin(r/2),Math.sin(i/2)];return [a*s*o+n*c*l,n*c*o-a*s*l,n*s*l+a*c*o,n*s*o-a*c*l]}function _$(t){return t.getRoot().listBuffers()[0]??t.createBuffer()}function uE(t,e,r,i){return t.createAccessor(e).setArray(r).setType(i).setBuffer(_$(t))}function dE(t){return {rotation:g$(t.rotation),scale:t.scale,translation:t.position}}function v$(t,e,r,i,n,s){let o=uE(t,`${e.getName()}.${i}.time`,new Float32Array(n),"SCALAR"),a=uE(t,`${e.getName()}.${i}`,s,i==="rotation"?"VEC4":"VEC3"),c=t.createAnimationSampler().setInput(o).setOutput(a).setInterpolation("LINEAR");e.addSampler(c),e.addChannel(t.createAnimationChannel().setTargetNode(r).setTargetPath(i).setSampler(c));}function y$(t,e,r,i){let n=[...i.keyframes].sort((c,l)=>c.time-l.time),s=n.map(c=>c.time),o=n.map(c=>dE(c.transform)),a=[["rotation",4],["scale",3],["translation",3]];for(let[c,l]of a){let u=new Float32Array(o.length*l);o.forEach((d,f)=>u.set(d[c],f*l)),v$(t,e,r,c,s,u);}}async function Iy(t,e){let r=cE(e),n=await new Jt().registerExtensions(Qt).read(r.attached),s=t.getRoot().listNodes().find(f=>f.getName()===r.anchor.node);if(s===void 0)throw new Error(`The host has no bone named '${r.anchor.node}' to attach to.`);let o=Gr.parse(r.attached).name,a=rE(t,`attach-${o}`,n);s.addChild(a);let l=[...r.poses[Ty]?.keyframes??[]].sort((f,p)=>f.time-p.time)[0];if(l!==void 0){let f=dE(l.transform);a.setTranslation(f.translation).setRotation(f.rotation).setScale(f.scale);}let u=[],d=[];for(let f of t.getRoot().listAnimations()){let p=f.getName(),g=r.poses[p];if(!(g===void 0||g.keyframes.length===0)){if(g.attachment==="detached"){d.push(p);continue}u.push(p),y$(t,f,a,g);}}return {anchor:s.getName(),attached:r.attached,clips:u,detached:d,node:a.getName()}}async function hE(t,e){let r=await new Jt().registerExtensions(Qt).read(t.host),i=await Iy(r,t);return await mkdir(Gr.dirname(Gr.resolve(e)),{recursive:true}),await new Jt().registerExtensions(Qt).write(e,r),{...i,file:Gr.resolve(e)}}var yh=[{id:"right-hand",label:"Right hand",patterns:[/righthand/u,/handright/u,/rhand/u]},{id:"left-hand",label:"Left hand",patterns:[/lefthand/u,/handleft/u,/lhand/u]},{id:"head",label:"Head",patterns:[/head/u]},{id:"hips",label:"Hips / root",patterns:[/hips/u,/pelvis/u,/^root$/u]},{id:"right-foot",label:"Right foot",patterns:[/rightfoot/u,/footright/u,/rfoot/u]},{id:"left-foot",label:"Left foot",patterns:[/leftfoot/u,/footleft/u,/lfoot/u]}];function Cy(t){return t.toLowerCase().replaceAll(/[^a-z0-9]/gu,"")}function S$(t,e){return e.filter(r=>t.patterns.some(i=>i.test(Cy(r)))).sort((r,i)=>Cy(r).length-Cy(i).length)[0]}function Sh(t){return yh.flatMap(e=>{let r=S$(e,t);return r===void 0?[]:[{id:e.id,label:e.label,node:r,source:"detected"}]})}var b$=.01,T$=()=>new Jt().registerExtensions(Qt);function R$(t){let r=t.getRoot().listSkins().flatMap(n=>n.listJoints())[0];return r!==void 0?r.getName():t.getRoot().listNodes().find(n=>/hips|pelvis|root/iu.test(n.getName()))?.getName()??null}function E$(t){let e=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;for(let i of t)i<e&&(e=i),i>r&&(r=i);return {max:r,min:e}}function w$(t,e){let r=new Map;if(e===null)return r;for(let i of t.getRoot().listAnimations()){let n=0;for(let s of i.listChannels()){if(s.getTargetNode()?.getName()!==e||s.getTargetPath()!=="translation")continue;let o=s.getSampler()?.getOutput()?.getArray();if(o==null||o.length<6)continue;let a=[o[0]??0,o[2]??0];for(let c=0;c+2<o.length;c+=3){let l=(o[c]??0)-a[0],u=(o[c+2]??0)-(a[1]??0);n=Math.max(n,Math.hypot(l,u));}}r.set(i.getName(),n);}return r}async function Py(t){let e=(await stat(t)).size,r=await T$().read(t),i=r.getRoot(),n=[],s=i.listSkins(),o=s.flatMap(f=>f.listJoints().map(p=>p.getName())),a=i.listNodes().map(f=>f.getName()),c=o.length>0?o:a.filter(f=>f.length>0);s.length===0&&n.push("No skin: the model is not rigged."),i.listAnimations().length===0&&n.push("No animation clip: nothing to verify.");let l=R$(r),u=w$(r,l),d=i.listAnimations().map(f=>{let p=0;for(let m of f.listSamplers()){let S=m.getInput()?.getArray();S!==void 0&&(p=Math.max(p,E$(S).max));}let g=Math.round((u.get(f.getName())??0)*1e4)/1e4;return {channels:f.listChannels().length,duration:Math.round(p*1e4)/1e4,horizontalTravel:g,inPlace:g<=b$,name:f.getName()}}).sort((f,p)=>f.name.localeCompare(p.name));return {bones:c,bytes:e,clips:d,extensionsUsed:[...i.listExtensionsUsed().map(f=>f.extensionName)].sort((f,p)=>f.localeCompare(p)),file:t,generator:i.getAsset().generator??"",inPlace:d.every(f=>f.inPlace),landmarks:Sh(c),meshes:i.listMeshes().length,rootBone:l,skins:s.length,warnings:n}}var p0="",tn="srgb",Qy="srgb-linear",e0="linear",wh="srgb";var $a=2e3,t0=2001;var fE={};function LE(t){let e=t[0];if(typeof e=="string"&&e.startsWith("TSL:")){let r=t[1];r&&r.isStackTrace?t[0]+=" "+r.getLocation():t[1]='Stack trace not available. Enable "THREE.Node.captureStackTrace" to capture stack traces.';}return t}function Rt(...t){t=LE(t);let e="THREE."+t.shift();{let r=t[0];r&&r.isStackTrace?console.warn(r.getError(e)):console.warn(e,...t);}}function Mh(...t){let e=t.join(" ");e in fE||(fE[e]=true,Rt(...t));}function De(t,e,r){return Math.max(e,Math.min(r,t))}function C$(t,e){return (t%e+e)%e}function Ny(t,e,r){return (1-r)*t+r*e}var mn=class{static{this.prototype.isVector2=true;}constructor(e=0,r=0){this.x=e,this.y=r;}get width(){return this.x}set width(e){this.x=e;}get height(){return this.y}set height(e){this.y=e;}set(e,r){return this.x=e,this.y=r,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;default:throw new Error("THREE.Vector2: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("THREE.Vector2: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this}addScaledVector(e,r){return this.x+=e.x*r,this.y+=e.y*r,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){let r=this.x,i=this.y,n=e.elements;return this.x=n[0]*r+n[3]*i+n[6],this.y=n[1]*r+n[4]*i+n[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,r){return this.x=De(this.x,e.x,r.x),this.y=De(this.y,e.y,r.y),this}clampScalar(e,r){return this.x=De(this.x,e,r),this.y=De(this.y,e,r),this}clampLength(e,r){let i=this.length();return this.divideScalar(i||1).multiplyScalar(De(i,e,r))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){let r=Math.sqrt(this.lengthSq()*e.lengthSq());if(r===0)return Math.PI/2;let i=this.dot(e)/r;return Math.acos(De(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let r=this.x-e.x,i=this.y-e.y;return r*r+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this}lerpVectors(e,r,i){return this.x=e.x+(r.x-e.x)*i,this.y=e.y+(r.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,r=0){return this.x=e[r],this.y=e[r+1],this}toArray(e=[],r=0){return e[r]=this.x,e[r+1]=this.y,e}fromBufferAttribute(e,r){return this.x=e.getX(r),this.y=e.getY(r),this}rotateAround(e,r){let i=Math.cos(r),n=Math.sin(r),s=this.x-e.x,o=this.y-e.y;return this.x=s*i-o*n+e.x,this.y=s*n+o*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y;}},Pt=class{constructor(e=0,r=0,i=0,n=1){this.isQuaternion=true,this._x=e,this._y=r,this._z=i,this._w=n;}static slerpFlat(e,r,i,n,s,o,a){let c=i[n+0],l=i[n+1],u=i[n+2],d=i[n+3],f=s[o+0],p=s[o+1],g=s[o+2],m=s[o+3];if(d!==m||c!==f||l!==p||u!==g){let S=c*f+l*p+u*g+d*m;S<0&&(f=-f,p=-p,g=-g,m=-m,S=-S);let h=1-a;if(S<.9995){let v=Math.acos(S),_=Math.sin(v);h=Math.sin(h*v)/_,a=Math.sin(a*v)/_,c=c*h+f*a,l=l*h+p*a,u=u*h+g*a,d=d*h+m*a;}else {c=c*h+f*a,l=l*h+p*a,u=u*h+g*a,d=d*h+m*a;let v=1/Math.sqrt(c*c+l*l+u*u+d*d);c*=v,l*=v,u*=v,d*=v;}}e[r]=c,e[r+1]=l,e[r+2]=u,e[r+3]=d;}static multiplyQuaternionsFlat(e,r,i,n,s,o){let a=i[n],c=i[n+1],l=i[n+2],u=i[n+3],d=s[o],f=s[o+1],p=s[o+2],g=s[o+3];return e[r]=a*g+u*d+c*p-l*f,e[r+1]=c*g+u*f+l*d-a*p,e[r+2]=l*g+u*p+a*f-c*d,e[r+3]=u*g-a*d-c*f-l*p,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback();}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback();}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback();}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback();}set(e,r,i,n){return this._x=e,this._y=r,this._z=i,this._w=n,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,r=true){let i=e._x,n=e._y,s=e._z,o=e._order,a=Math.cos,c=Math.sin,l=a(i/2),u=a(n/2),d=a(s/2),f=c(i/2),p=c(n/2),g=c(s/2);switch(o){case "XYZ":this._x=f*u*d+l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d-f*p*g;break;case "YXZ":this._x=f*u*d+l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d+f*p*g;break;case "ZXY":this._x=f*u*d-l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d-f*p*g;break;case "ZYX":this._x=f*u*d-l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d+f*p*g;break;case "YZX":this._x=f*u*d+l*p*g,this._y=l*p*d+f*u*g,this._z=l*u*g-f*p*d,this._w=l*u*d-f*p*g;break;case "XZY":this._x=f*u*d-l*p*g,this._y=l*p*d-f*u*g,this._z=l*u*g+f*p*d,this._w=l*u*d+f*p*g;break;default:Rt("Quaternion: .setFromEuler() encountered an unknown order: "+o);}return r===true&&this._onChangeCallback(),this}setFromAxisAngle(e,r){let i=r/2,n=Math.sin(i);return this._x=e.x*n,this._y=e.y*n,this._z=e.z*n,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){let r=e.elements,i=r[0],n=r[4],s=r[8],o=r[1],a=r[5],c=r[9],l=r[2],u=r[6],d=r[10],f=i+a+d;if(f>0){let p=.5/Math.sqrt(f+1);this._w=.25/p,this._x=(u-c)*p,this._y=(s-l)*p,this._z=(o-n)*p;}else if(i>a&&i>d){let p=2*Math.sqrt(1+i-a-d);this._w=(u-c)/p,this._x=.25*p,this._y=(n+o)/p,this._z=(s+l)/p;}else if(a>d){let p=2*Math.sqrt(1+a-i-d);this._w=(s-l)/p,this._x=(n+o)/p,this._y=.25*p,this._z=(c+u)/p;}else {let p=2*Math.sqrt(1+d-i-a);this._w=(o-n)/p,this._x=(s+l)/p,this._y=(c+u)/p,this._z=.25*p;}return this._onChangeCallback(),this}setFromUnitVectors(e,r){let i=e.dot(r)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*r.z-e.z*r.y,this._y=e.z*r.x-e.x*r.z,this._z=e.x*r.y-e.y*r.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(De(this.dot(e),-1,1)))}rotateTowards(e,r){let i=this.angleTo(e);if(i===0)return this;let n=Math.min(1,r/i);return this.slerp(e,n),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,r){let i=e._x,n=e._y,s=e._z,o=e._w,a=r._x,c=r._y,l=r._z,u=r._w;return this._x=i*u+o*a+n*l-s*c,this._y=n*u+o*c+s*a-i*l,this._z=s*u+o*l+i*c-n*a,this._w=o*u-i*a-n*c-s*l,this._onChangeCallback(),this}slerp(e,r){let i=e._x,n=e._y,s=e._z,o=e._w,a=this.dot(e);a<0&&(i=-i,n=-n,s=-s,o=-o,a=-a);let c=1-r;if(a<.9995){let l=Math.acos(a),u=Math.sin(l);c=Math.sin(c*l)/u,r=Math.sin(r*l)/u,this._x=this._x*c+i*r,this._y=this._y*c+n*r,this._z=this._z*c+s*r,this._w=this._w*c+o*r,this._onChangeCallback();}else this._x=this._x*c+i*r,this._y=this._y*c+n*r,this._z=this._z*c+s*r,this._w=this._w*c+o*r,this.normalize();return this}slerpQuaternions(e,r,i){return this.copy(e).slerp(r,i)}random(){let e=2*Math.PI*Math.random(),r=2*Math.PI*Math.random(),i=Math.random(),n=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(n*Math.sin(e),n*Math.cos(e),s*Math.sin(r),s*Math.cos(r))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,r=0){return this._x=e[r],this._y=e[r+1],this._z=e[r+2],this._w=e[r+3],this._onChangeCallback(),this}toArray(e=[],r=0){return e[r]=this._x,e[r+1]=this._y,e[r+2]=this._z,e[r+3]=this._w,e}fromBufferAttribute(e,r){return this._x=e.getX(r),this._y=e.getY(r),this._z=e.getZ(r),this._w=e.getW(r),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w;}},qe=class{static{this.prototype.isVector3=true;}constructor(e=0,r=0,i=0){this.x=e,this.y=r,this.z=i;}set(e,r,i){return i===void 0&&(i=this.z),this.x=e,this.y=r,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,r){switch(e){case 0:this.x=r;break;case 1:this.y=r;break;case 2:this.z=r;break;default:throw new Error("THREE.Vector3: index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("THREE.Vector3: index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,r){return this.x=e.x+r.x,this.y=e.y+r.y,this.z=e.z+r.z,this}addScaledVector(e,r){return this.x+=e.x*r,this.y+=e.y*r,this.z+=e.z*r,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,r){return this.x=e.x-r.x,this.y=e.y-r.y,this.z=e.z-r.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,r){return this.x=e.x*r.x,this.y=e.y*r.y,this.z=e.z*r.z,this}applyEuler(e){return this.applyQuaternion(pE.setFromEuler(e))}applyAxisAngle(e,r){return this.applyQuaternion(pE.setFromAxisAngle(e,r))}applyMatrix3(e){let r=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*r+s[3]*i+s[6]*n,this.y=s[1]*r+s[4]*i+s[7]*n,this.z=s[2]*r+s[5]*i+s[8]*n,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){let r=this.x,i=this.y,n=this.z,s=e.elements,o=1/(s[3]*r+s[7]*i+s[11]*n+s[15]);return this.x=(s[0]*r+s[4]*i+s[8]*n+s[12])*o,this.y=(s[1]*r+s[5]*i+s[9]*n+s[13])*o,this.z=(s[2]*r+s[6]*i+s[10]*n+s[14])*o,this}applyQuaternion(e){let r=this.x,i=this.y,n=this.z,s=e.x,o=e.y,a=e.z,c=e.w,l=2*(o*n-a*i),u=2*(a*r-s*n),d=2*(s*i-o*r);return this.x=r+c*l+o*d-a*u,this.y=i+c*u+a*l-s*d,this.z=n+c*d+s*u-o*l,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){let r=this.x,i=this.y,n=this.z,s=e.elements;return this.x=s[0]*r+s[4]*i+s[8]*n,this.y=s[1]*r+s[5]*i+s[9]*n,this.z=s[2]*r+s[6]*i+s[10]*n,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,r){return this.x=De(this.x,e.x,r.x),this.y=De(this.y,e.y,r.y),this.z=De(this.z,e.z,r.z),this}clampScalar(e,r){return this.x=De(this.x,e,r),this.y=De(this.y,e,r),this.z=De(this.z,e,r),this}clampLength(e,r){let i=this.length();return this.divideScalar(i||1).multiplyScalar(De(i,e,r))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,r){return this.x+=(e.x-this.x)*r,this.y+=(e.y-this.y)*r,this.z+=(e.z-this.z)*r,this}lerpVectors(e,r,i){return this.x=e.x+(r.x-e.x)*i,this.y=e.y+(r.y-e.y)*i,this.z=e.z+(r.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,r){let i=e.x,n=e.y,s=e.z,o=r.x,a=r.y,c=r.z;return this.x=n*c-s*a,this.y=s*o-i*c,this.z=i*a-n*o,this}projectOnVector(e){let r=e.lengthSq();if(r===0)return this.set(0,0,0);let i=e.dot(this)/r;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return Oy.copy(this).projectOnVector(e),this.sub(Oy)}reflect(e){return this.sub(Oy.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){let r=Math.sqrt(this.lengthSq()*e.lengthSq());if(r===0)return Math.PI/2;let i=this.dot(e)/r;return Math.acos(De(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let r=this.x-e.x,i=this.y-e.y,n=this.z-e.z;return r*r+i*i+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,r,i){let n=Math.sin(r)*e;return this.x=n*Math.sin(i),this.y=Math.cos(r)*e,this.z=n*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,r,i){return this.x=e*Math.sin(r),this.y=i,this.z=e*Math.cos(r),this}setFromMatrixPosition(e){let r=e.elements;return this.x=r[12],this.y=r[13],this.z=r[14],this}setFromMatrixScale(e){let r=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),n=this.setFromMatrixColumn(e,2).length();return this.x=r,this.y=i,this.z=n,this}setFromMatrixColumn(e,r){return this.fromArray(e.elements,r*4)}setFromMatrix3Column(e,r){return this.fromArray(e.elements,r*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,r=0){return this.x=e[r],this.y=e[r+1],this.z=e[r+2],this}toArray(e=[],r=0){return e[r]=this.x,e[r+1]=this.y,e[r+2]=this.z,e}fromBufferAttribute(e,r){return this.x=e.getX(r),this.y=e.getY(r),this.z=e.getZ(r),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){let e=Math.random()*Math.PI*2,r=Math.random()*2-1,i=Math.sqrt(1-r*r);return this.x=i*Math.cos(e),this.y=r,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z;}},Oy=new qe,pE=new Pt,Ce=class{static{this.prototype.isMatrix3=true;}constructor(e,r,i,n,s,o,a,c,l){this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,r,i,n,s,o,a,c,l);}set(e,r,i,n,s,o,a,c,l){let u=this.elements;return u[0]=e,u[1]=n,u[2]=a,u[3]=r,u[4]=s,u[5]=c,u[6]=i,u[7]=o,u[8]=l,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){let r=this.elements,i=e.elements;return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],this}extractBasis(e,r,i){return e.setFromMatrix3Column(this,0),r.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){let r=e.elements;return this.set(r[0],r[4],r[8],r[1],r[5],r[9],r[2],r[6],r[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,r){let i=e.elements,n=r.elements,s=this.elements,o=i[0],a=i[3],c=i[6],l=i[1],u=i[4],d=i[7],f=i[2],p=i[5],g=i[8],m=n[0],S=n[3],h=n[6],v=n[1],_=n[4],y=n[7],R=n[2],T=n[5],b=n[8];return s[0]=o*m+a*v+c*R,s[3]=o*S+a*_+c*T,s[6]=o*h+a*y+c*b,s[1]=l*m+u*v+d*R,s[4]=l*S+u*_+d*T,s[7]=l*h+u*y+d*b,s[2]=f*m+p*v+g*R,s[5]=f*S+p*_+g*T,s[8]=f*h+p*y+g*b,this}multiplyScalar(e){let r=this.elements;return r[0]*=e,r[3]*=e,r[6]*=e,r[1]*=e,r[4]*=e,r[7]*=e,r[2]*=e,r[5]*=e,r[8]*=e,this}determinant(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8];return r*o*u-r*a*l-i*s*u+i*a*c+n*s*l-n*o*c}invert(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],d=u*o-a*l,f=a*c-u*s,p=l*s-o*c,g=r*d+i*f+n*p;if(g===0)return this.set(0,0,0,0,0,0,0,0,0);let m=1/g;return e[0]=d*m,e[1]=(n*l-u*i)*m,e[2]=(a*i-n*o)*m,e[3]=f*m,e[4]=(u*r-n*c)*m,e[5]=(n*s-a*r)*m,e[6]=p*m,e[7]=(i*c-l*r)*m,e[8]=(o*r-i*s)*m,this}transpose(){let e,r=this.elements;return e=r[1],r[1]=r[3],r[3]=e,e=r[2],r[2]=r[6],r[6]=e,e=r[5],r[5]=r[7],r[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){let r=this.elements;return e[0]=r[0],e[1]=r[3],e[2]=r[6],e[3]=r[1],e[4]=r[4],e[5]=r[7],e[6]=r[2],e[7]=r[5],e[8]=r[8],this}setUvTransform(e,r,i,n,s,o,a){let c=Math.cos(s),l=Math.sin(s);return this.set(i*c,i*l,-i*(c*o+l*a)+o+e,-n*l,n*c,-n*(-l*o+c*a)+a+r,0,0,1),this}scale(e,r){return Mh("Matrix3: .scale() is deprecated. Use .makeScale() instead."),this.premultiply(zy.makeScale(e,r)),this}rotate(e){return Mh("Matrix3: .rotate() is deprecated. Use .makeRotation() instead."),this.premultiply(zy.makeRotation(-e)),this}translate(e,r){return Mh("Matrix3: .translate() is deprecated. Use .makeTranslation() instead."),this.premultiply(zy.makeTranslation(e,r)),this}makeTranslation(e,r){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,r,0,0,1),this}makeRotation(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,-i,0,i,r,0,0,0,1),this}makeScale(e,r){return this.set(e,0,0,0,r,0,0,0,1),this}equals(e){let r=this.elements,i=e.elements;for(let n=0;n<9;n++)if(r[n]!==i[n])return false;return true}fromArray(e,r=0){for(let i=0;i<9;i++)this.elements[i]=e[i+r];return this}toArray(e=[],r=0){let i=this.elements;return e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}},zy=new Ce,mE=new Ce().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),gE=new Ce().set(3.2409699,-1.5373832,-0.4986108,-0.9692436,1.8759675,.0415551,.0556301,-0.203977,1.0569715);function P$(){let t={enabled:true,workingColorSpace:Qy,spaces:{},convert:function(n,s,o){return this.enabled===false||s===o||!s||!o||(this.spaces[s].transfer===wh&&(n.r=Vn(n.r),n.g=Vn(n.g),n.b=Vn(n.b)),this.spaces[s].primaries!==this.spaces[o].primaries&&(n.applyMatrix3(this.spaces[s].toXYZ),n.applyMatrix3(this.spaces[o].fromXYZ)),this.spaces[o].transfer===wh&&(n.r=$s(n.r),n.g=$s(n.g),n.b=$s(n.b))),n},workingToColorSpace:function(n,s){return this.convert(n,this.workingColorSpace,s)},colorSpaceToWorking:function(n,s){return this.convert(n,s,this.workingColorSpace)},getPrimaries:function(n){return this.spaces[n].primaries},getTransfer:function(n){return n===p0?e0:this.spaces[n].transfer},getToneMappingMode:function(n){return this.spaces[n].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(n,s=this.workingColorSpace){return n.fromArray(this.spaces[s].luminanceCoefficients)},define:function(n){Object.assign(this.spaces,n);},_getMatrix:function(n,s,o){return n.copy(this.spaces[o].fromXYZ).multiply(this.spaces[s].toXYZ)},_getDrawingBufferColorSpace:function(n){return this.spaces[n].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(n=this.workingColorSpace){return this.spaces[n].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],r=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[Qy]:{primaries:e,whitePoint:i,transfer:e0,toXYZ:mE,fromXYZ:gE,luminanceCoefficients:r,workingColorSpaceConfig:{unpackColorSpace:tn},outputColorSpaceConfig:{drawingBufferColorSpace:tn}},[tn]:{primaries:e,whitePoint:i,transfer:wh,toXYZ:mE,fromXYZ:gE,luminanceCoefficients:r,outputColorSpaceConfig:{drawingBufferColorSpace:tn}}}),t}var en=P$();function Vn(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function $s(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}var nn=class t{static{this.prototype.isMatrix4=true;}constructor(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S){this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S);}set(e,r,i,n,s,o,a,c,l,u,d,f,p,g,m,S){let h=this.elements;return h[0]=e,h[4]=r,h[8]=i,h[12]=n,h[1]=s,h[5]=o,h[9]=a,h[13]=c,h[2]=l,h[6]=u,h[10]=d,h[14]=f,h[3]=p,h[7]=g,h[11]=m,h[15]=S,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new t().fromArray(this.elements)}copy(e){let r=this.elements,i=e.elements;return r[0]=i[0],r[1]=i[1],r[2]=i[2],r[3]=i[3],r[4]=i[4],r[5]=i[5],r[6]=i[6],r[7]=i[7],r[8]=i[8],r[9]=i[9],r[10]=i[10],r[11]=i[11],r[12]=i[12],r[13]=i[13],r[14]=i[14],r[15]=i[15],this}copyPosition(e){let r=this.elements,i=e.elements;return r[12]=i[12],r[13]=i[13],r[14]=i[14],this}setFromMatrix3(e){let r=e.elements;return this.set(r[0],r[3],r[6],0,r[1],r[4],r[7],0,r[2],r[5],r[8],0,0,0,0,1),this}extractBasis(e,r,i){return this.determinantAffine()===0?(e.set(1,0,0),r.set(0,1,0),i.set(0,0,1),this):(e.setFromMatrixColumn(this,0),r.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this)}makeBasis(e,r,i){return this.set(e.x,r.x,i.x,0,e.y,r.y,i.y,0,e.z,r.z,i.z,0,0,0,0,1),this}extractRotation(e){if(e.determinantAffine()===0)return this.identity();let r=this.elements,i=e.elements,n=1/Ps.setFromMatrixColumn(e,0).length(),s=1/Ps.setFromMatrixColumn(e,1).length(),o=1/Ps.setFromMatrixColumn(e,2).length();return r[0]=i[0]*n,r[1]=i[1]*n,r[2]=i[2]*n,r[3]=0,r[4]=i[4]*s,r[5]=i[5]*s,r[6]=i[6]*s,r[7]=0,r[8]=i[8]*o,r[9]=i[9]*o,r[10]=i[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromEuler(e){let r=this.elements,i=e.x,n=e.y,s=e.z,o=Math.cos(i),a=Math.sin(i),c=Math.cos(n),l=Math.sin(n),u=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){let f=o*u,p=o*d,g=a*u,m=a*d;r[0]=c*u,r[4]=-c*d,r[8]=l,r[1]=p+g*l,r[5]=f-m*l,r[9]=-a*c,r[2]=m-f*l,r[6]=g+p*l,r[10]=o*c;}else if(e.order==="YXZ"){let f=c*u,p=c*d,g=l*u,m=l*d;r[0]=f+m*a,r[4]=g*a-p,r[8]=o*l,r[1]=o*d,r[5]=o*u,r[9]=-a,r[2]=p*a-g,r[6]=m+f*a,r[10]=o*c;}else if(e.order==="ZXY"){let f=c*u,p=c*d,g=l*u,m=l*d;r[0]=f-m*a,r[4]=-o*d,r[8]=g+p*a,r[1]=p+g*a,r[5]=o*u,r[9]=m-f*a,r[2]=-o*l,r[6]=a,r[10]=o*c;}else if(e.order==="ZYX"){let f=o*u,p=o*d,g=a*u,m=a*d;r[0]=c*u,r[4]=g*l-p,r[8]=f*l+m,r[1]=c*d,r[5]=m*l+f,r[9]=p*l-g,r[2]=-l,r[6]=a*c,r[10]=o*c;}else if(e.order==="YZX"){let f=o*c,p=o*l,g=a*c,m=a*l;r[0]=c*u,r[4]=m-f*d,r[8]=g*d+p,r[1]=d,r[5]=o*u,r[9]=-a*u,r[2]=-l*u,r[6]=p*d+g,r[10]=f-m*d;}else if(e.order==="XZY"){let f=o*c,p=o*l,g=a*c,m=a*l;r[0]=c*u,r[4]=-d,r[8]=l*u,r[1]=f*d+m,r[5]=o*u,r[9]=p*d-g,r[2]=g*d-p,r[6]=a*u,r[10]=m*d+f;}return r[3]=0,r[7]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,this}makeRotationFromQuaternion(e){return this.compose(z$,e,$$)}lookAt(e,r,i){let n=this.elements;return Ht.subVectors(e,r),Ht.lengthSq()===0&&(Ht.z=1),Ht.normalize(),Ur.crossVectors(i,Ht),Ur.lengthSq()===0&&(Math.abs(i.z)===1?Ht.x+=1e-4:Ht.z+=1e-4,Ht.normalize(),Ur.crossVectors(i,Ht)),Ur.normalize(),xh.crossVectors(Ht,Ur),n[0]=Ur.x,n[4]=xh.x,n[8]=Ht.x,n[1]=Ur.y,n[5]=xh.y,n[9]=Ht.y,n[2]=Ur.z,n[6]=xh.z,n[10]=Ht.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,r){let i=e.elements,n=r.elements,s=this.elements,o=i[0],a=i[4],c=i[8],l=i[12],u=i[1],d=i[5],f=i[9],p=i[13],g=i[2],m=i[6],S=i[10],h=i[14],v=i[3],_=i[7],y=i[11],R=i[15],T=n[0],b=n[4],E=n[8],M=n[12],N=n[1],O=n[5],k=n[9],j=n[13],G=n[2],ne=n[6],Me=n[10],ye=n[14],Ue=n[3],ve=n[7],P=n[11],U=n[15];return s[0]=o*T+a*N+c*G+l*Ue,s[4]=o*b+a*O+c*ne+l*ve,s[8]=o*E+a*k+c*Me+l*P,s[12]=o*M+a*j+c*ye+l*U,s[1]=u*T+d*N+f*G+p*Ue,s[5]=u*b+d*O+f*ne+p*ve,s[9]=u*E+d*k+f*Me+p*P,s[13]=u*M+d*j+f*ye+p*U,s[2]=g*T+m*N+S*G+h*Ue,s[6]=g*b+m*O+S*ne+h*ve,s[10]=g*E+m*k+S*Me+h*P,s[14]=g*M+m*j+S*ye+h*U,s[3]=v*T+_*N+y*G+R*Ue,s[7]=v*b+_*O+y*ne+R*ve,s[11]=v*E+_*k+y*Me+R*P,s[15]=v*M+_*j+y*ye+R*U,this}multiplyScalar(e){let r=this.elements;return r[0]*=e,r[4]*=e,r[8]*=e,r[12]*=e,r[1]*=e,r[5]*=e,r[9]*=e,r[13]*=e,r[2]*=e,r[6]*=e,r[10]*=e,r[14]*=e,r[3]*=e,r[7]*=e,r[11]*=e,r[15]*=e,this}determinant(){let e=this.elements,r=e[0],i=e[4],n=e[8],s=e[12],o=e[1],a=e[5],c=e[9],l=e[13],u=e[2],d=e[6],f=e[10],p=e[14],g=e[3],m=e[7],S=e[11],h=e[15],v=c*p-l*f,_=a*p-l*d,y=a*f-c*d,R=o*p-l*u,T=o*f-c*u,b=o*d-a*u;return r*(m*v-S*_+h*y)-i*(g*v-S*R+h*T)+n*(g*_-m*R+h*b)-s*(g*y-m*T+S*b)}determinantAffine(){let e=this.elements,r=e[0],i=e[4],n=e[8],s=e[1],o=e[5],a=e[9],c=e[2],l=e[6],u=e[10];return r*(o*u-a*l)-i*(s*u-a*c)+n*(s*l-o*c)}transpose(){let e=this.elements,r;return r=e[1],e[1]=e[4],e[4]=r,r=e[2],e[2]=e[8],e[8]=r,r=e[6],e[6]=e[9],e[9]=r,r=e[3],e[3]=e[12],e[12]=r,r=e[7],e[7]=e[13],e[13]=r,r=e[11],e[11]=e[14],e[14]=r,this}setPosition(e,r,i){let n=this.elements;return e.isVector3?(n[12]=e.x,n[13]=e.y,n[14]=e.z):(n[12]=e,n[13]=r,n[14]=i),this}invert(){let e=this.elements,r=e[0],i=e[1],n=e[2],s=e[3],o=e[4],a=e[5],c=e[6],l=e[7],u=e[8],d=e[9],f=e[10],p=e[11],g=e[12],m=e[13],S=e[14],h=e[15],v=r*a-i*o,_=r*c-n*o,y=r*l-s*o,R=i*c-n*a,T=i*l-s*a,b=n*l-s*c,E=u*m-d*g,M=u*S-f*g,N=u*h-p*g,O=d*S-f*m,k=d*h-p*m,j=f*h-p*S,G=v*j-_*k+y*O+R*N-T*M+b*E;if(G===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);let ne=1/G;return e[0]=(a*j-c*k+l*O)*ne,e[1]=(n*k-i*j-s*O)*ne,e[2]=(m*b-S*T+h*R)*ne,e[3]=(f*T-d*b-p*R)*ne,e[4]=(c*N-o*j-l*M)*ne,e[5]=(r*j-n*N+s*M)*ne,e[6]=(S*y-g*b-h*_)*ne,e[7]=(u*b-f*y+p*_)*ne,e[8]=(o*k-a*N+l*E)*ne,e[9]=(i*N-r*k-s*E)*ne,e[10]=(g*T-m*y+h*v)*ne,e[11]=(d*y-u*T-p*v)*ne,e[12]=(a*M-o*O-c*E)*ne,e[13]=(r*O-i*M+n*E)*ne,e[14]=(m*_-g*R-S*v)*ne,e[15]=(u*R-d*_+f*v)*ne,this}scale(e){let r=this.elements,i=e.x,n=e.y,s=e.z;return r[0]*=i,r[4]*=n,r[8]*=s,r[1]*=i,r[5]*=n,r[9]*=s,r[2]*=i,r[6]*=n,r[10]*=s,r[3]*=i,r[7]*=n,r[11]*=s,this}getMaxScaleOnAxis(){let e=this.elements,r=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],n=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(r,i,n))}makeTranslation(e,r,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,r,0,0,1,i,0,0,0,1),this}makeRotationX(e){let r=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,r,-i,0,0,i,r,0,0,0,0,1),this}makeRotationY(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,0,i,0,0,1,0,0,-i,0,r,0,0,0,0,1),this}makeRotationZ(e){let r=Math.cos(e),i=Math.sin(e);return this.set(r,-i,0,0,i,r,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,r){let i=Math.cos(r),n=Math.sin(r),s=1-i,o=e.x,a=e.y,c=e.z,l=s*o,u=s*a;return this.set(l*o+i,l*a-n*c,l*c+n*a,0,l*a+n*c,u*a+i,u*c-n*o,0,l*c-n*a,u*c+n*o,s*c*c+i,0,0,0,0,1),this}makeScale(e,r,i){return this.set(e,0,0,0,0,r,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,r,i,n,s,o){return this.set(1,i,s,0,e,1,o,0,r,n,1,0,0,0,0,1),this}compose(e,r,i){let n=this.elements,s=r._x,o=r._y,a=r._z,c=r._w,l=s+s,u=o+o,d=a+a,f=s*l,p=s*u,g=s*d,m=o*u,S=o*d,h=a*d,v=c*l,_=c*u,y=c*d,R=i.x,T=i.y,b=i.z;return n[0]=(1-(m+h))*R,n[1]=(p+y)*R,n[2]=(g-_)*R,n[3]=0,n[4]=(p-y)*T,n[5]=(1-(f+h))*T,n[6]=(S+v)*T,n[7]=0,n[8]=(g+_)*b,n[9]=(S-v)*b,n[10]=(1-(f+m))*b,n[11]=0,n[12]=e.x,n[13]=e.y,n[14]=e.z,n[15]=1,this}decompose(e,r,i){let n=this.elements;e.x=n[12],e.y=n[13],e.z=n[14];let s=this.determinantAffine();if(s===0)return i.set(1,1,1),r.identity(),this;let o=Ps.set(n[0],n[1],n[2]).length(),a=Ps.set(n[4],n[5],n[6]).length(),c=Ps.set(n[8],n[9],n[10]).length();s<0&&(o=-o),pn.copy(this);let l=1/o,u=1/a,d=1/c;return pn.elements[0]*=l,pn.elements[1]*=l,pn.elements[2]*=l,pn.elements[4]*=u,pn.elements[5]*=u,pn.elements[6]*=u,pn.elements[8]*=d,pn.elements[9]*=d,pn.elements[10]*=d,r.setFromRotationMatrix(pn),i.x=o,i.y=a,i.z=c,this}makePerspective(e,r,i,n,s,o,a=$a,c=false){let l=this.elements,u=2*s/(r-e),d=2*s/(i-n),f=(r+e)/(r-e),p=(i+n)/(i-n),g,m;if(c)g=s/(o-s),m=o*s/(o-s);else if(a===$a)g=-(o+s)/(o-s),m=-2*o*s/(o-s);else if(a===t0)g=-o/(o-s),m=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=f,l[12]=0,l[1]=0,l[5]=d,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=g,l[14]=m,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,r,i,n,s,o,a=$a,c=false){let l=this.elements,u=2/(r-e),d=2/(i-n),f=-(r+e)/(r-e),p=-(i+n)/(i-n),g,m;if(c)g=1/(o-s),m=o/(o-s);else if(a===$a)g=-2/(o-s),m=-(o+s)/(o-s);else if(a===t0)g=-1/(o-s),m=-s/(o-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=u,l[4]=0,l[8]=0,l[12]=f,l[1]=0,l[5]=d,l[9]=0,l[13]=p,l[2]=0,l[6]=0,l[10]=g,l[14]=m,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){let r=this.elements,i=e.elements;for(let n=0;n<16;n++)if(r[n]!==i[n])return false;return true}fromArray(e,r=0){for(let i=0;i<16;i++)this.elements[i]=e[i+r];return this}toArray(e=[],r=0){let i=this.elements;return e[r]=i[0],e[r+1]=i[1],e[r+2]=i[2],e[r+3]=i[3],e[r+4]=i[4],e[r+5]=i[5],e[r+6]=i[6],e[r+7]=i[7],e[r+8]=i[8],e[r+9]=i[9],e[r+10]=i[10],e[r+11]=i[11],e[r+12]=i[12],e[r+13]=i[13],e[r+14]=i[14],e[r+15]=i[15],e}},Ps=new qe,pn=new nn,z$=new qe(0,0,0),$$=new qe(1,1,1),Ur=new qe,xh=new qe,Ht=new qe;new nn;new nn;var kE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Fr={h:0,s:0,l:0},Th={h:0,s:0,l:0};function ky(t,e,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?t+(e-t)*6*r:r<1/2?e:r<2/3?t+(e-t)*6*(2/3-r):t}var ft=class{constructor(e,r,i){return this.isColor=true,this.r=1,this.g=1,this.b=1,this.set(e,r,i)}set(e,r,i){if(r===void 0&&i===void 0){let n=e;n&&n.isColor?this.copy(n):typeof n=="number"?this.setHex(n):typeof n=="string"&&this.setStyle(n);}else this.setRGB(e,r,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,r=tn){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,en.colorSpaceToWorking(this,r),this}setRGB(e,r,i,n=en.workingColorSpace){return this.r=e,this.g=r,this.b=i,en.colorSpaceToWorking(this,n),this}setHSL(e,r,i,n=en.workingColorSpace){if(e=C$(e,1),r=De(r,0,1),i=De(i,0,1),r===0)this.r=this.g=this.b=i;else {let s=i<=.5?i*(1+r):i+r-i*r,o=2*i-s;this.r=ky(o,s,e+1/3),this.g=ky(o,s,e),this.b=ky(o,s,e-1/3);}return en.colorSpaceToWorking(this,n),this}setStyle(e,r=tn){function i(s){s!==void 0&&parseFloat(s)<1&&Rt("Color: Alpha component of "+e+" will be ignored.");}let n;if(n=/^(\w+)\(([^\)]*)\)/.exec(e)){let s,o=n[1],a=n[2];switch(o){case "rgb":case "rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,r);if(s=/^\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec(a))return i(s[4]),this.setRGB(Math.min(100,parseFloat(s[1]))/100,Math.min(100,parseFloat(s[2]))/100,Math.min(100,parseFloat(s[3]))/100,r);break;case "hsl":case "hsla":if(s=/^\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec(a))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,r);break;default:Rt("Color: Unknown color model "+e);}}else if(n=/^\#([A-Fa-f\d]+)$/.exec(e)){let s=n[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,r);if(o===6)return this.setHex(parseInt(s,16),r);Rt("Color: Invalid hex color "+e);}else if(e&&e.length>0)return this.setColorName(e,r);return this}setColorName(e,r=tn){let i=kE[e.toLowerCase()];return i!==void 0?this.setHex(i,r):Rt("Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Vn(e.r),this.g=Vn(e.g),this.b=Vn(e.b),this}copyLinearToSRGB(e){return this.r=$s(e.r),this.g=$s(e.g),this.b=$s(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=tn){return en.workingToColorSpace(Tt.copy(this),e),Math.round(De(Tt.r*255,0,255))*65536+Math.round(De(Tt.g*255,0,255))*256+Math.round(De(Tt.b*255,0,255))}getHexString(e=tn){return ("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,r=en.workingColorSpace){en.workingToColorSpace(Tt.copy(this),r);let i=Tt.r,n=Tt.g,s=Tt.b,o=Math.max(i,n,s),a=Math.min(i,n,s),c,l,u=(a+o)/2;if(a===o)c=0,l=0;else {let d=o-a;switch(l=u<=.5?d/(o+a):d/(2-o-a),o){case i:c=(n-s)/d+(n<s?6:0);break;case n:c=(s-i)/d+2;break;case s:c=(i-n)/d+4;break}c/=6;}return e.h=c,e.s=l,e.l=u,e}getRGB(e,r=en.workingColorSpace){return en.workingToColorSpace(Tt.copy(this),r),e.r=Tt.r,e.g=Tt.g,e.b=Tt.b,e}getStyle(e=tn){en.workingToColorSpace(Tt.copy(this),e);let r=Tt.r,i=Tt.g,n=Tt.b;return e!==tn?`color(${e} ${r.toFixed(3)} ${i.toFixed(3)} ${n.toFixed(3)})`:`rgb(${Math.round(r*255)},${Math.round(i*255)},${Math.round(n*255)})`}offsetHSL(e,r,i){return this.getHSL(Fr),this.setHSL(Fr.h+e,Fr.s+r,Fr.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,r){return this.r=e.r+r.r,this.g=e.g+r.g,this.b=e.b+r.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,r){return this.r+=(e.r-this.r)*r,this.g+=(e.g-this.g)*r,this.b+=(e.b-this.b)*r,this}lerpColors(e,r,i){return this.r=e.r+(r.r-e.r)*i,this.g=e.g+(r.g-e.g)*i,this.b=e.b+(r.b-e.b)*i,this}lerpHSL(e,r){this.getHSL(Fr),e.getHSL(Th);let i=Ny(Fr.h,Th.h,r),n=Ny(Fr.s,Th.s,r),s=Ny(Fr.l,Th.l,r);return this.setHSL(i,n,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){let r=this.r,i=this.g,n=this.b,s=e.elements;return this.r=s[0]*r+s[3]*i+s[6]*n,this.g=s[1]*r+s[4]*i+s[7]*n,this.b=s[2]*r+s[5]*i+s[8]*n,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,r=0){return this.r=e[r],this.g=e[r+1],this.b=e[r+2],this}toArray(e=[],r=0){return e[r]=this.r,e[r+1]=this.g,e[r+2]=this.b,e}fromBufferAttribute(e,r){return this.r=e.getX(r),this.g=e.getY(r),this.b=e.getZ(r),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b;}},Tt=new ft;ft.NAMES=kE;function UE(t){let e={};for(let r in t){e[r]={};for(let i in t[r]){let n=t[r][i];if(RE(n))n.isRenderTargetTexture?(Rt("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[r][i]=null):e[r][i]=n.clone();else if(Array.isArray(n))if(RE(n[0])){let s=[];for(let o=0,a=n.length;o<a;o++)s[o]=n[o].clone();e[r][i]=s;}else e[r][i]=n.slice();else e[r][i]=n;}}return e}function Nt(t){let e={};for(let r=0;r<t.length;r++){let i=UE(t[r]);for(let n in i)e[n]=i[n];}return e}function RE(t){return t&&(t.isColor||t.isMatrix3||t.isMatrix4||t.isVector2||t.isVector3||t.isVector4||t.isTexture||t.isQuaternion)}var g0="\\[\\]\\.:\\/",_0="[^"+g0+"]",j$="[^"+g0.replace("\\.","")+"]";/((?:WC+[\/:])*)/.source.replace("WC",_0);/(WCOD+)?/.source.replace("WCOD",j$);/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",_0);/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",_0);typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:"187"}}));typeof window<"u"&&(window.__THREE__?Rt("WARNING: Multiple instances of Three.js being imported."):window.__THREE__="187");var yk=`#define STANDARD
|
|
77
77
|
varying vec3 vViewPosition;
|
|
78
78
|
#ifdef USE_TRANSMISSION
|
|
79
79
|
varying vec3 vWorldPosition;
|
|
@@ -116,7 +116,7 @@ void main() {
|
|
|
116
116
|
#ifdef USE_TRANSMISSION
|
|
117
117
|
vWorldPosition = worldPosition.xyz;
|
|
118
118
|
#endif
|
|
119
|
-
}`,
|
|
119
|
+
}`,Sk=`#define STANDARD
|
|
120
120
|
#ifdef PHYSICAL
|
|
121
121
|
#define IOR
|
|
122
122
|
#define USE_SPECULAR
|
|
@@ -143,9 +143,18 @@ uniform float opacity;
|
|
|
143
143
|
uniform float clearcoat;
|
|
144
144
|
uniform float clearcoatRoughness;
|
|
145
145
|
#endif
|
|
146
|
+
#ifdef USE_DIFFUSE_ROUGHNESS
|
|
147
|
+
uniform float diffuseRoughness;
|
|
148
|
+
#ifdef USE_DIFFUSE_ROUGHNESSMAP
|
|
149
|
+
uniform sampler2D diffuseRoughnessMap;
|
|
150
|
+
#endif
|
|
151
|
+
#endif
|
|
146
152
|
#ifdef USE_DISPERSION
|
|
147
153
|
uniform float dispersion;
|
|
148
154
|
#endif
|
|
155
|
+
#ifdef USE_RETROREFLECTION
|
|
156
|
+
uniform float retroreflectivity;
|
|
157
|
+
#endif
|
|
149
158
|
#ifdef USE_IRIDESCENCE
|
|
150
159
|
uniform float iridescence;
|
|
151
160
|
uniform float iridescenceIOR;
|
|
@@ -181,7 +190,6 @@ varying vec3 vViewPosition;
|
|
|
181
190
|
#include <lightmap_pars_fragment>
|
|
182
191
|
#include <emissivemap_pars_fragment>
|
|
183
192
|
#include <iridescence_fragment>
|
|
184
|
-
#include <cube_uv_reflection_fragment>
|
|
185
193
|
#include <envmap_common_pars_fragment>
|
|
186
194
|
#include <envmap_physical_pars_fragment>
|
|
187
195
|
#include <fog_pars_fragment>
|
|
@@ -241,12 +249,12 @@ void main() {
|
|
|
241
249
|
#include <fog_fragment>
|
|
242
250
|
#include <premultiplied_alpha_fragment>
|
|
243
251
|
#include <dithering_fragment>
|
|
244
|
-
}`,$e={meshphysical_vert:g2,meshphysical_frag:_2},ae={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ne},alphaMap:{value:null},alphaMapTransform:{value:new Ne},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ne}},envmap:{envMap:{value:null},envMapRotation:{value:new Ne},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ne}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ne}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ne},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ne},normalScale:{value:new mn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ne},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ne}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ne}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ne}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:null},probesMin:{value:new Ue},probesMax:{value:new Ue},probesResolution:{value:new Ue}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ne},alphaTest:{value:0},uvTransform:{value:new Ne}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new mn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ne},alphaMap:{value:null},alphaMapTransform:{value:new Ne},alphaTest:{value:0}}},FE={basic:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.fog])},lambert:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},envMapIntensity:{value:1}}])},phong:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30},envMapIntensity:{value:1}}])},standard:{uniforms:Nt([ae.common,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.roughnessmap,ae.metalnessmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}])},toon:{uniforms:Nt([ae.common,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.gradientmap,ae.fog,ae.lights,{emissive:{value:new ft(0)}}])},matcap:{uniforms:Nt([ae.common,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,{matcap:{value:null}}])},points:{uniforms:Nt([ae.points,ae.fog])},dashed:{uniforms:Nt([ae.common,ae.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}])},depth:{uniforms:Nt([ae.common,ae.displacementmap])},normal:{uniforms:Nt([ae.common,ae.bumpmap,ae.normalmap,ae.displacementmap,{opacity:{value:1}}])},sprite:{uniforms:Nt([ae.sprite,ae.fog])},background:{uniforms:{uvTransform:{value:new Ne}}},backgroundCube:{uniforms:{backgroundRotation:{value:new Ne}}},distance:{uniforms:Nt([ae.common,ae.displacementmap,{referencePosition:{value:new Ue},nearDistance:{value:1},farDistance:{value:1e3}}])},shadow:{uniforms:Nt([ae.lights,ae.fog,{color:{value:new ft(0)},opacity:{value:1}}])}};FE.physical={uniforms:Nt([FE.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ne},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ne},clearcoatNormalScale:{value:new mn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ne},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ne},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ne},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ne},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ne},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ne},transmissionSamplerSize:{value:new mn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ne},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ne},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ne},anisotropyVector:{value:new mn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ne}}]),vertexShader:$e.meshphysical_vert,fragmentShader:$e.meshphysical_frag};var w2=new Ne;w2.set(-1,0,0,0,1,0,0,0,1);var M2=new Ne;M2.set(-1,0,0,0,1,0,0,0,1);var A2=t=>{let e=t.toLowerCase();if(e==="left")return t==="LEFT"?"RIGHT":"Right";if(e==="right")return t==="RIGHT"?"LEFT":"Left"};function BE(t){let e=t.replace(/left|right/giu,i=>A2(i)??i);if(e!==t)return e;let r=t.replace(/(^|[._\s-])([lrLR])(?=$|[._\s-]|\d)/gu,(i,n,s)=>`${n}${s==="L"?"R":s==="R"?"L":s==="l"?"r":"l"}`);return r===t?void 0:r}function VE(t,e){let r=[],i=[];return t.forEach((n,s)=>{let o=e(n);o!==void 0&&(r.push(s),i.push(o));}),{source:r,times:i}}function jE(t,e){let r=new Ue(t[0]??0,t[1]??0,t[2]??0).applyQuaternion(new Pt(e[0]??0,e[1]??0,e[2]??0,e[3]??1).invert());return [r.x,r.y,r.z]}var I2=()=>new Jt().registerExtensions(Qt);function gn(t,e,r){let{times:i,values:n}=t,s=i.length,o=t.interpolation==="CUBICSPLINE",a=o?e*3:e,c=(_,y)=>n[_*a+(o?e:0)+y]??0,l=i[0]??0,u=i[s-1]??l,d=_=>Array.from({length:e},(y,R)=>c(_,R));if(s===0)return new Array(e).fill(0);if(r<=l)return d(0);if(r>=u)return d(s-1);let f=1;for(;f<s&&(i[f]??0)<r;)f+=1;let p=f-1,g=i[p]??0,m=i[f]??g,S=d(p);if(t.interpolation==="STEP"||m-g<=1e-9)return S;let h=(r-g)/(m-g),v=d(f);return S.map((_,y)=>_+((v[y]??0)-_)*h)}function C2(t,e,r){let i=e.get(t.getName()),n=[...t.getTranslation()],s=[...t.getRotation()],o=[...t.getScale()],a=i?.get("translation");a!==void 0&&n.splice(0,3,...gn(a,3,r));let c=i?.get("rotation");c!==void 0&&s.splice(0,4,...gn(c,4,r));let l=i?.get("scale");return l!==void 0&&o.splice(0,3,...gn(l,3,r)),{matrix:new nn().compose(new Ue(n[0]??0,n[1]??0,n[2]??0),new Pt(s[0]??0,s[1]??0,s[2]??0,s[3]??1),new Ue(o[0]??1,o[1]??1,o[2]??1)),translation:n}}function GE(t,e){let r=0;for(let i of e.get(t.getName())?.values()??[])r=Math.max(r,i.times.at(-1)??0);for(let i of t.listChildren())r=Math.max(r,GE(i,e));return r}async function Vh(t,e,r=30){return v0(await I2().read(t),e,r)}function v0(t,e,r=30){let i=t.getRoot().listAnimations().find(p=>p.getName()===e);if(i===void 0){let p=t.getRoot().listAnimations().map(g=>g.getName());throw new Error(`The GLB has no clip '${e}'. It carries: ${p.length===0?"none":p.join(", ")}.`)}let n=new Map;for(let p of i.listChannels()){let g=p.getTargetNode(),m=p.getSampler(),S=p.getTargetPath();if(g===null||m===null||S===null)continue;let h=m.getInput()?.getArray(),v=m.getOutput()?.getArray();if(h==null||v===null||v===void 0)continue;let _=n.get(g.getName())??new Map;_.set(S,{interpolation:m.getInterpolation(),times:h,values:v}),n.set(g.getName(),_);}let s=t.getRoot().listScenes().flatMap(p=>p.listChildren()),o=s.reduce((p,g)=>Math.max(p,GE(g,n)),0),a=t.getRoot().listSkins().flatMap(p=>p.listJoints()).map(p=>p.getName()),c=new Set(a.length>0?a:t.getRoot().listNodes().map(p=>p.getName()).filter(p=>p.length>0)),l=[...c],u={},d=Math.max(1,Math.round(o*r)),f=[];for(let p=0;p<=d;p+=1){let g=Math.min(o,p/r),m={},S={},h={},v=(_,y,R)=>{let T=y.clone().multiply(C2(_,n,g).matrix),b=_.getName();if(c.has(b)){let E=new Ue().setFromMatrixPosition(T),M=new Pt().setFromRotationMatrix(T),N=new Pt().setFromRotationMatrix(y);m[b]=[E.x,E.y,E.z],S[b]=[M.x,M.y,M.z,M.w],h[b]=[N.x,N.y,N.z,N.w],R!==void 0&&c.has(R)&&(u[b]=R);}for(let E of _.listChildren())v(E,T,b);};for(let _ of s)v(_,new nn);f.push({parents:h,positions:m,rotations:S,time:g});}return {bones:l,duration:o,fps:r,frames:f,parentsOf:u}}var P2=()=>new Jt().registerExtensions(Qt),jh=t=>t==="rotation"?4:3;function xi(t){let e=t.getSampler(),r=e?.getInput()?.getArray(),i=e?.getOutput()?.getArray();if(!(e===null||r===null||r===void 0||i===null||i===void 0))return {interpolation:e.getInterpolation(),times:r,values:i}}function Fa(t,e,r,i,n){let s=e.getSampler();if(s===null)return;let o=t.getRoot().listBuffers()[0]??t.createBuffer(),a=t.createAccessor(`${e.getTargetNode()?.getName()}.time`).setType("SCALAR").setArray(new Float32Array(r)).setBuffer(o),c=t.createAccessor(`${e.getTargetNode()?.getName()}.${e.getTargetPath()}`).setType(n===4?"VEC4":"VEC3").setArray(new Float32Array(i)).setBuffer(o);s.setInput(a).setOutput(c).setInterpolation("LINEAR");}function HE(t,e,r,i){for(let n of e.listChannels()){let s=xi(n);if(s===void 0)continue;let o=n.getTargetPath()??"translation",a=jh(o),c=s.interpolation==="CUBICSPLINE",l=c?a*3:a,{source:u,times:d}=VE([...s.times],r);if(d.length===0)throw new Error(`'${e.getName()}' keeps no keyframes in that window; the edit would leave an empty clip.`);let f=[];for(let p of u)for(let g=0;g<l;g+=1)f.push(s.values[p*l+g]??0);if(i!==void 0){let p=gn(s,a,0),g=i,m=d.findIndex(v=>v>g),S=m===-1?d.length:m;d.splice(S,0,g);let h=c?Array.from({length:3*a},(v,_)=>_>=a&&_<a*2?p[_-a]??0:0):p;f.splice(S*l,0,...h);}Fa(t,n,d,f,a),c?n.getSampler()?.setInterpolation("CUBICSPLINE"):s.interpolation==="STEP"&&n.getSampler()?.setInterpolation("STEP");}}function N2(t){let e=0;for(let r of t.listChannels())e=Math.max(e,xi(r)?.times.at(-1)??0);return e}function O2(t,e,r,i){for(let n of e.listChannels()){let s=xi(n);if(s===void 0)continue;let o=jh(n.getTargetPath()??"translation"),a=s.interpolation==="CUBICSPLINE",c=a?o*3:o,u=[...gn(s,o,r),...a?new Array(o).fill(0):[]],d=[...gn(s,o,i),...a?new Array(o).fill(0):[]],f=[0],p=[...u];for(let g=0;g<s.times.length;g+=1){let m=s.times[g]??0;if(!(m<=r||m>=i)){f.push(m-r);for(let S=0;S<c;S+=1)p.push(s.values[g*c+S]??0);}}f.push(i-r),p.push(...d),Fa(t,n,f,p,o),a&&n.getSampler()?.setInterpolation("CUBICSPLINE");}}function z2(t,e,r){let i=e.listChannels(),n=0;for(let a of i){let c=xi(a);c!==void 0&&(n=Math.max(n,c.times.at(-1)??0));}let s=Math.max(1,Math.round(n*r)),o=Array.from({length:s+1},(a,c)=>Math.min(n,c/r));for(let a of i){let c=xi(a);if(c===void 0)continue;let l=jh(a.getTargetPath()??"translation"),u=o.flatMap(d=>gn(c,l,d));Fa(t,a,o,u,l);}}function $2(t,e){let r=new Map(t.getRoot().listNodes().map(i=>[i.getName(),i]));for(let i of e.listChannels()){let n=i.getTargetNode(),s=xi(i);if(n===null||s===void 0)continue;let o=i.getTargetPath()??"translation",a=jh(o),c=[];for(let d=0;d+a<=s.values.length;d+=a){let f=Array.from({length:a},(p,g)=>s.values[d+g]??0);o==="translation"&&(f[0]=-(f[0]??0)),o==="rotation"&&(f[1]=-(f[1]??0),f[2]=-(f[2]??0)),c.push(...f);}Fa(t,i,[...s.times],c,a);let l=BE(n.getName()),u=l===void 0?void 0:r.get(l);u!==void 0&&i.setTargetNode(u);}}function k2(t,e,r){let i=v0(t,e.getName()),n=r.feet.length>0?r.feet:i.bones.filter(s=>/foot/iu.test(s));if(n.length===0)throw new Error("No foot bones to lock: name them with 'feet'.");for(let s of n){let o=i.frames.map(g=>g.positions[s]?.[1]??0),a=Math.min(...o),c=e.listChannels().find(g=>g.getTargetNode()?.getName()===s&&g.getTargetPath()==="translation");if(c===void 0)continue;let l=xi(c);if(l===void 0)continue;let u=[],d=[],f,p=false;i.frames.forEach((g,m)=>{let S=g.positions[s];if(S===void 0)return;(S[1]??0)<=a+r.contact?(f??=S,p=true):(p=false,f=void 0);let v=p&&f!==void 0?[(f[0]??0)-(S[0]??0),0,(f[2]??0)-(S[2]??0)]:[0,0,0],_=jE(v,g.parents[s]??[0,0,0,1]);u.push(g.time),d.push((gn(l,3,g.time)[0]??0)+_[0],(gn(l,3,g.time)[1]??0)+_[1],(gn(l,3,g.time)[2]??0)+_[2]);}),Fa(t,c,u,d,3);}}function D2(t,e,r){switch(r.kind){case "trim":{if(r.end<=r.start)throw new Error("trim needs an end after its start.");let i=N2(e);if(r.start>=i||r.end>i+1e-6)throw new Error(`trim asks for ${r.start}\u2013${r.end}s but '${e.getName()}' is ${i}s long.`);O2(t,e,r.start,r.end);return}case "retime":if(!(r.speed>0))throw new Error("retime needs a speed above zero.");HE(t,e,i=>i/r.speed);return;case "loop-point":HE(t,e,i=>i<=r.time?i:void 0,r.time);return;case "resample":if(!(r.fps>0))throw new Error("resample needs an fps above zero.");z2(t,e,r.fps);return;case "mirror":$2(t,e);return;case "foot-lock":k2(t,e,r);return}}function qE(t,e,r){let i=t.getRoot().listAnimations().filter(n=>n.getName()===e);if(i.length===0)throw new Error(`The GLB has no clip '${e}' to edit.`);for(let n of r)for(let s of i)D2(t,s,n);}async function WE(t){return P2().read(t)}function L2(t){let e=new Map;for(let r of t)r.op==="modify"&&e.set(r.clip,[...e.get(r.clip)??[],r.edit]);return e}async function KE(t,e){let r=await WE(t.host),i=t.ops.some(o=>o.op==="attach")?await Ay(r,t):void 0,n=L2(t.ops);for(let[o,a]of n)qE(r,o,a);return await new Jt().registerExtensions(Qt).write(e,r),{clips:i?.clips??[],edits:[...n.values()].reduce((o,a)=>o+a.length,0),file:e,modified:[...n.keys()]}}var Ls=Object.freeze({contact:.03,jitter:.05,penetration:.01,seam:5,skate:.02,stretch:.02}),y0=(t,e)=>Math.hypot((t[0]??0)-(e[0]??0),(t[1]??0)-(e[1]??0),(t[2]??0)-(e[2]??0)),U2=(t,e)=>Math.hypot((t[0]??0)-(e[0]??0),(t[2]??0)-(e[2]??0));function F2(t,e){let r=n=>Math.hypot(n[0]??0,n[1]??0,n[2]??0,n[3]??1)||1,i=((t[0]??0)*(e[0]??0)+(t[1]??0)*(e[1]??0)+(t[2]??0)*(e[2]??0)+(t[3]??1)*(e[3]??1))/(r(t)*r(e));return 2*Math.acos(Math.min(1,Math.abs(i)))*180/Math.PI}function S0(t,e=2){let r=[],i,n;for(let s of t)(i===void 0||n===void 0||s-n>e)&&(i!==void 0&&n!==void 0&&r.push({from:i,to:n}),i=s),n=s;return i!==void 0&&n!==void 0&&r.push({from:i,to:n}),r}function B2(t,e,r,i){let n=[];for(let s of e){let o=t.frames.map(p=>p.positions[s]?.[1]??0),a=Math.min(...o),c=t.frames.map((p,g)=>({index:g,frame:p})).filter(({frame:p})=>(p.positions[s]?.[1]??0)<=a+i),l,u,d=()=>{u!==void 0&&(u.worst>r&&n.push({bone:s,detail:`the planted foot slid ${(u.worst*1e3).toFixed(0)} mm between frames ${u.first} and ${u.last}`,fromFrame:u.first,fromTime:t.frames[u.first]?.time??0,kind:"foot-skate",limit:r,measured:u.worst,toFrame:u.last,toTime:t.frames[u.last]?.time??0}),u=void 0,l=void 0);},f;for(let{index:p,frame:g}of c){f!==void 0&&p-f>1&&d(),l??=g;let m=U2(g.positions[s]??[0,0,0],l.positions[s]??[0,0,0]);u??={first:p,last:p,worst:0},u.last=p,u.worst=Math.max(u.worst,m),f=p;}d();}return n}function V2(t,e,r){let i=[];for(let n of e){let s=t.frames.map((o,a)=>({index:a,y:o.positions[n]?.[1]})).filter(({y:o})=>o!==void 0&&o<-r);for(let o of S0(s.map(({index:a})=>a))){let a=s.filter(({index:c})=>c>=o.from&&c<=o.to).reduce((c,{y:l})=>Math.min(c,l??0),0);i.push({bone:n,detail:`reaches ${(Math.abs(a)*1e3).toFixed(0)} mm below the floor`,fromFrame:o.from,fromTime:t.frames[o.from]?.time??0,kind:"ground-penetration",limit:r,measured:Math.abs(a),toFrame:o.to,toTime:t.frames[o.to]?.time??0});}}return i}function j2(t,e){let r=t.frames[0],i=t.frames.at(-1);if(r===void 0||i===void 0||t.frames.length<3)return [];let n,s=0;for(let o of t.bones){let a=r.rotations[o],c=i.rotations[o];if(a===void 0||c===void 0)continue;let l=F2(a,c);l<=e||(s+=1,(n===void 0||l>n.angle)&&(n={angle:l,bone:o}));}return n===void 0?[]:[{bone:n.bone,detail:`the clip ends ${n.angle.toFixed(1)}\xB0 from where it started${s>1?`, and ${s-1} more bones with it`:""}`,fromFrame:0,fromTime:r.time,kind:"loop-seam",limit:e,measured:n.angle,toFrame:t.frames.length-1,toTime:i.time}]}function G2(t,e,r){let i=[];for(let n of e){let s=t.frames.map(l=>l.positions[n]),o=[],a=new Map,c=0;for(let l=1;l<s.length-1;l+=1){let u=s[l-1],d=s[l],f=s[l+1];if(u===void 0||d===void 0||f===void 0)continue;let p=y0([2*(d[0]??0)-(u[0]??0),2*(d[1]??0)-(u[1]??0),2*(d[2]??0)-(u[2]??0)],[f[0]??0,f[1]??0,f[2]??0]);p>r&&(o.push(l),a.set(l,Math.max(a.get(l)??0,p)),c=Math.max(c,p));}for(let l of S0(o.map(u=>u)))i.push({bone:n,detail:`a frame-direction spike of ${((a.get(l.from)??c)*1e3).toFixed(0)} mm`,fromFrame:l.from,fromTime:t.frames[l.from]?.time??0,kind:"jitter",limit:r,measured:c,toFrame:l.to,toTime:t.frames[l.to]?.time??0});}return i}function H2(t,e){let r=t.frames[0];if(r===void 0)return [];let i=[];for(let[n,s]of Object.entries(t.parentsOf)){let o=y0(r.positions[n]??[0,0,0],r.positions[s]??[0,0,0]);if(o<=1e-6)continue;let a=t.frames.map((l,u)=>({index:u,ratio:Math.abs(y0(l.positions[n]??[0,0,0],l.positions[s]??[0,0,0])/o-1)})).filter(({ratio:l})=>l>e);if(a.length===0)continue;let c=a.reduce((l,{ratio:u})=>Math.max(l,u),0);for(let l of S0(a.map(({index:u})=>u)))i.push({bone:n,detail:`distance to its parent '${s}' changes by ${(c*100).toFixed(1)}%`,fromFrame:l.from,fromTime:t.frames[l.from]?.time??0,kind:"bone-stretch",limit:e,measured:c,toFrame:l.to,toTime:t.frames[l.to]?.time??0});}return i}var q2=new Set(["left-foot","right-foot"]);async function ZE(t,e,r={}){let i=r.scale??1,n={contact:(r.thresholds?.contact??Ls.contact)/i,jitter:(r.thresholds?.jitter??Ls.jitter)/i,penetration:(r.thresholds?.penetration??Ls.penetration)/i,seam:r.thresholds?.seam??Ls.seam,skate:(r.thresholds?.skate??Ls.skate)/i,stretch:r.thresholds?.stretch??Ls.stretch},s=await Vh(t,e,r.fps??30),o=Sh(s.bones).filter(c=>q2.has(c.id)).map(c=>c.node),a=[...B2(s,o,n.skate,n.contact),...V2(s,s.bones,n.penetration),...j2(s,n.seam),...G2(s,s.bones,n.jitter),...H2(s,n.stretch)];return {bones:s.bones.length,clip:e,defects:a,duration:s.duration,file:t,fps:s.fps,frames:s.frames.length,passed:a.length===0,scale:i,thresholds:n}}var K2=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e+=1){let r=e;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r>>>0;}return t})();function Z2(t){let e=4294967295;for(let r of t)e=(K2[(e^r)&255]??0)^e>>>8;return (e^4294967295)>>>0}function x0(t,e){let r=Buffer.alloc(4);r.writeUInt32BE(e.length,0);let i=Buffer.concat([Buffer.from(t,"ascii"),Buffer.from(e)]),n=Buffer.alloc(4);return n.writeUInt32BE(Z2(i),0),Buffer.concat([r,i,n])}function XE(t,e,r){let i=Buffer.alloc(13);i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=8,i[9]=6,i[10]=0,i[11]=0,i[12]=0;let n=t*4,s=Buffer.alloc((n+1)*e);for(let o=0;o<e;o+=1)s[o*(n+1)]=0,Buffer.from(r.buffer,r.byteOffset+o*n,n).copy(s,o*(n+1)+1);return Buffer.concat([Buffer.from([137,80,78,71,13,10,26,10]),x0("IHDR",i),x0("IDAT",deflateSync(s,{level:9})),x0("IEND",new Uint8Array)])}var b0=[9,13,11],Y2=[183,243,74],Q2=[39,48,44];function YE(t,e,r,i){let[n,s]=e,[o,a]=r,c=Math.max(1,Math.ceil(Math.max(Math.abs(o-n),Math.abs(a-s))));for(let l=0;l<=c;l+=1){let u=Math.round(n+(o-n)*l/c),d=Math.round(s+(a-s)*l/c);if(u<0||d<0||u>=t.width||d>=t.height)continue;let f=t.width*d+u<<2;t.data[f]=i[0]??0,t.data[f+1]=i[1]??0,t.data[f+2]=i[2]??0,t.data[f+3]=255;}}async function QE(t){let e=await Vh(t.file,t.clip,t.fps??30),r=Math.max(1,t.columns??6),i=Math.max(48,t.height??160),n=Math.min(r,e.frames.length),s=Math.max(1,Math.floor((e.frames.length-1)/Math.max(1,n-1))),o=Array.from({length:n},(_,y)=>Math.min(e.frames.length-1,y*s)),a={data:new Uint8Array(i*n*i*4),height:i,width:i*n};for(let _=0;_<a.width*a.height;_+=1){let y=_<<2;a.data[y]=b0[0],a.data[y+1]=b0[1],a.data[y+2]=b0[2],a.data[y+3]=255;}let c=o.flatMap(_=>e.bones.map(y=>e.frames[_]?.positions[y]).filter(y=>y!==void 0)),l=c.map(_=>_[0]),u=c.map(_=>_[1]),d=Math.min(...l,0),f=Math.max(...l,1),p=Math.min(...u,0),g=Math.max(...u,1),m=Math.max(1e-6,Math.max(f-d,g-p)),S=i*.12,h=(_,y,R)=>[Math.round(R*i+S+(_-d)/m*(i-S*2)),Math.round(i-S-(y-p)/m*(i-S*2))];o.forEach((_,y)=>{let R=e.frames[_];if(R!==void 0){YE(a,h(d,p,y),h(f,p,y),Q2);for(let T of e.bones){let b=R.positions[T];b!==void 0&&YE(a,h(b[0],0,y),h(b[0],b[1],y),Y2);}}});let v=XE(a.width,a.height,a.data);return await mkdir(Gr.dirname(Gr.resolve(t.output)),{recursive:true}),await writeFile(t.output,v),{bytes:v.length,columns:n,frames:e.frames.length}}var eL=String.raw`
|
|
252
|
+
}`,$e={meshphysical_vert:yk,meshphysical_frag:Sk},ae={common:{diffuse:{value:new ft(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ce}},envmap:{envMap:{value:null},envMapRotation:{value:new Ce},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98},dfgLUT:{value:null}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ce}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ce}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ce},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ce},normalScale:{value:new mn(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ce},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ce}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ce}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ce}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new ft(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},sunLights:{value:[],properties:{direction:{},color:{}}},sunLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},sunShadowMatrix:{value:[]},sunShadowCascade:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null},probesSH:{value:[]},probesMin:{value:[]},probesMax:{value:[]},probesResolution:{value:[]}},points:{diffuse:{value:new ft(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0},uvTransform:{value:new Ce}},sprite:{diffuse:{value:new ft(16777215)},opacity:{value:1},center:{value:new mn(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ce},alphaMap:{value:null},alphaMapTransform:{value:new Ce},alphaTest:{value:0}}},VE={basic:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.fog])},lambert:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},envMapIntensity:{value:1}}])},phong:{uniforms:Nt([ae.common,ae.specularmap,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},specular:{value:new ft(1118481)},shininess:{value:30},envMapIntensity:{value:1}}])},standard:{uniforms:Nt([ae.common,ae.envmap,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.roughnessmap,ae.metalnessmap,ae.fog,ae.lights,{emissive:{value:new ft(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}])},toon:{uniforms:Nt([ae.common,ae.aomap,ae.lightmap,ae.emissivemap,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.gradientmap,ae.fog,ae.lights,{emissive:{value:new ft(0)}}])},matcap:{uniforms:Nt([ae.common,ae.bumpmap,ae.normalmap,ae.displacementmap,ae.fog,{matcap:{value:null}}])},points:{uniforms:Nt([ae.points,ae.fog])},dashed:{uniforms:Nt([ae.common,ae.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}])},depth:{uniforms:Nt([ae.common,ae.displacementmap])},normal:{uniforms:Nt([ae.common,ae.bumpmap,ae.normalmap,ae.displacementmap,{opacity:{value:1}}])},sprite:{uniforms:Nt([ae.sprite,ae.fog])},background:{uniforms:{uvTransform:{value:new Ce}}},backgroundCube:{uniforms:{backgroundRotation:{value:new Ce}}},distance:{uniforms:Nt([ae.common,ae.displacementmap,{referencePosition:{value:new qe},nearDistance:{value:1},farDistance:{value:1e3}}])},shadow:{uniforms:Nt([ae.lights,ae.fog,{color:{value:new ft(0)},opacity:{value:1}}])}};VE.physical={uniforms:Nt([VE.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ce},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ce},clearcoatNormalScale:{value:new mn(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ce},diffuseRoughness:{value:0},diffuseRoughnessMap:{value:null},diffuseRoughnessMapTransform:{value:new Ce},dispersion:{value:0},retroreflectivity:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ce},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ce},sheen:{value:0},sheenColor:{value:new ft(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ce},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ce},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ce},transmissionSamplerSize:{value:new mn},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ce},attenuationDistance:{value:0},attenuationColor:{value:new ft(0)},specularColor:{value:new ft(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ce},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ce},anisotropyVector:{value:new mn},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ce}}]),vertexShader:$e.meshphysical_vert,fragmentShader:$e.meshphysical_frag};var Ik=new Ce;Ik.set(-1,0,0,0,1,0,0,0,1);var Ck=new Ce;Ck.set(-1,0,0,0,1,0,0,0,1);var Pk=t=>{let e=t.toLowerCase();if(e==="left")return t==="LEFT"?"RIGHT":"Right";if(e==="right")return t==="RIGHT"?"LEFT":"Left"};function jE(t){let e=t.replace(/left|right/giu,i=>Pk(i)??i);if(e!==t)return e;let r=t.replace(/(^|[._\s-])([lrLR])(?=$|[._\s-]|\d)/gu,(i,n,s)=>`${n}${s==="L"?"R":s==="R"?"L":s==="l"?"r":"l"}`);return r===t?void 0:r}function GE(t,e){let r=[],i=[];return t.forEach((n,s)=>{let o=e(n);o!==void 0&&(r.push(s),i.push(o));}),{source:r,times:i}}function HE(t,e){let r=new qe(t[0]??0,t[1]??0,t[2]??0).applyQuaternion(new Pt(e[0]??0,e[1]??0,e[2]??0,e[3]??1).invert());return [r.x,r.y,r.z]}var Nk=()=>new Jt().registerExtensions(Qt);function gn(t,e,r){let{times:i,values:n}=t,s=i.length,o=t.interpolation==="CUBICSPLINE",a=o?e*3:e,c=(_,y)=>n[_*a+(o?e:0)+y]??0,l=i[0]??0,u=i[s-1]??l,d=_=>Array.from({length:e},(y,R)=>c(_,R));if(s===0)return new Array(e).fill(0);if(r<=l)return d(0);if(r>=u)return d(s-1);let f=1;for(;f<s&&(i[f]??0)<r;)f+=1;let p=f-1,g=i[p]??0,m=i[f]??g,S=d(p);if(t.interpolation==="STEP"||m-g<=1e-9)return S;let h=(r-g)/(m-g),v=d(f);return S.map((_,y)=>_+((v[y]??0)-_)*h)}function Ok(t,e,r){let i=e.get(t.getName()),n=[...t.getTranslation()],s=[...t.getRotation()],o=[...t.getScale()],a=i?.get("translation");a!==void 0&&n.splice(0,3,...gn(a,3,r));let c=i?.get("rotation");c!==void 0&&s.splice(0,4,...gn(c,4,r));let l=i?.get("scale");return l!==void 0&&o.splice(0,3,...gn(l,3,r)),{matrix:new nn().compose(new qe(n[0]??0,n[1]??0,n[2]??0),new Pt(s[0]??0,s[1]??0,s[2]??0,s[3]??1),new qe(o[0]??1,o[1]??1,o[2]??1)),translation:n}}function qE(t,e){let r=0;for(let i of e.get(t.getName())?.values()??[])r=Math.max(r,i.times.at(-1)??0);for(let i of t.listChildren())r=Math.max(r,qE(i,e));return r}async function jh(t,e,r=30){return v0(await Nk().read(t),e,r)}function v0(t,e,r=30){let i=t.getRoot().listAnimations().find(p=>p.getName()===e);if(i===void 0){let p=t.getRoot().listAnimations().map(g=>g.getName());throw new Error(`The GLB has no clip '${e}'. It carries: ${p.length===0?"none":p.join(", ")}.`)}let n=new Map;for(let p of i.listChannels()){let g=p.getTargetNode(),m=p.getSampler(),S=p.getTargetPath();if(g===null||m===null||S===null)continue;let h=m.getInput()?.getArray(),v=m.getOutput()?.getArray();if(h==null||v===null||v===void 0)continue;let _=n.get(g.getName())??new Map;_.set(S,{interpolation:m.getInterpolation(),times:h,values:v}),n.set(g.getName(),_);}let s=t.getRoot().listScenes().flatMap(p=>p.listChildren()),o=s.reduce((p,g)=>Math.max(p,qE(g,n)),0),a=t.getRoot().listSkins().flatMap(p=>p.listJoints()).map(p=>p.getName()),c=new Set(a.length>0?a:t.getRoot().listNodes().map(p=>p.getName()).filter(p=>p.length>0)),l=[...c],u={},d=Math.max(1,Math.round(o*r)),f=[];for(let p=0;p<=d;p+=1){let g=Math.min(o,p/r),m={},S={},h={},v=(_,y,R)=>{let T=y.clone().multiply(Ok(_,n,g).matrix),b=_.getName();if(c.has(b)){let E=new qe().setFromMatrixPosition(T),M=new Pt().setFromRotationMatrix(T),N=new Pt().setFromRotationMatrix(y);m[b]=[E.x,E.y,E.z],S[b]=[M.x,M.y,M.z,M.w],h[b]=[N.x,N.y,N.z,N.w],R!==void 0&&c.has(R)&&(u[b]=R);}for(let E of _.listChildren())v(E,T,b);};for(let _ of s)v(_,new nn);f.push({parents:h,positions:m,rotations:S,time:g});}return {bones:l,duration:o,fps:r,frames:f,parentsOf:u}}var zk=()=>new Jt().registerExtensions(Qt),Gh=t=>t==="rotation"?4:3;function xi(t){let e=t.getSampler(),r=e?.getInput()?.getArray(),i=e?.getOutput()?.getArray();if(!(e===null||r===null||r===void 0||i===null||i===void 0))return {interpolation:e.getInterpolation(),times:r,values:i}}function Fa(t,e,r,i,n){let s=e.getSampler();if(s===null)return;let o=t.getRoot().listBuffers()[0]??t.createBuffer(),a=t.createAccessor(`${e.getTargetNode()?.getName()}.time`).setType("SCALAR").setArray(new Float32Array(r)).setBuffer(o),c=t.createAccessor(`${e.getTargetNode()?.getName()}.${e.getTargetPath()}`).setType(n===4?"VEC4":"VEC3").setArray(new Float32Array(i)).setBuffer(o);s.setInput(a).setOutput(c).setInterpolation("LINEAR");}function WE(t,e,r,i){for(let n of e.listChannels()){let s=xi(n);if(s===void 0)continue;let o=n.getTargetPath()??"translation",a=Gh(o),c=s.interpolation==="CUBICSPLINE",l=c?a*3:a,{source:u,times:d}=GE([...s.times],r);if(d.length===0)throw new Error(`'${e.getName()}' keeps no keyframes in that window; the edit would leave an empty clip.`);let f=[];for(let p of u)for(let g=0;g<l;g+=1)f.push(s.values[p*l+g]??0);if(i!==void 0){let p=gn(s,a,0),g=i,m=d.findIndex(v=>v>g),S=m===-1?d.length:m;d.splice(S,0,g);let h=c?Array.from({length:3*a},(v,_)=>_>=a&&_<a*2?p[_-a]??0:0):p;f.splice(S*l,0,...h);}Fa(t,n,d,f,a),c?n.getSampler()?.setInterpolation("CUBICSPLINE"):s.interpolation==="STEP"&&n.getSampler()?.setInterpolation("STEP");}}function $k(t){let e=0;for(let r of t.listChannels())e=Math.max(e,xi(r)?.times.at(-1)??0);return e}function Dk(t,e,r,i){for(let n of e.listChannels()){let s=xi(n);if(s===void 0)continue;let o=Gh(n.getTargetPath()??"translation"),a=s.interpolation==="CUBICSPLINE",c=a?o*3:o,u=[...gn(s,o,r),...a?new Array(o).fill(0):[]],d=[...gn(s,o,i),...a?new Array(o).fill(0):[]],f=[0],p=[...u];for(let g=0;g<s.times.length;g+=1){let m=s.times[g]??0;if(!(m<=r||m>=i)){f.push(m-r);for(let S=0;S<c;S+=1)p.push(s.values[g*c+S]??0);}}f.push(i-r),p.push(...d),Fa(t,n,f,p,o),a&&n.getSampler()?.setInterpolation("CUBICSPLINE");}}function Lk(t,e,r){let i=e.listChannels(),n=0;for(let a of i){let c=xi(a);c!==void 0&&(n=Math.max(n,c.times.at(-1)??0));}let s=Math.max(1,Math.round(n*r)),o=Array.from({length:s+1},(a,c)=>Math.min(n,c/r));for(let a of i){let c=xi(a);if(c===void 0)continue;let l=Gh(a.getTargetPath()??"translation"),u=o.flatMap(d=>gn(c,l,d));Fa(t,a,o,u,l);}}function kk(t,e){let r=new Map(t.getRoot().listNodes().map(i=>[i.getName(),i]));for(let i of e.listChannels()){let n=i.getTargetNode(),s=xi(i);if(n===null||s===void 0)continue;let o=i.getTargetPath()??"translation",a=Gh(o),c=[];for(let d=0;d+a<=s.values.length;d+=a){let f=Array.from({length:a},(p,g)=>s.values[d+g]??0);o==="translation"&&(f[0]=-(f[0]??0)),o==="rotation"&&(f[1]=-(f[1]??0),f[2]=-(f[2]??0)),c.push(...f);}Fa(t,i,[...s.times],c,a);let l=jE(n.getName()),u=l===void 0?void 0:r.get(l);u!==void 0&&i.setTargetNode(u);}}function Uk(t,e,r){let i=v0(t,e.getName()),n=r.feet.length>0?r.feet:i.bones.filter(s=>/foot/iu.test(s));if(n.length===0)throw new Error("No foot bones to lock: name them with 'feet'.");for(let s of n){let o=i.frames.map(g=>g.positions[s]?.[1]??0),a=Math.min(...o),c=e.listChannels().find(g=>g.getTargetNode()?.getName()===s&&g.getTargetPath()==="translation");if(c===void 0)continue;let l=xi(c);if(l===void 0)continue;let u=[],d=[],f,p=false;i.frames.forEach((g,m)=>{let S=g.positions[s];if(S===void 0)return;(S[1]??0)<=a+r.contact?(f??=S,p=true):(p=false,f=void 0);let v=p&&f!==void 0?[(f[0]??0)-(S[0]??0),0,(f[2]??0)-(S[2]??0)]:[0,0,0],_=HE(v,g.parents[s]??[0,0,0,1]);u.push(g.time),d.push((gn(l,3,g.time)[0]??0)+_[0],(gn(l,3,g.time)[1]??0)+_[1],(gn(l,3,g.time)[2]??0)+_[2]);}),Fa(t,c,u,d,3);}}function Fk(t,e,r){switch(r.kind){case "trim":{if(r.end<=r.start)throw new Error("trim needs an end after its start.");let i=$k(e);if(r.start>=i||r.end>i+1e-6)throw new Error(`trim asks for ${r.start}\u2013${r.end}s but '${e.getName()}' is ${i}s long.`);Dk(t,e,r.start,r.end);return}case "retime":if(!(r.speed>0))throw new Error("retime needs a speed above zero.");WE(t,e,i=>i/r.speed);return;case "loop-point":WE(t,e,i=>i<=r.time?i:void 0,r.time);return;case "resample":if(!(r.fps>0))throw new Error("resample needs an fps above zero.");Lk(t,e,r.fps);return;case "mirror":kk(t,e);return;case "foot-lock":Uk(t,e,r);return}}function KE(t,e,r){let i=t.getRoot().listAnimations().filter(n=>n.getName()===e);if(i.length===0)throw new Error(`The GLB has no clip '${e}' to edit.`);for(let n of r)for(let s of i)Fk(t,s,n);}async function ZE(t){return zk().read(t)}function Bk(t){let e=new Map;for(let r of t)r.op==="modify"&&e.set(r.clip,[...e.get(r.clip)??[],r.edit]);return e}async function XE(t,e){let r=await ZE(t.host),i=t.ops.some(o=>o.op==="attach")?await Iy(r,t):void 0,n=Bk(t.ops);for(let[o,a]of n)KE(r,o,a);return await new Jt().registerExtensions(Qt).write(e,r),{clips:i?.clips??[],edits:[...n.values()].reduce((o,a)=>o+a.length,0),file:e,modified:[...n.keys()]}}var ks=Object.freeze({contact:.03,jitter:.05,penetration:.01,seam:5,skate:.02,stretch:.02}),y0=(t,e)=>Math.hypot((t[0]??0)-(e[0]??0),(t[1]??0)-(e[1]??0),(t[2]??0)-(e[2]??0)),Vk=(t,e)=>Math.hypot((t[0]??0)-(e[0]??0),(t[2]??0)-(e[2]??0));function jk(t,e){let r=n=>Math.hypot(n[0]??0,n[1]??0,n[2]??0,n[3]??1)||1,i=((t[0]??0)*(e[0]??0)+(t[1]??0)*(e[1]??0)+(t[2]??0)*(e[2]??0)+(t[3]??1)*(e[3]??1))/(r(t)*r(e));return 2*Math.acos(Math.min(1,Math.abs(i)))*180/Math.PI}function S0(t,e=2){let r=[],i,n;for(let s of t)(i===void 0||n===void 0||s-n>e)&&(i!==void 0&&n!==void 0&&r.push({from:i,to:n}),i=s),n=s;return i!==void 0&&n!==void 0&&r.push({from:i,to:n}),r}function Gk(t,e,r,i){let n=[];for(let s of e){let o=t.frames.map(p=>p.positions[s]?.[1]??0),a=Math.min(...o),c=t.frames.map((p,g)=>({index:g,frame:p})).filter(({frame:p})=>(p.positions[s]?.[1]??0)<=a+i),l,u,d=()=>{u!==void 0&&(u.worst>r&&n.push({bone:s,detail:`the planted foot slid ${(u.worst*1e3).toFixed(0)} mm between frames ${u.first} and ${u.last}`,fromFrame:u.first,fromTime:t.frames[u.first]?.time??0,kind:"foot-skate",limit:r,measured:u.worst,toFrame:u.last,toTime:t.frames[u.last]?.time??0}),u=void 0,l=void 0);},f;for(let{index:p,frame:g}of c){f!==void 0&&p-f>1&&d(),l??=g;let m=Vk(g.positions[s]??[0,0,0],l.positions[s]??[0,0,0]);u??={first:p,last:p,worst:0},u.last=p,u.worst=Math.max(u.worst,m),f=p;}d();}return n}function Hk(t,e,r){let i=[];for(let n of e){let s=t.frames.map((o,a)=>({index:a,y:o.positions[n]?.[1]})).filter(({y:o})=>o!==void 0&&o<-r);for(let o of S0(s.map(({index:a})=>a))){let a=s.filter(({index:c})=>c>=o.from&&c<=o.to).reduce((c,{y:l})=>Math.min(c,l??0),0);i.push({bone:n,detail:`reaches ${(Math.abs(a)*1e3).toFixed(0)} mm below the floor`,fromFrame:o.from,fromTime:t.frames[o.from]?.time??0,kind:"ground-penetration",limit:r,measured:Math.abs(a),toFrame:o.to,toTime:t.frames[o.to]?.time??0});}}return i}function qk(t,e){let r=t.frames[0],i=t.frames.at(-1);if(r===void 0||i===void 0||t.frames.length<3)return [];let n,s=0;for(let o of t.bones){let a=r.rotations[o],c=i.rotations[o];if(a===void 0||c===void 0)continue;let l=jk(a,c);l<=e||(s+=1,(n===void 0||l>n.angle)&&(n={angle:l,bone:o}));}return n===void 0?[]:[{bone:n.bone,detail:`the clip ends ${n.angle.toFixed(1)}\xB0 from where it started${s>1?`, and ${s-1} more bones with it`:""}`,fromFrame:0,fromTime:r.time,kind:"loop-seam",limit:e,measured:n.angle,toFrame:t.frames.length-1,toTime:i.time}]}function Wk(t,e,r){let i=[];for(let n of e){let s=t.frames.map(l=>l.positions[n]),o=[],a=new Map,c=0;for(let l=1;l<s.length-1;l+=1){let u=s[l-1],d=s[l],f=s[l+1];if(u===void 0||d===void 0||f===void 0)continue;let p=y0([2*(d[0]??0)-(u[0]??0),2*(d[1]??0)-(u[1]??0),2*(d[2]??0)-(u[2]??0)],[f[0]??0,f[1]??0,f[2]??0]);p>r&&(o.push(l),a.set(l,Math.max(a.get(l)??0,p)),c=Math.max(c,p));}for(let l of S0(o.map(u=>u)))i.push({bone:n,detail:`a frame-direction spike of ${((a.get(l.from)??c)*1e3).toFixed(0)} mm`,fromFrame:l.from,fromTime:t.frames[l.from]?.time??0,kind:"jitter",limit:r,measured:c,toFrame:l.to,toTime:t.frames[l.to]?.time??0});}return i}function Kk(t,e){let r=t.frames[0];if(r===void 0)return [];let i=[];for(let[n,s]of Object.entries(t.parentsOf)){let o=y0(r.positions[n]??[0,0,0],r.positions[s]??[0,0,0]);if(o<=1e-6)continue;let a=t.frames.map((l,u)=>({index:u,ratio:Math.abs(y0(l.positions[n]??[0,0,0],l.positions[s]??[0,0,0])/o-1)})).filter(({ratio:l})=>l>e);if(a.length===0)continue;let c=a.reduce((l,{ratio:u})=>Math.max(l,u),0);for(let l of S0(a.map(({index:u})=>u)))i.push({bone:n,detail:`distance to its parent '${s}' changes by ${(c*100).toFixed(1)}%`,fromFrame:l.from,fromTime:t.frames[l.from]?.time??0,kind:"bone-stretch",limit:e,measured:c,toFrame:l.to,toTime:t.frames[l.to]?.time??0});}return i}var Zk=new Set(["left-foot","right-foot"]);async function JE(t,e,r={}){let i=r.scale??1,n={contact:(r.thresholds?.contact??ks.contact)/i,jitter:(r.thresholds?.jitter??ks.jitter)/i,penetration:(r.thresholds?.penetration??ks.penetration)/i,seam:r.thresholds?.seam??ks.seam,skate:(r.thresholds?.skate??ks.skate)/i,stretch:r.thresholds?.stretch??ks.stretch},s=await jh(t,e,r.fps??30),o=Sh(s.bones).filter(c=>Zk.has(c.id)).map(c=>c.node),a=[...Gk(s,o,n.skate,n.contact),...Hk(s,s.bones,n.penetration),...qk(s,n.seam),...Wk(s,s.bones,n.jitter),...Kk(s,n.stretch)];return {bones:s.bones.length,clip:e,defects:a,duration:s.duration,file:t,fps:s.fps,frames:s.frames.length,passed:a.length===0,scale:i,thresholds:n}}var Jk=(()=>{let t=new Uint32Array(256);for(let e=0;e<256;e+=1){let r=e;for(let i=0;i<8;i+=1)r=r&1?3988292384^r>>>1:r>>>1;t[e]=r>>>0;}return t})();function Yk(t){let e=4294967295;for(let r of t)e=(Jk[(e^r)&255]??0)^e>>>8;return (e^4294967295)>>>0}function x0(t,e){let r=Buffer.alloc(4);r.writeUInt32BE(e.length,0);let i=Buffer.concat([Buffer.from(t,"ascii"),Buffer.from(e)]),n=Buffer.alloc(4);return n.writeUInt32BE(Yk(i),0),Buffer.concat([r,i,n])}function YE(t,e,r){let i=Buffer.alloc(13);i.writeUInt32BE(t,0),i.writeUInt32BE(e,4),i[8]=8,i[9]=6,i[10]=0,i[11]=0,i[12]=0;let n=t*4,s=Buffer.alloc((n+1)*e);for(let o=0;o<e;o+=1)s[o*(n+1)]=0,Buffer.from(r.buffer,r.byteOffset+o*n,n).copy(s,o*(n+1)+1);return Buffer.concat([Buffer.from([137,80,78,71,13,10,26,10]),x0("IHDR",i),x0("IDAT",deflateSync(s,{level:9})),x0("IEND",new Uint8Array)])}var b0=[9,13,11],tU=[183,243,74],nU=[39,48,44];function ew(t,e,r,i){let[n,s]=e,[o,a]=r,c=Math.max(1,Math.ceil(Math.max(Math.abs(o-n),Math.abs(a-s))));for(let l=0;l<=c;l+=1){let u=Math.round(n+(o-n)*l/c),d=Math.round(s+(a-s)*l/c);if(u<0||d<0||u>=t.width||d>=t.height)continue;let f=t.width*d+u<<2;t.data[f]=i[0]??0,t.data[f+1]=i[1]??0,t.data[f+2]=i[2]??0,t.data[f+3]=255;}}async function tw(t){let e=await jh(t.file,t.clip,t.fps??30),r=Math.max(1,t.columns??6),i=Math.max(48,t.height??160),n=Math.min(r,e.frames.length),s=Math.max(1,Math.floor((e.frames.length-1)/Math.max(1,n-1))),o=Array.from({length:n},(_,y)=>Math.min(e.frames.length-1,y*s)),a={data:new Uint8Array(i*n*i*4),height:i,width:i*n};for(let _=0;_<a.width*a.height;_+=1){let y=_<<2;a.data[y]=b0[0],a.data[y+1]=b0[1],a.data[y+2]=b0[2],a.data[y+3]=255;}let c=o.flatMap(_=>e.bones.map(y=>e.frames[_]?.positions[y]).filter(y=>y!==void 0)),l=c.map(_=>_[0]),u=c.map(_=>_[1]),d=Math.min(...l,0),f=Math.max(...l,1),p=Math.min(...u,0),g=Math.max(...u,1),m=Math.max(1e-6,Math.max(f-d,g-p)),S=i*.12,h=(_,y,R)=>[Math.round(R*i+S+(_-d)/m*(i-S*2)),Math.round(i-S-(y-p)/m*(i-S*2))];o.forEach((_,y)=>{let R=e.frames[_];if(R!==void 0){ew(a,h(d,p,y),h(f,p,y),nU);for(let T of e.bones){let b=R.positions[T];b!==void 0&&ew(a,h(b[0],0,y),h(b[0],b[1],y),tU);}}});let v=YE(a.width,a.height,a.data);return await mkdir(Gr.dirname(Gr.resolve(t.output)),{recursive:true}),await writeFile(t.output,v),{bytes:v.length,columns:n,frames:e.frames.length}}var rU=String.raw`
|
|
245
253
|
:root{color-scheme:dark;font-family:"IBM Plex Mono","Azeret Mono",ui-monospace,monospace;background:#080b0a;color:#dce4de;--line:#27302c;--line2:#38433e;--panel:#111613;--panel2:#171d1a;--acid:#b7f34a;--cyan:#68d9d0;--muted:#77837c;--red:#ff705d}*{box-sizing:border-box}body{margin:0;overflow:hidden;background:#080b0a}button{cursor:pointer}.lab{height:100vh;display:grid;grid-template-rows:50px 1fr 26px}.bar{display:flex;align-items:center;gap:14px;padding:0 14px;border-bottom:1px solid var(--line);background:#0d120f}.brand{font:800 13px sans-serif;letter-spacing:.18em}.brand b{display:inline-grid;place-items:center;width:24px;height:24px;margin-right:9px;background:var(--acid);color:#101808}.bar small,.status{color:var(--muted)}.grow{flex:1}.bar button{border:1px solid #789e3f;border-radius:2px;background:var(--acid);color:#111908;padding:8px 14px;font:800 10px inherit}.body{min-height:0;display:grid;grid-template-columns:230px minmax(0,1fr) 285px}.side{overflow:auto;background:var(--panel)}.left{border-right:1px solid var(--line)}.right{border-left:1px solid var(--line)}.section{padding:13px;border-bottom:1px solid var(--line)}h2{margin:0 0 10px;color:var(--muted);font-size:9px;letter-spacing:.16em;text-transform:uppercase}label{display:grid;gap:5px;margin-bottom:10px;color:#91a097;font-size:9px;text-transform:uppercase}select,input{width:100%;border:1px solid var(--line);border-radius:2px;background:#090d0b;color:#dce4de;padding:8px;font:10px inherit;outline:none}select:focus,input:focus{border-color:var(--acid)}input:disabled{opacity:.38}.workspace{min-width:0;min-height:0;display:grid;grid-template-rows:minmax(280px,1fr) 224px;background:#090d0b}.viewport{position:relative;min-width:0;min-height:0}.viewport canvas{display:block;width:100%;height:100%}.title{position:absolute;top:18px;left:18px;pointer-events:none;font:800 23px sans-serif}.title small{display:block;margin-top:6px;color:var(--acid);font:9px ui-monospace;letter-spacing:.14em}.tools{position:absolute;bottom:16px;left:50%;display:flex;transform:translateX(-50%);border:1px solid var(--line2);background:#090d0be8}.tools button,.preset button{border:0;background:none;color:var(--muted);padding:9px 15px;font:9px inherit;text-transform:uppercase}.tools button.on{background:#263328;color:var(--acid)}.tools button:disabled{opacity:.28;cursor:not-allowed}.release-note{position:absolute;top:18px;right:18px;padding:7px 10px;border:1px solid #8b493d;background:#2b1713d9;color:#ff9b86;font-size:9px;letter-spacing:.13em}.landmarks{display:grid;gap:5px}.landmark{display:grid;grid-template-columns:8px 1fr auto;gap:8px;align-items:center;width:100%;padding:8px;border:1px solid transparent;border-radius:2px;background:#0c110f;color:var(--muted);font:10px inherit;text-align:left}.landmark.on{border-color:#668c34;color:#dce4de}.landmark i{width:6px;height:6px;border-radius:50%;background:#71b9ff}.landmark.detected i{background:var(--acid)}.landmark small{font-size:8px;color:#69756f}.axis{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.axis label{margin:0}.preset{display:grid;grid-template-columns:repeat(4,1fr);margin-top:8px}.preset button{padding:7px 2px;border:1px solid var(--line)}.wide,.editor-bar button,.segmented button{border:1px solid var(--line2);border-radius:2px;background:#1a211d;color:#dce4de;padding:8px;font:10px inherit}.wide{width:100%}.secondary{color:var(--muted)!important;background:#0d1210!important}.segmented{display:grid;grid-template-columns:1fr 1fr;gap:3px}.segmented button.on{border-color:var(--acid);color:var(--acid);background:#243021}.segmented button.danger.on{border-color:var(--red);color:#ff9b86;background:#321a16}.hint{margin:8px 0 0;color:var(--muted);font-size:9px;line-height:1.5}.status{display:flex;justify-content:space-between;align-items:center;padding:0 12px;border-top:1px solid var(--line);font-size:9px}.status b{color:var(--acid)}.error{position:absolute;top:18px;right:18px;max-width:360px;padding:10px;border:1px solid #81452f;background:#321a12;color:#ffb08a;font-size:10px}.saved{color:var(--acid);font-size:9px}.dope-editor{min-width:0;border-top:1px solid #46504b;background:#101512;box-shadow:0 -12px 30px #0008}.editor-bar{height:44px;display:flex;align-items:center;gap:7px;padding:6px 9px;border-bottom:1px solid var(--line2);background:#171c19}.editor-bar select{width:180px;padding:7px}.editor-bar button{white-space:nowrap;padding:7px 10px}.editor-bar button:disabled{opacity:.3;cursor:not-allowed}.editor-bar .transport{width:34px;border-color:#738d47;color:var(--acid);font-size:13px}.timecode{min-width:90px;color:#e1e7e3;font-size:11px;letter-spacing:.08em}.timecode i{color:var(--muted);font-style:normal}.compact{display:flex}.sheet{position:relative;height:179px;display:grid;grid-template-columns:132px 1fr;grid-template-rows:27px repeat(4,38px);overflow:hidden;background:repeating-linear-gradient(90deg,transparent 0,transparent calc(10% - 1px),#252d29 calc(10% - 1px),#252d29 10%)}.ruler-label{grid-column:1;grid-row:1}.ruler{position:relative;grid-column:2;grid-row:1;border-bottom:1px solid var(--line2);background:#0c100e}.ruler span{position:absolute;bottom:5px;transform:translateX(-50%);color:#68736d;font-size:8px}.lane-row{display:contents}.lane-label{z-index:3;display:flex;align-items:center;gap:8px;padding-left:13px;border-right:1px solid var(--line2);border-bottom:1px solid #222a26;background:#151a17;color:#87938c;font-size:9px;letter-spacing:.1em}.lane-label i{width:6px;height:6px;border:1px solid var(--cyan);transform:rotate(45deg)}.lane-track{position:relative;border-bottom:1px solid #222a26;background:#0d120f66}.key-diamond{position:absolute;z-index:4;top:14px;width:10px;height:10px;padding:0;transform:translate(-50%,-50%) rotate(45deg);border:1px solid #e2ffae;background:var(--acid);box-shadow:0 0 0 2px #0a0e0c}.attachment-lane .lane-label{grid-column:1;grid-row:5}.event-clip{align-self:center;grid-column:2;grid-row:5;height:23px;margin:0 8px;padding:6px 10px;border-left:3px solid var(--cyan);background:#17312d;color:#8ce7df;font-size:9px;letter-spacing:.08em}.event-clip.released{border-left-color:var(--red);background:#321a16;color:#ff9b86}.playhead{position:absolute;z-index:6;top:0;bottom:0;width:1px;background:#f3f7f4;pointer-events:none}.playhead b{position:absolute;top:0;left:-4px;width:9px;height:9px;background:#f3f7f4;clip-path:polygon(0 0,100% 0,50% 100%)}.scrubber{position:absolute;z-index:7;top:0;right:0;bottom:0;left:132px;width:calc(100% - 132px);height:100%;margin:0;padding:0;opacity:0;cursor:ew-resize}.ruler{grid-column:2;grid-row:1}.lane-row:nth-of-type(1) .lane-label,.lane-row:nth-of-type(1) .lane-track{grid-row:2}.lane-row:nth-of-type(2) .lane-label,.lane-row:nth-of-type(2) .lane-track{grid-row:3}.lane-row:nth-of-type(3) .lane-label,.lane-row:nth-of-type(3) .lane-track{grid-row:4}.lane-row .lane-label{grid-column:1}.lane-row .lane-track{grid-column:2}@media(max-width:980px){.body{grid-template-columns:210px 1fr}.right{display:none}.workspace{grid-template-rows:minmax(260px,1fr) 224px}.compact{display:none}}
|
|
246
|
-
`;function
|
|
247
|
-
`,"utf8"),Rn(o,200,{path:c,saved:!0}))}}return Rn(o,404,{error:"Not found."})}catch(a){return Rn(o,500,{error:a instanceof Error?a.message:String(a)})}});await new Promise((s,o)=>{i.once("error",o),i.listen(r,"127.0.0.1",s);});let n=i.address();return {port:typeof n=="object"&&n!==null?n.port:r,close:()=>new Promise((s,o)=>i.close(a=>a?o(a):s()))}}var
|
|
254
|
+
`;function nw(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll('"',""")}function rw(t){return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>Pose Lab \u2014 ${nw(t)}</title><style>${rU}</style></head><body><div id="root" data-project="${nw(t)}"></div><script type="module" src="/app.js"></script></body></html>`}var aU=new URL("./client/app.js",import.meta.url),cU=256e3;function iw(t,e){if(e.length===0||Gr.isAbsolute(e)||e.split(/[\\/]/u).some(n=>n.length===0||n.startsWith(".")))return;let r=Gr.resolve(t),i=Gr.resolve(r,e);return i.startsWith(`${r}${Gr.sep}`)?i:void 0}async function lU(t){let e=[],r=new Set([".git","build","dist","node_modules"]),i=async(n,s,o)=>{if(o>6||e.length>=2e3)return;let a=await readdir(n,{withFileTypes:true}).catch(()=>[]);for(let c of a){if(c.name.startsWith(".")||r.has(c.name))continue;let l=s.length===0?c.name:`${s}/${c.name}`;c.isDirectory()?await i(Gr.join(n,c.name),l,o+1):c.name.toLowerCase().endsWith(".glb")&&e.push(l);}};return await i(t,"",0),e.sort((n,s)=>n.localeCompare(s))}async function uU(t){let e=[],r=0;for await(let i of t){let n=Buffer.from(i);if(r+=n.length,r>cU)throw new Error("Request exceeds 256 KB.");e.push(n);}return JSON.parse(Buffer.concat(e).toString("utf8"))}function Hh(t,e,r,i){t.writeHead(e,{"cache-control":"no-store","content-type":i,"x-content-type-options":"nosniff"}),t.end(r);}function Rn(t,e,r){Hh(t,e,JSON.stringify(r),"application/json; charset=utf-8");}async function ow(t={}){let e=Gr.resolve(t.project??process.cwd()),r=t.port??4192;await readdir(e).catch(()=>{throw new Error(`Project directory does not exist: ${e}`)});let i=createServer(async(s,o)=>{try{let a=new URL(s.url??"/","http://pose-lab");if(s.method==="GET"&&(a.pathname==="/"||a.pathname==="/pose"))return Hh(o,200,rw(Gr.basename(e)),"text/html; charset=utf-8");if(s.method==="GET"&&a.pathname==="/app.js")return Hh(o,200,await readFile(aU),"text/javascript; charset=utf-8");if(s.method==="GET"&&a.pathname==="/favicon.ico")return o.writeHead(204),o.end();if(s.method==="GET"&&a.pathname==="/api/models")return Rn(o,200,{models:await lU(e)});if(s.method==="GET"&&a.pathname==="/api/model"){let c=a.searchParams.get("path")??"",l=c.endsWith(".glb")?iw(e,c):void 0;if(l===void 0)return Rn(o,404,{error:"GLB not found."});let u=await readFile(l).catch(()=>{});return u===void 0?Rn(o,404,{error:"GLB not found."}):Hh(o,200,u,"model/gltf-binary")}if(a.pathname==="/api/recipe"){let c=a.searchParams.get("path")??"",l=c.endsWith(".json")?iw(e,c):void 0;if(l===void 0)return Rn(o,404,{error:"Recipe not found."});if(s.method==="GET"){let u=await readFile(l,"utf8").catch(()=>{});return u===void 0?Rn(o,404,{error:"Recipe not found."}):Rn(o,200,{recipe:JSON.parse(u),path:c})}if(s.method==="PUT"){let u=await uU(s);return typeof u.recipe!="object"||u.recipe===null?Rn(o,400,{error:"Body must contain a recipe object."}):(await mkdir(Gr.dirname(l),{recursive:!0}),await writeFile(l,`${JSON.stringify(u.recipe,null,2)}
|
|
255
|
+
`,"utf8"),Rn(o,200,{path:c,saved:!0}))}}return Rn(o,404,{error:"Not found."})}catch(a){return Rn(o,500,{error:a instanceof Error?a.message:String(a)})}});await new Promise((s,o)=>{i.once("error",o),i.listen(r,"127.0.0.1",s);});let n=i.address();return {port:typeof n=="object"&&n!==null?n.port:r,close:()=>new Promise((s,o)=>i.close(a=>a?o(a):s()))}}var fU=B.object({position:B.tuple([B.number(),B.number(),B.number()]),rotation:B.tuple([B.number(),B.number(),B.number()]),scale:B.tuple([B.number(),B.number(),B.number()])}),_w=B.enum(yh.map(t=>t.id)),pU=B.object({attachment:B.enum(["attached","detached"]).optional(),clip:B.string().min(1).max(200),time:B.number().min(0).max(600),transform:fU}),mU=B.object({file:B.string().min(1)}),cw=B.object({bones:B.array(B.string()),bytes:B.number(),clips:B.array(B.object({channels:B.number(),duration:B.number(),horizontalTravel:B.number(),inPlace:B.boolean(),name:B.string()})),extensionsUsed:B.array(B.string()),file:B.string(),generator:B.string(),inPlace:B.boolean(),landmarks:B.array(B.object({id:B.string(),label:B.string(),node:B.string(),source:B.enum(["detected","estimated"])})),meshes:B.number(),rootBone:B.string().nullable(),skins:B.number(),warnings:B.array(B.string())}),lw=B.object({anchor:_w.default("right-hand"),attached:B.string().min(1).optional(),bone:B.string().min(1).optional(),host:B.string().min(1).optional(),keys:B.array(pU).max(2e3).optional(),log:B.string().min(1).optional(),output:B.string().min(1).optional(),recipe:B.string().min(1).optional()}),uw=B.object({anchor:B.string(),attached:B.string(),clips:B.array(B.string()),detached:B.array(B.string()),file:B.string(),log:B.string(),node:B.string()}),dw=B.object({clip:B.string().min(1).max(200),file:B.string().min(1),filmstrip:B.string().min(1).optional(),fps:B.number().int().min(1).max(240).default(30),scale:B.number().positive().default(1)}),hw=B.object({bones:B.number(),clip:B.string(),filmstrip:B.string().nullable(),defects:B.array(B.object({bone:B.string(),detail:B.string(),fromFrame:B.number(),fromTime:B.number(),kind:B.enum(["bone-stretch","foot-skate","ground-penetration","jitter","loop-seam"]),limit:B.number(),measured:B.number(),toFrame:B.number(),toTime:B.number()})),duration:B.number(),file:B.string(),fps:B.number(),frames:B.number(),passed:B.boolean(),scale:B.number(),thresholds:B.object({contact:B.number(),jitter:B.number(),penetration:B.number(),seam:B.number(),skate:B.number(),stretch:B.number()})}),gU=B.discriminatedUnion("kind",[B.object({end:B.number().min(0),kind:B.literal("trim"),start:B.number().min(0)}),B.object({kind:B.literal("retime"),speed:B.number().positive()}),B.object({kind:B.literal("loop-point"),time:B.number().min(0)}),B.object({fps:B.number().positive(),kind:B.literal("resample")}),B.object({kind:B.literal("mirror")}),B.object({contact:B.number().min(0).default(.03),feet:B.array(B.string().min(1)).max(8).default([]),kind:B.literal("foot-lock")})]),fw=B.object({clip:B.string().min(1).max(200),edits:B.array(gU).min(1).max(64),file:B.string().min(1),log:B.string().min(1).optional(),output:B.string().min(1).optional()}),pw=B.object({clips:B.array(B.string()),edits:B.number(),file:B.string(),log:B.string(),modified:B.array(B.string())}),R0=B.object({anchor:_w.default("right-hand"),attach:B.string().min(1).optional(),host:B.string().min(1).optional(),output:B.string().min(1).optional(),port:B.number().int().min(0).max(65535).optional(),project:B.string().min(1).optional()}),mw=B.object({port:B.number(),url:B.string()}),Ba=t=>({destructiveHint:false,idempotentHint:true,openWorldHint:false,readOnlyHint:t}),En=t=>[{type:"text",text:JSON.stringify(t)}];function _U(t,e,r){if(r!==void 0){let s=yh.find(o=>o.id===e);if(s===void 0)throw new Error(`Unknown anchor '${e}'.`);return {id:e,label:s.label,node:r,source:"detected"}}let i=t.find(s=>s.id===e);if(i!==void 0)return i;let n=t.map(s=>`${s.id} \u2192 ${s.node}`);throw new Error(`The host names no '${e}' landmark. It answers to: ${n.length===0?"none":n.join(", ")}. Pass 'bone' to name one directly.`)}function vU(t){return {position:t.position,rotation:t.rotation,scale:t.scale}}function vw(t){let e=Gr.parse(t);return Gr.join(e.dir,`${e.name}.anim.glb`)}async function yU(t){return t.filmstrip===void 0?null:(await tw({clip:t.clip,file:t.file,fps:t.fps,output:t.filmstrip}),Gr.resolve(t.filmstrip))}async function SU(t){let e=(t.keys??[]).map(s=>({attachment:s.attachment,clip:s.clip,op:"key",time:s.time,transform:vU(s.transform)})),r;if(t.recipe!==void 0){r=Ry(JSON.parse(await readFile(t.recipe,"utf8")));for(let s of e)r=Ey(r,s);}else {if(t.host===void 0||t.attached===void 0)throw new Error("Pass 'host' and 'attached', or a 'recipe' that names both.");let s=await Py(t.host);r={host:t.host,ops:[{anchor:_U(s.landmarks,t.anchor,t.bone),attached:t.attached,op:"attach"},...e],version:4};}let i=t.log??wy(r.host);return await My(i,r),{...await hE(r,t.output??vw(r.host)),log:Gr.resolve(i)}}var gw;function yw(t){return gw??=(async()=>{let e=await ow({...t.port===void 0?{}:{port:t.port},...t.project===void 0?{}:{project:t.project}}),r=new URLSearchParams;return t.host!==void 0&&r.set("host",t.host),t.attach!==void 0&&r.set("attach",t.attach),t.output!==void 0&&r.set("output",t.output),r.set("anchor",t.anchor),{port:e.port,url:`http://127.0.0.1:${e.port}/pose?${r.toString()}`}})(),gw}function xU(){let t=new Aa({name:"threenative-animation",version:"0.1.3"});return t.registerTool("animation_inspect",{annotations:Ba(true),description:"Inspect a local rigged GLB: bones, skeleton landmarks, clips with durations, root-motion travel and in-place detection, meshes, skins and extensions. Reads one local file and writes nothing.",inputSchema:mU,outputSchema:cw,title:"Inspect a rig and its clips"},async e=>{try{let r=cw.parse(await Py(e.file));return {content:En(r),structuredContent:r}}catch(r){return {content:En({message:r instanceof Error?r.message:String(r)}),isError:true}}}),t.registerTool("animation_attach",{annotations:Ba(false),description:"Attach a prop GLB to a bone, with per-clip keyed offsets, and bake it into an ordinary GLB beside the source. Writes the v4 op log (<model>.anim.json) next to the source GLB and the baked GLB; a version 3 pose recipe loads as the same ops and still bakes.",inputSchema:lw,outputSchema:uw,title:"Attach a prop to a bone and bake it"},async e=>{try{let r=uw.parse(await SU(lw.parse(e)));return {content:En(r),structuredContent:r}}catch(r){return {content:En({message:r instanceof Error?r.message:String(r)}),isError:true}}}),t.registerTool("animation_verify",{annotations:Ba(true),description:"Measure one clip for the defects a still frame cannot show: a planted foot that slides (2 cm), ground penetration (1 cm), a loop seam (5\xB0), a one-frame jitter spike, and bones whose length changes. Every defect names the bone and the frame range it spans. Thresholds are in metres; pass `scale` for a model that is not (Mixamo and Quaternius are centimetres: 0.01).",inputSchema:dw,outputSchema:hw,title:"Verify a clip's motion"},async e=>{try{let r=dw.parse(e),i=hw.parse({...await JE(r.file,r.clip,{fps:r.fps,scale:r.scale}),filmstrip:await yU(r)});return {content:En(i),structuredContent:i}}catch(r){return {content:En({message:r instanceof Error?r.message:String(r)}),isError:true}}}),t.registerTool("animation_modify",{annotations:Ba(false),description:"Edit one clip \u2014 trim, retime, move the loop point, resample, mirror, lock planted feet \u2014 writing each edit into the op log and rendering the result from the source GLB. Rendering twice from one log gives the same bytes, so the log is the change and the GLB is derived.",inputSchema:fw,outputSchema:pw,title:"Edit a clip and render it from the log"},async e=>{try{let r=fw.parse(e),i=r.log??wy(r.file),s=await lE(i).catch(async()=>({host:r.file,ops:[],version:4}));for(let c of r.edits)s=Ey(s,{clip:r.clip,edit:c,op:"modify"});await My(i,s);let o=await XE(s,r.output??vw(r.file)),a=pw.parse({...o,log:Gr.resolve(i)});return {content:En(a),structuredContent:a}}catch(r){return {content:En({message:r instanceof Error?r.message:String(r)}),isError:true}}}),t.registerTool("animation_open_view",{annotations:Ba(false),description:"Start the animation calibrator page on 127.0.0.1 and return its URL. A human drags the prop into place there; the same operations an agent calls are what the page records.",inputSchema:R0,outputSchema:mw,title:"Open the animation calibrator"},async e=>{try{let r=mw.parse(await yw(R0.parse(e)));return {content:En(r),structuredContent:r}}catch(r){return {content:En({message:r instanceof Error?r.message:String(r)}),isError:true}}}),t}function bU(){nR(()=>xU());}function TU(){let t=process.argv[1];if(t===void 0)return false;try{return realpathSync(t)===realpathSync(fileURLToPath(import.meta.url))}catch{return false}}TU()&&(process.argv[2]==="--view"?yw(R0.parse({project:process.cwd()})).then(({url:t})=>process.stdout.write(`Animation view: ${t}
|
|
248
256
|
`),t=>{process.stderr.write(`${t instanceof Error?t.message:String(t)}
|
|
249
|
-
`),process.exitCode=1;}):
|
|
257
|
+
`),process.exitCode=1;}):bU());/*! Bundled license information:
|
|
250
258
|
|
|
251
259
|
@modelcontextprotocol/server/dist/src-CX2iR2pK.mjs:
|
|
252
260
|
(*!
|
|
@@ -262,4 +270,4 @@ three/build/three.module.js:
|
|
|
262
270
|
* Copyright 2010-2026 Three.js Authors
|
|
263
271
|
* SPDX-License-Identifier: MIT
|
|
264
272
|
*)
|
|
265
|
-
*/export{
|
|
273
|
+
*/export{xU as createAnimationServer,bU as runServer};
|